From 3fbd67ab7f7e490196daa4169a4136064e9cdd3f Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Wed, 23 Aug 2023 13:22:55 +0200 Subject: [PATCH 001/845] Update releases.md --- docs/_pages/releases.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 282dcc6b0d..f680cccb69 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,6 +7,16 @@ sidebar: nav: "sidebar" --- +## 7.0 Alpha 1 + +### What's new + +### Fixes + +### Breaking Changes (for users) + +### Breaking Changes (for extensions) + ## 6.12.0 ### What's new From 315d5a75bd9d466589ade3a5d8812d3ab1bd69ba Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Wed, 23 Aug 2023 13:23:25 +0200 Subject: [PATCH 002/845] Update releases.md --- docs/_pages/releases.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index f680cccb69..11faf69f04 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -11,6 +11,8 @@ sidebar: ### What's new +### Improvements + ### Fixes ### Breaking Changes (for users) From 69f11ca7088e928ca355bf90c26e3c7f1bdf5c75 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Wed, 23 Aug 2023 20:00:10 +0200 Subject: [PATCH 003/845] Update GitVersion.yml --- GitVersion.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GitVersion.yml b/GitVersion.yml index 99fad930de..eb2338d698 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,4 +1,4 @@ -next-version: 6.0 +next-version: 7.0 branches: release: regex: releases?[/-] From 419139c28eab7b487d305dc7bd347780a8988e3b Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Wed, 23 Aug 2023 17:44:18 +0200 Subject: [PATCH 004/845] Qodana scan: Potentially misleading parameter name in lambda or local function --- Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs index f84c4b9e09..0e34dfd0e2 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs @@ -221,7 +221,7 @@ public object this[string key] ICollection IDictionary.Keys { - get { return Keys.Select(_ => _.ToString(CultureInfo.InvariantCulture)).ToList(); } + get { return Keys.Select(key => key.ToString(CultureInfo.InvariantCulture)).ToList(); } } ICollection IDictionary.Values => Values; From 3ea48a84cde1f63eb2805f0d4052e2a74fc1dae2 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Wed, 23 Aug 2023 17:46:00 +0200 Subject: [PATCH 005/845] Qodana scan: Use raw string: `DictionarySpecs` --- .../DictionarySpecs.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs index 0e34dfd0e2..a58657787e 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs @@ -1120,12 +1120,15 @@ public void When_a_dictionary_is_missing_a_key_it_should_report_the_specific_key public void When_a_nested_dictionary_value_doesnt_match_it_should_throw() { // Arrange - const string json = @"{ - ""NestedDictionary"": { - ""StringProperty"": ""string"", - ""IntProperty"": 123 + const string json = + """ + { + "NestedDictionary": { + "StringProperty": "string", + "IntProperty": 123 } - }"; + } + """; var expectedResult = new Dictionary { From 4b9b91b16663739f30c7490d048dce67cf128cee Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Wed, 23 Aug 2023 17:51:01 +0200 Subject: [PATCH 006/845] Qodana scan: Use raw string: `XElementAssertionSpecs` --- .../Xml/XElementAssertionSpecs.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Tests/FluentAssertions.Specs/Xml/XElementAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Xml/XElementAssertionSpecs.cs index 1937e36e64..c84f36c1ac 100644 --- a/Tests/FluentAssertions.Specs/Xml/XElementAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Xml/XElementAssertionSpecs.cs @@ -667,8 +667,8 @@ public void When_asserting_a_xml_element_is_not_equivalent_to_a_different_xml_element_with_same_contents_but_different_ns_prefixes_it_should_fail() { // Arrange - var theElement = XElement.Parse(@""); - var otherXElement = XElement.Parse(@""); + var theElement = XElement.Parse(""""""); + var otherXElement = XElement.Parse(""""""); // Act Action act = () => @@ -866,7 +866,7 @@ public void When_asserting_element_has_attribute_with_specific_value_and_it_does public void When_asserting_element_has_attribute_with_ns_and_specific_value_and_it_does_it_should_succeed() { // Arrange - var element = XElement.Parse(@""); + var element = XElement.Parse(""""""); // Act Action act = () => @@ -880,7 +880,7 @@ public void When_asserting_element_has_attribute_with_ns_and_specific_value_and_ public void When_asserting_element_has_attribute_with_specific_value_but_attribute_does_not_exist_it_should_fail() { // Arrange - var theElement = XElement.Parse(@""); + var theElement = XElement.Parse(""""""); // Act Action act = () => @@ -895,7 +895,7 @@ public void When_asserting_element_has_attribute_with_specific_value_but_attribu public void When_asserting_element_has_attribute_with_ns_and_specific_value_but_attribute_does_not_exist_it_should_fail() { // Arrange - var theElement = XElement.Parse(@""); + var theElement = XElement.Parse(""""""); // Act Action act = () => @@ -912,7 +912,7 @@ public void When_asserting_element_has_attribute_with_specific_value_but_attribute_does_not_exist_it_should_fail_with_descriptive_message() { // Arrange - var theElement = XElement.Parse(@""); + var theElement = XElement.Parse(""""""); // Act Action act = () => @@ -932,7 +932,7 @@ public void When_asserting_element_has_attribute_with_ns_and_specific_value_but_attribute_does_not_exist_it_should_fail_with_descriptive_message() { // Arrange - var theElement = XElement.Parse(@""); + var theElement = XElement.Parse(""""""); // Act Action act = () => @@ -950,7 +950,7 @@ public void public void When_asserting_element_has_attribute_with_specific_value_but_attribute_has_different_value_it_should_fail() { // Arrange - var theElement = XElement.Parse(@""); + var theElement = XElement.Parse(""""""); // Act Action act = () => @@ -966,7 +966,7 @@ public void When_asserting_element_has_attribute_with_ns_and_specific_value_but_attribute_has_different_value_it_should_fail() { // Arrange - var theElement = XElement.Parse(@""); + var theElement = XElement.Parse(""""""); // Act Action act = () => @@ -982,7 +982,7 @@ public void When_asserting_element_has_attribute_with_specific_value_but_attribute_has_different_value_it_should_fail_with_descriptive_message() { // Arrange - var theElement = XElement.Parse(@""); + var theElement = XElement.Parse(""""""); // Act Action act = () => @@ -999,7 +999,7 @@ public void When_asserting_element_has_attribute_with_ns_and_specific_value_but_attribute_has_different_value_it_should_fail_with_descriptive_message() { // Arrange - var theElement = XElement.Parse(@""); + var theElement = XElement.Parse(""""""); // Act Action act = () => From 36d2afe454937a846ee58c071cffd2d1242189eb Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Wed, 23 Aug 2023 17:53:55 +0200 Subject: [PATCH 007/845] Qodana scan: Use raw string: `AssertionScope.MessageFormatingSpecs` --- .../Execution/AssertionScope.MessageFormatingSpecs.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs index b773d14759..86f1257f9b 100644 --- a/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs @@ -238,7 +238,7 @@ public void Message_should_not_have_trailing_backslashes_removed_from_subject() // Assert act.Should().Throw() - .WithMessage(@"* near ""\"" *"); + .WithMessage("""* near "\" *"""); } [Fact] @@ -249,7 +249,7 @@ public void Message_should_not_have_trailing_backslashes_removed_from_expectatio // Assert act.Should().Throw() - .WithMessage(@"* to be ""A\"" *"); + .WithMessage("""* to be "A\" *"""); } [Fact] From f94ca96f2a1fe7a7865f7941902e2527e088ba8f Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Wed, 23 Aug 2023 18:08:41 +0200 Subject: [PATCH 008/845] Qodana scan: Use verbatim string: `AssertionScopeSpecs.MessageFormatingSpecs` --- .../Execution/AssertionScope.MessageFormatingSpecs.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs index 86f1257f9b..6043015730 100644 --- a/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs @@ -207,12 +207,12 @@ public void Message_should_not_have_modified_carriage_return_or_line_feed_contro [InlineData("\r")] [InlineData("\\r")] [InlineData("\\\r")] - [InlineData("\\\\r")] + [InlineData(@"\\r")] [InlineData("\\\\\r")] [InlineData("\n")] [InlineData("\\n")] [InlineData("\\\n")] - [InlineData("\\\\n")] + [InlineData(@"\\n")] [InlineData("\\\\\n")] [Theory] public void Message_should_not_have_modified_carriage_return_or_line_feed_control_characters_in_supplied_arguments(string str) @@ -220,7 +220,7 @@ public void Message_should_not_have_modified_carriage_return_or_line_feed_contro // Arrange var scope = new AssertionScope(); - AssertionScope.Current.FailWith("\\{0}\\A", str); + AssertionScope.Current.FailWith(@"\{0}\A", str); // Act Action act = scope.Dispose; From 114d7c44241de03559c3497050a4d5ee383ebd65 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Wed, 23 Aug 2023 21:32:35 +0200 Subject: [PATCH 009/845] Qodana scan: Use expression-bodied property --- .../DictionarySpecs.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs index a58657787e..94f8455d43 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs @@ -219,10 +219,8 @@ public object this[string key] set => this[Parse(key)] = value; } - ICollection IDictionary.Keys - { - get { return Keys.Select(key => key.ToString(CultureInfo.InvariantCulture)).ToList(); } - } + ICollection IDictionary.Keys => + Keys.Select(key => key.ToString(CultureInfo.InvariantCulture)).ToList(); ICollection IDictionary.Values => Values; @@ -236,10 +234,8 @@ public class UserRolesLookupElement { private readonly Dictionary> innerRoles = new(); - public virtual Dictionary> Roles - { - get { return innerRoles.ToDictionary(x => x.Key, y => y.Value.Select(z => z)); } - } + public virtual Dictionary> Roles => + innerRoles.ToDictionary(x => x.Key, y => y.Value.Select(z => z)); public void Add(Guid userId, params string[] roles) { From c59735c3c8b511304e4348dbdb376e13abd63e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Gr=C3=BCtzmacher?= Date: Wed, 23 Aug 2023 17:45:12 +0200 Subject: [PATCH 010/845] Fix Possible 'System.NullReferenceException' warning for Streams assertions --- .../Streams/BufferedStreamAssertions.cs | 4 +-- .../Streams/StreamAssertions.cs | 28 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs b/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs index a235549c2a..1557532d8d 100644 --- a/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs +++ b/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs @@ -53,7 +53,7 @@ public AndConstraint HaveBufferSize(int expected, string because = { Execute.Assertion .BecauseOf(because, becauseArgs) - .ForCondition(Subject.BufferSize == expected) + .ForCondition(Subject!.BufferSize == expected) .FailWith("Expected the buffer size of {context:stream} to be {0}{reason}, but it was {1}.", expected, Subject.BufferSize); } @@ -84,7 +84,7 @@ public AndConstraint NotHaveBufferSize(int unexpected, string becau { Execute.Assertion .BecauseOf(because, becauseArgs) - .ForCondition(Subject.BufferSize != unexpected) + .ForCondition(Subject!.BufferSize != unexpected) .FailWith("Expected the buffer size of {context:stream} not to be {0}{reason}, but it was.", unexpected); } diff --git a/Src/FluentAssertions/Streams/StreamAssertions.cs b/Src/FluentAssertions/Streams/StreamAssertions.cs index 0855ee12df..a31355377e 100644 --- a/Src/FluentAssertions/Streams/StreamAssertions.cs +++ b/Src/FluentAssertions/Streams/StreamAssertions.cs @@ -53,7 +53,7 @@ public AndConstraint BeWritable(string because = "", params object[ { Execute.Assertion .BecauseOf(because, becauseArgs) - .ForCondition(Subject.CanWrite) + .ForCondition(Subject!.CanWrite) .FailWith("Expected {context:stream} to be writable{reason}, but it was not."); } @@ -81,7 +81,7 @@ public AndConstraint NotBeWritable(string because = "", params obje { Execute.Assertion .BecauseOf(because, becauseArgs) - .ForCondition(!Subject.CanWrite) + .ForCondition(!Subject!.CanWrite) .FailWith("Expected {context:stream} not to be writable{reason}, but it was."); } @@ -109,7 +109,7 @@ public AndConstraint BeSeekable(string because = "", params object[ { Execute.Assertion .BecauseOf(because, becauseArgs) - .ForCondition(Subject.CanSeek) + .ForCondition(Subject!.CanSeek) .FailWith("Expected {context:stream} to be seekable{reason}, but it was not."); } @@ -137,7 +137,7 @@ public AndConstraint NotBeSeekable(string because = "", params obje { Execute.Assertion .BecauseOf(because, becauseArgs) - .ForCondition(!Subject.CanSeek) + .ForCondition(!Subject!.CanSeek) .FailWith("Expected {context:stream} not to be seekable{reason}, but it was."); } @@ -165,7 +165,7 @@ public AndConstraint BeReadable(string because = "", params object[ { Execute.Assertion .BecauseOf(because, becauseArgs) - .ForCondition(Subject.CanRead) + .ForCondition(Subject!.CanRead) .FailWith("Expected {context:stream} to be readable{reason}, but it was not."); } @@ -193,7 +193,7 @@ public AndConstraint NotBeReadable(string because = "", params obje { Execute.Assertion .BecauseOf(because, becauseArgs) - .ForCondition(!Subject.CanRead) + .ForCondition(!Subject!.CanRead) .FailWith("Expected {context:stream} not to be readable{reason}, but it was."); } @@ -225,7 +225,7 @@ public AndConstraint HavePosition(long expected, string because = " try { - position = Subject.Position; + position = Subject!.Position; } catch (Exception exception) when (exception is IOException or NotSupportedException or ObjectDisposedException) @@ -274,7 +274,7 @@ public AndConstraint NotHavePosition(long unexpected, string becaus try { - position = Subject.Position; + position = Subject!.Position; } catch (Exception exception) when (exception is IOException or NotSupportedException or ObjectDisposedException) @@ -323,7 +323,7 @@ public AndConstraint HaveLength(long expected, string because = "", try { - length = Subject.Length; + length = Subject!.Length; } catch (Exception exception) when (exception is IOException or NotSupportedException or ObjectDisposedException) @@ -372,7 +372,7 @@ public AndConstraint NotHaveLength(long unexpected, string because try { - length = Subject.Length; + length = Subject!.Length; } catch (Exception exception) when (exception is IOException or NotSupportedException or ObjectDisposedException) @@ -417,7 +417,7 @@ public AndConstraint BeReadOnly(string because = "", params object[ { Execute.Assertion .BecauseOf(because, becauseArgs) - .ForCondition(!Subject.CanWrite && Subject.CanRead) + .ForCondition(!Subject!.CanWrite && Subject.CanRead) .FailWith("Expected {context:stream} to be read-only{reason}, but it was writable or not readable."); } @@ -445,7 +445,7 @@ public AndConstraint NotBeReadOnly(string because = "", params obje { Execute.Assertion .BecauseOf(because, becauseArgs) - .ForCondition(Subject.CanWrite || !Subject.CanRead) + .ForCondition(Subject!.CanWrite || !Subject.CanRead) .FailWith("Expected {context:stream} not to be read-only{reason}, but it was."); } @@ -473,7 +473,7 @@ public AndConstraint BeWriteOnly(string because = "", params object { Execute.Assertion .BecauseOf(because, becauseArgs) - .ForCondition(Subject.CanWrite && !Subject.CanRead) + .ForCondition(Subject!.CanWrite && !Subject.CanRead) .FailWith("Expected {context:stream} to be write-only{reason}, but it was readable or not writable."); } @@ -501,7 +501,7 @@ public AndConstraint NotBeWriteOnly(string because = "", params obj { Execute.Assertion .BecauseOf(because, becauseArgs) - .ForCondition(!Subject.CanWrite || Subject.CanRead) + .ForCondition(!Subject!.CanWrite || Subject.CanRead) .FailWith("Expected {context:stream} not to be write-only{reason}, but it was."); } From 57298c25c6dae97d28896dc5f8ac2b249ea60b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Gr=C3=BCtzmacher?= Date: Wed, 23 Aug 2023 17:49:09 +0200 Subject: [PATCH 011/845] Fix Possible 'System.NullReferenceException' warning in GenericCollectionAssertions --- .../GenericCollectionAssertions.cs | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index c3fcf0a65e..5bdf109569 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -79,7 +79,7 @@ public AndWhichConstraint> AllBeAssignabl Execute.Assertion .BecauseOf(because, becauseArgs) .WithExpectation("Expected type to be {0}{reason}, ", typeof(TExpectation).FullName) - .ForCondition(Subject.All(x => x is not null)) + .ForCondition(Subject!.All(x => x is not null)) .FailWith("but found a null element.") .Then .ForCondition(Subject.All(x => typeof(TExpectation).IsAssignableFrom(GetType(x)))) @@ -226,7 +226,7 @@ public AndWhichConstraint> AllBeOfType x is not null)) + .ForCondition(Subject!.All(x => x is not null)) .FailWith("but found a null element.") .Then .ForCondition(Subject.All(x => typeof(TExpectation) == GetType(x))) @@ -748,7 +748,7 @@ public AndWhichConstraint Contain(Expression> pred Func func = predicate.Compile(); Execute.Assertion - .ForCondition(Subject.Any(func)) + .ForCondition(Subject!.Any(func)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} {0} to have an item matching {1}{reason}.", Subject, predicate.Body); @@ -786,7 +786,7 @@ public AndConstraint Contain(IEnumerable expected, string becaus if (success) { - IEnumerable missingItems = expectedObjects.Except(Subject); + IEnumerable missingItems = expectedObjects.Except(Subject!); if (missingItems.Any()) { @@ -875,7 +875,7 @@ public AndWhichConstraint ContainEquivalentOf(TExp using var scope = new AssertionScope(); scope.AddReportable("configuration", () => options.ToString()); - foreach (T actualItem in Subject) + foreach (T actualItem in Subject!) { var context = new EquivalencyValidationContext(Node.From(() => AssertionScope.Current.CallerIdentity), @@ -1375,7 +1375,7 @@ public AndConstraint HaveCount(int expected, string because = "", p if (success) { - int actualCount = Subject.Count(); + int actualCount = Subject!.Count(); Execute.Assertion .ForCondition(actualCount == expected) @@ -1415,7 +1415,7 @@ public AndConstraint HaveCount(Expression> countPre { Func compiledPredicate = countPredicate.Compile(); - int actualCount = Subject.Count(); + int actualCount = Subject!.Count(); if (!compiledPredicate(actualCount)) { @@ -1579,7 +1579,7 @@ public AndWhichConstraint HaveElementAt(int index, T element, st if (success) { - if (index < Subject.Count()) + if (index < Subject!.Count()) { actual = Subject.ElementAt(index); @@ -1731,7 +1731,7 @@ public AndConstraint IntersectWith(IEnumerable otherCollection, if (success) { - IEnumerable sharedItems = Subject.Intersect(otherCollection); + IEnumerable sharedItems = Subject!.Intersect(otherCollection); Execute.Assertion .BecauseOf(because, becauseArgs) @@ -2225,7 +2225,7 @@ public AndConstraint NotContain(Expression> predicate if (success) { Func compiledPredicate = predicate.Compile(); - IEnumerable unexpectedItems = Subject.Where(item => compiledPredicate(item)); + IEnumerable unexpectedItems = Subject!.Where(item => compiledPredicate(item)); Execute.Assertion .BecauseOf(because, becauseArgs) @@ -2267,7 +2267,7 @@ public AndConstraint NotContain(IEnumerable unexpected, string b if (success) { - IEnumerable foundItems = unexpectedObjects.Intersect(Subject); + IEnumerable foundItems = unexpectedObjects.Intersect(Subject!); if (foundItems.Any()) { @@ -2361,7 +2361,7 @@ public AndConstraint NotContainEquivalentOf(TExpectat { int index = 0; - foreach (T actualItem in Subject) + foreach (T actualItem in Subject!) { var context = new EquivalencyValidationContext(Node.From(() => AssertionScope.Current.CallerIdentity), @@ -2598,7 +2598,7 @@ public AndConstraint NotContainNulls(Expression { Func compiledPredicate = predicate.Compile(); - T[] values = Subject + T[] values = Subject! .Where(e => compiledPredicate(e) is null) .ToArray(); @@ -2631,7 +2631,7 @@ public AndConstraint NotContainNulls(string because = "", params ob if (success) { - int[] indices = Subject + int[] indices = Subject! .Select((item, index) => (Item: item, Index: index)) .Where(e => e.Item is null) .Select(e => e.Index) @@ -2870,7 +2870,7 @@ public AndConstraint OnlyHaveUniqueItems(Expression compiledPredicate = predicate.Compile(); - IGrouping[] groupWithMultipleItems = Subject + IGrouping[] groupWithMultipleItems = Subject! .GroupBy(compiledPredicate) .Where(g => g.Count() > 1) .ToArray(); @@ -2920,7 +2920,7 @@ public AndConstraint OnlyHaveUniqueItems(string because = "", param if (success) { - IEnumerable groupWithMultipleItems = Subject + IEnumerable groupWithMultipleItems = Subject! .GroupBy(o => o) .Where(g => g.Count() > 1) .Select(g => g.Key); From 593f0efb9a116317fd529af23b56bddbdee4cdef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Gr=C3=BCtzmacher?= Date: Wed, 23 Aug 2023 17:51:30 +0200 Subject: [PATCH 012/845] Fix Possible 'System.NullReferenceException' warning for Specialized assertions --- Src/FluentAssertions/Specialized/AssemblyAssertions.cs | 10 +++++----- .../Specialized/AsyncFunctionAssertions.cs | 4 ++-- .../Specialized/GenericAsyncFunctionAssertions.cs | 2 +- .../Specialized/TaskCompletionSourceAssertions.cs | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Src/FluentAssertions/Specialized/AssemblyAssertions.cs b/Src/FluentAssertions/Specialized/AssemblyAssertions.cs index 6b5eeb72e2..646ce0827b 100644 --- a/Src/FluentAssertions/Specialized/AssemblyAssertions.cs +++ b/Src/FluentAssertions/Specialized/AssemblyAssertions.cs @@ -47,7 +47,7 @@ public AndConstraint NotReference(Assembly assembly, string if (success) { - var subjectName = Subject.GetName().Name; + var subjectName = Subject!.GetName().Name; IEnumerable references = Subject.GetReferencedAssemblies().Select(x => x.Name); @@ -85,7 +85,7 @@ public AndConstraint Reference(Assembly assembly, string bec if (success) { - var subjectName = Subject.GetName().Name; + var subjectName = Subject!.GetName().Name; IEnumerable references = Subject.GetReferencedAssemblies().Select(x => x.Name); @@ -127,7 +127,7 @@ public AndWhichConstraint DefineType(string @namespace if (success) { - foundType = Subject.GetTypes().SingleOrDefault(t => t.Namespace == @namespace && t.Name == name); + foundType = Subject!.GetTypes().SingleOrDefault(t => t.Namespace == @namespace && t.Name == name); Execute.Assertion .ForCondition(foundType is not null) @@ -157,7 +157,7 @@ public AndConstraint BeUnsigned(string because = "", params { Execute.Assertion .BecauseOf(because, becauseArgs) - .ForCondition(Subject.GetName().GetPublicKey() is not { Length: > 0 }) + .ForCondition(Subject!.GetName().GetPublicKey() is not { Length: > 0 }) .FailWith( "Did not expect the assembly {0} to be signed{reason}, but it is.", Subject.FullName); } @@ -188,7 +188,7 @@ public AndConstraint BeSignedWithPublicKey(string publicKey, if (success) { - var bytes = Subject.GetName().GetPublicKey() ?? Array.Empty(); + var bytes = Subject!.GetName().GetPublicKey() ?? Array.Empty(); string assemblyKey = ToHexString(bytes); Execute.Assertion diff --git a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs index e51556d434..07a558d3f9 100644 --- a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs @@ -300,7 +300,7 @@ public async Task> NotThrowAsync(string because = "", { try { - await Subject.Invoke(); + await Subject!.Invoke(); } catch (Exception exception) { @@ -334,7 +334,7 @@ public async Task> NotThrowAsync(string b { try { - await Subject.Invoke(); + await Subject!.Invoke(); } catch (Exception exception) { diff --git a/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs index d389955d0e..af5729409c 100644 --- a/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs @@ -90,7 +90,7 @@ public GenericAsyncFunctionAssertions(Func> subject, IExtractExcep { try { - TResult result = await Subject.Invoke(); + TResult result = await Subject!.Invoke(); return new AndWhichConstraint, TResult>(this, result); } catch (Exception exception) diff --git a/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs b/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs index 1ad25bb5a9..7853d6aa1b 100644 --- a/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs +++ b/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs @@ -45,7 +45,7 @@ public async Task> CompleteWithinA if (success) { - bool completesWithinTimeout = await CompletesWithinTimeoutAsync(subject.Task, timeSpan); + bool completesWithinTimeout = await CompletesWithinTimeoutAsync(subject!.Task, timeSpan); Execute.Assertion .ForCondition(completesWithinTimeout) .BecauseOf(because, becauseArgs) @@ -76,7 +76,7 @@ public async Task> NotCompleteWith if (success) { - bool completesWithinTimeout = await CompletesWithinTimeoutAsync(subject.Task, timeSpan); + bool completesWithinTimeout = await CompletesWithinTimeoutAsync(subject!.Task, timeSpan); Execute.Assertion .ForCondition(!completesWithinTimeout) .BecauseOf(because, becauseArgs) @@ -124,7 +124,7 @@ public async Task, T>> Comp if (success) { - bool completesWithinTimeout = await CompletesWithinTimeoutAsync(subject.Task, timeSpan); + bool completesWithinTimeout = await CompletesWithinTimeoutAsync(subject!.Task, timeSpan); Execute.Assertion .ForCondition(completesWithinTimeout) @@ -161,7 +161,7 @@ public async Task>> NotCompleteW if (success) { - bool completesWithinTimeout = await CompletesWithinTimeoutAsync(subject.Task, timeSpan); + bool completesWithinTimeout = await CompletesWithinTimeoutAsync(subject!.Task, timeSpan); Execute.Assertion .ForCondition(!completesWithinTimeout) From e332aff5cf912ce0a1cba6607dd88210c81da1fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Gr=C3=BCtzmacher?= Date: Wed, 23 Aug 2023 18:02:30 +0200 Subject: [PATCH 013/845] Fix Possible 'System.NullReferenceException' warning for Xml assertions --- Src/FluentAssertions/Xml/XAttributeAssertions.cs | 2 +- Src/FluentAssertions/Xml/XDocumentAssertions.cs | 6 +++--- Src/FluentAssertions/Xml/XElementAssertions.cs | 10 +++++----- Src/FluentAssertions/Xml/XmlElementAssertions.cs | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Src/FluentAssertions/Xml/XAttributeAssertions.cs b/Src/FluentAssertions/Xml/XAttributeAssertions.cs index e5bf240bb9..1ab5df665a 100644 --- a/Src/FluentAssertions/Xml/XAttributeAssertions.cs +++ b/Src/FluentAssertions/Xml/XAttributeAssertions.cs @@ -83,7 +83,7 @@ public AndConstraint HaveValue(string expected, string bec if (success) { Execute.Assertion - .ForCondition(Subject.Value == expected) + .ForCondition(Subject!.Value == expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} \"{0}\" to have value {1}{reason}, but found {2}.", Subject.Name, expected, Subject.Value); diff --git a/Src/FluentAssertions/Xml/XDocumentAssertions.cs b/Src/FluentAssertions/Xml/XDocumentAssertions.cs index 2760a6e0b9..583eb25de4 100644 --- a/Src/FluentAssertions/Xml/XDocumentAssertions.cs +++ b/Src/FluentAssertions/Xml/XDocumentAssertions.cs @@ -265,7 +265,7 @@ public AndWhichConstraint HaveElement(XName expec if (success) { - xElement = Subject.Root.Element(expected); + xElement = Subject.Root!.Element(expected); Execute.Assertion .ForCondition(xElement is not null) @@ -312,7 +312,7 @@ public AndWhichConstraint> HaveElemen if (success) { - var root = Subject.Root; + var root = Subject!.Root; success = Execute.Assertion .ForCondition(root is not null) @@ -323,7 +323,7 @@ public AndWhichConstraint> HaveElemen if (success) { - xElements = root.Elements(expected); + xElements = root!.Elements(expected); int actual = xElements.Count(); Execute.Assertion diff --git a/Src/FluentAssertions/Xml/XElementAssertions.cs b/Src/FluentAssertions/Xml/XElementAssertions.cs index 2ab3943c89..1a86b49d58 100644 --- a/Src/FluentAssertions/Xml/XElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XElementAssertions.cs @@ -144,7 +144,7 @@ public AndConstraint HaveValue(string expected, string becau if (success) { Execute.Assertion - .ForCondition(Subject.Value == expected) + .ForCondition(Subject!.Value == expected) .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:subject} '{0}' to have value {1}{reason}, but found {2}.", @@ -207,7 +207,7 @@ public AndConstraint HaveAttribute(XName expectedName, strin if (success) { - XAttribute attribute = Subject.Attribute(expectedName); + XAttribute attribute = Subject!.Attribute(expectedName); success = Execute.Assertion .ForCondition(attribute is not null) @@ -220,7 +220,7 @@ public AndConstraint HaveAttribute(XName expectedName, strin if (success) { Execute.Assertion - .ForCondition(attribute.Value == expectedValue) + .ForCondition(attribute!.Value == expectedValue) .BecauseOf(because, becauseArgs) .FailWith( "Expected attribute {0} in {context:subject} to have value {1}{reason}, but found {2}.", @@ -282,7 +282,7 @@ public AndWhichConstraint HaveElement(XName expect if (success) { - xElement = Subject.Element(expected); + xElement = Subject!.Element(expected); Execute.Assertion .ForCondition(xElement is not null) @@ -331,7 +331,7 @@ public AndWhichConstraint> HaveElement if (success) { - xElements = Subject.Elements(expected); + xElements = Subject!.Elements(expected); int actual = xElements.Count(); Execute.Assertion diff --git a/Src/FluentAssertions/Xml/XmlElementAssertions.cs b/Src/FluentAssertions/Xml/XmlElementAssertions.cs index 40d3503982..0ebde2f5b8 100644 --- a/Src/FluentAssertions/Xml/XmlElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XmlElementAssertions.cs @@ -104,7 +104,7 @@ public AndConstraint HaveAttributeWithNamespace( if (success) { Execute.Assertion - .ForCondition(attribute.Value == expectedValue) + .ForCondition(attribute!.Value == expectedValue) .BecauseOf(because, becauseArgs) .FailWith( "Expected attribute {0} in {context:subject} to have value {1}{reason}, but found {2}.", From bc49f11ac661d5171c28fcee0abf740ebd09d0f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Gr=C3=BCtzmacher?= Date: Wed, 23 Aug 2023 18:06:00 +0200 Subject: [PATCH 014/845] Fix Possible 'System.NullReferenceException' warning for Types assertions --- .../Types/MethodBaseAssertions.cs | 4 ++-- .../Types/MethodInfoAssertions.cs | 8 ++++---- .../Types/PropertyInfoAssertions.cs | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Src/FluentAssertions/Types/MethodBaseAssertions.cs b/Src/FluentAssertions/Types/MethodBaseAssertions.cs index 7ab268bbb7..fd92a50dc9 100644 --- a/Src/FluentAssertions/Types/MethodBaseAssertions.cs +++ b/Src/FluentAssertions/Types/MethodBaseAssertions.cs @@ -52,7 +52,7 @@ public AndConstraint HaveAccessModifier( .ForCondition(accessModifier == subjectAccessModifier) .BecauseOf(because, becauseArgs) .FailWith( - $"Expected method {Subject.Name} to be {accessModifier}{{reason}}, but it is {subjectAccessModifier}."); + $"Expected method {Subject!.Name} to be {accessModifier}{{reason}}, but it is {subjectAccessModifier}."); } return new AndConstraint((TAssertions)this); @@ -88,7 +88,7 @@ public AndConstraint NotHaveAccessModifier(CSharpAccessModifier acc Execute.Assertion .ForCondition(accessModifier != subjectAccessModifier) .BecauseOf(because, becauseArgs) - .FailWith($"Expected method {Subject.Name} not to be {accessModifier}{{reason}}, but it is."); + .FailWith($"Expected method {Subject!.Name} not to be {accessModifier}{{reason}}, but it is."); } return new AndConstraint((TAssertions)this); diff --git a/Src/FluentAssertions/Types/MethodInfoAssertions.cs b/Src/FluentAssertions/Types/MethodInfoAssertions.cs index cafd02b3de..6d5cfde4f1 100644 --- a/Src/FluentAssertions/Types/MethodInfoAssertions.cs +++ b/Src/FluentAssertions/Types/MethodInfoAssertions.cs @@ -150,7 +150,7 @@ public AndConstraint> Ret if (success) { Execute.Assertion - .ForCondition(typeof(void) == Subject.ReturnType) + .ForCondition(typeof(void) == Subject!.ReturnType) .BecauseOf(because, becauseArgs) .FailWith("Expected the return type of method " + Subject.Name + " to be void{reason}, but it is {0}.", Subject.ReturnType.FullName); @@ -184,7 +184,7 @@ public AndConstraint> Ret if (success) { Execute.Assertion - .ForCondition(returnType == Subject.ReturnType) + .ForCondition(returnType == Subject!.ReturnType) .BecauseOf(because, becauseArgs) .FailWith("Expected the return type of method " + Subject.Name + " to be {0}{reason}, but it is {1}.", returnType, Subject.ReturnType.FullName); @@ -231,7 +231,7 @@ public AndConstraint> Not if (success) { Execute.Assertion - .ForCondition(typeof(void) != Subject.ReturnType) + .ForCondition(typeof(void) != Subject!.ReturnType) .BecauseOf(because, becauseArgs) .FailWith("Expected the return type of method " + Subject.Name + " not to be void{reason}, but it is."); } @@ -265,7 +265,7 @@ public AndConstraint> Not if (success) { Execute.Assertion - .ForCondition(returnType != Subject.ReturnType) + .ForCondition(returnType != Subject!.ReturnType) .BecauseOf(because, becauseArgs) .FailWith( "Expected the return type of method " + Subject.Name + " not to be {0}{reason}, but it is.", returnType); diff --git a/Src/FluentAssertions/Types/PropertyInfoAssertions.cs b/Src/FluentAssertions/Types/PropertyInfoAssertions.cs index e8f329d04f..a0476b243c 100644 --- a/Src/FluentAssertions/Types/PropertyInfoAssertions.cs +++ b/Src/FluentAssertions/Types/PropertyInfoAssertions.cs @@ -95,7 +95,7 @@ public AndConstraint BeWritable( if (success) { Execute.Assertion - .ForCondition(Subject.CanWrite) + .ForCondition(Subject!.CanWrite) .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:property} {0} to have a setter{reason}.", @@ -132,7 +132,7 @@ public AndConstraint BeWritable(CSharpAccessModifier acc { Subject.Should().BeWritable(because, becauseArgs); - Subject.GetSetMethod(nonPublic: true).Should().HaveAccessModifier(accessModifier, because, becauseArgs); + Subject!.GetSetMethod(nonPublic: true).Should().HaveAccessModifier(accessModifier, because, becauseArgs); } return new AndConstraint(this); @@ -159,7 +159,7 @@ public AndConstraint NotBeWritable( if (success) { Execute.Assertion - .ForCondition(!Subject.CanWrite) + .ForCondition(!Subject!.CanWrite) .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:property} {0} not to have a setter{reason}.", @@ -188,7 +188,7 @@ public AndConstraint BeReadable(string because = "", par if (success) { - Execute.Assertion.ForCondition(Subject.CanRead) + Execute.Assertion.ForCondition(Subject!.CanRead) .BecauseOf(because, becauseArgs) .FailWith("Expected property " + Subject.Name + " to have a getter{reason}, but it does not."); } @@ -223,7 +223,7 @@ public AndConstraint BeReadable(CSharpAccessModifier acc { Subject.Should().BeReadable(because, becauseArgs); - Subject.GetGetMethod(nonPublic: true).Should().HaveAccessModifier(accessModifier, because, becauseArgs); + Subject!.GetGetMethod(nonPublic: true).Should().HaveAccessModifier(accessModifier, because, becauseArgs); } return new AndConstraint(this); @@ -250,7 +250,7 @@ public AndConstraint NotBeReadable( if (success) { Execute.Assertion - .ForCondition(!Subject.CanRead) + .ForCondition(!Subject!.CanRead) .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:property} {0} not to have a getter{reason}.", @@ -284,7 +284,7 @@ public AndConstraint Return(Type propertyType, if (success) { - Execute.Assertion.ForCondition(Subject.PropertyType == propertyType) + Execute.Assertion.ForCondition(Subject!.PropertyType == propertyType) .BecauseOf(because, becauseArgs) .FailWith("Expected Type of property " + Subject.Name + " to be {0}{reason}, but it is {1}.", propertyType, Subject.PropertyType); @@ -333,7 +333,7 @@ public AndConstraint NotReturn(Type propertyType, string if (success) { Execute.Assertion - .ForCondition(Subject.PropertyType != propertyType) + .ForCondition(Subject!.PropertyType != propertyType) .BecauseOf(because, becauseArgs) .FailWith("Expected Type of property " + Subject.Name + " not to be {0}{reason}, but it is.", propertyType); } From 0f2a1cb7556c225b4283a1c5284c7ac7835a7805 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 27 Aug 2023 18:10:11 +0200 Subject: [PATCH 015/845] Removed all support for DataSet, DataTable, DataRow and such (#2267) This was moved to a new repository and package --- Src/FluentAssertions/AssertionExtensions.cs | 42 - Src/FluentAssertions/AssertionOptions.cs | 11 +- .../ReadOnlyNonGenericCollectionWrapper.cs | 69 - .../Data/DataColumnAssertions.cs | 146 --- .../Data/DataEquivalencyAssertionOptions.cs | 267 ---- .../Data/DataRowAssertions.cs | 217 ---- .../Data/DataSetAssertions.cs | 272 ---- .../Data/DataTableAssertions.cs | 284 ----- .../Data/IDataEquivalencyAssertionOptions.cs | 193 --- Src/FluentAssertions/Data/RowMatchMode.cs | 24 - ...DataColumnCollectionAssertionExtensions.cs | 173 --- .../DataRowAssertionExtensions.cs | 24 - .../DataRowCollectionAssertionExtensions.cs | 161 --- .../DataSetAssertionExtensions.cs | 24 - .../DataTableAssertionExtensions.cs | 24 - .../DataTableCollectionAssertionExtensions.cs | 199 --- .../ConstraintCollectionEquivalencyStep.cs | 57 - .../Steps/ConstraintEquivalencyStep.cs | 286 ----- .../Steps/DataColumnEquivalencyStep.cs | 142 --- .../Steps/DataRelationEquivalencyStep.cs | 244 ---- .../Steps/DataRowCollectionEquivalencyStep.cs | 244 ---- .../Steps/DataRowEquivalencyStep.cs | 220 ---- .../Steps/DataSetEquivalencyStep.cs | 270 ---- .../Steps/DataTableEquivalencyStep.cs | 198 --- Src/FluentAssertions/EquivalencyPlan.cs | 8 - Src/FluentAssertions/FluentAssertions.csproj | 7 +- .../FluentAssertions/net47.verified.txt | 162 +-- .../FluentAssertions/net6.0.verified.txt | 162 +-- .../netcoreapp2.1.verified.txt | 162 +-- .../netcoreapp3.0.verified.txt | 162 +-- .../netstandard2.0.verified.txt | 162 +-- .../netstandard2.1.verified.txt | 162 +-- Tests/Benchmarks/Benchmarks.csproj | 1 - Tests/Benchmarks/LargeDataTableEquivalency.cs | 111 -- .../DataColumnSpecs.cs | 785 ------------ .../DataRelationSpecs.cs | 353 ------ .../DataRowSpecs.cs | 530 -------- .../DataSetSpecs.cs | 831 ------------ .../DataSpecs.cs | 676 ---------- .../DataTableSpecs.cs | 1114 ----------------- .../FluentAssertions.Equivalency.Specs.csproj | 1 - .../TypedDataSetSpecs.cs | 576 --------- .../TypedDataTableSpecs.cs | 666 ---------- .../DataColumnCollectionAssertionSpecs.cs | 435 ------- .../Data/DataRowCollectionAssertionSpecs.cs | 625 --------- .../Data/DataTableCollectionAssertionSpecs.cs | 539 -------- .../FluentAssertions.Specs.csproj | 1 - docs/_pages/data.md | 193 --- docs/_pages/releases.md | 2 + 49 files changed, 14 insertions(+), 12203 deletions(-) delete mode 100644 Src/FluentAssertions/Common/ReadOnlyNonGenericCollectionWrapper.cs delete mode 100644 Src/FluentAssertions/Data/DataColumnAssertions.cs delete mode 100644 Src/FluentAssertions/Data/DataEquivalencyAssertionOptions.cs delete mode 100644 Src/FluentAssertions/Data/DataRowAssertions.cs delete mode 100644 Src/FluentAssertions/Data/DataSetAssertions.cs delete mode 100644 Src/FluentAssertions/Data/DataTableAssertions.cs delete mode 100644 Src/FluentAssertions/Data/IDataEquivalencyAssertionOptions.cs delete mode 100644 Src/FluentAssertions/Data/RowMatchMode.cs delete mode 100644 Src/FluentAssertions/DataColumnCollectionAssertionExtensions.cs delete mode 100644 Src/FluentAssertions/DataRowAssertionExtensions.cs delete mode 100644 Src/FluentAssertions/DataRowCollectionAssertionExtensions.cs delete mode 100644 Src/FluentAssertions/DataSetAssertionExtensions.cs delete mode 100644 Src/FluentAssertions/DataTableAssertionExtensions.cs delete mode 100644 Src/FluentAssertions/DataTableCollectionAssertionExtensions.cs delete mode 100644 Src/FluentAssertions/Equivalency/Steps/ConstraintCollectionEquivalencyStep.cs delete mode 100644 Src/FluentAssertions/Equivalency/Steps/ConstraintEquivalencyStep.cs delete mode 100644 Src/FluentAssertions/Equivalency/Steps/DataColumnEquivalencyStep.cs delete mode 100644 Src/FluentAssertions/Equivalency/Steps/DataRelationEquivalencyStep.cs delete mode 100644 Src/FluentAssertions/Equivalency/Steps/DataRowCollectionEquivalencyStep.cs delete mode 100644 Src/FluentAssertions/Equivalency/Steps/DataRowEquivalencyStep.cs delete mode 100644 Src/FluentAssertions/Equivalency/Steps/DataSetEquivalencyStep.cs delete mode 100644 Src/FluentAssertions/Equivalency/Steps/DataTableEquivalencyStep.cs delete mode 100644 Tests/Benchmarks/LargeDataTableEquivalency.cs delete mode 100644 Tests/FluentAssertions.Equivalency.Specs/DataColumnSpecs.cs delete mode 100644 Tests/FluentAssertions.Equivalency.Specs/DataRelationSpecs.cs delete mode 100644 Tests/FluentAssertions.Equivalency.Specs/DataRowSpecs.cs delete mode 100644 Tests/FluentAssertions.Equivalency.Specs/DataSetSpecs.cs delete mode 100644 Tests/FluentAssertions.Equivalency.Specs/DataSpecs.cs delete mode 100644 Tests/FluentAssertions.Equivalency.Specs/DataTableSpecs.cs delete mode 100644 Tests/FluentAssertions.Equivalency.Specs/TypedDataSetSpecs.cs delete mode 100644 Tests/FluentAssertions.Equivalency.Specs/TypedDataTableSpecs.cs delete mode 100644 Tests/FluentAssertions.Specs/Collections/Data/DataColumnCollectionAssertionSpecs.cs delete mode 100644 Tests/FluentAssertions.Specs/Collections/Data/DataRowCollectionAssertionSpecs.cs delete mode 100644 Tests/FluentAssertions.Specs/Collections/Data/DataTableCollectionAssertionSpecs.cs delete mode 100644 docs/_pages/data.md diff --git a/Src/FluentAssertions/AssertionExtensions.cs b/Src/FluentAssertions/AssertionExtensions.cs index d16c01d5d7..5a0c9d831b 100644 --- a/Src/FluentAssertions/AssertionExtensions.cs +++ b/Src/FluentAssertions/AssertionExtensions.cs @@ -1,7 +1,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Data; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; @@ -12,7 +11,6 @@ using System.Xml.Linq; using FluentAssertions.Collections; using FluentAssertions.Common; -using FluentAssertions.Data; using FluentAssertions.Numeric; using FluentAssertions.Primitives; using FluentAssertions.Reflection; @@ -388,46 +386,6 @@ public static GenericDictionaryAssertions Should(actualValue); } - /// - /// Returns an assertions object that provides methods for asserting the state of a . - /// - [Pure] - public static GenericCollectionAssertions Should(this DataTableCollection actualValue) - { - return new GenericCollectionAssertions( - ReadOnlyNonGenericCollectionWrapper.Create(actualValue)); - } - - /// - /// Returns an assertions object that provides methods for asserting the state of a . - /// - [Pure] - public static GenericCollectionAssertions Should(this DataColumnCollection actualValue) - { - return new GenericCollectionAssertions( - ReadOnlyNonGenericCollectionWrapper.Create(actualValue)); - } - - /// - /// Returns an assertions object that provides methods for asserting the state of a . - /// - [Pure] - public static GenericCollectionAssertions Should(this DataRowCollection actualValue) - { - return new GenericCollectionAssertions( - ReadOnlyNonGenericCollectionWrapper.Create(actualValue)); - } - - /// - /// Returns a object that can be used to assert the - /// current . - /// - [Pure] - public static DataColumnAssertions Should(this DataColumn actualValue) - { - return new DataColumnAssertions(actualValue); - } - /// /// Returns an object that can be used to assert the /// current . diff --git a/Src/FluentAssertions/AssertionOptions.cs b/Src/FluentAssertions/AssertionOptions.cs index c40eff298e..3ce1f64f0e 100644 --- a/Src/FluentAssertions/AssertionOptions.cs +++ b/Src/FluentAssertions/AssertionOptions.cs @@ -17,19 +17,14 @@ static AssertionOptions() EquivalencyPlan = new EquivalencyPlan(); } + /// + /// Creates a clone of the default options and allows the caller to modify them. + /// public static EquivalencyAssertionOptions CloneDefaults() { return new EquivalencyAssertionOptions(defaults); } - internal static TOptions CloneDefaults(Func predicate) - where TOptions : EquivalencyAssertionOptions - { - Guard.ThrowIfArgumentIsNull(predicate); - - return predicate(defaults); - } - /// /// Allows configuring the defaults used during a structural equivalency assertion. /// diff --git a/Src/FluentAssertions/Common/ReadOnlyNonGenericCollectionWrapper.cs b/Src/FluentAssertions/Common/ReadOnlyNonGenericCollectionWrapper.cs deleted file mode 100644 index 878eacda7f..0000000000 --- a/Src/FluentAssertions/Common/ReadOnlyNonGenericCollectionWrapper.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Data; -using System.Linq; - -namespace FluentAssertions.Common; - -internal static class ReadOnlyNonGenericCollectionWrapper -{ - public static ReadOnlyNonGenericCollectionWrapper Create(DataTableCollection collection) - { - return - collection != null - ? new ReadOnlyNonGenericCollectionWrapper(collection) - : null; - } - - public static ReadOnlyNonGenericCollectionWrapper Create(DataColumnCollection collection) - { - return - collection != null - ? new ReadOnlyNonGenericCollectionWrapper(collection) - : null; - } - - public static ReadOnlyNonGenericCollectionWrapper Create(DataRowCollection collection) - { - return - collection != null - ? new ReadOnlyNonGenericCollectionWrapper(collection) - : null; - } -} - -internal class ReadOnlyNonGenericCollectionWrapper : ICollection, ICollectionWrapper - where TCollection : ICollection -{ - public TCollection UnderlyingCollection { get; } - - /// - /// Initializes a new instance of the class. - /// - /// is . - public ReadOnlyNonGenericCollectionWrapper(TCollection collection) - { - Guard.ThrowIfArgumentIsNull(collection); - - UnderlyingCollection = collection; - } - - public int Count => UnderlyingCollection.Count; - - bool ICollection.IsReadOnly => true; - - public IEnumerator GetEnumerator() => UnderlyingCollection.Cast().GetEnumerator(); - - IEnumerator IEnumerable.GetEnumerator() => UnderlyingCollection.GetEnumerator(); - - public bool Contains(TItem item) => UnderlyingCollection.Cast().Contains(item); - - public void CopyTo(TItem[] array, int arrayIndex) => UnderlyingCollection.CopyTo(array, arrayIndex); - - void ICollection.Add(TItem item) => throw new NotSupportedException(); - - void ICollection.Clear() => throw new NotSupportedException(); - - bool ICollection.Remove(TItem item) => throw new NotSupportedException(); -} diff --git a/Src/FluentAssertions/Data/DataColumnAssertions.cs b/Src/FluentAssertions/Data/DataColumnAssertions.cs deleted file mode 100644 index 9adec7bea8..0000000000 --- a/Src/FluentAssertions/Data/DataColumnAssertions.cs +++ /dev/null @@ -1,146 +0,0 @@ -using System; -using System.Data; -using System.Diagnostics; -using FluentAssertions.Common; -using FluentAssertions.Equivalency; -using FluentAssertions.Execution; -using FluentAssertions.Primitives; - -namespace FluentAssertions.Data; - -/// -/// Provides convenient assertion methods on a that can be -/// used to assert equivalency. -/// -[DebuggerNonUserCode] -public class DataColumnAssertions : ReferenceTypeAssertions -{ - public DataColumnAssertions(DataColumn dataColumn) - : base(dataColumn) - { - } - - /// - /// Asserts that an instance of is equivalent to another. - /// - /// - /// Data columns are equivalent when the following members have the same values: - /// - /// - /// AllowDBNull - /// AutoIncrement - /// AutoIncrementSeed - /// AutoIncrementStep - /// Caption - /// ColumnName - /// DataType - /// DateTimeMode - /// DefaultValue - /// Expression - /// ExtendedProperties - /// MaxLength - /// Namespace - /// Prefix - /// ReadOnly - /// Unique - /// - /// - /// A with the expected configuration. - /// - /// 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 BeEquivalentTo(DataColumn expectation, string because = "", - params object[] becauseArgs) - { - return BeEquivalentTo( - expectation, - options => options, - because, - becauseArgs); - } - - /// - /// Asserts that an instance of is equivalent to another. - /// - /// - /// Data columns are equivalent when the following members have the same values: - /// - /// - /// AllowDBNull - /// AutoIncrement - /// AutoIncrementSeed - /// AutoIncrementStep - /// Caption - /// ColumnName - /// DataType - /// DateTimeMode - /// DefaultValue - /// Expression - /// ExtendedProperties - /// MaxLength - /// Namespace - /// Prefix - /// ReadOnly - /// Unique - /// - /// - /// - /// Testing of any property can be overridden using the callback. Exclude specific properties using - /// . - /// - /// - /// If or a related function is - /// used and the exclusion matches the subject , then the equivalency test will never - /// fail. - /// - /// - /// A with the expected configuration. - /// - /// A reference to the configuration object that can be used - /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the - /// class. - /// - /// - /// 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 . - /// - /// is . - public AndConstraint BeEquivalentTo(DataColumn expectation, - Func, IDataEquivalencyAssertionOptions> config, - string because = "", params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull(config); - - IDataEquivalencyAssertionOptions options = - config(AssertionOptions.CloneDefaults>(e => - new DataEquivalencyAssertionOptions(e))); - - var context = - new EquivalencyValidationContext(Node.From(() => AssertionScope.Current.CallerIdentity), options) - { - Reason = new Reason(because, becauseArgs), - TraceWriter = options.TraceWriter - }; - - var comparands = new Comparands - { - Subject = Subject, - Expectation = expectation, - CompileTimeType = typeof(DataColumn) - }; - - new EquivalencyValidator().AssertEquality(comparands, context); - - return new AndConstraint(this); - } - - protected override string Identifier => "DataColumn"; -} diff --git a/Src/FluentAssertions/Data/DataEquivalencyAssertionOptions.cs b/Src/FluentAssertions/Data/DataEquivalencyAssertionOptions.cs deleted file mode 100644 index b49c7d75ec..0000000000 --- a/Src/FluentAssertions/Data/DataEquivalencyAssertionOptions.cs +++ /dev/null @@ -1,267 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Linq.Expressions; -using System.Reflection; -using FluentAssertions.Equivalency; - -namespace FluentAssertions.Data; - -internal class DataEquivalencyAssertionOptions : EquivalencyAssertionOptions, IDataEquivalencyAssertionOptions -{ - private readonly HashSet excludeTableNames = new(); - private readonly HashSet excludeColumnNames = new(); - private readonly Dictionary> excludeColumnNamesByTableName = new(); - - public bool AllowMismatchedTypes { get; private set; } - - public bool IgnoreUnmatchedColumns { get; private set; } - - public bool ExcludeOriginalData { get; private set; } - - public RowMatchMode RowMatchMode { get; private set; } - - public ISet ExcludeTableNames => excludeTableNames; - - public ISet ExcludeColumnNames => excludeColumnNames; - - public DataEquivalencyAssertionOptions(EquivalencyAssertionOptions defaults) - : base(defaults) - { - } - - public IDataEquivalencyAssertionOptions AllowingMismatchedTypes() - { - AllowMismatchedTypes = true; - return this; - } - - public IDataEquivalencyAssertionOptions IgnoringUnmatchedColumns() - { - IgnoreUnmatchedColumns = true; - return this; - } - - public IDataEquivalencyAssertionOptions UsingRowMatchMode(RowMatchMode rowMatchMode) - { - RowMatchMode = rowMatchMode; - return this; - } - - public IDataEquivalencyAssertionOptions ExcludingOriginalData() - { - ExcludeOriginalData = true; - return this; - } - - public new IDataEquivalencyAssertionOptions Excluding(Expression> expression) - { - base.Excluding(expression); - return this; - } - - public IDataEquivalencyAssertionOptions ExcludingRelated(Expression> expression) - { - ExcludeMemberOfRelatedTypeByGeneratedPredicate(expression); - return this; - } - - public IDataEquivalencyAssertionOptions ExcludingRelated(Expression> expression) - { - ExcludeMemberOfRelatedTypeByGeneratedPredicate(expression); - return this; - } - - public IDataEquivalencyAssertionOptions ExcludingRelated(Expression> expression) - { - ExcludeMemberOfRelatedTypeByGeneratedPredicate(expression); - return this; - } - - public IDataEquivalencyAssertionOptions ExcludingRelated(Expression> expression) - { - ExcludeMemberOfRelatedTypeByGeneratedPredicate(expression); - return this; - } - - public IDataEquivalencyAssertionOptions ExcludingRelated(Expression> expression) - { - ExcludeMemberOfSubtypeOfRelatedTypeByGeneratedPredicate(expression); - ExcludeMemberOfSubtypeOfRelatedTypeByGeneratedPredicate(expression); - return this; - } - - public IDataEquivalencyAssertionOptions ExcludingRelated(Expression> expression) - { - ExcludeMemberOfRelatedTypeByGeneratedPredicate(expression); - return this; - } - - public IDataEquivalencyAssertionOptions ExcludingRelated(Expression> expression) - { - ExcludeMemberOfRelatedTypeByGeneratedPredicate(expression); - return this; - } - - private void ExcludeMemberOfRelatedTypeByGeneratedPredicate( - Expression> expression) - { - Expression> predicate = BuildMemberSelectionPredicate( - typeof(TDeclaringType), - GetMemberAccessTargetMember(expression.Body)); - - Excluding(predicate); - } - - private void ExcludeMemberOfSubtypeOfRelatedTypeByGeneratedPredicate( - Expression> expression) - where TInheritingType : TDeclaringType - { - Expression> predicate = BuildMemberSelectionPredicate( - typeof(TInheritingType), - GetMemberAccessTargetMember(expression.Body)); - - Excluding(predicate); - } - - private static MemberInfo GetMemberAccessTargetMember(Expression expression) - { - if (expression is UnaryExpression unaryExpression - && unaryExpression.NodeType == ExpressionType.Convert) - { - // If the expression is a value type, then accessing it will involve an - // implicit boxing conversion to type object that we need to ignore. - expression = unaryExpression.Operand; - } - - if (expression is MemberExpression memberExpression) - { - return memberExpression.Member; - } - - throw new ArgumentException("Expression must be a simple member access", nameof(expression)); - } - - private static Expression> BuildMemberSelectionPredicate(Type relatedSubjectType, - MemberInfo referencedMember) - { - ParameterExpression predicateMemberInfoArgument = Expression.Parameter(typeof(IMemberInfo)); - - BinaryExpression typeComparison = Expression.Equal( - Expression.MakeMemberAccess( - predicateMemberInfoArgument, - typeof(IMemberInfo).GetProperty(nameof(IMemberInfo.DeclaringType))), - Expression.Constant(relatedSubjectType)); - - BinaryExpression memberNameComparison = Expression.Equal( - Expression.MakeMemberAccess( - predicateMemberInfoArgument, - typeof(IMemberInfo).GetProperty(nameof(IMemberInfo.Name))), - Expression.Constant(referencedMember.Name)); - - BinaryExpression predicateBody = Expression.AndAlso( - typeComparison, - memberNameComparison); - - return Expression.Lambda>( - predicateBody, - predicateMemberInfoArgument); - } - - public new IDataEquivalencyAssertionOptions Excluding(Expression> predicate) - { - base.Excluding(predicate); - return this; - } - - public IDataEquivalencyAssertionOptions ExcludingTable(string tableName) - { - return ExcludingTables(tableName); - } - - public IDataEquivalencyAssertionOptions ExcludingTables(params string[] tableNames) - { - return ExcludingTables((IEnumerable)tableNames); - } - - public IDataEquivalencyAssertionOptions ExcludingTables(IEnumerable tableNames) - { - excludeTableNames.UnionWith(tableNames); - return this; - } - - public IDataEquivalencyAssertionOptions ExcludingColumnInAllTables(string columnName) - { - return ExcludingColumnsInAllTables(columnName); - } - - public IDataEquivalencyAssertionOptions ExcludingColumnsInAllTables(params string[] columnNames) - { - return ExcludingColumnsInAllTables((IEnumerable)columnNames); - } - - public IDataEquivalencyAssertionOptions ExcludingColumnsInAllTables(IEnumerable columnNames) - { - excludeColumnNames.UnionWith(columnNames); - return this; - } - - public IDataEquivalencyAssertionOptions ExcludingColumn(DataColumn column) - { - return ExcludingColumn(column.Table.TableName, column.ColumnName); - } - - public IDataEquivalencyAssertionOptions ExcludingColumns(params DataColumn[] columns) - { - return ExcludingColumns((IEnumerable)columns); - } - - public IDataEquivalencyAssertionOptions ExcludingColumns(IEnumerable columns) - { - foreach (DataColumn column in columns) - { - ExcludingColumn(column); - } - - return this; - } - - public IDataEquivalencyAssertionOptions ExcludingColumn(string tableName, string columnName) - { - return ExcludingColumns(tableName, columnName); - } - - public IDataEquivalencyAssertionOptions ExcludingColumns(string tableName, params string[] columnNames) - { - return ExcludingColumns(tableName, (IEnumerable)columnNames); - } - - public IDataEquivalencyAssertionOptions ExcludingColumns(string tableName, IEnumerable columnNames) - { - if (!excludeColumnNamesByTableName.TryGetValue(tableName, out HashSet excludeColumnNames)) - { - excludeColumnNames = new HashSet(); - excludeColumnNamesByTableName[tableName] = excludeColumnNames; - } - - excludeColumnNames.UnionWith(columnNames); - - return this; - } - - public bool ShouldExcludeColumn(DataColumn column) - { - if (excludeColumnNames.Contains(column.ColumnName)) - { - return true; - } - - if (excludeColumnNamesByTableName.TryGetValue(column.Table.TableName, out HashSet excludeColumnsForTable) - && excludeColumnsForTable.Contains(column.ColumnName)) - { - return true; - } - - return false; - } -} diff --git a/Src/FluentAssertions/Data/DataRowAssertions.cs b/Src/FluentAssertions/Data/DataRowAssertions.cs deleted file mode 100644 index 6f65842c99..0000000000 --- a/Src/FluentAssertions/Data/DataRowAssertions.cs +++ /dev/null @@ -1,217 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.Linq; -using FluentAssertions.Common; -using FluentAssertions.Equivalency; -using FluentAssertions.Execution; -using FluentAssertions.Primitives; - -namespace FluentAssertions.Data; - -/// -/// Provides convenient assertion methods on a that can be -/// used to assert equivalency and the presence of columns. -/// -[DebuggerNonUserCode] -public class DataRowAssertions : ReferenceTypeAssertions> - where TDataRow : DataRow -{ - public DataRowAssertions(TDataRow dataRow) - : base(dataRow) - { - } - - /// - /// Asserts that an instance of has a column with the expected column name. - /// - /// The value that is expected in . - /// - /// 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 AndWhichConstraint, DataColumn> HaveColumn(string expectedColumnName, string because = "", - params object[] becauseArgs) - { - var subjectColumn = default(DataColumn); - - if (Subject is null) - { - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:DataRow} to contain a column named {0}{reason}, but found .", - expectedColumnName); - } - else if (!Subject.Table.Columns.Contains(expectedColumnName)) - { - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:DataRow} to contain a column named {0}{reason}, but it does not.", - expectedColumnName); - } - else - { - subjectColumn = Subject.Table.Columns[expectedColumnName]; - } - - return new AndWhichConstraint, DataColumn>(this, subjectColumn); - } - - /// - /// Asserts that an instance of has columns with all of the supplied expected column names. - /// - /// An array of values expected in . - public AndConstraint> HaveColumns(params string[] expectedColumnNames) - { - return HaveColumns((IEnumerable)expectedColumnNames); - } - - /// - /// Asserts that an instance of has columns with all of the supplied expected column names. - /// - /// An of string values expected in . - /// - /// 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> HaveColumns(IEnumerable expectedColumnNames, string because = "", - params object[] becauseArgs) - { - bool success = Execute.Assertion - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith( - "Expected {context:DataRow} to be in a table containing {0} column(s) with specific names{reason}, but found .", - () => expectedColumnNames.Count()); - - if (success) - { - foreach (var expectedColumnName in expectedColumnNames) - { - Execute.Assertion - .ForCondition(Subject.Table.Columns.Contains(expectedColumnName)) - .BecauseOf(because, becauseArgs) - .FailWith("Expected table containing {context:DataRow} to contain a column named {0}{reason}, but it does not.", - expectedColumnName); - } - } - - return new AndConstraint>(this); - } - - /// - /// Asserts that an instance of is equivalent to another. - /// - /// - /// Data rows are equivalent when they contain identical field data for the row they represent, and - /// the following members have the same values: - /// - /// - /// HasErrors - /// RowState - /// - /// - /// The objects must be of the same type; if two objects - /// are equivalent in all ways, except that one is part of a typed and is of a subclass - /// of , then by default, they will not be considered equivalent. This can be overridden - /// by using the overload that takes . - /// - /// A with the expected configuration. - /// - /// 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> BeEquivalentTo(DataRow expectation, string because = "", - params object[] becauseArgs) - { - return BeEquivalentTo( - expectation, - options => options, - because, - becauseArgs); - } - - /// - /// Asserts that an instance of is equivalent to another. - /// - /// - /// Data rows are equivalent when they contain identical field data for the row they represent, and - /// the following members have the same values: - /// - /// - /// HasErrors - /// RowState - /// - /// - /// - /// The objects must be of the same type; if two objects - /// are equivalent in all ways, except that one is part of a typed and is of a subclass - /// of , then by default, they will not be considered equivalent. - /// - /// - /// This, as well as testing of any property can be overridden using the callback. - /// By calling , two - /// objects of differing types can be considered equivalent. Exclude specific properties using - /// . - /// Exclude columns of the data table (which also excludes the related field data in - /// objects) using or a related function. - /// - /// - /// - /// You can use - /// and related functions to exclude properties on other related System.Data types. - /// A with the expected configuration. - /// - /// A reference to the configuration object that can be used - /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the - /// class. - /// - /// - /// 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 . - /// - /// is . - public AndConstraint> BeEquivalentTo(DataRow expectation, - Func, IDataEquivalencyAssertionOptions> config, string because = "", - params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull(config); - - IDataEquivalencyAssertionOptions options = - config(AssertionOptions.CloneDefaults>(e => - new DataEquivalencyAssertionOptions(e))); - - var context = new EquivalencyValidationContext(Node.From(() => AssertionScope.Current.CallerIdentity), options) - { - Reason = new Reason(because, becauseArgs), - TraceWriter = options.TraceWriter - }; - - var comparands = new Comparands - { - Subject = Subject, - Expectation = expectation, - CompileTimeType = typeof(TDataRow), - }; - - new EquivalencyValidator().AssertEquality(comparands, context); - - return new AndConstraint>(this); - } - - protected override string Identifier => "DataRow"; -} diff --git a/Src/FluentAssertions/Data/DataSetAssertions.cs b/Src/FluentAssertions/Data/DataSetAssertions.cs deleted file mode 100644 index 2cf8559437..0000000000 --- a/Src/FluentAssertions/Data/DataSetAssertions.cs +++ /dev/null @@ -1,272 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.Linq; -using FluentAssertions.Common; -using FluentAssertions.Equivalency; -using FluentAssertions.Execution; -using FluentAssertions.Primitives; - -namespace FluentAssertions.Data; - -/// -/// Provides convenient assertion methods on a that can be -/// used to assert equivalency and the presence of tables. -/// -[DebuggerNonUserCode] -public class DataSetAssertions : ReferenceTypeAssertions> - where TDataSet : DataSet -{ - public DataSetAssertions(TDataSet dataSet) - : base(dataSet) - { - } - - /// - /// Asserts that an instance of contains exactly the expected number of tables in its collection. - /// - /// The expected number of rows. - /// - /// 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> HaveTableCount(int expected, string because = "", - params object[] becauseArgs) - { - bool success = Execute.Assertion - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:DataSet} to contain exactly {0} table(s){reason}, but found .", expected); - - if (success) - { - int actualCount = Subject.Tables.Count; - - Execute.Assertion - .ForCondition(actualCount == expected) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:DataSet} to contain exactly {0} table(s){reason}, but found {1}.", expected, - actualCount); - } - - return new AndConstraint>(this); - } - - /// - /// Asserts that an instance of contains a table with the expected name. - /// - /// The value that is expected in . - /// - /// 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 AndWhichConstraint, DataTable> HaveTable(string expectedTableName, string because = "", - params object[] becauseArgs) - { - var subjectTable = default(DataTable); - - if (Subject is null) - { - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:DataSet} to contain a table named {0}{reason}, but found .", - expectedTableName); - } - else if (!Subject.Tables.Contains(expectedTableName)) - { - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:DataSet} to contain a table named {0}{reason}, but it does not.", expectedTableName); - } - else - { - subjectTable = Subject.Tables[expectedTableName]; - } - - return new AndWhichConstraint, DataTable>(this, subjectTable); - } - - /// - /// Asserts that an instance of has tables with all of the supplied expected column names. - /// - /// An array of values expected in . - public AndConstraint> HaveTables(params string[] expectedTableNames) - { - return HaveTables((IEnumerable)expectedTableNames); - } - - /// - /// Asserts that an instance of has tables with all of the supplied expected table names. - /// - /// An of string values expected in . - /// - /// 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> HaveTables(IEnumerable expectedTableNames, string because = "", - params object[] becauseArgs) - { - bool success = Execute.Assertion - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:DataSet} to contain {0} table(s) with specific names{reason}, but found .", - () => expectedTableNames.Count()); - - if (success) - { - foreach (var expectedTableName in expectedTableNames) - { - Execute.Assertion - .ForCondition(Subject.Tables.Contains(expectedTableName)) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:DataSet} to contain a table named {0}{reason}, but it does not.", expectedTableName); - } - } - - return new AndConstraint>(this); - } - - /// - /// Asserts that an instance of is equivalent to another. - /// - /// - /// Data sets are equivalent when their and - /// collections are equivalent and the following members have the same values: - /// - /// - /// DataSetName - /// CaseSensitive - /// EnforceConstraints - /// HasErrors - /// Locale - /// Namespace - /// Prefix - /// RemotingFormat - /// SchemaSerializationMode - /// - /// - /// The objects must be of the same type; if two objects - /// are equivalent in all ways, except that one is a custom subclass of (e.g. to provide - /// typed accessors for values contained by the ), then by default, - /// they will not be considered equivalent. This can be overridden by using the overload that takes - /// . - /// - /// A with the expected configuration. - /// - /// 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> BeEquivalentTo(DataSet expectation, string because = "", - params object[] becauseArgs) - { - return BeEquivalentTo( - expectation, - options => options, - because, - becauseArgs); - } - - /// - /// Asserts that an instance of is equivalent to another. - /// - /// - /// Data sets are equivalent when their and - /// collections are equivalent and the following members have the same values: - /// - /// - /// DataSetName - /// CaseSensitive - /// EnforceConstraints - /// HasErrors - /// Locale - /// Namespace - /// Prefix - /// RemotingFormat - /// SchemaSerializationMode - /// - /// - /// - /// The objects must be of the same type; if two objects - /// are equivalent in all ways, except that one is a custom subclass of (e.g. to provide - /// typed accessors for values contained by the ), then by default, - /// they will not be considered equivalent. - /// - /// - /// This, as well as testing of any property can be overridden using the callback. - /// By calling , two - /// objects of differing types can be considered equivalent. This setting applies to all types recursively tested - /// as part of the . - /// - /// - /// Exclude specific properties using . - /// Exclude specific tables within the data set using - /// or a related function. You can also indicate that columns should be excluded within the - /// objects recursively tested as part of the using - /// or a related function. The method - /// can be used to exclude columns across all objects in the that share - /// the same name. - /// - /// - /// You can use - /// and related functions to exclude properties on other related System.Data types. - /// - /// - /// A with the expected configuration. - /// - /// A reference to the configuration object that can be used - /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the - /// class. - /// - /// - /// 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 . - /// - /// is . - public AndConstraint> BeEquivalentTo(DataSet expectation, - Func, IDataEquivalencyAssertionOptions> config, string because = "", - params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull(config); - - IDataEquivalencyAssertionOptions options = - config(AssertionOptions.CloneDefaults>(e => - new DataEquivalencyAssertionOptions(e))); - - var comparands = new Comparands - { - Subject = Subject, - Expectation = expectation, - CompileTimeType = typeof(TDataSet) - }; - - var context = new EquivalencyValidationContext(Node.From(() => AssertionScope.Current.CallerIdentity), options) - { - Reason = new Reason(because, becauseArgs), - TraceWriter = options.TraceWriter, - }; - - var equivalencyValidator = new EquivalencyValidator(); - equivalencyValidator.AssertEquality(comparands, context); - - return new AndConstraint>(this); - } - - protected override string Identifier => "DataSet"; -} diff --git a/Src/FluentAssertions/Data/DataTableAssertions.cs b/Src/FluentAssertions/Data/DataTableAssertions.cs deleted file mode 100644 index 2fe7427d2e..0000000000 --- a/Src/FluentAssertions/Data/DataTableAssertions.cs +++ /dev/null @@ -1,284 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.Linq; -using FluentAssertions.Common; -using FluentAssertions.Equivalency; -using FluentAssertions.Execution; -using FluentAssertions.Primitives; - -namespace FluentAssertions.Data; - -/// -/// Provides convenient assertion methods on a that can be -/// used to assert equivalency and the presence of rows and columns. -/// -[DebuggerNonUserCode] -public class DataTableAssertions : ReferenceTypeAssertions> - where TDataTable : DataTable -{ - public DataTableAssertions(TDataTable dataTable) - : base(dataTable) - { - } - - /// - /// Asserts that an instance of contains exactly the expected number of rows in its collection. - /// - /// The expected number of rows. - /// - /// 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> HaveRowCount(int expected, string because = "", - params object[] becauseArgs) - { - bool success = Execute.Assertion - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:DataTable} to contain exactly {0} row(s){reason}, but found .", expected); - - if (success) - { - int actualCount = Subject.Rows.Count; - - Execute.Assertion - .ForCondition(actualCount == expected) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:DataTable} to contain exactly {0} row(s){reason}, but found {1}.", expected, - actualCount); - } - - return new AndConstraint>(this); - } - - /// - /// Asserts that an instance of has a column with the expected column name. - /// - /// The value that is expected in . - /// - /// 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 AndWhichConstraint, DataColumn> HaveColumn(string expectedColumnName, - string because = "", params object[] becauseArgs) - { - var subjectColumn = default(DataColumn); - - if (Subject is null) - { - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:DataTable} to contain a column named {0}{reason}, but found .", - expectedColumnName); - } - else if (!Subject.Columns.Contains(expectedColumnName)) - { - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:DataTable} to contain a column named {0}{reason}, but it does not.", - expectedColumnName); - } - else - { - subjectColumn = Subject.Columns[expectedColumnName]; - } - - return new AndWhichConstraint, DataColumn>(this, subjectColumn); - } - - /// - /// Asserts that an instance of has columns with all of the supplied expected column names. - /// - /// An array of values expected in . - public AndConstraint> HaveColumns(params string[] expectedColumnNames) - { - return HaveColumns((IEnumerable)expectedColumnNames); - } - - /// - /// Asserts that an instance of has columns with all of the supplied expected column names. - /// - /// An of string values expected in . - /// - /// 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> HaveColumns(IEnumerable expectedColumnNames, - string because = "", params object[] becauseArgs) - { - bool success = Execute.Assertion - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:DataTable} to contain {0} column(s) with specific names{reason}, but found .", - () => expectedColumnNames.Count()); - - if (success) - { - foreach (var expectedColumnName in expectedColumnNames) - { - Execute.Assertion - .ForCondition(Subject.Columns.Contains(expectedColumnName)) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:DataTable} to contain a column named {0}{reason}, but it does not.", - expectedColumnName); - } - } - - return new AndConstraint>(this); - } - - /// - /// Asserts that an instance of is equivalent to another. - /// - /// - /// Data tables are equivalent when the following members have the same values: - /// - /// - /// TableName - /// CaseSensitive - /// DisplayExpression - /// HasErrors - /// Locale - /// Namespace - /// Prefix - /// RemotingFormat - /// - /// - /// In addition, the following collections must contain equivalent data: - /// - /// - /// ChildRelations - /// Columns - /// Constraints - /// ExtendedProperties - /// ParentRelations - /// PrimaryKey - /// Rows - /// - /// - /// The objects must be of the same type; if two objects - /// are equivalent in all ways, except that one is a typed that is a subclass - /// of , then by default, they will not be considered equivalent. This can be overridden by - /// using the overload that takes . - /// - /// A with the expected configuration. - /// - /// 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> BeEquivalentTo(DataTable expectation, string because = "", - params object[] becauseArgs) - { - return BeEquivalentTo( - expectation, - options => options, - because, - becauseArgs); - } - - /// - /// Asserts that an instance of is equivalent to another. - /// - /// - /// Data tables are equivalent when the following members have the same values: - /// - /// - /// TableName - /// CaseSensitive - /// DisplayExpression - /// HasErrors - /// Locale - /// Namespace - /// Prefix - /// RemotingFormat - /// - /// - /// In addition, the following collections must contain equivalent data: - /// - /// - /// ChildRelations - /// Columns - /// Constraints - /// ExtendedProperties - /// ParentRelations - /// PrimaryKey - /// Rows - /// - /// - /// The objects must be of the same type; if two objects - /// are equivalent in all ways, except that one is a typed that is a subclass - /// of , then by default, they will not be considered equivalent. - /// - /// - /// This, as well as testing of any property can be overridden using the callback. - /// By calling , two - /// objects of differing types can be considered equivalent. Exclude specific properties using - /// . - /// Exclude columns of the data table using - /// or a related function -- this excludes both the objects in - /// and associated field data in objects within the . - /// - /// - /// You can use - /// and related functions to exclude properties on other related System.Data types. - /// - /// - /// A with the expected configuration. - /// - /// A reference to the configuration object that can be used - /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the - /// class. - /// - /// - /// 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 . - /// - /// is . - public AndConstraint> BeEquivalentTo(DataTable expectation, - Func, IDataEquivalencyAssertionOptions> config, - string because = "", params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull(config); - - IDataEquivalencyAssertionOptions options = - config(AssertionOptions.CloneDefaults>(e => - new DataEquivalencyAssertionOptions(e))); - - var context = new EquivalencyValidationContext(Node.From(() => AssertionScope.Current.CallerIdentity), options) - { - Reason = new Reason(because, becauseArgs), - TraceWriter = options.TraceWriter - }; - - var comparands = new Comparands - { - Subject = Subject, - Expectation = expectation, - CompileTimeType = typeof(TDataTable), - }; - - new EquivalencyValidator().AssertEquality(comparands, context); - - return new AndConstraint>(this); - } - - protected override string Identifier => "DataTable"; -} diff --git a/Src/FluentAssertions/Data/IDataEquivalencyAssertionOptions.cs b/Src/FluentAssertions/Data/IDataEquivalencyAssertionOptions.cs deleted file mode 100644 index 41ebb4625d..0000000000 --- a/Src/FluentAssertions/Data/IDataEquivalencyAssertionOptions.cs +++ /dev/null @@ -1,193 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Linq.Expressions; -using FluentAssertions.Equivalency; - -namespace FluentAssertions.Data; - -/// -/// Provides access to configuration for equivalency assertions on System.Data types (, -/// , , , , -/// ). -/// -/// The System.Data type being tested for equivalency. -public interface IDataEquivalencyAssertionOptions : IEquivalencyAssertionOptions -{ - /// - /// Specifies that the subject and the expectation should not be considered non-equivalent if their exact data types do not match. - /// - IDataEquivalencyAssertionOptions AllowingMismatchedTypes(); - - /// - /// Specifies that when comparing , columns that are unmatched between the subject and the expectation should be ignored. - /// - IDataEquivalencyAssertionOptions IgnoringUnmatchedColumns(); - - /// - /// Specifies the that should be used when comparing . By default, rows are matched by their index in the collection. But, if the has a set, it is possible to use to indicate that rows should be matched by their primary key values, irrespective of their index within the collection. - /// - /// The to use when comparing between the subject and the expectation. - IDataEquivalencyAssertionOptions UsingRowMatchMode(RowMatchMode rowMatchMode); - - /// - /// Specifies that when comparing objects that are in the state, only the current field values should be compared. Original field values are excluded from comparison. This only affects comparisons where both the subject and the expectation are in the modified state. - /// - IDataEquivalencyAssertionOptions ExcludingOriginalData(); - - /// - /// Excludes members of the objects under test from comparison by means of a predicate that selects members based on objects describing them. - /// - /// A functor that returns true if the parameter refers to a member that should be excluded. - IDataEquivalencyAssertionOptions Excluding(Expression> predicate); - - /// - /// Excludes a member of the objects under test from comparison by means of an that refers to the member in question. - /// - /// An that accesses the member to be excluded. - IDataEquivalencyAssertionOptions Excluding(Expression> expression); - - /// - /// Excludes an entire table from comparison. When comparing objects, if a table is present by the supplied name, it is not considered for the purpose of determining equivalency. This configuration option has no effect when comparing other types of object, including . - /// - /// The value for for which tables within a should be ignored. - IDataEquivalencyAssertionOptions ExcludingTable(string tableName); - - /// - /// Excludes tables from comparison using names in an set. When comparing objects, if a table is present by one of the supplied names, it is not considered for the purpose of determining equivalency. This configuration option has no effect when comparing other types of object, including . - /// - /// An of values for for which tables within a should be ignored. - IDataEquivalencyAssertionOptions ExcludingTables(IEnumerable tableNames); - - /// - /// Excludes tables from comparison using an array of table names. When comparing objects, if a table is present by one of the supplied names, it is not considered for the purpose of determining equivalency. This configuration option has no effect when comparing other types of object, including . - /// - /// An array of values for for which tables within a should be ignored. - IDataEquivalencyAssertionOptions ExcludingTables(params string[] tableNames); - - /// - /// Excludes a column from comparison by . The column to be excluded is matched by the name of its associated and its own . - /// - /// A object that specifies which column should be ignored. - /// - /// When comparing objects (e.g. within ), excluded columns are ignored completely. When comparing objects, the data associated with excluded columns is ignored. - /// - IDataEquivalencyAssertionOptions ExcludingColumn(DataColumn column); - - /// - /// Excludes a column from comparison by the name of its associated and its own . - /// - /// The value for for which columns should be ignored. - /// The value for for which columns should be ignored. - /// - /// When comparing objects (e.g. within ), excluded columns are ignored completely. When comparing objects, the data associated with excluded columns is ignored. - /// - IDataEquivalencyAssertionOptions ExcludingColumn(string tableName, string columnName); - - /// - /// Exclude an enumerable set of columns from comparison by . For each item in the enumeration, the column to be excluded is matched by the name of its associated and its own . - /// - /// An object that specifies which column(s) should be ignored. - /// - /// When comparing objects (e.g. within ), excluded columns are ignored completely. When comparing objects, the data associated with excluded columns is ignored. - /// - IDataEquivalencyAssertionOptions ExcludingColumns(IEnumerable columns); - - /// - /// Excludes an array of columns from comparison by . For each element in the array, the column to be excluded is matched by the name of its associated and its own . - /// - /// An array of objects that specify which columns should be ignored. - /// - /// When comparing objects (e.g. within ), excluded columns are ignored completely. When comparing objects, the data associated with excluded columns is ignored. - /// - IDataEquivalencyAssertionOptions ExcludingColumns(params DataColumn[] columns); - - /// - /// Excludes an enumerable set of columns from comparison by name, within tables with a specified name./>. - /// - /// The value for for which columns should be ignored. - /// An of values that specify the values for which columns should be ignored. - /// - /// When comparing objects (e.g. within ), excluded columns are ignored completely. When comparing objects, the data associated with excluded columns is ignored. - /// - IDataEquivalencyAssertionOptions ExcludingColumns(string tableName, IEnumerable columnNames); - - /// - /// Excludes an array of columns from comparison by name, within tables with a specified name./>. - /// - /// The value for for which columns should be ignored. - /// An array of values that specify the values for which columns should be ignored. - /// - /// When comparing objects (e.g. within ), excluded columns are ignored completely. When comparing objects, the data associated with excluded columns is ignored. - /// - IDataEquivalencyAssertionOptions ExcludingColumns(string tableName, params string[] columnNames); - - /// - /// Excludes columns from comparison by comparing only the . If columns exist by the same name in multiple objects within a , they are all excluded from comparison. - /// - /// The value for for which columns should be ignored. - /// - /// When comparing objects (e.g. within ), excluded columns are ignored completely. When comparing objects, the data associated with excluded columns is ignored. - /// - IDataEquivalencyAssertionOptions ExcludingColumnInAllTables(string columnName); - - /// - /// Excludes columns from comparison by comparing only the . If columns exist by the same name in multiple objects within a , they are all excluded from comparison. - /// - /// An of values that specify the values for which columns should be ignored. - /// - /// When comparing objects (e.g. within ), excluded columns are ignored completely. When comparing objects, the data associated with excluded columns is ignored. - /// - IDataEquivalencyAssertionOptions ExcludingColumnsInAllTables(IEnumerable columnNames); - - /// - /// Excludes columns from comparison by comparing only the . If columns exist by the same name in multiple objects within a , they are all excluded from comparison. - /// - /// An array of values that specify the values for which columns should be ignored. - /// - /// When comparing objects (e.g. within ), excluded columns are ignored completely. When comparing objects, the data associated with excluded columns is ignored. - /// - IDataEquivalencyAssertionOptions ExcludingColumnsInAllTables(params string[] columnNames); - - /// - /// Excludes properties of from comparison by means of an that refers to the member in question. - /// - /// An that accesses the member to be excluded. - IDataEquivalencyAssertionOptions ExcludingRelated(Expression> expression); - - /// - /// Excludes properties of from comparison by means of an that refers to the member in question. - /// - /// An that accesses the member to be excluded. - IDataEquivalencyAssertionOptions ExcludingRelated(Expression> expression); - - /// - /// Excludes properties of from comparison by means of an that refers to the member in question. - /// - /// An that accesses the member to be excluded. - IDataEquivalencyAssertionOptions ExcludingRelated(Expression> expression); - - /// - /// Excludes properties of from comparison by means of an that refers to the member in question. - /// - /// An that accesses the member to be excluded. - IDataEquivalencyAssertionOptions ExcludingRelated(Expression> expression); - - /// - /// Excludes properties of from comparison by means of an that refers to the member in question. - /// - /// An that accesses the member to be excluded. - IDataEquivalencyAssertionOptions ExcludingRelated(Expression> expression); - - /// - /// Excludes properties of from comparison by means of an that refers to the member in question. - /// - /// An that accesses the member to be excluded. - IDataEquivalencyAssertionOptions ExcludingRelated(Expression> expression); - - /// - /// Excludes properties of from comparison by means of an that refers to the member in question. - /// - /// An that accesses the member to be excluded. - IDataEquivalencyAssertionOptions ExcludingRelated(Expression> expression); -} diff --git a/Src/FluentAssertions/Data/RowMatchMode.cs b/Src/FluentAssertions/Data/RowMatchMode.cs deleted file mode 100644 index c36d737b32..0000000000 --- a/Src/FluentAssertions/Data/RowMatchMode.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Data; - -namespace FluentAssertions.Data; - -/// -/// Indicates how objects from different objects should be matched -/// up for equivalency comparisons. -/// -public enum RowMatchMode -{ - /// - /// Indicates that objects should be matched up by their index within the - /// collection. This is the default. - /// - Index, - - /// - /// Indicates that objects should be matched up by the values they have for - /// the table's . For this to work, the rows must be from - /// objects with exactly equivalent - /// configuration. - /// - PrimaryKey, -} diff --git a/Src/FluentAssertions/DataColumnCollectionAssertionExtensions.cs b/Src/FluentAssertions/DataColumnCollectionAssertionExtensions.cs deleted file mode 100644 index d830033eb8..0000000000 --- a/Src/FluentAssertions/DataColumnCollectionAssertionExtensions.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System; -using System.Data; -using System.Linq; -using FluentAssertions.Collections; -using FluentAssertions.Common; -using FluentAssertions.Execution; - -namespace FluentAssertions; - -public static class DataColumnCollectionAssertionExtensions -{ - /// - /// Asserts that an object reference refers to the exact same object as another object reference. - /// - /// The object that is being extended. - /// The expected object - /// - /// 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 . - /// - /// is . - public static AndConstraint> BeSameAs( - this GenericCollectionAssertions assertion, DataColumnCollection expected, string because = "", - params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull( - expected, nameof(expected), "Cannot verify same reference against a collection (use BeNull instead?)."); - - if (assertion.Subject is ICollectionWrapper wrapper) - { - var actualSubject = wrapper.UnderlyingCollection; - - Execute.Assertion - .UsingLineBreaks - .ForCondition(ReferenceEquals(actualSubject, expected)) - .BecauseOf(because, becauseArgs) - .FailWith( - "Expected {context:column collection} to refer to {0}{reason}, but found {1} (different underlying object).", - expected, actualSubject); - } - else - { - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith( - "Invalid expectation: Expected {context:column collection} to refer to an instance of " + - "DataColumnCollection{reason}, but found {0}.", - assertion.Subject); - } - - return new AndConstraint>(assertion); - } - - /// - /// Asserts that an object reference refers to a different object than another object reference refers to. - /// - /// The object that is being extended. - /// The unexpected object - /// - /// 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 . - /// - /// is . - public static AndConstraint> NotBeSameAs( - this GenericCollectionAssertions assertion, DataColumnCollection unexpected, string because = "", - params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull( - unexpected, nameof(unexpected), "Cannot verify same reference against a collection (use NotBeNull instead?)."); - - if (assertion.Subject is ICollectionWrapper wrapper) - { - var actualSubject = wrapper.UnderlyingCollection; - - Execute.Assertion - .UsingLineBreaks - .ForCondition(!ReferenceEquals(actualSubject, unexpected)) - .BecauseOf(because, becauseArgs) - .FailWith("Did not expect {context:column collection} to refer to {0}{reason}.", unexpected); - } - else - { - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith( - "Invalid expectation: Expected {context:column collection} to refer to a different instance of " + - "DataColumnCollection{reason}, but found {0}.", - assertion.Subject); - } - - return new AndConstraint>(assertion); - } - - /// - /// Assert that the current collection has the same number of elements as . - /// - /// The object that is being extended. - /// The other collection with the same expected number of elements - /// - /// 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 . - /// - /// is . - public static AndConstraint> HaveSameCount( - this GenericCollectionAssertions assertion, DataColumnCollection otherCollection, string because = "", - params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull( - otherCollection, nameof(otherCollection), "Cannot verify count against a collection."); - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to have ") - .Given(() => assertion.Subject) - .ForCondition(subject => subject is not null) - .FailWith("the same count as {0}{reason}, but found .", otherCollection) - .Then - .Given(subject => (actual: subject.Count(), expected: otherCollection.Count)) - .ForCondition(count => count.actual == count.expected) - .FailWith("{0} column(s){reason}, but found {1}.", count => count.expected, count => count.actual) - .Then - .ClearExpectation(); - - return new AndConstraint>(assertion); - } - - /// - /// Assert that the current collection of s does not have the same number of columns as - /// . - /// - /// The object that is being extended. - /// The other with the unexpected number of - /// elements - /// - /// 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 . - /// - /// is . - public static AndConstraint> NotHaveSameCount( - this GenericCollectionAssertions assertion, DataColumnCollection otherCollection, string because = "", - params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull( - otherCollection, nameof(otherCollection), "Cannot verify count against a collection."); - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to not have ") - .Given(() => assertion.Subject) - .ForCondition(subject => subject is not null) - .FailWith("the same count as {0}{reason}, but found .", otherCollection) - .Then - .Given(subject => (actual: subject.Count(), expected: otherCollection.Count)) - .ForCondition(count => count.actual != count.expected) - .FailWith("{0} column(s){reason}, but found {1}.", count => count.expected, count => count.actual) - .Then - .ClearExpectation(); - - return new AndConstraint>(assertion); - } -} diff --git a/Src/FluentAssertions/DataRowAssertionExtensions.cs b/Src/FluentAssertions/DataRowAssertionExtensions.cs deleted file mode 100644 index b48db92509..0000000000 --- a/Src/FluentAssertions/DataRowAssertionExtensions.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Data; -using System.Diagnostics; -using FluentAssertions.Data; -using JetBrains.Annotations; - -namespace FluentAssertions; - -/// -/// Contains an extension method for custom assertions in unit tests related to DataRow objects. -/// -[DebuggerNonUserCode] -public static class DataRowAssertionExtensions -{ - /// - /// Returns a object that can be used to assert the - /// current . - /// - [Pure] - public static DataRowAssertions Should(this TDataRow actualValue) - where TDataRow : DataRow - { - return new DataRowAssertions(actualValue); - } -} diff --git a/Src/FluentAssertions/DataRowCollectionAssertionExtensions.cs b/Src/FluentAssertions/DataRowCollectionAssertionExtensions.cs deleted file mode 100644 index 3e5f04df8e..0000000000 --- a/Src/FluentAssertions/DataRowCollectionAssertionExtensions.cs +++ /dev/null @@ -1,161 +0,0 @@ -using System; -using System.Data; -using System.Linq; -using FluentAssertions.Collections; -using FluentAssertions.Common; -using FluentAssertions.Execution; - -namespace FluentAssertions; - -public static class DataRowCollectionAssertionExtensions -{ - /// - /// Asserts that an object reference refers to the exact same object as another object reference. - /// - /// The expected object - /// - /// 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 static AndConstraint> BeSameAs( - this GenericCollectionAssertions assertion, DataRowCollection expected, string because = "", - params object[] becauseArgs) - { - if (assertion.Subject is ICollectionWrapper wrapper) - { - var actualSubject = wrapper.UnderlyingCollection; - - Execute.Assertion - .UsingLineBreaks - .ForCondition(ReferenceEquals(actualSubject, expected)) - .BecauseOf(because, becauseArgs) - .FailWith( - "Expected {context:row collection} to refer to {0}{reason}, but found {1} (different underlying object).", - expected, actualSubject); - } - else - { - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith( - "Invalid expectation: Expected {context:column collection} to refer to an instance of " + - "DataRowCollection{reason}, but found {0}.", - assertion.Subject); - } - - return new AndConstraint>(assertion); - } - - /// - /// Asserts that an object reference refers to a different object than another object reference refers to. - /// - /// The unexpected object - /// - /// 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 static AndConstraint> NotBeSameAs( - this GenericCollectionAssertions assertion, DataRowCollection unexpected, string because = "", - params object[] becauseArgs) - { - if (assertion.Subject is ICollectionWrapper wrapper) - { - var actualSubject = wrapper.UnderlyingCollection; - - Execute.Assertion - .UsingLineBreaks - .ForCondition(!ReferenceEquals(actualSubject, unexpected)) - .BecauseOf(because, becauseArgs) - .FailWith("Did not expect {context:row collection} to refer to {0}{reason}.", unexpected); - } - else - { - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith( - "Invalid expectation: Expected {context:column collection} to refer to a different instance of " + - "DataRowCollection{reason}, but found {0}.", - assertion.Subject); - } - - return new AndConstraint>(assertion); - } - - /// - /// Assert that the current collection of s has the same number of rows as - /// . - /// - /// The other collection with the same expected number of elements - /// - /// 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 . - /// - /// is . - public static AndConstraint> HaveSameCount( - this GenericCollectionAssertions assertion, DataRowCollection otherCollection, string because = "", - params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull( - otherCollection, nameof(otherCollection), "Cannot verify count against a collection."); - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to have ") - .Given(() => assertion.Subject) - .ForCondition(subject => subject is not null) - .FailWith("the same count as {0}{reason}, but found .", otherCollection) - .Then - .Given(subject => (actual: subject.Count(), expected: otherCollection.Count)) - .ForCondition(count => count.actual == count.expected) - .FailWith("{0} row(s){reason}, but found {1}.", count => count.expected, count => count.actual) - .Then - .ClearExpectation(); - - return new AndConstraint>(assertion); - } - - /// - /// Assert that the current collection of s does not have the same number of rows as - /// . - /// - /// The other with the unexpected number of elements - /// - /// 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 . - /// - /// is . - public static AndConstraint> NotHaveSameCount( - this GenericCollectionAssertions assertion, DataRowCollection otherCollection, string because = "", - params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull( - otherCollection, nameof(otherCollection), "Cannot verify count against a collection."); - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to not have ") - .Given(() => assertion.Subject) - .ForCondition(subject => subject is not null) - .FailWith("the same count as {0}{reason}, but found .", otherCollection) - .Then - .Given(subject => (actual: subject.Count(), expected: otherCollection.Count)) - .ForCondition(count => count.actual != count.expected) - .FailWith("{0} row(s){reason}, but found {1}.", count => count.expected, count => count.actual) - .Then - .ClearExpectation(); - - return new AndConstraint>(assertion); - } -} diff --git a/Src/FluentAssertions/DataSetAssertionExtensions.cs b/Src/FluentAssertions/DataSetAssertionExtensions.cs deleted file mode 100644 index e993ddf88b..0000000000 --- a/Src/FluentAssertions/DataSetAssertionExtensions.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Data; -using System.Diagnostics; -using FluentAssertions.Data; -using JetBrains.Annotations; - -namespace FluentAssertions; - -/// -/// Contains an extension method for custom assertions in unit tests related to DataSet objects. -/// -[DebuggerNonUserCode] -public static class DataSetAssertionExtensions -{ - /// - /// Returns a object that can be used to assert the - /// current . - /// - [Pure] - public static DataSetAssertions Should(this TDataSet actualValue) - where TDataSet : DataSet - { - return new DataSetAssertions(actualValue); - } -} diff --git a/Src/FluentAssertions/DataTableAssertionExtensions.cs b/Src/FluentAssertions/DataTableAssertionExtensions.cs deleted file mode 100644 index ee7ea0e191..0000000000 --- a/Src/FluentAssertions/DataTableAssertionExtensions.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Data; -using System.Diagnostics; -using FluentAssertions.Data; -using JetBrains.Annotations; - -namespace FluentAssertions; - -/// -/// Contains an extension method for custom assertions in unit tests related to DataTable objects. -/// -[DebuggerNonUserCode] -public static class DataTableAssertionExtensions -{ - /// - /// Returns a object that can be used to assert the - /// current . - /// - [Pure] - public static DataTableAssertions Should(this TDataTable actualValue) - where TDataTable : DataTable - { - return new DataTableAssertions(actualValue); - } -} diff --git a/Src/FluentAssertions/DataTableCollectionAssertionExtensions.cs b/Src/FluentAssertions/DataTableCollectionAssertionExtensions.cs deleted file mode 100644 index f9c0f7c1b2..0000000000 --- a/Src/FluentAssertions/DataTableCollectionAssertionExtensions.cs +++ /dev/null @@ -1,199 +0,0 @@ -using System; -using System.Data; -using System.Linq; -using FluentAssertions.Collections; -using FluentAssertions.Common; -using FluentAssertions.Execution; - -namespace FluentAssertions; - -public static class DataTableCollectionAssertionExtensions -{ - /// - /// Asserts that an object reference refers to the exact same object as another object reference. - /// - /// The expected object - /// - /// 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 static AndConstraint> BeSameAs( - this GenericCollectionAssertions assertion, DataTableCollection expected, string because = "", - params object[] becauseArgs) - { - if (assertion.Subject is ICollectionWrapper wrapper) - { - var actualSubject = wrapper.UnderlyingCollection; - - Execute.Assertion - .UsingLineBreaks - .ForCondition(ReferenceEquals(actualSubject, expected)) - .BecauseOf(because, becauseArgs) - .FailWith( - "Expected {context:table collection} to refer to {0}{reason}, but found {1} (different underlying object).", - expected, actualSubject); - } - else - { - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith( - "Invalid expectation: Expected {context:column collection} to refer to an instance of " + - "DataTableCollection{reason}, but found {0}.", - assertion.Subject); - } - - return new AndConstraint>(assertion); - } - - /// - /// Asserts that an object reference refers to a different object than another object reference refers to. - /// - /// The unexpected object - /// - /// 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 static AndConstraint> NotBeSameAs( - this GenericCollectionAssertions assertion, DataTableCollection unexpected, string because = "", - params object[] becauseArgs) - { - if (assertion.Subject is ICollectionWrapper wrapper) - { - var actualSubject = wrapper.UnderlyingCollection; - - Execute.Assertion - .UsingLineBreaks - .ForCondition(!ReferenceEquals(actualSubject, unexpected)) - .BecauseOf(because, becauseArgs) - .FailWith("Did not expect {context:table collection} to refer to {0}{reason}.", unexpected); - } - else - { - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith( - "Invalid expectation: Expected {context:column collection} to refer to a different instance of " + - "DataTableCollection{reason}, but found {0}.", - assertion.Subject); - } - - return new AndConstraint>(assertion); - } - - /// - /// Assert that the current collection of s has the same number of tables as - /// . - /// - /// The other with the same expected number of tables - /// - /// 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 static AndConstraint> HaveSameCount( - this GenericCollectionAssertions assertion, DataSet otherDataSet, string because = "", - params object[] becauseArgs) - { - return assertion.HaveSameCount(otherDataSet.Tables, because, becauseArgs); - } - - /// - /// Assert that the current collection of s does not have the same number of tables as - /// . - /// - /// The other with the unexpected number of tables - /// - /// 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 static AndConstraint> NotHaveSameCount( - this GenericCollectionAssertions assertion, DataSet otherDataSet, string because = "", - params object[] becauseArgs) - { - return assertion.NotHaveSameCount(otherDataSet.Tables, because, becauseArgs); - } - - /// - /// Assert that the current collection of s has the same number of tables as - /// . - /// - /// The other with the same expected number of tables - /// - /// 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 . - /// - /// is . - public static AndConstraint> HaveSameCount( - this GenericCollectionAssertions assertion, DataTableCollection otherCollection, string because = "", - params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull( - otherCollection, nameof(otherCollection), "Cannot verify count against a collection."); - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to have ") - .Given(() => assertion.Subject) - .ForCondition(subject => subject is not null) - .FailWith("the same count as {0}{reason}, but found .", otherCollection) - .Then - .Given(subject => (actual: subject.Count(), expected: otherCollection.Count)) - .ForCondition(count => count.actual == count.expected) - .FailWith("{0} table(s){reason}, but found {1}.", count => count.expected, count => count.actual) - .Then - .ClearExpectation(); - - return new AndConstraint>(assertion); - } - - /// - /// Assert that the current collection of s does not have the same number of tables as - /// . - /// - /// The other with the unexpected number of tables - /// - /// 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 . - /// - /// is . - public static AndConstraint> NotHaveSameCount( - this GenericCollectionAssertions assertion, DataTableCollection otherCollection, string because = "", - params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull( - otherCollection, nameof(otherCollection), "Cannot verify count against a collection."); - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to not have ") - .Given(() => assertion.Subject) - .ForCondition(subject => subject is not null) - .FailWith("the same count as {0}{reason}, but found .", otherCollection) - .Then - .Given(subject => (actual: subject.Count(), expected: otherCollection.Count)) - .ForCondition(count => count.actual != count.expected) - .FailWith("{0} table(s){reason}, but found {1}.", count => count.expected, count => count.actual) - .Then - .ClearExpectation(); - - return new AndConstraint>(assertion); - } -} diff --git a/Src/FluentAssertions/Equivalency/Steps/ConstraintCollectionEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/ConstraintCollectionEquivalencyStep.cs deleted file mode 100644 index 991692215b..0000000000 --- a/Src/FluentAssertions/Equivalency/Steps/ConstraintCollectionEquivalencyStep.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Collections.Generic; -using System.Data; -using System.Linq; -using FluentAssertions.Execution; - -namespace FluentAssertions.Equivalency.Steps; - -public class ConstraintCollectionEquivalencyStep : EquivalencyStep -{ - protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) - { - if (comparands.Subject is not ConstraintCollection) - { - AssertionScope.Current - .FailWith("Expected a value of type ConstraintCollection at {context:Constraints}, but found {0}", - comparands.Subject.GetType()); - } - else - { - var subject = (ConstraintCollection)comparands.Subject; - var expectation = (ConstraintCollection)comparands.Expectation; - - var subjectConstraints = subject.Cast().ToDictionary(constraint => constraint.ConstraintName); - var expectationConstraints = expectation.Cast().ToDictionary(constraint => constraint.ConstraintName); - - IEnumerable constraintNames = subjectConstraints.Keys.Union(expectationConstraints.Keys); - - foreach (var constraintName in constraintNames) - { - AssertionScope.Current - .ForCondition(subjectConstraints.TryGetValue(constraintName, out Constraint subjectConstraint)) - .FailWith("Expected constraint named {0} in {context:Constraints collection}{reason}, but did not find one", - constraintName); - - AssertionScope.Current - .ForCondition(expectationConstraints.TryGetValue(constraintName, out Constraint expectationConstraint)) - .FailWith("Found unexpected constraint named {0} in {context:Constraints collection}", constraintName); - - if (subjectConstraint is not null && expectationConstraint is not null) - { - Comparands newComparands = new() - { - Subject = subjectConstraint, - Expectation = expectationConstraint, - CompileTimeType = typeof(Constraint) - }; - - IEquivalencyValidationContext nestedContext = context.AsCollectionItem(constraintName); - nestedValidator.RecursivelyAssertEquality(newComparands, nestedContext); - } - } - } - - return EquivalencyResult.AssertionCompleted; - } -} diff --git a/Src/FluentAssertions/Equivalency/Steps/ConstraintEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/ConstraintEquivalencyStep.cs deleted file mode 100644 index 4eb8c9ce1b..0000000000 --- a/Src/FluentAssertions/Equivalency/Steps/ConstraintEquivalencyStep.cs +++ /dev/null @@ -1,286 +0,0 @@ -using System.Collections.Generic; -using System.Data; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Text; -using FluentAssertions.Execution; -using FluentAssertions.Formatting; - -namespace FluentAssertions.Equivalency.Steps; - -public class ConstraintEquivalencyStep : EquivalencyStep -{ - protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) - { - if (comparands.Subject is not Constraint) - { - AssertionScope.Current - .FailWith("Expected {context:constraint} to be a value of type Constraint, but found {0}", - comparands.Subject.GetType()); - } - else - { - var subject = (Constraint)comparands.Subject; - var expectation = (Constraint)comparands.Expectation; - - var selectedMembers = GetMembersFromExpectation(comparands, context.CurrentNode, context.Options) - .ToDictionary(member => member.Name); - - CompareCommonProperties(context, nestedValidator, context.Options, subject, expectation, selectedMembers); - - bool matchingType = subject.GetType() == expectation.GetType(); - - AssertionScope.Current - .ForCondition(matchingType) - .FailWith("Expected {context:constraint} to be of type {0}, but found {1}", expectation.GetType(), - subject.GetType()); - - if (matchingType) - { - if (subject is UniqueConstraint subjectUniqueConstraint - && expectation is UniqueConstraint expectationUniqueConstraint) - { - CompareConstraints(nestedValidator, context, subjectUniqueConstraint, expectationUniqueConstraint, - selectedMembers); - } - else if (subject is ForeignKeyConstraint subjectForeignKeyConstraint - && expectation is ForeignKeyConstraint expectationForeignKeyConstraint) - { - CompareConstraints(nestedValidator, context, subjectForeignKeyConstraint, expectationForeignKeyConstraint, - selectedMembers); - } - else - { - AssertionScope.Current - .FailWith("Don't know how to handle {constraint:a Constraint} of type {0}", subject.GetType()); - } - } - } - - return EquivalencyResult.AssertionCompleted; - } - - private static void CompareCommonProperties(IEquivalencyValidationContext context, IEquivalencyValidator parent, - IEquivalencyAssertionOptions options, Constraint subject, Constraint expectation, - Dictionary selectedMembers) - { - if (selectedMembers.ContainsKey("ConstraintName")) - { - AssertionScope.Current - .ForCondition(subject.ConstraintName == expectation.ConstraintName) - .FailWith("Expected {context:constraint} to have a ConstraintName of {0}{reason}, but found {1}", - expectation.ConstraintName, subject.ConstraintName); - } - - if (selectedMembers.ContainsKey("Table")) - { - AssertionScope.Current - .ForCondition(subject.Table.TableName == expectation.Table.TableName) - .FailWith( - "Expected {context:constraint} to be associated with a Table with TableName of {0}{reason}, but found {1}", - expectation.Table.TableName, subject.Table.TableName); - } - - if (selectedMembers.TryGetValue("ExtendedProperties", out IMember expectationMember)) - { - IMember matchingMember = FindMatchFor(expectationMember, context.CurrentNode, subject, options); - - if (matchingMember is not null) - { - var nestedComparands = new Comparands - { - Subject = matchingMember.GetValue(subject), - Expectation = expectationMember.GetValue(expectation), - CompileTimeType = expectationMember.Type - }; - - parent.RecursivelyAssertEquality(nestedComparands, context.AsNestedMember(expectationMember)); - } - } - } - - private static void CompareConstraints(IEquivalencyValidator parent, IEquivalencyValidationContext context, - UniqueConstraint subject, UniqueConstraint expectation, Dictionary selectedMembers) - { - AssertionScope.Current - .ForCondition(subject.ConstraintName == expectation.ConstraintName) - .FailWith("Expected {context:constraint} to be named {0}{reason}, but found {1}", expectation.ConstraintName, - subject.ConstraintName); - - var nestedMember = new Property( - typeof(Constraint).GetProperty(nameof(subject.ExtendedProperties)), - context.CurrentNode); - - var nestedComparands = new Comparands - { - Subject = nestedMember.GetValue(subject), - Expectation = nestedMember.GetValue(expectation), - CompileTimeType = nestedMember.Type - }; - - parent.RecursivelyAssertEquality(nestedComparands, context.AsNestedMember(nestedMember)); - - if (selectedMembers.ContainsKey(nameof(expectation.IsPrimaryKey))) - { - AssertionScope.Current - .ForCondition(subject.IsPrimaryKey == expectation.IsPrimaryKey) - .FailWith("Expected {context:constraint} to be a {0} constraint{reason}, but found a {1} constraint", - expectation.IsPrimaryKey ? "Primary Key" : "Foreign Key", - subject.IsPrimaryKey ? "Primary Key" : "Foreign Key"); - } - - if (selectedMembers.ContainsKey(nameof(expectation.Columns))) - { - CompareConstraintColumns(subject.Columns, expectation.Columns); - } - } - - [SuppressMessage("Design", "MA0051:Method is too long", Justification = "Needs to be refactored")] - private static void CompareConstraints(IEquivalencyValidator parent, IEquivalencyValidationContext context, - ForeignKeyConstraint subject, ForeignKeyConstraint expectation, Dictionary selectedMembers) - { - AssertionScope.Current - .ForCondition(subject.ConstraintName == expectation.ConstraintName) - .FailWith("Expected {context:constraint} to be named {0}{reason}, but found {1}", expectation.ConstraintName, - subject.ConstraintName); - - var nestedMember = new Property( - typeof(Constraint).GetProperty(nameof(subject.ExtendedProperties)), - context.CurrentNode); - - var nestedComparands = new Comparands - { - Subject = nestedMember.GetValue(subject), - Expectation = nestedMember.GetValue(expectation), - CompileTimeType = nestedMember.Type - }; - - parent.RecursivelyAssertEquality(nestedComparands, context.AsNestedMember(nestedMember)); - - if (selectedMembers.ContainsKey(nameof(expectation.RelatedTable))) - { - AssertionScope.Current - .ForCondition(subject.RelatedTable.TableName == expectation.RelatedTable.TableName) - .FailWith("Expected {context:constraint} to have a related table named {0}{reason}, but found {1}", - expectation.RelatedTable.TableName, subject.RelatedTable.TableName); - } - - if (selectedMembers.ContainsKey(nameof(expectation.AcceptRejectRule))) - { - AssertionScope.Current - .ForCondition(subject.AcceptRejectRule == expectation.AcceptRejectRule) - .FailWith( - "Expected {context:constraint} to have AcceptRejectRule.{0}{reason}, but found AcceptRejectRule.{1}", - expectation.AcceptRejectRule, subject.AcceptRejectRule); - } - - if (selectedMembers.ContainsKey(nameof(expectation.DeleteRule))) - { - AssertionScope.Current - .ForCondition(subject.DeleteRule == expectation.DeleteRule) - .FailWith("Expected {context:constraint} to have DeleteRule Rule.{0}{reason}, but found Rule.{1}", - expectation.DeleteRule, subject.DeleteRule); - } - - if (selectedMembers.ContainsKey(nameof(expectation.UpdateRule))) - { - AssertionScope.Current - .ForCondition(subject.UpdateRule == expectation.UpdateRule) - .FailWith("Expected {context:constraint} to have UpdateRule Rule.{0}{reason}, but found Rule.{1}", - expectation.UpdateRule, subject.UpdateRule); - } - - if (selectedMembers.ContainsKey(nameof(expectation.Columns))) - { - CompareConstraintColumns(subject.Columns, expectation.Columns); - } - - if (selectedMembers.ContainsKey(nameof(expectation.RelatedColumns))) - { - CompareConstraintColumns(subject.RelatedColumns, expectation.RelatedColumns); - } - } - - private static void CompareConstraintColumns(DataColumn[] subjectColumns, DataColumn[] expectationColumns) - { - var subjectColumnNames = new HashSet(subjectColumns.Select(col => col.ColumnName)); - var expectationColumnNames = new HashSet(expectationColumns.Select(col => col.ColumnName)); - - var missingColumnNames = expectationColumnNames.Except(subjectColumnNames).ToList(); - var extraColumnNames = subjectColumnNames.Except(expectationColumnNames).ToList(); - - var failureMessage = new StringBuilder(); - - if (missingColumnNames.Count > 0) - { - failureMessage.Append("Expected {context:constraint} to include "); - - if (missingColumnNames.Count == 1) - { - failureMessage.Append("column ").Append(missingColumnNames.Single()); - } - else - { - failureMessage.Append("columns ").Append(missingColumnNames.JoinUsingWritingStyle()); - } - - failureMessage - .Append("{reason}, but constraint does not include ") - .Append(missingColumnNames.Count == 1 - ? "that column. " - : "these columns. "); - } - - if (extraColumnNames.Count > 0) - { - failureMessage.Append("Did not expect {context:constraint} to include "); - - if (extraColumnNames.Count == 1) - { - failureMessage.Append("column ").Append(extraColumnNames.Single()); - } - else - { - failureMessage.Append("columns ").Append(extraColumnNames.JoinUsingWritingStyle()); - } - - failureMessage.Append("{reason}, but it does."); - } - - bool successful = failureMessage.Length == 0; - - AssertionScope.Current - .ForCondition(successful) - .FailWith(failureMessage.ToString()); - } - - private static IMember FindMatchFor(IMember selectedMemberInfo, INode currentNode, object subject, - IEquivalencyAssertionOptions config) - { - IEnumerable query = - from rule in config.MatchingRules - let match = rule.Match(selectedMemberInfo, subject, currentNode, config) - where match is not null - select match; - - return query.FirstOrDefault(); - } - - private static IEnumerable GetMembersFromExpectation(Comparands comparands, INode currentNode, - IEquivalencyAssertionOptions options) - { - IEnumerable members = Enumerable.Empty(); - - foreach (IMemberSelectionRule rule in options.SelectionRules) - { - // Within a ConstraintCollection, different types of Constraint are kept polymorphically. - // As such, the concept of "compile-time type" isn't meaningful, and we override this - // with the discovered type of the constraint at runtime. - members = rule.SelectMembers(currentNode, members, - new MemberSelectionContext(comparands.RuntimeType, comparands.RuntimeType, options)); - } - - return members; - } -} diff --git a/Src/FluentAssertions/Equivalency/Steps/DataColumnEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/DataColumnEquivalencyStep.cs deleted file mode 100644 index 0d0e80d72e..0000000000 --- a/Src/FluentAssertions/Equivalency/Steps/DataColumnEquivalencyStep.cs +++ /dev/null @@ -1,142 +0,0 @@ -using System.Collections.Generic; -using System.Data; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using FluentAssertions.Data; -using FluentAssertions.Execution; - -namespace FluentAssertions.Equivalency.Steps; - -public class DataColumnEquivalencyStep : EquivalencyStep -{ - [SuppressMessage("Style", "IDE0019:Use pattern matching", Justification = "The code is easier to read without it.")] - protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) - { - var subject = comparands.Subject as DataColumn; - var expectation = comparands.Expectation as DataColumn; - - if (expectation is null) - { - if (subject is not null) - { - AssertionScope.Current.FailWith("Expected {context:DataColumn} value to be null, but found {0}", subject); - } - } - else if (subject is null) - { - if (comparands.Subject is null) - { - AssertionScope.Current.FailWith("Expected {context:DataColumn} to be non-null, but found null"); - } - else - { - AssertionScope.Current.FailWith("Expected {context:DataColumn} to be of type {0}, but found {1} instead", - expectation.GetType(), comparands.Subject.GetType()); - } - } - else - { - CompareSubjectAndExpectationOfTypeDataColumn(comparands, context, nestedValidator, subject); - } - - return EquivalencyResult.AssertionCompleted; - } - - private static void CompareSubjectAndExpectationOfTypeDataColumn(Comparands comparands, - IEquivalencyValidationContext context, IEquivalencyValidator parent, DataColumn subject) - { - bool compareColumn = true; - - var dataSetConfig = context.Options as DataEquivalencyAssertionOptions; - var dataTableConfig = context.Options as DataEquivalencyAssertionOptions; - var dataColumnConfig = context.Options as DataEquivalencyAssertionOptions; - - if (dataSetConfig?.ShouldExcludeColumn(subject) == true - || dataTableConfig?.ShouldExcludeColumn(subject) == true - || dataColumnConfig?.ShouldExcludeColumn(subject) == true) - { - compareColumn = false; - } - - if (compareColumn) - { - foreach (IMember expectationMember in GetMembersFromExpectation(context.CurrentNode, comparands, context.Options)) - { - if (expectationMember.Name != nameof(subject.Table)) - { - CompareMember(expectationMember, comparands, parent, context); - } - } - } - } - - private static void CompareMember(IMember expectationMember, Comparands comparands, IEquivalencyValidator parent, - IEquivalencyValidationContext context) - { - IMember matchingMember = FindMatchFor(expectationMember, comparands.Subject, context); - - if (matchingMember is not null) - { - var nestedComparands = new Comparands - { - Subject = matchingMember.GetValue(comparands.Subject), - Expectation = expectationMember.GetValue(comparands.Expectation), - CompileTimeType = expectationMember.Type - }; - - if (context.AsNestedMember(expectationMember) is not null) - { - parent.RecursivelyAssertEquality(nestedComparands, context.AsNestedMember(expectationMember)); - } - } - } - - private static IMember FindMatchFor(IMember selectedMemberInfo, object subject, IEquivalencyValidationContext context) - { - IEnumerable query = - from rule in context.Options.MatchingRules - let match = rule.Match(selectedMemberInfo, subject, context.CurrentNode, context.Options) - where match is not null - select match; - - return query.FirstOrDefault(); - } - - // NOTE: This list of candidate members is duplicated in the XML documentation for the - // DataColumn.BeEquivalentTo extension method in DataColumnAssertions.cs. If this ever - // needs to change, keep them in sync. - private static readonly HashSet CandidateMembers = new() - { - nameof(DataColumn.AllowDBNull), - nameof(DataColumn.AutoIncrement), - nameof(DataColumn.AutoIncrementSeed), - nameof(DataColumn.AutoIncrementStep), - nameof(DataColumn.Caption), - nameof(DataColumn.ColumnName), - nameof(DataColumn.DataType), - nameof(DataColumn.DateTimeMode), - nameof(DataColumn.DefaultValue), - nameof(DataColumn.Expression), - nameof(DataColumn.ExtendedProperties), - nameof(DataColumn.MaxLength), - nameof(DataColumn.Namespace), - nameof(DataColumn.Prefix), - nameof(DataColumn.ReadOnly), - nameof(DataColumn.Unique), - }; - - private static IEnumerable GetMembersFromExpectation(INode currentNode, Comparands comparands, - IEquivalencyAssertionOptions config) - { - IEnumerable members = Enumerable.Empty(); - - foreach (IMemberSelectionRule rule in config.SelectionRules) - { - members = rule.SelectMembers(currentNode, members, - new MemberSelectionContext(comparands.CompileTimeType, comparands.RuntimeType, config)); - } - - return members.Where(member => CandidateMembers.Contains(member.Name)); - } -} diff --git a/Src/FluentAssertions/Equivalency/Steps/DataRelationEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/DataRelationEquivalencyStep.cs deleted file mode 100644 index 0ec9c92051..0000000000 --- a/Src/FluentAssertions/Equivalency/Steps/DataRelationEquivalencyStep.cs +++ /dev/null @@ -1,244 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using FluentAssertions.Execution; - -namespace FluentAssertions.Equivalency.Steps; - -public class DataRelationEquivalencyStep : EquivalencyStep -{ - [SuppressMessage("Style", "IDE0019:Use pattern matching", Justification = "The code is easier to read without it.")] - protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) - { - var subject = comparands.Subject as DataRelation; - var expectation = comparands.Expectation as DataRelation; - - if (expectation is null) - { - if (subject is not null) - { - AssertionScope.Current.FailWith("Expected {context:DataRelation} to be null, but found {0}", subject); - } - } - else if (subject is null) - { - if (comparands.Subject is null) - { - AssertionScope.Current.FailWith("Expected {context:DataRelation} value to be non-null, but found null"); - } - else - { - AssertionScope.Current.FailWith("Expected {context:DataRelation} of type {0}, but found {1} instead", - expectation.GetType(), comparands.Subject.GetType()); - } - } - else - { - var selectedMembers = GetMembersFromExpectation(context.CurrentNode, comparands, context.Options) - .ToDictionary(member => member.Name); - - CompareScalarProperties(subject, expectation, selectedMembers); - - CompareCollections(context, comparands, nestedValidator, context.Options, selectedMembers); - - CompareRelationConstraints(context, nestedValidator, subject, expectation, selectedMembers); - } - - return EquivalencyResult.AssertionCompleted; - } - - private static void CompareScalarProperties(DataRelation subject, DataRelation expectation, - Dictionary selectedMembers) - { - if (selectedMembers.ContainsKey(nameof(expectation.RelationName))) - { - AssertionScope.Current - .ForCondition(subject.RelationName == expectation.RelationName) - .FailWith("Expected {context:DataRelation} to have RelationName of {0}{reason}, but found {1}", - expectation.RelationName, subject.RelationName); - } - - if (selectedMembers.ContainsKey(nameof(expectation.Nested))) - { - AssertionScope.Current - .ForCondition(subject.Nested == expectation.Nested) - .FailWith("Expected {context:DataRelation} to have Nested value of {0}{reason}, but found {1}", - expectation.Nested, subject.Nested); - } - - // Special case: Compare name only - if (selectedMembers.ContainsKey(nameof(expectation.DataSet))) - { - AssertionScope.Current - .ForCondition(subject.DataSet?.DataSetName == expectation.DataSet?.DataSetName) - .FailWith("Expected containing DataSet of {context:DataRelation} to be {0}{reason}, but found {1}", - expectation.DataSet?.DataSetName ?? "", - subject.DataSet?.DataSetName ?? ""); - } - } - - private static void CompareCollections(IEquivalencyValidationContext context, Comparands comparands, - IEquivalencyValidator parent, - IEquivalencyAssertionOptions config, Dictionary selectedMembers) - { - if (selectedMembers.TryGetValue(nameof(DataRelation.ExtendedProperties), out IMember expectationMember)) - { - IMember matchingMember = FindMatchFor(expectationMember, context.CurrentNode, comparands.Subject, config); - - if (matchingMember is not null) - { - var nestedComparands = new Comparands - { - Subject = matchingMember.GetValue(comparands.Subject), - Expectation = expectationMember.GetValue(comparands.Expectation), - CompileTimeType = expectationMember.Type - }; - - parent.RecursivelyAssertEquality(nestedComparands, context.AsNestedMember(expectationMember)); - } - } - } - - private static void CompareRelationConstraints(IEquivalencyValidationContext context, IEquivalencyValidator parent, - DataRelation subject, DataRelation expectation, - Dictionary selectedMembers) - { - CompareDataRelationConstraints( - parent, context, subject, expectation, selectedMembers, - "Child", - selectedMembers.ContainsKey(nameof(DataRelation.ChildTable)), - selectedMembers.ContainsKey(nameof(DataRelation.ChildColumns)), - selectedMembers.ContainsKey(nameof(DataRelation.ChildKeyConstraint)), - r => r.ChildColumns, - r => r.ChildTable); - - CompareDataRelationConstraints( - parent, context, subject, expectation, selectedMembers, - "Parent", - selectedMembers.ContainsKey(nameof(DataRelation.ParentTable)), - selectedMembers.ContainsKey(nameof(DataRelation.ParentColumns)), - selectedMembers.ContainsKey(nameof(DataRelation.ParentKeyConstraint)), - r => r.ParentColumns, - r => r.ParentTable); - } - - private static void CompareDataRelationConstraints( - IEquivalencyValidator parent, IEquivalencyValidationContext context, - DataRelation subject, DataRelation expectation, Dictionary selectedMembers, - string relationDirection, - bool compareTable, bool compareColumns, bool compareKeyConstraint, - Func getColumns, - Func getOtherTable) - { - if (compareColumns) - { - CompareDataRelationColumns(subject, expectation, getColumns); - } - - if (compareTable) - { - CompareDataRelationTable(subject, expectation, getOtherTable); - } - - if (compareKeyConstraint) - { - CompareDataRelationKeyConstraint(subject, expectation, parent, context, selectedMembers, relationDirection); - } - } - - private static void CompareDataRelationColumns(DataRelation subject, DataRelation expectation, - Func getColumns) - { - DataColumn[] subjectColumns = getColumns(subject); - DataColumn[] expectationColumns = getColumns(expectation); - - // These column references are in different tables in different data sets that _should_ be equivalent - // to one another. - bool success = AssertionScope.Current - .ForCondition(subjectColumns.Length == expectationColumns.Length) - .FailWith("Expected {context:DataRelation} to reference {0} column(s){reason}, but found {subjectColumns.Length}", - expectationColumns.Length, subjectColumns.Length); - - if (success) - { - for (int i = 0; i < expectationColumns.Length; i++) - { - DataColumn subjectColumn = subjectColumns[i]; - DataColumn expectationColumn = expectationColumns[i]; - - bool columnsAreEquivalent = - subjectColumn.Table.TableName == expectationColumn.Table.TableName && - subjectColumn.ColumnName == expectationColumn.ColumnName; - - AssertionScope.Current - .ForCondition(columnsAreEquivalent) - .FailWith( - "Expected {context:DataRelation} to reference column {0} in table {1}{reason}, but found a reference to {2} in table {3} instead", - expectationColumn.ColumnName, - expectationColumn.Table.TableName, - subjectColumn.ColumnName, - subjectColumn.Table.TableName); - } - } - } - - private static void CompareDataRelationTable(DataRelation subject, DataRelation expectation, - Func getOtherTable) - { - DataTable subjectTable = getOtherTable(subject); - DataTable expectationTable = getOtherTable(expectation); - - AssertionScope.Current - .ForCondition(subjectTable.TableName == expectationTable.TableName) - .FailWith("Expected {context:DataRelation} to reference a table named {0}{reason}, but found {1} instead", - expectationTable.TableName, subjectTable.TableName); - } - - private static void CompareDataRelationKeyConstraint(DataRelation subject, DataRelation expectation, - IEquivalencyValidator parent, IEquivalencyValidationContext context, Dictionary selectedMembers, - string relationDirection) - { - if (selectedMembers.TryGetValue(relationDirection + "KeyConstraint", out IMember expectationMember)) - { - IMember subjectMember = FindMatchFor(expectationMember, context.CurrentNode, subject, context.Options); - - var newComparands = new Comparands - { - Subject = subjectMember.GetValue(subject), - Expectation = expectationMember.GetValue(expectation), - CompileTimeType = expectationMember.Type - }; - - parent.RecursivelyAssertEquality(newComparands, context.AsNestedMember(expectationMember)); - } - } - - private static IMember FindMatchFor(IMember selectedMemberInfo, INode currentNode, object subject, - IEquivalencyAssertionOptions config) - { - IEnumerable query = - from rule in config.MatchingRules - let match = rule.Match(selectedMemberInfo, subject, currentNode, config) - where match is not null - select match; - - return query.FirstOrDefault(); - } - - private static IEnumerable GetMembersFromExpectation(INode currentNode, Comparands comparands, - IEquivalencyAssertionOptions config) - { - IEnumerable members = Enumerable.Empty(); - - foreach (IMemberSelectionRule rule in config.SelectionRules) - { - members = rule.SelectMembers(currentNode, members, - new MemberSelectionContext(comparands.CompileTimeType, comparands.RuntimeType, config)); - } - - return members; - } -} diff --git a/Src/FluentAssertions/Equivalency/Steps/DataRowCollectionEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/DataRowCollectionEquivalencyStep.cs deleted file mode 100644 index 62d434b11d..0000000000 --- a/Src/FluentAssertions/Equivalency/Steps/DataRowCollectionEquivalencyStep.cs +++ /dev/null @@ -1,244 +0,0 @@ -using System; -using System.Data; -using System.Linq; -using FluentAssertions.Data; -using FluentAssertions.Execution; - -namespace FluentAssertions.Equivalency.Steps; - -public class DataRowCollectionEquivalencyStep : EquivalencyStep -{ - protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) - { - if (comparands.Subject is not DataRowCollection) - { - AssertionScope.Current - .FailWith("Expected {context:value} to be of type DataRowCollection, but found {0}", - comparands.Subject.GetType()); - } - else - { - RowMatchMode rowMatchMode = context.Options switch - { - DataEquivalencyAssertionOptions dataSetConfig => dataSetConfig.RowMatchMode, - DataEquivalencyAssertionOptions dataTableConfig => dataTableConfig.RowMatchMode, - _ => RowMatchMode.Index - }; - - var subject = (DataRowCollection)comparands.Subject; - var expectation = (DataRowCollection)comparands.Expectation; - - bool success = AssertionScope.Current - .ForCondition(subject.Count == expectation.Count) - .FailWith("Expected {context:DataRowCollection} to contain {0} row(s){reason}, but found {1}", - expectation.Count, subject.Count); - - if (success) - { - switch (rowMatchMode) - { - case RowMatchMode.Index: - MatchRowsByIndexAndCompare(context, nestedValidator, subject, expectation); - break; - - case RowMatchMode.PrimaryKey: - MatchRowsByPrimaryKeyAndCompare(nestedValidator, context, subject, expectation); - break; - - default: - AssertionScope.Current.FailWith( - "Unknown RowMatchMode {0} when trying to compare {context:DataRowCollection}", rowMatchMode); - - break; - } - } - } - - return EquivalencyResult.AssertionCompleted; - } - - private static void MatchRowsByIndexAndCompare(IEquivalencyValidationContext context, IEquivalencyValidator parent, - DataRowCollection subject, DataRowCollection expectation) - { - for (int index = 0; index < expectation.Count; index++) - { - IEquivalencyValidationContext nestedContext = context.AsCollectionItem(index); - parent.RecursivelyAssertEquality(new Comparands(subject[index], expectation[index], typeof(DataRow)), nestedContext); - } - } - - private static void MatchRowsByPrimaryKeyAndCompare(IEquivalencyValidator parent, IEquivalencyValidationContext context, - DataRowCollection subject, DataRowCollection expectation) - { - Type[] subjectPrimaryKeyTypes = null; - Type[] expectationPrimaryKeyTypes = null; - - if (subject.Count > 0) - { - subjectPrimaryKeyTypes = GatherPrimaryKeyColumnTypes(subject[0].Table, "subject"); - } - - if (expectation.Count > 0) - { - expectationPrimaryKeyTypes = GatherPrimaryKeyColumnTypes(expectation[0].Table, "expectation"); - } - - bool matchingTypes = ComparePrimaryKeyTypes(subjectPrimaryKeyTypes, expectationPrimaryKeyTypes); - - if (matchingTypes) - { - GatherRowsByPrimaryKeyAndCompareData(parent, context, subject, expectation); - } - } - - private static Type[] GatherPrimaryKeyColumnTypes(DataTable table, string comparisonTerm) - { - Type[] primaryKeyTypes = null; - - if (table.PrimaryKey is null or { Length: 0 }) - { - AssertionScope.Current - .FailWith( - "Table {0} containing {1} {context:DataRowCollection} does not have a primary key. RowMatchMode.PrimaryKey cannot be applied.", - table.TableName, comparisonTerm); - } - else - { - primaryKeyTypes = new Type[table.PrimaryKey.Length]; - - for (int i = 0; i < table.PrimaryKey.Length; i++) - { - primaryKeyTypes[i] = table.PrimaryKey[i].DataType; - } - } - - return primaryKeyTypes; - } - - private static bool ComparePrimaryKeyTypes(Type[] subjectPrimaryKeyTypes, Type[] expectationPrimaryKeyTypes) - { - bool matchingTypes = false; - - if (subjectPrimaryKeyTypes is not null && expectationPrimaryKeyTypes is not null) - { - matchingTypes = subjectPrimaryKeyTypes.Length == expectationPrimaryKeyTypes.Length; - - for (int i = 0; matchingTypes && i < subjectPrimaryKeyTypes.Length; i++) - { - if (subjectPrimaryKeyTypes[i] != expectationPrimaryKeyTypes[i]) - { - matchingTypes = false; - } - } - - if (!matchingTypes) - { - AssertionScope.Current - .FailWith( - "Subject and expectation primary keys of table containing {context:DataRowCollection} do not have the same schema and cannot be compared. RowMatchMode.PrimaryKey cannot be applied."); - } - } - - return matchingTypes; - } - - private static void GatherRowsByPrimaryKeyAndCompareData(IEquivalencyValidator parent, IEquivalencyValidationContext context, - DataRowCollection subject, DataRowCollection expectation) - { - var expectationRowByKey = expectation.Cast() - .ToDictionary(row => ExtractPrimaryKey(row)); - - foreach (DataRow subjectRow in subject.Cast()) - { - CompoundKey key = ExtractPrimaryKey(subjectRow); - - if (!expectationRowByKey.TryGetValue(key, out DataRow expectationRow)) - { - AssertionScope.Current - .FailWith("Found unexpected row in {context:DataRowCollection} with key {0}", key); - } - else - { - expectationRowByKey.Remove(key); - - IEquivalencyValidationContext nestedContext = context.AsCollectionItem(key.ToString()); - parent.RecursivelyAssertEquality(new Comparands(subjectRow, expectationRow, typeof(DataRow)), nestedContext); - } - } - - if (expectationRowByKey.Count > 0) - { - if (expectationRowByKey.Count > 1) - { - AssertionScope.Current - .FailWith("{0} rows were expected in {context:DataRowCollection} and not found", expectationRowByKey.Count); - } - else - { - AssertionScope.Current - .FailWith( - "Expected to find a row with key {0} in {context:DataRowCollection}{reason}, but no such row was found", - expectationRowByKey.Keys.Single()); - } - } - } - - private sealed class CompoundKey : IEquatable - { - private readonly object[] values; - - public CompoundKey(params object[] values) - { - this.values = values; - } - - public bool Equals(CompoundKey other) - { - if (other is null) - { - return false; - } - - if (values.Length != other.values.Length) - { - return false; - } - - return values.SequenceEqual(other.values); - } - - public override bool Equals(object obj) => Equals(obj as CompoundKey); - - public override int GetHashCode() - { - int hash = 0; - - foreach (var value in values) - { - hash = hash * 389 ^ value.GetHashCode(); - } - - return hash; - } - - public override string ToString() - { - return "{ " + string.Join(", ", values) + " }"; - } - } - - private static CompoundKey ExtractPrimaryKey(DataRow row) - { - DataColumn[] primaryKey = row.Table.PrimaryKey; - - var values = new object[primaryKey.Length]; - - for (int i = 0; i < values.Length; i++) - { - values[i] = row[primaryKey[i]]; - } - - return new CompoundKey(values); - } -} diff --git a/Src/FluentAssertions/Equivalency/Steps/DataRowEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/DataRowEquivalencyStep.cs deleted file mode 100644 index 38240907a8..0000000000 --- a/Src/FluentAssertions/Equivalency/Steps/DataRowEquivalencyStep.cs +++ /dev/null @@ -1,220 +0,0 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using FluentAssertions.Data; -using FluentAssertions.Execution; - -namespace FluentAssertions.Equivalency.Steps; - -public class DataRowEquivalencyStep : EquivalencyStep -{ - [SuppressMessage("Style", "IDE0019:Use pattern matching", Justification = "The code is easier to read without it.")] - protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) - { - var subject = comparands.Subject as DataRow; - var expectation = comparands.Expectation as DataRow; - - if (expectation is null) - { - if (subject is not null) - { - AssertionScope.Current.FailWith("Expected {context:DataRow} value to be null, but found {0}", subject); - } - } - else if (subject is null) - { - if (comparands.Subject is null) - { - AssertionScope.Current.FailWith("Expected {context:DataRow} to be non-null, but found null"); - } - else - { - AssertionScope.Current.FailWith("Expected {context:DataRow} to be of type {0}, but found {1} instead", - expectation.GetType(), comparands.Subject.GetType()); - } - } - else - { - var dataSetConfig = context.Options as DataEquivalencyAssertionOptions; - var dataTableConfig = context.Options as DataEquivalencyAssertionOptions; - var dataRowConfig = context.Options as DataEquivalencyAssertionOptions; - - if (dataSetConfig?.AllowMismatchedTypes != true - && dataTableConfig?.AllowMismatchedTypes != true - && dataRowConfig?.AllowMismatchedTypes != true) - { - AssertionScope.Current - .ForCondition(subject.GetType() == expectation.GetType()) - .FailWith("Expected {context:DataRow} to be of type {0}{reason}, but found {1}", - expectation.GetType(), subject.GetType()); - } - - SelectedDataRowMembers selectedMembers = - GetMembersFromExpectation(comparands, context.CurrentNode, context.Options); - - CompareScalarProperties(subject, expectation, selectedMembers); - - CompareFieldValues(context, nestedValidator, subject, expectation, dataSetConfig, dataTableConfig, - dataRowConfig); - } - - return EquivalencyResult.AssertionCompleted; - } - - private static void CompareScalarProperties(DataRow subject, DataRow expectation, SelectedDataRowMembers selectedMembers) - { - // Note: The members here are listed in the XML documentation for the DataRow.BeEquivalentTo extension - // method in DataRowAssertions.cs. If this ever needs to change, keep them in sync. - if (selectedMembers.HasErrors) - { - AssertionScope.Current - .ForCondition(subject.HasErrors == expectation.HasErrors) - .FailWith("Expected {context:DataRow} to have HasErrors value of {0}{reason}, but found {1} instead", - expectation.HasErrors, subject.HasErrors); - } - - if (selectedMembers.RowState) - { - AssertionScope.Current - .ForCondition(subject.RowState == expectation.RowState) - .FailWith("Expected {context:DataRow} to have RowState value of {0}{reason}, but found {1} instead", - expectation.RowState, subject.RowState); - } - } - - [SuppressMessage("Maintainability", "AV1561:Signature contains too many parameters", Justification = "Needs to be refactored")] - [SuppressMessage("Design", "MA0051:Method is too long", Justification = "Needs to be refactored")] - private static void CompareFieldValues(IEquivalencyValidationContext context, IEquivalencyValidator parent, - DataRow subject, DataRow expectation, DataEquivalencyAssertionOptions dataSetConfig, - DataEquivalencyAssertionOptions dataTableConfig, DataEquivalencyAssertionOptions dataRowConfig) - { - IEnumerable expectationColumnNames = expectation.Table.Columns.Cast() - .Select(col => col.ColumnName); - - IEnumerable subjectColumnNames = subject.Table.Columns.Cast() - .Select(col => col.ColumnName); - - bool ignoreUnmatchedColumns = - dataSetConfig?.IgnoreUnmatchedColumns == true || - dataTableConfig?.IgnoreUnmatchedColumns == true || - dataRowConfig?.IgnoreUnmatchedColumns == true; - - DataRowVersion subjectVersion = - subject.RowState == DataRowState.Deleted - ? DataRowVersion.Original - : DataRowVersion.Current; - - DataRowVersion expectationVersion = - expectation.RowState == DataRowState.Deleted - ? DataRowVersion.Original - : DataRowVersion.Current; - - bool compareOriginalVersions = - subject.RowState == DataRowState.Modified && expectation.RowState == DataRowState.Modified; - - if (dataSetConfig?.ExcludeOriginalData == true - || dataTableConfig?.ExcludeOriginalData == true - || dataRowConfig?.ExcludeOriginalData == true) - { - compareOriginalVersions = false; - } - - foreach (var columnName in expectationColumnNames.Union(subjectColumnNames)) - { - DataColumn expectationColumn = expectation.Table.Columns[columnName]; - DataColumn subjectColumn = subject.Table.Columns[columnName]; - - if (subjectColumn is not null - && (dataSetConfig?.ShouldExcludeColumn(subjectColumn) == true - || dataTableConfig?.ShouldExcludeColumn(subjectColumn) == true - || dataRowConfig?.ShouldExcludeColumn(subjectColumn) == true)) - { - continue; - } - - if (!ignoreUnmatchedColumns) - { - AssertionScope.Current - .ForCondition(subjectColumn is not null) - .FailWith("Expected {context:DataRow} to have column {0}{reason}, but found none", columnName); - - AssertionScope.Current - .ForCondition(expectationColumn is not null) - .FailWith("Found unexpected column {0} in {context:DataRow}", columnName); - } - - if (subjectColumn is not null && expectationColumn is not null) - { - CompareFieldValue(context, parent, subject, expectation, subjectColumn, subjectVersion, expectationColumn, - expectationVersion); - - if (compareOriginalVersions) - { - CompareFieldValue(context, parent, subject, expectation, subjectColumn, DataRowVersion.Original, - expectationColumn, DataRowVersion.Original); - } - } - } - } - - private static void CompareFieldValue(IEquivalencyValidationContext context, IEquivalencyValidator parent, DataRow subject, - DataRow expectation, DataColumn subjectColumn, DataRowVersion subjectVersion, DataColumn expectationColumn, - DataRowVersion expectationVersion) - { - IEquivalencyValidationContext nestedContext = context.AsCollectionItem( - subjectVersion == DataRowVersion.Current - ? subjectColumn.ColumnName - : $"{subjectColumn.ColumnName}, DataRowVersion.Original"); - - if (nestedContext is not null) - { - parent.RecursivelyAssertEquality( - new Comparands(subject[subjectColumn, subjectVersion], expectation[expectationColumn, expectationVersion], - typeof(object)), - nestedContext); - } - } - - private sealed class SelectedDataRowMembers - { - public bool HasErrors { get; init; } - - public bool RowState { get; init; } - } - - private static readonly ConcurrentDictionary<(Type CompileTimeType, Type RuntimeType, IEquivalencyAssertionOptions Config), - SelectedDataRowMembers> SelectedMembersCache = new(); - - private static SelectedDataRowMembers GetMembersFromExpectation(Comparands comparands, INode currentNode, - IEquivalencyAssertionOptions config) - { - var cacheKey = (comparands.CompileTimeType, comparands.RuntimeType, config); - - if (!SelectedMembersCache.TryGetValue(cacheKey, out SelectedDataRowMembers selectedDataRowMembers)) - { - IEnumerable members = Enumerable.Empty(); - - foreach (IMemberSelectionRule rule in config.SelectionRules) - { - members = rule.SelectMembers(currentNode, members, - new MemberSelectionContext(comparands.CompileTimeType, comparands.RuntimeType, config)); - } - - IMember[] selectedMembers = members.ToArray(); - - selectedDataRowMembers = new SelectedDataRowMembers - { - HasErrors = selectedMembers.Any(m => m.Name == nameof(DataRow.HasErrors)), - RowState = selectedMembers.Any(m => m.Name == nameof(DataRow.RowState)) - }; - - SelectedMembersCache.TryAdd(cacheKey, selectedDataRowMembers); - } - - return selectedDataRowMembers; - } -} diff --git a/Src/FluentAssertions/Equivalency/Steps/DataSetEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/DataSetEquivalencyStep.cs deleted file mode 100644 index ebbf3525b3..0000000000 --- a/Src/FluentAssertions/Equivalency/Steps/DataSetEquivalencyStep.cs +++ /dev/null @@ -1,270 +0,0 @@ -using System.Collections.Generic; -using System.Data; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using FluentAssertions.Data; -using FluentAssertions.Execution; - -namespace FluentAssertions.Equivalency.Steps; - -public class DataSetEquivalencyStep : EquivalencyStep -{ - protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) - { - var subject = comparands.Subject as DataSet; - - if (comparands.Expectation is not DataSet expectation) - { - if (subject is not null) - { - AssertionScope.Current.FailWith("Expected {context:DataSet} value to be null, but found {0}", subject); - } - } - else if (subject is null) - { - if (comparands.Subject is null) - { - AssertionScope.Current.FailWith("Expected {context:DataSet} to be non-null, but found null"); - } - else - { - AssertionScope.Current.FailWith("Expected {context:DataSet} to be of type {0}, but found {1} instead", - expectation.GetType(), comparands.Subject.GetType()); - } - } - else - { - var dataConfig = context.Options as DataEquivalencyAssertionOptions; - - if (dataConfig?.AllowMismatchedTypes != true) - { - AssertionScope.Current - .ForCondition(subject.GetType() == expectation.GetType()) - .FailWith("Expected {context:DataSet} to be of type {0}{reason}, but found {1}", expectation.GetType(), - subject.GetType()); - } - - var selectedMembers = GetMembersFromExpectation(comparands, context.CurrentNode, context.Options) - .ToDictionary(member => member.Name); - - CompareScalarProperties(subject, expectation, selectedMembers); - - CompareCollections(context, nestedValidator, context.Options, subject, expectation, dataConfig, selectedMembers); - } - - return EquivalencyResult.AssertionCompleted; - } - - [SuppressMessage("Design", "MA0051:Method is too long")] - private static void CompareScalarProperties(DataSet subject, DataSet expectation, Dictionary selectedMembers) - { - // Note: The members here are listed in the XML documentation for the DataSet.BeEquivalentTo extension - // method in DataSetAssertions.cs. If this ever needs to change, keep them in sync. - if (selectedMembers.ContainsKey(nameof(expectation.DataSetName))) - { - AssertionScope.Current - .ForCondition(subject.DataSetName == expectation.DataSetName) - .FailWith("Expected {context:DataSet} to have DataSetName {0}{reason}, but found {1} instead", - expectation.DataSetName, subject.DataSetName); - } - - if (selectedMembers.ContainsKey(nameof(expectation.CaseSensitive))) - { - AssertionScope.Current - .ForCondition(subject.CaseSensitive == expectation.CaseSensitive) - .FailWith("Expected {context:DataSet} to have CaseSensitive value of {0}{reason}, but found {1} instead", - expectation.CaseSensitive, subject.CaseSensitive); - } - - if (selectedMembers.ContainsKey(nameof(expectation.EnforceConstraints))) - { - AssertionScope.Current - .ForCondition(subject.EnforceConstraints == expectation.EnforceConstraints) - .FailWith("Expected {context:DataSet} to have EnforceConstraints value of {0}{reason}, but found {1} instead", - expectation.EnforceConstraints, subject.EnforceConstraints); - } - - if (selectedMembers.ContainsKey(nameof(expectation.HasErrors))) - { - AssertionScope.Current - .ForCondition(subject.HasErrors == expectation.HasErrors) - .FailWith("Expected {context:DataSet} to have HasErrors value of {0}{reason}, but found {1} instead", - expectation.HasErrors, subject.HasErrors); - } - - if (selectedMembers.ContainsKey(nameof(expectation.Locale))) - { - AssertionScope.Current - .ForCondition(Equals(subject.Locale, expectation.Locale)) - .FailWith("Expected {context:DataSet} to have Locale value of {0}{reason}, but found {1} instead", - expectation.Locale, subject.Locale); - } - - if (selectedMembers.ContainsKey(nameof(expectation.Namespace))) - { - AssertionScope.Current - .ForCondition(subject.Namespace == expectation.Namespace) - .FailWith("Expected {context:DataSet} to have Namespace value of {0}{reason}, but found {1} instead", - expectation.Namespace, subject.Namespace); - } - - if (selectedMembers.ContainsKey(nameof(expectation.Prefix))) - { - AssertionScope.Current - .ForCondition(subject.Prefix == expectation.Prefix) - .FailWith("Expected {context:DataSet} to have Prefix value of {0}{reason}, but found {1} instead", - expectation.Prefix, subject.Prefix); - } - - if (selectedMembers.ContainsKey(nameof(expectation.RemotingFormat))) - { - AssertionScope.Current - .ForCondition(subject.RemotingFormat == expectation.RemotingFormat) - .FailWith("Expected {context:DataSet} to have RemotingFormat value of {0}{reason}, but found {1} instead", - expectation.RemotingFormat, subject.RemotingFormat); - } - - if (selectedMembers.ContainsKey(nameof(expectation.SchemaSerializationMode))) - { - AssertionScope.Current - .ForCondition(subject.SchemaSerializationMode == expectation.SchemaSerializationMode) - .FailWith( - "Expected {context:DataSet} to have SchemaSerializationMode value of {0}{reason}, but found {1} instead", - expectation.SchemaSerializationMode, subject.SchemaSerializationMode); - } - } - - private static void CompareCollections(IEquivalencyValidationContext context, IEquivalencyValidator parent, - IEquivalencyAssertionOptions config, DataSet subject, DataSet expectation, - DataEquivalencyAssertionOptions dataConfig, Dictionary selectedMembers) - { - // Note: The collections here are listed in the XML documentation for the DataSet.BeEquivalentTo extension - // method in DataSetAssertions.cs. If this ever needs to change, keep them in sync. - CompareExtendedProperties(new Comparands(subject, expectation, typeof(DataSet)), context, parent, config, - selectedMembers); - - CompareTables(context, parent, subject, expectation, dataConfig, selectedMembers); - } - - private static void CompareExtendedProperties(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator parent, IEquivalencyAssertionOptions config, Dictionary selectedMembers) - { - foreach (var collectionName in new[] { nameof(DataSet.ExtendedProperties), nameof(DataSet.Relations) }) - { - if (selectedMembers.TryGetValue(collectionName, out IMember expectationMember)) - { - IMember matchingMember = FindMatchFor(expectationMember, comparands.Subject, context.CurrentNode, config); - - if (matchingMember is not null) - { - var nestedComparands = new Comparands - { - Subject = matchingMember.GetValue(comparands.Subject), - Expectation = expectationMember.GetValue(comparands.Expectation), - CompileTimeType = expectationMember.Type - }; - - IEquivalencyValidationContext nestedContext = context.AsNestedMember(expectationMember); - parent.RecursivelyAssertEquality(nestedComparands, nestedContext); - } - } - } - } - - private static void CompareTables(IEquivalencyValidationContext context, IEquivalencyValidator parent, DataSet subject, - DataSet expectation, DataEquivalencyAssertionOptions dataConfig, Dictionary selectedMembers) - { - if (selectedMembers.ContainsKey(nameof(expectation.Tables))) - { - bool success = AssertionScope.Current - .ForCondition(subject.Tables.Count == expectation.Tables.Count) - .FailWith("Expected {context:DataSet} to contain {0}, but found {1} table(s)", expectation.Tables.Count, - subject.Tables.Count); - - if (!success) - { - return; - } - - if (dataConfig is not null) - { - bool excludeCaseSensitive = !selectedMembers.ContainsKey(nameof(DataSet.CaseSensitive)); - bool excludeLocale = !selectedMembers.ContainsKey(nameof(DataSet.Locale)); - - if (excludeCaseSensitive || excludeLocale) - { - dataConfig.Excluding(memberInfo => - memberInfo.DeclaringType == typeof(DataTable) && - ( - (excludeCaseSensitive && memberInfo.Name == nameof(DataTable.CaseSensitive)) - || - (excludeLocale && memberInfo.Name == nameof(DataTable.Locale)))); - } - } - - IEnumerable expectationTableNames = expectation.Tables.Cast() - .Select(table => table.TableName); - - IEnumerable subjectTableNames = subject.Tables.Cast() - .Select(table => table.TableName); - - foreach (string tableName in expectationTableNames.Union(subjectTableNames)) - { - if (dataConfig?.ExcludeTableNames.Contains(tableName) == true) - { - continue; - } - - CompareTable(context, parent, subject, expectation, tableName); - } - } - } - - private static void CompareTable(IEquivalencyValidationContext context, IEquivalencyValidator parent, DataSet subject, - DataSet expectation, string tableName) - { - DataTable expectationTable = expectation.Tables[tableName]; - DataTable subjectTable = subject.Tables[tableName]; - - bool success = AssertionScope.Current - .ForCondition(subjectTable is not null) - .FailWith("Expected {context:DataSet} to contain table {0}{reason}, but did not find it", tableName) - .Then - .ForCondition(expectationTable is not null) - .FailWith("Found unexpected table {0} in DataSet", tableName); - - if (success) - { - IEquivalencyValidationContext nestedContext = context.AsCollectionItem(tableName); - parent.RecursivelyAssertEquality(new Comparands(subjectTable, expectationTable, typeof(DataTable)), nestedContext); - } - } - - private static IMember FindMatchFor(IMember selectedMemberInfo, object subject, INode currentNode, - IEquivalencyAssertionOptions options) - { - IEnumerable query = - from rule in options.MatchingRules - let match = rule.Match(selectedMemberInfo, subject, currentNode, options) - where match is not null - select match; - - return query.FirstOrDefault(); - } - - private static IEnumerable GetMembersFromExpectation(Comparands comparands, - INode contextCurrentNode, - IEquivalencyAssertionOptions options) - { - IEnumerable members = Enumerable.Empty(); - - foreach (IMemberSelectionRule rule in options.SelectionRules) - { - members = rule.SelectMembers(contextCurrentNode, members, - new MemberSelectionContext(comparands.CompileTimeType, comparands.RuntimeType, options)); - } - - return members; - } -} diff --git a/Src/FluentAssertions/Equivalency/Steps/DataTableEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/DataTableEquivalencyStep.cs deleted file mode 100644 index 1fcf94909e..0000000000 --- a/Src/FluentAssertions/Equivalency/Steps/DataTableEquivalencyStep.cs +++ /dev/null @@ -1,198 +0,0 @@ -using System.Collections.Generic; -using System.Data; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using FluentAssertions.Data; -using FluentAssertions.Execution; - -namespace FluentAssertions.Equivalency.Steps; - -public class DataTableEquivalencyStep : EquivalencyStep -{ - [SuppressMessage("Style", "IDE0019:Use pattern matching", Justification = "The code is easier to read without it.")] - protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) - { - var subject = comparands.Subject as DataTable; - var expectation = comparands.Expectation as DataTable; - - if (expectation is null) - { - if (subject is not null) - { - AssertionScope.Current.FailWith("Expected {context:DataTable} value to be null, but found {0}", subject); - } - } - else if (subject is null) - { - if (comparands.Subject is null) - { - AssertionScope.Current.FailWith("Expected {context:DataTable} to be non-null, but found null"); - } - else - { - AssertionScope.Current.FailWith("Expected {context:DataTable} to be of type {0}, but found {1} instead", - expectation.GetType(), comparands.Subject.GetType()); - } - } - else - { - var dataSetConfig = context.Options as DataEquivalencyAssertionOptions; - var dataTableConfig = context.Options as DataEquivalencyAssertionOptions; - - if (dataSetConfig?.AllowMismatchedTypes != true - && dataTableConfig?.AllowMismatchedTypes != true) - { - AssertionScope.Current - .ForCondition(subject.GetType() == expectation.GetType()) - .FailWith("Expected {context:DataTable} to be of type {0}{reason}, but found {1}", expectation.GetType(), - subject.GetType()); - } - - var selectedMembers = GetMembersFromExpectation(context.CurrentNode, comparands, context.Options) - .ToDictionary(member => member.Name); - - CompareScalarProperties(subject, expectation, selectedMembers); - - CompareCollections(comparands, context, nestedValidator, context.Options, selectedMembers); - } - - return EquivalencyResult.AssertionCompleted; - } - - [SuppressMessage("Design", "MA0051:Method is too long")] - private static void CompareScalarProperties(DataTable subject, DataTable expectation, - Dictionary selectedMembers) - { - // Note: The members here are listed in the XML documentation for the DataTable.BeEquivalentTo extension - // method in DataTableAssertions.cs. If this ever needs to change, keep them in sync. - if (selectedMembers.ContainsKey(nameof(expectation.TableName))) - { - AssertionScope.Current - .ForCondition(subject.TableName == expectation.TableName) - .FailWith("Expected {context:DataTable} to have TableName {0}{reason}, but found {1} instead", - expectation.TableName, subject.TableName); - } - - if (selectedMembers.ContainsKey(nameof(expectation.CaseSensitive))) - { - AssertionScope.Current - .ForCondition(subject.CaseSensitive == expectation.CaseSensitive) - .FailWith("Expected {context:DataTable} to have CaseSensitive value of {0}{reason}, but found {1} instead", - expectation.CaseSensitive, subject.CaseSensitive); - } - - if (selectedMembers.ContainsKey(nameof(expectation.DisplayExpression))) - { - AssertionScope.Current - .ForCondition(subject.DisplayExpression == expectation.DisplayExpression) - .FailWith("Expected {context:DataTable} to have DisplayExpression value of {0}{reason}, but found {1} instead", - expectation.DisplayExpression, subject.DisplayExpression); - } - - if (selectedMembers.ContainsKey(nameof(expectation.HasErrors))) - { - AssertionScope.Current - .ForCondition(subject.HasErrors == expectation.HasErrors) - .FailWith("Expected {context:DataTable} to have HasErrors value of {0}{reason}, but found {1} instead", - expectation.HasErrors, subject.HasErrors); - } - - if (selectedMembers.ContainsKey(nameof(expectation.Locale))) - { - AssertionScope.Current - .ForCondition(Equals(subject.Locale, expectation.Locale)) - .FailWith("Expected {context:DataTable} to have Locale value of {0}{reason}, but found {1} instead", - expectation.Locale, subject.Locale); - } - - if (selectedMembers.ContainsKey(nameof(expectation.Namespace))) - { - AssertionScope.Current - .ForCondition(subject.Namespace == expectation.Namespace) - .FailWith("Expected {context:DataTable} to have Namespace value of {0}{reason}, but found {1} instead", - expectation.Namespace, subject.Namespace); - } - - if (selectedMembers.ContainsKey(nameof(expectation.Prefix))) - { - AssertionScope.Current - .ForCondition(subject.Prefix == expectation.Prefix) - .FailWith("Expected {context:DataTable} to have Prefix value of {0}{reason}, but found {1} instead", - expectation.Prefix, subject.Prefix); - } - - if (selectedMembers.ContainsKey(nameof(expectation.RemotingFormat))) - { - AssertionScope.Current - .ForCondition(subject.RemotingFormat == expectation.RemotingFormat) - .FailWith("Expected {context:DataTable} to have RemotingFormat value of {0}{reason}, but found {1} instead", - expectation.RemotingFormat, subject.RemotingFormat); - } - } - - private static void CompareCollections(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator parent, IEquivalencyAssertionOptions config, Dictionary selectedMembers) - { - // Note: The collections here are listed in the XML documentation for the DataTable.BeEquivalentTo extension - // method in DataTableAssertions.cs. If this ever needs to change, keep them in sync. - var collectionNames = new[] - { - nameof(DataTable.ChildRelations), - nameof(DataTable.Columns), - nameof(DataTable.Constraints), - nameof(DataTable.ExtendedProperties), - nameof(DataTable.ParentRelations), - nameof(DataTable.PrimaryKey), - nameof(DataTable.Rows), - }; - - foreach (var collectionName in collectionNames) - { - if (selectedMembers.TryGetValue(collectionName, out IMember expectationMember)) - { - IMember matchingMember = FindMatchFor(expectationMember, comparands.Subject, context.CurrentNode, config); - - if (matchingMember is not null) - { - IEquivalencyValidationContext nestedContext = context.AsNestedMember(expectationMember); - - var nestedComparands = new Comparands - { - Subject = matchingMember.GetValue(comparands.Subject), - Expectation = expectationMember.GetValue(comparands.Expectation), - CompileTimeType = expectationMember.Type - }; - - parent.RecursivelyAssertEquality(nestedComparands, nestedContext); - } - } - } - } - - private static IMember FindMatchFor(IMember selectedMemberInfo, object subject, INode currentNode, - IEquivalencyAssertionOptions config) - { - IEnumerable query = - from rule in config.MatchingRules - let match = rule.Match(selectedMemberInfo, subject, currentNode, config) - where match is not null - select match; - - return query.FirstOrDefault(); - } - - private static IEnumerable GetMembersFromExpectation(INode currentNode, Comparands comparands, - IEquivalencyAssertionOptions config) - { - IEnumerable members = Enumerable.Empty(); - - foreach (IMemberSelectionRule rule in config.SelectionRules) - { - members = rule.SelectMembers(currentNode, members, - new MemberSelectionContext(comparands.CompileTimeType, comparands.RuntimeType, config)); - } - - return members; - } -} diff --git a/Src/FluentAssertions/EquivalencyPlan.cs b/Src/FluentAssertions/EquivalencyPlan.cs index cf803c3ab7..e3f176cad2 100644 --- a/Src/FluentAssertions/EquivalencyPlan.cs +++ b/Src/FluentAssertions/EquivalencyPlan.cs @@ -150,17 +150,9 @@ private static List GetDefaultSteps() new AutoConversionStep(), new ReferenceEqualityEquivalencyStep(), new GenericDictionaryEquivalencyStep(), - new DataSetEquivalencyStep(), - new DataTableEquivalencyStep(), - new DataColumnEquivalencyStep(), - new DataRelationEquivalencyStep(), - new DataRowCollectionEquivalencyStep(), - new DataRowEquivalencyStep(), new XDocumentEquivalencyStep(), new XElementEquivalencyStep(), new XAttributeEquivalencyStep(), - new ConstraintCollectionEquivalencyStep(), - new ConstraintEquivalencyStep(), new DictionaryEquivalencyStep(), new MultiDimensionalArrayEquivalencyStep(), new GenericEnumerableEquivalencyStep(), diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 48a22d046e..d8c90190d5 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -12,7 +12,7 @@ true true - + Dennis Doomen;Jonas Nyrup @@ -31,7 +31,7 @@ See https://fluentassertions.com/releases/ Copyright Dennis Doomen 2010-$([System.DateTime]::Now.ToString(yyyy)) - + <_Parameter1>FluentAssertions.Specs, PublicKey=00240000048000009400000006020000002400005253413100040000010001002d25ff515c85b13ba08f61d466cff5d80a7f28ba197bbf8796085213e7a3406f970d2a4874932fed35db546e89af2da88c194bf1b7f7ac70de7988c78406f7629c547283061282a825616eb7eb48a9514a7570942936020a9bb37dca9ff60b778309900851575614491c6d25018fadb75828f4c7a17bf2d7dc86e7b6eafc5d8f @@ -114,11 +114,10 @@ - - + diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 377122900a..df07ccb123 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -59,10 +59,6 @@ namespace FluentAssertions public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } public static FluentAssertions.Specialized.ActionAssertions Should(this System.Action action) { } public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Collections.Generic.IEnumerable @this) { } - public static FluentAssertions.Data.DataColumnAssertions Should(this System.Data.DataColumn actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataColumnCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataRowCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataTableCollection actualValue) { } public static FluentAssertions.Primitives.DateTimeAssertions Should(this System.DateTime actualValue) { } public static FluentAssertions.Primitives.NullableDateTimeAssertions Should(this System.DateTime? actualValue) { } public static FluentAssertions.Primitives.DateTimeOffsetAssertions Should(this System.DateTimeOffset actualValue) { } @@ -197,44 +193,6 @@ namespace FluentAssertions { public CustomAssertionAttribute() { } } - public static class DataColumnCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection otherCollection, string because = "", params object[] becauseArgs) { } - } - public static class DataRowAssertionExtensions - { - public static FluentAssertions.Data.DataRowAssertions Should(this TDataRow actualValue) - where TDataRow : System.Data.DataRow { } - } - public static class DataRowCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection otherCollection, string because = "", params object[] becauseArgs) { } - } - public static class DataSetAssertionExtensions - { - public static FluentAssertions.Data.DataSetAssertions Should(this TDataSet actualValue) - where TDataSet : System.Data.DataSet { } - } - public static class DataTableAssertionExtensions - { - public static FluentAssertions.Data.DataTableAssertions Should(this TDataTable actualValue) - where TDataTable : System.Data.DataTable { } - } - public static class DataTableCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataSet otherDataSet, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataSet otherDataSet, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection otherCollection, string because = "", params object[] becauseArgs) { } - } public static class EnumAssertionsExtensions { public static FluentAssertions.Primitives.EnumAssertions Should(this TEnum @enum) @@ -674,84 +632,6 @@ namespace FluentAssertions.Common Scan = 2, } } -namespace FluentAssertions.Data -{ - public class DataColumnAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public DataColumnAssertions(System.Data.DataColumn dataColumn) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Data.DataColumn expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Data.DataColumn expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - } - public class DataRowAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataRow : System.Data.DataRow - { - public DataRowAssertions(TDataRow dataRow) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataRow expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataRow expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataColumn> HaveColumn(string expectedColumnName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveColumns(params string[] expectedColumnNames) { } - public FluentAssertions.AndConstraint> HaveColumns(System.Collections.Generic.IEnumerable expectedColumnNames, string because = "", params object[] becauseArgs) { } - } - public class DataSetAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataSet : System.Data.DataSet - { - public DataSetAssertions(TDataSet dataSet) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataSet expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataSet expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataTable> HaveTable(string expectedTableName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveTableCount(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveTables(params string[] expectedTableNames) { } - public FluentAssertions.AndConstraint> HaveTables(System.Collections.Generic.IEnumerable expectedTableNames, string because = "", params object[] becauseArgs) { } - } - public class DataTableAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataTable : System.Data.DataTable - { - public DataTableAssertions(TDataTable dataTable) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataTable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataTable expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataColumn> HaveColumn(string expectedColumnName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveColumns(params string[] expectedColumnNames) { } - public FluentAssertions.AndConstraint> HaveColumns(System.Collections.Generic.IEnumerable expectedColumnNames, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveRowCount(int expected, string because = "", params object[] becauseArgs) { } - } - public interface IDataEquivalencyAssertionOptions : FluentAssertions.Equivalency.IEquivalencyAssertionOptions - { - FluentAssertions.Data.IDataEquivalencyAssertionOptions AllowingMismatchedTypes(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> predicate); - FluentAssertions.Data.IDataEquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumn(System.Data.DataColumn column); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumn(string tableName, string columnName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnInAllTables(string columnName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(System.Collections.Generic.IEnumerable columns); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(params System.Data.DataColumn[] columns); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(string tableName, System.Collections.Generic.IEnumerable columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(string tableName, params string[] columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnsInAllTables(System.Collections.Generic.IEnumerable columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnsInAllTables(params string[] columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingOriginalData(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTable(string tableName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTables(System.Collections.Generic.IEnumerable tableNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTables(params string[] tableNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions IgnoringUnmatchedColumns(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions UsingRowMatchMode(FluentAssertions.Data.RowMatchMode rowMatchMode); - } - public enum RowMatchMode - { - Index = 0, - PrimaryKey = 1, - } -} namespace FluentAssertions.Equivalency { public class Comparands @@ -1114,46 +994,6 @@ namespace FluentAssertions.Equivalency.Steps public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } public override string ToString() { } } - public class ConstraintCollectionEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public ConstraintCollectionEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class ConstraintEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public ConstraintEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataColumnEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataColumnEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRelationEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRelationEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRowCollectionEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRowCollectionEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRowEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRowEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataSetEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataSetEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataTableEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataTableEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } @@ -2801,4 +2641,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 fa1f44fa66..fa362b74a4 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -59,10 +59,6 @@ namespace FluentAssertions public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } public static FluentAssertions.Specialized.ActionAssertions Should(this System.Action action) { } public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Collections.Generic.IEnumerable @this) { } - public static FluentAssertions.Data.DataColumnAssertions Should(this System.Data.DataColumn actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataColumnCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataRowCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataTableCollection actualValue) { } public static FluentAssertions.Primitives.DateOnlyAssertions Should(this System.DateOnly actualValue) { } public static FluentAssertions.Primitives.NullableDateOnlyAssertions Should(this System.DateOnly? actualValue) { } public static FluentAssertions.Primitives.DateTimeAssertions Should(this System.DateTime actualValue) { } @@ -210,44 +206,6 @@ namespace FluentAssertions { public CustomAssertionAttribute() { } } - public static class DataColumnCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection otherCollection, string because = "", params object[] becauseArgs) { } - } - public static class DataRowAssertionExtensions - { - public static FluentAssertions.Data.DataRowAssertions Should(this TDataRow actualValue) - where TDataRow : System.Data.DataRow { } - } - public static class DataRowCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection otherCollection, string because = "", params object[] becauseArgs) { } - } - public static class DataSetAssertionExtensions - { - public static FluentAssertions.Data.DataSetAssertions Should(this TDataSet actualValue) - where TDataSet : System.Data.DataSet { } - } - public static class DataTableAssertionExtensions - { - public static FluentAssertions.Data.DataTableAssertions Should(this TDataTable actualValue) - where TDataTable : System.Data.DataTable { } - } - public static class DataTableCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataSet otherDataSet, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataSet otherDataSet, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection otherCollection, string because = "", params object[] becauseArgs) { } - } public static class EnumAssertionsExtensions { public static FluentAssertions.Primitives.EnumAssertions Should(this TEnum @enum) @@ -687,84 +645,6 @@ namespace FluentAssertions.Common Scan = 2, } } -namespace FluentAssertions.Data -{ - public class DataColumnAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public DataColumnAssertions(System.Data.DataColumn dataColumn) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Data.DataColumn expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Data.DataColumn expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - } - public class DataRowAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataRow : System.Data.DataRow - { - public DataRowAssertions(TDataRow dataRow) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataRow expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataRow expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataColumn> HaveColumn(string expectedColumnName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveColumns(params string[] expectedColumnNames) { } - public FluentAssertions.AndConstraint> HaveColumns(System.Collections.Generic.IEnumerable expectedColumnNames, string because = "", params object[] becauseArgs) { } - } - public class DataSetAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataSet : System.Data.DataSet - { - public DataSetAssertions(TDataSet dataSet) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataSet expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataSet expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataTable> HaveTable(string expectedTableName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveTableCount(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveTables(params string[] expectedTableNames) { } - public FluentAssertions.AndConstraint> HaveTables(System.Collections.Generic.IEnumerable expectedTableNames, string because = "", params object[] becauseArgs) { } - } - public class DataTableAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataTable : System.Data.DataTable - { - public DataTableAssertions(TDataTable dataTable) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataTable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataTable expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataColumn> HaveColumn(string expectedColumnName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveColumns(params string[] expectedColumnNames) { } - public FluentAssertions.AndConstraint> HaveColumns(System.Collections.Generic.IEnumerable expectedColumnNames, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveRowCount(int expected, string because = "", params object[] becauseArgs) { } - } - public interface IDataEquivalencyAssertionOptions : FluentAssertions.Equivalency.IEquivalencyAssertionOptions - { - FluentAssertions.Data.IDataEquivalencyAssertionOptions AllowingMismatchedTypes(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> predicate); - FluentAssertions.Data.IDataEquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumn(System.Data.DataColumn column); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumn(string tableName, string columnName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnInAllTables(string columnName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(System.Collections.Generic.IEnumerable columns); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(params System.Data.DataColumn[] columns); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(string tableName, System.Collections.Generic.IEnumerable columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(string tableName, params string[] columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnsInAllTables(System.Collections.Generic.IEnumerable columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnsInAllTables(params string[] columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingOriginalData(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTable(string tableName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTables(System.Collections.Generic.IEnumerable tableNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTables(params string[] tableNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions IgnoringUnmatchedColumns(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions UsingRowMatchMode(FluentAssertions.Data.RowMatchMode rowMatchMode); - } - public enum RowMatchMode - { - Index = 0, - PrimaryKey = 1, - } -} namespace FluentAssertions.Equivalency { public class Comparands @@ -1127,46 +1007,6 @@ namespace FluentAssertions.Equivalency.Steps public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } public override string ToString() { } } - public class ConstraintCollectionEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public ConstraintCollectionEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class ConstraintEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public ConstraintEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataColumnEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataColumnEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRelationEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRelationEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRowCollectionEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRowCollectionEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRowEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRowEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataSetEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataSetEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataTableEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataTableEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } @@ -2931,4 +2771,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/netcoreapp2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt index 63d5985ea5..4bc84b35de 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt @@ -59,10 +59,6 @@ namespace FluentAssertions public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } public static FluentAssertions.Specialized.ActionAssertions Should(this System.Action action) { } public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Collections.Generic.IEnumerable @this) { } - public static FluentAssertions.Data.DataColumnAssertions Should(this System.Data.DataColumn actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataColumnCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataRowCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataTableCollection actualValue) { } public static FluentAssertions.Primitives.DateTimeAssertions Should(this System.DateTime actualValue) { } public static FluentAssertions.Primitives.NullableDateTimeAssertions Should(this System.DateTime? actualValue) { } public static FluentAssertions.Primitives.DateTimeOffsetAssertions Should(this System.DateTimeOffset actualValue) { } @@ -197,44 +193,6 @@ namespace FluentAssertions { public CustomAssertionAttribute() { } } - public static class DataColumnCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection otherCollection, string because = "", params object[] becauseArgs) { } - } - public static class DataRowAssertionExtensions - { - public static FluentAssertions.Data.DataRowAssertions Should(this TDataRow actualValue) - where TDataRow : System.Data.DataRow { } - } - public static class DataRowCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection otherCollection, string because = "", params object[] becauseArgs) { } - } - public static class DataSetAssertionExtensions - { - public static FluentAssertions.Data.DataSetAssertions Should(this TDataSet actualValue) - where TDataSet : System.Data.DataSet { } - } - public static class DataTableAssertionExtensions - { - public static FluentAssertions.Data.DataTableAssertions Should(this TDataTable actualValue) - where TDataTable : System.Data.DataTable { } - } - public static class DataTableCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataSet otherDataSet, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataSet otherDataSet, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection otherCollection, string because = "", params object[] becauseArgs) { } - } public static class EnumAssertionsExtensions { public static FluentAssertions.Primitives.EnumAssertions Should(this TEnum @enum) @@ -674,84 +632,6 @@ namespace FluentAssertions.Common Scan = 2, } } -namespace FluentAssertions.Data -{ - public class DataColumnAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public DataColumnAssertions(System.Data.DataColumn dataColumn) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Data.DataColumn expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Data.DataColumn expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - } - public class DataRowAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataRow : System.Data.DataRow - { - public DataRowAssertions(TDataRow dataRow) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataRow expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataRow expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataColumn> HaveColumn(string expectedColumnName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveColumns(params string[] expectedColumnNames) { } - public FluentAssertions.AndConstraint> HaveColumns(System.Collections.Generic.IEnumerable expectedColumnNames, string because = "", params object[] becauseArgs) { } - } - public class DataSetAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataSet : System.Data.DataSet - { - public DataSetAssertions(TDataSet dataSet) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataSet expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataSet expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataTable> HaveTable(string expectedTableName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveTableCount(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveTables(params string[] expectedTableNames) { } - public FluentAssertions.AndConstraint> HaveTables(System.Collections.Generic.IEnumerable expectedTableNames, string because = "", params object[] becauseArgs) { } - } - public class DataTableAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataTable : System.Data.DataTable - { - public DataTableAssertions(TDataTable dataTable) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataTable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataTable expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataColumn> HaveColumn(string expectedColumnName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveColumns(params string[] expectedColumnNames) { } - public FluentAssertions.AndConstraint> HaveColumns(System.Collections.Generic.IEnumerable expectedColumnNames, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveRowCount(int expected, string because = "", params object[] becauseArgs) { } - } - public interface IDataEquivalencyAssertionOptions : FluentAssertions.Equivalency.IEquivalencyAssertionOptions - { - FluentAssertions.Data.IDataEquivalencyAssertionOptions AllowingMismatchedTypes(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> predicate); - FluentAssertions.Data.IDataEquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumn(System.Data.DataColumn column); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumn(string tableName, string columnName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnInAllTables(string columnName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(System.Collections.Generic.IEnumerable columns); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(params System.Data.DataColumn[] columns); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(string tableName, System.Collections.Generic.IEnumerable columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(string tableName, params string[] columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnsInAllTables(System.Collections.Generic.IEnumerable columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnsInAllTables(params string[] columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingOriginalData(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTable(string tableName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTables(System.Collections.Generic.IEnumerable tableNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTables(params string[] tableNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions IgnoringUnmatchedColumns(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions UsingRowMatchMode(FluentAssertions.Data.RowMatchMode rowMatchMode); - } - public enum RowMatchMode - { - Index = 0, - PrimaryKey = 1, - } -} namespace FluentAssertions.Equivalency { public class Comparands @@ -1114,46 +994,6 @@ namespace FluentAssertions.Equivalency.Steps public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } public override string ToString() { } } - public class ConstraintCollectionEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public ConstraintCollectionEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class ConstraintEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public ConstraintEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataColumnEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataColumnEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRelationEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRelationEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRowCollectionEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRowCollectionEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRowEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRowEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataSetEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataSetEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataTableEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataTableEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } @@ -2803,4 +2643,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/netcoreapp3.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt index 63d5985ea5..4bc84b35de 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt @@ -59,10 +59,6 @@ namespace FluentAssertions public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } public static FluentAssertions.Specialized.ActionAssertions Should(this System.Action action) { } public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Collections.Generic.IEnumerable @this) { } - public static FluentAssertions.Data.DataColumnAssertions Should(this System.Data.DataColumn actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataColumnCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataRowCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataTableCollection actualValue) { } public static FluentAssertions.Primitives.DateTimeAssertions Should(this System.DateTime actualValue) { } public static FluentAssertions.Primitives.NullableDateTimeAssertions Should(this System.DateTime? actualValue) { } public static FluentAssertions.Primitives.DateTimeOffsetAssertions Should(this System.DateTimeOffset actualValue) { } @@ -197,44 +193,6 @@ namespace FluentAssertions { public CustomAssertionAttribute() { } } - public static class DataColumnCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection otherCollection, string because = "", params object[] becauseArgs) { } - } - public static class DataRowAssertionExtensions - { - public static FluentAssertions.Data.DataRowAssertions Should(this TDataRow actualValue) - where TDataRow : System.Data.DataRow { } - } - public static class DataRowCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection otherCollection, string because = "", params object[] becauseArgs) { } - } - public static class DataSetAssertionExtensions - { - public static FluentAssertions.Data.DataSetAssertions Should(this TDataSet actualValue) - where TDataSet : System.Data.DataSet { } - } - public static class DataTableAssertionExtensions - { - public static FluentAssertions.Data.DataTableAssertions Should(this TDataTable actualValue) - where TDataTable : System.Data.DataTable { } - } - public static class DataTableCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataSet otherDataSet, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataSet otherDataSet, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection otherCollection, string because = "", params object[] becauseArgs) { } - } public static class EnumAssertionsExtensions { public static FluentAssertions.Primitives.EnumAssertions Should(this TEnum @enum) @@ -674,84 +632,6 @@ namespace FluentAssertions.Common Scan = 2, } } -namespace FluentAssertions.Data -{ - public class DataColumnAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public DataColumnAssertions(System.Data.DataColumn dataColumn) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Data.DataColumn expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Data.DataColumn expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - } - public class DataRowAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataRow : System.Data.DataRow - { - public DataRowAssertions(TDataRow dataRow) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataRow expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataRow expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataColumn> HaveColumn(string expectedColumnName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveColumns(params string[] expectedColumnNames) { } - public FluentAssertions.AndConstraint> HaveColumns(System.Collections.Generic.IEnumerable expectedColumnNames, string because = "", params object[] becauseArgs) { } - } - public class DataSetAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataSet : System.Data.DataSet - { - public DataSetAssertions(TDataSet dataSet) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataSet expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataSet expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataTable> HaveTable(string expectedTableName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveTableCount(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveTables(params string[] expectedTableNames) { } - public FluentAssertions.AndConstraint> HaveTables(System.Collections.Generic.IEnumerable expectedTableNames, string because = "", params object[] becauseArgs) { } - } - public class DataTableAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataTable : System.Data.DataTable - { - public DataTableAssertions(TDataTable dataTable) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataTable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataTable expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataColumn> HaveColumn(string expectedColumnName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveColumns(params string[] expectedColumnNames) { } - public FluentAssertions.AndConstraint> HaveColumns(System.Collections.Generic.IEnumerable expectedColumnNames, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveRowCount(int expected, string because = "", params object[] becauseArgs) { } - } - public interface IDataEquivalencyAssertionOptions : FluentAssertions.Equivalency.IEquivalencyAssertionOptions - { - FluentAssertions.Data.IDataEquivalencyAssertionOptions AllowingMismatchedTypes(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> predicate); - FluentAssertions.Data.IDataEquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumn(System.Data.DataColumn column); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumn(string tableName, string columnName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnInAllTables(string columnName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(System.Collections.Generic.IEnumerable columns); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(params System.Data.DataColumn[] columns); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(string tableName, System.Collections.Generic.IEnumerable columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(string tableName, params string[] columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnsInAllTables(System.Collections.Generic.IEnumerable columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnsInAllTables(params string[] columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingOriginalData(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTable(string tableName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTables(System.Collections.Generic.IEnumerable tableNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTables(params string[] tableNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions IgnoringUnmatchedColumns(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions UsingRowMatchMode(FluentAssertions.Data.RowMatchMode rowMatchMode); - } - public enum RowMatchMode - { - Index = 0, - PrimaryKey = 1, - } -} namespace FluentAssertions.Equivalency { public class Comparands @@ -1114,46 +994,6 @@ namespace FluentAssertions.Equivalency.Steps public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } public override string ToString() { } } - public class ConstraintCollectionEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public ConstraintCollectionEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class ConstraintEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public ConstraintEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataColumnEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataColumnEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRelationEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRelationEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRowCollectionEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRowCollectionEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRowEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRowEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataSetEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataSetEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataTableEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataTableEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } @@ -2803,4 +2643,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/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 33bdb75873..40554f2caf 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -58,10 +58,6 @@ namespace FluentAssertions public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } public static FluentAssertions.Specialized.ActionAssertions Should(this System.Action action) { } public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Collections.Generic.IEnumerable @this) { } - public static FluentAssertions.Data.DataColumnAssertions Should(this System.Data.DataColumn actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataColumnCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataRowCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataTableCollection actualValue) { } public static FluentAssertions.Primitives.DateTimeAssertions Should(this System.DateTime actualValue) { } public static FluentAssertions.Primitives.NullableDateTimeAssertions Should(this System.DateTime? actualValue) { } public static FluentAssertions.Primitives.DateTimeOffsetAssertions Should(this System.DateTimeOffset actualValue) { } @@ -196,44 +192,6 @@ namespace FluentAssertions { public CustomAssertionAttribute() { } } - public static class DataColumnCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection otherCollection, string because = "", params object[] becauseArgs) { } - } - public static class DataRowAssertionExtensions - { - public static FluentAssertions.Data.DataRowAssertions Should(this TDataRow actualValue) - where TDataRow : System.Data.DataRow { } - } - public static class DataRowCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection otherCollection, string because = "", params object[] becauseArgs) { } - } - public static class DataSetAssertionExtensions - { - public static FluentAssertions.Data.DataSetAssertions Should(this TDataSet actualValue) - where TDataSet : System.Data.DataSet { } - } - public static class DataTableAssertionExtensions - { - public static FluentAssertions.Data.DataTableAssertions Should(this TDataTable actualValue) - where TDataTable : System.Data.DataTable { } - } - public static class DataTableCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataSet otherDataSet, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataSet otherDataSet, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection otherCollection, string because = "", params object[] becauseArgs) { } - } public static class EnumAssertionsExtensions { public static FluentAssertions.Primitives.EnumAssertions Should(this TEnum @enum) @@ -667,84 +625,6 @@ namespace FluentAssertions.Common Scan = 2, } } -namespace FluentAssertions.Data -{ - public class DataColumnAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public DataColumnAssertions(System.Data.DataColumn dataColumn) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Data.DataColumn expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Data.DataColumn expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - } - public class DataRowAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataRow : System.Data.DataRow - { - public DataRowAssertions(TDataRow dataRow) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataRow expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataRow expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataColumn> HaveColumn(string expectedColumnName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveColumns(params string[] expectedColumnNames) { } - public FluentAssertions.AndConstraint> HaveColumns(System.Collections.Generic.IEnumerable expectedColumnNames, string because = "", params object[] becauseArgs) { } - } - public class DataSetAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataSet : System.Data.DataSet - { - public DataSetAssertions(TDataSet dataSet) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataSet expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataSet expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataTable> HaveTable(string expectedTableName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveTableCount(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveTables(params string[] expectedTableNames) { } - public FluentAssertions.AndConstraint> HaveTables(System.Collections.Generic.IEnumerable expectedTableNames, string because = "", params object[] becauseArgs) { } - } - public class DataTableAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataTable : System.Data.DataTable - { - public DataTableAssertions(TDataTable dataTable) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataTable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataTable expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataColumn> HaveColumn(string expectedColumnName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveColumns(params string[] expectedColumnNames) { } - public FluentAssertions.AndConstraint> HaveColumns(System.Collections.Generic.IEnumerable expectedColumnNames, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveRowCount(int expected, string because = "", params object[] becauseArgs) { } - } - public interface IDataEquivalencyAssertionOptions : FluentAssertions.Equivalency.IEquivalencyAssertionOptions - { - FluentAssertions.Data.IDataEquivalencyAssertionOptions AllowingMismatchedTypes(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> predicate); - FluentAssertions.Data.IDataEquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumn(System.Data.DataColumn column); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumn(string tableName, string columnName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnInAllTables(string columnName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(System.Collections.Generic.IEnumerable columns); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(params System.Data.DataColumn[] columns); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(string tableName, System.Collections.Generic.IEnumerable columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(string tableName, params string[] columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnsInAllTables(System.Collections.Generic.IEnumerable columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnsInAllTables(params string[] columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingOriginalData(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTable(string tableName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTables(System.Collections.Generic.IEnumerable tableNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTables(params string[] tableNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions IgnoringUnmatchedColumns(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions UsingRowMatchMode(FluentAssertions.Data.RowMatchMode rowMatchMode); - } - public enum RowMatchMode - { - Index = 0, - PrimaryKey = 1, - } -} namespace FluentAssertions.Equivalency { public class Comparands @@ -1107,46 +987,6 @@ namespace FluentAssertions.Equivalency.Steps public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } public override string ToString() { } } - public class ConstraintCollectionEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public ConstraintCollectionEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class ConstraintEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public ConstraintEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataColumnEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataColumnEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRelationEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRelationEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRowCollectionEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRowCollectionEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRowEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRowEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataSetEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataSetEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataTableEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataTableEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } @@ -2752,4 +2592,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/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 63d5985ea5..4bc84b35de 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -59,10 +59,6 @@ namespace FluentAssertions public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } public static FluentAssertions.Specialized.ActionAssertions Should(this System.Action action) { } public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Collections.Generic.IEnumerable @this) { } - public static FluentAssertions.Data.DataColumnAssertions Should(this System.Data.DataColumn actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataColumnCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataRowCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataTableCollection actualValue) { } public static FluentAssertions.Primitives.DateTimeAssertions Should(this System.DateTime actualValue) { } public static FluentAssertions.Primitives.NullableDateTimeAssertions Should(this System.DateTime? actualValue) { } public static FluentAssertions.Primitives.DateTimeOffsetAssertions Should(this System.DateTimeOffset actualValue) { } @@ -197,44 +193,6 @@ namespace FluentAssertions { public CustomAssertionAttribute() { } } - public static class DataColumnCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataColumnCollection otherCollection, string because = "", params object[] becauseArgs) { } - } - public static class DataRowAssertionExtensions - { - public static FluentAssertions.Data.DataRowAssertions Should(this TDataRow actualValue) - where TDataRow : System.Data.DataRow { } - } - public static class DataRowCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataRowCollection otherCollection, string because = "", params object[] becauseArgs) { } - } - public static class DataSetAssertionExtensions - { - public static FluentAssertions.Data.DataSetAssertions Should(this TDataSet actualValue) - where TDataSet : System.Data.DataSet { } - } - public static class DataTableAssertionExtensions - { - public static FluentAssertions.Data.DataTableAssertions Should(this TDataTable actualValue) - where TDataTable : System.Data.DataTable { } - } - public static class DataTableCollectionAssertionExtensions - { - public static FluentAssertions.AndConstraint> BeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection expected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataSet otherDataSet, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> HaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection otherCollection, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeSameAs(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection unexpected, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataSet otherDataSet, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotHaveSameCount(this FluentAssertions.Collections.GenericCollectionAssertions assertion, System.Data.DataTableCollection otherCollection, string because = "", params object[] becauseArgs) { } - } public static class EnumAssertionsExtensions { public static FluentAssertions.Primitives.EnumAssertions Should(this TEnum @enum) @@ -674,84 +632,6 @@ namespace FluentAssertions.Common Scan = 2, } } -namespace FluentAssertions.Data -{ - public class DataColumnAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public DataColumnAssertions(System.Data.DataColumn dataColumn) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Data.DataColumn expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Data.DataColumn expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - } - public class DataRowAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataRow : System.Data.DataRow - { - public DataRowAssertions(TDataRow dataRow) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataRow expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataRow expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataColumn> HaveColumn(string expectedColumnName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveColumns(params string[] expectedColumnNames) { } - public FluentAssertions.AndConstraint> HaveColumns(System.Collections.Generic.IEnumerable expectedColumnNames, string because = "", params object[] becauseArgs) { } - } - public class DataSetAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataSet : System.Data.DataSet - { - public DataSetAssertions(TDataSet dataSet) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataSet expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataSet expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataTable> HaveTable(string expectedTableName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveTableCount(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveTables(params string[] expectedTableNames) { } - public FluentAssertions.AndConstraint> HaveTables(System.Collections.Generic.IEnumerable expectedTableNames, string because = "", params object[] becauseArgs) { } - } - public class DataTableAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDataTable : System.Data.DataTable - { - public DataTableAssertions(TDataTable dataTable) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataTable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeEquivalentTo(System.Data.DataTable expectation, System.Func, FluentAssertions.Data.IDataEquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, System.Data.DataColumn> HaveColumn(string expectedColumnName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveColumns(params string[] expectedColumnNames) { } - public FluentAssertions.AndConstraint> HaveColumns(System.Collections.Generic.IEnumerable expectedColumnNames, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> HaveRowCount(int expected, string because = "", params object[] becauseArgs) { } - } - public interface IDataEquivalencyAssertionOptions : FluentAssertions.Equivalency.IEquivalencyAssertionOptions - { - FluentAssertions.Data.IDataEquivalencyAssertionOptions AllowingMismatchedTypes(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> predicate); - FluentAssertions.Data.IDataEquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumn(System.Data.DataColumn column); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumn(string tableName, string columnName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnInAllTables(string columnName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(System.Collections.Generic.IEnumerable columns); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(params System.Data.DataColumn[] columns); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(string tableName, System.Collections.Generic.IEnumerable columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumns(string tableName, params string[] columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnsInAllTables(System.Collections.Generic.IEnumerable columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingColumnsInAllTables(params string[] columnNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingOriginalData(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingRelated(System.Linq.Expressions.Expression> expression); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTable(string tableName); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTables(System.Collections.Generic.IEnumerable tableNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions ExcludingTables(params string[] tableNames); - FluentAssertions.Data.IDataEquivalencyAssertionOptions IgnoringUnmatchedColumns(); - FluentAssertions.Data.IDataEquivalencyAssertionOptions UsingRowMatchMode(FluentAssertions.Data.RowMatchMode rowMatchMode); - } - public enum RowMatchMode - { - Index = 0, - PrimaryKey = 1, - } -} namespace FluentAssertions.Equivalency { public class Comparands @@ -1114,46 +994,6 @@ namespace FluentAssertions.Equivalency.Steps public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } public override string ToString() { } } - public class ConstraintCollectionEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public ConstraintCollectionEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class ConstraintEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public ConstraintEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataColumnEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataColumnEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRelationEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRelationEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRowCollectionEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRowCollectionEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataRowEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataRowEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataSetEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataSetEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class DataTableEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DataTableEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } @@ -2803,4 +2643,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/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index 6cc9eed47e..bbf0f36168 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -14,7 +14,6 @@ - diff --git a/Tests/Benchmarks/LargeDataTableEquivalency.cs b/Tests/Benchmarks/LargeDataTableEquivalency.cs deleted file mode 100644 index ff4b0f9455..0000000000 --- a/Tests/Benchmarks/LargeDataTableEquivalency.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using System.Data; -using System.Linq; -using BenchmarkDotNet.Attributes; -using Bogus; -using FluentAssertions; -using FluentAssertions.Data; - -namespace Benchmarks; - -[MemoryDiagnoser] -public class LargeDataTableEquivalencyBenchmarks -{ - private DataTable dataTable1; - private DataTable dataTable2; - - [Params(10, 100, 1_000, 10_000, 100_000)] - public int RowCount { get; set; } - - [GlobalSetup] - public void GlobalSetup() - { - dataTable1 = CreateDataTable(); - dataTable2 = CreateDataTable(); - - object[] rowData = new object[dataTable1.Columns.Count]; - - var faker = new Faker - { - Random = new Randomizer(localSeed: 1) - }; - - for (int i = 0; i < RowCount; i++) - { - for (int j = 0; j < dataTable1.Columns.Count; j++) - { - Type columnType = dataTable1.Columns[j].DataType; - rowData[j] = GetData(faker, columnType); - } - - dataTable1.Rows.Add(rowData); - dataTable2.Rows.Add(rowData); - } - } - - private static object GetData(Faker faker, Type columnType) - { - return Type.GetTypeCode(columnType) switch - { - TypeCode.Empty or TypeCode.DBNull => null, - TypeCode.Boolean => faker.Random.Bool(), - TypeCode.Char => faker.Lorem.Letter().Single(), - TypeCode.SByte => faker.Random.SByte(), - TypeCode.Byte => faker.Random.Byte(), - TypeCode.Int16 => faker.Random.Short(), - TypeCode.UInt16 => faker.Random.UShort(), - TypeCode.Int32 => faker.Random.Int(), - TypeCode.UInt32 => faker.Random.UInt(), - TypeCode.Int64 => faker.Random.Long(), - TypeCode.UInt64 => faker.Random.ULong(), - TypeCode.Single => faker.Random.Float(), - TypeCode.Double => faker.Random.Double(), - TypeCode.Decimal => faker.Random.Decimal(), - TypeCode.DateTime => faker.Date.Between(DateTime.UtcNow.AddDays(-30), DateTime.UtcNow.AddDays(+30)), - TypeCode.String => faker.Lorem.Lines(1), - _ => GetDefault(faker, columnType), - }; - } - - private static object GetDefault(Faker faker, Type columnType) - { - if (columnType == typeof(TimeSpan)) - { - return faker.Date.Future() - faker.Date.Future(); - } - else if (columnType == typeof(Guid)) - { - return faker.Random.Guid(); - } - - throw new Exception("Unable to populate column of type " + columnType); - } - - private static DataTable CreateDataTable() - { - var table = new DataTable("Test"); - - table.Columns.Add("A", typeof(bool)); - table.Columns.Add("B", typeof(char)); - table.Columns.Add("C", typeof(sbyte)); - table.Columns.Add("D", typeof(byte)); - table.Columns.Add("E", typeof(short)); - table.Columns.Add("F", typeof(ushort)); - table.Columns.Add("G", typeof(int)); - table.Columns.Add("H", typeof(uint)); - table.Columns.Add("I", typeof(long)); - table.Columns.Add("J", typeof(ulong)); - table.Columns.Add("K", typeof(float)); - table.Columns.Add("L", typeof(double)); - table.Columns.Add("M", typeof(decimal)); - table.Columns.Add("N", typeof(DateTime)); - table.Columns.Add("O", typeof(string)); - table.Columns.Add("P", typeof(TimeSpan)); - table.Columns.Add("Q", typeof(Guid)); - - return table; - } - - [Benchmark] - public AndConstraint> BeEquivalentTo() => dataTable1.Should().BeEquivalentTo(dataTable2); -} diff --git a/Tests/FluentAssertions.Equivalency.Specs/DataColumnSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DataColumnSpecs.cs deleted file mode 100644 index bc6481daeb..0000000000 --- a/Tests/FluentAssertions.Equivalency.Specs/DataColumnSpecs.cs +++ /dev/null @@ -1,785 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using Xunit; -using Xunit.Sdk; - -namespace FluentAssertions.Equivalency.Specs; - -public class DataColumnSpecs : DataSpecs -{ - [Fact] - public void When_DataColumns_are_identical_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - // Act & Assert - dataTable1.RowIDColumn.Should().BeEquivalentTo(dataTable2.RowIDColumn); - } - - [Fact] - public void When_DataColumns_are_both_null_it_should_succeed() - { - // Act & Assert - ((DataColumn)null).Should().BeEquivalentTo(null); - } - - [Fact] - public void When_DataColumn_is_null_and_isnt_expected_to_be_it_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataTable = dataSet.TypedDataTable1; - - // Act - Action action = () => ((DataColumn)null).Should().BeEquivalentTo(dataTable.RowIDColumn); - - // Assert - action.Should().Throw().WithMessage( - "Expected *to be non-null, but found null*"); - } - - [Fact] - public void When_DataColumn_is_expected_to_be_null_and_isnt_it_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataTable = dataSet.TypedDataTable1; - - // Act - Action action = () => dataTable.RowIDColumn.Should().BeEquivalentTo(null); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_DataColumn_has_changes_but_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.Unique = true; - dataColumn2.Caption = "Test"; - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .ExcludingColumn(dataColumn2)); - } - - [Fact] - public void Can_exclude_a_column_from_all_tables() - { - // Arrange - var subjectDataSet = CreateDummyDataSet(); - var expectationDataSet = new TypedDataSetSubclass(subjectDataSet); - - var subject = subjectDataSet.TypedDataTable1.DecimalColumn; - var expectation = expectationDataSet.TypedDataTable1.DecimalColumn; - - expectation.Unique = true; - expectation.Caption = "Test"; - - // Act & Assert - subject.Should().BeEquivalentTo(expectation, options => options - .ExcludingColumnInAllTables(expectation.ColumnName)); - } - - [Fact] - public void When_DataColumn_has_changes_but_is_excluded_as_params_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.Unique = true; - dataColumn2.Caption = "Test"; - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .ExcludingColumns(dataColumn2)); - } - - [Fact] - public void When_DataColumn_has_changes_but_is_excluded_as_enumerable_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.Unique = true; - dataColumn2.Caption = "Test"; - - // Act & Assert - IEnumerable excludedColumns = new[] { dataColumn2 }; - - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .ExcludingColumns(excludedColumns)); - } - - [Fact] - public void When_DataColumn_has_changes_but_is_excluded_it_should_succeed_when_compared_via_DataTable() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataTable2.DecimalColumn.Unique = true; - dataTable2.DecimalColumn.Caption = "Test"; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options - .ExcludingColumn(dataTable2.DecimalColumn) - .ExcludingRelated(dataTable => dataTable.Constraints)); - } - - [Fact] - public void When_DataColumn_has_changes_but_is_excluded_it_should_succeed_when_compared_via_DataSet() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable2 = dataSet2.TypedDataTable1; - - dataTable2.DecimalColumn.Unique = true; - dataTable2.DecimalColumn.Caption = "Test"; - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options - .ExcludingColumn(dataTable2.DecimalColumn) - .ExcludingRelated(dataTable => dataTable.Constraints)); - } - - [Fact] - public void When_ColumnName_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.ColumnName += "different"; - - // Act - Action action = () => dataColumn1.Should().BeEquivalentTo(dataColumn2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_ColumnName_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.ColumnName += "different"; - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .Excluding(dataColumn => dataColumn.ColumnName) - .Excluding(dataColumn => dataColumn.Caption)); - } - - [Fact] - public void When_AllowDBNull_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.AllowDBNull = !dataColumn2.AllowDBNull; - - // Act - Action action = () => dataColumn1.Should().BeEquivalentTo(dataColumn2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_AllowDBNull_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.AllowDBNull = !dataColumn2.AllowDBNull; - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .Excluding(dataColumn => dataColumn.AllowDBNull)); - } - - [Fact] - public void When_AutoIncrement_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.AutoIncrement = !dataColumn2.AutoIncrement; - - // Act - Action action = () => dataColumn1.Should().BeEquivalentTo(dataColumn2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_AutoIncrement_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.AutoIncrement = !dataColumn2.AutoIncrement; - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .Excluding(dataColumn => dataColumn.AutoIncrement)); - } - - [Fact] - public void When_AutoIncrementSeed_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.AutoIncrementSeed++; - - // Act - Action action = () => dataColumn1.Should().BeEquivalentTo(dataColumn2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_AutoIncrementSeed_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.AutoIncrementSeed++; - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .Excluding(dataColumn => dataColumn.AutoIncrementSeed)); - } - - [Fact] - public void When_AutoIncrementStep_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.AutoIncrementStep++; - - // Act - Action action = () => dataColumn1.Should().BeEquivalentTo(dataColumn2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_AutoIncrementStep_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.AutoIncrementStep++; - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .Excluding(dataColumn => dataColumn.AutoIncrementStep)); - } - - [Fact] - public void When_Caption_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.Caption += "different"; - - // Act - Action action = () => dataColumn1.Should().BeEquivalentTo(dataColumn2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_Caption_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.Caption += "different"; - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .Excluding(dataColumn => dataColumn.Caption)); - } - - [Fact] - public void When_DataType_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(includeDummyData: false); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable2.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable2.DecimalColumn; - - dataColumn2.DataType = typeof(double); - - // Act - Action action = () => dataColumn1.Should().BeEquivalentTo(dataColumn2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_DataType_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(includeDummyData: false); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable2.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable2.DecimalColumn; - - dataColumn2.DataType = typeof(double); - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .Excluding(dataColumn => dataColumn.DataType)); - } - - [Fact] - public void When_DateTimeMode_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(includeDummyData: false); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable2.DateTimeColumn; - var dataColumn2 = dataSet2.TypedDataTable2.DateTimeColumn; - - dataColumn2.DateTimeMode = - dataColumn2.DateTimeMode == DataSetDateTime.Local - ? DataSetDateTime.Utc - : DataSetDateTime.Local; - - // Act - Action action = () => dataColumn1.Should().BeEquivalentTo(dataColumn2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_DateTimeMode_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(includeDummyData: false); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable2.DateTimeColumn; - var dataColumn2 = dataSet2.TypedDataTable2.DateTimeColumn; - - dataColumn2.DateTimeMode = - dataColumn2.DateTimeMode == DataSetDateTime.Local - ? DataSetDateTime.Utc - : DataSetDateTime.Local; - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .Excluding(dataColumn => dataColumn.DateTimeMode)); - } - - [Fact] - public void When_DefaultValue_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.DefaultValue = 10M; - - // Act - Action action = () => dataColumn1.Should().BeEquivalentTo(dataColumn2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_DefaultValue_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.DefaultValue = 10M; - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .Excluding(dataColumn => dataColumn.DefaultValue)); - } - - [Fact] - public void When_Expression_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.Expression = "RowID"; - - // Act - Action action = () => - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .Excluding(dataColumn => dataColumn.ReadOnly)); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_Expression_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.Expression = "RowID"; - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .Excluding(dataColumn => dataColumn.Expression) - .Excluding(dataColumn => dataColumn.ReadOnly)); - } - - [Fact] - public void When_MaxLength_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.StringColumn; - var dataColumn2 = dataSet2.TypedDataTable1.StringColumn; - - dataColumn2.MaxLength = 250; - - // Act - Action action = () => dataColumn1.Should().BeEquivalentTo(dataColumn2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_MaxLength_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.StringColumn; - var dataColumn2 = dataSet2.TypedDataTable1.StringColumn; - - dataColumn2.MaxLength = 250; - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .Excluding(dataColumn => dataColumn.MaxLength)); - } - - [Fact] - public void When_Namespace_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.Namespace += "different"; - - // Act - Action action = () => dataColumn1.Should().BeEquivalentTo(dataColumn2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_Namespace_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.Namespace += "different"; - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .Excluding(dataColumn => dataColumn.Namespace)); - } - - [Fact] - public void When_Prefix_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.Prefix += "different"; - - // Act - Action action = () => dataColumn1.Should().BeEquivalentTo(dataColumn2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_Prefix_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.Prefix += "different"; - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .Excluding(dataColumn => dataColumn.Prefix)); - } - - [Fact] - public void When_ReadOnly_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.ReadOnly = !dataColumn2.ReadOnly; - - // Act - Action action = () => dataColumn1.Should().BeEquivalentTo(dataColumn2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_ReadOnly_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.ReadOnly = !dataColumn2.ReadOnly; - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .Excluding(dataColumn => dataColumn.ReadOnly)); - } - - [Fact] - public void When_Unique_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.Unique = !dataColumn2.Unique; - - // Act - Action action = () => dataColumn1.Should().BeEquivalentTo(dataColumn2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_Unique_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataColumn1 = dataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = dataSet2.TypedDataTable1.DecimalColumn; - - dataColumn2.Unique = !dataColumn2.Unique; - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, options => options - .Excluding(dataColumn => dataColumn.Unique)); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void When_ExtendedProperties_do_not_match_and_property_is_not_excluded_it_should_fail(ChangeType changeType) - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataColumn1 = typedDataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = typedDataSet2.TypedDataTable1.DecimalColumn; - - ApplyChange(dataColumn2.ExtendedProperties, changeType); - - // Act - Action action = () => dataColumn1.Should().BeEquivalentTo(dataColumn2); - - // Assert - action.Should().Throw(); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void When_ExtendedProperties_do_not_match_and_property_is_excluded_it_should_succeed(ChangeType changeType) - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataColumn1 = typedDataSet1.TypedDataTable1.DecimalColumn; - var dataColumn2 = typedDataSet2.TypedDataTable1.DecimalColumn; - - ApplyChange(dataColumn2.ExtendedProperties, changeType); - - // Act & Assert - dataColumn1.Should().BeEquivalentTo(dataColumn2, - options => options.Excluding(dataColumn => dataColumn.ExtendedProperties)); - } - - [Fact] - public void Data_column_is_not_equivalent_to_another_type() - { - // Arrange - var subject = new - { - DataColumn = "foobar" - }; - - var expected = new - { - DataColumn = new DataColumn() - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(expected); - - // Assert - act.Should().Throw() - .WithMessage("Expected*System.Data.DataColumn*found System.String*"); - } -} diff --git a/Tests/FluentAssertions.Equivalency.Specs/DataRelationSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DataRelationSpecs.cs deleted file mode 100644 index 62ee3276dd..0000000000 --- a/Tests/FluentAssertions.Equivalency.Specs/DataRelationSpecs.cs +++ /dev/null @@ -1,353 +0,0 @@ -using System; -using System.Data; -using Xunit; -using Xunit.Sdk; - -namespace FluentAssertions.Equivalency.Specs; - -public class DataRelationSpecs : DataSpecs -{ - [Fact] - public void When_RelationName_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataSet2.Relations[0].RelationName += "different"; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_RelationName_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataSet2.Relations[0].RelationName += "different"; - - // Act & Assert - dataTable1.Should().BeEquivalentTo( - dataTable2, - options => options - .ExcludingRelated(dataRelation => dataRelation.RelationName)); - } - - [Fact] - public void When_Nested_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataSet2.Relations[0].Nested = !dataSet2.Relations[0].Nested; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_Nested_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataSet2.Relations[0].Nested = !dataSet2.Relations[0].Nested; - - // Act & Assert - dataTable1.Should().BeEquivalentTo( - dataTable2, - options => options - .ExcludingRelated(dataRelation => dataRelation.Nested)); - } - - [Fact] - public void When_DataSet_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataSet2.DataSetName += "different"; - - // Act - Action action = () => - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.Excluding(dataTable => dataTable.DataSet)); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_DataSet_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(identicalTables: true); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataSet2.DataSetName += "different"; - - // Act & Assert - dataTable1.Should().BeEquivalentTo( - dataTable2, - options => options - .Excluding(dataTable => dataTable.DataSet) - .ExcludingRelated((DataRelation dataRelation) => dataRelation.DataSet)); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void When_ExtendedProperties_do_not_match_and_property_is_not_excluded_it_should_fail(ChangeType changeType) - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - ApplyChange(dataTable2.ChildRelations[0].ExtendedProperties, changeType); - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw(); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void When_ExtendedProperties_do_not_match_and_property_is_excluded_it_should_succeed(ChangeType changeType) - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - ApplyChange(dataTable2.ChildRelations[0].ExtendedProperties, changeType); - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options - .ExcludingRelated((DataRelation dataRelation) => dataRelation.ExtendedProperties)); - } - - [Fact] - public void When_ParentColumns_do_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable2; - var dataTable2 = dataSet2.TypedDataTable2; - - dataSet2.TypedDataTable1.RowIDColumn.ColumnName += "different"; - - // Act - Action action = () => - dataTable1.Should().BeEquivalentTo(dataTable2, options => options - .Excluding(dataTable => dataTable.ChildRelations) - .Excluding(dataTable => dataTable.Constraints)); - - // Assert - action.Should().Throw().Which.Message.Should() - .Contain(dataSet2.TypedDataTable1.Columns[0].ColumnName); - } - - [Fact] - public void When_ParentColumns_do_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable2; - var dataTable2 = dataSet2.TypedDataTable2; - - dataSet2.TypedDataTable1.RowIDColumn.ColumnName += "different"; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options - .Excluding(dataTable => dataTable.ChildRelations) - .Excluding(dataTable => dataTable.Constraints) - .ExcludingRelated(dataRelation => dataRelation.ParentColumns) - .ExcludingRelated(dataRelation => dataRelation.ParentKeyConstraint) - .ExcludingRelated(dataRelation => dataRelation.ChildKeyConstraint)); - } - - [Fact] - public void When_ChildColumns_do_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataSet2.TypedDataTable2.ForeignRowIDColumn.ColumnName += "different"; - - // Act - Action action = () => - dataTable1.Should().BeEquivalentTo(dataTable2, options => options - .Excluding(dataTable => dataTable.ParentRelations) - .Excluding(dataTable => dataTable.Constraints)); - - // Assert - action.Should().Throw().Which.Message.Should() - .Contain(dataSet2.TypedDataTable1.Columns[0].ColumnName); - } - - [Fact] - public void When_ChildColumns_do_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataSet2.TypedDataTable2.ForeignRowIDColumn.ColumnName += "different"; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options - .Excluding(dataTable => dataTable.ParentRelations) - .Excluding(dataTable => dataTable.Constraints) - .ExcludingRelated(dataRelation => dataRelation.ChildColumns) - .ExcludingRelated(dataRelation => dataRelation.ParentKeyConstraint) - .ExcludingRelated(dataRelation => dataRelation.ChildKeyConstraint)); - } - - [Fact] - public void Data_relation_is_not_equivalent_to_another_type() - { - // Arrange - var dataSet = new DataSet(); - var table = new DataTable(); - var col1 = new DataColumn(); - var col2 = new DataColumn(); - - table.Columns.Add(col1); - table.Columns.Add(col2); - - dataSet.Tables.Add(table); - - var subject = new - { - DataRelation = "foobar" - }; - - var expected = new - { - DataRelation = new DataRelation("bar", col1, col2) - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(expected); - - // Assert - act.Should().Throw() - .WithMessage("Expected*System.Data.DataRelation*found System.String*"); - } - - [Fact] - public void Null_is_not_equivalent_to_a_data_relation() - { - // Arrange - var dataSet = new DataSet(); - var table = new DataTable(); - var col1 = new DataColumn(); - var col2 = new DataColumn(); - - table.Columns.Add(col1); - table.Columns.Add(col2); - - dataSet.Tables.Add(table); - - var subject = new - { - DataRelation = (DataRelation)null - }; - - var expected = new - { - DataRelation = new DataRelation("bar", col1, col2) - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(expected); - - // Assert - act.Should().Throw() - .WithMessage("Expected *value to be non-null, but found*"); - } - - [Fact] - public void Data_relation_is_not_equivalent_to_null() - { - // Arrange - var dataSet = new DataSet(); - var table = new DataTable(); - var col1 = new DataColumn(); - var col2 = new DataColumn(); - - table.Columns.Add(col1); - table.Columns.Add(col2); - - dataSet.Tables.Add(table); - - var subject = new - { - DataRelation = new DataRelation("bar", col1, col2) - }; - - var expected = new - { - DataRelation = (DataRelation)null - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(expected); - - // Assert - act.Should().Throw() - .WithMessage("Expected *to be null, but found*"); - } -} diff --git a/Tests/FluentAssertions.Equivalency.Specs/DataRowSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DataRowSpecs.cs deleted file mode 100644 index 6e561ded69..0000000000 --- a/Tests/FluentAssertions.Equivalency.Specs/DataRowSpecs.cs +++ /dev/null @@ -1,530 +0,0 @@ -using System; -using System.Data; -using System.Linq; -using FluentAssertions.Execution; -using Xunit; -using Xunit.Sdk; - -namespace FluentAssertions.Equivalency.Specs; - -public class DataRowSpecs : DataSpecs -{ - [Fact] - public void When_data_rows_are_identical_equivalency_test_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - // Act & Assert - dataTable1[0].Should().BeEquivalentTo(dataTable2[0]); - } - - [Fact] - public void When_data_rows_are_both_null_equivalency_test_should_succeed() - { - // Act & Assert - ((DataRow)null).Should().BeEquivalentTo(null); - } - - [Fact] - public void When_data_row_is_null_and_isnt_expected_to_be_then_equivalency_test_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataTable = dataSet.TypedDataTable1; - - // Act - Action action = () => ((DataRow)null).Should().BeEquivalentTo(dataTable[0]); - - // Assert - action.Should().Throw().WithMessage( - "Expected *to be non-null, but found null*"); - } - - [Fact] - public void When_data_row_is_expected_to_be_null_and_isnt_then_equivalency_test_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataTable = dataSet.TypedDataTable1; - - // Act - Action action = () => dataTable[0].Should().BeEquivalentTo(null); - - // Assert - action.Should().Throw().WithMessage("Expected dataTable[0] value to be null, but found *"); - } - - [Fact] - public void - When_data_row_subject_is_deleted_and_expectation_is_not_but_the_row_state_is_excluded_equivalency_test_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable2; - var dataTable2 = dataSet2.TypedDataTable2; - - var dataRow1 = dataTable1[0]; - var dataRow2 = dataTable2[0]; - - dataRow1.Delete(); - - // Act & Assert - dataRow1.Should().BeEquivalentTo(dataRow2, config => config - .Excluding(row => row.RowState)); - } - - [Fact] - public void - When_data_row_expectation_is_deleted_and_subject_is_not_but_the_row_state_is_excluded_equivalency_test_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable2; - var dataTable2 = dataSet2.TypedDataTable2; - - var dataRow1 = dataTable1[0]; - var dataRow2 = dataTable2[0]; - - dataRow2.Delete(); - - // Act & Assert - dataRow1.Should().BeEquivalentTo(dataRow2, config => config - .Excluding(row => row.RowState)); - } - - [Fact] - public void When_data_row_is_deleted_equivalency_test_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable2; - var dataTable2 = dataSet2.TypedDataTable2; - - var dataRow1 = dataTable1[0]; - var dataRow2 = dataTable2[0]; - - dataRow1.Delete(); - dataRow2.Delete(); - - // Act & Assert - dataRow1.Should().BeEquivalentTo(dataRow2); - } - - [Fact] - public void When_data_row_is_modified_and_original_data_differs_equivalency_test_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable2; - var dataTable2 = dataSet2.TypedDataTable2; - - var dataRow1 = dataTable1[0]; - var dataRow2 = dataTable2[0]; - - dataRow1.Decimal++; - dataTable1.AcceptChanges(); - dataRow1.Decimal--; - - dataRow2.Decimal--; - dataTable2.AcceptChanges(); - dataRow2.Decimal++; - - // Act - Action action = () => dataRow1.Should().BeEquivalentTo(dataRow2); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataRow1[Decimal, DataRowVersion.Original] to be *, but found *"); - } - - [Fact] - public void - When_data_row_is_modified_and_original_data_differs_but_original_data_is_excluded_then_equivalency_test_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable2; - var dataTable2 = dataSet2.TypedDataTable2; - - var dataRow1 = dataTable1[0]; - var dataRow2 = dataTable2[0]; - - // Set the Decimal property to be the same for both rows, but by doing ++ and -- in - // different orders, the AcceptChanges call will load different values into the - // original data for each row. - dataRow1.Decimal++; - dataTable1.AcceptChanges(); - dataRow1.Decimal--; - - dataRow2.Decimal--; - dataTable2.AcceptChanges(); - dataRow2.Decimal++; - - // Act & Assert - dataRow1.Should().BeEquivalentTo(dataRow2, config => config - .ExcludingOriginalData()); - } - - [Fact] - public void When_data_row_type_does_not_match_and_mismatched_types_are_not_allowed_then_equivalency_test_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(identicalTables: true); - var dataSet2 = new TypedDataSetSubclass(dataSet); - - var dataTable = dataSet.TypedDataTable1; - var dataTableOfMismatchedType = dataSet2.TypedDataTable2; - - dataSet2.Tables.Remove(dataTable.TableName); - dataTableOfMismatchedType.TableName = dataTable.TableName; - - // Act - Action action = () => dataTable[0].Should().BeEquivalentTo(dataTableOfMismatchedType[0]); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataTable[0] to be of type *TypedDataRow2, but found *TypedDataRow1*"); - } - - [Fact] - public void When_data_row_type_does_not_match_but_mismatched_types_are_allowed_then_equivalency_test_should_succeed() - { - // Arrange - var dataSet = CreateDummyDataSet(identicalTables: true); - var dataSet2 = new TypedDataSetSubclass(dataSet); - - var dataTable = dataSet.TypedDataTable1; - var dataTableOfMismatchedType = dataSet2.TypedDataTable2; - - dataSet2.Tables.Remove(dataTable.TableName); - dataTableOfMismatchedType.TableName = dataTable.TableName; - - // Act & Assert - dataTable[0].Should().BeEquivalentTo(dataTableOfMismatchedType[0], options => options.AllowingMismatchedTypes()); - } - - [Fact] - public void - When_one_data_row_has_errors_and_the_other_does_not_and_the_corresponding_property_is_not_excluded_then_equivalency_test_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataRow1 = dataSet1.TypedDataTable1[0]; - var dataRow2 = dataSet2.TypedDataTable1[0]; - - dataRow2.RowError = "Manually added error"; - - // Act - Action action = () => dataRow1.Should().BeEquivalentTo(dataRow2); - - // Assert - action.Should().Throw().Which.Message.Should().Contain("HasErrors"); - } - - [Fact] - public void - When_one_data_row_has_errors_and_the_other_does_not_but_the_corresponding_property_is_excluded_then_equivalency_test_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataRow1 = dataSet1.TypedDataTable1[0]; - var dataRow2 = dataSet2.TypedDataTable1[0]; - - dataRow2.RowError = "Manually added error"; - - // Act & Assert - dataRow1.Should().BeEquivalentTo(dataRow2, config => config.Excluding(dataRow => dataRow.HasErrors)); - } - - [Fact] - public void - When_the_data_row_state_does_not_match_and_the_corresponding_property_is_not_excluded_equivalency_test_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataRow1 = dataSet1.TypedDataTable1[0]; - var dataRow2 = dataSet2.TypedDataTable1[0]; - - dataRow1.DateTime = DateTime.UtcNow; - dataRow2.DateTime = dataRow1.DateTime; - - dataSet2.AcceptChanges(); - - // Act - Action action = () => dataRow1.Should().BeEquivalentTo(dataRow2); - - // Assert - action.Should().Throw().Which.Message.Should().Contain("RowState"); - } - - [Fact] - public void - When_the_data_row_state_does_not_match_but_the_corresponding_property_is_excluded_equivalency_test_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataRow1 = dataSet1.TypedDataTable1[0]; - var dataRow2 = dataSet2.TypedDataTable1[0]; - - dataRow1.DateTime = DateTime.UtcNow; - dataRow2.DateTime = dataRow1.DateTime; - - dataSet2.AcceptChanges(); - - // Act & Assert - dataRow1.Should().BeEquivalentTo(dataRow2, config => config.Excluding(dataRow => dataRow.RowState)); - } - - [Fact] - public void When_data_row_data_does_not_match_and_the_column_in_question_is_not_excluded_then_equivalency_test_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataRow1 = dataSet1.TypedDataTable1[0]; - var dataRow2 = dataSet2.TypedDataTable1[0]; - - dataRow2.String = Guid.NewGuid().ToString(); - dataSet2.AcceptChanges(); - - // Act - Action action = () => dataRow1.Should().BeEquivalentTo(dataRow2); - - // Assert - action.Should().Throw().Which.Message.Should().Contain(dataRow2.String); - } - - [Fact] - public void When_data_row_data_does_not_match_but_the_column_is_excluded_then_equivalency_test_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataRow1 = dataSet1.TypedDataTable1[0]; - var dataRow2 = dataSet2.TypedDataTable1[0]; - - dataRow2.DateTime = DateTime.UtcNow; - dataSet2.AcceptChanges(); - - // Act & Assert - dataRow1.Should().BeEquivalentTo(dataRow2, config => config.ExcludingColumn(dataSet2.TypedDataTable1.DateTimeColumn)); - } - - [Fact] - public void Data_row_is_not_equivalent_to_another_type() - { - // Arrange - var table = new DataTable(); - var dataRow = table.NewRow(); - - var subject = new - { - DataRow = "foobar" - }; - - var expected = new - { - DataRow = dataRow - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(expected); - - // Assert - act.Should().Throw() - .WithMessage("Expected*System.Data.DataRow*found System.String*"); - } - - [Fact] - public void Any_type_is_not_equivalent_to_data_row_colletion() - { - // Arrange - var o = new object(); - - // Act - Action act = () => o.Should().BeEquivalentTo((DataRowCollection)null); - - // Assert - act.Should().Throw() - .WithMessage("Expected* to be of type DataRowCollection, but found*"); - } - - [Fact] - public void When_data_row_has_column_then_asserting_that_it_has_that_column_should_succeed() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataRow = dataSet.TypedDataTable1[0]; - - string expectedColumnName = dataSet.TypedDataTable1.Columns.Cast().Last().ColumnName; - - // Act & Assert - dataRow.Should().HaveColumn(expectedColumnName); - } - - [Fact] - public void When_data_row_does_not_have_column_then_asserting_that_it_has_that_column_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataRow = dataSet.TypedDataTable1[0]; - - // Act - Action action = - () => dataRow.Should().HaveColumn("Unicorn"); - - // Assert - action.Should().Throw().WithMessage("Expected dataRow to contain a column named *Unicorn*"); - } - - [Fact] - public void Null_data_row_does_not_have_column() - { - // Arrange - var dataRow = (DataRow)null; - - // Act - Action action = - () => dataRow.Should().HaveColumn("Does not matter"); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataRow to contain a column named *Does not matter*, but found *"); - } - - [Fact] - public void When_data_row_data_has_all_columns_being_asserted_then_it_should_succeed() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataRow = dataSet.TypedDataTable1[0]; - - var subsetOfColumnNames = dataRow.Table.Columns.Cast() - .Take(dataRow.Table.Columns.Count - 2) - .Select(column => column.ColumnName); - - // Act & Assert - dataRow.Should().HaveColumns(subsetOfColumnNames); - } - - [Fact] - public void Data_row_with_all_colums_asserted_and_using_the_array_overload_passes() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataRow = dataSet.TypedDataTable1[0]; - - string[] subsetOfColumnNames = dataRow.Table.Columns.Cast() - .Take(dataRow.Table.Columns.Count - 2) - .Select(column => column.ColumnName) - .ToArray(); - - // Act & Assert - dataRow.Should().HaveColumns(subsetOfColumnNames); - } - - [Fact] - public void Null_data_row_and_using_the_array_overload_fails() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataRow = dataSet.TypedDataTable1[0]; - - var actual = (DataRow)null; - - string[] subsetOfColumnNames = dataRow.Table.Columns.Cast() - .Take(dataRow.Table.Columns.Count - 2) - .Select(column => column.ColumnName) - .ToArray(); - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - actual.Should().HaveColumns(subsetOfColumnNames); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expected actual to be in a table containing *column*, but found *"); - } - - [Fact] - public void When_data_row_data_has_only_some_of_the_columns_being_asserted_then_it_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataRow = dataSet.TypedDataTable1[0]; - - var subsetOfColumnNamesWithUnicorn = dataRow.Table.Columns.Cast() - .Take(dataRow.Table.Columns.Count - 2) - .Select(column => column.ColumnName) - .Concat(new[] { "Unicorn" }); - - // Act - Action action = - () => dataRow.Should().HaveColumns(subsetOfColumnNamesWithUnicorn); - - // Assert - action.Should().Throw() - .WithMessage("Expected table containing dataRow to contain a column named *Unicorn*"); - } - - [Fact] - public void When_data_row_data_has_none_of_the_columns_being_asserted_then_it_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataRow = dataSet.TypedDataTable1[0]; - - var columnNames = new[] { "Unicorn", "Dragon" }; - - // Act - Action action = - () => dataRow.Should().HaveColumns(columnNames); - - // Assert - action.Should().Throw() - .WithMessage("Expected table containing dataRow to contain a column named *Unicorn*"); - } -} diff --git a/Tests/FluentAssertions.Equivalency.Specs/DataSetSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DataSetSpecs.cs deleted file mode 100644 index 341bd5d509..0000000000 --- a/Tests/FluentAssertions.Equivalency.Specs/DataSetSpecs.cs +++ /dev/null @@ -1,831 +0,0 @@ -using System; -using System.Data; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq; -using FluentAssertions.Execution; -using Xunit; -using Xunit.Sdk; - -namespace FluentAssertions.Equivalency.Specs; - -public class DataSetSpecs : DataSpecs -{ - [Fact] - public void When_data_sets_are_identical_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2); - } - - [Fact] - public void When_data_sets_are_both_null_equivalence_test_should_succeed() - { - // Act & Assert - ((DataSet)null).Should().BeEquivalentTo(null); - } - - [Fact] - public void When_data_set_is_null_and_isnt_expected_to_be_equivalence_test_should_fail() - { - // Arrange - var typedDataSet = CreateDummyDataSet(); - - var dataSet = typedDataSet.ToUntypedDataSet(); - - // Act - Action action = () => ((DataSet)null).Should().BeEquivalentTo(dataSet); - - // Assert - action.Should().Throw().WithMessage( - "Expected *to be non-null, but found null*"); - } - - [Fact] - public void When_data_set_is_expected_to_be_null_and_isnt_equivalence_test_should_fail() - { - // Arrange - var typedDataSet = CreateDummyDataSet(); - - var dataSet = typedDataSet.ToUntypedDataSet(); - - // Act - Action action = () => dataSet.Should().BeEquivalentTo(null); - - // Assert - action.Should().Throw().WithMessage("Expected dataSet value to be null, but found *"); - } - - [Fact] - public void When_data_set_type_does_not_match_and_not_allowing_msimatched_types_equivalence_test_should_fail() - { - // Arrange - var typedDataSet = CreateDummyDataSet(); - - var dataSet = typedDataSet.ToUntypedDataSet(); - - var dataSetOfMismatchedType = new TypedDataSetSubclass(typedDataSet); - - // Act - Action action = () => dataSet.Should().BeEquivalentTo(dataSetOfMismatchedType); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataSet to be of type *TypedDataSetSubclass, but found System.Data.DataSet*"); - } - - [Fact] - public void When_data_set_type_does_not_match_but_mismatched_types_are_allowed_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet = CreateDummyDataSet(); - - var dataSet = typedDataSet.ToUntypedDataSet(); - - var dataSetOfMismatchedType = new TypedDataSetSubclass(typedDataSet); - - // Act & Assert - dataSet.Should().BeEquivalentTo(dataSetOfMismatchedType, options => options - .AllowingMismatchedTypes() - .Excluding(dataSet => dataSet.SchemaSerializationMode)); - } - - [Fact] - public void When_data_set_name_does_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.DataSetName += "different"; - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw().WithMessage("Expected dataSet1 to have DataSetName *different*"); - } - - [Fact] - public void When_data_set_name_does_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.DataSetName += "different"; - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options - .Excluding(dataSet => dataSet.DataSetName) - .ExcludingRelated((DataRelation dataRelation) => dataRelation.DataSet)); - } - - [Fact] - public void - When_one_data_set_is_configured_to_be_case_sensitive_and_the_other_is_not_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.CaseSensitive = !typedDataSet2.CaseSensitive; - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataSet1 to have CaseSensitive value of True, but found False instead*"); - } - - [Fact] - public void - When_one_data_set_is_configured_to_be_case_sensitive_and_the_other_is_not_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.CaseSensitive = !typedDataSet2.CaseSensitive; - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options.Excluding(dataSet => dataSet.CaseSensitive)); - } - - [Fact] - public void - When_one_data_set_is_configured_to_enforce_constraints_and_the_other_is_not_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.EnforceConstraints = !typedDataSet2.EnforceConstraints; - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataSet1 to have EnforceConstraints value of False, but found True instead*"); - } - - [Fact] - public void - When_one_data_set_is_configured_to_enforce_constraints_and_the_other_is_not_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.EnforceConstraints = !typedDataSet2.EnforceConstraints; - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options.Excluding(dataSet => dataSet.EnforceConstraints)); - } - - [Fact] - public void - When_one_data_set_has_errors_and_the_other_does_not_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.TypedDataTable1.Rows[0].RowError = "Manually added error"; - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2, config => config.ExcludingTables("TypedDataTable1")); - - // Assert - action.Should().Throw().Which.Message.Should().Contain("HasErrors"); - } - - [Fact] - public void - When_one_data_set_has_errors_and_the_other_does_not_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.TypedDataTable1.Rows[0].RowError = "Manually added error"; - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, - config => config.Excluding(dataSet => dataSet.HasErrors).ExcludingTables("TypedDataTable1")); - } - - [Fact] - public void - When_data_sets_have_mismatched_locale_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet1.Locale = new CultureInfo("en-US"); - typedDataSet2.Locale = new CultureInfo("fr-CA"); - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataSet1 to have Locale value of fr-CA, but found en-US instead*"); - } - - [Fact] - public void When_data_set_locale_does_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet1.Locale = new CultureInfo("en-US"); - typedDataSet2.Locale = new CultureInfo("fr-CA"); - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options.Excluding(dataSet => dataSet.Locale)); - } - - [Fact] - public void - When_data_set_namespace_does_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.Namespace += "different"; - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw().WithMessage("Expected dataSet1 to have Namespace value of *different*"); - } - - [Fact] - public void - When_data_set_namespace_does_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.Namespace += "different"; - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options - .Excluding(dataSet => dataSet.Namespace) - .ExcludingRelated((DataTable dataTable) => dataTable.Namespace) - .ExcludingRelated((DataColumn dataColumn) => dataColumn.Namespace)); - } - - [Fact] - public void When_data_set_prefix_does_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.Prefix += "different"; - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw().WithMessage("Expected dataSet1 to have Prefix value of *different*"); - } - - [Fact] - public void When_data_set_prefix_does_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.Prefix += "different"; - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options.Excluding(dataSet => dataSet.Prefix)); - } - - [Fact] - public void - When_data_set_remoting_format_does_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.RemotingFormat = - typedDataSet2.RemotingFormat == SerializationFormat.Binary - ? SerializationFormat.Xml - : SerializationFormat.Binary; - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected dataSet1 to have RemotingFormat value of SerializationFormat.Binary*, but found *Xml* instead*"); - } - - [Fact] - public void - When_data_set_remoting_format_does_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.RemotingFormat = - typedDataSet2.RemotingFormat == SerializationFormat.Binary - ? SerializationFormat.Xml - : SerializationFormat.Binary; - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options - .Excluding(dataSet => dataSet.RemotingFormat) - .ExcludingRelated(dataTable => dataTable.RemotingFormat)); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void - When_data_set_extended_properties_do_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail( - ChangeType changeType) - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - ApplyChange(typedDataSet2.ExtendedProperties, changeType); - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw().WithMessage("Expected *dataSet1.ExtendedProperties* to be *, but *"); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void - When_data_set_extended_properties_do_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed( - ChangeType changeType) - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - ApplyChange(typedDataSet2.ExtendedProperties, changeType); - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options.Excluding(dataSet => dataSet.ExtendedProperties)); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - [SuppressMessage("Style", "IDE0010:Add missing cases", Justification = "All enum values are accounted for.")] - public void When_data_set_relations_do_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail( - ChangeType changeType) - { - // Arrange - TypedDataSetSubclass typedDataSet1; - TypedDataSetSubclass typedDataSet2; - - if (changeType == ChangeType.Changed) - { - typedDataSet1 = CreateDummyDataSet(); - typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.Relations[0].RelationName += "different"; - } - else - { - var doesNotHaveRelation = CreateDummyDataSet(includeRelation: false); - var hasRelation = new TypedDataSetSubclass(doesNotHaveRelation); - - AddRelation(hasRelation); - - if (changeType == ChangeType.Added) - { - typedDataSet1 = doesNotHaveRelation; - typedDataSet2 = hasRelation; - } - else - { - typedDataSet1 = hasRelation; - typedDataSet2 = doesNotHaveRelation; - } - } - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw().WithMessage("Expected *dataSet1.Relations* to *, but *"); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - [SuppressMessage("Style", "IDE0010:Add missing cases", Justification = "All enum values are accounted for.")] - public void When_data_set_relations_do_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed( - ChangeType changeType) - { - // Arrange - TypedDataSetSubclass typedDataSet1; - TypedDataSetSubclass typedDataSet2; - - if (changeType == ChangeType.Changed) - { - typedDataSet1 = CreateDummyDataSet(); - typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.Relations[0].RelationName += "different"; - } - else - { - var doesNotHaveRelation = CreateDummyDataSet(includeRelation: false); - var hasRelation = new TypedDataSetSubclass(doesNotHaveRelation); - - AddRelation(hasRelation); - - if (changeType == ChangeType.Added) - { - typedDataSet1 = doesNotHaveRelation; - typedDataSet2 = hasRelation; - } - else - { - typedDataSet1 = hasRelation; - typedDataSet2 = doesNotHaveRelation; - } - } - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options - .Excluding(dataSet => dataSet.Relations) - .ExcludingRelated(dataTable => dataTable.Constraints) - .ExcludingRelated(dataTable => dataTable.ParentRelations) - .ExcludingRelated(dataTable => dataTable.ChildRelations) - .ExcludingRelated(dataColumn => dataColumn.Unique)); - } - - [Fact] - public void When_data_set_tables_are_the_same_but_in_a_different_order_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1, swapTableOrder: true); - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2); - } - - [Fact] - public void When_data_set_table_count_does_not_match_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1, swapTableOrder: true); - - typedDataSet2.Tables.Add(new DataTable("ThirdWheel")); - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw().Which.Message.Should().Contain("to contain " + dataSet2.Tables.Count); - } - - [Fact] - public void When_data_set_table_count_matches_but_tables_are_different_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1, swapTableOrder: true); - - typedDataSet2.TypedDataTable2.TableName = "DifferentTableName"; - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected dataSet1.Relations[0].ExtendedProperties* to reference column *ForeignRowID* in table *Different*, but found a reference to *ForeignRowID* in table *TypedDataTable2* instead*"); - } - - [Fact] - public void When_data_set_tables_contain_different_data_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1, swapTableOrder: true); - - typedDataSet2.TypedDataTable2[0].Guid = Guid.NewGuid(); - - var dataSet1 = typedDataSet1.ToUntypedDataSet(); - var dataSet2 = typedDataSet2.ToUntypedDataSet(); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected dataSet1[TypedDataTable2].Rows[0] to have RowState value of *Modified*, but found *Unchanged* instead*"); - } - - [Fact] - public void Data_set_is_not_equivalent_to_another_type() - { - // Arrange - var subject = new - { - DataSet = "foobar" - }; - - var expected = new - { - DataSet = new DataSet() - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(expected); - - // Assert - act.Should().Throw() - .WithMessage("Expected*System.Data.DataSet*found System.String*"); - } - - [Fact] - public void When_data_set_table_count_has_expected_value_equivalence_test_should_succeed() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var correctTableCount = dataSet.Tables.Count; - - // Act & Assert - dataSet.Should().HaveTableCount(correctTableCount); - } - - [Fact] - public void Null_data_set_fails() - { - // Arrange - var dataSet = (DataSet)null; - - var correctTableCount = -1; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - dataSet.Should().HaveTableCount(correctTableCount); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expected dataSet to contain exactly*, but found *"); - } - - [Fact] - public void When_data_set_table_count_has_unexpected_value_equivalence_test_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var correctTableCount = dataSet.Tables.Count; - - var incorrectTableCount = correctTableCount + 1; - - // Act - Action action = - () => dataSet.Should().HaveTableCount(incorrectTableCount); - - // Assert - action.Should().Throw().WithMessage("Expected dataSet to contain exactly 3 table(s), but found 2."); - } - - [Fact] - public void When_data_set_contains_expected_table_and_asserting_that_it_has_that_table_it_should_succeed() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var existingTableName = dataSet.Tables[0].TableName; - - // Act & Assert - dataSet.Should().HaveTable(existingTableName); - } - - [Fact] - public void Null_data_set_does_not_contain_expected_table() - { - // Arrange - var dataSet = (DataSet)null; - - var existingTableName = "Does not matter"; - - // Act - Action act = () => dataSet.Should().HaveTable(existingTableName); - - // Assert - act.Should().Throw() - .WithMessage("Expected dataSet to contain a table named*, but found *"); - } - - [Fact] - public void When_data_set_does_not_contain_expected_table_asserting_that_it_has_that_table_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - string nonExistingTableName = "Unicorn"; - - // Act - Action action = - () => dataSet.Should().HaveTable(nonExistingTableName); - - // Assert - action.Should().Throw().WithMessage("Expected dataSet to contain a table named *Unicorn*"); - } - - [Fact] - public void When_data_set_has_all_expected_tables_asserting_that_it_has_them_should_succeed() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var existingTableNames = dataSet.Tables.Cast() - .Select(table => table.TableName); - - // Act & Assert - dataSet.Should().HaveTables(existingTableNames); - } - - [Fact] - public void Null_data_set_has_no_tables_and_fails() - { - // Arrange - var dataSet = CreateDummyDataSet(); - var actual = (DataSet)null; - - var existingTableNames = dataSet.Tables.Cast() - .Select(table => table.TableName); - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - actual.Should().HaveTables(existingTableNames); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expected actual to contain*table*with specific name*, but found *"); - } - - [Fact] - public void When_data_set_has_some_of_the_expected_tables_but_not_all_then_asserting_that_it_has_them_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var tableNames = dataSet.Tables.Cast() - .Select(table => table.TableName) - .Concat(new[] { "Unicorn" }); - - // Act - Action action = - () => dataSet.Should().HaveTables(tableNames); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataSet to contain a table named *Unicorn*, but it does not."); - } - - [Fact] - public void When_data_set_has_none_of_the_expected_tables_then_asserting_that_it_has_them_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var nonExistentTableNames = new[] { "Unicorn", "Dragon" }; - - // Act - Action action = - () => dataSet.Should().HaveTables(nonExistentTableNames); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataSet to contain a table named *Unicorn*, but it does not."); - } -} diff --git a/Tests/FluentAssertions.Equivalency.Specs/DataSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DataSpecs.cs deleted file mode 100644 index a2d6b77e35..0000000000 --- a/Tests/FluentAssertions.Equivalency.Specs/DataSpecs.cs +++ /dev/null @@ -1,676 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics.CodeAnalysis; -using System.Linq; - -namespace FluentAssertions.Equivalency.Specs; - -/// -/// Class containing specs related to System.Data, including many common declarations and methods. -/// -public class DataSpecs -{ - // Non-static member to avoid getting flagged as a "static holder type". This - // type is inherited by the specialized specs classes it contains. - public int Dummy { get; set; } - - #region Subject Types - - /* - - NB: TypedDataTable1 and TypedDataTable2 intentionally have the same schema. This allows testing of - Should().BeEquivalentTo(options => options.AllowMismatchedTypes). - - */ - - public class TypedDataRow1 : DataRow - { - private readonly TypedDataTable1 ownerTable; - - public TypedDataRow1(DataRowBuilder rowBuilder) - : base(rowBuilder) - { - ownerTable = (TypedDataTable1)Table; - } - - public int RowID - { - get => (int)this[ownerTable.RowIDColumn]; - set => this[ownerTable.RowIDColumn] = value; - } - - public decimal Decimal - { - get => (decimal)this[ownerTable.DecimalColumn]; - set => this[ownerTable.DecimalColumn] = value; - } - - public string String - { - get => (string)this[ownerTable.StringColumn]; - set => this[ownerTable.StringColumn] = value; - } - - public Guid Guid - { - get => (Guid)this[ownerTable.GuidColumn]; - set => this[ownerTable.GuidColumn] = value; - } - - public DateTime DateTime - { - get => (DateTime)this[ownerTable.DateTimeColumn]; - set => this[ownerTable.DateTimeColumn] = value; - } - - public int? ForeignRowID - { - get => IsNull(ownerTable.ForeignRowIDColumn) ? null : (int?)this[ownerTable.ForeignRowIDColumn]; - set => this[ownerTable.ForeignRowIDColumn] = value; - } - } - - [SuppressMessage("Microsoft.StyleCop.CSharp.Naming", "SA1306", - Justification = "DataColumn accessors are named after the columns.")] - [SuppressMessage("Microsoft.StyleCop.CSharp.Naming", "SA1516", - Justification = "DataColumn accessors are grouped in a block of lines.")] - public class TypedDataTable1 : TypedTableBase - { - public TypedDataTable1() - { - TableName = "TypedDataTable1"; - - Columns.Add(new DataColumn("RowID", typeof(int))); - Columns.Add(new DataColumn("Decimal", typeof(decimal))); - Columns.Add(new DataColumn("String", typeof(string))); - Columns.Add(new DataColumn("Guid", typeof(Guid))); - Columns.Add(new DataColumn("DateTime", typeof(DateTime))); - Columns.Add(new DataColumn("ForeignRowID", typeof(int))); - - PrimaryKey = new[] { RowIDColumn }; - - Constraints.Add(new UniqueConstraint(GuidColumn)); - } - - protected override DataRow NewRowFromBuilder(DataRowBuilder builder) - { - return new TypedDataRow1(builder); - } - - public new TypedDataRow1 NewRow() - { - return (TypedDataRow1)base.NewRow(); - } - - public TypedDataRow1 this[int index] - { - get => (TypedDataRow1)Rows[index]; - } - - public DataColumn RowIDColumn => Columns["RowID"]; - public DataColumn DecimalColumn => Columns["Decimal"]; - public DataColumn StringColumn => Columns["String"]; - public DataColumn GuidColumn => Columns["Guid"]; - public DataColumn DateTimeColumn => Columns["DateTime"]; - public DataColumn ForeignRowIDColumn => Columns["ForeignRowID"]; - } - - public class TypedDataRow2 : DataRow - { - private readonly TypedDataTable2 ownerTable; - - public TypedDataRow2(DataRowBuilder rowBuilder) - : base(rowBuilder) - { - ownerTable = (TypedDataTable2)Table; - } - - public int RowID - { - get => (int)this[ownerTable.RowIDColumn]; - set => this[ownerTable.RowIDColumn] = value; - } - - public decimal Decimal - { - get => (decimal)this[ownerTable.DecimalColumn]; - set => this[ownerTable.DecimalColumn] = value; - } - - public string String - { - get => (string)this[ownerTable.StringColumn]; - set => this[ownerTable.StringColumn] = value; - } - - public Guid Guid - { - get => (Guid)this[ownerTable.GuidColumn]; - set => this[ownerTable.GuidColumn] = value; - } - - public DateTime DateTime - { - get => (DateTime)this[ownerTable.DateTimeColumn]; - set => this[ownerTable.DateTimeColumn] = value; - } - - public int? ForeignRowID - { - get => IsNull(ownerTable.ForeignRowIDColumn) ? null : (int?)this[ownerTable.ForeignRowIDColumn]; - set => this[ownerTable.ForeignRowIDColumn] = value; - } - } - - [SuppressMessage("Microsoft.StyleCop.CSharp.Naming", "SA1306", - Justification = "DataColumn accessors are named after the columns.")] - [SuppressMessage("Microsoft.StyleCop.CSharp.Naming", "SA1516", - Justification = "DataColumn accessors are grouped in a block of lines.")] - public class TypedDataTable2 : TypedTableBase - { - public TypedDataTable2() - { - TableName = "TypedDataTable2"; - - Columns.Add(new DataColumn("RowID", typeof(int))); - Columns.Add(new DataColumn("Decimal", typeof(decimal))); - Columns.Add(new DataColumn("String", typeof(string))); - Columns.Add(new DataColumn("Guid", typeof(Guid))); - Columns.Add(new DataColumn("DateTime", typeof(DateTime))); - Columns.Add(new DataColumn("ForeignRowID", typeof(int))); - - PrimaryKey = new[] { RowIDColumn }; - - Constraints.Add(new UniqueConstraint(GuidColumn)); - } - - protected override DataRow NewRowFromBuilder(DataRowBuilder builder) - { - return new TypedDataRow2(builder); - } - - public new TypedDataRow2 NewRow() - { - return (TypedDataRow2)base.NewRow(); - } - - public TypedDataRow2 this[int index] - { - get => (TypedDataRow2)Rows[index]; - } - - public DataColumn RowIDColumn => Columns["RowID"]; - public DataColumn DecimalColumn => Columns["Decimal"]; - public DataColumn StringColumn => Columns["String"]; - public DataColumn GuidColumn => Columns["Guid"]; - public DataColumn DateTimeColumn => Columns["DateTime"]; - public DataColumn ForeignRowIDColumn => Columns["ForeignRowID"]; - } - - [SuppressMessage("Microsoft.StyleCop.CSharp.Naming", "SA1516", - Justification = "DataTable accessors are grouped in a block of lines.")] - public class TypedDataSet : DataSet - { - public override SchemaSerializationMode SchemaSerializationMode { get; set; } - - public TypedDataSet() - : this(swapTableOrder: false) - { - } - - public TypedDataSet(bool swapTableOrder) - { - if (swapTableOrder) - { - Tables.Add(new TypedDataTable2()); - Tables.Add(new TypedDataTable1()); - } - else - { - Tables.Add(new TypedDataTable1()); - Tables.Add(new TypedDataTable2()); - } - } - - public TypedDataTable1 TypedDataTable1 => (TypedDataTable1)Tables["TypedDataTable1"]; - public TypedDataTable2 TypedDataTable2 => (TypedDataTable2)Tables["TypedDataTable2"]; - - public DataSet ToUntypedDataSet() - { - var dataSet = new DataSet(); - - dataSet.DataSetName = DataSetName; - dataSet.CaseSensitive = CaseSensitive; - dataSet.EnforceConstraints = EnforceConstraints; - dataSet.Locale = Locale; - dataSet.Namespace = Namespace; - dataSet.Prefix = Prefix; - dataSet.RemotingFormat = RemotingFormat; - - foreach (var typedTable in Tables.Cast()) - { - var dataTable = new DataTable(); - - dataTable.TableName = typedTable.TableName; - dataTable.DisplayExpression = typedTable.DisplayExpression; - dataTable.MinimumCapacity = typedTable.MinimumCapacity; - dataTable.Namespace = typedTable.Namespace; - dataTable.Prefix = typedTable.Prefix; - dataTable.RemotingFormat = typedTable.RemotingFormat; - - foreach (var column in typedTable.Columns.Cast()) - { - var dataColumn = new DataColumn(); - - dataColumn.ColumnName = column.ColumnName; - dataColumn.AllowDBNull = column.AllowDBNull; - dataColumn.AutoIncrement = column.AutoIncrement; - dataColumn.AutoIncrementSeed = column.AutoIncrementSeed; - dataColumn.AutoIncrementStep = column.AutoIncrementStep; - dataColumn.Caption = column.Caption; - dataColumn.ColumnMapping = column.ColumnMapping; - dataColumn.DataType = column.DataType; - dataColumn.DateTimeMode = column.DateTimeMode; - dataColumn.DefaultValue = column.DefaultValue; - dataColumn.Expression = column.Expression; - dataColumn.MaxLength = column.MaxLength; - dataColumn.Namespace = column.Namespace; - dataColumn.Prefix = column.Prefix; - dataColumn.ReadOnly = column.ReadOnly; - - foreach (var property in column.ExtendedProperties.Cast()) - { - dataColumn.ExtendedProperties.Add(property.Key, property.Value); - } - - dataTable.Columns.Add(dataColumn); - } - - foreach (var row in typedTable.Rows.Cast()) - { - dataTable.ImportRow(row); - } - - dataTable.PrimaryKey = typedTable.PrimaryKey - .Select(col => dataTable.Columns[col.ColumnName]) - .ToArray(); - - foreach (var property in typedTable.ExtendedProperties.Cast()) - { - dataTable.ExtendedProperties.Add(property.Key, property.Value); - } - - foreach (var constraint in typedTable.Constraints.Cast()) - { - if (!Relations.Cast().Any(rel => - rel.ChildKeyConstraint == constraint || - rel.ParentKeyConstraint == constraint)) - { - if (constraint is UniqueConstraint uniqueConstraint) - { - if (!uniqueConstraint.IsPrimaryKey) - { - dataTable.Constraints.Add(new UniqueConstraint( - name: uniqueConstraint.ConstraintName, - column: dataTable.Columns[uniqueConstraint.Columns.Single().ColumnName])); - } - } - else - { - throw new Exception($"Don't know how to clone a constraint of type {constraint.GetType()}"); - } - } - } - - dataSet.Tables.Add(dataTable); - } - - foreach (var property in ExtendedProperties.Cast()) - { - dataSet.ExtendedProperties.Add(property.Key, property.Value); - } - - foreach (var relation in Relations.Cast()) - { - // NB: In the context of the unit test, this is assuming that there is only one column in a relation. - var dataRelation = new DataRelation( - relation.RelationName, - parentColumn: dataSet.Tables[relation.ParentTable.TableName] - .Columns[relation.ParentColumns.Single().ColumnName], - childColumn: dataSet.Tables[relation.ChildTable.TableName] - .Columns[relation.ChildColumns.Single().ColumnName]); - - foreach (var property in relation.ExtendedProperties.Cast()) - { - dataRelation.ExtendedProperties.Add(property.Key, property.Value); - } - - dataSet.Relations.Add(dataRelation); - } - - return dataSet; - } - } - - public class TypedDataSetSubclass : TypedDataSet - { - public TypedDataSetSubclass() - { - } - - public TypedDataSetSubclass(TypedDataSet copyFrom, bool swapTableOrder = false, bool randomizeRowOrder = false) - : base(swapTableOrder) - { - DataSetName = copyFrom.DataSetName; - CaseSensitive = copyFrom.CaseSensitive; - EnforceConstraints = copyFrom.EnforceConstraints; - Locale = copyFrom.Locale; - Namespace = copyFrom.Namespace; - Prefix = copyFrom.Prefix; - RemotingFormat = copyFrom.RemotingFormat; -#pragma warning disable MA0056 - SchemaSerializationMode = copyFrom.SchemaSerializationMode; -#pragma warning restore MA0056 - - CopyTable( - from: copyFrom.TypedDataTable1, - to: TypedDataTable1, - randomizeRowOrder); - - CopyTable( - from: copyFrom.TypedDataTable2, - to: TypedDataTable2, - randomizeRowOrder); - - foreach (var property in copyFrom.ExtendedProperties.Cast()) - { - ExtendedProperties.Add(property.Key, property.Value); - } - - foreach (var copyFromRelation in copyFrom.Relations.Cast()) - { - // NB: In the context of the unit test, this is assuming that there is only one column in a relation. - var relation = new DataRelation( - copyFromRelation.RelationName, - parentColumn: Tables[copyFromRelation.ParentTable.TableName] - .Columns[copyFromRelation.ParentColumns.Single().ColumnName], - childColumn: Tables[copyFromRelation.ChildTable.TableName] - .Columns[copyFromRelation.ChildColumns.Single().ColumnName]); - - foreach (var property in copyFromRelation.ExtendedProperties.Cast()) - { - relation.ExtendedProperties.Add(property.Key, property.Value); - } - - Relations.Add(relation); - } - } - - private void CopyTable(TDataTable from, TDataTable to, bool randomizeRowOrder) - where TDataTable : DataTable, IEnumerable - where TDataRow : DataRow - { - if (randomizeRowOrder) - { - foreach (var row in from.OrderBy(_ => Guid.NewGuid())) - { - to.ImportRow(row); - } - } - else - { - foreach (var row in from) - { - to.ImportRow(row); - } - } - - foreach (var property in from.ExtendedProperties.Cast()) - { - to.ExtendedProperties.Add(property.Key, property.Value); - } - - foreach (var column in to.Columns.Cast()) - { - foreach (var property in from.Columns[column.ColumnName].ExtendedProperties.Cast()) - { - column.ExtendedProperties.Add(property.Key, property.Value); - } - } - } - } - - #endregion - - private static readonly Random Random = new(0); - - internal static TDataSet CreateDummyDataSet(bool identicalTables = false, bool includeDummyData = true, - bool includeRelation = true) - where TDataSet : TypedDataSet, new() - { - var ret = new TDataSet(); - - foreach (var dataColumn in ret.TypedDataTable1.Columns.Cast()) - { - AddExtendedProperties(dataColumn.ExtendedProperties); - } - - if (includeDummyData) - { - InsertDummyRows(ret.TypedDataTable1); - } - - AddExtendedProperties(ret.TypedDataTable1.ExtendedProperties); - - if (identicalTables) - { - foreach (var dataColumn in ret.TypedDataTable2.Columns.Cast()) - { - foreach (var property in ret.TypedDataTable1.ExtendedProperties.Cast()) - { - dataColumn.ExtendedProperties.Add(property.Key, property.Value); - } - } - - foreach (var row in ret.TypedDataTable1.Cast()) - { - ret.TypedDataTable2.ImportRow(row); - } - - foreach (var property in ret.TypedDataTable1.ExtendedProperties.Cast()) - { - ret.TypedDataTable2.ExtendedProperties.Add(property.Key, property.Value); - } - } - else - { - foreach (var dataColumn in ret.TypedDataTable2.Columns.Cast()) - { - AddExtendedProperties(dataColumn.ExtendedProperties); - } - - if (includeDummyData) - { - InsertDummyRows(ret.TypedDataTable2, ret.TypedDataTable1); - } - - if (includeRelation) - { - AddRelation(ret); - } - - AddExtendedProperties(ret.TypedDataTable2.ExtendedProperties); - } - - AddExtendedProperties(ret.ExtendedProperties); - - return ret; - } - - protected static void AddRelation(TypedDataSet dataSet) - { - var relation = new DataRelation("TestRelation", dataSet.TypedDataTable1.RowIDColumn, - dataSet.TypedDataTable2.ForeignRowIDColumn); - - AddExtendedProperties(relation.ExtendedProperties); - - dataSet.Relations.Add(relation); - } - - private static void AddExtendedProperties(PropertyCollection extendedProperties) - { - extendedProperties.Add(Guid.NewGuid(), Guid.NewGuid()); - extendedProperties.Add(Guid.NewGuid(), Guid.NewGuid().ToString()); - extendedProperties.Add(Guid.NewGuid().ToString(), Guid.NewGuid()); - } - - private static void InsertDummyRows(DataTable table, DataTable foreignRows = null) - { - for (int i = 0; i < 10; i++) - { - InsertDummyRow(table, foreignRows?.Rows[i]); - } - - table.AcceptChanges(); - } - - private static void InsertDummyRow(DataTable table, DataRow foreignRow = null) - { - var row = table.NewRow(); - - foreach (var column in table.Columns.Cast()) - { - if (column.ColumnName.StartsWith("Foreign", StringComparison.Ordinal)) - { - row[column] = foreignRow?[column.ColumnName.Substring(7)] ?? DBNull.Value; - } - else - { - row[column] = GetDummyValueOfType(column.DataType); - } - } - - table.Rows.Add(row); - } - - [SuppressMessage("Style", "IDE0010:Add missing cases", - Justification = "TypedDataTable test types have a limited set of columns.")] - private static object GetDummyValueOfType(Type dataType) - { - switch (Type.GetTypeCode(dataType)) - { - case TypeCode.Int32: - return Random.Next(); - case TypeCode.DateTime: - return DateTime.MinValue.AddTicks((Random.Next() & 0x7FFFFFFF) * 1469337835L) - .AddTicks(((Random.Next() & 0x7FFFFFFF) * 1469337835L) / 2147483648); - case TypeCode.Decimal: - return new decimal(Random.NextDouble()); - case TypeCode.String: - return Guid.NewGuid().ToString(); - - default: - if (dataType == typeof(Guid)) - { - return Guid.NewGuid(); - } - - throw new Exception($"Don't know how to generate dummy value of type {dataType}"); - } - } - - public enum ChangeType - { - Added, - Changed, - Removed, - } - - public static IEnumerable AllChangeTypes => - Enum.GetValues(typeof(ChangeType)).Cast().Select(t => new object[] { t }); - - public static IEnumerable AllChangeTypesWithAcceptChangesValues - { - get - { - return - from changeType in Enum.GetValues(typeof(ChangeType)).Cast() - from acceptChanges in new[] { true, false } - select new object[] { changeType, acceptChanges }; - } - } - - [SuppressMessage("Style", "IDE0010:Add missing cases", Justification = "Every enum value is covered")] - protected static void ApplyChange(DataColumnCollection columns, ChangeType changeType) - { - switch (changeType) - { - case ChangeType.Added: - columns.Add("Test", typeof(int)); - break; - case ChangeType.Changed: - columns[1].ColumnName += "different"; - break; - case ChangeType.Removed: - columns.RemoveAt(1); - break; - } - } - - [SuppressMessage("Style", "IDE0010:Add missing cases", Justification = "Every enum value is covered")] - protected static void ApplyChange(PropertyCollection extendedProperties, ChangeType changeType) - { - switch (changeType) - { - case ChangeType.Added: - extendedProperties[Guid.NewGuid()] = Guid.NewGuid(); - break; - case ChangeType.Changed: - extendedProperties[extendedProperties.Keys.Cast().First()] = Guid.NewGuid(); - break; - case ChangeType.Removed: - extendedProperties.Remove(extendedProperties.Keys.Cast().First()); - break; - } - } - - [SuppressMessage("Style", "IDE0010:Add missing cases", Justification = "Every enum value is covered")] - protected static void ApplyChange(ConstraintCollection constraints, DataColumn columnForNewConstraint, ChangeType changeType) - { - switch (changeType) - { - case ChangeType.Added: - constraints.Add( - new UniqueConstraint( - "Test", - columnForNewConstraint)); - - break; - case ChangeType.Changed: - constraints[1].ConstraintName += "different"; - break; - case ChangeType.Removed: - constraints.RemoveAt(1); - break; - } - } - - [SuppressMessage("Style", "IDE0010:Add missing cases", Justification = "Every enum value is covered")] - protected static void ApplyChange(DataRowCollection rows, DataTable dataTable, ChangeType changeType) - { - switch (changeType) - { - case ChangeType.Added: - InsertDummyRow(dataTable); - break; - case ChangeType.Changed: - rows[1]["String"] += "different"; - break; - case ChangeType.Removed: - rows.RemoveAt(0); - break; - } - } -} diff --git a/Tests/FluentAssertions.Equivalency.Specs/DataTableSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DataTableSpecs.cs deleted file mode 100644 index a19bc43b40..0000000000 --- a/Tests/FluentAssertions.Equivalency.Specs/DataTableSpecs.cs +++ /dev/null @@ -1,1114 +0,0 @@ -using System; -using System.Data; -using System.Globalization; -using System.Linq; -using FluentAssertions.Data; -using FluentAssertions.Execution; -using Xunit; -using Xunit.Sdk; - -namespace FluentAssertions.Equivalency.Specs; - -public class DataTableSpecs : DataSpecs -{ - [Fact] - public void When_data_tables_are_identical_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2); - } - - [Fact] - public void When_data_tables_are_both_null_equivalence_test_should_succeed() - { - // Act & Assert - ((DataTable)null).Should().BeEquivalentTo(null); - } - - [Fact] - public void When_row_match_mode_is_invalid_it_should_fail() - { - // Arrange - var typedDataSet = CreateDummyDataSet(); - - var subject = typedDataSet.ToUntypedDataSet().Tables["TypedDataTable1"]; - var expectation = typedDataSet.ToUntypedDataSet().Tables["TypedDataTable1"]; - - // Act - Action action = () => subject.Should().BeEquivalentTo(expectation, options => options.UsingRowMatchMode((RowMatchMode)2)); - - // Assert - action.Should().Throw().WithMessage( - "Unknown RowMatchMode *when trying to compare *"); - } - - [Theory] - [MemberData(nameof(EmptyPrimaryKeys))] - public void When_row_match_mode_is_primary_key_without_primary_key_it_should_fail(DataColumn[] emptyPrimaryKey) - { - // Arrange - var typedDataSet = CreateDummyDataSet(includeRelation: false); - - var subject = typedDataSet.ToUntypedDataSet().Tables["TypedDataTable1"]; - var expectation = typedDataSet.ToUntypedDataSet().Tables["TypedDataTable1"]; - - subject.PrimaryKey = emptyPrimaryKey; - - // Act - Action action = () => - subject.Should().BeEquivalentTo(expectation, options => options.UsingRowMatchMode(RowMatchMode.PrimaryKey)); - - // Assert - action.Should().Throw().WithMessage( - "*Table *containing *does not have a primary key. RowMatchMode.PrimaryKey cannot be applied.*"); - } - - public static TheoryData EmptyPrimaryKeys => new() - { - null, - new DataColumn[] { } - }; - - [Fact] - public void When_primary_key_types_do_not_match_it_should_throw() - { - // Arrange - var typedDataSetSubject = CreateDummyDataSet(includeDummyData: false, includeRelation: false); - var typedDataSetExpectation = new TypedDataSetSubclass(typedDataSetSubject); - - var subject = typedDataSetSubject.ToUntypedDataSet().Tables["TypedDataTable1"]; - var expectation = typedDataSetExpectation.ToUntypedDataSet().Tables["TypedDataTable1"]; - - subject.PrimaryKey[0].DataType = typeof(long); - subject.Rows.Add(1L); - subject.AcceptChanges(); - expectation.Rows.Add(1); - expectation.AcceptChanges(); - - // Act - Action action = () => - subject.Should().BeEquivalentTo(expectation, options => options.UsingRowMatchMode(RowMatchMode.PrimaryKey)); - - // Assert - action.Should().Throw().WithMessage( - "*Subject and expectation primary keys of table containing *do not have the same schema and cannot be compared. " + - "RowMatchMode.PrimaryKey cannot be applied.*"); - } - - [Fact] - public void When_primary_key_of_one_rows_differ_it_should_fail() - { - // Arrange - var typedDataSetSubject = CreateDummyDataSet(); - var typedDataSetExpectation = new TypedDataSetSubclass(typedDataSetSubject); - - var subject = typedDataSetSubject.ToUntypedDataSet().Tables["TypedDataTable1"]; - var expectation = typedDataSetExpectation.ToUntypedDataSet().Tables["TypedDataTable1"]; - - expectation.Rows[0].SetField(expectation.PrimaryKey[0], 0); - - expectation.AcceptChanges(); - - // Act - Action action = () => - subject.Should().BeEquivalentTo(expectation, options => options.UsingRowMatchMode(RowMatchMode.PrimaryKey)); - - // Assert - action.Should().Throw().WithMessage( - "Found unexpected row in *with key *Expected to find a row with key *in *, but no such row was found*"); - } - - [Fact] - public void When_primary_key_of_multiple_rows_differ_it_should_fail() - { - // Arrange - var typedDataSetSubject = CreateDummyDataSet(); - var typedDataSetExpectation = new TypedDataSetSubclass(typedDataSetSubject); - - var subject = typedDataSetSubject.ToUntypedDataSet().Tables["TypedDataTable1"]; - var expectation = typedDataSetExpectation.ToUntypedDataSet().Tables["TypedDataTable1"]; - - for (int i = 0; i < 3; i++) - { - expectation.Rows[i].SetField(expectation.PrimaryKey[0], i); - } - - expectation.AcceptChanges(); - - // Act - Action action = () => - subject.Should().BeEquivalentTo(expectation, options => options.UsingRowMatchMode(RowMatchMode.PrimaryKey)); - - // Assert - action.Should().Throw().WithMessage( - "Found unexpected row in *with key * rows were expected in *and not found*"); - } - - [Fact] - public void When_data_table_is_null_and_isnt_expected_to_be_equivalence_test_should_fail() - { - // Arrange - var typedDataSet = CreateDummyDataSet(); - - var dataTable = typedDataSet.ToUntypedDataSet().Tables["TypedDataTable1"]; - - // Act - Action action = () => ((DataTable)null).Should().BeEquivalentTo(dataTable); - - // Assert - action.Should().Throw().WithMessage( - "Expected *to be non-null, but found null*"); - } - - [Fact] - public void When_data_table_is_expected_to_be_null_and_isnt_equivalence_test_should_fail() - { - // Arrange - var typedDataSet = CreateDummyDataSet(); - - var dataTable = typedDataSet.ToUntypedDataSet().Tables["TypedDataTable1"]; - - // Act - Action action = () => dataTable.Should().BeEquivalentTo(null); - - // Assert - action.Should().Throw().WithMessage("Expected dataTable value to be null, but found TypedDataTable1*"); - } - - [Fact] - public void - When_data_table_type_does_not_match_and_assertion_is_not_configured_to_allow_mismatched_types_equivalence_test_should_fail() - { - // Arrange - var typedDataSet = CreateDummyDataSet(identicalTables: true); - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet); - - var dataTable = typedDataSet.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTableOfMismatchedType = typedDataSet2.TypedDataTable1; - - // Act - Action action = () => dataTable.Should().BeEquivalentTo(dataTableOfMismatchedType); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataTable to be of type *TypedDataTable1*, but found *System.Data.DataTable*"); - } - - [Fact] - public void - When_data_table_type_does_not_match_but_assertion_is_configured_to_allow_mismatched_types_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet = CreateDummyDataSet(identicalTables: true); - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet); - - var dataTable = typedDataSet.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTableOfMismatchedType = typedDataSet2.TypedDataTable1; - - // Act & Assert - dataTable.Should().BeEquivalentTo(dataTableOfMismatchedType, options => options.AllowingMismatchedTypes()); - } - - [Fact] - public void When_data_table_name_does_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - dataTable2.TableName += "different"; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataTable1 to have TableName *different*, but found *TypedDataTable1* instead*"); - } - - [Fact] - public void When_excluding_invalid_constraint_it_should_throw() - { - // Arrange - var typedDataSet = CreateDummyDataSet(); - - var subject = typedDataSet.ToUntypedDataSet().Tables["TypedDataTable1"]; - var expectation = typedDataSet.ToUntypedDataSet().Tables["TypedDataTable1"]; - - // Act - Action action = () => subject.Should().BeEquivalentTo(expectation, options => options - .ExcludingRelated((Constraint constraint) => new object())); - - // Assert - action.Should().Throw().WithMessage( - "*Expression must be a simple member access*"); - } - - [Fact] - public void When_data_table_name_does_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(identicalTables: true); - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - dataTable2.TableName += "different"; - - // Act & Assert - dataTable1.Should().BeEquivalentTo( - dataTable2, - options => options - .Excluding(dataTable => dataTable.TableName) - .ExcludingRelated((DataColumn dataColumn) => dataColumn.Table) - .ExcludingRelated((Constraint constraint) => constraint.Table)); - } - - [Fact] - public void - When_data_table_case_sensitivity_does_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.CaseSensitive = !typedDataSet2.CaseSensitive; - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataTable1 to have CaseSensitive value of True, but found False instead*"); - } - - [Fact] - public void - When_data_table_case_sensitivity_does_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.CaseSensitive = !typedDataSet2.CaseSensitive; - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.Excluding(dataTable => dataTable.CaseSensitive)); - } - - [Fact] - public void - When_data_table_display_expression_does_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - dataTable2.DisplayExpression = typedDataSet2.TypedDataTable1.StringColumn.ColumnName; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw().WithMessage("Expected dataTable1 to have DisplayExpression value of *String*"); - } - - [Fact] - public void - When_data_table_display_expression_does_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - dataTable2.DisplayExpression = typedDataSet2.TypedDataTable1.StringColumn.ColumnName; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.Excluding(dataTable => dataTable.DisplayExpression)); - } - - [Fact] - public void - When_one_data_table_has_errors_and_the_other_does_not_and_the_property_that_indicates_the_presence_of_errors_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - dataTable2.Rows[0].RowError = "Manually added error"; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw().Which.Message.Should().Contain("HasErrors"); - } - - [Fact] - public void - When_one_data_table_has_errors_and_the_other_does_not_but_the_property_that_indicates_the_presence_of_errors_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - dataTable2.Rows[0].RowError = "Manually added error"; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, config => config - .Excluding(dataTable => dataTable.HasErrors) - .ExcludingRelated((DataRow dataRow) => dataRow.HasErrors)); - } - - [Fact] - public void - When_data_table_locale_does_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet1.Locale = new CultureInfo("en-US"); - typedDataSet2.Locale = new CultureInfo("fr-CA"); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataTable1 to have Locale value of *fr-CA*, but found *en-US* instead*"); - } - - [Fact] - public void When_data_table_locale_does_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet1.Locale = new CultureInfo("en-US"); - typedDataSet2.Locale = new CultureInfo("fr-CA"); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.Excluding(dataTable => dataTable.Locale)); - } - - [Fact] - public void - When_data_table_namespace_does_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.Namespace += "different"; - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataTable1 to have Namespace value of *different*, but found *"); - } - - [Fact] - public void - When_data_table_namespace_does_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.Namespace += "different"; - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options - .Excluding(dataTable => dataTable.Namespace) - .ExcludingRelated((DataColumn dataColumn) => dataColumn.Namespace)); - } - - [Fact] - public void - When_data_table_prefix_does_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - dataTable2.Prefix += "different"; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataTable1 to have Prefix value of *different*, but found * instead*"); - } - - [Fact] - public void When_data_table_prefix_does_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - dataTable2.Prefix += "different"; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.Excluding(dataTable => dataTable.Prefix)); - } - - [Fact] - public void - When_data_table_remoting_format_does_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.RemotingFormat = - typedDataSet2.RemotingFormat == SerializationFormat.Binary - ? SerializationFormat.Xml - : SerializationFormat.Binary; - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataTable1 to have RemotingFormat value of *Binary*, but found *Xml* instead*"); - } - - [Fact] - public void - When_data_table_remoting_format_does_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - typedDataSet2.RemotingFormat = - typedDataSet2.RemotingFormat == SerializationFormat.Binary - ? SerializationFormat.Xml - : SerializationFormat.Binary; - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - // LAST ONE - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.Excluding(dataTable => dataTable.RemotingFormat)); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void When_data_table_columns_do_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail( - ChangeType changeType) - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - ApplyChange(dataTable2.Columns, changeType); - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw().WithMessage("Expected property dataTable1.Column* to be *, but *"); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void When_data_table_columns_do_not_match_but_columns_and_rows_are_excluded_equivalence_test_should_succeed( - ChangeType changeType) - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - ApplyChange(dataTable2.Columns, changeType); - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options - .Excluding(dataTable => dataTable.Columns) - .Excluding(dataTable => dataTable.Rows)); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void - When_data_table_extended_properties_do_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail( - ChangeType changeType) - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - ApplyChange(dataTable2.ExtendedProperties, changeType); - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw().WithMessage("Expected *dataTable1.ExtendedProperties* to be *, but *"); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void - When_data_table_extended_properties_do_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed( - ChangeType changeType) - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - ApplyChange(dataTable2.ExtendedProperties, changeType); - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.Excluding(dataTable => dataTable.ExtendedProperties)); - } - - [Fact] - public void - When_data_table_primary_key_does_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable2"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable2"]; - - dataTable1.Columns.Cast().Skip(2).ToList() - .ForEach(col => col.AllowDBNull = false); - - dataTable2.PrimaryKey = dataTable2.Columns.Cast().Skip(2).ToArray(); - dataTable2.Columns[0].Unique = true; - - // Act - Action action = () => - dataTable1.Should().BeEquivalentTo(dataTable2, options => options - .Excluding(dataTable => dataTable.Constraints)); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected property dataTable1.PrimaryKey to be a collection with * item(s), but *contains * item(s) less than*"); - } - - [Fact] - public void - When_data_table_primary_key_does_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - for (int i = 2; i < typedDataSet1.TypedDataTable2.Columns.Count; i++) - { - typedDataSet1.TypedDataTable2.Columns[i].AllowDBNull = false; - } - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable2"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable2"]; - - dataTable2.PrimaryKey = dataTable2.Columns.Cast().Skip(2).ToArray(); - dataTable2.Columns[0].Unique = true; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options - .Excluding(dataTable => dataTable.PrimaryKey) - .Excluding(dataTable => dataTable.Constraints)); - } - - public enum NumberOfColumnsInConstraintDifference - { - SingleColumn, - MultipleColumns, - } - - [Theory] - [InlineData(NumberOfColumnsInConstraintDifference.SingleColumn)] - [InlineData(NumberOfColumnsInConstraintDifference.MultipleColumns)] - public void When_columns_for_constraint_in_data_table_do_not_match_message_should_list_all_columns_involved( - NumberOfColumnsInConstraintDifference difference) - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable2"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable2"]; - - int differenceCount = - difference switch - { - NumberOfColumnsInConstraintDifference.SingleColumn => 1, - NumberOfColumnsInConstraintDifference.MultipleColumns => 2, - - _ => throw new Exception("Sanity failure") - }; - - var dataTable1ColumnsForConstraint = dataTable1.Columns.Cast() - .Take(dataTable1.Columns.Count - differenceCount) - .ToArray(); - - var dataTable2ColumnsForConstraint = dataTable2.Columns.Cast() - .Skip(differenceCount) - .ToArray(); - - const string ConstraintName = "TestSubjectConstraint"; - - dataTable1.Constraints.Add(new UniqueConstraint(ConstraintName, dataTable1ColumnsForConstraint)); - dataTable2.Constraints.Add(new UniqueConstraint(ConstraintName, dataTable2ColumnsForConstraint)); - - var missingColumnNames = dataTable2ColumnsForConstraint.Select(col => col.ColumnName) - .Except(dataTable1ColumnsForConstraint.Select(col => col.ColumnName)); - - var extraColumnNames = dataTable1ColumnsForConstraint.Select(col => col.ColumnName) - .Except(dataTable2ColumnsForConstraint.Select(col => col.ColumnName)); - - string columnsNoun = differenceCount == 1 - ? "column" - : "columns"; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw().WithMessage( - $"Expected *{ConstraintName}* to include {columnsNoun} {string.Join("*", missingColumnNames)}*" + - $"Did not expect *{ConstraintName}* to include {columnsNoun} {string.Join("*", extraColumnNames)}*"); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void - When_data_table_constraints_do_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail( - ChangeType changeType) - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable2"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable2"]; - - ApplyChange(dataTable2.Constraints, dataTable2.Columns["Decimal"], changeType); - - string expectedExceptionPattern = - changeType == ChangeType.Changed - ? "Found unexpected constraint named *Constraint2* in property dataTable1.Constraints*" - : "Expected property dataTable1.Columns[*].Unique to be *, but found *"; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw().WithMessage(expectedExceptionPattern); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void - When_data_table_constraints_do_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed( - ChangeType changeType) - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable2"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable2"]; - - ApplyChange(dataTable2.Constraints, dataTable2.Columns["Decimal"], changeType); - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options - .Excluding(dataTable => dataTable.Constraints) - .ExcludingRelated(dataColumn => dataColumn.Unique)); - } - - [Theory] - [MemberData(nameof(AllChangeTypesWithAcceptChangesValues))] - public void When_data_table_rows_do_not_match_and_the_corresponding_property_is_not_excluded_equivalence_test_should_fail( - ChangeType changeType, bool acceptChanges) - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - ApplyChange(dataTable2.Rows, dataTable2, changeType); - - if (acceptChanges) - { - dataTable2.AcceptChanges(); - } - - string exceptionPattern; - - if (changeType == ChangeType.Changed) - { - exceptionPattern = - acceptChanges - ? "Expected dataTable1.Rows[1][String] to be *different* with a length of *, but * has a length of *, differs near *" - : "Expected dataTable1.Rows[1] to have RowState value of *Modified*, but found *Unchanged* instead*"; - } - else - { - exceptionPattern = - "Expected property dataTable1.Rows to contain * row(s), but found 10*"; - } - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw().WithMessage(exceptionPattern); - } - - [Theory] - [MemberData(nameof(AllChangeTypesWithAcceptChangesValues))] - public void When_data_table_rows_do_not_match_but_the_corresponding_property_is_excluded_equivalence_test_should_succeed( - ChangeType changeType, bool acceptChanges) - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - ApplyChange(dataTable2.Rows, dataTable2, changeType); - - if (acceptChanges) - { - dataTable2.AcceptChanges(); - } - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.Excluding(dataTable => dataTable.Rows)); - } - - [Fact] - public void - When_data_table_data_matches_in_different_order_and_the_row_match_mode_is_by_primary_key_equivalence_test_should_succeed() - { - // Arrange - var typedDataSet1 = CreateDummyDataSet(); - - var typedDataSet2 = new TypedDataSetSubclass(typedDataSet1, randomizeRowOrder: true); - - var dataTable1 = typedDataSet1.ToUntypedDataSet().Tables["TypedDataTable1"]; - var dataTable2 = typedDataSet2.ToUntypedDataSet().Tables["TypedDataTable1"]; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.UsingRowMatchMode(RowMatchMode.PrimaryKey)); - } - - [Fact] - public void Data_table_is_not_equivalent_to_another_type() - { - // Arrange - var subject = new - { - DataTable = "foobar" - }; - - var expected = new - { - DataTable = new DataTable() - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(expected); - - // Assert - act.Should().Throw() - .WithMessage("Expected*System.Data.DataTable*found System.String*"); - } - - [Fact] - public void When_data_table_has_expected_row_count_it_should_succeed() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataTable = dataSet.TypedDataTable1; - - int correctRowCount = dataTable.Rows.Count; - - // Act & Assert - dataTable.Should().HaveRowCount(correctRowCount); - } - - [Fact] - public void Null_data_table_no_rows_and_fails_test() - { - // Arrange - var dataTable = (DataTable)null; - - int correctRowCount = -1; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - dataTable.Should().HaveRowCount(correctRowCount); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expected dataTable to contain exactly*row*, but found *"); - } - - [Fact] - public void When_empty_data_table_has_expected_row_count_of_zero_it_should_succeed() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataTable = dataSet.TypedDataTable2; - - dataTable.Rows.Clear(); - dataTable.AcceptChanges(); - - // Act & Assert - dataTable.Should().HaveRowCount(0); - } - - [Fact] - public void When_data_table_does_not_have_expected_row_count_does_not_match_it_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataTable = dataSet.TypedDataTable1; - - int correctRowCount = dataTable.Rows.Count; - - int incorrectRowCount = correctRowCount * 2; - - // Act - Action action = - () => dataTable.Should().HaveRowCount(incorrectRowCount); - - // Assert - action.Should().Throw().WithMessage("Expected dataTable to contain exactly * row(s), but found *"); - } - - [Fact] - public void When_data_table_has_expected_column_it_should_succeed() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataTable = dataSet.TypedDataTable1; - - var expectedColumnName = dataTable.Columns[0].ColumnName; - - // Act & Assert - dataTable.Should().HaveColumn(expectedColumnName); - } - - [Fact] - public void Null_data_table_has_no_columns_and_fail_the_test() - { - // Arrange - var dataTable = (DataTable)null; - - var expectedColumnName = "Does not matter"; - - // Act - Action act = () => dataTable.Should().HaveColumn(expectedColumnName); - - // Assert - act.Should().Throw() - .WithMessage("Expected dataTable to contain a column named*, but found *"); - } - - [Fact] - public void When_data_table_does_not_have_expected_column_it_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataTable = dataSet.TypedDataTable1; - - // Act - Action action = - () => dataTable.Should().HaveColumn("Unicorn"); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataTable to contain a column named *Unicorn*, but it does not."); - } - - [Fact] - public void When_data_table_has_all_expected_columns_it_should_succeed() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataTable = dataSet.TypedDataTable1; - - var existingColumnNames = dataTable.Columns.Cast() - .Select(column => column.ColumnName); - - // Act & Assert - dataTable.Should().HaveColumns(existingColumnNames); - } - - [Fact] - public void Null_data_table_has_no_columns_and_fails_the_test() - { - // Arrange - var actual = (DataTable)null; - - var existingColumnName = "Does not matter"; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - actual.Should().HaveColumns(existingColumnName); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expected actual to contain*column*with specific name*, but found *"); - } - - [Fact] - public void When_data_table_has_only_some_expected_columns_then_asserting_that_it_has_all_of_them_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataTable = dataSet.TypedDataTable1; - - var columnNames = dataTable.Columns.Cast() - .Select(column => column.ColumnName) - .Concat(new[] { "Unicorn" }); - - // Act - Action action = - () => dataTable.Should().HaveColumns(columnNames); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataTable to contain a column named *Unicorn*, but it does not."); - } - - [Fact] - public void When_data_table_has_none_of_the_expected_columns_then_asserting_that_it_has_all_of_them_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataTable = dataSet.TypedDataTable1; - - var nonExistingColumnNames = new[] { "Unicorn", "Dragon" }; - - // Act - Action action = - () => dataTable.Should().HaveColumns(nonExistingColumnNames); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataTable to contain a column named *Unicorn*, but it does not."); - } -} diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index a3b8f16c2f..17f0ed9e6b 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -60,7 +60,6 @@ - runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Equivalency.Specs/TypedDataSetSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/TypedDataSetSpecs.cs deleted file mode 100644 index b3ad964315..0000000000 --- a/Tests/FluentAssertions.Equivalency.Specs/TypedDataSetSpecs.cs +++ /dev/null @@ -1,576 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using Xunit; -using Xunit.Sdk; - -namespace FluentAssertions.Equivalency.Specs; - -public class TypedDataSetSpecs : DataSpecs -{ - [Fact] - public void When_DataSets_are_identical_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2); - } - - [Fact] - public void When_DataSets_are_both_null_it_should_succeed() - { - // Act & Assert - ((TypedDataSet)null).Should().BeEquivalentTo(null); - } - - [Fact] - public void When_DataSet_is_null_and_isnt_expected_to_be_it_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - // Act - Action action = () => ((TypedDataSet)null).Should().BeEquivalentTo(dataSet); - - // Assert - action.Should().Throw().WithMessage( - "Expected *to be non-null, but found null*"); - } - - [Fact] - public void When_DataSet_is_expected_to_be_null_and_isnt_it_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - // Act - Action action = () => dataSet.Should().BeEquivalentTo(null); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_DataSet_type_does_not_match_and_AllowMismatchedType_not_enabled_it_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataSetOfMismatchedType = new TypedDataSetSubclass(dataSet); - - // Act - Action action = () => dataSet.Should().BeEquivalentTo(dataSetOfMismatchedType); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_DataSet_type_does_not_match_and_AllowMismatchedType_is_enabled_it_should_succeed() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataSetOfMismatchedType = new TypedDataSetSubclass(dataSet); - - // Act & Assert - dataSet.Should().BeEquivalentTo(dataSetOfMismatchedType, options => options.AllowingMismatchedTypes()); - } - - [Fact] - public void When_DataSetName_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.DataSetName += "different"; - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_DataSetName_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.DataSetName += "different"; - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options - .Excluding(dataSet => dataSet.DataSetName) - .ExcludingRelated((DataRelation dataRelation) => dataRelation.DataSet)); - } - - [Fact] - public void When_CaseSensitive_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.CaseSensitive = !dataSet2.CaseSensitive; - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_CaseSensitive_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.CaseSensitive = !dataSet2.CaseSensitive; - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options.Excluding(dataSet => dataSet.CaseSensitive)); - } - - [Fact] - public void When_EnforceConstraints_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.EnforceConstraints = !dataSet2.EnforceConstraints; - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_EnforceConstraints_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.EnforceConstraints = !dataSet2.EnforceConstraints; - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options.Excluding(dataSet => dataSet.EnforceConstraints)); - } - - [Fact] - public void When_HasErrors_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.TypedDataTable1.Rows[0].RowError = "Manually added error"; - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2, config => config.ExcludingTable("TypedDataTable1")); - - // Assert - action.Should().Throw().Which.Message.Should().Contain("HasErrors"); - } - - [Fact] - public void When_HasErrors_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.TypedDataTable1.Rows[0].RowError = "Manually added error"; - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, - config => config.Excluding(dataSet => dataSet.HasErrors).ExcludingTable("TypedDataTable1")); - } - - [Fact] - public void When_HasErrors_does_not_match_and_property_is_excluded_as_params_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.TypedDataTable1.Rows[0].RowError = "Manually added error"; - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, - config => config.Excluding(dataSet => dataSet.HasErrors).ExcludingTables("TypedDataTable1")); - } - - [Fact] - public void When_HasErrors_does_not_match_and_property_is_excluded_as_list_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.TypedDataTable1.Rows[0].RowError = "Manually added error"; - - // Act & Assert - IEnumerable excludedTables = new[] { "TypedDataTable1" }; - - dataSet1.Should().BeEquivalentTo(dataSet2, - config => config.Excluding(dataSet => dataSet.HasErrors).ExcludingTables(excludedTables)); - } - - [Fact] - public void When_Locale_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.Locale = new CultureInfo("fr-CA"); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_Locale_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.Locale = new CultureInfo("fr-CA"); - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options.Excluding(dataSet => dataSet.Locale)); - } - - [Fact] - public void When_Namespace_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.Namespace += "different"; - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_Namespace_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.Namespace += "different"; - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options - .Excluding(dataSet => dataSet.Namespace) - .ExcludingRelated((DataTable dataTable) => dataTable.Namespace) - .ExcludingRelated((DataColumn dataColumn) => dataColumn.Namespace)); - } - - [Fact] - public void When_Prefix_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.Prefix += "different"; - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_Prefix_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.Prefix += "different"; - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options.Excluding(dataSet => dataSet.Prefix)); - } - - [Fact] - public void When_RemotingFormat_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.RemotingFormat = - dataSet2.RemotingFormat == SerializationFormat.Binary - ? SerializationFormat.Xml - : SerializationFormat.Binary; - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_RemotingFormat_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.RemotingFormat = - dataSet2.RemotingFormat == SerializationFormat.Binary - ? SerializationFormat.Xml - : SerializationFormat.Binary; - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options - .Excluding(dataSet => dataSet.RemotingFormat) - .ExcludingRelated(dataTable => dataTable.RemotingFormat)); - } - - [Fact] - public void When_SchemaSerializationMode_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.SchemaSerializationMode = - dataSet2.SchemaSerializationMode == SchemaSerializationMode.ExcludeSchema - ? SchemaSerializationMode.IncludeSchema - : SchemaSerializationMode.ExcludeSchema; - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_SchemaSerializationMode_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.SchemaSerializationMode = - dataSet2.SchemaSerializationMode == SchemaSerializationMode.ExcludeSchema - ? SchemaSerializationMode.IncludeSchema - : SchemaSerializationMode.ExcludeSchema; - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options.Excluding(dataSet => dataSet.SchemaSerializationMode)); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void When_ExtendedProperties_do_not_match_and_property_is_not_excluded_it_should_fail(ChangeType changeType) - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - ApplyChange(dataSet2.ExtendedProperties, changeType); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw(); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void When_ExtendedProperties_do_not_match_and_property_is_excluded_it_should_succeed(ChangeType changeType) - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - ApplyChange(dataSet2.ExtendedProperties, changeType); - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options.Excluding(dataSet => dataSet.ExtendedProperties)); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - [SuppressMessage("Style", "IDE0010:Add missing cases", Justification = "All enum values are accounted for.")] - public void When_Relations_does_not_match_and_property_is_not_excluded_it_should_fail(ChangeType changeType) - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - switch (changeType) - { - case ChangeType.Added: - dataSet1.Relations.RemoveAt(0); - break; - - case ChangeType.Changed: - dataSet2.Relations[0].RelationName += "different"; - break; - - case ChangeType.Removed: - dataSet2.Relations.RemoveAt(0); - break; - } - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw(); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - [SuppressMessage("Style", "IDE0010:Add missing cases", Justification = "All enum values are accounted for.")] - public void When_Relations_does_not_match_and_property_is_excluded_it_should_succeed(ChangeType changeType) - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - switch (changeType) - { - case ChangeType.Added: - dataSet1.Relations.RemoveAt(0); - break; - - case ChangeType.Changed: - dataSet2.Relations[0].RelationName += "different"; - break; - - case ChangeType.Removed: - dataSet2.Relations.RemoveAt(0); - break; - } - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2, options => options - .Excluding(dataSet => dataSet.Relations) - .ExcludingRelated(dataTable => dataTable.ParentRelations) - .ExcludingRelated(dataTable => dataTable.ChildRelations)); - } - - [Fact] - public void When_Tables_are_the_same_but_in_a_different_order_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1, swapTableOrder: true); - - // Act & Assert - dataSet1.Should().BeEquivalentTo(dataSet2); - } - - [Fact] - public void When_Tables_count_does_not_match_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1, swapTableOrder: true); - - dataSet2.Tables.Add(new DataTable("ThirdWheel")); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw().Which.Message.Should().Contain("to contain " + dataSet2.Tables.Count); - } - - [Fact] - public void When_Tables_count_matches_but_tables_are_different_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1, swapTableOrder: true); - - dataSet2.TypedDataTable2.TableName = "DifferentTableName"; - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_Tables_contain_different_data_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1, swapTableOrder: true); - - dataSet2.TypedDataTable2[0].Guid = Guid.NewGuid(); - - // Act - Action action = () => dataSet1.Should().BeEquivalentTo(dataSet2); - - // Assert - action.Should().Throw(); - } -} diff --git a/Tests/FluentAssertions.Equivalency.Specs/TypedDataTableSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/TypedDataTableSpecs.cs deleted file mode 100644 index c084d9f02e..0000000000 --- a/Tests/FluentAssertions.Equivalency.Specs/TypedDataTableSpecs.cs +++ /dev/null @@ -1,666 +0,0 @@ -using System; -using System.Collections; -using System.Data; -using System.Globalization; -using System.Linq; -using FluentAssertions.Data; -using Xunit; -using Xunit.Sdk; - -namespace FluentAssertions.Equivalency.Specs; - -/// -/// DataTableEquivalency specs for typed data tables. -/// -public class TypedDataTableSpecs : DataSpecs -{ - [Fact] - public void When_DataTables_are_identical_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2); - } - - [Fact] - public void When_DataTables_are_both_null_it_should_succeed() - { - // Act & Assert - ((TypedDataTable1)null).Should().BeEquivalentTo(null); - } - - [Fact] - public void When_DataTable_is_null_and_isnt_expected_to_be_it_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataTable = dataSet.TypedDataTable1; - - // Act - Action action = () => ((TypedDataTable1)null).Should().BeEquivalentTo(dataTable); - - // Assert - action.Should().Throw().WithMessage( - "Expected *to be non-null, but found null*"); - } - - [Fact] - public void When_DataTable_is_expected_to_be_null_and_isnt_it_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(); - - var dataTable = dataSet.TypedDataTable1; - - // Act - Action action = () => dataTable.Should().BeEquivalentTo(null); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_DataTable_type_does_not_match_and_AllowMismatchedType_not_enabled_it_should_fail() - { - // Arrange - var dataSet = CreateDummyDataSet(identicalTables: true); - var dataSet2 = new TypedDataSetSubclass(dataSet); - - var dataTable = dataSet.TypedDataTable1; - var dataTableOfMismatchedType = dataSet2.TypedDataTable2; - - dataSet2.Tables.Remove(dataTable.TableName); - dataTableOfMismatchedType.TableName = dataTable.TableName; - - // Act - Action action = () => dataTable.Should().BeEquivalentTo(dataTableOfMismatchedType); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_DataTable_type_does_not_match_and_AllowMismatchedType_is_enabled_it_should_succeed() - { - // Arrange - var dataSet = CreateDummyDataSet(identicalTables: true); - var dataSet2 = new TypedDataSetSubclass(dataSet); - - var dataTable = dataSet.TypedDataTable1; - var dataTableOfMismatchedType = dataSet2.TypedDataTable2; - - dataSet2.Tables.Remove(dataTable.TableName); - dataTableOfMismatchedType.TableName = dataTable.TableName; - - dataTableOfMismatchedType.Rows.Clear(); - - foreach (var row in dataTable) - { - dataTableOfMismatchedType.ImportRow(row); - } - - foreach (var col in dataTableOfMismatchedType.Columns.Cast()) - { - col.ExtendedProperties.Clear(); - - foreach (var property in dataTable.Columns[col.ColumnName].ExtendedProperties.Cast()) - { - col.ExtendedProperties.Add(property.Key, property.Value); - } - } - - dataTableOfMismatchedType.AcceptChanges(); - - // Act & Assert - dataTable.Should().BeEquivalentTo(dataTableOfMismatchedType, options => options.AllowingMismatchedTypes()); - } - - [Fact] - public void When_TableName_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataTable2.TableName += "different"; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_TableName_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(identicalTables: true); - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataTable2.TableName += "different"; - - // Act & Assert - dataTable1.Should().BeEquivalentTo( - dataTable2, - options => options - .Excluding(dataTable => dataTable.TableName) - .ExcludingRelated((DataColumn dataColumn) => dataColumn.Table) - .ExcludingRelated((Constraint constraint) => constraint.Table)); - } - - [Fact] - public void When_CaseSensitive_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.CaseSensitive = !dataSet2.CaseSensitive; - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_CaseSensitive_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.CaseSensitive = !dataSet2.CaseSensitive; - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.Excluding(dataTable => dataTable.CaseSensitive)); - } - - [Fact] - public void When_DisplayExpression_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataTable2.DisplayExpression = dataTable2.StringColumn.ColumnName; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_DisplayExpression_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataTable2.DisplayExpression = dataTable2.StringColumn.ColumnName; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.Excluding(dataTable => dataTable.DisplayExpression)); - } - - [Fact] - public void When_HasErrors_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataTable2.Rows[0].RowError = "Manually added error"; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw().Which.Message.Should().Contain("HasErrors"); - } - - [Fact] - public void When_HasErrors_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataTable2.Rows[0].RowError = "Manually added error"; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, config => config - .Excluding(dataTable => dataTable.HasErrors) - .ExcludingRelated((DataRow dataRow) => dataRow.HasErrors)); - } - - [Fact] - public void When_Locale_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.Locale = new CultureInfo("fr-CA"); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_Locale_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.Locale = new CultureInfo("fr-CA"); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.Excluding(dataTable => dataTable.Locale)); - } - - [Fact] - public void When_Namespace_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.Namespace += "different"; - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_Namespace_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.Namespace += "different"; - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options - .Excluding(dataTable => dataTable.Namespace) - .ExcludingRelated((DataColumn dataColumn) => dataColumn.Namespace)); - } - - [Fact] - public void When_Prefix_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataTable2.Prefix += "different"; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_Prefix_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - dataTable2.Prefix += "different"; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.Excluding(dataTable => dataTable.Prefix)); - } - - [Fact] - public void When_RemotingFormat_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.RemotingFormat = - dataSet2.RemotingFormat == SerializationFormat.Binary - ? SerializationFormat.Xml - : SerializationFormat.Binary; - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_RemotingFormat_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - dataSet2.RemotingFormat = - dataSet2.RemotingFormat == SerializationFormat.Binary - ? SerializationFormat.Xml - : SerializationFormat.Binary; - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.Excluding(dataTable => dataTable.RemotingFormat)); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void When_Columns_do_not_match_and_property_is_not_excluded_it_should_fail(ChangeType changeType) - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - ApplyChange(dataTable2.Columns, changeType); - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw(); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void When_Columns_do_not_match_and_Columns_and_Rows_are_excluded_it_should_succeed(ChangeType changeType) - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - ApplyChange(dataTable2.Columns, changeType); - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options - .Excluding(dataTable => dataTable.Columns) - .Excluding(dataTable => dataTable.Rows)); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void When_ExtendedProperties_do_not_match_and_property_is_not_excluded_it_should_fail(ChangeType changeType) - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - ApplyChange(dataTable2.ExtendedProperties, changeType); - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw(); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void When_ExtendedProperties_do_not_match_and_property_is_excluded_it_should_succeed(ChangeType changeType) - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - ApplyChange(dataTable2.ExtendedProperties, changeType); - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.Excluding(dataTable => dataTable.ExtendedProperties)); - } - - [Fact] - public void When_PrimaryKey_does_not_match_and_property_is_not_excluded_it_should_fail() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable2; - var dataTable2 = dataSet2.TypedDataTable2; - - dataTable2.PrimaryKey = dataTable2.Columns.Cast().Skip(2).ToArray(); - dataTable2.Columns[0].Unique = true; - - // Act - Action action = () => - dataTable1.Should().BeEquivalentTo(dataTable2, options => options - .Excluding(dataTable => dataTable.Constraints)); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_PrimaryKey_does_not_match_and_property_is_excluded_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - for (int i = 2; i < dataSet1.TypedDataTable2.Columns.Count; i++) - { - dataSet1.TypedDataTable2.Columns[i].AllowDBNull = false; - } - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable2; - var dataTable2 = dataSet2.TypedDataTable2; - - dataTable2.PrimaryKey = dataTable2.Columns.Cast().Skip(2).ToArray(); - dataTable2.Columns[0].Unique = true; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options - .Excluding(dataTable => dataTable.PrimaryKey) - .Excluding(dataTable => dataTable.Constraints)); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void When_Constraints_do_not_match_and_property_is_not_excluded_it_should_fail(ChangeType changeType) - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - ApplyChange(dataTable2.Constraints, dataTable2.DecimalColumn, changeType); - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw(); - } - - [Theory] - [MemberData(nameof(AllChangeTypes))] - public void When_Constraints_do_not_match_and_property_is_excluded_it_should_succeed(ChangeType changeType) - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - ApplyChange(dataTable2.Constraints, dataTable2.DecimalColumn, changeType); - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options - .Excluding(dataTable => dataTable.Constraints) - .ExcludingRelated(dataColumn => dataColumn.Unique)); - } - - [Theory] - [MemberData(nameof(AllChangeTypesWithAcceptChangesValues))] - public void When_Rows_do_not_match_and_property_is_not_excluded_it_should_fail(ChangeType changeType, bool acceptChanges) - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - ApplyChange(dataTable2.Rows, dataTable2, changeType); - - if (acceptChanges) - { - dataTable2.AcceptChanges(); - } - - // Act - Action action = () => dataTable1.Should().BeEquivalentTo(dataTable2); - - // Assert - action.Should().Throw(); - } - - [Theory] - [MemberData(nameof(AllChangeTypesWithAcceptChangesValues))] - public void When_Rows_do_not_match_and_property_is_excluded_it_should_succeed(ChangeType changeType, bool acceptChanges) - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - ApplyChange(dataTable2.Rows, dataTable2, changeType); - - if (acceptChanges) - { - dataTable2.AcceptChanges(); - } - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.Excluding(dataTable => dataTable.Rows)); - } - - [Fact] - public void When_data_matches_in_different_order_and_RowMatchMode_is_PrimaryKey_it_should_succeed() - { - // Arrange - var dataSet1 = CreateDummyDataSet(); - - var dataSet2 = new TypedDataSetSubclass(dataSet1, randomizeRowOrder: true); - - var dataTable1 = dataSet1.TypedDataTable1; - var dataTable2 = dataSet2.TypedDataTable1; - - // Act & Assert - dataTable1.Should().BeEquivalentTo(dataTable2, options => options.UsingRowMatchMode(RowMatchMode.PrimaryKey)); - } -} diff --git a/Tests/FluentAssertions.Specs/Collections/Data/DataColumnCollectionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Collections/Data/DataColumnCollectionAssertionSpecs.cs deleted file mode 100644 index e59f3e6979..0000000000 --- a/Tests/FluentAssertions.Specs/Collections/Data/DataColumnCollectionAssertionSpecs.cs +++ /dev/null @@ -1,435 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Linq; -using Xunit; -using Xunit.Sdk; - -namespace FluentAssertions.Specs.Collections.Data; - -public static class DataColumnCollectionAssertionSpecs -{ - public class BeSameAs - { - [Fact] - public void Succeeds_for_references_to_the_same_object() - { - // Arrange - var dataTable = new DataTable("Test"); - - var columnCollection1 = dataTable.Columns; - var columnCollection2 = columnCollection1; - - // Act & Assert - columnCollection1.Should().BeSameAs(columnCollection2); - } - - [Fact] - public void Throws_for_different_references() - { - // Arrange - var dataTable1 = new DataTable("Test1"); - var dataTable2 = new DataTable("Test2"); - - var columnCollection1 = dataTable1.Columns; - var columnCollection2 = dataTable2.Columns; - - // Act - Action action = - () => columnCollection1.Should().BeSameAs(columnCollection2); - - // Assert - action.Should().Throw().WithMessage( - "Expected columnCollection1 to refer to *, but found * (different underlying object)."); - } - - [Fact] - public void When_generic_collection_is_tested_against_typed_collection_it_should_fail() - { - // Arrange - var dataTable = new DataTable("Test"); - - var columnCollection = dataTable.Columns; - - var genericCollection = columnCollection.Cast(); - - // Act - Action action = - () => genericCollection.Should().BeSameAs(columnCollection, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Invalid expectation: Expected genericCollection to refer to an instance of DataColumnCollection " + - "because we care, but found *."); - } - } - - public class NotBeSameAs - { - [Fact] - public void When_references_are_the_same_it_should_fail() - { - // Arrange - var dataTable = new DataTable("Test"); - - var columnCollection1 = dataTable.Columns; - var columnCollection2 = columnCollection1; - - // Act - Action action = - () => columnCollection1.Should().NotBeSameAs(columnCollection2); - - // Assert - action.Should().Throw().WithMessage("Did not expect columnCollection1 to refer to *."); - } - - [Fact] - public void When_references_are_different_it_should_succeed() - { - // Arrange - var dataTable1 = new DataTable("Test1"); - var dataTable2 = new DataTable("Test2"); - - var columnCollection1 = dataTable1.Columns; - var columnCollection2 = dataTable2.Columns; - - // Act & Assert - columnCollection1.Should().NotBeSameAs(columnCollection2); - } - - [Fact] - public void When_generic_collection_is_tested_against_typed_collection_it_should_fail() - { - // Arrange - var dataTable = new DataTable("Test"); - - var columnCollection = dataTable.Columns; - - var genericCollection = columnCollection.Cast(); - - // Act - Action action = - () => genericCollection.Should().NotBeSameAs(columnCollection, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Invalid expectation: Expected genericCollection to refer to a different instance of " + - "DataColumnCollection because we care, but found *."); - } - } - - public class HaveSameCount - { - [Fact] - public void When_subject_is_null_it_should_fail() - { - // Arrange - var subject = default(DataColumnCollection); - - var expectation = new DataTable().Columns; - - // Act - Action action = - () => subject.Should().HaveSameCount(expectation, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected * to have the same count as * because we care, but found .*"); - } - - [Fact] - public void When_expectation_is_null_it_should_fail() - { - // Arrange - var dataTable = new DataTable(); - - dataTable.Columns.Add(new DataColumn("Column0")); - dataTable.Columns.Add(new DataColumn("Column1")); - dataTable.Columns.Add(new DataColumn("Column2")); - - var nullReference = default(DataColumnCollection); - - // Act - Action action = - () => dataTable.Columns.Should().HaveSameCount(nullReference); - - // Assert - action.Should().Throw().WithMessage( - "Cannot verify count against a collection.*"); - } - - public class DataColumnCollectionAssertions - { - [Fact] - public void When_two_collections_have_the_same_number_of_columns_it_should_succeed() - { - // Arrange - var firstDataTable = new DataTable(); - var secondDataTable = new DataTable(); - - firstDataTable.Columns.Add(new DataColumn("Column0")); - firstDataTable.Columns.Add(new DataColumn("Column1")); - firstDataTable.Columns.Add(new DataColumn("Column2")); - - secondDataTable.Columns.Add(new DataColumn("Column10")); - secondDataTable.Columns.Add(new DataColumn("Column11")); - secondDataTable.Columns.Add(new DataColumn("Column12")); - - // Act & Assert - firstDataTable.Columns.Should().HaveSameCount(secondDataTable.Columns); - } - - [Fact] - public void When_two_collections_do_not_have_the_same_number_of_columns_it_should_fail() - { - // Arrange - var firstDataTable = new DataTable(); - var secondDataTable = new DataTable(); - - firstDataTable.Columns.Add(new DataColumn("Column0")); - firstDataTable.Columns.Add(new DataColumn("Column1")); - firstDataTable.Columns.Add(new DataColumn("Column2")); - - secondDataTable.Columns.Add(new DataColumn("Column10")); - secondDataTable.Columns.Add(new DataColumn("Column12")); - - // Act - Action action = - () => firstDataTable.Columns.Should().HaveSameCount(secondDataTable.Columns); - - // Assert - action.Should().Throw().WithMessage( - "Expected firstDataTable.Columns to have 2 column(s), but found 3."); - } - } - - public class GenericCollectionAssertions - { - [Fact] - public void When_collection_is_compared_with_null_it_should_fail() - { - // Arrange - var dataTable = new DataTable(); - - dataTable.Columns.Add(new DataColumn("Column0")); - dataTable.Columns.Add(new DataColumn("Column1")); - dataTable.Columns.Add(new DataColumn("Column2")); - - List nullDataColumns = null; - - // Act - Action action = - () => nullDataColumns.Should().HaveSameCount(dataTable.Columns, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected nullDataColumns to have the same count as * because we care, but found ."); - } - - [Fact] - public void When_collection_is_compared_with_typed_collection_with_same_number_of_columns_it_should_succeed() - { - // Arrange - var firstDataTable = new DataTable(); - var secondDataTable = new DataTable(); - - firstDataTable.Columns.Add(new DataColumn("Column0")); - firstDataTable.Columns.Add(new DataColumn("Column1")); - firstDataTable.Columns.Add(new DataColumn("Column2")); - - secondDataTable.Columns.Add(new DataColumn("Column10")); - secondDataTable.Columns.Add(new DataColumn("Column11")); - secondDataTable.Columns.Add(new DataColumn("Column12")); - - var genericDataColumnCollection = firstDataTable.Columns.Cast(); - - // Act & Assert - genericDataColumnCollection.Should().HaveSameCount(secondDataTable.Columns); - } - - [Fact] - public void When_collection_is_compared_with_typed_collection_with_different_number_of_columns_it_should_fail() - { - // Arrange - var firstDataTable = new DataTable(); - var secondDataTable = new DataTable(); - - firstDataTable.Columns.Add(new DataColumn("Column0")); - firstDataTable.Columns.Add(new DataColumn("Column1")); - firstDataTable.Columns.Add(new DataColumn("Column2")); - - secondDataTable.Columns.Add(new DataColumn("Column10")); - secondDataTable.Columns.Add(new DataColumn("Column12")); - - var genericDataColumnCollection = firstDataTable.Columns.Cast(); - - // Act - Action action = - () => genericDataColumnCollection.Should().HaveSameCount(secondDataTable.Columns, - because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected genericDataColumnCollection to have 2 column(s) because we care, but found 3."); - } - } - } - - public class NotHaveSameCount - { - [Fact] - public void When_subject_is_null_it_should_fail() - { - // Arrange - var subject = default(DataColumnCollection); - - var expectation = new DataTable().Columns; - - // Act - Action action = - () => subject.Should().NotHaveSameCount(expectation, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected * to not have the same count as * because we care, but found .*"); - } - - [Fact] - public void When_expectation_is_null_it_should_fail() - { - // Arrange - var dataTable = new DataTable(); - - dataTable.Columns.Add(new DataColumn("Column0")); - dataTable.Columns.Add(new DataColumn("Column1")); - dataTable.Columns.Add(new DataColumn("Column2")); - - var nullReference = default(DataColumnCollection); - - // Act - Action action = - () => dataTable.Columns.Should().NotHaveSameCount(nullReference); - - // Assert - action.Should().Throw().WithMessage( - "Cannot verify count against a collection.*"); - } - - public class DataColumnCollectionAssertions - { - [Fact] - public void When_two_collections_have_different_number_of_columns_it_should_succeed() - { - // Arrange - var firstDataTable = new DataTable(); - var secondDataTable = new DataTable(); - - firstDataTable.Columns.Add(new DataColumn("Column0")); - firstDataTable.Columns.Add(new DataColumn("Column1")); - firstDataTable.Columns.Add(new DataColumn("Column2")); - - secondDataTable.Columns.Add(new DataColumn("Column10")); - secondDataTable.Columns.Add(new DataColumn("Column12")); - - // Act & Assert - firstDataTable.Columns.Should().NotHaveSameCount(secondDataTable.Columns); - } - - [Fact] - public void When_two_collections_have_the_same_number_of_columns_it_should_fail() - { - // Arrange - var firstDataTable = new DataTable(); - var secondDataTable = new DataTable(); - - firstDataTable.Columns.Add(new DataColumn("Column0")); - firstDataTable.Columns.Add(new DataColumn("Column1")); - firstDataTable.Columns.Add(new DataColumn("Column2")); - - secondDataTable.Columns.Add(new DataColumn("Column10")); - secondDataTable.Columns.Add(new DataColumn("Column11")); - secondDataTable.Columns.Add(new DataColumn("Column12")); - - // Act - Action action = - () => firstDataTable.Columns.Should().NotHaveSameCount(secondDataTable.Columns, - because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected firstDataTable.Columns to not have 3 column(s) because we care, but found 3."); - } - } - - public class GenericCollectionAssertions - { - [Fact] - public void When_collection_is_compared_with_null_it_should_fail() - { - // Arrange - var dataTable = new DataTable(); - - dataTable.Columns.Add(new DataColumn("Column0")); - dataTable.Columns.Add(new DataColumn("Column1")); - dataTable.Columns.Add(new DataColumn("Column2")); - - List nullDataColumns = null; - - // Act - Action action = - () => nullDataColumns.Should().NotHaveSameCount(dataTable.Columns, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected nullDataColumns to not have the same count as * because we care, but found ."); - } - - [Fact] - public void When_collection_is_compared_with_typed_collection_with_same_number_of_columns_it_should_fail() - { - // Arrange - var firstDataTable = new DataTable(); - var secondDataTable = new DataTable(); - - firstDataTable.Columns.Add(new DataColumn("Column0")); - firstDataTable.Columns.Add(new DataColumn("Column1")); - firstDataTable.Columns.Add(new DataColumn("Column2")); - - secondDataTable.Columns.Add(new DataColumn("Column10")); - secondDataTable.Columns.Add(new DataColumn("Column11")); - secondDataTable.Columns.Add(new DataColumn("Column12")); - - var genericDataColumnCollection = firstDataTable.Columns.Cast(); - - // Act - Action action = - () => genericDataColumnCollection.Should().NotHaveSameCount(secondDataTable.Columns, - because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected genericDataColumnCollection to not have 3 column(s) because we care, but found 3."); - } - - [Fact] - public void When_collection_is_compared_with_typed_collection_with_different_number_of_columns_it_should_succeed() - { - // Arrange - var firstDataTable = new DataTable(); - var secondDataTable = new DataTable(); - - firstDataTable.Columns.Add(new DataColumn("Column0")); - firstDataTable.Columns.Add(new DataColumn("Column1")); - firstDataTable.Columns.Add(new DataColumn("Column2")); - - secondDataTable.Columns.Add(new DataColumn("Column10")); - secondDataTable.Columns.Add(new DataColumn("Column12")); - - var genericDataColumnCollection = firstDataTable.Columns.Cast(); - - // Act & Assert - genericDataColumnCollection.Should().NotHaveSameCount(secondDataTable.Columns); - } - } - } -} diff --git a/Tests/FluentAssertions.Specs/Collections/Data/DataRowCollectionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Collections/Data/DataRowCollectionAssertionSpecs.cs deleted file mode 100644 index 6780b8a2c5..0000000000 --- a/Tests/FluentAssertions.Specs/Collections/Data/DataRowCollectionAssertionSpecs.cs +++ /dev/null @@ -1,625 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Linq; -using Xunit; -using Xunit.Sdk; - -namespace FluentAssertions.Specs.Collections.Data; - -public static class DataRowCollectionAssertionSpecs -{ - public class BeSameAs - { - [Fact] - public void When_references_are_the_same_it_should_succeed() - { - // Arrange - var dataTable = new DataTable("Test"); - - var rowCollection1 = dataTable.Rows; - var rowCollection2 = rowCollection1; - - // Act & Assert - rowCollection1.Should().BeSameAs(rowCollection2); - } - - [Fact] - public void When_references_are_different_it_should_fail() - { - // Arrange - var dataTable1 = new DataTable("Test1"); - var dataTable2 = new DataTable("Test2"); - - var rowCollection1 = dataTable1.Rows; - var rowCollection2 = dataTable2.Rows; - - // Act - Action action = - () => rowCollection1.Should().BeSameAs(rowCollection2); - - // Assert - action.Should().Throw().WithMessage( - "Expected rowCollection1 to refer to *, but found * (different underlying object)."); - } - - [Fact] - public void When_generic_collection_is_tested_against_typed_collection_it_should_fail() - { - // Arrange - var dataTable = new DataTable("Test"); - - var rowCollection = dataTable.Rows; - - var genericCollection = rowCollection.Cast(); - - // Act - Action action = - () => genericCollection.Should().BeSameAs(rowCollection, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Invalid expectation: Expected genericCollection to refer to an instance of DataRowCollection " + - "because we care, but found *."); - } - } - - public class NotBeSameAs - { - [Fact] - public void When_references_are_the_same_object_it_should_fail() - { - // Arrange - var dataTable = new DataTable("Test"); - - var rowCollection1 = dataTable.Rows; - var rowCollection2 = rowCollection1; - - // Act - Action action = - () => rowCollection1.Should().NotBeSameAs(rowCollection2); - - // Assert - action.Should().Throw().WithMessage("Did not expect rowCollection1 to refer to *."); - } - - [Fact] - public void When_references_are_different_it_should_succeed() - { - // Arrange - var dataTable1 = new DataTable("Test1"); - var dataTable2 = new DataTable("Test2"); - - var rowCollection1 = dataTable1.Rows; - var rowCollection2 = dataTable2.Rows; - - // Act & Assert - rowCollection1.Should().NotBeSameAs(rowCollection2); - } - - [Fact] - public void When_generic_collection_is_tested_against_typed_collection_it_should_fail() - { - // Arrange - var dataTable = new DataTable("Test"); - - var rowCollection = dataTable.Rows; - - var genericCollection = rowCollection.Cast(); - - // Act - Action action = - () => genericCollection.Should().NotBeSameAs(rowCollection, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Invalid expectation: Expected genericCollection to refer to a different instance of " + - "DataRowCollection because we care, but found *."); - } - } - - public class HaveSameCount - { - [Fact] - public void When_subject_is_null_it_should_fail() - { - // Arrange - var subject = default(DataRowCollection); - - var expectation = new DataTable().Rows; - - // Act - Action action = - () => subject.Should().HaveSameCount(expectation, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected * to have the same count as * because we care, but found .*"); - } - - [Fact] - public void When_expectation_is_null_it_should_fail() - { - // Arrange - var dataTable = new DataTable(); - - var nullReference = default(DataRowCollection); - - // Act - Action action = - () => dataTable.Rows.Should().HaveSameCount(nullReference); - - // Assert - action.Should().Throw().WithMessage( - "Cannot verify count against a collection.*"); - } - - public class DataRowCollectionAssertions - { - [Fact] - public void When_two_collections_have_the_same_number_of_rows_it_should_succeed() - { - // Arrange - var firstDataTable = new DataTable(); - var secondDataTable = new DataTable(); - - firstDataTable.Rows.Add(); - firstDataTable.Rows.Add(); - firstDataTable.Rows.Add(); - - secondDataTable.Rows.Add(); - secondDataTable.Rows.Add(); - secondDataTable.Rows.Add(); - - // Act & Assert - firstDataTable.Rows.Should().HaveSameCount(secondDataTable.Rows); - } - - [Fact] - public void When_two_collections_do_not_have_the_same_number_of_rows_it_should_fail() - { - // Arrange - var firstDataTable = new DataTable(); - var secondDataTable = new DataTable(); - - firstDataTable.Rows.Add(); - firstDataTable.Rows.Add(); - firstDataTable.Rows.Add(); - - secondDataTable.Rows.Add(); - secondDataTable.Rows.Add(); - - // Act - Action action = - () => firstDataTable.Rows.Should().HaveSameCount(secondDataTable.Rows); - - // Assert - action.Should().Throw().WithMessage( - "Expected firstDataTable.Rows to have 2 row(s), but found 3."); - } - } - - public class GenericCollectionAssertions - { - [Fact] - public void When_collection_is_compared_with_null_it_should_fail() - { - // Arrange - var dataTable = new DataTable(); - - List nullDataRows = null; - - // Act - Action action = - () => nullDataRows.Should().HaveSameCount(dataTable.Rows, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected nullDataRows to have the same count as * because we care, but found ."); - } - - [Fact] - public void When_collection_is_compared_with_typed_collection_with_same_number_of_rows_it_should_succeed() - { - // Arrange - var firstDataTable = new DataTable(); - var secondDataTable = new DataTable(); - - firstDataTable.Rows.Add(); - firstDataTable.Rows.Add(); - firstDataTable.Rows.Add(); - - secondDataTable.Rows.Add(); - secondDataTable.Rows.Add(); - secondDataTable.Rows.Add(); - - var genericDataRowCollection = firstDataTable.Rows.Cast(); - - // Act & Assert - genericDataRowCollection.Should().HaveSameCount(secondDataTable.Rows); - } - - [Fact] - public void When_collection_is_compared_with_typed_collection_with_different_number_of_rows_it_should_fail() - { - // Arrange - var firstDataTable = new DataTable(); - var secondDataTable = new DataTable(); - - firstDataTable.Rows.Add(); - firstDataTable.Rows.Add(); - firstDataTable.Rows.Add(); - - secondDataTable.Rows.Add(); - secondDataTable.Rows.Add(); - - var genericDataRowCollection = firstDataTable.Rows.Cast(); - - // Act - Action action = - () => genericDataRowCollection.Should().HaveSameCount(secondDataTable.Rows, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected genericDataRowCollection to have 2 row(s) because we care, but found 3."); - } - } - } - - public class NotHaveSameCount - { - [Fact] - public void When_subject_is_null_it_should_fail() - { - // Arrange - var subject = default(DataRowCollection); - - var expectation = new DataTable().Rows; - - // Act - Action action = - () => subject.Should().NotHaveSameCount(expectation, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected * to not have the same count as * because we care, but found .*"); - } - - [Fact] - public void When_expectation_is_null_it_should_fail() - { - // Arrange - var dataTable = new DataTable(); - - var nullReference = default(DataRowCollection); - - // Act - Action action = - () => dataTable.Rows.Should().NotHaveSameCount(nullReference); - - // Assert - action.Should().Throw().WithMessage( - "Cannot verify count against a collection.*"); - } - - public class DataRowCollectionAssertions - { - [Fact] - public void When_two_collections_have_different_number_of_rows_it_should_succeed() - { - // Arrange - var firstDataTable = new DataTable(); - var secondDataTable = new DataTable(); - - firstDataTable.Rows.Add(); - firstDataTable.Rows.Add(); - firstDataTable.Rows.Add(); - - secondDataTable.Rows.Add(); - secondDataTable.Rows.Add(); - - // Act & Assert - firstDataTable.Rows.Should().NotHaveSameCount(secondDataTable.Rows); - } - - [Fact] - public void When_two_collections_have_the_same_number_rows_it_should_fail() - { - // Arrange - var firstDataTable = new DataTable(); - var secondDataTable = new DataTable(); - - firstDataTable.Rows.Add(); - firstDataTable.Rows.Add(); - firstDataTable.Rows.Add(); - - secondDataTable.Rows.Add(); - secondDataTable.Rows.Add(); - secondDataTable.Rows.Add(); - - // Act - Action action = - () => firstDataTable.Rows.Should().NotHaveSameCount(secondDataTable.Rows, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected firstDataTable.Rows to not have 3 row(s) because we care, but found 3."); - } - } - - public class GenericCollectionAssertions - { - [Fact] - public void When_collection_is_compared_with_null_it_should_fail() - { - // Arrange - var dataTable = new DataTable(); - - dataTable.Rows.Add(); - dataTable.Rows.Add(); - dataTable.Rows.Add(); - - List nullDataRows = null; - - // Act - Action action = - () => nullDataRows.Should().NotHaveSameCount(dataTable.Rows, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected nullDataRows to not have the same count as * because we care, but found ."); - } - - [Fact] - public void When_collection_is_compared_with_typed_collection_with_same_number_of_rows_it_should_fail() - { - // Arrange - var firstDataTable = new DataTable(); - var secondDataTable = new DataTable(); - - firstDataTable.Rows.Add(); - firstDataTable.Rows.Add(); - firstDataTable.Rows.Add(); - - secondDataTable.Rows.Add(); - secondDataTable.Rows.Add(); - secondDataTable.Rows.Add(); - - var genericDataRowCollection = firstDataTable.Rows.Cast(); - - // Act - Action action = - () => genericDataRowCollection.Should().NotHaveSameCount(secondDataTable.Rows, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected genericDataRowCollection to not have 3 row(s) because we care, but found 3."); - } - - [Fact] - public void When_collection_is_compared_with_typed_collection_with_different_number_of_rows_it_should_succeed() - { - // Arrange - var firstDataTable = new DataTable(); - var secondDataTable = new DataTable(); - - firstDataTable.Rows.Add(); - firstDataTable.Rows.Add(); - firstDataTable.Rows.Add(); - - secondDataTable.Rows.Add(); - secondDataTable.Rows.Add(); - - var genericDataRowCollection = firstDataTable.Rows.Cast(); - - // Act & Assert - genericDataRowCollection.Should().NotHaveSameCount(secondDataTable.Rows); - } - } - } - - // These tests are present to ensure that we can trust DataRow equivalency in the context of ContainEquivalentOf. - public class ContainEquivalentOf - { - [Fact] - public void When_subject_is_null_it_should_fail() - { - // Arrange - var subject = default(DataRowCollection); - - var expectation = new DataTable().Rows; - - // Act - Action action = - () => subject.Should().ContainEquivalentOf(expectation, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected * to contain equivalent of * because we care, but found .*"); - } - - [Fact] - public void When_collection_contains_equivalent_row_it_should_succeed() - { - // Arrange - var dataTable = new DataTable(); - - dataTable.Columns.Add("RowID", typeof(Guid)); - dataTable.Columns.Add("Description", typeof(string)); - dataTable.Columns.Add("Number", typeof(int)); - dataTable.Columns.Add("Flag", typeof(bool)); - dataTable.Columns.Add("Timestamp", typeof(DateTime)); - - dataTable.Rows.Add(new Guid("6f460c1a-755d-d8e4-ad67-65d5f519dbc8"), "1851925803", 2137491580, true, - new DateTime(638898932425580731)); - - dataTable.Rows.Add(new Guid("8286d046-9740-a3e4-95cf-ff46699c73c4"), "607156385", 1321446349, true, - new DateTime(641752306337096884)); - - dataTable.Rows.Add(new Guid("95c69371-b924-6fe3-7c38-98b7dd200bc1"), "1509870614", 505401118, true, - new DateTime(623130841631129390)); - - var subjectTable = new DataTable(); - - subjectTable.Columns.Add("RowID", typeof(Guid)); - subjectTable.Columns.Add("Description", typeof(string)); - subjectTable.Columns.Add("Number", typeof(int)); - subjectTable.Columns.Add("Flag", typeof(bool)); - subjectTable.Columns.Add("Timestamp", typeof(DateTime)); - - subjectTable.Rows.Add(new Guid("95c69371-b924-6fe3-7c38-98b7dd200bc1"), "1509870614", 505401118, true, - new DateTime(623130841631129390)); - - var subjectRow = subjectTable.Rows[0]; - - // Act & Assert - dataTable.Rows.Should().ContainEquivalentOf(subjectRow); - } - - [Fact] - public void When_collection_does_not_contain_equivalent_row_it_should_fail() - { - // Arrange - var dataTable = new DataTable(); - - dataTable.Columns.Add("RowID", typeof(Guid)); - dataTable.Columns.Add("Description", typeof(string)); - dataTable.Columns.Add("Number", typeof(int)); - dataTable.Columns.Add("Flag", typeof(bool)); - dataTable.Columns.Add("Timestamp", typeof(DateTime)); - - dataTable.Rows.Add(new Guid("8286d046-9740-a3e4-95cf-ff46699c73c4"), "607156385", 1321446349, true, - new DateTime(641752306337096884)); - - dataTable.Rows.Add(new Guid("95c69371-b924-6fe3-7c38-98b7dd200bc1"), "1509870614", 505401118, true, - new DateTime(623130841631129390)); - - dataTable.Rows.Add(new Guid("a905569d-db07-3ae3-63a0-322750a4a3bd"), "265101196", 1836839534, true, - new DateTime(625984215542645543)); - - var subjectTable = new DataTable(); - - subjectTable.Columns.Add("RowID", typeof(Guid)); - subjectTable.Columns.Add("Description", typeof(string)); - subjectTable.Columns.Add("Number", typeof(int)); - subjectTable.Columns.Add("Flag", typeof(bool)); - subjectTable.Columns.Add("Timestamp", typeof(DateTime)); - - subjectTable.Rows.Add(new Guid("bc4519c8-fdeb-06e2-4a08-cc98c4273aba"), "1167815425", 1020794303, true, - new DateTime(628837589454161696)); - - var subjectRow = subjectTable.Rows[0]; - - // Act - Action action = - () => dataTable.Rows.Should().ContainEquivalentOf(subjectRow, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected dataTable.Rows * to contain equivalent of System.Data.DataRow* because we care.*"); - } - } - - // These tests are present to ensure that we can trust DataRow equivalency in the context of NotContainEquivalentOf. - public class NotContainEquivalentOf - { - [Fact] - public void When_subject_is_null_it_should_fail() - { - // Arrange - var subject = default(DataRowCollection); - - var expectation = new DataTable().Rows; - - // Act - Action action = - () => subject.Should().NotContainEquivalentOf(expectation, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected * not to contain equivalent of * because we care, but collection is .*"); - } - - [Fact] - public void When_collection_contains_equivalent_row_it_should_fail() - { - // Arrange - var dataTable = new DataTable(); - - dataTable.Columns.Add("RowID", typeof(Guid)); - dataTable.Columns.Add("Description", typeof(string)); - dataTable.Columns.Add("Number", typeof(int)); - dataTable.Columns.Add("Flag", typeof(bool)); - dataTable.Columns.Add("Timestamp", typeof(DateTime)); - - dataTable.Rows.Add(new Guid("8286d046-9740-a3e4-95cf-ff46699c73c4"), "607156385", 1321446349, true, - new DateTime(641752306337096884)); - - dataTable.Rows.Add(new Guid("95c69371-b924-6fe3-7c38-98b7dd200bc1"), "1509870614", 505401118, true, - new DateTime(623130841631129390)); - - dataTable.Rows.Add(new Guid("a905569d-db07-3ae3-63a0-322750a4a3bd"), "265101196", 1836839534, true, - new DateTime(625984215542645543)); - - var subjectTable = new DataTable(); - - subjectTable.Columns.Add("RowID", typeof(Guid)); - subjectTable.Columns.Add("Description", typeof(string)); - subjectTable.Columns.Add("Number", typeof(int)); - subjectTable.Columns.Add("Flag", typeof(bool)); - subjectTable.Columns.Add("Timestamp", typeof(DateTime)); - - subjectTable.Rows.Add(new Guid("95c69371-b924-6fe3-7c38-98b7dd200bc1"), "1509870614", 505401118, true, - new DateTime(623130841631129390)); - - var subjectRow = subjectTable.Rows[0]; - - // Act - Action action = - () => dataTable.Rows.Should().NotContainEquivalentOf(subjectRow, because: "we {0}", "care"); - - // Assert - action.Should().Throw() - .WithMessage("Expected dataTable.Rows * not to contain equivalent of System.Data.DataRow* because we " + - "care, but found one at index 1.*"); - } - - [Fact] - public void When_collection_does_not_contain_equivalent_row_it_should_succeed() - { - // Arrange - var dataTable = new DataTable(); - - dataTable.Columns.Add("RowID", typeof(Guid)); - dataTable.Columns.Add("Description", typeof(string)); - dataTable.Columns.Add("Number", typeof(int)); - dataTable.Columns.Add("Flag", typeof(bool)); - dataTable.Columns.Add("Timestamp", typeof(DateTime)); - - dataTable.Rows.Add(new Guid("8286d046-9740-a3e4-95cf-ff46699c73c4"), "607156385", 1321446349, true, - new DateTime(641752306337096884)); - - dataTable.Rows.Add(new Guid("95c69371-b924-6fe3-7c38-98b7dd200bc1"), "1509870614", 505401118, true, - new DateTime(623130841631129390)); - - dataTable.Rows.Add(new Guid("a905569d-db07-3ae3-63a0-322750a4a3bd"), "265101196", 1836839534, true, - new DateTime(625984215542645543)); - - var subjectTable = new DataTable(); - - subjectTable.Columns.Add("RowID", typeof(Guid)); - subjectTable.Columns.Add("Description", typeof(string)); - subjectTable.Columns.Add("Number", typeof(int)); - subjectTable.Columns.Add("Flag", typeof(bool)); - subjectTable.Columns.Add("Timestamp", typeof(DateTime)); - - subjectTable.Rows.Add(new Guid("bc4519c8-fdeb-06e2-4a08-cc98c4273aba"), "1167815425", 1020794303, true, - new DateTime(628837589454161696)); - - var subjectRow = subjectTable.Rows[0]; - - // Act & Assert - dataTable.Rows.Should().NotContainEquivalentOf(subjectRow); - } - } -} diff --git a/Tests/FluentAssertions.Specs/Collections/Data/DataTableCollectionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Collections/Data/DataTableCollectionAssertionSpecs.cs deleted file mode 100644 index c33decc33b..0000000000 --- a/Tests/FluentAssertions.Specs/Collections/Data/DataTableCollectionAssertionSpecs.cs +++ /dev/null @@ -1,539 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Linq; -using Xunit; -using Xunit.Sdk; - -namespace FluentAssertions.Specs.Collections.Data; - -public static class DataTableCollectionAssertionSpecs -{ - public class BeSameAs - { - [Fact] - public void When_references_are_the_same_it_should_succeed() - { - // Arrange - var dataSet = new DataSet(); - - dataSet.Tables.Add(new DataTable("Table1")); - - var tableCollection1 = dataSet.Tables; - var tableCollection2 = tableCollection1; - - // Act & Assert - tableCollection1.Should().BeSameAs(tableCollection2); - } - - [Fact] - public void When_references_are_different_it_should_fail() - { - // Arrange - var dataSet1 = new DataSet(); - var dataSet2 = new DataSet(); - - dataSet1.Tables.Add(new DataTable("Table1")); - dataSet2.Tables.Add(new DataTable("Table1")); - - var tableCollection1 = dataSet1.Tables; - var tableCollection2 = dataSet2.Tables; - - // Act - Action action = - () => tableCollection1.Should().BeSameAs(tableCollection2); - - // Assert - action.Should().Throw().WithMessage( - "Expected tableCollection1 to refer to *, but found * (different underlying object)."); - } - - [Fact] - public void When_generic_collection_is_tested_against_typed_collection_it_should_fail() - { - // Arrange - var dataSet = new DataSet(); - - var tableCollection = dataSet.Tables; - - var genericCollection = tableCollection.Cast(); - - // Act - Action action = - () => genericCollection.Should().BeSameAs(tableCollection, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Invalid expectation: Expected genericCollection to refer to an instance of DataTableCollection " + - "because we care, but found *."); - } - } - - public class NotBeSameAs - { - [Fact] - public void When_references_are_the_same_it_should_fail() - { - // Arrange - var dataSet = new DataSet(); - - dataSet.Tables.Add(new DataTable("Table1")); - - var tableCollection1 = dataSet.Tables; - var tableCollection2 = tableCollection1; - - // Act - Action action = - () => tableCollection1.Should().NotBeSameAs(tableCollection2); - - // Assert - action.Should().Throw().WithMessage( - "Did not expect tableCollection1 to refer to *."); - } - - [Fact] - public void When_references_are_different_it_should_succeed() - { - // Arrange - var dataSet1 = new DataSet(); - var dataSet2 = new DataSet(); - - dataSet1.Tables.Add(new DataTable("Table1")); - dataSet2.Tables.Add(new DataTable("Table1")); - - var tableCollection1 = dataSet1.Tables; - var tableCollection2 = dataSet2.Tables; - - // Act & Assert - tableCollection1.Should().NotBeSameAs(tableCollection2); - } - - [Fact] - public void When_generic_collection_is_tested_against_typed_collection_it_should_fail() - { - // Arrange - var dataSet = new DataSet(); - - var tableCollection = dataSet.Tables; - - var genericCollection = tableCollection.Cast(); - - // Act - Action action = - () => genericCollection.Should().NotBeSameAs(tableCollection, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Invalid expectation: Expected genericCollection to refer to a different instance of " + - "DataTableCollection because we care, but found *."); - } - } - - public class HaveSameCount - { - [Fact] - public void When_subject_is_null_it_should_fail() - { - // Arrange - var subject = default(DataTableCollection); - - var expectation = new DataSet().Tables; - - // Act - Action action = - () => subject.Should().HaveSameCount(expectation, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected * to have the same count as * because we care, but found .*"); - } - - [Fact] - public void When_expectation_is_null_it_should_fail() - { - // Arrange - var dataSet = new DataSet(); - - var nullReference = default(DataTableCollection); - - // Act - Action action = - () => dataSet.Tables.Should().HaveSameCount(nullReference); - - // Assert - action.Should().Throw().WithMessage( - "Cannot verify count against a collection.*"); - } - - public class DataSetAssertions - { - [Fact] - public void When_collections_have_the_same_number_of_tables_it_should_succeed() - { - // Arrange - var firstDataSet = new DataSet(); - var secondDataSet = new DataSet(); - - firstDataSet.Tables.Add(new DataTable("Table0")); - firstDataSet.Tables.Add(new DataTable("Table1")); - firstDataSet.Tables.Add(new DataTable("Table2")); - - secondDataSet.Tables.Add(new DataTable("Table10")); - secondDataSet.Tables.Add(new DataTable("Table11")); - secondDataSet.Tables.Add(new DataTable("Table12")); - - // Ensure that the table schema isn't important for the count comparison. - secondDataSet.Tables[0].Columns.Add("Column1", typeof(int)); - - // Act & Assert - firstDataSet.Tables.Should().HaveSameCount(secondDataSet, because: "we {0}", "care"); - } - - [Fact] - public void When_collections_do_not_have_the_same_number_of_tables_it_should_fail() - { - // Arrange - var firstDataSet = new DataSet(); - var secondDataSet = new DataSet(); - - firstDataSet.Tables.Add(new DataTable("Table0")); - firstDataSet.Tables.Add(new DataTable("Table1")); - firstDataSet.Tables.Add(new DataTable("Table2")); - - secondDataSet.Tables.Add(new DataTable("Table10")); - secondDataSet.Tables.Add(new DataTable("Table12")); - - // Act - Action action = - () => firstDataSet.Tables.Should().HaveSameCount(secondDataSet, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected firstDataSet.Tables to have 2 table(s) because we care, but found 3."); - } - } - - public class DataTableCollectionAssertions - { - [Fact] - public void When_collections_have_the_same_number_of_tables_it_should_succeed() - { - // Arrange - var firstDataSet = new DataSet(); - var secondDataSet = new DataSet(); - - firstDataSet.Tables.Add(new DataTable("Table0")); - firstDataSet.Tables.Add(new DataTable("Table1")); - firstDataSet.Tables.Add(new DataTable("Table2")); - - secondDataSet.Tables.Add(new DataTable("Table10")); - secondDataSet.Tables.Add(new DataTable("Table11")); - secondDataSet.Tables.Add(new DataTable("Table12")); - - // Ensure that the table schema isn't important for the count comparison. - secondDataSet.Tables[0].Columns.Add("Column1", typeof(int)); - - // Act & Assert - firstDataSet.Tables.Should().HaveSameCount(secondDataSet.Tables); - } - - [Fact] - public void When_collections_do_not_have_the_same_number_of_tables_it_should_fail() - { - // Arrange - var firstDataSet = new DataSet(); - var secondDataSet = new DataSet(); - - firstDataSet.Tables.Add(new DataTable("Table0")); - firstDataSet.Tables.Add(new DataTable("Table1")); - firstDataSet.Tables.Add(new DataTable("Table2")); - - secondDataSet.Tables.Add(new DataTable("Table10")); - secondDataSet.Tables.Add(new DataTable("Table12")); - - // Act - Action action = - () => firstDataSet.Tables.Should().HaveSameCount(secondDataSet.Tables); - - // Assert - action.Should().Throw().WithMessage( - "Expected firstDataSet.Tables to have 2 table(s), but found 3."); - } - } - - public class GenericCollectionAssertions - { - [Fact] - public void When_collection_is_compared_with_null_it_should_fail() - { - // Arrange - var dataSet = new DataSet(); - - dataSet.Tables.Add(new DataTable("Table0")); - dataSet.Tables.Add(new DataTable("Table1")); - dataSet.Tables.Add(new DataTable("Table2")); - - List nullDataTables = null; - - // Act - Action action = - () => nullDataTables.Should().HaveSameCount(dataSet.Tables, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected nullDataTables to have the same count as * because we care, but found ."); - } - - [Fact] - public void When_collection_is_compared_with_typed_collection_with_same_number_of_tables_it_should_succeed() - { - // Arrange - var firstDataSet = new DataSet(); - var secondDataSet = new DataSet(); - - firstDataSet.Tables.Add(new DataTable("Table0")); - firstDataSet.Tables.Add(new DataTable("Table1")); - firstDataSet.Tables.Add(new DataTable("Table2")); - - secondDataSet.Tables.Add(new DataTable("Table10")); - secondDataSet.Tables.Add(new DataTable("Table11")); - secondDataSet.Tables.Add(new DataTable("Table12")); - - // Ensure that the table schema isn't important for the count comparison. - secondDataSet.Tables[0].Columns.Add("Column1", typeof(int)); - - var genericDataTableCollection = firstDataSet.Tables.Cast(); - - // Act & Assert - genericDataTableCollection.Should().HaveSameCount(secondDataSet.Tables); - } - - [Fact] - public void When_collection_is_compared_with_typed_collection_with_different_number_of_tables_it_should_fail() - { - // Arrange - var firstDataSet = new DataSet(); - var secondDataSet = new DataSet(); - - firstDataSet.Tables.Add(new DataTable("Table0")); - firstDataSet.Tables.Add(new DataTable("Table1")); - firstDataSet.Tables.Add(new DataTable("Table2")); - - secondDataSet.Tables.Add(new DataTable("Table10")); - secondDataSet.Tables.Add(new DataTable("Table12")); - - var genericDataTableCollection = firstDataSet.Tables.Cast(); - - // Act - Action action = - () => genericDataTableCollection.Should().HaveSameCount(secondDataSet.Tables, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected genericDataTableCollection to have 2 table(s) because we care, but found 3."); - } - } - } - - public class NotHaveSameCount - { - [Fact] - public void When_subject_is_null_it_should_fail() - { - // Arrange - var subject = default(DataTableCollection); - - var expectation = new DataSet().Tables; - - // Act - Action action = - () => subject.Should().NotHaveSameCount(expectation, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected * to not have the same count as * because we care, but found .*"); - } - - [Fact] - public void When_expectation_is_null_it_should_fail() - { - // Arrange - var dataSet = new DataSet(); - - dataSet.Tables.Add(new DataTable("Table0")); - dataSet.Tables.Add(new DataTable("Table1")); - dataSet.Tables.Add(new DataTable("Table2")); - - var nullReference = default(DataTableCollection); - - // Act - Action action = - () => dataSet.Tables.Should().NotHaveSameCount(nullReference); - - // Assert - action.Should().Throw().WithMessage( - "Cannot verify count against a collection.*"); - } - - public class DataTableCollectionAssertions - { - [Fact] - public void When_two_collections_have_different_number_of_tables_it_should_succeed() - { - // Arrange - var firstDataSet = new DataSet(); - var secondDataSet = new DataSet(); - - firstDataSet.Tables.Add(new DataTable("Table0")); - firstDataSet.Tables.Add(new DataTable("Table1")); - firstDataSet.Tables.Add(new DataTable("Table2")); - - secondDataSet.Tables.Add(new DataTable("Table10")); - secondDataSet.Tables.Add(new DataTable("Table12")); - - // Act & Assert - firstDataSet.Tables.Should().NotHaveSameCount(secondDataSet.Tables); - } - - [Fact] - public void When_two_collections_have_the_same_number_of_tables_it_should_fail() - { - // Arrange - var firstDataSet = new DataSet(); - var secondDataSet = new DataSet(); - - firstDataSet.Tables.Add(new DataTable("Table0")); - firstDataSet.Tables.Add(new DataTable("Table1")); - firstDataSet.Tables.Add(new DataTable("Table2")); - - secondDataSet.Tables.Add(new DataTable("Table10")); - secondDataSet.Tables.Add(new DataTable("Table11")); - secondDataSet.Tables.Add(new DataTable("Table12")); - - // Act - Action action = - () => firstDataSet.Tables.Should().NotHaveSameCount(secondDataSet.Tables, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected firstDataSet.Tables to not have 3 table(s) because we care, but found 3."); - } - } - - public class DataSetAssertions - { - [Fact] - public void When_two_collections_have_different_number_of_tables_it_should_succeed() - { - // Arrange - var firstDataSet = new DataSet(); - var secondDataSet = new DataSet(); - - firstDataSet.Tables.Add(new DataTable("Table0")); - firstDataSet.Tables.Add(new DataTable("Table1")); - firstDataSet.Tables.Add(new DataTable("Table2")); - - secondDataSet.Tables.Add(new DataTable("Table10")); - secondDataSet.Tables.Add(new DataTable("Table12")); - - // Act & Assert - firstDataSet.Tables.Should().NotHaveSameCount(secondDataSet, because: "we {0}", "care"); - } - - [Fact] - public void When_two_collections_have_the_same_number_of_tables_it_should_fail() - { - // Arrange - var firstDataSet = new DataSet(); - var secondDataSet = new DataSet(); - - firstDataSet.Tables.Add(new DataTable("Table0")); - firstDataSet.Tables.Add(new DataTable("Table1")); - firstDataSet.Tables.Add(new DataTable("Table2")); - - secondDataSet.Tables.Add(new DataTable("Table10")); - secondDataSet.Tables.Add(new DataTable("Table11")); - secondDataSet.Tables.Add(new DataTable("Table12")); - - // Act - Action action = - () => firstDataSet.Tables.Should().NotHaveSameCount(secondDataSet, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected firstDataSet.Tables to not have 3 table(s) because we care, but found 3."); - } - } - - public class GenericCollectionAssertions - { - [Fact] - public void When_collection_is_compared_with_null_it_should_fail() - { - // Arrange - var dataSet = new DataSet(); - - dataSet.Tables.Add(new DataTable("Table0")); - dataSet.Tables.Add(new DataTable("Table1")); - dataSet.Tables.Add(new DataTable("Table2")); - - List nullDataTables = null; - - // Act - Action action = - () => nullDataTables.Should().NotHaveSameCount(dataSet.Tables, because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected nullDataTables to not have the same count as * because we care, but found ."); - } - - [Fact] - public void When_collection_is_compared_with_typed_collection_with_same_number_of_tables_it_should_fail() - { - // Arrange - var firstDataSet = new DataSet(); - var secondDataSet = new DataSet(); - - firstDataSet.Tables.Add(new DataTable("Table0")); - firstDataSet.Tables.Add(new DataTable("Table1")); - firstDataSet.Tables.Add(new DataTable("Table2")); - - secondDataSet.Tables.Add(new DataTable("Table10")); - secondDataSet.Tables.Add(new DataTable("Table11")); - secondDataSet.Tables.Add(new DataTable("Table12")); - - var genericDataTableCollection = firstDataSet.Tables.Cast(); - - // Act - Action action = - () => genericDataTableCollection.Should().NotHaveSameCount(secondDataSet.Tables, - because: "we {0}", "care"); - - // Assert - action.Should().Throw().WithMessage( - "Expected genericDataTableCollection to not have 3 table(s) because we care, but found 3."); - } - - [Fact] - public void When_collection_is_compared_with_typed_collection_with_different_number_of_tables_it_should_succeed() - { - // Arrange - var firstDataSet = new DataSet(); - var secondDataSet = new DataSet(); - - firstDataSet.Tables.Add(new DataTable("Table0")); - firstDataSet.Tables.Add(new DataTable("Table1")); - firstDataSet.Tables.Add(new DataTable("Table2")); - - secondDataSet.Tables.Add(new DataTable("Table10")); - secondDataSet.Tables.Add(new DataTable("Table12")); - - var genericDataTableCollection = firstDataSet.Tables.Cast(); - - // Act & Assert - genericDataTableCollection.Should().NotHaveSameCount(secondDataSet.Tables); - } - } - } -} diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index eee4d5e48c..295b1b5d1c 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -63,7 +63,6 @@ - runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/docs/_pages/data.md b/docs/_pages/data.md deleted file mode 100644 index bd7ce15f47..0000000000 --- a/docs/_pages/data.md +++ /dev/null @@ -1,193 +0,0 @@ ---- -title: System.Data -permalink: /data/ -layout: single -classes: wide -sidebar: - nav: "sidebar" ---- - -Fluent Assertions can be used to assert equivalence of System.Data types such as `DataSet` and `DataTable`. - -## Basic Assertions - -As with other reference types, you can assert a value of any of the core System.Data types to be null or not null: - -```csharp -DataSet result = ...; - -result.Should().NotBeNull(); -``` - -You can also assert that two `DataSet` objects contain equivalent configuration and data, which, by default, will compare the rows contained by `DataTable` objects by their index within the collection. -Like this: - -```csharp -var expected = GetExpectedDataSet(); -var actual = GetActualDataSet(); - -actual.Should().BeEquivalentTo(expected); -``` - -The `BeEquivalentTo` test can be applied to `DataTable`, `DataColumn` and `DataRow` objects as well: - -```csharp -actual.Tables["First"].Should().BeEquivalentTo(expected.Tables["First"]); -``` - -Chaining additional assertions is supported as well. - -```csharp -dataTable.Should().HaveColumns("FirstName", "LastName") - .And.Should().HaveRowCount(3); -``` - -## `DataSet` Assertions - -The following assertions are available on `DataSet` objects: - -* `.Should().HaveTableCount(n)`: Asserts that the `DataSet`'s `Tables` collection has the expected number of members. -* `.Should().HaveTable(tableName)`, `.Should().HaveTables(tableName, tableName, ...)`: Asserts that the `DataSet`'s `Tables` collection contains at least tables with the specified names. Additional tables are ignored. -* `.Should().BeEquivalentTo(dataSet)`: Performs a deep equivalency comparison between the subject and the expectation. - -## `DataTable` Assertions - -The following assertions are available on `DataTable` objects: - -* `.Should().HaveColumn(columnName)`, `.Should().HaveColumns(columnName, columnName, ...)`: Asserts that the `DataTable`'s `Columns` collection contains at least columns with the specified names. Additional columns are ignored. -* `.Should().HaveRowCount(n)`: Asserts that the `DataTable`'s `Rows` collection has the expected number of elements. -* `.Should().BeEquivalentTo(dataTable)`: Performs a deep equivalency comparison between the subject and the expectation. - -When comparing the rows of a `DataTable`, by default the rows are matched by their index in the `Rows` collection. But, if the subject and expectation tables contain equivalent `PrimaryKey` values, then it is possible to match the rows by their primary key field data, irrespective of the row order within the `Rows` collection. See "Equivalency Assertion Options" below for how to configure this. - -## `DataColumn` Assertions - -The following assertions are available on `DataColumn` objects: - -* `.Should().BeEquivalentTo(dataColumn)`: Performs a deep equivalency comparison between the subject and the expectation. - -## `DataRow` Assertions - -The following assertions are available on `DataRow` objects: - -* `.Should().HaveColumn(columnName)`, `.Should().HaveColumns(columnName, columnName, ...)`: Asserts that the `DataTable`'s `Columns` collection contains at least columns with the specified names. Additional columns are ignored. -* `.Should().BeEquivalentTo(dataRow)`: Performs a deep equivalency comparison between the subject and the expectation. This includes comparing field values, for which the defined columns must match. - -When checking the equivalency of two `DataRow` objects, by default the `RowState` must match. But, if this is overridden using equivalency assertion options (`.Excluding(row => row.RowState)`), two `DataRow` objects with differing `RowState`s can still be considered equivalent based on their field values. FluentAssertions automatically determines which _version_ of field values to use in the subject and the expectation separately. - -* For `DataRowState.Unchanged`, field values for `DataRowVersion.Current` are used. -* For `DataRowState.Added`, field values for `DataRowVersion.Current` are used. -* For `DataRowState.Deleted`, field values for `DataRowVersion.Original` are used. -* For `DataRowState.Modified`, field values for `DataRowVersion.Current` are used. - -In addition, if both the subject and the expectation are in the `DataRowState.Modified` state, then the `DataRowVersion.Original` values are also compared, separately from the `DataRowVersion.Current` values. This can be disabled using the `.ExcludingOriginalData()` equivalency assertion option. - -## Collections - -Each `DataSet` has a `DataTableCollection` called `Tables`, and each `DataTable` has a `DataColumnCollection` called `Columns` and a `DataRowCollection` called `Rows`. Some assertions can be performed on these collection types. - -The following assertions are in common to all three collection types: - -* `.Should().BeEmpty()`: Succeeds if the collection contains no items (tables, columns, rows). -* `.Should().NotBeEmpty()`: Succeeds if the collection contains at least one item (table, column, row). -* `.Should().ContainEquivalentOf(x)`: Succeeds if the collection contains an item (table, column, row) that is equivalent to the supplied item. -* `.Should().NotContainEquivalentOf(x)`: Succeeds if the item does not contain any item (table, column, row) that is equivalent to the supplied item. -* `.Should().HaveSameCount(x)`: Succeeds if the collection contains the same number of items as the supplied collection of the same type. -* `.Should().NotHaveSameCount(x)`: Succeeds if the collection does not contain the same number of items as the supplied collection of the same type. -* `.Should().HaveCount(x)`: Succeeds if the collection contains exactly the specified number of items. -* `.Should().HaveCount(predicate)`: Succeeds if the predicate returns true for the number of items in the collection. -* `.Should().NotHaveCount(x)`: Succeeds if the collection contains a different number of items than the supplied count. -* `.Should().HaveCountGreaterThan(x)`: Succeeds if the collection contains more items than the supplied count. -* `.Should().HaveCountGreaterThanOrEqualTo(x)`: Succeeds if the collection contains at least as many items as the supplied count. -* `.Should().HaveCountLessThan(x)`: Succeeds if the collection contains fewer items than the supplied count. -* `.Should().HaveCountLessThanOrEqualTo(x)`: Succeeds if the collection contains at most as many items as the supplied count. - -## Equivalency Assertion Options - -When checking equivalency, the operation can be fine-tuned by configuring the options provided to an optional configuration callback in the `.BeEquivalentTo` method. - -In addition to standard equivalency assertion options, which are applied recursively to all subjects found in the object graph, the following options are available that are specific to equivalency tests for supported `System.Data` types: - -* `.AllowingMismatchedTypes()`: Allows objects with equivalent data to be considered equivalent, even if their data types do not match. See "Typed `DataSet`, `DataTable`, `DataRow` objects" below. -* `.IgnoringUnmatchedColumns()`: Allows tables to be equivalent if one table has columns that the other does not. The column definitions and row data for these columns is ignored. -* `.UsingRowMatchMode(Index | PrimaryKey)`: Specifies the manner in which rows in two `DataTable`s should be matched up for equivalency testing. -* `.ExcludingOriginalData()`: Specifies that when comparing two `DataRow` objects whose `RowState` is both `Modified`, only the `Current` value of fields should be compared, ignoring any differences in the `Original` versions of those fields. -* `.Excluding(x => x.Member)`: Excludes the specified member of the subject type from comparison. This method can only be used to select members accessible from the subject type directly. -* `.ExcludingRelated((DataRelation x) => x.Member)`: -* `.ExcludingRelated((DataTable x) => x.Member)`: -* `.ExcludingRelated((DataColumn x) => x.Member)`: -* `.ExcludingRelated((DataRow x) => x.Member)`: -* `.ExcludingRelated((DataConstraint x) => x.Member)`: Excludes the specified member of a related System.Data type from comparison. This is to handle the case where a change to one object within a `DataSet` causes corresponding changes automatically in other places. For instance, setting `Unique` to `true` in a `DataColumn` has a side-effect of adding a new `UniqueConstraint` to the `Constraints` collection of the containing `DataTable`. -* `.ExcludingTable(tableName)`, `.ExcludingTables(tableName, tableName, ...)`: Excludes tables with the specified name(s) from comparison. -* `.ExcludingColumnInAllTables(columnName)`, `.ExcludingColumnsInAllTables(columnName, columnName, ...)`: Excludes all columns in any table within the `DataSet` with the specified name(s) from comparison. -* `.ExcludingColumn(tableName, columnName)`, `.ExcludingColumns(tableName, columnName, columnName, ...)`: Excludes the specified column(s) in tables with a specific name within the `DataSet`s from comparison. -* `.ExcludingColumn(dataColumn)`, `.ExcludingColumns(dataColumn, dataColumn, ...`): Excludes the specified column(s) in tables with names matching the owner `DataTable` of the supplied `DataColumn` object(s) from comparison. This method is supplied because with typed `DataTable` objects, it is a common pattern that accessors for `DataColumn` objects are provided. - -These configuration methods follow a fluent initialization pattern; they return the same options object they were called on, so that configuration can be chained in a single expression. - -See the "Examples" section for some uses of equivalency options. - -## Typed `DataSet`, `DataTable`, `DataRow` objects - -If some of your `DataSet`, `DataTable` or `DataRow` objects are _typed_ objects (e.g. `DataTable` classes that inherit from `TypedTableBase`), by default, equivalency tests will fail if the data types do not also match. If you want to compare typed objects with untyped objects that otherwise contain equivalent data, then the option `AllowingMismatchedTypes` can be used: - -```csharp -DataSet expected = GetExpectedDataSet(); -EmployeeData actual = service.GetEmployeeData(); - -actual.Should().BeEquivalentTo(expected, options => options.AllowingMismatchedTypes()); -``` - -Apart from the default check for matching types, whether a `DataSet`, `DataTable` or `DataRow` is a vanilla object or an instance of a custom subtype is irrelevant for the purposes of comparison. - -## Examples - -Asserting that a `DataTable` has certain columns: - -```csharp -var table = GetDataTable(); - -MyTypedTableType templateTable = GetExpectedDataTable(); - -table.Should().HaveColumn("FirstName"); - -table.Should().HaveColumns(templateTable.FirstNameColumn, templateTable.LastNameColumn); -``` - -Excluding tables and columns from equivalency tests: - -> You can exclude a column from consideration by name across all tables in a `DataSet`, or from a specific `DataTable`. - -```csharp -var expected = GetExpectedDataSet(); -var actual = GetActualDataSet(); - -actual.Should().BeEquivalentTo(expected, options => options - .ExcludingTable("Employees") - .ExcludingColumnInAllTables("EmployeeID") - .ExcludingColumn(tableName: "Employees", columnName: "Address")); -``` - -Excluding fields from types other than the subject: - -> `DataSet` objects have a hierarchy of objects representing the data and many interrelations between these objects. For instance, setting `Unique` to `true` in a `DataColumn` has a side-effect of adding a new `UniqueConstraint` to the `Constraints` collection of the containing `DataTable`. As such, to eliminate side-effects it may be necessary to ignore additional properties of types related to the subject. To support this, a method `ExcludingRelated` can be used that allows members to be selected on any related type. - -```csharp -var expected = GetExpectedDataSet(); -var actual = GetActualDataSet(); - -actual.Should().BeEquivalentTo(expected, options => options - .Excluding(dataSet => dataSet.DataSetName) - .ExcludingRelated((DataRelation relation) => relation.DataSet); -``` - -Matching the rows of `DataTable`s by their primary key values: - -> When comparing the rows of a `DataTable`, by default, rows are expected to be occur at the same indices. If a `DataTable` has a `PrimaryKey` set, then it is possible to instead match rows by their primary key, irrespective of the order in which they occur. - -```csharp -var expected = GetExpectedDataTable(); -var actual = GetActualDataTable(); - -actual.Should().BeEquivalentTo(expected, options => options.UsingRowMatchMode(RowMatchMode.PrimaryKey)); -``` diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 11faf69f04..bfdac56010 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -17,6 +17,8 @@ sidebar: ### Breaking Changes (for users) +* Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) + ### Breaking Changes (for extensions) ## 6.12.0 From 83895f99689ad31c15363f8d0a40750ee7cbe6a6 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 29 Jul 2023 10:11:34 +0200 Subject: [PATCH 016/845] Add dependabot --- .github/dependabot.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..5849f3000a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,24 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "yarn" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "bundler" + directory: "/docs" + schedule: + interval: "daily" + + - package-ecosystem: "nuget" + directory: "/" + schedule: + interval: "daily" + ignore: + - dependency-name: "System.Configuration.ConfigurationManager" + - dependency-name: "System.Threading.Tasks.Extensions" \ No newline at end of file From ced4545bcfe2b66a6bb3b1fe0b6fc699030ec810 Mon Sep 17 00:00:00 2001 From: Dennis Date: Mon, 28 Aug 2023 07:21:35 +0200 Subject: [PATCH 017/845] Attempt to fix version calculation --- Build/Build.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/Build.cs b/Build/Build.cs index 261ee82390..badaf37a17 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -54,7 +54,7 @@ class Build : NukeBuild [Solution(GenerateProjects = true)] readonly Solution Solution; - [GitVersion(Framework = "net6.0")] + [GitVersion(Framework = "net6.0", NoCache = true, NoFetch = true)] readonly GitVersion GitVersion; [GitRepository] From 22ac70fd7501f7426aae2ad768fb38dec4e41faa Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Mon, 28 Aug 2023 09:59:59 +0200 Subject: [PATCH 018/845] Downgrade GitVersion tool to help generate the proper packages for alpha tags --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 332fe3c835..8e24c4d5c1 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -17,7 +17,7 @@ OS_MAC - + From 24674f64ec79362dc38a9d6db9c8cef9e3081d68 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Thu, 31 Aug 2023 10:03:44 +0200 Subject: [PATCH 019/845] Updated sponsors (#2284) --- README.md | 13 +++++++++++-- docs/assets/images/aws.png | Bin 13879 -> 0 bytes docs/assets/images/swyfft.jpg | Bin 0 -> 6613 bytes 3 files changed, 11 insertions(+), 2 deletions(-) delete mode 100644 docs/assets/images/aws.png create mode 100644 docs/assets/images/swyfft.jpg diff --git a/README.md b/README.md index f9fdb27e17..a6d5bc792a 100644 --- a/README.md +++ b/README.md @@ -31,15 +31,24 @@ This is a special set of tests that use the [Verify](https://github.com/VerifyTe If you've verified the changes and decided they are valid, you can accept them using `AcceptApiChanges.ps1` or `AcceptApiChanges.sh`. Alternatively, you can use the [Verify Support](https://plugins.jetbrains.com/plugin/17240-verify-support) plug-in to compare the changes and accept them right from inside Rider. See also the [Contribution Guidelines](CONTRIBUTING.md). -# Powered By -  +# Sponsors +      With support from the following public [sponsors](https://github.com/sponsors/fluentassertions) + + + + + + + + + diff --git a/docs/assets/images/aws.png b/docs/assets/images/aws.png deleted file mode 100644 index 2c118792880d64f51dd8414e8973f3dbb5319919..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13879 zcmcJ0RahKN(C)H}`{M2v+#$G22=4AA!QEvE?hYZiySs1D0Kwfo5G=R_`S<(J)wwvA zr}uegc4oSJdTOe=>wT*xN=-!`1C<07003YpD#&O60B{np|4?K^*w#b0a~QUR|0Jm_ z2>>)Cpgo%-z>cXb6*QCq0AB_G01^rSJi$&uj$pMp0f1vO06^#)06^%R-Kj1DyMSn+ zBrgMa`|p?EQ*f({1o+=vlU0swr%iZYT~-m7OhKK^M7E%$vV?+@uh ziDlqqGr5_5&|%{z?PJfZT97}r4%t@KZ0e{TJ2=$^*qyYn^*Hp9pPy|zXiM0c8VZ-! zMDr95!^=!7;6x?|t1}Q=p<4+a>i?xY%r8fOKjj>5^(K}#r;2fSdgya!^6$R7<$kpf z0TEV2@sgtijP(S4oaLGRp+_A%%c#l;5(^Sbm;=lLE*u;P_o?#vJIRyIDjQ{4|81Pc zLx;n|$3VmA=;&gx>xwB)ZcLxZmc!DA{#2sN3TmhIrvC&0w0)zd39`IaqsPP~x3sNd zm<_e{*wT9{tz~a9r6HJV>gwS2<~6Z3sj_7Y{1{s}=ilay*8tRNq)i;XlFB+Hp+;ui zxh%p)#DlCE8a(`NFOSj<_YY^_^kKweK`{BRhw9c^O5FGDT z(Mv)dx%}p4-sU3OGAE&gjc>D!JV5nFAhRwAH)UP+@4IfQ!YKrh$eX9~?IMLDr04@P zqRq-3KC=m-cFAU?vlB1L z(?O>;NAC&g${{v2QQ9;UKy+txhCMh5VbL$Su;>*Pk^J>=#3&ot1rM2bzcs4TYA?`N9R@ZpPKNz{h}IoaFlNPvTUpJF4j&|nc)axIXE#THsxXAD&Pl5WCH zG>b>>tI#nP_Ac~lM&r7^a=rlNfCINpUw=*1LY?iU!jDt+9j#I_Hhc@cSDmJW3eo?v zOpVmjb@2jMF%@c1n|QuG16;Lk%Kp&=q#qDOFnVuzn+4tRLvMHMsb~fM#``lH3$Yd6 zEl?y;LKE*GFJU*_XeSI#BFRUd9OT*0yH|$xDAhkDu0Y@NE9-s}gav&|g4a{yEupFt z>{e^20<+Ug&pF2P2?CYel=@At8fVheKds?!UVZjA) zLFv!3&KaXF+P30C8d_vdn3koKudCYFJGOf|;yp?_Dn6=;WT}x{L<9T~5Rdk?ywv6~ zQy-^KpA!X4t(x6Kg(t=H{$&~3)Gyr6Dhn51F)rK%^jR&ix8x)xha)S z-i31BsiQRe@C(biY1pGq_iwfQnkdFmz%~Jn9#5CE7H?D=`rF*oh%+$ z2YqY1l1U9QNTYIZwe`m!akpv~d6I{f`fx9yNH!c?;zDw-+B0k7fe|FORGA@djIv;uKG zHU5;2fdR=XVZnMxX{*3NUU#YxQh}4pL({QK^bA+MZkkO)vwm7l2{&Gn)kepK7-5xt`U4dv@l2*NLmHp_ zJ*^Hv()FdTl_XvVZu>HQm-ssh?EK~A#yD)r@%gR0G5}V|?h2-ipCA3=Wh$<9>VGrz z+_15j=%!8Zp?%U}QIc6&)?VJHY-9fN40<1a9k?T(LZeXUbZV&O9yz`bh2Bx?^&SvW z7$T71@AfzDCYRx-HgrM4i86Pm@N3~k^YBw;Mz#Pr00;PX0H>6#si!w1up&RQOEF6q zWU2N}H7#lNSp6wxY%e~%rDmy3QuX>FPNQT@)$q8Iz;|IEHu-vi#`p5XC0PY{ZIL)| z7Gfe%3eZnKG;bNB)Jsoi*zfo>>_7e%sM@@{wz%Z!o&rrBsxZCP${b`Nw*hk*FxDC@ zgW^%@OB@xYO%xwVw1zvo)6@(h+}j;in8&@7*-?=k92vA+we`+d+u`9Qf9bcntiK~| zI@lTJ#fN4vqN0}GXxk&`^1Q zv^l%}e9Fc)WEp=ns7`gWjc0UiW38lVyl~%0(>1BKKnyk7Mvx6$HsZWl zA_fD|o+2KoPY0G`uG%9#Of`)UEN1aemULV32?$Kqh(*3c>V{HR>H_4Xw(#M7%_@kxHv3UM1y#Y|DI_}!ID>?RtVSqY zA&xuy)0(2E;FX8GuuiMLO&PmRmOSM+e5tQfv`z4tJoumJXZC4g^Z=l9wHYfvnpXSp zt$WOwfmjZiN_0BC`U|UYRbMWe7UP};0)pn#N`J?B1~OTA-*Hr-n;l2j66K$rdQL%R zIrK&f8TUB(on)4&ssU7y2&8v_bOqVQCslBn`5&Q(p6q5$JvZQii69o7VRr7T;9AIt zcSUcYxt(g>VK^Wmcx-G8dCW=FwsvqLVQER{Tpg>MRGW=hTZ4=9efq&?W5+J$x2a44 zdc`&5hJ~05-D8rIDzfCBf0j-(l>0*@KwiP{0{J)0b`z>}y)aJQ0Jdntt{=hq4*%Gx zoOQlDI!AQG#5Ay$RS;<=TTku&c*-*qzIxrY%c&h=!!vfWX{UznSt!3$tqo;)lmuEb z>cqOpL+(;2lufqg%!P_3-Ji6YJK4$th^Ke94;8@*aZaB*blMtRJfCQ%`v!13ScYu* zc-FDabkSR8V?2RlOagrgX&+J%mjq}`qP!^n;!Mt(@>VWnrL&9DZI=@TaKmc|e=R_5 zyOx{5VDr#!iGNx=UzkckQa}4-(?$(t$IkFg=`3nJ;mKmo4gDeeDc5I4vDfpv(CW=f z(39eiflQNy$)7*ox}|UFo~_|9>0N<3gLhWDRhWEDYuMW;VCu#(QeBO8N&~`fNh6+_jY^1^%~nL+R_n8C2!| zxolvgb*6DQ&6?~WwitAM&xRgp@(K%{4`$>E#yTch?QdhtztEys}HQ>dnHl1730?u4#0@F zbmFf?Q5(z>de?KBO?dQueHq2O|4Ia%osA6xg|54`_+og3u0W^i46{i(AvUskgANsZJ0F*97bx=-R2H{RF{^bGE}bx!;CcuZTGpM&R&qSk zbz5>B2KS`Y`iW`olDi8pDE($T^Qob=dRdV{@}UFKpMGQ zPyDnpM!|4T)QOcxycs#y-?Mg2C{6n#HzV$E<=8^&WN2nnb#Yz~{sR)|a3sZcdgo&3 z1b=7EcY)<)f>i02$=PyJn7D;K_zDx^UArH*wY&n(lpp@RD%A%n(q6QyE-nxrtOZB5 zFw_-4b36{=Thpnp&tT_E5Gs-Z< z$xRV2s1}?%ROj4qsxLoE7ISbdpVoQ5)+o5qdaDI~uboyv10OtaC7~}75qYX(C@f*9 zT@Cu`2;z^qz_f7CX%J}pa1!ob@%13uZTnr=%6WH|0)lr#{`u#P8v5QfzwU@?f&*Km zogQ6MYJy{SYX!E$PeH1`ChyM5jTC2(>i{2;q`oG{m2XQu&jWEt18pcHVY&?OER z&(^t(H;!r&JI09DvyJW0L6weN{xxz?8fqCEXY1c0l}Ni7sSOtwr%d_u873Z4g^+v< z{#nQ>hC=|2lW@h%cjo0nGNn><%L!EiaEahBk0Y>Hq}bId;U3XOt0+^ zrpnaT>THRKIH}%laRAIaMi_ShHd~(c$vCf4o#<#0mL&OL!uN*$EQ%<0kPlRUxO`5& z(47?QvR4zDC`iRN`w<%Lb`?FK8ugPDdKg)=Rl@QF`jSP&-0J5NYBt|FO|D26_^M;J zwz^tbn{(s*4eLmUs->`y2Kl%$Ji2BPceFkPwqiyuI0g~$lG`~QmOGa)2mNZTcJQI! zVZ4eNt5cC=JDkVaE>DgQew5wWT5Ih=f8gEVZDXoH)}I2Xdzt47Vuqmo=NxJ?b_Fk> z)JJN*i0D#m|GuXw@vk5K4gYW7Y;t^*J8XEE{$CCMzggaEc=2e~RG3}V6~NsI!|r4H zJI|P(L0ce&7x;?<#q@j0-5T?+;o>dt@Y3&NInb(FWbCyDq|b-&QzJhNTxnc&U!)^8 z2cxLMl!CP+OFK?nYDL=}_n{!7h zxW){$Ra{y5C(T2zDLe@g(YPD)nM77sO2~h&DdvyE>uGAvRn-4d_pSqvnAfj8QKtL) zJ<%pPw|BJqwpLC`tfavakZJ7;6;{L0Xpr;GLrk(x-JmXzmASK6)lu=`OK=`>-IV-m z45CpTNNy-oC{`M7zGuRRk&)rJLJ&P9CkJhEA}2R4l2ki0UV-V~iq@*EQowBy%@2!U zdG5hfHrZMxXIn;E4?1JnNp?BsV za7^Nqy1anFzB%o-WKxWimigjR<< zT4!;S@|=G$MhzvMW>Q1%VL-N!akC&Yh5(mM}ZoibJ0`m3PoBw_APysoGvrbo1kjQ_=)=`ZiVFX+s3 zQ8~XA2+<=E^*DW>WmCHG(r;q{BdI1L5;Wx3m((5lW~4_V>W`L|FDxfwHwdMbyvB!{nc$mJbVjd-b?cO0b>md>??M0UA&)xMT?_cgdMl|FvKMGyj5$Q{9G* zVry8A_dX7;f-#JQsEN7zZTm9SS`$kRrJZTCUlH3j-`<&>ot^IeyoK6u%foC07prjl zg2K&Bbo3kqbr%sbIU2Ps@y+h-oIO4=~#Ml(2ZN-qwt~YMAQNQdxoQGD}TPG zNq((>?^(?&V(S7O%A-Xb<{7)#%#DrVqDsi1q`vo=ThWV8uyru%@b)rM^v3^CSTJoK zJkOq7$5L{d&Uc$u#T}qnQd(My>rMUIQDP<~TS49;9^y>TDHhgtH`={>@#}YIWrqpx z?@-%Bqa?sH0iB5bD2MK3dpzjCA%hWxFTtpBi8r912cL1p_>k6=0km^nnVQ*Zu-LvG_7PLPq zquTDySX~k1;pb+2`^LYdt&HQIJjk#0e4Nmm^P~DiQw8$XZJ!+<2w;AV_&4>#ik60MaD&2rs_`;g-GXqe6c ztbju?iM-~mU2GN0;UGHxhYYSY>Td0*J-)Wk&jT#_ks;>g2nVh%r-IG=IE4_9efFAv zzLlOat?InRa(8wf3qWevzkl;(U1MVUHme$ngH(K)snJ00Y`}c|Fj%u~^Ws#X-zFBX zTw88rWoMP#K41GR7$VD|XpGDnD(V~CdKxK`-U=?U#+u;tYtp`bN7zT{T7Ao11}rzR zhmZ|_7ho|Y19v+Qqa5c6n!Mq1?fgXIuJ6ehHbg8=jt%s!S z8}xSzLVVZ1CS36m*A{2Iq;m))Xl!-;gcvaA%&W^i=5KNu_6Ev8KA2977A;}9{oA3- z&F+7w(H=$WmuQ8VT=&ouyznGU28^G8dS*RpoxQ7-{%R}pvWz*sN zoUhX6p+&gfP*>d7)rl!KU53c`+uzjH>CNOd#5_QW zVeocoi4qnyt1DOMPQt2u^#>A6Da?wyr$@TNT-4&uq&^MYR|X36(8fTJw@ZK3*0tSIQcShR&&EnOfAX1bffimpfYxMFLiEBb2Ufx$B6zIHoy5KK&5Z{s~1sR zRi!QpT{gGJ$6zfN6$qRmIvhh}3t!A#;ii48eoj)LA|v$0v$;+;2du5Qw!xDo5hbsj zlX2?zHxe!BT-(rVn^VBc z$f18Z$ZkJAsVD>&Uc6B?N2#a78&^^~&*HLF?3Z*x%G?H5CoC|HRTuLfEP=ng(O&7B zCXV|v6R7~_L9Kz7#nyCxc|3hyEARvpJAp=gyp>E?Egofhk##CQqQW3#&IKa(F*h6J znkheluxs~Ov6Wk(MXFh(7m?(Un{oE4aWIb17f86UA{V)OFhctj`a8G=jnkRPc+}6N z*)rnmzZ4Znuv*tA^D3s0Sr>>eCF)De?naNpDyj05n*mt2ObQXN`Scrr3r;H=Isd8t z_5O82A88XhqvG|E>J}s)iW)(26rTQcj2}KmHs!~WKI85%QMiw5R+hG>&z0u>kyosx zxw&oCe`K7Wk3`|gjlZ_Cc4P=lXXrs9p#_Y;dYhLAR>No`yiW*oO-+c-n9$|IXesDS zJ2ESj)_OM=WeqLu51S(m`Urfx=dXMaM4*z5`LJwl`X=t?5w4$jv(`sORY|>m$3j4` z6pLvRm5Th=`Lh1rNzwaXNHRqS4Ji4OszF4Tptca*T}fJ}j_5?Px2q)i!br!P;qdo; z_4S+%c)G4i%*?!{-Y2(KqAc__HV6dm-}bE=T9gd{{&s)}flkNxej+Ae}_; z#)}kE6{j=*h-=v=P~L@^N=YQZQm1*d==EsBJSUaF#O!s&+LE>9EgDNUku@!KUIW?V zw7maurYO+xPKIM(hKs9e_3x(>*-1MU8gMY$2PGwG=8qnN*SRVJ8)LCoFHaQhh)0L5 z|FG}Hlq6d4zxmGuHxk>2(hQAuZe+qpP96^2_} z;;#;J-~WuLmw(JCZn8AkxdzHol*ho1rMDTueGU9{28*+Pu zFJF-;mIshTuD-i;ZxR;HqxX@u1L)8x?a1dWk$4KBn0`$2RX1^YoWj=+|5;>f*y1y^ zlm1*-(Kd3@Tr3I$C{1`T=>p)i*9`~K+MlH`8zUcE+wA$7nQltf%cCEn{+}}nLs@Nw zPhK30w4ISBN-)`u@^}BoL>I6sF5cqRs4TWL7UjfTvaCFnQ@GepzW%pPB3(@+Jo_|9 zzw+WW3;c!!{yo+)D2 zcPo}wdVq0If#ffor~`MhPe!>oXn2aN6$mUSCqeSbT~gAGI=DhY2cufCrp<((04pQW z`FJ+V{V}ko8-@X~Y%TV80g>%7{Y9{#mul6|9E!=7h(#Fb=&}}hQlxLY5`=4bevvE# zi!_-i`k3%023)Uxm-Xwh75I>&toF+IPQ8L|Y7M?V z)fRv9F6hXcEpS-qPksH9JJ*SjY8s_nLm&)g)@sju!t?P}-ki1`tu_$&FGM35=RdAv z6Xk25duYb{`E9=F@`kR~G?MVWDCGzye$O1HmH2il^0g96_;S)w8T`qdi+M<3G047@ zzpna&FNHo#`VQM4^ETGovQDao>90HfLw`C+eGEV1dTToF(oBo{t*&Cmr!=iHV;Jr# z>SfHLtedo?b$Zs6LlgY`G*RuxJArBAQ41D#CPy;uMIEhUxWJoz=iZvdI@X34Drk!A z!BVioh^nhnzjk`ff`vMM3y2gm{I0L9r1bZTTYgwrn0^vevFx1?;y6jnu}^e%9rz!s zBTEx90gKx&tCpW<;x1~JXR7{J27P=*!F6dVm z{%mVn+5j=Kb_1-NM<*;%-#U?)s|-ozWRZLaUyA$N%6>*#20Toe``tO_sm z$9=1WQljNKBr^=g=>tMWLj z?T$lAq#FG}Dq-MGWW$Nj!*rl7i>mXcmqpAT`fsE+5Exs+G}OFCP-N*TT@ddkYm zpLjn91%H#%EtLXy)Kv5ypU5i_f3B#hhR?k@`p~uduena~NyN5|5Gdw@+bO6GYHMw+ z)W4{KE&`Lk*$2!Y#K2HK@~vp>>nlO@Y3F2J@BQ=g%IfzaQV@Tht40G0hO?ShpLZcI zQbWyOZwabOg01yt_b;<(QhfaED;!7Tuic`j$9M?^97`Fz70;zV*K?%h>O$ z6@TYAbkwb@HmI;w9XTBGRP8eG8JIm9EPXoe%eheQZgl0N5qFkuj`lApX+18$n=B4` zm_Ggui?}+Kc+-iRBH=ANP#(W%2rYk6I%Bybn0U={Zd=ii;;)l7Jy6f`9B?i zh$77Jec4=5-)00!)e!P7a(p?xx<1Ic62~0qu@yGMZ=3JADoaHqIJ?^lexcwQDk|2a zF#%l_-v32?aZ?&^`qKz!4hxwEV9bz00yYw#)4%Wv7Qlr0!^-HF?m^muM@$ybK|e*| zM?)RE$};nKqZaVCJ$06P-p;W&omw9Z1p_OPpC!N;frx{Yxj8h~L(f0*3 zL8`ZIe0}=2{Fpaz2@w#s>$wT{EW4^VqK2=sE>88r$W7;XJLz+X`qpe!CI%@Ys0uh& z(Pf*EV-B#&2heXjwF5u4+q(A6Uq4xxvqJSaKqK!at7Fb2w!_`2dTF^l{U6*}pdZX2 ze$umt-;XQH$_CsHGD11D6Ep(gDI6=So}`3$P!GY1^^9F-LUTvPMb#c` z0fmQy^lG%8`}6SC*8%w{v_fDia5OzsBh*%_cge_ktgrX}il?f_r#3Dt0-f}h;Nr`6 zk%uy7<&oEawz%2j@lxyF)V;ALa7rrT?p_jU654f@hel7-?zyyhi!`^>;pwn8En>A? z{sQF{;II9;rw=}PA{SotD&`3}_4OLaz2DrZcYa9h^^&dGY$2gN-+MPwOcw1}pO_~T zqQ6w5e|eSS*IMJGq>TM7TEP9w5Vo*I5dMvgq}-E#hZlap&qmO7mX1#C-3d*{URhk4 z*}g6lVbQ6KHv>uYo1MeNZd|dj%`fDA0mnW-43ERY4`beJQCL<`$dzZOPiuq=EUI+z zS&LmgOGM^hh>nzgX27psqn|a?`l>7Z z4)8UybyB&3B0!z<(25jR!#cGcjZ`VD?pe<;dZ?5ZZ0@h+Z!yI1<&{h5`}}!2`lIye zDAgg5e!D_uVa5!^$K1$dc2a2OzGSgg1#d$H7r0-eJ<~SO$Vj6>)6X;wu8fs9lC{qn zi}pIE2nC_mSTq?=%i({agRZ@lvKnv{W?(-%HBN zL^&WjO8F?U)o8aI7t*k3G}LA^z<)L~OQh&d6fW>bc5am8WyD6u1gfo_a}@I92tt$% z=i|v5L-d7_4E@@O$_AkSpUUQ8B&|G!#nZGV2Ekc6Y|O;DEl*blVe=<>%Q) zTm^i!VZuO1$3b>sgln7raR|wd^#km1uXcbRwi3Yklb_(#QL(>U6Oc|glM)dP4y>cq zKT=%$iA^92v%|#AC;M@_1s6#0mW3gbFm!()XZ!1dl<3ARLA3+d9OgB6=SigWRR{{4H@?rkOhcN18WCL z6%Vg)d-4K@dC}23-#>1QA3#5BlWrtG15&9YP%vBTQN8a4O{d^qLy(n)GBTf>1{>xUzsR;V!*b?)UGa+jdkaJy5+7Bl zdzYr){n&7J>YY1<3!R21F$^8@nuu=*mJG+)Ci{y1iEz3PEwmM5hdfmoIZNFWAgsPg zkNx%r=h+wmy827@;lU(O)s$5ZY=-`Ut3l=@ntk1H32a^c%jQh|+Q(h2sKJLskcGNb zH+OjVA9sp@r3NA*vE0||%Ve)&+md`xX&z<9O&egq)d=u=0ZA# zw}kO~TDSM(2^TKOts^3MKaU9?h2H`6Cebc!Gi&v03}y_P+}YzFw;i+ps0}G-dINgonk zjGU3ZOJxEOtQ?wbFTDqJpR35Ak80^LwnGR6G@f4HI3^Q)MUW;ZRu~p2$nI ztsxB!9C-c%lpS+{6+Tye@0ztaLB&%Fvpi!uZbq;bDM1w(F4bWCX_C+(3~UV3am9_gxS<%fY~cQ3=x1!>vY8ZgA@U;QXoI2# ze4ZE)%MEp=j94zbZXe0!=HgV~`ZHl2Ik}f5l+mWf99-3<5C|xn6_A{ObKyNC47|bW zO&vxRr7`v-Xmlu=;J z(48>wdmkR#{55oR%;vVj8O}SF8}Uqi_HEkzbXZ9bykt0sTnB$cbCz zB^=GD`+W7uv@CC0xP&G+q6{cLKWEAe4do)Q!iVUnNqU*;{&}xwh#t=JDj*%{$i z4&B8{#EGi*f<)B&C^)`S;jTlW+eFuVr6^B9YPE3egL$X%+Cx}-$@kw(6>MqtJs)nvWzio4fpkFo1F z!6Mp(e=h^KO>rI+(RfD1zei*?Y7+Qzq=3(rIOFd@q>&2}KB1Yce=12G&88g`{=y;7 z{$PZR2Twu%-uB^t!}3?Mp$|;eIc$uVnLSPYJFfh^|M@L-*3w2O1ADA*WWl&;7D~Vm zHz2MXx57j2}h-I(-I?VJ2W>-3aSJ8bF7OCculP233mPR?aX0IJ7I0`n zV${Vzc*RFLcW`gIHe6F7<(C-wyulYdXdc6* z&E-I#xRj_rde~y=tfCnXQR3kgwrmYprUVO%DdaH(}P(qCQ z`Pb$pM3GZ+cIwj99?n3VVJP&?#}%v0jEhgjHxFK}bhO4n_OW(-FoYucUmL{K;}NO< zW9I1dUJ!i_(mi|Q=x?2E&wSPJWh=&h*KO<2jFl-3+CA&-mF!3dlT>Q0K}9G3?;C{} z>&n7!J04cWZaxUeUY93-XUC3kCwgMBNf)-t>oSqd~-yUyL09Op9*OO%Tj%qa4TE`*&fDAZ9<{EnttssfG#()PJzxSG)> zzh>BE6@h6FB9%HTxRaCoBcTO3#xSK|vi6=Ev!Ecx)Co9DssB)Jh_n4K$Bi;1>dJVV zK%?j2ueeZf8}@O1#XuokLDYmj=Ldl=W--yu9JDCTI@w3Va6^Oq%#EF+mbLJ`Y)xY9 z?8im-_nH=@1;*yhO4bZho-MFgxeHsb!c%}nM6tA}{do&04q2H=8M!KIHd3}oarDw! z>JD)jXsM1`PejPr)$}vlK1`+o;ek5Dn=12Up%VF8PibjU>W!hPogwM2%Xn0=C!_me zWw%NpXZ54dj&UeKDh5=}jJ97`MqibYR2k=!9`BS&5Cnte9tFtZEaeNJQ z>ZgSX^I({V*j&9&1DfeZ#Dri+=7i{Xz}DaP<;PuN$eU&4Mf)UKt*M=H=B_JX#-%3<2=qs4ZzZi6CeN`duVZev5inbqD4bOG1Ql=?nQ{@yoTm8 zW{O{+6Z9pM`n+Rvx-glP^nQUi?NYY6L=#v_qHscSt0x*R1NXuiSv?KrlNOPC6YU&w zH;qRPRb0KEBiN81vfPidI=cIj^QAYZG!9=X@BR$O1` z?oUUsk^Ku@YO+5-<(MQV1&Zi+lkLYq?JY8&5fL-PF}G1deb#@*WEPv%Ubj;m1Y2@0 zx(anD^iINY)LJ874BCOsLsy`m{`fF{MCZn`Q~Qm(oe+qI_aJy!i9MEZrCK*ViEqO2 zmlSyV^nDO}+t%VSH05IgYze=k6+wKCV(U&FJ?#I_vom9)6z!%G8GsY}>)}{PEx{P# z4x9O$`TCb2MzC?elfd&PK2Vi;EYqbnA3I$9ODvbjM!8ek#~Df5`CZTnnKKhci)h&Q zemrfT#D+BxD?;2+MGhLD$8JNLS)2+ch1??drDcljFSVe<`SN{+xtJX6pjx>{yy>Nz z=wPJ!U~8zQ%wxnao0>m3(vUyO;aJl#Dr0KwNMfo}8dzKxG~M_nAPVZSqA2EUA|l{N zO785CAvFeCf5aW0Z+y}rMSFk?k+D6i>(q59#T-6<}X?0RW1!Dl)ZFW?%mYNjk6e diff --git a/docs/assets/images/swyfft.jpg b/docs/assets/images/swyfft.jpg new file mode 100644 index 0000000000000000000000000000000000000000..090caeecacd3712e00799df381ec0f1cf043bf4f GIT binary patch literal 6613 zcmb_g2UJr_w>}}Ew}jq8SCFEBAXN#1fFM0m6pAfReni6>7diCP}?sC1i)<5SYXV3n=z31#Rv(L<&qk*Fd0IH&RRS^Jz004wLfTLkR z9suLv9iO-Y!JYU-`1lYAJ_#Wq0TCGq85t=FDJeMx6_lI;MnOsnrGvt#X=rI_$tdX= z=x7+IXlQAUoq)hN8wfrzK0YxGIVm~K|GOO30x%-bBhVu-h!enrfxs}(Q9ZzdyGbzU zxBx#3J^>*Fj0YmZq0Bfn9uEEq;jUl^9swaf=x7Ka1LHs_7>bLuI8qLAg7XLQhSgAK z0XJnw)NF}{KZUEdRozzls_yw5@8xja2Iki>W`>~+-8Zp$b`<;aJ-M&GMof3LJYdfK zS&n{AYx{mzpAgBx7NCyC>4mFM?i&A$p9}G)3mvX*)_j>YZnr$Y-et5uqQoU^E zL)N{Im}g;vl&>En{VI(&KRXQNO3pvbO>*mF|75f0^M3qNv%jjszS}t(?;M8JHiHt4 zWy0mzm!A`cgd}C{)G{SrZD{O1v07inN@RXoF;i^HFnc=?&|3Y6NAj-_p8EX4eA4$X zJw`JL@yW9=o)LY^{@=ZT#Lf+@&^3=%8XRCRFv>5&&cSZ7=sP4Lesd^YlV|1 zM-PCFbF(J0I1jLNT1q(vqu3y*v-4+l7<5N z-fsj_eD4}ZL0@O-=KukH<6vVmZ=la_1d#FTfwSgsC^DS@pmy)O#QrI0)WmNL0ow0^ zBX0}(UiktHx7lvJSofb(OqPSlN8scFXU5gWE*c< zsJ#FPGXFxHWbkaU?@0>y8{qtX0szRut~7}8$`W7Zck<^hO zzy2>c;U(*N6TxRm-?Fspe}jQT-|MncUah7fq&jn{>YXw&3>6aXcF_M|{ciJrsj=bm znID&|5PUoWFfQkR*x=#bM*xUGOcN@Ed(+UJ7ll!?a|xq-arsSz%X<($-VvZ?Z%XwQ zn&b)Qbo7(u4pw{MY0T^9=b^SlEB0(N5ZI<`%Fo8>mBCl zp4hF04acCcxLCc%3Wr2l`H4DlP2wM4@XvRzE|Sv=^1Z$gQstH(eg@}c>e$Jy(_c<73S*T>y8JY~EOm;!!qZ<0JsxHC6)m-L|n@3;Z|WuOMDJ86*PakXFHygyFv z6^RDncau8_PEP%rqI{$j!dzAliquqng;cGO8`yhmwjX(}nWi%@_Jo9}$i+{N4TsoT z3)fr1XaZmNR=tDved3|M$_=6a?piY0&CS$L{20U`O|df~P3m(x-h6C0=&n-7*&!U5 z{bc;c#Y|5-Mn;yxTYe;n=+1@a#3eteCkaS%Y|9R%3~>nBNvzt<#o&Iq4RYyFDcGd^ zi!^4Z%#^`ynDk<$Jo&JR#k*jW3LAl)4Ki`t2gzd`K`U>HhU>y`c~F${5R7e4u8Uc6bb=o^jB?wq(9?R~wi z^bTBilXsIkg)Esxa@&A#*IOX0b&UeC)q3q_`g;F#n<(Ugt%?Eag+VT1*eWtw>M1w# zbv#Wk<-8`*X-fKoDBS4egaLTCY3{^)1HuDfR0uGXT9}!>+@Cpf(K*>O4M_(v435YO=E`<{WX`a2Lc zyewcEa0W4xBOos2XHxTKp!J?+5}X(uGQB61(ZTDqVX2?3zI)L$XL!P+zL)L3hQ6<+ zTO5Pg2e{&XaMfP&27P7h+9}WGURp^OQ;-J1R}p8*Hh)`a;&c&y;Aj{sDU2d@e?J8m z&;=L(!cF}6B=`{Uk8}g!@(sX;aZpjS3nQSkoFZ~s+UV4R^PepnwobF{JH==Qi7Ch2Vmi*^SW%&lr^+|8udax-tsh)^nOPjf zon5j^xvv`>-oj52j>^_8%@=z6Leg){opWfayp}FwPRTvDQqlB@RS?6pCX@W8=Fl$F zoSQeBjy4r^v*%fLVsVYBj*3n?%hI%61gkK*c)kgvAo9q`OYN4~JKFW2ATT-Reny?A zerhDrzHPE!=8;|d6=Tti#4y)SKObL52-=1mM-n8I^Y3VmI zMSEDzAqTFuIVe?$ww|%cnBkk3q*ievU_gooy7nwp@E_Z_do&^ohOCAi?5NF2AyZb) zgW1>UVjeePmf1mRR?~v#;S}5^@m=T%<;RKC@m}J_dP|ar*~84XB`+3}N_B^Bwh$re z`}n18oW>UUd*d{!Z%0p3#k_@Ny64`fsZ-jK-r+vL-)E(2q-VL4dtlSNN4hD)t>{d~ z@qV)Cw2keJ?w7*V>oz=UeLR&BnEHOfIyhmPICf9jM`V2F;?8Z|$2nSSlN<-FK96<> z9bdWqtv6gwrh+!8dYg@#ca%*Ebhj3YRfP;{)lb)?)izx`MXe?pME!iA+D6S$2X6fx zEj}now74asP^KK*jdohjaX0_CCL>eUF0al%KC1mfQqaQ=RXIt&k1y#K9MRI)l5rdE zcv>;4>dY03t4gvjWpM*b5(%tq zWfL0q^QanmU;pUTzu)QvvUu2biiej)TeQP!-Hnq+rDWdbbC}R6d=0MTi91I;`=D4Y z_q0wnxq5s0nU9k)1#TJw7f5PXP_!>@l{23VImk~YcQ_O^bDh@gKNfgJz4*~q0?tcm56>pf@te%B8tqZR8;(q| zi#PYLIED9XZRsg}6?^vtnO9ppCw8vq-R7qw;Pu9JHZdD>vA0iSo$i{64&| zq7!p2SuGp}m28H_Cg>(Ly!fVjcw>C~kS~2MKm27$Vd%4MxU&nhyRrs|{=vsd=a`-r z;>lwPrCVgFWSJ#M&=OSlS6y0Rx@~nWwW?V8s1$ku#k8fD*)OvZdr8#8% zSSsZ=C{8a<^zX9CvJrMOG@=K}3(L@Xz_%IB^-^B+>=_<3c4d`AwS|Y?)!jJzn#7Zc zSqb}E`-&-PcKQ*%OEfl-(?o0zJh!;c(m{JvVnN8L&<~V7obrf+;_y=4$YnFDsk*E2 z)Rl)GiiSM3J>KRB+u}jx0fMyXcp_Eh@#1x89EM7{uSaB(uJ00mqQ-z#HY3UjPda3c zUr)I;AbWI`ZBNW8yi{7vO-Jxr^P?%_F!MWZ5UC#R3GKkZ>YArYA;wn7skWGeHDK%YHXBdv zt4iAbL9jSMAgm?+3o!CT(K(-G6RxESBvsM%mw!w66ln9^Xg%^n-h##}uJg|oqk0qrr%s19cW-Ao)vMB&TYgJo zYhc%%@~5t^v3*+d8NO7vA}B{Zb&aOGcZk2<LBJr)iSfy}luY_A6kIM%7IITK33t93-+9 z@UUsmGiAyPFI&^O7bQ7&h#5{JtK)iBrnw@tCahV`FRF&k?7CIJgoq3o9a&a>dE?S-!EkiIC9db4wJN|orLB4uh2Q< zWYuQYg1rM4WaE7<#0T;`k;{QDi}GGcE{t`O+boYq9PBkBR~|=h^V*3x?J(AfZ^Qk4 zpv}|elkjrQaSM15s>4f(dzS^%J6&;Sx=MvP{FzW!h%2w*5Fp1cQLniXBK7$~S+UZo zGJYY>m=W3s?XPTE&$|qzNdaJB8Kdxm$uNy0m1C^HC8gB znRoamj@B5(hh31R;2hs-skwen3Nbc}y6`?N$T=te5fwmhD?*ykO&L2C!DdJ6$?$Lx z0T?sLikF*<7mf+bvjb#6)_q6MoUv`O1mY*W-IfL--tJYsS4Un?2qRF^P6YN& zx@7}5X!^l3Qy!94T{VjG$)KM0RS);~r3Smb?W-t8I-Q9ftjyS4zC?d;qRUrhML2gj z-s&gc@7dC;W*V-dC8q|z2~w!5oO`Y&9a7u{PWHEZY;Pn+P@pP0hREJbkv;H1ktQVlgE~#ODr>Z^1 zekM?^@h~>sPmsYs4^qx0bmNh$D5dM;i&h(0v6+3=u(1)W5f_ck!42IIhq=dYWPt$1 z)dH6KFN|&bJsT^hY-+w&A}DEX7_2JsSe~10$qkvfCOqW!C!fgkF;^+ODF3EH$i)>A zD$U*xO`VffQs-(>`jV%0Gi4?U_X_`OZJWs`v+T{GB^K3z~LMAem7RaYlhR*9?jOa!Jd^)m9CLrQ`omECAA8*Di35iFa0NQvXPlT05Kwku6An4F z)`@KfF1<9ZBJ%|oiG>8nmI71ZCTUEfXZVaE7DyU@5tDCBv}lU_^nzzMi~<1=Etk}D zAwTPIk}f|@OYIQ#tbBbCm3Gj>S&F*7ODz67HTacUeC+$~Qd_2Y#q#hkbM?DBTc${6 zs~3}D1bsKqA$7Y}#ZxHk(B_Fhca8Q}jH|{Z7x)cRZnJ+e_eI}qeKn>RNhR1W zHWU*TwObPlvs1YB%n}k~Bzi5`2_ZmPBsP{(e4T?-Vt_KoLMTB|=hau8R{HSv115LQ z?&vDM{1G#WUMm(FwQ!Wmn#Pbw7uRY&dyJ~0A4XxXz=gAEd7`q|0h=)c7>Vc!9svO? zqjXZ!i=x4Z8J?UJ8mPiq0)_P=Iw2AwusqL8&-Z;Wv$~>t>kpGM2&F34!oNwv(Zh{6 zg@3?<_nqC#vtNc}*cC5RSGeZw(-7b5<%XVjv$Z4ZZ}QBHyTm9kvd?6_SnG0&71uFpeXTRg>b>Ls3 zB5vdC7R_4m<&MYn0-7QCj@9D#RJECmss&@z)@36w{rcQ??X!{wxz?4=2S-4@+=vI^ zY(PHrqjl88a@DEJ1vfvm`QSR8AByXA5CH++uTME3m=*xVb^E%Iriov4D!PCjQG@dB zp8R{w50b@o`{^dbPYP*wRsCgy3)=kcC2AmM!VIS-@vg2ng@c91ru!s=m%?fx>ZvMb zB>DCi10m7ujj=VSj5JPbofq7s7mMb78Z!}wC*a7AX%jMGXj3G1Lj>T5a?0~~MrqY6 zA&sD10H8<>3mwyE%;p5M>Orn|Bqf~JFyd#n)m!Pmy>=M(E>wKg`NR9({YMSMdLYmD zn8gqG(y;H7CGTDsdOe);VH`_uPh&r_?BkWW#Su~R3UAj-yw|(?%6Bgr?GArDA;aN9 z@<~{S5#eo}z=HVly#9 zzXCVcsC~2KH+wl54qXF`U(6&@menN#!>X!th;MryHftu_FRAdt(3PV6GSE9m+o zXPfLv=$w{prIbElsRWo^R2Dv!$rli4yyrwCx@AfjI8~YY^&VUDhR&0!=)krkpy-ob z06`cHAy$vJf5M(t62U{tr(ER0+9y^5E{PXM_8U>)xI`f!;kLzz*8auXF+K-}&qP$b zm-qc>l36!&9%pUTS_?(486C@bzNegu6zE1mgk3HCFYG``a$|$ZIcSqZ>6-@2>q#8$ zMr=1{PWFl{3 z^L6B!%PK7Wu*kTjk$As%E=5!}4(Pf)vMvYaoNkd@qFPc4@F%hfT0H_3u#O5WAEi6G zU7&EsSAJa*7G#crbm+~ieYnMvpJ9;K<3XlDMjCU&G2{69B;cdoDSPb-gd&*h6t>?8U_=ns-+rz(dRpGIu!lW!Ww^&L04V(=Ainm xa4@3!lBDsRhOz;tc1o8`asKjzS6(i?U;K7F>vR2XKd`=LJY`=eR`h7_e*m|aQpo@S literal 0 HcmV?d00001 From 8192206e3931b8b3d43f058256bc9a47312fee7c Mon Sep 17 00:00:00 2001 From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> Date: Sun, 3 Sep 2023 16:06:18 +0200 Subject: [PATCH 020/845] Remove obsolete `OrEqualTo` methods (#2269) * Remove obsolete `OrEqualTo`: `GenericCollectionAssertions` * Remove obsolete `OrEqualTo`: `ComparableTypeAssertions` * Remove obsolete `OrEqualTo`: `SimpleTimeSpanAssertions` * Remove obsolete `OrEqualTo`: `ExecutionTimeAssertions` * Remove obsolete `OrEqualTo`: `NumericAssertions` * Accept API changes * Update releases.md Co-authored-by: Jonas Nyrup * Fix migration docs --------- Co-authored-by: Jonas Nyrup --- .../Collections/GenericCollectionAssertions.cs | 9 --------- .../Numeric/ComparableTypeAssertions.cs | 9 --------- Src/FluentAssertions/Numeric/NumericAssertions.cs | 9 --------- .../Primitives/SimpleTimeSpanAssertions.cs | 9 --------- .../Specialized/ExecutionTimeAssertions.cs | 9 --------- .../FluentAssertions/net47.verified.txt | 10 ---------- .../FluentAssertions/net6.0.verified.txt | 10 ---------- .../FluentAssertions/netcoreapp2.1.verified.txt | 10 ---------- .../FluentAssertions/netcoreapp3.0.verified.txt | 10 ---------- .../FluentAssertions/netstandard2.0.verified.txt | 10 ---------- .../FluentAssertions/netstandard2.1.verified.txt | 10 ---------- .../Specialized/ExecutionTimeAssertionsSpecs.cs | 2 +- docs/_data/mstest-migration/assert.yml | 8 ++++---- docs/_pages/releases.md | 14 +++++++++++++- 14 files changed, 18 insertions(+), 111 deletions(-) diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index 5bdf109569..83d70c43b4 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; @@ -1459,10 +1458,6 @@ public AndConstraint HaveCountGreaterThanOrEqualTo(int expected, st return new AndConstraint((TAssertions)this); } - [EditorBrowsable(EditorBrowsableState.Never)] - public AndConstraint HaveCountGreaterOrEqualTo(int expected, string because = "", params object[] becauseArgs) => - HaveCountGreaterThanOrEqualTo(expected, because, becauseArgs); - /// /// Asserts that the number of items in the collection is greater than the supplied amount. /// @@ -1521,10 +1516,6 @@ public AndConstraint HaveCountLessThanOrEqualTo(int expected, strin return new AndConstraint((TAssertions)this); } - [EditorBrowsable(EditorBrowsableState.Never)] - public AndConstraint HaveCountLessOrEqualTo(int expected, string because = "", params object[] becauseArgs) => - HaveCountLessThanOrEqualTo(expected, because, becauseArgs); - /// /// Asserts that the number of items in the collection is less than the supplied amount. /// diff --git a/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs b/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs index 79558d964a..a847069d59 100644 --- a/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs +++ b/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics; using System.Linq; using FluentAssertions.Common; @@ -247,10 +246,6 @@ public AndConstraint BeLessThanOrEqualTo(T expected, string because return new AndConstraint((TAssertions)this); } - [EditorBrowsable(EditorBrowsableState.Never)] - public AndConstraint BeLessOrEqualTo(T expected, string because = "", params object[] becauseArgs) => - BeLessThanOrEqualTo(expected, because, becauseArgs); - /// /// Asserts that the subject is greater than another object according to its implementation of . /// @@ -297,10 +292,6 @@ public AndConstraint BeGreaterThanOrEqualTo(T expected, string beca return new AndConstraint((TAssertions)this); } - [EditorBrowsable(EditorBrowsableState.Never)] - public AndConstraint BeGreaterOrEqualTo(T expected, string because = "", params object[] becauseArgs) => - BeGreaterThanOrEqualTo(expected, because, becauseArgs); - /// /// Asserts that a value is within a range. /// diff --git a/Src/FluentAssertions/Numeric/NumericAssertions.cs b/Src/FluentAssertions/Numeric/NumericAssertions.cs index d0b1b16eb2..bea05d044f 100644 --- a/Src/FluentAssertions/Numeric/NumericAssertions.cs +++ b/Src/FluentAssertions/Numeric/NumericAssertions.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics; using System.Linq; using System.Linq.Expressions; @@ -226,10 +225,6 @@ public AndConstraint BeLessThanOrEqualTo(T expected, string because return new AndConstraint((TAssertions)this); } - [EditorBrowsable(EditorBrowsableState.Never)] - public AndConstraint BeLessOrEqualTo(T expected, string because = "", params object[] becauseArgs) => - BeLessThanOrEqualTo(expected, because, becauseArgs); - /// /// Asserts that the numeric value is greater than the specified value. /// @@ -288,10 +283,6 @@ public AndConstraint BeGreaterThanOrEqualTo(T expected, string beca return new AndConstraint((TAssertions)this); } - [EditorBrowsable(EditorBrowsableState.Never)] - public AndConstraint BeGreaterOrEqualTo(T expected, string because = "", params object[] becauseArgs) => - BeGreaterThanOrEqualTo(expected, because, becauseArgs); - /// /// Asserts that a value is within a range. /// diff --git a/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs b/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs index 9612a6e23b..c33d8ea3d2 100644 --- a/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs +++ b/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs @@ -1,5 +1,4 @@ using System; -using System.ComponentModel; using System.Diagnostics; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -165,10 +164,6 @@ public AndConstraint BeLessThanOrEqualTo(TimeSpan expected, string return new AndConstraint((TAssertions)this); } - [EditorBrowsable(EditorBrowsableState.Never)] - public AndConstraint BeLessOrEqualTo(TimeSpan expected, string because = "", params object[] becauseArgs) => - BeLessThanOrEqualTo(expected, because, becauseArgs); - /// /// Asserts that the time difference of the current is greater than the /// specified time. @@ -214,10 +209,6 @@ public AndConstraint BeGreaterThanOrEqualTo(TimeSpan expected, stri return new AndConstraint((TAssertions)this); } - [EditorBrowsable(EditorBrowsableState.Never)] - public AndConstraint BeGreaterOrEqualTo(TimeSpan expected, string because = "", params object[] becauseArgs) => - BeGreaterThanOrEqualTo(expected, because, becauseArgs); - /// /// Asserts that the current is within the specified time /// from the specified value. diff --git a/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs b/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs index 16e5b24970..8d3a148195 100644 --- a/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs @@ -1,5 +1,4 @@ using System; -using System.ComponentModel; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -87,10 +86,6 @@ public AndConstraint BeLessThanOrEqualTo(TimeSpan maxDu return new AndConstraint(this); } - [EditorBrowsable(EditorBrowsableState.Never)] - public AndConstraint BeLessOrEqualTo(TimeSpan maxDuration, string because = "", - params object[] becauseArgs) => BeLessThanOrEqualTo(maxDuration, because, becauseArgs); - /// /// Asserts that the execution time of the operation is less than a specified amount of time. /// @@ -152,10 +147,6 @@ public AndConstraint BeGreaterThanOrEqualTo(TimeSpan mi return new AndConstraint(this); } - [EditorBrowsable(EditorBrowsableState.Never)] - public AndConstraint BeGreaterOrEqualTo(TimeSpan minDuration, string because = "", - params object[] becauseArgs) => BeGreaterThanOrEqualTo(minDuration, because, becauseArgs); - /// /// Asserts that the execution time of the operation is greater than a specified amount of time. /// diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index df07ccb123..6880ab6fb2 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -423,10 +423,8 @@ namespace FluentAssertions.Collections public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCount(System.Linq.Expressions.Expression> countPredicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountGreaterOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThan(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountLessOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountLessThan(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountLessThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElementAt(int index, T element, string because = "", params object[] becauseArgs) { } @@ -1587,11 +1585,9 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint Be(T 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 BeGreaterOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } - 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) { } @@ -1630,11 +1626,9 @@ namespace FluentAssertions.Numeric public T? Subject { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } - 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 BeNegative(string because = "", params object[] becauseArgs) { } @@ -2000,10 +1994,8 @@ namespace FluentAssertions.Primitives public System.TimeSpan? Subject { get; } public FluentAssertions.AndConstraint Be(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNegative(string because = "", params object[] becauseArgs) { } @@ -2178,10 +2170,8 @@ namespace FluentAssertions.Specialized { public ExecutionTimeAssertions(FluentAssertions.Specialized.ExecutionTime executionTime) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan expectedDuration, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index fa362b74a4..8522a926f3 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -436,10 +436,8 @@ namespace FluentAssertions.Collections public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCount(System.Linq.Expressions.Expression> countPredicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountGreaterOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThan(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountLessOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountLessThan(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountLessThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElementAt(int index, T element, string because = "", params object[] becauseArgs) { } @@ -1612,11 +1610,9 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint Be(T 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 BeGreaterOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } - 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) { } @@ -1655,11 +1651,9 @@ namespace FluentAssertions.Numeric public T? Subject { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } - 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 BeNegative(string because = "", params object[] becauseArgs) { } @@ -2084,10 +2078,8 @@ namespace FluentAssertions.Primitives public System.TimeSpan? Subject { get; } public FluentAssertions.AndConstraint Be(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNegative(string because = "", params object[] becauseArgs) { } @@ -2299,10 +2291,8 @@ namespace FluentAssertions.Specialized { public ExecutionTimeAssertions(FluentAssertions.Specialized.ExecutionTime executionTime) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan expectedDuration, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt index 4bc84b35de..03d67070e2 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt @@ -423,10 +423,8 @@ namespace FluentAssertions.Collections public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCount(System.Linq.Expressions.Expression> countPredicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountGreaterOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThan(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountLessOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountLessThan(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountLessThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElementAt(int index, T element, string because = "", params object[] becauseArgs) { } @@ -1587,11 +1585,9 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint Be(T 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 BeGreaterOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } - 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) { } @@ -1630,11 +1626,9 @@ namespace FluentAssertions.Numeric public T? Subject { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } - 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 BeNegative(string because = "", params object[] becauseArgs) { } @@ -2000,10 +1994,8 @@ namespace FluentAssertions.Primitives public System.TimeSpan? Subject { get; } public FluentAssertions.AndConstraint Be(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNegative(string because = "", params object[] becauseArgs) { } @@ -2178,10 +2170,8 @@ namespace FluentAssertions.Specialized { public ExecutionTimeAssertions(FluentAssertions.Specialized.ExecutionTime executionTime) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan expectedDuration, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt index 4bc84b35de..03d67070e2 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt @@ -423,10 +423,8 @@ namespace FluentAssertions.Collections public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCount(System.Linq.Expressions.Expression> countPredicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountGreaterOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThan(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountLessOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountLessThan(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountLessThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElementAt(int index, T element, string because = "", params object[] becauseArgs) { } @@ -1587,11 +1585,9 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint Be(T 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 BeGreaterOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } - 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) { } @@ -1630,11 +1626,9 @@ namespace FluentAssertions.Numeric public T? Subject { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } - 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 BeNegative(string because = "", params object[] becauseArgs) { } @@ -2000,10 +1994,8 @@ namespace FluentAssertions.Primitives public System.TimeSpan? Subject { get; } public FluentAssertions.AndConstraint Be(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNegative(string because = "", params object[] becauseArgs) { } @@ -2178,10 +2170,8 @@ namespace FluentAssertions.Specialized { public ExecutionTimeAssertions(FluentAssertions.Specialized.ExecutionTime executionTime) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan expectedDuration, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 40554f2caf..fa2e87cfa7 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -416,10 +416,8 @@ namespace FluentAssertions.Collections public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCount(System.Linq.Expressions.Expression> countPredicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountGreaterOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThan(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountLessOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountLessThan(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountLessThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElementAt(int index, T element, string because = "", params object[] becauseArgs) { } @@ -1538,11 +1536,9 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint Be(T 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 BeGreaterOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } - 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) { } @@ -1581,11 +1577,9 @@ namespace FluentAssertions.Numeric public T? Subject { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } - 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 BeNegative(string because = "", params object[] becauseArgs) { } @@ -1951,10 +1945,8 @@ namespace FluentAssertions.Primitives public System.TimeSpan? Subject { get; } public FluentAssertions.AndConstraint Be(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNegative(string because = "", params object[] becauseArgs) { } @@ -2129,10 +2121,8 @@ namespace FluentAssertions.Specialized { public ExecutionTimeAssertions(FluentAssertions.Specialized.ExecutionTime executionTime) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan expectedDuration, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 4bc84b35de..03d67070e2 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -423,10 +423,8 @@ namespace FluentAssertions.Collections public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCount(System.Linq.Expressions.Expression> countPredicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountGreaterOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThan(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountLessOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountLessThan(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountLessThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElementAt(int index, T element, string because = "", params object[] becauseArgs) { } @@ -1587,11 +1585,9 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint Be(T 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 BeGreaterOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } - 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) { } @@ -1630,11 +1626,9 @@ namespace FluentAssertions.Numeric public T? Subject { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } - 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 BeNegative(string because = "", params object[] becauseArgs) { } @@ -2000,10 +1994,8 @@ namespace FluentAssertions.Primitives public System.TimeSpan? Subject { get; } public FluentAssertions.AndConstraint Be(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNegative(string because = "", params object[] becauseArgs) { } @@ -2178,10 +2170,8 @@ namespace FluentAssertions.Specialized { public ExecutionTimeAssertions(FluentAssertions.Specialized.ExecutionTime executionTime) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan expectedDuration, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } diff --git a/Tests/FluentAssertions.Specs/Specialized/ExecutionTimeAssertionsSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/ExecutionTimeAssertionsSpecs.cs index 74af166f13..d1cd1bff84 100644 --- a/Tests/FluentAssertions.Specs/Specialized/ExecutionTimeAssertionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/ExecutionTimeAssertionsSpecs.cs @@ -95,7 +95,7 @@ public void Actions_with_brackets_fail_with_correctly_formatted_message() // Act Action act = () => - subject.ExecutionTimeOf(s => s.AddRange(new object[] { })).Should().BeLessOrEqualTo(1.Nanoseconds()); + subject.ExecutionTimeOf(s => s.AddRange(new object[] { })).Should().BeLessThanOrEqualTo(1.Nanoseconds()); // Assert act.Should().ThrowExactly() diff --git a/docs/_data/mstest-migration/assert.yml b/docs/_data/mstest-migration/assert.yml index 8e43dc0cf4..35f1b2bbe2 100644 --- a/docs/_data/mstest-migration/assert.yml +++ b/docs/_data/mstest-migration/assert.yml @@ -246,7 +246,7 @@ Assert.IsFalse(actual > expected); new: | - actual.Should().BeLessOrEqualTo(expected); + actual.Should().BeLessThanOrEqualTo(expected); old-message: | Assert.IsFalse failed. @@ -258,7 +258,7 @@ Assert.IsTrue(actual >= expected); new: | - actual.Should().BeGreaterOrEqualTo(expected); + actual.Should().BeGreaterThanOrEqualTo(expected); old-message: | Assert.IsTrue failed. @@ -294,7 +294,7 @@ Assert.IsFalse(actual < expected); new: | - actual.Should().BeGreaterOrEqualTo(expected); + actual.Should().BeGreaterThanOrEqualTo(expected); old-message: | Assert.IsFalse failed. @@ -306,7 +306,7 @@ Assert.IsTrue(actual <= expected); new: | - actual.Should().BeLessOrEqualTo(expected); + actual.Should().BeLessThanOrEqualTo(expected); old-message: | Assert.IsTrue failed. diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index bfdac56010..d968a51573 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -16,8 +16,20 @@ sidebar: ### Fixes ### Breaking Changes (for users) - * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) +* Removed obsolete `...OrEqualTo` methods - [#2269](https://github.com/fluentassertions/fluentassertions/pull/2269) + * `GenericCollectionAssertions` + * `HaveCountGreaterOrEqualTo`: Use `HaveCountGreaterThanOrEqualTo` + * `HaveCountLessOrEqualTo`: Use `HaveCountLessThanOrEqualTo` + * `ComparableTypeAssertions` + * `BeGreaterOrEqualTo`: Use `BeGreaterThanOrEqualTo` + * `BeLessOrEqualTo`: Use `BeLessThanOrEqualTo` + * `SimpleTimeSpanAssertions` + * `BeGreaterOrEqualTo`: Use `BeGreaterThanOrEqualTo` + * `BeLessOrEqualTo`: Use `BeLessThanOrEqualTo` + * `ExecutionTimeAssertions` + * `BeGreaterOrEqualTo`: Use `BeGreaterThanOrEqualTo` + * `BeLessOrEqualTo`: Use `BeLessThanOrEqualTo` ### Breaking Changes (for extensions) From cd28a5280303f39618171d5fb81067b4755ee058 Mon Sep 17 00:00:00 2001 From: Joel Wakefield Date: Thu, 7 Sep 2023 13:15:19 -0600 Subject: [PATCH 021/845] added missing parenthesis in docs --- docs/_pages/collections.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_pages/collections.md b/docs/_pages/collections.md index a347e0a41f..a0a4d9cc36 100644 --- a/docs/_pages/collections.md +++ b/docs/_pages/collections.md @@ -162,9 +162,9 @@ Consider for instance two collections that contain some kind of domain entity pe Since the actual object instance is different, if you want to make sure a particular property was properly persisted, you usually do something like this: ```csharp -persistedCustomers.Select(c => c.Name).Should().Equal(customers.Select(c => c.Name); -persistedCustomers.Select(c => c.Name).Should().StartWith(customers.Select(c => c.Name); -persistedCustomers.Select(c => c.Name).Should().EndWith(customers.Select(c => c.Name); +persistedCustomers.Select(c => c.Name).Should().Equal(customers.Select(c => c.Name)); +persistedCustomers.Select(c => c.Name).Should().StartWith(customers.Select(c => c.Name)); +persistedCustomers.Select(c => c.Name).Should().EndWith(customers.Select(c => c.Name)); ``` With these new overloads, you can rewrite them into: From 8007f039da92f664397c6e1686fa4807e62c108c Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 27 Aug 2023 18:24:19 +0200 Subject: [PATCH 022/845] Remove SpacesPerIndentionLevel --- Src/FluentAssertions/Formatting/DefaultValueFormatter.cs | 6 ------ .../ApprovedApi/FluentAssertions/net47.verified.txt | 1 - .../ApprovedApi/FluentAssertions/net6.0.verified.txt | 1 - .../ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt | 1 - .../ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt | 1 - .../FluentAssertions/netstandard2.0.verified.txt | 1 - .../FluentAssertions/netstandard2.1.verified.txt | 1 - Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs | 2 -- docs/_pages/extensibility.md | 3 --- docs/_pages/releases.md | 1 + 10 files changed, 1 insertion(+), 17 deletions(-) diff --git a/Src/FluentAssertions/Formatting/DefaultValueFormatter.cs b/Src/FluentAssertions/Formatting/DefaultValueFormatter.cs index 723b04cbff..92f946a4f1 100644 --- a/Src/FluentAssertions/Formatting/DefaultValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/DefaultValueFormatter.cs @@ -8,12 +8,6 @@ namespace FluentAssertions.Formatting; public class DefaultValueFormatter : IValueFormatter { - /// - /// The number of spaces to indent the members of this object by. - /// - /// The default value is 3. - protected virtual int SpacesPerIndentionLevel => 3; - /// /// Determines whether this instance can handle the specified value. /// diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 6880ab6fb2..f5175ba831 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -1359,7 +1359,6 @@ namespace FluentAssertions.Formatting public class DefaultValueFormatter : FluentAssertions.Formatting.IValueFormatter { public DefaultValueFormatter() { } - protected virtual int SpacesPerIndentionLevel { get; } public virtual bool CanHandle(object value) { } public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } protected virtual System.Reflection.MemberInfo[] GetMembers(System.Type type) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 8522a926f3..c2e3b913b1 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -1378,7 +1378,6 @@ namespace FluentAssertions.Formatting public class DefaultValueFormatter : FluentAssertions.Formatting.IValueFormatter { public DefaultValueFormatter() { } - protected virtual int SpacesPerIndentionLevel { get; } public virtual bool CanHandle(object value) { } public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } protected virtual System.Reflection.MemberInfo[] GetMembers(System.Type type) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt index 03d67070e2..a22a0160eb 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt @@ -1359,7 +1359,6 @@ namespace FluentAssertions.Formatting public class DefaultValueFormatter : FluentAssertions.Formatting.IValueFormatter { public DefaultValueFormatter() { } - protected virtual int SpacesPerIndentionLevel { get; } public virtual bool CanHandle(object value) { } public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } protected virtual System.Reflection.MemberInfo[] GetMembers(System.Type type) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt index 03d67070e2..a22a0160eb 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt @@ -1359,7 +1359,6 @@ namespace FluentAssertions.Formatting public class DefaultValueFormatter : FluentAssertions.Formatting.IValueFormatter { public DefaultValueFormatter() { } - protected virtual int SpacesPerIndentionLevel { get; } public virtual bool CanHandle(object value) { } public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } protected virtual System.Reflection.MemberInfo[] GetMembers(System.Type type) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index fa2e87cfa7..c4c1fdc6c8 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -1310,7 +1310,6 @@ namespace FluentAssertions.Formatting public class DefaultValueFormatter : FluentAssertions.Formatting.IValueFormatter { public DefaultValueFormatter() { } - protected virtual int SpacesPerIndentionLevel { get; } public virtual bool CanHandle(object value) { } public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } protected virtual System.Reflection.MemberInfo[] GetMembers(System.Type type) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 03d67070e2..a22a0160eb 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -1359,7 +1359,6 @@ namespace FluentAssertions.Formatting public class DefaultValueFormatter : FluentAssertions.Formatting.IValueFormatter { public DefaultValueFormatter() { } - protected virtual int SpacesPerIndentionLevel { get; } public virtual bool CanHandle(object value) { } public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } protected virtual System.Reflection.MemberInfo[] GetMembers(System.Type type) { } diff --git a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs index e31201a92f..76871e0b6e 100644 --- a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs +++ b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs @@ -1169,8 +1169,6 @@ private class CustomClass private class CustomClassValueFormatter : DefaultValueFormatter { - protected override int SpacesPerIndentionLevel => 8; - public override bool CanHandle(object value) => value is CustomClass; protected override MemberInfo[] GetMembers(Type type) diff --git a/docs/_pages/extensibility.md b/docs/_pages/extensibility.md index ba8c06e569..dc4fc52bec 100644 --- a/docs/_pages/extensibility.md +++ b/docs/_pages/extensibility.md @@ -139,7 +139,6 @@ public class DirectoryInfoValueFormatter : IValueFormatter Say you want to customize the formatting of your `CustomClass` type to: -* Increase the indentation from the default 3 to 8, * Exclude all `string` members and * Exclude the namespace of the type. @@ -148,8 +147,6 @@ An easy way to achieve this is by extending the `DefaultValueFormatter`. ```csharp class CustomClassFormatter : DefaultValueFormatter { - protected override int SpacesPerIndentionLevel => 8; - public override bool CanHandle(object value) => value is CustomClass; protected override MemberInfo[] GetMembers(Type type) => diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index d968a51573..0dfd14a7b6 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -30,6 +30,7 @@ sidebar: * `ExecutionTimeAssertions` * `BeGreaterOrEqualTo`: Use `BeGreaterThanOrEqualTo` * `BeLessOrEqualTo`: Use `BeLessThanOrEqualTo` +* Removed the `DefaultValueFormatter.SpacesPerIndentionLevel` property which was added during the development of v6, but wasn't removed before the release of v6 - [#2281](https://github.com/fluentassertions/fluentassertions/pull/2281) ### Breaking Changes (for extensions) From c54921d260b602695d519a6ce0e19311910f4ebb Mon Sep 17 00:00:00 2001 From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> Date: Mon, 11 Sep 2023 18:19:58 +0200 Subject: [PATCH 023/845] Optimize the PR-help-options in issue templates --- .github/ISSUE_TEMPLATE/01_bug_report.yml | 7 ++++--- .github/ISSUE_TEMPLATE/02_api_proposal.yml | 8 +++++--- .github/ISSUE_TEMPLATE/03_general_feature.yml | 7 ++++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.yml b/.github/ISSUE_TEMPLATE/01_bug_report.yml index 550bfb0378..febe299c00 100644 --- a/.github/ISSUE_TEMPLATE/01_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/01_bug_report.yml @@ -104,10 +104,11 @@ body: - type: dropdown id: pull-request attributes: - label: Could you help with a pull-request? - description: Make sure you have read the sections about [contributing changes](https://github.com/fluentassertions/fluentassertions/blob/develop/CONTRIBUTING.md#contributing-changes) and [dos and don'ts](https://github.com/fluentassertions/fluentassertions/blob/develop/CONTRIBUTING.md#dos-and-donts). + label: Are you willing to help with a pull-request? + description: | + Make sure you have read the sections about [contributing changes](https://github.com/fluentassertions/fluentassertions/blob/develop/CONTRIBUTING.md#contributing-changes) and [dos and don'ts](https://github.com/fluentassertions/fluentassertions/blob/develop/CONTRIBUTING.md#dos-and-donts). options: - "No" - - "Yes" + - "Yes, please assign this issue to me." validations: required: true diff --git a/.github/ISSUE_TEMPLATE/02_api_proposal.yml b/.github/ISSUE_TEMPLATE/02_api_proposal.yml index 882af545ad..375ae1a78c 100644 --- a/.github/ISSUE_TEMPLATE/02_api_proposal.yml +++ b/.github/ISSUE_TEMPLATE/02_api_proposal.yml @@ -70,10 +70,12 @@ body: - type: dropdown id: pull-request attributes: - label: Could you help with a proof-of-concept (as PR in that or a separate repo) first and as pull-request later on? - description: This is mainly to help demonstrate your suggestion. Please also make sure you have read the sections about [contributing changes](https://github.com/fluentassertions/fluentassertions/blob/develop/CONTRIBUTING.md#contributing-changes) and [dos and don'ts](https://github.com/fluentassertions/fluentassertions/blob/develop/CONTRIBUTING.md#dos-and-donts). + label: Are you willing to help with a proof-of-concept (as PR in that or a separate repo) first and as pull-request later on? + description: | + This is mainly to help demonstrate your suggestion. + Please also make sure you have read the sections about [contributing changes](https://github.com/fluentassertions/fluentassertions/blob/develop/CONTRIBUTING.md#contributing-changes) and [dos and don'ts](https://github.com/fluentassertions/fluentassertions/blob/develop/CONTRIBUTING.md#dos-and-donts). options: - "No" - - "Yes" + - "Yes, please assign this issue to me." validations: required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/03_general_feature.yml b/.github/ISSUE_TEMPLATE/03_general_feature.yml index 6a6471b8cb..211c325acd 100644 --- a/.github/ISSUE_TEMPLATE/03_general_feature.yml +++ b/.github/ISSUE_TEMPLATE/03_general_feature.yml @@ -27,10 +27,11 @@ body: - type: dropdown id: pull-request attributes: - label: Could you help with a pull-request? - description: Make sure you have read the sections about [contributing changes](https://github.com/fluentassertions/fluentassertions/blob/develop/CONTRIBUTING.md#contributing-changes) and [dos and don'ts](https://github.com/fluentassertions/fluentassertions/blob/develop/CONTRIBUTING.md#dos-and-donts). + label: Are you willing help with a pull-request? + description: | + Make sure you have read the sections about [contributing changes](https://github.com/fluentassertions/fluentassertions/blob/develop/CONTRIBUTING.md#contributing-changes) and [dos and don'ts](https://github.com/fluentassertions/fluentassertions/blob/develop/CONTRIBUTING.md#dos-and-donts). options: - "No" - - "Yes" + - "Yes, please assign this issue to me." validations: required: true \ No newline at end of file From b0f8abb5b22f2b319ddeabb89621e442f3e8a701 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Thu, 14 Sep 2023 01:12:21 +0800 Subject: [PATCH 024/845] Update FluentAssertions.csproj (#2300) simplify InternalsVisibleTo --- Src/FluentAssertions/FluentAssertions.csproj | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index d8c90190d5..61b8873c74 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -11,6 +11,7 @@ $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb true true + 00240000048000009400000006020000002400005253413100040000010001002d25ff515c85b13ba08f61d466cff5d80a7f28ba197bbf8796085213e7a3406f970d2a4874932fed35db546e89af2da88c194bf1b7f7ac70de7988c78406f7629c547283061282a825616eb7eb48a9514a7570942936020a9bb37dca9ff60b778309900851575614491c6d25018fadb75828f4c7a17bf2d7dc86e7b6eafc5d8f @@ -33,15 +34,9 @@ - - <_Parameter1>FluentAssertions.Specs, PublicKey=00240000048000009400000006020000002400005253413100040000010001002d25ff515c85b13ba08f61d466cff5d80a7f28ba197bbf8796085213e7a3406f970d2a4874932fed35db546e89af2da88c194bf1b7f7ac70de7988c78406f7629c547283061282a825616eb7eb48a9514a7570942936020a9bb37dca9ff60b778309900851575614491c6d25018fadb75828f4c7a17bf2d7dc86e7b6eafc5d8f - - - <_Parameter1>FluentAssertions.Equivalency.Specs, PublicKey=00240000048000009400000006020000002400005253413100040000010001002d25ff515c85b13ba08f61d466cff5d80a7f28ba197bbf8796085213e7a3406f970d2a4874932fed35db546e89af2da88c194bf1b7f7ac70de7988c78406f7629c547283061282a825616eb7eb48a9514a7570942936020a9bb37dca9ff60b778309900851575614491c6d25018fadb75828f4c7a17bf2d7dc86e7b6eafc5d8f - - - <_Parameter1>Benchmarks, PublicKey=00240000048000009400000006020000002400005253413100040000010001002d25ff515c85b13ba08f61d466cff5d80a7f28ba197bbf8796085213e7a3406f970d2a4874932fed35db546e89af2da88c194bf1b7f7ac70de7988c78406f7629c547283061282a825616eb7eb48a9514a7570942936020a9bb37dca9ff60b778309900851575614491c6d25018fadb75828f4c7a17bf2d7dc86e7b6eafc5d8f - + + + From bb50da5f1539a35cba0f3108e8a12b2e74a9a94a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sat, 16 Sep 2023 18:14:19 +0200 Subject: [PATCH 025/845] Refactor `StringValidator` to avoid inheritance (#2296) --- .../Primitives/IStringComparisonStrategy.cs | 19 ++++ .../Primitives/NegatedStringStartStrategy.cs | 33 +++++++ .../Primitives/NegatedStringStartValidator.cs | 43 --------- .../Primitives/StringAssertions.cs | 91 +++++++++++-------- .../Primitives/StringEqualityStrategy.cs | 87 ++++++++++++++++++ .../Primitives/StringEqualityValidator.cs | 88 ------------------ .../Primitives/StringStartStrategy.cs | 49 ++++++++++ .../Primitives/StringStartValidator.cs | 54 ----------- .../Primitives/StringValidator.cs | 75 +++++---------- ...r.cs => StringWildcardMatchingStrategy.cs} | 33 +++---- 10 files changed, 285 insertions(+), 287 deletions(-) create mode 100644 Src/FluentAssertions/Primitives/IStringComparisonStrategy.cs create mode 100644 Src/FluentAssertions/Primitives/NegatedStringStartStrategy.cs delete mode 100644 Src/FluentAssertions/Primitives/NegatedStringStartValidator.cs create mode 100644 Src/FluentAssertions/Primitives/StringEqualityStrategy.cs delete mode 100644 Src/FluentAssertions/Primitives/StringEqualityValidator.cs create mode 100644 Src/FluentAssertions/Primitives/StringStartStrategy.cs delete mode 100644 Src/FluentAssertions/Primitives/StringStartValidator.cs rename Src/FluentAssertions/Primitives/{StringWildcardMatchingValidator.cs => StringWildcardMatchingStrategy.cs} (69%) diff --git a/Src/FluentAssertions/Primitives/IStringComparisonStrategy.cs b/Src/FluentAssertions/Primitives/IStringComparisonStrategy.cs new file mode 100644 index 0000000000..da95c7ccbb --- /dev/null +++ b/Src/FluentAssertions/Primitives/IStringComparisonStrategy.cs @@ -0,0 +1,19 @@ +using FluentAssertions.Execution; + +namespace FluentAssertions.Primitives; + +/// +/// The strategy used for comparing two s. +/// +internal interface IStringComparisonStrategy +{ + /// + /// The prefix for the message when the assertion fails. + /// + string ExpectationDescription { get; } + + /// + /// Asserts that the matches the value. + /// + void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected); +} diff --git a/Src/FluentAssertions/Primitives/NegatedStringStartStrategy.cs b/Src/FluentAssertions/Primitives/NegatedStringStartStrategy.cs new file mode 100644 index 0000000000..32e3429e2b --- /dev/null +++ b/Src/FluentAssertions/Primitives/NegatedStringStartStrategy.cs @@ -0,0 +1,33 @@ +using System; +using FluentAssertions.Execution; + +namespace FluentAssertions.Primitives; + +internal class NegatedStringStartStrategy : IStringComparisonStrategy +{ + private readonly StringComparison stringComparison; + + public NegatedStringStartStrategy(StringComparison stringComparison) + { + this.stringComparison = stringComparison; + } + + public string ExpectationDescription + { + get + { + string predicateDescription = IgnoreCase ? "start with equivalent of" : "start with"; + return "Expected {context:string} that does not " + predicateDescription + " "; + } + } + + private bool IgnoreCase + => stringComparison == StringComparison.OrdinalIgnoreCase; + + public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected) + { + assertion + .ForCondition(!subject.StartsWith(expected, stringComparison)) + .FailWith(ExpectationDescription + "{0}{reason}, but found {1}.", expected, subject); + } +} diff --git a/Src/FluentAssertions/Primitives/NegatedStringStartValidator.cs b/Src/FluentAssertions/Primitives/NegatedStringStartValidator.cs deleted file mode 100644 index fa719a7327..0000000000 --- a/Src/FluentAssertions/Primitives/NegatedStringStartValidator.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; - -namespace FluentAssertions.Primitives; - -internal class NegatedStringStartValidator : StringValidator -{ - private readonly StringComparison stringComparison; - - public NegatedStringStartValidator(string subject, string expected, StringComparison stringComparison, string because, - object[] becauseArgs) - : base(subject, expected, because, becauseArgs) - { - this.stringComparison = stringComparison; - } - - protected override string ExpectationDescription - { - get - { - string predicateDescription = IgnoreCase ? "start with equivalent of" : "start with"; - return "Expected {context:string} that does not " + predicateDescription + " "; - } - } - - private bool IgnoreCase - { - get - { - return stringComparison == StringComparison.OrdinalIgnoreCase; - } - } - - protected override void ValidateAgainstMismatch() - { - bool isMatch = Subject.StartsWith(Expected, stringComparison); - - if (isMatch) - { - Assertion.FailWith(ExpectationDescription + "{0}{reason}, but found {1}.", - Expected, Subject); - } - } -} diff --git a/Src/FluentAssertions/Primitives/StringAssertions.cs b/Src/FluentAssertions/Primitives/StringAssertions.cs index e171ec4cc9..e383b9fc86 100644 --- a/Src/FluentAssertions/Primitives/StringAssertions.cs +++ b/Src/FluentAssertions/Primitives/StringAssertions.cs @@ -53,10 +53,11 @@ public StringAssertions(string value) /// public AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { - var stringEqualityValidator = - new StringEqualityValidator(Subject, expected, StringComparison.Ordinal, because, becauseArgs); + var stringEqualityValidator = new StringValidator( + new StringEqualityStrategy(StringComparison.Ordinal), + because, becauseArgs); - stringEqualityValidator.Validate(); + stringEqualityValidator.Validate(Subject, expected); return new AndConstraint((TAssertions)this); } @@ -112,10 +113,11 @@ public AndConstraint BeOneOf(IEnumerable validValues, strin public AndConstraint BeEquivalentTo(string expected, string because = "", params object[] becauseArgs) { - var expectation = new StringEqualityValidator( - Subject, expected, StringComparison.OrdinalIgnoreCase, because, becauseArgs); + var expectation = new StringValidator( + new StringEqualityStrategy(StringComparison.OrdinalIgnoreCase), + because, becauseArgs); - expectation.Validate(); + expectation.Validate(Subject, expected); return new AndConstraint((TAssertions)this); } @@ -218,8 +220,11 @@ public AndConstraint Match(string wildcardPattern, string because = Guard.ThrowIfArgumentIsEmpty(wildcardPattern, nameof(wildcardPattern), "Cannot match string against an empty string. Provide a wildcard pattern or use the BeEmpty method."); - var stringWildcardMatchingValidator = new StringWildcardMatchingValidator(Subject, wildcardPattern, because, becauseArgs); - stringWildcardMatchingValidator.Validate(); + var stringWildcardMatchingValidator = new StringValidator( + new StringWildcardMatchingStrategy(), + because, becauseArgs); + + stringWildcardMatchingValidator.Validate(Subject, wildcardPattern); return new AndConstraint((TAssertions)this); } @@ -267,10 +272,14 @@ public AndConstraint NotMatch(string wildcardPattern, string becaus Guard.ThrowIfArgumentIsEmpty(wildcardPattern, nameof(wildcardPattern), "Cannot match string against an empty string. Provide a wildcard pattern or use the NotBeEmpty method."); - new StringWildcardMatchingValidator(Subject, wildcardPattern, because, becauseArgs) - { - Negate = true - }.Validate(); + var stringWildcardMatchingValidator = new StringValidator( + new StringWildcardMatchingStrategy + { + Negate = true + }, + because, becauseArgs); + + stringWildcardMatchingValidator.Validate(Subject, wildcardPattern); return new AndConstraint((TAssertions)this); } @@ -319,13 +328,15 @@ public AndConstraint MatchEquivalentOf(string wildcardPattern, stri Guard.ThrowIfArgumentIsEmpty(wildcardPattern, nameof(wildcardPattern), "Cannot match string against an empty string. Provide a wildcard pattern or use the BeEmpty method."); - var validator = new StringWildcardMatchingValidator(Subject, wildcardPattern, because, becauseArgs) - { - IgnoreCase = true, - IgnoreNewLineDifferences = true - }; + var stringWildcardMatchingValidator = new StringValidator( + new StringWildcardMatchingStrategy + { + IgnoreCase = true, + IgnoreNewLineDifferences = true + }, + because, becauseArgs); - validator.Validate(); + stringWildcardMatchingValidator.Validate(Subject, wildcardPattern); return new AndConstraint((TAssertions)this); } @@ -374,14 +385,16 @@ public AndConstraint NotMatchEquivalentOf(string wildcardPattern, s Guard.ThrowIfArgumentIsEmpty(wildcardPattern, nameof(wildcardPattern), "Cannot match string against an empty string. Provide a wildcard pattern or use the NotBeEmpty method."); - var validator = new StringWildcardMatchingValidator(Subject, wildcardPattern, because, becauseArgs) - { - IgnoreCase = true, - IgnoreNewLineDifferences = true, - Negate = true - }; + var stringWildcardMatchingValidator = new StringValidator( + new StringWildcardMatchingStrategy + { + IgnoreCase = true, + IgnoreNewLineDifferences = true, + Negate = true + }, + because, becauseArgs); - validator.Validate(); + stringWildcardMatchingValidator.Validate(Subject, wildcardPattern); return new AndConstraint((TAssertions)this); } @@ -661,8 +674,11 @@ public AndConstraint StartWith(string expected, string because = "" { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare start of string with ."); - var stringStartValidator = new StringStartValidator(Subject, expected, StringComparison.Ordinal, because, becauseArgs); - stringStartValidator.Validate(); + var stringStartValidator = new StringValidator( + new StringStartStrategy(StringComparison.Ordinal), + because, becauseArgs); + + stringStartValidator.Validate(Subject, expected); return new AndConstraint((TAssertions)this); } @@ -684,10 +700,11 @@ public AndConstraint NotStartWith(string unexpected, string because { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare start of string with ."); - var negatedStringStartValidator = - new NegatedStringStartValidator(Subject, unexpected, StringComparison.Ordinal, because, becauseArgs); + var negatedStringStartValidator = new StringValidator( + new NegatedStringStartStrategy(StringComparison.Ordinal), + because, becauseArgs); - negatedStringStartValidator.Validate(); + negatedStringStartValidator.Validate(Subject, unexpected); return new AndConstraint((TAssertions)this); } @@ -710,10 +727,11 @@ public AndConstraint StartWithEquivalentOf(string expected, string { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare string start equivalence with ."); - var stringStartValidator = - new StringStartValidator(Subject, expected, StringComparison.OrdinalIgnoreCase, because, becauseArgs); + var stringStartValidator = new StringValidator( + new StringStartStrategy(StringComparison.OrdinalIgnoreCase), + because, becauseArgs); - stringStartValidator.Validate(); + stringStartValidator.Validate(Subject, expected); return new AndConstraint((TAssertions)this); } @@ -736,10 +754,11 @@ public AndConstraint NotStartWithEquivalentOf(string unexpected, st { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare start of string with ."); - var negatedStringStartValidator = - new NegatedStringStartValidator(Subject, unexpected, StringComparison.OrdinalIgnoreCase, because, becauseArgs); + var negatedStringStartValidator = new StringValidator( + new NegatedStringStartStrategy(StringComparison.OrdinalIgnoreCase), + because, becauseArgs); - negatedStringStartValidator.Validate(); + negatedStringStartValidator.Validate(Subject, unexpected); return new AndConstraint((TAssertions)this); } diff --git a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs new file mode 100644 index 0000000000..26f40f4eae --- /dev/null +++ b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs @@ -0,0 +1,87 @@ +using System; +using FluentAssertions.Common; +using FluentAssertions.Execution; + +namespace FluentAssertions.Primitives; + +internal class StringEqualityStrategy : IStringComparisonStrategy +{ + private readonly StringComparison comparisonMode; + + public StringEqualityStrategy(StringComparison comparisonMode) + { + this.comparisonMode = comparisonMode; + } + + private bool ValidateAgainstSuperfluousWhitespace(IAssertionScope assertion, string subject, string expected) + { + return assertion + .ForCondition(!(expected.Length > subject.Length && expected.TrimEnd().Equals(subject, comparisonMode))) + .FailWith(ExpectationDescription + "{0}{reason}, but it misses some extra whitespace at the end.", expected) + .Then + .ForCondition(!(subject.Length > expected.Length && subject.TrimEnd().Equals(expected, comparisonMode))) + .FailWith(ExpectationDescription + "{0}{reason}, but it has unexpected whitespace at the end.", expected); + } + + private bool ValidateAgainstLengthDifferences(IAssertionScope assertion, string subject, string expected) + { + return assertion + .ForCondition(subject.Length == expected.Length) + .FailWith(() => + { + string mismatchSegment = GetMismatchSegmentForStringsOfDifferentLengths(subject, expected); + + string message = ExpectationDescription + + "{0} with a length of {1}{reason}, but {2} has a length of {3}, differs near " + mismatchSegment + "."; + + return new FailReason(message, expected, expected.Length, subject, subject.Length); + }); + } + + private string GetMismatchSegmentForStringsOfDifferentLengths(string subject, string expected) + { + int indexOfMismatch = subject.IndexOfFirstMismatch(expected, comparisonMode); + + // If there is no difference it means that expected starts with subject and subject is shorter than expected + if (indexOfMismatch == -1) + { + // Subject is shorter so we point at its last character. + // We would like to point at next character as it is the real + // index of first mismatch, but we need to point at character existing in + // subject, so the next best thing is the last subject character. + indexOfMismatch = Math.Max(0, subject.Length - 1); + } + + return subject.IndexedSegmentAt(indexOfMismatch); + } + + public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected) + { + if (!ValidateAgainstSuperfluousWhitespace(assertion, subject, expected) || + !ValidateAgainstLengthDifferences(assertion, subject, expected)) + { + return; + } + + int indexOfMismatch = subject.IndexOfFirstMismatch(expected, comparisonMode); + + if (indexOfMismatch != -1) + { + assertion.FailWith( + ExpectationDescription + "{0}{reason}, but {1} differs near " + subject.IndexedSegmentAt(indexOfMismatch) + ".", + expected, subject); + } + } + + public string ExpectationDescription + { + get + { + string predicateDescription = IgnoreCase ? "be equivalent to" : "be"; + return "Expected {context:string} to " + predicateDescription + " "; + } + } + + private bool IgnoreCase + => comparisonMode == StringComparison.OrdinalIgnoreCase; +} diff --git a/Src/FluentAssertions/Primitives/StringEqualityValidator.cs b/Src/FluentAssertions/Primitives/StringEqualityValidator.cs deleted file mode 100644 index eb098e56a1..0000000000 --- a/Src/FluentAssertions/Primitives/StringEqualityValidator.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using FluentAssertions.Common; -using FluentAssertions.Execution; - -namespace FluentAssertions.Primitives; - -internal class StringEqualityValidator : StringValidator -{ - private readonly StringComparison comparisonMode; - - public StringEqualityValidator(string subject, string expected, StringComparison comparisonMode, string because, - object[] becauseArgs) - : base(subject, expected, because, becauseArgs) - { - this.comparisonMode = comparisonMode; - } - - protected override bool ValidateAgainstSuperfluousWhitespace() - { - return Assertion - .ForCondition(!(Expected.Length > Subject.Length && Expected.TrimEnd().Equals(Subject, comparisonMode))) - .FailWith(ExpectationDescription + "{0}{reason}, but it misses some extra whitespace at the end.", Expected) - .Then - .ForCondition(!(Subject.Length > Expected.Length && Subject.TrimEnd().Equals(Expected, comparisonMode))) - .FailWith(ExpectationDescription + "{0}{reason}, but it has unexpected whitespace at the end.", Expected); - } - - protected override bool ValidateAgainstLengthDifferences() - { - return Assertion - .ForCondition(Subject.Length == Expected.Length) - .FailWith(() => - { - string mismatchSegment = GetMismatchSegmentForStringsOfDifferentLengths(); - - string message = ExpectationDescription + - "{0} with a length of {1}{reason}, but {2} has a length of {3}, differs near " + mismatchSegment + "."; - - return new FailReason(message, Expected, Expected.Length, Subject, Subject.Length); - }); - } - - private string GetMismatchSegmentForStringsOfDifferentLengths() - { - int indexOfMismatch = Subject.IndexOfFirstMismatch(Expected, comparisonMode); - - // If there is no difference it means that expected starts with subject and subject is shorter than expected - if (indexOfMismatch == -1) - { - // Subject is shorter so we point at its last character. - // We would like to point at next character as it is the real - // index of first mismatch, but we need to point at character existing in - // subject, so the next best thing is the last subject character. - indexOfMismatch = Math.Max(0, Subject.Length - 1); - } - - return Subject.IndexedSegmentAt(indexOfMismatch); - } - - protected override void ValidateAgainstMismatch() - { - int indexOfMismatch = Subject.IndexOfFirstMismatch(Expected, comparisonMode); - - if (indexOfMismatch != -1) - { - Assertion.FailWith( - ExpectationDescription + "{0}{reason}, but {1} differs near " + Subject.IndexedSegmentAt(indexOfMismatch) + ".", - Expected, Subject); - } - } - - protected override string ExpectationDescription - { - get - { - string predicateDescription = IgnoreCase ? "be equivalent to" : "be"; - return "Expected {context:string} to " + predicateDescription + " "; - } - } - - private bool IgnoreCase - { - get - { - return comparisonMode == StringComparison.OrdinalIgnoreCase; - } - } -} diff --git a/Src/FluentAssertions/Primitives/StringStartStrategy.cs b/Src/FluentAssertions/Primitives/StringStartStrategy.cs new file mode 100644 index 0000000000..394ecaea1e --- /dev/null +++ b/Src/FluentAssertions/Primitives/StringStartStrategy.cs @@ -0,0 +1,49 @@ +using System; +using FluentAssertions.Common; +using FluentAssertions.Execution; + +namespace FluentAssertions.Primitives; + +internal class StringStartStrategy : IStringComparisonStrategy +{ + private readonly StringComparison stringComparison; + + public StringStartStrategy(StringComparison stringComparison) + { + this.stringComparison = stringComparison; + } + + public string ExpectationDescription + { + get + { + string predicateDescription = IgnoreCase ? "start with equivalent of" : "start with"; + return "Expected {context:string} to " + predicateDescription + " "; + } + } + + private bool IgnoreCase + => stringComparison == StringComparison.OrdinalIgnoreCase; + + public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected) + { + if (!assertion + .ForCondition(subject.Length >= expected.Length) + .FailWith(ExpectationDescription + "{0}{reason}, but {1} is too short.", expected, subject)) + { + return; + } + + if (subject.StartsWith(expected, stringComparison)) + { + return; + } + + int indexOfMismatch = subject.IndexOfFirstMismatch(expected, stringComparison); + + assertion.FailWith( + ExpectationDescription + "{0}{reason}, but {1} differs near " + subject.IndexedSegmentAt(indexOfMismatch) + + ".", + expected, subject); + } +} diff --git a/Src/FluentAssertions/Primitives/StringStartValidator.cs b/Src/FluentAssertions/Primitives/StringStartValidator.cs deleted file mode 100644 index 727d645a74..0000000000 --- a/Src/FluentAssertions/Primitives/StringStartValidator.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using FluentAssertions.Common; - -namespace FluentAssertions.Primitives; - -internal class StringStartValidator : StringValidator -{ - private readonly StringComparison stringComparison; - - public StringStartValidator(string subject, string expected, StringComparison stringComparison, string because, - object[] becauseArgs) - : base(subject, expected, because, becauseArgs) - { - this.stringComparison = stringComparison; - } - - protected override string ExpectationDescription - { - get - { - string predicateDescription = IgnoreCase ? "start with equivalent of" : "start with"; - return "Expected {context:string} to " + predicateDescription + " "; - } - } - - private bool IgnoreCase - { - get - { - return stringComparison == StringComparison.OrdinalIgnoreCase; - } - } - - protected override bool ValidateAgainstLengthDifferences() - { - return Assertion - .ForCondition(Subject.Length >= Expected.Length) - .FailWith(ExpectationDescription + "{0}{reason}, but {1} is too short.", Expected, Subject); - } - - protected override void ValidateAgainstMismatch() - { - bool isMismatch = !Subject.StartsWith(Expected, stringComparison); - - if (isMismatch) - { - int indexOfMismatch = Subject.IndexOfFirstMismatch(Expected, stringComparison); - - Assertion.FailWith( - ExpectationDescription + "{0}{reason}, but {1} differs near " + Subject.IndexedSegmentAt(indexOfMismatch) + ".", - Expected, Subject); - } - } -} diff --git a/Src/FluentAssertions/Primitives/StringValidator.cs b/Src/FluentAssertions/Primitives/StringValidator.cs index 0b2edd0bdf..e13460dd0e 100644 --- a/Src/FluentAssertions/Primitives/StringValidator.cs +++ b/Src/FluentAssertions/Primitives/StringValidator.cs @@ -3,77 +3,52 @@ namespace FluentAssertions.Primitives; -/// -/// Dedicated class for comparing two strings and generating consistent error messages. -/// -internal abstract class StringValidator +internal class StringValidator { - #region Private Definition - private const int HumanReadableLength = 8; - protected string Subject { get; } - - protected string Expected { get; } - - protected IAssertionScope Assertion { get; set; } + private readonly IStringComparisonStrategy comparisonStrategy; + private IAssertionScope assertion; - #endregion - - protected StringValidator(string subject, string expected, string because, object[] becauseArgs) + public StringValidator(IStringComparisonStrategy comparisonStrategy, string because, object[] becauseArgs) { - Assertion = Execute.Assertion.BecauseOf(because, becauseArgs); - - Subject = subject; - Expected = expected; + this.comparisonStrategy = comparisonStrategy; + assertion = Execute.Assertion.BecauseOf(because, becauseArgs); } - public void Validate() + public void Validate(string subject, string expected) { - if (Expected is not null || Subject is not null) + if (expected is null && subject is null) { - if (ValidateAgainstNulls()) - { - if (IsLongOrMultiline(Expected) || IsLongOrMultiline(Subject)) - { - Assertion = Assertion.UsingLineBreaks; - } + return; + } - if (ValidateAgainstSuperfluousWhitespace() && ValidateAgainstLengthDifferences()) - { - ValidateAgainstMismatch(); - } - } + if (!ValidateAgainstNulls(subject, expected)) + { + return; } - } - private bool ValidateAgainstNulls() - { - if (Expected is null != Subject is null) + if (IsLongOrMultiline(expected) || IsLongOrMultiline(subject)) { - Assertion.FailWith(ExpectationDescription + "{0}{reason}, but found {1}.", Expected, Subject); - return false; + assertion = assertion.UsingLineBreaks; } - return true; + comparisonStrategy.ValidateAgainstMismatch(assertion, subject, expected); } - private static bool IsLongOrMultiline(string value) + private bool ValidateAgainstNulls(string subject, string expected) { - return value.Length > HumanReadableLength || value.Contains(Environment.NewLine, StringComparison.Ordinal); - } + if (expected is null == subject is null) + { + return true; + } - protected virtual bool ValidateAgainstSuperfluousWhitespace() - { - return true; + assertion.FailWith(comparisonStrategy.ExpectationDescription + "{0}{reason}, but found {1}.", expected, subject); + return false; } - protected virtual bool ValidateAgainstLengthDifferences() + private static bool IsLongOrMultiline(string value) { - return true; + return value.Length > HumanReadableLength || value.Contains(Environment.NewLine, StringComparison.Ordinal); } - - protected abstract void ValidateAgainstMismatch(); - - protected abstract string ExpectationDescription { get; } } diff --git a/Src/FluentAssertions/Primitives/StringWildcardMatchingValidator.cs b/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs similarity index 69% rename from Src/FluentAssertions/Primitives/StringWildcardMatchingValidator.cs rename to Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs index 7a8ce1e7b9..86b55566eb 100644 --- a/Src/FluentAssertions/Primitives/StringWildcardMatchingValidator.cs +++ b/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs @@ -2,39 +2,39 @@ using System.Text; using System.Text.RegularExpressions; using FluentAssertions.Common; +using FluentAssertions.Execution; namespace FluentAssertions.Primitives; -internal class StringWildcardMatchingValidator : StringValidator +internal class StringWildcardMatchingStrategy : IStringComparisonStrategy { - public StringWildcardMatchingValidator(string subject, string expected, string because, object[] becauseArgs) - : base(subject, expected, because, becauseArgs) + public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected) { - } - - protected override void ValidateAgainstMismatch() - { - bool isMatch = IsMatch(); + bool isMatch = IsMatch(subject, expected); - if (!isMatch && !Negate) + if (isMatch != Negate) { - Assertion.FailWith(ExpectationDescription + "but {1} does not.", Expected, Subject); + return; } - if (isMatch && Negate) + if (Negate) { - Assertion.FailWith(ExpectationDescription + "but {1} matches.", Expected, Subject); + assertion.FailWith(ExpectationDescription + "but {1} matches.", expected, subject); + } + else + { + assertion.FailWith(ExpectationDescription + "but {1} does not.", expected, subject); } } - private bool IsMatch() + private bool IsMatch(string subject, string expected) { RegexOptions options = IgnoreCase ? RegexOptions.IgnoreCase | RegexOptions.CultureInvariant : RegexOptions.None; - string input = CleanNewLines(Subject); - string pattern = ConvertWildcardToRegEx(CleanNewLines(Expected)); + string input = CleanNewLines(subject); + string pattern = ConvertWildcardToRegEx(CleanNewLines(expected)); return Regex.IsMatch(input, pattern, options | RegexOptions.Singleline); } @@ -53,11 +53,12 @@ private string CleanNewLines(string input) return IgnoreNewLineDifferences ? input.RemoveNewLines() : input; } - protected override string ExpectationDescription + public string ExpectationDescription { get { var builder = new StringBuilder(); + builder .Append(Negate ? "Did not expect " : "Expected ") .Append("{context:string}") From 74b3a4999e412f875984658e101fe62cb0cd59ae Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 17 Sep 2023 11:10:41 +0200 Subject: [PATCH 026/845] Make Gitversion+GitRepository required We've seen two cases where `GitVersion` could not be injected and later in the pipeline `Libgit2Sharp` failed to extract the source branch name. --- Build/Build.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Build/Build.cs b/Build/Build.cs index badaf37a17..25c892cf7f 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -54,9 +54,11 @@ class Build : NukeBuild [Solution(GenerateProjects = true)] readonly Solution Solution; + [Required] [GitVersion(Framework = "net6.0", NoCache = true, NoFetch = true)] readonly GitVersion GitVersion; + [Required] [GitRepository] readonly GitRepository GitRepository; From 269ac689e7ef414050d3b37c8ed365cf97f836c3 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 17 Sep 2023 10:51:34 +0200 Subject: [PATCH 027/845] Silence CA1859 --- Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs b/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs index 5ad1b3606f..e1a8d5a3b7 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using System.Reflection; using System.Threading.Tasks; using FluentAssertions.Types; @@ -896,8 +897,8 @@ internal class ClassToExploreUnwrappedEnumerableTypes internal class ClassImplementingMultipleEnumerable : IEnumerable, IEnumerable { - private readonly IEnumerable integers = new int[0]; - private readonly IEnumerable strings = new string[0]; + private readonly IEnumerable integers = Enumerable.Empty(); + private readonly IEnumerable strings = Enumerable.Empty(); public IEnumerator GetEnumerator() => integers.GetEnumerator(); From a07bdfdd3455d463a2d4700242f4e98d68b0a9fd Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Wed, 20 Sep 2023 07:39:09 +0200 Subject: [PATCH 028/845] Drop support for .NET Core (#2302) --- .github/ISSUE_TEMPLATE/01_bug_report.yml | 2 +- .nuke/build.schema.json | 8 +- Build/Build.cs | 10 +- README.md | 2 +- .../MemberPathSegmentEqualityComparer.cs | 2 +- Src/FluentAssertions/Common/Services.cs | 2 +- Src/FluentAssertions/FluentAssertions.csproj | 24 +- .../Streams/BufferedStreamAssertions.cs | 4 +- .../netcoreapp2.1.verified.txt | 2635 ----------------- .../netcoreapp3.0.verified.txt | 2635 ----------------- .../CollectionSpecs.cs | 9 +- .../FluentAssertions.Equivalency.Specs.csproj | 25 +- .../Common/TimeSpanExtensions.cs | 2 +- .../Events/EventAssertionSpecs.cs | 11 +- .../AsyncFunctionExceptionAssertionSpecs.cs | 6 +- .../FunctionExceptionAssertionSpecs.cs | 6 +- .../Exceptions/NotThrowSpecs.cs | 8 +- .../FluentAssertions.Specs.csproj | 29 +- .../Specialized/TaskOfTAssertionSpecs.cs | 8 +- .../Streams/BufferedStreamAssertionSpecs.cs | 6 +- docs/_config.yml | 2 +- docs/_data/navigation.yml | 2 + docs/_pages/about.md | 4 +- docs/_pages/introduction.md | 2 +- docs/_pages/releases.md | 1 + docs/_pages/upgradingtov7.md | 12 + docs/index.html | 4 +- 27 files changed, 69 insertions(+), 5392 deletions(-) delete mode 100644 Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt delete mode 100644 Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt create mode 100644 docs/_pages/upgradingtov7.md diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.yml b/.github/ISSUE_TEMPLATE/01_bug_report.yml index febe299c00..dc156456c0 100644 --- a/.github/ISSUE_TEMPLATE/01_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/01_bug_report.yml @@ -88,7 +88,7 @@ body: description: | Please provide more information on your .NET configuration: * Which version of Fluent Assertions are you using? - * Which .NET runtime and version are you targeting? E.g. .NET framework 4.6.1 or .NET Core 2.1. + * Which .NET runtime and version are you targeting? E.g. .NET framework 4.7.2 or .NET 6.0. placeholder: Configuration validations: required: false diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 0cc64a64ed..0362d5b05c 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -84,8 +84,8 @@ "SpellCheck", "TestFrameworks", "UnitTests", - "UnitTestsNetCore", - "UnitTestsNetFramework" + "UnitTestsNetFramework", + "UnitTestsNewerFrameworks" ] } }, @@ -110,8 +110,8 @@ "SpellCheck", "TestFrameworks", "UnitTests", - "UnitTestsNetCore", - "UnitTestsNetFramework" + "UnitTestsNetFramework", + "UnitTestsNewerFrameworks" ] } }, diff --git a/Build/Build.cs b/Build/Build.cs index 25c892cf7f..ae7740ce48 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -188,13 +188,13 @@ class Build : NukeBuild ); }); - Target UnitTestsNetCore => _ => _ + Target UnitTestsNewerFrameworks => _ => _ .Unlisted() .DependsOn(Compile) .OnlyWhenDynamic(() => RunAllTargets || HasSourceChanges) .Executes(() => { - const string NET47 = "net47"; + const string net47 = "net47"; DotNetTest(s => s .SetConfiguration(Configuration.Debug) @@ -210,7 +210,7 @@ class Build : NukeBuild (_, project) => _ .SetProjectFile(project) .CombineWith( - project.GetTargetFrameworks().Except(new[] { NET47 }), + project.GetTargetFrameworks().Except(new[] { net47 }), (_, framework) => _ .SetFramework(framework) .AddLoggers($"trx;LogFileName={project.Name}_{framework}.trx") @@ -218,12 +218,12 @@ class Build : NukeBuild ), completeOnFailure: true ); - ReportTestOutcome(globFilters: $"*[!*{NET47}].trx"); + ReportTestOutcome(globFilters: $"*[!*{net47}].trx"); }); Target UnitTests => _ => _ .DependsOn(UnitTestsNetFramework) - .DependsOn(UnitTestsNetCore); + .DependsOn(UnitTestsNewerFrameworks); static string[] Outcomes(AbsolutePath path) => XmlTasks.XmlPeek( diff --git a/README.md b/README.md index a6d5bc792a..8e78319c6b 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ [![open issues](https://img.shields.io/github/issues/fluentassertions/fluentassertions)](https://github.com/fluentassertions/fluentassertions/issues) ![](https://img.shields.io/badge/release%20strategy-githubflow-orange.svg) -A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Targets .NET Framework 4.7, as well as .NET Core 2.1, .NET Core 3.0, .NET 6, .NET Standard 2.0 and 2.1. +A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Targets .NET Framework 4.7, as well as .NET 6, .NET Standard 2.0 and 2.1. See https://www.fluentassertions.com for [background information](https://fluentassertions.com/about/), [usage documentation](https://fluentassertions.com/introduction), an [extensibility guide](https://fluentassertions.com/extensibility/), support information and more [tips & tricks](https://fluentassertions.com/tips/). diff --git a/Src/FluentAssertions/Common/MemberPathSegmentEqualityComparer.cs b/Src/FluentAssertions/Common/MemberPathSegmentEqualityComparer.cs index edf54813c7..fc0c53a8cf 100644 --- a/Src/FluentAssertions/Common/MemberPathSegmentEqualityComparer.cs +++ b/Src/FluentAssertions/Common/MemberPathSegmentEqualityComparer.cs @@ -40,7 +40,7 @@ private static bool IsIndexQualifier(string segment) => public int GetHashCode(string obj) { -#if NETCOREAPP2_1_OR_GREATER +#if NET6_0_OR_GREATER || NETSTANDARD2_1 return obj.GetHashCode(StringComparison.Ordinal); #else return obj.GetHashCode(); diff --git a/Src/FluentAssertions/Common/Services.cs b/Src/FluentAssertions/Common/Services.cs index 5dd8061ae7..dd283265ee 100644 --- a/Src/FluentAssertions/Common/Services.cs +++ b/Src/FluentAssertions/Common/Services.cs @@ -36,7 +36,7 @@ public static Configuration Configuration public static void ResetToDefaults() { Reflector = new FullFrameworkReflector(); -#if NETFRAMEWORK || NETCOREAPP +#if NETFRAMEWORK || NET6_0_OR_GREATER ConfigurationStore = new ConfigurationStoreExceptionInterceptor(new AppSettingsConfigurationStore()); #else ConfigurationStore = new NullConfigurationStore(); diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 61b8873c74..c42c2a0a28 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -2,7 +2,7 @@ - net47;net6.0;netcoreapp2.1;netcoreapp3.0;netstandard2.0;netstandard2.1 + net47;net6.0;netstandard2.0;netstandard2.1 True FluentAssertions.snk true @@ -18,7 +18,7 @@ Dennis Doomen;Jonas Nyrup A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or - BDD-style unit tests. Targets .NET Framework 4.7, .NET Core 2.1 and 3.0, .NET 6, as well as .NET Standard 2.0 and 2.1. + BDD-style unit tests. Targets .NET Framework 4.7, .NET 6, as well as .NET Standard 2.0 and 2.1. Supports the unit test frameworks MSTest2, NUnit3, XUnit2, MSpec, and NSpec3. Supported by InfoSupport B.V. @@ -26,7 +26,7 @@ https://www.fluentassertions.com https://github.com/fluentassertions/fluentassertions git - MSTest2;xUnit;NUnit;MSpec;NSpec;TDD;BDD;Fluent;netcore;netstandard;uwp + MSTest2;xUnit;NUnit;MSpec;NSpec;TDD;BDD;Fluent;netstandard;uwp Apache-2.0 FluentAssertions.png See https://fluentassertions.com/releases/ @@ -62,24 +62,6 @@ - - - - - - - - - - - - - - - - - - diff --git a/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs b/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs index 1557532d8d..82d9b8bf67 100644 --- a/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs +++ b/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs @@ -1,6 +1,6 @@ using System.Diagnostics; using System.IO; -#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1 +#if NET6_0_OR_GREATER || NETSTANDARD2_1 using FluentAssertions.Execution; #endif @@ -29,7 +29,7 @@ public BufferedStreamAssertions(BufferedStream stream) protected override string Identifier => "buffered stream"; -#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1 +#if NET6_0_OR_GREATER || NETSTANDARD2_1 /// /// Asserts that the current has the buffer size. /// diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt deleted file mode 100644 index a22a0160eb..0000000000 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp2.1.verified.txt +++ /dev/null @@ -1,2635 +0,0 @@ -[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/fluentassertions/fluentassertions")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"Benchmarks, PublicKey=00240000048000009400000006020000002400005253413100040000010001002d25ff515c85b13ba08f61d466cff5d80a7f28ba197bbf8796085213e7a3406f970d2a4874932fed35db546e89af2da88c194bf1b7f7ac70de7988c78406f7629c547283061282a825616eb7eb48a9514a7570942936020a9bb37dca9ff60b778309900851575614491c6d25018fadb75828f4c7a17bf2d7dc86e7b6eafc5d8f")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"FluentAssertions.Equivalency.Specs, PublicKey=00240000048000009400000006020000002400005253413100040000010001002d25ff515c85b13ba08f61d466cff5d80a7f28ba197bbf8796085213e7a3406f970d2a4874932fed35db546e89af2da88c194bf1b7f7ac70de7988c78406f7629c547283061282a825616eb7eb48a9514a7570942936020a9bb37dca9ff60b778309900851575614491c6d25018fadb75828f4c7a17bf2d7dc86e7b6eafc5d8f")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"FluentAssertions.Specs, PublicKey=00240000048000009400000006020000002400005253413100040000010001002d25ff515c85b13ba08f61d466cff5d80a7f28ba197bbf8796085213e7a3406f970d2a4874932fed35db546e89af2da88c194bf1b7f7ac70de7988c78406f7629c547283061282a825616eb7eb48a9514a7570942936020a9bb37dca9ff60b778309900851575614491c6d25018fadb75828f4c7a17bf2d7dc86e7b6eafc5d8f")] -namespace FluentAssertions -{ - public class AggregateExceptionExtractor : FluentAssertions.Specialized.IExtractExceptions - { - public AggregateExceptionExtractor() { } - public System.Collections.Generic.IEnumerable OfType(System.Exception actualException) - where T : System.Exception { } - } - public class AndConstraint - { - public AndConstraint(T parentConstraint) { } - public T And { get; } - } - public class AndWhichConstraint : FluentAssertions.AndConstraint - { - public AndWhichConstraint(TParentConstraint parentConstraint, System.Collections.Generic.IEnumerable matchedConstraint) { } - public AndWhichConstraint(TParentConstraint parentConstraint, TMatchedElement matchedConstraint) { } - public TMatchedElement Subject { get; } - public TMatchedElement Which { get; } - } - public static class AssertionExtensions - { - public static TTo As(this object subject) { } - public static System.Func Awaiting(this T subject, System.Func action) { } - public static System.Func Awaiting(this T subject, System.Func action) { } - public static System.Func> Awaiting(this T subject, System.Func> action) { } - public static System.Func> Awaiting(this T subject, System.Func> action) { } - public static System.Action Enumerating(this System.Func enumerable) { } - public static System.Action Enumerating(this System.Func> enumerable) { } - public static System.Action Enumerating(this T subject, System.Func> enumerable) { } - public static FluentAssertions.Specialized.ExecutionTime ExecutionTime(this System.Func action) { } - public static FluentAssertions.Specialized.ExecutionTime ExecutionTime(this System.Action action, FluentAssertions.Common.StartTimer createTimer = null) { } - public static FluentAssertions.Specialized.MemberExecutionTime ExecutionTimeOf(this T subject, System.Linq.Expressions.Expression> action, FluentAssertions.Common.StartTimer createTimer = null) { } - public static System.Action Invoking(this T subject, System.Action action) { } - public static System.Func Invoking(this T subject, System.Func action) { } - public static FluentAssertions.Events.IMonitor Monitor(this T eventSource, System.Func utcNow = null) { } - public static FluentAssertions.Specialized.ExecutionTimeAssertions Should(this FluentAssertions.Specialized.ExecutionTime executionTime) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Specialized.ExecutionTimeAssertions _) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase _) { } - public static FluentAssertions.Types.MethodInfoSelectorAssertions Should(this FluentAssertions.Types.MethodInfoSelector methodSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Types.MethodInfoSelectorAssertions _) { } - public static FluentAssertions.Types.PropertyInfoSelectorAssertions Should(this FluentAssertions.Types.PropertyInfoSelector propertyInfoSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Types.PropertyInfoSelectorAssertions _) { } - public static FluentAssertions.Types.TypeSelectorAssertions Should(this FluentAssertions.Types.TypeSelector typeSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } - public static FluentAssertions.Specialized.ActionAssertions Should(this System.Action action) { } - public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Collections.Generic.IEnumerable @this) { } - public static FluentAssertions.Primitives.DateTimeAssertions Should(this System.DateTime actualValue) { } - public static FluentAssertions.Primitives.NullableDateTimeAssertions Should(this System.DateTime? actualValue) { } - public static FluentAssertions.Primitives.DateTimeOffsetAssertions Should(this System.DateTimeOffset actualValue) { } - public static FluentAssertions.Primitives.NullableDateTimeOffsetAssertions Should(this System.DateTimeOffset? actualValue) { } - public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should(this System.Func action) { } - public static FluentAssertions.Primitives.GuidAssertions Should(this System.Guid actualValue) { } - public static FluentAssertions.Primitives.NullableGuidAssertions Should(this System.Guid? actualValue) { } - public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } - public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } - public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Reflection.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } - public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } - public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } - public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } - public static FluentAssertions.Primitives.SimpleTimeSpanAssertions Should(this System.TimeSpan actualValue) { } - public static FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions Should(this System.TimeSpan? actualValue) { } - public static FluentAssertions.Types.TypeAssertions Should(this System.Type subject) { } - public static FluentAssertions.Xml.XAttributeAssertions Should(this System.Xml.Linq.XAttribute actualValue) { } - public static FluentAssertions.Xml.XDocumentAssertions Should(this System.Xml.Linq.XDocument actualValue) { } - public static FluentAssertions.Xml.XElementAssertions Should(this System.Xml.Linq.XElement actualValue) { } - public static FluentAssertions.Primitives.BooleanAssertions Should(this bool actualValue) { } - public static FluentAssertions.Primitives.NullableBooleanAssertions Should(this bool? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this byte actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this byte? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this decimal actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this decimal? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this double actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this double? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this float actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this float? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this int actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this int? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this long actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this long? actualValue) { } - public static FluentAssertions.Primitives.ObjectAssertions Should(this object actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this sbyte actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this sbyte? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this short actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this short? actualValue) { } - public static FluentAssertions.Primitives.StringAssertions Should(this string actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this uint actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this uint? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this ulong actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ulong? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this ushort actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ushort? actualValue) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.BooleanAssertions _) - where TAssertions : FluentAssertions.Primitives.BooleanAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.DateTimeAssertions _) - where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.DateTimeOffsetAssertions _) - where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.DateTimeOffsetRangeAssertions _) - where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.DateTimeRangeAssertions _) - where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.GuidAssertions _) - where TAssertions : FluentAssertions.Primitives.GuidAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.SimpleTimeSpanAssertions _) - where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Collections.Generic.IEnumerable actualValue) { } - public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should(this System.Func> action) { } - public static FluentAssertions.Specialized.FunctionAssertions Should(this System.Func func) { } - public static FluentAssertions.Numeric.ComparableTypeAssertions Should(this System.IComparable comparableValue) { } - public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Numeric.NumericAssertions _) - where TSubject : struct, System.IComparable - where TAssertions : FluentAssertions.Numeric.NumericAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.EnumAssertions _) - where TEnum : struct, System.Enum - where TAssertions : FluentAssertions.Primitives.EnumAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.ReferenceTypeAssertions _) - where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { } - public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should(this System.Collections.Generic.IDictionary actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should(this System.Collections.Generic.IEnumerable> actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions Should(this TCollection actualValue) - where TCollection : System.Collections.Generic.IEnumerable> { } - } - public static class AssertionOptions - { - public static FluentAssertions.EquivalencyPlan EquivalencyPlan { get; } - public static FluentAssertions.Formatting.FormattingOptions FormattingOptions { get; } - public static void AssertEquivalencyUsing(System.Func defaultsConfigurer) { } - public static FluentAssertions.Equivalency.EquivalencyAssertionOptions CloneDefaults() { } - } - public static class AsyncAssertionsExtensions - { - public static System.Threading.Tasks.Task, T>> WithResult(this System.Threading.Tasks.Task, T>> task, T expected, string because = "", params object[] becauseArgs) { } - public static System.Threading.Tasks.Task, T>> WithResult(this System.Threading.Tasks.Task, T>> task, T expected, string because = "", params object[] becauseArgs) { } - } - public static class AtLeast - { - public static FluentAssertions.OccurrenceConstraint Once() { } - public static FluentAssertions.OccurrenceConstraint Thrice() { } - public static FluentAssertions.OccurrenceConstraint Times(int expected) { } - public static FluentAssertions.OccurrenceConstraint Twice() { } - } - public static class AtMost - { - public static FluentAssertions.OccurrenceConstraint Once() { } - public static FluentAssertions.OccurrenceConstraint Thrice() { } - public static FluentAssertions.OccurrenceConstraint Times(int expected) { } - public static FluentAssertions.OccurrenceConstraint Twice() { } - } - public static class CallerIdentifier - { - public static System.Action Logger { get; set; } - public static string DetermineCallerIdentity() { } - } - [System.AttributeUsage(System.AttributeTargets.Method)] - public class CustomAssertionAttribute : System.Attribute - { - public CustomAssertionAttribute() { } - } - public static class EnumAssertionsExtensions - { - public static FluentAssertions.Primitives.EnumAssertions Should(this TEnum @enum) - where TEnum : struct, System.Enum { } - public static FluentAssertions.Primitives.NullableEnumAssertions Should(this TEnum? @enum) - where TEnum : struct, System.Enum { } - } - public class EquivalencyPlan : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - public EquivalencyPlan() { } - public void Add() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void AddAfter() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void Clear() { } - public System.Collections.Generic.IEnumerator GetEnumerator() { } - public void Insert() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void InsertBefore() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void Remove() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep { } - public void Reset() { } - } - public static class EventRaisingExtensions - { - public static FluentAssertions.Events.IEventRecording WithArgs(this FluentAssertions.Events.IEventRecording eventRecording, System.Linq.Expressions.Expression> predicate) { } - public static FluentAssertions.Events.IEventRecording WithArgs(this FluentAssertions.Events.IEventRecording eventRecording, params System.Linq.Expressions.Expression>[] predicates) { } - public static FluentAssertions.Events.IEventRecording WithSender(this FluentAssertions.Events.IEventRecording eventRecording, object expectedSender) { } - } - public static class Exactly - { - public static FluentAssertions.OccurrenceConstraint Once() { } - public static FluentAssertions.OccurrenceConstraint Thrice() { } - public static FluentAssertions.OccurrenceConstraint Times(int expected) { } - public static FluentAssertions.OccurrenceConstraint Twice() { } - } - public static class ExceptionAssertionsExtensions - { - public static System.Threading.Tasks.Task> Where(this System.Threading.Tasks.Task> task, System.Linq.Expressions.Expression> exceptionExpression, string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public static System.Threading.Tasks.Task> WithInnerException(this System.Threading.Tasks.Task> task, System.Type innerException, string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public static System.Threading.Tasks.Task> WithInnerException(this System.Threading.Tasks.Task> task, string because = "", params object[] becauseArgs) - where TException : System.Exception - where TInnerException : System.Exception { } - public static System.Threading.Tasks.Task> WithInnerExceptionExactly(this System.Threading.Tasks.Task> task, System.Type innerException, string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public static System.Threading.Tasks.Task> WithInnerExceptionExactly(this System.Threading.Tasks.Task> task, string because = "", params object[] becauseArgs) - where TException : System.Exception - where TInnerException : System.Exception { } - public static System.Threading.Tasks.Task> WithMessage(this System.Threading.Tasks.Task> task, string expectedWildcardPattern, string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public static FluentAssertions.Specialized.ExceptionAssertions WithParameterName(this FluentAssertions.Specialized.ExceptionAssertions parent, string paramName, string because = "", params object[] becauseArgs) - where TException : System.ArgumentException { } - public static System.Threading.Tasks.Task> WithParameterName(this System.Threading.Tasks.Task> task, string paramName, string because = "", params object[] becauseArgs) - where TException : System.ArgumentException { } - } - public static class FluentActions - { - public static System.Func Awaiting(System.Func action) { } - public static System.Func> Awaiting(System.Func> func) { } - public static System.Action Enumerating(System.Func enumerable) { } - public static System.Action Enumerating(System.Func> enumerable) { } - public static System.Action Invoking(System.Action action) { } - public static System.Func Invoking(System.Func func) { } - } - public static class LessThan - { - public static FluentAssertions.OccurrenceConstraint Thrice() { } - public static FluentAssertions.OccurrenceConstraint Times(int expected) { } - public static FluentAssertions.OccurrenceConstraint Twice() { } - } - public static class MoreThan - { - public static FluentAssertions.OccurrenceConstraint Once() { } - public static FluentAssertions.OccurrenceConstraint Thrice() { } - public static FluentAssertions.OccurrenceConstraint Times(int expected) { } - public static FluentAssertions.OccurrenceConstraint Twice() { } - } - public static class NumericAssertionsExtensions - { - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, decimal expectedValue, decimal precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, decimal? expectedValue, decimal precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, double expectedValue, double precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, double? expectedValue, double precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, float expectedValue, float precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, float? expectedValue, float precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, decimal expectedValue, decimal precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, double expectedValue, double precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, float expectedValue, float precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, byte nearbyValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, int nearbyValue, uint delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, long nearbyValue, ulong delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, sbyte nearbyValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint nearbyValue, uint delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong nearbyValue, ulong delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, decimal unexpectedValue, decimal precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, decimal? unexpectedValue, decimal precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, double unexpectedValue, double precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, double? unexpectedValue, double precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, float unexpectedValue, float precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, float? unexpectedValue, float precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, decimal unexpectedValue, decimal precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, double unexpectedValue, double precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, float unexpectedValue, float precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, byte distantValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short distantValue, ushort delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, int distantValue, uint delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, long distantValue, ulong delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, sbyte distantValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort distantValue, ushort delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint distantValue, uint delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong distantValue, ulong delta, string because = "", params object[] becauseArgs) { } - } - public static class ObjectAssertionsExtensions - { - public static FluentAssertions.AndConstraint BeBinarySerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint BeBinarySerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> options, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> options, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } - } - public abstract class OccurrenceConstraint - { - protected OccurrenceConstraint(int expectedCount) { } - } - public static class TypeEnumerableExtensions - { - public static System.Collections.Generic.IEnumerable ThatAreClasses(this System.Collections.Generic.IEnumerable types) { } - public static System.Collections.Generic.IEnumerable ThatAreDecoratedWith(this System.Collections.Generic.IEnumerable types) - where TAttribute : System.Attribute { } - public static System.Collections.Generic.IEnumerable ThatAreDecoratedWithOrInherit(this System.Collections.Generic.IEnumerable types) - where TAttribute : System.Attribute { } - public static System.Collections.Generic.IEnumerable ThatAreInNamespace(this System.Collections.Generic.IEnumerable types, string @namespace) { } - public static System.Collections.Generic.IEnumerable ThatAreNotClasses(this System.Collections.Generic.IEnumerable types) { } - public static System.Collections.Generic.IEnumerable ThatAreNotDecoratedWith(this System.Collections.Generic.IEnumerable types) - where TAttribute : System.Attribute { } - public static System.Collections.Generic.IEnumerable ThatAreNotDecoratedWithOrInherit(this System.Collections.Generic.IEnumerable types) - where TAttribute : System.Attribute { } - public static System.Collections.Generic.IEnumerable ThatAreNotStatic(this System.Collections.Generic.IEnumerable types) { } - public static System.Collections.Generic.IEnumerable ThatAreStatic(this System.Collections.Generic.IEnumerable types) { } - public static System.Collections.Generic.IEnumerable ThatAreUnderNamespace(this System.Collections.Generic.IEnumerable types, string @namespace) { } - public static System.Collections.Generic.IEnumerable ThatDeriveFrom(this System.Collections.Generic.IEnumerable types) { } - public static System.Collections.Generic.IEnumerable ThatImplement(this System.Collections.Generic.IEnumerable types) { } - public static System.Collections.Generic.IEnumerable ThatSatisfy(this System.Collections.Generic.IEnumerable types, System.Func predicate) { } - public static System.Collections.Generic.IEnumerable UnwrapEnumerableTypes(this System.Collections.Generic.IEnumerable types) { } - public static System.Collections.Generic.IEnumerable UnwrapTaskTypes(this System.Collections.Generic.IEnumerable types) { } - } - public static class TypeExtensions - { - public static FluentAssertions.Types.MethodInfoSelector Methods(this FluentAssertions.Types.TypeSelector typeSelector) { } - public static FluentAssertions.Types.MethodInfoSelector Methods(this System.Type type) { } - public static FluentAssertions.Types.PropertyInfoSelector Properties(this FluentAssertions.Types.TypeSelector typeSelector) { } - public static FluentAssertions.Types.PropertyInfoSelector Properties(this System.Type type) { } - public static FluentAssertions.Types.TypeSelector Types(this System.Collections.Generic.IEnumerable types) { } - public static FluentAssertions.Types.TypeSelector Types(this System.Reflection.Assembly assembly) { } - public static FluentAssertions.Types.TypeSelector Types(this System.Type type) { } - } - public static class XmlAssertionExtensions - { - public static FluentAssertions.Xml.XmlElementAssertions Should(this System.Xml.XmlElement actualValue) { } - public static FluentAssertions.Xml.XmlNodeAssertions Should(this System.Xml.XmlNode actualValue) { } - } -} -namespace FluentAssertions.Collections -{ - public class GenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions, T, FluentAssertions.Collections.GenericCollectionAssertions> - { - public GenericCollectionAssertions(System.Collections.Generic.IEnumerable actualValue) { } - } - public class GenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions> - where TCollection : System.Collections.Generic.IEnumerable - { - public GenericCollectionAssertions(TCollection actualValue) { } - } - public class GenericCollectionAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - where TCollection : System.Collections.Generic.IEnumerable - where TAssertions : FluentAssertions.Collections.GenericCollectionAssertions - { - public GenericCollectionAssertions(TCollection actualValue) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint AllBeAssignableTo(System.Type expectedType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> AllBeAssignableTo(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllBeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllBeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllBeOfType(System.Type expectedType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> AllBeOfType(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllSatisfy(System.Action expected, string because = "", params object[] becauseArgs) { } - protected void AssertCollectionEndsWith(System.Collections.Generic.IEnumerable actual, System.Collections.Generic.ICollection expected, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } - protected void AssertCollectionStartsWith(System.Collections.Generic.IEnumerable actualItems, System.Collections.Generic.ICollection expected, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } - protected void AssertSubjectEquality(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInAscendingOrder(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInAscendingOrder(System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInAscendingOrder(System.Func comparison, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInDescendingOrder(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInDescendingOrder(System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInDescendingOrder(System.Func comparison, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeNullOrEmpty(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSubsetOf(System.Collections.Generic.IEnumerable expectedSuperset, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Contain(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint Contain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint Contain(T expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint ContainEquivalentOf(TExpectation expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint ContainEquivalentOf(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainInConsecutiveOrder(params T[] expected) { } - public FluentAssertions.AndConstraint ContainInConsecutiveOrder(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainInOrder(params T[] expected) { } - public FluentAssertions.AndConstraint ContainInOrder(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainItemsAssignableTo(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint ContainSingle(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint ContainSingle(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint EndWith(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint EndWith(T element, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint EndWith(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Equal(params T[] elements) { } - public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCount(System.Linq.Expressions.Expression> countPredicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountGreaterThan(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountGreaterThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountLessThan(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountLessThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElementAt(int index, T element, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveElementPreceding(T successor, T expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveElementSucceeding(T predecessor, T expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveSameCount(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint IntersectWith(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInAscendingOrder(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInAscendingOrder(System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInAscendingOrder(System.Func comparison, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInDescendingOrder(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInDescendingOrder(System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInDescendingOrder(System.Func comparison, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNullOrEmpty(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeSubsetOf(System.Collections.Generic.IEnumerable unexpectedSuperset, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContain(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint NotContain(T unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainInConsecutiveOrder(params T[] unexpected) { } - public FluentAssertions.AndConstraint NotContainInConsecutiveOrder(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainInOrder(params T[] unexpected) { } - public FluentAssertions.AndConstraint NotContainInOrder(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainItemsAssignableTo(System.Type type, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainItemsAssignableTo(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainNulls(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainNulls(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) - where TKey : class { } - public FluentAssertions.AndConstraint NotEqual(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveCount(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveSameCount(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotIntersectWith(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint OnlyContain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint OnlyHaveUniqueItems(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint OnlyHaveUniqueItems(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Satisfy(params System.Linq.Expressions.Expression>[] predicates) { } - public FluentAssertions.AndConstraint Satisfy(System.Collections.Generic.IEnumerable>> predicates, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint SatisfyRespectively(params System.Action[] elementInspectors) { } - public FluentAssertions.AndConstraint SatisfyRespectively(System.Collections.Generic.IEnumerable> expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint StartWith(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint StartWith(T element, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint StartWith(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } - protected static System.Collections.Generic.IEnumerable RepeatAsManyAs(TExpectation value, System.Collections.Generic.IEnumerable enumerable) { } - } - public class GenericDictionaryAssertions : FluentAssertions.Collections.GenericDictionaryAssertions> - where TCollection : System.Collections.Generic.IEnumerable> - { - public GenericDictionaryAssertions(TCollection keyValuePairs) { } - } - public class GenericDictionaryAssertions : FluentAssertions.Collections.GenericCollectionAssertions, TAssertions> - where TCollection : System.Collections.Generic.IEnumerable> - where TAssertions : FluentAssertions.Collections.GenericDictionaryAssertions - { - public GenericDictionaryAssertions(TCollection keyValuePairs) { } - protected override string Identifier { get; } - 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 Contain(params System.Collections.Generic.KeyValuePair[] expected) { } - public FluentAssertions.AndConstraint Contain(System.Collections.Generic.IEnumerable> expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Contain(System.Collections.Generic.KeyValuePair expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Contain(TKey key, TValue value, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Collections.WhoseValueConstraint ContainKey(TKey expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainKeys(params TKey[] expected) { } - public FluentAssertions.AndConstraint ContainKeys(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint ContainValue(TValue expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainValues(params TValue[] expected) { } - public FluentAssertions.AndConstraint ContainValues(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Equal(T expected, string because = "", params object[] becauseArgs) - where T : System.Collections.Generic.IEnumerable> { } - public FluentAssertions.AndConstraint NotContain(params System.Collections.Generic.KeyValuePair[] items) { } - public FluentAssertions.AndConstraint NotContain(System.Collections.Generic.IEnumerable> items, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContain(System.Collections.Generic.KeyValuePair item, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContain(TKey key, TValue value, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainKey(TKey unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainKeys(params TKey[] unexpected) { } - public FluentAssertions.AndConstraint NotContainKeys(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainValue(TValue unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainValues(params TValue[] unexpected) { } - public FluentAssertions.AndConstraint NotContainValues(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotEqual(T unexpected, string because = "", params object[] becauseArgs) - where T : System.Collections.Generic.IEnumerable> { } - } - public class StringCollectionAssertions : FluentAssertions.Collections.StringCollectionAssertions> - { - public StringCollectionAssertions(System.Collections.Generic.IEnumerable actualValue) { } - } - public class StringCollectionAssertions : FluentAssertions.Collections.StringCollectionAssertions> - where TCollection : System.Collections.Generic.IEnumerable - { - public StringCollectionAssertions(TCollection actualValue) { } - } - public class StringCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions - where TCollection : System.Collections.Generic.IEnumerable - where TAssertions : FluentAssertions.Collections.StringCollectionAssertions - { - public StringCollectionAssertions(TCollection actualValue) { } - public FluentAssertions.AndConstraint AllBe(string expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllBe(string expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(params string[] expectation) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint ContainMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expected) { } - public FluentAssertions.AndConstraint Equal(params string[] expected) { } - public FluentAssertions.AndConstraint NotContainMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } - } - public class SubsequentOrderingAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions, T, FluentAssertions.Collections.SubsequentOrderingAssertions> - { - public SubsequentOrderingAssertions(System.Collections.Generic.IEnumerable actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } - } - public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions> - where TCollection : System.Collections.Generic.IEnumerable - { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } - } - public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions - where TCollection : System.Collections.Generic.IEnumerable - where TAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions - { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } - public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> ThenBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> ThenBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - } - public class WhoseValueConstraint : FluentAssertions.AndConstraint - where TCollection : System.Collections.Generic.IEnumerable> - where TAssertions : FluentAssertions.Collections.GenericDictionaryAssertions - { - public WhoseValueConstraint(TAssertions parentConstraint, TValue value) { } - public TValue WhoseValue { get; } - } -} -namespace FluentAssertions.Common -{ - public enum CSharpAccessModifier - { - Public = 0, - Private = 1, - Protected = 2, - Internal = 3, - ProtectedInternal = 4, - InvalidForCSharp = 5, - PrivateProtected = 6, - } - public class Configuration - { - public Configuration(FluentAssertions.Common.IConfigurationStore store) { } - public string TestFrameworkName { get; set; } - public string ValueFormatterAssembly { get; set; } - public FluentAssertions.Common.ValueFormatterDetectionMode ValueFormatterDetectionMode { get; set; } - public static FluentAssertions.Common.Configuration Current { get; } - } - public static class DateTimeExtensions - { - public static System.DateTimeOffset ToDateTimeOffset(this System.DateTime dateTime) { } - public static System.DateTimeOffset ToDateTimeOffset(this System.DateTime dateTime, System.TimeSpan offset) { } - } - public interface IClock - { - void Delay(System.TimeSpan timeToDelay); - System.Threading.Tasks.Task DelayAsync(System.TimeSpan delay, System.Threading.CancellationToken cancellationToken); - FluentAssertions.Common.ITimer StartTimer(); - } - public interface ICollectionWrapper - where TCollection : System.Collections.ICollection - { - TCollection UnderlyingCollection { get; } - } - public interface IConfigurationStore - { - string GetSetting(string name); - } - public interface IReflector - { - System.Collections.Generic.IEnumerable GetAllTypesFromAppDomain(System.Func predicate); - } - public interface ITimer : System.IDisposable - { - System.TimeSpan Elapsed { get; } - } - public static class Services - { - public static FluentAssertions.Common.Configuration Configuration { get; } - public static FluentAssertions.Common.IConfigurationStore ConfigurationStore { get; set; } - public static FluentAssertions.Common.IReflector Reflector { get; set; } - public static System.Action ThrowException { get; set; } - public static void ResetToDefaults() { } - } - public delegate FluentAssertions.Common.ITimer StartTimer(); - public enum ValueFormatterDetectionMode - { - Disabled = 0, - Specific = 1, - Scan = 2, - } -} -namespace FluentAssertions.Equivalency -{ - public class Comparands - { - public Comparands() { } - public Comparands(object subject, object expectation, System.Type compileTimeType) { } - public System.Type CompileTimeType { get; set; } - public object Expectation { get; set; } - public System.Type RuntimeType { get; } - public object Subject { get; set; } - public System.Type GetExpectedType(FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } - public override string ToString() { } - } - public class ConversionSelector - { - public ConversionSelector() { } - public FluentAssertions.Equivalency.ConversionSelector Clone() { } - public void Exclude(System.Linq.Expressions.Expression> predicate) { } - public void Include(System.Linq.Expressions.Expression> predicate) { } - public void IncludeAll() { } - public bool RequiresConversion(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.INode currentNode) { } - public override string ToString() { } - } - public enum CyclicReferenceHandling - { - Ignore = 0, - ThrowException = 1, - } - public enum EnumEquivalencyHandling - { - ByValue = 0, - ByName = 1, - } - public enum EqualityStrategy - { - Equals = 0, - Members = 1, - ForceEquals = 2, - ForceMembers = 3, - } - public class EquivalencyAssertionOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions - { - public EquivalencyAssertionOptions() { } - } - public class EquivalencyAssertionOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions> - { - public EquivalencyAssertionOptions() { } - public EquivalencyAssertionOptions(FluentAssertions.Equivalency.IEquivalencyAssertionOptions defaults) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions> AsCollection() { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> expression) { } - public FluentAssertions.Equivalency.NestedExclusionOptionBuilder For(System.Linq.Expressions.Expression>> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Including(System.Linq.Expressions.Expression> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(string expectationMemberPath, string subjectMemberPath) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(System.Linq.Expressions.Expression> expectationMemberPath, System.Linq.Expressions.Expression> subjectMemberPath) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(System.Linq.Expressions.Expression> expectationMember, System.Linq.Expressions.Expression> subjectMember) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(string expectationMemberName, string subjectMemberName) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithoutStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } - } - public enum EquivalencyResult - { - ContinueWithNext = 0, - AssertionCompleted = 1, - } - public abstract class EquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - protected EquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator); - } - public class EquivalencyValidationContext : FluentAssertions.Equivalency.IEquivalencyValidationContext - { - public EquivalencyValidationContext(FluentAssertions.Equivalency.INode root, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } - public FluentAssertions.Equivalency.INode CurrentNode { get; } - public FluentAssertions.Equivalency.IEquivalencyAssertionOptions Options { get; } - public FluentAssertions.Execution.Reason Reason { get; set; } - public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; set; } - public FluentAssertions.Equivalency.Tracing.Tracer Tracer { get; } - public FluentAssertions.Equivalency.IEquivalencyValidationContext AsCollectionItem(string index) { } - public FluentAssertions.Equivalency.IEquivalencyValidationContext AsDictionaryItem(TKey key) { } - public FluentAssertions.Equivalency.IEquivalencyValidationContext AsNestedMember(FluentAssertions.Equivalency.IMember expectationMember) { } - public FluentAssertions.Equivalency.IEquivalencyValidationContext Clone() { } - public bool IsCyclicReference(object expectation) { } - public override string ToString() { } - } - public class EquivalencyValidator : FluentAssertions.Equivalency.IEquivalencyValidator - { - public EquivalencyValidator() { } - public void AssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.EquivalencyValidationContext context) { } - public void RecursivelyAssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context) { } - } - public class Field : FluentAssertions.Equivalency.Node, FluentAssertions.Equivalency.IMember, FluentAssertions.Equivalency.INode - { - public Field(System.Reflection.FieldInfo fieldInfo, FluentAssertions.Equivalency.INode parent) { } - public Field(System.Type reflectedType, System.Reflection.FieldInfo fieldInfo, FluentAssertions.Equivalency.INode parent) { } - public System.Type DeclaringType { get; set; } - public override string Description { get; } - public FluentAssertions.Common.CSharpAccessModifier GetterAccessibility { get; } - public bool IsBrowsable { get; } - public System.Type ReflectedType { get; } - public FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } - public object GetValue(object obj) { } - } - public delegate string GetSubjectId(); - public interface IAssertionContext - { - string Because { get; set; } - object[] BecauseArgs { get; set; } - TSubject Expectation { get; } - FluentAssertions.Equivalency.INode SelectedNode { get; } - TSubject Subject { get; } - } - public interface IEquivalencyAssertionOptions - { - bool AllowInfiniteRecursion { get; } - bool? CompareRecordsByValue { get; } - FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } - FluentAssertions.Equivalency.CyclicReferenceHandling CyclicReferenceHandling { get; } - FluentAssertions.Equivalency.EnumEquivalencyHandling EnumEquivalencyHandling { get; } - bool ExcludeNonBrowsableOnExpectation { get; } - bool IgnoreNonBrowsableOnSubject { get; } - FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } - FluentAssertions.Equivalency.MemberVisibility IncludedProperties { get; } - bool IsRecursive { get; } - System.Collections.Generic.IEnumerable MatchingRules { get; } - FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } - System.Collections.Generic.IEnumerable SelectionRules { get; } - FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } - bool UseRuntimeTyping { get; } - System.Collections.Generic.IEnumerable UserEquivalencySteps { get; } - FluentAssertions.Equivalency.EqualityStrategy GetEqualityStrategy(System.Type type); - } - public interface IEquivalencyStep - { - FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator); - } - public interface IEquivalencyValidationContext - { - FluentAssertions.Equivalency.INode CurrentNode { get; } - FluentAssertions.Equivalency.IEquivalencyAssertionOptions Options { get; } - FluentAssertions.Execution.Reason Reason { get; } - FluentAssertions.Equivalency.Tracing.Tracer Tracer { get; } - FluentAssertions.Equivalency.IEquivalencyValidationContext AsCollectionItem(string index); - FluentAssertions.Equivalency.IEquivalencyValidationContext AsDictionaryItem(TKey key); - FluentAssertions.Equivalency.IEquivalencyValidationContext AsNestedMember(FluentAssertions.Equivalency.IMember expectationMember); - FluentAssertions.Equivalency.IEquivalencyValidationContext Clone(); - bool IsCyclicReference(object expectation); - } - public interface IEquivalencyValidator - { - void RecursivelyAssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context); - } - public interface IMember : FluentAssertions.Equivalency.INode - { - System.Type DeclaringType { get; } - FluentAssertions.Common.CSharpAccessModifier GetterAccessibility { get; } - bool IsBrowsable { get; } - System.Type ReflectedType { get; } - FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } - object GetValue(object obj); - } - public interface IMemberInfo - { - System.Type DeclaringType { get; } - FluentAssertions.Common.CSharpAccessModifier GetterAccessibility { get; } - string Name { get; } - string Path { get; set; } - FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } - System.Type Type { get; } - } - public interface IMemberMatchingRule - { - FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options); - } - public interface IMemberSelectionRule - { - bool IncludesMembers { get; } - System.Collections.Generic.IEnumerable SelectMembers(FluentAssertions.Equivalency.INode currentNode, System.Collections.Generic.IEnumerable selectedMembers, FluentAssertions.Equivalency.MemberSelectionContext context); - } - public interface INode - { - int Depth { get; } - string Description { get; } - FluentAssertions.Equivalency.GetSubjectId GetSubjectId { get; } - bool IsRoot { get; } - string Name { get; set; } - System.Type ParentType { get; } - string Path { get; } - string PathAndName { get; } - bool RootIsCollection { get; } - System.Type Type { get; } - } - public interface IObjectInfo - { - System.Type CompileTimeType { get; } - System.Type ParentType { get; } - string Path { get; set; } - System.Type RuntimeType { get; } - [System.Obsolete("Use CompileTimeType or RuntimeType instead")] - System.Type Type { get; } - } - public interface IOrderingRule - { - FluentAssertions.Equivalency.OrderStrictness Evaluate(FluentAssertions.Equivalency.IObjectInfo objectInfo); - } - public static class MemberFactory - { - public static FluentAssertions.Equivalency.IMember Create(System.Reflection.MemberInfo memberInfo, FluentAssertions.Equivalency.INode parent) { } - } - public class MemberSelectionContext - { - public MemberSelectionContext(System.Type compileTimeType, System.Type runtimeType, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } - public FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } - public FluentAssertions.Equivalency.MemberVisibility IncludedProperties { get; } - public System.Type Type { get; } - } - [System.Flags] - public enum MemberVisibility - { - None = 0, - Internal = 1, - Public = 2, - } - public class NestedExclusionOptionBuilder - { - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Exclude(System.Linq.Expressions.Expression> expression) { } - public FluentAssertions.Equivalency.NestedExclusionOptionBuilder For(System.Linq.Expressions.Expression>> expression) { } - } - public class Node : FluentAssertions.Equivalency.INode - { - public Node() { } - public int Depth { get; } - public virtual string Description { get; } - public FluentAssertions.Equivalency.GetSubjectId GetSubjectId { get; set; } - public bool IsRoot { get; } - public string Name { get; set; } - public System.Type ParentType { get; set; } - public string Path { get; set; } - public string PathAndName { get; } - public bool RootIsCollection { get; set; } - public System.Type Type { get; set; } - public override bool Equals(object obj) { } - public override int GetHashCode() { } - public override string ToString() { } - public static FluentAssertions.Equivalency.INode From(FluentAssertions.Equivalency.GetSubjectId getSubjectId) { } - public static FluentAssertions.Equivalency.INode FromCollectionItem(string index, FluentAssertions.Equivalency.INode parent) { } - public static FluentAssertions.Equivalency.INode FromDictionaryItem(object key, FluentAssertions.Equivalency.INode parent) { } - } - public enum OrderStrictness - { - Strict = 0, - NotStrict = 1, - Irrelevant = 2, - } - public class OrderingRuleCollection : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - public OrderingRuleCollection() { } - public OrderingRuleCollection(System.Collections.Generic.IEnumerable orderingRules) { } - public void Add(FluentAssertions.Equivalency.IOrderingRule rule) { } - public System.Collections.Generic.IEnumerator GetEnumerator() { } - public bool IsOrderingStrictFor(FluentAssertions.Equivalency.IObjectInfo objectInfo) { } - } - public class Property : FluentAssertions.Equivalency.Node, FluentAssertions.Equivalency.IMember, FluentAssertions.Equivalency.INode - { - public Property(System.Reflection.PropertyInfo propertyInfo, FluentAssertions.Equivalency.INode parent) { } - public Property(System.Type reflectedType, System.Reflection.PropertyInfo propertyInfo, FluentAssertions.Equivalency.INode parent) { } - public System.Type DeclaringType { get; } - public override string Description { get; } - public FluentAssertions.Common.CSharpAccessModifier GetterAccessibility { get; } - public bool IsBrowsable { get; } - public System.Type ReflectedType { get; } - public FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } - public object GetValue(object obj) { } - } - public abstract class SelfReferenceEquivalencyAssertionOptions : FluentAssertions.Equivalency.IEquivalencyAssertionOptions - where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions - { - protected SelfReferenceEquivalencyAssertionOptions(FluentAssertions.Equivalency.IEquivalencyAssertionOptions defaults) { } - public bool? CompareRecordsByValue { get; } - public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } - [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] - protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } - public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } - protected TSelf AddMatchingRule(FluentAssertions.Equivalency.IMemberMatchingRule matchingRule) { } - protected TSelf AddSelectionRule(FluentAssertions.Equivalency.IMemberSelectionRule selectionRule) { } - public TSelf AllowingInfiniteRecursion() { } - public TSelf ComparingByMembers(System.Type type) { } - public TSelf ComparingByMembers() { } - public TSelf ComparingByValue(System.Type type) { } - public TSelf ComparingByValue() { } - public TSelf ComparingEnumsByName() { } - public TSelf ComparingEnumsByValue() { } - public TSelf ComparingRecordsByMembers() { } - public TSelf ComparingRecordsByValue() { } - public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } - public TSelf ExcludingFields() { } - public TSelf ExcludingMissingMembers() { } - public TSelf ExcludingNestedObjects() { } - public TSelf ExcludingNonBrowsableMembers() { } - public TSelf ExcludingProperties() { } - public TSelf IgnoringCyclicReferences() { } - public TSelf IgnoringNonBrowsableMembersOnSubject() { } - public TSelf Including(System.Linq.Expressions.Expression> predicate) { } - public TSelf IncludingAllDeclaredProperties() { } - public TSelf IncludingAllRuntimeProperties() { } - public TSelf IncludingFields() { } - public TSelf IncludingInternalFields() { } - public TSelf IncludingInternalProperties() { } - public TSelf IncludingNestedObjects() { } - public TSelf IncludingProperties() { } - public TSelf RespectingDeclaredTypes() { } - public TSelf RespectingRuntimeTypes() { } - public TSelf ThrowingOnMissingMembers() { } - public override string ToString() { } - public TSelf Using(FluentAssertions.Equivalency.IEquivalencyStep equivalencyStep) { } - public TSelf Using(FluentAssertions.Equivalency.IMemberMatchingRule matchingRule) { } - public TSelf Using(FluentAssertions.Equivalency.IMemberSelectionRule selectionRule) { } - public TSelf Using(FluentAssertions.Equivalency.IOrderingRule orderingRule) { } - public FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions.Restriction Using(System.Action> action) { } - public TSelf Using(System.Collections.Generic.IEqualityComparer comparer) { } - public TSelf Using() - where TEqualityComparer : System.Collections.Generic.IEqualityComparer, new () { } - public TSelf WithAutoConversion() { } - public TSelf WithAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } - public TSelf WithStrictOrdering() { } - public TSelf WithStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } - public TSelf WithTracing(FluentAssertions.Equivalency.Tracing.ITraceWriter writer = null) { } - public TSelf WithoutAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } - public void WithoutMatchingRules() { } - public void WithoutSelectionRules() { } - public TSelf WithoutStrictOrdering() { } - public TSelf WithoutStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } - public class Restriction - { - public Restriction(TSelf options, System.Action> action) { } - public TSelf When(System.Linq.Expressions.Expression> predicate) { } - public TSelf WhenTypeIs() - where TMemberType : TMember { } - } - } - public static class SubjectInfoExtensions - { - public static bool WhichGetterDoesNotHave(this FluentAssertions.Equivalency.IMemberInfo memberInfo, FluentAssertions.Common.CSharpAccessModifier accessModifier) { } - public static bool WhichGetterHas(this FluentAssertions.Equivalency.IMemberInfo memberInfo, FluentAssertions.Common.CSharpAccessModifier accessModifier) { } - public static bool WhichSetterDoesNotHave(this FluentAssertions.Equivalency.IMemberInfo memberInfo, FluentAssertions.Common.CSharpAccessModifier accessModifier) { } - public static bool WhichSetterHas(this FluentAssertions.Equivalency.IMemberInfo memberInfo, FluentAssertions.Common.CSharpAccessModifier accessModifier) { } - } -} -namespace FluentAssertions.Equivalency.Steps -{ - public class AssertionRuleEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public AssertionRuleEquivalencyStep(System.Linq.Expressions.Expression> predicate, System.Action> assertion) { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - public override string ToString() { } - } - public class AutoConversionStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public AutoConversionStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - public override string ToString() { } - } - public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DictionaryEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class EnumEqualityStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public EnumEqualityStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class EnumerableEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public EnumerableEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class EqualityComparerEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public EqualityComparerEquivalencyStep(System.Collections.Generic.IEqualityComparer comparer) { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - public override string ToString() { } - } - public class GenericDictionaryEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public GenericDictionaryEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class GenericEnumerableEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public GenericEnumerableEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class ReferenceEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public ReferenceEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class RunAllUserStepsEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public RunAllUserStepsEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class SimpleEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public SimpleEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class StringEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public StringEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class StructuralEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public StructuralEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class ValueTypeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public ValueTypeEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class XAttributeEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public XAttributeEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class XDocumentEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public XDocumentEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class XElementEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public XElementEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } -} -namespace FluentAssertions.Equivalency.Tracing -{ - public delegate string GetTraceMessage(FluentAssertions.Equivalency.INode node); - public interface ITraceWriter - { - System.IDisposable AddBlock(string trace); - void AddSingle(string trace); - string ToString(); - } - public class StringBuilderTraceWriter : FluentAssertions.Equivalency.Tracing.ITraceWriter - { - public StringBuilderTraceWriter() { } - public System.IDisposable AddBlock(string trace) { } - public void AddSingle(string trace) { } - public override string ToString() { } - } - public class Tracer - { - public override string ToString() { } - public System.IDisposable WriteBlock(FluentAssertions.Equivalency.Tracing.GetTraceMessage getTraceMessage) { } - public void WriteLine(FluentAssertions.Equivalency.Tracing.GetTraceMessage getTraceMessage) { } - } -} -namespace FluentAssertions.Events -{ - public class EventAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - { - protected EventAssertions(FluentAssertions.Events.IMonitor monitor) { } - protected override string Identifier { get; } - public FluentAssertions.Events.IMonitor Monitor { get; } - public void NotRaise(string eventName, string because = "", params object[] becauseArgs) { } - public void NotRaisePropertyChangeFor(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Events.IEventRecording Raise(string eventName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Events.IEventRecording RaisePropertyChangeFor(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } - } - public class EventMetadata - { - public EventMetadata(string eventName, System.Type handlerType) { } - public string EventName { get; } - public System.Type HandlerType { get; } - } - public interface IEventRecording : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - System.Type EventHandlerType { get; } - string EventName { get; } - object EventObject { get; } - } - public interface IMonitor : System.IDisposable - { - FluentAssertions.Events.EventMetadata[] MonitoredEvents { get; } - FluentAssertions.Events.OccurredEvent[] OccurredEvents { get; } - T Subject { get; } - void Clear(); - FluentAssertions.Events.IEventRecording GetRecordingFor(string eventName); - FluentAssertions.Events.EventAssertions Should(); - } - public class OccurredEvent - { - public OccurredEvent() { } - public string EventName { get; set; } - public object[] Parameters { get; set; } - public int Sequence { get; set; } - public System.DateTime TimestampUtc { get; set; } - } -} -namespace FluentAssertions.Execution -{ - [System.Serializable] - public class AssertionFailedException : System.Exception - { - public AssertionFailedException(string message) { } - protected AssertionFailedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } - } - public sealed class AssertionScope : FluentAssertions.Execution.IAssertionScope, System.IDisposable - { - public AssertionScope() { } - public AssertionScope(FluentAssertions.Execution.IAssertionStrategy assertionStrategy) { } - public AssertionScope(System.Lazy context) { } - public AssertionScope(string context) { } - public string CallerIdentity { get; } - public System.Lazy Context { get; set; } - public FluentAssertions.Formatting.FormattingOptions FormattingOptions { get; } - public FluentAssertions.Execution.AssertionScope UsingLineBreaks { get; } - public static FluentAssertions.Execution.AssertionScope Current { get; } - public void AddNonReportable(string key, object value) { } - public void AddPreFormattedFailure(string formattedFailureMessage) { } - public void AddReportable(string key, System.Func valueFunc) { } - public void AddReportable(string key, string value) { } - public void AppendTracing(string tracingBlock) { } - public void AssumeSingleCaller() { } - public FluentAssertions.Execution.AssertionScope BecauseOf(FluentAssertions.Execution.Reason reason) { } - public FluentAssertions.Execution.AssertionScope BecauseOf(string because, params object[] becauseArgs) { } - public FluentAssertions.Execution.Continuation ClearExpectation() { } - public string[] Discard() { } - public void Dispose() { } - public FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc) { } - public FluentAssertions.Execution.Continuation FailWith(string message) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } - public FluentAssertions.Execution.AssertionScope ForCondition(bool condition) { } - public FluentAssertions.Execution.AssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } - public T Get(string key) { } - public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } - public bool HasFailures() { } - public FluentAssertions.Execution.AssertionScope WithDefaultIdentifier(string identifier) { } - public FluentAssertions.Execution.AssertionScope WithExpectation(string message, params object[] args) { } - } - public class Continuation - { - public FluentAssertions.Execution.IAssertionScope Then { get; } - public static bool op_Implicit(FluentAssertions.Execution.Continuation continuation) { } - } - public class ContinuationOfGiven - { - public FluentAssertions.Execution.GivenSelector Then { get; } - public static bool op_Implicit(FluentAssertions.Execution.ContinuationOfGiven continuationOfGiven) { } - } - public sealed class ContinuedAssertionScope : FluentAssertions.Execution.IAssertionScope, System.IDisposable - { - public FluentAssertions.Execution.IAssertionScope UsingLineBreaks { get; } - public FluentAssertions.Execution.IAssertionScope BecauseOf(string because, params object[] becauseArgs) { } - public FluentAssertions.Execution.Continuation ClearExpectation() { } - public string[] Discard() { } - public void Dispose() { } - public FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc) { } - public FluentAssertions.Execution.Continuation FailWith(string message) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } - public FluentAssertions.Execution.IAssertionScope ForCondition(bool condition) { } - public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } - public FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier) { } - public FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args) { } - } - public static class Execute - { - public static FluentAssertions.Execution.AssertionScope Assertion { get; } - } - public class FailReason - { - public FailReason(string message, params object[] args) { } - public object[] Args { get; } - public string Message { get; } - } - public class GivenSelector - { - public FluentAssertions.Execution.ContinuationOfGiven ClearExpectation() { } - public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message) { } - public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message, params System.Func[] args) { } - public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message, params object[] args) { } - public FluentAssertions.Execution.GivenSelector ForCondition(System.Func predicate) { } - public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } - } - public interface IAssertionScope : System.IDisposable - { - FluentAssertions.Execution.IAssertionScope UsingLineBreaks { get; } - FluentAssertions.Execution.IAssertionScope BecauseOf(string because, params object[] becauseArgs); - FluentAssertions.Execution.Continuation ClearExpectation(); - string[] Discard(); - FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc); - FluentAssertions.Execution.Continuation FailWith(string message); - FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders); - FluentAssertions.Execution.Continuation FailWith(string message, params object[] args); - FluentAssertions.Execution.IAssertionScope ForCondition(bool condition); - FluentAssertions.Execution.GivenSelector Given(System.Func selector); - FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier); - FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args); - } - public interface IAssertionStrategy - { - System.Collections.Generic.IEnumerable FailureMessages { get; } - System.Collections.Generic.IEnumerable DiscardFailures(); - void HandleFailure(string message); - void ThrowIfAny(System.Collections.Generic.IDictionary context); - } - public interface ICloneable2 - { - object Clone(); - } - public class Reason - { - public Reason(string formattedMessage, object[] arguments) { } - public object[] Arguments { get; set; } - public string FormattedMessage { get; set; } - } -} -namespace FluentAssertions.Extensions -{ - public static class FluentDateTimeExtensions - { - public static System.DateTime AddMicroseconds(this System.DateTime self, long microseconds) { } - public static System.DateTimeOffset AddMicroseconds(this System.DateTimeOffset self, long microseconds) { } - public static System.DateTime AddNanoseconds(this System.DateTime self, long nanoseconds) { } - public static System.DateTimeOffset AddNanoseconds(this System.DateTimeOffset self, long nanoseconds) { } - public static System.DateTime After(this System.TimeSpan timeDifference, System.DateTime sourceDateTime) { } - public static System.DateTime April(this int day, int year) { } - public static System.DateTime AsLocal(this System.DateTime dateTime) { } - public static System.DateTime AsUtc(this System.DateTime dateTime) { } - public static System.DateTime At(this System.DateTime date, System.TimeSpan time) { } - public static System.DateTime At(this System.DateTime date, int hours, int minutes, int seconds = 0, int milliseconds = 0, int microseconds = 0, int nanoseconds = 0) { } - public static System.DateTimeOffset At(this System.DateTimeOffset date, int hours, int minutes, int seconds = 0, int milliseconds = 0, int microseconds = 0, int nanoseconds = 0) { } - public static System.DateTime August(this int day, int year) { } - public static System.DateTime Before(this System.TimeSpan timeDifference, System.DateTime sourceDateTime) { } - public static System.DateTime December(this int day, int year) { } - public static System.DateTime February(this int day, int year) { } - public static System.DateTime January(this int day, int year) { } - public static System.DateTime July(this int day, int year) { } - public static System.DateTime June(this int day, int year) { } - public static System.DateTime March(this int day, int year) { } - public static System.DateTime May(this int day, int year) { } - public static int Microsecond(this System.DateTime self) { } - public static int Microsecond(this System.DateTimeOffset self) { } - public static int Nanosecond(this System.DateTime self) { } - public static int Nanosecond(this System.DateTimeOffset self) { } - public static System.DateTime November(this int day, int year) { } - public static System.DateTime October(this int day, int year) { } - public static System.DateTime September(this int day, int year) { } - public static System.DateTimeOffset WithOffset(this System.DateTime self, System.TimeSpan offset) { } - } - public static class FluentTimeSpanExtensions - { - public const long TicksPerMicrosecond = 10; - public const double TicksPerNanosecond = 0.01D; - public static System.TimeSpan And(this System.TimeSpan sourceTime, System.TimeSpan offset) { } - public static System.TimeSpan Days(this double days) { } - public static System.TimeSpan Days(this int days) { } - public static System.TimeSpan Days(this int days, System.TimeSpan offset) { } - public static System.TimeSpan Hours(this double hours) { } - public static System.TimeSpan Hours(this int hours) { } - public static System.TimeSpan Hours(this int hours, System.TimeSpan offset) { } - public static int Microseconds(this System.TimeSpan self) { } - public static System.TimeSpan Microseconds(this int microseconds) { } - public static System.TimeSpan Microseconds(this long microseconds) { } - public static System.TimeSpan Milliseconds(this double milliseconds) { } - public static System.TimeSpan Milliseconds(this int milliseconds) { } - public static System.TimeSpan Minutes(this double minutes) { } - public static System.TimeSpan Minutes(this int minutes) { } - public static System.TimeSpan Minutes(this int minutes, System.TimeSpan offset) { } - public static int Nanoseconds(this System.TimeSpan self) { } - public static System.TimeSpan Nanoseconds(this int nanoseconds) { } - public static System.TimeSpan Nanoseconds(this long nanoseconds) { } - public static System.TimeSpan Seconds(this double seconds) { } - public static System.TimeSpan Seconds(this int seconds) { } - public static System.TimeSpan Seconds(this int seconds, System.TimeSpan offset) { } - public static System.TimeSpan Ticks(this int ticks) { } - public static System.TimeSpan Ticks(this long ticks) { } - public static double TotalMicroseconds(this System.TimeSpan self) { } - public static double TotalNanoseconds(this System.TimeSpan self) { } - } - public static class OccurrenceConstraintExtensions - { - public static FluentAssertions.OccurrenceConstraint TimesExactly(this int times) { } - public static FluentAssertions.OccurrenceConstraint TimesOrLess(this int times) { } - public static FluentAssertions.OccurrenceConstraint TimesOrMore(this int times) { } - } -} -namespace FluentAssertions.Formatting -{ - public class AggregateExceptionValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public AggregateExceptionValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class AttributeBasedFormatter : FluentAssertions.Formatting.IValueFormatter - { - public AttributeBasedFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class ByteValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public ByteValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class DateTimeOffsetValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public DateTimeOffsetValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class DecimalValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public DecimalValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class DefaultValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public DefaultValueFormatter() { } - public virtual bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - protected virtual System.Reflection.MemberInfo[] GetMembers(System.Type type) { } - protected virtual string TypeDisplayName(System.Type type) { } - } - public class DictionaryValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public DictionaryValueFormatter() { } - protected virtual int MaxItems { get; } - public virtual bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class DoubleValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public DoubleValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class EnumValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public EnumValueFormatter() { } - public virtual bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class EnumerableValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public EnumerableValueFormatter() { } - protected virtual int MaxItems { get; } - public virtual bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class ExceptionValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public ExceptionValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class ExpressionValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public ExpressionValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public delegate void FormatChild(string childPath, object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph); - public class FormattedObjectGraph - { - public FormattedObjectGraph(int maxLines) { } - public int LineCount { get; } - public static int SpacesPerIndentation { get; } - public void AddFragment(string fragment) { } - public void AddFragmentOnNewLine(string fragment) { } - public void AddLine(string line) { } - public override string ToString() { } - public System.IDisposable WithIndentation() { } - } - public static class Formatter - { - public static System.Collections.Generic.IEnumerable Formatters { get; } - public static void AddFormatter(FluentAssertions.Formatting.IValueFormatter formatter) { } - public static void RemoveFormatter(FluentAssertions.Formatting.IValueFormatter formatter) { } - public static string ToString(object value, FluentAssertions.Formatting.FormattingOptions options = null) { } - } - public class FormattingContext - { - public FormattingContext() { } - public bool UseLineBreaks { get; set; } - } - public class FormattingOptions - { - public FormattingOptions() { } - public int MaxDepth { get; set; } - public int MaxLines { get; set; } - public bool UseLineBreaks { get; set; } - } - public class GuidValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public GuidValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public interface IValueFormatter - { - bool CanHandle(object value); - void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild); - } - public class Int16ValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public Int16ValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class Int32ValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public Int32ValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class Int64ValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public Int64ValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class MaxLinesExceededException : System.Exception - { - public MaxLinesExceededException() { } - public MaxLinesExceededException(string message) { } - public MaxLinesExceededException(string message, System.Exception innerException) { } - } - public class MultidimensionalArrayFormatter : FluentAssertions.Formatting.IValueFormatter - { - public MultidimensionalArrayFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class NullValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public NullValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class PredicateLambdaExpressionValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public PredicateLambdaExpressionValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class PropertyInfoFormatter : FluentAssertions.Formatting.IValueFormatter - { - public PropertyInfoFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class SByteValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public SByteValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class SingleValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public SingleValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class StringValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public StringValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class TaskFormatter : FluentAssertions.Formatting.IValueFormatter - { - public TaskFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class TimeSpanValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public TimeSpanValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class UInt16ValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public UInt16ValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class UInt32ValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public UInt32ValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class UInt64ValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public UInt64ValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - [System.AttributeUsage(System.AttributeTargets.Method)] - public class ValueFormatterAttribute : System.Attribute - { - public ValueFormatterAttribute() { } - } - public class XAttributeValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public XAttributeValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class XDocumentValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public XDocumentValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class XElementValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public XElementValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class XmlReaderValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public XmlReaderValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } -} -namespace FluentAssertions.Numeric -{ - public class ComparableTypeAssertions : FluentAssertions.Numeric.ComparableTypeAssertions> - { - public ComparableTypeAssertions(System.IComparable value) { } - } - public class ComparableTypeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions, TAssertions> - where TAssertions : FluentAssertions.Numeric.ComparableTypeAssertions - { - public ComparableTypeAssertions(System.IComparable value) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint Be(T 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 BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, 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) { } - public FluentAssertions.AndConstraint NotBeRankedEquallyTo(T unexpected, string because = "", params object[] becauseArgs) { } - } - public class NullableNumericAssertions : FluentAssertions.Numeric.NullableNumericAssertions> - where T : struct, System.IComparable - { - public NullableNumericAssertions(T? value) { } - } - public class NullableNumericAssertions : FluentAssertions.Numeric.NumericAssertions - where T : struct, System.IComparable - where TAssertions : FluentAssertions.Numeric.NullableNumericAssertions - { - public NullableNumericAssertions(T? value) { } - public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } - } - public class NumericAssertions : FluentAssertions.Numeric.NumericAssertions> - where T : struct, System.IComparable - { - public NumericAssertions(T value) { } - } - public class NumericAssertions - where T : struct, System.IComparable - where TAssertions : FluentAssertions.Numeric.NumericAssertions - { - public NumericAssertions(T value) { } - public T? Subject { get; } - public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, 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 BeNegative(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOfType(System.Type expectedType, 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 BePositive(string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(T unexpected, 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) { } - public FluentAssertions.AndConstraint NotBeOfType(System.Type unexpectedType, string because = "", params object[] becauseArgs) { } - } -} -namespace FluentAssertions.Primitives -{ - public class BooleanAssertions : FluentAssertions.Primitives.BooleanAssertions - { - public BooleanAssertions(bool? value) { } - } - public class BooleanAssertions - where TAssertions : FluentAssertions.Primitives.BooleanAssertions - { - public BooleanAssertions(bool? value) { } - public bool? Subject { get; } - public FluentAssertions.AndConstraint Be(bool expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeFalse(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeTrue(string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint Imply(bool consequent, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(bool unexpected, string because = "", params object[] becauseArgs) { } - } - public class DateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions - { - public DateTimeAssertions(System.DateTime? value) { } - } - public class DateTimeAssertions - where TAssertions : FluentAssertions.Primitives.DateTimeAssertions - { - public DateTimeAssertions(System.DateTime? value) { } - public System.DateTime? Subject { get; } - public FluentAssertions.AndConstraint Be(System.DateTime expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Be(System.DateTime? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeAfter(System.DateTime expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Primitives.DateTimeRangeAssertions BeAtLeast(System.TimeSpan timeSpan) { } - public FluentAssertions.AndConstraint BeBefore(System.DateTime expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeCloseTo(System.DateTime nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Primitives.DateTimeRangeAssertions BeExactly(System.TimeSpan timeSpan) { } - public FluentAssertions.AndConstraint BeIn(System.DateTimeKind expectedKind, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Primitives.DateTimeRangeAssertions BeLessThan(System.TimeSpan timeSpan) { } - public FluentAssertions.Primitives.DateTimeRangeAssertions BeMoreThan(System.TimeSpan timeSpan) { } - public FluentAssertions.AndConstraint BeOnOrAfter(System.DateTime expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOnOrBefore(System.DateTime expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOneOf(params System.DateTime[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(params System.Nullable[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSameDateAs(System.DateTime expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Primitives.DateTimeRangeAssertions BeWithin(System.TimeSpan timeSpan) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveMonth(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveSecond(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveYear(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(System.DateTime? unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAfter(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeBefore(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeCloseTo(System.DateTime distantTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeOnOrAfter(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeOnOrBefore(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeSameDateAs(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveDay(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveHour(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveMinute(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveMonth(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveSecond(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveYear(int unexpected, string because = "", params object[] becauseArgs) { } - } - public class DateTimeOffsetAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions - { - public DateTimeOffsetAssertions(System.DateTimeOffset? value) { } - } - public class DateTimeOffsetAssertions - where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions - { - public DateTimeOffsetAssertions(System.DateTimeOffset? value) { } - public System.DateTimeOffset? Subject { get; } - public FluentAssertions.AndConstraint Be(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Be(System.DateTimeOffset? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeAfter(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Primitives.DateTimeOffsetRangeAssertions BeAtLeast(System.TimeSpan timeSpan) { } - public FluentAssertions.AndConstraint BeBefore(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeCloseTo(System.DateTimeOffset nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Primitives.DateTimeOffsetRangeAssertions BeExactly(System.TimeSpan timeSpan) { } - public FluentAssertions.AndConstraint BeExactly(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeExactly(System.DateTimeOffset? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Primitives.DateTimeOffsetRangeAssertions BeLessThan(System.TimeSpan timeSpan) { } - public FluentAssertions.Primitives.DateTimeOffsetRangeAssertions BeMoreThan(System.TimeSpan timeSpan) { } - public FluentAssertions.AndConstraint BeOnOrAfter(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOnOrBefore(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOneOf(params System.DateTimeOffset[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(params System.Nullable[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSameDateAs(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Primitives.DateTimeOffsetRangeAssertions BeWithin(System.TimeSpan timeSpan) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveMonth(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveOffset(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveSecond(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveYear(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(System.DateTimeOffset? unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAfter(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeBefore(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeCloseTo(System.DateTimeOffset distantTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeExactly(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeExactly(System.DateTimeOffset? unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeOnOrAfter(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeOnOrBefore(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeSameDateAs(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveDay(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveHour(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveMinute(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveMonth(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveOffset(System.TimeSpan unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveSecond(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveYear(int unexpected, string because = "", params object[] becauseArgs) { } - } - public class DateTimeOffsetRangeAssertions - where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions - { - protected DateTimeOffsetRangeAssertions(TAssertions parentAssertions, System.DateTimeOffset? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } - public FluentAssertions.AndConstraint After(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Before(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - } - public class DateTimeRangeAssertions - where TAssertions : FluentAssertions.Primitives.DateTimeAssertions - { - protected DateTimeRangeAssertions(TAssertions parentAssertions, System.DateTime? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } - public FluentAssertions.AndConstraint After(System.DateTime target, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Before(System.DateTime target, string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - } - public class EnumAssertions : FluentAssertions.Primitives.EnumAssertions> - where TEnum : struct, System.Enum - { - public EnumAssertions(TEnum subject) { } - } - public class EnumAssertions - where TEnum : struct, System.Enum - where TAssertions : FluentAssertions.Primitives.EnumAssertions - { - public EnumAssertions(TEnum subject) { } - public TEnum? Subject { get; } - public FluentAssertions.AndConstraint Be(TEnum expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Be(TEnum? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeDefined(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOneOf(params TEnum[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint HaveFlag(TEnum expectedFlag, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveSameNameAs(T expected, string because = "", params object[] becauseArgs) - where T : struct, System.Enum { } - public FluentAssertions.AndConstraint HaveSameValueAs(T expected, string because = "", params object[] becauseArgs) - where T : struct, System.Enum { } - public FluentAssertions.AndConstraint HaveValue(decimal expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(TEnum unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(TEnum? unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeDefined(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveFlag(TEnum unexpectedFlag, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveSameNameAs(T unexpected, string because = "", params object[] becauseArgs) - where T : struct, System.Enum { } - public FluentAssertions.AndConstraint NotHaveSameValueAs(T unexpected, string because = "", params object[] becauseArgs) - where T : struct, System.Enum { } - public FluentAssertions.AndConstraint NotHaveValue(decimal unexpected, string because = "", params object[] becauseArgs) { } - } - public class GuidAssertions : FluentAssertions.Primitives.GuidAssertions - { - public GuidAssertions(System.Guid? value) { } - } - public class GuidAssertions - where TAssertions : FluentAssertions.Primitives.GuidAssertions - { - public GuidAssertions(System.Guid? value) { } - public System.Guid? Subject { get; } - public FluentAssertions.AndConstraint Be(System.Guid expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint NotBe(System.Guid unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } - } - public class HttpResponseMessageAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions - { - public HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value) { } - } - public class HttpResponseMessageAssertions : FluentAssertions.Primitives.ObjectAssertions - where TAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions - { - protected HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeRedirection(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSuccessful(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveClientError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveServerError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveStatusCode(System.Net.HttpStatusCode expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveStatusCode(System.Net.HttpStatusCode unexpected, string because = "", params object[] becauseArgs) { } - } - public class NullableBooleanAssertions : FluentAssertions.Primitives.NullableBooleanAssertions - { - public NullableBooleanAssertions(bool? value) { } - } - public class NullableBooleanAssertions : FluentAssertions.Primitives.BooleanAssertions - where TAssertions : FluentAssertions.Primitives.NullableBooleanAssertions - { - public NullableBooleanAssertions(bool? value) { } - public FluentAssertions.AndConstraint Be(bool? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(bool? unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeFalse(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeTrue(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } - } - public class NullableDateTimeAssertions : FluentAssertions.Primitives.NullableDateTimeAssertions - { - public NullableDateTimeAssertions(System.DateTime? expected) { } - } - public class NullableDateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions - where TAssertions : FluentAssertions.Primitives.NullableDateTimeAssertions - { - public NullableDateTimeAssertions(System.DateTime? expected) { } - public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } - } - public class NullableDateTimeOffsetAssertions : FluentAssertions.Primitives.NullableDateTimeOffsetAssertions - { - public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected) { } - } - public class NullableDateTimeOffsetAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions - where TAssertions : FluentAssertions.Primitives.NullableDateTimeOffsetAssertions - { - public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected) { } - public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } - } - public class NullableEnumAssertions : FluentAssertions.Primitives.NullableEnumAssertions> - where TEnum : struct, System.Enum - { - public NullableEnumAssertions(TEnum? subject) { } - } - public class NullableEnumAssertions : FluentAssertions.Primitives.EnumAssertions - where TEnum : struct, System.Enum - where TAssertions : FluentAssertions.Primitives.NullableEnumAssertions - { - public NullableEnumAssertions(TEnum? subject) { } - public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveValue(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint NotBeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } - } - public class NullableGuidAssertions : FluentAssertions.Primitives.NullableGuidAssertions - { - public NullableGuidAssertions(System.Guid? value) { } - } - public class NullableGuidAssertions : FluentAssertions.Primitives.GuidAssertions - where TAssertions : FluentAssertions.Primitives.NullableGuidAssertions - { - public NullableGuidAssertions(System.Guid? value) { } - public FluentAssertions.AndConstraint Be(System.Guid? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } - } - public class NullableSimpleTimeSpanAssertions : FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions - { - public NullableSimpleTimeSpanAssertions(System.TimeSpan? value) { } - } - public class NullableSimpleTimeSpanAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions - where TAssertions : FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions - { - public NullableSimpleTimeSpanAssertions(System.TimeSpan? value) { } - public FluentAssertions.AndConstraint Be(System.TimeSpan? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } - } - public class ObjectAssertions : FluentAssertions.Primitives.ObjectAssertions - { - public ObjectAssertions(object value) { } - public FluentAssertions.AndConstraint Be(TExpectation expected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(TExpectation unexpected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } - } - public class ObjectAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - where TAssertions : FluentAssertions.Primitives.ObjectAssertions - { - public ObjectAssertions(TSubject value) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Be(TSubject expected, System.Collections.Generic.IEqualityComparer comparer, 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 FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, System.Collections.Generic.IEqualityComparer comparer, 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 NotBe(TSubject unexpected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - } - public abstract class ReferenceTypeAssertions - where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - protected ReferenceTypeAssertions(TSubject subject) { } - protected abstract string Identifier { get; } - public TSubject Subject { get; } - public FluentAssertions.AndConstraint BeAssignableTo(System.Type type, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint BeAssignableTo(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOfType(System.Type expectedType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint BeOfType(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSameAs(TSubject expected, string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) - where T : TSubject { } - public FluentAssertions.AndConstraint NotBeAssignableTo(System.Type type, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAssignableTo(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeOfType(System.Type unexpectedType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeOfType(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeSameAs(TSubject unexpected, string because = "", params object[] becauseArgs) { } - } - public class SimpleTimeSpanAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions - { - public SimpleTimeSpanAssertions(System.TimeSpan? value) { } - } - public class SimpleTimeSpanAssertions - where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions - { - public SimpleTimeSpanAssertions(System.TimeSpan? value) { } - public System.TimeSpan? Subject { get; } - public FluentAssertions.AndConstraint Be(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeNegative(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BePositive(string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint NotBe(System.TimeSpan unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeCloseTo(System.TimeSpan distantTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - } - public class StringAssertions : FluentAssertions.Primitives.StringAssertions - { - public StringAssertions(string value) { } - } - public class StringAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - where TAssertions : FluentAssertions.Primitives.StringAssertions - { - public StringAssertions(string value) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLowerCased(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeNullOrEmpty(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeNullOrWhiteSpace(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOneOf(params string[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeUpperCased(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Contain(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Contain(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainAll(params string[] values) { } - public FluentAssertions.AndConstraint ContainAll(System.Collections.Generic.IEnumerable values, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainAny(params string[] values) { } - public FluentAssertions.AndConstraint ContainAny(System.Collections.Generic.IEnumerable values, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint EndWith(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint EndWithEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveLength(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Match(string wildcardPattern, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchRegex(string regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchRegex(System.Text.RegularExpressions.Regex regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeLowerCased(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNullOrEmpty(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNullOrWhiteSpace(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeUpperCased(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContain(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainAll(params string[] values) { } - public FluentAssertions.AndConstraint NotContainAll(System.Collections.Generic.IEnumerable values, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainAny(params string[] values) { } - public FluentAssertions.AndConstraint NotContainAny(System.Collections.Generic.IEnumerable values, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotEndWith(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotEndWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotMatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotMatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotStartWith(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint StartWith(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint StartWithEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } - } - public enum TimeSpanCondition - { - MoreThan = 0, - AtLeast = 1, - Exactly = 2, - Within = 3, - LessThan = 4, - } -} -namespace FluentAssertions.Reflection -{ - public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public AssemblyAssertions(System.Reflection.Assembly assembly) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - } -} -namespace FluentAssertions.Specialized -{ - public class ActionAssertions : FluentAssertions.Specialized.DelegateAssertions - { - public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } - protected override string Identifier { get; } - protected override void InvokeSubject() { } - } - public class AsyncFunctionAssertions : FluentAssertions.Specialized.DelegateAssertionsBase, TAssertions> - where TTask : System.Threading.Tasks.Task - where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions - { - [System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" + - "e removed in Version 7.")] - public AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - [System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" + - "e made protected in Version 7.")] - public AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } - protected override string Identifier { get; } - public System.Threading.Tasks.Task> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public System.Threading.Tasks.Task> ThrowAsync(string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public System.Threading.Tasks.Task> ThrowExactlyAsync(string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public System.Threading.Tasks.Task> ThrowWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) - where TException : System.Exception { } - } - public abstract class DelegateAssertionsBase : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDelegate : System.Delegate - where TAssertions : FluentAssertions.Specialized.DelegateAssertionsBase - { - protected FluentAssertions.AndConstraint NotThrowInternal(System.Exception exception, string because, object[] becauseArgs) { } - protected FluentAssertions.AndConstraint NotThrowInternal(System.Exception exception, string because, object[] becauseArgs) - where TException : System.Exception { } - protected FluentAssertions.Specialized.ExceptionAssertions ThrowInternal(System.Exception exception, string because, object[] becauseArgs) - where TException : System.Exception { } - } - public abstract class DelegateAssertions : FluentAssertions.Specialized.DelegateAssertionsBase - where TDelegate : System.Delegate - where TAssertions : FluentAssertions.Specialized.DelegateAssertions - { - protected DelegateAssertions(TDelegate @delegate, FluentAssertions.Specialized.IExtractExceptions extractor) { } - protected abstract void InvokeSubject(); - public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Specialized.ExceptionAssertions Throw(string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public FluentAssertions.Specialized.ExceptionAssertions ThrowExactly(string because = "", params object[] becauseArgs) - where TException : System.Exception { } - } - public class ExceptionAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions, FluentAssertions.Specialized.ExceptionAssertions> - where TException : System.Exception - { - public ExceptionAssertions(System.Collections.Generic.IEnumerable exceptions) { } - public TException And { get; } - protected override string Identifier { get; } - public TException Which { get; } - public FluentAssertions.Specialized.ExceptionAssertions Where(System.Linq.Expressions.Expression> exceptionExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Specialized.ExceptionAssertions WithInnerException(System.Type innerException, string because = "", params object[] becauseArgs) { } - public virtual FluentAssertions.Specialized.ExceptionAssertions WithInnerException(string because = "", params object[] becauseArgs) - where TInnerException : System.Exception { } - public FluentAssertions.Specialized.ExceptionAssertions WithInnerExceptionExactly(System.Type innerException, string because = "", params object[] becauseArgs) { } - public virtual FluentAssertions.Specialized.ExceptionAssertions WithInnerExceptionExactly(string because = "", params object[] becauseArgs) - where TInnerException : System.Exception { } - public virtual FluentAssertions.Specialized.ExceptionAssertions WithMessage(string expectedWildcardPattern, string because = "", params object[] becauseArgs) { } - } - public class ExecutionTime - { - public ExecutionTime(System.Action action, FluentAssertions.Common.StartTimer createTimer) { } - public ExecutionTime(System.Func action, FluentAssertions.Common.StartTimer createTimer) { } - protected ExecutionTime(System.Action action, string actionDescription, FluentAssertions.Common.StartTimer createTimer) { } - protected ExecutionTime(System.Func action, string actionDescription, FluentAssertions.Common.StartTimer createTimer) { } - } - public class ExecutionTimeAssertions - { - public ExecutionTimeAssertions(FluentAssertions.Specialized.ExecutionTime executionTime) { } - public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan expectedDuration, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - } - public class FunctionAssertions : FluentAssertions.Specialized.DelegateAssertions, FluentAssertions.Specialized.FunctionAssertions> - { - public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } - protected override string Identifier { get; } - protected override void InvokeSubject() { } - public FluentAssertions.AndWhichConstraint, T> NotThrow(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, T> NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } - } - public class GenericAsyncFunctionAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions, FluentAssertions.Specialized.GenericAsyncFunctionAssertions> - { - public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } - public System.Threading.Tasks.Task, TResult>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task, TResult>> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task, TResult>> NotThrowAsync(string because = "", params object[] becauseArgs) { } - } - public interface IExtractExceptions - { - System.Collections.Generic.IEnumerable OfType(System.Exception actualException) - where T : System.Exception; - } - public class MemberExecutionTime : FluentAssertions.Specialized.ExecutionTime - { - public MemberExecutionTime(T subject, System.Linq.Expressions.Expression> action, FluentAssertions.Common.StartTimer createTimer) { } - } - public class NonGenericAsyncFunctionAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions - { - public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } - } - public class TaskCompletionSourceAssertionsBase - { - protected TaskCompletionSourceAssertionsBase(FluentAssertions.Common.IClock clock) { } - public override bool Equals(object obj) { } - } - public class TaskCompletionSourceAssertions : FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase - { - public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs) { } - public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Common.IClock clock) { } - public System.Threading.Tasks.Task, T>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task>> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } - } -} -namespace FluentAssertions.Streams -{ - public class BufferedStreamAssertions : FluentAssertions.Streams.BufferedStreamAssertions - { - public BufferedStreamAssertions(System.IO.BufferedStream stream) { } - } - public class BufferedStreamAssertions : FluentAssertions.Streams.StreamAssertions - where TAssertions : FluentAssertions.Streams.BufferedStreamAssertions - { - public BufferedStreamAssertions(System.IO.BufferedStream stream) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint HaveBufferSize(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveBufferSize(int unexpected, string because = "", params object[] becauseArgs) { } - } - public class StreamAssertions : FluentAssertions.Streams.StreamAssertions - { - public StreamAssertions(System.IO.Stream stream) { } - } - public class StreamAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - where TSubject : System.IO.Stream - where TAssertions : FluentAssertions.Streams.StreamAssertions - { - public StreamAssertions(TSubject stream) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeReadOnly(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeReadable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSeekable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeWritable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeWriteOnly(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveLength(long expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HavePosition(long expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeReadOnly(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeReadable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeSeekable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeWritable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeWriteOnly(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveLength(long unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHavePosition(long unexpected, string because = "", params object[] becauseArgs) { } - } -} -namespace FluentAssertions.Types -{ - public static class AllTypes - { - public static FluentAssertions.Types.TypeSelector From(System.Reflection.Assembly assembly) { } - } - public class ConstructorInfoAssertions : FluentAssertions.Types.MethodBaseAssertions - { - public ConstructorInfoAssertions(System.Reflection.ConstructorInfo constructorInfo) { } - protected override string Identifier { get; } - } - public abstract class MemberInfoAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - where TSubject : System.Reflection.MemberInfo - where TAssertions : FluentAssertions.Types.MemberInfoAssertions - { - protected MemberInfoAssertions(TSubject subject) { } - protected override string Identifier { get; } - public FluentAssertions.AndWhichConstraint, TAttribute> BeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndWhichConstraint, TAttribute> BeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - } - public abstract class MethodBaseAssertions : FluentAssertions.Types.MemberInfoAssertions - where TSubject : System.Reflection.MethodBase - where TAssertions : FluentAssertions.Types.MethodBaseAssertions - { - protected MethodBaseAssertions(TSubject subject) { } - public FluentAssertions.AndConstraint HaveAccessModifier(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveAccessModifier(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } - } - public class MethodInfoAssertions : FluentAssertions.Types.MethodBaseAssertions - { - public MethodInfoAssertions(System.Reflection.MethodInfo methodInfo) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeAsync(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAsync(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> NotReturn(System.Type returnType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> NotReturn(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> NotReturnVoid(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> Return(System.Type returnType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> Return(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> ReturnVoid(string because = "", params object[] becauseArgs) { } - } - public class MethodInfoSelector : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - public MethodInfoSelector(System.Collections.Generic.IEnumerable types) { } - public MethodInfoSelector(System.Type type) { } - public FluentAssertions.Types.MethodInfoSelector ThatArePublicOrInternal { get; } - public FluentAssertions.Types.MethodInfoSelector ThatDoNotReturnVoid { get; } - public FluentAssertions.Types.MethodInfoSelector ThatReturnVoid { get; } - public System.Collections.Generic.IEnumerator GetEnumerator() { } - public FluentAssertions.Types.TypeSelector ReturnTypes() { } - public FluentAssertions.Types.MethodInfoSelector ThatAreAbstract() { } - public FluentAssertions.Types.MethodInfoSelector ThatAreAsync() { } - public FluentAssertions.Types.MethodInfoSelector ThatAreDecoratedWith() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.MethodInfoSelector ThatAreDecoratedWithOrInherit() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.MethodInfoSelector ThatAreNotAbstract() { } - public FluentAssertions.Types.MethodInfoSelector ThatAreNotAsync() { } - public FluentAssertions.Types.MethodInfoSelector ThatAreNotDecoratedWith() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.MethodInfoSelector ThatAreNotDecoratedWithOrInherit() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.MethodInfoSelector ThatAreNotStatic() { } - public FluentAssertions.Types.MethodInfoSelector ThatAreNotVirtual() { } - public FluentAssertions.Types.MethodInfoSelector ThatAreStatic() { } - public FluentAssertions.Types.MethodInfoSelector ThatAreVirtual() { } - public FluentAssertions.Types.MethodInfoSelector ThatDoNotReturn() { } - public FluentAssertions.Types.MethodInfoSelector ThatReturn() { } - public System.Reflection.MethodInfo[] ToArray() { } - } - public class MethodInfoSelectorAssertions - { - public MethodInfoSelectorAssertions(params System.Reflection.MethodInfo[] methods) { } - protected string Context { get; } - public System.Collections.Generic.IEnumerable SubjectMethods { get; } - public FluentAssertions.AndConstraint Be(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeAsync(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint BeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint NotBe(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAsync(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) { } - } - public class PropertyInfoAssertions : FluentAssertions.Types.MemberInfoAssertions - { - public PropertyInfoAssertions(System.Reflection.PropertyInfo propertyInfo) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeReadable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeReadable(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeWritable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeWritable(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeReadable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeWritable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotReturn(System.Type propertyType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotReturn(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Return(System.Type propertyType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Return(string because = "", params object[] becauseArgs) { } - } - public class PropertyInfoSelector : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - public PropertyInfoSelector(System.Collections.Generic.IEnumerable types) { } - public PropertyInfoSelector(System.Type type) { } - public FluentAssertions.Types.PropertyInfoSelector ThatAreAbstract { get; } - public FluentAssertions.Types.PropertyInfoSelector ThatAreNotAbstract { get; } - public FluentAssertions.Types.PropertyInfoSelector ThatAreNotStatic { get; } - public FluentAssertions.Types.PropertyInfoSelector ThatAreNotVirtual { get; } - public FluentAssertions.Types.PropertyInfoSelector ThatArePublicOrInternal { get; } - public FluentAssertions.Types.PropertyInfoSelector ThatAreStatic { get; } - public FluentAssertions.Types.PropertyInfoSelector ThatAreVirtual { get; } - public System.Collections.Generic.IEnumerator GetEnumerator() { } - public FluentAssertions.Types.PropertyInfoSelector NotOfType() { } - public FluentAssertions.Types.PropertyInfoSelector OfType() { } - public FluentAssertions.Types.TypeSelector ReturnTypes() { } - public FluentAssertions.Types.PropertyInfoSelector ThatAreDecoratedWith() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.PropertyInfoSelector ThatAreDecoratedWithOrInherit() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.PropertyInfoSelector ThatAreNotDecoratedWith() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.PropertyInfoSelector ThatAreNotDecoratedWithOrInherit() - where TAttribute : System.Attribute { } - public System.Reflection.PropertyInfo[] ToArray() { } - } - public class PropertyInfoSelectorAssertions - { - public PropertyInfoSelectorAssertions(params System.Reflection.PropertyInfo[] properties) { } - protected string Context { get; } - public System.Collections.Generic.IEnumerable SubjectProperties { get; } - public FluentAssertions.AndConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeWritable(string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeWritable(string because = "", params object[] becauseArgs) { } - } - public class TypeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public TypeAssertions(System.Type type) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint Be(System.Type expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Be(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeAbstract(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeAssignableTo(System.Type type, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeAssignableTo(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndWhichConstraint BeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndWhichConstraint BeDecoratedWithOrInherit(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndWhichConstraint BeDecoratedWithOrInherit(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint BeDerivedFrom(System.Type baseType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeDerivedFrom(string because = "", params object[] becauseArgs) - where TBaseClass : class { } - public FluentAssertions.AndConstraint BeSealed(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeStatic(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAccessModifier(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveConstructor(System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveDefaultConstructor(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveExplicitConversionOperator(System.Type sourceType, System.Type targetType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveExplicitConversionOperator(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveExplicitMethod(System.Type interfaceType, string name, System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveExplicitMethod(string name, System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) - where TInterface : class { } - public FluentAssertions.AndConstraint HaveExplicitProperty(System.Type interfaceType, string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveExplicitProperty(string name, string because = "", params object[] becauseArgs) - where TInterface : class { } - public FluentAssertions.AndWhichConstraint HaveImplicitConversionOperator(System.Type sourceType, System.Type targetType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveImplicitConversionOperator(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveIndexer(System.Type indexerType, System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveMethod(string name, System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveProperty(System.Type propertyType, string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveProperty(string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Implement(System.Type interfaceType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Implement(string because = "", params object[] becauseArgs) - where TInterface : class { } - public FluentAssertions.AndConstraint NotBe(System.Type unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAbstract(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAssignableTo(System.Type type, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAssignableTo(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWithOrInherit(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWithOrInherit(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDerivedFrom(System.Type baseType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeDerivedFrom(string because = "", params object[] becauseArgs) - where TBaseClass : class { } - public FluentAssertions.AndConstraint NotBeSealed(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeStatic(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveAccessModifier(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint NotHaveConstructor(System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint NotHaveDefaultConstructor(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveExplicitConversionOperator(System.Type sourceType, System.Type targetType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveExplicitConversionOperator(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveExplicitMethod(System.Type interfaceType, string name, System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveExplicitMethod(string name, System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) - where TInterface : class { } - public FluentAssertions.AndConstraint NotHaveExplicitProperty(System.Type interfaceType, string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveExplicitProperty(string name, string because = "", params object[] becauseArgs) - where TInterface : class { } - public FluentAssertions.AndConstraint NotHaveImplicitConversionOperator(System.Type sourceType, System.Type targetType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveImplicitConversionOperator(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveIndexer(System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveMethod(string name, System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveProperty(string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotImplement(System.Type interfaceType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotImplement(string because = "", params object[] becauseArgs) - where TInterface : class { } - } - public class TypeSelector : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - public TypeSelector(System.Collections.Generic.IEnumerable types) { } - public TypeSelector(System.Type type) { } - public System.Collections.Generic.IEnumerator GetEnumerator() { } - public FluentAssertions.Types.TypeSelector ThatAreAbstract() { } - public FluentAssertions.Types.TypeSelector ThatAreClasses() { } - public FluentAssertions.Types.TypeSelector ThatAreDecoratedWith() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.TypeSelector ThatAreDecoratedWithOrInherit() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.TypeSelector ThatAreInNamespace(string @namespace) { } - public FluentAssertions.Types.TypeSelector ThatAreInterfaces() { } - public FluentAssertions.Types.TypeSelector ThatAreNotAbstract() { } - public FluentAssertions.Types.TypeSelector ThatAreNotClasses() { } - public FluentAssertions.Types.TypeSelector ThatAreNotDecoratedWith() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.TypeSelector ThatAreNotDecoratedWithOrInherit() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.TypeSelector ThatAreNotInNamespace(string @namespace) { } - public FluentAssertions.Types.TypeSelector ThatAreNotInterfaces() { } - public FluentAssertions.Types.TypeSelector ThatAreNotSealed() { } - public FluentAssertions.Types.TypeSelector ThatAreNotStatic() { } - public FluentAssertions.Types.TypeSelector ThatAreNotUnderNamespace(string @namespace) { } - public FluentAssertions.Types.TypeSelector ThatAreNotValueTypes() { } - public FluentAssertions.Types.TypeSelector ThatAreSealed() { } - public FluentAssertions.Types.TypeSelector ThatAreStatic() { } - public FluentAssertions.Types.TypeSelector ThatAreUnderNamespace(string @namespace) { } - public FluentAssertions.Types.TypeSelector ThatAreValueTypes() { } - public FluentAssertions.Types.TypeSelector ThatDeriveFrom() { } - public FluentAssertions.Types.TypeSelector ThatDoNotDeriveFrom() { } - public FluentAssertions.Types.TypeSelector ThatDoNotImplement() { } - public FluentAssertions.Types.TypeSelector ThatImplement() { } - public FluentAssertions.Types.TypeSelector ThatSatisfy(System.Func predicate) { } - public System.Type[] ToArray() { } - public FluentAssertions.Types.TypeSelector UnwrapEnumerableTypes() { } - public FluentAssertions.Types.TypeSelector UnwrapTaskTypes() { } - } - public class TypeSelectorAssertions - { - public TypeSelectorAssertions(params System.Type[] types) { } - public System.Collections.Generic.IEnumerable Subject { get; } - public FluentAssertions.AndConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint BeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint BeDecoratedWithOrInherit(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint BeDecoratedWithOrInherit(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint BeInNamespace(string @namespace, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSealed(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeUnderNamespace(string @namespace, string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWithOrInherit(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWithOrInherit(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeInNamespace(string @namespace, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeSealed(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeUnderNamespace(string @namespace, string because = "", params object[] becauseArgs) { } - } -} -namespace FluentAssertions.Xml -{ - public class XAttributeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public XAttributeAssertions(System.Xml.Linq.XAttribute attribute) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint Be(System.Xml.Linq.XAttribute expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XAttribute unexpected, string because = "", params object[] becauseArgs) { } - } - public class XDocumentAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public XDocumentAssertions(System.Xml.Linq.XDocument document) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint Be(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveRoot(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveRoot(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } - } - public class XElementAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public XElementAssertions(System.Xml.Linq.XElement xElement) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint Be(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttribute(System.Xml.Linq.XName expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } - } - public class XmlElementAssertions : FluentAssertions.Xml.XmlNodeAssertions - { - public XmlElementAssertions(System.Xml.XmlElement xmlElement) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttributeWithNamespace(string expectedName, string expectedNamespace, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(string expectedName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElementWithNamespace(string expectedName, string expectedNamespace, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveInnerText(string expected, string because = "", params object[] becauseArgs) { } - } - public class XmlNodeAssertions : FluentAssertions.Xml.XmlNodeAssertions - { - public XmlNodeAssertions(System.Xml.XmlNode xmlNode) { } - } - public class XmlNodeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - where TSubject : System.Xml.XmlNode - where TAssertions : FluentAssertions.Xml.XmlNodeAssertions - { - public XmlNodeAssertions(TSubject xmlNode) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.XmlNode expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.XmlNode unexpected, string because = "", params object[] becauseArgs) { } - } - public class XmlNodeFormatter : FluentAssertions.Formatting.IValueFormatter - { - public XmlNodeFormatter() { } - 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/netcoreapp3.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt deleted file mode 100644 index a22a0160eb..0000000000 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netcoreapp3.0.verified.txt +++ /dev/null @@ -1,2635 +0,0 @@ -[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/fluentassertions/fluentassertions")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"Benchmarks, PublicKey=00240000048000009400000006020000002400005253413100040000010001002d25ff515c85b13ba08f61d466cff5d80a7f28ba197bbf8796085213e7a3406f970d2a4874932fed35db546e89af2da88c194bf1b7f7ac70de7988c78406f7629c547283061282a825616eb7eb48a9514a7570942936020a9bb37dca9ff60b778309900851575614491c6d25018fadb75828f4c7a17bf2d7dc86e7b6eafc5d8f")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"FluentAssertions.Equivalency.Specs, PublicKey=00240000048000009400000006020000002400005253413100040000010001002d25ff515c85b13ba08f61d466cff5d80a7f28ba197bbf8796085213e7a3406f970d2a4874932fed35db546e89af2da88c194bf1b7f7ac70de7988c78406f7629c547283061282a825616eb7eb48a9514a7570942936020a9bb37dca9ff60b778309900851575614491c6d25018fadb75828f4c7a17bf2d7dc86e7b6eafc5d8f")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"FluentAssertions.Specs, PublicKey=00240000048000009400000006020000002400005253413100040000010001002d25ff515c85b13ba08f61d466cff5d80a7f28ba197bbf8796085213e7a3406f970d2a4874932fed35db546e89af2da88c194bf1b7f7ac70de7988c78406f7629c547283061282a825616eb7eb48a9514a7570942936020a9bb37dca9ff60b778309900851575614491c6d25018fadb75828f4c7a17bf2d7dc86e7b6eafc5d8f")] -namespace FluentAssertions -{ - public class AggregateExceptionExtractor : FluentAssertions.Specialized.IExtractExceptions - { - public AggregateExceptionExtractor() { } - public System.Collections.Generic.IEnumerable OfType(System.Exception actualException) - where T : System.Exception { } - } - public class AndConstraint - { - public AndConstraint(T parentConstraint) { } - public T And { get; } - } - public class AndWhichConstraint : FluentAssertions.AndConstraint - { - public AndWhichConstraint(TParentConstraint parentConstraint, System.Collections.Generic.IEnumerable matchedConstraint) { } - public AndWhichConstraint(TParentConstraint parentConstraint, TMatchedElement matchedConstraint) { } - public TMatchedElement Subject { get; } - public TMatchedElement Which { get; } - } - public static class AssertionExtensions - { - public static TTo As(this object subject) { } - public static System.Func Awaiting(this T subject, System.Func action) { } - public static System.Func Awaiting(this T subject, System.Func action) { } - public static System.Func> Awaiting(this T subject, System.Func> action) { } - public static System.Func> Awaiting(this T subject, System.Func> action) { } - public static System.Action Enumerating(this System.Func enumerable) { } - public static System.Action Enumerating(this System.Func> enumerable) { } - public static System.Action Enumerating(this T subject, System.Func> enumerable) { } - public static FluentAssertions.Specialized.ExecutionTime ExecutionTime(this System.Func action) { } - public static FluentAssertions.Specialized.ExecutionTime ExecutionTime(this System.Action action, FluentAssertions.Common.StartTimer createTimer = null) { } - public static FluentAssertions.Specialized.MemberExecutionTime ExecutionTimeOf(this T subject, System.Linq.Expressions.Expression> action, FluentAssertions.Common.StartTimer createTimer = null) { } - public static System.Action Invoking(this T subject, System.Action action) { } - public static System.Func Invoking(this T subject, System.Func action) { } - public static FluentAssertions.Events.IMonitor Monitor(this T eventSource, System.Func utcNow = null) { } - public static FluentAssertions.Specialized.ExecutionTimeAssertions Should(this FluentAssertions.Specialized.ExecutionTime executionTime) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Specialized.ExecutionTimeAssertions _) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase _) { } - public static FluentAssertions.Types.MethodInfoSelectorAssertions Should(this FluentAssertions.Types.MethodInfoSelector methodSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Types.MethodInfoSelectorAssertions _) { } - public static FluentAssertions.Types.PropertyInfoSelectorAssertions Should(this FluentAssertions.Types.PropertyInfoSelector propertyInfoSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Types.PropertyInfoSelectorAssertions _) { } - public static FluentAssertions.Types.TypeSelectorAssertions Should(this FluentAssertions.Types.TypeSelector typeSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } - public static FluentAssertions.Specialized.ActionAssertions Should(this System.Action action) { } - public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Collections.Generic.IEnumerable @this) { } - public static FluentAssertions.Primitives.DateTimeAssertions Should(this System.DateTime actualValue) { } - public static FluentAssertions.Primitives.NullableDateTimeAssertions Should(this System.DateTime? actualValue) { } - public static FluentAssertions.Primitives.DateTimeOffsetAssertions Should(this System.DateTimeOffset actualValue) { } - public static FluentAssertions.Primitives.NullableDateTimeOffsetAssertions Should(this System.DateTimeOffset? actualValue) { } - public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should(this System.Func action) { } - public static FluentAssertions.Primitives.GuidAssertions Should(this System.Guid actualValue) { } - public static FluentAssertions.Primitives.NullableGuidAssertions Should(this System.Guid? actualValue) { } - public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } - public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } - public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Reflection.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } - public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } - public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } - public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } - public static FluentAssertions.Primitives.SimpleTimeSpanAssertions Should(this System.TimeSpan actualValue) { } - public static FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions Should(this System.TimeSpan? actualValue) { } - public static FluentAssertions.Types.TypeAssertions Should(this System.Type subject) { } - public static FluentAssertions.Xml.XAttributeAssertions Should(this System.Xml.Linq.XAttribute actualValue) { } - public static FluentAssertions.Xml.XDocumentAssertions Should(this System.Xml.Linq.XDocument actualValue) { } - public static FluentAssertions.Xml.XElementAssertions Should(this System.Xml.Linq.XElement actualValue) { } - public static FluentAssertions.Primitives.BooleanAssertions Should(this bool actualValue) { } - public static FluentAssertions.Primitives.NullableBooleanAssertions Should(this bool? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this byte actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this byte? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this decimal actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this decimal? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this double actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this double? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this float actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this float? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this int actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this int? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this long actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this long? actualValue) { } - public static FluentAssertions.Primitives.ObjectAssertions Should(this object actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this sbyte actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this sbyte? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this short actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this short? actualValue) { } - public static FluentAssertions.Primitives.StringAssertions Should(this string actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this uint actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this uint? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this ulong actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ulong? actualValue) { } - public static FluentAssertions.Numeric.NumericAssertions Should(this ushort actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ushort? actualValue) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.BooleanAssertions _) - where TAssertions : FluentAssertions.Primitives.BooleanAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.DateTimeAssertions _) - where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.DateTimeOffsetAssertions _) - where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.DateTimeOffsetRangeAssertions _) - where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.DateTimeRangeAssertions _) - where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.GuidAssertions _) - where TAssertions : FluentAssertions.Primitives.GuidAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.SimpleTimeSpanAssertions _) - where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Collections.Generic.IEnumerable actualValue) { } - public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should(this System.Func> action) { } - public static FluentAssertions.Specialized.FunctionAssertions Should(this System.Func func) { } - public static FluentAssertions.Numeric.ComparableTypeAssertions Should(this System.IComparable comparableValue) { } - public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Numeric.NumericAssertions _) - where TSubject : struct, System.IComparable - where TAssertions : FluentAssertions.Numeric.NumericAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.EnumAssertions _) - where TEnum : struct, System.Enum - where TAssertions : FluentAssertions.Primitives.EnumAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Primitives.ReferenceTypeAssertions _) - where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { } - public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should(this System.Collections.Generic.IDictionary actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should(this System.Collections.Generic.IEnumerable> actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions Should(this TCollection actualValue) - where TCollection : System.Collections.Generic.IEnumerable> { } - } - public static class AssertionOptions - { - public static FluentAssertions.EquivalencyPlan EquivalencyPlan { get; } - public static FluentAssertions.Formatting.FormattingOptions FormattingOptions { get; } - public static void AssertEquivalencyUsing(System.Func defaultsConfigurer) { } - public static FluentAssertions.Equivalency.EquivalencyAssertionOptions CloneDefaults() { } - } - public static class AsyncAssertionsExtensions - { - public static System.Threading.Tasks.Task, T>> WithResult(this System.Threading.Tasks.Task, T>> task, T expected, string because = "", params object[] becauseArgs) { } - public static System.Threading.Tasks.Task, T>> WithResult(this System.Threading.Tasks.Task, T>> task, T expected, string because = "", params object[] becauseArgs) { } - } - public static class AtLeast - { - public static FluentAssertions.OccurrenceConstraint Once() { } - public static FluentAssertions.OccurrenceConstraint Thrice() { } - public static FluentAssertions.OccurrenceConstraint Times(int expected) { } - public static FluentAssertions.OccurrenceConstraint Twice() { } - } - public static class AtMost - { - public static FluentAssertions.OccurrenceConstraint Once() { } - public static FluentAssertions.OccurrenceConstraint Thrice() { } - public static FluentAssertions.OccurrenceConstraint Times(int expected) { } - public static FluentAssertions.OccurrenceConstraint Twice() { } - } - public static class CallerIdentifier - { - public static System.Action Logger { get; set; } - public static string DetermineCallerIdentity() { } - } - [System.AttributeUsage(System.AttributeTargets.Method)] - public class CustomAssertionAttribute : System.Attribute - { - public CustomAssertionAttribute() { } - } - public static class EnumAssertionsExtensions - { - public static FluentAssertions.Primitives.EnumAssertions Should(this TEnum @enum) - where TEnum : struct, System.Enum { } - public static FluentAssertions.Primitives.NullableEnumAssertions Should(this TEnum? @enum) - where TEnum : struct, System.Enum { } - } - public class EquivalencyPlan : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - public EquivalencyPlan() { } - public void Add() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void AddAfter() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void Clear() { } - public System.Collections.Generic.IEnumerator GetEnumerator() { } - public void Insert() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void InsertBefore() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void Remove() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep { } - public void Reset() { } - } - public static class EventRaisingExtensions - { - public static FluentAssertions.Events.IEventRecording WithArgs(this FluentAssertions.Events.IEventRecording eventRecording, System.Linq.Expressions.Expression> predicate) { } - public static FluentAssertions.Events.IEventRecording WithArgs(this FluentAssertions.Events.IEventRecording eventRecording, params System.Linq.Expressions.Expression>[] predicates) { } - public static FluentAssertions.Events.IEventRecording WithSender(this FluentAssertions.Events.IEventRecording eventRecording, object expectedSender) { } - } - public static class Exactly - { - public static FluentAssertions.OccurrenceConstraint Once() { } - public static FluentAssertions.OccurrenceConstraint Thrice() { } - public static FluentAssertions.OccurrenceConstraint Times(int expected) { } - public static FluentAssertions.OccurrenceConstraint Twice() { } - } - public static class ExceptionAssertionsExtensions - { - public static System.Threading.Tasks.Task> Where(this System.Threading.Tasks.Task> task, System.Linq.Expressions.Expression> exceptionExpression, string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public static System.Threading.Tasks.Task> WithInnerException(this System.Threading.Tasks.Task> task, System.Type innerException, string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public static System.Threading.Tasks.Task> WithInnerException(this System.Threading.Tasks.Task> task, string because = "", params object[] becauseArgs) - where TException : System.Exception - where TInnerException : System.Exception { } - public static System.Threading.Tasks.Task> WithInnerExceptionExactly(this System.Threading.Tasks.Task> task, System.Type innerException, string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public static System.Threading.Tasks.Task> WithInnerExceptionExactly(this System.Threading.Tasks.Task> task, string because = "", params object[] becauseArgs) - where TException : System.Exception - where TInnerException : System.Exception { } - public static System.Threading.Tasks.Task> WithMessage(this System.Threading.Tasks.Task> task, string expectedWildcardPattern, string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public static FluentAssertions.Specialized.ExceptionAssertions WithParameterName(this FluentAssertions.Specialized.ExceptionAssertions parent, string paramName, string because = "", params object[] becauseArgs) - where TException : System.ArgumentException { } - public static System.Threading.Tasks.Task> WithParameterName(this System.Threading.Tasks.Task> task, string paramName, string because = "", params object[] becauseArgs) - where TException : System.ArgumentException { } - } - public static class FluentActions - { - public static System.Func Awaiting(System.Func action) { } - public static System.Func> Awaiting(System.Func> func) { } - public static System.Action Enumerating(System.Func enumerable) { } - public static System.Action Enumerating(System.Func> enumerable) { } - public static System.Action Invoking(System.Action action) { } - public static System.Func Invoking(System.Func func) { } - } - public static class LessThan - { - public static FluentAssertions.OccurrenceConstraint Thrice() { } - public static FluentAssertions.OccurrenceConstraint Times(int expected) { } - public static FluentAssertions.OccurrenceConstraint Twice() { } - } - public static class MoreThan - { - public static FluentAssertions.OccurrenceConstraint Once() { } - public static FluentAssertions.OccurrenceConstraint Thrice() { } - public static FluentAssertions.OccurrenceConstraint Times(int expected) { } - public static FluentAssertions.OccurrenceConstraint Twice() { } - } - public static class NumericAssertionsExtensions - { - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, decimal expectedValue, decimal precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, decimal? expectedValue, decimal precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, double expectedValue, double precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, double? expectedValue, double precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, float expectedValue, float precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, float? expectedValue, float precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, decimal expectedValue, decimal precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, double expectedValue, double precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, float expectedValue, float precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, byte nearbyValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, int nearbyValue, uint delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, long nearbyValue, ulong delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, sbyte nearbyValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint nearbyValue, uint delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong nearbyValue, ulong delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, decimal unexpectedValue, decimal precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, decimal? unexpectedValue, decimal precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, double unexpectedValue, double precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, double? unexpectedValue, double precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, float unexpectedValue, float precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, float? unexpectedValue, float precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, decimal unexpectedValue, decimal precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, double unexpectedValue, double precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, float unexpectedValue, float precision, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, byte distantValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short distantValue, ushort delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, int distantValue, uint delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, long distantValue, ulong delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, sbyte distantValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort distantValue, ushort delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint distantValue, uint delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong distantValue, ulong delta, string because = "", params object[] becauseArgs) { } - } - public static class ObjectAssertionsExtensions - { - public static FluentAssertions.AndConstraint BeBinarySerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint BeBinarySerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> options, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> options, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } - } - public abstract class OccurrenceConstraint - { - protected OccurrenceConstraint(int expectedCount) { } - } - public static class TypeEnumerableExtensions - { - public static System.Collections.Generic.IEnumerable ThatAreClasses(this System.Collections.Generic.IEnumerable types) { } - public static System.Collections.Generic.IEnumerable ThatAreDecoratedWith(this System.Collections.Generic.IEnumerable types) - where TAttribute : System.Attribute { } - public static System.Collections.Generic.IEnumerable ThatAreDecoratedWithOrInherit(this System.Collections.Generic.IEnumerable types) - where TAttribute : System.Attribute { } - public static System.Collections.Generic.IEnumerable ThatAreInNamespace(this System.Collections.Generic.IEnumerable types, string @namespace) { } - public static System.Collections.Generic.IEnumerable ThatAreNotClasses(this System.Collections.Generic.IEnumerable types) { } - public static System.Collections.Generic.IEnumerable ThatAreNotDecoratedWith(this System.Collections.Generic.IEnumerable types) - where TAttribute : System.Attribute { } - public static System.Collections.Generic.IEnumerable ThatAreNotDecoratedWithOrInherit(this System.Collections.Generic.IEnumerable types) - where TAttribute : System.Attribute { } - public static System.Collections.Generic.IEnumerable ThatAreNotStatic(this System.Collections.Generic.IEnumerable types) { } - public static System.Collections.Generic.IEnumerable ThatAreStatic(this System.Collections.Generic.IEnumerable types) { } - public static System.Collections.Generic.IEnumerable ThatAreUnderNamespace(this System.Collections.Generic.IEnumerable types, string @namespace) { } - public static System.Collections.Generic.IEnumerable ThatDeriveFrom(this System.Collections.Generic.IEnumerable types) { } - public static System.Collections.Generic.IEnumerable ThatImplement(this System.Collections.Generic.IEnumerable types) { } - public static System.Collections.Generic.IEnumerable ThatSatisfy(this System.Collections.Generic.IEnumerable types, System.Func predicate) { } - public static System.Collections.Generic.IEnumerable UnwrapEnumerableTypes(this System.Collections.Generic.IEnumerable types) { } - public static System.Collections.Generic.IEnumerable UnwrapTaskTypes(this System.Collections.Generic.IEnumerable types) { } - } - public static class TypeExtensions - { - public static FluentAssertions.Types.MethodInfoSelector Methods(this FluentAssertions.Types.TypeSelector typeSelector) { } - public static FluentAssertions.Types.MethodInfoSelector Methods(this System.Type type) { } - public static FluentAssertions.Types.PropertyInfoSelector Properties(this FluentAssertions.Types.TypeSelector typeSelector) { } - public static FluentAssertions.Types.PropertyInfoSelector Properties(this System.Type type) { } - public static FluentAssertions.Types.TypeSelector Types(this System.Collections.Generic.IEnumerable types) { } - public static FluentAssertions.Types.TypeSelector Types(this System.Reflection.Assembly assembly) { } - public static FluentAssertions.Types.TypeSelector Types(this System.Type type) { } - } - public static class XmlAssertionExtensions - { - public static FluentAssertions.Xml.XmlElementAssertions Should(this System.Xml.XmlElement actualValue) { } - public static FluentAssertions.Xml.XmlNodeAssertions Should(this System.Xml.XmlNode actualValue) { } - } -} -namespace FluentAssertions.Collections -{ - public class GenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions, T, FluentAssertions.Collections.GenericCollectionAssertions> - { - public GenericCollectionAssertions(System.Collections.Generic.IEnumerable actualValue) { } - } - public class GenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions> - where TCollection : System.Collections.Generic.IEnumerable - { - public GenericCollectionAssertions(TCollection actualValue) { } - } - public class GenericCollectionAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - where TCollection : System.Collections.Generic.IEnumerable - where TAssertions : FluentAssertions.Collections.GenericCollectionAssertions - { - public GenericCollectionAssertions(TCollection actualValue) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint AllBeAssignableTo(System.Type expectedType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> AllBeAssignableTo(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllBeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllBeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllBeOfType(System.Type expectedType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> AllBeOfType(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllSatisfy(System.Action expected, string because = "", params object[] becauseArgs) { } - protected void AssertCollectionEndsWith(System.Collections.Generic.IEnumerable actual, System.Collections.Generic.ICollection expected, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } - protected void AssertCollectionStartsWith(System.Collections.Generic.IEnumerable actualItems, System.Collections.Generic.ICollection expected, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } - protected void AssertSubjectEquality(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInAscendingOrder(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInAscendingOrder(System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInAscendingOrder(System.Func comparison, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInDescendingOrder(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInDescendingOrder(System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInDescendingOrder(System.Func comparison, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> BeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeNullOrEmpty(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSubsetOf(System.Collections.Generic.IEnumerable expectedSuperset, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Contain(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint Contain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint Contain(T expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint ContainEquivalentOf(TExpectation expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint ContainEquivalentOf(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainInConsecutiveOrder(params T[] expected) { } - public FluentAssertions.AndConstraint ContainInConsecutiveOrder(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainInOrder(params T[] expected) { } - public FluentAssertions.AndConstraint ContainInOrder(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainItemsAssignableTo(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint ContainSingle(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint ContainSingle(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint EndWith(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint EndWith(T element, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint EndWith(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Equal(params T[] elements) { } - public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCount(System.Linq.Expressions.Expression> countPredicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountGreaterThan(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountGreaterThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountLessThan(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveCountLessThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElementAt(int index, T element, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveElementPreceding(T successor, T expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveElementSucceeding(T predecessor, T expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveSameCount(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint IntersectWith(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInAscendingOrder(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInAscendingOrder(System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInAscendingOrder(System.Func comparison, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInDescendingOrder(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInDescendingOrder(System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInDescendingOrder(System.Func comparison, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNullOrEmpty(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeSubsetOf(System.Collections.Generic.IEnumerable unexpectedSuperset, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContain(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint NotContain(T unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainInConsecutiveOrder(params T[] unexpected) { } - public FluentAssertions.AndConstraint NotContainInConsecutiveOrder(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainInOrder(params T[] unexpected) { } - public FluentAssertions.AndConstraint NotContainInOrder(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainItemsAssignableTo(System.Type type, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainItemsAssignableTo(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainNulls(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainNulls(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) - where TKey : class { } - public FluentAssertions.AndConstraint NotEqual(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveCount(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveSameCount(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotIntersectWith(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint OnlyContain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint OnlyHaveUniqueItems(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint OnlyHaveUniqueItems(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Satisfy(params System.Linq.Expressions.Expression>[] predicates) { } - public FluentAssertions.AndConstraint Satisfy(System.Collections.Generic.IEnumerable>> predicates, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint SatisfyRespectively(params System.Action[] elementInspectors) { } - public FluentAssertions.AndConstraint SatisfyRespectively(System.Collections.Generic.IEnumerable> expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint StartWith(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint StartWith(T element, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint StartWith(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } - protected static System.Collections.Generic.IEnumerable RepeatAsManyAs(TExpectation value, System.Collections.Generic.IEnumerable enumerable) { } - } - public class GenericDictionaryAssertions : FluentAssertions.Collections.GenericDictionaryAssertions> - where TCollection : System.Collections.Generic.IEnumerable> - { - public GenericDictionaryAssertions(TCollection keyValuePairs) { } - } - public class GenericDictionaryAssertions : FluentAssertions.Collections.GenericCollectionAssertions, TAssertions> - where TCollection : System.Collections.Generic.IEnumerable> - where TAssertions : FluentAssertions.Collections.GenericDictionaryAssertions - { - public GenericDictionaryAssertions(TCollection keyValuePairs) { } - protected override string Identifier { get; } - 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 Contain(params System.Collections.Generic.KeyValuePair[] expected) { } - public FluentAssertions.AndConstraint Contain(System.Collections.Generic.IEnumerable> expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Contain(System.Collections.Generic.KeyValuePair expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Contain(TKey key, TValue value, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Collections.WhoseValueConstraint ContainKey(TKey expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainKeys(params TKey[] expected) { } - public FluentAssertions.AndConstraint ContainKeys(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint ContainValue(TValue expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainValues(params TValue[] expected) { } - public FluentAssertions.AndConstraint ContainValues(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Equal(T expected, string because = "", params object[] becauseArgs) - where T : System.Collections.Generic.IEnumerable> { } - public FluentAssertions.AndConstraint NotContain(params System.Collections.Generic.KeyValuePair[] items) { } - public FluentAssertions.AndConstraint NotContain(System.Collections.Generic.IEnumerable> items, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContain(System.Collections.Generic.KeyValuePair item, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContain(TKey key, TValue value, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainKey(TKey unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainKeys(params TKey[] unexpected) { } - public FluentAssertions.AndConstraint NotContainKeys(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainValue(TValue unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainValues(params TValue[] unexpected) { } - public FluentAssertions.AndConstraint NotContainValues(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotEqual(T unexpected, string because = "", params object[] becauseArgs) - where T : System.Collections.Generic.IEnumerable> { } - } - public class StringCollectionAssertions : FluentAssertions.Collections.StringCollectionAssertions> - { - public StringCollectionAssertions(System.Collections.Generic.IEnumerable actualValue) { } - } - public class StringCollectionAssertions : FluentAssertions.Collections.StringCollectionAssertions> - where TCollection : System.Collections.Generic.IEnumerable - { - public StringCollectionAssertions(TCollection actualValue) { } - } - public class StringCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions - where TCollection : System.Collections.Generic.IEnumerable - where TAssertions : FluentAssertions.Collections.StringCollectionAssertions - { - public StringCollectionAssertions(TCollection actualValue) { } - public FluentAssertions.AndConstraint AllBe(string expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllBe(string expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(params string[] expectation) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint ContainMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expected) { } - public FluentAssertions.AndConstraint Equal(params string[] expected) { } - public FluentAssertions.AndConstraint NotContainMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } - } - public class SubsequentOrderingAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions, T, FluentAssertions.Collections.SubsequentOrderingAssertions> - { - public SubsequentOrderingAssertions(System.Collections.Generic.IEnumerable actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } - } - public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions> - where TCollection : System.Collections.Generic.IEnumerable - { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } - } - public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions - where TCollection : System.Collections.Generic.IEnumerable - where TAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions - { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } - public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> ThenBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> ThenBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } - } - public class WhoseValueConstraint : FluentAssertions.AndConstraint - where TCollection : System.Collections.Generic.IEnumerable> - where TAssertions : FluentAssertions.Collections.GenericDictionaryAssertions - { - public WhoseValueConstraint(TAssertions parentConstraint, TValue value) { } - public TValue WhoseValue { get; } - } -} -namespace FluentAssertions.Common -{ - public enum CSharpAccessModifier - { - Public = 0, - Private = 1, - Protected = 2, - Internal = 3, - ProtectedInternal = 4, - InvalidForCSharp = 5, - PrivateProtected = 6, - } - public class Configuration - { - public Configuration(FluentAssertions.Common.IConfigurationStore store) { } - public string TestFrameworkName { get; set; } - public string ValueFormatterAssembly { get; set; } - public FluentAssertions.Common.ValueFormatterDetectionMode ValueFormatterDetectionMode { get; set; } - public static FluentAssertions.Common.Configuration Current { get; } - } - public static class DateTimeExtensions - { - public static System.DateTimeOffset ToDateTimeOffset(this System.DateTime dateTime) { } - public static System.DateTimeOffset ToDateTimeOffset(this System.DateTime dateTime, System.TimeSpan offset) { } - } - public interface IClock - { - void Delay(System.TimeSpan timeToDelay); - System.Threading.Tasks.Task DelayAsync(System.TimeSpan delay, System.Threading.CancellationToken cancellationToken); - FluentAssertions.Common.ITimer StartTimer(); - } - public interface ICollectionWrapper - where TCollection : System.Collections.ICollection - { - TCollection UnderlyingCollection { get; } - } - public interface IConfigurationStore - { - string GetSetting(string name); - } - public interface IReflector - { - System.Collections.Generic.IEnumerable GetAllTypesFromAppDomain(System.Func predicate); - } - public interface ITimer : System.IDisposable - { - System.TimeSpan Elapsed { get; } - } - public static class Services - { - public static FluentAssertions.Common.Configuration Configuration { get; } - public static FluentAssertions.Common.IConfigurationStore ConfigurationStore { get; set; } - public static FluentAssertions.Common.IReflector Reflector { get; set; } - public static System.Action ThrowException { get; set; } - public static void ResetToDefaults() { } - } - public delegate FluentAssertions.Common.ITimer StartTimer(); - public enum ValueFormatterDetectionMode - { - Disabled = 0, - Specific = 1, - Scan = 2, - } -} -namespace FluentAssertions.Equivalency -{ - public class Comparands - { - public Comparands() { } - public Comparands(object subject, object expectation, System.Type compileTimeType) { } - public System.Type CompileTimeType { get; set; } - public object Expectation { get; set; } - public System.Type RuntimeType { get; } - public object Subject { get; set; } - public System.Type GetExpectedType(FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } - public override string ToString() { } - } - public class ConversionSelector - { - public ConversionSelector() { } - public FluentAssertions.Equivalency.ConversionSelector Clone() { } - public void Exclude(System.Linq.Expressions.Expression> predicate) { } - public void Include(System.Linq.Expressions.Expression> predicate) { } - public void IncludeAll() { } - public bool RequiresConversion(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.INode currentNode) { } - public override string ToString() { } - } - public enum CyclicReferenceHandling - { - Ignore = 0, - ThrowException = 1, - } - public enum EnumEquivalencyHandling - { - ByValue = 0, - ByName = 1, - } - public enum EqualityStrategy - { - Equals = 0, - Members = 1, - ForceEquals = 2, - ForceMembers = 3, - } - public class EquivalencyAssertionOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions - { - public EquivalencyAssertionOptions() { } - } - public class EquivalencyAssertionOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions> - { - public EquivalencyAssertionOptions() { } - public EquivalencyAssertionOptions(FluentAssertions.Equivalency.IEquivalencyAssertionOptions defaults) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions> AsCollection() { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> expression) { } - public FluentAssertions.Equivalency.NestedExclusionOptionBuilder For(System.Linq.Expressions.Expression>> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Including(System.Linq.Expressions.Expression> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(string expectationMemberPath, string subjectMemberPath) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(System.Linq.Expressions.Expression> expectationMemberPath, System.Linq.Expressions.Expression> subjectMemberPath) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(System.Linq.Expressions.Expression> expectationMember, System.Linq.Expressions.Expression> subjectMember) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(string expectationMemberName, string subjectMemberName) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithoutStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } - } - public enum EquivalencyResult - { - ContinueWithNext = 0, - AssertionCompleted = 1, - } - public abstract class EquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - protected EquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator); - } - public class EquivalencyValidationContext : FluentAssertions.Equivalency.IEquivalencyValidationContext - { - public EquivalencyValidationContext(FluentAssertions.Equivalency.INode root, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } - public FluentAssertions.Equivalency.INode CurrentNode { get; } - public FluentAssertions.Equivalency.IEquivalencyAssertionOptions Options { get; } - public FluentAssertions.Execution.Reason Reason { get; set; } - public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; set; } - public FluentAssertions.Equivalency.Tracing.Tracer Tracer { get; } - public FluentAssertions.Equivalency.IEquivalencyValidationContext AsCollectionItem(string index) { } - public FluentAssertions.Equivalency.IEquivalencyValidationContext AsDictionaryItem(TKey key) { } - public FluentAssertions.Equivalency.IEquivalencyValidationContext AsNestedMember(FluentAssertions.Equivalency.IMember expectationMember) { } - public FluentAssertions.Equivalency.IEquivalencyValidationContext Clone() { } - public bool IsCyclicReference(object expectation) { } - public override string ToString() { } - } - public class EquivalencyValidator : FluentAssertions.Equivalency.IEquivalencyValidator - { - public EquivalencyValidator() { } - public void AssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.EquivalencyValidationContext context) { } - public void RecursivelyAssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context) { } - } - public class Field : FluentAssertions.Equivalency.Node, FluentAssertions.Equivalency.IMember, FluentAssertions.Equivalency.INode - { - public Field(System.Reflection.FieldInfo fieldInfo, FluentAssertions.Equivalency.INode parent) { } - public Field(System.Type reflectedType, System.Reflection.FieldInfo fieldInfo, FluentAssertions.Equivalency.INode parent) { } - public System.Type DeclaringType { get; set; } - public override string Description { get; } - public FluentAssertions.Common.CSharpAccessModifier GetterAccessibility { get; } - public bool IsBrowsable { get; } - public System.Type ReflectedType { get; } - public FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } - public object GetValue(object obj) { } - } - public delegate string GetSubjectId(); - public interface IAssertionContext - { - string Because { get; set; } - object[] BecauseArgs { get; set; } - TSubject Expectation { get; } - FluentAssertions.Equivalency.INode SelectedNode { get; } - TSubject Subject { get; } - } - public interface IEquivalencyAssertionOptions - { - bool AllowInfiniteRecursion { get; } - bool? CompareRecordsByValue { get; } - FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } - FluentAssertions.Equivalency.CyclicReferenceHandling CyclicReferenceHandling { get; } - FluentAssertions.Equivalency.EnumEquivalencyHandling EnumEquivalencyHandling { get; } - bool ExcludeNonBrowsableOnExpectation { get; } - bool IgnoreNonBrowsableOnSubject { get; } - FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } - FluentAssertions.Equivalency.MemberVisibility IncludedProperties { get; } - bool IsRecursive { get; } - System.Collections.Generic.IEnumerable MatchingRules { get; } - FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } - System.Collections.Generic.IEnumerable SelectionRules { get; } - FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } - bool UseRuntimeTyping { get; } - System.Collections.Generic.IEnumerable UserEquivalencySteps { get; } - FluentAssertions.Equivalency.EqualityStrategy GetEqualityStrategy(System.Type type); - } - public interface IEquivalencyStep - { - FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator); - } - public interface IEquivalencyValidationContext - { - FluentAssertions.Equivalency.INode CurrentNode { get; } - FluentAssertions.Equivalency.IEquivalencyAssertionOptions Options { get; } - FluentAssertions.Execution.Reason Reason { get; } - FluentAssertions.Equivalency.Tracing.Tracer Tracer { get; } - FluentAssertions.Equivalency.IEquivalencyValidationContext AsCollectionItem(string index); - FluentAssertions.Equivalency.IEquivalencyValidationContext AsDictionaryItem(TKey key); - FluentAssertions.Equivalency.IEquivalencyValidationContext AsNestedMember(FluentAssertions.Equivalency.IMember expectationMember); - FluentAssertions.Equivalency.IEquivalencyValidationContext Clone(); - bool IsCyclicReference(object expectation); - } - public interface IEquivalencyValidator - { - void RecursivelyAssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context); - } - public interface IMember : FluentAssertions.Equivalency.INode - { - System.Type DeclaringType { get; } - FluentAssertions.Common.CSharpAccessModifier GetterAccessibility { get; } - bool IsBrowsable { get; } - System.Type ReflectedType { get; } - FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } - object GetValue(object obj); - } - public interface IMemberInfo - { - System.Type DeclaringType { get; } - FluentAssertions.Common.CSharpAccessModifier GetterAccessibility { get; } - string Name { get; } - string Path { get; set; } - FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } - System.Type Type { get; } - } - public interface IMemberMatchingRule - { - FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options); - } - public interface IMemberSelectionRule - { - bool IncludesMembers { get; } - System.Collections.Generic.IEnumerable SelectMembers(FluentAssertions.Equivalency.INode currentNode, System.Collections.Generic.IEnumerable selectedMembers, FluentAssertions.Equivalency.MemberSelectionContext context); - } - public interface INode - { - int Depth { get; } - string Description { get; } - FluentAssertions.Equivalency.GetSubjectId GetSubjectId { get; } - bool IsRoot { get; } - string Name { get; set; } - System.Type ParentType { get; } - string Path { get; } - string PathAndName { get; } - bool RootIsCollection { get; } - System.Type Type { get; } - } - public interface IObjectInfo - { - System.Type CompileTimeType { get; } - System.Type ParentType { get; } - string Path { get; set; } - System.Type RuntimeType { get; } - [System.Obsolete("Use CompileTimeType or RuntimeType instead")] - System.Type Type { get; } - } - public interface IOrderingRule - { - FluentAssertions.Equivalency.OrderStrictness Evaluate(FluentAssertions.Equivalency.IObjectInfo objectInfo); - } - public static class MemberFactory - { - public static FluentAssertions.Equivalency.IMember Create(System.Reflection.MemberInfo memberInfo, FluentAssertions.Equivalency.INode parent) { } - } - public class MemberSelectionContext - { - public MemberSelectionContext(System.Type compileTimeType, System.Type runtimeType, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } - public FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } - public FluentAssertions.Equivalency.MemberVisibility IncludedProperties { get; } - public System.Type Type { get; } - } - [System.Flags] - public enum MemberVisibility - { - None = 0, - Internal = 1, - Public = 2, - } - public class NestedExclusionOptionBuilder - { - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Exclude(System.Linq.Expressions.Expression> expression) { } - public FluentAssertions.Equivalency.NestedExclusionOptionBuilder For(System.Linq.Expressions.Expression>> expression) { } - } - public class Node : FluentAssertions.Equivalency.INode - { - public Node() { } - public int Depth { get; } - public virtual string Description { get; } - public FluentAssertions.Equivalency.GetSubjectId GetSubjectId { get; set; } - public bool IsRoot { get; } - public string Name { get; set; } - public System.Type ParentType { get; set; } - public string Path { get; set; } - public string PathAndName { get; } - public bool RootIsCollection { get; set; } - public System.Type Type { get; set; } - public override bool Equals(object obj) { } - public override int GetHashCode() { } - public override string ToString() { } - public static FluentAssertions.Equivalency.INode From(FluentAssertions.Equivalency.GetSubjectId getSubjectId) { } - public static FluentAssertions.Equivalency.INode FromCollectionItem(string index, FluentAssertions.Equivalency.INode parent) { } - public static FluentAssertions.Equivalency.INode FromDictionaryItem(object key, FluentAssertions.Equivalency.INode parent) { } - } - public enum OrderStrictness - { - Strict = 0, - NotStrict = 1, - Irrelevant = 2, - } - public class OrderingRuleCollection : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - public OrderingRuleCollection() { } - public OrderingRuleCollection(System.Collections.Generic.IEnumerable orderingRules) { } - public void Add(FluentAssertions.Equivalency.IOrderingRule rule) { } - public System.Collections.Generic.IEnumerator GetEnumerator() { } - public bool IsOrderingStrictFor(FluentAssertions.Equivalency.IObjectInfo objectInfo) { } - } - public class Property : FluentAssertions.Equivalency.Node, FluentAssertions.Equivalency.IMember, FluentAssertions.Equivalency.INode - { - public Property(System.Reflection.PropertyInfo propertyInfo, FluentAssertions.Equivalency.INode parent) { } - public Property(System.Type reflectedType, System.Reflection.PropertyInfo propertyInfo, FluentAssertions.Equivalency.INode parent) { } - public System.Type DeclaringType { get; } - public override string Description { get; } - public FluentAssertions.Common.CSharpAccessModifier GetterAccessibility { get; } - public bool IsBrowsable { get; } - public System.Type ReflectedType { get; } - public FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } - public object GetValue(object obj) { } - } - public abstract class SelfReferenceEquivalencyAssertionOptions : FluentAssertions.Equivalency.IEquivalencyAssertionOptions - where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions - { - protected SelfReferenceEquivalencyAssertionOptions(FluentAssertions.Equivalency.IEquivalencyAssertionOptions defaults) { } - public bool? CompareRecordsByValue { get; } - public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } - [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] - protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } - public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } - protected TSelf AddMatchingRule(FluentAssertions.Equivalency.IMemberMatchingRule matchingRule) { } - protected TSelf AddSelectionRule(FluentAssertions.Equivalency.IMemberSelectionRule selectionRule) { } - public TSelf AllowingInfiniteRecursion() { } - public TSelf ComparingByMembers(System.Type type) { } - public TSelf ComparingByMembers() { } - public TSelf ComparingByValue(System.Type type) { } - public TSelf ComparingByValue() { } - public TSelf ComparingEnumsByName() { } - public TSelf ComparingEnumsByValue() { } - public TSelf ComparingRecordsByMembers() { } - public TSelf ComparingRecordsByValue() { } - public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } - public TSelf ExcludingFields() { } - public TSelf ExcludingMissingMembers() { } - public TSelf ExcludingNestedObjects() { } - public TSelf ExcludingNonBrowsableMembers() { } - public TSelf ExcludingProperties() { } - public TSelf IgnoringCyclicReferences() { } - public TSelf IgnoringNonBrowsableMembersOnSubject() { } - public TSelf Including(System.Linq.Expressions.Expression> predicate) { } - public TSelf IncludingAllDeclaredProperties() { } - public TSelf IncludingAllRuntimeProperties() { } - public TSelf IncludingFields() { } - public TSelf IncludingInternalFields() { } - public TSelf IncludingInternalProperties() { } - public TSelf IncludingNestedObjects() { } - public TSelf IncludingProperties() { } - public TSelf RespectingDeclaredTypes() { } - public TSelf RespectingRuntimeTypes() { } - public TSelf ThrowingOnMissingMembers() { } - public override string ToString() { } - public TSelf Using(FluentAssertions.Equivalency.IEquivalencyStep equivalencyStep) { } - public TSelf Using(FluentAssertions.Equivalency.IMemberMatchingRule matchingRule) { } - public TSelf Using(FluentAssertions.Equivalency.IMemberSelectionRule selectionRule) { } - public TSelf Using(FluentAssertions.Equivalency.IOrderingRule orderingRule) { } - public FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions.Restriction Using(System.Action> action) { } - public TSelf Using(System.Collections.Generic.IEqualityComparer comparer) { } - public TSelf Using() - where TEqualityComparer : System.Collections.Generic.IEqualityComparer, new () { } - public TSelf WithAutoConversion() { } - public TSelf WithAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } - public TSelf WithStrictOrdering() { } - public TSelf WithStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } - public TSelf WithTracing(FluentAssertions.Equivalency.Tracing.ITraceWriter writer = null) { } - public TSelf WithoutAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } - public void WithoutMatchingRules() { } - public void WithoutSelectionRules() { } - public TSelf WithoutStrictOrdering() { } - public TSelf WithoutStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } - public class Restriction - { - public Restriction(TSelf options, System.Action> action) { } - public TSelf When(System.Linq.Expressions.Expression> predicate) { } - public TSelf WhenTypeIs() - where TMemberType : TMember { } - } - } - public static class SubjectInfoExtensions - { - public static bool WhichGetterDoesNotHave(this FluentAssertions.Equivalency.IMemberInfo memberInfo, FluentAssertions.Common.CSharpAccessModifier accessModifier) { } - public static bool WhichGetterHas(this FluentAssertions.Equivalency.IMemberInfo memberInfo, FluentAssertions.Common.CSharpAccessModifier accessModifier) { } - public static bool WhichSetterDoesNotHave(this FluentAssertions.Equivalency.IMemberInfo memberInfo, FluentAssertions.Common.CSharpAccessModifier accessModifier) { } - public static bool WhichSetterHas(this FluentAssertions.Equivalency.IMemberInfo memberInfo, FluentAssertions.Common.CSharpAccessModifier accessModifier) { } - } -} -namespace FluentAssertions.Equivalency.Steps -{ - public class AssertionRuleEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public AssertionRuleEquivalencyStep(System.Linq.Expressions.Expression> predicate, System.Action> assertion) { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - public override string ToString() { } - } - public class AutoConversionStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public AutoConversionStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - public override string ToString() { } - } - public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public DictionaryEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class EnumEqualityStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public EnumEqualityStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class EnumerableEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public EnumerableEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class EqualityComparerEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public EqualityComparerEquivalencyStep(System.Collections.Generic.IEqualityComparer comparer) { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - public override string ToString() { } - } - public class GenericDictionaryEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public GenericDictionaryEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class GenericEnumerableEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public GenericEnumerableEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class ReferenceEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public ReferenceEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class RunAllUserStepsEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public RunAllUserStepsEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class SimpleEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public SimpleEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class StringEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public StringEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class StructuralEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public StructuralEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class ValueTypeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep - { - public ValueTypeEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class XAttributeEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public XAttributeEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class XDocumentEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public XDocumentEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } - public class XElementEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep - { - public XElementEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - } -} -namespace FluentAssertions.Equivalency.Tracing -{ - public delegate string GetTraceMessage(FluentAssertions.Equivalency.INode node); - public interface ITraceWriter - { - System.IDisposable AddBlock(string trace); - void AddSingle(string trace); - string ToString(); - } - public class StringBuilderTraceWriter : FluentAssertions.Equivalency.Tracing.ITraceWriter - { - public StringBuilderTraceWriter() { } - public System.IDisposable AddBlock(string trace) { } - public void AddSingle(string trace) { } - public override string ToString() { } - } - public class Tracer - { - public override string ToString() { } - public System.IDisposable WriteBlock(FluentAssertions.Equivalency.Tracing.GetTraceMessage getTraceMessage) { } - public void WriteLine(FluentAssertions.Equivalency.Tracing.GetTraceMessage getTraceMessage) { } - } -} -namespace FluentAssertions.Events -{ - public class EventAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> - { - protected EventAssertions(FluentAssertions.Events.IMonitor monitor) { } - protected override string Identifier { get; } - public FluentAssertions.Events.IMonitor Monitor { get; } - public void NotRaise(string eventName, string because = "", params object[] becauseArgs) { } - public void NotRaisePropertyChangeFor(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Events.IEventRecording Raise(string eventName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Events.IEventRecording RaisePropertyChangeFor(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } - } - public class EventMetadata - { - public EventMetadata(string eventName, System.Type handlerType) { } - public string EventName { get; } - public System.Type HandlerType { get; } - } - public interface IEventRecording : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - System.Type EventHandlerType { get; } - string EventName { get; } - object EventObject { get; } - } - public interface IMonitor : System.IDisposable - { - FluentAssertions.Events.EventMetadata[] MonitoredEvents { get; } - FluentAssertions.Events.OccurredEvent[] OccurredEvents { get; } - T Subject { get; } - void Clear(); - FluentAssertions.Events.IEventRecording GetRecordingFor(string eventName); - FluentAssertions.Events.EventAssertions Should(); - } - public class OccurredEvent - { - public OccurredEvent() { } - public string EventName { get; set; } - public object[] Parameters { get; set; } - public int Sequence { get; set; } - public System.DateTime TimestampUtc { get; set; } - } -} -namespace FluentAssertions.Execution -{ - [System.Serializable] - public class AssertionFailedException : System.Exception - { - public AssertionFailedException(string message) { } - protected AssertionFailedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } - } - public sealed class AssertionScope : FluentAssertions.Execution.IAssertionScope, System.IDisposable - { - public AssertionScope() { } - public AssertionScope(FluentAssertions.Execution.IAssertionStrategy assertionStrategy) { } - public AssertionScope(System.Lazy context) { } - public AssertionScope(string context) { } - public string CallerIdentity { get; } - public System.Lazy Context { get; set; } - public FluentAssertions.Formatting.FormattingOptions FormattingOptions { get; } - public FluentAssertions.Execution.AssertionScope UsingLineBreaks { get; } - public static FluentAssertions.Execution.AssertionScope Current { get; } - public void AddNonReportable(string key, object value) { } - public void AddPreFormattedFailure(string formattedFailureMessage) { } - public void AddReportable(string key, System.Func valueFunc) { } - public void AddReportable(string key, string value) { } - public void AppendTracing(string tracingBlock) { } - public void AssumeSingleCaller() { } - public FluentAssertions.Execution.AssertionScope BecauseOf(FluentAssertions.Execution.Reason reason) { } - public FluentAssertions.Execution.AssertionScope BecauseOf(string because, params object[] becauseArgs) { } - public FluentAssertions.Execution.Continuation ClearExpectation() { } - public string[] Discard() { } - public void Dispose() { } - public FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc) { } - public FluentAssertions.Execution.Continuation FailWith(string message) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } - public FluentAssertions.Execution.AssertionScope ForCondition(bool condition) { } - public FluentAssertions.Execution.AssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } - public T Get(string key) { } - public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } - public bool HasFailures() { } - public FluentAssertions.Execution.AssertionScope WithDefaultIdentifier(string identifier) { } - public FluentAssertions.Execution.AssertionScope WithExpectation(string message, params object[] args) { } - } - public class Continuation - { - public FluentAssertions.Execution.IAssertionScope Then { get; } - public static bool op_Implicit(FluentAssertions.Execution.Continuation continuation) { } - } - public class ContinuationOfGiven - { - public FluentAssertions.Execution.GivenSelector Then { get; } - public static bool op_Implicit(FluentAssertions.Execution.ContinuationOfGiven continuationOfGiven) { } - } - public sealed class ContinuedAssertionScope : FluentAssertions.Execution.IAssertionScope, System.IDisposable - { - public FluentAssertions.Execution.IAssertionScope UsingLineBreaks { get; } - public FluentAssertions.Execution.IAssertionScope BecauseOf(string because, params object[] becauseArgs) { } - public FluentAssertions.Execution.Continuation ClearExpectation() { } - public string[] Discard() { } - public void Dispose() { } - public FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc) { } - public FluentAssertions.Execution.Continuation FailWith(string message) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } - public FluentAssertions.Execution.IAssertionScope ForCondition(bool condition) { } - public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } - public FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier) { } - public FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args) { } - } - public static class Execute - { - public static FluentAssertions.Execution.AssertionScope Assertion { get; } - } - public class FailReason - { - public FailReason(string message, params object[] args) { } - public object[] Args { get; } - public string Message { get; } - } - public class GivenSelector - { - public FluentAssertions.Execution.ContinuationOfGiven ClearExpectation() { } - public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message) { } - public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message, params System.Func[] args) { } - public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message, params object[] args) { } - public FluentAssertions.Execution.GivenSelector ForCondition(System.Func predicate) { } - public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } - } - public interface IAssertionScope : System.IDisposable - { - FluentAssertions.Execution.IAssertionScope UsingLineBreaks { get; } - FluentAssertions.Execution.IAssertionScope BecauseOf(string because, params object[] becauseArgs); - FluentAssertions.Execution.Continuation ClearExpectation(); - string[] Discard(); - FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc); - FluentAssertions.Execution.Continuation FailWith(string message); - FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders); - FluentAssertions.Execution.Continuation FailWith(string message, params object[] args); - FluentAssertions.Execution.IAssertionScope ForCondition(bool condition); - FluentAssertions.Execution.GivenSelector Given(System.Func selector); - FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier); - FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args); - } - public interface IAssertionStrategy - { - System.Collections.Generic.IEnumerable FailureMessages { get; } - System.Collections.Generic.IEnumerable DiscardFailures(); - void HandleFailure(string message); - void ThrowIfAny(System.Collections.Generic.IDictionary context); - } - public interface ICloneable2 - { - object Clone(); - } - public class Reason - { - public Reason(string formattedMessage, object[] arguments) { } - public object[] Arguments { get; set; } - public string FormattedMessage { get; set; } - } -} -namespace FluentAssertions.Extensions -{ - public static class FluentDateTimeExtensions - { - public static System.DateTime AddMicroseconds(this System.DateTime self, long microseconds) { } - public static System.DateTimeOffset AddMicroseconds(this System.DateTimeOffset self, long microseconds) { } - public static System.DateTime AddNanoseconds(this System.DateTime self, long nanoseconds) { } - public static System.DateTimeOffset AddNanoseconds(this System.DateTimeOffset self, long nanoseconds) { } - public static System.DateTime After(this System.TimeSpan timeDifference, System.DateTime sourceDateTime) { } - public static System.DateTime April(this int day, int year) { } - public static System.DateTime AsLocal(this System.DateTime dateTime) { } - public static System.DateTime AsUtc(this System.DateTime dateTime) { } - public static System.DateTime At(this System.DateTime date, System.TimeSpan time) { } - public static System.DateTime At(this System.DateTime date, int hours, int minutes, int seconds = 0, int milliseconds = 0, int microseconds = 0, int nanoseconds = 0) { } - public static System.DateTimeOffset At(this System.DateTimeOffset date, int hours, int minutes, int seconds = 0, int milliseconds = 0, int microseconds = 0, int nanoseconds = 0) { } - public static System.DateTime August(this int day, int year) { } - public static System.DateTime Before(this System.TimeSpan timeDifference, System.DateTime sourceDateTime) { } - public static System.DateTime December(this int day, int year) { } - public static System.DateTime February(this int day, int year) { } - public static System.DateTime January(this int day, int year) { } - public static System.DateTime July(this int day, int year) { } - public static System.DateTime June(this int day, int year) { } - public static System.DateTime March(this int day, int year) { } - public static System.DateTime May(this int day, int year) { } - public static int Microsecond(this System.DateTime self) { } - public static int Microsecond(this System.DateTimeOffset self) { } - public static int Nanosecond(this System.DateTime self) { } - public static int Nanosecond(this System.DateTimeOffset self) { } - public static System.DateTime November(this int day, int year) { } - public static System.DateTime October(this int day, int year) { } - public static System.DateTime September(this int day, int year) { } - public static System.DateTimeOffset WithOffset(this System.DateTime self, System.TimeSpan offset) { } - } - public static class FluentTimeSpanExtensions - { - public const long TicksPerMicrosecond = 10; - public const double TicksPerNanosecond = 0.01D; - public static System.TimeSpan And(this System.TimeSpan sourceTime, System.TimeSpan offset) { } - public static System.TimeSpan Days(this double days) { } - public static System.TimeSpan Days(this int days) { } - public static System.TimeSpan Days(this int days, System.TimeSpan offset) { } - public static System.TimeSpan Hours(this double hours) { } - public static System.TimeSpan Hours(this int hours) { } - public static System.TimeSpan Hours(this int hours, System.TimeSpan offset) { } - public static int Microseconds(this System.TimeSpan self) { } - public static System.TimeSpan Microseconds(this int microseconds) { } - public static System.TimeSpan Microseconds(this long microseconds) { } - public static System.TimeSpan Milliseconds(this double milliseconds) { } - public static System.TimeSpan Milliseconds(this int milliseconds) { } - public static System.TimeSpan Minutes(this double minutes) { } - public static System.TimeSpan Minutes(this int minutes) { } - public static System.TimeSpan Minutes(this int minutes, System.TimeSpan offset) { } - public static int Nanoseconds(this System.TimeSpan self) { } - public static System.TimeSpan Nanoseconds(this int nanoseconds) { } - public static System.TimeSpan Nanoseconds(this long nanoseconds) { } - public static System.TimeSpan Seconds(this double seconds) { } - public static System.TimeSpan Seconds(this int seconds) { } - public static System.TimeSpan Seconds(this int seconds, System.TimeSpan offset) { } - public static System.TimeSpan Ticks(this int ticks) { } - public static System.TimeSpan Ticks(this long ticks) { } - public static double TotalMicroseconds(this System.TimeSpan self) { } - public static double TotalNanoseconds(this System.TimeSpan self) { } - } - public static class OccurrenceConstraintExtensions - { - public static FluentAssertions.OccurrenceConstraint TimesExactly(this int times) { } - public static FluentAssertions.OccurrenceConstraint TimesOrLess(this int times) { } - public static FluentAssertions.OccurrenceConstraint TimesOrMore(this int times) { } - } -} -namespace FluentAssertions.Formatting -{ - public class AggregateExceptionValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public AggregateExceptionValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class AttributeBasedFormatter : FluentAssertions.Formatting.IValueFormatter - { - public AttributeBasedFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class ByteValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public ByteValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class DateTimeOffsetValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public DateTimeOffsetValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class DecimalValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public DecimalValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class DefaultValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public DefaultValueFormatter() { } - public virtual bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - protected virtual System.Reflection.MemberInfo[] GetMembers(System.Type type) { } - protected virtual string TypeDisplayName(System.Type type) { } - } - public class DictionaryValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public DictionaryValueFormatter() { } - protected virtual int MaxItems { get; } - public virtual bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class DoubleValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public DoubleValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class EnumValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public EnumValueFormatter() { } - public virtual bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class EnumerableValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public EnumerableValueFormatter() { } - protected virtual int MaxItems { get; } - public virtual bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class ExceptionValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public ExceptionValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class ExpressionValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public ExpressionValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public delegate void FormatChild(string childPath, object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph); - public class FormattedObjectGraph - { - public FormattedObjectGraph(int maxLines) { } - public int LineCount { get; } - public static int SpacesPerIndentation { get; } - public void AddFragment(string fragment) { } - public void AddFragmentOnNewLine(string fragment) { } - public void AddLine(string line) { } - public override string ToString() { } - public System.IDisposable WithIndentation() { } - } - public static class Formatter - { - public static System.Collections.Generic.IEnumerable Formatters { get; } - public static void AddFormatter(FluentAssertions.Formatting.IValueFormatter formatter) { } - public static void RemoveFormatter(FluentAssertions.Formatting.IValueFormatter formatter) { } - public static string ToString(object value, FluentAssertions.Formatting.FormattingOptions options = null) { } - } - public class FormattingContext - { - public FormattingContext() { } - public bool UseLineBreaks { get; set; } - } - public class FormattingOptions - { - public FormattingOptions() { } - public int MaxDepth { get; set; } - public int MaxLines { get; set; } - public bool UseLineBreaks { get; set; } - } - public class GuidValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public GuidValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public interface IValueFormatter - { - bool CanHandle(object value); - void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild); - } - public class Int16ValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public Int16ValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class Int32ValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public Int32ValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class Int64ValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public Int64ValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class MaxLinesExceededException : System.Exception - { - public MaxLinesExceededException() { } - public MaxLinesExceededException(string message) { } - public MaxLinesExceededException(string message, System.Exception innerException) { } - } - public class MultidimensionalArrayFormatter : FluentAssertions.Formatting.IValueFormatter - { - public MultidimensionalArrayFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class NullValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public NullValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class PredicateLambdaExpressionValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public PredicateLambdaExpressionValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class PropertyInfoFormatter : FluentAssertions.Formatting.IValueFormatter - { - public PropertyInfoFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class SByteValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public SByteValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class SingleValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public SingleValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class StringValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public StringValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class TaskFormatter : FluentAssertions.Formatting.IValueFormatter - { - public TaskFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class TimeSpanValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public TimeSpanValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class UInt16ValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public UInt16ValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class UInt32ValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public UInt32ValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class UInt64ValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public UInt64ValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - [System.AttributeUsage(System.AttributeTargets.Method)] - public class ValueFormatterAttribute : System.Attribute - { - public ValueFormatterAttribute() { } - } - public class XAttributeValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public XAttributeValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class XDocumentValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public XDocumentValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class XElementValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public XElementValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } - public class XmlReaderValueFormatter : FluentAssertions.Formatting.IValueFormatter - { - public XmlReaderValueFormatter() { } - public bool CanHandle(object value) { } - public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } - } -} -namespace FluentAssertions.Numeric -{ - public class ComparableTypeAssertions : FluentAssertions.Numeric.ComparableTypeAssertions> - { - public ComparableTypeAssertions(System.IComparable value) { } - } - public class ComparableTypeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions, TAssertions> - where TAssertions : FluentAssertions.Numeric.ComparableTypeAssertions - { - public ComparableTypeAssertions(System.IComparable value) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint Be(T 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 BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, 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) { } - public FluentAssertions.AndConstraint NotBeRankedEquallyTo(T unexpected, string because = "", params object[] becauseArgs) { } - } - public class NullableNumericAssertions : FluentAssertions.Numeric.NullableNumericAssertions> - where T : struct, System.IComparable - { - public NullableNumericAssertions(T? value) { } - } - public class NullableNumericAssertions : FluentAssertions.Numeric.NumericAssertions - where T : struct, System.IComparable - where TAssertions : FluentAssertions.Numeric.NullableNumericAssertions - { - public NullableNumericAssertions(T? value) { } - public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } - } - public class NumericAssertions : FluentAssertions.Numeric.NumericAssertions> - where T : struct, System.IComparable - { - public NumericAssertions(T value) { } - } - public class NumericAssertions - where T : struct, System.IComparable - where TAssertions : FluentAssertions.Numeric.NumericAssertions - { - public NumericAssertions(T value) { } - public T? Subject { get; } - public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, 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 BeNegative(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOfType(System.Type expectedType, 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 BePositive(string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(T unexpected, 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) { } - public FluentAssertions.AndConstraint NotBeOfType(System.Type unexpectedType, string because = "", params object[] becauseArgs) { } - } -} -namespace FluentAssertions.Primitives -{ - public class BooleanAssertions : FluentAssertions.Primitives.BooleanAssertions - { - public BooleanAssertions(bool? value) { } - } - public class BooleanAssertions - where TAssertions : FluentAssertions.Primitives.BooleanAssertions - { - public BooleanAssertions(bool? value) { } - public bool? Subject { get; } - public FluentAssertions.AndConstraint Be(bool expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeFalse(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeTrue(string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint Imply(bool consequent, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(bool unexpected, string because = "", params object[] becauseArgs) { } - } - public class DateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions - { - public DateTimeAssertions(System.DateTime? value) { } - } - public class DateTimeAssertions - where TAssertions : FluentAssertions.Primitives.DateTimeAssertions - { - public DateTimeAssertions(System.DateTime? value) { } - public System.DateTime? Subject { get; } - public FluentAssertions.AndConstraint Be(System.DateTime expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Be(System.DateTime? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeAfter(System.DateTime expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Primitives.DateTimeRangeAssertions BeAtLeast(System.TimeSpan timeSpan) { } - public FluentAssertions.AndConstraint BeBefore(System.DateTime expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeCloseTo(System.DateTime nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Primitives.DateTimeRangeAssertions BeExactly(System.TimeSpan timeSpan) { } - public FluentAssertions.AndConstraint BeIn(System.DateTimeKind expectedKind, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Primitives.DateTimeRangeAssertions BeLessThan(System.TimeSpan timeSpan) { } - public FluentAssertions.Primitives.DateTimeRangeAssertions BeMoreThan(System.TimeSpan timeSpan) { } - public FluentAssertions.AndConstraint BeOnOrAfter(System.DateTime expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOnOrBefore(System.DateTime expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOneOf(params System.DateTime[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(params System.Nullable[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSameDateAs(System.DateTime expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Primitives.DateTimeRangeAssertions BeWithin(System.TimeSpan timeSpan) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveMonth(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveSecond(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveYear(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(System.DateTime? unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAfter(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeBefore(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeCloseTo(System.DateTime distantTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeOnOrAfter(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeOnOrBefore(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeSameDateAs(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveDay(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveHour(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveMinute(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveMonth(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveSecond(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveYear(int unexpected, string because = "", params object[] becauseArgs) { } - } - public class DateTimeOffsetAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions - { - public DateTimeOffsetAssertions(System.DateTimeOffset? value) { } - } - public class DateTimeOffsetAssertions - where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions - { - public DateTimeOffsetAssertions(System.DateTimeOffset? value) { } - public System.DateTimeOffset? Subject { get; } - public FluentAssertions.AndConstraint Be(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Be(System.DateTimeOffset? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeAfter(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Primitives.DateTimeOffsetRangeAssertions BeAtLeast(System.TimeSpan timeSpan) { } - public FluentAssertions.AndConstraint BeBefore(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeCloseTo(System.DateTimeOffset nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Primitives.DateTimeOffsetRangeAssertions BeExactly(System.TimeSpan timeSpan) { } - public FluentAssertions.AndConstraint BeExactly(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeExactly(System.DateTimeOffset? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Primitives.DateTimeOffsetRangeAssertions BeLessThan(System.TimeSpan timeSpan) { } - public FluentAssertions.Primitives.DateTimeOffsetRangeAssertions BeMoreThan(System.TimeSpan timeSpan) { } - public FluentAssertions.AndConstraint BeOnOrAfter(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOnOrBefore(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOneOf(params System.DateTimeOffset[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(params System.Nullable[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSameDateAs(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Primitives.DateTimeOffsetRangeAssertions BeWithin(System.TimeSpan timeSpan) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveMonth(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveOffset(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveSecond(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveYear(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(System.DateTimeOffset? unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAfter(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeBefore(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeCloseTo(System.DateTimeOffset distantTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeExactly(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeExactly(System.DateTimeOffset? unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeOnOrAfter(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeOnOrBefore(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeSameDateAs(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveDay(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveHour(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveMinute(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveMonth(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveOffset(System.TimeSpan unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveSecond(int unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveYear(int unexpected, string because = "", params object[] becauseArgs) { } - } - public class DateTimeOffsetRangeAssertions - where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions - { - protected DateTimeOffsetRangeAssertions(TAssertions parentAssertions, System.DateTimeOffset? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } - public FluentAssertions.AndConstraint After(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Before(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - } - public class DateTimeRangeAssertions - where TAssertions : FluentAssertions.Primitives.DateTimeAssertions - { - protected DateTimeRangeAssertions(TAssertions parentAssertions, System.DateTime? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } - public FluentAssertions.AndConstraint After(System.DateTime target, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Before(System.DateTime target, string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - } - public class EnumAssertions : FluentAssertions.Primitives.EnumAssertions> - where TEnum : struct, System.Enum - { - public EnumAssertions(TEnum subject) { } - } - public class EnumAssertions - where TEnum : struct, System.Enum - where TAssertions : FluentAssertions.Primitives.EnumAssertions - { - public EnumAssertions(TEnum subject) { } - public TEnum? Subject { get; } - public FluentAssertions.AndConstraint Be(TEnum expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Be(TEnum? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeDefined(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOneOf(params TEnum[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint HaveFlag(TEnum expectedFlag, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveSameNameAs(T expected, string because = "", params object[] becauseArgs) - where T : struct, System.Enum { } - public FluentAssertions.AndConstraint HaveSameValueAs(T expected, string because = "", params object[] becauseArgs) - where T : struct, System.Enum { } - public FluentAssertions.AndConstraint HaveValue(decimal expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(TEnum unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(TEnum? unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeDefined(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveFlag(TEnum unexpectedFlag, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveSameNameAs(T unexpected, string because = "", params object[] becauseArgs) - where T : struct, System.Enum { } - public FluentAssertions.AndConstraint NotHaveSameValueAs(T unexpected, string because = "", params object[] becauseArgs) - where T : struct, System.Enum { } - public FluentAssertions.AndConstraint NotHaveValue(decimal unexpected, string because = "", params object[] becauseArgs) { } - } - public class GuidAssertions : FluentAssertions.Primitives.GuidAssertions - { - public GuidAssertions(System.Guid? value) { } - } - public class GuidAssertions - where TAssertions : FluentAssertions.Primitives.GuidAssertions - { - public GuidAssertions(System.Guid? value) { } - public System.Guid? Subject { get; } - public FluentAssertions.AndConstraint Be(System.Guid expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint NotBe(System.Guid unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } - } - public class HttpResponseMessageAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions - { - public HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value) { } - } - public class HttpResponseMessageAssertions : FluentAssertions.Primitives.ObjectAssertions - where TAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions - { - protected HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeRedirection(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSuccessful(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveClientError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveServerError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveStatusCode(System.Net.HttpStatusCode expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveStatusCode(System.Net.HttpStatusCode unexpected, string because = "", params object[] becauseArgs) { } - } - public class NullableBooleanAssertions : FluentAssertions.Primitives.NullableBooleanAssertions - { - public NullableBooleanAssertions(bool? value) { } - } - public class NullableBooleanAssertions : FluentAssertions.Primitives.BooleanAssertions - where TAssertions : FluentAssertions.Primitives.NullableBooleanAssertions - { - public NullableBooleanAssertions(bool? value) { } - public FluentAssertions.AndConstraint Be(bool? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(bool? unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeFalse(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeTrue(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } - } - public class NullableDateTimeAssertions : FluentAssertions.Primitives.NullableDateTimeAssertions - { - public NullableDateTimeAssertions(System.DateTime? expected) { } - } - public class NullableDateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions - where TAssertions : FluentAssertions.Primitives.NullableDateTimeAssertions - { - public NullableDateTimeAssertions(System.DateTime? expected) { } - public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } - } - public class NullableDateTimeOffsetAssertions : FluentAssertions.Primitives.NullableDateTimeOffsetAssertions - { - public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected) { } - } - public class NullableDateTimeOffsetAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions - where TAssertions : FluentAssertions.Primitives.NullableDateTimeOffsetAssertions - { - public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected) { } - public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } - } - public class NullableEnumAssertions : FluentAssertions.Primitives.NullableEnumAssertions> - where TEnum : struct, System.Enum - { - public NullableEnumAssertions(TEnum? subject) { } - } - public class NullableEnumAssertions : FluentAssertions.Primitives.EnumAssertions - where TEnum : struct, System.Enum - where TAssertions : FluentAssertions.Primitives.NullableEnumAssertions - { - public NullableEnumAssertions(TEnum? subject) { } - public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveValue(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint NotBeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } - } - public class NullableGuidAssertions : FluentAssertions.Primitives.NullableGuidAssertions - { - public NullableGuidAssertions(System.Guid? value) { } - } - public class NullableGuidAssertions : FluentAssertions.Primitives.GuidAssertions - where TAssertions : FluentAssertions.Primitives.NullableGuidAssertions - { - public NullableGuidAssertions(System.Guid? value) { } - public FluentAssertions.AndConstraint Be(System.Guid? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } - } - public class NullableSimpleTimeSpanAssertions : FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions - { - public NullableSimpleTimeSpanAssertions(System.TimeSpan? value) { } - } - public class NullableSimpleTimeSpanAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions - where TAssertions : FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions - { - public NullableSimpleTimeSpanAssertions(System.TimeSpan? value) { } - public FluentAssertions.AndConstraint Be(System.TimeSpan? expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } - } - public class ObjectAssertions : FluentAssertions.Primitives.ObjectAssertions - { - public ObjectAssertions(object value) { } - public FluentAssertions.AndConstraint Be(TExpectation expected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(TExpectation unexpected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } - } - public class ObjectAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - where TAssertions : FluentAssertions.Primitives.ObjectAssertions - { - public ObjectAssertions(TSubject value) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Be(TSubject expected, System.Collections.Generic.IEqualityComparer comparer, 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 FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, System.Collections.Generic.IEqualityComparer comparer, 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 NotBe(TSubject unexpected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } - } - public abstract class ReferenceTypeAssertions - where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - protected ReferenceTypeAssertions(TSubject subject) { } - protected abstract string Identifier { get; } - public TSubject Subject { get; } - public FluentAssertions.AndConstraint BeAssignableTo(System.Type type, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint BeAssignableTo(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOfType(System.Type expectedType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint BeOfType(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSameAs(TSubject expected, string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) - where T : TSubject { } - public FluentAssertions.AndConstraint NotBeAssignableTo(System.Type type, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAssignableTo(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeOfType(System.Type unexpectedType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeOfType(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeSameAs(TSubject unexpected, string because = "", params object[] becauseArgs) { } - } - public class SimpleTimeSpanAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions - { - public SimpleTimeSpanAssertions(System.TimeSpan? value) { } - } - public class SimpleTimeSpanAssertions - where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions - { - public SimpleTimeSpanAssertions(System.TimeSpan? value) { } - public System.TimeSpan? Subject { get; } - public FluentAssertions.AndConstraint Be(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeNegative(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BePositive(string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint NotBe(System.TimeSpan unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeCloseTo(System.TimeSpan distantTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - } - public class StringAssertions : FluentAssertions.Primitives.StringAssertions - { - public StringAssertions(string value) { } - } - public class StringAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - where TAssertions : FluentAssertions.Primitives.StringAssertions - { - public StringAssertions(string value) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLowerCased(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeNullOrEmpty(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeNullOrWhiteSpace(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOneOf(params string[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeUpperCased(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Contain(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Contain(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainAll(params string[] values) { } - public FluentAssertions.AndConstraint ContainAll(System.Collections.Generic.IEnumerable values, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainAny(params string[] values) { } - public FluentAssertions.AndConstraint ContainAny(System.Collections.Generic.IEnumerable values, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint EndWith(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint EndWithEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveLength(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Match(string wildcardPattern, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchRegex(string regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchRegex(System.Text.RegularExpressions.Regex regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeLowerCased(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNullOrEmpty(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNullOrWhiteSpace(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeUpperCased(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContain(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainAll(params string[] values) { } - public FluentAssertions.AndConstraint NotContainAll(System.Collections.Generic.IEnumerable values, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainAny(params string[] values) { } - public FluentAssertions.AndConstraint NotContainAny(System.Collections.Generic.IEnumerable values, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotEndWith(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotEndWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotMatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotMatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotStartWith(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint StartWith(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint StartWithEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } - } - public enum TimeSpanCondition - { - MoreThan = 0, - AtLeast = 1, - Exactly = 2, - Within = 3, - LessThan = 4, - } -} -namespace FluentAssertions.Reflection -{ - public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public AssemblyAssertions(System.Reflection.Assembly assembly) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - } -} -namespace FluentAssertions.Specialized -{ - public class ActionAssertions : FluentAssertions.Specialized.DelegateAssertions - { - public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } - protected override string Identifier { get; } - protected override void InvokeSubject() { } - } - public class AsyncFunctionAssertions : FluentAssertions.Specialized.DelegateAssertionsBase, TAssertions> - where TTask : System.Threading.Tasks.Task - where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions - { - [System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" + - "e removed in Version 7.")] - public AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - [System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" + - "e made protected in Version 7.")] - public AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } - protected override string Identifier { get; } - public System.Threading.Tasks.Task> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public System.Threading.Tasks.Task> ThrowAsync(string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public System.Threading.Tasks.Task> ThrowExactlyAsync(string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public System.Threading.Tasks.Task> ThrowWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) - where TException : System.Exception { } - } - public abstract class DelegateAssertionsBase : FluentAssertions.Primitives.ReferenceTypeAssertions> - where TDelegate : System.Delegate - where TAssertions : FluentAssertions.Specialized.DelegateAssertionsBase - { - protected FluentAssertions.AndConstraint NotThrowInternal(System.Exception exception, string because, object[] becauseArgs) { } - protected FluentAssertions.AndConstraint NotThrowInternal(System.Exception exception, string because, object[] becauseArgs) - where TException : System.Exception { } - protected FluentAssertions.Specialized.ExceptionAssertions ThrowInternal(System.Exception exception, string because, object[] becauseArgs) - where TException : System.Exception { } - } - public abstract class DelegateAssertions : FluentAssertions.Specialized.DelegateAssertionsBase - where TDelegate : System.Delegate - where TAssertions : FluentAssertions.Specialized.DelegateAssertions - { - protected DelegateAssertions(TDelegate @delegate, FluentAssertions.Specialized.IExtractExceptions extractor) { } - protected abstract void InvokeSubject(); - public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Specialized.ExceptionAssertions Throw(string because = "", params object[] becauseArgs) - where TException : System.Exception { } - public FluentAssertions.Specialized.ExceptionAssertions ThrowExactly(string because = "", params object[] becauseArgs) - where TException : System.Exception { } - } - public class ExceptionAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions, FluentAssertions.Specialized.ExceptionAssertions> - where TException : System.Exception - { - public ExceptionAssertions(System.Collections.Generic.IEnumerable exceptions) { } - public TException And { get; } - protected override string Identifier { get; } - public TException Which { get; } - public FluentAssertions.Specialized.ExceptionAssertions Where(System.Linq.Expressions.Expression> exceptionExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.Specialized.ExceptionAssertions WithInnerException(System.Type innerException, string because = "", params object[] becauseArgs) { } - public virtual FluentAssertions.Specialized.ExceptionAssertions WithInnerException(string because = "", params object[] becauseArgs) - where TInnerException : System.Exception { } - public FluentAssertions.Specialized.ExceptionAssertions WithInnerExceptionExactly(System.Type innerException, string because = "", params object[] becauseArgs) { } - public virtual FluentAssertions.Specialized.ExceptionAssertions WithInnerExceptionExactly(string because = "", params object[] becauseArgs) - where TInnerException : System.Exception { } - public virtual FluentAssertions.Specialized.ExceptionAssertions WithMessage(string expectedWildcardPattern, string because = "", params object[] becauseArgs) { } - } - public class ExecutionTime - { - public ExecutionTime(System.Action action, FluentAssertions.Common.StartTimer createTimer) { } - public ExecutionTime(System.Func action, FluentAssertions.Common.StartTimer createTimer) { } - protected ExecutionTime(System.Action action, string actionDescription, FluentAssertions.Common.StartTimer createTimer) { } - protected ExecutionTime(System.Func action, string actionDescription, FluentAssertions.Common.StartTimer createTimer) { } - } - public class ExecutionTimeAssertions - { - public ExecutionTimeAssertions(FluentAssertions.Specialized.ExecutionTime executionTime) { } - public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan expectedDuration, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessThan(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeLessThanOrEqualTo(System.TimeSpan maxDuration, string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - } - public class FunctionAssertions : FluentAssertions.Specialized.DelegateAssertions, FluentAssertions.Specialized.FunctionAssertions> - { - public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } - protected override string Identifier { get; } - protected override void InvokeSubject() { } - public FluentAssertions.AndWhichConstraint, T> NotThrow(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, T> NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } - } - public class GenericAsyncFunctionAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions, FluentAssertions.Specialized.GenericAsyncFunctionAssertions> - { - public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } - public System.Threading.Tasks.Task, TResult>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task, TResult>> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task, TResult>> NotThrowAsync(string because = "", params object[] becauseArgs) { } - } - public interface IExtractExceptions - { - System.Collections.Generic.IEnumerable OfType(System.Exception actualException) - where T : System.Exception; - } - public class MemberExecutionTime : FluentAssertions.Specialized.ExecutionTime - { - public MemberExecutionTime(T subject, System.Linq.Expressions.Expression> action, FluentAssertions.Common.StartTimer createTimer) { } - } - public class NonGenericAsyncFunctionAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions - { - public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } - } - public class TaskCompletionSourceAssertionsBase - { - protected TaskCompletionSourceAssertionsBase(FluentAssertions.Common.IClock clock) { } - public override bool Equals(object obj) { } - } - public class TaskCompletionSourceAssertions : FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase - { - public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs) { } - public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Common.IClock clock) { } - public System.Threading.Tasks.Task, T>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task>> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } - } -} -namespace FluentAssertions.Streams -{ - public class BufferedStreamAssertions : FluentAssertions.Streams.BufferedStreamAssertions - { - public BufferedStreamAssertions(System.IO.BufferedStream stream) { } - } - public class BufferedStreamAssertions : FluentAssertions.Streams.StreamAssertions - where TAssertions : FluentAssertions.Streams.BufferedStreamAssertions - { - public BufferedStreamAssertions(System.IO.BufferedStream stream) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint HaveBufferSize(int expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveBufferSize(int unexpected, string because = "", params object[] becauseArgs) { } - } - public class StreamAssertions : FluentAssertions.Streams.StreamAssertions - { - public StreamAssertions(System.IO.Stream stream) { } - } - public class StreamAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - where TSubject : System.IO.Stream - where TAssertions : FluentAssertions.Streams.StreamAssertions - { - public StreamAssertions(TSubject stream) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeReadOnly(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeReadable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSeekable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeWritable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeWriteOnly(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveLength(long expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HavePosition(long expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeReadOnly(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeReadable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeSeekable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeWritable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeWriteOnly(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveLength(long unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHavePosition(long unexpected, string because = "", params object[] becauseArgs) { } - } -} -namespace FluentAssertions.Types -{ - public static class AllTypes - { - public static FluentAssertions.Types.TypeSelector From(System.Reflection.Assembly assembly) { } - } - public class ConstructorInfoAssertions : FluentAssertions.Types.MethodBaseAssertions - { - public ConstructorInfoAssertions(System.Reflection.ConstructorInfo constructorInfo) { } - protected override string Identifier { get; } - } - public abstract class MemberInfoAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - where TSubject : System.Reflection.MemberInfo - where TAssertions : FluentAssertions.Types.MemberInfoAssertions - { - protected MemberInfoAssertions(TSubject subject) { } - protected override string Identifier { get; } - public FluentAssertions.AndWhichConstraint, TAttribute> BeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndWhichConstraint, TAttribute> BeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - } - public abstract class MethodBaseAssertions : FluentAssertions.Types.MemberInfoAssertions - where TSubject : System.Reflection.MethodBase - where TAssertions : FluentAssertions.Types.MethodBaseAssertions - { - protected MethodBaseAssertions(TSubject subject) { } - public FluentAssertions.AndConstraint HaveAccessModifier(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveAccessModifier(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } - } - public class MethodInfoAssertions : FluentAssertions.Types.MethodBaseAssertions - { - public MethodInfoAssertions(System.Reflection.MethodInfo methodInfo) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeAsync(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAsync(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> NotReturn(System.Type returnType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> NotReturn(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> NotReturnVoid(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> Return(System.Type returnType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> Return(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint> ReturnVoid(string because = "", params object[] becauseArgs) { } - } - public class MethodInfoSelector : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - public MethodInfoSelector(System.Collections.Generic.IEnumerable types) { } - public MethodInfoSelector(System.Type type) { } - public FluentAssertions.Types.MethodInfoSelector ThatArePublicOrInternal { get; } - public FluentAssertions.Types.MethodInfoSelector ThatDoNotReturnVoid { get; } - public FluentAssertions.Types.MethodInfoSelector ThatReturnVoid { get; } - public System.Collections.Generic.IEnumerator GetEnumerator() { } - public FluentAssertions.Types.TypeSelector ReturnTypes() { } - public FluentAssertions.Types.MethodInfoSelector ThatAreAbstract() { } - public FluentAssertions.Types.MethodInfoSelector ThatAreAsync() { } - public FluentAssertions.Types.MethodInfoSelector ThatAreDecoratedWith() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.MethodInfoSelector ThatAreDecoratedWithOrInherit() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.MethodInfoSelector ThatAreNotAbstract() { } - public FluentAssertions.Types.MethodInfoSelector ThatAreNotAsync() { } - public FluentAssertions.Types.MethodInfoSelector ThatAreNotDecoratedWith() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.MethodInfoSelector ThatAreNotDecoratedWithOrInherit() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.MethodInfoSelector ThatAreNotStatic() { } - public FluentAssertions.Types.MethodInfoSelector ThatAreNotVirtual() { } - public FluentAssertions.Types.MethodInfoSelector ThatAreStatic() { } - public FluentAssertions.Types.MethodInfoSelector ThatAreVirtual() { } - public FluentAssertions.Types.MethodInfoSelector ThatDoNotReturn() { } - public FluentAssertions.Types.MethodInfoSelector ThatReturn() { } - public System.Reflection.MethodInfo[] ToArray() { } - } - public class MethodInfoSelectorAssertions - { - public MethodInfoSelectorAssertions(params System.Reflection.MethodInfo[] methods) { } - protected string Context { get; } - public System.Collections.Generic.IEnumerable SubjectMethods { get; } - public FluentAssertions.AndConstraint Be(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeAsync(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint BeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint NotBe(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAsync(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) { } - } - public class PropertyInfoAssertions : FluentAssertions.Types.MemberInfoAssertions - { - public PropertyInfoAssertions(System.Reflection.PropertyInfo propertyInfo) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeReadable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeReadable(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeWritable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeWritable(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeReadable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeWritable(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotReturn(System.Type propertyType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotReturn(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Return(System.Type propertyType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Return(string because = "", params object[] becauseArgs) { } - } - public class PropertyInfoSelector : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - public PropertyInfoSelector(System.Collections.Generic.IEnumerable types) { } - public PropertyInfoSelector(System.Type type) { } - public FluentAssertions.Types.PropertyInfoSelector ThatAreAbstract { get; } - public FluentAssertions.Types.PropertyInfoSelector ThatAreNotAbstract { get; } - public FluentAssertions.Types.PropertyInfoSelector ThatAreNotStatic { get; } - public FluentAssertions.Types.PropertyInfoSelector ThatAreNotVirtual { get; } - public FluentAssertions.Types.PropertyInfoSelector ThatArePublicOrInternal { get; } - public FluentAssertions.Types.PropertyInfoSelector ThatAreStatic { get; } - public FluentAssertions.Types.PropertyInfoSelector ThatAreVirtual { get; } - public System.Collections.Generic.IEnumerator GetEnumerator() { } - public FluentAssertions.Types.PropertyInfoSelector NotOfType() { } - public FluentAssertions.Types.PropertyInfoSelector OfType() { } - public FluentAssertions.Types.TypeSelector ReturnTypes() { } - public FluentAssertions.Types.PropertyInfoSelector ThatAreDecoratedWith() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.PropertyInfoSelector ThatAreDecoratedWithOrInherit() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.PropertyInfoSelector ThatAreNotDecoratedWith() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.PropertyInfoSelector ThatAreNotDecoratedWithOrInherit() - where TAttribute : System.Attribute { } - public System.Reflection.PropertyInfo[] ToArray() { } - } - public class PropertyInfoSelectorAssertions - { - public PropertyInfoSelectorAssertions(params System.Reflection.PropertyInfo[] properties) { } - protected string Context { get; } - public System.Collections.Generic.IEnumerable SubjectProperties { get; } - public FluentAssertions.AndConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeWritable(string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeWritable(string because = "", params object[] becauseArgs) { } - } - public class TypeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public TypeAssertions(System.Type type) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint Be(System.Type expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Be(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeAbstract(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeAssignableTo(System.Type type, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeAssignableTo(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndWhichConstraint BeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndWhichConstraint BeDecoratedWithOrInherit(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndWhichConstraint BeDecoratedWithOrInherit(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint BeDerivedFrom(System.Type baseType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeDerivedFrom(string because = "", params object[] becauseArgs) - where TBaseClass : class { } - public FluentAssertions.AndConstraint BeSealed(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeStatic(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAccessModifier(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveConstructor(System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveDefaultConstructor(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveExplicitConversionOperator(System.Type sourceType, System.Type targetType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveExplicitConversionOperator(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveExplicitMethod(System.Type interfaceType, string name, System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveExplicitMethod(string name, System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) - where TInterface : class { } - public FluentAssertions.AndConstraint HaveExplicitProperty(System.Type interfaceType, string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveExplicitProperty(string name, string because = "", params object[] becauseArgs) - where TInterface : class { } - public FluentAssertions.AndWhichConstraint HaveImplicitConversionOperator(System.Type sourceType, System.Type targetType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveImplicitConversionOperator(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveIndexer(System.Type indexerType, System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveMethod(string name, System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveProperty(System.Type propertyType, string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveProperty(string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Implement(System.Type interfaceType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Implement(string because = "", params object[] becauseArgs) - where TInterface : class { } - public FluentAssertions.AndConstraint NotBe(System.Type unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAbstract(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAssignableTo(System.Type type, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAssignableTo(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWithOrInherit(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWithOrInherit(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDerivedFrom(System.Type baseType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeDerivedFrom(string because = "", params object[] becauseArgs) - where TBaseClass : class { } - public FluentAssertions.AndConstraint NotBeSealed(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeStatic(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveAccessModifier(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint NotHaveConstructor(System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint NotHaveDefaultConstructor(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveExplicitConversionOperator(System.Type sourceType, System.Type targetType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveExplicitConversionOperator(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveExplicitMethod(System.Type interfaceType, string name, System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveExplicitMethod(string name, System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) - where TInterface : class { } - public FluentAssertions.AndConstraint NotHaveExplicitProperty(System.Type interfaceType, string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveExplicitProperty(string name, string because = "", params object[] becauseArgs) - where TInterface : class { } - public FluentAssertions.AndConstraint NotHaveImplicitConversionOperator(System.Type sourceType, System.Type targetType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveImplicitConversionOperator(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveIndexer(System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveMethod(string name, System.Collections.Generic.IEnumerable parameterTypes, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveProperty(string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotImplement(System.Type interfaceType, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotImplement(string because = "", params object[] becauseArgs) - where TInterface : class { } - } - public class TypeSelector : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - public TypeSelector(System.Collections.Generic.IEnumerable types) { } - public TypeSelector(System.Type type) { } - public System.Collections.Generic.IEnumerator GetEnumerator() { } - public FluentAssertions.Types.TypeSelector ThatAreAbstract() { } - public FluentAssertions.Types.TypeSelector ThatAreClasses() { } - public FluentAssertions.Types.TypeSelector ThatAreDecoratedWith() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.TypeSelector ThatAreDecoratedWithOrInherit() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.TypeSelector ThatAreInNamespace(string @namespace) { } - public FluentAssertions.Types.TypeSelector ThatAreInterfaces() { } - public FluentAssertions.Types.TypeSelector ThatAreNotAbstract() { } - public FluentAssertions.Types.TypeSelector ThatAreNotClasses() { } - public FluentAssertions.Types.TypeSelector ThatAreNotDecoratedWith() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.TypeSelector ThatAreNotDecoratedWithOrInherit() - where TAttribute : System.Attribute { } - public FluentAssertions.Types.TypeSelector ThatAreNotInNamespace(string @namespace) { } - public FluentAssertions.Types.TypeSelector ThatAreNotInterfaces() { } - public FluentAssertions.Types.TypeSelector ThatAreNotSealed() { } - public FluentAssertions.Types.TypeSelector ThatAreNotStatic() { } - public FluentAssertions.Types.TypeSelector ThatAreNotUnderNamespace(string @namespace) { } - public FluentAssertions.Types.TypeSelector ThatAreNotValueTypes() { } - public FluentAssertions.Types.TypeSelector ThatAreSealed() { } - public FluentAssertions.Types.TypeSelector ThatAreStatic() { } - public FluentAssertions.Types.TypeSelector ThatAreUnderNamespace(string @namespace) { } - public FluentAssertions.Types.TypeSelector ThatAreValueTypes() { } - public FluentAssertions.Types.TypeSelector ThatDeriveFrom() { } - public FluentAssertions.Types.TypeSelector ThatDoNotDeriveFrom() { } - public FluentAssertions.Types.TypeSelector ThatDoNotImplement() { } - public FluentAssertions.Types.TypeSelector ThatImplement() { } - public FluentAssertions.Types.TypeSelector ThatSatisfy(System.Func predicate) { } - public System.Type[] ToArray() { } - public FluentAssertions.Types.TypeSelector UnwrapEnumerableTypes() { } - public FluentAssertions.Types.TypeSelector UnwrapTaskTypes() { } - } - public class TypeSelectorAssertions - { - public TypeSelectorAssertions(params System.Type[] types) { } - public System.Collections.Generic.IEnumerable Subject { get; } - public FluentAssertions.AndConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint BeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint BeDecoratedWithOrInherit(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint BeDecoratedWithOrInherit(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint BeInNamespace(string @namespace, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSealed(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeUnderNamespace(string @namespace, string because = "", params object[] becauseArgs) { } - public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWith(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWithOrInherit(string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeDecoratedWithOrInherit(System.Linq.Expressions.Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) - where TAttribute : System.Attribute { } - public FluentAssertions.AndConstraint NotBeInNamespace(string @namespace, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeSealed(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeUnderNamespace(string @namespace, string because = "", params object[] becauseArgs) { } - } -} -namespace FluentAssertions.Xml -{ - public class XAttributeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public XAttributeAssertions(System.Xml.Linq.XAttribute attribute) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint Be(System.Xml.Linq.XAttribute expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XAttribute unexpected, string because = "", params object[] becauseArgs) { } - } - public class XDocumentAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public XDocumentAssertions(System.Xml.Linq.XDocument document) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint Be(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveRoot(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveRoot(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } - } - public class XElementAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public XElementAssertions(System.Xml.Linq.XElement xElement) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint Be(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttribute(System.Xml.Linq.XName expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } - } - public class XmlElementAssertions : FluentAssertions.Xml.XmlNodeAssertions - { - public XmlElementAssertions(System.Xml.XmlElement xmlElement) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttributeWithNamespace(string expectedName, string expectedNamespace, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(string expectedName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElementWithNamespace(string expectedName, string expectedNamespace, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveInnerText(string expected, string because = "", params object[] becauseArgs) { } - } - public class XmlNodeAssertions : FluentAssertions.Xml.XmlNodeAssertions - { - public XmlNodeAssertions(System.Xml.XmlNode xmlNode) { } - } - public class XmlNodeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - where TSubject : System.Xml.XmlNode - where TAssertions : FluentAssertions.Xml.XmlNodeAssertions - { - public XmlNodeAssertions(TSubject xmlNode) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.XmlNode expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.XmlNode unexpected, string because = "", params object[] becauseArgs) { } - } - public class XmlNodeFormatter : FluentAssertions.Formatting.IValueFormatter - { - public XmlNodeFormatter() { } - 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/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs index 128514b678..648b9d80be 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs @@ -157,9 +157,7 @@ public class UserRolesLookupElement private readonly Dictionary> innerRoles = new(); public virtual Dictionary> Roles - { - get { return innerRoles.ToDictionary(x => x.Key, y => y.Value.Select(z => z)); } - } + => innerRoles.ToDictionary(x => x.Key, y => y.Value.Select(z => z)); public void Add(Guid userId, params string[] roles) { @@ -315,7 +313,10 @@ public void When_collection_of_same_count_does_not_match_it_should_include_at_mo public void When_a_nullable_collection_does_not_match_it_should_throw() { // Arrange - var subject = new { Values = (ImmutableArray?)ImmutableArray.Create(1, 2, 3) }; + var subject = new + { + Values = (ImmutableArray?)ImmutableArray.Create(1, 2, 3) + }; // Act Action act = () => subject.Should().BeEquivalentTo(new diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 17f0ed9e6b..7f69be6c33 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -1,7 +1,7 @@ - net47;net6.0;netcoreapp2.0;netcoreapp2.1;netcoreapp3.1 + net47;net6.0 True ..\..\Src\FluentAssertions\FluentAssertions.snk false @@ -24,29 +24,6 @@ - - - all - runtime; build; native; contentfiles; analyzers - - - - - - - all - runtime; build; native; contentfiles; analyzers - - - - - - - all - runtime; build; native; contentfiles; analyzers - - - diff --git a/Tests/FluentAssertions.Specs/Common/TimeSpanExtensions.cs b/Tests/FluentAssertions.Specs/Common/TimeSpanExtensions.cs index 1dbd668b12..57e4db9038 100644 --- a/Tests/FluentAssertions.Specs/Common/TimeSpanExtensions.cs +++ b/Tests/FluentAssertions.Specs/Common/TimeSpanExtensions.cs @@ -3,7 +3,7 @@ namespace FluentAssertions.Specs.Common; /// -/// Implements extensions to available in .NET Core 2+, but not in .NET Framework. +/// Implements extensions to /// public static class TimeSpanExtensions { diff --git a/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs index c211c9f0b8..892d199047 100644 --- a/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs @@ -1,4 +1,9 @@ -using System; +#if NET47 +using System.Reflection; +using System.Reflection.Emit; +#endif + +using System; using System.ComponentModel; using System.Linq; using FluentAssertions.Events; @@ -7,10 +12,6 @@ using FluentAssertions.Formatting; using Xunit; using Xunit.Sdk; -#if NETFRAMEWORK -using System.Reflection; -using System.Reflection.Emit; -#endif namespace FluentAssertions.Specs.Events; diff --git a/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs index 47971b006e..eeff68e60b 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs @@ -2,11 +2,11 @@ using System.Threading.Tasks; using FluentAssertions.Execution; using FluentAssertions.Extensions; -using Xunit; -using Xunit.Sdk; -#if NETFRAMEWORK +#if NET47 using FluentAssertions.Specs.Common; #endif +using Xunit; +using Xunit.Sdk; namespace FluentAssertions.Specs.Exceptions; diff --git a/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs index 859aabe359..778382c494 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs @@ -2,11 +2,11 @@ using System.Threading.Tasks; using FluentAssertions.Execution; using FluentAssertions.Extensions; -using Xunit; -using Xunit.Sdk; -#if NETFRAMEWORK +#if NET47 using FluentAssertions.Specs.Common; #endif +using Xunit; +using Xunit.Sdk; namespace FluentAssertions.Specs.Exceptions; diff --git a/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs index 448b553067..73eb1de47d 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs @@ -1,9 +1,9 @@ -#if NETFRAMEWORK -using FluentAssertions.Specs.Common; -#endif -using System; +using System; using System.Threading.Tasks; using FluentAssertions.Execution; +#if NET47 +using FluentAssertions.Specs.Common; +#endif using Xunit; using Xunit.Sdk; using static FluentAssertions.Extensions.FluentTimeSpanExtensions; diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 295b1b5d1c..bbdf21d880 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -1,7 +1,7 @@ - net47;net6.0;netcoreapp2.0;netcoreapp2.1;netcoreapp3.1 + net47;net6.0 True ..\..\Src\FluentAssertions\FluentAssertions.snk false @@ -9,10 +9,6 @@ full - - - - - + all runtime; build; native; contentfiles; analyzers @@ -26,7 +26,7 @@ - + all runtime; build; native; contentfiles; analyzers @@ -36,7 +36,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index bbdf21d880..d87ba2457a 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -18,7 +18,7 @@ Upgrading to 1.6.0 gives "Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0" --> - + all runtime; build; native; contentfiles; analyzers @@ -26,7 +26,7 @@ - + all runtime; build; native; contentfiles; analyzers @@ -34,7 +34,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index 9d3e4e18e1..f19283ecfe 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -1,4 +1,4 @@ - + net47;net6.0 XUnit2.Specs @@ -12,8 +12,8 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 480d59a907..8e2a663c3f 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -7,8 +7,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all From 3d6a1fd2f9872e3c87b981508e00cb0f4df5e9ad Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 27 Sep 2023 20:26:25 +0200 Subject: [PATCH 066/845] Remove tests of sync over async These were introduced in #1027 when `AsyncFunctionAssertions` had blocking calls. We have since embraced async code better. --- .../Exceptions/FunctionExceptionAssertionSpecs.cs | 10 ---------- .../FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs index 778382c494..d2499eb23f 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs @@ -669,15 +669,5 @@ public void When_function_throw_one_exception_but_other_was_not_expected_it_shou action.Should().NotThrow(); } - [Fact] - public void When_no_exception_should_be_thrown_by_sync_over_async_it_should_not_throw() - { - // Arrange - Func func = () => Task.Delay(0).Wait(0); - - // Act / Assert - func.Should().NotThrow(); - } - #endregion } diff --git a/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs index 73eb1de47d..a33bcdb56a 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs @@ -58,16 +58,6 @@ public void When_a_specific_exception_should_not_be_thrown_but_another_was_it_sh foo.Invoking(f => f.Do()).Should().NotThrow(); } - [Fact] - public void When_no_exception_should_be_thrown_by_sync_over_async_it_should_not_throw() - { - // Arrange - Action act = () => Task.Delay(0).Wait(0); - - // Act / Assert - act.Should().NotThrow(); - } - [Fact] public void When_no_exception_should_be_thrown_but_it_was_it_should_throw() { From 855bdefde9b633eee9d84a179a65b1f005b2f92e Mon Sep 17 00:00:00 2001 From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> Date: Sat, 30 Sep 2023 17:58:08 +0200 Subject: [PATCH 067/845] Add `ForConstraint` to `IAssertionScope` (#2324) * Add `ForConstraint` to `IAssertionScope` * Add release notes * Accept api changes --- .../Execution/AssertionScope.cs | 13 +- .../Execution/ContinuedAssertionScope.cs | 11 ++ .../Execution/IAssertionScope.cs | 12 ++ .../FluentAssertions/net47.verified.txt | 2 + .../FluentAssertions/net6.0.verified.txt | 2 + .../netstandard2.0.verified.txt | 2 + .../netstandard2.1.verified.txt | 2 + .../AssertionScope.ChainingApiSpecs.cs | 145 ++++++++++++++++++ docs/_pages/releases.md | 1 + 9 files changed, 180 insertions(+), 10 deletions(-) diff --git a/Src/FluentAssertions/Execution/AssertionScope.cs b/Src/FluentAssertions/Execution/AssertionScope.cs index f9436ff254..fd32cf5918 100644 --- a/Src/FluentAssertions/Execution/AssertionScope.cs +++ b/Src/FluentAssertions/Execution/AssertionScope.cs @@ -226,16 +226,7 @@ public AssertionScope ForCondition(bool condition) return this; } - /// - /// Makes assertion fail when does not match . - /// - /// The occurrence description in natural language could then be inserted in failure message by using - /// {expectedOccurrence} placeholder in message parameters of and its - /// overloaded versions. - /// - /// - /// defining the number of expected occurrences. - /// The number of actual occurrences. + /// public AssertionScope ForConstraint(OccurrenceConstraint constraint, int actualOccurrences) { constraint.RegisterReportables(this); @@ -455,6 +446,8 @@ private static void SetCurrentAssertionScope(AssertionScope scope) IAssertionScope IAssertionScope.ForCondition(bool condition) => ForCondition(condition); + IAssertionScope IAssertionScope.ForConstraint(OccurrenceConstraint constraint, int actualOccurrences) => ForConstraint(constraint, actualOccurrences); + IAssertionScope IAssertionScope.BecauseOf(string because, params object[] becauseArgs) => BecauseOf(because, becauseArgs); IAssertionScope IAssertionScope.WithExpectation(string message, params object[] args) => WithExpectation(message, args); diff --git a/Src/FluentAssertions/Execution/ContinuedAssertionScope.cs b/Src/FluentAssertions/Execution/ContinuedAssertionScope.cs index 52cddb56f5..1db8e75912 100644 --- a/Src/FluentAssertions/Execution/ContinuedAssertionScope.cs +++ b/Src/FluentAssertions/Execution/ContinuedAssertionScope.cs @@ -42,6 +42,17 @@ public IAssertionScope ForCondition(bool condition) return this; } + /// + public IAssertionScope ForConstraint(OccurrenceConstraint constraint, int actualOccurrences) + { + if (continueAsserting) + { + return predecessor.ForConstraint(constraint, actualOccurrences); + } + + return this; + } + /// public Continuation FailWith(string message) { diff --git a/Src/FluentAssertions/Execution/IAssertionScope.cs b/Src/FluentAssertions/Execution/IAssertionScope.cs index 0ed41c0292..1324bed4b7 100644 --- a/Src/FluentAssertions/Execution/IAssertionScope.cs +++ b/Src/FluentAssertions/Execution/IAssertionScope.cs @@ -20,6 +20,18 @@ public interface IAssertionScope : IDisposable /// IAssertionScope ForCondition(bool condition); + /// + /// Makes assertion fail when does not match . + /// + /// The occurrence description in natural language could then be inserted in failure message by using + /// {expectedOccurrence} placeholder in message parameters of and its + /// overloaded versions. + /// + /// + /// defining the number of expected occurrences. + /// The number of actual occurrences. + IAssertionScope ForConstraint(OccurrenceConstraint constraint, int actualOccurrences); + /// /// Sets the failure message when the assertion is not met, or completes the failure message set to a prior call to /// . diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index ac21f97b50..288c6437f0 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -1194,6 +1194,7 @@ namespace FluentAssertions.Execution public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } public FluentAssertions.Execution.IAssertionScope ForCondition(bool condition) { } + public FluentAssertions.Execution.IAssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } public FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier) { } public FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args) { } @@ -1228,6 +1229,7 @@ namespace FluentAssertions.Execution FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders); FluentAssertions.Execution.Continuation FailWith(string message, params object[] args); FluentAssertions.Execution.IAssertionScope ForCondition(bool condition); + FluentAssertions.Execution.IAssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences); FluentAssertions.Execution.GivenSelector Given(System.Func selector); FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier); FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args); diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 34b5aaf1c4..c1dc2b0fe2 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -1207,6 +1207,7 @@ namespace FluentAssertions.Execution public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } public FluentAssertions.Execution.IAssertionScope ForCondition(bool condition) { } + public FluentAssertions.Execution.IAssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } public FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier) { } public FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args) { } @@ -1241,6 +1242,7 @@ namespace FluentAssertions.Execution FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders); FluentAssertions.Execution.Continuation FailWith(string message, params object[] args); FluentAssertions.Execution.IAssertionScope ForCondition(bool condition); + FluentAssertions.Execution.IAssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences); FluentAssertions.Execution.GivenSelector Given(System.Func selector); FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier); FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args); diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 0b633457c5..e6376ee7d8 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -1145,6 +1145,7 @@ namespace FluentAssertions.Execution public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } public FluentAssertions.Execution.IAssertionScope ForCondition(bool condition) { } + public FluentAssertions.Execution.IAssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } public FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier) { } public FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args) { } @@ -1179,6 +1180,7 @@ namespace FluentAssertions.Execution FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders); FluentAssertions.Execution.Continuation FailWith(string message, params object[] args); FluentAssertions.Execution.IAssertionScope ForCondition(bool condition); + FluentAssertions.Execution.IAssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences); FluentAssertions.Execution.GivenSelector Given(System.Func selector); FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier); FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args); diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 4cc370a459..e57d709b48 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -1194,6 +1194,7 @@ namespace FluentAssertions.Execution public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } public FluentAssertions.Execution.IAssertionScope ForCondition(bool condition) { } + public FluentAssertions.Execution.IAssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } public FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier) { } public FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args) { } @@ -1228,6 +1229,7 @@ namespace FluentAssertions.Execution FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders); FluentAssertions.Execution.Continuation FailWith(string message, params object[] args); FluentAssertions.Execution.IAssertionScope ForCondition(bool condition); + FluentAssertions.Execution.IAssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences); FluentAssertions.Execution.GivenSelector Given(System.Func selector); FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier); FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args); diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScope.ChainingApiSpecs.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScope.ChainingApiSpecs.cs index dfe06be10b..638cfb34fe 100644 --- a/Tests/FluentAssertions.Specs/Execution/AssertionScope.ChainingApiSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/AssertionScope.ChainingApiSpecs.cs @@ -426,4 +426,149 @@ public void When_the_previous_assertion_succeeded_it_should_not_affect_the_succe act.Should().Throw() .WithMessage("Expected other"); } + + [Fact] + public void Continuing_an_assertion_with_occurrence() + { + // Act + Action act = () => Execute.Assertion + .ForCondition(true) + .FailWith("First assertion") + .Then + .WithExpectation("{expectedOccurrence} ") + .ForConstraint(Exactly.Once(), 2) + .FailWith("Second {0}", "assertion"); + + // Assert + act.Should().Throw() + .WithMessage("Exactly 1 time Second \"assertion\"*"); + } + + [Fact] + public void Continuing_an_assertion_with_occurrence_will_not_be_executed_when_first_assertion_fails() + { + // Act + Action act = () => Execute.Assertion + .ForCondition(false) + .FailWith("First assertion") + .Then + .WithExpectation("{expectedOccurrence} ") + .ForConstraint(Exactly.Once(), 2) + .FailWith("Second {0}", "assertion"); + + // Assert + act.Should().Throw() + .WithMessage("First assertion"); + } + + [Fact] + public void Continuing_an_assertion_with_occurrence_overrides_the_previous_defined_expectations() + { + // Act + Action act = () => Execute.Assertion + .WithExpectation("First expectation") + .ForCondition(true) + .FailWith("First assertion") + .Then + .WithExpectation("{expectedOccurrence} ") + .ForConstraint(Exactly.Once(), 2) + .FailWith("Second {0}", "assertion"); + + // Assert + act.Should().Throw() + .WithMessage("Exactly 1 time Second \"assertion\"*"); + } + + [Fact] + public void Continuing_an_assertion_after_occurrence_check_works() + { + // Act + Action act = () => Execute.Assertion + .WithExpectation("{expectedOccurrence} ") + .ForConstraint(Exactly.Once(), 1) + .FailWith("First assertion") + .Then + .WithExpectation("Second expectation ") + .ForCondition(false) + .FailWith("Second {0}", "assertion"); + + // Assert + act.Should().Throw() + .WithMessage("Second expectation Second \"assertion\"*"); + } + + [Fact] + public void Continuing_an_assertion_with_occurrence_check_before_defining_expectation_works() + { + // Act + Action act = () => Execute.Assertion + .ForCondition(true) + .FailWith("First assertion") + .Then + .ForConstraint(Exactly.Once(), 2) + .WithExpectation("Second expectation ") + .FailWith("Second {0}", "assertion"); + + // Assert + act.Should().Throw() + .WithMessage("Second expectation Second \"assertion\"*"); + } + + [Fact] + public void Does_not_continue_a_chained_assertion_after_the_first_one_failed_the_occurrence_check() + { + // Arrange + using var scope = new AssertionScope(); + + // Act + Execute.Assertion + .ForConstraint(Exactly.Once(), 2) + .FailWith("First {0}", "assertion") + .Then + .ForConstraint(Exactly.Once(), 2) + .FailWith("Second {0}", "assertion"); + + string[] failures = scope.Discard(); + scope.Dispose(); + + // Assert + Assert.Single(failures); + Assert.Contains("First \"assertion\"", failures); + } + + [Fact] + public void Discard_a_scope_after_continuing_chained_assertion() + { + // Arrange + using var scope = new AssertionScope(); + + // Act + var failures = Execute.Assertion + .ForConstraint(Exactly.Once(), 2) + .FailWith("First {0}", "assertion") + .Then + .Discard(); + + // Assert + Assert.Single(failures); + Assert.Contains("First \"assertion\"", failures); + } + + [Fact] + public void Get_info_about_line_breaks_from_parent_scope_after_continuing_chained_assertion() + { + // Arrange + using var scope = new AssertionScope(); + scope.FormattingOptions.UseLineBreaks = true; + + // Act + var innerScope = Execute.Assertion + .ForConstraint(Exactly.Once(), 1) + .FailWith("First {0}", "assertion") + .Then + .UsingLineBreaks; + + // Assert + innerScope.UsingLineBreaks.Should().Be(scope.UsingLineBreaks); + } } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index bfc39648a2..5119b88d5e 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -39,6 +39,7 @@ sidebar: * `AllSatisfy` now suceeds when asserting that an empty collection satisfies some predicates - [#2321](https://github.com/fluentassertions/fluentassertions/pull/2321) ### Breaking Changes (for extensions) +* Add `ForConstraint` to `IAssertionsScope` to support chaining `.ForConstraint()` after `.Then` - [#2324](https://github.com/fluentassertions/fluentassertions/pull/2324) ## 6.12.0 From 28147d30287efe06c58c94584f3c577526ff9c5c Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Tue, 26 Sep 2023 15:16:04 +0200 Subject: [PATCH 068/845] Add missing `null` test for the reason --- .../Execution/AssertionScope.ChainingApiSpecs.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScope.ChainingApiSpecs.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScope.ChainingApiSpecs.cs index 638cfb34fe..3213116475 100644 --- a/Tests/FluentAssertions.Specs/Execution/AssertionScope.ChainingApiSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/AssertionScope.ChainingApiSpecs.cs @@ -113,6 +113,20 @@ public void When_continuing_an_assertion_chain_the_reason_with_arguments_should_ .WithMessage("Expected because reasons"); } + [Fact] + public void Passing_a_null_value_as_reason_does_not_fail() + { + // Act + Action act = () => Execute.Assertion + .BecauseOf(null, "only because for method disambiguity") + .ForCondition(false) + .FailWith("First assertion"); + + // Assert + act.Should().Throw() + .WithMessage("First assertion"); + } + [Fact] public void When_a_given_is_used_before_an_assertion_then_the_result_should_be_available_for_evaluation() { From 5ce94b2392d7f823478048031b3d81e69e7ca911 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Fri, 29 Sep 2023 14:17:57 +0200 Subject: [PATCH 069/845] Change `OnlyContain` to succeed on empty collections --- .../Collections/GenericCollectionAssertions.cs | 6 +----- .../Collections/CollectionAssertionSpecs.OnlyContain.cs | 8 ++------ docs/_pages/releases.md | 1 + 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index e2313fbc4b..8027e10e34 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -2822,11 +2822,7 @@ public AndConstraint OnlyContain( .ForCondition(subject => subject is not null) .FailWith("but the collection is .") .Then - .Given(subject => subject.ConvertOrCastToCollection()) - .ForCondition(collection => collection.Count > 0) - .FailWith("but the collection is empty.") - .Then - .Given(collection => collection.Where(item => !compiledPredicate(item))) + .Given(subject => subject.ConvertOrCastToCollection().Where(item => !compiledPredicate(item))) .ForCondition(mismatchingItems => !mismatchingItems.Any()) .FailWith("but {0} do(es) not match.", mismatchingItems => mismatchingItems) .Then diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyContain.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyContain.cs index c45061fe20..47704b1c61 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyContain.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyContain.cs @@ -62,12 +62,8 @@ public void When_a_collection_is_empty_and_should_contain_only_items_matching_a_ // Arrange IEnumerable strings = Enumerable.Empty(); - // Act - Action act = () => strings.Should().OnlyContain(e => e.Length > 0); - - // Assert - act.Should().Throw() - .WithMessage("Expected strings to contain only items matching (e.Length > 0), but the collection is empty."); + // Act / Assert + strings.Should().OnlyContain(e => e.Length > 0); } [Fact] diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 5119b88d5e..1246a23cdd 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -37,6 +37,7 @@ sidebar: * Removed the `DefaultValueFormatter.SpacesPerIndentionLevel` property which was added during the development of v6, but wasn't removed before the release of v6 - [#2281](https://github.com/fluentassertions/fluentassertions/pull/2281) * Dropped direct support for .NET Core 2.x and .NET Core 3.x - [#2302](https://github.com/fluentassertions/fluentassertions/pull/2302) * `AllSatisfy` now suceeds when asserting that an empty collection satisfies some predicates - [#2321](https://github.com/fluentassertions/fluentassertions/pull/2321) +* `OnlyContain` now succeeds when asserting that an empty collection matches some predicates - [#2350](https://github.com/fluentassertions/fluentassertions/pull/2350) ### Breaking Changes (for extensions) * Add `ForConstraint` to `IAssertionsScope` to support chaining `.ForConstraint()` after `.Then` - [#2324](https://github.com/fluentassertions/fluentassertions/pull/2324) From 7917f9750f7fc43df6f93b411ff198c221a5c18d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Sep 2023 20:13:16 +0000 Subject: [PATCH 070/845] Bump Microsoft.NET.Test.Sdk from 17.6.3 to 17.7.2 Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.6.3 to 17.7.2. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.6.3...v17.7.2) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 2 +- Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj | 4 ++-- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index d5bfd506fa..aaf505ab37 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -5,7 +5,7 @@ - + all diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 0b347f82b6..be6a64183d 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -10,7 +10,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index d0269c4b4a..f9712e19d3 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -25,7 +25,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index d87ba2457a..897971825b 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -25,7 +25,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 5a32471422..1c1aa37c46 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj index 0a4fc5f37b..caa549fd78 100644 --- a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj +++ b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index 635792a863..21b24e8382 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -1,4 +1,4 @@ - + net6.0 NUnit3.Specs @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index f19283ecfe..3ca0c1acea 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 8e2a663c3f..7fbe3b0ffe 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -6,7 +6,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive From 8d9f241a8d627f19624d1806ce7341896edf3ad5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 30 Sep 2023 21:52:07 +0200 Subject: [PATCH 071/845] Bump the mstest group with 2 updates (#2347) * Bump the mstest group with 2 updates Bumps the mstest group with 2 updates: [MSTest.TestAdapter](https://github.com/microsoft/testfx) and [MSTest.TestFramework](https://github.com/microsoft/testfx). Updates `MSTest.TestAdapter` from 2.2.10 to 3.0.4 - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](https://github.com/microsoft/testfx/compare/v2.2.10...v3.0.4) Updates `MSTest.TestFramework` from 2.2.10 to 3.0.4 - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](https://github.com/microsoft/testfx/compare/v2.2.10...v3.0.4) --- updated-dependencies: - dependency-name: MSTest.TestAdapter dependency-type: direct:production update-type: version-update:semver-major dependency-group: mstest - dependency-name: MSTest.TestFramework dependency-type: direct:production update-type: version-update:semver-major dependency-group: mstest ... Signed-off-by: dependabot[bot] * Update Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jonas Nyrup --- Tests/UWP.Specs/UWP.Specs.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/UWP.Specs/UWP.Specs.csproj b/Tests/UWP.Specs/UWP.Specs.csproj index 9f73358eae..9c40f4b002 100644 --- a/Tests/UWP.Specs/UWP.Specs.csproj +++ b/Tests/UWP.Specs/UWP.Specs.csproj @@ -1,4 +1,4 @@ - + Debug @@ -86,10 +86,10 @@ 6.2.14 - 2.2.10 + 3.0.4 - 2.2.10 + 3.0.4 4.3.0 From 7f87c7b9c291a4aa8e5900b61c1075e95db41b03 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 19:21:17 +0000 Subject: [PATCH 072/845] Bump BenchmarkDotNet from 0.13.6 to 0.13.8 Bumps [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet) from 0.13.6 to 0.13.8. - [Release notes](https://github.com/dotnet/BenchmarkDotNet/releases) - [Commits](https://github.com/dotnet/BenchmarkDotNet/compare/v0.13.6...v0.13.8) --- updated-dependencies: - dependency-name: BenchmarkDotNet dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Tests/Benchmarks/Benchmarks.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index 47b06ab4a0..602643e8de 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -1,4 +1,4 @@ - + net6;net472 True @@ -9,7 +9,7 @@ - + From 48e5af9f3d3655ff6fb343c12256e0bc64da9d07 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Fri, 29 Sep 2023 07:51:59 +0200 Subject: [PATCH 073/845] Checkout the merge commit for qodana to generate correct results --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index ae75d940a6..5071c42883 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit + ref: ${{ github.event.pull_request.merge_commit_sha }} fetch-depth: 0 - name: 'Qodana Scan' uses: JetBrains/qodana-action@v2023.2 From a8a04fe96658a53c6747bfc1ea485820b1edbcb7 Mon Sep 17 00:00:00 2001 From: Matt Pityo Date: Sun, 1 Oct 2023 21:03:30 -0400 Subject: [PATCH 074/845] change of "which" to "whose" --- Src/FluentAssertions/Primitives/BooleanAssertions.cs | 2 +- Src/FluentAssertions/Primitives/DateOnlyAssertions.cs | 2 +- Src/FluentAssertions/Primitives/DateTimeAssertions.cs | 2 +- Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs | 2 +- Src/FluentAssertions/Primitives/GuidAssertions.cs | 2 +- Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs | 2 +- Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs | 2 +- Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs | 2 +- Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs | 2 +- Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs | 2 +- Src/FluentAssertions/Types/TypeSelectorAssertions.cs | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Src/FluentAssertions/Primitives/BooleanAssertions.cs b/Src/FluentAssertions/Primitives/BooleanAssertions.cs index 69ba629c9a..489aac2e37 100644 --- a/Src/FluentAssertions/Primitives/BooleanAssertions.cs +++ b/Src/FluentAssertions/Primitives/BooleanAssertions.cs @@ -32,7 +32,7 @@ public BooleanAssertions(bool? value) } /// - /// Gets the object which value is being asserted. + /// Gets the object whose value is being asserted. /// public bool? Subject { get; } diff --git a/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs b/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs index f610c6ee6e..9d01383966 100644 --- a/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs @@ -34,7 +34,7 @@ public DateOnlyAssertions(DateOnly? value) } /// - /// Gets the object which value is being asserted. + /// Gets the object whose value is being asserted. /// public DateOnly? Subject { get; } diff --git a/Src/FluentAssertions/Primitives/DateTimeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeAssertions.cs index f511267c2b..0606a6a0ae 100644 --- a/Src/FluentAssertions/Primitives/DateTimeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeAssertions.cs @@ -42,7 +42,7 @@ public DateTimeAssertions(DateTime? value) } /// - /// Gets the object which value is being asserted. + /// Gets the object whose value is being asserted. /// public DateTime? Subject { get; } diff --git a/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs index 490bf3c113..dafcdbbdba 100644 --- a/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs @@ -43,7 +43,7 @@ public DateTimeOffsetAssertions(DateTimeOffset? value) } /// - /// Gets the object which value is being asserted. + /// Gets the object whose value is being asserted. /// public DateTimeOffset? Subject { get; } diff --git a/Src/FluentAssertions/Primitives/GuidAssertions.cs b/Src/FluentAssertions/Primitives/GuidAssertions.cs index e52b51df41..eb9cb115a0 100644 --- a/Src/FluentAssertions/Primitives/GuidAssertions.cs +++ b/Src/FluentAssertions/Primitives/GuidAssertions.cs @@ -31,7 +31,7 @@ public GuidAssertions(Guid? value) } /// - /// Gets the object which value is being asserted. + /// Gets the object whose value is being asserted. /// public Guid? Subject { get; } diff --git a/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs b/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs index 4d16b601ed..5cd0addfc5 100644 --- a/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs +++ b/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs @@ -21,7 +21,7 @@ protected ReferenceTypeAssertions(TSubject subject) } /// - /// Gets the object which value is being asserted. + /// Gets the object whose value is being asserted. /// public TSubject Subject { get; } diff --git a/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs b/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs index c33d8ea3d2..63b922b113 100644 --- a/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs +++ b/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs @@ -32,7 +32,7 @@ public SimpleTimeSpanAssertions(TimeSpan? value) } /// - /// Gets the object which value is being asserted. + /// Gets the object whose value is being asserted. /// public TimeSpan? Subject { get; } diff --git a/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs b/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs index b604aa0d28..70c48e5383 100644 --- a/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs @@ -35,7 +35,7 @@ public TimeOnlyAssertions(TimeOnly? value) } /// - /// Gets the object which value is being asserted. + /// Gets the object whose value is being asserted. /// public TimeOnly? Subject { get; } diff --git a/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs b/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs index a6b5993dc9..f7f0b2f37b 100644 --- a/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs +++ b/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs @@ -30,7 +30,7 @@ public MethodInfoSelectorAssertions(params MethodInfo[] methods) } /// - /// Gets the object which value is being asserted. + /// Gets the object whose value is being asserted. /// public IEnumerable SubjectMethods { get; } diff --git a/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs b/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs index 9f776c8e96..644652b364 100644 --- a/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs +++ b/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs @@ -17,7 +17,7 @@ namespace FluentAssertions.Types; public class PropertyInfoSelectorAssertions { /// - /// Gets the object which value is being asserted. + /// Gets the object whose value is being asserted. /// public IEnumerable SubjectProperties { get; } diff --git a/Src/FluentAssertions/Types/TypeSelectorAssertions.cs b/Src/FluentAssertions/Types/TypeSelectorAssertions.cs index f1436e49a8..90ab465827 100644 --- a/Src/FluentAssertions/Types/TypeSelectorAssertions.cs +++ b/Src/FluentAssertions/Types/TypeSelectorAssertions.cs @@ -30,7 +30,7 @@ public TypeSelectorAssertions(params Type[] types) } /// - /// Gets the object which value is being asserted. + /// Gets the object whose value is being asserted. /// public IEnumerable Subject { get; } From 4514a98d86d1bafde928b7d4da2a0495942d61c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 19:18:40 +0000 Subject: [PATCH 075/845] Bump Meziantou.Analyzer from 2.0.85 to 2.0.92 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.85 to 2.0.92. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.85...2.0.92) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 7c5f10034b..339fe62beb 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From c5b518a3e2d65b4bb24e5f1521cb4e2525d8f4a1 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Wed, 4 Oct 2023 07:37:47 +0200 Subject: [PATCH 076/845] Drop support for `NSpec3` (#2356) * Drop support for `NSpec3` * Add release notes * Fix documentation --- Build/Build.cs | 66 ++++++++----------- Build/_build.csproj | 1 - FluentAssertions.sln | 9 --- .../Execution/NSpecFramework.cs | 37 ----------- .../Execution/TestFrameworkProvider.cs | 1 - Src/FluentAssertions/FluentAssertions.csproj | 4 +- .../Execution/TestFrameworkProviderTests.cs | 19 ------ .../NSpec3.Net47.Specs/FrameworkSpecs.cs | 19 ------ .../NSpec3.Net47.Specs.csproj | 13 ---- docs/_pages/about.md | 1 - docs/_pages/introduction.md | 2 +- docs/_pages/releases.md | 7 +- docs/index.html | 2 +- 13 files changed, 37 insertions(+), 144 deletions(-) delete mode 100644 Src/FluentAssertions/Execution/NSpecFramework.cs delete mode 100644 Tests/TestFrameworks/NSpec3.Net47.Specs/FrameworkSpecs.cs delete mode 100644 Tests/TestFrameworks/NSpec3.Net47.Specs/NSpec3.Net47.Specs.csproj diff --git a/Build/Build.cs b/Build/Build.cs index 060496f89e..0b4aa96fa8 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; using LibGit2Sharp; using Nuke.Common; @@ -15,8 +14,6 @@ using Nuke.Common.Tools.Xunit; using Nuke.Common.Utilities.Collections; using Nuke.Components; -using static Nuke.Common.IO.FileSystemTasks; -using static Nuke.Common.IO.PathConstruction; using static Nuke.Common.Tools.DotNet.DotNetTasks; using static Nuke.Common.Tools.ReportGenerator.ReportGeneratorTasks; using static Nuke.Common.Tools.Xunit.XunitTasks; @@ -62,9 +59,6 @@ class Build : NukeBuild [GitRepository] readonly GitRepository GitRepository; - [NuGetPackage("nspec", "NSpecRunner.exe", Version = "3.1.0")] - Tool NSpec3; - #if OS_WINDOWS [NuGetPackage("Node.js.redist", "node.exe", Version = "16.20.0", Framework = "win-x64")] #elif OS_MAC @@ -95,6 +89,7 @@ class Build : NukeBuild .Executes(() => { SemVer = GitVersion.SemVer; + if (IsPullRequest) { Information( @@ -176,9 +171,9 @@ class Build : NukeBuild .Executes(() => { string[] testAssemblies = Projects - .SelectMany(project => project.Directory.GlobFiles("bin/Debug/net47/*.Specs.dll")) - .Select(_ => _.ToString()) - .ToArray(); + .SelectMany(project => project.Directory.GlobFiles("bin/Debug/net47/*.Specs.dll")) + .Select(_ => _.ToString()) + .ToArray(); Assert.NotEmpty(testAssemblies.ToList()); @@ -197,25 +192,25 @@ class Build : NukeBuild const string net47 = "net47"; DotNetTest(s => s - .SetConfiguration(Configuration.Debug) - .SetProcessEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE", "en-US") - .EnableNoBuild() - .SetDataCollector("XPlat Code Coverage") - .SetResultsDirectory(TestResultsDirectory) - .AddRunSetting( - "DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.DoesNotReturnAttribute", - "DoesNotReturnAttribute") - .CombineWith( - Projects, - (_, project) => _ - .SetProjectFile(project) - .CombineWith( - project.GetTargetFrameworks().Except(new[] { net47 }), - (_, framework) => _ - .SetFramework(framework) - .AddLoggers($"trx;LogFileName={project.Name}_{framework}.trx") - ) - ), completeOnFailure: true + .SetConfiguration(Configuration.Debug) + .SetProcessEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE", "en-US") + .EnableNoBuild() + .SetDataCollector("XPlat Code Coverage") + .SetResultsDirectory(TestResultsDirectory) + .AddRunSetting( + "DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.DoesNotReturnAttribute", + "DoesNotReturnAttribute") + .CombineWith( + Projects, + (_, project) => _ + .SetProjectFile(project) + .CombineWith( + project.GetTargetFrameworks().Except(new[] { net47 }), + (_, framework) => _ + .SetFramework(framework) + .AddLoggers($"trx;LogFileName={project.Name}_{framework}.trx") + ) + ), completeOnFailure: true ); ReportTestOutcome(globFilters: $"*[!*{net47}].trx"); @@ -227,9 +222,9 @@ class Build : NukeBuild static string[] Outcomes(AbsolutePath path) => XmlTasks.XmlPeek( - path, - "/xn:TestRun/xn:Results/xn:UnitTestResult/@outcome", - ("xn", "http://microsoft.com/schemas/VisualStudio/TeamTest/2010")).ToArray(); + path, + "/xn:TestRun/xn:Results/xn:UnitTestResult/@outcome", + ("xn", "http://microsoft.com/schemas/VisualStudio/TeamTest/2010")).ToArray(); void ReportTestOutcome(params string[] globFilters) { @@ -254,7 +249,8 @@ void ReportTestOutcome(params string[] globFilters) .Executes(() => { ReportGenerator(s => s - .SetProcessToolPath(NuGetToolPathResolver.GetPackageExecutable("ReportGenerator", "ReportGenerator.dll", framework: "net6.0")) + .SetProcessToolPath(NuGetToolPathResolver.GetPackageExecutable("ReportGenerator", "ReportGenerator.dll", + framework: "net6.0")) .SetTargetDirectory(TestResultsDirectory / "reports") .AddReports(TestResultsDirectory / "**/coverage.cobertura.xml") .AddReportTypes( @@ -303,11 +299,6 @@ from framework in supportedFrameworks .SetFramework(v.framework) .AddLoggers($"trx;LogFileName={v.project.Name}_{v.framework}.trx")), completeOnFailure: true); - if (EnvironmentInfo.IsWin) - { - NSpec3($"{Solution.TestFrameworks.NSpec3_Net47_Specs.Directory / "bin" / "Debug" / "net47" / "NSpec3.Specs.dll"}"); - } - ReportTestOutcome(projects.Select(p => $"*{p.Name}*.trx").ToArray()); }); @@ -359,6 +350,7 @@ from framework in supportedFrameworks .Executes(() => { Node($"{YarnCli} --silent install", workingDirectory: RootDirectory); + Node($"{YarnCli} --silent run cspell", workingDirectory: RootDirectory, logger: (_, msg) => Error(msg)); }); diff --git a/Build/_build.csproj b/Build/_build.csproj index 92b9a65942..476f398ae6 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -18,7 +18,6 @@ - diff --git a/FluentAssertions.sln b/FluentAssertions.sln index a5fc376d23..31ee369de2 100644 --- a/FluentAssertions.sln +++ b/FluentAssertions.sln @@ -35,8 +35,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentAssertions", "Src\Flu EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NUnit3.Specs", "Tests\TestFrameworks\NUnit3.Specs\NUnit3.Specs.csproj", "{C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSpec3.Net47.Specs", "Tests\TestFrameworks\NSpec3.Net47.Specs\NSpec3.Net47.Specs.csproj", "{4195D943-DEF5-41AA-87E6-E273C33E1111}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSpec.Specs", "Tests\TestFrameworks\MSpec.Specs\MSpec.Specs.csproj", "{4F210C41-7E8E-424A-B956-FC1AA47663C9}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks", "Tests\Benchmarks\Benchmarks.csproj", "{FCAFB0F1-79EA-4D49-813B-188D4BC4BE71}" @@ -99,12 +97,6 @@ Global {C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2}.Debug|Any CPU.Build.0 = Debug|Any CPU {C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2}.Release|Any CPU.ActiveCfg = Debug|Any CPU {C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2}.Release|Any CPU.Build.0 = Debug|Any CPU - {4195D943-DEF5-41AA-87E6-E273C33E1111}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {4195D943-DEF5-41AA-87E6-E273C33E1111}.CI|Any CPU.Build.0 = Debug|Any CPU - {4195D943-DEF5-41AA-87E6-E273C33E1111}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4195D943-DEF5-41AA-87E6-E273C33E1111}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4195D943-DEF5-41AA-87E6-E273C33E1111}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {4195D943-DEF5-41AA-87E6-E273C33E1111}.Release|Any CPU.Build.0 = Debug|Any CPU {4F210C41-7E8E-424A-B956-FC1AA47663C9}.CI|Any CPU.ActiveCfg = Debug|Any CPU {4F210C41-7E8E-424A-B956-FC1AA47663C9}.CI|Any CPU.Build.0 = Debug|Any CPU {4F210C41-7E8E-424A-B956-FC1AA47663C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -160,7 +152,6 @@ Global {A4E37052-5581-4E70-A9C3-FF8364B2F332} = {4D8FA213-8724-4C43-B68A-F018148D238C} {34E3713D-C02F-4868-BBE7-47DAD2C7F03D} = {31891850-3EDC-480A-9B6C-F60540E9C90F} {C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2} = {4D8FA213-8724-4C43-B68A-F018148D238C} - {4195D943-DEF5-41AA-87E6-E273C33E1111} = {4D8FA213-8724-4C43-B68A-F018148D238C} {4F210C41-7E8E-424A-B956-FC1AA47663C9} = {4D8FA213-8724-4C43-B68A-F018148D238C} {FCAFB0F1-79EA-4D49-813B-188D4BC4BE71} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} {F5115158-A038-4D14-A04E-46E7863E40B9} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} diff --git a/Src/FluentAssertions/Execution/NSpecFramework.cs b/Src/FluentAssertions/Execution/NSpecFramework.cs deleted file mode 100644 index 90cec47ab0..0000000000 --- a/Src/FluentAssertions/Execution/NSpecFramework.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using System.Reflection; - -namespace FluentAssertions.Execution; - -internal class NSpecFramework : ITestFramework -{ - private Assembly assembly; - - public bool IsAvailable - { - get - { - assembly = Array.Find(AppDomain.CurrentDomain - .GetAssemblies(), a => a.FullName.StartsWith("nspec,", StringComparison.OrdinalIgnoreCase)); - - if (assembly is null) - { - return false; - } - - int majorVersion = assembly.GetName().Version.Major; - - return majorVersion >= 2; - } - } - - [DoesNotReturn] - public void Throw(string message) - { - Type exceptionType = assembly.GetType("NSpec.Domain.AssertionException") - ?? throw new NotSupportedException("Failed to create the NSpec assertion type"); - - throw (Exception)Activator.CreateInstance(exceptionType, message); - } -} diff --git a/Src/FluentAssertions/Execution/TestFrameworkProvider.cs b/Src/FluentAssertions/Execution/TestFrameworkProvider.cs index 486dede58e..f5e291d8f9 100644 --- a/Src/FluentAssertions/Execution/TestFrameworkProvider.cs +++ b/Src/FluentAssertions/Execution/TestFrameworkProvider.cs @@ -16,7 +16,6 @@ internal class TestFrameworkProvider private static readonly Dictionary Frameworks = new(StringComparer.OrdinalIgnoreCase) { ["mspec"] = new MSpecFramework(), - ["nspec3"] = new NSpecFramework(), ["nunit"] = new NUnitTestFramework(), ["mstestv2"] = new MSTestFrameworkV2(), ["xunit2"] = new XUnit2TestFramework() // Keep this the last one as it uses a try/catch approach diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index c42c2a0a28..c72f01136a 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -19,14 +19,14 @@ A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Targets .NET Framework 4.7, .NET 6, as well as .NET Standard 2.0 and 2.1. - Supports the unit test frameworks MSTest2, NUnit3, XUnit2, MSpec, and NSpec3. + Supports the unit test frameworks MSTest2, NUnit3, XUnit2 and MSpec. Supported by InfoSupport B.V. https://www.fluentassertions.com https://github.com/fluentassertions/fluentassertions git - MSTest2;xUnit;NUnit;MSpec;NSpec;TDD;BDD;Fluent;netstandard;uwp + MSTest2;xUnit;NUnit;MSpec;TDD;BDD;Fluent;netstandard;uwp Apache-2.0 FluentAssertions.png See https://fluentassertions.com/releases/ diff --git a/Tests/FluentAssertions.Specs/Execution/TestFrameworkProviderTests.cs b/Tests/FluentAssertions.Specs/Execution/TestFrameworkProviderTests.cs index 50f2b43d37..bf934d4c12 100644 --- a/Tests/FluentAssertions.Specs/Execution/TestFrameworkProviderTests.cs +++ b/Tests/FluentAssertions.Specs/Execution/TestFrameworkProviderTests.cs @@ -59,25 +59,6 @@ public void When_running_test_with_unknown_test_framework_it_should_throw() .WithMessage("*the test framework 'foo' but this is not supported*"); } - [Fact] - public void When_running_test_with_direct_bound_but_unavailable_test_framework_it_should_throw() - { - // Arrange - var configuration = new Configuration(new TestConfigurationStore()) - { - TestFrameworkName = "nspec3" - }; - - var testFrameworkProvider = new TestFrameworkProvider(configuration); - - // Act - Action act = () => testFrameworkProvider.Throw("MyMessage"); - - // Assert - act.Should().Throw() - .WithMessage("*test framework 'nspec3' but it could not be found*"); - } - [Fact] public void When_running_test_with_late_bound_but_unavailable_test_framework_it_should_throw() { diff --git a/Tests/TestFrameworks/NSpec3.Net47.Specs/FrameworkSpecs.cs b/Tests/TestFrameworks/NSpec3.Net47.Specs/FrameworkSpecs.cs deleted file mode 100644 index 514b96e343..0000000000 --- a/Tests/TestFrameworks/NSpec3.Net47.Specs/FrameworkSpecs.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using FluentAssertions; -using NSpec; - -namespace NSpec3.Specs; - -public class FrameworkSpecs : nspec -{ - // NSpec requires tests to start with "it" or "specify", see https://github.com/nspec/NSpec/blob/master/sln/src/NSpec/DefaultConventions.cs - public void It_should_throw_nspec3_exceptions_for_assertion_failures_when_nspec3_is_used() - { - // Act - Action act = () => 0.Should().Be(1); - - // Assert - Exception exception = act.Should().Throw().Which; - exception.GetType().FullName.Should().ContainEquivalentOf("NSpec.Domain.AssertionException"); - } -} diff --git a/Tests/TestFrameworks/NSpec3.Net47.Specs/NSpec3.Net47.Specs.csproj b/Tests/TestFrameworks/NSpec3.Net47.Specs/NSpec3.Net47.Specs.csproj deleted file mode 100644 index 6ec84c6e14..0000000000 --- a/Tests/TestFrameworks/NSpec3.Net47.Specs/NSpec3.Net47.Specs.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - net47 - NSpec3.Specs - NSpec3.Specs - - - - - - - - \ No newline at end of file diff --git a/docs/_pages/about.md b/docs/_pages/about.md index 4fb019a2a7..e0f4565207 100644 --- a/docs/_pages/about.md +++ b/docs/_pages/about.md @@ -53,7 +53,6 @@ Fluent Assertions supports the following unit test frameworks: * [MSTest V2](https://github.com/Microsoft/testfx) (Visual Studio 2017, Visual Studio 2019) * [NUnit](http://www.nunit.org/) * [XUnit2](https://github.com/xunit/xunit/releases) -* [NSpec](http://nspec.org/) * [MSpec](https://github.com/machine/machine.specifications) ## Coding by Example diff --git a/docs/_pages/introduction.md b/docs/_pages/introduction.md index 309c60dffa..d2333c7156 100644 --- a/docs/_pages/introduction.md +++ b/docs/_pages/introduction.md @@ -72,7 +72,7 @@ If, for some unknown reason, Fluent Assertions fails to find the assembly, and y ```xml - + diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 1246a23cdd..873762c155 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -14,7 +14,7 @@ sidebar: ### Improvements ### Fixes -* Fixed formatting error when checking nullable `DateTimeOffset` with +* Fixed formatting error when checking nullable `DateTimeOffset` with `BeWithin(...).Before(...)` - [#2312](https://github.com/fluentassertions/fluentassertions/pull/2312) * `BeEquivalentTo` will now find and can map subject properties that are implemented through an explicitly-implemented interface - [#2152](https://github.com/fluentassertions/fluentassertions/pull/2152) * Fixed that the `because` and `becauseArgs` were not passed down the equivalency tree - [#2318](https://github.com/fluentassertions/fluentassertions/pull/2318) @@ -23,8 +23,8 @@ sidebar: * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) * Removed obsolete `...OrEqualTo` methods - [#2269](https://github.com/fluentassertions/fluentassertions/pull/2269) * `GenericCollectionAssertions` - * `HaveCountGreaterOrEqualTo`: Use `HaveCountGreaterThanOrEqualTo` - * `HaveCountLessOrEqualTo`: Use `HaveCountLessThanOrEqualTo` + * `HaveCountGreaterOrEqualTo`: Use `HaveCountGreaterThanOrEqualTo` + * `HaveCountLessOrEqualTo`: Use `HaveCountLessThanOrEqualTo` * `ComparableTypeAssertions` * `BeGreaterOrEqualTo`: Use `BeGreaterThanOrEqualTo` * `BeLessOrEqualTo`: Use `BeLessThanOrEqualTo` @@ -38,6 +38,7 @@ sidebar: * Dropped direct support for .NET Core 2.x and .NET Core 3.x - [#2302](https://github.com/fluentassertions/fluentassertions/pull/2302) * `AllSatisfy` now suceeds when asserting that an empty collection satisfies some predicates - [#2321](https://github.com/fluentassertions/fluentassertions/pull/2321) * `OnlyContain` now succeeds when asserting that an empty collection matches some predicates - [#2350](https://github.com/fluentassertions/fluentassertions/pull/2350) +* Dropped support for `NSpec3` test framework - [#2356](https://github.com/fluentassertions/fluentassertions/pull/2356) ### Breaking Changes (for extensions) * Add `ForConstraint` to `IAssertionsScope` to support chaining `.ForConstraint()` after `.Then` - [#2324](https://github.com/fluentassertions/fluentassertions/pull/2324) diff --git a/docs/index.html b/docs/index.html index dd790a02ae..6a02040ba1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -54,7 +54,7 @@ image_path: /assets/images/checklist.svg excerpt: ' Targets .NET 4.7, .NET 6, .NET Standard 2.0 and 2.1. -Supports MSTest2, xUnit2, NUnit3, MSpec and NSpec3. +Supports MSTest2, xUnit2, NUnit3 and MSpec. ' - title: "Great Support" image_path: /assets/images/customer-service.svg From 3c97a30f5ecd1a0dbedc472578afd869c34e654e Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Wed, 4 Oct 2023 16:04:37 +0200 Subject: [PATCH 077/845] Decrease the Qodana `failThreshold` (#2360) See latest Qodana scan: https://qodana.cloud/projects/AgRgk/reports/QLJY9 --- qodana.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qodana.yaml b/qodana.yaml index e71233f6ec..a0bd0ce51d 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,7 +1,7 @@ version: "1.0" linter: jetbrains/qodana-dotnet:latest -failThreshold: 93 +failThreshold: 57 dotnet: solution: FluentAssertions.sln From 6859575f30829b69877a953c77250389d85368ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Wed, 4 Oct 2023 22:00:49 +0200 Subject: [PATCH 078/845] Improve failure message for string assertions when checking for equality (#2307) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Draft improved failure message when checking for equality. * Use line and column for multiline strings * Fix failing tests * Fix Qodana issues * Fix further failing tests * Also fix tests on MacOS (due to different newline) * Calculate expected index * Fix paranthesis * Move specific methods from common StringExtensions to the `StringEqualityStrategy` class * Fix review comments from @dennisdoomen and add tests for word boundary algorithm * Improve tests by using [raw string literals](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/#raw-string-literals) * Update releases.md * Implement review comments from @jnyrup * Adapt due to survived mutants * Adapt test names --------- Co-authored-by: Valentin Breuß --- .../Common/StringExtensions.cs | 9 + .../Primitives/StringEqualityStrategy.cs | 181 ++++++++++++++++-- .../Primitives/StringValidator.cs | 11 +- .../BasicSpecs.cs | 4 +- .../CyclicReferencesSpecs.cs | 2 +- .../NestedPropertiesSpecs.cs | 2 +- .../SelectionRulesSpecs.cs | 4 +- .../FluentAssertions.Specs.csproj | 2 +- .../Formatting/FormatterSpecs.cs | 2 +- .../Primitives/ObjectAssertionSpecs.cs | 6 +- .../Primitives/StringAssertionSpecs.Be.cs | 172 ++++++++++++++++- .../Types/PropertyInfoAssertionSpecs.cs | 2 +- docs/_pages/releases.md | 1 + 13 files changed, 356 insertions(+), 42 deletions(-) diff --git a/Src/FluentAssertions/Common/StringExtensions.cs b/Src/FluentAssertions/Common/StringExtensions.cs index 7f38809cee..e73226c6ee 100644 --- a/Src/FluentAssertions/Common/StringExtensions.cs +++ b/Src/FluentAssertions/Common/StringExtensions.cs @@ -150,4 +150,13 @@ public static int CountSubstring(this string str, string substring, StringCompar return count; } + + /// + /// Determines if the is longer than 8 characters or contains an . + /// + public static bool IsLongOrMultiline(this string value) + { + const int humanReadableLength = 8; + return value.Length > humanReadableLength || value.Contains(Environment.NewLine, StringComparison.Ordinal); + } } diff --git a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs index 26f40f4eae..211c8595cb 100644 --- a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs @@ -1,4 +1,6 @@ using System; +using System.Linq; +using System.Text; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -13,9 +15,65 @@ public StringEqualityStrategy(StringComparison comparisonMode) this.comparisonMode = comparisonMode; } - private bool ValidateAgainstSuperfluousWhitespace(IAssertionScope assertion, string subject, string expected) + public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected) { - return assertion + ValidateAgainstSuperfluousWhitespace(assertion, subject, expected); + + if (expected.IsLongOrMultiline() || subject.IsLongOrMultiline()) + { + int indexOfMismatch = subject.IndexOfFirstMismatch(expected, comparisonMode); + + if (indexOfMismatch == -1) + { + ValidateAgainstLengthDifferences(assertion, subject, expected); + return; + } + + string locationDescription = $"at index {indexOfMismatch}"; + var matchingString = subject[..indexOfMismatch]; + int lineNumber = matchingString.Count(c => c == '\n'); + + if (lineNumber > 0) + { + var indexOfLastNewlineBeforeMismatch = matchingString.LastIndexOf('\n'); + var column = matchingString.Length - indexOfLastNewlineBeforeMismatch; + locationDescription = $"on line {lineNumber + 1} and column {column} (index {indexOfMismatch})"; + } + + assertion.FailWith( + ExpectationDescription + "the same string{reason}, but they differ " + locationDescription + ":" + + Environment.NewLine + + GetMismatchSegmentForLongStrings(subject, expected, indexOfMismatch) + "."); + } + else if (ValidateAgainstLengthDifferences(assertion, subject, expected)) + { + int indexOfMismatch = subject.IndexOfFirstMismatch(expected, comparisonMode); + + if (indexOfMismatch != -1) + { + assertion.FailWith( + ExpectationDescription + "{0}{reason}, but {1} differs near " + subject.IndexedSegmentAt(indexOfMismatch) + + ".", + expected, subject); + } + } + } + + public string ExpectationDescription + { + get + { + string predicateDescription = IgnoreCase ? "be equivalent to" : "be"; + return "Expected {context:string} to " + predicateDescription + " "; + } + } + + private bool IgnoreCase + => comparisonMode == StringComparison.OrdinalIgnoreCase; + + private void ValidateAgainstSuperfluousWhitespace(IAssertionScope assertion, string subject, string expected) + { + assertion .ForCondition(!(expected.Length > subject.Length && expected.TrimEnd().Equals(subject, comparisonMode))) .FailWith(ExpectationDescription + "{0}{reason}, but it misses some extra whitespace at the end.", expected) .Then @@ -55,33 +113,122 @@ private string GetMismatchSegmentForStringsOfDifferentLengths(string subject, st return subject.IndexedSegmentAt(indexOfMismatch); } - public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected) + /// + /// Get the mismatch segment between and for long strings, + /// when they differ at index . + /// + private static string GetMismatchSegmentForLongStrings(string subject, string expected, int firstIndexOfMismatch) + { + int trimStart = GetStartIndexOfPhraseToShowBeforeTheMismatchingIndex(subject, firstIndexOfMismatch); + const string prefix = " \""; + const string suffix = "\""; + const char arrowDown = '\u2193'; + const char arrowUp = '\u2191'; + + int whiteSpaceCountBeforeArrow = (firstIndexOfMismatch - trimStart) + prefix.Length; + + if (trimStart > 0) + { + whiteSpaceCountBeforeArrow++; + } + + var visibleText = subject[trimStart..firstIndexOfMismatch]; + whiteSpaceCountBeforeArrow += visibleText.Count(c => c is '\r' or '\n'); + + var sb = new StringBuilder(); + + sb.Append(' ', whiteSpaceCountBeforeArrow).Append(arrowDown).AppendLine(" (actual)"); + AppendPrefixAndEscapedPhraseToShowWithEllipsisAndSuffix(sb, prefix, subject, trimStart, suffix); + AppendPrefixAndEscapedPhraseToShowWithEllipsisAndSuffix(sb, prefix, expected, trimStart, suffix); + sb.Append(' ', whiteSpaceCountBeforeArrow).Append(arrowUp).Append(" (expected)"); + + return sb.ToString(); + } + + /// + /// Appends the , the escaped visible phrase decorated with ellipsis and the to the . + /// + /// When text phrase starts at and with a calculated length omits text on start or end, an ellipsis is added. + private static void AppendPrefixAndEscapedPhraseToShowWithEllipsisAndSuffix(StringBuilder stringBuilder, + string prefix, string text, int indexOfStartingPhrase, string suffix) { - if (!ValidateAgainstSuperfluousWhitespace(assertion, subject, expected) || - !ValidateAgainstLengthDifferences(assertion, subject, expected)) + var subjectLength = GetLengthOfPhraseToShowOrDefaultLength(text[indexOfStartingPhrase..]); + const char ellipsis = '\u2026'; + + stringBuilder.Append(prefix); + + if (indexOfStartingPhrase > 0) { - return; + stringBuilder.Append(ellipsis); } - int indexOfMismatch = subject.IndexOfFirstMismatch(expected, comparisonMode); + stringBuilder.Append(text + .Substring(indexOfStartingPhrase, subjectLength) + .Replace("\r", "\\r", StringComparison.OrdinalIgnoreCase) + .Replace("\n", "\\n", StringComparison.OrdinalIgnoreCase)); - if (indexOfMismatch != -1) + if (text.Length > (indexOfStartingPhrase + subjectLength)) { - assertion.FailWith( - ExpectationDescription + "{0}{reason}, but {1} differs near " + subject.IndexedSegmentAt(indexOfMismatch) + ".", - expected, subject); + stringBuilder.Append(ellipsis); } + + stringBuilder.AppendLine(suffix); } - public string ExpectationDescription + /// + /// Calculates the start index of the visible segment from when highlighting the difference at . + /// + /// + /// Either keep the last 10 characters before or a word begin (separated by whitespace) between 15 and 5 characters before . + /// + private static int GetStartIndexOfPhraseToShowBeforeTheMismatchingIndex(string value, int indexOfFirstMismatch) { - get + const int defaultCharactersToKeep = 10; + const int minCharactersToKeep = 5; + const int maxCharactersToKeep = 15; + const int lengthOfWhitespace = 1; + const int phraseLengthToCheckForWordBoundary = (maxCharactersToKeep - minCharactersToKeep) + lengthOfWhitespace; + + if (indexOfFirstMismatch <= defaultCharactersToKeep) { - string predicateDescription = IgnoreCase ? "be equivalent to" : "be"; - return "Expected {context:string} to " + predicateDescription + " "; + return 0; } + + var indexToStartSearchingForWordBoundary = Math.Max(indexOfFirstMismatch - (maxCharactersToKeep + lengthOfWhitespace), 0); + + var indexOfWordBoundary = value + .IndexOf(' ', indexToStartSearchingForWordBoundary, phraseLengthToCheckForWordBoundary) - + indexToStartSearchingForWordBoundary; + + if (indexOfWordBoundary >= 0) + { + return indexToStartSearchingForWordBoundary + indexOfWordBoundary + lengthOfWhitespace; + } + + return indexOfFirstMismatch - defaultCharactersToKeep; } - private bool IgnoreCase - => comparisonMode == StringComparison.OrdinalIgnoreCase; + /// + /// Calculates how many characters to keep in . + /// + /// + /// If a word end is found between 15 and 25 characters, use this word end, otherwise keep 20 characters. + /// + private static int GetLengthOfPhraseToShowOrDefaultLength(string value) + { + const int defaultLength = 20; + const int minLength = 15; + const int maxLength = 25; + const int lengthOfWhitespace = 1; + + var indexOfWordBoundary = value + .LastIndexOf(' ', Math.Min(maxLength + lengthOfWhitespace, value.Length) - 1); + + if (indexOfWordBoundary >= minLength) + { + return indexOfWordBoundary; + } + + return Math.Min(defaultLength, value.Length); + } } diff --git a/Src/FluentAssertions/Primitives/StringValidator.cs b/Src/FluentAssertions/Primitives/StringValidator.cs index e13460dd0e..9bdd8f6c4f 100644 --- a/Src/FluentAssertions/Primitives/StringValidator.cs +++ b/Src/FluentAssertions/Primitives/StringValidator.cs @@ -1,12 +1,10 @@ -using System; +using FluentAssertions.Common; using FluentAssertions.Execution; namespace FluentAssertions.Primitives; internal class StringValidator { - private const int HumanReadableLength = 8; - private readonly IStringComparisonStrategy comparisonStrategy; private IAssertionScope assertion; @@ -28,7 +26,7 @@ public void Validate(string subject, string expected) return; } - if (IsLongOrMultiline(expected) || IsLongOrMultiline(subject)) + if (expected.IsLongOrMultiline() || subject.IsLongOrMultiline()) { assertion = assertion.UsingLineBreaks; } @@ -46,9 +44,4 @@ private bool ValidateAgainstNulls(string subject, string expected) assertion.FailWith(comparisonStrategy.ExpectationDescription + "{0}{reason}, but found {1}.", expected, subject); return false; } - - private static bool IsLongOrMultiline(string value) - { - return value.Length > HumanReadableLength || value.Contains(Environment.NewLine, StringComparison.Ordinal); - } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs index c8f3bcd5d9..d6754fb9f1 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs @@ -221,7 +221,7 @@ public void When_treating_a_value_type_in_a_collection_as_a_complex_type_it_shou options => options.ComparingByMembers()); // Assert - act.Should().Throw().WithMessage("*NestedProperty*OtherValue*SomeValue*"); + act.Should().Throw().WithMessage("*NestedProperty*SomeValue*OtherValue*"); } [Fact] @@ -237,7 +237,7 @@ public void When_treating_a_value_type_as_a_complex_type_it_should_compare_them_ options => options.ComparingByMembers()); // Assert - act.Should().Throw().WithMessage("*NestedProperty*OtherValue*SomeValue*"); + act.Should().Throw().WithMessage("*NestedProperty*SomeValue*OtherValue*"); } [Fact] diff --git a/Tests/FluentAssertions.Equivalency.Specs/CyclicReferencesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/CyclicReferencesSpecs.cs index ca99887b63..569682ce9b 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/CyclicReferencesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/CyclicReferencesSpecs.cs @@ -340,7 +340,7 @@ public void Allow_ignoring_cyclic_references_in_value_types_compared_by_members( // Assert act.Should().Throw() - .WithMessage("*subject.Next.Title*Second*SecondDifferent*") + .WithMessage("*subject.Next.Title*SecondDifferent*Second*") .Which.Message.Should().NotContain("maximum recursion depth was reached"); } diff --git a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs index 8377cd0f20..3996fff1fb 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs @@ -270,7 +270,7 @@ public void When_deeply_nested_properties_do_not_have_all_equal_values_it_should act .Should().Throw() .WithMessage( - "Expected*Level.Level.Text*to be *A wrong text value*but*\"Level2\"*length*"); + "Expected*Level.Level.Text*to be *\"Level2\"*A wrong text value*"); } [Fact] diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs index 1d63556ba7..b3301db9a2 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs @@ -1353,7 +1353,7 @@ public void When_a_property_is_internal_and_it_should_be_included_it_should_fail // Assert act.Should().Throw() - .WithMessage("*InternalProperty*also internal*internal*ProtectedInternalProperty*"); + .WithMessage("*InternalProperty*internal*also internal*ProtectedInternalProperty*"); } private class ClassWithInternalProperty @@ -1409,7 +1409,7 @@ public void When_a_field_is_internal_and_it_should_be_included_it_should_fail_th Action act = () => actual.Should().BeEquivalentTo(expected, options => options.IncludingInternalFields()); // Assert - act.Should().Throw().WithMessage("*InternalField*also internal*internal*ProtectedInternalField*"); + act.Should().Throw().WithMessage("*InternalField*internal*also internal*ProtectedInternalField*"); } private class ClassWithInternalField diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 897971825b..1616da6aa9 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -1,4 +1,4 @@ - + net47;net6.0 diff --git a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs index 76871e0b6e..d178b86cdf 100644 --- a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs +++ b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs @@ -74,7 +74,7 @@ public void When_the_subject_or_expectation_contains_reserved_symbols_it_should_ Action act = () => result.Should().Be(expectedJson); // Assert - act.Should().Throw().WithMessage("*near*index 37*"); + act.Should().Throw().WithMessage("*at*index 37*"); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs index fe4874a31f..3543f023a1 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs @@ -695,7 +695,7 @@ public void When_object_is_of_the_expected_type_it_should_cast_the_returned_obje Action act = () => someObject.Should().BeOfType().Which.Message.Should().Be("Other Message"); // Assert - act.Should().Throw().WithMessage("*Expected*Other*Actual*"); + act.Should().Throw().WithMessage("*Expected*Actual*Other*"); } [Fact] @@ -906,7 +906,7 @@ public void When_to_the_expected_type_it_should_cast_the_returned_object_for_cha Action act = () => someObject.Should().BeAssignableTo().Which.Message.Should().Be("Other Message"); // Assert - act.Should().Throw().WithMessage("*Expected*Other*Actual*"); + act.Should().Throw().WithMessage("*Expected*Actual*Other*"); } [Fact] @@ -1117,7 +1117,7 @@ public void .Which.Message.Should().Be("Other Message"); // Assert - act.Should().Throw().WithMessage("*Expected*Other*Actual*"); + act.Should().Throw().WithMessage("*Expected*Actual*Other*"); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.Be.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.Be.cs index 30de5f6751..6b158cc2b3 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.Be.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.Be.cs @@ -173,8 +173,13 @@ public void When_two_strings_differ_and_one_of_them_is_long_it_should_display_bo Action act = () => "1234567890".Should().Be("0987654321"); // Assert - act.Should().Throw().WithMessage( - "Expected string to be*\"0987654321\", but*\"1234567890\" differs near \"123\" (index 0)."); + act.Should().Throw().WithMessage(""" + Expected string to be the same string, but they differ at index 0: + ↓ (actual) + "1234567890" + "0987654321" + ↑ (expected). + """); } [Fact] @@ -184,8 +189,167 @@ public void When_two_strings_differ_and_one_of_them_is_multiline_it_should_displ Action act = () => "A\r\nB".Should().Be("A\r\nC"); // Assert - act.Should().Throw().WithMessage( - "Expected string to be \r\n\"A\\r\\nC\", but \r\n\"A\\r\\nB\" differs near \"B\" (index 3)."); + act.Should().Throw().Which.Message.Should().Be(""" + Expected string to be the same string, but they differ on line 2 and column 1 (index 3): + ↓ (actual) + "A\r\nB" + "A\r\nC" + ↑ (expected). + """); + } + + [Fact] + public void Use_arrows_for_text_longer_than_8_characters() + { + const string subject = "this is a long text that differs in between two words"; + const string expected = "this is a long text which differs in between two words"; + + // Act + Action act = () => subject.Should().Be(expected, "because we use arrows now"); + + // Assert + act.Should().Throw().WithMessage(""" + Expected subject to be the same string because we use arrows now, but they differ at index 20: + ↓ (actual) + "…is a long text that…" + "…is a long text which…" + ↑ (expected). + """); + } + + [Fact] + public void Only_add_ellipsis_for_long_text() + { + const string subject = "this is a long text that differs"; + const string expected = "this was too short"; + + // Act + Action act = () => subject.Should().Be(expected, "because we use arrows now"); + + // Assert + act.Should().Throw().WithMessage(""" + Expected subject to be the same string because we use arrows now, but they differ at index 5: + ↓ (actual) + "this is a long text that…" + "this was too short" + ↑ (expected). + """); + } + + [Theory] + [InlineData("ThisIsUsedTo Check a difference after 5 characters")] + [InlineData("ThisIsUsedTo CheckADifferenc e after 15 characters")] + public void Will_look_for_a_word_boundary_between_5_and_15_characters_before_the_mismatching_index_to_highlight_the_mismatch(string expected) + { + const string subject = "ThisIsUsedTo CheckADifferenceInThe WordBoundaryAlgorithm"; + + // Act + Action act = () => subject.Should().Be(expected); + + // Assert + act.Should().Throw().WithMessage("*\"…CheckADifferenceInThe*"); + } + + [Theory] + [InlineData("ThisIsUsedTo Chec k a difference after 4 characters", "\"…sedTo CheckADifferen")] + [InlineData("ThisIsUsedTo CheckADifference after 16 characters", "\"…Difference")] + public void Will_fallback_to_10_characters_if_no_word_boundary_can_be_found_before_the_mismatching_index( + string expected, string expectedMessagePart) + { + const string subject = "ThisIsUsedTo CheckADifferenceInThe WordBoundaryAlgorithm"; + + // Act + Action act = () => subject.Should().Be(expected); + + // Assert + act.Should().Throw().WithMessage($"*{expectedMessagePart}*"); + } + + [Theory] + [InlineData("ThisLongTextIsUsedToCheckADifferenceAtTheEnd after 10 + 5 characters")] + [InlineData("ThisLongTextIsUsedToCheckADifferen after 10 + 15 characters")] + public void Will_look_for_a_word_boundary_between_15_and_25_characters_after_the_mismatching_index_to_highlight_the_mismatch(string expected) + { + const string subject = "ThisLongTextIsUsedToCheckADifferenceAtTheEndOfThe WordBoundaryAlgorithm"; + + // Act + Action act = () => subject.Should().Be(expected); + + // Assert + act.Should().Throw().WithMessage("*AtTheEndOfThe…\"*"); + } + + [Fact] + public void An_empty_string_is_always_shorter_than_a_long_text() + { + // Act + Action act = () => "".Should().Be("ThisIsALongText"); + + // Assert + act.Should().Throw().WithMessage("*length*15*differs*"); + } + + [Fact] + public void A_mismatch_below_index_11_includes_all_text_preceding_the_index_in_the_failure() + { + // Act + Action act = () => "This is a long text".Should().Be("This is a text that differs at index 10"); + + // Assert + act.Should().Throw().WithMessage("*\"This is a long*"); + } + + [Theory] + [InlineData("ThisLongTextIsUsedToCheckADifferenceAtTheEndO after 10 + 4 characters", "eAtTheEndOfThe WordB…\"")] + [InlineData("ThisLongTextIsUsedToCheckADiffere after 10 + 16 characters", "ckADifferenceAtTheEn…\"")] + public void Will_fallback_to_20_characters_if_no_word_boundary_can_be_found_after_the_mismatching_index( + string expected, string expectedMessagePart) + { + const string subject = "ThisLongTextIsUsedToCheckADifferenceAtTheEndOfThe WordBoundaryAlgorithm"; + + // Act + Action act = () => subject.Should().Be(expected); + + // Assert + act.Should().Throw().WithMessage($"*{expectedMessagePart}*"); + } + + [Fact] + public void Mismatches_in_multiline_text_includes_the_line_number() + { + var expectedIndex = 100 + (4 * Environment.NewLine.Length); + + var subject = """ + @startuml + Alice -> Bob : Authentication Request + Bob --> Alice : Authentication Response + + Alice -> Bob : Another authentication Request + Alice <-- Bob : Another authentication Response + @enduml + """; + + var expected = """ + @startuml + Alice -> Bob : Authentication Request + Bob --> Alice : Authentication Response + + Alice -> Bob : Invalid authentication Request + Alice <-- Bob : Another authentication Response + @enduml + """; + + // Act + Action act = () => subject.Should().Be(expected); + + // Assert + act.Should().Throw().WithMessage($""" + Expected subject to be the same string, but they differ on line 5 and column 16 (index {expectedIndex}): + ↓ (actual) + "…-> Bob : Another…" + "…-> Bob : Invalid…" + ↑ (expected). + """); } } diff --git a/Tests/FluentAssertions.Specs/Types/PropertyInfoAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Types/PropertyInfoAssertionSpecs.cs index bffbe31bbc..1254bb83da 100644 --- a/Tests/FluentAssertions.Specs/Types/PropertyInfoAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/PropertyInfoAssertionSpecs.cs @@ -140,7 +140,7 @@ public void When_a_property_is_decorated_with_an_attribute_it_allow_chaining_ass propertyInfo.Should().BeDecoratedWith().Which.Value.Should().Be("OtherValue"); // Assert - act.Should().Throw().WithMessage("Expected*OtherValue*Value*"); + act.Should().Throw().WithMessage("Expected*Value*OtherValue*"); } [Fact] diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 873762c155..8eeb1ca88b 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -12,6 +12,7 @@ sidebar: ### What's new ### Improvements +* Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) ### Fixes * Fixed formatting error when checking nullable `DateTimeOffset` with From e9a0c0e4459566adc7d0001fe50d08ae00acddd4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 19:13:15 +0000 Subject: [PATCH 079/845] Bump CSharpGuidelinesAnalyzer from 3.8.3 to 3.8.4 Bumps [CSharpGuidelinesAnalyzer](https://github.com/bkoelman/CSharpGuidelinesAnalyzer) from 3.8.3 to 3.8.4. - [Release notes](https://github.com/bkoelman/CSharpGuidelinesAnalyzer/releases) - [Commits](https://github.com/bkoelman/CSharpGuidelinesAnalyzer/compare/v3.8.3...v3.8.4) --- updated-dependencies: - dependency-name: CSharpGuidelinesAnalyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 339fe62beb..68ee5980e7 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -26,7 +26,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 92f4981ed272d0af1eafd7fc1c13c5a727c79029 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Thu, 5 Oct 2023 07:10:09 +0200 Subject: [PATCH 080/845] Do not ignore `cSpell` on releases.md anymore (#2361) Since typos are awkward in every case :) --- cSpell.json | 20 ++++++++++++++------ docs/_pages/releases.md | 6 +++--- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/cSpell.json b/cSpell.json index e3d0562a0f..6b62537329 100644 --- a/cSpell.json +++ b/cSpell.json @@ -4,21 +4,30 @@ "words": [ "browsable", "comparands", - "Doomen", "formattable", + "unformattable", "Guids", "LINQ", "MVVM", "parameterless", "refactorings", - "struct" + "struct", + "reportables", + "Gallio", + "plict", + "enumerables" ], "patterns": [ { "name": "Markdown links", - "pattern": "\\((.*)\\)", + "pattern": "/\\[.*\\]\\((.*)\\)/", "description": "" }, + { + "name": "Contributors", + "pattern": "/\\@.*/g", + "description": "Exclude contributors e.g. from releases.md" + }, { "name": "Inline code blocks", "pattern": "\\`([^\\`\\r\\n]+?)\\`", @@ -59,6 +68,7 @@ ], "ignoreRegExpList": [ "Markdown links", + "Contributors", "Markdown code blocks", "Inline code blocks", "Link contents", @@ -69,7 +79,5 @@ "Frontmatter", "Liquid Includes" ], - "ignorePaths": [ - "docs/_pages/releases.md" - ] + "ignorePaths": [] } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 8eeb1ca88b..15724de1c2 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -37,7 +37,7 @@ sidebar: * `BeLessOrEqualTo`: Use `BeLessThanOrEqualTo` * Removed the `DefaultValueFormatter.SpacesPerIndentionLevel` property which was added during the development of v6, but wasn't removed before the release of v6 - [#2281](https://github.com/fluentassertions/fluentassertions/pull/2281) * Dropped direct support for .NET Core 2.x and .NET Core 3.x - [#2302](https://github.com/fluentassertions/fluentassertions/pull/2302) -* `AllSatisfy` now suceeds when asserting that an empty collection satisfies some predicates - [#2321](https://github.com/fluentassertions/fluentassertions/pull/2321) +* `AllSatisfy` now succeeds when asserting that an empty collection satisfies some predicates - [#2321](https://github.com/fluentassertions/fluentassertions/pull/2321) * `OnlyContain` now succeeds when asserting that an empty collection matches some predicates - [#2350](https://github.com/fluentassertions/fluentassertions/pull/2350) * Dropped support for `NSpec3` test framework - [#2356](https://github.com/fluentassertions/fluentassertions/pull/2356) @@ -92,11 +92,11 @@ sidebar: * 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) * Added new extension methods to be able to write `Exactly.Times(n)`, `AtLeast.Times(n)` and `AtMost.Times(n)` in a more fluent way - [#2047](https://github.com/fluentassertions/fluentassertions/pull/2047) -* Changed `BeEquivalentTo` to treat record structs like records, thus comparing them by member by default - [#2009](https://github.com/fluentassertions/fluentassertions/pull/2009) +* Changed `BeEquivalentTo` to treat `record struct`s like `record`s, thus comparing them by member by default - [#2009](https://github.com/fluentassertions/fluentassertions/pull/2009) ### Fixes * `PropertyInfoSelector.ThatArePublicOrInternal` now takes the setter into account when determining if a property is `public` or `internal` - [#2082](https://github.com/fluentassertions/fluentassertions/pull/2082) -* Quering properties on classes, e.g. `typeof(MyClass).Properties()`, now also includes static properties - [#2054](https://github.com/fluentassertions/fluentassertions/pull/2054) +* Querying properties on classes, e.g. `typeof(MyClass).Properties()`, now also includes static properties - [#2054](https://github.com/fluentassertions/fluentassertions/pull/2054) * Nested AssertionScopes now print the inner scope reportables - [#2044](https://github.com/fluentassertions/fluentassertions/pull/2044) * Throw `ArgumentException` instead of `ArgumentNullException` when a required `string` argument is empty - [#2023](https://github.com/fluentassertions/fluentassertions/pull/2023) * Assertions on the ordering of a collection of `string`s now uses ordinal comparison when an `IComparer` is not provided - [#2075](https://github.com/fluentassertions/fluentassertions/pull/2075) From 05ad12cd5bd38ef5f846e255d155c4ba406f735e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 19:18:10 +0000 Subject: [PATCH 081/845] Bump BenchmarkDotNet from 0.13.8 to 0.13.9 Bumps [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet) from 0.13.8 to 0.13.9. - [Release notes](https://github.com/dotnet/BenchmarkDotNet/releases) - [Commits](https://github.com/dotnet/BenchmarkDotNet/compare/v0.13.8...v0.13.9) --- updated-dependencies: - dependency-name: BenchmarkDotNet dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Tests/Benchmarks/Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index 602643e8de..d8334980e7 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -9,7 +9,7 @@ - + From 2548094724b044b1adf9822f1ef6e200b7b0b323 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 19:18:01 +0000 Subject: [PATCH 082/845] Bump the xunit group with 1 update Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify). - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/21.3.0...22.1.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index aaf505ab37..f6c516149f 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From a6aa93bef09b91cbea146ff8f4a499c86aedadc0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 19:44:57 +0000 Subject: [PATCH 083/845] Bump the xunit group with 1 update Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify). - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/commits) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index f6c516149f..5242e739c5 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 6f1035afeb17191dbf65e26bf8f27086f35a4585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Gr=C3=BCtzmacher?= <44983012+lg2de@users.noreply.github.com> Date: Sun, 8 Oct 2023 12:26:57 +0200 Subject: [PATCH 084/845] Removed binary formatter (#2278) * Remove BeBinarySerializable * Fix confusing variable name * Update documentation --- .../ObjectAssertionsExtensions.cs | 111 +---------- .../FluentAssertions/net47.verified.txt | 2 - .../FluentAssertions/net6.0.verified.txt | 2 - .../netstandard2.0.verified.txt | 2 - .../netstandard2.1.verified.txt | 2 - .../Primitives/ObjectAssertionSpecs.cs | 182 ------------------ docs/_pages/basicassertions.md | 10 +- docs/_pages/releases.md | 1 + 8 files changed, 7 insertions(+), 305 deletions(-) diff --git a/Src/FluentAssertions/ObjectAssertionsExtensions.cs b/Src/FluentAssertions/ObjectAssertionsExtensions.cs index f49d3b6a7f..60e20a782c 100644 --- a/Src/FluentAssertions/ObjectAssertionsExtensions.cs +++ b/Src/FluentAssertions/ObjectAssertionsExtensions.cs @@ -12,71 +12,6 @@ namespace FluentAssertions; public static class ObjectAssertionsExtensions { - /// - /// Asserts that an object can be serialized and deserialized using the binary serializer and that it stills retains - /// the values of all members. - /// - /// - /// - /// 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 static AndConstraint BeBinarySerializable(this ObjectAssertions assertions, string because = "", - params object[] becauseArgs) - { - return BeBinarySerializable(assertions, options => options, because, becauseArgs); - } - - /// - /// Asserts that an object can be serialized and deserialized using the binary serializer and that it stills retains - /// the values of all members. - /// - /// - /// - /// A reference to the configuration object that can be used - /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the - /// class. - /// - /// - /// 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 . - /// - /// is . - public static AndConstraint BeBinarySerializable(this ObjectAssertions assertions, - Func, EquivalencyAssertionOptions> options, string because = "", - params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull(options); - - try - { - object deserializedObject = CreateCloneUsingBinarySerializer(assertions.Subject); - - EquivalencyAssertionOptions defaultOptions = AssertionOptions.CloneDefaults() - .RespectingRuntimeTypes().IncludingFields().IncludingProperties(); - - ((T)deserializedObject).Should().BeEquivalentTo((T)assertions.Subject, _ => options(defaultOptions)); - } - catch (Exception exc) - { - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith("Expected {0} to be serializable{reason}, but serialization failed with:" - + Environment.NewLine + Environment.NewLine + "{1}.", - assertions.Subject, - exc.Message); - } - - return new AndConstraint(assertions); - } - /// /// Asserts that an object can be serialized and deserialized using the data contract serializer and that it stills retains /// the values of all members. @@ -134,7 +69,7 @@ public static AndConstraint BeDataContractSerializable(this Execute.Assertion .BecauseOf(because, becauseArgs) .FailWith("Expected {0} to be serializable{reason}, but serialization failed with:" - + Environment.NewLine + Environment.NewLine + "{1}.", + + Environment.NewLine + Environment.NewLine + "{1}.", assertions.Subject, exc.Message); } @@ -142,42 +77,6 @@ public static AndConstraint BeDataContractSerializable(this return new AndConstraint(assertions); } - private static object CreateCloneUsingBinarySerializer(object subject) - { - using var stream = new MemoryStream(); - - var binaryFormatter = new BinaryFormatter - { - Binder = new SimpleBinder(subject.GetType()) - }; - -#pragma warning disable SYSLIB0011, CA2300 // BinaryFormatter is obsoleted, GH-issue 1779 tracks the upcoming removal in .NET 8.0 - binaryFormatter.Serialize(stream, subject); - stream.Position = 0; - return binaryFormatter.Deserialize(stream); -#pragma warning restore SYSLIB0011, CA2300 - } - - private sealed class SimpleBinder : SerializationBinder - { - private readonly Type type; - - public SimpleBinder(Type type) - { - this.type = type; - } - - public override Type BindToType(string assemblyName, string typeName) - { - if (type.FullName == typeName && type.Assembly.FullName == assemblyName) - { - return type; - } - - return null; - } - } - private static object CreateCloneUsingDataContractSerializer(object subject) { using var stream = new MemoryStream(); @@ -214,7 +113,7 @@ public static AndConstraint BeXmlSerializable(this ObjectAsser Execute.Assertion .BecauseOf(because, becauseArgs) .FailWith("Expected {0} to be serializable{reason}, but serialization failed with:" - + Environment.NewLine + Environment.NewLine + "{1}.", + + Environment.NewLine + Environment.NewLine + "{1}.", assertions.Subject, exc.Message); } @@ -225,10 +124,10 @@ public static AndConstraint BeXmlSerializable(this ObjectAsser private static object CreateCloneUsingXmlSerializer(object subject) { using var stream = new MemoryStream(); - var binaryFormatter = new XmlSerializer(subject.GetType()); - binaryFormatter.Serialize(stream, subject); + var serializer = new XmlSerializer(subject.GetType()); + serializer.Serialize(stream, subject); stream.Position = 0; - return binaryFormatter.Deserialize(stream); + return serializer.Deserialize(stream); } } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 288c6437f0..78f7524815 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -312,8 +312,6 @@ namespace FluentAssertions } public static class ObjectAssertionsExtensions { - public static FluentAssertions.AndConstraint BeBinarySerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint BeBinarySerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index c1dc2b0fe2..6edbcef563 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -325,8 +325,6 @@ namespace FluentAssertions } public static class ObjectAssertionsExtensions { - public static FluentAssertions.AndConstraint BeBinarySerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint BeBinarySerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, 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 e6376ee7d8..19c8a2e93a 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -305,8 +305,6 @@ namespace FluentAssertions } public static class ObjectAssertionsExtensions { - public static FluentAssertions.AndConstraint BeBinarySerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint BeBinarySerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, 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 e57d709b48..6d1222dc21 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -312,8 +312,6 @@ namespace FluentAssertions } public static class ObjectAssertionsExtensions { - public static FluentAssertions.AndConstraint BeBinarySerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint BeBinarySerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs index 3543f023a1..fad59acbab 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs @@ -1251,188 +1251,6 @@ public void Should_throw_a_helpful_error_when_accidentally_using_equals() } } - public class BeBinarySerializable - { - [Fact] - public void When_an_object_is_binary_serializable_it_should_succeed() - { - // Arrange - var subject = new SerializableClass - { - Name = "John", - Id = 2 - }; - - // Act - Action act = () => subject.Should().BeBinarySerializable(); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_an_object_is_binary_serializable_with_non_serializable_members_it_should_succeed() - { - // Arrange - var subject = new SerializableClassWithNonSerializableMember - { - Name = "John", - NonSerializable = "Nonserializable value" - }; - - // Act - Action act = () => subject.Should().BeBinarySerializable(options => - options.Excluding(s => s.NonSerializable)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_injecting_null_options_it_should_throw() - { - // Arrange - var subject = new SerializableClassWithNonSerializableMember(); - - // Act - Action act = () => subject.Should().BeBinarySerializable(options: null); - - // Assert - act.Should().ThrowExactly() - .WithParameterName("options"); - } - - [Fact] - public void When_an_object_is_not_binary_serializable_it_should_fail() - { - // Arrange - var subject = new UnserializableClass - { - Name = "John" - }; - - // Act - Action act = () => subject.Should().BeBinarySerializable("we need to store it on {0}", "disk"); - - // Assert - act.Should().Throw() - .WithMessage( - "*to be serializable because we need to store it on disk, but serialization failed with:*UnserializableClass*"); - } - - [Fact] - public void When_an_object_is_binary_serializable_but_not_deserializable_it_should_fail() - { - // Arrange - var subject = new BinarySerializableClassMissingDeserializationConstructor - { - Name = "John", - BirthDay = 20.September(1973) - }; - - // Act - Action act = () => subject.Should().BeBinarySerializable(); - - // Assert - act.Should().Throw() - .WithMessage( - "*to be serializable, but serialization failed with:*BinarySerializableClassMissingDeserializationConstructor*"); - } - - [Fact] - public void When_an_object_is_binary_serializable_but_doesnt_restore_all_properties_it_should_fail() - { - // Arrange - var subject = new BinarySerializableClassNotRestoringAllProperties - { - Name = "John", - BirthDay = 20.September(1973) - }; - - // Act - Action act = () => subject.Should().BeBinarySerializable(); - - // Assert - act.Should().Throw() - .WithMessage("*to be serializable, but serialization failed with:*subject.Name*to be*"); - } - - [Fact] - public void When_a_system_exception_is_asserted_to_be_serializable_it_should_compare_its_fields_and_properties() - { - // Arrange - var subject = new Exception("some error"); - - // Act - Action act = () => subject.Should().BeBinarySerializable(); - - // Assert - act.Should().NotThrow(); - } - } - - internal class UnserializableClass - { - public string Name { get; set; } - } - - [Serializable] - public class SerializableClass - { - public string Name { get; set; } - - public int Id; - } - - [Serializable] - public class SerializableClassWithNonSerializableMember - { - [NonSerialized] - private string nonSerializable; - - public string Name { get; set; } - - public string NonSerializable - { - get => nonSerializable; - set => nonSerializable = value; - } - } - - [Serializable] - internal class BinarySerializableClassMissingDeserializationConstructor : ISerializable - { - public string Name { get; set; } - - public DateTime BirthDay { get; set; } - - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - } - } - - [Serializable] - internal class BinarySerializableClassNotRestoringAllProperties : ISerializable - { - public string Name { get; set; } - - public DateTime BirthDay { get; set; } - - public BinarySerializableClassNotRestoringAllProperties() - { - } - - public BinarySerializableClassNotRestoringAllProperties(SerializationInfo info, StreamingContext context) - { - BirthDay = info.GetDateTime("BirthDay"); - } - - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("BirthDay", BirthDay); - } - } - public class BeXmlSerializable { [Fact] diff --git a/docs/_pages/basicassertions.md b/docs/_pages/basicassertions.md index 453b4fe345..4adf6b4608 100644 --- a/docs/_pages/basicassertions.md +++ b/docs/_pages/basicassertions.md @@ -76,17 +76,9 @@ Some users requested the ability to easily downcast an object to one of its deri customer.Animals.First().As().Height.Should().Be(178); ``` -We’ve also added the possibility to assert that an object can be serialized and deserialized using the XML, binary or data contract formatters. +We’ve also added the possibility to assert that an object can be serialized and deserialized using the XML or data contract formatters. ```csharp theObject.Should().BeXmlSerializable(); -theObject.Should().BeBinarySerializable(); theObject.Should().BeDataContractSerializable(); ``` - -Internally, `BeBinarySerializable` uses the [Object graph comparison](objectgraphs.md) API, so if you are in need of excluding certain properties from the comparison (for instance, because its backing field is `[NonSerializable]`, you can do this: - -```csharp -theObject.Should().BeBinarySerializable( - options => options.Excluding(s => s.SomeNonSerializableProperty)); -``` diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 15724de1c2..857ea74b42 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -40,6 +40,7 @@ sidebar: * `AllSatisfy` now succeeds when asserting that an empty collection satisfies some predicates - [#2321](https://github.com/fluentassertions/fluentassertions/pull/2321) * `OnlyContain` now succeeds when asserting that an empty collection matches some predicates - [#2350](https://github.com/fluentassertions/fluentassertions/pull/2350) * Dropped support for `NSpec3` test framework - [#2356](https://github.com/fluentassertions/fluentassertions/pull/2356) +* Dropped support for `BinaryFormatter` - [#2278](https://github.com/fluentassertions/fluentassertions/pull/2278) ### Breaking Changes (for extensions) * Add `ForConstraint` to `IAssertionsScope` to support chaining `.ForConstraint()` after `.Then` - [#2324](https://github.com/fluentassertions/fluentassertions/pull/2324) From 3205e04d919a5be03803ccb6834bbc3b8662d3ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Gr=C3=BCtzmacher?= <44983012+lg2de@users.noreply.github.com> Date: Sun, 8 Oct 2023 14:51:22 +0200 Subject: [PATCH 085/845] Converted AsyncFunctionAssertions into real base class (#2359) * Make AsyncFunctionAssertions a base class * Move methods to concrete class to prevent overwriting with `new` * Add some class documentation * Updated release notes * Disable Qudana rule "InvertIf" --- .../Specialized/AsyncFunctionAssertions.cs | 155 +----------------- .../GenericAsyncFunctionAssertions.cs | 18 +- .../NonGenericAsyncFunctionAssertions.cs | 155 +++++++++++++++++- .../FluentAssertions/net47.verified.txt | 13 +- .../FluentAssertions/net6.0.verified.txt | 13 +- .../netstandard2.0.verified.txt | 13 +- .../netstandard2.1.verified.txt | 13 +- docs/_pages/releases.md | 4 + qodana.yaml | 1 + 9 files changed, 191 insertions(+), 194 deletions(-) diff --git a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs index 07a558d3f9..e25b6cc44e 100644 --- a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs @@ -11,67 +11,20 @@ namespace FluentAssertions.Specialized; /// /// Contains a number of methods to assert that an asynchronous method yields the expected result. /// +/// The type of to be handled. +/// The type of assertion to be returned. [DebuggerNonUserCode] public class AsyncFunctionAssertions : DelegateAssertionsBase, TAssertions> where TTask : Task where TAssertions : AsyncFunctionAssertions { - [Obsolete("This class is intended as base class. This ctor is accidentally public and will be removed in Version 7.")] - public AsyncFunctionAssertions(Func subject, IExtractExceptions extractor) - : this(subject, extractor, new Clock()) - { - } - - [Obsolete("This class is intended as base class. This ctor is accidentally public and will be made protected in Version 7.")] - public AsyncFunctionAssertions(Func subject, IExtractExceptions extractor, IClock clock) + protected AsyncFunctionAssertions(Func subject, IExtractExceptions extractor, IClock clock) : base(subject, extractor, clock) { } protected override string Identifier => "async function"; - /// - /// Asserts that the current will complete within the specified time. - /// - /// The allowed time span for the operation. - /// - /// 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 async Task> CompleteWithinAsync( - TimeSpan timeSpan, string because = "", params object[] becauseArgs) - { - bool success = Execute.Assertion - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:task} to complete within {0}{reason}, but found .", timeSpan); - - if (success) - { - (TTask task, TimeSpan remainingTime) = InvokeWithTimer(timeSpan); - - success = Execute.Assertion - .ForCondition(remainingTime >= TimeSpan.Zero) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:task} to complete within {0}{reason}.", timeSpan); - - if (success) - { - bool completesWithinTimeout = await CompletesWithinTimeoutAsync(task, remainingTime); - - Execute.Assertion - .ForCondition(completesWithinTimeout) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:task} to complete within {0}{reason}.", timeSpan); - } - } - - return new AndConstraint((TAssertions)this); - } - /// /// Asserts that the current will not complete within the specified time. /// @@ -279,38 +232,6 @@ private async Task InvokeWithInterceptionAsync(TimeSpan timeout) } } - /// - /// Asserts that the current does not throw any exception. - /// - /// - /// 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 async Task> NotThrowAsync(string because = "", params object[] becauseArgs) - { - bool success = Execute.Assertion - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context} not to throw{reason}, but found ."); - - if (success) - { - try - { - await Subject!.Invoke(); - } - catch (Exception exception) - { - return NotThrowInternal(exception, because, becauseArgs); - } - } - - return new AndConstraint((TAssertions)this); - } - /// /// Asserts that the current does not throw an exception of type . /// @@ -345,74 +266,6 @@ public async Task> NotThrowAsync(string b return new AndConstraint((TAssertions)this); } - /// - /// Asserts that the current stops throwing any exception - /// after a specified amount of time. - /// - /// - /// The is invoked. If it raises an exception, - /// the invocation is repeated until it either stops raising any exceptions - /// or the specified wait time is exceeded. - /// - /// - /// The time after which the should have stopped throwing any exception. - /// - /// - /// The time between subsequent invocations of the . - /// - /// - /// 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 . - /// - /// or are negative. - public Task> NotThrowAfterAsync(TimeSpan waitTime, TimeSpan pollInterval, string because = "", - params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNegative(waitTime); - Guard.ThrowIfArgumentIsNegative(pollInterval); - - bool success = Execute.Assertion - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context} not to throw any exceptions after {0}{reason}, but found .", waitTime); - - if (success) - { - return AssertionTaskAsync(); - - async Task> AssertionTaskAsync() - { - TimeSpan? invocationEndTime = null; - Exception exception = null; - ITimer timer = Clock.StartTimer(); - - while (invocationEndTime is null || invocationEndTime < waitTime) - { - exception = await InvokeWithInterceptionAsync(Subject); - - if (exception is null) - { - return new AndConstraint((TAssertions)this); - } - - await Clock.DelayAsync(pollInterval, CancellationToken.None); - invocationEndTime = timer.Elapsed; - } - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith("Did not expect any exceptions after {0}{reason}, but found {1}.", waitTime, exception); - - return new AndConstraint((TAssertions)this); - } - } - - return Task.FromResult(new AndConstraint((TAssertions)this)); - } - /// /// Invokes the subject and measures the sync execution time. /// @@ -452,7 +305,7 @@ private protected async Task CompletesWithinTimeoutAsync(Task target, Time return true; } - private static async Task InvokeWithInterceptionAsync(Func action) + private protected static async Task InvokeWithInterceptionAsync(Func action) { try { diff --git a/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs index af5729409c..0e5eaad07d 100644 --- a/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs @@ -6,18 +6,26 @@ namespace FluentAssertions.Specialized; +/// +/// Contains a number of methods to assert that an asynchronous method yields the expected result. +/// +/// The type returned in the . public class GenericAsyncFunctionAssertions : AsyncFunctionAssertions, GenericAsyncFunctionAssertions> { + /// + /// Initializes a new instance of the class. + /// public GenericAsyncFunctionAssertions(Func> subject, IExtractExceptions extractor) : this(subject, extractor, new Clock()) { } + /// + /// Initializes a new instance of the class with custom . + /// public GenericAsyncFunctionAssertions(Func> subject, IExtractExceptions extractor, IClock clock) -#pragma warning disable CS0618 // is currently obsolete to make it protected in Version 7 : base(subject, extractor, clock) -#pragma warning restore CS0618 { } @@ -32,7 +40,7 @@ public GenericAsyncFunctionAssertions(Func> subject, IExtractExcep /// /// Zero or more objects to format using the placeholders in . /// - public new async Task, TResult>> CompleteWithinAsync( + public async Task, TResult>> CompleteWithinAsync( TimeSpan timeSpan, string because = "", params object[] becauseArgs) { bool success = Execute.Assertion @@ -78,7 +86,7 @@ public GenericAsyncFunctionAssertions(Func> subject, IExtractExcep /// /// Zero or more objects to format using the placeholders in . /// - public new async Task, TResult>> NotThrowAsync( + public async Task, TResult>> NotThrowAsync( string because = "", params object[] becauseArgs) { bool success = Execute.Assertion @@ -125,7 +133,7 @@ public GenericAsyncFunctionAssertions(Func> subject, IExtractExcep /// Zero or more objects to format using the placeholders in . /// /// or are negative. - public new Task, TResult>> NotThrowAfterAsync( + public Task, TResult>> NotThrowAfterAsync( TimeSpan waitTime, TimeSpan pollInterval, string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(waitTime); diff --git a/Src/FluentAssertions/Specialized/NonGenericAsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/NonGenericAsyncFunctionAssertions.cs index 19bcf54d99..619e287bfb 100644 --- a/Src/FluentAssertions/Specialized/NonGenericAsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/NonGenericAsyncFunctionAssertions.cs @@ -1,20 +1,171 @@ using System; +using System.Threading; using System.Threading.Tasks; using FluentAssertions.Common; +using FluentAssertions.Execution; namespace FluentAssertions.Specialized; +/// +/// Contains a number of methods to assert that an asynchronous method yields the expected result. +/// public class NonGenericAsyncFunctionAssertions : AsyncFunctionAssertions { + /// + /// Initializes a new instance of the class. + /// public NonGenericAsyncFunctionAssertions(Func subject, IExtractExceptions extractor) : this(subject, extractor, new Clock()) { } + /// + /// Initializes a new instance of the class with custom . + /// public NonGenericAsyncFunctionAssertions(Func subject, IExtractExceptions extractor, IClock clock) -#pragma warning disable CS0618 // is currently obsolete to make it protected in Version 7 : base(subject, extractor, clock) -#pragma warning restore CS0618 { } + + /// + /// Asserts that the current will complete within the specified time. + /// + /// The allowed time span for the operation. + /// + /// 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 async Task> CompleteWithinAsync( + TimeSpan timeSpan, string because = "", params object[] becauseArgs) + { + bool success = Execute.Assertion + .ForCondition(Subject is not null) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:task} to complete within {0}{reason}, but found .", timeSpan); + + if (success) + { + (Task task, TimeSpan remainingTime) = InvokeWithTimer(timeSpan); + + success = Execute.Assertion + .ForCondition(remainingTime >= TimeSpan.Zero) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:task} to complete within {0}{reason}.", timeSpan); + + if (success) + { + bool completesWithinTimeout = await CompletesWithinTimeoutAsync(task, remainingTime); + + Execute.Assertion + .ForCondition(completesWithinTimeout) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:task} to complete within {0}{reason}.", timeSpan); + } + } + + return new AndConstraint(this); + } + + /// + /// Asserts that the current does not throw any exception. + /// + /// + /// 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 async Task> NotThrowAsync(string because = "", params object[] becauseArgs) + { + bool success = Execute.Assertion + .ForCondition(Subject is not null) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context} not to throw{reason}, but found ."); + + if (success) + { + try + { + await Subject!.Invoke(); + } + catch (Exception exception) + { + return NotThrowInternal(exception, because, becauseArgs); + } + } + + return new AndConstraint(this); + } + + /// + /// Asserts that the current stops throwing any exception + /// after a specified amount of time. + /// + /// + /// The is invoked. If it raises an exception, + /// the invocation is repeated until it either stops raising any exceptions + /// or the specified wait time is exceeded. + /// + /// + /// The time after which the should have stopped throwing any exception. + /// + /// + /// The time between subsequent invocations of the . + /// + /// + /// 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 . + /// + /// or are negative. + public Task> NotThrowAfterAsync(TimeSpan waitTime, TimeSpan pollInterval, string because = "", + params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNegative(waitTime); + Guard.ThrowIfArgumentIsNegative(pollInterval); + + bool success = Execute.Assertion + .ForCondition(Subject is not null) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context} not to throw any exceptions after {0}{reason}, but found .", waitTime); + + if (success) + { + return AssertionTaskAsync(); + + async Task> AssertionTaskAsync() + { + TimeSpan? invocationEndTime = null; + Exception exception = null; + ITimer timer = Clock.StartTimer(); + + while (invocationEndTime is null || invocationEndTime < waitTime) + { + exception = await InvokeWithInterceptionAsync(Subject); + + if (exception is null) + { + return new AndConstraint(this); + } + + await Clock.DelayAsync(pollInterval, CancellationToken.None); + invocationEndTime = timer.Elapsed; + } + + Execute.Assertion + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect any exceptions after {0}{reason}, but found {1}.", waitTime, exception); + + return new AndConstraint(this); + } + } + + return Task.FromResult(new AndConstraint(this)); + } } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 78f7524815..ee07e987b1 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -2093,17 +2093,9 @@ namespace FluentAssertions.Specialized where TTask : System.Threading.Tasks.Task where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions { - [System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" + - "e removed in Version 7.")] - public AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - [System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" + - "e made protected in Version 7.")] - public AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + protected AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } - public System.Threading.Tasks.Task> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) where TException : System.Exception { } public System.Threading.Tasks.Task> ThrowAsync(string because = "", params object[] becauseArgs) @@ -2201,6 +2193,9 @@ namespace FluentAssertions.Specialized { public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public System.Threading.Tasks.Task> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } + public System.Threading.Tasks.Task> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } + public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) { } } public class TaskCompletionSourceAssertionsBase { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 6edbcef563..8eb557ce5e 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -2214,17 +2214,9 @@ namespace FluentAssertions.Specialized where TTask : System.Threading.Tasks.Task where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions { - [System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" + - "e removed in Version 7.")] - public AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - [System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" + - "e made protected in Version 7.")] - public AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + protected AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } - public System.Threading.Tasks.Task> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) where TException : System.Exception { } public System.Threading.Tasks.Task> ThrowAsync(string because = "", params object[] becauseArgs) @@ -2322,6 +2314,9 @@ namespace FluentAssertions.Specialized { public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public System.Threading.Tasks.Task> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } + public System.Threading.Tasks.Task> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } + public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) { } } public class TaskCompletionSourceAssertions : FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 19c8a2e93a..925751a221 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -2044,17 +2044,9 @@ namespace FluentAssertions.Specialized where TTask : System.Threading.Tasks.Task where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions { - [System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" + - "e removed in Version 7.")] - public AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - [System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" + - "e made protected in Version 7.")] - public AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + protected AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } - public System.Threading.Tasks.Task> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) where TException : System.Exception { } public System.Threading.Tasks.Task> ThrowAsync(string because = "", params object[] becauseArgs) @@ -2152,6 +2144,9 @@ namespace FluentAssertions.Specialized { public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public System.Threading.Tasks.Task> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } + public System.Threading.Tasks.Task> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } + public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) { } } public class TaskCompletionSourceAssertionsBase { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 6d1222dc21..8ce0e56515 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -2093,17 +2093,9 @@ namespace FluentAssertions.Specialized where TTask : System.Threading.Tasks.Task where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions { - [System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" + - "e removed in Version 7.")] - public AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - [System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" + - "e made protected in Version 7.")] - public AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + protected AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } - public System.Threading.Tasks.Task> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } - public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) where TException : System.Exception { } public System.Threading.Tasks.Task> ThrowAsync(string because = "", params object[] becauseArgs) @@ -2201,6 +2193,9 @@ namespace FluentAssertions.Specialized { public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public System.Threading.Tasks.Task> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } + public System.Threading.Tasks.Task> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } + public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) { } } public class TaskCompletionSourceAssertionsBase { diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 857ea74b42..ac3a31a0c6 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -44,6 +44,10 @@ sidebar: ### Breaking Changes (for extensions) * Add `ForConstraint` to `IAssertionsScope` to support chaining `.ForConstraint()` after `.Then` - [#2324](https://github.com/fluentassertions/fluentassertions/pull/2324) +* Refactored `AsyncFunctionAssertions` into real base class - [#2359](https://github.com/fluentassertions/fluentassertions/pull/2359) + * Its constructor has been made `protected`. + * Unused constructors have been removed. + * Methods overwritten in `GenericAsyncFunctionAssertions` has been moved to `NonGenericAsyncFunctionAssertions`. ## 6.12.0 diff --git a/qodana.yaml b/qodana.yaml index a0bd0ce51d..d8e3164bf0 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -9,6 +9,7 @@ dotnet: exclude: - name: ConvertIfStatementToReturnStatement - name: ConvertIfStatementToConditionalTernaryExpression + - name: InvertIf - name: SimilarAnonymousTypeNearby paths: - Tests From 39dfa49bb688065f4ef0441aaae5cc9f463186ad Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 8 Oct 2023 13:41:25 +0200 Subject: [PATCH 086/845] Remove unused using --- Src/FluentAssertions/ObjectAssertionsExtensions.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Src/FluentAssertions/ObjectAssertionsExtensions.cs b/Src/FluentAssertions/ObjectAssertionsExtensions.cs index 60e20a782c..196cf8461d 100644 --- a/Src/FluentAssertions/ObjectAssertionsExtensions.cs +++ b/Src/FluentAssertions/ObjectAssertionsExtensions.cs @@ -1,7 +1,6 @@ using System; using System.IO; using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; using System.Xml.Serialization; using FluentAssertions.Common; using FluentAssertions.Equivalency; From 707d3f6e3d8a3becd587adbbe70d0194967d1382 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 8 Oct 2023 15:43:21 +0200 Subject: [PATCH 087/845] Replace constructor with members initialized inline --- Src/FluentAssertions/Common/StopwatchTimer.cs | 7 +------ Src/FluentAssertions/EquivalencyPlan.cs | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Src/FluentAssertions/Common/StopwatchTimer.cs b/Src/FluentAssertions/Common/StopwatchTimer.cs index bb81266cbb..889a316e5f 100644 --- a/Src/FluentAssertions/Common/StopwatchTimer.cs +++ b/Src/FluentAssertions/Common/StopwatchTimer.cs @@ -5,12 +5,7 @@ namespace FluentAssertions.Common; internal sealed class StopwatchTimer : ITimer { - private readonly Stopwatch stopwatch; - - public StopwatchTimer() - { - stopwatch = Stopwatch.StartNew(); - } + private readonly Stopwatch stopwatch = Stopwatch.StartNew(); public TimeSpan Elapsed => stopwatch.Elapsed; diff --git a/Src/FluentAssertions/EquivalencyPlan.cs b/Src/FluentAssertions/EquivalencyPlan.cs index e3f176cad2..59e241da60 100644 --- a/Src/FluentAssertions/EquivalencyPlan.cs +++ b/Src/FluentAssertions/EquivalencyPlan.cs @@ -17,12 +17,7 @@ namespace FluentAssertions; /// public class EquivalencyPlan : IEnumerable { - private List steps; - - public EquivalencyPlan() - { - steps = GetDefaultSteps(); - } + private List steps = GetDefaultSteps(); public IEnumerator GetEnumerator() { From 9cab5687f3215e9f34432352c185ecfecf07020b Mon Sep 17 00:00:00 2001 From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> Date: Sun, 8 Oct 2023 19:56:45 +0200 Subject: [PATCH 088/845] Add a note to XML-docs that explains the `(Not)ContainEquivalentOf` problem (#2354) --- .../GenericCollectionAssertions.cs | 52 +++++++++++++------ 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index 8027e10e34..9590af0ac1 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -810,13 +810,18 @@ public AndConstraint Contain(IEnumerable expected, string becaus } /// - /// Asserts that a collection of objects contains at least one object equivalent to another object. + /// Asserts that at least one element in the collection is equivalent to . /// /// - /// Objects within the collection are equivalent to the expected object when both object graphs have equally named properties with the same - /// value, irrespective of the type of those objects. Two properties are also equal if one type can be converted to another - /// and the result is equal. + /// + /// Important: You cannot use this method to assert whether a subset of the collection is equivalent to the . + /// This usually means that the expectation is meant to be a single item. + /// + /// + /// By default, objects within the collection are seen as equivalent to the expected object when both object graphs have equally named properties with the same + /// value, irrespective of the type of those objects. /// Notice that actual behavior is determined by the global defaults managed by . + /// /// /// The expected element. /// @@ -833,13 +838,18 @@ public AndWhichConstraint ContainEquivalentOf(TExp } /// - /// Asserts that a collection of objects contains at least one object equivalent to another object. + /// Asserts that at least one element in the collection is equivalent to . /// /// - /// Objects within the collection are equivalent to the expected object when both object graphs have equally named properties with the same - /// value, irrespective of the type of those objects. Two properties are also equal if one type can be converted to another - /// and the result is equal. + /// + /// Important: You cannot use this method to assert whether a subset of the collection is equivalent to the . + /// This usually means that the expectation is meant to be a single item. + /// + /// + /// By default, objects within the collection are seen as equivalent to the expected object when both object graphs have equally named properties with the same + /// value, irrespective of the type of those objects. /// Notice that actual behavior is determined by the global defaults managed by . + /// /// /// The expected element. /// @@ -2283,13 +2293,18 @@ public AndConstraint NotContain(IEnumerable unexpected, string b } /// - /// Asserts that a collection of objects does not contain any object equivalent to another object. + /// Asserts that no element in the collection is equivalent to . /// /// - /// Objects within the collection are equivalent to the expected object when both object graphs have equally named properties with the same - /// value, irrespective of the type of those objects. Two properties are also equal if one type can be converted to another - /// and the result is equal. + /// + /// Important: You cannot use this method to assert whether a subset of the collection is not equivalent to the . + /// This usually means that the expectation is meant to be a single item. + /// + /// + /// By default, objects within the collection are seen as not equivalent to the expected object when both object graphs have unequally named properties with the same + /// value, irrespective of the type of those objects. /// Notice that actual behavior is determined by the global defaults managed by . + /// /// /// The unexpected element. /// @@ -2306,13 +2321,18 @@ public AndConstraint NotContainEquivalentOf(TExpectat } /// - /// Asserts that a collection of objects does not contain any object equivalent to another object. + /// Asserts that no element in the collection is equivalent to . /// /// - /// Objects within the collection are equivalent to the expected object when both object graphs have equally named properties with the same - /// value, irrespective of the type of those objects. Two properties are also equal if one type can be converted to another - /// and the result is equal. + /// + /// Important: You cannot use this method to assert whether a subset of the collection is not equivalent to the . + /// This usually means that the expectation is meant to be a single item. + /// + /// + /// By default, objects within the collection are seen as not equivalent to the expected object when both object graphs have unequally named properties with the same + /// value, irrespective of the type of those objects. /// Notice that actual behavior is determined by the global defaults managed by . + /// /// /// The unexpected element. /// From 729f8063702541a202334be330a8216b7e3867f6 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 9 Oct 2023 19:45:46 +0200 Subject: [PATCH 089/845] Move non-generic `NotThrow[After]` to `ActionAssertions` (#2371) Similar to what we did in #2359 --- .../Specialized/ActionAssertions.cs | 92 ++++++++++++++++++ .../Specialized/DelegateAssertions.cs | 95 +------------------ .../Specialized/FunctionAssertions.cs | 4 +- .../FluentAssertions/net47.verified.txt | 4 +- .../FluentAssertions/net6.0.verified.txt | 4 +- .../netstandard2.0.verified.txt | 4 +- .../netstandard2.1.verified.txt | 4 +- docs/_pages/releases.md | 1 + 8 files changed, 105 insertions(+), 103 deletions(-) diff --git a/Src/FluentAssertions/Specialized/ActionAssertions.cs b/Src/FluentAssertions/Specialized/ActionAssertions.cs index 5dec1d2d52..4f939de01b 100644 --- a/Src/FluentAssertions/Specialized/ActionAssertions.cs +++ b/Src/FluentAssertions/Specialized/ActionAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using FluentAssertions.Common; +using FluentAssertions.Execution; namespace FluentAssertions.Specialized; @@ -20,6 +21,97 @@ public ActionAssertions(Action subject, IExtractExceptions extractor, IClock clo { } + /// + /// Asserts that the current does not throw any exception. + /// + /// + /// 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 NotThrow(string because = "", params object[] becauseArgs) + { + bool success = Execute.Assertion + .ForCondition(Subject is not null) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context} not to throw{reason}, but found ."); + + if (success) + { + FailIfSubjectIsAsyncVoid(); + Exception exception = InvokeSubjectWithInterception(); + return NotThrowInternal(exception, because, becauseArgs); + } + + return new AndConstraint(this); + } + + /// + /// Asserts that the current stops throwing any exception + /// after a specified amount of time. + /// + /// + /// The delegate is invoked. If it raises an exception, + /// the invocation is repeated until it either stops raising any exceptions + /// or the specified wait time is exceeded. + /// + /// + /// The time after which the delegate should have stopped throwing any exception. + /// + /// + /// The time between subsequent invocations of the delegate. + /// + /// + /// 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 . + /// + /// or are negative. + public AndConstraint NotThrowAfter(TimeSpan waitTime, TimeSpan pollInterval, string because = "", + params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNegative(waitTime); + Guard.ThrowIfArgumentIsNegative(pollInterval); + + bool success = Execute.Assertion + .ForCondition(Subject is not null) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context} not to throw after {0}{reason}, but found .", waitTime); + + if (success) + { + FailIfSubjectIsAsyncVoid(); + + TimeSpan? invocationEndTime = null; + Exception exception = null; + ITimer timer = Clock.StartTimer(); + + while (invocationEndTime is null || invocationEndTime < waitTime) + { + exception = InvokeSubjectWithInterception(); + + if (exception is null) + { + break; + } + + Clock.Delay(pollInterval); + invocationEndTime = timer.Elapsed; + } + + Execute.Assertion + .BecauseOf(because, becauseArgs) + .ForCondition(exception is null) + .FailWith("Did not expect any exceptions after {0}{reason}, but found {1}.", waitTime, exception); + } + + return new AndConstraint(this); + } + protected override void InvokeSubject() { Subject(); diff --git a/Src/FluentAssertions/Specialized/DelegateAssertions.cs b/Src/FluentAssertions/Specialized/DelegateAssertions.cs index 3329c17799..785b0f7dcf 100644 --- a/Src/FluentAssertions/Specialized/DelegateAssertions.cs +++ b/Src/FluentAssertions/Specialized/DelegateAssertions.cs @@ -81,33 +81,6 @@ public AndConstraint NotThrow(string because = "", para return new AndConstraint((TAssertions)this); } - /// - /// Asserts that the current does not throw any exception. - /// - /// - /// 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 NotThrow(string because = "", params object[] becauseArgs) - { - bool success = Execute.Assertion - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context} not to throw{reason}, but found ."); - - if (success) - { - FailIfSubjectIsAsyncVoid(); - Exception exception = InvokeSubjectWithInterception(); - return NotThrowInternal(exception, because, becauseArgs); - } - - return new AndConstraint((TAssertions)this); - } - /// /// Asserts that the current throws an exception of the exact type (and not a derived exception type). /// @@ -153,73 +126,9 @@ public ExceptionAssertions ThrowExactly(string because = return new ExceptionAssertions(Array.Empty()); } - /// - /// Asserts that the current stops throwing any exception - /// after a specified amount of time. - /// - /// - /// The delegate is invoked. If it raises an exception, - /// the invocation is repeated until it either stops raising any exceptions - /// or the specified wait time is exceeded. - /// - /// - /// The time after which the delegate should have stopped throwing any exception. - /// - /// - /// The time between subsequent invocations of the delegate. - /// - /// - /// 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 . - /// - /// or are negative. - public AndConstraint NotThrowAfter(TimeSpan waitTime, TimeSpan pollInterval, string because = "", - params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNegative(waitTime); - Guard.ThrowIfArgumentIsNegative(pollInterval); - - bool success = Execute.Assertion - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context} not to throw after {0}{reason}, but found .", waitTime); - - if (success) - { - FailIfSubjectIsAsyncVoid(); - - TimeSpan? invocationEndTime = null; - Exception exception = null; - ITimer timer = Clock.StartTimer(); - - while (invocationEndTime is null || invocationEndTime < waitTime) - { - exception = InvokeSubjectWithInterception(); - - if (exception is null) - { - break; - } - - Clock.Delay(pollInterval); - invocationEndTime = timer.Elapsed; - } - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .ForCondition(exception is null) - .FailWith("Did not expect any exceptions after {0}{reason}, but found {1}.", waitTime, exception); - } - - return new AndConstraint((TAssertions)this); - } - protected abstract void InvokeSubject(); - private Exception InvokeSubjectWithInterception() + private protected Exception InvokeSubjectWithInterception() { Exception actualException = null; @@ -248,7 +157,7 @@ private Exception InvokeSubjectWithInterception() return actualException; } - private void FailIfSubjectIsAsyncVoid() + private protected void FailIfSubjectIsAsyncVoid() { if (Subject.GetMethodInfo().IsDecoratedWithOrInherit()) { diff --git a/Src/FluentAssertions/Specialized/FunctionAssertions.cs b/Src/FluentAssertions/Specialized/FunctionAssertions.cs index fda57829d9..49a54992e4 100644 --- a/Src/FluentAssertions/Specialized/FunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/FunctionAssertions.cs @@ -38,7 +38,7 @@ protected override void InvokeSubject() /// /// Zero or more objects to format using the placeholders in . /// - public new AndWhichConstraint, T> NotThrow(string because = "", params object[] becauseArgs) + public AndWhichConstraint, T> NotThrow(string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(Subject is not null) @@ -78,7 +78,7 @@ protected override void InvokeSubject() /// Zero or more objects to format using the placeholders in . /// /// or are negative. - public new AndWhichConstraint, T> NotThrowAfter(TimeSpan waitTime, TimeSpan pollInterval, + public AndWhichConstraint, T> NotThrowAfter(TimeSpan waitTime, TimeSpan pollInterval, string because = "", params object[] becauseArgs) { bool success = Execute.Assertion diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index ee07e987b1..8be364f24e 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -2088,6 +2088,8 @@ namespace FluentAssertions.Specialized public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } protected override void InvokeSubject() { } + public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } } public class AsyncFunctionAssertions : FluentAssertions.Specialized.DelegateAssertionsBase, TAssertions> where TTask : System.Threading.Tasks.Task @@ -2121,10 +2123,8 @@ namespace FluentAssertions.Specialized { protected DelegateAssertions(TDelegate @delegate, FluentAssertions.Specialized.IExtractExceptions extractor) { } protected abstract void InvokeSubject(); - public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) where TException : System.Exception { } - public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } public FluentAssertions.Specialized.ExceptionAssertions Throw(string because = "", params object[] becauseArgs) where TException : System.Exception { } public FluentAssertions.Specialized.ExceptionAssertions ThrowExactly(string because = "", params object[] becauseArgs) diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 8eb557ce5e..d319c0fc3f 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -2209,6 +2209,8 @@ namespace FluentAssertions.Specialized public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } protected override void InvokeSubject() { } + public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } } public class AsyncFunctionAssertions : FluentAssertions.Specialized.DelegateAssertionsBase, TAssertions> where TTask : System.Threading.Tasks.Task @@ -2242,10 +2244,8 @@ namespace FluentAssertions.Specialized { protected DelegateAssertions(TDelegate @delegate, FluentAssertions.Specialized.IExtractExceptions extractor) { } protected abstract void InvokeSubject(); - public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) where TException : System.Exception { } - public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } public FluentAssertions.Specialized.ExceptionAssertions Throw(string because = "", params object[] becauseArgs) where TException : System.Exception { } public FluentAssertions.Specialized.ExceptionAssertions ThrowExactly(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 925751a221..a2e54fe7a8 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -2039,6 +2039,8 @@ namespace FluentAssertions.Specialized public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } protected override void InvokeSubject() { } + public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } } public class AsyncFunctionAssertions : FluentAssertions.Specialized.DelegateAssertionsBase, TAssertions> where TTask : System.Threading.Tasks.Task @@ -2072,10 +2074,8 @@ namespace FluentAssertions.Specialized { protected DelegateAssertions(TDelegate @delegate, FluentAssertions.Specialized.IExtractExceptions extractor) { } protected abstract void InvokeSubject(); - public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) where TException : System.Exception { } - public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } public FluentAssertions.Specialized.ExceptionAssertions Throw(string because = "", params object[] becauseArgs) where TException : System.Exception { } public FluentAssertions.Specialized.ExceptionAssertions ThrowExactly(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 8ce0e56515..44ff600418 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -2088,6 +2088,8 @@ namespace FluentAssertions.Specialized public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } protected override void InvokeSubject() { } + public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } } public class AsyncFunctionAssertions : FluentAssertions.Specialized.DelegateAssertionsBase, TAssertions> where TTask : System.Threading.Tasks.Task @@ -2121,10 +2123,8 @@ namespace FluentAssertions.Specialized { protected DelegateAssertions(TDelegate @delegate, FluentAssertions.Specialized.IExtractExceptions extractor) { } protected abstract void InvokeSubject(); - public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) where TException : System.Exception { } - public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } public FluentAssertions.Specialized.ExceptionAssertions Throw(string because = "", params object[] becauseArgs) where TException : System.Exception { } public FluentAssertions.Specialized.ExceptionAssertions ThrowExactly(string because = "", params object[] becauseArgs) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index ac3a31a0c6..989ae0e528 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -48,6 +48,7 @@ sidebar: * Its constructor has been made `protected`. * Unused constructors have been removed. * Methods overwritten in `GenericAsyncFunctionAssertions` has been moved to `NonGenericAsyncFunctionAssertions`. +* Moved the non-generic `NotThrow` and `NotThrowAfter` from `DelegateAssertions` to `ActionAssertions` - [#2371](https://github.com/fluentassertions/fluentassertions/pull/2371) ## 6.12.0 From 908cc6d4b6bd22bd46ef7827e59f3b46de37780d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Oct 2023 20:02:15 +0000 Subject: [PATCH 090/845] Bump the xunit group with 1 update Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify). - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/commits/22.1.2) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 5242e739c5..6cbf0c64d1 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From e9c7f3750276579c1277f2677d12baf02d7ac601 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Oct 2023 19:50:37 +0000 Subject: [PATCH 091/845] Bump the xunit group with 1 update Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify). - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/22.1.2...22.1.3) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 6cbf0c64d1..83ad3af6a3 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 3f250d8af84604ae6fc596a81da5265cccc7d35c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:12:43 +0000 Subject: [PATCH 092/845] Bump Meziantou.Analyzer from 2.0.92 to 2.0.93 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.92 to 2.0.93. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.92...2.0.93) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 68ee5980e7..2b366c7e69 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 1ff6be642b82f3db00f7d9bb5b01e788990b9f4f Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 11 Oct 2023 17:30:45 +0200 Subject: [PATCH 093/845] Use targeted methods instead of LINQ --- Src/FluentAssertions/Common/TypeExtensions.cs | 4 +--- Src/FluentAssertions/Types/TypeAssertions.cs | 4 ++-- .../Types/TypeAssertionSpecs.Implement.cs | 24 +++++++++++++++++++ 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Src/FluentAssertions/Common/TypeExtensions.cs b/Src/FluentAssertions/Common/TypeExtensions.cs index 2fbcbcd41c..a84af752ad 100644 --- a/Src/FluentAssertions/Common/TypeExtensions.cs +++ b/Src/FluentAssertions/Common/TypeExtensions.cs @@ -351,9 +351,7 @@ private static bool IsImplementationOfOpenGeneric(this Type type, Type definitio // check subject's interfaces against definition return type.GetInterfaces() - .Where(i => i.IsGenericType) - .Select(i => i.GetGenericTypeDefinition()) - .Contains(definition); + .Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == definition); } public static bool IsDerivedFromOpenGeneric(this Type type, Type definition) diff --git a/Src/FluentAssertions/Types/TypeAssertions.cs b/Src/FluentAssertions/Types/TypeAssertions.cs index 2c8c577072..7f4f52aa10 100644 --- a/Src/FluentAssertions/Types/TypeAssertions.cs +++ b/Src/FluentAssertions/Types/TypeAssertions.cs @@ -462,7 +462,7 @@ public AndConstraint Implement(Type interfaceType, string becaus { Guard.ThrowIfArgumentIsNull(interfaceType); - bool containsInterface = Subject.GetInterfaces().Contains(interfaceType); + bool containsInterface = interfaceType.IsAssignableFrom(Subject) && interfaceType != Subject; Execute.Assertion .BecauseOf(because, becauseArgs) @@ -511,7 +511,7 @@ public AndConstraint NotImplement(Type interfaceType, string bec { Guard.ThrowIfArgumentIsNull(interfaceType); - bool containsInterface = Subject.GetInterfaces().Contains(interfaceType); + bool containsInterface = interfaceType.IsAssignableFrom(Subject) && interfaceType != Subject; Execute.Assertion .BecauseOf(because, becauseArgs) diff --git a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.Implement.cs b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.Implement.cs index 14161430a7..a53e61e0ea 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.Implement.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.Implement.cs @@ -73,6 +73,20 @@ public void When_asserting_a_type_to_implement_null_it_should_throw() act.Should().ThrowExactly() .WithParameterName("interfaceType"); } + + [Fact] + public void An_interface_does_not_implement_itself() + { + // Arrange + var type = typeof(IDummyInterface); + + // Act + Action act = () => + type.Should().Implement(typeof(IDummyInterface)); + + // Assert + act.Should().Throw(); + } } public class ImplementOfT @@ -156,6 +170,16 @@ public void When_asserting_a_type_not_to_implement_null_it_should_throw() act.Should().ThrowExactly() .WithParameterName("interfaceType"); } + + [Fact] + public void An_interface_does_not_implement_itself() + { + // Arrange + var type = typeof(IDummyInterface); + + // Act / Assert + type.Should().NotImplement(typeof(IDummyInterface)); + } } public class NotImplementOfT From dcd8f2a14e52cb1493403be968887289ffb407e5 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Sat, 14 Oct 2023 09:10:30 +0200 Subject: [PATCH 094/845] Handle comparing an `IDictionary` subject with an `IDictionary<,>` expectation (#2358) * Handle non-generic `dictionary` subject when compared with a generic `dictionary` expectation * Add release notes Co-authored-by: Jonas Nyrup --------- Co-authored-by: Jonas Nyrup --- .../Steps/GenericDictionaryEquivalencyStep.cs | 55 +++++-- .../DictionarySpecs.cs | 139 ++++++++++++++++++ docs/_pages/releases.md | 1 + 3 files changed, 179 insertions(+), 16 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs index cbbf9ec3d9..bffb1ec68b 100644 --- a/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs @@ -1,5 +1,7 @@ using System; +using System.Collections; using System.Collections.Generic; +using System.Linq; using System.Reflection; using FluentAssertions.Execution; @@ -17,32 +19,53 @@ public class GenericDictionaryEquivalencyStep : IEquivalencyStep public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, IEquivalencyValidator nestedValidator) { - if (comparands.Expectation != null) + if (comparands.Expectation is null) { - Type expectationType = comparands.GetExpectedType(context.Options); - if (DictionaryInterfaceInfo.FindFrom(expectationType, "expectation") is { } expectedDictionary) - { - if (AssertSubjectIsNotNull(comparands.Subject) - && EnsureSubjectIsDictionary(comparands, expectedDictionary) is { } actualDictionary) - { - AssertDictionaryEquivalence(comparands, context, nestedValidator, actualDictionary, expectedDictionary); - } + return EquivalencyResult.ContinueWithNext; + } - return EquivalencyResult.AssertionCompleted; - } + Type expectationType = comparands.GetExpectedType(context.Options); + + if (DictionaryInterfaceInfo.FindFrom(expectationType, "expectation") is not { } expectedDictionary) + { + return EquivalencyResult.ContinueWithNext; + } + + if (IsNonGenericDictionary(comparands.Subject)) + { + // Because we handle non-generic dictionaries later + return EquivalencyResult.ContinueWithNext; + } + + if (IsNotNull(comparands.Subject) + && EnsureSubjectIsOfTheExpectedDictionaryType(comparands, expectedDictionary) is { } actualDictionary) + { + AssertDictionaryEquivalence(comparands, context, nestedValidator, actualDictionary, expectedDictionary); + } + + return EquivalencyResult.AssertionCompleted; + } + + private static bool IsNonGenericDictionary(object subject) + { + if (subject is not IDictionary) + { + return false; } - return EquivalencyResult.ContinueWithNext; + return !subject.GetType().GetInterfaces() + .Any(@interface => @interface.IsGenericType + && @interface.GetGenericTypeDefinition() == typeof(IDictionary<,>)); } - private static bool AssertSubjectIsNotNull(object subject) + private static bool IsNotNull(object subject) { return AssertionScope.Current .ForCondition(subject is not null) .FailWith("Expected {context:Subject} not to be {0}{reason}.", new object[] { null }); } - private static DictionaryInterfaceInfo EnsureSubjectIsDictionary(Comparands comparands, + private static DictionaryInterfaceInfo EnsureSubjectIsOfTheExpectedDictionaryType(Comparands comparands, DictionaryInterfaceInfo expectedDictionary) { var actualDictionary = DictionaryInterfaceInfo.FindFromWithKey(comparands.Subject.GetType(), "subject", @@ -57,8 +80,8 @@ private static DictionaryInterfaceInfo EnsureSubjectIsDictionary(Comparands comp if (actualDictionary is null) { AssertionScope.Current.FailWith( - $"Expected {{context:subject}} to be a dictionary or collection of key-value pairs that is keyed to type {expectedDictionary.Key}. " + - $"It implements {actualDictionary}."); + "Expected {context:subject} to be a dictionary or collection of key-value pairs that is keyed to " + + $"type {expectedDictionary.Key}."); } return actualDictionary; diff --git a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs index ac46be1931..b2330eb16e 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Collections.Specialized; using System.Globalization; using System.Linq; using FluentAssertions.Equivalency.Tracing; @@ -1188,4 +1189,142 @@ public void Passing_the_reason_to_the_inner_equivalency_assertion_works() act.Should().Throw().WithMessage("*FOO BAR*"); } + + [Fact] + public void A_non_generic_subject_can_be_compared_with_a_generic_expectation() + { + var subject = new ListDictionary + { + ["id"] = 22, + ["CustomerId"] = 33 + }; + + var expected = new Dictionary + { + ["id"] = 22, + ["CustomerId"] = 33 + }; + + subject.Should().BeEquivalentTo(expected); + } + + [Fact] + public void A_non_generic_subject_which_is_null_can_be_compared_with_a_generic_expectation() + { + var subject = (ListDictionary)null; + + var expected = new Dictionary + { + ["id"] = 22, + ["CustomerId"] = 33 + }; + + Action act = () => subject.Should().BeEquivalentTo(expected); + + act.Should().Throw().WithMessage("**"); + } + + [Fact] + public void Excluding_nested_objects_when_dictionary_is_equivalent() + { + var subject = new Dictionary + { + ["id"] = 22, + ["CustomerId"] = 33 + }; + + var expected = new Dictionary + { + ["id"] = 22, + ["CustomerId"] = 33 + }; + + subject.Should().BeEquivalentTo(expected, opt => opt.ExcludingNestedObjects()); + } + + [Fact] + public void Custom_types_which_implementing_dictionaries_pass() + { + var subject = new NonGenericChildDictionary + { + ["id"] = 22, + ["CustomerId"] = 33 + }; + + var expected = new Specs.NonGenericDictionary + { + ["id"] = 22, + ["CustomerId"] = 33 + }; + + subject.Should().BeEquivalentTo(expected); + } + + [Fact] + public void Custom_types_which_implementing_dictionaries_pass_with_swapped_subject_expectation() + { + var subject = new Specs.NonGenericDictionary + { + ["id"] = 22, + ["CustomerId"] = 33 + }; + + var expected = new NonGenericChildDictionary + { + ["id"] = 22, + ["CustomerId"] = 33 + }; + + subject.Should().BeEquivalentTo(expected); + } +} + +internal class NonGenericChildDictionary : Dictionary +{ + public new void Add(string key, int value) + { + base.Add(key, value); + } +} + +internal class NonGenericDictionary : IDictionary +{ + private readonly Dictionary innerDictionary = new(); + + public int this[string key] + { + get => innerDictionary[key]; + set => innerDictionary[key] = value; + } + + public ICollection Keys => innerDictionary.Keys; + + public ICollection Values => innerDictionary.Values; + + public int Count => innerDictionary.Count; + + public bool IsReadOnly => false; + + public void Add(string key, int value) => innerDictionary.Add(key, value); + + public void Add(KeyValuePair item) => innerDictionary.Add(item.Key, item.Value); + + public void Clear() => innerDictionary.Clear(); + + public bool Contains(KeyValuePair item) => innerDictionary.Contains(item); + + public bool ContainsKey(string key) => innerDictionary.ContainsKey(key); + + public void CopyTo(KeyValuePair[] array, int arrayIndex) => + ((ICollection>)innerDictionary).CopyTo(array, arrayIndex); + + public IEnumerator> GetEnumerator() => innerDictionary.GetEnumerator(); + + public bool Remove(string key) => innerDictionary.Remove(key); + + public bool Remove(KeyValuePair item) => innerDictionary.Remove(item.Key); + + public bool TryGetValue(string key, out int value) => innerDictionary.TryGetValue(key, out value); + + IEnumerator IEnumerable.GetEnumerator() => innerDictionary.GetEnumerator(); } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 989ae0e528..ab2ba3cb28 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -19,6 +19,7 @@ sidebar: `BeWithin(...).Before(...)` - [#2312](https://github.com/fluentassertions/fluentassertions/pull/2312) * `BeEquivalentTo` will now find and can map subject properties that are implemented through an explicitly-implemented interface - [#2152](https://github.com/fluentassertions/fluentassertions/pull/2152) * Fixed that the `because` and `becauseArgs` were not passed down the equivalency tree - [#2318](https://github.com/fluentassertions/fluentassertions/pull/2318) +* `BeEquivalentTo` can again compare a non-generic `IDictionary` with a generic one - [#2358](https://github.com/fluentassertions/fluentassertions/pull/23158) ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) From d01480dda8abcf0a5e264a3a141671dbcfade170 Mon Sep 17 00:00:00 2001 From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> Date: Sat, 14 Oct 2023 09:36:44 +0200 Subject: [PATCH 095/845] Switch to preferred syntax style (#2384) --- .../Equivalency/Steps/GenericDictionaryEquivalencyStep.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs index bffb1ec68b..a0ad4d364c 100644 --- a/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs @@ -53,9 +53,8 @@ private static bool IsNonGenericDictionary(object subject) return false; } - return !subject.GetType().GetInterfaces() - .Any(@interface => @interface.IsGenericType - && @interface.GetGenericTypeDefinition() == typeof(IDictionary<,>)); + return !subject.GetType().GetInterfaces().Any(@interface => + @interface.IsGenericType && @interface.GetGenericTypeDefinition() == typeof(IDictionary<,>)); } private static bool IsNotNull(object subject) From 17a3dc067b47d3e5890bc908107518835dd55f73 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 14 Oct 2023 10:00:20 +0200 Subject: [PATCH 096/845] Bump cspell from 7.3.7 to 7.3.8 (#2383) Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 7.3.7 to 7.3.8. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/compare/v7.3.7...v7.3.8) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 334 +++++++++++++++++++++++++-------------------------- 2 files changed, 168 insertions(+), 168 deletions(-) diff --git a/package.json b/package.json index a21e7d5988..5694b22a56 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^7.3.7" + "cspell": "^7.3.8" } } diff --git a/yarn.lock b/yarn.lock index 5aa575b44c..929d7c6a2c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,19 +23,19 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@cspell/cspell-bundled-dicts@7.3.7": - version "7.3.7" - resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-7.3.7.tgz#32a67ba983ee0bd247834006ed9cc99be9334649" - integrity sha512-Mw7J0RAWGpEup/+eIePw3wi+OlMGNicrD1r9OhdgIgO6sHEi01ibS/RzNNbC7UziLaYEHi8+WfLyGzmp1ZISrQ== +"@cspell/cspell-bundled-dicts@7.3.8": + version "7.3.8" + resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-7.3.8.tgz#2d170f0c680555ebc8cfb3cebd764496cb9707bc" + integrity sha512-Dj8iSGQyfgIsCjmXk9D/SjV7EpbpQSogeaGcBM66H33pd0GyGmLhn3biRN+vqi/vqWmsp75rT3kd5MKa8X5W9Q== dependencies: "@cspell/dict-ada" "^4.0.2" "@cspell/dict-aws" "^4.0.0" "@cspell/dict-bash" "^4.1.2" - "@cspell/dict-companies" "^3.0.24" - "@cspell/dict-cpp" "^5.0.5" + "@cspell/dict-companies" "^3.0.26" + "@cspell/dict-cpp" "^5.0.8" "@cspell/dict-cryptocurrencies" "^4.0.0" "@cspell/dict-csharp" "^4.0.2" - "@cspell/dict-css" "^4.0.10" + "@cspell/dict-css" "^4.0.12" "@cspell/dict-dart" "^2.0.3" "@cspell/dict-django" "^4.1.0" "@cspell/dict-docker" "^1.1.7" @@ -43,7 +43,7 @@ "@cspell/dict-elixir" "^4.0.3" "@cspell/dict-en-common-misspellings" "^1.0.2" "@cspell/dict-en-gb" "1.1.33" - "@cspell/dict-en_us" "^4.3.8" + "@cspell/dict-en_us" "^4.3.9" "@cspell/dict-filetypes" "^3.0.1" "@cspell/dict-fonts" "^4.0.0" "@cspell/dict-fsharp" "^1.0.0" @@ -58,52 +58,52 @@ "@cspell/dict-k8s" "^1.0.1" "@cspell/dict-latex" "^4.0.0" "@cspell/dict-lorem-ipsum" "^4.0.0" - "@cspell/dict-lua" "^4.0.1" + "@cspell/dict-lua" "^4.0.2" "@cspell/dict-node" "^4.0.3" - "@cspell/dict-npm" "^5.0.10" + "@cspell/dict-npm" "^5.0.12" "@cspell/dict-php" "^4.0.3" "@cspell/dict-powershell" "^5.0.2" - "@cspell/dict-public-licenses" "^2.0.4" + "@cspell/dict-public-licenses" "^2.0.5" "@cspell/dict-python" "^4.1.9" "@cspell/dict-r" "^2.0.1" - "@cspell/dict-ruby" "^5.0.0" + "@cspell/dict-ruby" "^5.0.1" "@cspell/dict-rust" "^4.0.1" "@cspell/dict-scala" "^5.0.0" - "@cspell/dict-software-terms" "^3.3.2" - "@cspell/dict-sql" "^2.1.1" + "@cspell/dict-software-terms" "^3.3.6" + "@cspell/dict-sql" "^2.1.2" "@cspell/dict-svelte" "^1.0.2" "@cspell/dict-swift" "^2.0.1" "@cspell/dict-typescript" "^3.1.2" "@cspell/dict-vue" "^3.0.0" -"@cspell/cspell-json-reporter@7.3.7": - version "7.3.7" - resolved "https://registry.yarnpkg.com/@cspell/cspell-json-reporter/-/cspell-json-reporter-7.3.7.tgz#ef7a7b316717041873d73c2dde8fdb926670aff8" - integrity sha512-bogUQKKZWLttZtxFKjpzHuliIha/ByV2km18gm8dA2uB3IrzD1UJy4sCE8lnaodm6n3VtjnViSkQ5XIVU3gAKQ== +"@cspell/cspell-json-reporter@7.3.8": + version "7.3.8" + resolved "https://registry.yarnpkg.com/@cspell/cspell-json-reporter/-/cspell-json-reporter-7.3.8.tgz#517245b15f862794706d21bbc40b59d25ae2092b" + integrity sha512-FxYJWtDgxIQYxdP0RWwRV8nzLfxVx8D8D5L2sbbP/0NFczDbq/zWYep4nSAHJT10aUJrogsVUYwNwdkr562wKA== dependencies: - "@cspell/cspell-types" "7.3.7" + "@cspell/cspell-types" "7.3.8" -"@cspell/cspell-pipe@7.3.7": - version "7.3.7" - resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-7.3.7.tgz#aaad8b3deb864afa6c40a2279c4220d3d16fdb82" - integrity sha512-ZO8v3EwGhjUvhPo1S48+CKv7EPXMoYF7LGERB34K8EXFByb9+J74ojMYj9UgLRV68lFTrDFde3bHoZPPVS1FsA== +"@cspell/cspell-pipe@7.3.8": + version "7.3.8" + resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-7.3.8.tgz#4a8053764d9012125632a11f5a572227b6971b8c" + integrity sha512-/vKPfiHM5bJUkNX12w9j533Lm2JvvSMKUCChM2AxYjy6vL8prc/7ei++4g2xAWwRxLZPg2OfpDJS5EirZNBJdA== -"@cspell/cspell-resolver@7.3.7": - version "7.3.7" - resolved "https://registry.yarnpkg.com/@cspell/cspell-resolver/-/cspell-resolver-7.3.7.tgz#2eb64b2fedbb10ae5034ed7968d13e82f5748884" - integrity sha512-WWZcTI5f2cCjr1yRDTMkcVg7Meil3s+0aaKcLCDTGQf9J2UWWjpqDJ6M6keYei3paAjxW2Pk03IRNNwdA3+igQ== +"@cspell/cspell-resolver@7.3.8": + version "7.3.8" + resolved "https://registry.yarnpkg.com/@cspell/cspell-resolver/-/cspell-resolver-7.3.8.tgz#13e026e9f1315956c498fa119a93aece619f9a48" + integrity sha512-CeyQmhqZI5a+T7a6oiVN90TFlzU3qVVYqCaZ9grFrVOsmzY9ipH5gmqfgMavaBOqb0di/+VZS8d02suMOXcKLQ== dependencies: global-dirs "^3.0.1" -"@cspell/cspell-service-bus@7.3.7": - version "7.3.7" - resolved "https://registry.yarnpkg.com/@cspell/cspell-service-bus/-/cspell-service-bus-7.3.7.tgz#571dcb1de0ffa2ba5d03facafe3d1feeb6639580" - integrity sha512-pnDOFpjht7dZYydMygcf0brCSk5BGRvbeWRH6MaMhd+3CdyzyEvtZG3IbBQVNyVvDTA2c/K3rljOAo8y3/lpnw== +"@cspell/cspell-service-bus@7.3.8": + version "7.3.8" + resolved "https://registry.yarnpkg.com/@cspell/cspell-service-bus/-/cspell-service-bus-7.3.8.tgz#93326a7e775da7f609052de56649438e1995ec16" + integrity sha512-3E7gwY6QILrZH83p69i9CERbRBEqeBiKCIKnAd7U2PbxfFqG/P47fqpnarzSWFwFpU92oyGsYry+wC8TEGISRQ== -"@cspell/cspell-types@7.3.7": - version "7.3.7" - resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-7.3.7.tgz#d27afdf1654e7a23b04ecbae1797ae7245fa5a1c" - integrity sha512-zM2BuZJ3UUgPwF78bssggi8X20nmW3a95EmbNJKfbO6Zf2ui7UMzeP3BwpCZk30A/EixGlFhLf6Xd+eBT/DQqw== +"@cspell/cspell-types@7.3.8": + version "7.3.8" + resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-7.3.8.tgz#6d6b5633ee3f3f46ef78da8adee056d48402ae10" + integrity sha512-hsOtaULDnawEL4pU0fga941GhvE8mbTbywrJBx+eGX3fnJsaUr8XQzCtnLsW2ko7WCLWFItNEhSSTPQHBFRLsw== "@cspell/dict-ada@^4.0.2": version "4.0.2" @@ -120,15 +120,15 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-bash/-/dict-bash-4.1.2.tgz#47696a13f6294c310801b811e75fc62e6151d28c" integrity sha512-AEBWjbaMaJEyAjOHW0F15P2izBjli2cNerG3NjuVH7xX/HUUeNoTj8FF1nwpMufKwGQCvuyO2hCmkVxhJ0y55Q== -"@cspell/dict-companies@^3.0.24": - version "3.0.24" - resolved "https://registry.yarnpkg.com/@cspell/dict-companies/-/dict-companies-3.0.24.tgz#632e5cff88b0ff25cfe64c69933c5b7c665c47fb" - integrity sha512-zn9QN99yIvhpGl6fZwt0mvHYcsV2w6XDdK2XWA86A0s9A94U1LCCUsvA4wijUclbZEj9ewsNMlidHcV/D329eQ== +"@cspell/dict-companies@^3.0.26": + version "3.0.26" + resolved "https://registry.yarnpkg.com/@cspell/dict-companies/-/dict-companies-3.0.26.tgz#bb6ac17fb6fee0e1d3f5614175a1db40660c444b" + integrity sha512-BGRZ/Uykx+IgQoTGqvRqbBMQy7QSuY0pbTHgtmKtc1scgzZMJQKMDwyuE6LJzlhdlrV7TsVY0lyXREybnDpQPQ== -"@cspell/dict-cpp@^5.0.5": - version "5.0.5" - resolved "https://registry.yarnpkg.com/@cspell/dict-cpp/-/dict-cpp-5.0.5.tgz#b544edd0d06c55f45959d5f9c1518640ac64319f" - integrity sha512-ojCpQ4z+sHHLJYfvA3SApqQ1BjO/k3TUdDgqR3sVhFl5qjT9yz1/srBNzqCaBBSz/fiO5A8NKdSA9+IFrUHcig== +"@cspell/dict-cpp@^5.0.8": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@cspell/dict-cpp/-/dict-cpp-5.0.8.tgz#e3e6608a32309f1ac769e5ab08137e628c14774f" + integrity sha512-QZ1k3jsGmoP2mfECWp1h9q26KiNA3yxWWkt4GtNGAoqNVUrID93E8RGk2vWR/KNgCu8X15mD3TuYUfQxT72aRw== "@cspell/dict-cryptocurrencies@^4.0.0": version "4.0.0" @@ -140,10 +140,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-csharp/-/dict-csharp-4.0.2.tgz#e55659dbe594e744d86b1baf0f3397fe57b1e283" integrity sha512-1JMofhLK+4p4KairF75D3A924m5ERMgd1GvzhwK2geuYgd2ZKuGW72gvXpIV7aGf52E3Uu1kDXxxGAiZ5uVG7g== -"@cspell/dict-css@^4.0.10": - version "4.0.10" - resolved "https://registry.yarnpkg.com/@cspell/dict-css/-/dict-css-4.0.10.tgz#3e89b60a3897b115518cdbe628dc52176273c5c0" - integrity sha512-3W5rBoOJQDs3pty0TxRd2xDolTYaOk7rdsWVv3rs8YpyyHNEJIfI/zXGjYECmCAmZiUVvCnorNawUSComOo5uQ== +"@cspell/dict-css@^4.0.12": + version "4.0.12" + resolved "https://registry.yarnpkg.com/@cspell/dict-css/-/dict-css-4.0.12.tgz#59abf3512ae729835c933c38f64a3d8a5f09ce3d" + integrity sha512-vGBgPM92MkHQF5/2jsWcnaahOZ+C6OE/fPvd5ScBP72oFY9tn5GLuomcyO0z8vWCr2e0nUSX1OGimPtcQAlvSw== "@cspell/dict-dart@^2.0.3": version "2.0.3" @@ -185,10 +185,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz#7f1fd90fc364a5cb77111b5438fc9fcf9cc6da0e" integrity sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g== -"@cspell/dict-en_us@^4.3.8": - version "4.3.8" - resolved "https://registry.yarnpkg.com/@cspell/dict-en_us/-/dict-en_us-4.3.8.tgz#79f0d93827c6bc8f6d9c5b9dcbf5fd7b8aec42ee" - integrity sha512-rCPsbDHuRnFUbzWAY6O1H9+cLZt5FNQwjPVw2TdQZfipdb0lim984aLGY+nupi1iKC3lfjyd5SVUgmSZEG1QNA== +"@cspell/dict-en_us@^4.3.9": + version "4.3.9" + resolved "https://registry.yarnpkg.com/@cspell/dict-en_us/-/dict-en_us-4.3.9.tgz#580e697ec9d7cca63f094b5f8907fbfe7a85a8f5" + integrity sha512-7cSTSxokwkQXJdh9ZkPy3Vih/GheSEVFzN0R/1Ak1inHOWCRNSWQCdMqd6DCmfyVgzCk6fDGS+8Uphe/5JTBZQ== "@cspell/dict-filetypes@^3.0.1": version "3.0.1" @@ -260,20 +260,20 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.0.tgz#2793a5dbfde474a546b0caecc40c38fdf076306e" integrity sha512-1l3yjfNvMzZPibW8A7mQU4kTozwVZVw0AvFEdy+NcqtbxH+TvbSkNMqROOFWrkD2PjnKG0+Ea0tHI2Pi6Gchnw== -"@cspell/dict-lua@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-lua/-/dict-lua-4.0.1.tgz#4c31975646cb2d71f1216c7aeaa0c5ab6994ea25" - integrity sha512-j0MFmeCouSoC6EdZTbvGe1sJ9V+ruwKSeF+zRkNNNload7R72Co5kX1haW2xLHGdlq0kqSy1ODRZKdVl0e+7hg== +"@cspell/dict-lua@^4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@cspell/dict-lua/-/dict-lua-4.0.2.tgz#74f080296f94eda4e65f79d14be00cb0f8fdcb22" + integrity sha512-eeC20Q+UnHcTVBK6pgwhSjGIVugO2XqU7hv4ZfXp2F9DxGx1RME0+1sKX4qAGhdFGwOBsEzb2fwUsAEP6Mibpg== "@cspell/dict-node@^4.0.3": version "4.0.3" resolved "https://registry.yarnpkg.com/@cspell/dict-node/-/dict-node-4.0.3.tgz#5ae0222d72871e82978049f8e11ea627ca42fca3" integrity sha512-sFlUNI5kOogy49KtPg8SMQYirDGIAoKBO3+cDLIwD4MLdsWy1q0upc7pzGht3mrjuyMiPRUV14Bb0rkVLrxOhg== -"@cspell/dict-npm@^5.0.10": - version "5.0.10" - resolved "https://registry.yarnpkg.com/@cspell/dict-npm/-/dict-npm-5.0.10.tgz#6171a8f7b84db05c8bc55f7fb7a430714221ec25" - integrity sha512-idwEgqP6Rgxr6W9UFCfS4E8gIpM1cwEz24+VOnMc/0hFztu9MTtAu8wkdKcBuHG2mQuplqbLLcL0e1cy68ecOQ== +"@cspell/dict-npm@^5.0.12": + version "5.0.12" + resolved "https://registry.yarnpkg.com/@cspell/dict-npm/-/dict-npm-5.0.12.tgz#dc752a4a22875c3835910266398d70c732648610" + integrity sha512-T/+WeQmtbxo7ad6hrdI8URptYstKJP+kXyWJZfuVJJGWJQ7yubxrI5Z5AfM+Dh/ff4xHmdzapxD9adaEQ727uw== "@cspell/dict-php@^4.0.3": version "4.0.3" @@ -285,10 +285,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-powershell/-/dict-powershell-5.0.2.tgz#2b1d7d514354b6d7de405d5faaef30f8eca0ef09" integrity sha512-IHfWLme3FXE7vnOmMncSBxOsMTdNWd1Vcyhag03WS8oANSgX8IZ+4lMI00mF0ptlgchf16/OU8WsV4pZfikEFw== -"@cspell/dict-public-licenses@^2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.4.tgz#70468e37ca5b0096e5f31db32b0e07e46de48bcb" - integrity sha512-KjsfuGwMWvPkp6s0nR+s4mZc9SQhh1tHDOyQZfEVRwi+2ev7f8l7R6ts9sP2Mplb8UcxwO6YmKwxHjN+XHoMoA== +"@cspell/dict-public-licenses@^2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.5.tgz#86948b29bd36184943955eaa80bf594488c4dd8a" + integrity sha512-91HK4dSRri/HqzAypHgduRMarJAleOX5NugoI8SjDLPzWYkwZ1ftuCXSk+fy8DLc3wK7iOaFcZAvbjmnLhVs4A== "@cspell/dict-python@^4.1.9": version "4.1.9" @@ -302,10 +302,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-r/-/dict-r-2.0.1.tgz#73474fb7cce45deb9094ebf61083fbf5913f440a" integrity sha512-KCmKaeYMLm2Ip79mlYPc8p+B2uzwBp4KMkzeLd5E6jUlCL93Y5Nvq68wV5fRLDRTf7N1LvofkVFWfDcednFOgA== -"@cspell/dict-ruby@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-ruby/-/dict-ruby-5.0.0.tgz#ca22ddf0842f29b485e3ef585c666c6be5227e6d" - integrity sha512-ssb96QxLZ76yPqFrikWxItnCbUKhYXJ2owkoIYzUGNFl2CHSoHCb5a6Zetum9mQ/oUA3gNeUhd28ZUlXs0la2A== +"@cspell/dict-ruby@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@cspell/dict-ruby/-/dict-ruby-5.0.1.tgz#a59df952d66781d811e7aac9208c145680e8cdf9" + integrity sha512-rruTm7Emhty/BSYavSm8ZxRuVw0OBqzJkwIFXcV0cX7To8D1qbmS9HFHRuRg8IL11+/nJvtdDz+lMFBSmPUagQ== "@cspell/dict-rust@^4.0.1": version "4.0.1" @@ -317,15 +317,15 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-scala/-/dict-scala-5.0.0.tgz#b64365ad559110a36d44ccd90edf7151ea648022" integrity sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ== -"@cspell/dict-software-terms@^3.3.2": - version "3.3.2" - resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-3.3.2.tgz#badd182fadffabb161404ee7909de43146558375" - integrity sha512-OLyBo9IBB2w8m98OI75npY+Q3tdUdhtarXTj+fKKlwP7I2lXZcphNO3v1WxZvkpQF9z+39bWud4VvFozIdLMcg== +"@cspell/dict-software-terms@^3.3.6": + version "3.3.6" + resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-3.3.6.tgz#8ed7899b185dbb99e6b6c3154df53c982ff81fb7" + integrity sha512-nr2UPjyDq+4NEQ4V//VL8L3EumL1FylpuRcwiWSUdZdh3b1nh4TV9aEYYUXdgHFxd8qXU2YJ9Kj2hmq0mS/lWQ== -"@cspell/dict-sql@^2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-sql/-/dict-sql-2.1.1.tgz#eb16c8bece4ff3154a193fe854a600ed0f75c64c" - integrity sha512-v1mswi9NF40+UDUMuI148YQPEQvWjac72P6ZsjlRdLjEiQEEMEsTQ+zlkIdnzC9QCNyJaqD5Liq9Mn78/8Zxtw== +"@cspell/dict-sql@^2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@cspell/dict-sql/-/dict-sql-2.1.2.tgz#80492b887e7986dd8bc39a9c5ea513ede2b17cb1" + integrity sha512-Pi0hAcvsSGtZZeyyAN1VfGtQJbrXos5x2QjJU0niAQKhmITSOrXU/1II1Gogk+FYDjWyV9wP2De0U2f7EWs6oQ== "@cspell/dict-svelte@^1.0.2": version "1.0.2" @@ -347,17 +347,17 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-vue/-/dict-vue-3.0.0.tgz#68ccb432ad93fcb0fd665352d075ae9a64ea9250" integrity sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A== -"@cspell/dynamic-import@7.3.7": - version "7.3.7" - resolved "https://registry.yarnpkg.com/@cspell/dynamic-import/-/dynamic-import-7.3.7.tgz#84c2e02e74bd8669a3256d416772da25128c41cc" - integrity sha512-ac52OLDMYBHkRQ8XzihOWnyfqri3M84ELTZdqBhR5YGcHW/mxKhsmXqudA980SdRRKaicD39yhX4idAFb4AsDg== +"@cspell/dynamic-import@7.3.8": + version "7.3.8" + resolved "https://registry.yarnpkg.com/@cspell/dynamic-import/-/dynamic-import-7.3.8.tgz#677ce11983780d4e88d00552eac685181ae3c989" + integrity sha512-s8x7dH/ScfW0pFEIvNFo4JOR7YmvM2wZSHOykmWTJCQ8k2EQ/+uECPp6ZxkoJoukTz8sj+3KzF0fRl5mKxPd6g== dependencies: import-meta-resolve "^3.0.0" -"@cspell/strong-weak-map@7.3.7": - version "7.3.7" - resolved "https://registry.yarnpkg.com/@cspell/strong-weak-map/-/strong-weak-map-7.3.7.tgz#4ad2aba20af2bc2d63434b1cfe24017e9050765b" - integrity sha512-n+jRgwH0wU+HsfqgCGVzPmWnZl4SyhtvPxusKwXj6L/STGdt8IP2rYl1PFOtyvgjPjh8xXe/jRrq7zH07btiKA== +"@cspell/strong-weak-map@7.3.8": + version "7.3.8" + resolved "https://registry.yarnpkg.com/@cspell/strong-weak-map/-/strong-weak-map-7.3.8.tgz#8505ed746ac7c6a324b3cc28cd3f9e130a8ec61c" + integrity sha512-qNnt2wG45wb8JP54mENarnQgxfSYKPp3zlYID/2przbMNmVJRqUlcIBOdLI6plCgGeNkzJTl3T9T1ATbnN+LLw== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -468,10 +468,10 @@ color-name@1.1.3: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== -commander@^11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-11.0.0.tgz#43e19c25dbedc8256203538e8d7e9346877a6f67" - integrity sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ== +commander@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-11.1.0.tgz#62fdce76006a68e5c1ab3314dc92e800eb83d906" + integrity sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ== comment-json@^4.2.3: version "4.2.3" @@ -522,108 +522,108 @@ crypto-random-string@^4.0.0: dependencies: type-fest "^1.0.1" -cspell-dictionary@7.3.7: - version "7.3.7" - resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-7.3.7.tgz#cce1f04290822368ec27b878e46e6f1419ae09a2" - integrity sha512-mJ0h2BGxYEqb/1FxKD50WuufKhDaCaIk8pwZQryqazXQCvoTpla0yud3KO61Cke92za8z37Rfb+5xATlywEfaw== +cspell-dictionary@7.3.8: + version "7.3.8" + resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-7.3.8.tgz#ed9ef0626c11a467884e05fd99e802310f35c4ba" + integrity sha512-gkq4t78eLR0xC3P0vDDHPeNY4iZRd5YE6Z8uDJ7RM4UaX/TSdVUN9KNFr34RnJ119NYVHujpL9+uW7wPSAe8Eg== dependencies: - "@cspell/cspell-pipe" "7.3.7" - "@cspell/cspell-types" "7.3.7" - cspell-trie-lib "7.3.7" + "@cspell/cspell-pipe" "7.3.8" + "@cspell/cspell-types" "7.3.8" + cspell-trie-lib "7.3.8" fast-equals "^4.0.3" gensequence "^6.0.0" -cspell-gitignore@7.3.7: - version "7.3.7" - resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-7.3.7.tgz#8907a36b96e57d80a9b447b25bf8c8c20fd798f9" - integrity sha512-nP4Gg+zq5y0njzhiNYTLvaJIMAponBhJoTMzkXCOOKYEHJmiRQocfa3gO4t2s8iZ4YVhscbrB2h+dYvo3MLQqg== +cspell-gitignore@7.3.8: + version "7.3.8" + resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-7.3.8.tgz#5fffc53daa0d27965f044ab3d0819d731ac2c219" + integrity sha512-vJzCOUEiw6/MwV/U4Ux3bgSdj9mXB+X5eHL+qzVoyFI7ArlvrkuGTL+iFJThQcS8McM3SGqtvaBNCiKBmAeCkA== dependencies: - cspell-glob "7.3.7" + cspell-glob "7.3.8" find-up "^5.0.0" -cspell-glob@7.3.7: - version "7.3.7" - resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-7.3.7.tgz#2c6559386c9760ed90330ac23b8371912d8219aa" - integrity sha512-DJX5wJ5dhcNzyycukZst+WtbIdpCLTL7DaKS0EKW/57QjzMwwMBgpsF89ufnreGHB8dHrPF85epF9qyOI1SRNg== +cspell-glob@7.3.8: + version "7.3.8" + resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-7.3.8.tgz#d774aa82b879d41a56330bf7054ca068dfe33e6b" + integrity sha512-wUZC6znyxEs0wlhzGfZ4XHkATPJyazJIFi/VvAdj+KHe7U8SoSgitJVDQqdgectI2y3MxR7lQdVLX9dONFh+7A== dependencies: micromatch "^4.0.5" -cspell-grammar@7.3.7: - version "7.3.7" - resolved "https://registry.yarnpkg.com/cspell-grammar/-/cspell-grammar-7.3.7.tgz#85a34e1f21381c54e8d86904533f2d7f908fa710" - integrity sha512-4cyJ4Alq/wBGTctH7fNTbY9EZCihm11fbrGSYVe8w+msRNx6W8rugsMX009aHiw9zlvGrMAeTD08YFPnBVdfpA== +cspell-grammar@7.3.8: + version "7.3.8" + resolved "https://registry.yarnpkg.com/cspell-grammar/-/cspell-grammar-7.3.8.tgz#3411f1ba50744474b25e81b42a3846839be577cf" + integrity sha512-nTjAlMAZAVSFhBd9U3MB9l5FfC5JCCr9DTOA2wWxusVOm+36MbSEH90ucLPkhPa9/+0HtbpDhqVMwXCZllRpsg== dependencies: - "@cspell/cspell-pipe" "7.3.7" - "@cspell/cspell-types" "7.3.7" + "@cspell/cspell-pipe" "7.3.8" + "@cspell/cspell-types" "7.3.8" -cspell-io@7.3.7: - version "7.3.7" - resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-7.3.7.tgz#0e97d33b90da473efe8196b8af6a1f3a5c42af24" - integrity sha512-zqGGllG/OM3Of7zaOELdrSoBpCyG9nJuSRCzLfKgnCG4g2zpoMfDZknJaY9VjZODHP99PvYWooF8E6kVxT34Fw== +cspell-io@7.3.8: + version "7.3.8" + resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-7.3.8.tgz#6bd59848a0b1f353b9997f07713c4617d0bddebe" + integrity sha512-XrxPbaiek7EZh+26k9RYVz2wKclaMqM6mXBiu/kpFAHRHHfz91ado6xWvyxZ7UAxQ8ixEwZ+oz9TU+k21gHzyw== dependencies: - "@cspell/cspell-service-bus" "7.3.7" + "@cspell/cspell-service-bus" "7.3.8" node-fetch "^2.7.0" -cspell-lib@7.3.7: - version "7.3.7" - resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-7.3.7.tgz#d31f09c852b51ac0ac7e59ceb358138dc3ee7e78" - integrity sha512-KuFn0WTwmK50Ij1KVaXVuheleSOfv3oFIO3PfMuFg7llkfPfaRawF0b61da/EFGckU/hUc8uHRbBuGELlDo3tA== - dependencies: - "@cspell/cspell-bundled-dicts" "7.3.7" - "@cspell/cspell-pipe" "7.3.7" - "@cspell/cspell-resolver" "7.3.7" - "@cspell/cspell-types" "7.3.7" - "@cspell/dynamic-import" "7.3.7" - "@cspell/strong-weak-map" "7.3.7" +cspell-lib@7.3.8: + version "7.3.8" + resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-7.3.8.tgz#6140cca31b32a89b4847e6d50d6d69948b1f13d2" + integrity sha512-2L770sI5DdsAKVzO3jxmfP2fz4LryW6dzL93BpN7WU+ebFC6rg4ioa5liOJV4WoDo2fNQMSeqfW4Aawu9zWR7A== + dependencies: + "@cspell/cspell-bundled-dicts" "7.3.8" + "@cspell/cspell-pipe" "7.3.8" + "@cspell/cspell-resolver" "7.3.8" + "@cspell/cspell-types" "7.3.8" + "@cspell/dynamic-import" "7.3.8" + "@cspell/strong-weak-map" "7.3.8" clear-module "^4.1.2" comment-json "^4.2.3" configstore "^6.0.0" cosmiconfig "8.0.0" - cspell-dictionary "7.3.7" - cspell-glob "7.3.7" - cspell-grammar "7.3.7" - cspell-io "7.3.7" - cspell-trie-lib "7.3.7" + cspell-dictionary "7.3.8" + cspell-glob "7.3.8" + cspell-grammar "7.3.8" + cspell-io "7.3.8" + cspell-trie-lib "7.3.8" fast-equals "^5.0.1" find-up "^6.3.0" gensequence "^6.0.0" import-fresh "^3.3.0" resolve-from "^5.0.0" vscode-languageserver-textdocument "^1.0.11" - vscode-uri "^3.0.7" + vscode-uri "^3.0.8" -cspell-trie-lib@7.3.7: - version "7.3.7" - resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-7.3.7.tgz#7aabf3c4a34a2e2784dc3173d7d3c4ef88d70538" - integrity sha512-Vv8TdTMZD3DE79SorTwn5NoWj8JD7DnYMeUK+5S6JDNLy4Ck+kTEPN6Ic9hvLAxuDmQjmoZI3TizrWvuCG66aA== +cspell-trie-lib@7.3.8: + version "7.3.8" + resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-7.3.8.tgz#1cbabd9473aa3603ee8a8d2f182d905e3f6c9212" + integrity sha512-UQx1Bazbyz2eQJ/EnMohINnUdZvAQL+OcQU3EPPbNWM1DWF4bJGgmFXKNCRYfJk6wtOZVXG5g5AZXx9KnHeN9A== dependencies: - "@cspell/cspell-pipe" "7.3.7" - "@cspell/cspell-types" "7.3.7" + "@cspell/cspell-pipe" "7.3.8" + "@cspell/cspell-types" "7.3.8" gensequence "^6.0.0" -cspell@^7.3.7: - version "7.3.7" - resolved "https://registry.yarnpkg.com/cspell/-/cspell-7.3.7.tgz#f07eaf2c635036133214c65e8280a375d1be5d0a" - integrity sha512-p23EuTu+7b2qioRxC7sV1TVfxIPm7928BtT4jYBHGeONiYP0EOOWNP8ynaksMYLTifQBzH1Q0LO4L5ogHiQsfw== +cspell@^7.3.8: + version "7.3.8" + resolved "https://registry.yarnpkg.com/cspell/-/cspell-7.3.8.tgz#69b7bca7decaca54b101389c749d3eb53e797d3c" + integrity sha512-8AkqsBQAMsKYV5XyJLB6rBs5hgspL4+MPOg6mBKG2j5EvQgRVc6dIfAPWDNLpIeW2a3+7K5BIWqKHapKPeiknQ== dependencies: - "@cspell/cspell-json-reporter" "7.3.7" - "@cspell/cspell-pipe" "7.3.7" - "@cspell/cspell-types" "7.3.7" - "@cspell/dynamic-import" "7.3.7" + "@cspell/cspell-json-reporter" "7.3.8" + "@cspell/cspell-pipe" "7.3.8" + "@cspell/cspell-types" "7.3.8" + "@cspell/dynamic-import" "7.3.8" chalk "^5.3.0" chalk-template "^1.1.0" - commander "^11.0.0" - cspell-gitignore "7.3.7" - cspell-glob "7.3.7" - cspell-io "7.3.7" - cspell-lib "7.3.7" + commander "^11.1.0" + cspell-gitignore "7.3.8" + cspell-glob "7.3.8" + cspell-io "7.3.8" + cspell-lib "7.3.8" fast-glob "^3.3.1" fast-json-stable-stringify "^2.1.0" - file-entry-cache "^7.0.0" + file-entry-cache "^7.0.1" get-stdin "^9.0.0" semver "^7.5.4" strip-ansi "^7.1.0" - vscode-uri "^3.0.7" + vscode-uri "^3.0.8" dot-prop@^6.0.1: version "6.0.1" @@ -682,12 +682,12 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -file-entry-cache@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-7.0.0.tgz#5bb4aef4f0a7dd2ff95966c6d97256b61504bd0a" - integrity sha512-OWhoO9dvvwspdI7YjGrs5wD7bPggVHc5b1NFAdyd1fEPIeno3Fj70fjBhklAqzUefgX7KCNDBnvrT8rZhS8Shw== +file-entry-cache@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-7.0.1.tgz#c71b3509badb040f362255a53e21f15a4e74fc0f" + integrity sha512-uLfFktPmRetVCbHe5UPuekWrQ6hENufnA46qEGbfACkK5drjTTdQYUragRgMjHldcbYG+nslUerqMPjbBSHXjQ== dependencies: - flat-cache "^3.1.0" + flat-cache "^3.1.1" fill-range@^7.0.1: version "7.0.1" @@ -712,16 +712,16 @@ find-up@^6.3.0: locate-path "^7.1.0" path-exists "^5.0.0" -flat-cache@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.1.0.tgz#0e54ab4a1a60fe87e2946b6b00657f1c99e1af3f" - integrity sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew== +flat-cache@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.1.1.tgz#a02a15fdec25a8f844ff7cc658f03dd99eb4609b" + integrity sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q== dependencies: - flatted "^3.2.7" + flatted "^3.2.9" keyv "^4.5.3" rimraf "^3.0.2" -flatted@^3.2.7: +flatted@^3.2.9: version "3.2.9" resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== @@ -1117,10 +1117,10 @@ vscode-languageserver-textdocument@^1.0.11: resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz#0822a000e7d4dc083312580d7575fe9e3ba2e2bf" integrity sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA== -vscode-uri@^3.0.7: - version "3.0.7" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.7.tgz#6d19fef387ee6b46c479e5fb00870e15e58c1eb8" - integrity sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA== +vscode-uri@^3.0.8: + version "3.0.8" + resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f" + integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw== webidl-conversions@^3.0.0: version "3.0.1" From ed421ecbb4a007d3cb18f34640d2e1d595b5e0a1 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Sat, 14 Oct 2023 13:51:26 +0200 Subject: [PATCH 097/845] Pass `FormattingOptions` to inner `AssertionScope` (#2329) * Pass `FormattingOptions` to inner `AssertionScope` * Add release notes * Simplify the `AssertionOptions.Formatting` test --- .../Execution/AssertionScope.cs | 1 + .../AssertionOptionsSpecs.cs | 1 + .../Execution/AssertionScopeSpecs.cs | 34 +++++++++++++++++++ docs/_pages/releases.md | 2 ++ 4 files changed, 38 insertions(+) diff --git a/Src/FluentAssertions/Execution/AssertionScope.cs b/Src/FluentAssertions/Execution/AssertionScope.cs index fd32cf5918..d8bde7cbf5 100644 --- a/Src/FluentAssertions/Execution/AssertionScope.cs +++ b/Src/FluentAssertions/Execution/AssertionScope.cs @@ -109,6 +109,7 @@ private AssertionScope(IAssertionStrategy assertionStrategy, AssertionScope pare Context = parent.Context; reason = parent.reason; callerIdentityProvider = parent.callerIdentityProvider; + FormattingOptions = parent.FormattingOptions.Clone(); } } diff --git a/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs b/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs index cfbe57f4fc..88869729ee 100644 --- a/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs @@ -6,6 +6,7 @@ using FluentAssertions.Equivalency; using FluentAssertions.Equivalency.Steps; using FluentAssertions.Execution; +using FluentAssertions.Extensions; using FluentAssertions.Formatting; using Xunit; using Xunit.Sdk; diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs index 09f14fad11..93707aa0e4 100644 --- a/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs @@ -252,6 +252,40 @@ public void When_nested_scope_is_disposed_it_passes_reports_to_parent_scope() outerScope.Get("innerReportable").Should().Be("bar"); } + [Fact] + public void Formatting_options_passed_to_inner_assertion_scopes() + { + // Arrange + var subject = new[] + { + new + { + Value = 42 + } + }; + + var expected = new[] + { + new + { + Value = 42 + }, + new + { + Value = 42 + } + }; + + // Act + using var scope = new AssertionScope(); + scope.FormattingOptions.MaxDepth = 1; + subject.Should().BeEquivalentTo(expected); + + // Assert + scope.Discard().Should().ContainSingle() + .Which.Should().Contain("Maximum recursion depth of 1 was reached"); + } + public class CustomAssertionStrategy : IAssertionStrategy { private readonly List failureMessages = new(); diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index ab2ba3cb28..b63bca7de2 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -20,6 +20,8 @@ sidebar: * `BeEquivalentTo` will now find and can map subject properties that are implemented through an explicitly-implemented interface - [#2152](https://github.com/fluentassertions/fluentassertions/pull/2152) * Fixed that the `because` and `becauseArgs` were not passed down the equivalency tree - [#2318](https://github.com/fluentassertions/fluentassertions/pull/2318) * `BeEquivalentTo` can again compare a non-generic `IDictionary` with a generic one - [#2358](https://github.com/fluentassertions/fluentassertions/pull/23158) +* Fixed that the `FormattingOptions` were not respected in inner `AssertionScope` - [#2328](https://github.com/fluentassertions/fluentassertions/pull/2328) + ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) From b43127ca80a8853391f18bebd2d1b78d1c01c59b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 14 Oct 2023 15:08:36 +0200 Subject: [PATCH 098/845] Bump the xunit group with 2 updates (#2382) Bumps the xunit group with 2 updates: [xunit](https://github.com/xunit/xunit) and [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit). Updates `xunit` from 2.5.1 to 2.5.2 - [Commits](https://github.com/xunit/xunit/compare/2.5.1...2.5.2) Updates `xunit.runner.visualstudio` from 2.5.1 to 2.5.3 - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.5.1...2.5.3) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 4 ++-- Tests/FSharp.Specs/FSharp.Specs.fsproj | 4 ++-- .../FluentAssertions.Equivalency.Specs.csproj | 6 +++--- .../FluentAssertions.Specs/FluentAssertions.Specs.csproj | 8 ++++---- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 4 ++-- Tests/VB.Specs/VB.Specs.vbproj | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 83ad3af6a3..f2e698748e 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -6,8 +6,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index be6a64183d..03df2d2a6f 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -11,8 +11,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index f9712e19d3..b21074438b 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -18,7 +18,7 @@ Upgrading to 1.6.0 gives "Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0" --> - + all runtime; build; native; contentfiles; analyzers @@ -26,7 +26,7 @@ - + all runtime; build; native; contentfiles; analyzers @@ -36,7 +36,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 1616da6aa9..48297cf9c3 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -1,4 +1,4 @@ - + net47;net6.0 @@ -18,7 +18,7 @@ Upgrading to 1.6.0 gives "Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0" --> - + all runtime; build; native; contentfiles; analyzers @@ -26,7 +26,7 @@ - + all runtime; build; native; contentfiles; analyzers @@ -34,7 +34,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index 3ca0c1acea..ad6c074ce4 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -12,8 +12,8 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 7fbe3b0ffe..92a8502c76 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -7,8 +7,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all From 97914e5b13cc7c0d43fd48695e9cc2e6017bcc4b Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Sun, 15 Oct 2023 15:46:28 +0200 Subject: [PATCH 099/845] Ignore `UnusedMember.Global` --- qodana.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/qodana.yaml b/qodana.yaml index d8e3164bf0..0cc572888a 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -20,3 +20,4 @@ exclude: - Tests/AssemblyB - Tests/Benchmarks - Tests/UWP.Specs + - name: UnusedMember.Global From 558e62a31514a8577120bb7c9809575b289866a8 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Sun, 15 Oct 2023 15:53:48 +0200 Subject: [PATCH 100/845] Add tests to use method return values: `ObjectAssertions` --- .../Primitives/ObjectAssertionSpecs.cs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs index fad59acbab..a1778fe1a7 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs @@ -186,6 +186,16 @@ public void A_typed_value_requires_a_comparer() // Assert act.Should().Throw().WithParameterName("comparer"); } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + var value = new SomeClass(3); + + // Act / Assert + value.Should().Be(value).And.NotBeNull(); + } } public class NotBe @@ -315,6 +325,16 @@ public void A_typed_value_requires_a_comparer() // Assert act.Should().Throw().WithParameterName("comparer"); } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + var value = new SomeClass(3); + + // Act / Assert + value.Should().NotBe(new SomeClass(3)).And.NotBeNull(); + } } public class BeOneOf @@ -508,6 +528,16 @@ public void A_typed_value_requires_a_comparer() // Assert act.Should().Throw().WithParameterName("comparer"); } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + var value = new SomeClass(3); + + // Act / Assert + value.Should().BeOneOf(value).And.NotBeNull(); + } } private enum MyEnum From e2694c2c73855f22edd22a890c963920372f82a4 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Sun, 15 Oct 2023 15:57:26 +0200 Subject: [PATCH 101/845] Add tests to use method return values: `AssemblyAssertions` --- .../Specialized/AssemblyAssertionSpecs.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Tests/FluentAssertions.Specs/Specialized/AssemblyAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/AssemblyAssertionSpecs.cs index f40c776549..7736ea9f54 100644 --- a/Tests/FluentAssertions.Specs/Specialized/AssemblyAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/AssemblyAssertionSpecs.cs @@ -302,6 +302,16 @@ public void Throws_for_null_subject() act.Should().Throw() .WithMessage("Can't check for assembly signing if nullAssembly reference is ."); } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + var unsignedAssembly = FindAssembly.Stub(""); + + // Act & Assert + unsignedAssembly.Should().BeUnsigned().And.NotBeNull(); + } } public class BeSignedWithPublicKey @@ -362,6 +372,17 @@ public void Throws_for_null_assembly() act.Should().Throw() .WithMessage("Can't check for assembly signing if nullAssembly reference is ."); } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + var key = "0123456789ABCEF007"; + var signedAssembly = FindAssembly.Stub(key); + + // Act & Assert + signedAssembly.Should().BeSignedWithPublicKey(key).And.NotBeNull(); + } } } From 062baf1e338724e2555e74d69606ac05b8464b14 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Sun, 15 Oct 2023 16:03:36 +0200 Subject: [PATCH 102/845] Add tests to use method return values: `NumericAssertions` --- .../Numeric/NumericAssertionSpecs.cs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.cs index 71aecb389b..c96125f947 100644 --- a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.cs @@ -784,6 +784,17 @@ public void A_double_can_never_be_greater_or_equal_to_NaN() .Should().Throw() .WithMessage("*NaN*"); } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + int value = 2; + int smallerValue = 1; + + // Act / Assert + value.Should().BeGreaterThan(smallerValue).And.Be(2); + } } public class LessThanOrEqualTo @@ -1031,6 +1042,17 @@ public void A_double_can_never_be_less_than_or_equal_to_NaN() .Should().Throw() .WithMessage("*NaN*"); } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + int value = 1; + int greaterValue = 2; + + // Act / Assert + value.Should().BeLessThanOrEqualTo(greaterValue).And.Be(1); + } } public class InRange From 4b59732dc17c3cc807ead2ccf0e4432343e531f4 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Sun, 15 Oct 2023 16:03:51 +0200 Subject: [PATCH 103/845] Add tests to use method return values: `GenericCollectionAssertions` --- ...tionAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs | 10 ++++++++++ ...lectionAssertionSpecs.HaveCountLessThanOrEqualTo.cs | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs index a6bd1f0e3d..2941effa41 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs @@ -69,5 +69,15 @@ public void When_collection_count_is_greater_than_or_equal_to_and_collection_is_ act.Should().Throw() .WithMessage("*at least*1*we want to test the behaviour with a null subject*found *"); } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + var collection = new[] { 1, 2, 3 }; + + // Act / Assert + collection.Should().HaveCountGreaterThanOrEqualTo(3).And.Contain(1); + } } } diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountLessThanOrEqualTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountLessThanOrEqualTo.cs index 3ce98f3d43..777fb3baa5 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountLessThanOrEqualTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountLessThanOrEqualTo.cs @@ -69,5 +69,15 @@ public void When_collection_count_is_less_than_or_equal_to_and_collection_is_nul act.Should().Throw() .WithMessage("*at most*1*we want to test the behaviour with a null subject*found *"); } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + var collection = new[] { 1, 2, 3 }; + + // Act / Assert + collection.Should().HaveCountLessThanOrEqualTo(3).And.Contain(1); + } } } From 6c154441736d7611a38aa782a523714cd1c72f41 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Sun, 15 Oct 2023 16:09:08 +0200 Subject: [PATCH 104/845] Add tests to use method return values: `ExecutionTimeAssertions` --- .../ExecutionTimeAssertionsSpecs.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Tests/FluentAssertions.Specs/Specialized/ExecutionTimeAssertionsSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/ExecutionTimeAssertionsSpecs.cs index d1cd1bff84..d1a591ba61 100644 --- a/Tests/FluentAssertions.Specs/Specialized/ExecutionTimeAssertionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/ExecutionTimeAssertionsSpecs.cs @@ -101,6 +101,18 @@ public void Actions_with_brackets_fail_with_correctly_formatted_message() act.Should().ThrowExactly() .Which.Message.Should().Contain("{}").And.NotContain("{0}"); } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + var subject = new SleepingClass(); + + // Act / Assert + subject.ExecutionTimeOf(s => s.Sleep(0)) + .Should().BeLessThanOrEqualTo(500.Milliseconds()) + .And.BeCloseTo(0.Seconds(), 500.Milliseconds()); + } } public class BeLessThan @@ -310,6 +322,18 @@ public void Actions_with_brackets_fail_with_correctly_formatted_message() act.Should().ThrowExactly() .Which.Message.Should().Contain("{}").And.NotContain("{0}"); } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + var subject = new SleepingClass(); + + // Act / Assert + subject.ExecutionTimeOf(s => s.Sleep(100)) + .Should().BeGreaterThanOrEqualTo(50.Milliseconds()) + .And.BeCloseTo(0.Seconds(), 500.Milliseconds()); + } } public class BeGreaterThan From 00ef733e36be83f9d1f6facba300a1ba1abfe0b2 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Sun, 15 Oct 2023 16:11:50 +0200 Subject: [PATCH 105/845] Add tests to use method return values: `ComparableTypeAssertions` --- .../Numeric/ComparableSpecs.cs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Tests/FluentAssertions.Specs/Numeric/ComparableSpecs.cs b/Tests/FluentAssertions.Specs/Numeric/ComparableSpecs.cs index 5fd324b210..c762fe199d 100644 --- a/Tests/FluentAssertions.Specs/Numeric/ComparableSpecs.cs +++ b/Tests/FluentAssertions.Specs/Numeric/ComparableSpecs.cs @@ -556,6 +556,17 @@ public void When_subject_is_less_than_another_subject_and_less_than_or_equal_is_ // Assert act.Should().NotThrow(); } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + var subject = new ComparableOfString("World"); + var other = new ComparableOfString("World"); + + // Act / Assert + subject.Should().BeLessThanOrEqualTo(other).And.NotBeNull(); + } } public class BeGreaterThan @@ -650,6 +661,17 @@ public void When_subject_is_greater_than_another_subject_and_greater_than_or_equ // Assert act.Should().NotThrow(); } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + var subject = new ComparableOfString("def"); + var other = new ComparableOfString("def"); + + // Act / Assert + subject.Should().BeGreaterThanOrEqualTo(other).And.NotBeNull(); + } } } From 734ce749d9800237873c601b8932b4d3fdee9b94 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Sun, 15 Oct 2023 16:16:48 +0200 Subject: [PATCH 106/845] Add tests to use method return values: `ActionAssertions` --- .../Specialized/TaskAssertionSpecs.cs | 47 +++++++++++++++++-- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs index 2cfe99ee3b..c58b0b5090 100644 --- a/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs @@ -5,7 +5,6 @@ using FluentAssertions.Extensions; using Xunit; using Xunit.Sdk; - using static FluentAssertions.FluentActions; namespace FluentAssertions.Specs.Specialized; @@ -28,6 +27,38 @@ public void When_getting_the_subject_it_should_remain_unchanged() } } + public class NotThrow + { + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + Func> subject = () => Task.FromResult(42); + + // Act + Action action = () => subject.Should().Subject.As().Should().BeSameAs(subject); + + // Assert + action.Should().NotThrow("the Subject should remain the same").And.NotBeNull(); + } + } + + public class NotThrowAfter + { + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + Func> subject = () => Task.FromResult(42); + + // Act + Action action = () => subject.Should().Subject.As().Should().BeSameAs(subject); + + // Assert + action.Should().NotThrowAfter(1.Seconds(), 1.Seconds()).And.NotBeNull(); + } + } + public class CompleteWithinAsync { [Fact] @@ -99,6 +130,7 @@ public async Task When_task_completes_late_it_should_fail() // Act Func action = () => taskFactory.Awaiting(t => (Task)t.Task).Should(timer).CompleteWithinAsync(100.Milliseconds()); + timer.Complete(); // Assert @@ -214,6 +246,7 @@ public async Task When_subject_is_null_in_assertion_scope_it_should_throw() Func testAction = async () => { using var _ = new AssertionScope(); + await action.Should().ThrowAsync( "because we want to test the failure {0}", "message"); }; @@ -231,7 +264,7 @@ public async Task When_task_throws_it_should_succeed() { return Awaiting(() => Task.FromException(new InvalidOperationException("foo"))) - .Should().ThrowAsync(); + .Should().ThrowAsync(); }; // Assert @@ -246,7 +279,7 @@ public async Task When_task_throws_unexpected_exception_it_should_fail() { return Awaiting(() => Task.FromException(new NotSupportedException("foo"))) - .Should().ThrowAsync(); + .Should().ThrowAsync(); }; // Assert @@ -263,7 +296,7 @@ public async Task When_task_completes_without_exception_it_should_fail() { return Awaiting(() => Task.CompletedTask) - .Should().ThrowAsync(); + .Should().ThrowAsync(); }; // Assert @@ -299,6 +332,7 @@ public async Task When_subject_is_null_in_assertion_scope_it_should_throw() Func testAction = async () => { using var _ = new AssertionScope(); + await action.Should().ThrowWithinAsync( 100.Milliseconds(), "because we want to test the failure {0}", "message"); }; @@ -368,6 +402,7 @@ public async Task When_task_throws_asynchronous_it_should_succeed() return Awaiting(() => (Task)taskFactory.Task) .Should(timer).ThrowWithinAsync(1.Seconds()); }; + _ = action.Invoke(); taskFactory.SetException(new InvalidOperationException("foo")); @@ -390,6 +425,7 @@ public async Task When_task_not_completes_it_should_fail() .Should(timer).ThrowWithinAsync( 100.Ticks(), "because we want to test the failure {0}", "message"); }; + timer.Delay(101.Ticks()); // Assert @@ -413,6 +449,7 @@ public async Task When_task_completes_without_exception_it_should_fail() .Awaiting(t => (Task)t.Task) .Should(timer).ThrowWithinAsync(100.Milliseconds()); }; + taskFactory.SetResult(true); timer.Complete(); @@ -435,6 +472,7 @@ public async Task When_task_throws_unexpected_exception_it_should_fail() .Awaiting(t => (Task)t.Task) .Should(timer).ThrowWithinAsync(100.Milliseconds()); }; + taskFactory.SetException(new NotSupportedException("foo")); // Assert @@ -456,6 +494,7 @@ public async Task When_task_throws_unexpected_exception_asynchronous_it_should_f return Awaiting(() => (Task)taskFactory.Task) .Should(timer).ThrowWithinAsync(1.Seconds()); }; + _ = action.Invoke(); taskFactory.SetException(new NotSupportedException("foo")); From 5fe3ca8303ddc2fec381e2e64cadca25ddfe8a00 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Sun, 15 Oct 2023 16:19:52 +0200 Subject: [PATCH 107/845] Add tests to use method return values: `SimpleTimeSpanAssertions` --- .../SimpleTimeSpanAssertionSpecs.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Tests/FluentAssertions.Specs/Primitives/SimpleTimeSpanAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/SimpleTimeSpanAssertionSpecs.cs index e208d68d20..1e2a8a56d8 100644 --- a/Tests/FluentAssertions.Specs/Primitives/SimpleTimeSpanAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/SimpleTimeSpanAssertionSpecs.cs @@ -357,6 +357,16 @@ public void When_asserting_value_to_be_greater_than_or_equal_to_same_value_it_sh twoSeconds.Should().BeGreaterThanOrEqualTo(twoSeconds); } + [Fact] + public void Chaining_after_one_assertion_1() + { + // Arrange + var twoSeconds = 2.Seconds(); + + // Act / Assert + twoSeconds.Should().BeGreaterThanOrEqualTo(twoSeconds).And.Be(2.Seconds()); + } + [Fact] public void When_asserting_value_to_be_greater_than_or_equal_to_greater_value_it_should_fail() { @@ -464,6 +474,17 @@ public void When_asserting_value_to_be_less_than_or_equal_to_greater_value_it_sh actual.Should().BeLessThanOrEqualTo(greater); } + [Fact] + public void Chaining_after_one_assertion_2() + { + // Arrange + TimeSpan actual = 1.Seconds(); + TimeSpan greater = 2.Seconds(); + + // Act / Assert + actual.Should().BeLessThanOrEqualTo(greater).And.Be(1.Seconds()); + } + [Fact] public void When_asserting_null_value_to_be_less_than_or_equal_to_other_value_it_should_fail() { From a8b91432f6c6fed016202157251b9beab881bc82 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 15 Oct 2023 17:49:27 +0200 Subject: [PATCH 108/845] Run dependabot weekly According to https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#scheduleinterval this does not apply to security updates --- .github/dependabot.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e2a6d17638..a5225a3de5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,22 +3,34 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "daily" + interval: "weekly" + day: "monday" + time: "16:00" + timezone: "Europe/Copenhagen" - package-ecosystem: "npm" directory: "/" schedule: - interval: "daily" + interval: "weekly" + day: "monday" + time: "16:00" + timezone: "Europe/Copenhagen" - package-ecosystem: "bundler" directory: "/docs" schedule: - interval: "daily" + interval: "weekly" + day: "monday" + time: "16:00" + timezone: "Europe/Copenhagen" - package-ecosystem: "nuget" directory: "/" schedule: - interval: "daily" + interval: "weekly" + day: "monday" + time: "16:00" + timezone: "Europe/Copenhagen" ignore: - dependency-name: "System.Configuration.ConfigurationManager" - dependency-name: "System.Threading.Tasks.Extensions" From 41c1343e24b0cef6612ac2fbdbbded26a3fea293 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Sun, 15 Oct 2023 17:50:45 +0200 Subject: [PATCH 109/845] Add tests to use method return values: `ObjectAssertions` (generic) --- .../Primitives/ObjectAssertionSpecs.cs | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs index a1778fe1a7..591081ac7a 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs @@ -196,6 +196,16 @@ public void Chaining_after_one_assertion() // Act / Assert value.Should().Be(value).And.NotBeNull(); } + + [Fact] + public void Can_chain_multiple_assertions() + { + // Arrange + var value = new object(); + + // Act / Assert + value.Should().Be(value, new DumbObjectEqualityComparer()).And.NotBeNull(); + } } public class NotBe @@ -335,6 +345,16 @@ public void Chaining_after_one_assertion() // Act / Assert value.Should().NotBe(new SomeClass(3)).And.NotBeNull(); } + + [Fact] + public void Can_chain_multiple_assertions() + { + // Arrange + var value = new object(); + + // Act / Assert + value.Should().NotBe(new object(), new DumbObjectEqualityComparer()).And.NotBeNull(); + } } public class BeOneOf @@ -538,6 +558,16 @@ public void Chaining_after_one_assertion() // Act / Assert value.Should().BeOneOf(value).And.NotBeNull(); } + + [Fact] + public void Can_chain_multiple_assertions() + { + // Arrange + var value = new object(); + + // Act / Assert + value.Should().BeOneOf(new[] { value }, new DumbObjectEqualityComparer()).And.NotBeNull(); + } } private enum MyEnum @@ -1511,6 +1541,13 @@ public SomeClass(int key) public override string ToString() => $"SomeClass({Key})"; } +internal class DumbObjectEqualityComparer : IEqualityComparer +{ + public new bool Equals(object x, object y) => x.Equals(y); + + public int GetHashCode(object obj) => obj.GetHashCode(); +} + internal class SomeClassEqualityComparer : IEqualityComparer { public bool Equals(SomeClass x, SomeClass y) => x.Key == y.Key; From 25aad01d6924163df971003ee4d9a72918ccacdf Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Sun, 15 Oct 2023 17:54:54 +0200 Subject: [PATCH 110/845] Fix typo for `NumericAssertions.BeGreaterThanOrEqualTo` --- Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.cs index c96125f947..84d4f7c71e 100644 --- a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.cs @@ -793,7 +793,7 @@ public void Chaining_after_one_assertion() int smallerValue = 1; // Act / Assert - value.Should().BeGreaterThan(smallerValue).And.Be(2); + value.Should().BeGreaterThanOrEqualTo(smallerValue).And.Be(2); } } From 9219834830457cda644cbd292d4d83495ac248ec Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Sun, 15 Oct 2023 18:59:20 +0200 Subject: [PATCH 111/845] Decrease qodana fail threshold --- qodana.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qodana.yaml b/qodana.yaml index 0cc572888a..e28367dea2 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,7 +1,7 @@ version: "1.0" linter: jetbrains/qodana-dotnet:latest -failThreshold: 57 +failThreshold: 13 dotnet: solution: FluentAssertions.sln From 4e955b6a7bdb8ebf1e50022298ab5a66e893ec82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:12:43 +0000 Subject: [PATCH 112/845] Bump the xunit group with 1 update Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify). - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/22.1.3...22.1.4) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index f2e698748e..36ec777262 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 514ed4c36592e15f9e9325a8a019bc4bbdbd063e Mon Sep 17 00:00:00 2001 From: Cervac Petru Date: Tue, 17 Oct 2023 23:49:03 +0100 Subject: [PATCH 113/845] Capitalize true and false in failure messages (#2390) * chore: capitalize true and false Display 'true' and 'false' as capitalized rathen than in lowercase so that both expected value and actual value uses the same casing. ---Before--- "Expected boolean to be false, but found True." ---After--- "Expected boolean to be False, but found True." * docs: update releases.md --- Src/FluentAssertions/Primitives/BooleanAssertions.cs | 4 ++-- .../Primitives/BooleanAssertionSpecs.cs | 4 ++-- docs/_pages/releases.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Src/FluentAssertions/Primitives/BooleanAssertions.cs b/Src/FluentAssertions/Primitives/BooleanAssertions.cs index 489aac2e37..393909249e 100644 --- a/Src/FluentAssertions/Primitives/BooleanAssertions.cs +++ b/Src/FluentAssertions/Primitives/BooleanAssertions.cs @@ -51,7 +51,7 @@ public AndConstraint BeFalse(string because = "", params object[] b Execute.Assertion .ForCondition(Subject == false) .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:boolean} to be false{reason}, but found {0}.", Subject); + .FailWith("Expected {context:boolean} to be False{reason}, but found {0}.", Subject); return new AndConstraint((TAssertions)this); } @@ -71,7 +71,7 @@ public AndConstraint BeTrue(string because = "", params object[] be Execute.Assertion .ForCondition(Subject == true) .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:boolean} to be true{reason}, but found {0}.", Subject); + .FailWith("Expected {context:boolean} to be True{reason}, but found {0}.", Subject); return new AndConstraint((TAssertions)this); } diff --git a/Tests/FluentAssertions.Specs/Primitives/BooleanAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/BooleanAssertionSpecs.cs index f956cb55af..63e8cf8cb5 100644 --- a/Tests/FluentAssertions.Specs/Primitives/BooleanAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/BooleanAssertionSpecs.cs @@ -41,7 +41,7 @@ public void Should_fail_with_descriptive_message_when_asserting_boolean_value_fa // Assert action .Should().Throw() - .WithMessage("Expected boolean to be true because we want to test the failure message, but found False."); + .WithMessage("Expected boolean to be True because we want to test the failure message, but found False."); } } @@ -78,7 +78,7 @@ public void Should_fail_with_descriptive_message_when_asserting_boolean_value_tr // Assert action.Should().Throw() - .WithMessage("Expected boolean to be false because we want to test the failure message, but found True."); + .WithMessage("Expected boolean to be False because we want to test the failure message, but found True."); } } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index b63bca7de2..4f3b2877d3 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -21,7 +21,7 @@ sidebar: * Fixed that the `because` and `becauseArgs` were not passed down the equivalency tree - [#2318](https://github.com/fluentassertions/fluentassertions/pull/2318) * `BeEquivalentTo` can again compare a non-generic `IDictionary` with a generic one - [#2358](https://github.com/fluentassertions/fluentassertions/pull/23158) * Fixed that the `FormattingOptions` were not respected in inner `AssertionScope` - [#2328](https://github.com/fluentassertions/fluentassertions/pull/2328) - +* Capitalize `true` and `false` in failure messages - [#2390](https://github.com/fluentassertions/fluentassertions/pull/2390) ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) From 6738eb8fc3207165a65a57082f8b8fe5dda3eebe Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Wed, 18 Oct 2023 08:57:22 +0200 Subject: [PATCH 114/845] Introduced the [CustomAssertionsAssembly] to mark an entire assembly as one that contains custom assertions. (#2389) --- FluentAssertions.sln | 9 ++++++++ Src/FluentAssertions/CallerIdentifier.cs | 12 +++++++++- .../CustomAssertionsAssemblyAttribute.cs | 12 ++++++++++ .../FluentAssertions/net47.verified.txt | 5 ++++ .../FluentAssertions/net6.0.verified.txt | 5 ++++ .../netstandard2.0.verified.txt | 5 ++++ .../netstandard2.1.verified.txt | 5 ++++ Tests/ExampleExtensions/AssemblyInfo.cs | 3 +++ .../ExampleExtensions.csproj | 16 +++++++++++++ .../StringAssertionExtensions.cs | 16 +++++++++++++ .../ExtensibilitySpecs.cs | 23 +++++++++++++++---- .../FluentAssertions.Specs.csproj | 3 ++- docs/_pages/introduction.md | 2 ++ docs/_pages/releases.md | 1 + 14 files changed, 111 insertions(+), 6 deletions(-) create mode 100644 Src/FluentAssertions/CustomAssertionsAssemblyAttribute.cs create mode 100644 Tests/ExampleExtensions/AssemblyInfo.cs create mode 100644 Tests/ExampleExtensions/ExampleExtensions.csproj create mode 100644 Tests/ExampleExtensions/StringAssertionExtensions.cs diff --git a/FluentAssertions.sln b/FluentAssertions.sln index 31ee369de2..52e93a3c91 100644 --- a/FluentAssertions.sln +++ b/FluentAssertions.sln @@ -51,6 +51,8 @@ Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "VB.Specs", "Tests\VB.Specs\ EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Specs", "Tests\FSharp.Specs\FSharp.Specs.fsproj", "{0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleExtensions", "Tests\ExampleExtensions\ExampleExtensions.csproj", "{8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution CI|Any CPU = CI|Any CPU @@ -141,6 +143,12 @@ Global {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}.Debug|Any CPU.Build.0 = Debug|Any CPU {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}.Release|Any CPU.ActiveCfg = Release|Any CPU {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}.Release|Any CPU.Build.0 = Release|Any CPU + {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.CI|Any CPU.ActiveCfg = Debug|Any CPU + {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.CI|Any CPU.Build.0 = Debug|Any CPU + {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -160,6 +168,7 @@ Global {A946043D-D3F8-46A4-B485-A88412C417FE} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} {0C0211B6-D185-4518-A15A-38AC092EDC50} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} + {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {75DDA3D8-9D6F-4865-93F4-DDE11DEE8290} diff --git a/Src/FluentAssertions/CallerIdentifier.cs b/Src/FluentAssertions/CallerIdentifier.cs index ff9c66f547..525bba71d1 100644 --- a/Src/FluentAssertions/CallerIdentifier.cs +++ b/Src/FluentAssertions/CallerIdentifier.cs @@ -3,6 +3,7 @@ using System.Globalization; using System.IO; using System.Linq; +using System.Reflection; using System.Text.RegularExpressions; using System.Threading; using FluentAssertions.CallerIdentification; @@ -137,7 +138,16 @@ internal static bool OnlyOneFluentAssertionScopeOnCallStack() private static bool IsCustomAssertion(StackFrame frame) { - return frame.GetMethod()?.IsDecoratedWithOrInherit() == true; + MethodBase getMethod = frame.GetMethod(); + + if (getMethod is not null) + { + return + getMethod.IsDecoratedWithOrInherit() || + getMethod.ReflectedType?.Assembly.IsDefined(typeof(CustomAssertionsAssemblyAttribute)) == true; + } + + return false; } private static bool IsDynamic(StackFrame frame) diff --git a/Src/FluentAssertions/CustomAssertionsAssemblyAttribute.cs b/Src/FluentAssertions/CustomAssertionsAssemblyAttribute.cs new file mode 100644 index 0000000000..ce016d9dd3 --- /dev/null +++ b/Src/FluentAssertions/CustomAssertionsAssemblyAttribute.cs @@ -0,0 +1,12 @@ +using System; + +namespace FluentAssertions; + +/// +/// Marks an assembly as containing extensions to Fluent Assertions that either uses the built-in assertions +/// internally, or directly uses the Execute.Assertion. +/// +[AttributeUsage(AttributeTargets.Assembly)] +public sealed class CustomAssertionsAssemblyAttribute : Attribute +{ +} diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 8be364f24e..521562257a 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -193,6 +193,11 @@ namespace FluentAssertions { public CustomAssertionAttribute() { } } + [System.AttributeUsage(System.AttributeTargets.Assembly)] + public sealed class CustomAssertionsAssemblyAttribute : System.Attribute + { + public CustomAssertionsAssemblyAttribute() { } + } public static class EnumAssertionsExtensions { public static FluentAssertions.Primitives.EnumAssertions Should(this TEnum @enum) diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index d319c0fc3f..29636f86a4 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -206,6 +206,11 @@ namespace FluentAssertions { public CustomAssertionAttribute() { } } + [System.AttributeUsage(System.AttributeTargets.Assembly)] + public sealed class CustomAssertionsAssemblyAttribute : System.Attribute + { + public CustomAssertionsAssemblyAttribute() { } + } public static class EnumAssertionsExtensions { public static FluentAssertions.Primitives.EnumAssertions Should(this TEnum @enum) diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index a2e54fe7a8..dbd61567d4 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -192,6 +192,11 @@ namespace FluentAssertions { public CustomAssertionAttribute() { } } + [System.AttributeUsage(System.AttributeTargets.Assembly)] + public sealed class CustomAssertionsAssemblyAttribute : System.Attribute + { + public CustomAssertionsAssemblyAttribute() { } + } public static class EnumAssertionsExtensions { public static FluentAssertions.Primitives.EnumAssertions Should(this TEnum @enum) diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 44ff600418..d6e22422b5 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -193,6 +193,11 @@ namespace FluentAssertions { public CustomAssertionAttribute() { } } + [System.AttributeUsage(System.AttributeTargets.Assembly)] + public sealed class CustomAssertionsAssemblyAttribute : System.Attribute + { + public CustomAssertionsAssemblyAttribute() { } + } public static class EnumAssertionsExtensions { public static FluentAssertions.Primitives.EnumAssertions Should(this TEnum @enum) diff --git a/Tests/ExampleExtensions/AssemblyInfo.cs b/Tests/ExampleExtensions/AssemblyInfo.cs new file mode 100644 index 0000000000..520561d30e --- /dev/null +++ b/Tests/ExampleExtensions/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using FluentAssertions; + +[assembly: CustomAssertionsAssembly] diff --git a/Tests/ExampleExtensions/ExampleExtensions.csproj b/Tests/ExampleExtensions/ExampleExtensions.csproj new file mode 100644 index 0000000000..20e21aa202 --- /dev/null +++ b/Tests/ExampleExtensions/ExampleExtensions.csproj @@ -0,0 +1,16 @@ + + + + netstandard2.0 + enable + disable + false + True + ..\..\Src\FluentAssertions\FluentAssertions.snk + + + + + + + diff --git a/Tests/ExampleExtensions/StringAssertionExtensions.cs b/Tests/ExampleExtensions/StringAssertionExtensions.cs new file mode 100644 index 0000000000..4ed34ab39f --- /dev/null +++ b/Tests/ExampleExtensions/StringAssertionExtensions.cs @@ -0,0 +1,16 @@ +using FluentAssertions; +using FluentAssertions.Primitives; + +namespace ExampleExtensions; + +public static class StringAssertionExtensions +{ + public static void BePalindromic(this StringAssertions assertions) + { + char[] charArray = assertions.Subject.ToCharArray(); + Array.Reverse(charArray); + string reversedSubject = new string(charArray); + + assertions.Subject.Should().Be(reversedSubject); + } +} diff --git a/Tests/FluentAssertions.Specs/ExtensibilitySpecs.cs b/Tests/FluentAssertions.Specs/ExtensibilitySpecs.cs index e4ad77ede5..6f729948be 100644 --- a/Tests/FluentAssertions.Specs/ExtensibilitySpecs.cs +++ b/Tests/FluentAssertions.Specs/ExtensibilitySpecs.cs @@ -1,4 +1,5 @@ using System; +using ExampleExtensions; using Xunit; using Xunit.Sdk; @@ -7,7 +8,7 @@ namespace FluentAssertions.Specs; public class ExtensibilitySpecs { [Fact] - public void When_a_method_is_marked_as_custom_assertion_it_should_be_ignored_during_caller_identification() + public void Methods_marked_as_custom_assertion_are_ignored_during_caller_identification() { // Arrange var myClient = new MyCustomer @@ -22,14 +23,28 @@ public void When_a_method_is_marked_as_custom_assertion_it_should_be_ignored_dur act.Should().Throw().WithMessage( "Expected myClient to be true because we don't work with old clients, but found False."); } + + [Fact] + public void Methods_in_assemblies_marked_as_custom_assertion_are_ignored_during_caller_identification() + { + // Arrange + string palindrome = "fluent"; + + // Act + Action act = () => palindrome.Should().BePalindromic(); + + // Assert + act.Should().Throw().WithMessage( + "Expected palindrome to be*tneulf*"); + } } -public class MyCustomer +internal class MyCustomer { public bool Active { get; set; } } -public static class MyCustomerExtensions +internal static class MyCustomerExtensions { public static MyCustomerAssertions Should(this MyCustomer customer) { @@ -37,7 +52,7 @@ public static MyCustomerAssertions Should(this MyCustomer customer) } } -public class MyCustomerAssertions +internal class MyCustomerAssertions { private readonly MyCustomer customer; diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 48297cf9c3..e93bf2ad17 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -1,4 +1,4 @@ - + net47;net6.0 @@ -45,6 +45,7 @@ + diff --git a/docs/_pages/introduction.md b/docs/_pages/introduction.md index d2333c7156..8f98ede3f1 100644 --- a/docs/_pages/introduction.md +++ b/docs/_pages/introduction.md @@ -124,6 +124,8 @@ myClient.Should().BeActive("because we don't work with old clients"); Without the `[CustomAssertion]` attribute, Fluent Assertions would find the line that calls `Should().BeTrue()` and treat the `customer` variable as the subject-under-test (SUT). But by applying this attribute, it will ignore this invocation and instead find the SUT by looking for a call to `Should().BeActive()` and use the `myClient` variable instead. +Alternatively, you can add the `[assembly:CustomAssertionsAssembly]` attribute to a file within the project to tell Fluent Assertions that all code in that assembly should be treated as custom assertion code. + ## Assertion Scopes You can batch multiple assertions into an `AssertionScope` so that FluentAssertions throws one exception at the end of the scope with all failures. diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 4f3b2877d3..78f465ed27 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -13,6 +13,7 @@ sidebar: ### Improvements * Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) +* You can mark all assertions in an assembly as custom assertions using the `[CustomAssertionsAssembly]` attribute - [#2389](https://github.com/fluentassertions/fluentassertions/pull/2389) ### Fixes * Fixed formatting error when checking nullable `DateTimeOffset` with From fcb67bafcabdcc936b4bc9385badccb6646cef67 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Wed, 18 Oct 2023 13:13:46 +0200 Subject: [PATCH 115/845] Allow specifying the build configuration. (#2386) --- .nuke/build.schema.json | 8 ++++++++ Build/Build.cs | 9 ++++++--- Build/Configuration.cs | 6 ++---- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index fa2e337741..b828be0d11 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -6,6 +6,14 @@ "build": { "type": "object", "properties": { + "Configuration": { + "type": "string", + "description": "The solution configuration to build. Default is 'Debug' (local) or 'CI' (server)", + "enum": [ + "CI", + "Debug" + ] + }, "Continue": { "type": "boolean", "description": "Indicates to continue a previously failed build attempt" diff --git a/Build/Build.cs b/Build/Build.cs index 0b4aa96fa8..d78719fc3e 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -40,6 +40,9 @@ class Build : NukeBuild string PullRequestBase => GitHubActions?.BaseRef; + [Parameter("The solution configuration to build. Default is 'Debug' (local) or 'CI' (server).")] + readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.CI; + [Parameter("Use this parameter if you encounter build problems in any way, " + "to generate a .binlog file which holds some useful information.")] readonly bool? GenerateBinLog; @@ -126,7 +129,7 @@ class Build : NukeBuild DotNetBuild(s => s .SetProjectFile(Solution) - .SetConfiguration(Configuration.CI) + .SetConfiguration(Configuration) .When(GenerateBinLog is true, _ => _ .SetBinaryLog(ArtifactsDirectory / $"{Solution.Core.FluentAssertions.Name}.binlog") ) @@ -145,7 +148,7 @@ class Build : NukeBuild Project project = Solution.Specs.Approval_Tests; DotNetTest(s => s - .SetConfiguration(Configuration.Release) + .SetConfiguration(Configuration == Configuration.Debug ? "Debug" : "Release") .SetProcessEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE", "en-US") .EnableNoBuild() .SetResultsDirectory(TestResultsDirectory) @@ -318,7 +321,7 @@ from framework in supportedFrameworks DotNetPack(s => s .SetProject(Solution.Core.FluentAssertions) .SetOutputDirectory(ArtifactsDirectory) - .SetConfiguration(Configuration.Release) + .SetConfiguration(Configuration == Configuration.Debug ? "Debug" : "Release") .EnableNoLogo() .EnableNoRestore() .EnableContinuousIntegrationBuild() // Necessary for deterministic builds diff --git a/Build/Configuration.cs b/Build/Configuration.cs index 63b8965fad..79a1433858 100644 --- a/Build/Configuration.cs +++ b/Build/Configuration.cs @@ -4,11 +4,9 @@ [TypeConverter(typeof(TypeConverter))] public class Configuration : Enumeration { - public static Configuration Debug { get; } = new() { Value = nameof(Debug) }; + public static Configuration Debug = new() { Value = nameof(Debug) }; - public static Configuration Release { get; } = new() { Value = nameof(Release) }; - - public static Configuration CI { get; } = new() { Value = nameof(CI) }; + public static Configuration CI = new() { Value = nameof(CI) }; public static implicit operator string(Configuration configuration) { From 50d9569623e1c6e36298710a6b57e41b14127525 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Thu, 12 Oct 2023 14:08:00 +0200 Subject: [PATCH 116/845] Remove redundant parentheses --- Src/FluentAssertions/Common/TimeOnlyExtensions.cs | 4 ++-- Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/Common/TimeOnlyExtensions.cs b/Src/FluentAssertions/Common/TimeOnlyExtensions.cs index bbb77fc057..e327319193 100644 --- a/Src/FluentAssertions/Common/TimeOnlyExtensions.cs +++ b/Src/FluentAssertions/Common/TimeOnlyExtensions.cs @@ -21,8 +21,8 @@ public static bool IsCloseTo(this TimeOnly subject, TimeOnly other, TimeSpan pre long ticks = subject.Ticks; return startTicks <= endTicks - ? (startTicks <= ticks && endTicks >= ticks) - : (startTicks <= ticks || endTicks >= ticks); + ? startTicks <= ticks && endTicks >= ticks + : startTicks <= ticks || endTicks >= ticks; } } diff --git a/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs b/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs index b2f92fc3b1..e888baa9b2 100644 --- a/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs +++ b/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs @@ -69,5 +69,5 @@ public override string ToString() return Invariant($"{{\"{path}\", {@object}}}"); } - public bool CompareByMembers => compareByMembers ?? (@object?.GetType().OverridesEquals() == false); + public bool CompareByMembers => compareByMembers ?? @object?.GetType().OverridesEquals() == false; } From f2e8ea49996c49ad3f1453c397677f48d873d665 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Mon, 16 Oct 2023 11:29:51 +0200 Subject: [PATCH 117/845] Ignore qodana complaints about trailing commas --- qodana.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qodana.yaml b/qodana.yaml index e28367dea2..defc6bb46d 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -21,3 +21,5 @@ exclude: - Tests/Benchmarks - Tests/UWP.Specs - name: UnusedMember.Global + - name: ArrangeTrailingCommaInMultilineLists + - name: ArrangeTrailingCommaInSinglelineLists From eb23c36ddb0841c67fe797af30f4397ccce21b58 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 18 Oct 2023 10:09:48 +0200 Subject: [PATCH 118/845] Pass Boolean literals as becauseArguments This allows any potential BooleanFormatter to format them --- Src/FluentAssertions/Primitives/BooleanAssertions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/FluentAssertions/Primitives/BooleanAssertions.cs b/Src/FluentAssertions/Primitives/BooleanAssertions.cs index 393909249e..c44bc7f2ff 100644 --- a/Src/FluentAssertions/Primitives/BooleanAssertions.cs +++ b/Src/FluentAssertions/Primitives/BooleanAssertions.cs @@ -51,7 +51,7 @@ public AndConstraint BeFalse(string because = "", params object[] b Execute.Assertion .ForCondition(Subject == false) .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:boolean} to be False{reason}, but found {0}.", Subject); + .FailWith("Expected {context:boolean} to be {0}{reason}, but found {1}.", false, Subject); return new AndConstraint((TAssertions)this); } @@ -71,7 +71,7 @@ public AndConstraint BeTrue(string because = "", params object[] be Execute.Assertion .ForCondition(Subject == true) .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:boolean} to be True{reason}, but found {0}.", Subject); + .FailWith("Expected {context:boolean} to be {0}{reason}, but found {1}.", true, Subject); return new AndConstraint((TAssertions)this); } From 63c96fa31de8cc35d74edb24a3269f1b3fc5733c Mon Sep 17 00:00:00 2001 From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> Date: Fri, 20 Oct 2023 10:33:07 +0200 Subject: [PATCH 119/845] Add release notes for #2393 (#2396) * Add release notes for #2393 * Update releases.md Co-authored-by: Jonas Nyrup --------- Co-authored-by: Jonas Nyrup --- docs/_pages/releases.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 78f465ed27..572a7c36ed 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -22,7 +22,8 @@ sidebar: * Fixed that the `because` and `becauseArgs` were not passed down the equivalency tree - [#2318](https://github.com/fluentassertions/fluentassertions/pull/2318) * `BeEquivalentTo` can again compare a non-generic `IDictionary` with a generic one - [#2358](https://github.com/fluentassertions/fluentassertions/pull/23158) * Fixed that the `FormattingOptions` were not respected in inner `AssertionScope` - [#2328](https://github.com/fluentassertions/fluentassertions/pull/2328) -* Capitalize `true` and `false` in failure messages - [#2390](https://github.com/fluentassertions/fluentassertions/pull/2390) +* Capitalize `true` and `false` in failure messages and make them formattable to a custom `BooleanFormatter` - [#2390](https://github.com/fluentassertions/fluentassertions/pull/2390), [#2393](https://github.com/fluentassertions/fluentassertions/pull/2393) + ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) From fa3ca1a756aa9ecc9651c792b19cbfc01b703268 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Fri, 20 Oct 2023 11:06:49 +0200 Subject: [PATCH 120/845] Fix a small typo in release notes --- docs/_pages/releases.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 572a7c36ed..50f56cb8b9 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -20,7 +20,7 @@ sidebar: `BeWithin(...).Before(...)` - [#2312](https://github.com/fluentassertions/fluentassertions/pull/2312) * `BeEquivalentTo` will now find and can map subject properties that are implemented through an explicitly-implemented interface - [#2152](https://github.com/fluentassertions/fluentassertions/pull/2152) * Fixed that the `because` and `becauseArgs` were not passed down the equivalency tree - [#2318](https://github.com/fluentassertions/fluentassertions/pull/2318) -* `BeEquivalentTo` can again compare a non-generic `IDictionary` with a generic one - [#2358](https://github.com/fluentassertions/fluentassertions/pull/23158) +* `BeEquivalentTo` can again compare a non-generic `IDictionary` with a generic one - [#2358](https://github.com/fluentassertions/fluentassertions/pull/2358) * Fixed that the `FormattingOptions` were not respected in inner `AssertionScope` - [#2328](https://github.com/fluentassertions/fluentassertions/pull/2328) * Capitalize `true` and `false` in failure messages and make them formattable to a custom `BooleanFormatter` - [#2390](https://github.com/fluentassertions/fluentassertions/pull/2390), [#2393](https://github.com/fluentassertions/fluentassertions/pull/2393) From f4c3d56d5524996f6dc6bd02024fce88f55941d9 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Fri, 20 Oct 2023 11:12:58 +0200 Subject: [PATCH 121/845] Fix another typo --- docs/_pages/releases.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 50f56cb8b9..829acdaa5c 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -21,7 +21,7 @@ sidebar: * `BeEquivalentTo` will now find and can map subject properties that are implemented through an explicitly-implemented interface - [#2152](https://github.com/fluentassertions/fluentassertions/pull/2152) * Fixed that the `because` and `becauseArgs` were not passed down the equivalency tree - [#2318](https://github.com/fluentassertions/fluentassertions/pull/2318) * `BeEquivalentTo` can again compare a non-generic `IDictionary` with a generic one - [#2358](https://github.com/fluentassertions/fluentassertions/pull/2358) -* Fixed that the `FormattingOptions` were not respected in inner `AssertionScope` - [#2328](https://github.com/fluentassertions/fluentassertions/pull/2328) +* Fixed that the `FormattingOptions` were not respected in inner `AssertionScope` - [#2329](https://github.com/fluentassertions/fluentassertions/pull/2329) * Capitalize `true` and `false` in failure messages and make them formattable to a custom `BooleanFormatter` - [#2390](https://github.com/fluentassertions/fluentassertions/pull/2390), [#2393](https://github.com/fluentassertions/fluentassertions/pull/2393) From da130f26783fbec631a95ee443374fc93631a170 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 21 Oct 2023 16:53:22 +0200 Subject: [PATCH 122/845] Improve failure message for `NotBeOfType` and `BeReadable`/`BeWritable` (#2399) --- .../Numeric/NumericAssertions.cs | 7 +++- .../Types/PropertyInfoAssertions.cs | 21 +++++++++-- .../Primitives/ObjectAssertionSpecs.cs | 3 ++ .../Types/PropertyInfoAssertionSpecs.cs | 37 +++++++++++++++++++ docs/_pages/releases.md | 3 +- 5 files changed, 64 insertions(+), 7 deletions(-) diff --git a/Src/FluentAssertions/Numeric/NumericAssertions.cs b/Src/FluentAssertions/Numeric/NumericAssertions.cs index bea05d044f..6896f2760f 100644 --- a/Src/FluentAssertions/Numeric/NumericAssertions.cs +++ b/Src/FluentAssertions/Numeric/NumericAssertions.cs @@ -440,12 +440,15 @@ public AndConstraint NotBeOfType(Type unexpectedType, string becaus { Guard.ThrowIfArgumentIsNull(unexpectedType); - Execute.Assertion + bool success = Execute.Assertion .ForCondition(Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected type not to be " + unexpectedType + "{reason}, but found ."); - Subject.GetType().Should().NotBe(unexpectedType, because, becauseArgs); + if (success) + { + Subject.GetType().Should().NotBe(unexpectedType, because, becauseArgs); + } return new AndConstraint((TAssertions)this); } diff --git a/Src/FluentAssertions/Types/PropertyInfoAssertions.cs b/Src/FluentAssertions/Types/PropertyInfoAssertions.cs index a0476b243c..c7900b536f 100644 --- a/Src/FluentAssertions/Types/PropertyInfoAssertions.cs +++ b/Src/FluentAssertions/Types/PropertyInfoAssertions.cs @@ -130,9 +130,17 @@ public AndConstraint BeWritable(CSharpAccessModifier acc if (success) { - Subject.Should().BeWritable(because, becauseArgs); + success = Execute.Assertion + .ForCondition(Subject!.CanWrite) + .BecauseOf(because, becauseArgs) + .FailWith( + "Expected {context:property} {0} to have a setter{reason}.", + Subject); - Subject!.GetSetMethod(nonPublic: true).Should().HaveAccessModifier(accessModifier, because, becauseArgs); + if (success) + { + Subject!.GetSetMethod(nonPublic: true).Should().HaveAccessModifier(accessModifier, because, becauseArgs); + } } return new AndConstraint(this); @@ -221,9 +229,14 @@ public AndConstraint BeReadable(CSharpAccessModifier acc if (success) { - Subject.Should().BeReadable(because, becauseArgs); + success = Execute.Assertion.ForCondition(Subject!.CanRead) + .BecauseOf(because, becauseArgs) + .FailWith("Expected property " + Subject.Name + " to have a getter{reason}, but it does not."); - Subject!.GetGetMethod(nonPublic: true).Should().HaveAccessModifier(accessModifier, because, becauseArgs); + if (success) + { + Subject!.GetGetMethod(nonPublic: true).Should().HaveAccessModifier(accessModifier, because, becauseArgs); + } } return new AndConstraint(this); diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs index 591081ac7a..1e2a850b69 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs @@ -875,7 +875,10 @@ public void When_null_object_is_matched_negatively_against_a_type_it_should_thro // Act Action act = () => + { + using var _ = new AssertionScope(); valueTypeObject.Should().NotBeOfType(typeof(int), "because we want to test the failure {0}", "message"); + }; // Assert act.Should().Throw() diff --git a/Tests/FluentAssertions.Specs/Types/PropertyInfoAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Types/PropertyInfoAssertionSpecs.cs index 1254bb83da..e4479a345e 100644 --- a/Tests/FluentAssertions.Specs/Types/PropertyInfoAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/PropertyInfoAssertionSpecs.cs @@ -2,6 +2,7 @@ using System.Linq.Expressions; using System.Reflection; using FluentAssertions.Common; +using FluentAssertions.Execution; using Xunit; using Xunit.Sdk; @@ -556,6 +557,24 @@ public void When_asserting_a_private_read_public_write_property_is_public_readab "Expected method get_WritePrivateReadProperty to be Public because we want to test the error message, but it is Private."); } + [Fact] + public void Do_not_the_check_access_modifier_when_the_property_is_not_readable() + { + // Arrange + PropertyInfo propertyInfo = typeof(ClassWithProperties).GetRuntimeProperty("WriteOnlyProperty"); + + // Act + Action action = () => + { + using var _ = new AssertionScope(); + propertyInfo.Should().BeReadable(CSharpAccessModifier.Private); + }; + + // Assert + action.Should().Throw() + .WithMessage("Expected property WriteOnlyProperty to have a getter, but it does not."); + } + [Fact] public void When_subject_is_null_be_readable_with_accessmodifier_should_fail() { @@ -618,6 +637,24 @@ public void When_asserting_a_private_write_public_read_property_is_public_writab "Expected method set_ReadPrivateWriteProperty to be Public because we want to test the error message, but it is Private."); } + [Fact] + public void Do_not_the_check_access_modifier_when_the_property_is_not_writable() + { + // Arrange + PropertyInfo propertyInfo = typeof(ClassWithProperties).GetRuntimeProperty("ReadOnlyProperty"); + + // Act + Action action = () => + { + using var _ = new AssertionScope(); + propertyInfo.Should().BeWritable(CSharpAccessModifier.Private); + }; + + // Assert + action.Should().Throw() + .WithMessage("Expected propertyInfo ReadOnlyProperty to have a setter."); + } + [Fact] public void When_subject_is_null_be_writable_with_accessmodifier_should_fail() { diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 829acdaa5c..25164505ff 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -23,7 +23,8 @@ sidebar: * `BeEquivalentTo` can again compare a non-generic `IDictionary` with a generic one - [#2358](https://github.com/fluentassertions/fluentassertions/pull/2358) * Fixed that the `FormattingOptions` were not respected in inner `AssertionScope` - [#2329](https://github.com/fluentassertions/fluentassertions/pull/2329) * Capitalize `true` and `false` in failure messages and make them formattable to a custom `BooleanFormatter` - [#2390](https://github.com/fluentassertions/fluentassertions/pull/2390), [#2393](https://github.com/fluentassertions/fluentassertions/pull/2393) - +* Improved the failure message for `NotBeOfType` when wrapped in an `AssertionScope` and the subject is null - [#2399](https://github.com/fluentassertions/fluentassertions/pull/2399) +* Improved the failure message for `BeWritable`/`BeReadable` when wrapped in an `AssertionScope` and the subject is read-only/write-only - [#2399](https://github.com/fluentassertions/fluentassertions/pull/2399) ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) From 4ac2689e28466770ecb12943d717bf2ccb72630d Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Sat, 21 Oct 2023 08:53:58 +0200 Subject: [PATCH 123/845] Use base class constructor in delegate assertions --- Src/FluentAssertions/Specialized/ActionAssertions.cs | 2 +- Src/FluentAssertions/Specialized/FunctionAssertions.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/FluentAssertions/Specialized/ActionAssertions.cs b/Src/FluentAssertions/Specialized/ActionAssertions.cs index 4f939de01b..0511ac5604 100644 --- a/Src/FluentAssertions/Specialized/ActionAssertions.cs +++ b/Src/FluentAssertions/Specialized/ActionAssertions.cs @@ -12,7 +12,7 @@ namespace FluentAssertions.Specialized; public class ActionAssertions : DelegateAssertions { public ActionAssertions(Action subject, IExtractExceptions extractor) - : this(subject, extractor, new Clock()) + : base(subject, extractor) { } diff --git a/Src/FluentAssertions/Specialized/FunctionAssertions.cs b/Src/FluentAssertions/Specialized/FunctionAssertions.cs index 49a54992e4..b51e82ac74 100644 --- a/Src/FluentAssertions/Specialized/FunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/FunctionAssertions.cs @@ -12,7 +12,7 @@ namespace FluentAssertions.Specialized; public class FunctionAssertions : DelegateAssertions, FunctionAssertions> { public FunctionAssertions(Func subject, IExtractExceptions extractor) - : this(subject, extractor, new Clock()) + : base(subject, extractor) { } From 0ae4aa376443085239c55cb2e8c7ab00c11f7be9 Mon Sep 17 00:00:00 2001 From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> Date: Sun, 22 Oct 2023 09:17:31 +0200 Subject: [PATCH 124/845] Do not continue asserting on the concrete exception type when the exception is `null` (#2398) * Improved the failure message for `ThrowExactly[Async]` * Add release notes Co-authored-by: Jonas Nyrup --------- Co-authored-by: IT-VBFK Co-authored-by: Jonas Nyrup --- .../Specialized/AsyncFunctionAssertions.cs | 7 +++++-- .../Specialized/DelegateAssertions.cs | 7 +++++-- .../Specialized/DelegateAssertionSpecs.cs | 20 +++++++++++++++++++ .../Specialized/TaskAssertionSpecs.cs | 19 ++++++++++++++++++ docs/_pages/releases.md | 2 ++ 5 files changed, 51 insertions(+), 4 deletions(-) diff --git a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs index e25b6cc44e..c698345e25 100644 --- a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs @@ -91,12 +91,15 @@ public async Task> ThrowExactlyAsync { Exception exception = await InvokeWithInterceptionAsync(Subject); - Execute.Assertion + success = Execute.Assertion .ForCondition(exception is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {0}{reason}, but no exception was thrown.", expectedType); - exception.Should().BeOfType(expectedType, because, becauseArgs); + if (success) + { + exception.Should().BeOfType(expectedType, because, becauseArgs); + } return new ExceptionAssertions(new[] { exception as TException }); } diff --git a/Src/FluentAssertions/Specialized/DelegateAssertions.cs b/Src/FluentAssertions/Specialized/DelegateAssertions.cs index 785b0f7dcf..e9787b927b 100644 --- a/Src/FluentAssertions/Specialized/DelegateAssertions.cs +++ b/Src/FluentAssertions/Specialized/DelegateAssertions.cs @@ -113,12 +113,15 @@ public ExceptionAssertions ThrowExactly(string because = Type expectedType = typeof(TException); - Execute.Assertion + success = Execute.Assertion .ForCondition(exception is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {0}{reason}, but no exception was thrown.", expectedType); - exception.Should().BeOfType(expectedType, because, becauseArgs); + if (success) + { + exception.Should().BeOfType(expectedType, because, becauseArgs); + } return new ExceptionAssertions(new[] { exception as TException }); } diff --git a/Tests/FluentAssertions.Specs/Specialized/DelegateAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/DelegateAssertionSpecs.cs index 547c6ee46e..9a4ae8ce8f 100644 --- a/Tests/FluentAssertions.Specs/Specialized/DelegateAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/DelegateAssertionSpecs.cs @@ -1,4 +1,6 @@ using System; +using System.Threading.Tasks; +using FluentAssertions.Execution; using FluentAssertions.Specialized; using Xunit; @@ -34,4 +36,22 @@ public void When_injecting_a_null_clock_it_should_throw() act.Should().ThrowExactly() .WithParameterName("clock"); } + + public class ThrowExactly + { + [Fact] + public void Does_not_continue_assertion_on_exact_exception_type() + { + // Arrange + var a = () => { }; + + // Act + using var scope = new AssertionScope(); + a.Should().ThrowExactly(); + + // Assert + scope.Discard().Should().ContainSingle() + .Which.Should().Match("*InvalidOperationException*no exception*"); + } + } } diff --git a/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs index c58b0b5090..42d1bbe59d 100644 --- a/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs @@ -3,6 +3,7 @@ using System.Threading.Tasks; using FluentAssertions.Execution; using FluentAssertions.Extensions; +using FluentAssertions.Specialized; using Xunit; using Xunit.Sdk; using static FluentAssertions.FluentActions; @@ -505,6 +506,24 @@ await action.Should().ThrowAsync().WithMessage( } } + public class ThrowExactlyAsync + { + [Fact] + public async Task Does_not_continue_assertion_on_exact_exception_type() + { + // Arrange + var a = () => Task.Delay(1); + + // Act + using var scope = new AssertionScope(); + await a.Should().ThrowExactlyAsync(); + + // Assert + scope.Discard().Should().ContainSingle() + .Which.Should().Match("*InvalidOperationException*no exception*"); + } + } + [Collection("UIFacts")] public class CompleteWithinAsyncUIFacts { diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 25164505ff..9f47037da2 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -25,6 +25,8 @@ sidebar: * Capitalize `true` and `false` in failure messages and make them formattable to a custom `BooleanFormatter` - [#2390](https://github.com/fluentassertions/fluentassertions/pull/2390), [#2393](https://github.com/fluentassertions/fluentassertions/pull/2393) * Improved the failure message for `NotBeOfType` when wrapped in an `AssertionScope` and the subject is null - [#2399](https://github.com/fluentassertions/fluentassertions/pull/2399) * Improved the failure message for `BeWritable`/`BeReadable` when wrapped in an `AssertionScope` and the subject is read-only/write-only - [#2399](https://github.com/fluentassertions/fluentassertions/pull/2399) +* Improved the failure message for `ThrowExactly[Async]` when wrapped in an `AssertionScope` and no exception is thrown - [#2398](https://github.com/fluentassertions/fluentassertions/pull/2398) + ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) From 9276a30c4f354da16ef1cf75f2f68aa616480723 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:31:01 +0000 Subject: [PATCH 125/845] Bump Meziantou.Analyzer from 2.0.93 to 2.0.94 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.93 to 2.0.94. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.93...2.0.94) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 2b366c7e69..feeeeb0267 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From a2ae6aa3fd6c5584a89bd3944de3503dc405fa1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:30:53 +0000 Subject: [PATCH 126/845] Bump Roslynator.Analyzers from 4.5.0 to 4.6.0 Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.5.0 to 4.6.0. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.5.0...v4.6.0) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index feeeeb0267..a536aea668 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 52622a034062e65dbf981970c97c6ab773ca4fe3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:30:47 +0000 Subject: [PATCH 127/845] Bump the xunit group with 1 update Bumps the xunit group with 1 update: [xunit](https://github.com/xunit/xunit). - [Commits](https://github.com/xunit/xunit/compare/2.5.2...2.5.3) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 4 ++-- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 36ec777262..4241fef2be 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -6,7 +6,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 03df2d2a6f..f080397467 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -11,7 +11,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index b21074438b..ea66748531 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -36,7 +36,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index e93bf2ad17..021de3e10f 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -1,4 +1,4 @@ - + net47;net6.0 @@ -34,7 +34,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index ad6c074ce4..0ebeb25d7f 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 92a8502c76..63caf70ac2 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -7,7 +7,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 187fa6df29086af8146fe5cb5c3993044b9a84ce Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Mon, 23 Oct 2023 18:58:40 +0200 Subject: [PATCH 128/845] Return type can be `IEnumerable` --- Directory.Build.props | 2 +- Src/FluentAssertions/Specialized/ExceptionAssertions.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index a536aea668..9c69fe26a5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -13,7 +13,7 @@ true - latest + 7.0 All true diff --git a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs index 5e221d402a..90c0957002 100644 --- a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs @@ -193,7 +193,7 @@ public ExceptionAssertions Where(Expression> return this; } - private Exception[] AssertInnerExceptionExactly(Type innerException, string because = "", + private IEnumerable AssertInnerExceptionExactly(Type innerException, string because = "", params object[] becauseArgs) { Execute.Assertion @@ -213,7 +213,7 @@ private Exception[] AssertInnerExceptionExactly(Type innerException, string beca return expectedExceptions; } - private Exception[] AssertInnerExceptions(Type innerException, string because = "", + private IEnumerable AssertInnerExceptions(Type innerException, string because = "", params object[] becauseArgs) { Execute.Assertion From 31b1519f9f5e1f398e4aaa60935638fb4bcc3a6d Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Mon, 23 Oct 2023 19:00:27 +0200 Subject: [PATCH 129/845] Use verbatim string --- Src/FluentAssertions/Common/StringExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/FluentAssertions/Common/StringExtensions.cs b/Src/FluentAssertions/Common/StringExtensions.cs index e73226c6ee..e464129d4b 100644 --- a/Src/FluentAssertions/Common/StringExtensions.cs +++ b/Src/FluentAssertions/Common/StringExtensions.cs @@ -125,7 +125,7 @@ public static string RemoveNewLines(this string @this) { return @this.Replace("\n", string.Empty, StringComparison.Ordinal) .Replace("\r", string.Empty, StringComparison.Ordinal) - .Replace("\\r\\n", string.Empty, StringComparison.Ordinal); + .Replace(@"\r\n", string.Empty, StringComparison.Ordinal); } /// From 9432f4ddc719369dfe4349da3a85c5effa6f0577 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Mon, 23 Oct 2023 19:00:42 +0200 Subject: [PATCH 130/845] Type member is never accessed via base type --- Src/FluentAssertions/Common/TypeMemberReflector.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/Common/TypeMemberReflector.cs b/Src/FluentAssertions/Common/TypeMemberReflector.cs index fe1d350b24..d7936e4799 100644 --- a/Src/FluentAssertions/Common/TypeMemberReflector.cs +++ b/Src/FluentAssertions/Common/TypeMemberReflector.cs @@ -52,13 +52,13 @@ orderby IsExplicitImplementation(p) }); } - private static bool IsPublic(MethodInfo getMethod) => + private static bool IsPublic(MethodBase getMethod) => !getMethod.IsPrivate && !getMethod.IsFamily; - private static bool IsExplicitlyImplemented(MethodInfo getMethod) => + private static bool IsExplicitlyImplemented(MethodBase getMethod) => getMethod.IsPrivate && getMethod.IsFinal; - private static bool IsInternal(MethodInfo getMethod) => + private static bool IsInternal(MethodBase getMethod) => getMethod.IsAssembly || getMethod.IsFamilyOrAssembly; private static bool IsExplicitImplementation(PropertyInfo property) From 6d52088b4c34a0ed05ee5d8bb185add4df63e7aa Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Mon, 23 Oct 2023 19:00:58 +0200 Subject: [PATCH 131/845] Add test case to possibly silence 'Member can be made private' --- ...ectionAssertionSpecs.NotContainItemsAssignableTo.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainItemsAssignableTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainItemsAssignableTo.cs index 3981430166..8ded54716e 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainItemsAssignableTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainItemsAssignableTo.cs @@ -62,6 +62,16 @@ public void Throws_when_the_passed_type_argument_is_null() act.Should().Throw(); } + [Fact] + public void Succeed_when_type_as_parameter_is_valid_type() + { + // Arrange + var collection = new[] { 1, 2, 3 }; + + // Act / Assert + collection.Should().NotContainItemsAssignableTo(typeof(string)); + } + [Fact] public void Throws_when_the_collection_is_null() { From b3b29fe1e22bfaa26a56a0f871e6f08c4b8d8689 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Mon, 23 Oct 2023 19:03:00 +0200 Subject: [PATCH 132/845] Ignore a few warnings - Use lambda expression - 'Some values of enum are not processed' (switch expression) - Type member is never accessed via base type --- qodana.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qodana.yaml b/qodana.yaml index defc6bb46d..caf1cfb08b 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -23,3 +23,6 @@ exclude: - name: UnusedMember.Global - name: ArrangeTrailingCommaInMultilineLists - name: ArrangeTrailingCommaInSinglelineLists + - name: ConvertToLambdaExpression + - name: SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault + - name: UnusedMemberInSuper.Global From d881fdd9894696dc36a469287c005e717c9b09cc Mon Sep 17 00:00:00 2001 From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> Date: Wed, 25 Oct 2023 22:41:38 +0200 Subject: [PATCH 133/845] Guard methods against assertion scope `[Not]HaveExplicit(Property|Method)` (#2403) * Guard against assertion scope: `[Not]HaveExplicitProperty` * Guard against assertion scope: `[Not]HaveExplicitMethod` * Add release notes --- Src/FluentAssertions/Types/TypeAssertions.cs | 119 ++++++++++-------- .../TypeAssertionSpecs.HaveExplicitMethod.cs | 29 +++++ ...TypeAssertionSpecs.HaveExplicitProperty.cs | 29 +++++ docs/_pages/releases.md | 2 + 4 files changed, 128 insertions(+), 51 deletions(-) diff --git a/Src/FluentAssertions/Types/TypeAssertions.cs b/Src/FluentAssertions/Types/TypeAssertions.cs index 7f4f52aa10..8c25e0bc7d 100644 --- a/Src/FluentAssertions/Types/TypeAssertions.cs +++ b/Src/FluentAssertions/Types/TypeAssertions.cs @@ -462,22 +462,27 @@ public AndConstraint Implement(Type interfaceType, string becaus { Guard.ThrowIfArgumentIsNull(interfaceType); - bool containsInterface = interfaceType.IsAssignableFrom(Subject) && interfaceType != Subject; - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .WithExpectation("Expected type {0} to implement interface {1}{reason}", Subject, interfaceType) - .ForCondition(interfaceType.IsInterface) - .FailWith(", but {0} is not an interface.", interfaceType) - .Then - .ForCondition(containsInterface) - .FailWith(", but it does not.") - .Then - .ClearExpectation(); + AssertSubjectImplements(interfaceType, because, becauseArgs); return new AndConstraint(this); } + private bool AssertSubjectImplements(Type interfaceType, string because = "", params object[] becauseArgs) + { + bool containsInterface = interfaceType.IsAssignableFrom(Subject) && interfaceType != Subject; + + return Execute.Assertion + .BecauseOf(because, becauseArgs) + .WithExpectation("Expected type {0} to implement interface {1}{reason}", Subject, interfaceType) + .ForCondition(interfaceType.IsInterface) + .FailWith(", but {0} is not an interface.", interfaceType) + .Then + .ForCondition(containsInterface) + .FailWith(", but it does not.") + .Then + .ClearExpectation(); + } + /// /// Asserts that the current implements interface . /// @@ -973,15 +978,18 @@ public AndConstraint HaveExplicitProperty( if (success) { - Subject.Should().Implement(interfaceType, because, becauseArgs); - - var explicitlyImplementsProperty = Subject.HasExplicitlyImplementedProperty(interfaceType, name); - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .ForCondition(explicitlyImplementsProperty) - .FailWith( - $"Expected {Subject} to explicitly implement {interfaceType}.{name}{{reason}}, but it does not."); + success = AssertSubjectImplements(interfaceType, because, becauseArgs); + + if (success) + { + var explicitlyImplementsProperty = Subject.HasExplicitlyImplementedProperty(interfaceType, name); + + Execute.Assertion + .BecauseOf(because, becauseArgs) + .ForCondition(explicitlyImplementsProperty) + .FailWith( + $"Expected {Subject} to explicitly implement {interfaceType}.{name}{{reason}}, but it does not."); + } } return new AndConstraint(this); @@ -1040,16 +1048,19 @@ public AndConstraint NotHaveExplicitProperty( if (success) { - Subject.Should().Implement(interfaceType, because, becauseArgs); - - var explicitlyImplementsProperty = Subject.HasExplicitlyImplementedProperty(interfaceType, name); - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .ForCondition(!explicitlyImplementsProperty) - .FailWith( - $"Expected {Subject} to not explicitly implement {interfaceType}.{name}{{reason}}" + - ", but it does."); + success = AssertSubjectImplements(interfaceType, because, becauseArgs); + + if (success) + { + var explicitlyImplementsProperty = Subject.HasExplicitlyImplementedProperty(interfaceType, name); + + Execute.Assertion + .BecauseOf(because, becauseArgs) + .ForCondition(!explicitlyImplementsProperty) + .FailWith( + $"Expected {Subject} to not explicitly implement {interfaceType}.{name}{{reason}}" + + ", but it does."); + } } return new AndConstraint(this); @@ -1111,16 +1122,19 @@ public AndConstraint HaveExplicitMethod( if (success) { - Subject.Should().Implement(interfaceType, because, becauseArgs); - - var explicitlyImplementsMethod = Subject.HasMethod($"{interfaceType}.{name}", parameterTypes); - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .ForCondition(explicitlyImplementsMethod) - .FailWith( - $"Expected {Subject} to explicitly implement {interfaceType}.{name}" + - $"({GetParameterString(parameterTypes)}){{reason}}, but it does not."); + success = AssertSubjectImplements(interfaceType, because, becauseArgs); + + if (success) + { + var explicitlyImplementsMethod = Subject.HasMethod($"{interfaceType}.{name}", parameterTypes); + + Execute.Assertion + .BecauseOf(because, becauseArgs) + .ForCondition(explicitlyImplementsMethod) + .FailWith( + $"Expected {Subject} to explicitly implement {interfaceType}.{name}" + + $"({GetParameterString(parameterTypes)}){{reason}}, but it does not."); + } } return new AndConstraint(this); @@ -1184,16 +1198,19 @@ public AndConstraint NotHaveExplicitMethod( if (success) { - Subject.Should().Implement(interfaceType, because, becauseArgs); - - var explicitlyImplementsMethod = Subject.HasMethod($"{interfaceType}.{name}", parameterTypes); - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .ForCondition(!explicitlyImplementsMethod) - .FailWith( - $"Expected {Subject} to not explicitly implement {interfaceType}.{name}" + - $"({GetParameterString(parameterTypes)}){{reason}}, but it does."); + success = AssertSubjectImplements(interfaceType, because, becauseArgs); + + if (success) + { + var explicitlyImplementsMethod = Subject.HasMethod($"{interfaceType}.{name}", parameterTypes); + + Execute.Assertion + .BecauseOf(because, becauseArgs) + .ForCondition(!explicitlyImplementsMethod) + .FailWith( + $"Expected {Subject} to not explicitly implement {interfaceType}.{name}" + + $"({GetParameterString(parameterTypes)}){{reason}}, but it does."); + } } return new AndConstraint(this); diff --git a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveExplicitMethod.cs b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveExplicitMethod.cs index 7b3ba3e712..9af605c66c 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveExplicitMethod.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveExplicitMethod.cs @@ -1,4 +1,5 @@ using System; +using FluentAssertions.Execution; using Xunit; using Xunit.Sdk; @@ -183,6 +184,19 @@ public void When_asserting_a_type_has_an_explicit_method_with_an_empty_name_it_s act.Should().ThrowExactly() .WithParameterName("name"); } + + [Fact] + public void Does_not_continue_assertion_on_explicit_interface_implementation_if_not_implemented_at_all() + { + var act = () => + { + using var _ = new AssertionScope(); + typeof(ClassWithMembers).Should().HaveExplicitMethod(typeof(IExplicitInterface), "Foo", new Type[0]); + }; + + act.Should().Throw() + .WithMessage("Expected type *ClassWithMembers* to*implement *IExplicitInterface, but it does not."); + } } public class HaveExplicitMethodOfT @@ -440,6 +454,21 @@ public void When_asserting_a_type_does_not_have_an_explicit_method_with_an_empty act.Should().ThrowExactly() .WithParameterName("name"); } + + [Fact] + public void Does_not_continue_assertion_on_explicit_interface_implementation_if_implemented() + { + var act = () => + { + using var _ = new AssertionScope(); + typeof(ClassExplicitlyImplementingInterface) + .Should().NotHaveExplicitMethod(typeof(IExplicitInterface), "ExplicitMethod", new Type[0]); + }; + + act.Should().Throw() + .WithMessage("Expected *ClassExplicitlyImplementingInterface* to not*implement " + + "*IExplicitInterface.ExplicitMethod(), but it does."); + } } public class NotHaveExplicitMethodOfT diff --git a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveExplicitProperty.cs b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveExplicitProperty.cs index 43e84e67a0..36ed2d36ce 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveExplicitProperty.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveExplicitProperty.cs @@ -1,4 +1,5 @@ using System; +using FluentAssertions.Execution; using Xunit; using Xunit.Sdk; @@ -168,6 +169,19 @@ public void When_asserting_a_type_has_an_explicit_property_with_an_empty_name_it act.Should().ThrowExactly() .WithParameterName("name"); } + + [Fact] + public void Does_not_continue_assertion_on_explicit_interface_implementation_if_not_implemented_at_all() + { + var act = () => + { + using var _ = new AssertionScope(); + typeof(int).Should().HaveExplicitProperty(typeof(IExplicitInterface), "Foo"); + }; + + act.Should().Throw() + .WithMessage("Expected type System.Int32 to*implement *IExplicitInterface, but it does not."); + } } public class HaveExplicitPropertyOfT @@ -395,6 +409,21 @@ public void When_asserting_a_type_does_not_have_an_explicit_property_with_an_emp act.Should().ThrowExactly() .WithParameterName("name"); } + + [Fact] + public void Does_not_continue_assertion_on_explicit_interface_implementation_if_implemented() + { + var act = () => + { + using var _ = new AssertionScope(); + typeof(ClassExplicitlyImplementingInterface) + .Should().NotHaveExplicitProperty(typeof(IExplicitInterface), "ExplicitStringProperty"); + }; + + act.Should().Throw() + .WithMessage("Expected *ClassExplicitlyImplementingInterface* to*implement " + + "*IExplicitInterface.ExplicitStringProperty, but it does."); + } } public class NotHaveExplicitPropertyOfT diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 9f47037da2..8a1d139a35 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -26,6 +26,8 @@ sidebar: * Improved the failure message for `NotBeOfType` when wrapped in an `AssertionScope` and the subject is null - [#2399](https://github.com/fluentassertions/fluentassertions/pull/2399) * Improved the failure message for `BeWritable`/`BeReadable` when wrapped in an `AssertionScope` and the subject is read-only/write-only - [#2399](https://github.com/fluentassertions/fluentassertions/pull/2399) * Improved the failure message for `ThrowExactly[Async]` when wrapped in an `AssertionScope` and no exception is thrown - [#2398](https://github.com/fluentassertions/fluentassertions/pull/2398) +* Improved the failure message for `[Not]HaveExplicitProperty` when wrapped in an `AssertionScope` and not implementing the interface - [#2403](https://github.com/fluentassertions/fluentassertions/pull/2403) +* Improved the failure message for `[Not]HaveExplicitMethod` when wrapped in an `AssertionScope` and not implementing the interface - [#2403](https://github.com/fluentassertions/fluentassertions/pull/2403) ### Breaking Changes (for users) From 67fa57085562d0fa290b427a88618f86ea5ba1dc Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 22 Oct 2023 17:27:44 +0200 Subject: [PATCH 134/845] Remove unecessary call to `Subject.Should()` --- Src/FluentAssertions/Collections/GenericCollectionAssertions.cs | 2 +- Src/FluentAssertions/Primitives/ObjectAssertions.cs | 2 +- Src/FluentAssertions/Primitives/StringAssertions.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index 9590af0ac1..91bb48638c 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -1845,7 +1845,7 @@ public AndConstraint NotBeEquivalentTo(IEnumerable NotBeEquivalentTo( using (var scope = new AssertionScope()) { - Subject.Should().BeEquivalentTo(unexpected, config); + BeEquivalentTo(unexpected, config); hasMismatches = scope.Discard().Length > 0; } diff --git a/Src/FluentAssertions/Primitives/StringAssertions.cs b/Src/FluentAssertions/Primitives/StringAssertions.cs index e383b9fc86..ba82219096 100644 --- a/Src/FluentAssertions/Primitives/StringAssertions.cs +++ b/Src/FluentAssertions/Primitives/StringAssertions.cs @@ -143,7 +143,7 @@ public AndConstraint NotBeEquivalentTo(string unexpected, string be using (var scope = new AssertionScope()) { - Subject.Should().BeEquivalentTo(unexpected); + BeEquivalentTo(unexpected); notEquivalent = scope.Discard().Length > 0; } From 287b6678f54012dbc0574cafb8f1ee86956ee619 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 3 Sep 2023 10:41:37 +0200 Subject: [PATCH 135/845] Introduced a new attribute to allow global initialization of the assertion engine fixup! Introduced a new attribute to allow global initialization of the assertion engine fixup! Introduced a new attribute to allow global initialization of the assertion engine fixup! Introduced a new attribute to allow global initialization of the assertion engine --- Build/Build.cs | 1 + FluentAssertions.sln | 9 ++ Src/FluentAssertions/AssertionExtensions.cs | 5 ++ Src/FluentAssertions/AssertionOptions.cs | 1 + Src/FluentAssertions/Common/Services.cs | 84 +++++++++++++++++-- Src/FluentAssertions/Execution/Execute.cs | 13 ++- .../AssertionEngineInitializerAttribute.cs | 30 +++++++ .../FluentAssertions/net47.verified.txt | 8 ++ .../FluentAssertions/net6.0.verified.txt | 8 ++ .../netstandard2.0.verified.txt | 8 ++ .../netstandard2.1.verified.txt | 8 ++ .../AssertionEngineInitializer.cs | 20 +++++ .../ExtensionAssemblyAttributeSpecs.cs | 15 ++++ ...luentAssertions.Extensibility.Specs.csproj | 41 +++++++++ .../Usings.cs | 1 + docs/_data/navigation.yml | 2 + docs/_pages/extensibility.md | 15 ++++ docs/_pages/introduction.md | 18 ++++ docs/_pages/releases.md | 2 + 19 files changed, 281 insertions(+), 8 deletions(-) create mode 100644 Src/FluentAssertions/Extensibility/AssertionEngineInitializerAttribute.cs create mode 100644 Tests/FluentAssertions.Extensibility.Specs/AssertionEngineInitializer.cs create mode 100644 Tests/FluentAssertions.Extensibility.Specs/ExtensionAssemblyAttributeSpecs.cs create mode 100644 Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj create mode 100644 Tests/FluentAssertions.Extensibility.Specs/Usings.cs diff --git a/Build/Build.cs b/Build/Build.cs index d78719fc3e..44ec118547 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -163,6 +163,7 @@ class Build : NukeBuild { Solution.Specs.FluentAssertions_Specs, Solution.Specs.FluentAssertions_Equivalency_Specs, + Solution.Specs.FluentAssertions_Extensibility_Specs, Solution.Specs.FSharp_Specs, Solution.Specs.VB_Specs }; diff --git a/FluentAssertions.sln b/FluentAssertions.sln index 52e93a3c91..3a4453f573 100644 --- a/FluentAssertions.sln +++ b/FluentAssertions.sln @@ -53,6 +53,8 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Specs", "Tests\FShar EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleExtensions", "Tests\ExampleExtensions\ExampleExtensions.csproj", "{8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentAssertions.Extensibility.Specs", "Tests\FluentAssertions.Extensibility.Specs\FluentAssertions.Extensibility.Specs.csproj", "{450FC408-A4E2-4483-B064-2007024D6CF1}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution CI|Any CPU = CI|Any CPU @@ -143,6 +145,12 @@ Global {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}.Debug|Any CPU.Build.0 = Debug|Any CPU {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}.Release|Any CPU.ActiveCfg = Release|Any CPU {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}.Release|Any CPU.Build.0 = Release|Any CPU + {450FC408-A4E2-4483-B064-2007024D6CF1}.CI|Any CPU.ActiveCfg = Debug|Any CPU + {450FC408-A4E2-4483-B064-2007024D6CF1}.CI|Any CPU.Build.0 = Debug|Any CPU + {450FC408-A4E2-4483-B064-2007024D6CF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {450FC408-A4E2-4483-B064-2007024D6CF1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {450FC408-A4E2-4483-B064-2007024D6CF1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {450FC408-A4E2-4483-B064-2007024D6CF1}.Release|Any CPU.Build.0 = Release|Any CPU {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.CI|Any CPU.ActiveCfg = Debug|Any CPU {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.CI|Any CPU.Build.0 = Debug|Any CPU {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -169,6 +177,7 @@ Global {0C0211B6-D185-4518-A15A-38AC092EDC50} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} + {450FC408-A4E2-4483-B064-2007024D6CF1} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {75DDA3D8-9D6F-4865-93F4-DDE11DEE8290} diff --git a/Src/FluentAssertions/AssertionExtensions.cs b/Src/FluentAssertions/AssertionExtensions.cs index 5a0c9d831b..d2ed6822d9 100644 --- a/Src/FluentAssertions/AssertionExtensions.cs +++ b/Src/FluentAssertions/AssertionExtensions.cs @@ -33,6 +33,11 @@ public static class AssertionExtensions { private static readonly AggregateExceptionExtractor Extractor = new(); + static AssertionExtensions() + { + Services.EnsureInitialized(); + } + /// /// Invokes the specified action on a subject so that you can chain it /// with any of the assertions from diff --git a/Src/FluentAssertions/AssertionOptions.cs b/Src/FluentAssertions/AssertionOptions.cs index 3ce1f64f0e..7f30d1b36a 100644 --- a/Src/FluentAssertions/AssertionOptions.cs +++ b/Src/FluentAssertions/AssertionOptions.cs @@ -15,6 +15,7 @@ public static class AssertionOptions static AssertionOptions() { EquivalencyPlan = new EquivalencyPlan(); + Services.EnsureInitialized(); } /// diff --git a/Src/FluentAssertions/Common/Services.cs b/Src/FluentAssertions/Common/Services.cs index dd283265ee..57b6a21d02 100644 --- a/Src/FluentAssertions/Common/Services.cs +++ b/Src/FluentAssertions/Common/Services.cs @@ -1,5 +1,9 @@ -using System; +using System; +using System.Linq; +using System.Reflection; using FluentAssertions.Execution; +using FluentAssertions.Extensibility; +using JetBrains.Annotations; namespace FluentAssertions.Common; @@ -10,10 +14,11 @@ public static class Services { private static readonly object Lockable = new(); private static Configuration configuration; + private static bool isInitialized; static Services() { - ResetToDefaults(); + EnsureInitialized(); } public static IConfigurationStore ConfigurationStore { get; set; } @@ -33,14 +38,81 @@ public static Configuration Configuration public static IReflector Reflector { get; set; } + [PublicAPI] public static void ResetToDefaults() { - Reflector = new FullFrameworkReflector(); + isInitialized = false; + EnsureInitialized(); + } + + internal static void EnsureInitialized() + { + if (isInitialized) + { + return; + } + + lock (Lockable) + { + if (!isInitialized) + { + ExecuteCustomInitializers(); + + Reflector = new FullFrameworkReflector(); #if NETFRAMEWORK || NET6_0_OR_GREATER - ConfigurationStore = new ConfigurationStoreExceptionInterceptor(new AppSettingsConfigurationStore()); + ConfigurationStore = new ConfigurationStoreExceptionInterceptor(new AppSettingsConfigurationStore()); #else - ConfigurationStore = new NullConfigurationStore(); + ConfigurationStore = new NullConfigurationStore(); #endif - ThrowException = new TestFrameworkProvider(Configuration).Throw; + ThrowException = new TestFrameworkProvider(Configuration).Throw; + + isInitialized = true; + } + } + } + + private static void ExecuteCustomInitializers() + { + var currentAssembly = Assembly.GetExecutingAssembly(); + var currentAssemblyName = currentAssembly.GetName(); + + var attributes = Array.Empty(); + + try + { + attributes = AppDomain.CurrentDomain + .GetAssemblies() + .Where(assembly => assembly != currentAssembly && !assembly.IsDynamic && !IsFramework(assembly)) + .Where(a => a.GetReferencedAssemblies().Any(r => r.FullName == currentAssemblyName.FullName)) + .SelectMany(a => a.GetCustomAttributes()) + .ToArray(); + } + catch + { + // Just ignore any exceptions that might happen while trying to find the attributes + } + + foreach (var attribute in attributes) + { + try + { + attribute.Initialize(); + } + catch + { + // Just ignore any exceptions that might happen while trying to find the attributes + } + } + } + + private static bool IsFramework(Assembly assembly) + { + #if NET6_0_OR_GREATER + return assembly!.FullName?.StartsWith("Microsoft.", StringComparison.OrdinalIgnoreCase) == true || + assembly.FullName?.StartsWith("System.", StringComparison.OrdinalIgnoreCase) == true; + #else + return assembly.FullName.StartsWith("Microsoft.", StringComparison.OrdinalIgnoreCase) || + assembly.FullName.StartsWith("System.", StringComparison.OrdinalIgnoreCase); + #endif } } diff --git a/Src/FluentAssertions/Execution/Execute.cs b/Src/FluentAssertions/Execution/Execute.cs index 208e98fb35..9533780cb4 100644 --- a/Src/FluentAssertions/Execution/Execute.cs +++ b/Src/FluentAssertions/Execution/Execute.cs @@ -1,4 +1,6 @@ -namespace FluentAssertions.Execution; +using FluentAssertions.Common; + +namespace FluentAssertions.Execution; /// /// Helper class for verifying a condition and/or throwing a test harness specific exception representing an assertion failure. @@ -8,5 +10,12 @@ public static class Execute /// /// Gets an object that wraps and executes a conditional or unconditional assertion. /// - public static AssertionScope Assertion => AssertionScope.Current; + public static AssertionScope Assertion + { + get + { + Services.EnsureInitialized(); + return AssertionScope.Current; + } + } } diff --git a/Src/FluentAssertions/Extensibility/AssertionEngineInitializerAttribute.cs b/Src/FluentAssertions/Extensibility/AssertionEngineInitializerAttribute.cs new file mode 100644 index 0000000000..c6f5d4f4e2 --- /dev/null +++ b/Src/FluentAssertions/Extensibility/AssertionEngineInitializerAttribute.cs @@ -0,0 +1,30 @@ +using System; +using System.Reflection; + +namespace FluentAssertions.Extensibility; + +/// +/// Can be added to an assembly so it gets a change to initialize Fluent Assertions before the first assertion happens. +/// +[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] +public sealed class AssertionEngineInitializerAttribute : Attribute +{ + private readonly string methodName; + private readonly Type type; + + /// + /// Defines the static void-returning and parameterless method that should be invoked before the first assertion happens. + /// +#pragma warning disable CA1019 + public AssertionEngineInitializerAttribute(Type type, string methodName) +#pragma warning restore CA1019 + { + this.type = type; + this.methodName = methodName; + } + + internal void Initialize() + { + type?.GetMethod(methodName, BindingFlags.Public | BindingFlags.Static)?.Invoke(obj: null, parameters: null); + } +} diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 521562257a..7a7d238434 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -1255,6 +1255,14 @@ namespace FluentAssertions.Execution public string FormattedMessage { get; set; } } } +namespace FluentAssertions.Extensibility +{ + [System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)] + public sealed class AssertionEngineInitializerAttribute : System.Attribute + { + public AssertionEngineInitializerAttribute(System.Type type, string methodName) { } + } +} namespace FluentAssertions.Extensions { public static class FluentDateTimeExtensions diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 29636f86a4..8ab95145fa 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -1268,6 +1268,14 @@ namespace FluentAssertions.Execution public string FormattedMessage { get; set; } } } +namespace FluentAssertions.Extensibility +{ + [System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)] + public sealed class AssertionEngineInitializerAttribute : System.Attribute + { + public AssertionEngineInitializerAttribute(System.Type type, string methodName) { } + } +} namespace FluentAssertions.Extensions { public static class FluentDateTimeExtensions diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index dbd61567d4..437f323d88 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -1206,6 +1206,14 @@ namespace FluentAssertions.Execution public string FormattedMessage { get; set; } } } +namespace FluentAssertions.Extensibility +{ + [System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)] + public sealed class AssertionEngineInitializerAttribute : System.Attribute + { + public AssertionEngineInitializerAttribute(System.Type type, string methodName) { } + } +} namespace FluentAssertions.Extensions { public static class FluentDateTimeExtensions diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index d6e22422b5..0c651a41f7 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -1255,6 +1255,14 @@ namespace FluentAssertions.Execution public string FormattedMessage { get; set; } } } +namespace FluentAssertions.Extensibility +{ + [System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)] + public sealed class AssertionEngineInitializerAttribute : System.Attribute + { + public AssertionEngineInitializerAttribute(System.Type type, string methodName) { } + } +} namespace FluentAssertions.Extensions { public static class FluentDateTimeExtensions diff --git a/Tests/FluentAssertions.Extensibility.Specs/AssertionEngineInitializer.cs b/Tests/FluentAssertions.Extensibility.Specs/AssertionEngineInitializer.cs new file mode 100644 index 0000000000..80cf5b9c4a --- /dev/null +++ b/Tests/FluentAssertions.Extensibility.Specs/AssertionEngineInitializer.cs @@ -0,0 +1,20 @@ +using System.Threading; + +// With specific initialization code to invoke before the first assertion happens +[assembly: FluentAssertions.Extensibility.AssertionEngineInitializer( + typeof(FluentAssertions.Extensibility.Specs.AssertionEngineInitializer), + nameof(FluentAssertions.Extensibility.Specs.AssertionEngineInitializer.InitializeBeforeFirstAssertion))] + +namespace FluentAssertions.Extensibility.Specs; + +public static class AssertionEngineInitializer +{ + private static int shouldBeCalledOnlyOnce; + + public static int ShouldBeCalledOnlyOnce => shouldBeCalledOnlyOnce; + + public static void InitializeBeforeFirstAssertion() + { + Interlocked.Increment(ref shouldBeCalledOnlyOnce); + } +} diff --git a/Tests/FluentAssertions.Extensibility.Specs/ExtensionAssemblyAttributeSpecs.cs b/Tests/FluentAssertions.Extensibility.Specs/ExtensionAssemblyAttributeSpecs.cs new file mode 100644 index 0000000000..ee70fd8b5c --- /dev/null +++ b/Tests/FluentAssertions.Extensibility.Specs/ExtensionAssemblyAttributeSpecs.cs @@ -0,0 +1,15 @@ +namespace FluentAssertions.Extensibility.Specs; + +public class ExtensionAssemblyAttributeSpecs +{ + [Fact] + public void Calls_assembly_initialization_code_only_once() + { + for (int i = 0; i < 10; i++) + { + var act = () => AssertionEngineInitializer.ShouldBeCalledOnlyOnce.Should().Be(1); + + act.Should().NotThrow(); + } + } +} diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj new file mode 100644 index 0000000000..08c9379412 --- /dev/null +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -0,0 +1,41 @@ + + + + net6.0;net47 + True + ..\..\Src\FluentAssertions\FluentAssertions.snk + false + $(NoWarn),IDE0052,1573,1591,1712 + full + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + diff --git a/Tests/FluentAssertions.Extensibility.Specs/Usings.cs b/Tests/FluentAssertions.Extensibility.Specs/Usings.cs new file mode 100644 index 0000000000..c802f4480b --- /dev/null +++ b/Tests/FluentAssertions.Extensibility.Specs/Usings.cs @@ -0,0 +1 @@ +global using Xunit; diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index 7726d5c268..e283cca660 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -33,6 +33,8 @@ sidebar: url: /introduction#detecting-test-frameworks - title: Subject Identification url: /introduction#subject-identification + - title: Global Configuration + url: /introduction#global-configuration - title: Assertion Scopes url: /introduction#assertion-scopes - title: Basic Assertions diff --git a/docs/_pages/extensibility.md b/docs/_pages/extensibility.md index dc4fc52bec..a6615ac8f1 100644 --- a/docs/_pages/extensibility.md +++ b/docs/_pages/extensibility.md @@ -275,6 +275,21 @@ internal static class Initializer } ``` +Unfortunately, this only works for .NET 5 and higher. That's why Fluent Assertions supports its own "module initializer" through the `[AssertionEngineInitializer]` attribute. It can be used multiple times. + +```csharp +[assembly: AssertionEngineInitializer(typeof(Initializer), nameof(Initializer.Initialize))] + +public static class Initializer +{ + public static void Initialize() + { + AssertionOptions.AssertEquivalencyUsing(options => options + .ComparingByValue()); + } +} +``` + ### MSTest MSTest provides the `AssemblyInitializeAttribute` to annotate that a method in a `TestClass` should be run once per assembly. diff --git a/docs/_pages/introduction.md b/docs/_pages/introduction.md index 8f98ede3f1..43d06b7fa3 100644 --- a/docs/_pages/introduction.md +++ b/docs/_pages/introduction.md @@ -63,6 +63,23 @@ xDocument.Should().HaveElement("child").Which.Should().BeOfType().And. This chaining can make your unit tests a lot easier to read. +## Global Configurations + +Fluent Assertions `AssertionOptions` has several methods and properties that can be used to change the way it executes assertions or the defaults it will use for comparing object graphs. Changing those settings at the right time can be difficult, depending on the test framework. That's why Fluent Assertions offers a special assembly-level attribute that can be used to have some code executed _before_ the first assertion is executed. It will be called only once per test run, but you can use the attribute multiple times. + +```csharp +[assembly: AssertionEngineInitializer(typeof(Initializer), nameof(Initializer.Initialize))] + +public static class Initializer +{ + public static void Initialize() + { + AssertionOptions.AssertEquivalencyUsing(options => options + .ComparingByValue()); + } +} +``` + ## Detecting Test Frameworks Fluent Assertions supports a lot of different unit testing frameworks. Just add a reference to the corresponding test framework assembly to the unit test project. Fluent Assertions will automatically find the corresponding assembly and use it for throwing the framework-specific exceptions. @@ -152,3 +169,4 @@ Expected string to be "Expected" with a length of 8, but "Actual" has a length o ``` For more information take a look at the [AssertionScopeSpecs.cs](https://github.com/fluentassertions/fluentassertions/blob/master/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs) in Unit Tests. + diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 8a1d139a35..c425d16514 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -11,6 +11,8 @@ sidebar: ### What's new +* Introduced a new assembly-level attribute that you can use to initialize Fluent Assertions before the first assertion - [#2292](https://github.com/fluentassertions/fluentassertions/pull/2292) + ### Improvements * Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) * You can mark all assertions in an assembly as custom assertions using the `[CustomAssertionsAssembly]` attribute - [#2389](https://github.com/fluentassertions/fluentassertions/pull/2389) From 55ec67758d161f71528266938795777989c58ab0 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Tue, 24 Oct 2023 20:27:15 +0200 Subject: [PATCH 136/845] Ensure all code from the core assembly in a stack trace is ignored by the caller identification logic --- Src/FluentAssertions/CallerIdentifier.cs | 3 ++- .../Execution/CallerIdentifierSpecs.cs | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/Src/FluentAssertions/CallerIdentifier.cs b/Src/FluentAssertions/CallerIdentifier.cs index 525bba71d1..cdc91b31ec 100644 --- a/Src/FluentAssertions/CallerIdentifier.cs +++ b/Src/FluentAssertions/CallerIdentifier.cs @@ -56,7 +56,8 @@ public static string DetermineCallerIdentity() if (frame.GetMethod() is not null && !IsDynamic(frame) && !IsDotNet(frame) - && !IsCustomAssertion(frame)) + && !IsCustomAssertion(frame) + && !IsCurrentAssembly(frame)) { caller = ExtractVariableNameFrom(frame); break; diff --git a/Tests/FluentAssertions.Specs/Execution/CallerIdentifierSpecs.cs b/Tests/FluentAssertions.Specs/Execution/CallerIdentifierSpecs.cs index 6af9c8ce86..e3c127f626 100644 --- a/Tests/FluentAssertions.Specs/Execution/CallerIdentifierSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/CallerIdentifierSpecs.cs @@ -4,8 +4,10 @@ using System.Linq; using System.Threading.Tasks; using FluentAssertions; +using FluentAssertions.Equivalency; using FluentAssertions.Execution; using FluentAssertions.Extensions; +using FluentAssertions.Primitives; using Xunit; using Xunit.Sdk; @@ -548,6 +550,28 @@ public void An_object_initializer_preceding_an_assertion_is_not_an_identifier() act.Should().Throw() .WithMessage("Expected object to be*"); } + + [Fact] + public void All_core_code_anywhere_in_the_stack_trace_is_ignored() + { + /* + We want to test this specific scenario. + + 1. CallerIdentifier.DetermineCallerIdentity + 2. FluentAssertions code + 3. Custom extension <--- pointed to by lastUserStackFrameBeforeFluentAssertionsCodeIndex + 4. FluentAssertions code <--- this is where DetermineCallerIdentity tried to get the variable name from before the fix + 5. Test + */ + + var node = Node.From(GetSubjectId); + + // Assert + node.Description.Should().StartWith("node.Description"); + } + + [CustomAssertion] + private string GetSubjectId() => AssertionScope.Current.CallerIdentity; } #pragma warning disable IDE0060, RCS1163 // Remove unused parameter From 9418efef9203f7108d709c98b86f7bdc7951ddca Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Thu, 26 Oct 2023 19:34:24 +0200 Subject: [PATCH 137/845] Reformat file --- Src/FluentAssertions/Common/Services.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Src/FluentAssertions/Common/Services.cs b/Src/FluentAssertions/Common/Services.cs index 57b6a21d02..a20c7562a7 100644 --- a/Src/FluentAssertions/Common/Services.cs +++ b/Src/FluentAssertions/Common/Services.cs @@ -62,7 +62,7 @@ internal static void EnsureInitialized() #if NETFRAMEWORK || NET6_0_OR_GREATER ConfigurationStore = new ConfigurationStoreExceptionInterceptor(new AppSettingsConfigurationStore()); #else - ConfigurationStore = new NullConfigurationStore(); + ConfigurationStore = new NullConfigurationStore(); #endif ThrowException = new TestFrameworkProvider(Configuration).Throw; @@ -107,12 +107,12 @@ private static void ExecuteCustomInitializers() private static bool IsFramework(Assembly assembly) { - #if NET6_0_OR_GREATER +#if NET6_0_OR_GREATER return assembly!.FullName?.StartsWith("Microsoft.", StringComparison.OrdinalIgnoreCase) == true || assembly.FullName?.StartsWith("System.", StringComparison.OrdinalIgnoreCase) == true; - #else +#else return assembly.FullName.StartsWith("Microsoft.", StringComparison.OrdinalIgnoreCase) || assembly.FullName.StartsWith("System.", StringComparison.OrdinalIgnoreCase); - #endif +#endif } } From 2059c96eeb6bcb78e1a63656eb58e170b8a3d424 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Thu, 26 Oct 2023 19:36:28 +0200 Subject: [PATCH 138/845] Fix MA0069 and SA1401 --- Build/Configuration.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Build/Configuration.cs b/Build/Configuration.cs index 79a1433858..3de0a1c880 100644 --- a/Build/Configuration.cs +++ b/Build/Configuration.cs @@ -4,9 +4,9 @@ [TypeConverter(typeof(TypeConverter))] public class Configuration : Enumeration { - public static Configuration Debug = new() { Value = nameof(Debug) }; + public static readonly Configuration Debug = new() { Value = nameof(Debug) }; - public static Configuration CI = new() { Value = nameof(CI) }; + public static readonly Configuration CI = new() { Value = nameof(CI) }; public static implicit operator string(Configuration configuration) { From d0199f38dc199f94cb4556aeff842c7a35b95155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Luthi?= Date: Fri, 27 Oct 2023 09:04:21 +0200 Subject: [PATCH 139/845] Simplify the ApiApproval test (#2381) * Simplify the ApiApproval test (1/2) Simplify how paths relative to the solution directory are accessed. * Simplify the ApiApproval test (2/2) Actually use the Verify.DiffPlex integration instead of using DiffPlex directly. * Address pull request feedback * Use the new minimal diff output style --- Tests/Approval.Tests/ApiApproval.cs | 73 +++++----------------- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 2 files changed, 18 insertions(+), 57 deletions(-) diff --git a/Tests/Approval.Tests/ApiApproval.cs b/Tests/Approval.Tests/ApiApproval.cs index c9b3726f6f..44163b414e 100644 --- a/Tests/Approval.Tests/ApiApproval.cs +++ b/Tests/Approval.Tests/ApiApproval.cs @@ -1,16 +1,13 @@ -using System; -using System.Collections.Generic; -using System.IO; +using System.IO; +using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; -using System.Text; using System.Threading.Tasks; using System.Xml.Linq; using System.Xml.XPath; -using DiffPlex.DiffBuilder; -using DiffPlex.DiffBuilder.Model; using PublicApiGenerator; using VerifyTests; +using VerifyTests.DiffPlex; using VerifyXunit; using Xunit; @@ -19,72 +16,30 @@ namespace Approval.Tests; [UsesVerify] public class ApiApproval { + static ApiApproval() => VerifyDiffPlex.Initialize(OutputType.Minimal); + [Theory] [ClassData(typeof(TargetFrameworksTheoryData))] - public Task ApproveApi(string frameworkVersion) + public Task ApproveApi(string framework) { - string codeBase = Assembly.GetExecutingAssembly().Location; - var uri = new UriBuilder(new Uri(codeBase)); - string assemblyPath = Uri.UnescapeDataString(uri.Path); - var containingDirectory = Path.GetDirectoryName(assemblyPath); - var configurationName = new DirectoryInfo(containingDirectory).Parent.Name; - - var assemblyFile = Path.GetFullPath( - Path.Combine( - GetSourceDirectory(), - Path.Combine("..", "..", "Src", "FluentAssertions", "bin", configurationName, frameworkVersion, - "FluentAssertions.dll"))); - - var assembly = Assembly.LoadFile(Path.GetFullPath(assemblyFile)); + var configuration = typeof(ApiApproval).Assembly.GetCustomAttribute()!.Configuration; + var assemblyFile = CombinedPaths("Src", "FluentAssertions", "bin", configuration, framework, "FluentAssertions.dll"); + var assembly = Assembly.LoadFile(assemblyFile); var publicApi = assembly.GeneratePublicApi(options: null); return Verifier .Verify(publicApi) .ScrubLinesContaining("FrameworkDisplayName") .UseDirectory(Path.Combine("ApprovedApi", "FluentAssertions")) - .UseStringComparer(OnlyIncludeChanges) - .UseFileName(frameworkVersion) + .UseFileName(framework) .DisableDiff(); } - private static string GetSourceDirectory([CallerFilePath] string path = "") => Path.GetDirectoryName(path); - - // Copied from https://github.com/VerifyTests/Verify.DiffPlex/blob/master/src/Verify.DiffPlex/VerifyDiffPlex.cs - public static Task OnlyIncludeChanges(string received, string verified, IReadOnlyDictionary _) - { - var diff = InlineDiffBuilder.Diff(verified, received); - - var builder = new StringBuilder(); - - foreach (var line in diff.Lines) - { - switch (line.Type) - { - case ChangeType.Inserted: - builder.Append("+ "); - break; - case ChangeType.Deleted: - builder.Append("- "); - break; - default: - // omit unchanged files - continue; - } - - builder.AppendLine(line.Text); - } - - var compareResult = CompareResult.NotEqual(builder.ToString()); - return Task.FromResult(compareResult); - } - private class TargetFrameworksTheoryData : TheoryData { public TargetFrameworksTheoryData() { - var csproj = Path.Combine(GetSourceDirectory(), - Path.Combine("..", "..", "Src", "FluentAssertions", "FluentAssertions.csproj")); - + var csproj = CombinedPaths("Src", "FluentAssertions", "FluentAssertions.csproj"); var project = XDocument.Load(csproj); var targetFrameworks = project.XPathSelectElement("/Project/PropertyGroup/TargetFrameworks"); @@ -94,4 +49,10 @@ public TargetFrameworksTheoryData() } } } + + private static string GetSolutionDirectory([CallerFilePath] string path = "") => + Path.Combine(Path.GetDirectoryName(path)!, "..", ".."); + + private static string CombinedPaths(params string[] paths) => + Path.GetFullPath(Path.Combine(paths.Prepend(GetSolutionDirectory()).ToArray())); } diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 4241fef2be..6e05e11a5e 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + From 254172106c37fb7dab12acd6452252f6a42ea147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Mon, 30 Oct 2023 13:58:44 +0100 Subject: [PATCH 140/845] Split ObjectAssertionSpecs in multiple files similar to StringAssertionSpecs in #1903 (#2416) --- .../Primitives/ObjectAssertionSpecs.Be.cs | 354 ++++ .../ObjectAssertionSpecs.BeAssignableTo.cs | 393 +++++ ...sertionSpecs.BeDataContractSerializable.cs | 125 ++ .../Primitives/ObjectAssertionSpecs.BeNull.cs | 91 + .../ObjectAssertionSpecs.BeOfType.cs | 253 +++ .../ObjectAssertionSpecs.BeOneOf.cs | 221 +++ .../ObjectAssertionSpecs.BeXmlSerializable.cs | 103 ++ .../Primitives/ObjectAssertionSpecs.cs | 1490 +---------------- 8 files changed, 1544 insertions(+), 1486 deletions(-) create mode 100644 Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.Be.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeAssignableTo.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeDataContractSerializable.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeNull.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOfType.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOneOf.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.Be.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.Be.cs new file mode 100644 index 0000000000..93a2900427 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.Be.cs @@ -0,0 +1,354 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class ObjectAssertionSpecs +{ + public class Be + { + [Fact] + public void When_two_equal_object_are_expected_to_be_equal_it_should_not_fail() + { + // Arrange + var someObject = new ClassWithCustomEqualMethod(1); + var equalObject = new ClassWithCustomEqualMethod(1); + + // Act / Assert + someObject.Should().Be(equalObject); + } + + [Fact] + public void When_two_different_objects_are_expected_to_be_equal_it_should_fail_with_a_clear_explanation() + { + // Arrange + var someObject = new ClassWithCustomEqualMethod(1); + var nonEqualObject = new ClassWithCustomEqualMethod(2); + + // Act + Action act = () => someObject.Should().Be(nonEqualObject); + + // Assert + act.Should().Throw().WithMessage( + "Expected someObject to be ClassWithCustomEqualMethod(2), but found ClassWithCustomEqualMethod(1)."); + } + + [Fact] + public void When_both_subject_and_expected_are_null_it_should_succeed() + { + // Arrange + object someObject = null; + object expectedObject = null; + + // Act / Assert + someObject.Should().Be(expectedObject); + } + + [Fact] + public void When_the_subject_is_null_it_should_fail() + { + // Arrange + object someObject = null; + var nonEqualObject = new ClassWithCustomEqualMethod(2); + + // Act + Action act = () => someObject.Should().Be(nonEqualObject); + + // Assert + act.Should().Throw() + .WithMessage("Expected someObject to be ClassWithCustomEqualMethod(2), but found ."); + } + + [Fact] + public void When_two_different_objects_are_expected_to_be_equal_it_should_fail_and_use_the_reason() + { + // Arrange + var someObject = new ClassWithCustomEqualMethod(1); + var nonEqualObject = new ClassWithCustomEqualMethod(2); + + // Act + Action act = () => someObject.Should().Be(nonEqualObject, "because it should use the {0}", "reason"); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected someObject to be ClassWithCustomEqualMethod(2) because it should use the reason, but found ClassWithCustomEqualMethod(1)."); + } + + [Fact] + public void When_comparing_a_numeric_and_an_enum_for_equality_it_should_throw() + { + // Arrange + object subject = 1; + MyEnum expected = MyEnum.One; + + // Act + Action act = () => subject.Should().Be(expected); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void An_untyped_value_is_equal_to_another_according_to_a_comparer() + { + // Arrange + object value = new SomeClass(5); + + // Act / Assert + value.Should().Be(new SomeClass(5), new SomeClassEqualityComparer()); + } + + [Fact] + public void A_typed_value_is_equal_to_another_according_to_a_comparer() + { + // Arrange + var value = new SomeClass(5); + + // Act / Assert + value.Should().Be(new SomeClass(5), new SomeClassEqualityComparer()); + } + + [Fact] + public void An_untyped_value_is_not_equal_to_another_according_to_a_comparer() + { + // Arrange + object value = new SomeClass(3); + + // Act + Action act = () => value.Should().Be(new SomeClass(4), new SomeClassEqualityComparer(), "I said so"); + + // Assert + act.Should().Throw().WithMessage("Expected value to be SomeClass(4)*I said so*found SomeClass(3)."); + } + + [Fact] + public void A_typed_value_is_not_equal_to_another_according_to_a_comparer() + { + // Arrange + var value = new SomeClass(3); + + // Act + Action act = () => value.Should().Be(new SomeClass(4), new SomeClassEqualityComparer(), "I said so"); + + // Assert + act.Should().Throw().WithMessage("Expected value to be SomeClass(4)*I said so*found SomeClass(3)."); + } + + [Fact] + public void A_typed_value_is_not_of_the_same_type() + { + // Arrange + var value = new ClassWithCustomEqualMethod(3); + + // Act + Action act = () => value.Should().Be(new SomeClass(3), new SomeClassEqualityComparer(), "I said so"); + + // Assert + act.Should().Throw() + .WithMessage("Expected value to be SomeClass(3)*I said so*found ClassWithCustomEqualMethod(3)."); + } + + [Fact] + public void A_untyped_value_requires_a_comparer() + { + // Arrange + object value = new SomeClass(3); + + // Act + Action act = () => value.Should().Be(new SomeClass(3), comparer: null); + + // Assert + act.Should().Throw().WithParameterName("comparer"); + } + + [Fact] + public void A_typed_value_requires_a_comparer() + { + // Arrange + var value = new SomeClass(3); + + // Act + Action act = () => value.Should().Be(new SomeClass(3), comparer: null); + + // Assert + act.Should().Throw().WithParameterName("comparer"); + } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + var value = new SomeClass(3); + + // Act / Assert + value.Should().Be(value).And.NotBeNull(); + } + + [Fact] + public void Can_chain_multiple_assertions() + { + // Arrange + var value = new object(); + + // Act / Assert + value.Should().Be(value, new DumbObjectEqualityComparer()).And.NotBeNull(); + } + } + + public class NotBe + { + [Fact] + public void When_non_equal_objects_are_expected_to_be_not_equal_it_should_not_fail() + { + // Arrange + var someObject = new ClassWithCustomEqualMethod(1); + var nonEqualObject = new ClassWithCustomEqualMethod(2); + + // Act / Assert + someObject.Should().NotBe(nonEqualObject); + } + + [Fact] + public void When_two_equal_objects_are_expected_not_to_be_equal_it_should_fail_with_a_clear_explanation() + { + // Arrange + var someObject = new ClassWithCustomEqualMethod(1); + var equalObject = new ClassWithCustomEqualMethod(1); + + // Act + Action act = () => + someObject.Should().NotBe(equalObject); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect someObject to be equal to ClassWithCustomEqualMethod(1)."); + } + + [Fact] + public void When_two_equal_objects_are_expected_not_to_be_equal_it_should_fail_and_use_the_reason() + { + // Arrange + var someObject = new ClassWithCustomEqualMethod(1); + var equalObject = new ClassWithCustomEqualMethod(1); + + // Act + Action act = () => + someObject.Should().NotBe(equalObject, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect someObject to be equal to ClassWithCustomEqualMethod(1) " + + "because we want to test the failure message."); + } + + [Fact] + public void An_untyped_value_is_not_equal_to_another_according_to_a_comparer() + { + // Arrange + object value = new SomeClass(5); + + // Act / Assert + value.Should().NotBe(new SomeClass(4), new SomeClassEqualityComparer()); + } + + [Fact] + public void A_typed_value_is_not_equal_to_another_according_to_a_comparer() + { + // Arrange + var value = new SomeClass(5); + + // Act / Assert + value.Should().NotBe(new SomeClass(4), new SomeClassEqualityComparer()); + } + + [Fact] + public void An_untyped_value_is_equal_to_another_according_to_a_comparer() + { + // Arrange + object value = new SomeClass(3); + + // Act + Action act = () => value.Should().NotBe(new SomeClass(3), new SomeClassEqualityComparer(), "I said so"); + + // Assert + act.Should().Throw().WithMessage("Did not expect value to be equal to SomeClass(3)*I said so*"); + } + + [Fact] + public void A_typed_value_is_equal_to_another_according_to_a_comparer() + { + // Arrange + var value = new SomeClass(3); + + // Act + Action act = () => value.Should().NotBe(new SomeClass(3), new SomeClassEqualityComparer(), "I said so"); + + // Assert + act.Should().Throw().WithMessage("Did not expect value to be equal to SomeClass(3)*I said so*"); + } + + [Fact] + public void A_typed_value_is_not_of_the_same_type() + { + // Arrange + var value = new ClassWithCustomEqualMethod(3); + + // Act / Assert + value.Should().NotBe(new SomeClass(3), new SomeClassEqualityComparer(), "I said so"); + } + + [Fact] + public void An_untyped_value_requires_a_comparer() + { + // Arrange + object value = new SomeClass(3); + + // Act + Action act = () => value.Should().NotBe(new SomeClass(3), comparer: null); + + // Assert + act.Should().Throw().WithParameterName("comparer"); + } + + [Fact] + public void A_typed_value_requires_a_comparer() + { + // Arrange + var value = new SomeClass(3); + + // Act + Action act = () => value.Should().NotBe(new SomeClass(3), comparer: null); + + // Assert + act.Should().Throw().WithParameterName("comparer"); + } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + var value = new SomeClass(3); + + // Act / Assert + value.Should().NotBe(new SomeClass(3)).And.NotBeNull(); + } + + [Fact] + public void Can_chain_multiple_assertions() + { + // Arrange + var value = new object(); + + // Act / Assert + value.Should().NotBe(new object(), new DumbObjectEqualityComparer()).And.NotBeNull(); + } + } + + private enum MyEnum + { + One = 1, + Two = 2 + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeAssignableTo.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeAssignableTo.cs new file mode 100644 index 0000000000..1e923dc998 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeAssignableTo.cs @@ -0,0 +1,393 @@ +using System; +using System.Collections.Generic; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class ObjectAssertionSpecs +{ + public class BeAssignableTo + { + [Fact] + public void When_object_type_is_matched_against_null_type_it_should_throw() + { + // Arrange + var someObject = new object(); + + // Act + Action act = () => someObject.Should().BeAssignableTo(null); + + // Assert + act.Should().Throw() + .WithParameterName("type"); + } + + [Fact] + public void When_its_own_type_it_should_succeed() + { + // Arrange + var someObject = new DummyImplementingClass(); + + // Act / Assert + someObject.Should().BeAssignableTo(); + } + + [Fact] + public void When_its_base_type_it_should_succeed() + { + // Arrange + var someObject = new DummyImplementingClass(); + + // Act / Assert + someObject.Should().BeAssignableTo(); + } + + [Fact] + public void When_an_implemented_interface_type_it_should_succeed() + { + // Arrange + var someObject = new DummyImplementingClass(); + + // Act / Assert + someObject.Should().BeAssignableTo(); + } + + [Fact] + public void When_an_unrelated_type_it_should_fail_with_a_descriptive_message() + { + // Arrange + var someObject = new DummyImplementingClass(); + Action act = () => someObject.Should().BeAssignableTo("because we want to test the failure {0}", "message"); + + // Act / Assert + act.Should().Throw() + .WithMessage($"*assignable to {typeof(DateTime)}*failure message*{typeof(DummyImplementingClass)} is not*"); + } + + [Fact] + public void When_to_the_expected_type_it_should_cast_the_returned_object_for_chaining() + { + // Arrange + var someObject = new Exception("Actual Message"); + + // Act + Action act = () => someObject.Should().BeAssignableTo().Which.Message.Should().Be("Other Message"); + + // Assert + act.Should().Throw().WithMessage("*Expected*Actual*Other*"); + } + + [Fact] + public void When_a_null_instance_is_asserted_to_be_assignableOfT_it_should_fail() + { + // Arrange + object someObject = null; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + someObject.Should().BeAssignableTo("because we want to test the failure {0}", "message"); + }; + + // Assert + act.Should().Throw() + .WithMessage($"*assignable to {typeof(DateTime)}*failure message*found *"); + } + + [Fact] + public void When_its_own_type_instance_it_should_succeed() + { + // Arrange + var someObject = new DummyImplementingClass(); + + // Act / Assert + someObject.Should().BeAssignableTo(typeof(DummyImplementingClass)); + } + + [Fact] + public void When_its_base_type_instance_it_should_succeed() + { + // Arrange + var someObject = new DummyImplementingClass(); + + // Act / Assert + someObject.Should().BeAssignableTo(typeof(DummyBaseClass)); + } + + [Fact] + public void When_an_implemented_interface_type_instance_it_should_succeed() + { + // Arrange + var someObject = new DummyImplementingClass(); + + // Act / Assert + someObject.Should().BeAssignableTo(typeof(IDisposable)); + } + + [Fact] + public void When_an_implemented_open_generic_interface_type_instance_it_should_succeed() + { + // Arrange + var someObject = new List(); + + // Act / Assert + someObject.Should().BeAssignableTo(typeof(IList<>)); + } + + [Fact] + public void When_a_null_instance_is_asserted_to_be_assignable_it_should_fail_with_a_descriptive_message() + { + // Arrange + object someObject = null; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + someObject.Should().BeAssignableTo(typeof(DateTime), "because we want to test the failure {0}", "message"); + }; + + // Assert + act.Should().Throw() + .WithMessage($"*assignable to {typeof(DateTime)}*failure message*found *"); + } + + [Fact] + public void When_an_unrelated_type_instance_it_should_fail_with_a_descriptive_message() + { + // Arrange + var someObject = new DummyImplementingClass(); + + Action act = () => + someObject.Should().BeAssignableTo(typeof(DateTime), "because we want to test the failure {0}", "message"); + + // Act / Assert + act.Should().Throw() + .WithMessage($"*assignable to {typeof(DateTime)}*failure message*{typeof(DummyImplementingClass)} is not*"); + } + + [Fact] + public void When_unrelated_to_open_generic_type_it_should_fail_with_a_descriptive_message() + { + // Arrange + var someObject = new DummyImplementingClass(); + + Action act = () => + someObject.Should().BeAssignableTo(typeof(IList<>), "because we want to test the failure {0}", "message"); + + // Act / Assert + act.Should().Throw() + .WithMessage($"*assignable to {typeof(IList<>)}*failure message*{typeof(DummyImplementingClass)} is not*"); + } + + [Fact] + public void When_an_assertion_fails_on_BeAssignableTo_succeeding_message_should_be_included() + { + // Act + Action act = () => + { + using var _ = new AssertionScope(); + var item = string.Empty; + item.Should().BeAssignableTo(); + item.Should().BeAssignableTo(); + }; + + // Assert + act.Should().Throw() + .WithMessage( + "Expected * to be assignable to System.Int32, but System.String is not.*" + + "Expected * to be assignable to System.Int64, but System.String is not."); + } + } + + public class NotBeAssignableTo + { + [Fact] + public void When_object_type_is_matched_negatively_against_null_type_it_should_throw() + { + // Arrange + var someObject = new object(); + + // Act + Action act = () => someObject.Should().NotBeAssignableTo(null); + + // Assert + act.Should().Throw() + .WithParameterName("type"); + } + + [Fact] + public void When_its_own_type_and_asserting_not_assignable_it_should_fail_with_a_useful_message() + { + // Arrange + var someObject = new DummyImplementingClass(); + + Action act = () => + someObject.Should() + .NotBeAssignableTo("because we want to test the failure {0}", "message"); + + // Act / Assert + act.Should().Throw() + .WithMessage( + $"*not be assignable to {typeof(DummyImplementingClass)}*failure message*{typeof(DummyImplementingClass)} is*"); + } + + [Fact] + public void When_its_base_type_and_asserting_not_assignable_it_should_fail_with_a_useful_message() + { + // Arrange + var someObject = new DummyImplementingClass(); + + Action act = () => + someObject.Should().NotBeAssignableTo("because we want to test the failure {0}", "message"); + + // Act / Assert + act.Should().Throw() + .WithMessage( + $"*not be assignable to {typeof(DummyBaseClass)}*failure message*{typeof(DummyImplementingClass)} is*"); + } + + [Fact] + public void When_an_implemented_interface_type_and_asserting_not_assignable_it_should_fail_with_a_useful_message() + { + // Arrange + var someObject = new DummyImplementingClass(); + + Action act = () => + someObject.Should().NotBeAssignableTo("because we want to test the failure {0}", "message"); + + // Act / Assert + act.Should().Throw() + .WithMessage($"*not be assignable to {typeof(IDisposable)}*failure message*{typeof(DummyImplementingClass)} is*"); + } + + [Fact] + public void When_an_unrelated_type_and_asserting_not_assignable_it_should_succeed() + { + // Arrange + var someObject = new DummyImplementingClass(); + + // Act / Assert + someObject.Should().NotBeAssignableTo(); + } + + [Fact] + public void + When_not_to_the_unexpected_type_and_asserting_not_assignable_it_should_not_cast_the_returned_object_for_chaining() + { + // Arrange + var someObject = new Exception("Actual Message"); + + // Act + Action act = () => someObject.Should().NotBeAssignableTo() + .And.Subject.Should().BeOfType() + .Which.Message.Should().Be("Other Message"); + + // Assert + act.Should().Throw().WithMessage("*Expected*Actual*Other*"); + } + + [Fact] + public void When_its_own_type_instance_and_asserting_not_assignable_it_should_fail_with_a_useful_message() + { + // Arrange + var someObject = new DummyImplementingClass(); + + Action act = () => + someObject.Should().NotBeAssignableTo(typeof(DummyImplementingClass), "because we want to test the failure {0}", + "message"); + + // Act / Assert + act.Should().Throw() + .WithMessage( + $"*not be assignable to {typeof(DummyImplementingClass)}*failure message*{typeof(DummyImplementingClass)} is*"); + } + + [Fact] + public void When_its_base_type_instance_and_asserting_not_assignable_it_should_fail_with_a_useful_message() + { + // Arrange + var someObject = new DummyImplementingClass(); + + Action act = () => + someObject.Should() + .NotBeAssignableTo(typeof(DummyBaseClass), "because we want to test the failure {0}", "message"); + + // Act / Assert + act.Should().Throw() + .WithMessage( + $"*not be assignable to {typeof(DummyBaseClass)}*failure message*{typeof(DummyImplementingClass)} is*"); + } + + [Fact] + public void + When_an_implemented_interface_type_instance_and_asserting_not_assignable_it_should_fail_with_a_useful_message() + { + // Arrange + var someObject = new DummyImplementingClass(); + + Action act = () => + someObject.Should().NotBeAssignableTo(typeof(IDisposable), "because we want to test the failure {0}", "message"); + + // Act / Assert + act.Should().Throw() + .WithMessage($"*not be assignable to {typeof(IDisposable)}*failure message*{typeof(DummyImplementingClass)} is*"); + } + + [Fact] + public void + When_an_implemented_open_generic_interface_type_instance_and_asserting_not_assignable_it_should_fail_with_a_useful_message() + { + // Arrange + var someObject = new List(); + + Action act = () => + someObject.Should().NotBeAssignableTo(typeof(IList<>), "because we want to test the failure {0}", "message"); + + // Act / Assert + act.Should().Throw() + .WithMessage($"*not be assignable to {typeof(IList<>)}*failure message*{typeof(List)} is*"); + } + + [Fact] + public void When_a_null_instance_is_asserted_to_not_be_assignable_it_should_fail_with_a_descriptive_message() + { + // Arrange + object someObject = null; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + someObject.Should().NotBeAssignableTo(typeof(DateTime), "because we want to test the failure {0}", "message"); + }; + + // Assert + act.Should().Throw() + .WithMessage($"*not be assignable to {typeof(DateTime)}*failure message*found *"); + } + + [Fact] + public void When_an_unrelated_type_instance_and_asserting_not_assignable_it_should_succeed() + { + // Arrange + var someObject = new DummyImplementingClass(); + + // Act / Assert + someObject.Should().NotBeAssignableTo(typeof(DateTime), "because we want to test the failure {0}", "message"); + } + + [Fact] + public void When_unrelated_to_open_generic_type_and_asserting_not_assignable_it_should_succeed() + { + // Arrange + var someObject = new DummyImplementingClass(); + + // Act / Assert + someObject.Should().NotBeAssignableTo(typeof(IList<>), "because we want to test the failure {0}", "message"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeDataContractSerializable.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeDataContractSerializable.cs new file mode 100644 index 0000000000..3cab6d97b3 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeDataContractSerializable.cs @@ -0,0 +1,125 @@ +using System; +using System.Runtime.Serialization; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class ObjectAssertionSpecs +{ + public class BeDataContractSerializable + { + [Fact] + public void When_an_object_is_data_contract_serializable_it_should_succeed() + { + // Arrange + var subject = new DataContractSerializableClass + { + Name = "John", + Id = 1 + }; + + // Act + Action act = () => subject.Should().BeDataContractSerializable(); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_an_object_is_not_data_contract_serializable_it_should_fail() + { + // Arrange + var subject = new NonDataContractSerializableClass(); + + // Act + Action act = () => subject.Should().BeDataContractSerializable("we need to store it on {0}", "disk"); + + // Assert + act + .Should().Throw() + .WithMessage("*we need to store it on disk*EnumMemberAttribute*"); + } + + [Fact] + public void When_an_object_is_data_contract_serializable_but_doesnt_restore_all_properties_it_should_fail() + { + // Arrange + var subject = new DataContractSerializableClassNotRestoringAllProperties + { + Name = "John", + BirthDay = 20.September(1973) + }; + + // Act + Action act = () => subject.Should().BeDataContractSerializable(); + + // Assert + act.Should().Throw() + .WithMessage("*to be serializable, but serialization failed with:*property subject.Name*to be*"); + } + + [Fact] + public void When_a_data_contract_serializable_object_doesnt_restore_an_ignored_property_it_should_succeed() + { + // Arrange + var subject = new DataContractSerializableClassNotRestoringAllProperties + { + Name = "John", + BirthDay = 20.September(1973) + }; + + // Act + Action act = () => subject.Should() + .BeDataContractSerializable( + options => options.Excluding(x => x.Name)); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_injecting_null_options_to_BeDataContractSerializable_it_should_throw() + { + // Arrange + var subject = new DataContractSerializableClassNotRestoringAllProperties(); + + // Act + Action act = () => subject.Should() + .BeDataContractSerializable( + options: null); + + // Assert + act.Should().ThrowExactly() + .WithParameterName("options"); + } + } + + public class NonDataContractSerializableClass + { + public Color Color { get; set; } + } + + public class DataContractSerializableClass + { + public string Name { get; set; } + + public int Id; + } + + [DataContract] + public class DataContractSerializableClassNotRestoringAllProperties + { + public string Name { get; set; } + + [DataMember] + public DateTime BirthDay { get; set; } + } + + public enum Color + { + Red = 1, + Yellow = 2 + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeNull.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeNull.cs new file mode 100644 index 0000000000..8806ee451a --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeNull.cs @@ -0,0 +1,91 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class ObjectAssertionSpecs +{ + public class BeNull + { + [Fact] + public void Should_succeed_when_asserting_null_object_to_be_null() + { + // Arrange + object someObject = null; + + // Act / Assert + someObject.Should().BeNull(); + } + + [Fact] + public void Should_fail_when_asserting_non_null_object_to_be_null() + { + // Arrange + var someObject = new object(); + + // Act + Action act = () => someObject.Should().BeNull(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_non_null_object_is_expected_to_be_null_it_should_fail() + { + // Arrange + var someObject = new object(); + + // Act + Action act = () => someObject.Should().BeNull("because we want to test the failure {0}", "message"); + + // Assert + act + .Should().Throw() + .Where(e => e.Message.StartsWith( + "Expected someObject to be because we want to test the failure message, but found System.Object", + StringComparison.Ordinal)); + } + } + + public class BeNotNull + { + [Fact] + public void Should_succeed_when_asserting_non_null_object_not_to_be_null() + { + // Arrange + var someObject = new object(); + + // Act / Assert + someObject.Should().NotBeNull(); + } + + [Fact] + public void Should_fail_when_asserting_null_object_not_to_be_null() + { + // Arrange + object someObject = null; + + // Act + Action act = () => someObject.Should().NotBeNull(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Should_fail_with_descriptive_message_when_asserting_null_object_not_to_be_null() + { + // Arrange + object someObject = null; + + // Act + Action act = () => someObject.Should().NotBeNull("because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Expected someObject not to be because we want to test the failure message."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOfType.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOfType.cs new file mode 100644 index 0000000000..fb046ecf2b --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOfType.cs @@ -0,0 +1,253 @@ +using System; +using AssemblyA; +using AssemblyB; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class ObjectAssertionSpecs +{ + public class BeOfType + { + [Fact] + public void When_object_type_is_matched_against_null_type_exactly_it_should_throw() + { + // Arrange + var someObject = new object(); + + // Act + Action act = () => someObject.Should().BeOfType(null); + + // Assert + act.Should().Throw() + .WithParameterName("expectedType"); + } + + [Fact] + public void When_object_type_is_exactly_equal_to_the_specified_type_it_should_not_fail() + { + // Arrange + var someObject = new Exception(); + + // Act + Action act = () => someObject.Should().BeOfType(); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_object_type_is_value_type_and_matches_received_type_should_not_fail_and_assert_correctly() + { + // Arrange + int valueTypeObject = 42; + + // Act + Action act = () => valueTypeObject.Should().BeOfType(typeof(int)); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_object_is_matched_against_a_null_type_it_should_throw() + { + // Arrange + int valueTypeObject = 42; + + // Act + Action act = () => valueTypeObject.Should().BeOfType(null); + + // Assert + act.Should().Throw() + .WithParameterName("expectedType"); + } + + [Fact] + public void When_null_object_is_matched_against_a_type_it_should_throw() + { + // Arrange + int? valueTypeObject = null; + + // Act + Action act = () => + valueTypeObject.Should().BeOfType(typeof(int), "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage("*type to be System.Int32*because we want to test the failure message*"); + } + + [Fact] + public void When_object_type_is_value_type_and_doesnt_match_received_type_should_fail() + { + // Arrange + int valueTypeObject = 42; + var doubleType = typeof(double); + + // Act + Action act = () => valueTypeObject.Should().BeOfType(doubleType); + + // Assert + act.Should().Throw() + .WithMessage($"Expected type to be {doubleType}, but found {valueTypeObject.GetType()}."); + } + + [Fact] + public void When_object_is_of_the_expected_type_it_should_cast_the_returned_object_for_chaining() + { + // Arrange + var someObject = new Exception("Actual Message"); + + // Act + Action act = () => someObject.Should().BeOfType().Which.Message.Should().Be("Other Message"); + + // Assert + act.Should().Throw().WithMessage("*Expected*Actual*Other*"); + } + + [Fact] + public void When_object_type_is_different_than_expected_type_it_should_fail_with_descriptive_message() + { + // Arrange + var someObject = new object(); + + // Act + Action act = () => someObject.Should().BeOfType("because they are {0} {1}", "of different", "type"); + + // Assert + act.Should().Throw().WithMessage( + "Expected type to be System.Int32 because they are of different type, but found System.Object."); + } + + [Fact] + public void When_asserting_the_type_of_a_null_object_it_should_throw() + { + // Arrange + object someObject = null; + + // Act + Action act = () => someObject.Should().BeOfType(); + + // Assert + act.Should().Throw() + .WithMessage("Expected someObject to be System.Int32, but found ."); + } + + [Fact] + public void + When_object_type_is_same_as_expected_type_but_in_different_assembly_it_should_fail_with_assembly_qualified_name() + { + // Arrange + var typeFromOtherAssembly = + new ClassA().ReturnClassC(); + + // Act +#pragma warning disable 436 // disable the warning on conflicting types, as this is the intention for the spec + + Action act = () => + typeFromOtherAssembly.Should().BeOfType(); + +#pragma warning restore 436 + + // Assert + act.Should().Throw() + .WithMessage( + "Expected type to be [AssemblyB.ClassC, FluentAssertions.Specs*], but found [AssemblyB.ClassC, AssemblyB*]."); + } + + [Fact] + public void When_object_type_is_a_subclass_of_the_expected_type_it_should_fail() + { + // Arrange + var someObject = new DummyImplementingClass(); + + // Act + Action act = () => someObject.Should().BeOfType(); + + // Assert + act.Should().Throw().WithMessage( + "Expected type to be FluentAssertions*DummyBaseClass, but found FluentAssertions*DummyImplementingClass."); + } + } + + public class NotBeOfType + { + [Fact] + public void When_object_type_is_matched_negatively_against_null_type_exactly_it_should_throw() + { + // Arrange + var someObject = new object(); + + // Act + Action act = () => someObject.Should().NotBeOfType(null); + + // Assert + act.Should().Throw() + .WithParameterName("unexpectedType"); + } + + [Fact] + public void When_object_is_matched_negatively_against_a_null_type_it_should_throw() + { + // Arrange + int valueTypeObject = 42; + + // Act + Action act = () => valueTypeObject.Should().NotBeOfType(null); + + // Assert + act.Should().Throw() + .WithParameterName("unexpectedType"); + } + + [Fact] + public void + When_object_type_is_value_type_and_doesnt_match_received_type_as_expected_should_not_fail_and_assert_correctly() + { + // Arrange + int valueTypeObject = 42; + + // Act + Action act = () => valueTypeObject.Should().NotBeOfType(typeof(double)); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_null_object_is_matched_negatively_against_a_type_it_should_throw() + { + // Arrange + int? valueTypeObject = null; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + valueTypeObject.Should().NotBeOfType(typeof(int), "because we want to test the failure {0}", "message"); + }; + + // Assert + act.Should().Throw() + .WithMessage("*type not to be System.Int32*because we want to test the failure message*"); + } + + [Fact] + public void When_object_type_is_value_type_and_matches_received_type_not_as_expected_should_fail() + { + // Arrange + int valueTypeObject = 42; + var expectedType = typeof(int); + + // Act + Action act = () => valueTypeObject.Should().NotBeOfType(expectedType); + + // Assert + act.Should().Throw() + .WithMessage($"Expected type not to be [{expectedType.AssemblyQualifiedName}], but it is."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOneOf.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOneOf.cs new file mode 100644 index 0000000000..99cd091f3d --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOneOf.cs @@ -0,0 +1,221 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class ObjectAssertionSpecs +{ + 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(); + } + + [Fact] + public void An_untyped_value_is_one_of_the_specified_values() + { + // Arrange + object value = new SomeClass(5); + + // Act / Assert + value.Should().BeOneOf(new[] { new SomeClass(4), new SomeClass(5) }, new SomeClassEqualityComparer()); + } + + [Fact] + public void A_typed_value_is_one_of_the_specified_values() + { + // Arrange + var value = new SomeClass(5); + + // Act / Assert + value.Should().BeOneOf(new[] { new SomeClass(4), new SomeClass(5) }, new SomeClassEqualityComparer()); + } + + [Fact] + public void An_untyped_value_is_not_one_of_the_specified_values() + { + // Arrange + object value = new SomeClass(3); + + // Act + Action act = () => value.Should().BeOneOf(new[] { new SomeClass(4), new SomeClass(5) }, + new SomeClassEqualityComparer(), "I said so"); + + // Assert + act.Should().Throw() + .WithMessage("Expected value to be one of {SomeClass(4), SomeClass(5)}*I said so*SomeClass(3)."); + } + + [Fact] + public void An_untyped_value_is_not_one_of_no_values() + { + // Arrange + object value = new SomeClass(3); + + // Act + Action act = () => value.Should().BeOneOf(Array.Empty(), new SomeClassEqualityComparer()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void A_typed_value_is_not_one_of_the_specified_values() + { + // Arrange + var value = new SomeClass(3); + + // Act + Action act = () => value.Should().BeOneOf(new[] { new SomeClass(4), new SomeClass(5) }, + new SomeClassEqualityComparer(), "I said so"); + + // Assert + act.Should().Throw() + .WithMessage("Expected value to be one of {SomeClass(4), SomeClass(5)}*I said so*SomeClass(3)."); + } + + [Fact] + public void A_typed_value_is_not_one_of_no_values() + { + // Arrange + var value = new SomeClass(3); + + // Act + Action act = () => value.Should().BeOneOf(Array.Empty(), new SomeClassEqualityComparer()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void A_typed_value_is_not_the_same_type_as_the_specified_values() + { + // Arrange + var value = new ClassWithCustomEqualMethod(3); + + // Act + Action act = () => value.Should().BeOneOf(new[] { new SomeClass(4), new SomeClass(5) }, + new SomeClassEqualityComparer(), "I said so"); + + // Assert + act.Should().Throw() + .WithMessage("Expected value to be one of {SomeClass(4), SomeClass(5)}*I said so*ClassWithCustomEqualMethod(3)."); + } + + [Fact] + public void An_untyped_value_requires_an_expectation() + { + // Arrange + object value = new SomeClass(3); + + // Act + Action act = () => value.Should().BeOneOf(null, new SomeClassEqualityComparer()); + + // Assert + act.Should().Throw().WithParameterName("validValues"); + } + + [Fact] + public void A_typed_value_requires_an_expectation() + { + // Arrange + var value = new SomeClass(3); + + // Act + Action act = () => value.Should().BeOneOf(null, new SomeClassEqualityComparer()); + + // Assert + act.Should().Throw().WithParameterName("validValues"); + } + + [Fact] + public void An_untyped_value_requires_a_comparer() + { + // Arrange + object value = new SomeClass(3); + + // Act + Action act = () => value.Should().BeOneOf(Array.Empty(), comparer: null); + + // Assert + act.Should().Throw().WithParameterName("comparer"); + } + + [Fact] + public void A_typed_value_requires_a_comparer() + { + // Arrange + var value = new SomeClass(3); + + // Act + Action act = () => value.Should().BeOneOf(Array.Empty(), comparer: null); + + // Assert + act.Should().Throw().WithParameterName("comparer"); + } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + var value = new SomeClass(3); + + // Act / Assert + value.Should().BeOneOf(value).And.NotBeNull(); + } + + [Fact] + public void Can_chain_multiple_assertions() + { + // Arrange + var value = new object(); + + // Act / Assert + value.Should().BeOneOf(new[] { value }, new DumbObjectEqualityComparer()).And.NotBeNull(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs new file mode 100644 index 0000000000..bf1cd3fc4d --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs @@ -0,0 +1,103 @@ +using System; +using System.Globalization; +using System.Xml; +using System.Xml.Schema; +using System.Xml.Serialization; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class ObjectAssertionSpecs +{ + public class BeXmlSerializable + { + [Fact] + public void When_an_object_is_xml_serializable_it_should_succeed() + { + // Arrange + var subject = new XmlSerializableClass + { + Name = "John", + Id = 1 + }; + + // Act + Action act = () => subject.Should().BeXmlSerializable(); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_an_object_is_not_xml_serializable_it_should_fail() + { + // Arrange + var subject = new NonPublicClass + { + Name = "John" + }; + + // Act + Action act = () => subject.Should().BeXmlSerializable("we need to store it on {0}", "disk"); + + // Assert + act.Should().Throw() + .WithMessage( + "*to be serializable because we need to store it on disk, but serialization failed with:*NonPublicClass*"); + } + + [Fact] + public void When_an_object_is_xml_serializable_but_doesnt_restore_all_properties_it_should_fail() + { + // Arrange + var subject = new XmlSerializableClassNotRestoringAllProperties + { + Name = "John", + BirthDay = 20.September(1973) + }; + + // Act + Action act = () => subject.Should().BeXmlSerializable(); + + // Assert + act.Should().Throw() + .WithMessage("*to be serializable, but serialization failed with:*Name*to be*"); + } + } + + public class XmlSerializableClass + { + public string Name { get; set; } + + public int Id; + } + + public class XmlSerializableClassNotRestoringAllProperties : IXmlSerializable + { + public string Name { get; set; } + + public DateTime BirthDay { get; set; } + + public XmlSchema GetSchema() + { + return null; + } + + public void ReadXml(XmlReader reader) + { + BirthDay = DateTime.Parse(reader.ReadElementContentAsString(), CultureInfo.InvariantCulture); + } + + public void WriteXml(XmlWriter writer) + { + writer.WriteString(BirthDay.ToString(CultureInfo.InvariantCulture)); + } + } + + internal class NonPublicClass + { + public string Name { get; set; } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs index 1e2a850b69..567b5e2f17 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs @@ -1,1289 +1,12 @@ using System; using System.Collections.Generic; -using System.Globalization; -using System.Runtime.Serialization; -using System.Xml; -using System.Xml.Schema; -using System.Xml.Serialization; -using AssemblyA; -using AssemblyB; -using FluentAssertions.Execution; -using FluentAssertions.Extensions; using FluentAssertions.Primitives; using Xunit; -using Xunit.Sdk; namespace FluentAssertions.Specs.Primitives; -public class ObjectAssertionSpecs +public partial class ObjectAssertionSpecs { - public class Be - { - [Fact] - public void When_two_equal_object_are_expected_to_be_equal_it_should_not_fail() - { - // Arrange - var someObject = new ClassWithCustomEqualMethod(1); - var equalObject = new ClassWithCustomEqualMethod(1); - - // Act / Assert - someObject.Should().Be(equalObject); - } - - [Fact] - public void When_two_different_objects_are_expected_to_be_equal_it_should_fail_with_a_clear_explanation() - { - // Arrange - var someObject = new ClassWithCustomEqualMethod(1); - var nonEqualObject = new ClassWithCustomEqualMethod(2); - - // Act - Action act = () => someObject.Should().Be(nonEqualObject); - - // Assert - act.Should().Throw().WithMessage( - "Expected someObject to be ClassWithCustomEqualMethod(2), but found ClassWithCustomEqualMethod(1)."); - } - - [Fact] - public void When_both_subject_and_expected_are_null_it_should_succeed() - { - // Arrange - object someObject = null; - object expectedObject = null; - - // Act / Assert - someObject.Should().Be(expectedObject); - } - - [Fact] - public void When_the_subject_is_null_it_should_fail() - { - // Arrange - object someObject = null; - var nonEqualObject = new ClassWithCustomEqualMethod(2); - - // Act - Action act = () => someObject.Should().Be(nonEqualObject); - - // Assert - act.Should().Throw() - .WithMessage("Expected someObject to be ClassWithCustomEqualMethod(2), but found ."); - } - - [Fact] - public void When_two_different_objects_are_expected_to_be_equal_it_should_fail_and_use_the_reason() - { - // Arrange - var someObject = new ClassWithCustomEqualMethod(1); - var nonEqualObject = new ClassWithCustomEqualMethod(2); - - // Act - Action act = () => someObject.Should().Be(nonEqualObject, "because it should use the {0}", "reason"); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected someObject to be ClassWithCustomEqualMethod(2) because it should use the reason, but found ClassWithCustomEqualMethod(1)."); - } - - [Fact] - public void When_comparing_a_numeric_and_an_enum_for_equality_it_should_throw() - { - // Arrange - object subject = 1; - MyEnum expected = MyEnum.One; - - // Act - Action act = () => subject.Should().Be(expected); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void An_untyped_value_is_equal_to_another_according_to_a_comparer() - { - // Arrange - object value = new SomeClass(5); - - // Act / Assert - value.Should().Be(new SomeClass(5), new SomeClassEqualityComparer()); - } - - [Fact] - public void A_typed_value_is_equal_to_another_according_to_a_comparer() - { - // Arrange - var value = new SomeClass(5); - - // Act / Assert - value.Should().Be(new SomeClass(5), new SomeClassEqualityComparer()); - } - - [Fact] - public void An_untyped_value_is_not_equal_to_another_according_to_a_comparer() - { - // Arrange - object value = new SomeClass(3); - - // Act - Action act = () => value.Should().Be(new SomeClass(4), new SomeClassEqualityComparer(), "I said so"); - - // Assert - act.Should().Throw().WithMessage("Expected value to be SomeClass(4)*I said so*found SomeClass(3)."); - } - - [Fact] - public void A_typed_value_is_not_equal_to_another_according_to_a_comparer() - { - // Arrange - var value = new SomeClass(3); - - // Act - Action act = () => value.Should().Be(new SomeClass(4), new SomeClassEqualityComparer(), "I said so"); - - // Assert - act.Should().Throw().WithMessage("Expected value to be SomeClass(4)*I said so*found SomeClass(3)."); - } - - [Fact] - public void A_typed_value_is_not_of_the_same_type() - { - // Arrange - var value = new ClassWithCustomEqualMethod(3); - - // Act - Action act = () => value.Should().Be(new SomeClass(3), new SomeClassEqualityComparer(), "I said so"); - - // Assert - act.Should().Throw() - .WithMessage("Expected value to be SomeClass(3)*I said so*found ClassWithCustomEqualMethod(3)."); - } - - [Fact] - public void A_untyped_value_requires_a_comparer() - { - // Arrange - object value = new SomeClass(3); - - // Act - Action act = () => value.Should().Be(new SomeClass(3), comparer: null); - - // Assert - act.Should().Throw().WithParameterName("comparer"); - } - - [Fact] - public void A_typed_value_requires_a_comparer() - { - // Arrange - var value = new SomeClass(3); - - // Act - Action act = () => value.Should().Be(new SomeClass(3), comparer: null); - - // Assert - act.Should().Throw().WithParameterName("comparer"); - } - - [Fact] - public void Chaining_after_one_assertion() - { - // Arrange - var value = new SomeClass(3); - - // Act / Assert - value.Should().Be(value).And.NotBeNull(); - } - - [Fact] - public void Can_chain_multiple_assertions() - { - // Arrange - var value = new object(); - - // Act / Assert - value.Should().Be(value, new DumbObjectEqualityComparer()).And.NotBeNull(); - } - } - - public class NotBe - { - [Fact] - public void When_non_equal_objects_are_expected_to_be_not_equal_it_should_not_fail() - { - // Arrange - var someObject = new ClassWithCustomEqualMethod(1); - var nonEqualObject = new ClassWithCustomEqualMethod(2); - - // Act / Assert - someObject.Should().NotBe(nonEqualObject); - } - - [Fact] - public void When_two_equal_objects_are_expected_not_to_be_equal_it_should_fail_with_a_clear_explanation() - { - // Arrange - var someObject = new ClassWithCustomEqualMethod(1); - var equalObject = new ClassWithCustomEqualMethod(1); - - // Act - Action act = () => - someObject.Should().NotBe(equalObject); - - // Assert - act.Should().Throw().WithMessage( - "Did not expect someObject to be equal to ClassWithCustomEqualMethod(1)."); - } - - [Fact] - public void When_two_equal_objects_are_expected_not_to_be_equal_it_should_fail_and_use_the_reason() - { - // Arrange - var someObject = new ClassWithCustomEqualMethod(1); - var equalObject = new ClassWithCustomEqualMethod(1); - - // Act - Action act = () => - someObject.Should().NotBe(equalObject, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Did not expect someObject to be equal to ClassWithCustomEqualMethod(1) " + - "because we want to test the failure message."); - } - - [Fact] - public void An_untyped_value_is_not_equal_to_another_according_to_a_comparer() - { - // Arrange - object value = new SomeClass(5); - - // Act / Assert - value.Should().NotBe(new SomeClass(4), new SomeClassEqualityComparer()); - } - - [Fact] - public void A_typed_value_is_not_equal_to_another_according_to_a_comparer() - { - // Arrange - var value = new SomeClass(5); - - // Act / Assert - value.Should().NotBe(new SomeClass(4), new SomeClassEqualityComparer()); - } - - [Fact] - public void An_untyped_value_is_equal_to_another_according_to_a_comparer() - { - // Arrange - object value = new SomeClass(3); - - // Act - Action act = () => value.Should().NotBe(new SomeClass(3), new SomeClassEqualityComparer(), "I said so"); - - // Assert - act.Should().Throw().WithMessage("Did not expect value to be equal to SomeClass(3)*I said so*"); - } - - [Fact] - public void A_typed_value_is_equal_to_another_according_to_a_comparer() - { - // Arrange - var value = new SomeClass(3); - - // Act - Action act = () => value.Should().NotBe(new SomeClass(3), new SomeClassEqualityComparer(), "I said so"); - - // Assert - act.Should().Throw().WithMessage("Did not expect value to be equal to SomeClass(3)*I said so*"); - } - - [Fact] - public void A_typed_value_is_not_of_the_same_type() - { - // Arrange - var value = new ClassWithCustomEqualMethod(3); - - // Act / Assert - value.Should().NotBe(new SomeClass(3), new SomeClassEqualityComparer(), "I said so"); - } - - [Fact] - public void An_untyped_value_requires_a_comparer() - { - // Arrange - object value = new SomeClass(3); - - // Act - Action act = () => value.Should().NotBe(new SomeClass(3), comparer: null); - - // Assert - act.Should().Throw().WithParameterName("comparer"); - } - - [Fact] - public void A_typed_value_requires_a_comparer() - { - // Arrange - var value = new SomeClass(3); - - // Act - Action act = () => value.Should().NotBe(new SomeClass(3), comparer: null); - - // Assert - act.Should().Throw().WithParameterName("comparer"); - } - - [Fact] - public void Chaining_after_one_assertion() - { - // Arrange - var value = new SomeClass(3); - - // Act / Assert - value.Should().NotBe(new SomeClass(3)).And.NotBeNull(); - } - - [Fact] - public void Can_chain_multiple_assertions() - { - // Arrange - var value = new object(); - - // Act / Assert - value.Should().NotBe(new object(), new DumbObjectEqualityComparer()).And.NotBeNull(); - } - } - - 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(); - } - - [Fact] - public void An_untyped_value_is_one_of_the_specified_values() - { - // Arrange - object value = new SomeClass(5); - - // Act / Assert - value.Should().BeOneOf(new[] { new SomeClass(4), new SomeClass(5) }, new SomeClassEqualityComparer()); - } - - [Fact] - public void A_typed_value_is_one_of_the_specified_values() - { - // Arrange - var value = new SomeClass(5); - - // Act / Assert - value.Should().BeOneOf(new[] { new SomeClass(4), new SomeClass(5) }, new SomeClassEqualityComparer()); - } - - [Fact] - public void An_untyped_value_is_not_one_of_the_specified_values() - { - // Arrange - object value = new SomeClass(3); - - // Act - Action act = () => value.Should().BeOneOf(new[] { new SomeClass(4), new SomeClass(5) }, - new SomeClassEqualityComparer(), "I said so"); - - // Assert - act.Should().Throw() - .WithMessage("Expected value to be one of {SomeClass(4), SomeClass(5)}*I said so*SomeClass(3)."); - } - - [Fact] - public void An_untyped_value_is_not_one_of_no_values() - { - // Arrange - object value = new SomeClass(3); - - // Act - Action act = () => value.Should().BeOneOf(Array.Empty(), new SomeClassEqualityComparer()); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void A_typed_value_is_not_one_of_the_specified_values() - { - // Arrange - var value = new SomeClass(3); - - // Act - Action act = () => value.Should().BeOneOf(new[] { new SomeClass(4), new SomeClass(5) }, - new SomeClassEqualityComparer(), "I said so"); - - // Assert - act.Should().Throw() - .WithMessage("Expected value to be one of {SomeClass(4), SomeClass(5)}*I said so*SomeClass(3)."); - } - - [Fact] - public void A_typed_value_is_not_one_of_no_values() - { - // Arrange - var value = new SomeClass(3); - - // Act - Action act = () => value.Should().BeOneOf(Array.Empty(), new SomeClassEqualityComparer()); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void A_typed_value_is_not_the_same_type_as_the_specified_values() - { - // Arrange - var value = new ClassWithCustomEqualMethod(3); - - // Act - Action act = () => value.Should().BeOneOf(new[] { new SomeClass(4), new SomeClass(5) }, - new SomeClassEqualityComparer(), "I said so"); - - // Assert - act.Should().Throw() - .WithMessage("Expected value to be one of {SomeClass(4), SomeClass(5)}*I said so*ClassWithCustomEqualMethod(3)."); - } - - [Fact] - public void An_untyped_value_requires_an_expectation() - { - // Arrange - object value = new SomeClass(3); - - // Act - Action act = () => value.Should().BeOneOf(null, new SomeClassEqualityComparer()); - - // Assert - act.Should().Throw().WithParameterName("validValues"); - } - - [Fact] - public void A_typed_value_requires_an_expectation() - { - // Arrange - var value = new SomeClass(3); - - // Act - Action act = () => value.Should().BeOneOf(null, new SomeClassEqualityComparer()); - - // Assert - act.Should().Throw().WithParameterName("validValues"); - } - - [Fact] - public void An_untyped_value_requires_a_comparer() - { - // Arrange - object value = new SomeClass(3); - - // Act - Action act = () => value.Should().BeOneOf(Array.Empty(), comparer: null); - - // Assert - act.Should().Throw().WithParameterName("comparer"); - } - - [Fact] - public void A_typed_value_requires_a_comparer() - { - // Arrange - var value = new SomeClass(3); - - // Act - Action act = () => value.Should().BeOneOf(Array.Empty(), comparer: null); - - // Assert - act.Should().Throw().WithParameterName("comparer"); - } - - [Fact] - public void Chaining_after_one_assertion() - { - // Arrange - var value = new SomeClass(3); - - // Act / Assert - value.Should().BeOneOf(value).And.NotBeNull(); - } - - [Fact] - public void Can_chain_multiple_assertions() - { - // Arrange - var value = new object(); - - // Act / Assert - value.Should().BeOneOf(new[] { value }, new DumbObjectEqualityComparer()).And.NotBeNull(); - } - } - - private enum MyEnum - { - One = 1, - Two = 2 - } - - public class BeNull - { - [Fact] - public void Should_succeed_when_asserting_null_object_to_be_null() - { - // Arrange - object someObject = null; - - // Act / Assert - someObject.Should().BeNull(); - } - - [Fact] - public void Should_fail_when_asserting_non_null_object_to_be_null() - { - // Arrange - var someObject = new object(); - - // Act - Action act = () => someObject.Should().BeNull(); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_non_null_object_is_expected_to_be_null_it_should_fail() - { - // Arrange - var someObject = new object(); - - // Act - Action act = () => someObject.Should().BeNull("because we want to test the failure {0}", "message"); - - // Assert - act - .Should().Throw() - .Where(e => e.Message.StartsWith( - "Expected someObject to be because we want to test the failure message, but found System.Object", - StringComparison.Ordinal)); - } - } - - public class BeNotNull - { - [Fact] - public void Should_succeed_when_asserting_non_null_object_not_to_be_null() - { - // Arrange - var someObject = new object(); - - // Act / Assert - someObject.Should().NotBeNull(); - } - - [Fact] - public void Should_fail_when_asserting_null_object_not_to_be_null() - { - // Arrange - object someObject = null; - - // Act - Action act = () => someObject.Should().NotBeNull(); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_null_object_not_to_be_null() - { - // Arrange - object someObject = null; - - // Act - Action act = () => someObject.Should().NotBeNull("because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Expected someObject not to be because we want to test the failure message."); - } - } - - public class BeOfType - { - [Fact] - public void When_object_type_is_matched_against_null_type_exactly_it_should_throw() - { - // Arrange - var someObject = new object(); - - // Act - Action act = () => someObject.Should().BeOfType(null); - - // Assert - act.Should().Throw() - .WithParameterName("expectedType"); - } - - [Fact] - public void When_object_type_is_exactly_equal_to_the_specified_type_it_should_not_fail() - { - // Arrange - var someObject = new Exception(); - - // Act - Action act = () => someObject.Should().BeOfType(); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_object_type_is_value_type_and_matches_received_type_should_not_fail_and_assert_correctly() - { - // Arrange - int valueTypeObject = 42; - - // Act - Action act = () => valueTypeObject.Should().BeOfType(typeof(int)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_object_is_matched_against_a_null_type_it_should_throw() - { - // Arrange - int valueTypeObject = 42; - - // Act - Action act = () => valueTypeObject.Should().BeOfType(null); - - // Assert - act.Should().Throw() - .WithParameterName("expectedType"); - } - - [Fact] - public void When_null_object_is_matched_against_a_type_it_should_throw() - { - // Arrange - int? valueTypeObject = null; - - // Act - Action act = () => - valueTypeObject.Should().BeOfType(typeof(int), "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage("*type to be System.Int32*because we want to test the failure message*"); - } - - [Fact] - public void When_object_type_is_value_type_and_doesnt_match_received_type_should_fail() - { - // Arrange - int valueTypeObject = 42; - var doubleType = typeof(double); - - // Act - Action act = () => valueTypeObject.Should().BeOfType(doubleType); - - // Assert - act.Should().Throw() - .WithMessage($"Expected type to be {doubleType}, but found {valueTypeObject.GetType()}."); - } - - [Fact] - public void When_object_is_of_the_expected_type_it_should_cast_the_returned_object_for_chaining() - { - // Arrange - var someObject = new Exception("Actual Message"); - - // Act - Action act = () => someObject.Should().BeOfType().Which.Message.Should().Be("Other Message"); - - // Assert - act.Should().Throw().WithMessage("*Expected*Actual*Other*"); - } - - [Fact] - public void When_object_type_is_different_than_expected_type_it_should_fail_with_descriptive_message() - { - // Arrange - var someObject = new object(); - - // Act - Action act = () => someObject.Should().BeOfType("because they are {0} {1}", "of different", "type"); - - // Assert - act.Should().Throw().WithMessage( - "Expected type to be System.Int32 because they are of different type, but found System.Object."); - } - - [Fact] - public void When_asserting_the_type_of_a_null_object_it_should_throw() - { - // Arrange - object someObject = null; - - // Act - Action act = () => someObject.Should().BeOfType(); - - // Assert - act.Should().Throw() - .WithMessage("Expected someObject to be System.Int32, but found ."); - } - - [Fact] - public void - When_object_type_is_same_as_expected_type_but_in_different_assembly_it_should_fail_with_assembly_qualified_name() - { - // Arrange - var typeFromOtherAssembly = - new ClassA().ReturnClassC(); - - // Act -#pragma warning disable 436 // disable the warning on conflicting types, as this is the intention for the spec - - Action act = () => - typeFromOtherAssembly.Should().BeOfType(); - -#pragma warning restore 436 - - // Assert - act.Should().Throw() - .WithMessage( - "Expected type to be [AssemblyB.ClassC, FluentAssertions.Specs*], but found [AssemblyB.ClassC, AssemblyB*]."); - } - - [Fact] - public void When_object_type_is_a_subclass_of_the_expected_type_it_should_fail() - { - // Arrange - var someObject = new DummyImplementingClass(); - - // Act - Action act = () => someObject.Should().BeOfType(); - - // Assert - act.Should().Throw().WithMessage( - "Expected type to be FluentAssertions*DummyBaseClass, but found FluentAssertions*DummyImplementingClass."); - } - } - - public class NotBeOfType - { - [Fact] - public void When_object_type_is_matched_negatively_against_null_type_exactly_it_should_throw() - { - // Arrange - var someObject = new object(); - - // Act - Action act = () => someObject.Should().NotBeOfType(null); - - // Assert - act.Should().Throw() - .WithParameterName("unexpectedType"); - } - - [Fact] - public void When_object_is_matched_negatively_against_a_null_type_it_should_throw() - { - // Arrange - int valueTypeObject = 42; - - // Act - Action act = () => valueTypeObject.Should().NotBeOfType(null); - - // Assert - act.Should().Throw() - .WithParameterName("unexpectedType"); - } - - [Fact] - public void - When_object_type_is_value_type_and_doesnt_match_received_type_as_expected_should_not_fail_and_assert_correctly() - { - // Arrange - int valueTypeObject = 42; - - // Act - Action act = () => valueTypeObject.Should().NotBeOfType(typeof(double)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_null_object_is_matched_negatively_against_a_type_it_should_throw() - { - // Arrange - int? valueTypeObject = null; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - valueTypeObject.Should().NotBeOfType(typeof(int), "because we want to test the failure {0}", "message"); - }; - - // Assert - act.Should().Throw() - .WithMessage("*type not to be System.Int32*because we want to test the failure message*"); - } - - [Fact] - public void When_object_type_is_value_type_and_matches_received_type_not_as_expected_should_fail() - { - // Arrange - int valueTypeObject = 42; - var expectedType = typeof(int); - - // Act - Action act = () => valueTypeObject.Should().NotBeOfType(expectedType); - - // Assert - act.Should().Throw() - .WithMessage($"Expected type not to be [{expectedType.AssemblyQualifiedName}], but it is."); - } - } - - public class BeAssignableTo - { - [Fact] - public void When_object_type_is_matched_against_null_type_it_should_throw() - { - // Arrange - var someObject = new object(); - - // Act - Action act = () => someObject.Should().BeAssignableTo(null); - - // Assert - act.Should().Throw() - .WithParameterName("type"); - } - - [Fact] - public void When_its_own_type_it_should_succeed() - { - // Arrange - var someObject = new DummyImplementingClass(); - - // Act / Assert - someObject.Should().BeAssignableTo(); - } - - [Fact] - public void When_its_base_type_it_should_succeed() - { - // Arrange - var someObject = new DummyImplementingClass(); - - // Act / Assert - someObject.Should().BeAssignableTo(); - } - - [Fact] - public void When_an_implemented_interface_type_it_should_succeed() - { - // Arrange - var someObject = new DummyImplementingClass(); - - // Act / Assert - someObject.Should().BeAssignableTo(); - } - - [Fact] - public void When_an_unrelated_type_it_should_fail_with_a_descriptive_message() - { - // Arrange - var someObject = new DummyImplementingClass(); - Action act = () => someObject.Should().BeAssignableTo("because we want to test the failure {0}", "message"); - - // Act / Assert - act.Should().Throw() - .WithMessage($"*assignable to {typeof(DateTime)}*failure message*{typeof(DummyImplementingClass)} is not*"); - } - - [Fact] - public void When_to_the_expected_type_it_should_cast_the_returned_object_for_chaining() - { - // Arrange - var someObject = new Exception("Actual Message"); - - // Act - Action act = () => someObject.Should().BeAssignableTo().Which.Message.Should().Be("Other Message"); - - // Assert - act.Should().Throw().WithMessage("*Expected*Actual*Other*"); - } - - [Fact] - public void When_a_null_instance_is_asserted_to_be_assignableOfT_it_should_fail() - { - // Arrange - object someObject = null; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - someObject.Should().BeAssignableTo("because we want to test the failure {0}", "message"); - }; - - // Assert - act.Should().Throw() - .WithMessage($"*assignable to {typeof(DateTime)}*failure message*found *"); - } - - [Fact] - public void When_its_own_type_instance_it_should_succeed() - { - // Arrange - var someObject = new DummyImplementingClass(); - - // Act / Assert - someObject.Should().BeAssignableTo(typeof(DummyImplementingClass)); - } - - [Fact] - public void When_its_base_type_instance_it_should_succeed() - { - // Arrange - var someObject = new DummyImplementingClass(); - - // Act / Assert - someObject.Should().BeAssignableTo(typeof(DummyBaseClass)); - } - - [Fact] - public void When_an_implemented_interface_type_instance_it_should_succeed() - { - // Arrange - var someObject = new DummyImplementingClass(); - - // Act / Assert - someObject.Should().BeAssignableTo(typeof(IDisposable)); - } - - [Fact] - public void When_an_implemented_open_generic_interface_type_instance_it_should_succeed() - { - // Arrange - var someObject = new List(); - - // Act / Assert - someObject.Should().BeAssignableTo(typeof(IList<>)); - } - - [Fact] - public void When_a_null_instance_is_asserted_to_be_assignable_it_should_fail_with_a_descriptive_message() - { - // Arrange - object someObject = null; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - someObject.Should().BeAssignableTo(typeof(DateTime), "because we want to test the failure {0}", "message"); - }; - - // Assert - act.Should().Throw() - .WithMessage($"*assignable to {typeof(DateTime)}*failure message*found *"); - } - - [Fact] - public void When_an_unrelated_type_instance_it_should_fail_with_a_descriptive_message() - { - // Arrange - var someObject = new DummyImplementingClass(); - - Action act = () => - someObject.Should().BeAssignableTo(typeof(DateTime), "because we want to test the failure {0}", "message"); - - // Act / Assert - act.Should().Throw() - .WithMessage($"*assignable to {typeof(DateTime)}*failure message*{typeof(DummyImplementingClass)} is not*"); - } - - [Fact] - public void When_unrelated_to_open_generic_type_it_should_fail_with_a_descriptive_message() - { - // Arrange - var someObject = new DummyImplementingClass(); - - Action act = () => - someObject.Should().BeAssignableTo(typeof(IList<>), "because we want to test the failure {0}", "message"); - - // Act / Assert - act.Should().Throw() - .WithMessage($"*assignable to {typeof(IList<>)}*failure message*{typeof(DummyImplementingClass)} is not*"); - } - - [Fact] - public void When_an_assertion_fails_on_BeAssignableTo_succeeding_message_should_be_included() - { - // Act - Action act = () => - { - using var _ = new AssertionScope(); - var item = string.Empty; - item.Should().BeAssignableTo(); - item.Should().BeAssignableTo(); - }; - - // Assert - act.Should().Throw() - .WithMessage( - "Expected * to be assignable to System.Int32, but System.String is not.*" + - "Expected * to be assignable to System.Int64, but System.String is not."); - } - } - - public class NotBeAssignableTo - { - [Fact] - public void When_object_type_is_matched_negatively_against_null_type_it_should_throw() - { - // Arrange - var someObject = new object(); - - // Act - Action act = () => someObject.Should().NotBeAssignableTo(null); - - // Assert - act.Should().Throw() - .WithParameterName("type"); - } - - [Fact] - public void When_its_own_type_and_asserting_not_assignable_it_should_fail_with_a_useful_message() - { - // Arrange - var someObject = new DummyImplementingClass(); - - Action act = () => - someObject.Should() - .NotBeAssignableTo("because we want to test the failure {0}", "message"); - - // Act / Assert - act.Should().Throw() - .WithMessage( - $"*not be assignable to {typeof(DummyImplementingClass)}*failure message*{typeof(DummyImplementingClass)} is*"); - } - - [Fact] - public void When_its_base_type_and_asserting_not_assignable_it_should_fail_with_a_useful_message() - { - // Arrange - var someObject = new DummyImplementingClass(); - - Action act = () => - someObject.Should().NotBeAssignableTo("because we want to test the failure {0}", "message"); - - // Act / Assert - act.Should().Throw() - .WithMessage( - $"*not be assignable to {typeof(DummyBaseClass)}*failure message*{typeof(DummyImplementingClass)} is*"); - } - - [Fact] - public void When_an_implemented_interface_type_and_asserting_not_assignable_it_should_fail_with_a_useful_message() - { - // Arrange - var someObject = new DummyImplementingClass(); - - Action act = () => - someObject.Should().NotBeAssignableTo("because we want to test the failure {0}", "message"); - - // Act / Assert - act.Should().Throw() - .WithMessage($"*not be assignable to {typeof(IDisposable)}*failure message*{typeof(DummyImplementingClass)} is*"); - } - - [Fact] - public void When_an_unrelated_type_and_asserting_not_assignable_it_should_succeed() - { - // Arrange - var someObject = new DummyImplementingClass(); - - // Act / Assert - someObject.Should().NotBeAssignableTo(); - } - - [Fact] - public void - When_not_to_the_unexpected_type_and_asserting_not_assignable_it_should_not_cast_the_returned_object_for_chaining() - { - // Arrange - var someObject = new Exception("Actual Message"); - - // Act - Action act = () => someObject.Should().NotBeAssignableTo() - .And.Subject.Should().BeOfType() - .Which.Message.Should().Be("Other Message"); - - // Assert - act.Should().Throw().WithMessage("*Expected*Actual*Other*"); - } - - [Fact] - public void When_its_own_type_instance_and_asserting_not_assignable_it_should_fail_with_a_useful_message() - { - // Arrange - var someObject = new DummyImplementingClass(); - - Action act = () => - someObject.Should().NotBeAssignableTo(typeof(DummyImplementingClass), "because we want to test the failure {0}", - "message"); - - // Act / Assert - act.Should().Throw() - .WithMessage( - $"*not be assignable to {typeof(DummyImplementingClass)}*failure message*{typeof(DummyImplementingClass)} is*"); - } - - [Fact] - public void When_its_base_type_instance_and_asserting_not_assignable_it_should_fail_with_a_useful_message() - { - // Arrange - var someObject = new DummyImplementingClass(); - - Action act = () => - someObject.Should() - .NotBeAssignableTo(typeof(DummyBaseClass), "because we want to test the failure {0}", "message"); - - // Act / Assert - act.Should().Throw() - .WithMessage( - $"*not be assignable to {typeof(DummyBaseClass)}*failure message*{typeof(DummyImplementingClass)} is*"); - } - - [Fact] - public void - When_an_implemented_interface_type_instance_and_asserting_not_assignable_it_should_fail_with_a_useful_message() - { - // Arrange - var someObject = new DummyImplementingClass(); - - Action act = () => - someObject.Should().NotBeAssignableTo(typeof(IDisposable), "because we want to test the failure {0}", "message"); - - // Act / Assert - act.Should().Throw() - .WithMessage($"*not be assignable to {typeof(IDisposable)}*failure message*{typeof(DummyImplementingClass)} is*"); - } - - [Fact] - public void - When_an_implemented_open_generic_interface_type_instance_and_asserting_not_assignable_it_should_fail_with_a_useful_message() - { - // Arrange - var someObject = new List(); - - Action act = () => - someObject.Should().NotBeAssignableTo(typeof(IList<>), "because we want to test the failure {0}", "message"); - - // Act / Assert - act.Should().Throw() - .WithMessage($"*not be assignable to {typeof(IList<>)}*failure message*{typeof(List)} is*"); - } - - [Fact] - public void When_a_null_instance_is_asserted_to_not_be_assignable_it_should_fail_with_a_descriptive_message() - { - // Arrange - object someObject = null; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - someObject.Should().NotBeAssignableTo(typeof(DateTime), "because we want to test the failure {0}", "message"); - }; - - // Assert - act.Should().Throw() - .WithMessage($"*not be assignable to {typeof(DateTime)}*failure message*found *"); - } - - [Fact] - public void When_an_unrelated_type_instance_and_asserting_not_assignable_it_should_succeed() - { - // Arrange - var someObject = new DummyImplementingClass(); - - // Act / Assert - someObject.Should().NotBeAssignableTo(typeof(DateTime), "because we want to test the failure {0}", "message"); - } - - [Fact] - public void When_unrelated_to_open_generic_type_and_asserting_not_assignable_it_should_succeed() - { - // Arrange - var someObject = new DummyImplementingClass(); - - // Act / Assert - someObject.Should().NotBeAssignableTo(typeof(IList<>), "because we want to test the failure {0}", "message"); - } - } - public class Miscellaneous { [Fact] @@ -1314,209 +37,11 @@ public void Should_throw_a_helpful_error_when_accidentally_using_equals() } } - public class BeXmlSerializable - { - [Fact] - public void When_an_object_is_xml_serializable_it_should_succeed() - { - // Arrange - var subject = new XmlSerializableClass - { - Name = "John", - Id = 1 - }; - - // Act - Action act = () => subject.Should().BeXmlSerializable(); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_an_object_is_not_xml_serializable_it_should_fail() - { - // Arrange - var subject = new NonPublicClass - { - Name = "John" - }; - - // Act - Action act = () => subject.Should().BeXmlSerializable("we need to store it on {0}", "disk"); - - // Assert - act.Should().Throw() - .WithMessage( - "*to be serializable because we need to store it on disk, but serialization failed with:*NonPublicClass*"); - } - - [Fact] - public void When_an_object_is_xml_serializable_but_doesnt_restore_all_properties_it_should_fail() - { - // Arrange - var subject = new XmlSerializableClassNotRestoringAllProperties - { - Name = "John", - BirthDay = 20.September(1973) - }; - - // Act - Action act = () => subject.Should().BeXmlSerializable(); - - // Assert - act.Should().Throw() - .WithMessage("*to be serializable, but serialization failed with:*Name*to be*"); - } - } - - internal class NonPublicClass - { - public string Name { get; set; } - } - - public class XmlSerializableClass - { - public string Name { get; set; } - - public int Id; - } - - public class XmlSerializableClassNotRestoringAllProperties : IXmlSerializable - { - public string Name { get; set; } - - public DateTime BirthDay { get; set; } - - public XmlSchema GetSchema() - { - return null; - } - - public void ReadXml(XmlReader reader) - { - BirthDay = DateTime.Parse(reader.ReadElementContentAsString(), CultureInfo.InvariantCulture); - } - - public void WriteXml(XmlWriter writer) - { - writer.WriteString(BirthDay.ToString(CultureInfo.InvariantCulture)); - } - } - - public class BeDataContractSerializable - { - [Fact] - public void When_an_object_is_data_contract_serializable_it_should_succeed() - { - // Arrange - var subject = new DataContractSerializableClass - { - Name = "John", - Id = 1 - }; - - // Act - Action act = () => subject.Should().BeDataContractSerializable(); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_an_object_is_not_data_contract_serializable_it_should_fail() - { - // Arrange - var subject = new NonDataContractSerializableClass(); - - // Act - Action act = () => subject.Should().BeDataContractSerializable("we need to store it on {0}", "disk"); - - // Assert - act - .Should().Throw() - .WithMessage("*we need to store it on disk*EnumMemberAttribute*"); - } - - [Fact] - public void When_an_object_is_data_contract_serializable_but_doesnt_restore_all_properties_it_should_fail() - { - // Arrange - var subject = new DataContractSerializableClassNotRestoringAllProperties - { - Name = "John", - BirthDay = 20.September(1973) - }; - - // Act - Action act = () => subject.Should().BeDataContractSerializable(); - - // Assert - act.Should().Throw() - .WithMessage("*to be serializable, but serialization failed with:*property subject.Name*to be*"); - } - - [Fact] - public void When_a_data_contract_serializable_object_doesnt_restore_an_ignored_property_it_should_succeed() - { - // Arrange - var subject = new DataContractSerializableClassNotRestoringAllProperties - { - Name = "John", - BirthDay = 20.September(1973) - }; - - // Act - Action act = () => subject.Should() - .BeDataContractSerializable( - options => options.Excluding(x => x.Name)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_injecting_null_options_to_BeDataContractSerializable_it_should_throw() - { - // Arrange - var subject = new DataContractSerializableClassNotRestoringAllProperties(); - - // Act - Action act = () => subject.Should() - .BeDataContractSerializable( - options: null); - - // Assert - act.Should().ThrowExactly() - .WithParameterName("options"); - } - } - - public enum Color - { - Red = 1, - Yellow = 2 - } - - public class NonDataContractSerializableClass - { - public Color Color { get; set; } - } - - public class DataContractSerializableClass + internal class DumbObjectEqualityComparer : IEqualityComparer { - public string Name { get; set; } + public new bool Equals(object x, object y) => x.Equals(y); - public int Id; - } - - [DataContract] - public class DataContractSerializableClassNotRestoringAllProperties - { - public string Name { get; set; } - - [DataMember] - public DateTime BirthDay { get; set; } + public int GetHashCode(object obj) => obj.GetHashCode(); } } @@ -1544,13 +69,6 @@ public SomeClass(int key) public override string ToString() => $"SomeClass({Key})"; } -internal class DumbObjectEqualityComparer : IEqualityComparer -{ - public new bool Equals(object x, object y) => x.Equals(y); - - public int GetHashCode(object obj) => obj.GetHashCode(); -} - internal class SomeClassEqualityComparer : IEqualityComparer { public bool Equals(SomeClass x, SomeClass y) => x.Key == y.Key; From 47d38b23a8a8dc3fc246049935472ed7f562e338 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:59:22 +0000 Subject: [PATCH 141/845] Bump Meziantou.Analyzer from 2.0.94 to 2.0.103 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.94 to 2.0.103. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.94...2.0.103) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 9c69fe26a5..e7e6d330fd 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From d7db91550c4ef03bec5bb317d9b984710e8ecfde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:59:17 +0000 Subject: [PATCH 142/845] Bump Roslynator.Analyzers from 4.6.0 to 4.6.1 Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.6.0 to 4.6.1. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.6.0...v4.6.1) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index e7e6d330fd..ad74a503b5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From b005cbe54115563024afd18a5c645f041f604dc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:59:03 +0000 Subject: [PATCH 143/845] Bump the xunit group with 2 updates Bumps the xunit group with 2 updates: [xunit](https://github.com/xunit/xunit) and [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit). Updates `xunit` from 2.5.0 to 2.5.3 - [Commits](https://github.com/xunit/xunit/compare/2.5.0...2.5.3) Updates `xunit.runner.visualstudio` from 2.5.0 to 2.5.3 - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.5.0...2.5.3) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] --- .../FluentAssertions.Extensibility.Specs.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 08c9379412..fc6b91f365 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -10,7 +10,7 @@ - + all runtime; build; native; contentfiles; analyzers @@ -18,7 +18,7 @@ - + all runtime; build; native; contentfiles; analyzers @@ -29,7 +29,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive From e22c576fe01dd8378d740b3970c6462e3606d1f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 16:58:01 +0000 Subject: [PATCH 144/845] Bump Microsoft.NET.Test.Sdk from 17.6.3 to 17.7.2 Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.6.3 to 17.7.2. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.6.3...v17.7.2) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index fc6b91f365..1ad41d31f1 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -17,7 +17,7 @@ - + all runtime; build; native; contentfiles; analyzers From 6b79ce91745bce3f6a8b0240db8f8d613aaefa45 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 29 Oct 2023 16:35:44 +0100 Subject: [PATCH 145/845] Exclude `private protected` members from `BeEquivalentTo` --- .../Common/TypeMemberReflector.cs | 7 ++- .../SelectionRulesSpecs.cs | 48 +++++++++++++++++++ docs/_pages/releases.md | 1 + 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/Src/FluentAssertions/Common/TypeMemberReflector.cs b/Src/FluentAssertions/Common/TypeMemberReflector.cs index d7936e4799..ea65969cdf 100644 --- a/Src/FluentAssertions/Common/TypeMemberReflector.cs +++ b/Src/FluentAssertions/Common/TypeMemberReflector.cs @@ -53,7 +53,7 @@ orderby IsExplicitImplementation(p) } private static bool IsPublic(MethodBase getMethod) => - !getMethod.IsPrivate && !getMethod.IsFamily; + !getMethod.IsPrivate && !getMethod.IsFamily && !getMethod.IsFamilyAndAssembly; private static bool IsExplicitlyImplemented(MethodBase getMethod) => getMethod.IsPrivate && getMethod.IsFinal; @@ -83,11 +83,14 @@ private static List GetFieldsFromHierarchy(Type typeToReflect, Member { return type .GetFields(AllInstanceMembersFlag) - .Where(field => !field.IsPrivate && !field.IsFamily) + .Where(field => IsPublic(field)) .Where(field => includeInternal || !IsInternal(field)); }); } + private static bool IsPublic(FieldInfo field) => + !field.IsPrivate && !field.IsFamily && !field.IsFamilyAndAssembly; + private static bool IsInternal(FieldInfo field) { return field.IsAssembly || field.IsFamilyOrAssembly; diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs index b3301db9a2..4ddae8d47d 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs @@ -1442,6 +1442,54 @@ public void When_a_property_is_internal_it_should_be_excluded_from_the_compariso // Act / Assert actual.Should().BeEquivalentTo(expected); } + + [Fact] + public void Private_protected_properties_are_ignored() + { + // Arrange + var subject = new ClassWithPrivateProtectedProperty("Name", 13); + var other = new ClassWithPrivateProtectedProperty("Name", 37); + + // Act/Assert + subject.Should().BeEquivalentTo(other); + } + + private class ClassWithPrivateProtectedProperty + { + public ClassWithPrivateProtectedProperty(string name, int value) + { + Name = name; + Value = value; + } + + public string Name { get; } + + private protected int Value { get; } + } + + [Fact] + public void Private_protected_fields_are_ignored() + { + // Arrange + var subject = new ClassWithPrivateProtectedField("Name", 13); + var other = new ClassWithPrivateProtectedField("Name", 37); + + // Act/Assert + subject.Should().BeEquivalentTo(other); + } + + private class ClassWithPrivateProtectedField + { + public ClassWithPrivateProtectedField(string name, int value) + { + Name = name; + this.value = value; + } + + public string Name; + + private protected int value; + } } public class MemberHiding diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index c425d16514..3620fc8565 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -30,6 +30,7 @@ sidebar: * Improved the failure message for `ThrowExactly[Async]` when wrapped in an `AssertionScope` and no exception is thrown - [#2398](https://github.com/fluentassertions/fluentassertions/pull/2398) * Improved the failure message for `[Not]HaveExplicitProperty` when wrapped in an `AssertionScope` and not implementing the interface - [#2403](https://github.com/fluentassertions/fluentassertions/pull/2403) * Improved the failure message for `[Not]HaveExplicitMethod` when wrapped in an `AssertionScope` and not implementing the interface - [#2403](https://github.com/fluentassertions/fluentassertions/pull/2403) +* Changed `BeEquivalentTo` to exclude `private protected` members from the comparison - [#2417](https://github.com/fluentassertions/fluentassertions/pull/2417) ### Breaking Changes (for users) From 75aa13e9e813b677a93dd950a93a41d32526b4a6 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 30 Oct 2023 18:52:06 +0100 Subject: [PATCH 146/845] Improve CC for `GetCSharpAccessModifier(FieldInfo)` For properties and methods `PropertyInfoAssertions` and `MethodBaseAssertions` have assertions to exercise the `private`, `protected` and `private protected` cases in `GetCSharpAccessModifier(MethodBase)`. We don't have `FieldInfoAssertions` so we only exercise the access modifiers on fields through `WhichGetterHas`/`WhichSetterHas`. Since `GetFieldsFromHierarchy` excludes `private`, `protected` and `private protected` fields those three cases cannot currently be hit through the public API. --- .../SelectionRulesSpecs.cs | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs index 4ddae8d47d..c8c23d5f70 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs @@ -905,13 +905,14 @@ public void When_members_are_excluded_by_the_access_modifier_of_the_getter_using "internal", "protected-internal", "private", "private-protected"); var expected = new ClassWithAllAccessModifiersForMembers("public", "protected", - "ignored-internal", "ignored-protected-internal", "private", "ignore-private-protected"); + "ignored-internal", "ignored-protected-internal", "private", "private-protected"); // Act - Action act = () => subject.Should().BeEquivalentTo(expected, config => - config.Excluding(ctx => ctx.WhichGetterHas(CSharpAccessModifier.Internal) || - ctx.WhichGetterHas(CSharpAccessModifier.ProtectedInternal) || - ctx.WhichGetterHas(CSharpAccessModifier.PrivateProtected))); + Action act = () => subject.Should().BeEquivalentTo(expected, config => config + .IncludingInternalFields() + .Excluding(ctx => + ctx.WhichGetterHas(CSharpAccessModifier.Internal) || + ctx.WhichGetterHas(CSharpAccessModifier.ProtectedInternal))); // Assert act.Should().NotThrow(); @@ -925,14 +926,15 @@ public void When_members_are_excluded_by_the_access_modifier_of_the_setter_using "internal", "protected-internal", "private", "private-protected"); var expected = new ClassWithAllAccessModifiersForMembers("public", "protected", - "ignored-internal", "ignored-protected-internal", "ignored-private", "ignore-private-protected"); + "ignored-internal", "ignored-protected-internal", "ignored-private", "private-protected"); // Act - Action act = () => subject.Should().BeEquivalentTo(expected, config => - config.Excluding(ctx => ctx.WhichSetterHas(CSharpAccessModifier.Internal) || + Action act = () => subject.Should().BeEquivalentTo(expected, config => config + .IncludingInternalFields() + .Excluding(ctx => + ctx.WhichSetterHas(CSharpAccessModifier.Internal) || ctx.WhichSetterHas(CSharpAccessModifier.ProtectedInternal) || - ctx.WhichSetterHas(CSharpAccessModifier.Private) || - ctx.WhichSetterHas(CSharpAccessModifier.PrivateProtected))); + ctx.WhichSetterHas(CSharpAccessModifier.Private))); // Assert act.Should().NotThrow(); From bd2a041915442d7a3f30a11af923708ad056d34d Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 30 Oct 2023 19:11:15 +0100 Subject: [PATCH 147/845] Restore DateTime tips --- docs/_data/tips/datetimes.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 docs/_data/tips/datetimes.yml diff --git a/docs/_data/tips/datetimes.yml b/docs/_data/tips/datetimes.yml new file mode 100644 index 0000000000..64cc7e4b3c --- /dev/null +++ b/docs/_data/tips/datetimes.yml @@ -0,0 +1,23 @@ +- old: | + actual.Date.Should().Be(expected.Date); + + new: | + actual.Should().BeSameDateAs(expected); + + old-message: | + Expected date and time to be <2017-01-01>, but found <2017-01-02>. + + new-message: | + Expected a date and time with date <2017-01-01>, but found <2017-01-02 21:00:00>. + +- old: | + actual.Date.Should().NotBe(unexpected.Date); + + new: | + actual.Should().NotBeSameDateAs(unexpected); + + old-message: | + Expected date and time not to be <2017-01-01>, but it is. + + new-message: | + Expected a date and time that does not have date <2017-01-01>, but found it does. From c44d74ef445a6c210cfca4647c397dd8a77c3c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Wed, 1 Nov 2023 16:04:49 +0100 Subject: [PATCH 148/845] Split NullableNumericAssertionSpecs (#2428) --- .../NullableNumericAssertionSpecs.Be.cs | 114 ++ ...leNumericAssertionSpecs.BeApproximately.cs | 957 +++++++++ ...ableNumericAssertionSpecs.BeGreaterThan.cs | 71 + ...icAssertionSpecs.BeGreaterThanOrEqualTo.cs | 71 + ...NullableNumericAssertionSpecs.BeInRange.cs | 136 ++ ...ullableNumericAssertionSpecs.BeLessThan.cs | 71 + ...mericAssertionSpecs.BeLessThanOrEqualTo.cs | 71 + ...ullableNumericAssertionSpecs.BeNegative.cs | 37 + .../NullableNumericAssertionSpecs.BeNull.cs | 89 + ...ullableNumericAssertionSpecs.BePositive.cs | 37 + ...NullableNumericAssertionSpecs.HaveValue.cs | 90 + .../NullableNumericAssertionSpecs.Match.cs | 51 + .../Numeric/NullableNumericAssertionSpecs.cs | 1703 +---------------- 13 files changed, 1796 insertions(+), 1702 deletions(-) create mode 100644 Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.Be.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeApproximately.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeGreaterThan.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeGreaterThanOrEqualTo.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeInRange.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeLessThan.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeLessThanOrEqualTo.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeNegative.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeNull.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BePositive.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.HaveValue.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.Match.cs diff --git a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.Be.cs b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.Be.cs new file mode 100644 index 0000000000..09b6d8f624 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.Be.cs @@ -0,0 +1,114 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NullableNumericAssertionSpecs +{ + public class Be + { + [Fact] + public void Should_succeed_when_asserting_nullable_numeric_value_equals_an_equal_value() + { + // Arrange + int? nullableIntegerA = 1; + int? nullableIntegerB = 1; + + // Act / Assert + nullableIntegerA.Should().Be(nullableIntegerB); + } + + [Fact] + public void Should_succeed_when_asserting_nullable_numeric_null_value_equals_null() + { + // Arrange + int? nullableIntegerA = null; + int? nullableIntegerB = null; + + // Act / Assert + nullableIntegerA.Should().Be(nullableIntegerB); + } + + [Fact] + public void Should_fail_when_asserting_nullable_numeric_value_equals_a_different_value() + { + // Arrange + int? nullableIntegerA = 1; + int? nullableIntegerB = 2; + + // Act + Action act = () => nullableIntegerA.Should().Be(nullableIntegerB); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Should_fail_with_descriptive_message_when_asserting_nullable_numeric_value_equals_a_different_value() + { + // Arrange + int? nullableIntegerA = 1; + int? nullableIntegerB = 2; + + // Act + Action act = () => + nullableIntegerA.Should().Be(nullableIntegerB, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage("Expected*2 because we want to test the failure message, but found 1."); + } + + [Fact] + public void Nan_is_never_equal_to_a_normal_float() + { + // Arrange + float? value = float.NaN; + + // Act + Action act = () => value.Should().Be(3.4F); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to be *3.4F, but found NaN*"); + } + + [Fact] + public void NaN_can_be_compared_to_NaN_when_its_a_float() + { + // Arrange + float? value = float.NaN; + + // Act + value.Should().Be(float.NaN); + } + + [Fact] + public void Nan_is_never_equal_to_a_normal_double() + { + // Arrange + double? value = double.NaN; + + // Act + Action act = () => value.Should().Be(3.4D); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to be *3.4, but found NaN*"); + } + + [Fact] + public void NaN_can_be_compared_to_NaN_when_its_a_double() + { + // Arrange + double? value = double.NaN; + + // Act + value.Should().Be(double.NaN); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeApproximately.cs b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeApproximately.cs new file mode 100644 index 0000000000..97026a8ac7 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeApproximately.cs @@ -0,0 +1,957 @@ +using System; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NullableNumericAssertionSpecs +{ + public class BeApproximately + { + [Fact] + public void When_approximating_a_nullable_double_with_a_negative_precision_it_should_throw() + { + // Arrange + double? value = 3.1415927; + + // Act + Action act = () => value.Should().BeApproximately(3.14, -0.1); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_approximating_two_nullable_doubles_with_a_negative_precision_it_should_throw() + { + // Arrange + double? value = 3.1415927; + double? expected = 3.14; + + // Act + Action act = () => value.Should().BeApproximately(expected, -0.1); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_nullable_double_is_indeed_approximating_a_value_it_should_not_throw() + { + // Arrange + double? value = 3.1415927; + + // Act + Action act = () => value.Should().BeApproximately(3.14, 0.1); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_nullable_double_is_indeed_approximating_a_nullable_value_it_should_not_throw() + { + // Arrange + double? value = 3.1415927; + double? expected = 3.142; + + // Act + Action act = () => value.Should().BeApproximately(expected, 0.1); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_nullable_double_is_null_approximating_a_nullable_null_value_it_should_not_throw() + { + // Arrange + double? value = null; + double? expected = null; + + // Act + Action act = () => value.Should().BeApproximately(expected, 0.1); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_nullable_double_with_value_is_not_approximating_a_non_null_nullable_value_it_should_throw() + { + // Arrange + double? value = 13; + double? expected = 12; + + // Act + Action act = () => value.Should().BeApproximately(expected, 0.1); + + // Assert + act.Should().Throw().WithMessage("Expected*12.0*0.1*13.0*"); + } + + [Fact] + public void When_nullable_double_is_null_approximating_a_non_null_nullable_value_it_should_throw() + { + // Arrange + double? value = null; + double? expected = 12; + + // Act + Action act = () => value.Should().BeApproximately(expected, 0.1); + + // Assert + act.Should().Throw().WithMessage( + "Expected value to approximate 12.0 +/- 0.1, but it was ."); + } + + [Fact] + public void When_nullable_double_is_not_null_approximating_a_null_value_it_should_throw() + { + // Arrange + double? value = 12; + double? expected = null; + + // Act + Action act = () => value.Should().BeApproximately(expected, 0.1); + + // Assert + act.Should().Throw().WithMessage( + "Expected value to approximate +/- 0.1, but it was 12.0."); + } + + [Fact] + public void When_nullable_double_has_no_value_it_should_throw() + { + // Arrange + double? value = null; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + value.Should().BeApproximately(3.14, 0.001); + }; + + // Assert + act.Should().Throw().WithMessage( + "Expected value to approximate 3.14 +/- 0.001, but it was ."); + } + + [Fact] + public void When_nullable_double_is_not_approximating_a_value_it_should_throw() + { + // Arrange + double? value = 3.1415927F; + + // Act + Action act = () => value.Should().BeApproximately(1.0, 0.1); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to approximate 1.0 +/- 0.1, but 3.14* differed by*"); + } + + [Fact] + public void A_double_cannot_approximate_NaN() + { + // Arrange + double? value = 3.1415927F; + + // Act + Action act = () => value.Should().BeApproximately(double.NaN, 0.1); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void When_approximating_a_nullable_float_with_a_negative_precision_it_should_throw() + { + // Arrange + float? value = 3.1415927F; + + // Act + Action act = () => value.Should().BeApproximately(3.14F, -0.1F); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_approximating_two_nullable_floats_with_a_negative_precision_it_should_throw() + { + // Arrange + float? value = 3.1415927F; + float? expected = 3.14F; + + // Act + Action act = () => value.Should().BeApproximately(expected, -0.1F); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_nullable_float_is_indeed_approximating_a_value_it_should_not_throw() + { + // Arrange + float? value = 3.1415927F; + + // Act + Action act = () => value.Should().BeApproximately(3.14F, 0.1F); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_nullable_float_is_indeed_approximating_a_nullable_value_it_should_not_throw() + { + // Arrange + float? value = 3.1415927f; + float? expected = 3.142f; + + // Act + Action act = () => value.Should().BeApproximately(expected, 0.1f); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_nullable_float_is_null_approximating_a_nullable_null_value_it_should_not_throw() + { + // Arrange + float? value = null; + float? expected = null; + + // Act + Action act = () => value.Should().BeApproximately(expected, 0.1f); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_nullable_float_with_value_is_not_approximating_a_non_null_nullable_value_it_should_throw() + { + // Arrange + float? value = 13; + float? expected = 12; + + // Act + Action act = () => value.Should().BeApproximately(expected, 0.1f); + + // Assert + act.Should().Throw().WithMessage("Expected*12*0.1*13*"); + } + + [Fact] + public void When_nullable_float_is_null_approximating_a_non_null_nullable_value_it_should_throw() + { + // Arrange + float? value = null; + float? expected = 12; + + // Act + Action act = () => value.Should().BeApproximately(expected, 0.1f); + + // Assert + act.Should().Throw().WithMessage( + "Expected value to approximate 12F +/- 0.1F, but it was ."); + } + + [Fact] + public void When_nullable_float_is_not_null_approximating_a_null_value_it_should_throw() + { + // Arrange + float? value = 12; + float? expected = null; + + // Act + Action act = () => value.Should().BeApproximately(expected, 0.1f); + + // Assert + act.Should().Throw().WithMessage( + "Expected value to approximate +/- 0.1F, but it was 12F."); + } + + [Fact] + public void When_nullable_float_has_no_value_it_should_throw() + { + // Arrange + float? value = null; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + value.Should().BeApproximately(3.14F, 0.001F); + }; + + // Assert + act.Should().Throw().WithMessage( + "Expected value to approximate 3.14F +/- 0.001F, but it was ."); + } + + [Fact] + public void When_nullable_float_is_not_approximating_a_value_it_should_throw() + { + // Arrange + float? value = 3.1415927F; + + // Act + Action act = () => value.Should().BeApproximately(1.0F, 0.1F); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to approximate *1* +/- *0.1* but 3.14* differed by*"); + } + + [Fact] + public void A_float_cannot_approximate_NaN() + { + // Arrange + float? value = 3.1415927F; + + // Act + Action act = () => value.Should().BeApproximately(float.NaN, 0.1F); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void When_approximating_a_nullable_decimal_with_a_negative_precision_it_should_throw() + { + // Arrange + decimal? value = 3.1415927m; + + // Act + Action act = () => value.Should().BeApproximately(3.14m, -0.1m); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_approximating_two_nullable_decimals_with_a_negative_precision_it_should_throw() + { + // Arrange + decimal? value = 3.1415927m; + decimal? expected = 3.14m; + + // Act + Action act = () => value.Should().BeApproximately(expected, -0.1m); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_nullable_decimal_is_indeed_approximating_a_value_it_should_not_throw() + { + // Arrange + decimal? value = 3.1415927m; + + // Act + Action act = () => value.Should().BeApproximately(3.14m, 0.1m); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_nullable_decimal_is_indeed_approximating_a_nullable_value_it_should_not_throw() + { + // Arrange + decimal? value = 3.1415927m; + decimal? expected = 3.142m; + + // Act + Action act = () => value.Should().BeApproximately(expected, 0.1m); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_nullable_decimal_is_null_approximating_a_nullable_null_value_it_should_not_throw() + { + // Arrange + decimal? value = null; + decimal? expected = null; + + // Act + Action act = () => value.Should().BeApproximately(expected, 0.1m); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_nullable_decimal_with_value_is_not_approximating_a_non_null_nullable_value_it_should_throw() + { + // Arrange + decimal? value = 13; + decimal? expected = 12; + + // Act + Action act = () => value.Should().BeApproximately(expected, 0.1m); + + // Assert + act.Should().Throw().WithMessage("Expected*12*0.1*13*"); + } + + [Fact] + public void When_nullable_decimal_is_null_approximating_a_non_null_nullable_value_it_should_throw() + { + // Arrange + decimal? value = null; + decimal? expected = 12; + + // Act + Action act = () => value.Should().BeApproximately(expected, 0.1m); + + // Assert + act.Should().Throw().WithMessage( + "Expected value to approximate 12M +/- 0.1M, but it was ."); + } + + [Fact] + public void When_nullable_decimal_is_not_null_approximating_a_null_value_it_should_throw() + { + // Arrange + decimal? value = 12; + decimal? expected = null; + + // Act + Action act = () => value.Should().BeApproximately(expected, 0.1m); + + // Assert + act.Should().Throw().WithMessage( + "Expected value to approximate +/- 0.1M, but it was 12M."); + } + + [Fact] + public void When_nullable_decimal_has_no_value_it_should_throw() + { + // Arrange + decimal? value = null; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + value.Should().BeApproximately(3.14m, 0.001m); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expected value to approximate*3.14* +/-*0.001*, but it was ."); + } + + [Fact] + public void When_nullable_decimal_is_not_approximating_a_value_it_should_throw() + { + // Arrange + decimal? value = 3.1415927m; + + // Act + Action act = () => value.Should().BeApproximately(1.0m, 0.1m); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to approximate*1.0* +/-*0.1*, but 3.14* differed by*"); + } + } + + public class NotBeApproximately + { + [Fact] + public void When_not_approximating_a_nullable_double_with_a_negative_precision_it_should_throw() + { + // Arrange + double? value = 3.1415927; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14, -0.1); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_not_approximating_two_nullable_doubles_with_a_negative_precision_it_should_throw() + { + // Arrange + double? value = 3.1415927; + double? expected = 3.14; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, -0.1); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_asserting_not_approximately_and_nullable_double_is_not_approximating_a_value_it_should_not_throw() + { + // Arrange + double? value = 3.1415927; + + // Act + Action act = () => value.Should().NotBeApproximately(1.0, 0.1); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_not_approximately_and_nullable_double_has_no_value_it_should_throw() + { + // Arrange + double? value = null; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14, 0.001); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_not_approximately_and_nullable_double_is_indeed_approximating_a_value_it_should_throw() + { + // Arrange + double? value = 3.1415927; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14, 0.1); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to not approximate 3.14 +/- 0.1, but 3.14*only differed by*"); + } + + [Fact] + public void + When_asserting_not_approximately_and_nullable_double_is_not_approximating_a_nullable_value_it_should_not_throw() + { + // Arrange + double? value = 3.1415927; + double? expected = 1.0; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, 0.1); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_not_approximately_and_nullable_double_is_not_approximating_a_null_value_it_should_throw() + { + // Arrange + double? value = 3.1415927; + double? expected = null; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, 0.1); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void + When_asserting_not_approximately_and_null_double_is_not_approximating_a_nullable_double_value_it_should_throw() + { + // Arrange + double? value = null; + double? expected = 20.0; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, 0.1); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_not_approximately_and_null_double_is_not_approximating_a_null_value_it_should_not_throw() + { + // Arrange + double? value = null; + double? expected = null; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, 0.1); + + // Assert + act.Should().Throw() + .WithMessage("Expected*null*0.1*but*null*"); + } + + [Fact] + public void When_asserting_not_approximately_and_nullable_double_is_approximating_a_nullable_value_it_should_throw() + { + // Arrange + double? value = 3.1415927; + double? expected = 3.1; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, 0.1F); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void A_double_cannot_approximate_NaN() + { + // Arrange + double? value = 3.1415927F; + + // Act + Action act = () => value.Should().NotBeApproximately(double.NaN, 0.1); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void When_not_approximating_a_nullable_float_with_a_negative_precision_it_should_throw() + { + // Arrange + float? value = 3.1415927F; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14F, -0.1F); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_not_approximating_two_nullable_floats_with_a_negative_precision_it_should_throw() + { + // Arrange + float? value = 3.1415927F; + float? expected = 3.14F; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, -0.1F); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_asserting_not_approximately_and_nullable_float_is_not_approximating_a_value_it_should_not_throw() + { + // Arrange + float? value = 3.1415927F; + + // Act + Action act = () => value.Should().NotBeApproximately(1.0F, 0.1F); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_not_approximately_and_nullable_float_has_no_value_it_should_throw() + { + // Arrange + float? value = null; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14F, 0.001F); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_not_approximately_and_nullable_float_is_indeed_approximating_a_value_it_should_throw() + { + // Arrange + float? value = 3.1415927F; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14F, 0.1F); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to not approximate *3.14F* +/- *0.1F* but 3.14* only differed by*"); + } + + [Fact] + public void + When_asserting_not_approximately_and_nullable_float_is_not_approximating_a_nullable_value_it_should_not_throw() + { + // Arrange + float? value = 3.1415927F; + float? expected = 1.0F; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, 0.1F); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_not_approximately_and_nullable_float_is_not_approximating_a_null_value_it_should_throw() + { + // Arrange + float? value = 3.1415927F; + float? expected = null; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, 0.1F); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void + When_asserting_not_approximately_and_null_float_is_not_approximating_a_nullable_float_value_it_should_throw() + { + // Arrange + float? value = null; + float? expected = 20.0f; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, 0.1F); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_not_approximately_and_null_float_is_not_approximating_a_null_value_it_should_not_throw() + { + // Arrange + float? value = null; + float? expected = null; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, 0.1F); + + // Assert + act.Should().Throw("Expected**+/-*0.1F**"); + } + + [Fact] + public void When_asserting_not_approximately_and_nullable_float_is_approximating_a_nullable_value_it_should_throw() + { + // Arrange + float? value = 3.1415927F; + float? expected = 3.1F; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, 0.1F); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void A_float_cannot_approximate_NaN() + { + // Arrange + float? value = 3.1415927F; + + // Act + Action act = () => value.Should().NotBeApproximately(float.NaN, 0.1F); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void When_not_approximating_a_nullable_decimal_with_a_negative_precision_it_should_throw() + { + // Arrange + decimal? value = 3.1415927m; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14m, -0.1m); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_not_approximating_two_nullable_decimals_with_a_negative_precision_it_should_throw() + { + // Arrange + decimal? value = 3.1415927m; + decimal? expected = 3.14m; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, -0.1m); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_asserting_not_approximately_and_nullable_decimal_is_not_approximating_a_value_it_should_not_throw() + { + // Arrange + decimal? value = 3.1415927m; + + // Act + Action act = () => value.Should().NotBeApproximately(1.0m, 0.1m); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_not_approximately_and_nullable_decimal_has_no_value_it_should_throw() + { + // Arrange + decimal? value = null; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14m, 0.001m); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_not_approximately_and_nullable_decimal_is_indeed_approximating_a_value_it_should_throw() + { + // Arrange + decimal? value = 3.1415927m; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14m, 0.1m); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to not approximate*3.14* +/-*0.1*, but*3.14*only differed by*"); + } + + [Fact] + public void + When_asserting_not_approximately_and_nullable_decimal_is_not_approximating_a_nullable_value_it_should_not_throw() + { + // Arrange + decimal? value = 3.1415927m; + decimal? expected = 1.0m; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, 0.1m); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_not_approximately_and_nullable_decimal_is_not_approximating_a_null_value_it_should_throw() + { + // Arrange + decimal? value = 3.1415927m; + decimal? expected = null; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, 0.1m); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void + When_asserting_not_approximately_and_null_decimal_is_not_approximating_a_nullable_decimal_value_it_should_throw() + { + // Arrange + decimal? value = null; + decimal? expected = 20.0m; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, 0.1m); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_not_approximately_and_null_decimal_is_not_approximating_a_null_value_it_should_not_throw() + { + // Arrange + decimal? value = null; + decimal? expected = null; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, 0.1m); + + // Assert + act.Should().Throw() + .WithMessage("Expected**0.1M**"); + } + + [Fact] + public void When_asserting_not_approximately_and_nullable_decimal_is_approximating_a_nullable_value_it_should_throw() + { + // Arrange + decimal? value = 3.1415927m; + decimal? expected = 3.1m; + + // Act + Action act = () => value.Should().NotBeApproximately(expected, 0.1m); + + // Assert + act.Should().Throw(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeGreaterThan.cs b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeGreaterThan.cs new file mode 100644 index 0000000000..8d1acc61cc --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeGreaterThan.cs @@ -0,0 +1,71 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NullableNumericAssertionSpecs +{ + public class BeGreaterThan + { + [Fact] + public void A_float_can_never_be_greater_than_NaN() + { + // Arrange + float? value = 3.4F; + + // Act + Action act = () => value.Should().BeGreaterThan(float.NaN); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void NaN_is_never_greater_than_another_float() + { + // Arrange + float? value = float.NaN; + + // Act + Action act = () => value.Should().BeGreaterThan(0); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void A_double_can_never_be_greater_than_NaN() + { + // Arrange + double? value = 3.4F; + + // Act + Action act = () => value.Should().BeGreaterThan(double.NaN); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void NaN_is_never_greater_than_another_double() + { + // Arrange + double? value = double.NaN; + + // Act + Action act = () => value.Should().BeGreaterThan(0); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeGreaterThanOrEqualTo.cs b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeGreaterThanOrEqualTo.cs new file mode 100644 index 0000000000..ababf48c24 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeGreaterThanOrEqualTo.cs @@ -0,0 +1,71 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NullableNumericAssertionSpecs +{ + public class BeGreaterThanOrEqualTo + { + [Fact] + public void A_float_can_never_be_greater_than_or_equal_to_NaN() + { + // Arrange + float? value = 3.4F; + + // Act + Action act = () => value.Should().BeGreaterThanOrEqualTo(float.NaN); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void NaN_is_never_greater_than_or_equal_to_another_float() + { + // Arrange + float? value = float.NaN; + + // Act + Action act = () => value.Should().BeGreaterThanOrEqualTo(0); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void A_double_can_never_be_greater_than_or_equal_to_NaN() + { + // Arrange + double? value = 3.4; + + // Act + Action act = () => value.Should().BeGreaterThanOrEqualTo(double.NaN); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void NaN_is_never_greater_than_or_equal_to_another_double() + { + // Arrange + double? value = double.NaN; + + // Act + Action act = () => value.Should().BeGreaterThanOrEqualTo(0); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeInRange.cs b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeInRange.cs new file mode 100644 index 0000000000..62d1ffa151 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeInRange.cs @@ -0,0 +1,136 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NullableNumericAssertionSpecs +{ + public class BeInRange + { + [Theory] + [InlineData(float.NaN, 5F)] + [InlineData(5F, float.NaN)] + public void A_float_can_never_be_in_a_range_containing_NaN(float minimumValue, float maximumValue) + { + // Arrange + float? value = 4.5F; + + // Act + Action act = () => value.Should().BeInRange(minimumValue, maximumValue); + + // Assert + act + .Should().Throw() + .WithMessage( + "*NaN*"); + } + + [Fact] + public void NaN_is_never_in_range_of_two_floats() + { + // Arrange + float? value = float.NaN; + + // Act + Action act = () => value.Should().BeInRange(4, 5); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to be between*4* and*5*, but found*NaN*"); + } + + [Theory] + [InlineData(double.NaN, 5)] + [InlineData(5, double.NaN)] + public void A_double_can_never_be_in_a_range_containing_NaN(double minimumValue, double maximumValue) + { + // Arrange + double? value = 4.5; + + // Act + Action act = () => value.Should().BeInRange(minimumValue, maximumValue); + + // Assert + act + .Should().Throw() + .WithMessage( + "*NaN*"); + } + + [Fact] + public void NaN_is_never_in_range_of_two_doubles() + { + // Arrange + double? value = double.NaN; + + // Act + Action act = () => value.Should().BeInRange(4, 5); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to be between*4* and*5*, but found*NaN*"); + } + } + + public class NotBeInRange + { + [Theory] + [InlineData(float.NaN, 1F)] + [InlineData(1F, float.NaN)] + public void Cannot_use_NaN_in_a_range_of_floats(float minimumValue, float maximumValue) + { + // Arrange + float? value = 4.5F; + + // Act + Action act = () => value.Should().NotBeInRange(minimumValue, maximumValue); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void NaN_is_never_inside_any_range_of_floats() + { + // Arrange + float? value = float.NaN; + + // Act / Assert + value.Should().NotBeInRange(4, 5); + } + + [Theory] + [InlineData(double.NaN, 1D)] + [InlineData(1D, double.NaN)] + public void Cannot_use_NaN_in_a_range_of_doubles(double minimumValue, double maximumValue) + { + // Arrange + double? value = 4.5D; + + // Act + Action act = () => value.Should().NotBeInRange(minimumValue, maximumValue); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void NaN_is_never_inside_any_range_of_doubles() + { + // Arrange + double? value = double.NaN; + + // Act / Assert + value.Should().NotBeInRange(4, 5); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeLessThan.cs b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeLessThan.cs new file mode 100644 index 0000000000..5d6dd6f7e1 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeLessThan.cs @@ -0,0 +1,71 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NullableNumericAssertionSpecs +{ + public class BeLessThan + { + [Fact] + public void A_float_can_never_be_less_than_NaN() + { + // Arrange + float? value = 3.4F; + + // Act + Action act = () => value.Should().BeLessThan(float.NaN); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void NaN_is_never_less_than_another_float() + { + // Arrange + float? value = float.NaN; + + // Act + Action act = () => value.Should().BeLessThan(0); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void A_double_can_never_be_less_than_NaN() + { + // Arrange + double? value = 3.4F; + + // Act + Action act = () => value.Should().BeLessThan(double.NaN); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void NaN_is_never_less_than_another_double() + { + // Arrange + double? value = double.NaN; + + // Act + Action act = () => value.Should().BeLessThan(0); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeLessThanOrEqualTo.cs b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeLessThanOrEqualTo.cs new file mode 100644 index 0000000000..9c0854369f --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeLessThanOrEqualTo.cs @@ -0,0 +1,71 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NullableNumericAssertionSpecs +{ + public class BeLessThanOrEqualTo + { + [Fact] + public void A_float_can_never_be_less_than_or_equal_to_NaN() + { + // Arrange + float? value = 3.4F; + + // Act + Action act = () => value.Should().BeLessThanOrEqualTo(float.NaN); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void NaN_is_never_less_than_or_equal_to_another_float() + { + // Arrange + float? value = float.NaN; + + // Act + Action act = () => value.Should().BeLessThanOrEqualTo(0); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void A_double_can_never_be_less_than_or_equal_to_NaN() + { + // Arrange + double? value = 3.4; + + // Act + Action act = () => value.Should().BeLessThanOrEqualTo(double.NaN); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void NaN_is_never_less_than_or_equal_to_another_double() + { + // Arrange + double? value = double.NaN; + + // Act + Action act = () => value.Should().BeLessThanOrEqualTo(0); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeNegative.cs b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeNegative.cs new file mode 100644 index 0000000000..38ecbc9b99 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeNegative.cs @@ -0,0 +1,37 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NullableNumericAssertionSpecs +{ + public class BeNegative + { + [Fact] + public void NaN_is_never_a_negative_float() + { + // Arrange + float? value = float.NaN; + + // Act + Action act = () => value.Should().BeNegative(); + + // Assert + act.Should().Throw().WithMessage("*but found NaN*"); + } + + [Fact] + public void NaN_is_never_a_negative_double() + { + // Arrange + double? value = double.NaN; + + // Act + Action act = () => value.Should().BeNegative(); + + // Assert + act.Should().Throw().WithMessage("*but found NaN*"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeNull.cs b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeNull.cs new file mode 100644 index 0000000000..abac3ec134 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeNull.cs @@ -0,0 +1,89 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NullableNumericAssertionSpecs +{ + public class BeNull + { + [Fact] + public void Should_succeed_when_asserting_nullable_numeric_value_without_a_value_to_be_null() + { + // Arrange + int? nullableInteger = null; + + // Act / Assert + nullableInteger.Should().BeNull(); + } + + [Fact] + public void Should_fail_when_asserting_nullable_numeric_value_with_a_value_to_be_null() + { + // Arrange + int? nullableInteger = 1; + + // Act + Action act = () => nullableInteger.Should().BeNull(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Should_fail_with_descriptive_message_when_asserting_nullable_numeric_value_with_a_value_to_be_null() + { + // Arrange + int? nullableInteger = 1; + + // Act + Action act = () => nullableInteger.Should().BeNull("because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect a value because we want to test the failure message, but found 1."); + } + } + + public class NotBeNull + { + [Fact] + public void Should_succeed_when_asserting_nullable_numeric_value_with_value_to_not_be_null() + { + // Arrange + int? nullableInteger = 1; + + // Act / Assert + nullableInteger.Should().NotBeNull(); + } + + [Fact] + public void Should_fail_when_asserting_nullable_numeric_value_without_a_value_to_not_be_null() + { + // Arrange + int? nullableInteger = null; + + // Act + Action act = () => nullableInteger.Should().NotBeNull(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void + Should_fail_with_descriptive_message_when_asserting_nullable_numeric_value_without_a_value_to_not_be_null() + { + // Arrange + int? nullableInteger = null; + + // Act + Action act = () => nullableInteger.Should().NotBeNull("because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage("Expected a value because we want to test the failure message."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BePositive.cs b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BePositive.cs new file mode 100644 index 0000000000..c5a21dd73c --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BePositive.cs @@ -0,0 +1,37 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NullableNumericAssertionSpecs +{ + public class BePositive + { + [Fact] + public void NaN_is_never_a_positive_float() + { + // Arrange + float? value = float.NaN; + + // Act + Action act = () => value.Should().BePositive(); + + // Assert + act.Should().Throw().WithMessage("*but found NaN*"); + } + + [Fact] + public void NaN_is_never_a_positive_double() + { + // Arrange + double? value = double.NaN; + + // Act + Action act = () => value.Should().BePositive(); + + // Assert + act.Should().Throw().WithMessage("*but found NaN*"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.HaveValue.cs b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.HaveValue.cs new file mode 100644 index 0000000000..67346c8d2f --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.HaveValue.cs @@ -0,0 +1,90 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NullableNumericAssertionSpecs +{ + public class HaveValue + { + [Fact] + public void Should_succeed_when_asserting_nullable_numeric_value_with_value_to_have_a_value() + { + // Arrange + int? nullableInteger = 1; + + // Act / Assert + nullableInteger.Should().HaveValue(); + } + + [Fact] + public void Should_fail_when_asserting_nullable_numeric_value_without_a_value_to_have_a_value() + { + // Arrange + int? nullableInteger = null; + + // Act + Action act = () => nullableInteger.Should().HaveValue(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void + Should_fail_with_descriptive_message_when_asserting_nullable_numeric_value_without_a_value_to_have_a_value() + { + // Arrange + int? nullableInteger = null; + + // Act + Action act = () => nullableInteger.Should().HaveValue("because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage("Expected a value because we want to test the failure message."); + } + } + + public class NotHaveValue + { + [Fact] + public void Should_succeed_when_asserting_nullable_numeric_value_without_a_value_to_not_have_a_value() + { + // Arrange + int? nullableInteger = null; + + // Act / Assert + nullableInteger.Should().NotHaveValue(); + } + + [Fact] + public void Should_fail_when_asserting_nullable_numeric_value_with_a_value_to_not_have_a_value() + { + // Arrange + int? nullableInteger = 1; + + // Act + Action act = () => nullableInteger.Should().NotHaveValue(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_nullable_value_with_unexpected_value_is_found_it_should_throw_with_message() + { + // Arrange + int? nullableInteger = 1; + + // Act + Action action = () => nullableInteger.Should().NotHaveValue("it was {0} expected", "not"); + + // Assert + action + .Should().Throw() + .WithMessage("Did not expect a value because it was not expected, but found 1."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.Match.cs b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.Match.cs new file mode 100644 index 0000000000..f1a545a78c --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.Match.cs @@ -0,0 +1,51 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NullableNumericAssertionSpecs +{ + public class Match + { + [Fact] + public void When_nullable_value_satisfies_predicate_it_should_not_throw() + { + // Arrange + int? nullableInteger = 1; + + // Act / Assert + nullableInteger.Should().Match(o => o.HasValue); + } + + [Fact] + public void When_nullable_value_does_not_match_the_predicate_it_should_throw() + { + // Arrange + int? nullableInteger = 1; + + // Act + Action act = () => + nullableInteger.Should().Match(o => !o.HasValue, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected value to match Not(o.HasValue) because we want to test the failure message, but found 1."); + } + + [Fact] + public void When_nullable_value_is_matched_against_a_null_it_should_throw() + { + // Arrange + int? nullableInteger = 1; + + // Act + Action act = () => nullableInteger.Should().Match(null); + + // Assert + act.Should().ThrowExactly() + .WithParameterName("predicate"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.cs index a77f500164..d7dce9c4e7 100644 --- a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.cs @@ -1,1710 +1,9 @@ -using System; -using FluentAssertions.Execution; using Xunit; -using Xunit.Sdk; namespace FluentAssertions.Specs.Numeric; -public class NullableNumericAssertionSpecs +public partial class NullableNumericAssertionSpecs { - public class BePositive - { - [Fact] - public void NaN_is_never_a_positive_float() - { - // Arrange - float? value = float.NaN; - - // Act - Action act = () => value.Should().BePositive(); - - // Assert - act.Should().Throw().WithMessage("*but found NaN*"); - } - - [Fact] - public void NaN_is_never_a_positive_double() - { - // Arrange - double? value = double.NaN; - - // Act - Action act = () => value.Should().BePositive(); - - // Assert - act.Should().Throw().WithMessage("*but found NaN*"); - } - } - - public class BeNegative - { - [Fact] - public void NaN_is_never_a_negative_float() - { - // Arrange - float? value = float.NaN; - - // Act - Action act = () => value.Should().BeNegative(); - - // Assert - act.Should().Throw().WithMessage("*but found NaN*"); - } - - [Fact] - public void NaN_is_never_a_negative_double() - { - // Arrange - double? value = double.NaN; - - // Act - Action act = () => value.Should().BeNegative(); - - // Assert - act.Should().Throw().WithMessage("*but found NaN*"); - } - } - - public class BeLessThan - { - [Fact] - public void A_float_can_never_be_less_than_NaN() - { - // Arrange - float? value = 3.4F; - - // Act - Action act = () => value.Should().BeLessThan(float.NaN); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void NaN_is_never_less_than_another_float() - { - // Arrange - float? value = float.NaN; - - // Act - Action act = () => value.Should().BeLessThan(0); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void A_double_can_never_be_less_than_NaN() - { - // Arrange - double? value = 3.4F; - - // Act - Action act = () => value.Should().BeLessThan(double.NaN); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void NaN_is_never_less_than_another_double() - { - // Arrange - double? value = double.NaN; - - // Act - Action act = () => value.Should().BeLessThan(0); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - } - - public class BeGreaterThan - { - [Fact] - public void A_float_can_never_be_greater_than_NaN() - { - // Arrange - float? value = 3.4F; - - // Act - Action act = () => value.Should().BeGreaterThan(float.NaN); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void NaN_is_never_greater_than_another_float() - { - // Arrange - float? value = float.NaN; - - // Act - Action act = () => value.Should().BeGreaterThan(0); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void A_double_can_never_be_greater_than_NaN() - { - // Arrange - double? value = 3.4F; - - // Act - Action act = () => value.Should().BeGreaterThan(double.NaN); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void NaN_is_never_greater_than_another_double() - { - // Arrange - double? value = double.NaN; - - // Act - Action act = () => value.Should().BeGreaterThan(0); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - } - - public class BeLessThanOrEqualTo - { - [Fact] - public void A_float_can_never_be_less_than_or_equal_to_NaN() - { - // Arrange - float? value = 3.4F; - - // Act - Action act = () => value.Should().BeLessThanOrEqualTo(float.NaN); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void NaN_is_never_less_than_or_equal_to_another_float() - { - // Arrange - float? value = float.NaN; - - // Act - Action act = () => value.Should().BeLessThanOrEqualTo(0); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void A_double_can_never_be_less_than_or_equal_to_NaN() - { - // Arrange - double? value = 3.4; - - // Act - Action act = () => value.Should().BeLessThanOrEqualTo(double.NaN); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void NaN_is_never_less_than_or_equal_to_another_double() - { - // Arrange - double? value = double.NaN; - - // Act - Action act = () => value.Should().BeLessThanOrEqualTo(0); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - } - - public class BeGreaterThanOrEqualTo - { - [Fact] - public void A_float_can_never_be_greater_than_or_equal_to_NaN() - { - // Arrange - float? value = 3.4F; - - // Act - Action act = () => value.Should().BeGreaterThanOrEqualTo(float.NaN); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void NaN_is_never_greater_than_or_equal_to_another_float() - { - // Arrange - float? value = float.NaN; - - // Act - Action act = () => value.Should().BeGreaterThanOrEqualTo(0); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void A_double_can_never_be_greater_than_or_equal_to_NaN() - { - // Arrange - double? value = 3.4; - - // Act - Action act = () => value.Should().BeGreaterThanOrEqualTo(double.NaN); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void NaN_is_never_greater_than_or_equal_to_another_double() - { - // Arrange - double? value = double.NaN; - - // Act - Action act = () => value.Should().BeGreaterThanOrEqualTo(0); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - } - - public class BeInRange - { - [Theory] - [InlineData(float.NaN, 5F)] - [InlineData(5F, float.NaN)] - public void A_float_can_never_be_in_a_range_containing_NaN(float minimumValue, float maximumValue) - { - // Arrange - float? value = 4.5F; - - // Act - Action act = () => value.Should().BeInRange(minimumValue, maximumValue); - - // Assert - act - .Should().Throw() - .WithMessage( - "*NaN*"); - } - - [Fact] - public void NaN_is_never_in_range_of_two_floats() - { - // Arrange - float? value = float.NaN; - - // Act - Action act = () => value.Should().BeInRange(4, 5); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to be between*4* and*5*, but found*NaN*"); - } - - [Theory] - [InlineData(double.NaN, 5)] - [InlineData(5, double.NaN)] - public void A_double_can_never_be_in_a_range_containing_NaN(double minimumValue, double maximumValue) - { - // Arrange - double? value = 4.5; - - // Act - Action act = () => value.Should().BeInRange(minimumValue, maximumValue); - - // Assert - act - .Should().Throw() - .WithMessage( - "*NaN*"); - } - - [Fact] - public void NaN_is_never_in_range_of_two_doubles() - { - // Arrange - double? value = double.NaN; - - // Act - Action act = () => value.Should().BeInRange(4, 5); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to be between*4* and*5*, but found*NaN*"); - } - } - - public class NotBeInRange - { - [Theory] - [InlineData(float.NaN, 1F)] - [InlineData(1F, float.NaN)] - public void Cannot_use_NaN_in_a_range_of_floats(float minimumValue, float maximumValue) - { - // Arrange - float? value = 4.5F; - - // Act - Action act = () => value.Should().NotBeInRange(minimumValue, maximumValue); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void NaN_is_never_inside_any_range_of_floats() - { - // Arrange - float? value = float.NaN; - - // Act / Assert - value.Should().NotBeInRange(4, 5); - } - - [Theory] - [InlineData(double.NaN, 1D)] - [InlineData(1D, double.NaN)] - public void Cannot_use_NaN_in_a_range_of_doubles(double minimumValue, double maximumValue) - { - // Arrange - double? value = 4.5D; - - // Act - Action act = () => value.Should().NotBeInRange(minimumValue, maximumValue); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void NaN_is_never_inside_any_range_of_doubles() - { - // Arrange - double? value = double.NaN; - - // Act / Assert - value.Should().NotBeInRange(4, 5); - } - } - - public class HaveValue - { - [Fact] - public void Should_succeed_when_asserting_nullable_numeric_value_with_value_to_have_a_value() - { - // Arrange - int? nullableInteger = 1; - - // Act / Assert - nullableInteger.Should().HaveValue(); - } - - [Fact] - public void Should_fail_when_asserting_nullable_numeric_value_without_a_value_to_have_a_value() - { - // Arrange - int? nullableInteger = null; - - // Act - Action act = () => nullableInteger.Should().HaveValue(); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void - Should_fail_with_descriptive_message_when_asserting_nullable_numeric_value_without_a_value_to_have_a_value() - { - // Arrange - int? nullableInteger = null; - - // Act - Action act = () => nullableInteger.Should().HaveValue("because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage("Expected a value because we want to test the failure message."); - } - } - - public class NotHaveValue - { - [Fact] - public void Should_succeed_when_asserting_nullable_numeric_value_without_a_value_to_not_have_a_value() - { - // Arrange - int? nullableInteger = null; - - // Act / Assert - nullableInteger.Should().NotHaveValue(); - } - - [Fact] - public void Should_fail_when_asserting_nullable_numeric_value_with_a_value_to_not_have_a_value() - { - // Arrange - int? nullableInteger = 1; - - // Act - Action act = () => nullableInteger.Should().NotHaveValue(); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_nullable_value_with_unexpected_value_is_found_it_should_throw_with_message() - { - // Arrange - int? nullableInteger = 1; - - // Act - Action action = () => nullableInteger.Should().NotHaveValue("it was {0} expected", "not"); - - // Assert - action - .Should().Throw() - .WithMessage("Did not expect a value because it was not expected, but found 1."); - } - } - - public class NotBeNull - { - [Fact] - public void Should_succeed_when_asserting_nullable_numeric_value_with_value_to_not_be_null() - { - // Arrange - int? nullableInteger = 1; - - // Act / Assert - nullableInteger.Should().NotBeNull(); - } - - [Fact] - public void Should_fail_when_asserting_nullable_numeric_value_without_a_value_to_not_be_null() - { - // Arrange - int? nullableInteger = null; - - // Act - Action act = () => nullableInteger.Should().NotBeNull(); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void - Should_fail_with_descriptive_message_when_asserting_nullable_numeric_value_without_a_value_to_not_be_null() - { - // Arrange - int? nullableInteger = null; - - // Act - Action act = () => nullableInteger.Should().NotBeNull("because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage("Expected a value because we want to test the failure message."); - } - } - - public class BeNull - { - [Fact] - public void Should_succeed_when_asserting_nullable_numeric_value_without_a_value_to_be_null() - { - // Arrange - int? nullableInteger = null; - - // Act / Assert - nullableInteger.Should().BeNull(); - } - - [Fact] - public void Should_fail_when_asserting_nullable_numeric_value_with_a_value_to_be_null() - { - // Arrange - int? nullableInteger = 1; - - // Act - Action act = () => nullableInteger.Should().BeNull(); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_nullable_numeric_value_with_a_value_to_be_null() - { - // Arrange - int? nullableInteger = 1; - - // Act - Action act = () => nullableInteger.Should().BeNull("because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect a value because we want to test the failure message, but found 1."); - } - } - - public class Be - { - [Fact] - public void Should_succeed_when_asserting_nullable_numeric_value_equals_an_equal_value() - { - // Arrange - int? nullableIntegerA = 1; - int? nullableIntegerB = 1; - - // Act / Assert - nullableIntegerA.Should().Be(nullableIntegerB); - } - - [Fact] - public void Should_succeed_when_asserting_nullable_numeric_null_value_equals_null() - { - // Arrange - int? nullableIntegerA = null; - int? nullableIntegerB = null; - - // Act / Assert - nullableIntegerA.Should().Be(nullableIntegerB); - } - - [Fact] - public void Should_fail_when_asserting_nullable_numeric_value_equals_a_different_value() - { - // Arrange - int? nullableIntegerA = 1; - int? nullableIntegerB = 2; - - // Act - Action act = () => nullableIntegerA.Should().Be(nullableIntegerB); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_nullable_numeric_value_equals_a_different_value() - { - // Arrange - int? nullableIntegerA = 1; - int? nullableIntegerB = 2; - - // Act - Action act = () => - nullableIntegerA.Should().Be(nullableIntegerB, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage("Expected*2 because we want to test the failure message, but found 1."); - } - - [Fact] - public void Nan_is_never_equal_to_a_normal_float() - { - // Arrange - float? value = float.NaN; - - // Act - Action act = () => value.Should().Be(3.4F); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to be *3.4F, but found NaN*"); - } - - [Fact] - public void NaN_can_be_compared_to_NaN_when_its_a_float() - { - // Arrange - float? value = float.NaN; - - // Act - value.Should().Be(float.NaN); - } - - [Fact] - public void Nan_is_never_equal_to_a_normal_double() - { - // Arrange - double? value = double.NaN; - - // Act - Action act = () => value.Should().Be(3.4D); - - // Assert - act - .Should().Throw() - .WithMessage("Expected value to be *3.4, but found NaN*"); - } - - [Fact] - public void NaN_can_be_compared_to_NaN_when_its_a_double() - { - // Arrange - double? value = double.NaN; - - // Act - value.Should().Be(double.NaN); - } - } - - public class BeApproximately - { - [Fact] - public void When_approximating_a_nullable_double_with_a_negative_precision_it_should_throw() - { - // Arrange - double? value = 3.1415927; - - // Act - Action act = () => value.Should().BeApproximately(3.14, -0.1); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_approximating_two_nullable_doubles_with_a_negative_precision_it_should_throw() - { - // Arrange - double? value = 3.1415927; - double? expected = 3.14; - - // Act - Action act = () => value.Should().BeApproximately(expected, -0.1); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_nullable_double_is_indeed_approximating_a_value_it_should_not_throw() - { - // Arrange - double? value = 3.1415927; - - // Act - Action act = () => value.Should().BeApproximately(3.14, 0.1); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_nullable_double_is_indeed_approximating_a_nullable_value_it_should_not_throw() - { - // Arrange - double? value = 3.1415927; - double? expected = 3.142; - - // Act - Action act = () => value.Should().BeApproximately(expected, 0.1); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_nullable_double_is_null_approximating_a_nullable_null_value_it_should_not_throw() - { - // Arrange - double? value = null; - double? expected = null; - - // Act - Action act = () => value.Should().BeApproximately(expected, 0.1); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_nullable_double_with_value_is_not_approximating_a_non_null_nullable_value_it_should_throw() - { - // Arrange - double? value = 13; - double? expected = 12; - - // Act - Action act = () => value.Should().BeApproximately(expected, 0.1); - - // Assert - act.Should().Throw().WithMessage("Expected*12.0*0.1*13.0*"); - } - - [Fact] - public void When_nullable_double_is_null_approximating_a_non_null_nullable_value_it_should_throw() - { - // Arrange - double? value = null; - double? expected = 12; - - // Act - Action act = () => value.Should().BeApproximately(expected, 0.1); - - // Assert - act.Should().Throw().WithMessage( - "Expected value to approximate 12.0 +/- 0.1, but it was ."); - } - - [Fact] - public void When_nullable_double_is_not_null_approximating_a_null_value_it_should_throw() - { - // Arrange - double? value = 12; - double? expected = null; - - // Act - Action act = () => value.Should().BeApproximately(expected, 0.1); - - // Assert - act.Should().Throw().WithMessage( - "Expected value to approximate +/- 0.1, but it was 12.0."); - } - - [Fact] - public void When_nullable_double_has_no_value_it_should_throw() - { - // Arrange - double? value = null; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - value.Should().BeApproximately(3.14, 0.001); - }; - - // Assert - act.Should().Throw().WithMessage( - "Expected value to approximate 3.14 +/- 0.001, but it was ."); - } - - [Fact] - public void When_nullable_double_is_not_approximating_a_value_it_should_throw() - { - // Arrange - double? value = 3.1415927F; - - // Act - Action act = () => value.Should().BeApproximately(1.0, 0.1); - - // Assert - act - .Should().Throw() - .WithMessage("Expected value to approximate 1.0 +/- 0.1, but 3.14* differed by*"); - } - - [Fact] - public void A_double_cannot_approximate_NaN() - { - // Arrange - double? value = 3.1415927F; - - // Act - Action act = () => value.Should().BeApproximately(double.NaN, 0.1); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void When_approximating_a_nullable_float_with_a_negative_precision_it_should_throw() - { - // Arrange - float? value = 3.1415927F; - - // Act - Action act = () => value.Should().BeApproximately(3.14F, -0.1F); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_approximating_two_nullable_floats_with_a_negative_precision_it_should_throw() - { - // Arrange - float? value = 3.1415927F; - float? expected = 3.14F; - - // Act - Action act = () => value.Should().BeApproximately(expected, -0.1F); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_nullable_float_is_indeed_approximating_a_value_it_should_not_throw() - { - // Arrange - float? value = 3.1415927F; - - // Act - Action act = () => value.Should().BeApproximately(3.14F, 0.1F); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_nullable_float_is_indeed_approximating_a_nullable_value_it_should_not_throw() - { - // Arrange - float? value = 3.1415927f; - float? expected = 3.142f; - - // Act - Action act = () => value.Should().BeApproximately(expected, 0.1f); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_nullable_float_is_null_approximating_a_nullable_null_value_it_should_not_throw() - { - // Arrange - float? value = null; - float? expected = null; - - // Act - Action act = () => value.Should().BeApproximately(expected, 0.1f); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_nullable_float_with_value_is_not_approximating_a_non_null_nullable_value_it_should_throw() - { - // Arrange - float? value = 13; - float? expected = 12; - - // Act - Action act = () => value.Should().BeApproximately(expected, 0.1f); - - // Assert - act.Should().Throw().WithMessage("Expected*12*0.1*13*"); - } - - [Fact] - public void When_nullable_float_is_null_approximating_a_non_null_nullable_value_it_should_throw() - { - // Arrange - float? value = null; - float? expected = 12; - - // Act - Action act = () => value.Should().BeApproximately(expected, 0.1f); - - // Assert - act.Should().Throw().WithMessage( - "Expected value to approximate 12F +/- 0.1F, but it was ."); - } - - [Fact] - public void When_nullable_float_is_not_null_approximating_a_null_value_it_should_throw() - { - // Arrange - float? value = 12; - float? expected = null; - - // Act - Action act = () => value.Should().BeApproximately(expected, 0.1f); - - // Assert - act.Should().Throw().WithMessage( - "Expected value to approximate +/- 0.1F, but it was 12F."); - } - - [Fact] - public void When_nullable_float_has_no_value_it_should_throw() - { - // Arrange - float? value = null; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - value.Should().BeApproximately(3.14F, 0.001F); - }; - - // Assert - act.Should().Throw().WithMessage( - "Expected value to approximate 3.14F +/- 0.001F, but it was ."); - } - - [Fact] - public void When_nullable_float_is_not_approximating_a_value_it_should_throw() - { - // Arrange - float? value = 3.1415927F; - - // Act - Action act = () => value.Should().BeApproximately(1.0F, 0.1F); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to approximate *1* +/- *0.1* but 3.14* differed by*"); - } - - [Fact] - public void A_float_cannot_approximate_NaN() - { - // Arrange - float? value = 3.1415927F; - - // Act - Action act = () => value.Should().BeApproximately(float.NaN, 0.1F); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void When_approximating_a_nullable_decimal_with_a_negative_precision_it_should_throw() - { - // Arrange - decimal? value = 3.1415927m; - - // Act - Action act = () => value.Should().BeApproximately(3.14m, -0.1m); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_approximating_two_nullable_decimals_with_a_negative_precision_it_should_throw() - { - // Arrange - decimal? value = 3.1415927m; - decimal? expected = 3.14m; - - // Act - Action act = () => value.Should().BeApproximately(expected, -0.1m); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_nullable_decimal_is_indeed_approximating_a_value_it_should_not_throw() - { - // Arrange - decimal? value = 3.1415927m; - - // Act - Action act = () => value.Should().BeApproximately(3.14m, 0.1m); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_nullable_decimal_is_indeed_approximating_a_nullable_value_it_should_not_throw() - { - // Arrange - decimal? value = 3.1415927m; - decimal? expected = 3.142m; - - // Act - Action act = () => value.Should().BeApproximately(expected, 0.1m); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_nullable_decimal_is_null_approximating_a_nullable_null_value_it_should_not_throw() - { - // Arrange - decimal? value = null; - decimal? expected = null; - - // Act - Action act = () => value.Should().BeApproximately(expected, 0.1m); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_nullable_decimal_with_value_is_not_approximating_a_non_null_nullable_value_it_should_throw() - { - // Arrange - decimal? value = 13; - decimal? expected = 12; - - // Act - Action act = () => value.Should().BeApproximately(expected, 0.1m); - - // Assert - act.Should().Throw().WithMessage("Expected*12*0.1*13*"); - } - - [Fact] - public void When_nullable_decimal_is_null_approximating_a_non_null_nullable_value_it_should_throw() - { - // Arrange - decimal? value = null; - decimal? expected = 12; - - // Act - Action act = () => value.Should().BeApproximately(expected, 0.1m); - - // Assert - act.Should().Throw().WithMessage( - "Expected value to approximate 12M +/- 0.1M, but it was ."); - } - - [Fact] - public void When_nullable_decimal_is_not_null_approximating_a_null_value_it_should_throw() - { - // Arrange - decimal? value = 12; - decimal? expected = null; - - // Act - Action act = () => value.Should().BeApproximately(expected, 0.1m); - - // Assert - act.Should().Throw().WithMessage( - "Expected value to approximate +/- 0.1M, but it was 12M."); - } - - [Fact] - public void When_nullable_decimal_has_no_value_it_should_throw() - { - // Arrange - decimal? value = null; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - value.Should().BeApproximately(3.14m, 0.001m); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expected value to approximate*3.14* +/-*0.001*, but it was ."); - } - - [Fact] - public void When_nullable_decimal_is_not_approximating_a_value_it_should_throw() - { - // Arrange - decimal? value = 3.1415927m; - - // Act - Action act = () => value.Should().BeApproximately(1.0m, 0.1m); - - // Assert - act - .Should().Throw() - .WithMessage("Expected value to approximate*1.0* +/-*0.1*, but 3.14* differed by*"); - } - } - - public class NotBeApproximately - { - [Fact] - public void When_not_approximating_a_nullable_double_with_a_negative_precision_it_should_throw() - { - // Arrange - double? value = 3.1415927; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14, -0.1); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_not_approximating_two_nullable_doubles_with_a_negative_precision_it_should_throw() - { - // Arrange - double? value = 3.1415927; - double? expected = 3.14; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, -0.1); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_asserting_not_approximately_and_nullable_double_is_not_approximating_a_value_it_should_not_throw() - { - // Arrange - double? value = 3.1415927; - - // Act - Action act = () => value.Should().NotBeApproximately(1.0, 0.1); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_not_approximately_and_nullable_double_has_no_value_it_should_throw() - { - // Arrange - double? value = null; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14, 0.001); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_not_approximately_and_nullable_double_is_indeed_approximating_a_value_it_should_throw() - { - // Arrange - double? value = 3.1415927; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14, 0.1); - - // Assert - act - .Should().Throw() - .WithMessage("Expected value to not approximate 3.14 +/- 0.1, but 3.14*only differed by*"); - } - - [Fact] - public void - When_asserting_not_approximately_and_nullable_double_is_not_approximating_a_nullable_value_it_should_not_throw() - { - // Arrange - double? value = 3.1415927; - double? expected = 1.0; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, 0.1); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_not_approximately_and_nullable_double_is_not_approximating_a_null_value_it_should_throw() - { - // Arrange - double? value = 3.1415927; - double? expected = null; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, 0.1); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void - When_asserting_not_approximately_and_null_double_is_not_approximating_a_nullable_double_value_it_should_throw() - { - // Arrange - double? value = null; - double? expected = 20.0; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, 0.1); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_not_approximately_and_null_double_is_not_approximating_a_null_value_it_should_not_throw() - { - // Arrange - double? value = null; - double? expected = null; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, 0.1); - - // Assert - act.Should().Throw() - .WithMessage("Expected*null*0.1*but*null*"); - } - - [Fact] - public void When_asserting_not_approximately_and_nullable_double_is_approximating_a_nullable_value_it_should_throw() - { - // Arrange - double? value = 3.1415927; - double? expected = 3.1; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, 0.1F); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void A_double_cannot_approximate_NaN() - { - // Arrange - double? value = 3.1415927F; - - // Act - Action act = () => value.Should().NotBeApproximately(double.NaN, 0.1); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void When_not_approximating_a_nullable_float_with_a_negative_precision_it_should_throw() - { - // Arrange - float? value = 3.1415927F; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14F, -0.1F); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_not_approximating_two_nullable_floats_with_a_negative_precision_it_should_throw() - { - // Arrange - float? value = 3.1415927F; - float? expected = 3.14F; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, -0.1F); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_asserting_not_approximately_and_nullable_float_is_not_approximating_a_value_it_should_not_throw() - { - // Arrange - float? value = 3.1415927F; - - // Act - Action act = () => value.Should().NotBeApproximately(1.0F, 0.1F); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_not_approximately_and_nullable_float_has_no_value_it_should_throw() - { - // Arrange - float? value = null; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14F, 0.001F); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_not_approximately_and_nullable_float_is_indeed_approximating_a_value_it_should_throw() - { - // Arrange - float? value = 3.1415927F; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14F, 0.1F); - - // Assert - act - .Should().Throw() - .WithMessage("Expected value to not approximate *3.14F* +/- *0.1F* but 3.14* only differed by*"); - } - - [Fact] - public void - When_asserting_not_approximately_and_nullable_float_is_not_approximating_a_nullable_value_it_should_not_throw() - { - // Arrange - float? value = 3.1415927F; - float? expected = 1.0F; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, 0.1F); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_not_approximately_and_nullable_float_is_not_approximating_a_null_value_it_should_throw() - { - // Arrange - float? value = 3.1415927F; - float? expected = null; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, 0.1F); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void - When_asserting_not_approximately_and_null_float_is_not_approximating_a_nullable_float_value_it_should_throw() - { - // Arrange - float? value = null; - float? expected = 20.0f; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, 0.1F); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_not_approximately_and_null_float_is_not_approximating_a_null_value_it_should_not_throw() - { - // Arrange - float? value = null; - float? expected = null; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, 0.1F); - - // Assert - act.Should().Throw("Expected**+/-*0.1F**"); - } - - [Fact] - public void When_asserting_not_approximately_and_nullable_float_is_approximating_a_nullable_value_it_should_throw() - { - // Arrange - float? value = 3.1415927F; - float? expected = 3.1F; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, 0.1F); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void A_float_cannot_approximate_NaN() - { - // Arrange - float? value = 3.1415927F; - - // Act - Action act = () => value.Should().NotBeApproximately(float.NaN, 0.1F); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void When_not_approximating_a_nullable_decimal_with_a_negative_precision_it_should_throw() - { - // Arrange - decimal? value = 3.1415927m; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14m, -0.1m); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_not_approximating_two_nullable_decimals_with_a_negative_precision_it_should_throw() - { - // Arrange - decimal? value = 3.1415927m; - decimal? expected = 3.14m; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, -0.1m); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_asserting_not_approximately_and_nullable_decimal_is_not_approximating_a_value_it_should_not_throw() - { - // Arrange - decimal? value = 3.1415927m; - - // Act - Action act = () => value.Should().NotBeApproximately(1.0m, 0.1m); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_not_approximately_and_nullable_decimal_has_no_value_it_should_throw() - { - // Arrange - decimal? value = null; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14m, 0.001m); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_not_approximately_and_nullable_decimal_is_indeed_approximating_a_value_it_should_throw() - { - // Arrange - decimal? value = 3.1415927m; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14m, 0.1m); - - // Assert - act - .Should().Throw() - .WithMessage("Expected value to not approximate*3.14* +/-*0.1*, but*3.14*only differed by*"); - } - - [Fact] - public void - When_asserting_not_approximately_and_nullable_decimal_is_not_approximating_a_nullable_value_it_should_not_throw() - { - // Arrange - decimal? value = 3.1415927m; - decimal? expected = 1.0m; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, 0.1m); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_not_approximately_and_nullable_decimal_is_not_approximating_a_null_value_it_should_throw() - { - // Arrange - decimal? value = 3.1415927m; - decimal? expected = null; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, 0.1m); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void - When_asserting_not_approximately_and_null_decimal_is_not_approximating_a_nullable_decimal_value_it_should_throw() - { - // Arrange - decimal? value = null; - decimal? expected = 20.0m; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, 0.1m); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_not_approximately_and_null_decimal_is_not_approximating_a_null_value_it_should_not_throw() - { - // Arrange - decimal? value = null; - decimal? expected = null; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, 0.1m); - - // Assert - act.Should().Throw() - .WithMessage("Expected**0.1M**"); - } - - [Fact] - public void When_asserting_not_approximately_and_nullable_decimal_is_approximating_a_nullable_value_it_should_throw() - { - // Arrange - decimal? value = 3.1415927m; - decimal? expected = 3.1m; - - // Act - Action act = () => value.Should().NotBeApproximately(expected, 0.1m); - - // Assert - act.Should().Throw(); - } - } - - public class Match - { - [Fact] - public void When_nullable_value_satisfies_predicate_it_should_not_throw() - { - // Arrange - int? nullableInteger = 1; - - // Act / Assert - nullableInteger.Should().Match(o => o.HasValue); - } - - [Fact] - public void When_nullable_value_does_not_match_the_predicate_it_should_throw() - { - // Arrange - int? nullableInteger = 1; - - // Act - Action act = () => - nullableInteger.Should().Match(o => !o.HasValue, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected value to match Not(o.HasValue) because we want to test the failure message, but found 1."); - } - - [Fact] - public void When_nullable_value_is_matched_against_a_null_it_should_throw() - { - // Arrange - int? nullableInteger = 1; - - // Act - Action act = () => nullableInteger.Should().Match(null); - - // Assert - act.Should().ThrowExactly() - .WithParameterName("predicate"); - } - } - [Fact] public void Should_support_chaining_constraints_with_and() { From ba8ff48e230b99d337fadcf9ce21e814cc614ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Wed, 1 Nov 2023 16:05:58 +0100 Subject: [PATCH 149/845] Split GenericDictionaryAssertionSpecs (#2424) --- ...GenericDictionaryAssertionSpecs.BeEmpty.cs | 143 + .../GenericDictionaryAssertionSpecs.BeNull.cs | 73 + ...GenericDictionaryAssertionSpecs.Contain.cs | 782 +++++ ...ericDictionaryAssertionSpecs.ContainKey.cs | 152 + ...ricDictionaryAssertionSpecs.ContainKeys.cs | 211 ++ ...icDictionaryAssertionSpecs.ContainValue.cs | 183 + ...cDictionaryAssertionSpecs.ContainValues.cs | 160 + .../GenericDictionaryAssertionSpecs.Equal.cs | 351 ++ ...nericDictionaryAssertionSpecs.HaveCount.cs | 216 ++ ...naryAssertionSpecs.HaveCountGreaterThan.cs | 81 + ...tionSpecs.HaveCountGreaterThanOrEqualTo.cs | 83 + ...tionaryAssertionSpecs.HaveCountLessThan.cs | 80 + ...sertionSpecs.HaveCountLessThanOrEqualTo.cs | 83 + ...cDictionaryAssertionSpecs.HaveSameCount.cs | 230 ++ .../GenericDictionaryAssertionSpecs.cs | 3003 +---------------- 15 files changed, 2992 insertions(+), 2839 deletions(-) create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.BeEmpty.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.BeNull.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.Contain.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainKey.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainKeys.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValue.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValues.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.Equal.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCount.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountGreaterThan.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountLessThan.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountLessThanOrEqualTo.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveSameCount.cs diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.BeEmpty.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.BeEmpty.cs new file mode 100644 index 0000000000..1a388efd45 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.BeEmpty.cs @@ -0,0 +1,143 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericDictionaryAssertionSpecs +{ + public class BeEmpty + { + [Fact] + public void Should_succeed_when_asserting_dictionary_without_items_is_empty() + { + // Arrange + var dictionary = new Dictionary(); + + // Act / Assert + dictionary.Should().BeEmpty(); + } + + [Fact] + public void Should_fail_when_asserting_dictionary_with_items_is_empty() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One" + }; + + // Act + Action act = () => dictionary.Should().BeEmpty(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Should_fail_with_descriptive_message_when_asserting_dictionary_with_items_is_empty() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One" + }; + + // Act + Action act = () => dictionary.Should().BeEmpty("because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected dictionary to be empty because we want to test the failure message, but found {[1] = \"One\"}."); + } + + [Fact] + public void When_asserting_dictionary_to_be_empty_but_dictionary_is_null_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => dictionary.Should().BeEmpty("because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to be empty because we want to test the behaviour with a null subject, but found ."); + } + } + + public class NotBeEmpty + { + [Fact] + public void When_asserting_dictionary_with_items_is_not_empty_it_should_succeed() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One" + }; + + // Act / Assert + dictionary.Should().NotBeEmpty(); + } + +#if !NET5_0_OR_GREATER + [Fact] + public void When_asserting_dictionary_with_items_is_not_empty_it_should_enumerate_the_dictionary_only_once() + { + // Arrange + var trackingDictionary = new TrackingTestDictionary(new KeyValuePair(1, "One")); + + // Act + trackingDictionary.Should().NotBeEmpty(); + + // Assert + trackingDictionary.Enumerator.LoopCount.Should().Be(1); + } + +#endif + + [Fact] + public void When_asserting_dictionary_without_items_is_not_empty_it_should_fail() + { + // Arrange + var dictionary = new Dictionary(); + + // Act + Action act = () => dictionary.Should().NotBeEmpty(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_asserting_dictionary_without_items_is_not_empty_it_should_fail_with_descriptive_message_() + { + // Arrange + var dictionary = new Dictionary(); + + // Act + Action act = () => dictionary.Should().NotBeEmpty("because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage("Expected dictionary not to be empty because we want to test the failure message."); + } + + [Fact] + public void When_asserting_dictionary_to_be_not_empty_but_dictionary_is_null_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => dictionary.Should().NotBeEmpty("because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary not to be empty because we want to test the behaviour with a null subject, but found ."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.BeNull.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.BeNull.cs new file mode 100644 index 0000000000..ad40258aa2 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.BeNull.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericDictionaryAssertionSpecs +{ + public class BeNull + { + [Fact] + public void When_dictionary_is_expected_to_be_null_and_it_is_it_should_not_throw() + { + // Arrange + IDictionary someDictionary = null; + + // Act / Assert + someDictionary.Should().BeNull(); + } + + [Fact] + public void When_dictionary_is_expected_to_be_null_and_it_isnt_it_should_throw() + { + // Arrange + var someDictionary = new Dictionary(); + + // Act + Action act = () => someDictionary.Should().BeNull("because {0} is valid", "null"); + + // Assert + act.Should().Throw().WithMessage( + "Expected someDictionary to be because null is valid, but found {empty}."); + } + } + + public class NotBeNull + { + [Fact] + public void When_a_custom_dictionary_implementation_is_expected_not_to_be_null_and_it_is_it_should_not_throw() + { + // Arrange + var dictionary = new TrackingTestDictionary(); + + // Act / Assert + dictionary.Should().NotBeNull(); + } + + [Fact] + public void When_dictionary_is_not_expected_to_be_null_and_it_isnt_it_should_not_throw() + { + // Arrange + IDictionary someDictionary = new Dictionary(); + + // Act / Assert + someDictionary.Should().NotBeNull(); + } + + [Fact] + public void When_dictionary_is_not_expected_to_be_null_and_it_is_it_should_throw() + { + // Arrange + IDictionary someDictionary = null; + + // Act + Action act = () => someDictionary.Should().NotBeNull("because {0} should not", "someDictionary"); + + // Assert + act.Should().Throw().WithMessage( + "Expected someDictionary not to be because someDictionary should not."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.Contain.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.Contain.cs new file mode 100644 index 0000000000..92ff7c8b4e --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.Contain.cs @@ -0,0 +1,782 @@ +using System; +using System.Collections.Generic; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericDictionaryAssertionSpecs +{ + public class Contain + { + [Fact] + public void Should_succeed_when_asserting_dictionary_contains_single_key_value_pair() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var keyValuePairs = new List> + { + new(1, "One") + }; + + // Act / Assert + dictionary.Should().Contain(keyValuePairs); + } + + [Fact] + public void Should_succeed_when_asserting_dictionary_contains_multiple_key_value_pair() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three", + [4] = "Four" + }; + + var expectedKeyValuePair1 = new KeyValuePair(2, "Two"); + var expectedKeyValuePair2 = new KeyValuePair(3, "Three"); + + // Act / Assert + dictionary.Should().Contain(expectedKeyValuePair1, expectedKeyValuePair2); + } + + [Fact] + public void Should_succeed_when_asserting_dictionary_contains_multiple_key_value_pairs() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var keyValuePairs = new List> + { + new(1, "One"), + new(2, "Two") + }; + + // Act / Assert + dictionary.Should().Contain(keyValuePairs); + } + + [Fact] + public void When_a_dictionary_does_not_contain_single_value_for_key_value_pairs_it_should_throw_with_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var keyValuePairs = new List> + { + new(1, "One"), + new(2, "Three") + }; + + // Act + Action act = () => dictionary.Should().Contain(keyValuePairs, "because {0}", "we do"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to contain value \"Three\" at key 2 because we do, but found \"Two\"."); + } + + [Fact] + public void + When_a_dictionary_does_not_contain_multiple_values_for_key_value_pairs_it_should_throw_with_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var keyValuePairs = new List> + { + new(1, "Two"), + new(2, "Three") + }; + + // Act + Action act = () => dictionary.Should().Contain(keyValuePairs, "because {0}", "we do"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to contain {[1, Two], [2, Three]} because we do, but dictionary differs at keys {1, 2}."); + } + + [Fact] + public void When_a_dictionary_does_not_contain_single_key_for_key_value_pairs_it_should_throw_with_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var keyValuePairs = new List> + { + new(3, "Three") + }; + + // Act + Action act = () => dictionary.Should().Contain(keyValuePairs, "because {0}", "we do"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to contain key 3 because we do."); + } + + [Fact] + public void When_a_dictionary_does_not_contain_multiple_keys_for_key_value_pairs_it_should_throw_with_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var keyValuePairs = new List> + { + new(1, "One"), + new(3, "Three"), + new(4, "Four") + }; + + // Act + Action act = () => dictionary.Should().Contain(keyValuePairs, "because {0}", "we do"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to contain key(s) {1, 3, 4} because we do, but could not find keys {3, 4}."); + } + + [Fact] + public void When_asserting_dictionary_contains_key_value_pairs_against_null_dictionary_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + + List> keyValuePairs = new() + { + new KeyValuePair(1, "One"), + new KeyValuePair(1, "Two") + }; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + dictionary.Should().Contain(keyValuePairs, "because we want to test the behaviour with a null subject"); + }; + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to contain key/value pairs {[1, One], [1, Two]} because we want to test the behaviour with a null subject, but dictionary is ."); + } + + [Fact] + public void When_asserting_dictionary_contains_key_value_pairs_but_expected_key_value_pairs_are_empty_it_should_throw() + { + // Arrange + var dictionary1 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + List> keyValuePairs = new(); + + // Act + Action act = () => dictionary1.Should().Contain(keyValuePairs, + "because we want to test the behaviour with an empty set of key/value pairs"); + + // Assert + act.Should().Throw().WithMessage( + "Cannot verify key containment against an empty collection of key/value pairs*"); + } + + [Fact] + public void When_asserting_dictionary_contains_key_value_pairs_but_expected_key_value_pairs_are_null_it_should_throw() + { + // Arrange + var dictionary1 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + List> keyValuePairs = null; + + // Act + Action act = () => + dictionary1.Should().Contain(keyValuePairs, "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw() + .WithMessage("Cannot compare dictionary with .*") + .WithParameterName("expected"); + } + + [Fact] + public void When_dictionary_contains_expected_value_at_specific_key_it_should_not_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act / Assert + dictionary.Should().Contain(1, "One"); + } + + [Fact] + public void When_dictionary_contains_expected_null_at_specific_key_it_should_not_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = null + }; + + // Act / Assert + dictionary.Should().Contain(1, null); + } + + [Fact] + public void When_dictionary_contains_expected_key_value_pairs_it_should_not_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act / Assert + var items = new List> + { + new(1, "One"), + new(2, "Two") + }; + + dictionary.Should().Contain(items); + } + + [Fact] + public void When_dictionary_contains_expected_key_value_pair_it_should_not_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act / Assert + var item = new KeyValuePair(1, "One"); + dictionary.Should().Contain(item); + } + + [Fact] + public void When_dictionary_does_not_contain_the_expected_value_at_specific_key_it_should_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + var item = new KeyValuePair(1, "Two"); + Action act = () => dictionary.Should().Contain(item, "we put it {0}", "there"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to contain value \"Two\" at key 1 because we put it there, but found \"One\"."); + } + + [Fact] + public void When_dictionary_does_not_contain_the_key_value_pairs_it_should_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var items = new List> + { + new(1, "Two"), + new(2, "Three") + }; + + // Act + Action act = () => dictionary.Should().Contain(items, "we put them {0}", "there"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to contain {[1, Two], [2, Three]} because we put them there, but dictionary differs at keys {1, 2}."); + } + + [Fact] + public void When_dictionary_does_not_contain_the_key_value_pair_it_should_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().Contain(1, "Two", "we put it {0}", "there"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to contain value \"Two\" at key 1 because we put it there, but found \"One\"."); + } + + [Fact] + public void When_dictionary_does_not_contain_an_value_at_the_specific_key_it_should_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().Contain(3, "Two", "we put it {0}", "there"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to contain value \"Two\" at key 3 because we put it there, but the key was not found."); + } + + [Fact] + public void When_asserting_dictionary_contains_value_at_specific_key_against_null_dictionary_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + dictionary.Should().Contain(1, "One", "because we want to test the behaviour with a null subject"); + }; + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to contain value \"One\" at key 1 because we want to test the behaviour with a null subject, but dictionary is ."); + } + + [Fact] + public void When_a_dictionary_like_collection_contains_the_default_key_it_should_succeed() + { + // Arrange + var subject = new List> + { new(0, 0) }; + + // Act + Action act = () => subject.Should().Contain(0, 0); + + // Assert + act.Should().NotThrow(); + } + } + + public class NotContain + { + [Fact] + public void Should_succeed_when_asserting_dictionary_does_not_contain_single_key_value_pair() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var keyValuePairs = new List> + { + new(3, "Three") + }; + + // Act / Assert + dictionary.Should().NotContain(keyValuePairs); + } + + [Fact] + public void Should_succeed_when_asserting_dictionary_does_not_contain_multiple_key_value_pair() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var unexpectedKeyValuePair1 = new KeyValuePair(3, "Three"); + var unexpectedKeyValuePair2 = new KeyValuePair(4, "Four"); + + // Act / Assert + dictionary.Should().NotContain(unexpectedKeyValuePair1, unexpectedKeyValuePair2); + } + + [Fact] + public void + Should_succeed_when_asserting_dictionary_does_not_contain_single_key_value_pair_with_existing_key_but_different_value() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var keyValuePairs = new List> + { + new(1, "Two") + }; + + // Act / Assert + dictionary.Should().NotContain(keyValuePairs); + } + + [Fact] + public void Should_succeed_when_asserting_dictionary_does_not_contain_multiple_key_value_pairs() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var keyValuePairs = new List> + { + new(3, "Three"), + new(4, "Four") + }; + + // Act / Assert + dictionary.Should().NotContain(keyValuePairs); + } + + [Fact] + public void + Should_succeed_when_asserting_dictionary_does_not_contain_multiple_key_value_pairs_with_existing_keys_but_different_values() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var keyValuePairs = new List> + { + new(1, "Three"), + new(2, "Four") + }; + + // Act / Assert + dictionary.Should().NotContain(keyValuePairs); + } + + [Fact] + public void When_a_dictionary_does_contain_single_key_value_pair_it_should_throw_with_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var keyValuePairs = new List> + { + new(1, "One") + }; + + // Act + Action act = () => dictionary.Should().NotContain(keyValuePairs, "because {0}", "we do"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to not contain value \"One\" at key 1 because we do, but found it anyhow."); + } + + [Fact] + public void When_a_dictionary_does_contain_multiple_key_value_pairs_it_should_throw_with_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var keyValuePairs = new List> + { + new(1, "One"), + new(2, "Two") + }; + + // Act + Action act = () => dictionary.Should().NotContain(keyValuePairs, "because {0}", "we do"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to not contain key/value pairs {[1, One], [2, Two]} because we do, but found them anyhow."); + } + + [Fact] + public void When_asserting_dictionary_does_not_contain_key_value_pairs_against_null_dictionary_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + + List> keyValuePairs = new() + { + new KeyValuePair(1, "One"), + new KeyValuePair(1, "Two") + }; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + dictionary.Should().NotContain(keyValuePairs, "because we want to test the behaviour with a null subject"); + }; + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to not contain key/value pairs {[1, One], [1, Two]} because we want to test the behaviour with a null subject, but dictionary is ."); + } + + [Fact] + public void + When_asserting_dictionary_does_not_contain_key_value_pairs_but_expected_key_value_pairs_are_empty_it_should_throw() + { + // Arrange + var dictionary1 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + List> keyValuePair = new(); + + // Act + Action act = () => dictionary1.Should().NotContain(keyValuePair, + "because we want to test the behaviour with an empty set of key/value pairs"); + + // Assert + act.Should().Throw().WithMessage( + "Cannot verify key containment against an empty collection of key/value pairs*"); + } + + [Fact] + public void + When_asserting_dictionary_does_not_contain_key_value_pairs_but_expected_key_value_pairs_are_null_it_should_throw() + { + // Arrange + var dictionary1 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + List> keyValuePairs = null; + + // Act + Action act = () => + dictionary1.Should().NotContain(keyValuePairs, "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw() + .WithMessage("Cannot compare dictionary with .*") + .WithParameterName("items"); + } + + [Fact] + public void When_dictionary_does_not_contain_unexpected_value_or_key_it_should_not_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act / Assert + dictionary.Should().NotContain(3, "Three"); + } + + [Fact] + public void When_dictionary_does_not_contain_unexpected_value_at_existing_key_it_should_not_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act / Assert + dictionary.Should().NotContain(2, "Three"); + } + + [Fact] + public void When_dictionary_does_not_have_the_unexpected_value_but_null_at_existing_key_it_should_succeed() + { + // Arrange + var dictionary = new Dictionary + { + [1] = null + }; + + // Act + Action action = () => dictionary.Should().NotContain(1, "other"); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void When_dictionary_does_not_contain_unexpected_key_value_pairs_it_should_not_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act / Assert + var items = new List> + { + new(3, "Three"), + new(4, "Four") + }; + + dictionary.Should().NotContain(items); + } + + [Fact] + public void When_dictionary_does_not_contain_unexpected_key_value_pair_it_should_not_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act / Assert + var item = new KeyValuePair(3, "Three"); + dictionary.Should().NotContain(item); + } + + [Fact] + public void When_dictionary_contains_the_unexpected_value_at_specific_key_it_should_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + var item = new KeyValuePair(1, "One"); + Action act = () => dictionary.Should().NotContain(item, "we put it {0}", "there"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary not to contain value \"One\" at key 1 because we put it there, but found it anyhow."); + } + + [Fact] + public void When_dictionary_contains_the_key_value_pairs_it_should_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + var items = new List> + { + new(1, "One"), + new(2, "Two") + }; + + Action act = () => dictionary.Should().NotContain(items, "we did not put them {0}", "there"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to not contain key/value pairs {[1, One], [2, Two]} because we did not put them there, but found them anyhow."); + } + + [Fact] + public void When_dictionary_contains_the_key_value_pair_it_should_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().NotContain(1, "One", "we did not put it {0}", "there"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary not to contain value \"One\" at key 1 because we did not put it there, but found it anyhow."); + } + + [Fact] + public void When_asserting_dictionary_does_not_contain_value_at_specific_key_against_null_dictionary_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + dictionary.Should().NotContain(1, "One", "because we want to test the behaviour with a null subject"); + }; + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary not to contain value \"One\" at key 1 because we want to test the behaviour with a null subject, but dictionary is ."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainKey.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainKey.cs new file mode 100644 index 0000000000..7d717b598f --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainKey.cs @@ -0,0 +1,152 @@ +using System; +using System.Collections.Generic; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericDictionaryAssertionSpecs +{ + public class ContainKey + { + [Fact] + public void Should_succeed_when_asserting_dictionary_contains_a_key_from_the_dictionary() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act / Assert + dictionary.Should().ContainKey(1); + } + + [Fact] + public void When_a_dictionary_has_custom_equality_comparer_the_contains_key_assertion_should_work_accordingly() + { + // Arrange + var dictionary = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + ["One"] = "One", + ["Two"] = "Two" + }; + + // Act + + // Assert + dictionary.Should().ContainKey("One"); + dictionary.Should().ContainKey("ONE"); + dictionary.Should().ContainKey("one"); + } + + [Fact] + public void When_a_dictionary_does_not_contain_single_key_it_should_throw_with_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().ContainKey(3, "because {0}", "we do"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to contain key 3 because we do."); + } + + [Fact] + public void When_the_requested_key_exists_it_should_allow_continuation_with_the_value() + { + // Arrange + var dictionary = new Dictionary + { + ["Key"] = new() { SomeProperty = 3 } + }; + + // Act + Action act = () => dictionary.Should().ContainKey("Key").WhoseValue.Should().Be(4); + + // Assert + act.Should().Throw().WithMessage("Expected*4*3*."); + } + + [Fact] + public void When_an_assertion_fails_on_ContainKey_succeeding_message_should_be_included() + { + // Act + Action act = () => + { + using var _ = new AssertionScope(); + var values = new Dictionary(); + values.Should().ContainKey(0); + values.Should().ContainKey(1); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expected*to contain key 0*Expected*to contain key 1*"); + } + } + + public class NotContainKey + { + [Fact] + public void When_dictionary_does_not_contain_a_key_that_is_not_in_the_dictionary_it_should_not_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().NotContainKey(4); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_dictionary_contains_an_unexpected_key_it_should_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().NotContainKey(1, "because we {0} like it", "don't"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary {[1] = \"One\", [2] = \"Two\"} not to contain key 1 because we don't like it, but found it anyhow."); + } + + [Fact] + public void When_asserting_dictionary_does_not_contain_key_against_null_dictionary_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + dictionary.Should().NotContainKey(1, "because we want to test the behaviour with a null subject"); + }; + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary not to contain key 1 because we want to test the behaviour with a null subject, but found ."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainKeys.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainKeys.cs new file mode 100644 index 0000000000..b336e31236 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainKeys.cs @@ -0,0 +1,211 @@ +using System; +using System.Collections.Generic; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericDictionaryAssertionSpecs +{ + public class ContainKeys + { + [Fact] + public void Should_succeed_when_asserting_dictionary_contains_multiple_keys_from_the_dictionary() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act / Assert + dictionary.Should().ContainKeys(2, 1); + } + + [Fact] + public void When_a_dictionary_does_not_contain_a_list_of_keys_it_should_throw_with_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().ContainKeys(new[] { 2, 3 }, "because {0}", "we do"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to contain keys {2, 3} because we do, but could not find {3}."); + } + + [Fact] + public void Null_dictionaries_do_not_contain_any_keys() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + dictionary.Should().ContainKeys(new[] { 2, 3 }, "because {0}", "we do"); + }; + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to contain keys {2, 3} because we do, but found ."); + } + + [Fact] + public void + When_the_contents_of_a_dictionary_are_checked_against_an_empty_list_of_keys_it_should_throw_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().ContainKeys(); + + // Assert + act.Should().Throw().WithMessage( + "Cannot verify key containment against an empty sequence*"); + } + } + + public class NotContainKeys + { + [Fact] + public void When_dictionary_does_not_contain_multiple_keys_from_the_dictionary_it_should_not_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().NotContainKeys(3, 4); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_dictionary_contains_a_list_of_keys_it_should_throw_with_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().NotContainKeys(new[] { 2, 3 }, "because {0}", "we do"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to not contain keys {2, 3} because we do, but found {2}."); + } + + [Fact] + public void When_a_dictionary_contains_exactly_one_of_the_keys_it_should_throw_with_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().NotContainKeys(new[] { 2 }, "because {0}", "we do"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to not contain key 2 because we do."); + } + + [Fact] + public void Null_dictionaries_do_not_contain_any_keys() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + dictionary.Should().NotContainKeys(new[] { 2 }, "because {0}", "we do"); + }; + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to not contain keys {2} because we do, but found ."); + } + + [Fact] + public void + When_the_noncontents_of_a_dictionary_are_checked_against_an_empty_list_of_keys_it_should_throw_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().NotContainKeys(); + + // Assert + act.Should().Throw().WithMessage( + "Cannot verify key containment against an empty sequence*"); + } + + [Fact] + public void + When_a_dictionary_checks_a_list_of_keys_not_to_be_present_it_will_honor_the_case_sensitive_equality_comparer_of_the_dictionary() + { + // Arrange + var dictionary = new Dictionary(StringComparer.Ordinal) + { + ["ONE"] = "One", + ["TWO"] = "Two" + }; + + // Act + Action act = () => dictionary.Should().NotContainKeys("One", "Two"); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void + When_a_dictionary_checks_a_list_of_keys_not_to_be_present_it_will_honor_the_case_insensitive_equality_comparer_of_the_dictionary() + { + // Arrange + var dictionary = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + ["ONE"] = "One", + ["TWO"] = "Two" + }; + + // Act + Action act = () => dictionary.Should().NotContainKeys("One", "Two"); + + // Assert + act.Should().Throw(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValue.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValue.cs new file mode 100644 index 0000000000..639b329436 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValue.cs @@ -0,0 +1,183 @@ +using System; +using System.Collections.Generic; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericDictionaryAssertionSpecs +{ + public class ContainValue + { + [Fact] + public void When_dictionary_contains_expected_value_it_should_succeed() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().ContainValue("One"); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void Null_dictionaries_do_not_contain_any_values() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + dictionary.Should().ContainValue("One", "because {0}", "we do"); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expected dictionary to contain values {\"One\"} because we do, but found ."); + } + + [Fact] + public void When_dictionary_contains_expected_null_value_it_should_succeed() + { + // Arrange + var dictionary = new Dictionary + { + [1] = null + }; + + // Act + Action act = () => dictionary.Should().ContainValue(null); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_the_specified_value_exists_it_should_allow_continuation_using_that_value() + { + // Arrange + var myClass = new MyClass + { + SomeProperty = 0 + }; + + var dictionary = new Dictionary + { + [1] = myClass + }; + + // Act + Action act = () => dictionary.Should().ContainValue(myClass).Which.SomeProperty.Should().BeGreaterThan(0); + + // Assert + act.Should().Throw().WithMessage("Expected*greater*0*0*"); + } + + [Fact] + public void When_multiple_matches_for_the_specified_value_exist_continuation_using_the_matched_value_should_fail() + { + // Arrange + var myClass = new MyClass { SomeProperty = 0 }; + + var dictionary = new Dictionary + { + [1] = myClass, + [2] = new() { SomeProperty = 0 } + }; + + // Act + Action act = + () => + dictionary.Should() + .ContainValue(new MyClass { SomeProperty = 0 }) + .Which.Should() + .BeSameAs(myClass); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_dictionary_does_not_contain_single_value_it_should_throw_with_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().ContainValue("Three", "because {0}", "we do"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to contain value \"Three\" because we do."); + } + } + + public class NotContainValue + { + [Fact] + public void When_dictionary_does_not_contain_a_value_that_is_not_in_the_dictionary_it_should_not_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().NotContainValue("Three"); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_dictionary_contains_an_unexpected_value_it_should_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().NotContainValue("One", "because we {0} like it", "don't"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary {[1] = \"One\", [2] = \"Two\"} not to contain value \"One\" because we don't like it, but found it anyhow."); + } + + [Fact] + public void When_asserting_dictionary_does_not_contain_value_against_null_dictionary_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + dictionary.Should().NotContainValue("One", "because we want to test the behaviour with a null subject"); + }; + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary not to contain value \"One\" because we want to test the behaviour with a null subject, but found ."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValues.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValues.cs new file mode 100644 index 0000000000..f31f4d6f3a --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValues.cs @@ -0,0 +1,160 @@ +using System; +using System.Collections.Generic; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericDictionaryAssertionSpecs +{ + public class ContainValues + { + [Fact] + public void When_dictionary_contains_multiple_values_from_the_dictionary_it_should_not_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().ContainValues("Two", "One"); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_dictionary_does_not_contain_a_number_of_values_it_should_throw_with_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().ContainValues(new[] { "Two", "Three" }, "because {0}", "we do"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to contain value {\"Two\", \"Three\"} because we do, but could not find {\"Three\"}."); + } + + [Fact] + public void + When_the_contents_of_a_dictionary_are_checked_against_an_empty_list_of_values_it_should_throw_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().ContainValues(); + + // Assert + act.Should().Throw().WithMessage( + "Cannot verify value containment against an empty sequence*"); + } + } + + public class NotContainValues + { + [Fact] + public void When_dictionary_does_not_contain_multiple_values_that_is_not_in_the_dictionary_it_should_not_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().NotContainValues("Three", "Four"); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_dictionary_contains_a_exactly_one_of_the_values_it_should_throw_with_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().NotContainValues(new[] { "Two" }, "because {0}", "we do"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to not contain value \"Two\" because we do."); + } + + [Fact] + public void When_a_dictionary_contains_a_number_of_values_it_should_throw_with_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().NotContainValues(new[] { "Two", "Three" }, "because {0}", "we do"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to not contain value {\"Two\", \"Three\"} because we do, but found {\"Two\"}."); + } + + [Fact] + public void + When_the_noncontents_of_a_dictionary_are_checked_against_an_empty_list_of_values_it_should_throw_clear_explanation() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().NotContainValues(); + + // Assert + act.Should().Throw().WithMessage( + "Cannot verify value containment with an empty sequence*"); + } + + [Fact] + public void Null_dictionaries_do_not_contain_any_values() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + dictionary.Should().NotContainValues(new[] { "Two", "Three" }, "because {0}", "we do"); + }; + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to not contain values {\"Two\", \"Three\"} because we do, but found ."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.Equal.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.Equal.cs new file mode 100644 index 0000000000..773e3a4576 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.Equal.cs @@ -0,0 +1,351 @@ +using System; +using System.Collections.Generic; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericDictionaryAssertionSpecs +{ + public class Equal + { + [Fact] + public void Should_succeed_when_asserting_dictionary_is_equal_to_the_same_dictionary() + { + // Arrange + var dictionary1 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var dictionary2 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act / Assert + dictionary1.Should().Equal(dictionary2); + } + + [Fact] + public void Should_succeed_when_asserting_dictionary_with_null_value_is_equal_to_the_same_dictionary() + { + // Arrange + var dictionary1 = new Dictionary + { + [1] = "One", + [2] = null + }; + + var dictionary2 = new Dictionary + { + [1] = "One", + [2] = null + }; + + // Act / Assert + dictionary1.Should().Equal(dictionary2); + } + + [Fact] + public void When_asserting_dictionaries_to_be_equal_but_subject_dictionary_misses_a_value_it_should_throw() + { + // Arrange + var dictionary1 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var dictionary2 = new Dictionary + { + [1] = "One", + [22] = "Two" + }; + + // Act + Action act = () => dictionary1.Should().Equal(dictionary2, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary1 to be equal to {[1] = \"One\", [22] = \"Two\"} because we want to test the failure message, but could not find keys {22}."); + } + + [Fact] + public void When_asserting_dictionaries_to_be_equal_but_subject_dictionary_has_extra_key_it_should_throw() + { + // Arrange + var dictionary1 = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + var dictionary2 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary1.Should().Equal(dictionary2, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary1 to be equal to {[1] = \"One\", [2] = \"Two\"} because we want to test the failure message, but found additional keys {3}."); + } + + [Fact] + public void When_two_dictionaries_are_not_equal_by_values_it_should_throw_using_the_reason() + { + // Arrange + var dictionary1 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var dictionary2 = new Dictionary + { + [1] = "One", + [2] = "Three" + }; + + // Act + Action act = () => dictionary1.Should().Equal(dictionary2, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary1 to be equal to {[1] = \"One\", [2] = \"Three\"} because we want to test the failure message, but {[1] = \"One\", [2] = \"Two\"} differs at key 2."); + } + + [Fact] + public void When_asserting_dictionaries_to_be_equal_but_subject_dictionary_is_null_it_should_throw() + { + // Arrange + Dictionary dictionary1 = null; + + var dictionary2 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + dictionary1.Should().Equal(dictionary2, "because we want to test the behaviour with a null subject"); + }; + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary1 to be equal to {[1] = \"One\", [2] = \"Two\"} because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void When_asserting_dictionaries_to_be_equal_but_expected_dictionary_is_null_it_should_throw() + { + // Arrange + var dictionary1 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + Dictionary dictionary2 = null; + + // Act + Action act = () => + dictionary1.Should().Equal(dictionary2, "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw() + .WithMessage("Cannot compare dictionary with .*") + .WithParameterName("expected"); + } + + [Fact] + public void When_an_empty_dictionary_is_compared_for_equality_to_a_non_empty_dictionary_it_should_throw() + { + // Arrange + var dictionary1 = new Dictionary(); + + var dictionary2 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary1.Should().Equal(dictionary2); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary1 to be equal to {[1] = \"One\", [2] = \"Two\"}, but could not find keys {1, 2}."); + } + } + + public class NotEqual + { + [Fact] + public void Should_succeed_when_asserting_dictionary_is_not_equal_to_a_dictionary_with_different_key() + { + // Arrange + var dictionary1 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var dictionary2 = new Dictionary + { + [1] = "One", + [22] = "Two" + }; + + // Act / Assert + dictionary1.Should().NotEqual(dictionary2); + } + + [Fact] + public void Should_succeed_when_asserting_dictionary_is_not_equal_to_a_dictionary_with_different_value() + { + // Arrange + var dictionary1 = new Dictionary + { + [1] = "One", + [2] = null + }; + + var dictionary2 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act / Assert + dictionary1.Should().NotEqual(dictionary2); + } + + [Fact] + public void When_two_equal_dictionaries_are_not_expected_to_be_equal_it_should_throw() + { + // Arrange + var dictionary1 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var dictionary2 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary1.Should().NotEqual(dictionary2); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect dictionaries {[1] = \"One\", [2] = \"Two\"} and {[1] = \"One\", [2] = \"Two\"} to be equal."); + } + + [Fact] + public void When_two_equal_dictionaries_are_not_expected_to_be_equal_it_should_report_a_clear_explanation() + { + // Arrange + var dictionary1 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var dictionary2 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary1.Should().NotEqual(dictionary2, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect dictionaries {[1] = \"One\", [2] = \"Two\"} and {[1] = \"One\", [2] = \"Two\"} to be equal because we want to test the failure message."); + } + + [Fact] + public void When_asserting_dictionaries_not_to_be_equal_subject_but_dictionary_is_null_it_should_throw() + { + // Arrange + Dictionary dictionary1 = null; + + var dictionary2 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + dictionary1.Should().NotEqual(dictionary2, "because we want to test the behaviour with a null subject"); + }; + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionaries not to be equal because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void When_asserting_dictionaries_not_to_be_equal_but_expected_dictionary_is_null_it_should_throw() + { + // Arrange + var dictionary1 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + Dictionary dictionary2 = null; + + // Act + Action act = + () => dictionary1.Should().NotEqual(dictionary2, "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw() + .WithMessage("Cannot compare dictionary with .*") + .WithParameterName("unexpected"); + } + + [Fact] + public void + When_asserting_dictionaries_not_to_be_equal_subject_but_both_dictionaries_reference_the_same_object_it_should_throw() + { + // Arrange + var dictionary1 = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + var dictionary2 = dictionary1; + + // Act + Action act = + () => dictionary1.Should().NotEqual(dictionary2, "because we want to test the behaviour with same objects"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionaries not to be equal because we want to test the behaviour with same objects, but they both reference the same object."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCount.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCount.cs new file mode 100644 index 0000000000..7033636199 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCount.cs @@ -0,0 +1,216 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericDictionaryAssertionSpecs +{ + public class HaveCount + { + [Fact] + public void Should_succeed_when_asserting_dictionary_has_a_count_that_equals_the_number_of_items() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act / Assert + dictionary.Should().HaveCount(3); + } + + [Fact] + public void Should_fail_when_asserting_dictionary_has_a_count_that_is_different_from_the_number_of_items() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act + Action act = () => dictionary.Should().HaveCount(4); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void + When_dictionary_has_a_count_that_is_different_from_the_number_of_items_it_should_fail_with_descriptive_message_() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act + Action action = () => dictionary.Should().HaveCount(4, "because we want to test the failure {0}", "message"); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected dictionary to contain 4 item(s) because we want to test the failure message, but found 3: {[1] = \"One\", [2] = \"Two\", [3] = \"Three\"}."); + } + + [Fact] + public void When_dictionary_has_a_count_larger_than_the_minimum_it_should_not_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act / Assert + dictionary.Should().HaveCount(c => c >= 3); + } + + [Fact] + public void When_dictionary_has_a_count_that_not_matches_the_predicate_it_should_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act + Action act = () => dictionary.Should().HaveCount(c => c >= 4, "a minimum of 4 is required"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to have a count (c >= 4) because a minimum of 4 is required, but count is 3: {[1] = \"One\", [2] = \"Two\", [3] = \"Three\"}."); + } + + [Fact] + public void When_dictionary_count_is_matched_against_a_null_predicate_it_should_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act + Action act = () => dictionary.Should().HaveCount(null); + + // Assert + act.Should().Throw().WithMessage( + "Cannot compare collection count against a predicate.*"); + } + + [Fact] + public void When_dictionary_count_is_matched_and_dictionary_is_null_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => dictionary.Should().HaveCount(1, "we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to contain 1 item(s) because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void When_dictionary_count_is_matched_against_a_predicate_and_dictionary_is_null_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => dictionary.Should().HaveCount(c => c < 3, "we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to contain (c < 3) items because we want to test the behaviour with a null subject, but found ."); + } + } + + public class NotHaveCount + { + [Fact] + public void Should_succeed_when_asserting_dictionary_has_a_count_different_from_the_number_of_items() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act / Assert + dictionary.Should().NotHaveCount(2); + } + + [Fact] + public void Should_fail_when_asserting_dictionary_has_a_count_that_equals_the_number_of_items() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act + Action act = () => dictionary.Should().NotHaveCount(3); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_dictionary_has_a_count_that_equals_than_the_number_of_items_it_should_fail_with_descriptive_message_() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act + Action action = () => dictionary.Should().NotHaveCount(3, "because we want to test the failure {0}", "message"); + + // Assert + action.Should().Throw() + .WithMessage("*not contain*3*because we want to test the failure message*3*"); + } + + [Fact] + public void When_dictionary_count_is_same_than_and_dictionary_is_null_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => dictionary.Should().NotHaveCount(1, "we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw() + .WithMessage("*not contain*1*we want to test the behaviour with a null subject*found *"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountGreaterThan.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountGreaterThan.cs new file mode 100644 index 0000000000..2045bf26cc --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountGreaterThan.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericDictionaryAssertionSpecs +{ + public class HaveCountGreaterThan + { + [Fact] + public void Should_succeed_when_asserting_dictionary_has_a_count_greater_than_less_the_number_of_items() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act / Assert + dictionary.Should().HaveCountGreaterThan(2); + } + + [Fact] + public void Should_fail_when_asserting_dictionary_has_a_count_greater_than_the_number_of_items() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act + Action act = () => dictionary.Should().HaveCountGreaterThan(3); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_dictionary_has_a_count_greater_than_the_number_of_items_it_should_fail_with_descriptive_message_() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act + Action action = () => + dictionary.Should().HaveCountGreaterThan(3, "because we want to test the failure {0}", "message"); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected dictionary to contain more than 3 item(s) because we want to test the failure message, but found 3: {[1] = \"One\", [2] = \"Two\", [3] = \"Three\"}."); + } + + [Fact] + public void When_dictionary_count_is_greater_than_and_dictionary_is_null_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => dictionary.Should().HaveCountGreaterThan(1, "we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw() + .WithMessage("*more than*1*we want to test the behaviour with a null subject*found *"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs new file mode 100644 index 0000000000..83b1d7d156 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericDictionaryAssertionSpecs +{ + public class HaveCountGreaterThanOrEqualTo + { + [Fact] + public void Should_succeed_when_asserting_dictionary_has_a_count_greater_than_or_equal_to_less_the_number_of_items() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act / Assert + dictionary.Should().HaveCountGreaterThanOrEqualTo(3); + } + + [Fact] + public void Should_fail_when_asserting_dictionary_has_a_count_greater_than_or_equal_to_the_number_of_items() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act + Action act = () => dictionary.Should().HaveCountGreaterThanOrEqualTo(4); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void + When_dictionary_has_a_count_greater_than_or_equal_to_the_number_of_items_it_should_fail_with_descriptive_message_() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act + Action action = () => + dictionary.Should().HaveCountGreaterThanOrEqualTo(4, "because we want to test the failure {0}", "message"); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected dictionary to contain at least 4 item(s) because we want to test the failure message, but found 3: {[1] = \"One\", [2] = \"Two\", [3] = \"Three\"}."); + } + + [Fact] + public void When_dictionary_count_is_greater_than_or_equal_to_and_dictionary_is_null_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => + dictionary.Should().HaveCountGreaterThanOrEqualTo(1, "we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw() + .WithMessage("*at least*1*we want to test the behaviour with a null subject*found *"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountLessThan.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountLessThan.cs new file mode 100644 index 0000000000..ea783d883f --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountLessThan.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericDictionaryAssertionSpecs +{ + public class HaveCountLessThan + { + [Fact] + public void Should_succeed_when_asserting_dictionary_has_a_count_less_than_less_the_number_of_items() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act / Assert + dictionary.Should().HaveCountLessThan(4); + } + + [Fact] + public void Should_fail_when_asserting_dictionary_has_a_count_less_than_the_number_of_items() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act + Action act = () => dictionary.Should().HaveCountLessThan(3); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_dictionary_has_a_count_less_than_the_number_of_items_it_should_fail_with_descriptive_message_() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act + Action action = () => dictionary.Should().HaveCountLessThan(3, "because we want to test the failure {0}", "message"); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected dictionary to contain fewer than 3 item(s) because we want to test the failure message, but found 3: {[1] = \"One\", [2] = \"Two\", [3] = \"Three\"}."); + } + + [Fact] + public void When_dictionary_count_is_less_than_and_dictionary_is_null_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => dictionary.Should().HaveCountLessThan(1, "we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw() + .WithMessage("*fewer than*1*we want to test the behaviour with a null subject*found *"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountLessThanOrEqualTo.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountLessThanOrEqualTo.cs new file mode 100644 index 0000000000..3c553d8170 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountLessThanOrEqualTo.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericDictionaryAssertionSpecs +{ + public class HaveCountLessThanOrEqualTo + { + [Fact] + public void Should_succeed_when_asserting_dictionary_has_a_count_less_than_or_equal_to_less_the_number_of_items() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act / Assert + dictionary.Should().HaveCountLessThanOrEqualTo(3); + } + + [Fact] + public void Should_fail_when_asserting_dictionary_has_a_count_less_than_or_equal_to_the_number_of_items() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act + Action act = () => dictionary.Should().HaveCountLessThanOrEqualTo(2); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void + When_dictionary_has_a_count_less_than_or_equal_to_the_number_of_items_it_should_fail_with_descriptive_message_() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + // Act + Action action = () => + dictionary.Should().HaveCountLessThanOrEqualTo(2, "because we want to test the failure {0}", "message"); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected dictionary to contain at most 2 item(s) because we want to test the failure message, but found 3: {[1] = \"One\", [2] = \"Two\", [3] = \"Three\"}."); + } + + [Fact] + public void When_dictionary_count_is_less_than_or_equal_to_and_dictionary_is_null_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + + // Act + Action act = () => + dictionary.Should().HaveCountLessThanOrEqualTo(1, "we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw() + .WithMessage("*at most*1*we want to test the behaviour with a null subject*found *"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveSameCount.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveSameCount.cs new file mode 100644 index 0000000000..a931cc04d4 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveSameCount.cs @@ -0,0 +1,230 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericDictionaryAssertionSpecs +{ + public class HaveSameCount + { + [Fact] + public void When_dictionary_and_collection_have_the_same_number_elements_it_should_succeed() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + var collection = new[] { 4, 5, 6 }; + + // Act / Assert + dictionary.Should().HaveSameCount(collection); + } + + [Fact] + public void When_dictionary_and_collection_do_not_have_the_same_number_of_elements_it_should_fail() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + var collection = new[] { 4, 6 }; + + // Act + Action act = () => dictionary.Should().HaveSameCount(collection); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to have 2 item(s), but found 3."); + } + + [Fact] + public void When_comparing_item_counts_and_a_reason_is_specified_it_should_it_in_the_exception() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + var collection = new[] { 4, 6 }; + + // Act + Action act = () => dictionary.Should().HaveSameCount(collection, "we want to test the {0}", "reason"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to have 2 item(s) because we want to test the reason, but found 3."); + } + + [Fact] + public void When_asserting_dictionary_and_collection_have_same_count_against_null_dictionary_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + var collection = new[] { 1, 2, 3 }; + + // Act + Action act = () => dictionary.Should().HaveSameCount(collection, + "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to have the same count as {1, 2, 3} because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void When_asserting_dictionary_and_collection_have_same_count_against_a_null_collection_it_should_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + int[] collection = null; + + // Act + Action act = () => dictionary.Should().HaveSameCount(collection); + + // Assert + act.Should().Throw().WithMessage( + "Cannot verify count against a collection.*"); + } + } + + public class NotHaveSameCount + { + [Fact] + public void When_asserting_not_same_count_and_collections_have_different_number_elements_it_should_succeed() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + var collection = new[] { 4, 6 }; + + // Act / Assert + dictionary.Should().NotHaveSameCount(collection); + } + + [Fact] + public void When_asserting_not_same_count_and_both_collections_have_the_same_number_elements_it_should_fail() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + var collection = new[] { 4, 5, 6 }; + + // Act + Action act = () => dictionary.Should().NotHaveSameCount(collection); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to not have 3 item(s), but found 3."); + } + + [Fact] + public void When_comparing_not_same_item_counts_and_a_reason_is_specified_it_should_it_in_the_exception() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + var collection = new[] { 4, 5, 6 }; + + // Act + Action act = () => dictionary.Should().NotHaveSameCount(collection, "we want to test the {0}", "reason"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to not have 3 item(s) because we want to test the reason, but found 3."); + } + + [Fact] + public void When_asserting_dictionary_and_collection_to_not_have_same_count_against_null_dictionary_it_should_throw() + { + // Arrange + Dictionary dictionary = null; + var collection = new[] { 1, 2, 3 }; + + // Act + Action act = () => dictionary.Should().NotHaveSameCount(collection, + "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dictionary to not have the same count as {1, 2, 3} because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void When_asserting_dictionary_and_collection_to_not_have_same_count_against_a_null_collection_it_should_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + int[] collection = null; + + // Act + Action act = () => dictionary.Should().NotHaveSameCount(collection); + + // Assert + act.Should().Throw().WithMessage( + "Cannot verify count against a collection.*"); + } + + [Fact] + public void + When_asserting_dictionary_and_collection_to_not_have_same_count_but_both_reference_the_same_object_it_should_throw() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two", + [3] = "Three" + }; + + var collection = dictionary; + + // Act + Action act = () => dictionary.Should().NotHaveSameCount(collection, + "because we want to test the behaviour with same objects"); + + // Assert + act.Should().Throw().WithMessage( + "*not have the same count*because we want to test the behaviour with same objects*but they both reference the same object."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.cs index 536d660726..54b69a1a10 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.cs @@ -3,13 +3,12 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using FluentAssertions.Execution; using Xunit; using Xunit.Sdk; namespace FluentAssertions.Specs.Collections; -public class GenericDictionaryAssertionSpecs +public partial class GenericDictionaryAssertionSpecs { // If you try to implement support for IReadOnlyDictionary, these tests should still succeed. public class SanityChecks @@ -58,2715 +57,6 @@ public void When_a_dictionary_does_not_implement_the_read_only_interface_it_shou } } - public class BeNull - { - [Fact] - public void When_dictionary_is_expected_to_be_null_and_it_is_it_should_not_throw() - { - // Arrange - IDictionary someDictionary = null; - - // Act / Assert - someDictionary.Should().BeNull(); - } - - [Fact] - public void When_a_custom_dictionary_implementation_is_expected_not_to_be_null_and_it_is_it_should_not_throw() - { - // Arrange - var dictionary = new TrackingTestDictionary(); - - // Act / Assert - dictionary.Should().NotBeNull(); - } - - [Fact] - public void When_dictionary_is_expected_to_be_null_and_it_isnt_it_should_throw() - { - // Arrange - var someDictionary = new Dictionary(); - - // Act - Action act = () => someDictionary.Should().BeNull("because {0} is valid", "null"); - - // Assert - act.Should().Throw().WithMessage( - "Expected someDictionary to be because null is valid, but found {empty}."); - } - - [Fact] - public void When_dictionary_is_not_expected_to_be_null_and_it_isnt_it_should_not_throw() - { - // Arrange - IDictionary someDictionary = new Dictionary(); - - // Act / Assert - someDictionary.Should().NotBeNull(); - } - - [Fact] - public void When_dictionary_is_not_expected_to_be_null_and_it_is_it_should_throw() - { - // Arrange - IDictionary someDictionary = null; - - // Act - Action act = () => someDictionary.Should().NotBeNull("because {0} should not", "someDictionary"); - - // Assert - act.Should().Throw().WithMessage( - "Expected someDictionary not to be because someDictionary should not."); - } - } - - public class HaveCount - { - [Fact] - public void Should_succeed_when_asserting_dictionary_has_a_count_that_equals_the_number_of_items() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act / Assert - dictionary.Should().HaveCount(3); - } - - [Fact] - public void Should_fail_when_asserting_dictionary_has_a_count_that_is_different_from_the_number_of_items() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act - Action act = () => dictionary.Should().HaveCount(4); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void - When_dictionary_has_a_count_that_is_different_from_the_number_of_items_it_should_fail_with_descriptive_message_() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act - Action action = () => dictionary.Should().HaveCount(4, "because we want to test the failure {0}", "message"); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected dictionary to contain 4 item(s) because we want to test the failure message, but found 3: {[1] = \"One\", [2] = \"Two\", [3] = \"Three\"}."); - } - - [Fact] - public void When_dictionary_has_a_count_larger_than_the_minimum_it_should_not_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act / Assert - dictionary.Should().HaveCount(c => c >= 3); - } - - [Fact] - public void When_dictionary_has_a_count_that_not_matches_the_predicate_it_should_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act - Action act = () => dictionary.Should().HaveCount(c => c >= 4, "a minimum of 4 is required"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to have a count (c >= 4) because a minimum of 4 is required, but count is 3: {[1] = \"One\", [2] = \"Two\", [3] = \"Three\"}."); - } - - [Fact] - public void When_dictionary_count_is_matched_against_a_null_predicate_it_should_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act - Action act = () => dictionary.Should().HaveCount(null); - - // Assert - act.Should().Throw().WithMessage( - "Cannot compare collection count against a predicate.*"); - } - - [Fact] - public void When_dictionary_count_is_matched_and_dictionary_is_null_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => dictionary.Should().HaveCount(1, "we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to contain 1 item(s) because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_dictionary_count_is_matched_against_a_predicate_and_dictionary_is_null_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => dictionary.Should().HaveCount(c => c < 3, "we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to contain (c < 3) items because we want to test the behaviour with a null subject, but found ."); - } - } - - public class NotHaveCount - { - [Fact] - public void Should_succeed_when_asserting_dictionary_has_a_count_different_from_the_number_of_items() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act / Assert - dictionary.Should().NotHaveCount(2); - } - - [Fact] - public void Should_fail_when_asserting_dictionary_has_a_count_that_equals_the_number_of_items() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act - Action act = () => dictionary.Should().NotHaveCount(3); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_dictionary_has_a_count_that_equals_than_the_number_of_items_it_should_fail_with_descriptive_message_() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act - Action action = () => dictionary.Should().NotHaveCount(3, "because we want to test the failure {0}", "message"); - - // Assert - action.Should().Throw() - .WithMessage("*not contain*3*because we want to test the failure message*3*"); - } - - [Fact] - public void When_dictionary_count_is_same_than_and_dictionary_is_null_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => dictionary.Should().NotHaveCount(1, "we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw() - .WithMessage("*not contain*1*we want to test the behaviour with a null subject*found *"); - } - } - - public class HaveCountGreaterThan - { - [Fact] - public void Should_succeed_when_asserting_dictionary_has_a_count_greater_than_less_the_number_of_items() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act / Assert - dictionary.Should().HaveCountGreaterThan(2); - } - - [Fact] - public void Should_fail_when_asserting_dictionary_has_a_count_greater_than_the_number_of_items() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act - Action act = () => dictionary.Should().HaveCountGreaterThan(3); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_dictionary_has_a_count_greater_than_the_number_of_items_it_should_fail_with_descriptive_message_() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act - Action action = () => - dictionary.Should().HaveCountGreaterThan(3, "because we want to test the failure {0}", "message"); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected dictionary to contain more than 3 item(s) because we want to test the failure message, but found 3: {[1] = \"One\", [2] = \"Two\", [3] = \"Three\"}."); - } - - [Fact] - public void When_dictionary_count_is_greater_than_and_dictionary_is_null_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => dictionary.Should().HaveCountGreaterThan(1, "we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw() - .WithMessage("*more than*1*we want to test the behaviour with a null subject*found *"); - } - } - - public class HaveCountGreaterThanOrEqualTo - { - [Fact] - public void Should_succeed_when_asserting_dictionary_has_a_count_greater_than_or_equal_to_less_the_number_of_items() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act / Assert - dictionary.Should().HaveCountGreaterThanOrEqualTo(3); - } - - [Fact] - public void Should_fail_when_asserting_dictionary_has_a_count_greater_than_or_equal_to_the_number_of_items() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act - Action act = () => dictionary.Should().HaveCountGreaterThanOrEqualTo(4); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void - When_dictionary_has_a_count_greater_than_or_equal_to_the_number_of_items_it_should_fail_with_descriptive_message_() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act - Action action = () => - dictionary.Should().HaveCountGreaterThanOrEqualTo(4, "because we want to test the failure {0}", "message"); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected dictionary to contain at least 4 item(s) because we want to test the failure message, but found 3: {[1] = \"One\", [2] = \"Two\", [3] = \"Three\"}."); - } - - [Fact] - public void When_dictionary_count_is_greater_than_or_equal_to_and_dictionary_is_null_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => - dictionary.Should().HaveCountGreaterThanOrEqualTo(1, "we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw() - .WithMessage("*at least*1*we want to test the behaviour with a null subject*found *"); - } - } - - public class HaveCountLessThan - { - [Fact] - public void Should_succeed_when_asserting_dictionary_has_a_count_less_than_less_the_number_of_items() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act / Assert - dictionary.Should().HaveCountLessThan(4); - } - - [Fact] - public void Should_fail_when_asserting_dictionary_has_a_count_less_than_the_number_of_items() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act - Action act = () => dictionary.Should().HaveCountLessThan(3); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_dictionary_has_a_count_less_than_the_number_of_items_it_should_fail_with_descriptive_message_() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act - Action action = () => dictionary.Should().HaveCountLessThan(3, "because we want to test the failure {0}", "message"); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected dictionary to contain fewer than 3 item(s) because we want to test the failure message, but found 3: {[1] = \"One\", [2] = \"Two\", [3] = \"Three\"}."); - } - - [Fact] - public void When_dictionary_count_is_less_than_and_dictionary_is_null_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => dictionary.Should().HaveCountLessThan(1, "we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw() - .WithMessage("*fewer than*1*we want to test the behaviour with a null subject*found *"); - } - } - - public class HaveCountLessThanOrEqualTo - { - [Fact] - public void Should_succeed_when_asserting_dictionary_has_a_count_less_than_or_equal_to_less_the_number_of_items() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act / Assert - dictionary.Should().HaveCountLessThanOrEqualTo(3); - } - - [Fact] - public void Should_fail_when_asserting_dictionary_has_a_count_less_than_or_equal_to_the_number_of_items() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act - Action act = () => dictionary.Should().HaveCountLessThanOrEqualTo(2); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void - When_dictionary_has_a_count_less_than_or_equal_to_the_number_of_items_it_should_fail_with_descriptive_message_() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - // Act - Action action = () => - dictionary.Should().HaveCountLessThanOrEqualTo(2, "because we want to test the failure {0}", "message"); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected dictionary to contain at most 2 item(s) because we want to test the failure message, but found 3: {[1] = \"One\", [2] = \"Two\", [3] = \"Three\"}."); - } - - [Fact] - public void When_dictionary_count_is_less_than_or_equal_to_and_dictionary_is_null_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => - dictionary.Should().HaveCountLessThanOrEqualTo(1, "we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw() - .WithMessage("*at most*1*we want to test the behaviour with a null subject*found *"); - } - } - - public class HaveSameCount - { - [Fact] - public void When_dictionary_and_collection_have_the_same_number_elements_it_should_succeed() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - var collection = new[] { 4, 5, 6 }; - - // Act / Assert - dictionary.Should().HaveSameCount(collection); - } - - [Fact] - public void When_dictionary_and_collection_do_not_have_the_same_number_of_elements_it_should_fail() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - var collection = new[] { 4, 6 }; - - // Act - Action act = () => dictionary.Should().HaveSameCount(collection); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to have 2 item(s), but found 3."); - } - - [Fact] - public void When_comparing_item_counts_and_a_reason_is_specified_it_should_it_in_the_exception() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - var collection = new[] { 4, 6 }; - - // Act - Action act = () => dictionary.Should().HaveSameCount(collection, "we want to test the {0}", "reason"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to have 2 item(s) because we want to test the reason, but found 3."); - } - - [Fact] - public void When_asserting_dictionary_and_collection_have_same_count_against_null_dictionary_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - var collection = new[] { 1, 2, 3 }; - - // Act - Action act = () => dictionary.Should().HaveSameCount(collection, - "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to have the same count as {1, 2, 3} because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_asserting_dictionary_and_collection_have_same_count_against_a_null_collection_it_should_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - int[] collection = null; - - // Act - Action act = () => dictionary.Should().HaveSameCount(collection); - - // Assert - act.Should().Throw().WithMessage( - "Cannot verify count against a collection.*"); - } - } - - public class NotHaveSameCount - { - [Fact] - public void When_asserting_not_same_count_and_collections_have_different_number_elements_it_should_succeed() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - var collection = new[] { 4, 6 }; - - // Act / Assert - dictionary.Should().NotHaveSameCount(collection); - } - - [Fact] - public void When_asserting_not_same_count_and_both_collections_have_the_same_number_elements_it_should_fail() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - var collection = new[] { 4, 5, 6 }; - - // Act - Action act = () => dictionary.Should().NotHaveSameCount(collection); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to not have 3 item(s), but found 3."); - } - - [Fact] - public void When_comparing_not_same_item_counts_and_a_reason_is_specified_it_should_it_in_the_exception() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - var collection = new[] { 4, 5, 6 }; - - // Act - Action act = () => dictionary.Should().NotHaveSameCount(collection, "we want to test the {0}", "reason"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to not have 3 item(s) because we want to test the reason, but found 3."); - } - - [Fact] - public void When_asserting_dictionary_and_collection_to_not_have_same_count_against_null_dictionary_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - var collection = new[] { 1, 2, 3 }; - - // Act - Action act = () => dictionary.Should().NotHaveSameCount(collection, - "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to not have the same count as {1, 2, 3} because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_asserting_dictionary_and_collection_to_not_have_same_count_against_a_null_collection_it_should_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - int[] collection = null; - - // Act - Action act = () => dictionary.Should().NotHaveSameCount(collection); - - // Assert - act.Should().Throw().WithMessage( - "Cannot verify count against a collection.*"); - } - - [Fact] - public void - When_asserting_dictionary_and_collection_to_not_have_same_count_but_both_reference_the_same_object_it_should_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - var collection = dictionary; - - // Act - Action act = () => dictionary.Should().NotHaveSameCount(collection, - "because we want to test the behaviour with same objects"); - - // Assert - act.Should().Throw().WithMessage( - "*not have the same count*because we want to test the behaviour with same objects*but they both reference the same object."); - } - } - - public class BeEmpty - { - [Fact] - public void Should_succeed_when_asserting_dictionary_without_items_is_empty() - { - // Arrange - var dictionary = new Dictionary(); - - // Act / Assert - dictionary.Should().BeEmpty(); - } - - [Fact] - public void Should_fail_when_asserting_dictionary_with_items_is_empty() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One" - }; - - // Act - Action act = () => dictionary.Should().BeEmpty(); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_dictionary_with_items_is_empty() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One" - }; - - // Act - Action act = () => dictionary.Should().BeEmpty("because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected dictionary to be empty because we want to test the failure message, but found {[1] = \"One\"}."); - } - - [Fact] - public void When_asserting_dictionary_with_items_is_not_empty_it_should_succeed() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One" - }; - - // Act / Assert - dictionary.Should().NotBeEmpty(); - } - -#if !NET5_0_OR_GREATER - [Fact] - public void When_asserting_dictionary_with_items_is_not_empty_it_should_enumerate_the_dictionary_only_once() - { - // Arrange - var trackingDictionary = new TrackingTestDictionary(new KeyValuePair(1, "One")); - - // Act - trackingDictionary.Should().NotBeEmpty(); - - // Assert - trackingDictionary.Enumerator.LoopCount.Should().Be(1); - } - -#endif - - [Fact] - public void When_asserting_dictionary_without_items_is_not_empty_it_should_fail() - { - // Arrange - var dictionary = new Dictionary(); - - // Act - Action act = () => dictionary.Should().NotBeEmpty(); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_asserting_dictionary_without_items_is_not_empty_it_should_fail_with_descriptive_message_() - { - // Arrange - var dictionary = new Dictionary(); - - // Act - Action act = () => dictionary.Should().NotBeEmpty("because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage("Expected dictionary not to be empty because we want to test the failure message."); - } - - [Fact] - public void When_asserting_dictionary_to_be_empty_but_dictionary_is_null_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => dictionary.Should().BeEmpty("because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to be empty because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_asserting_dictionary_to_be_not_empty_but_dictionary_is_null_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => dictionary.Should().NotBeEmpty("because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary not to be empty because we want to test the behaviour with a null subject, but found ."); - } - } - - public class Equal - { - [Fact] - public void Should_succeed_when_asserting_dictionary_is_equal_to_the_same_dictionary() - { - // Arrange - var dictionary1 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var dictionary2 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act / Assert - dictionary1.Should().Equal(dictionary2); - } - - [Fact] - public void Should_succeed_when_asserting_dictionary_with_null_value_is_equal_to_the_same_dictionary() - { - // Arrange - var dictionary1 = new Dictionary - { - [1] = "One", - [2] = null - }; - - var dictionary2 = new Dictionary - { - [1] = "One", - [2] = null - }; - - // Act / Assert - dictionary1.Should().Equal(dictionary2); - } - - [Fact] - public void When_asserting_dictionaries_to_be_equal_but_subject_dictionary_misses_a_value_it_should_throw() - { - // Arrange - var dictionary1 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var dictionary2 = new Dictionary - { - [1] = "One", - [22] = "Two" - }; - - // Act - Action act = () => dictionary1.Should().Equal(dictionary2, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary1 to be equal to {[1] = \"One\", [22] = \"Two\"} because we want to test the failure message, but could not find keys {22}."); - } - - [Fact] - public void When_asserting_dictionaries_to_be_equal_but_subject_dictionary_has_extra_key_it_should_throw() - { - // Arrange - var dictionary1 = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three" - }; - - var dictionary2 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary1.Should().Equal(dictionary2, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary1 to be equal to {[1] = \"One\", [2] = \"Two\"} because we want to test the failure message, but found additional keys {3}."); - } - - [Fact] - public void When_two_dictionaries_are_not_equal_by_values_it_should_throw_using_the_reason() - { - // Arrange - var dictionary1 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var dictionary2 = new Dictionary - { - [1] = "One", - [2] = "Three" - }; - - // Act - Action act = () => dictionary1.Should().Equal(dictionary2, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary1 to be equal to {[1] = \"One\", [2] = \"Three\"} because we want to test the failure message, but {[1] = \"One\", [2] = \"Two\"} differs at key 2."); - } - - [Fact] - public void When_asserting_dictionaries_to_be_equal_but_subject_dictionary_is_null_it_should_throw() - { - // Arrange - Dictionary dictionary1 = null; - - var dictionary2 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - dictionary1.Should().Equal(dictionary2, "because we want to test the behaviour with a null subject"); - }; - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary1 to be equal to {[1] = \"One\", [2] = \"Two\"} because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_asserting_dictionaries_to_be_equal_but_expected_dictionary_is_null_it_should_throw() - { - // Arrange - var dictionary1 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - Dictionary dictionary2 = null; - - // Act - Action act = () => - dictionary1.Should().Equal(dictionary2, "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw() - .WithMessage("Cannot compare dictionary with .*") - .WithParameterName("expected"); - } - - [Fact] - public void When_an_empty_dictionary_is_compared_for_equality_to_a_non_empty_dictionary_it_should_throw() - { - // Arrange - var dictionary1 = new Dictionary(); - - var dictionary2 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary1.Should().Equal(dictionary2); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary1 to be equal to {[1] = \"One\", [2] = \"Two\"}, but could not find keys {1, 2}."); - } - } - - public class NotEqual - { - [Fact] - public void Should_succeed_when_asserting_dictionary_is_not_equal_to_a_dictionary_with_different_key() - { - // Arrange - var dictionary1 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var dictionary2 = new Dictionary - { - [1] = "One", - [22] = "Two" - }; - - // Act / Assert - dictionary1.Should().NotEqual(dictionary2); - } - - [Fact] - public void Should_succeed_when_asserting_dictionary_is_not_equal_to_a_dictionary_with_different_value() - { - // Arrange - var dictionary1 = new Dictionary - { - [1] = "One", - [2] = null - }; - - var dictionary2 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act / Assert - dictionary1.Should().NotEqual(dictionary2); - } - - [Fact] - public void When_two_equal_dictionaries_are_not_expected_to_be_equal_it_should_throw() - { - // Arrange - var dictionary1 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var dictionary2 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary1.Should().NotEqual(dictionary2); - - // Assert - act.Should().Throw().WithMessage( - "Did not expect dictionaries {[1] = \"One\", [2] = \"Two\"} and {[1] = \"One\", [2] = \"Two\"} to be equal."); - } - - [Fact] - public void When_two_equal_dictionaries_are_not_expected_to_be_equal_it_should_report_a_clear_explanation() - { - // Arrange - var dictionary1 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var dictionary2 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary1.Should().NotEqual(dictionary2, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Did not expect dictionaries {[1] = \"One\", [2] = \"Two\"} and {[1] = \"One\", [2] = \"Two\"} to be equal because we want to test the failure message."); - } - - [Fact] - public void When_asserting_dictionaries_not_to_be_equal_subject_but_dictionary_is_null_it_should_throw() - { - // Arrange - Dictionary dictionary1 = null; - - var dictionary2 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - dictionary1.Should().NotEqual(dictionary2, "because we want to test the behaviour with a null subject"); - }; - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionaries not to be equal because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_asserting_dictionaries_not_to_be_equal_but_expected_dictionary_is_null_it_should_throw() - { - // Arrange - var dictionary1 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - Dictionary dictionary2 = null; - - // Act - Action act = - () => dictionary1.Should().NotEqual(dictionary2, "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw() - .WithMessage("Cannot compare dictionary with .*") - .WithParameterName("unexpected"); - } - - [Fact] - public void - When_asserting_dictionaries_not_to_be_equal_subject_but_both_dictionaries_reference_the_same_object_it_should_throw() - { - // Arrange - var dictionary1 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var dictionary2 = dictionary1; - - // Act - Action act = - () => dictionary1.Should().NotEqual(dictionary2, "because we want to test the behaviour with same objects"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionaries not to be equal because we want to test the behaviour with same objects, but they both reference the same object."); - } - } - - public class ContainKey - { - [Fact] - public void Should_succeed_when_asserting_dictionary_contains_a_key_from_the_dictionary() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act / Assert - dictionary.Should().ContainKey(1); - } - - [Fact] - public void When_a_dictionary_has_custom_equality_comparer_the_contains_key_assertion_should_work_accordingly() - { - // Arrange - var dictionary = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - ["One"] = "One", - ["Two"] = "Two" - }; - - // Act - - // Assert - dictionary.Should().ContainKey("One"); - dictionary.Should().ContainKey("ONE"); - dictionary.Should().ContainKey("one"); - } - - [Fact] - public void Should_succeed_when_asserting_dictionary_contains_multiple_keys_from_the_dictionary() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act / Assert - dictionary.Should().ContainKeys(2, 1); - } - - [Fact] - public void When_a_dictionary_does_not_contain_single_key_it_should_throw_with_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().ContainKey(3, "because {0}", "we do"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to contain key 3 because we do."); - } - - [Fact] - public void When_the_requested_key_exists_it_should_allow_continuation_with_the_value() - { - // Arrange - var dictionary = new Dictionary - { - ["Key"] = new() { SomeProperty = 3 } - }; - - // Act - Action act = () => dictionary.Should().ContainKey("Key").WhoseValue.Should().Be(4); - - // Assert - act.Should().Throw().WithMessage("Expected*4*3*."); - } - - [Fact] - public void When_a_dictionary_does_not_contain_a_list_of_keys_it_should_throw_with_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().ContainKeys(new[] { 2, 3 }, "because {0}", "we do"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to contain keys {2, 3} because we do, but could not find {3}."); - } - - [Fact] - public void Null_dictionaries_do_not_contain_any_keys() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - dictionary.Should().ContainKeys(new[] { 2, 3 }, "because {0}", "we do"); - }; - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to contain keys {2, 3} because we do, but found ."); - } - - [Fact] - public void - When_the_contents_of_a_dictionary_are_checked_against_an_empty_list_of_keys_it_should_throw_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().ContainKeys(); - - // Assert - act.Should().Throw().WithMessage( - "Cannot verify key containment against an empty sequence*"); - } - } - - public class NotContainKey - { - [Fact] - public void When_dictionary_does_not_contain_a_key_that_is_not_in_the_dictionary_it_should_not_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().NotContainKey(4); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_dictionary_does_not_contain_multiple_keys_from_the_dictionary_it_should_not_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().NotContainKeys(3, 4); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_dictionary_contains_an_unexpected_key_it_should_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().NotContainKey(1, "because we {0} like it", "don't"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary {[1] = \"One\", [2] = \"Two\"} not to contain key 1 because we don't like it, but found it anyhow."); - } - - [Fact] - public void When_asserting_dictionary_does_not_contain_key_against_null_dictionary_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - dictionary.Should().NotContainKey(1, "because we want to test the behaviour with a null subject"); - }; - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary not to contain key 1 because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_a_dictionary_contains_a_list_of_keys_it_should_throw_with_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().NotContainKeys(new[] { 2, 3 }, "because {0}", "we do"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to not contain keys {2, 3} because we do, but found {2}."); - } - - [Fact] - public void When_a_dictionary_contains_exactly_one_of_the_keys_it_should_throw_with_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().NotContainKeys(new[] { 2 }, "because {0}", "we do"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to not contain key 2 because we do."); - } - - [Fact] - public void Null_dictionaries_do_not_contain_any_keys() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - dictionary.Should().NotContainKeys(new[] { 2 }, "because {0}", "we do"); - }; - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to not contain keys {2} because we do, but found ."); - } - - [Fact] - public void - When_the_noncontents_of_a_dictionary_are_checked_against_an_empty_list_of_keys_it_should_throw_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().NotContainKeys(); - - // Assert - act.Should().Throw().WithMessage( - "Cannot verify key containment against an empty sequence*"); - } - - [Fact] - public void - When_a_dictionary_checks_a_list_of_keys_not_to_be_present_it_will_honor_the_case_sensitive_equality_comparer_of_the_dictionary() - { - // Arrange - var dictionary = new Dictionary(StringComparer.Ordinal) - { - ["ONE"] = "One", - ["TWO"] = "Two" - }; - - // Act - Action act = () => dictionary.Should().NotContainKeys("One", "Two"); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void - When_a_dictionary_checks_a_list_of_keys_not_to_be_present_it_will_honor_the_case_insensitive_equality_comparer_of_the_dictionary() - { - // Arrange - var dictionary = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - ["ONE"] = "One", - ["TWO"] = "Two" - }; - - // Act - Action act = () => dictionary.Should().NotContainKeys("One", "Two"); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_an_assertion_fails_on_ContainKey_succeeding_message_should_be_included() - { - // Act - Action act = () => - { - using var _ = new AssertionScope(); - var values = new Dictionary(); - values.Should().ContainKey(0); - values.Should().ContainKey(1); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expected*to contain key 0*Expected*to contain key 1*"); - } - } - - public class MyClass - { - public int SomeProperty { get; set; } - - protected bool Equals(MyClass other) - { - return SomeProperty == other.SomeProperty; - } - - public override bool Equals(object obj) - { - if (obj is null) - { - return false; - } - - if (ReferenceEquals(this, obj)) - { - return true; - } - - if (obj.GetType() != GetType()) - { - return false; - } - - return Equals((MyClass)obj); - } - - public override int GetHashCode() - { - return SomeProperty; - } - } - - public class ContainValue - { - [Fact] - public void When_dictionary_contains_expected_value_it_should_succeed() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().ContainValue("One"); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void Null_dictionaries_do_not_contain_any_values() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - dictionary.Should().ContainValue("One", "because {0}", "we do"); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expected dictionary to contain values {\"One\"} because we do, but found ."); - } - - [Fact] - public void When_dictionary_contains_expected_null_value_it_should_succeed() - { - // Arrange - var dictionary = new Dictionary - { - [1] = null - }; - - // Act - Action act = () => dictionary.Should().ContainValue(null); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_the_specified_value_exists_it_should_allow_continuation_using_that_value() - { - // Arrange - var myClass = new MyClass - { - SomeProperty = 0 - }; - - var dictionary = new Dictionary - { - [1] = myClass - }; - - // Act - Action act = () => dictionary.Should().ContainValue(myClass).Which.SomeProperty.Should().BeGreaterThan(0); - - // Assert - act.Should().Throw().WithMessage("Expected*greater*0*0*"); - } - - [Fact] - public void When_multiple_matches_for_the_specified_value_exist_continuation_using_the_matched_value_should_fail() - { - // Arrange - var myClass = new MyClass { SomeProperty = 0 }; - - var dictionary = new Dictionary - { - [1] = myClass, - [2] = new() { SomeProperty = 0 } - }; - - // Act - Action act = - () => - dictionary.Should() - .ContainValue(new MyClass { SomeProperty = 0 }) - .Which.Should() - .BeSameAs(myClass); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_dictionary_contains_multiple_values_from_the_dictionary_it_should_not_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().ContainValues("Two", "One"); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_dictionary_does_not_contain_single_value_it_should_throw_with_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().ContainValue("Three", "because {0}", "we do"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to contain value \"Three\" because we do."); - } - - [Fact] - public void When_a_dictionary_does_not_contain_a_number_of_values_it_should_throw_with_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().ContainValues(new[] { "Two", "Three" }, "because {0}", "we do"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to contain value {\"Two\", \"Three\"} because we do, but could not find {\"Three\"}."); - } - - [Fact] - public void - When_the_contents_of_a_dictionary_are_checked_against_an_empty_list_of_values_it_should_throw_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().ContainValues(); - - // Assert - act.Should().Throw().WithMessage( - "Cannot verify value containment against an empty sequence*"); - } - } - - public class NotContainValue - { - [Fact] - public void When_dictionary_does_not_contain_a_value_that_is_not_in_the_dictionary_it_should_not_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().NotContainValue("Three"); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_dictionary_contains_an_unexpected_value_it_should_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().NotContainValue("One", "because we {0} like it", "don't"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary {[1] = \"One\", [2] = \"Two\"} not to contain value \"One\" because we don't like it, but found it anyhow."); - } - - [Fact] - public void When_asserting_dictionary_does_not_contain_value_against_null_dictionary_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - dictionary.Should().NotContainValue("One", "because we want to test the behaviour with a null subject"); - }; - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary not to contain value \"One\" because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_dictionary_does_not_contain_multiple_values_that_is_not_in_the_dictionary_it_should_not_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().NotContainValues("Three", "Four"); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_dictionary_contains_a_exactly_one_of_the_values_it_should_throw_with_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().NotContainValues(new[] { "Two" }, "because {0}", "we do"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to not contain value \"Two\" because we do."); - } - - [Fact] - public void When_a_dictionary_contains_a_number_of_values_it_should_throw_with_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().NotContainValues(new[] { "Two", "Three" }, "because {0}", "we do"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to not contain value {\"Two\", \"Three\"} because we do, but found {\"Two\"}."); - } - - [Fact] - public void - When_the_noncontents_of_a_dictionary_are_checked_against_an_empty_list_of_values_it_should_throw_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().NotContainValues(); - - // Assert - act.Should().Throw().WithMessage( - "Cannot verify value containment with an empty sequence*"); - } - - [Fact] - public void Null_dictionaries_do_not_contain_any_values() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - dictionary.Should().NotContainValues(new[] { "Two", "Three" }, "because {0}", "we do"); - }; - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to not contain values {\"Two\", \"Three\"} because we do, but found ."); - } - } - - public class Contain - { - [Fact] - public void Should_succeed_when_asserting_dictionary_contains_single_key_value_pair() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var keyValuePairs = new List> - { - new(1, "One") - }; - - // Act / Assert - dictionary.Should().Contain(keyValuePairs); - } - - [Fact] - public void Should_succeed_when_asserting_dictionary_contains_multiple_key_value_pair() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two", - [3] = "Three", - [4] = "Four" - }; - - var expectedKeyValuePair1 = new KeyValuePair(2, "Two"); - var expectedKeyValuePair2 = new KeyValuePair(3, "Three"); - - // Act / Assert - dictionary.Should().Contain(expectedKeyValuePair1, expectedKeyValuePair2); - } - - [Fact] - public void Should_succeed_when_asserting_dictionary_contains_multiple_key_value_pairs() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var keyValuePairs = new List> - { - new(1, "One"), - new(2, "Two") - }; - - // Act / Assert - dictionary.Should().Contain(keyValuePairs); - } - - [Fact] - public void When_a_dictionary_does_not_contain_single_value_for_key_value_pairs_it_should_throw_with_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var keyValuePairs = new List> - { - new(1, "One"), - new(2, "Three") - }; - - // Act - Action act = () => dictionary.Should().Contain(keyValuePairs, "because {0}", "we do"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to contain value \"Three\" at key 2 because we do, but found \"Two\"."); - } - - [Fact] - public void - When_a_dictionary_does_not_contain_multiple_values_for_key_value_pairs_it_should_throw_with_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var keyValuePairs = new List> - { - new(1, "Two"), - new(2, "Three") - }; - - // Act - Action act = () => dictionary.Should().Contain(keyValuePairs, "because {0}", "we do"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to contain {[1, Two], [2, Three]} because we do, but dictionary differs at keys {1, 2}."); - } - - [Fact] - public void When_a_dictionary_does_not_contain_single_key_for_key_value_pairs_it_should_throw_with_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var keyValuePairs = new List> - { - new(3, "Three") - }; - - // Act - Action act = () => dictionary.Should().Contain(keyValuePairs, "because {0}", "we do"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to contain key 3 because we do."); - } - - [Fact] - public void When_a_dictionary_does_not_contain_multiple_keys_for_key_value_pairs_it_should_throw_with_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var keyValuePairs = new List> - { - new(1, "One"), - new(3, "Three"), - new(4, "Four") - }; - - // Act - Action act = () => dictionary.Should().Contain(keyValuePairs, "because {0}", "we do"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to contain key(s) {1, 3, 4} because we do, but could not find keys {3, 4}."); - } - - [Fact] - public void When_asserting_dictionary_contains_key_value_pairs_against_null_dictionary_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - - List> keyValuePairs = new() - { - new KeyValuePair(1, "One"), - new KeyValuePair(1, "Two") - }; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - dictionary.Should().Contain(keyValuePairs, "because we want to test the behaviour with a null subject"); - }; - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to contain key/value pairs {[1, One], [1, Two]} because we want to test the behaviour with a null subject, but dictionary is ."); - } - - [Fact] - public void When_asserting_dictionary_contains_key_value_pairs_but_expected_key_value_pairs_are_empty_it_should_throw() - { - // Arrange - var dictionary1 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - List> keyValuePairs = new(); - - // Act - Action act = () => dictionary1.Should().Contain(keyValuePairs, - "because we want to test the behaviour with an empty set of key/value pairs"); - - // Assert - act.Should().Throw().WithMessage( - "Cannot verify key containment against an empty collection of key/value pairs*"); - } - - [Fact] - public void When_asserting_dictionary_contains_key_value_pairs_but_expected_key_value_pairs_are_null_it_should_throw() - { - // Arrange - var dictionary1 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - List> keyValuePairs = null; - - // Act - Action act = () => - dictionary1.Should().Contain(keyValuePairs, "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw() - .WithMessage("Cannot compare dictionary with .*") - .WithParameterName("expected"); - } - - [Fact] - public void When_dictionary_contains_expected_value_at_specific_key_it_should_not_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act / Assert - dictionary.Should().Contain(1, "One"); - } - - [Fact] - public void When_dictionary_contains_expected_null_at_specific_key_it_should_not_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = null - }; - - // Act / Assert - dictionary.Should().Contain(1, null); - } - - [Fact] - public void When_dictionary_contains_expected_key_value_pairs_it_should_not_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act / Assert - var items = new List> - { - new(1, "One"), - new(2, "Two") - }; - - dictionary.Should().Contain(items); - } - - [Fact] - public void When_dictionary_contains_expected_key_value_pair_it_should_not_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act / Assert - var item = new KeyValuePair(1, "One"); - dictionary.Should().Contain(item); - } - - [Fact] - public void When_dictionary_does_not_contain_the_expected_value_at_specific_key_it_should_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - var item = new KeyValuePair(1, "Two"); - Action act = () => dictionary.Should().Contain(item, "we put it {0}", "there"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to contain value \"Two\" at key 1 because we put it there, but found \"One\"."); - } - - [Fact] - public void When_dictionary_does_not_contain_the_key_value_pairs_it_should_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var items = new List> - { - new(1, "Two"), - new(2, "Three") - }; - - // Act - Action act = () => dictionary.Should().Contain(items, "we put them {0}", "there"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to contain {[1, Two], [2, Three]} because we put them there, but dictionary differs at keys {1, 2}."); - } - - [Fact] - public void When_dictionary_does_not_contain_the_key_value_pair_it_should_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().Contain(1, "Two", "we put it {0}", "there"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to contain value \"Two\" at key 1 because we put it there, but found \"One\"."); - } - - [Fact] - public void When_dictionary_does_not_contain_an_value_at_the_specific_key_it_should_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().Contain(3, "Two", "we put it {0}", "there"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to contain value \"Two\" at key 3 because we put it there, but the key was not found."); - } - - [Fact] - public void When_asserting_dictionary_contains_value_at_specific_key_against_null_dictionary_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - dictionary.Should().Contain(1, "One", "because we want to test the behaviour with a null subject"); - }; - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to contain value \"One\" at key 1 because we want to test the behaviour with a null subject, but dictionary is ."); - } - - [Fact] - public void When_a_dictionary_like_collection_contains_the_default_key_it_should_succeed() - { - // Arrange - var subject = new List> - { new(0, 0) }; - - // Act - Action act = () => subject.Should().Contain(0, 0); - - // Assert - act.Should().NotThrow(); - } - } - - public class NotContain - { - [Fact] - public void Should_succeed_when_asserting_dictionary_does_not_contain_single_key_value_pair() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var keyValuePairs = new List> - { - new(3, "Three") - }; - - // Act / Assert - dictionary.Should().NotContain(keyValuePairs); - } - - [Fact] - public void Should_succeed_when_asserting_dictionary_does_not_contain_multiple_key_value_pair() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var unexpectedKeyValuePair1 = new KeyValuePair(3, "Three"); - var unexpectedKeyValuePair2 = new KeyValuePair(4, "Four"); - - // Act / Assert - dictionary.Should().NotContain(unexpectedKeyValuePair1, unexpectedKeyValuePair2); - } - - [Fact] - public void - Should_succeed_when_asserting_dictionary_does_not_contain_single_key_value_pair_with_existing_key_but_different_value() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var keyValuePairs = new List> - { - new(1, "Two") - }; - - // Act / Assert - dictionary.Should().NotContain(keyValuePairs); - } - - [Fact] - public void Should_succeed_when_asserting_dictionary_does_not_contain_multiple_key_value_pairs() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var keyValuePairs = new List> - { - new(3, "Three"), - new(4, "Four") - }; - - // Act / Assert - dictionary.Should().NotContain(keyValuePairs); - } - - [Fact] - public void - Should_succeed_when_asserting_dictionary_does_not_contain_multiple_key_value_pairs_with_existing_keys_but_different_values() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var keyValuePairs = new List> - { - new(1, "Three"), - new(2, "Four") - }; - - // Act / Assert - dictionary.Should().NotContain(keyValuePairs); - } - - [Fact] - public void When_a_dictionary_does_contain_single_key_value_pair_it_should_throw_with_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var keyValuePairs = new List> - { - new(1, "One") - }; - - // Act - Action act = () => dictionary.Should().NotContain(keyValuePairs, "because {0}", "we do"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to not contain value \"One\" at key 1 because we do, but found it anyhow."); - } - - [Fact] - public void When_a_dictionary_does_contain_multiple_key_value_pairs_it_should_throw_with_clear_explanation() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - var keyValuePairs = new List> - { - new(1, "One"), - new(2, "Two") - }; - - // Act - Action act = () => dictionary.Should().NotContain(keyValuePairs, "because {0}", "we do"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to not contain key/value pairs {[1, One], [2, Two]} because we do, but found them anyhow."); - } - - [Fact] - public void When_asserting_dictionary_does_not_contain_key_value_pairs_against_null_dictionary_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - - List> keyValuePairs = new() - { - new KeyValuePair(1, "One"), - new KeyValuePair(1, "Two") - }; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - dictionary.Should().NotContain(keyValuePairs, "because we want to test the behaviour with a null subject"); - }; - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to not contain key/value pairs {[1, One], [1, Two]} because we want to test the behaviour with a null subject, but dictionary is ."); - } - - [Fact] - public void - When_asserting_dictionary_does_not_contain_key_value_pairs_but_expected_key_value_pairs_are_empty_it_should_throw() - { - // Arrange - var dictionary1 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - List> keyValuePair = new(); - - // Act - Action act = () => dictionary1.Should().NotContain(keyValuePair, - "because we want to test the behaviour with an empty set of key/value pairs"); - - // Assert - act.Should().Throw().WithMessage( - "Cannot verify key containment against an empty collection of key/value pairs*"); - } - - [Fact] - public void - When_asserting_dictionary_does_not_contain_key_value_pairs_but_expected_key_value_pairs_are_null_it_should_throw() - { - // Arrange - var dictionary1 = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - List> keyValuePairs = null; - - // Act - Action act = () => - dictionary1.Should().NotContain(keyValuePairs, "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw() - .WithMessage("Cannot compare dictionary with .*") - .WithParameterName("items"); - } - - [Fact] - public void When_dictionary_does_not_contain_unexpected_value_or_key_it_should_not_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act / Assert - dictionary.Should().NotContain(3, "Three"); - } - - [Fact] - public void When_dictionary_does_not_contain_unexpected_value_at_existing_key_it_should_not_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act / Assert - dictionary.Should().NotContain(2, "Three"); - } - - [Fact] - public void When_dictionary_does_not_have_the_unexpected_value_but_null_at_existing_key_it_should_succeed() - { - // Arrange - var dictionary = new Dictionary - { - [1] = null - }; - - // Act - Action action = () => dictionary.Should().NotContain(1, "other"); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void When_dictionary_does_not_contain_unexpected_key_value_pairs_it_should_not_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act / Assert - var items = new List> - { - new(3, "Three"), - new(4, "Four") - }; - - dictionary.Should().NotContain(items); - } - - [Fact] - public void When_dictionary_does_not_contain_unexpected_key_value_pair_it_should_not_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act / Assert - var item = new KeyValuePair(3, "Three"); - dictionary.Should().NotContain(item); - } - - [Fact] - public void When_dictionary_contains_the_unexpected_value_at_specific_key_it_should_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - var item = new KeyValuePair(1, "One"); - Action act = () => dictionary.Should().NotContain(item, "we put it {0}", "there"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary not to contain value \"One\" at key 1 because we put it there, but found it anyhow."); - } - - [Fact] - public void When_dictionary_contains_the_key_value_pairs_it_should_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - var items = new List> - { - new(1, "One"), - new(2, "Two") - }; - - Action act = () => dictionary.Should().NotContain(items, "we did not put them {0}", "there"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary to not contain key/value pairs {[1, One], [2, Two]} because we did not put them there, but found them anyhow."); - } - - [Fact] - public void When_dictionary_contains_the_key_value_pair_it_should_throw() - { - // Arrange - var dictionary = new Dictionary - { - [1] = "One", - [2] = "Two" - }; - - // Act - Action act = () => dictionary.Should().NotContain(1, "One", "we did not put it {0}", "there"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary not to contain value \"One\" at key 1 because we did not put it there, but found it anyhow."); - } - - [Fact] - public void When_asserting_dictionary_does_not_contain_value_at_specific_key_against_null_dictionary_it_should_throw() - { - // Arrange - Dictionary dictionary = null; - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - dictionary.Should().NotContain(1, "One", "because we want to test the behaviour with a null subject"); - }; - - // Assert - act.Should().Throw().WithMessage( - "Expected dictionary not to contain value \"One\" at key 1 because we want to test the behaviour with a null subject, but dictionary is ."); - } - } - public class OtherDictionaryAssertions { [Theory] @@ -2913,181 +203,216 @@ public TrueReadOnlyDictionary(IReadOnlyDictionary dictionary) IEnumerator IEnumerable.GetEnumerator() => dictionary.GetEnumerator(); } -} - -internal class TrackingTestDictionary : IDictionary -{ - private readonly IDictionary entries; - public TrackingTestDictionary(params KeyValuePair[] entries) + internal class TrackingTestDictionary : IDictionary { - this.entries = entries.ToDictionary(e => e.Key, e => e.Value); - Enumerator = new TrackingDictionaryEnumerator(entries); - } + private readonly IDictionary entries; - public TrackingDictionaryEnumerator Enumerator { get; } + public TrackingTestDictionary(params KeyValuePair[] entries) + { + this.entries = entries.ToDictionary(e => e.Key, e => e.Value); + Enumerator = new TrackingDictionaryEnumerator(entries); + } - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } + public TrackingDictionaryEnumerator Enumerator { get; } - public IEnumerator> GetEnumerator() - { - Enumerator.IncreaseEnumerationCount(); - Enumerator.Reset(); - return Enumerator; - } + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } - public void Add(KeyValuePair item) - { - entries.Add(item); - } + public IEnumerator> GetEnumerator() + { + Enumerator.IncreaseEnumerationCount(); + Enumerator.Reset(); + return Enumerator; + } - public void Clear() - { - entries.Clear(); - } + public void Add(KeyValuePair item) + { + entries.Add(item); + } - public bool Contains(KeyValuePair item) - { - return entries.Contains(item); - } + public void Clear() + { + entries.Clear(); + } - public void CopyTo(KeyValuePair[] array, int arrayIndex) - { - entries.CopyTo(array, arrayIndex); - } + public bool Contains(KeyValuePair item) + { + return entries.Contains(item); + } - public bool Remove(KeyValuePair item) - { - return entries.Remove(item); - } + public void CopyTo(KeyValuePair[] array, int arrayIndex) + { + entries.CopyTo(array, arrayIndex); + } - public int Count - { - get { return entries.Count; } - } + public bool Remove(KeyValuePair item) + { + return entries.Remove(item); + } - public bool IsReadOnly - { - get { return entries.IsReadOnly; } - } + public int Count + { + get { return entries.Count; } + } - public bool ContainsKey(int key) - { - return entries.ContainsKey(key); - } + public bool IsReadOnly + { + get { return entries.IsReadOnly; } + } - public void Add(int key, string value) - { - entries.Add(key, value); - } + public bool ContainsKey(int key) + { + return entries.ContainsKey(key); + } - public bool Remove(int key) - { - return entries.Remove(key); - } + public void Add(int key, string value) + { + entries.Add(key, value); + } - public bool TryGetValue(int key, out string value) - { - return entries.TryGetValue(key, out value); - } + public bool Remove(int key) + { + return entries.Remove(key); + } - public string this[int key] - { - get { return entries[key]; } - set { entries[key] = value; } - } + public bool TryGetValue(int key, out string value) + { + return entries.TryGetValue(key, out value); + } - public ICollection Keys - { - get { return entries.Keys; } + public string this[int key] + { + get { return entries[key]; } + set { entries[key] = value; } + } + + public ICollection Keys + { + get { return entries.Keys; } + } + + public ICollection Values + { + get { return entries.Values; } + } } - public ICollection Values + internal sealed class TrackingDictionaryEnumerator : IEnumerator> { - get { return entries.Values; } - } -} + private readonly KeyValuePair[] values; + private int index; -internal sealed class TrackingDictionaryEnumerator : IEnumerator> -{ - private readonly KeyValuePair[] values; - private int index; + public TrackingDictionaryEnumerator(KeyValuePair[] values) + { + index = -1; + this.values = values; + } - public TrackingDictionaryEnumerator(KeyValuePair[] values) - { - index = -1; - this.values = values; - } + public int LoopCount { get; private set; } - public int LoopCount { get; private set; } + public void IncreaseEnumerationCount() + { + LoopCount++; + } - public void IncreaseEnumerationCount() - { - LoopCount++; - } + public void Dispose() + { + } - public void Dispose() - { - } + public bool MoveNext() + { + index++; + return index < values.Length; + } - public bool MoveNext() - { - index++; - return index < values.Length; - } + public void Reset() + { + index = -1; + } - public void Reset() - { - index = -1; - } + public KeyValuePair Current + { + get { return values[index]; } + } - public KeyValuePair Current - { - get { return values[index]; } + object IEnumerator.Current + { + get { return Current; } + } } - object IEnumerator.Current + internal class DictionaryNotImplementingIReadOnlyDictionary : IDictionary { - get { return Current; } - } -} + private readonly Dictionary dictionary = new(); -internal class DictionaryNotImplementingIReadOnlyDictionary : IDictionary -{ - private readonly Dictionary dictionary = new(); + public TValue this[TKey key] { get => dictionary[key]; set => throw new NotImplementedException(); } - public TValue this[TKey key] { get => dictionary[key]; set => throw new NotImplementedException(); } + public ICollection Keys => dictionary.Keys; - public ICollection Keys => dictionary.Keys; + public ICollection Values => dictionary.Values; - public ICollection Values => dictionary.Values; + public int Count => dictionary.Count; + + public bool IsReadOnly => ((ICollection>)dictionary).IsReadOnly; + + public void Add(TKey key, TValue value) => throw new NotImplementedException(); + + public void Add(KeyValuePair item) => throw new NotImplementedException(); + + public void Clear() => throw new NotImplementedException(); + + public bool Contains(KeyValuePair item) => dictionary.Contains(item); + + public bool ContainsKey(TKey key) => dictionary.ContainsKey(key); - public int Count => dictionary.Count; + public void CopyTo(KeyValuePair[] array, int arrayIndex) => throw new NotImplementedException(); - public bool IsReadOnly => ((ICollection>)dictionary).IsReadOnly; + public IEnumerator> GetEnumerator() => dictionary.GetEnumerator(); - public void Add(TKey key, TValue value) => throw new NotImplementedException(); + public bool Remove(TKey key) => throw new NotImplementedException(); - public void Add(KeyValuePair item) => throw new NotImplementedException(); + public bool Remove(KeyValuePair item) => throw new NotImplementedException(); - public void Clear() => throw new NotImplementedException(); + public bool TryGetValue(TKey key, out TValue value) => dictionary.TryGetValue(key, out value); - public bool Contains(KeyValuePair item) => dictionary.Contains(item); + IEnumerator IEnumerable.GetEnumerator() => dictionary.GetEnumerator(); + } - public bool ContainsKey(TKey key) => dictionary.ContainsKey(key); + public class MyClass + { + public int SomeProperty { get; set; } - public void CopyTo(KeyValuePair[] array, int arrayIndex) => throw new NotImplementedException(); + protected bool Equals(MyClass other) + { + return SomeProperty == other.SomeProperty; + } - public IEnumerator> GetEnumerator() => dictionary.GetEnumerator(); + public override bool Equals(object obj) + { + if (obj is null) + { + return false; + } - public bool Remove(TKey key) => throw new NotImplementedException(); + if (ReferenceEquals(this, obj)) + { + return true; + } - public bool Remove(KeyValuePair item) => throw new NotImplementedException(); + if (obj.GetType() != GetType()) + { + return false; + } - public bool TryGetValue(TKey key, out TValue value) => dictionary.TryGetValue(key, out value); + return Equals((MyClass)obj); + } - IEnumerator IEnumerable.GetEnumerator() => dictionary.GetEnumerator(); + public override int GetHashCode() + { + return SomeProperty; + } + } } From b84cf95d09cb483600ab218d12da8544b79ba912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Wed, 1 Nov 2023 16:06:27 +0100 Subject: [PATCH 150/845] Split GenericCollectionAssertionOfStringSpecs (#2425) --- ...ectionAssertionOfStringSpecs.AllSatisfy.cs | 3 - ...ollectionAssertionOfStringSpecs.BeEmpty.cs | 119 + ...onAssertionOfStringSpecs.BeEquivalentTo.cs | 200 ++ ...CollectionAssertionOfStringSpecs.BeNull.cs | 63 + ...ectionAssertionOfStringSpecs.BeSubsetOf.cs | 144 ++ ...ollectionAssertionOfStringSpecs.Contain.cs | 177 ++ ...onAssertionOfStringSpecs.ContainInOrder.cs | 248 +++ ...tionAssertionOfStringSpecs.ContainMatch.cs | 269 +++ ...cCollectionAssertionOfStringSpecs.Equal.cs | 296 +++ ...lectionAssertionOfStringSpecs.HaveCount.cs | 132 ++ ...ionAssertionOfStringSpecs.HaveElementAt.cs | 65 + ...ionAssertionOfStringSpecs.HaveSameCount.cs | 176 ++ ...ionAssertionOfStringSpecs.IntersectWith.cs | 86 + ...nAssertionOfStringSpecs.NotContainNulls.cs | 64 + ...ertionOfStringSpecs.OnlyHaveUniqueItems.cs | 65 + ...ertionOfStringSpecs.SatisfyRespectively.cs | 44 + ...GenericCollectionAssertionOfStringSpecs.cs | 1951 ----------------- 17 files changed, 2148 insertions(+), 1954 deletions(-) create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEmpty.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEquivalentTo.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeNull.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeSubsetOf.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.Contain.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainInOrder.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainMatch.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.Equal.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveCount.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveElementAt.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveSameCount.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.IntersectWith.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.NotContainNulls.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.OnlyHaveUniqueItems.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.SatisfyRespectively.cs diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.AllSatisfy.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.AllSatisfy.cs index aefdfd2f3d..e1b7d8067a 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.AllSatisfy.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.AllSatisfy.cs @@ -4,9 +4,6 @@ namespace FluentAssertions.Specs.Collections; -/// -/// This part contains tests that address AllSatisfy -/// public partial class GenericCollectionAssertionOfStringSpecs { public class AllSatisfy diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEmpty.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEmpty.cs new file mode 100644 index 0000000000..efe51fe01a --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEmpty.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericCollectionAssertionOfStringSpecs +{ + public class BeEmpty + { + [Fact] + public void Should_fail_when_asserting_collection_with_items_is_empty() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().BeEmpty(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Should_succeed_when_asserting_collection_without_items_is_empty() + { + // Arrange + IEnumerable collection = new string[0]; + + // Act / Assert + collection.Should().BeEmpty(); + } + + [Fact] + public void When_asserting_collection_to_be_empty_but_collection_is_null_it_should_throw() + { + // Arrange + IEnumerable collection = null; + + // Act + Action act = () => collection.Should().BeEmpty("because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to be empty because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void When_the_collection_is_not_empty_unexpectedly_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().BeEmpty("because we want to test the failure {0}", "message"); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected collection to be empty because we want to test the failure message, but found*one*two*three*"); + } + } + + public class NotBeEmpty + { + [Fact] + public void When_asserting_collection_to_be_not_empty_but_collection_is_null_it_should_throw() + { + // Arrange + IEnumerable collection = null; + + // Act + Action act = () => collection.Should().NotBeEmpty("because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection not to be empty because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void When_asserting_collection_with_items_is_not_empty_it_should_succeed() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act / Assert + collection.Should().NotBeEmpty(); + } + + [Fact] + public void When_asserting_collection_without_items_is_not_empty_it_should_fail() + { + // Arrange + IEnumerable collection = new string[0]; + + // Act + Action act = () => collection.Should().NotBeEmpty(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_asserting_collection_without_items_is_not_empty_it_should_fail_with_descriptive_message_() + { + // Arrange + IEnumerable collection = new string[0]; + + // Act + Action act = () => collection.Should().NotBeEmpty("because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage("Expected collection not to be empty because we want to test the failure message."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEquivalentTo.cs new file mode 100644 index 0000000000..0e7a9bab74 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEquivalentTo.cs @@ -0,0 +1,200 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericCollectionAssertionOfStringSpecs +{ + public class BeEquivalentTo + { + [Fact] + public void When_asserting_collections_to_be_equivalent_but_subject_collection_is_null_it_should_throw() + { + // Arrange + IEnumerable collection = null; + IEnumerable collection1 = new[] { "one", "two", "three" }; + + // Act + Action act = + () => collection.Should() + .BeEquivalentTo(collection1, "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw() + .WithMessage("Expected collection*not to be *"); + } + + [Fact] + public void When_collections_with_duplicates_are_not_equivalent_it_should_throw() + { + // Arrange + IEnumerable collection1 = new[] { "one", "two", "three", "one" }; + IEnumerable collection2 = new[] { "one", "two", "three", "three" }; + + // Act + Action act = () => collection1.Should().BeEquivalentTo(collection2); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection1[3]*to be \"three\" with a length of 5, but \"one\" has a length of 3*"); + } + + [Fact] + public void When_testing_for_equivalence_against_empty_collection_it_should_throw() + { + // Arrange + IEnumerable subject = new[] { "one", "two", "three" }; + IEnumerable otherCollection = new string[0]; + + // Act + Action act = () => subject.Should().BeEquivalentTo(otherCollection); + + // Assert + act.Should().Throw().WithMessage( + "Expected subject*to be a collection with 0 item(s), but*contains 3 item(s)*"); + } + + [Fact] + public void When_testing_for_equivalence_against_null_collection_it_should_throw() + { + // Arrange + IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection2 = null; + + // Act + Action act = () => collection1.Should().BeEquivalentTo(collection2); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection1*to be , but found {\"one\", \"two\", \"three\"}*"); + } + + [Fact] + public void When_two_collections_are_both_empty_it_should_treat_them_as_equivalent() + { + // Arrange + IEnumerable subject = new string[0]; + IEnumerable otherCollection = new string[0]; + + // Act + Action act = () => subject.Should().BeEquivalentTo(otherCollection); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_two_collections_contain_the_same_elements_it_should_treat_them_as_equivalent() + { + // Arrange + IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection2 = new[] { "three", "two", "one" }; + + // Act / Assert + collection1.Should().BeEquivalentTo(collection2); + } + + [Fact] + public void When_two_arrays_contain_the_same_elements_it_should_treat_them_as_equivalent() + { + // Arrange + string[] array1 = { "one", "two", "three" }; + string[] array2 = { "three", "two", "one" }; + + // Act / Assert + array1.Should().BeEquivalentTo(array2); + } + } + + public class NotBeEquivalentTo + { + [Fact] + public void Should_succeed_when_asserting_collection_is_not_equivalent_to_a_different_collection() + { + // Arrange + IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection2 = new[] { "three", "one" }; + + // Act / Assert + collection1.Should().NotBeEquivalentTo(collection2); + } + + [Fact] + public void When_asserting_collections_not_to_be_equivalent_but_subject_collection_is_null_it_should_throw() + { + // Arrange + IEnumerable actual = null; + IEnumerable expectation = new[] { "one", "two", "three" }; + + // Act + Action act = () => actual.Should().NotBeEquivalentTo(expectation, + "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected actual not to be equivalent because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void When_collections_are_unexpectedly_equivalent_it_should_throw() + { + // Arrange + IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection2 = new[] { "three", "one", "two" }; + + // Act + Action act = () => collection1.Should().NotBeEquivalentTo(collection2); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection1 {\"one\", \"two\", \"three\"} not*equivalent*{\"three\", \"one\", \"two\"}."); + } + + [Fact] + public void When_non_empty_collection_is_not_expected_to_be_equivalent_to_an_empty_collection_it_should_succeed() + { + // Arrange + IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection2 = new string[0]; + + // Act + Action act = () => collection1.Should().NotBeEquivalentTo(collection2); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_testing_collections_not_to_be_equivalent_against_null_collection_it_should_throw() + { + // Arrange + IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection2 = null; + + // Act + Action act = () => collection1.Should().NotBeEquivalentTo(collection2); + + // Assert + act.Should().Throw().WithMessage( + "Cannot verify inequivalence against a collection.*"); + } + + [Fact] + public void When_testing_collections_not_to_be_equivalent_against_same_collection_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection1 = collection; + + // Act + Action act = () => collection.Should().NotBeEquivalentTo(collection1, + "because we want to test the behaviour with same objects"); + + // Assert + act.Should().Throw().WithMessage( + "*not to be equivalent*because we want to test the behaviour with same objects*but they both reference the same object."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeNull.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeNull.cs new file mode 100644 index 0000000000..433a253111 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeNull.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericCollectionAssertionOfStringSpecs +{ + public class BeNull + { + [Fact] + public void When_collection_is_expected_to_be_null_and_it_is_it_should_not_throw() + { + // Arrange + IEnumerable someCollection = null; + + // Act / Assert + someCollection.Should().BeNull(); + } + + [Fact] + public void When_collection_is_expected_to_be_null_and_it_isnt_it_should_throw() + { + // Arrange + IEnumerable someCollection = new string[0]; + + // Act + Action act = () => someCollection.Should().BeNull("because {0} is valid", "null"); + + // Assert + act.Should().Throw().WithMessage( + "Expected someCollection to be because null is valid, but found {empty}."); + } + } + + public class NotBeNull + { + [Fact] + public void When_collection_is_not_expected_to_be_null_and_it_is_it_should_throw() + { + // Arrange + IEnumerable someCollection = null; + + // Act + Action act = () => someCollection.Should().NotBeNull("because {0} should not", "someCollection"); + + // Assert + act.Should().Throw().WithMessage( + "Expected someCollection not to be because someCollection should not."); + } + + [Fact] + public void When_collection_is_not_expected_to_be_null_and_it_isnt_it_should_not_throw() + { + // Arrange + IEnumerable someCollection = new string[0]; + + // Act / Assert + someCollection.Should().NotBeNull(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeSubsetOf.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeSubsetOf.cs new file mode 100644 index 0000000000..533694d1be --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeSubsetOf.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericCollectionAssertionOfStringSpecs +{ + public class BeSubsetOf + { + [Fact] + public void When_a_subset_is_tested_against_a_null_superset_it_should_throw_with_a_clear_explanation() + { + // Arrange + IEnumerable subset = new[] { "one", "two", "three" }; + IEnumerable superset = null; + + // Act + Action act = () => subset.Should().BeSubsetOf(superset); + + // Assert + act.Should().Throw().WithMessage( + "Cannot verify a subset against a collection.*"); + } + + [Fact] + public void When_an_empty_collection_is_tested_against_a_superset_it_should_succeed() + { + // Arrange + IEnumerable subset = new string[0]; + IEnumerable superset = new[] { "one", "two", "four", "five" }; + + // Act + Action act = () => subset.Should().BeSubsetOf(superset); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_collection_to_be_subset_against_null_collection_it_should_throw() + { + // Arrange + IEnumerable collection = null; + IEnumerable collection1 = new[] { "one", "two", "three" }; + + // Act + Action act = + () => collection.Should().BeSubsetOf(collection1, "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to be a subset of {\"one\", \"two\", \"three\"} because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void When_collection_is_not_a_subset_of_another_it_should_throw_with_the_reason() + { + // Arrange + IEnumerable subset = new[] { "one", "two", "three", "six" }; + IEnumerable superset = new[] { "one", "two", "four", "five" }; + + // Act + Action act = () => subset.Should().BeSubsetOf(superset, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Expected subset to be a subset of {\"one\", \"two\", \"four\", \"five\"} because we want to test the failure message, " + + "but items {\"three\", \"six\"} are not part of the superset."); + } + + [Fact] + public void When_collection_is_subset_of_a_specified_collection_it_should_not_throw() + { + // Arrange + IEnumerable subset = new[] { "one", "two" }; + IEnumerable superset = new[] { "one", "two", "three" }; + + // Act / Assert + subset.Should().BeSubsetOf(superset); + } + } + + public class NotBeSubsetOf + { + [Fact] + public void Should_fail_when_asserting_collection_is_not_subset_of_a_superset_collection() + { + // Arrange + IEnumerable subject = new[] { "one", "two" }; + IEnumerable otherSet = new[] { "one", "two", "three" }; + + // Act + Action act = () => subject.Should().NotBeSubsetOf(otherSet, "because I'm {0}", "mistaken"); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect subject {\"one\", \"two\"} to be a subset of {\"one\", \"two\", \"three\"} because I'm mistaken."); + } + + [Fact] + public void When_a_set_is_expected_to_be_not_a_subset_it_should_succeed() + { + // Arrange + IEnumerable subject = new[] { "one", "two", "four" }; + IEnumerable otherSet = new[] { "one", "two", "three" }; + + // Act / Assert + subject.Should().NotBeSubsetOf(otherSet); + } + + [Fact] + public void When_an_empty_set_is_not_supposed_to_be_a_subset_of_another_set_it_should_throw() + { + // Arrange + IEnumerable subject = new string[] { }; + IEnumerable otherSet = new[] { "one", "two", "three" }; + + // Act + Action act = () => subject.Should().NotBeSubsetOf(otherSet); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect subject {empty} to be a subset of {\"one\", \"two\", \"three\"}."); + } + + [Fact] + public void When_asserting_collection_to_not_be_subset_against_same_collection_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable otherCollection = collection; + + // Act + Action act = () => collection.Should().NotBeSubsetOf(otherCollection, + "because we want to test the behaviour with same objects"); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect*to be a subset of*because we want to test the behaviour with same objects*but they both reference the same object."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.Contain.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.Contain.cs new file mode 100644 index 0000000000..422acb5173 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.Contain.cs @@ -0,0 +1,177 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericCollectionAssertionOfStringSpecs +{ + public class Contain + { + [Fact] + public void When_a_collection_does_not_contain_another_collection_it_should_throw_with_clear_explanation() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().Contain(new[] { "three", "four", "five" }, "because {0}", "we do"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection {\"one\", \"two\", \"three\"} to contain {\"three\", \"four\", \"five\"} because we do, but could not find {\"four\", \"five\"}."); + } + + [Fact] + public void When_a_collection_does_not_contain_single_item_it_should_throw_with_clear_explanation() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().Contain("four", "because {0}", "we do"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection {\"one\", \"two\", \"three\"} to contain \"four\" because we do."); + } + + [Fact] + public void + When_asserting_a_string_collection_contains_an_element_it_should_allow_specifying_the_reason_via_named_parameter() + { + // Arrange + var expected = new List { "hello", "world" }; + var actual = new List { "hello", "world" }; + + // Act + Action act = () => expected.Should().Contain(actual, "they are in the collection"); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_collection_contains_an_item_from_the_collection_it_should_succeed() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().Contain("one"); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_collection_contains_multiple_items_from_the_collection_in_any_order_it_should_succeed() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().Contain(new[] { "two", "one" }); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_the_contents_of_a_collection_are_checked_against_an_empty_collection_it_should_throw_clear_explanation() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().Contain(new string[0]); + + // Assert + act.Should().Throw().WithMessage( + "Cannot verify containment against an empty collection*"); + } + + [Fact] + public void When_the_expected_object_exists_it_should_allow_chaining_additional_assertions() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().Contain("one").Which.Should().HaveLength(4); + + // Assert + act.Should().Throw().WithMessage("Expected*length*4*3*"); + } + } + + public class NotContain + { + [Fact] + public void When_asserting_collection_does_not_contain_item_against_null_collection_it_should_throw() + { + // Arrange + IEnumerable collection = null; + + // Act + Action act = () => collection.Should() + .NotContain("one", "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to not contain \"one\" because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void When_collection_contains_an_unexpected_item_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().NotContain("one", "because we {0} like it, but found it anyhow", "don't"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection {\"one\", \"two\", \"three\"} to not contain \"one\" because we don't like it, but found it anyhow."); + } + + [Fact] + public void When_collection_does_contain_an_unexpected_item_matching_a_predicate_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().NotContain(item => item == "two", "because {0}s are evil", "two"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection {\"one\", \"two\", \"three\"} to not have any items matching (item == \"two\") because twos are evil,*{\"two\"}*"); + } + + [Fact] + public void When_collection_does_not_contain_an_item_that_is_not_in_the_collection_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().NotContain("four"); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_collection_does_not_contain_an_unexpected_item_matching_a_predicate_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act / Assert + collection.Should().NotContain(item => item == "four"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainInOrder.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainInOrder.cs new file mode 100644 index 0000000000..15348015a9 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainInOrder.cs @@ -0,0 +1,248 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericCollectionAssertionOfStringSpecs +{ + public class ContainInOrder + { + [Fact] + public void When_a_collection_does_not_contain_a_range_twice_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "one", "three", "twelve", "two", "two" }; + + // Act + Action act = () => collection.Should().ContainInOrder("one", "two", "one", "one", "two"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection {\"one\", \"two\", \"one\", \"three\", \"twelve\", \"two\", \"two\"} to contain items {\"one\", \"two\", \"one\", \"one\", \"two\"} in order, but \"one\" (index 3) did not appear (in the right order)."); + } + + [Fact] + public void When_a_collection_does_not_contain_an_ordered_item_it_should_throw_with_a_clear_explanation() + { + // Act + Action act = () => new[] { "one", "two", "three" }.Should().ContainInOrder(new[] { "four", "one" }, "we failed"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection {\"one\", \"two\", \"three\"} to contain items {\"four\", \"one\"} in order because we failed, " + + "but \"four\" (index 0) did not appear (in the right order)."); + } + + [Fact] + public void When_asserting_collection_contains_some_values_in_order_but_collection_is_null_it_should_throw() + { + // Arrange + IEnumerable strings = null; + + // Act + Action act = + () => strings.Should() + .ContainInOrder(new[] { "string4" }, "because we're checking how it reacts to a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected strings to contain {\"string4\"} in order because we're checking how it reacts to a null subject, but found ."); + } + + [Fact] + public void When_collection_contains_null_value_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "one", null, "two", "string" }; + + // Act / Assert + collection.Should().ContainInOrder("one", null, "string"); + } + + [Fact] + public void When_passing_in_null_while_checking_for_ordered_containment_it_should_throw_with_a_clear_explanation() + { + // Act + Action act = () => new[] { "one", "two", "three" }.Should().ContainInOrder(null); + + // Assert + act.Should().Throw().WithMessage( + "Cannot verify ordered containment against a collection.*"); + } + + [Fact] + public void When_the_first_collection_contains_a_duplicate_item_without_affecting_the_order_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three", "two" }; + + // Act / Assert + collection.Should().ContainInOrder("one", "two", "three"); + } + + [Fact] + public void When_two_collections_contain_the_same_duplicate_items_in_the_same_order_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "one", "two", "twelve", "two", "two" }; + + // Act / Assert + collection.Should().ContainInOrder("one", "two", "one", "two", "twelve", "two", "two"); + } + + [Fact] + public void When_two_collections_contain_the_same_items_but_in_different_order_it_should_throw_with_a_clear_explanation() + { + // Act + Action act = () => + new[] { "one", "two", "three" }.Should().ContainInOrder(new[] { "three", "one" }, "because we said so"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection {\"one\", \"two\", \"three\"} to contain items {\"three\", \"one\"} in order because we said so, but \"one\" (index 1) did not appear (in the right order)."); + } + + [Fact] + public void When_two_collections_contain_the_same_items_in_the_same_order_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "two", "three" }; + + // Act / Assert + collection.Should().ContainInOrder("one", "two", "three"); + } + } + + public class NotContainInOrder + { + [Fact] + public void When_two_collections_contain_the_same_items_but_in_different_order_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act / Assert + collection.Should().NotContainInOrder("two", "one"); + } + + [Fact] + public void When_a_collection_does_not_contain_an_ordered_item_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act / Assert + collection.Should().NotContainInOrder("four", "one"); + } + + [Fact] + public void When_a_collection_contains_less_items_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two" }; + + // Act / Assert + collection.Should().NotContainInOrder("one", "two", "three"); + } + + [Fact] + public void When_a_collection_does_not_contain_a_range_twice_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "one", "three", "twelve", "two", "two" }; + + // Act / Assert + collection.Should().NotContainInOrder("one", "two", "one", "one", "two"); + } + + [Fact] + public void When_asserting_collection_does_not_contain_some_values_in_order_but_collection_is_null_it_should_throw() + { + // Arrange + IEnumerable collection = null; + + // Act + Action act = () => collection.Should().NotContainInOrder("four"); + + // Assert + act.Should().Throw() + .WithMessage("Cannot verify absence of ordered containment in a collection."); + } + + [Fact] + public void When_two_collections_contain_the_same_items_in_the_same_order_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "two", "three" }; + + // Act + Action act = () => collection.Should().NotContainInOrder(new[] { "one", "two", "three" }, "that's what we expect"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection {\"one\", \"two\", \"two\", \"three\"} to not contain items {\"one\", \"two\", \"three\"} " + + "in order because that's what we expect, but items appeared in order ending at index 3."); + } + + [Fact] + public void When_collection_contains_contain_the_same_items_in_the_same_order_with_null_value_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", null, "two", "three" }; + + // Act + Action act = () => collection.Should().NotContainInOrder("one", null, "three"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection {\"one\", , \"two\", \"three\"} to not contain items {\"one\", , \"three\"} in order, " + + "but items appeared in order ending at index 3."); + } + + [Fact] + public void When_the_first_collection_contains_a_duplicate_item_without_affecting_the_order_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three", "two" }; + + // Act + Action act = () => collection.Should().NotContainInOrder("one", "two", "three"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection {\"one\", \"two\", \"three\", \"two\"} to not contain items {\"one\", \"two\", \"three\"} in order, " + + "but items appeared in order ending at index 2."); + } + + [Fact] + public void When_two_collections_contain_the_same_duplicate_items_in_the_same_order_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "one", "twelve", "two" }; + + // Act + Action act = () => collection.Should().NotContainInOrder("one", "two", "one", "twelve", "two"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection {\"one\", \"two\", \"one\", \"twelve\", \"two\"} to not contain items " + + "{\"one\", \"two\", \"one\", \"twelve\", \"two\"} in order, but items appeared in order ending at index 4."); + } + + [Fact] + public void When_passing_in_null_while_checking_for_absence_of_ordered_containment_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().NotContainInOrder(null); + + // Assert + act.Should().Throw().WithMessage( + "Cannot verify absence of ordered containment against a collection.*"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainMatch.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainMatch.cs new file mode 100644 index 0000000000..d83e756215 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainMatch.cs @@ -0,0 +1,269 @@ +using System; +using System.Collections.Generic; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericCollectionAssertionOfStringSpecs +{ + public class ContainMatch + { + [Fact] + public void When_collection_contains_a_match_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "build succeded", "test failed" }; + + // Act + Action action = () => collection.Should().ContainMatch("* failed"); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void When_collection_contains_multiple_matches_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "build succeded", "test failed", "pack failed" }; + + // Act + Action action = () => collection.Should().ContainMatch("* failed"); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void When_collection_contains_multiple_matches_which_should_throw() + { + // Arrange + IEnumerable collection = new[] { "build succeded", "test failed", "pack failed" }; + + // Act + Action action = () => _ = collection.Should().ContainMatch("* failed").Which; + + // Assert + action.Should().Throw() + .WithMessage("More than one object found. FluentAssertions cannot determine which object is meant.*") + .WithMessage("*Found objects:*\"test failed\"*\"pack failed\""); + } + + [Fact] + public void When_collection_does_not_contain_a_match_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "build succeded", "test failed" }; + + // Act + Action action = () => collection.Should().ContainMatch("* stopped", "because {0}", "we do"); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected collection {\"build succeded\", \"test failed\"} to contain a match of \"* stopped\" because we do."); + } + + [Fact] + public void When_collection_contains_a_match_that_differs_in_casing_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "build succeded", "test failed" }; + + // Act + Action action = () => collection.Should().ContainMatch("* Failed"); + + // Assert + action.Should().Throw() + .WithMessage("Expected collection {\"build succeded\", \"test failed\"} to contain a match of \"* Failed\"."); + } + + [Fact] + public void When_asserting_empty_collection_for_match_it_should_throw() + { + // Arrange + IEnumerable collection = new string[] { }; + + // Act + Action action = () => collection.Should().ContainMatch("* failed"); + + // Assert + action.Should().Throw() + .WithMessage("Expected collection {empty} to contain a match of \"* failed\"."); + } + + [Fact] + public void When_asserting_null_collection_for_match_it_should_throw() + { + // Arrange + IEnumerable collection = null; + + // Act + Action action = () => + { + using var _ = new AssertionScope(); + collection.Should().ContainMatch("* failed", "because {0}", "we do"); + }; + + // Assert + action.Should().Throw() + .WithMessage("Expected collection to contain a match of \"* failed\" because we do, but found ."); + } + + [Fact] + public void When_asserting_collection_to_have_null_match_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "build succeded", "test failed" }; + + // Act + Action action = () => collection.Should().ContainMatch(null); + + // Assert + action.Should().Throw() + .WithMessage( + "Cannot match strings in collection against . Provide a wildcard pattern or use the Contain method.*") + .WithParameterName("wildcardPattern"); + } + + [Fact] + public void When_asserting_collection_to_have_empty_string_match_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "build succeded", "test failed" }; + + // Act + Action action = () => collection.Should().ContainMatch(string.Empty); + + // Assert + action.Should().Throw() + .WithMessage( + "Cannot match strings in collection against an empty string. Provide a wildcard pattern or use the Contain method.*") + .WithParameterName("wildcardPattern"); + } + } + + public class NotContainMatch + { + [Fact] + public void When_collection_doesnt_contain_a_match_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "build succeded", "test" }; + + // Act + Action action = () => collection.Should().NotContainMatch("* failed"); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void When_collection_doesnt_contain_multiple_matches_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "build succeded", "test", "pack" }; + + // Act + Action action = () => collection.Should().NotContainMatch("* failed"); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void When_collection_contains_a_match_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "build succeded", "test failed" }; + + // Act + Action action = () => collection.Should().NotContainMatch("* failed", "because {0}", "it shouldn't"); + + // Assert + action.Should().Throw() + .WithMessage( + "Did not expect collection {\"build succeded\", \"test failed\"} to contain a match of \"* failed\" because it shouldn't."); + } + + [Fact] + public void When_collection_contains_multiple_matches_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "build failed", "test failed" }; + + // Act + Action action = () => collection.Should().NotContainMatch("* failed", "because {0}", "it shouldn't"); + + // Assert + action.Should().Throw() + .WithMessage( + "Did not expect collection {\"build failed\", \"test failed\"} to contain a match of \"* failed\" because it shouldn't."); + } + + [Fact] + public void When_collection_contains_a_match_with_different_casing_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "build succeded", "test failed" }; + + // Act + Action action = () => collection.Should().NotContainMatch("* Failed"); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void When_asserting_collection_to_not_have_null_match_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "build succeded", "test failed" }; + + // Act + Action action = () => collection.Should().NotContainMatch(null); + + // Assert + action.Should().Throw() + .WithMessage( + "Cannot match strings in collection against . Provide a wildcard pattern or use the NotContain method.*") + .WithParameterName("wildcardPattern"); + } + + [Fact] + public void When_asserting_collection_to_not_have_empty_string_match_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "build succeded", "test failed" }; + + // Act + Action action = () => collection.Should().NotContainMatch(string.Empty); + + // Assert + action.Should().Throw() + .WithMessage( + "Cannot match strings in collection against an empty string. Provide a wildcard pattern or use the NotContain method.*") + .WithParameterName("wildcardPattern"); + } + + [Fact] + public void When_asserting_null_collection_to_not_have_null_match_it_should_throw() + { + // Arrange + IEnumerable collection = null; + + // Act + Action action = () => + { + using var _ = new AssertionScope(); + collection.Should().NotContainMatch("* Failed", "we want to test the failure {0}", "message"); + }; + + // Assert + action.Should().Throw() + .WithMessage("Did not expect collection to contain a match of \"* failed\" *failure message*, but found ."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.Equal.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.Equal.cs new file mode 100644 index 0000000000..1c1a23c369 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.Equal.cs @@ -0,0 +1,296 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericCollectionAssertionOfStringSpecs +{ + public class Equal + { + [Fact] + public void Should_succeed_when_asserting_collection_is_equal_to_the_same_collection() + { + // Arrange + IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection2 = new[] { "one", "two", "three" }; + + // Act / Assert + collection1.Should().Equal(collection2); + } + + [Fact] + public void Should_succeed_when_asserting_collection_is_equal_to_the_same_list_of_elements() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act / Assert + collection.Should().Equal("one", "two", "three"); + } + + [Fact] + public void When_all_items_match_according_to_a_predicate_it_should_succeed() + { + // Arrange + var actual = new List { "ONE", "TWO", "THREE", "FOUR" }; + var expected = new List { "One", "Two", "Three", "Four" }; + + // Act + Action action = () => actual.Should().Equal(expected, + (a, e) => string.Equals(a, e, StringComparison.OrdinalIgnoreCase)); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void When_an_empty_collection_is_compared_for_equality_to_a_non_empty_collection_it_should_throw() + { + // Arrange + var collection1 = new string[0]; + IEnumerable collection2 = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection1.Should().Equal(collection2); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection1 to be equal to {\"one\", \"two\", \"three\"}, but found empty collection."); + } + + [Fact] + public void When_any_item_does_not_match_according_to_a_predicate_it_should_throw() + { + // Arrange + var actual = new List { "ONE", "TWO", "THREE", "FOUR" }; + var expected = new List { "One", "Two", "Three", "Five" }; + + // Act + Action action = () => actual.Should().Equal(expected, + (a, e) => string.Equals(a, e, StringComparison.OrdinalIgnoreCase)); + + // Assert + action + .Should().Throw() + .WithMessage("Expected*equal to*, but*differs at index 3."); + } + + [Fact] + public void When_injecting_a_null_comparer_it_should_throw() + { + // Arrange + var actual = new List(); + var expected = new List(); + + // Act + Action action = () => actual.Should().Equal(expected, equalityComparison: null); + + // Assert + action + .Should().ThrowExactly() + .WithParameterName("equalityComparison"); + } + + [Fact] + public void When_asserting_collections_to_be_equal_but_expected_collection_is_null_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection1 = null; + + // Act + Action act = () => + collection.Should().Equal(collection1, "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw() + .WithMessage("Cannot compare collection with .*") + .WithParameterName("expectation"); + } + + [Fact] + public void When_asserting_collections_to_be_equal_but_subject_collection_is_null_it_should_throw() + { + // Arrange + IEnumerable collection = null; + IEnumerable collection1 = new[] { "one", "two", "three" }; + + // Act + Action act = () => + collection.Should().Equal(collection1, "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to be equal to {\"one\", \"two\", \"three\"} because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void When_both_collections_are_null_it_should_succeed() + { + // Arrange + IEnumerable nullColl = null; + + // Act + Action act = () => nullColl.Should().Equal(null); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_two_collections_are_not_equal_because_one_item_differs_it_should_throw_using_the_reason() + { + // Arrange + IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection2 = new[] { "one", "two", "five" }; + + // Act + Action act = () => collection1.Should().Equal(collection2, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection1 to be equal to {\"one\", \"two\", \"five\"} because we want to test the failure message, but {\"one\", \"two\", \"three\"} differs at index 2."); + } + + [Fact] + public void + When_two_collections_are_not_equal_because_the_actual_collection_contains_less_items_it_should_throw_using_the_reason() + { + // Arrange + IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection2 = new[] { "one", "two", "three", "four" }; + + // Act + Action act = () => collection1.Should().Equal(collection2, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection1 to be equal to {\"one\", \"two\", \"three\", \"four\"} because we want to test the failure message, but {\"one\", \"two\", \"three\"} contains 1 item(s) less."); + } + + [Fact] + public void + When_two_collections_are_not_equal_because_the_actual_collection_contains_more_items_it_should_throw_using_the_reason() + { + // Arrange + IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection2 = new[] { "one", "two" }; + + // Act + Action act = () => collection1.Should().Equal(collection2, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection1 to be equal to {\"one\", \"two\"} because we want to test the failure message, but {\"one\", \"two\", \"three\"} contains 1 item(s) too many."); + } + + [Fact] + public void When_two_collections_containing_nulls_are_equal_it_should_not_throw() + { + // Arrange + var subject = new List { "aaa", null }; + var expected = new List { "aaa", null }; + + // Act + Action action = () => subject.Should().Equal(expected); + + // Assert + action.Should().NotThrow(); + } + } + + public class NotEqual + { + [Fact] + public void Should_succeed_when_asserting_collection_is_not_equal_to_a_different_collection() + { + // Arrange + IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection2 = new[] { "three", "one", "two" }; + + // Act / Assert + collection1.Should() + .NotEqual(collection2); + } + + [Fact] + public void When_asserting_collections_not_to_be_equal_but_both_collections_reference_the_same_object_it_should_throw() + { + IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection2 = collection1; + + // Act + Action act = () => + collection1.Should().NotEqual(collection2, "because we want to test the behaviour with same objects"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collections not to be equal because we want to test the behaviour with same objects, but they both reference the same object."); + } + + [Fact] + public void When_asserting_collections_not_to_be_equal_but_expected_collection_is_null_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection1 = null; + + // Act + Action act = + () => collection.Should().NotEqual(collection1, "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw() + .WithMessage("Cannot compare collection with .*") + .WithParameterName("unexpected"); + } + + [Fact] + public void When_asserting_collections_not_to_be_equal_subject_but_collection_is_null_it_should_throw() + { + // Arrange + IEnumerable collection = null; + IEnumerable collection1 = new[] { "one", "two", "three" }; + + // Act + Action act = + () => collection.Should().NotEqual(collection1, "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collections not to be equal because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void When_two_equal_collections_are_not_expected_to_be_equal_it_should_report_a_clear_explanation() + { + // Arrange + IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection2 = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection1.Should().NotEqual(collection2, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect collections {\"one\", \"two\", \"three\"} and {\"one\", \"two\", \"three\"} to be equal because we want to test the failure message."); + } + + [Fact] + public void When_two_equal_collections_are_not_expected_to_be_equal_it_should_throw() + { + // Arrange + IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection2 = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection1.Should().NotEqual(collection2); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect collections {\"one\", \"two\", \"three\"} and {\"one\", \"two\", \"three\"} to be equal."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveCount.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveCount.cs new file mode 100644 index 0000000000..73544ce47b --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveCount.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericCollectionAssertionOfStringSpecs +{ + public class HaveCount + { + [Fact] + public void Should_fail_when_asserting_collection_has_a_count_that_is_different_from_the_number_of_items() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().HaveCount(4); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Should_succeed_when_asserting_collection_has_a_count_that_equals_the_number_of_items() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act / Assert + collection.Should().HaveCount(3); + } + + [Fact] + public void Should_support_chaining_constraints_with_and() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act / Assert + collection.Should() + .HaveCount(3) + .And + .HaveElementAt(1, "two") + .And.NotContain("four"); + } + + [Fact] + public void When_collection_count_is_matched_against_a_null_predicate_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().HaveCount(null); + + // Assert + act.Should().Throw().WithMessage( + "Cannot compare collection count against a predicate.*"); + } + + [Fact] + public void When_collection_count_is_matched_against_a_predicate_and_collection_is_null_it_should_throw() + { + // Arrange + IEnumerable collection = null; + + // Act + Action act = + () => collection.Should().HaveCount(c => c < 3, "we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to contain (c < 3) items because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void When_collection_count_is_matched_and_collection_is_null_it_should_throw() + { + // Arrange + IEnumerable collection = null; + + // Act + Action act = () => collection.Should().HaveCount(1, "we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to contain 1 item(s) because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void When_collection_has_a_count_larger_than_the_minimum_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act / Assert + collection.Should().HaveCount(c => c >= 3); + } + + [Fact] + public void + When_collection_has_a_count_that_is_different_from_the_number_of_items_it_should_fail_with_descriptive_message_() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action action = () => collection.Should().HaveCount(4, "because we want to test the failure {0}", "message"); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected collection to contain 4 item(s) because we want to test the failure message, but found 3: {\"one\", \"two\", \"three\"}."); + } + + [Fact] + public void When_collection_has_a_count_that_not_matches_the_predicate_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().HaveCount(c => c >= 4, "a minimum of 4 is required"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to have a count (c >= 4) because a minimum of 4 is required, but count is 3: {\"one\", \"two\", \"three\"}."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveElementAt.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveElementAt.cs new file mode 100644 index 0000000000..a4fb37ff99 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveElementAt.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericCollectionAssertionOfStringSpecs +{ + public class HaveElementAt + { + [Fact] + public void When_asserting_collection_has_element_at_specific_index_against_null_collection_it_should_throw() + { + // Arrange + IEnumerable collection = null; + + // Act + Action act = () => collection.Should().HaveElementAt(1, "one", + "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to have element at index 1 because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void When_collection_does_not_have_an_element_at_the_specific_index_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().HaveElementAt(4, "three", "we put it {0}", "there"); + + // Assert + act.Should().Throw().WithMessage( + "Expected \"three\" at index 4 because we put it there, but found no element."); + } + + [Fact] + public void When_collection_does_not_have_the_expected_element_at_specific_index_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().HaveElementAt(1, "three", "we put it {0}", "there"); + + // Assert + act.Should().Throw().WithMessage( + "Expected \"three\" at index 1 because we put it there, but found \"two\"."); + } + + [Fact] + public void When_collection_has_expected_element_at_specific_index_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act / Assert + collection.Should().HaveElementAt(1, "two"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveSameCount.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveSameCount.cs new file mode 100644 index 0000000000..abc30ae906 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveSameCount.cs @@ -0,0 +1,176 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericCollectionAssertionOfStringSpecs +{ + public class HaveSameCount + { + [Fact] + public void When_asserting_collections_to_have_same_count_against_an_other_null_collection_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable otherCollection = null; + + // Act + Action act = () => collection.Should().HaveSameCount(otherCollection); + + // Assert + act.Should().Throw().WithMessage( + "Cannot verify count against a collection.*"); + } + + [Fact] + public void When_asserting_collections_to_have_same_count_against_null_collection_it_should_throw() + { + // Arrange + IEnumerable collection = null; + IEnumerable collection1 = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().HaveSameCount(collection1, + "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to have the same count as {\"one\", \"two\", \"three\"} because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void When_both_collections_do_not_have_the_same_number_of_elements_it_should_fail() + { + // Arrange + IEnumerable firstCollection = new[] { "one", "two", "three" }; + IEnumerable secondCollection = new[] { "four", "six" }; + + // Act + Action act = () => firstCollection.Should().HaveSameCount(secondCollection); + + // Assert + act.Should().Throw().WithMessage( + "Expected firstCollection to have 2 item(s), but found 3."); + } + + [Fact] + public void When_both_collections_have_the_same_number_elements_it_should_succeed() + { + // Arrange + IEnumerable firstCollection = new[] { "one", "two", "three" }; + IEnumerable secondCollection = new[] { "four", "five", "six" }; + + // Act / Assert + firstCollection.Should().HaveSameCount(secondCollection); + } + + [Fact] + public void When_comparing_item_counts_and_a_reason_is_specified_it_should_it_in_the_exception() + { + // Arrange + IEnumerable firstCollection = new[] { "one", "two", "three" }; + IEnumerable secondCollection = new[] { "four", "six" }; + + // Act + Action act = () => firstCollection.Should().HaveSameCount(secondCollection, "we want to test the {0}", "reason"); + + // Assert + act.Should().Throw().WithMessage( + "Expected firstCollection to have 2 item(s) because we want to test the reason, but found 3."); + } + } + + public class NotHaveSameCount + { + [Fact] + public void When_asserting_collections_to_not_have_same_count_against_an_other_null_collection_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable otherCollection = null; + + // Act + Action act = () => collection.Should().NotHaveSameCount(otherCollection); + + // Assert + act.Should().Throw().WithMessage( + "Cannot verify count against a collection.*"); + } + + [Fact] + public void When_asserting_collections_to_not_have_same_count_against_null_collection_it_should_throw() + { + // Arrange + IEnumerable collection = null; + IEnumerable collection1 = new[] { "one", "two", "three" }; + + // Act + Action act = () => collection.Should().NotHaveSameCount(collection1, + "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to not have the same count as {\"one\", \"two\", \"three\"} because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void + When_asserting_collections_to_not_have_same_count_but_both_collections_references_the_same_object_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable otherCollection = collection; + + // Act + Action act = () => collection.Should().NotHaveSameCount(otherCollection, + "because we want to test the behaviour with same objects"); + + // Assert + act.Should().Throw().WithMessage( + "*not have the same count*because we want to test the behaviour with same objects*but they both reference the same object."); + } + + [Fact] + public void When_asserting_not_same_count_and_both_collections_have_the_same_number_elements_it_should_fail() + { + // Arrange + IEnumerable firstCollection = new[] { "one", "two", "three" }; + IEnumerable secondCollection = new[] { "four", "five", "six" }; + + // Act + Action act = () => firstCollection.Should().NotHaveSameCount(secondCollection); + + // Assert + act.Should().Throw().WithMessage( + "Expected firstCollection to not have 3 item(s), but found 3."); + } + + [Fact] + public void When_asserting_not_same_count_and_collections_have_different_number_elements_it_should_succeed() + { + // Arrange + IEnumerable firstCollection = new[] { "one", "two", "three" }; + IEnumerable secondCollection = new[] { "four", "six" }; + + // Act / Assert + firstCollection.Should().NotHaveSameCount(secondCollection); + } + + [Fact] + public void When_comparing_not_same_item_counts_and_a_reason_is_specified_it_should_it_in_the_exception() + { + // Arrange + IEnumerable firstCollection = new[] { "one", "two", "three" }; + IEnumerable secondCollection = new[] { "four", "five", "six" }; + + // Act + Action act = () => firstCollection.Should().NotHaveSameCount(secondCollection, "we want to test the {0}", "reason"); + + // Assert + act.Should().Throw().WithMessage( + "Expected firstCollection to not have 3 item(s) because we want to test the reason, but found 3."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.IntersectWith.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.IntersectWith.cs new file mode 100644 index 0000000000..e9c9541d89 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.IntersectWith.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericCollectionAssertionOfStringSpecs +{ + public class IntersectWith + { + [Fact] + public void When_asserting_the_items_in_an_two_intersecting_collections_intersect_it_should_succeed() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable otherCollection = new[] { "three", "four", "five" }; + + // Act / Assert + collection.Should().IntersectWith(otherCollection); + } + + [Fact] + public void When_asserting_the_items_in_an_two_non_intersecting_collections_intersect_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable otherCollection = new[] { "four", "five" }; + + // Act + Action action = () => collection.Should().IntersectWith(otherCollection, "they should share items"); + + // Assert + action.Should().Throw() + .WithMessage("Expected collection to intersect with {\"four\", \"five\"} because they should share items," + + " but {\"one\", \"two\", \"three\"} does not contain any shared items."); + } + } + + public class NotIntersectWith + { + [Fact] + public void When_asserting_collection_to_not_intersect_with_same_collection_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable otherCollection = collection; + + // Act + Action act = () => collection.Should().NotIntersectWith(otherCollection, + "because we want to test the behaviour with same objects"); + + // Assert + act.Should().Throw().WithMessage( + "*to intersect with*because we want to test the behaviour with same objects*but they both reference the same object."); + } + + [Fact] + public void When_asserting_the_items_in_an_two_intersecting_collections_do_not_intersect_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable otherCollection = new[] { "two", "three", "four" }; + + // Act + Action action = () => collection.Should().NotIntersectWith(otherCollection, "they should not share items"); + + // Assert + action.Should().Throw() + .WithMessage( + "Did not expect collection to intersect with {\"two\", \"three\", \"four\"} because they should not share items," + + " but found the following shared items {\"two\", \"three\"}."); + } + + [Fact] + public void When_asserting_the_items_in_an_two_non_intersecting_collections_do_not_intersect_it_should_succeed() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable otherCollection = new[] { "four", "five" }; + + // Act / Assert + collection.Should().NotIntersectWith(otherCollection); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.NotContainNulls.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.NotContainNulls.cs new file mode 100644 index 0000000000..b4ecdadc19 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.NotContainNulls.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericCollectionAssertionOfStringSpecs +{ + public class NotContainNulls + { + [Fact] + public void When_asserting_collection_to_not_contain_nulls_but_collection_is_null_it_should_throw() + { + // Arrange + IEnumerable collection = null; + + // Act + Action act = () => collection.Should().NotContainNulls("because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection not to contain s because we want to test the behaviour with a null subject, but collection is ."); + } + + [Fact] + public void When_collection_contains_multiple_nulls_that_are_unexpected_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "", null, "", null }; + + // Act + Action act = () => collection.Should().NotContainNulls("because they are {0}", "evil"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection not to contain s*because they are evil*{1, 3}*"); + } + + [Fact] + public void When_collection_contains_nulls_that_are_unexpected_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "", null }; + + // Act + Action act = () => collection.Should().NotContainNulls("because they are {0}", "evil"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection not to contain s because they are evil, but found one at index 1."); + } + + [Fact] + public void When_collection_does_not_contain_nulls_it_should_not_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three" }; + + // Act / Assert + collection.Should().NotContainNulls(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.OnlyHaveUniqueItems.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.OnlyHaveUniqueItems.cs new file mode 100644 index 0000000000..c30a1bd5d5 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.OnlyHaveUniqueItems.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericCollectionAssertionOfStringSpecs +{ + public class OnlyHaveUniqueItems + { + [Fact] + public void Should_succeed_when_asserting_collection_with_unique_items_contains_only_unique_items() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three", "four" }; + + // Act / Assert + collection.Should().OnlyHaveUniqueItems(); + } + + [Fact] + public void When_a_collection_contains_duplicate_items_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "three", "three" }; + + // Act + Action act = () => collection.Should().OnlyHaveUniqueItems("{0} don't like {1}", "we", "duplicates"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to only have unique items because we don't like duplicates, but item \"three\" is not unique."); + } + + [Fact] + public void When_a_collection_contains_multiple_duplicate_items_it_should_throw() + { + // Arrange + IEnumerable collection = new[] { "one", "two", "two", "three", "three" }; + + // Act + Action act = () => collection.Should().OnlyHaveUniqueItems("{0} don't like {1}", "we", "duplicates"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to only have unique items because we don't like duplicates, but items {\"two\", \"three\"} are not unique."); + } + + [Fact] + public void When_asserting_collection_to_only_have_unique_items_but_collection_is_null_it_should_throw() + { + // Arrange + IEnumerable collection = null; + + // Act + Action act = + () => collection.Should().OnlyHaveUniqueItems("because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to only have unique items because we want to test the behaviour with a null subject, but found ."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.SatisfyRespectively.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.SatisfyRespectively.cs new file mode 100644 index 0000000000..98c669795b --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.SatisfyRespectively.cs @@ -0,0 +1,44 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericCollectionAssertionOfStringSpecs +{ + public class SatisfyRespectively + { + [Fact] + public void When_string_collection_satisfies_all_inspectors_it_should_succeed() + { + // Arrange + string[] collection = { "John", "Jane" }; + + // Act / Assert + collection.Should().SatisfyRespectively( + value => value.Should().Be("John"), + value => value.Should().Be("Jane") + ); + } + + [Fact] + public void When_string_collection_does_not_satisfy_all_inspectors_it_should_throw() + { + // Arrange + string[] collection = { "Jack", "Jessica" }; + + // Act + Action act = () => collection.Should().SatisfyRespectively(new Action[] + { + value => value.Should().Be("John"), + value => value.Should().Be("Jane") + }, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to satisfy all inspectors because we want to test the failure message, but some inspectors are not satisfied" + + "*John*Jack" + + "*Jane*Jessica*"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.cs index b03855eb1c..6d5b90c9a4 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.cs @@ -3,9 +3,7 @@ using System.Linq; using System.Reflection; using FluentAssertions.Collections; -using FluentAssertions.Execution; using Xunit; -using Xunit.Sdk; namespace FluentAssertions.Specs.Collections; @@ -14,1657 +12,6 @@ namespace FluentAssertions.Specs.Collections; /// public partial class GenericCollectionAssertionOfStringSpecs { - [Fact] - public void Should_fail_when_asserting_collection_has_a_count_that_is_different_from_the_number_of_items() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().HaveCount(4); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void Should_fail_when_asserting_collection_is_not_subset_of_a_superset_collection() - { - // Arrange - IEnumerable subject = new[] { "one", "two" }; - IEnumerable otherSet = new[] { "one", "two", "three" }; - - // Act - Action act = () => subject.Should().NotBeSubsetOf(otherSet, "because I'm {0}", "mistaken"); - - // Assert - act.Should().Throw().WithMessage( - "Did not expect subject {\"one\", \"two\"} to be a subset of {\"one\", \"two\", \"three\"} because I'm mistaken."); - } - - [Fact] - public void Should_fail_when_asserting_collection_with_items_is_empty() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().BeEmpty(); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void Should_succeed_when_asserting_collection_has_a_count_that_equals_the_number_of_items() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act / Assert - collection.Should().HaveCount(3); - } - - [Fact] - public void Should_succeed_when_asserting_collection_is_equal_to_the_same_collection() - { - // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "one", "two", "three" }; - - // Act / Assert - collection1.Should().Equal(collection2); - } - - [Fact] - public void Should_succeed_when_asserting_collection_is_equal_to_the_same_list_of_elements() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act / Assert - collection.Should().Equal("one", "two", "three"); - } - - [Fact] - public void Should_succeed_when_asserting_collection_is_not_equal_to_a_different_collection() - { - // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "three", "one", "two" }; - - // Act / Assert - collection1.Should() - .NotEqual(collection2); - } - - [Fact] - public void Should_succeed_when_asserting_collection_is_not_equivalent_to_a_different_collection() - { - // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "three", "one" }; - - // Act / Assert - collection1.Should().NotBeEquivalentTo(collection2); - } - - [Fact] - public void Should_succeed_when_asserting_collection_with_unique_items_contains_only_unique_items() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three", "four" }; - - // Act / Assert - collection.Should().OnlyHaveUniqueItems(); - } - - [Fact] - public void Should_succeed_when_asserting_collection_without_items_is_empty() - { - // Arrange - IEnumerable collection = new string[0]; - - // Act / Assert - collection.Should().BeEmpty(); - } - - [Fact] - public void Should_support_chaining_constraints_with_and() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act / Assert - collection.Should() - .HaveCount(3) - .And - .HaveElementAt(1, "two") - .And.NotContain("four"); - } - - [Fact] - public void When_a_collection_contains_duplicate_items_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three", "three" }; - - // Act - Action act = () => collection.Should().OnlyHaveUniqueItems("{0} don't like {1}", "we", "duplicates"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection to only have unique items because we don't like duplicates, but item \"three\" is not unique."); - } - - [Fact] - public void When_a_collection_contains_multiple_duplicate_items_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "two", "three", "three" }; - - // Act - Action act = () => collection.Should().OnlyHaveUniqueItems("{0} don't like {1}", "we", "duplicates"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection to only have unique items because we don't like duplicates, but items {\"two\", \"three\"} are not unique."); - } - - [Fact] - public void When_a_collection_does_not_contain_a_range_twice_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "one", "three", "twelve", "two", "two" }; - - // Act - Action act = () => collection.Should().ContainInOrder("one", "two", "one", "one", "two"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection {\"one\", \"two\", \"one\", \"three\", \"twelve\", \"two\", \"two\"} to contain items {\"one\", \"two\", \"one\", \"one\", \"two\"} in order, but \"one\" (index 3) did not appear (in the right order)."); - } - - [Fact] - public void When_a_collection_does_not_contain_an_ordered_item_it_should_throw_with_a_clear_explanation() - { - // Act - Action act = () => new[] { "one", "two", "three" }.Should().ContainInOrder(new[] { "four", "one" }, "we failed"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection {\"one\", \"two\", \"three\"} to contain items {\"four\", \"one\"} in order because we failed, " + - "but \"four\" (index 0) did not appear (in the right order)."); - } - - [Fact] - public void When_a_collection_does_not_contain_another_collection_it_should_throw_with_clear_explanation() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().Contain(new[] { "three", "four", "five" }, "because {0}", "we do"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection {\"one\", \"two\", \"three\"} to contain {\"three\", \"four\", \"five\"} because we do, but could not find {\"four\", \"five\"}."); - } - - [Fact] - public void When_a_collection_does_not_contain_single_item_it_should_throw_with_clear_explanation() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().Contain("four", "because {0}", "we do"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection {\"one\", \"two\", \"three\"} to contain \"four\" because we do."); - } - - [Fact] - public void When_a_set_is_expected_to_be_not_a_subset_it_should_succeed() - { - // Arrange - IEnumerable subject = new[] { "one", "two", "four" }; - IEnumerable otherSet = new[] { "one", "two", "three" }; - - // Act / Assert - subject.Should().NotBeSubsetOf(otherSet); - } - - [Fact] - public void When_a_subset_is_tested_against_a_null_superset_it_should_throw_with_a_clear_explanation() - { - // Arrange - IEnumerable subset = new[] { "one", "two", "three" }; - IEnumerable superset = null; - - // Act - Action act = () => subset.Should().BeSubsetOf(superset); - - // Assert - act.Should().Throw().WithMessage( - "Cannot verify a subset against a collection.*"); - } - - [Fact] - public void When_all_items_match_according_to_a_predicate_it_should_succeed() - { - // Arrange - var actual = new List { "ONE", "TWO", "THREE", "FOUR" }; - var expected = new List { "One", "Two", "Three", "Four" }; - - // Act - Action action = () => actual.Should().Equal(expected, - (a, e) => string.Equals(a, e, StringComparison.OrdinalIgnoreCase)); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void When_an_empty_collection_is_compared_for_equality_to_a_non_empty_collection_it_should_throw() - { - // Arrange - var collection1 = new string[0]; - IEnumerable collection2 = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection1.Should().Equal(collection2); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection1 to be equal to {\"one\", \"two\", \"three\"}, but found empty collection."); - } - - [Fact] - public void When_an_empty_collection_is_tested_against_a_superset_it_should_succeed() - { - // Arrange - IEnumerable subset = new string[0]; - IEnumerable superset = new[] { "one", "two", "four", "five" }; - - // Act - Action act = () => subset.Should().BeSubsetOf(superset); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_an_empty_set_is_not_supposed_to_be_a_subset_of_another_set_it_should_throw() - { - // Arrange - IEnumerable subject = new string[] { }; - IEnumerable otherSet = new[] { "one", "two", "three" }; - - // Act - Action act = () => subject.Should().NotBeSubsetOf(otherSet); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect subject {empty} to be a subset of {\"one\", \"two\", \"three\"}."); - } - - [Fact] - public void When_any_item_does_not_match_according_to_a_predicate_it_should_throw() - { - // Arrange - var actual = new List { "ONE", "TWO", "THREE", "FOUR" }; - var expected = new List { "One", "Two", "Three", "Five" }; - - // Act - Action action = () => actual.Should().Equal(expected, - (a, e) => string.Equals(a, e, StringComparison.OrdinalIgnoreCase)); - - // Assert - action - .Should().Throw() - .WithMessage("Expected*equal to*, but*differs at index 3."); - } - - [Fact] - public void When_injecting_a_null_comparer_it_should_throw() - { - // Arrange - var actual = new List(); - var expected = new List(); - - // Act - Action action = () => actual.Should().Equal(expected, equalityComparison: null); - - // Assert - action - .Should().ThrowExactly() - .WithParameterName("equalityComparison"); - } - - [Fact] - public void - When_asserting_a_string_collection_contains_an_element_it_should_allow_specifying_the_reason_via_named_parameter() - { - // Arrange - var expected = new List { "hello", "world" }; - var actual = new List { "hello", "world" }; - - // Act - Action act = () => expected.Should().Contain(actual, "they are in the collection"); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_collection_contains_an_item_from_the_collection_it_should_succeed() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().Contain("one"); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_collection_contains_multiple_items_from_the_collection_in_any_order_it_should_succeed() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().Contain(new[] { "two", "one" }); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_collection_contains_some_values_in_order_but_collection_is_null_it_should_throw() - { - // Arrange - IEnumerable strings = null; - - // Act - Action act = - () => strings.Should() - .ContainInOrder(new[] { "string4" }, "because we're checking how it reacts to a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected strings to contain {\"string4\"} in order because we're checking how it reacts to a null subject, but found ."); - } - - [Fact] - public void When_asserting_collection_does_not_contain_item_against_null_collection_it_should_throw() - { - // Arrange - IEnumerable collection = null; - - // Act - Action act = () => collection.Should() - .NotContain("one", "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection to not contain \"one\" because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_asserting_collection_has_element_at_specific_index_against_null_collection_it_should_throw() - { - // Arrange - IEnumerable collection = null; - - // Act - Action act = () => collection.Should().HaveElementAt(1, "one", - "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection to have element at index 1 because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_asserting_collection_to_be_empty_but_collection_is_null_it_should_throw() - { - // Arrange - IEnumerable collection = null; - - // Act - Action act = () => collection.Should().BeEmpty("because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection to be empty because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_asserting_collection_to_be_not_empty_but_collection_is_null_it_should_throw() - { - // Arrange - IEnumerable collection = null; - - // Act - Action act = () => collection.Should().NotBeEmpty("because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection not to be empty because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_asserting_collection_to_be_subset_against_null_collection_it_should_throw() - { - // Arrange - IEnumerable collection = null; - IEnumerable collection1 = new[] { "one", "two", "three" }; - - // Act - Action act = - () => collection.Should().BeSubsetOf(collection1, "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection to be a subset of {\"one\", \"two\", \"three\"} because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_asserting_collection_to_not_be_subset_against_same_collection_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - IEnumerable otherCollection = collection; - - // Act - Action act = () => collection.Should().NotBeSubsetOf(otherCollection, - "because we want to test the behaviour with same objects"); - - // Assert - act.Should().Throw().WithMessage( - "Did not expect*to be a subset of*because we want to test the behaviour with same objects*but they both reference the same object."); - } - - [Fact] - public void When_asserting_collection_to_not_contain_nulls_but_collection_is_null_it_should_throw() - { - // Arrange - IEnumerable collection = null; - - // Act - Action act = () => collection.Should().NotContainNulls("because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection not to contain s because we want to test the behaviour with a null subject, but collection is ."); - } - - [Fact] - public void When_asserting_collection_to_not_intersect_with_same_collection_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - IEnumerable otherCollection = collection; - - // Act - Action act = () => collection.Should().NotIntersectWith(otherCollection, - "because we want to test the behaviour with same objects"); - - // Assert - act.Should().Throw().WithMessage( - "*to intersect with*because we want to test the behaviour with same objects*but they both reference the same object."); - } - - [Fact] - public void When_asserting_collection_to_only_have_unique_items_but_collection_is_null_it_should_throw() - { - // Arrange - IEnumerable collection = null; - - // Act - Action act = - () => collection.Should().OnlyHaveUniqueItems("because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection to only have unique items because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_asserting_collection_with_items_is_not_empty_it_should_succeed() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act / Assert - collection.Should().NotBeEmpty(); - } - - [Fact] - public void When_asserting_collection_without_items_is_not_empty_it_should_fail() - { - // Arrange - IEnumerable collection = new string[0]; - - // Act - Action act = () => collection.Should().NotBeEmpty(); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_asserting_collection_without_items_is_not_empty_it_should_fail_with_descriptive_message_() - { - // Arrange - IEnumerable collection = new string[0]; - - // Act - Action act = () => collection.Should().NotBeEmpty("because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage("Expected collection not to be empty because we want to test the failure message."); - } - - [Fact] - public void When_asserting_collections_not_to_be_equal_but_both_collections_reference_the_same_object_it_should_throw() - { - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = collection1; - - // Act - Action act = () => - collection1.Should().NotEqual(collection2, "because we want to test the behaviour with same objects"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collections not to be equal because we want to test the behaviour with same objects, but they both reference the same object."); - } - - [Fact] - public void When_asserting_collections_not_to_be_equal_but_expected_collection_is_null_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - IEnumerable collection1 = null; - - // Act - Action act = - () => collection.Should().NotEqual(collection1, "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw() - .WithMessage("Cannot compare collection with .*") - .WithParameterName("unexpected"); - } - - [Fact] - public void When_asserting_collections_not_to_be_equal_subject_but_collection_is_null_it_should_throw() - { - // Arrange - IEnumerable collection = null; - IEnumerable collection1 = new[] { "one", "two", "three" }; - - // Act - Action act = - () => collection.Should().NotEqual(collection1, "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collections not to be equal because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_asserting_collections_not_to_be_equivalent_but_subject_collection_is_null_it_should_throw() - { - // Arrange - IEnumerable actual = null; - IEnumerable expectation = new[] { "one", "two", "three" }; - - // Act - Action act = () => actual.Should().NotBeEquivalentTo(expectation, - "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected actual not to be equivalent because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_asserting_collections_to_be_equal_but_expected_collection_is_null_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - IEnumerable collection1 = null; - - // Act - Action act = () => - collection.Should().Equal(collection1, "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw() - .WithMessage("Cannot compare collection with .*") - .WithParameterName("expectation"); - } - - [Fact] - public void When_asserting_collections_to_be_equal_but_subject_collection_is_null_it_should_throw() - { - // Arrange - IEnumerable collection = null; - IEnumerable collection1 = new[] { "one", "two", "three" }; - - // Act - Action act = () => - collection.Should().Equal(collection1, "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection to be equal to {\"one\", \"two\", \"three\"} because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_asserting_collections_to_be_equivalent_but_subject_collection_is_null_it_should_throw() - { - // Arrange - IEnumerable collection = null; - IEnumerable collection1 = new[] { "one", "two", "three" }; - - // Act - Action act = - () => collection.Should() - .BeEquivalentTo(collection1, "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw() - .WithMessage("Expected collection*not to be *"); - } - - [Fact] - public void When_asserting_collections_to_have_same_count_against_an_other_null_collection_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - IEnumerable otherCollection = null; - - // Act - Action act = () => collection.Should().HaveSameCount(otherCollection); - - // Assert - act.Should().Throw().WithMessage( - "Cannot verify count against a collection.*"); - } - - [Fact] - public void When_asserting_collections_to_have_same_count_against_null_collection_it_should_throw() - { - // Arrange - IEnumerable collection = null; - IEnumerable collection1 = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().HaveSameCount(collection1, - "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection to have the same count as {\"one\", \"two\", \"three\"} because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_asserting_collections_to_not_have_same_count_against_an_other_null_collection_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - IEnumerable otherCollection = null; - - // Act - Action act = () => collection.Should().NotHaveSameCount(otherCollection); - - // Assert - act.Should().Throw().WithMessage( - "Cannot verify count against a collection.*"); - } - - [Fact] - public void When_asserting_collections_to_not_have_same_count_against_null_collection_it_should_throw() - { - // Arrange - IEnumerable collection = null; - IEnumerable collection1 = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().NotHaveSameCount(collection1, - "because we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection to not have the same count as {\"one\", \"two\", \"three\"} because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void - When_asserting_collections_to_not_have_same_count_but_both_collections_references_the_same_object_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - IEnumerable otherCollection = collection; - - // Act - Action act = () => collection.Should().NotHaveSameCount(otherCollection, - "because we want to test the behaviour with same objects"); - - // Assert - act.Should().Throw().WithMessage( - "*not have the same count*because we want to test the behaviour with same objects*but they both reference the same object."); - } - - [Fact] - public void When_asserting_not_same_count_and_both_collections_have_the_same_number_elements_it_should_fail() - { - // Arrange - IEnumerable firstCollection = new[] { "one", "two", "three" }; - IEnumerable secondCollection = new[] { "four", "five", "six" }; - - // Act - Action act = () => firstCollection.Should().NotHaveSameCount(secondCollection); - - // Assert - act.Should().Throw().WithMessage( - "Expected firstCollection to not have 3 item(s), but found 3."); - } - - [Fact] - public void When_asserting_not_same_count_and_collections_have_different_number_elements_it_should_succeed() - { - // Arrange - IEnumerable firstCollection = new[] { "one", "two", "three" }; - IEnumerable secondCollection = new[] { "four", "six" }; - - // Act / Assert - firstCollection.Should().NotHaveSameCount(secondCollection); - } - - [Fact] - public void When_asserting_the_items_in_an_two_intersecting_collections_do_not_intersect_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - IEnumerable otherCollection = new[] { "two", "three", "four" }; - - // Act - Action action = () => collection.Should().NotIntersectWith(otherCollection, "they should not share items"); - - // Assert - action.Should().Throw() - .WithMessage( - "Did not expect collection to intersect with {\"two\", \"three\", \"four\"} because they should not share items," + - " but found the following shared items {\"two\", \"three\"}."); - } - - [Fact] - public void When_asserting_the_items_in_an_two_intersecting_collections_intersect_it_should_succeed() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - IEnumerable otherCollection = new[] { "three", "four", "five" }; - - // Act / Assert - collection.Should().IntersectWith(otherCollection); - } - - [Fact] - public void When_asserting_the_items_in_an_two_non_intersecting_collections_do_not_intersect_it_should_succeed() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - IEnumerable otherCollection = new[] { "four", "five" }; - - // Act / Assert - collection.Should().NotIntersectWith(otherCollection); - } - - [Fact] - public void When_asserting_the_items_in_an_two_non_intersecting_collections_intersect_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - IEnumerable otherCollection = new[] { "four", "five" }; - - // Act - Action action = () => collection.Should().IntersectWith(otherCollection, "they should share items"); - - // Assert - action.Should().Throw() - .WithMessage("Expected collection to intersect with {\"four\", \"five\"} because they should share items," + - " but {\"one\", \"two\", \"three\"} does not contain any shared items."); - } - - [Fact] - public void When_both_collections_are_null_it_should_succeed() - { - // Arrange - IEnumerable nullColl = null; - - // Act - Action act = () => nullColl.Should().Equal(null); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_both_collections_do_not_have_the_same_number_of_elements_it_should_fail() - { - // Arrange - IEnumerable firstCollection = new[] { "one", "two", "three" }; - IEnumerable secondCollection = new[] { "four", "six" }; - - // Act - Action act = () => firstCollection.Should().HaveSameCount(secondCollection); - - // Assert - act.Should().Throw().WithMessage( - "Expected firstCollection to have 2 item(s), but found 3."); - } - - [Fact] - public void When_both_collections_have_the_same_number_elements_it_should_succeed() - { - // Arrange - IEnumerable firstCollection = new[] { "one", "two", "three" }; - IEnumerable secondCollection = new[] { "four", "five", "six" }; - - // Act / Assert - firstCollection.Should().HaveSameCount(secondCollection); - } - - [Fact] - public void When_collection_contains_an_unexpected_item_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().NotContain("one", "because we {0} like it, but found it anyhow", "don't"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection {\"one\", \"two\", \"three\"} to not contain \"one\" because we don't like it, but found it anyhow."); - } - - [Fact] - public void When_collection_contains_multiple_nulls_that_are_unexpected_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "", null, "", null }; - - // Act - Action act = () => collection.Should().NotContainNulls("because they are {0}", "evil"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection not to contain s*because they are evil*{1, 3}*"); - } - - [Fact] - public void When_collection_contains_null_value_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "one", null, "two", "string" }; - - // Act / Assert - collection.Should().ContainInOrder("one", null, "string"); - } - - [Fact] - public void When_collection_contains_nulls_that_are_unexpected_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "", null }; - - // Act - Action act = () => collection.Should().NotContainNulls("because they are {0}", "evil"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection not to contain s because they are evil, but found one at index 1."); - } - - [Fact] - public void When_collection_count_is_matched_against_a_null_predicate_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().HaveCount(null); - - // Assert - act.Should().Throw().WithMessage( - "Cannot compare collection count against a predicate.*"); - } - - [Fact] - public void When_collection_count_is_matched_against_a_predicate_and_collection_is_null_it_should_throw() - { - // Arrange - IEnumerable collection = null; - - // Act - Action act = - () => collection.Should().HaveCount(c => c < 3, "we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection to contain (c < 3) items because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_collection_count_is_matched_and_collection_is_null_it_should_throw() - { - // Arrange - IEnumerable collection = null; - - // Act - Action act = () => collection.Should().HaveCount(1, "we want to test the behaviour with a null subject"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection to contain 1 item(s) because we want to test the behaviour with a null subject, but found ."); - } - - [Fact] - public void When_collection_does_contain_an_unexpected_item_matching_a_predicate_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().NotContain(item => item == "two", "because {0}s are evil", "two"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection {\"one\", \"two\", \"three\"} to not have any items matching (item == \"two\") because twos are evil,*{\"two\"}*"); - } - - [Fact] - public void When_collection_does_not_contain_an_item_that_is_not_in_the_collection_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().NotContain("four"); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_collection_does_not_contain_an_unexpected_item_matching_a_predicate_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act / Assert - collection.Should().NotContain(item => item == "four"); - } - - [Fact] - public void When_collection_does_not_contain_nulls_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act / Assert - collection.Should().NotContainNulls(); - } - - [Fact] - public void When_collection_does_not_have_an_element_at_the_specific_index_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().HaveElementAt(4, "three", "we put it {0}", "there"); - - // Assert - act.Should().Throw().WithMessage( - "Expected \"three\" at index 4 because we put it there, but found no element."); - } - - [Fact] - public void When_collection_does_not_have_the_expected_element_at_specific_index_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().HaveElementAt(1, "three", "we put it {0}", "there"); - - // Assert - act.Should().Throw().WithMessage( - "Expected \"three\" at index 1 because we put it there, but found \"two\"."); - } - - [Fact] - public void When_collection_has_a_count_larger_than_the_minimum_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act / Assert - collection.Should().HaveCount(c => c >= 3); - } - - [Fact] - public void - When_collection_has_a_count_that_is_different_from_the_number_of_items_it_should_fail_with_descriptive_message_() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action action = () => collection.Should().HaveCount(4, "because we want to test the failure {0}", "message"); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected collection to contain 4 item(s) because we want to test the failure message, but found 3: {\"one\", \"two\", \"three\"}."); - } - - [Fact] - public void When_collection_has_a_count_that_not_matches_the_predicate_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().HaveCount(c => c >= 4, "a minimum of 4 is required"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection to have a count (c >= 4) because a minimum of 4 is required, but count is 3: {\"one\", \"two\", \"three\"}."); - } - - [Fact] - public void When_collection_has_expected_element_at_specific_index_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act / Assert - collection.Should().HaveElementAt(1, "two"); - } - - [Fact] - public void When_collection_is_expected_to_be_null_and_it_is_it_should_not_throw() - { - // Arrange - IEnumerable someCollection = null; - - // Act / Assert - someCollection.Should().BeNull(); - } - - [Fact] - public void When_collection_is_expected_to_be_null_and_it_isnt_it_should_throw() - { - // Arrange - IEnumerable someCollection = new string[0]; - - // Act - Action act = () => someCollection.Should().BeNull("because {0} is valid", "null"); - - // Assert - act.Should().Throw().WithMessage( - "Expected someCollection to be because null is valid, but found {empty}."); - } - - [Fact] - public void When_collection_is_not_a_subset_of_another_it_should_throw_with_the_reason() - { - // Arrange - IEnumerable subset = new[] { "one", "two", "three", "six" }; - IEnumerable superset = new[] { "one", "two", "four", "five" }; - - // Act - Action act = () => subset.Should().BeSubsetOf(superset, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Expected subset to be a subset of {\"one\", \"two\", \"four\", \"five\"} because we want to test the failure message, " + - "but items {\"three\", \"six\"} are not part of the superset."); - } - - [Fact] - public void When_collection_is_not_expected_to_be_null_and_it_is_it_should_throw() - { - // Arrange - IEnumerable someCollection = null; - - // Act - Action act = () => someCollection.Should().NotBeNull("because {0} should not", "someCollection"); - - // Assert - act.Should().Throw().WithMessage( - "Expected someCollection not to be because someCollection should not."); - } - - [Fact] - public void When_collection_is_not_expected_to_be_null_and_it_isnt_it_should_not_throw() - { - // Arrange - IEnumerable someCollection = new string[0]; - - // Act / Assert - someCollection.Should().NotBeNull(); - } - - [Fact] - public void When_collection_is_subset_of_a_specified_collection_it_should_not_throw() - { - // Arrange - IEnumerable subset = new[] { "one", "two" }; - IEnumerable superset = new[] { "one", "two", "three" }; - - // Act / Assert - subset.Should().BeSubsetOf(superset); - } - - [Fact] - public void When_collections_are_unexpectedly_equivalent_it_should_throw() - { - // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "three", "one", "two" }; - - // Act - Action act = () => collection1.Should().NotBeEquivalentTo(collection2); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection1 {\"one\", \"two\", \"three\"} not*equivalent*{\"three\", \"one\", \"two\"}."); - } - - [Fact] - public void When_collections_with_duplicates_are_not_equivalent_it_should_throw() - { - // Arrange - IEnumerable collection1 = new[] { "one", "two", "three", "one" }; - IEnumerable collection2 = new[] { "one", "two", "three", "three" }; - - // Act - Action act = () => collection1.Should().BeEquivalentTo(collection2); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection1[3]*to be \"three\" with a length of 5, but \"one\" has a length of 3*"); - } - - [Fact] - public void When_comparing_item_counts_and_a_reason_is_specified_it_should_it_in_the_exception() - { - // Arrange - IEnumerable firstCollection = new[] { "one", "two", "three" }; - IEnumerable secondCollection = new[] { "four", "six" }; - - // Act - Action act = () => firstCollection.Should().HaveSameCount(secondCollection, "we want to test the {0}", "reason"); - - // Assert - act.Should().Throw().WithMessage( - "Expected firstCollection to have 2 item(s) because we want to test the reason, but found 3."); - } - - [Fact] - public void When_comparing_not_same_item_counts_and_a_reason_is_specified_it_should_it_in_the_exception() - { - // Arrange - IEnumerable firstCollection = new[] { "one", "two", "three" }; - IEnumerable secondCollection = new[] { "four", "five", "six" }; - - // Act - Action act = () => firstCollection.Should().NotHaveSameCount(secondCollection, "we want to test the {0}", "reason"); - - // Assert - act.Should().Throw().WithMessage( - "Expected firstCollection to not have 3 item(s) because we want to test the reason, but found 3."); - } - - [Fact] - public void When_non_empty_collection_is_not_expected_to_be_equivalent_to_an_empty_collection_it_should_succeed() - { - // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new string[0]; - - // Act - Action act = () => collection1.Should().NotBeEquivalentTo(collection2); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_passing_in_null_while_checking_for_ordered_containment_it_should_throw_with_a_clear_explanation() - { - // Act - Action act = () => new[] { "one", "two", "three" }.Should().ContainInOrder(null); - - // Assert - act.Should().Throw().WithMessage( - "Cannot verify ordered containment against a collection.*"); - } - - [Fact] - public void When_testing_collections_not_to_be_equivalent_against_null_collection_it_should_throw() - { - // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = null; - - // Act - Action act = () => collection1.Should().NotBeEquivalentTo(collection2); - - // Assert - act.Should().Throw().WithMessage( - "Cannot verify inequivalence against a collection.*"); - } - - [Fact] - public void When_testing_collections_not_to_be_equivalent_against_same_collection_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - IEnumerable collection1 = collection; - - // Act - Action act = () => collection.Should().NotBeEquivalentTo(collection1, - "because we want to test the behaviour with same objects"); - - // Assert - act.Should().Throw().WithMessage( - "*not to be equivalent*because we want to test the behaviour with same objects*but they both reference the same object."); - } - - [Fact] - public void When_testing_for_equivalence_against_empty_collection_it_should_throw() - { - // Arrange - IEnumerable subject = new[] { "one", "two", "three" }; - IEnumerable otherCollection = new string[0]; - - // Act - Action act = () => subject.Should().BeEquivalentTo(otherCollection); - - // Assert - act.Should().Throw().WithMessage( - "Expected subject*to be a collection with 0 item(s), but*contains 3 item(s)*"); - } - - [Fact] - public void When_testing_for_equivalence_against_null_collection_it_should_throw() - { - // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = null; - - // Act - Action act = () => collection1.Should().BeEquivalentTo(collection2); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection1*to be , but found {\"one\", \"two\", \"three\"}*"); - } - - [Fact] - public void When_the_collection_is_not_empty_unexpectedly_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().BeEmpty("because we want to test the failure {0}", "message"); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected collection to be empty because we want to test the failure message, but found*one*two*three*"); - } - - [Fact] - public void When_the_contents_of_a_collection_are_checked_against_an_empty_collection_it_should_throw_clear_explanation() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().Contain(new string[0]); - - // Assert - act.Should().Throw().WithMessage( - "Cannot verify containment against an empty collection*"); - } - - [Fact] - public void When_the_expected_object_exists_it_should_allow_chaining_additional_assertions() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().Contain("one").Which.Should().HaveLength(4); - - // Assert - act.Should().Throw().WithMessage("Expected*length*4*3*"); - } - - [Fact] - public void When_the_first_collection_contains_a_duplicate_item_without_affecting_the_order_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three", "two" }; - - // Act / Assert - collection.Should().ContainInOrder("one", "two", "three"); - } - - [Fact] - public void When_two_collections_are_both_empty_it_should_treat_them_as_equivalent() - { - // Arrange - IEnumerable subject = new string[0]; - IEnumerable otherCollection = new string[0]; - - // Act - Action act = () => subject.Should().BeEquivalentTo(otherCollection); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_two_collections_are_not_equal_because_one_item_differs_it_should_throw_using_the_reason() - { - // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "one", "two", "five" }; - - // Act - Action act = () => collection1.Should().Equal(collection2, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection1 to be equal to {\"one\", \"two\", \"five\"} because we want to test the failure message, but {\"one\", \"two\", \"three\"} differs at index 2."); - } - - [Fact] - public void - When_two_collections_are_not_equal_because_the_actual_collection_contains_less_items_it_should_throw_using_the_reason() - { - // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "one", "two", "three", "four" }; - - // Act - Action act = () => collection1.Should().Equal(collection2, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection1 to be equal to {\"one\", \"two\", \"three\", \"four\"} because we want to test the failure message, but {\"one\", \"two\", \"three\"} contains 1 item(s) less."); - } - - [Fact] - public void - When_two_collections_are_not_equal_because_the_actual_collection_contains_more_items_it_should_throw_using_the_reason() - { - // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "one", "two" }; - - // Act - Action act = () => collection1.Should().Equal(collection2, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection1 to be equal to {\"one\", \"two\"} because we want to test the failure message, but {\"one\", \"two\", \"three\"} contains 1 item(s) too many."); - } - - [Fact] - public void When_two_collections_contain_the_same_duplicate_items_in_the_same_order_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "one", "two", "twelve", "two", "two" }; - - // Act / Assert - collection.Should().ContainInOrder("one", "two", "one", "two", "twelve", "two", "two"); - } - - [Fact] - public void When_two_collections_contain_the_same_elements_it_should_treat_them_as_equivalent() - { - // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "three", "two", "one" }; - - // Act / Assert - collection1.Should().BeEquivalentTo(collection2); - } - - [Fact] - public void When_two_arrays_contain_the_same_elements_it_should_treat_them_as_equivalent() - { - // Arrange - string[] array1 = { "one", "two", "three" }; - string[] array2 = { "three", "two", "one" }; - - // Act / Assert - array1.Should().BeEquivalentTo(array2); - } - - [Fact] - public void When_two_collections_contain_the_same_items_but_in_different_order_it_should_throw_with_a_clear_explanation() - { - // Act - Action act = () => - new[] { "one", "two", "three" }.Should().ContainInOrder(new[] { "three", "one" }, "because we said so"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection {\"one\", \"two\", \"three\"} to contain items {\"three\", \"one\"} in order because we said so, but \"one\" (index 1) did not appear (in the right order)."); - } - - [Fact] - public void When_two_collections_contain_the_same_items_in_the_same_order_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "two", "three" }; - - // Act / Assert - collection.Should().ContainInOrder("one", "two", "three"); - } - - [Fact] - public void When_two_collections_contain_the_same_items_but_in_different_order_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act / Assert - collection.Should().NotContainInOrder("two", "one"); - } - - [Fact] - public void When_a_collection_does_not_contain_an_ordered_item_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act / Assert - collection.Should().NotContainInOrder("four", "one"); - } - - [Fact] - public void When_a_collection_contains_less_items_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two" }; - - // Act / Assert - collection.Should().NotContainInOrder("one", "two", "three"); - } - - [Fact] - public void When_a_collection_does_not_contain_a_range_twice_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "one", "three", "twelve", "two", "two" }; - - // Act / Assert - collection.Should().NotContainInOrder("one", "two", "one", "one", "two"); - } - - [Fact] - public void When_asserting_collection_does_not_contain_some_values_in_order_but_collection_is_null_it_should_throw() - { - // Arrange - IEnumerable collection = null; - - // Act - Action act = () => collection.Should().NotContainInOrder("four"); - - // Assert - act.Should().Throw().WithMessage("Cannot verify absence of ordered containment in a collection."); - } - - [Fact] - public void When_two_collections_contain_the_same_items_in_the_same_order_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "two", "three" }; - - // Act - Action act = () => collection.Should().NotContainInOrder(new[] { "one", "two", "three" }, "that's what we expect"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection {\"one\", \"two\", \"two\", \"three\"} to not contain items {\"one\", \"two\", \"three\"} " + - "in order because that's what we expect, but items appeared in order ending at index 3."); - } - - [Fact] - public void When_collection_contains_contain_the_same_items_in_the_same_order_with_null_value_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", null, "two", "three" }; - - // Act - Action act = () => collection.Should().NotContainInOrder("one", null, "three"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection {\"one\", , \"two\", \"three\"} to not contain items {\"one\", , \"three\"} in order, " + - "but items appeared in order ending at index 3."); - } - - [Fact] - public void When_the_first_collection_contains_a_duplicate_item_without_affecting_the_order_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three", "two" }; - - // Act - Action act = () => collection.Should().NotContainInOrder("one", "two", "three"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection {\"one\", \"two\", \"three\", \"two\"} to not contain items {\"one\", \"two\", \"three\"} in order, " + - "but items appeared in order ending at index 2."); - } - - [Fact] - public void When_two_collections_contain_the_same_duplicate_items_in_the_same_order_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "one", "twelve", "two" }; - - // Act - Action act = () => collection.Should().NotContainInOrder("one", "two", "one", "twelve", "two"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection {\"one\", \"two\", \"one\", \"twelve\", \"two\"} to not contain items " + - "{\"one\", \"two\", \"one\", \"twelve\", \"two\"} in order, but items appeared in order ending at index 4."); - } - - [Fact] - public void When_passing_in_null_while_checking_for_absence_of_ordered_containment_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection.Should().NotContainInOrder(null); - - // Assert - act.Should().Throw().WithMessage( - "Cannot verify absence of ordered containment against a collection.*"); - } - - [Fact] - public void When_two_collections_containing_nulls_are_equal_it_should_not_throw() - { - // Arrange - var subject = new List { "aaa", null }; - var expected = new List { "aaa", null }; - - // Act - Action action = () => subject.Should().Equal(expected); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void When_two_equal_collections_are_not_expected_to_be_equal_it_should_report_a_clear_explanation() - { - // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection1.Should().NotEqual(collection2, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Did not expect collections {\"one\", \"two\", \"three\"} and {\"one\", \"two\", \"three\"} to be equal because we want to test the failure message."); - } - - [Fact] - public void When_two_equal_collections_are_not_expected_to_be_equal_it_should_throw() - { - // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "one", "two", "three" }; - - // Act - Action act = () => collection1.Should().NotEqual(collection2); - - // Assert - act.Should().Throw().WithMessage( - "Did not expect collections {\"one\", \"two\", \"three\"} and {\"one\", \"two\", \"three\"} to be equal."); - } - [Fact] public void When_using_StringCollectionAssertions_the_AndConstraint_should_have_the_correct_type() { @@ -1691,304 +38,6 @@ from method in methodInfo methods.Should().OnlyContain(method => expectedTypes.Any(e => e.IsAssignableFrom(method.ReturnType))); } - #region ContainMatch - - [Fact] - public void When_collection_contains_a_match_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; - - // Act - Action action = () => collection.Should().ContainMatch("* failed"); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void When_collection_contains_multiple_matches_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "build succeded", "test failed", "pack failed" }; - - // Act - Action action = () => collection.Should().ContainMatch("* failed"); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void When_collection_contains_multiple_matches_which_should_throw() - { - // Arrange - IEnumerable collection = new[] { "build succeded", "test failed", "pack failed" }; - - // Act - Action action = () => _ = collection.Should().ContainMatch("* failed").Which; - - // Assert - action.Should().Throw() - .WithMessage("More than one object found. FluentAssertions cannot determine which object is meant.*") - .WithMessage("*Found objects:*\"test failed\"*\"pack failed\""); - } - - [Fact] - public void When_collection_does_not_contain_a_match_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; - - // Act - Action action = () => collection.Should().ContainMatch("* stopped", "because {0}", "we do"); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected collection {\"build succeded\", \"test failed\"} to contain a match of \"* stopped\" because we do."); - } - - [Fact] - public void When_collection_contains_a_match_that_differs_in_casing_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; - - // Act - Action action = () => collection.Should().ContainMatch("* Failed"); - - // Assert - action.Should().Throw() - .WithMessage("Expected collection {\"build succeded\", \"test failed\"} to contain a match of \"* Failed\"."); - } - - [Fact] - public void When_asserting_empty_collection_for_match_it_should_throw() - { - // Arrange - IEnumerable collection = new string[] { }; - - // Act - Action action = () => collection.Should().ContainMatch("* failed"); - - // Assert - action.Should().Throw() - .WithMessage("Expected collection {empty} to contain a match of \"* failed\"."); - } - - [Fact] - public void When_asserting_null_collection_for_match_it_should_throw() - { - // Arrange - IEnumerable collection = null; - - // Act - Action action = () => - { - using var _ = new AssertionScope(); - collection.Should().ContainMatch("* failed", "because {0}", "we do"); - }; - - // Assert - action.Should().Throw() - .WithMessage("Expected collection to contain a match of \"* failed\" because we do, but found ."); - } - - [Fact] - public void When_asserting_collection_to_have_null_match_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; - - // Act - Action action = () => collection.Should().ContainMatch(null); - - // Assert - action.Should().Throw() - .WithMessage( - "Cannot match strings in collection against . Provide a wildcard pattern or use the Contain method.*") - .WithParameterName("wildcardPattern"); - } - - [Fact] - public void When_asserting_collection_to_have_empty_string_match_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; - - // Act - Action action = () => collection.Should().ContainMatch(string.Empty); - - // Assert - action.Should().Throw() - .WithMessage( - "Cannot match strings in collection against an empty string. Provide a wildcard pattern or use the Contain method.*") - .WithParameterName("wildcardPattern"); - } - - #endregion - - #region NotContainMatch - - [Fact] - public void When_collection_doesnt_contain_a_match_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "build succeded", "test" }; - - // Act - Action action = () => collection.Should().NotContainMatch("* failed"); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void When_collection_doesnt_contain_multiple_matches_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "build succeded", "test", "pack" }; - - // Act - Action action = () => collection.Should().NotContainMatch("* failed"); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void When_collection_contains_a_match_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; - - // Act - Action action = () => collection.Should().NotContainMatch("* failed", "because {0}", "it shouldn't"); - - // Assert - action.Should().Throw() - .WithMessage( - "Did not expect collection {\"build succeded\", \"test failed\"} to contain a match of \"* failed\" because it shouldn't."); - } - - [Fact] - public void When_collection_contains_multiple_matches_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "build failed", "test failed" }; - - // Act - Action action = () => collection.Should().NotContainMatch("* failed", "because {0}", "it shouldn't"); - - // Assert - action.Should().Throw() - .WithMessage( - "Did not expect collection {\"build failed\", \"test failed\"} to contain a match of \"* failed\" because it shouldn't."); - } - - [Fact] - public void When_collection_contains_a_match_with_different_casing_it_should_not_throw() - { - // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; - - // Act - Action action = () => collection.Should().NotContainMatch("* Failed"); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void When_asserting_collection_to_not_have_null_match_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; - - // Act - Action action = () => collection.Should().NotContainMatch(null); - - // Assert - action.Should().Throw() - .WithMessage( - "Cannot match strings in collection against . Provide a wildcard pattern or use the NotContain method.*") - .WithParameterName("wildcardPattern"); - } - - [Fact] - public void When_asserting_collection_to_not_have_empty_string_match_it_should_throw() - { - // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; - - // Act - Action action = () => collection.Should().NotContainMatch(string.Empty); - - // Assert - action.Should().Throw() - .WithMessage( - "Cannot match strings in collection against an empty string. Provide a wildcard pattern or use the NotContain method.*") - .WithParameterName("wildcardPattern"); - } - - [Fact] - public void When_asserting_null_collection_to_not_have_null_match_it_should_throw() - { - // Arrange - IEnumerable collection = null; - - // Act - Action action = () => - { - using var _ = new AssertionScope(); - collection.Should().NotContainMatch("* Failed", "we want to test the failure {0}", "message"); - }; - - // Assert - action.Should().Throw() - .WithMessage("Did not expect collection to contain a match of \"* failed\" *failure message*, but found ."); - } - - #endregion - - #region SatisfyRespectively - - [Fact] - public void When_string_collection_satisfies_all_inspectors_it_should_succeed() - { - // Arrange - string[] collection = { "John", "Jane" }; - - // Act / Assert - collection.Should().SatisfyRespectively( - value => value.Should().Be("John"), - value => value.Should().Be("Jane") - ); - } - - [Fact] - public void When_string_collection_does_not_satisfy_all_inspectors_it_should_throw() - { - // Arrange - string[] collection = { "Jack", "Jessica" }; - - // Act - Action act = () => collection.Should().SatisfyRespectively(new Action[] - { - value => value.Should().Be("John"), - value => value.Should().Be("Jane") - }, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Expected collection to satisfy all inspectors because we want to test the failure message, but some inspectors are not satisfied" - + "*John*Jack" - + "*Jane*Jessica*"); - } - - #endregion - [Fact] public void When_accidentally_using_equals_it_should_throw_a_helpful_error() { From 1329a39b9fae1d8d72c033edea598ea01da85709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Wed, 1 Nov 2023 16:06:59 +0100 Subject: [PATCH 151/845] Split DateTimeOffsetAssertionSpecs (#2426) --- .../DateTimeOffsetAssertionSpecs.Be.cs | 266 ++ .../DateTimeOffsetAssertionSpecs.BeAfter.cs | 101 + .../DateTimeOffsetAssertionSpecs.BeAtLeast.cs | 76 + .../DateTimeOffsetAssertionSpecs.BeBefore.cs | 101 + .../DateTimeOffsetAssertionSpecs.BeCloseTo.cs | 437 +++ .../DateTimeOffsetAssertionSpecs.BeExactly.cs | 233 ++ ...DateTimeOffsetAssertionSpecs.BeLessThan.cs | 86 + ...DateTimeOffsetAssertionSpecs.BeMoreThan.cs | 70 + .../DateTimeOffsetAssertionSpecs.BeNull.cs | 69 + ...ateTimeOffsetAssertionSpecs.BeOnOrAfter.cs | 101 + ...teTimeOffsetAssertionSpecs.BeOnOrBefore.cs | 103 + .../DateTimeOffsetAssertionSpecs.BeOneOf.cs | 129 + ...teTimeOffsetAssertionSpecs.BeSameDateAs.cs | 159 + .../DateTimeOffsetAssertionSpecs.BeWithin.cs | 108 + .../DateTimeOffsetAssertionSpecs.HaveDay.cs | 102 + .../DateTimeOffsetAssertionSpecs.HaveHour.cs | 102 + ...DateTimeOffsetAssertionSpecs.HaveMinute.cs | 102 + .../DateTimeOffsetAssertionSpecs.HaveMonth.cs | 102 + ...DateTimeOffsetAssertionSpecs.HaveOffset.cs | 102 + ...DateTimeOffsetAssertionSpecs.HaveSecond.cs | 102 + .../DateTimeOffsetAssertionSpecs.HaveValue.cs | 69 + .../DateTimeOffsetAssertionSpecs.HaveYear.cs | 102 + .../DateTimeOffsetAssertionSpecs.cs | 2626 +---------------- 23 files changed, 2823 insertions(+), 2625 deletions(-) create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.Be.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeAfter.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeAtLeast.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeBefore.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeCloseTo.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeExactly.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeLessThan.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeMoreThan.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeNull.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeOnOrAfter.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeOnOrBefore.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeOneOf.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeSameDateAs.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeWithin.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveDay.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveHour.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveMinute.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveMonth.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveOffset.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveSecond.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveValue.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveYear.cs diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.Be.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.Be.cs new file mode 100644 index 0000000000..3ee00fe022 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.Be.cs @@ -0,0 +1,266 @@ +using System; +using FluentAssertions.Common; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class Be + { + [Fact] + public void Should_succeed_when_asserting_datetimeoffset_value_is_equal_to_the_same_value() + { + // Arrange + DateTimeOffset dateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); + DateTimeOffset sameDateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); + + // Act + Action act = () => dateTime.Should().Be(sameDateTime); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_datetimeoffset_value_is_equal_to_the_same_nullable_value_be_should_succeed() + { + // Arrange + DateTimeOffset dateTime = 4.June(2016).ToDateTimeOffset(); + DateTimeOffset? sameDateTime = 4.June(2016).ToDateTimeOffset(); + + // Act + Action act = () => dateTime.Should().Be(sameDateTime); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_both_values_are_at_their_minimum_then_it_should_succeed() + { + // Arrange + DateTimeOffset dateTime = DateTimeOffset.MinValue; + DateTimeOffset sameDateTime = DateTimeOffset.MinValue; + + // Act + Action act = () => dateTime.Should().Be(sameDateTime); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_both_values_are_at_their_maximum_then_it_should_succeed() + { + // Arrange + DateTimeOffset dateTime = DateTimeOffset.MaxValue; + DateTimeOffset sameDateTime = DateTimeOffset.MaxValue; + + // Act + Action act = () => dateTime.Should().Be(sameDateTime); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void Should_fail_when_asserting_datetimeoffset_value_is_equal_to_the_different_value() + { + // Arrange + var dateTime = 10.March(2012).WithOffset(1.Hours()); + var otherDateTime = 11.March(2012).WithOffset(1.Hours()); + + // Act + Action act = () => dateTime.Should().Be(otherDateTime, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dateTime to represent the same point in time as <2012-03-11 +1h>*failure message, but <2012-03-10 +1h> does not."); + } + + [Fact] + public void When_datetimeoffset_value_is_equal_to_the_different_nullable_value_be_should_failed() + { + // Arrange + DateTimeOffset dateTime = 10.March(2012).WithOffset(1.Hours()); + DateTimeOffset? otherDateTime = 11.March(2012).WithOffset(1.Hours()); + + // Act + Action act = () => dateTime.Should().Be(otherDateTime, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dateTime to represent the same point in time as <2012-03-11 +1h>*failure message, but <2012-03-10 +1h> does not."); + } + + [Fact] + public void Should_succeed_when_asserting_nullable_datetimeoffset_value_equals_the_same_value() + { + // Arrange + DateTimeOffset? nullableDateTimeA = new DateTime(2016, 06, 04).ToDateTimeOffset(); + DateTimeOffset? nullableDateTimeB = new DateTime(2016, 06, 04).ToDateTimeOffset(); + + // Act + Action action = () => + nullableDateTimeA.Should().Be(nullableDateTimeB); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void Should_succeed_when_asserting_nullable_datetimeoffset_null_value_equals_null() + { + // Arrange + DateTimeOffset? nullableDateTimeA = null; + DateTimeOffset? nullableDateTimeB = null; + + // Act / Assert + nullableDateTimeA.Should().Be(nullableDateTimeB); + } + + [Fact] + public void Should_fail_when_asserting_nullable_datetimeoffset_value_equals_a_different_value() + { + // Arrange + DateTimeOffset? nullableDateTimeA = new DateTime(2016, 06, 04).ToDateTimeOffset(); + DateTimeOffset? nullableDateTimeB = new DateTime(2016, 06, 06).ToDateTimeOffset(); + + // Act + Action action = () => + nullableDateTimeA.Should().Be(nullableDateTimeB); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void Should_fail_with_descriptive_message_when_asserting_datetimeoffset_null_value_is_equal_to_another_value() + { + // Arrange + DateTimeOffset? nullableDateTime = null; + DateTimeOffset expectation = 27.March(2016).ToDateTimeOffset(1.Hours()); + + // Act + Action action = () => + nullableDateTime.Should().Be(expectation, "because we want to test the failure {0}", "message"); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected nullableDateTime to represent the same point in time as <2016-03-27 +1h> because we want to test the failure message, but found a DateTimeOffset."); + } + + [Fact] + public void Should_fail_with_descriptive_message_when_asserting_non_null_value_is_equal_to_null_value() + { + // Arrange + DateTimeOffset? nullableDateTime = 27.March(2016).ToDateTimeOffset(1.Hours()); + DateTimeOffset? expectation = null; + + // Act + Action action = () => + nullableDateTime.Should().Be(expectation, "because we want to test the failure {0}", "message"); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected nullableDateTime to be because we want to test the failure message, but it was <2016-03-27 +1h>."); + } + + [Fact] + public void + When_asserting_different_date_time_offsets_representing_the_same_world_time_it_should_succeed() + { + // Arrange + var specificDate = 1.May(2008).At(6, 32); + + var dateWithFiveHourOffset = new DateTimeOffset(specificDate - 5.Hours(), -5.Hours()); + + var dateWithSixHourOffset = new DateTimeOffset(specificDate - 6.Hours(), -6.Hours()); + + // Act / Assert + dateWithFiveHourOffset.Should().Be(dateWithSixHourOffset); + } + } + + public class NotBe + { + [Fact] + public void Should_succeed_when_asserting_datetimeoffset_value_is_not_equal_to_a_different_value() + { + // Arrange + DateTimeOffset dateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); + DateTimeOffset otherDateTime = new DateTime(2016, 06, 05).ToDateTimeOffset(); + + // Act + Action act = () => dateTime.Should().NotBe(otherDateTime); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_datetimeoffset_value_is_not_equal_to_a_nullable_different_value_notbe_should_succeed() + { + // Arrange + DateTimeOffset dateTime = 4.June(2016).ToDateTimeOffset(); + DateTimeOffset? otherDateTime = 5.June(2016).ToDateTimeOffset(); + + // Act + Action act = () => dateTime.Should().NotBe(otherDateTime); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void Should_fail_when_asserting_datetimeoffset_value_is_not_equal_to_the_same_value() + { + // Arrange + var dateTime = new DateTimeOffset(10.March(2012), 1.Hours()); + var sameDateTime = new DateTimeOffset(10.March(2012), 1.Hours()); + + // Act + Action act = + () => dateTime.Should().NotBe(sameDateTime, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect dateTime to represent the same point in time as <2012-03-10 +1h> because we want to test the failure message, but it did."); + } + + [Fact] + public void When_datetimeoffset_value_is_not_equal_to_the_same_nullable_value_notbe_should_failed() + { + // Arrange + DateTimeOffset dateTime = new(10.March(2012), 1.Hours()); + DateTimeOffset? sameDateTime = new DateTimeOffset(10.March(2012), 1.Hours()); + + // Act + Action act = + () => dateTime.Should().NotBe(sameDateTime, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect dateTime to represent the same point in time as <2012-03-10 +1h> because we want to test the failure message, but it did."); + } + + [Fact] + public void + When_asserting_different_date_time_offsets_representing_different_world_times_it_should_not_succeed() + { + // Arrange + var specificDate = 1.May(2008).At(6, 32); + + var dateWithZeroHourOffset = new DateTimeOffset(specificDate, TimeSpan.Zero); + var dateWithOneHourOffset = new DateTimeOffset(specificDate, 1.Hours()); + + // Act / Assert + dateWithZeroHourOffset.Should().NotBe(dateWithOneHourOffset); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeAfter.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeAfter.cs new file mode 100644 index 0000000000..acb0b57e2f --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeAfter.cs @@ -0,0 +1,101 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class BeAfter + { + [Fact] + public void When_asserting_subject_datetimeoffset_is_after_earlier_expected_datetimeoffset_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 03), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().BeAfter(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_after_later_expected_datetimeoffset_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 05), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().BeAfter(expectation); + + // Assert + act.Should().Throw().WithMessage( + "Expected subject to be after <2016-06-05 +0h>, but it was <2016-06-04 +0h>."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_after_the_same_expected_datetimeoffset_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().BeAfter(expectation); + + // Assert + act.Should().Throw().WithMessage( + "Expected subject to be after <2016-06-04 +0h>, but it was <2016-06-04 +0h>."); + } + } + + public class NotBeAfter + { + [Fact] + public void When_asserting_subject_datetimeoffset_is_not_after_earlier_expected_datetimeoffset_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 03), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotBeAfter(expectation); + + // Assert + act.Should().Throw().WithMessage( + "Expected subject to be on or before <2016-06-03 +0h>, but it was <2016-06-04 +0h>."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_not_after_later_expected_datetimeoffset_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 05), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotBeAfter(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_not_after_the_same_expected_datetimeoffset_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotBeAfter(expectation); + + // Assert + act.Should().NotThrow(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeAtLeast.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeAtLeast.cs new file mode 100644 index 0000000000..84d0d68168 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeAtLeast.cs @@ -0,0 +1,76 @@ +using System; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class BeAtLeast + { + [Fact] + public void When_date_is_not_at_least_one_day_before_another_it_should_throw() + { + // Arrange + var target = new DateTimeOffset(2.October(2009), 0.Hours()); + DateTimeOffset subject = target - 23.Hours(); + + // Act + Action act = () => subject.Should().BeAtLeast(TimeSpan.FromDays(1)).Before(target, "we like {0}", "that"); + + // Assert + act.Should().Throw().WithMessage( + "Expected subject <2009-10-01 01:00:00 +0h> to be at least 1d before <2009-10-02 +0h> because we like that, but it is behind by 23h."); + } + + [Fact] + public void When_date_is_at_least_one_day_before_another_it_should_not_throw() + { + // Arrange + var target = new DateTimeOffset(2.October(2009)); + DateTimeOffset subject = target - 24.Hours(); + + // Act / Assert + subject.Should().BeAtLeast(TimeSpan.FromDays(1)).Before(target); + } + + [Theory] + [InlineData(30, 20)] // edge case + [InlineData(30, 15)] + public void When_asserting_subject_be_at_least_10_seconds_after_target_but_subject_is_before_target_it_should_throw( + int targetSeconds, int subjectSeconds) + { + // Arrange + var expectation = 1.January(0001).At(0, 0, targetSeconds).WithOffset(0.Hours()); + var subject = 1.January(0001).At(0, 0, subjectSeconds).WithOffset(0.Hours()); + + // Act + Action action = () => subject.Should().BeAtLeast(10.Seconds()).After(expectation); + + // Assert + action.Should().Throw() + .WithMessage( + $"Expected subject <00:00:{subjectSeconds} +0h> to be at least 10s after <00:00:30 +0h>, but it is behind by {Math.Abs(subjectSeconds - targetSeconds)}s."); + } + + [Theory] + [InlineData(30, 40)] // edge case + [InlineData(30, 45)] + public void When_asserting_subject_be_at_least_10_seconds_before_target_but_subject_is_after_target_it_should_throw( + int targetSeconds, int subjectSeconds) + { + // Arrange + var expectation = 1.January(0001).At(0, 0, targetSeconds).WithOffset(0.Hours()); + var subject = 1.January(0001).At(0, 0, subjectSeconds).WithOffset(0.Hours()); + + // Act + Action action = () => subject.Should().BeAtLeast(10.Seconds()).Before(expectation); + + // Assert + action.Should().Throw() + .WithMessage( + $"Expected subject <00:00:{subjectSeconds} +0h> to be at least 10s before <00:00:30 +0h>, but it is ahead by {Math.Abs(subjectSeconds - targetSeconds)}s."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeBefore.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeBefore.cs new file mode 100644 index 0000000000..f1bd84fa24 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeBefore.cs @@ -0,0 +1,101 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class BeBefore + { + [Fact] + public void When_asserting_a_point_of_time_is_before_a_later_point_it_should_succeed() + { + // Arrange + DateTimeOffset earlierDate = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset laterDate = new(new DateTime(2016, 06, 04, 0, 5, 0), TimeSpan.Zero); + + // Act + Action act = () => earlierDate.Should().BeBefore(laterDate); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_is_before_earlier_expected_datetimeoffset_it_should_throw() + { + // Arrange + DateTimeOffset expected = new(new DateTime(2016, 06, 03), TimeSpan.Zero); + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().BeBefore(expected); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be before <2016-06-03 +0h>, but it was <2016-06-04 +0h>."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_before_the_same_datetimeoffset_it_should_throw() + { + // Arrange + DateTimeOffset expected = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().BeBefore(expected); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be before <2016-06-04 +0h>, but it was <2016-06-04 +0h>."); + } + } + + public class NotBeBefore + { + [Fact] + public void When_asserting_a_point_of_time_is_not_before_another_it_should_throw() + { + // Arrange + DateTimeOffset earlierDate = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset laterDate = new(new DateTime(2016, 06, 04, 0, 5, 0), TimeSpan.Zero); + + // Act + Action act = () => earlierDate.Should().NotBeBefore(laterDate); + + // Assert + act.Should().Throw().WithMessage( + "Expected earlierDate to be on or after <2016-06-04 00:05:00 +0h>, but it was <2016-06-04 +0h>."); + } + + [Fact] + public void When_asserting_subject_is_not_before_earlier_expected_datetimeoffset_it_should_succeed() + { + // Arrange + DateTimeOffset expected = new(new DateTime(2016, 06, 03), TimeSpan.Zero); + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotBeBefore(expected); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_not_before_the_same_datetimeoffset_it_should_succeed() + { + // Arrange + DateTimeOffset expected = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotBeBefore(expected); + + // Assert + act.Should().NotThrow(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeCloseTo.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeCloseTo.cs new file mode 100644 index 0000000000..74de68e3ea --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeCloseTo.cs @@ -0,0 +1,437 @@ +using System; +using FluentAssertions.Common; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class BeCloseTo + { + [Fact] + public void When_asserting_that_time_is_close_to_a_negative_precision_it_should_throw() + { + // Arrange + var dateTime = DateTimeOffset.UtcNow; + var actual = new DateTimeOffset(dateTime.Ticks - 1, TimeSpan.Zero); + + // Act + Action act = () => actual.Should().BeCloseTo(dateTime, -1.Ticks()); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_a_datetimeoffset_is_close_to_a_later_datetimeoffset_by_one_tick_it_should_succeed() + { + // Arrange + var dateTime = DateTimeOffset.UtcNow; + var actual = new DateTimeOffset(dateTime.Ticks - 1, TimeSpan.Zero); + + // Act + Action act = () => actual.Should().BeCloseTo(dateTime, TimeSpan.FromTicks(1)); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_datetimeoffset_is_close_to_an_earlier_datetimeoffset_by_one_tick_it_should_succeed() + { + // Arrange + var dateTime = DateTimeOffset.UtcNow; + var actual = new DateTimeOffset(dateTime.Ticks + 1, TimeSpan.Zero); + + // Act + Action act = () => actual.Should().BeCloseTo(dateTime, TimeSpan.FromTicks(1)); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_datetimeoffset_is_close_to_a_MinValue_by_one_tick_it_should_succeed() + { + // Arrange + var dateTime = DateTimeOffset.MinValue; + var actual = new DateTimeOffset(dateTime.Ticks + 1, TimeSpan.Zero); + + // Act + Action act = () => actual.Should().BeCloseTo(dateTime, TimeSpan.FromTicks(1)); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_datetimeoffset_is_close_to_a_MaxValue_by_one_tick_it_should_succeed() + { + // Arrange + var dateTime = DateTimeOffset.MaxValue; + var actual = new DateTimeOffset(dateTime.Ticks - 1, TimeSpan.Zero); + + // Act + Action act = () => actual.Should().BeCloseTo(dateTime, TimeSpan.FromTicks(1)); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_close_to_a_later_datetimeoffset_it_should_succeed() + { + // Arrange + DateTimeOffset time = new(2016, 06, 04, 12, 15, 30, 980, TimeSpan.Zero); + DateTimeOffset nearbyTime = new(2016, 06, 04, 12, 15, 31, 0, TimeSpan.Zero); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_close_to_an_earlier_datetimeoffset_it_should_succeed() + { + // Arrange + DateTimeOffset time = new(2016, 06, 04, 12, 15, 31, 020, TimeSpan.Zero); + DateTimeOffset nearbyTime = new(2016, 06, 04, 12, 15, 31, 0, TimeSpan.Zero); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void + When_asserting_subject_datetimeoffset_is_close_to_another_value_that_is_later_by_more_than_20ms_it_should_throw() + { + // Arrange + DateTimeOffset time = 13.March(2012).At(12, 15, 30, 979).ToDateTimeOffset(1.Hours()); + DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).ToDateTimeOffset(1.Hours()); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected time to be within 20ms from <2012-03-13 12:15:31 +1H>, but <2012-03-13 12:15:30.979 +1H> was off by 21ms."); + } + + [Fact] + public void + When_asserting_subject_datetimeoffset_is_close_to_another_value_that_is_earlier_by_more_than_20ms_it_should_throw() + { + // Arrange + DateTimeOffset time = 13.March(2012).At(12, 15, 31, 021).ToDateTimeOffset(1.Hours()); + DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).ToDateTimeOffset(1.Hours()); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected time to be within 20ms from <2012-03-13 12:15:31 +1h>, but <2012-03-13 12:15:31.021 +1h> was off by 21ms."); + } + + [Fact] + public void + When_asserting_subject_datetimeoffset_is_close_to_another_value_that_is_earlier_by_more_than_a_35ms_timespan_it_should_throw() + { + // Arrange + DateTimeOffset time = 13.March(2012).At(12, 15, 31, 036).WithOffset(1.Hours()); + DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).WithOffset(1.Hours()); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, TimeSpan.FromMilliseconds(35)); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected time to be within 35ms from <2012-03-13 12:15:31 +1h>, but <2012-03-13 12:15:31.036 +1h> was off by 36ms."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_close_to_an_earlier_datetimeoffset_by_35ms_it_should_succeed() + { + // Arrange + DateTimeOffset time = 13.March(2012).At(12, 15, 31, 035).ToDateTimeOffset(1.Hours()); + DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).ToDateTimeOffset(1.Hours()); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 35.Milliseconds()); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_is_close_to_another_it_should_throw() + { + // Arrange + DateTimeOffset? time = null; + DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).ToDateTimeOffset(5.Hours()); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 35.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage("Expected*, but found ."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_close_to_the_maximum_datetimeoffset_it_should_succeed() + { + // Arrange + DateTimeOffset time = DateTimeOffset.MaxValue - 50.Milliseconds(); + DateTimeOffset nearbyTime = DateTimeOffset.MaxValue; + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 100.Milliseconds()); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_close_to_the_minimum_datetimeoffset_it_should_succeed() + { + // Arrange + DateTimeOffset time = DateTimeOffset.MinValue + 50.Milliseconds(); + DateTimeOffset nearbyTime = DateTimeOffset.MinValue; + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 100.Milliseconds()); + + // Assert + act.Should().NotThrow(); + } + } + + public class NotBeCloseTo + { + [Fact] + public void When_asserting_that_time_is_not_close_to_a_negative_precision_it_should_throw() + { + // Arrange + var dateTime = DateTimeOffset.UtcNow; + var actual = new DateTimeOffset(dateTime.Ticks - 1, TimeSpan.Zero); + + // Act + Action act = () => actual.Should().NotBeCloseTo(dateTime, -1.Ticks()); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_a_datetimeoffset_is_close_to_a_later_datetimeoffset_by_one_tick_it_should_fail() + { + // Arrange + var dateTime = DateTimeOffset.UtcNow; + var actual = new DateTimeOffset(dateTime.Ticks - 1, TimeSpan.Zero); + + // Act + Action act = () => actual.Should().NotBeCloseTo(dateTime, TimeSpan.FromTicks(1)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_datetimeoffset_is_close_to_an_earlier_datetimeoffset_by_one_tick_it_should_fail() + { + // Arrange + var dateTime = DateTimeOffset.UtcNow; + var actual = new DateTimeOffset(dateTime.Ticks + 1, TimeSpan.Zero); + + // Act + Action act = () => actual.Should().NotBeCloseTo(dateTime, TimeSpan.FromTicks(1)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_datetimeoffset_is_close_to_a_MinValue_by_one_tick_it_should_fail() + { + // Arrange + var dateTime = DateTimeOffset.MinValue; + var actual = new DateTimeOffset(dateTime.Ticks + 1, TimeSpan.Zero); + + // Act + Action act = () => actual.Should().NotBeCloseTo(dateTime, TimeSpan.FromTicks(1)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_datetimeoffset_is_close_to_a_MaxValue_by_one_tick_it_should_fail() + { + // Arrange + var dateTime = DateTimeOffset.MaxValue; + var actual = new DateTimeOffset(dateTime.Ticks - 1, TimeSpan.Zero); + + // Act + Action act = () => actual.Should().NotBeCloseTo(dateTime, TimeSpan.FromTicks(1)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_not_close_to_a_later_datetimeoffset_it_should_throw() + { + // Arrange + DateTimeOffset time = new(2016, 06, 04, 12, 15, 30, 980, TimeSpan.Zero); + DateTimeOffset nearbyTime = new(2016, 06, 04, 12, 15, 31, 0, TimeSpan.Zero); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage( + "Did not expect time to be within 20ms from <2016-06-04 12:15:31 +0h>, but it was <2016-06-04 12:15:30.980 +0h>."); + } + + [Fact] + public void + When_asserting_subject_datetimeoffset_is_not_close_to_a_later_datetimeoffset_by_a_20ms_timespan_it_should_throw() + { + // Arrange + DateTimeOffset time = new(2016, 06, 04, 12, 15, 30, 980, TimeSpan.Zero); + DateTimeOffset nearbyTime = new(2016, 06, 04, 12, 15, 31, 0, TimeSpan.Zero); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, TimeSpan.FromMilliseconds(20)); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect time to be within 20ms from <2016-06-04 12:15:31 +0h>, but it was <2016-06-04 12:15:30.980 +0h>."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_not_close_to_an_earlier_datetimeoffset_it_should_throw() + { + // Arrange + DateTimeOffset time = new(2016, 06, 04, 12, 15, 31, 020, TimeSpan.Zero); + DateTimeOffset nearbyTime = new(2016, 06, 04, 12, 15, 31, 0, TimeSpan.Zero); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage( + "Did not expect time to be within 20ms from <2016-06-04 12:15:31 +0h>, but it was <2016-06-04 12:15:31.020 +0h>."); + } + + [Fact] + public void + When_asserting_subject_datetimeoffset_is_not_close_to_another_value_that_is_later_by_more_than_20ms_it_should_succeed() + { + // Arrange + DateTimeOffset time = 13.March(2012).At(12, 15, 30, 979).ToDateTimeOffset(1.Hours()); + DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).ToDateTimeOffset(1.Hours()); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void + When_asserting_subject_datetimeoffset_is_not_close_to_another_value_that_is_earlier_by_more_than_20ms_it_should_succeed() + { + // Arrange + DateTimeOffset time = 13.March(2012).At(12, 15, 31, 021).ToDateTimeOffset(1.Hours()); + DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).ToDateTimeOffset(1.Hours()); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_not_close_to_an_earlier_datetimeoffset_by_35ms_it_should_throw() + { + // Arrange + DateTimeOffset time = 13.March(2012).At(12, 15, 31, 035).ToDateTimeOffset(1.Hours()); + DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).ToDateTimeOffset(1.Hours()); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 35.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage( + "Did not expect time to be within 35ms from <2012-03-13 12:15:31 +1h>, but it was <2012-03-13 12:15:31.035 +1h>."); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_is_not_close_to_another_it_should_throw() + { + // Arrange + DateTimeOffset? time = null; + DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).ToDateTimeOffset(5.Hours()); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 35.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect*, but it was ."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_not_close_to_the_minimum_datetimeoffset_it_should_throw() + { + // Arrange + DateTimeOffset time = DateTimeOffset.MinValue + 50.Milliseconds(); + DateTimeOffset nearbyTime = DateTimeOffset.MinValue; + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 100.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage( + "Did not expect time to be within 100ms from <0001-01-01 00:00:00.000>, but it was <00:00:00.050 +0h>."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_not_close_to_the_maximum_datetimeoffset_it_should_throw() + { + // Arrange + DateTimeOffset time = DateTimeOffset.MaxValue - 50.Milliseconds(); + DateTimeOffset nearbyTime = DateTimeOffset.MaxValue; + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 100.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage( + "Did not expect time to be within 100ms from <9999-12-31 23:59:59.9999999 +0h>, but it was <9999-12-31 23:59:59.9499999 +0h>."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeExactly.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeExactly.cs new file mode 100644 index 0000000000..f0fa0a9c35 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeExactly.cs @@ -0,0 +1,233 @@ +using System; +using FluentAssertions.Common; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class BeExactly + { + [Fact] + public void Should_succeed_when_asserting_value_is_exactly_equal_to_the_same_value() + { + // Arrange + DateTimeOffset dateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); + DateTimeOffset sameDateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); + + // Act / Assert + dateTime.Should().BeExactly(sameDateTime); + } + + [Fact] + public void Should_succeed_when_asserting_value_is_exactly_equal_to_the_same_nullable_value() + { + // Arrange + DateTimeOffset dateTime = 4.June(2016).ToDateTimeOffset(); + DateTimeOffset? sameDateTime = 4.June(2016).ToDateTimeOffset(); + + // Act / Assert + dateTime.Should().BeExactly(sameDateTime); + } + + [Fact] + public void Should_fail_when_asserting_value_is_exactly_equal_to_a_different_value() + { + // Arrange + var dateTime = 10.March(2012).WithOffset(1.Hours()); + var otherDateTime = dateTime.ToUniversalTime(); + + // Act + Action act = () => dateTime.Should().BeExactly(otherDateTime, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dateTime to be exactly <2012-03-09 23:00:00 +0h>*failure message, but it was <2012-03-10 +1h>."); + } + + [Fact] + public void Should_fail_when_asserting_value_is_exactly_equal_to_a_different_nullable_value() + { + // Arrange + DateTimeOffset dateTime = 10.March(2012).WithOffset(1.Hours()); + DateTimeOffset? otherDateTime = dateTime.ToUniversalTime(); + + // Act + Action act = () => dateTime.Should().BeExactly(otherDateTime, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Expected dateTime to be exactly <2012-03-09 23:00:00 +0h>*failure message, but it was <2012-03-10 +1h>."); + } + + [Fact] + public void Should_succeed_when_asserting_nullable_value_is_exactly_equal_to_the_same_nullable_value() + { + // Arrange + DateTimeOffset? nullableDateTimeA = new DateTime(2016, 06, 04).ToDateTimeOffset(); + DateTimeOffset? nullableDateTimeB = new DateTime(2016, 06, 04).ToDateTimeOffset(); + + // Act / Assert + nullableDateTimeA.Should().BeExactly(nullableDateTimeB); + } + + [Fact] + public void Should_succeed_when_asserting_nullable_null_value_exactly_equals_null() + { + // Arrange + DateTimeOffset? nullableDateTimeA = null; + DateTimeOffset? nullableDateTimeB = null; + + // Act / Assert + nullableDateTimeA.Should().BeExactly(nullableDateTimeB); + } + + [Fact] + public void Should_fail_when_asserting_nullable_value_exactly_equals_a_different_value() + { + // Arrange + DateTimeOffset? nullableDateTimeA = new DateTime(2016, 06, 04).ToDateTimeOffset(); + DateTimeOffset? nullableDateTimeB = new DateTime(2016, 06, 06).ToDateTimeOffset(); + + // Act + Action action = () => + nullableDateTimeA.Should().BeExactly(nullableDateTimeB); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void Should_fail_with_descriptive_message_when_asserting_null_value_is_exactly_equal_to_another_value() + { + // Arrange + DateTimeOffset? nullableDateTime = null; + DateTimeOffset expectation = 27.March(2016).ToDateTimeOffset(1.Hours()); + + // Act + Action action = () => + nullableDateTime.Should().BeExactly(expectation, "because we want to test the failure {0}", "message"); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected nullableDateTime to be exactly <2016-03-27 +1h> because we want to test the failure message, but found a DateTimeOffset."); + } + } + + public class NotBeExactly + { + [Fact] + public void Should_succeed_when_asserting_value_is_not_exactly_equal_to_a_different_value() + { + // Arrange + DateTimeOffset dateTime = 10.March(2012).WithOffset(1.Hours()); + DateTimeOffset otherDateTime = dateTime.ToUniversalTime(); + + // Act / Assert + dateTime.Should().NotBeExactly(otherDateTime); + } + + [Fact] + public void Should_succeed_when_asserting_value_is_not_exactly_equal_to_a_different_nullable_value() + { + // Arrange + DateTimeOffset dateTime = 10.March(2012).WithOffset(1.Hours()); + DateTimeOffset? otherDateTime = dateTime.ToUniversalTime(); + + // Act / Assert + dateTime.Should().NotBeExactly(otherDateTime); + } + + [Fact] + public void Should_fail_when_asserting_value_is_not_exactly_equal_to_the_same_value() + { + // Arrange + var dateTime = new DateTimeOffset(10.March(2012), 1.Hours()); + var sameDateTime = new DateTimeOffset(10.March(2012), 1.Hours()); + + // Act + Action act = + () => dateTime.Should().NotBeExactly(sameDateTime, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect dateTime to be exactly <2012-03-10 +1h> because we want to test the failure message, but it was."); + } + + [Fact] + public void Should_fail_when_asserting_value_is_not_exactly_equal_to_the_same_nullable_value() + { + // Arrange + DateTimeOffset dateTime = new(10.March(2012), 1.Hours()); + DateTimeOffset? sameDateTime = new DateTimeOffset(10.March(2012), 1.Hours()); + + // Act + Action act = + () => dateTime.Should().NotBeExactly(sameDateTime, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect dateTime to be exactly <2012-03-10 +1h> because we want to test the failure message, but it was."); + } + + [Fact] + public void When_time_is_not_at_exactly_20_minutes_before_another_time_it_should_throw() + { + // Arrange + DateTimeOffset target = 1.January(0001).At(12, 55).ToDateTimeOffset(); + DateTimeOffset subject = 1.January(0001).At(12, 36).ToDateTimeOffset(); + + // Act + Action act = + () => subject.Should().BeExactly(TimeSpan.FromMinutes(20)).Before(target, "{0} minutes is enough", 20); + + // Assert + act.Should().Throw().WithMessage( + "Expected subject <12:36:00 +0h> to be exactly 20m before <12:55:00 +0h> because 20 minutes is enough, but it is behind by 19m."); + } + + [Fact] + public void When_time_is_exactly_90_seconds_before_another_time_it_should_not_throw() + { + // Arrange + DateTimeOffset target = 1.January(0001).At(12, 55).ToDateTimeOffset(); + DateTimeOffset subject = 1.January(0001).At(12, 53, 30).ToDateTimeOffset(); + + // Act / Assert + subject.Should().BeExactly(TimeSpan.FromSeconds(90)).Before(target); + } + + [Fact] + public void When_asserting_subject_be_exactly_10_seconds_after_target_but_subject_is_before_target_it_should_throw() + { + // Arrange + var expectation = 1.January(0001).At(0, 0, 30).WithOffset(0.Hours()); + var subject = 1.January(0001).At(0, 0, 20).WithOffset(0.Hours()); + + // Act + Action action = () => subject.Should().BeExactly(10.Seconds()).After(expectation); + + // Assert + action.Should().Throw() + .WithMessage("Expected subject <00:00:20 +0h> to be exactly 10s after <00:00:30 +0h>, but it is behind by 10s."); + } + + [Fact] + public void When_asserting_subject_be_exactly_10_seconds_before_target_but_subject_is_after_target_it_should_throw() + { + // Arrange + var expectation = 1.January(0001).At(0, 0, 30).WithOffset(0.Hours()); + var subject = 1.January(0001).At(0, 0, 40).WithOffset(0.Hours()); + + // Act + Action action = () => subject.Should().BeExactly(10.Seconds()).Before(expectation); + + // Assert + action.Should().Throw() + .WithMessage("Expected subject <00:00:40 +0h> to be exactly 10s before <00:00:30 +0h>, but it is ahead by 10s."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeLessThan.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeLessThan.cs new file mode 100644 index 0000000000..a3805b533b --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeLessThan.cs @@ -0,0 +1,86 @@ +using System; +using System.Linq; +using FluentAssertions.Common; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class BeLessThan + { + [Fact] + public void When_time_is_not_less_than_30s_after_another_time_it_should_throw() + { + // Arrange + var target = 1.January(1).At(12, 0, 30).WithOffset(1.Hours()); + DateTimeOffset subject = target + 30.Seconds(); + + // Act + Action act = + () => subject.Should().BeLessThan(TimeSpan.FromSeconds(30)).After(target, "{0}s is the max", 30); + + // Assert + act.Should().Throw().WithMessage( + "Expected subject <12:01:00 +1h> to be less than 30s after <12:00:30 +1h> because 30s is the max, but it is ahead by 30s."); + } + + [Fact] + public void When_time_is_less_than_30s_after_another_time_it_should_not_throw() + { + // Arrange + var target = new DateTimeOffset(1.January(1).At(12, 0, 30)); + DateTimeOffset subject = target + 20.Seconds(); + + // Act / Assert + subject.Should().BeLessThan(TimeSpan.FromSeconds(30)).After(target); + } + + [Fact] + public void When_asserting_subject_be_less_than_10_seconds_after_target_but_subject_is_before_target_it_should_throw() + { + // Arrange + var expectation = 1.January(0001).At(0, 0, 30).WithOffset(0.Hours()); + var subject = 1.January(0001).At(0, 0, 25).WithOffset(0.Hours()); + + // Act + Action action = () => subject.Should().BeLessThan(10.Seconds()).After(expectation); + + // Assert + action.Should().Throw() + .WithMessage("Expected subject <00:00:25 +0h> to be less than 10s after <00:00:30 +0h>, but it is behind by 5s."); + } + + [Fact] + public void When_asserting_subject_be_less_than_10_seconds_before_target_but_subject_is_after_target_it_should_throw() + { + // Arrange + var expectation = 1.January(0001).At(0, 0, 30).WithOffset(0.Hours()); + var subject = 1.January(0001).At(0, 0, 45).WithOffset(0.Hours()); + + // Act + Action action = () => subject.Should().BeLessThan(10.Seconds()).Before(expectation); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected subject <00:00:45 +0h> to be less than 10s before <00:00:30 +0h>, but it is ahead by 15s."); + } + + [Fact] + public void Should_throw_a_helpful_error_when_accidentally_using_equals_with_a_range() + { + // Arrange + DateTimeOffset someDateTimeOffset = new(2022, 9, 25, 13, 48, 42, 0, TimeSpan.Zero); + + // Act + var action = () => someDateTimeOffset.Should().BeLessThan(0.Seconds()).Equals(null); + + // Assert + action.Should().Throw() + .WithMessage("Equals is not part of Fluent Assertions. Did you mean Before() or After() instead?"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeMoreThan.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeMoreThan.cs new file mode 100644 index 0000000000..f76d37b69d --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeMoreThan.cs @@ -0,0 +1,70 @@ +using System; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class BeMoreThan + { + [Fact] + public void When_date_is_not_more_than_the_required_one_day_before_another_it_should_throw() + { + // Arrange + var target = new DateTimeOffset(2.October(2009), 0.Hours()); + DateTimeOffset subject = target - 1.Days(); + + // Act + Action act = () => subject.Should().BeMoreThan(TimeSpan.FromDays(1)).Before(target, "we like {0}", "that"); + + // Assert + act.Should().Throw().WithMessage( + "Expected subject <2009-10-01 +0h> to be more than 1d before <2009-10-02 +0h> because we like that, but it is behind by 1d."); + } + + [Fact] + public void When_date_is_more_than_the_required_one_day_before_another_it_should_not_throw() + { + // Arrange + var target = new DateTimeOffset(2.October(2009)); + DateTimeOffset subject = target - 25.Hours(); + + // Act / Assert + subject.Should().BeMoreThan(TimeSpan.FromDays(1)).Before(target); + } + + [Fact] + public void When_asserting_subject_be_more_than_10_seconds_after_target_but_subject_is_before_target_it_should_throw() + { + // Arrange + var expectation = 1.January(0001).At(0, 0, 30).WithOffset(0.Hours()); + var subject = 1.January(0001).At(0, 0, 15).WithOffset(0.Hours()); + + // Act + Action action = () => subject.Should().BeMoreThan(10.Seconds()).After(expectation); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected subject <00:00:15 +0h> to be more than 10s after <00:00:30 +0h>, but it is behind by 15s."); + } + + [Fact] + public void When_asserting_subject_be_more_than_10_seconds_before_target_but_subject_is_after_target_it_should_throw() + { + // Arrange + var expectation = 1.January(0001).At(0, 0, 30).WithOffset(0.Hours()); + var subject = 1.January(0001).At(0, 0, 45).WithOffset(0.Hours()); + + // Act + Action action = () => subject.Should().BeMoreThan(10.Seconds()).Before(expectation); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected subject <00:00:45 +0h> to be more than 10s before <00:00:30 +0h>, but it is ahead by 15s."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeNull.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeNull.cs new file mode 100644 index 0000000000..dc4ce0a7fc --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeNull.cs @@ -0,0 +1,69 @@ +using System; +using FluentAssertions.Common; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class BeNull + { + [Fact] + public void Should_succeed_when_asserting_nullable_datetimeoffset_value_without_a_value_to_be_null() + { + // Arrange + DateTimeOffset? nullableDateTime = null; + + // Act + Action action = () => + nullableDateTime.Should().BeNull(); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void Should_fail_when_asserting_nullable_datetimeoffset_value_with_a_value_to_be_null() + { + // Arrange + DateTimeOffset? nullableDateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); + + // Act + Action action = () => + nullableDateTime.Should().BeNull(); + + // Assert + action.Should().Throw(); + } + } + + public class NotBeNull + { + [Fact] + public void When_nullable_datetimeoffset_value_with_a_value_not_be_null_it_should_succeed() + { + // Arrange + DateTimeOffset? nullableDateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); + + // Act + Action action = () => nullableDateTime.Should().NotBeNull(); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void Should_fail_when_asserting_nullable_datetimeoffset_value_without_a_value_to_not_be_null() + { + // Arrange + DateTimeOffset? nullableDateTime = null; + + // Act + Action action = () => nullableDateTime.Should().NotBeNull(); + + // Assert + action.Should().Throw(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeOnOrAfter.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeOnOrAfter.cs new file mode 100644 index 0000000000..a04969806c --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeOnOrAfter.cs @@ -0,0 +1,101 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class BeOnOrAfter + { + [Fact] + public void When_asserting_subject_datetimeoffset_is_on_or_after_earlier_expected_datetimeoffset_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 03), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().BeOnOrAfter(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_on_or_after_the_same_expected_datetimeoffset_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().BeOnOrAfter(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_on_or_after_later_expected_datetimeoffset_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 05), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().BeOnOrAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be on or after <2016-06-05 +0h>, but it was <2016-06-04 +0h>."); + } + } + + public class NotBeOnOrAfter + { + [Fact] + public void When_asserting_subject_datetimeoffset_is_not_on_or_after_earlier_expected_datetimeoffset_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 03), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotBeOnOrAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be before <2016-06-03 +0h>, but it was <2016-06-04 +0h>."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_not_on_or_after_the_same_expected_datetimeoffset_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotBeOnOrAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be before <2016-06-04 +0h>, but it was <2016-06-04 +0h>."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_not_on_or_after_later_expected_datetimeoffset_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 05), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotBeOnOrAfter(expectation); + + // Assert + act.Should().NotThrow(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeOnOrBefore.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeOnOrBefore.cs new file mode 100644 index 0000000000..ff9a76c09d --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeOnOrBefore.cs @@ -0,0 +1,103 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class BeOnOrBefore + { + [Fact] + public void When_asserting_subject_datetimeoffset_is_on_or_before_expected_datetimeoffset_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 05), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().BeOnOrBefore(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void + When_asserting_subject_datetimeoffset_is_on_or_before_the_same_date_as_the_expected_datetimeoffset_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().BeOnOrBefore(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_not_on_or_before_earlier_expected_datetimeoffset_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 03), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().BeOnOrBefore(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be on or before <2016-06-03 +0h>, but it was <2016-06-04 +0h>."); + } + } + + public class NotBeOnOrBefore + { + [Fact] + public void When_asserting_subject_datetimeoffset_is_on_or_before_expected_datetimeoffset_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 05), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotBeOnOrBefore(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be after <2016-06-05 +0h>, but it was <2016-06-04 +0h>."); + } + + [Fact] + public void + When_asserting_subject_datetimeoffset_is_on_or_before_the_same_date_as_the_expected_datetimeoffset_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotBeOnOrBefore(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be after <2016-06-04 +0h>, but it was <2016-06-04 +0h>."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_is_not_on_or_before_earlier_expected_datetimeoffset_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2016, 06, 03), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotBeOnOrBefore(expectation); + + // Assert + act.Should().NotThrow(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeOneOf.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeOneOf.cs new file mode 100644 index 0000000000..60fc3abc32 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeOneOf.cs @@ -0,0 +1,129 @@ +using System; +using System.Linq; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class BeOneOf + { + [Fact] + public void When_a_value_is_not_one_of_the_specified_values_it_should_throw() + { + // Arrange + var value = new DateTimeOffset(31.December(2016), 1.Hours()); + + // Act + Action action = () => value.Should().BeOneOf(value + 1.Days(), value + 4.Hours()); + + // Assert + action.Should().Throw().WithMessage( + "Expected value to be one of {<2017-01-01 +1h>, <2016-12-31 04:00:00 +1h>}, but it was <2016-12-31 +1h>."); + } + + [Fact] + public void When_a_value_is_one_of_the_specified_param_values_follow_up_assertions_works() + { + // Arrange + var value = new DateTimeOffset(31.December(2016), 1.Hours()); + + // Act / Assert + value.Should().BeOneOf(value, value + 1.Hours()) + .And.Be(31.December(2016).WithOffset(1.Hours())); + } + + [Fact] + public void When_a_value_is_one_of_the_specified_nullable_params_values_follow_up_assertions_works() + { + // Arrange + var value = new DateTimeOffset(31.December(2016), 1.Hours()); + + // Act / Assert + value.Should().BeOneOf(null, value, value + 1.Hours()) + .And.Be(31.December(2016).WithOffset(1.Hours())); + } + + [Fact] + public void When_a_value_is_one_of_the_specified_enumerable_values_follow_up_assertions_works() + { + // Arrange + var value = new DateTimeOffset(31.December(2016), 1.Hours()); + var expected = new[] { value, value + 1.Hours() }.AsEnumerable(); + + // Act / Assert + value.Should().BeOneOf(expected) + .And.Be(31.December(2016).WithOffset(1.Hours())); + } + + [Fact] + public void When_a_value_is_one_of_the_specified_nullable_enumerable_follow_up_assertions_works() + { + // Arrange + var value = new DateTimeOffset(31.December(2016), 1.Hours()); + var expected = new DateTimeOffset?[] { null, value, value + 1.Hours() }.AsEnumerable(); + + // Act / Assert + value.Should().BeOneOf(expected) + .And.Be(31.December(2016).WithOffset(1.Hours())); + } + + [Fact] + public void When_a_value_is_not_one_of_the_specified_values_it_should_throw_with_descriptive_message() + { + // Arrange + DateTimeOffset value = 31.December(2016).WithOffset(1.Hours()); + + // Act + Action action = () => value.Should().BeOneOf(new[] { value + 1.Days(), value + 2.Days() }, "because it's true"); + + // Assert + action.Should().Throw().WithMessage( + "Expected value to be one of {<2017-01-01 +1h>, <2017-01-02 +1h>} because it's true, but it was <2016-12-31 +1h>."); + } + + [Fact] + public void When_a_value_is_one_of_the_specified_values_it_should_succeed() + { + // Arrange + DateTimeOffset value = new(2016, 12, 30, 23, 58, 57, TimeSpan.FromHours(4)); + + // Act + Action action = () => value.Should().BeOneOf(new DateTimeOffset(2216, 1, 30, 0, 5, 7, TimeSpan.FromHours(2)), + new DateTimeOffset(2016, 12, 30, 23, 58, 57, TimeSpan.FromHours(4))); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void When_a_null_value_is_not_one_of_the_specified_values_it_should_throw() + { + // Arrange + DateTimeOffset? value = null; + + // Act + Action action = () => value.Should().BeOneOf(new DateTimeOffset(2216, 1, 30, 0, 5, 7, TimeSpan.FromHours(1)), + new DateTimeOffset(2016, 2, 10, 2, 45, 7, TimeSpan.FromHours(2))); + + // Assert + action.Should().Throw().WithMessage( + "Expected value to be one of {<2216-01-30 00:05:07 +1h>, <2016-02-10 02:45:07 +2h>}, but it was ."); + } + + [Fact] + public void When_a_value_is_one_of_the_specified_values_it_should_succeed_when_datetimeoffset_is_null() + { + // Arrange + DateTimeOffset? value = null; + + // Act + Action action = () => value.Should().BeOneOf(new DateTimeOffset(2216, 1, 30, 0, 5, 7, TimeSpan.Zero), null); + + // Assert + action.Should().NotThrow(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeSameDateAs.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeSameDateAs.cs new file mode 100644 index 0000000000..dda39ebaf3 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeSameDateAs.cs @@ -0,0 +1,159 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class BeSameDateAs + { + [Fact] + public void When_asserting_subject_datetimeoffset_should_be_same_date_as_another_with_the_same_date_it_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 4, 5, 6), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2009, 12, 31), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().BeSameDateAs(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void + When_asserting_subject_datetimeoffset_should_be_same_as_another_with_same_date_but_different_time_it_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 4, 5, 6), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2009, 12, 31, 11, 15, 11), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().BeSameDateAs(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_to_be_same_date_as_another_datetimeoffset_it_should_throw() + { + // Arrange + DateTimeOffset? subject = null; + DateTimeOffset expectation = new(new DateTime(2009, 12, 31), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().BeSameDateAs(expectation); + + // Assert + act.Should().Throw().WithMessage( + "Expected the date part of subject to be <2009-12-31>, but found a DateTimeOffset."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_should_have_same_date_as_another_but_it_doesnt_it_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2009, 12, 30), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().BeSameDateAs(expectation); + + // Assert + act.Should().Throw().WithMessage( + "Expected the date part of subject to be <2009-12-30>, but it was <2009-12-31>."); + } + + [Fact] + public void Can_chain_follow_up_assertions() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 4, 5, 6), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2009, 12, 31, 4, 5, 6), TimeSpan.Zero); + + // Act / Assert + subject.Should().BeSameDateAs(expectation).And.Be(subject); + } + } + + public class NotBeSameDateAs + { + [Fact] + public void When_asserting_subject_datetimeoffset_should_not_be_same_date_as_another_with_the_same_date_it_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 4, 5, 6), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2009, 12, 31), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotBeSameDateAs(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the date part of subject to be <2009-12-31>, but it was."); + } + + [Fact] + public void Can_chain_follow_up_assertions() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 4, 5, 6), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2009, 12, 31), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotBeSameDateAs(expectation).And.Be(subject); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the date part of subject to be <2009-12-31>, but it was."); + } + + [Fact] + public void + When_asserting_subject_datetimeoffset_should_not_be_same_as_another_with_same_date_but_different_time_it_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 4, 5, 6), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2009, 12, 31, 11, 15, 11), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotBeSameDateAs(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the date part of subject to be <2009-12-31>, but it was."); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_to_not_be_same_date_as_another_datetimeoffset_it_should_throw() + { + // Arrange + DateTimeOffset? subject = null; + DateTimeOffset expectation = new(new DateTime(2009, 12, 31), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotBeSameDateAs(expectation); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect the date part of subject to be <2009-12-31>, but found a DateTimeOffset."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_should_not_have_same_date_as_another_but_it_doesnt_it_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); + DateTimeOffset expectation = new(new DateTime(2009, 12, 30), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotBeSameDateAs(expectation); + + // Assert + act.Should().NotThrow(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeWithin.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeWithin.cs new file mode 100644 index 0000000000..4ebb9eaa22 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeWithin.cs @@ -0,0 +1,108 @@ +using System; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class BeWithin + { + [Fact] + public void When_date_is_not_within_50_hours_before_another_date_it_should_throw() + { + // Arrange + var target = 10.April(2010).At(12, 0).WithOffset(0.Hours()); + DateTimeOffset subject = target - 50.Hours() - 1.Seconds(); + + // Act + Action act = + () => subject.Should().BeWithin(TimeSpan.FromHours(50)).Before(target, "{0} hours is enough", 50); + + // Assert + act.Should().Throw().WithMessage( + "Expected subject <2010-04-08 09:59:59 +0h> to be within 2d and 2h before <2010-04-10 12:00:00 +0h> because 50 hours is enough, but it is behind by 2d, 2h and 1s."); + } + + [Fact] + public void When_date_is_exactly_within_1d_before_another_date_it_should_not_throw() + { + // Arrange + var target = new DateTimeOffset(10.April(2010)); + DateTimeOffset subject = target - 1.Days(); + + // Act / Assert + subject.Should().BeWithin(TimeSpan.FromHours(24)).Before(target); + } + + [Fact] + public void When_date_is_within_1d_before_another_date_it_should_not_throw() + { + // Arrange + var target = new DateTimeOffset(10.April(2010)); + DateTimeOffset subject = target - 23.Hours(); + + // Act / Assert + subject.Should().BeWithin(TimeSpan.FromHours(24)).Before(target); + } + + [Fact] + public void When_a_utc_date_is_within_0s_before_itself_it_should_not_throw() + { + // Arrange + var date = DateTimeOffset.UtcNow; // local timezone differs from +0h + + // Act / Assert + date.Should().BeWithin(TimeSpan.Zero).Before(date); + } + + [Fact] + public void When_a_utc_date_is_within_0s_after_itself_it_should_not_throw() + { + // Arrange + var date = DateTimeOffset.UtcNow; // local timezone differs from +0h + + // Act / Assert + date.Should().BeWithin(TimeSpan.Zero).After(date); + } + + [Theory] + [InlineData(30, 20)] // edge case + [InlineData(30, 25)] + public void When_asserting_subject_be_within_10_seconds_after_target_but_subject_is_before_target_it_should_throw( + int targetSeconds, int subjectSeconds) + { + // Arrange + var expectation = 1.January(0001).At(0, 0, targetSeconds).WithOffset(0.Hours()); + var subject = 1.January(0001).At(0, 0, subjectSeconds).WithOffset(0.Hours()); + + // Act + Action action = () => subject.Should().BeWithin(10.Seconds()).After(expectation); + + // Assert + action.Should().Throw() + .WithMessage( + $"Expected subject <00:00:{subjectSeconds} +0h> to be within 10s after <00:00:30 +0h>, but it is behind by {Math.Abs(subjectSeconds - targetSeconds)}s."); + } + + [Theory] + [InlineData(30, 40)] // edge case + [InlineData(30, 35)] + public void When_asserting_subject_be_within_10_seconds_before_target_but_subject_is_after_target_it_should_throw( + int targetSeconds, int subjectSeconds) + { + // Arrange + var expectation = 1.January(0001).At(0, 0, targetSeconds).WithOffset(0.Hours()); + var subject = 1.January(0001).At(0, 0, subjectSeconds).WithOffset(0.Hours()); + + // Act + Action action = () => subject.Should().BeWithin(10.Seconds()).Before(expectation); + + // Assert + action.Should().Throw() + .WithMessage( + $"Expected subject <00:00:{subjectSeconds} +0h> to be within 10s before <00:00:30 +0h>, but it is ahead by {Math.Abs(subjectSeconds - targetSeconds)}s."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveDay.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveDay.cs new file mode 100644 index 0000000000..4a42ea1fd1 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveDay.cs @@ -0,0 +1,102 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class HaveDay + { + [Fact] + public void When_asserting_subject_datetimeoffset_should_have_day_with_the_same_value_it_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); + int expectation = 31; + + // Act + Action act = () => subject.Should().HaveDay(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_should_have_day_with_a_different_value_it_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); + int expectation = 30; + + // Act + Action act = () => subject.Should().HaveDay(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the day part of subject to be 30, but it was 31."); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_should_have_day_should_throw() + { + // Arrange + DateTimeOffset? subject = null; + int expectation = 22; + + // Act + Action act = () => subject.Should().HaveDay(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the day part of subject to be 22, but found a DateTimeOffset."); + } + } + + public class NotHaveDay + { + [Fact] + public void When_asserting_subject_datetimeoffset_should_not_have_day_with_the_same_value_it_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); + int expectation = 31; + + // Act + Action act = () => subject.Should().NotHaveDay(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the day part of subject to be 31, but it was."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_should_not_have_day_with_a_different_value_it_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); + int expectation = 30; + + // Act + Action act = () => subject.Should().NotHaveDay(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_should_not_have_day_should_throw() + { + // Arrange + DateTimeOffset? subject = null; + int expectation = 22; + + // Act + Action act = () => subject.Should().NotHaveDay(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the day part of subject to be 22, but found a DateTimeOffset."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveHour.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveHour.cs new file mode 100644 index 0000000000..e87ea18fe0 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveHour.cs @@ -0,0 +1,102 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class HaveHour + { + [Fact] + public void When_asserting_subject_datetimeoffset_should_have_hour_with_the_same_value_it_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); + int expectation = 23; + + // Act + Action act = () => subject.Should().HaveHour(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_should_have_hour_with_different_value_it_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); + int expectation = 22; + + // Act + Action act = () => subject.Should().HaveHour(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the hour part of subject to be 22, but it was 23."); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_should_have_hour_should_throw() + { + // Arrange + DateTimeOffset? subject = null; + int expectation = 22; + + // Act + Action act = () => subject.Should().HaveHour(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the hour part of subject to be 22, but found a DateTimeOffset."); + } + } + + public class NotHaveHour + { + [Fact] + public void When_asserting_subject_datetimeoffset_should_not_have_hour_with_the_same_value_it_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); + int expectation = 23; + + // Act + Action act = () => subject.Should().NotHaveHour(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the hour part of subject to be 23, but it was."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_should_not_have_hour_with_different_value_it_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); + int expectation = 22; + + // Act + Action act = () => subject.Should().NotHaveHour(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_should_not_have_hour_should_throw() + { + // Arrange + DateTimeOffset? subject = null; + int expectation = 22; + + // Act + Action act = () => subject.Should().NotHaveHour(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the hour part of subject to be 22, but found a DateTimeOffset."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveMinute.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveMinute.cs new file mode 100644 index 0000000000..ad54f84334 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveMinute.cs @@ -0,0 +1,102 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class HaveMinute + { + [Fact] + public void When_asserting_subject_datetimeoffset_should_have_minutes_with_the_same_value_it_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); + int expectation = 59; + + // Act + Action act = () => subject.Should().HaveMinute(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_should_have_minutes_with_different_value_it_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); + int expectation = 58; + + // Act + Action act = () => subject.Should().HaveMinute(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the minute part of subject to be 58, but it was 59."); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_should_have_minute_should_throw() + { + // Arrange + DateTimeOffset? subject = null; + int expectation = 22; + + // Act + Action act = () => subject.Should().HaveMinute(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the minute part of subject to be 22, but found a DateTimeOffset."); + } + } + + public class NotHaveMinute + { + [Fact] + public void When_asserting_subject_datetimeoffset_should_not_have_minutes_with_the_same_value_it_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); + int expectation = 59; + + // Act + Action act = () => subject.Should().NotHaveMinute(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the minute part of subject to be 59, but it was."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_should_not_have_minutes_with_different_value_it_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); + int expectation = 58; + + // Act + Action act = () => subject.Should().NotHaveMinute(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_should_not_have_minute_should_throw() + { + // Arrange + DateTimeOffset? subject = null; + int expectation = 22; + + // Act + Action act = () => subject.Should().NotHaveMinute(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the minute part of subject to be 22, but found a DateTimeOffset."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveMonth.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveMonth.cs new file mode 100644 index 0000000000..d49d9f371f --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveMonth.cs @@ -0,0 +1,102 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class HaveMonth + { + [Fact] + public void When_asserting_subject_datetimeoffset_should_have_month_with_the_same_value_it_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); + int expectation = 12; + + // Act + Action act = () => subject.Should().HaveMonth(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_should_have_a_month_with_a_different_value_it_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); + int expectation = 11; + + // Act + Action act = () => subject.Should().HaveMonth(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the month part of subject to be 11, but it was 12."); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_should_have_month_should_throw() + { + // Arrange + DateTimeOffset? subject = null; + int expectation = 12; + + // Act + Action act = () => subject.Should().HaveMonth(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the month part of subject to be 12, but found a DateTimeOffset."); + } + } + + public class NotHaveMonth + { + [Fact] + public void When_asserting_subject_datetimeoffset_should_not_have_month_with_the_same_value_it_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); + int expectation = 12; + + // Act + Action act = () => subject.Should().NotHaveMonth(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the month part of subject to be 12, but it was."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_should_not_have_a_month_with_a_different_value_it_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); + int expectation = 11; + + // Act + Action act = () => subject.Should().NotHaveMonth(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_should_not_have_month_should_throw() + { + // Arrange + DateTimeOffset? subject = null; + int expectation = 12; + + // Act + Action act = () => subject.Should().NotHaveMonth(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the month part of subject to be 12, but found a DateTimeOffset."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveOffset.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveOffset.cs new file mode 100644 index 0000000000..57db04b8d3 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveOffset.cs @@ -0,0 +1,102 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class HaveOffset + { + [Fact] + public void When_asserting_subject_datetimeoffset_should_have_offset_with_the_same_value_it_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.FromHours(7)); + TimeSpan expectation = TimeSpan.FromHours(7); + + // Act + Action act = () => subject.Should().HaveOffset(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_should_have_offset_with_different_value_it_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 10), TimeSpan.Zero); + TimeSpan expectation = TimeSpan.FromHours(3); + + // Act + Action act = () => subject.Should().HaveOffset(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the offset of subject to be 3h, but it was default."); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_should_have_offset_should_throw() + { + // Arrange + DateTimeOffset? subject = null; + TimeSpan expectation = TimeSpan.FromHours(3); + + // Act + Action act = () => subject.Should().HaveOffset(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the offset of subject to be 3h, but found a DateTimeOffset."); + } + } + + public class NotHaveOffset + { + [Fact] + public void When_asserting_subject_datetimeoffset_should_not_have_offset_with_the_same_value_it_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.FromHours(7)); + TimeSpan expectation = TimeSpan.FromHours(7); + + // Act + Action act = () => subject.Should().NotHaveOffset(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the offset of subject to be 7h, but it was."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_should_not_have_offset_with_different_value_it_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); + TimeSpan expectation = TimeSpan.FromHours(3); + + // Act + Action act = () => subject.Should().NotHaveOffset(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_should_not_have_offset_should_throw() + { + // Arrange + DateTimeOffset? subject = null; + TimeSpan expectation = TimeSpan.FromHours(3); + + // Act + Action act = () => subject.Should().NotHaveOffset(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the offset of subject to be 3h, but found a DateTimeOffset."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveSecond.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveSecond.cs new file mode 100644 index 0000000000..18fa8066fd --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveSecond.cs @@ -0,0 +1,102 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class HaveSecond + { + [Fact] + public void When_asserting_subject_datetimeoffset_should_have_seconds_with_the_same_value_it_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); + int expectation = 0; + + // Act + Action act = () => subject.Should().HaveSecond(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_should_have_seconds_with_different_value_it_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); + int expectation = 1; + + // Act + Action act = () => subject.Should().HaveSecond(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the seconds part of subject to be 1, but it was 0."); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_should_have_second_should_throw() + { + // Arrange + DateTimeOffset? subject = null; + int expectation = 22; + + // Act + Action act = () => subject.Should().HaveSecond(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the seconds part of subject to be 22, but found a DateTimeOffset."); + } + } + + public class NotHaveSecond + { + [Fact] + public void When_asserting_subject_datetimeoffset_should_not_have_seconds_with_the_same_value_it_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); + int expectation = 0; + + // Act + Action act = () => subject.Should().NotHaveSecond(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the seconds part of subject to be 0, but it was."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_should_not_have_seconds_with_different_value_it_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); + int expectation = 1; + + // Act + Action act = () => subject.Should().NotHaveSecond(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_should_not_have_second_should_throw() + { + // Arrange + DateTimeOffset? subject = null; + int expectation = 22; + + // Act + Action act = () => subject.Should().NotHaveSecond(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the seconds part of subject to be 22, but found a DateTimeOffset."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveValue.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveValue.cs new file mode 100644 index 0000000000..6c29dff3f0 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveValue.cs @@ -0,0 +1,69 @@ +using System; +using FluentAssertions.Common; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class HaveValue + { + [Fact] + public void When_nullable_datetimeoffset_value_with_a_value_to_have_a_value_it_should_succeed() + { + // Arrange + DateTimeOffset? nullableDateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); + + // Act + Action action = () => nullableDateTime.Should().HaveValue(); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void Should_fail_when_asserting_nullable_datetimeoffset_value_without_a_value_to_have_a_value() + { + // Arrange + DateTimeOffset? nullableDateTime = null; + + // Act + Action action = () => nullableDateTime.Should().HaveValue(); + + // Assert + action.Should().Throw(); + } + } + + public class NotHaveValue + { + [Fact] + public void Should_succeed_when_asserting_nullable_datetimeoffset_value_without_a_value_to_not_have_a_value() + { + // Arrange + DateTimeOffset? nullableDateTime = null; + + // Act + Action action = () => + nullableDateTime.Should().NotHaveValue(); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void Should_fail_when_asserting_nullable_datetimeoffset_value_with_a_value_to_not_have_a_value() + { + // Arrange + DateTimeOffset? nullableDateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); + + // Act + Action action = () => + nullableDateTime.Should().NotHaveValue(); + + // Assert + action.Should().Throw(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveYear.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveYear.cs new file mode 100644 index 0000000000..4c2d773237 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveYear.cs @@ -0,0 +1,102 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class HaveYear + { + [Fact] + public void When_asserting_subject_datetimeoffset_should_have_year_with_the_same_value_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 06, 04), TimeSpan.Zero); + int expectation = 2009; + + // Act + Action act = () => subject.Should().HaveYear(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_should_have_year_with_a_different_value_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 06, 04), TimeSpan.Zero); + int expectation = 2008; + + // Act + Action act = () => subject.Should().HaveYear(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the year part of subject to be 2008, but it was 2009."); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_should_have_year_should_throw() + { + // Arrange + DateTimeOffset? subject = null; + int expectation = 2008; + + // Act + Action act = () => subject.Should().HaveYear(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the year part of subject to be 2008, but found a DateTimeOffset."); + } + } + + public class NotHaveYear + { + [Fact] + public void When_asserting_subject_datetimeoffset_should_not_have_year_with_the_same_value_should_throw() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 06, 04), TimeSpan.Zero); + int expectation = 2009; + + // Act + Action act = () => subject.Should().NotHaveYear(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the year part of subject to be 2009, but it was."); + } + + [Fact] + public void When_asserting_subject_datetimeoffset_should_not_have_year_with_a_different_value_should_succeed() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 06, 04), TimeSpan.Zero); + int expectation = 2008; + + // Act + Action act = () => subject.Should().NotHaveYear(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetimeoffset_should_not_have_year_should_throw() + { + // Arrange + DateTimeOffset? subject = null; + int expectation = 2008; + + // Act + Action act = () => subject.Should().NotHaveYear(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the year part of subject to be 2008, but found a DateTimeOffset."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.cs index 11a5edbab1..4b79d69fdd 100644 --- a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.cs @@ -1,2516 +1,11 @@ using System; -using System.Linq; using FluentAssertions.Common; -using FluentAssertions.Extensions; using Xunit; -using Xunit.Sdk; namespace FluentAssertions.Specs.Primitives; -public class DateTimeOffsetAssertionSpecs +public partial class DateTimeOffsetAssertionSpecs { - public class HaveValue - { - [Fact] - public void When_nullable_datetimeoffset_value_with_a_value_to_have_a_value_it_should_succeed() - { - // Arrange - DateTimeOffset? nullableDateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); - - // Act - Action action = () => nullableDateTime.Should().HaveValue(); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void Should_fail_when_asserting_nullable_datetimeoffset_value_without_a_value_to_have_a_value() - { - // Arrange - DateTimeOffset? nullableDateTime = null; - - // Act - Action action = () => nullableDateTime.Should().HaveValue(); - - // Assert - action.Should().Throw(); - } - } - - public class NotHaveValue - { - [Fact] - public void Should_succeed_when_asserting_nullable_datetimeoffset_value_without_a_value_to_not_have_a_value() - { - // Arrange - DateTimeOffset? nullableDateTime = null; - - // Act - Action action = () => - nullableDateTime.Should().NotHaveValue(); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void Should_fail_when_asserting_nullable_datetimeoffset_value_with_a_value_to_not_have_a_value() - { - // Arrange - DateTimeOffset? nullableDateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); - - // Act - Action action = () => - nullableDateTime.Should().NotHaveValue(); - - // Assert - action.Should().Throw(); - } - } - - public class NotBeNull - { - [Fact] - public void When_nullable_datetimeoffset_value_with_a_value_not_be_null_it_should_succeed() - { - // Arrange - DateTimeOffset? nullableDateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); - - // Act - Action action = () => nullableDateTime.Should().NotBeNull(); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void Should_fail_when_asserting_nullable_datetimeoffset_value_without_a_value_to_not_be_null() - { - // Arrange - DateTimeOffset? nullableDateTime = null; - - // Act - Action action = () => nullableDateTime.Should().NotBeNull(); - - // Assert - action.Should().Throw(); - } - } - - public class BeNull - { - [Fact] - public void Should_succeed_when_asserting_nullable_datetimeoffset_value_without_a_value_to_be_null() - { - // Arrange - DateTimeOffset? nullableDateTime = null; - - // Act - Action action = () => - nullableDateTime.Should().BeNull(); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void Should_fail_when_asserting_nullable_datetimeoffset_value_with_a_value_to_be_null() - { - // Arrange - DateTimeOffset? nullableDateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); - - // Act - Action action = () => - nullableDateTime.Should().BeNull(); - - // Assert - action.Should().Throw(); - } - } - - public class Be - { - [Fact] - public void Should_succeed_when_asserting_datetimeoffset_value_is_equal_to_the_same_value() - { - // Arrange - DateTimeOffset dateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); - DateTimeOffset sameDateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); - - // Act - Action act = () => dateTime.Should().Be(sameDateTime); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_datetimeoffset_value_is_equal_to_the_same_nullable_value_be_should_succeed() - { - // Arrange - DateTimeOffset dateTime = 4.June(2016).ToDateTimeOffset(); - DateTimeOffset? sameDateTime = 4.June(2016).ToDateTimeOffset(); - - // Act - Action act = () => dateTime.Should().Be(sameDateTime); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_both_values_are_at_their_minimum_then_it_should_succeed() - { - // Arrange - DateTimeOffset dateTime = DateTimeOffset.MinValue; - DateTimeOffset sameDateTime = DateTimeOffset.MinValue; - - // Act - Action act = () => dateTime.Should().Be(sameDateTime); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_both_values_are_at_their_maximum_then_it_should_succeed() - { - // Arrange - DateTimeOffset dateTime = DateTimeOffset.MaxValue; - DateTimeOffset sameDateTime = DateTimeOffset.MaxValue; - - // Act - Action act = () => dateTime.Should().Be(sameDateTime); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void Should_fail_when_asserting_datetimeoffset_value_is_equal_to_the_different_value() - { - // Arrange - var dateTime = 10.March(2012).WithOffset(1.Hours()); - var otherDateTime = 11.March(2012).WithOffset(1.Hours()); - - // Act - Action act = () => dateTime.Should().Be(otherDateTime, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dateTime to represent the same point in time as <2012-03-11 +1h>*failure message, but <2012-03-10 +1h> does not."); - } - - [Fact] - public void When_datetimeoffset_value_is_equal_to_the_different_nullable_value_be_should_failed() - { - // Arrange - DateTimeOffset dateTime = 10.March(2012).WithOffset(1.Hours()); - DateTimeOffset? otherDateTime = 11.March(2012).WithOffset(1.Hours()); - - // Act - Action act = () => dateTime.Should().Be(otherDateTime, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dateTime to represent the same point in time as <2012-03-11 +1h>*failure message, but <2012-03-10 +1h> does not."); - } - - [Fact] - public void Should_succeed_when_asserting_nullable_datetimeoffset_value_equals_the_same_value() - { - // Arrange - DateTimeOffset? nullableDateTimeA = new DateTime(2016, 06, 04).ToDateTimeOffset(); - DateTimeOffset? nullableDateTimeB = new DateTime(2016, 06, 04).ToDateTimeOffset(); - - // Act - Action action = () => - nullableDateTimeA.Should().Be(nullableDateTimeB); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void Should_succeed_when_asserting_nullable_datetimeoffset_null_value_equals_null() - { - // Arrange - DateTimeOffset? nullableDateTimeA = null; - DateTimeOffset? nullableDateTimeB = null; - - // Act / Assert - nullableDateTimeA.Should().Be(nullableDateTimeB); - } - - [Fact] - public void Should_fail_when_asserting_nullable_datetimeoffset_value_equals_a_different_value() - { - // Arrange - DateTimeOffset? nullableDateTimeA = new DateTime(2016, 06, 04).ToDateTimeOffset(); - DateTimeOffset? nullableDateTimeB = new DateTime(2016, 06, 06).ToDateTimeOffset(); - - // Act - Action action = () => - nullableDateTimeA.Should().Be(nullableDateTimeB); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_datetimeoffset_null_value_is_equal_to_another_value() - { - // Arrange - DateTimeOffset? nullableDateTime = null; - DateTimeOffset expectation = 27.March(2016).ToDateTimeOffset(1.Hours()); - - // Act - Action action = () => - nullableDateTime.Should().Be(expectation, "because we want to test the failure {0}", "message"); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected nullableDateTime to represent the same point in time as <2016-03-27 +1h> because we want to test the failure message, but found a DateTimeOffset."); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_non_null_value_is_equal_to_null_value() - { - // Arrange - DateTimeOffset? nullableDateTime = 27.March(2016).ToDateTimeOffset(1.Hours()); - DateTimeOffset? expectation = null; - - // Act - Action action = () => - nullableDateTime.Should().Be(expectation, "because we want to test the failure {0}", "message"); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected nullableDateTime to be because we want to test the failure message, but it was <2016-03-27 +1h>."); - } - - [Fact] - public void - When_asserting_different_date_time_offsets_representing_the_same_world_time_it_should_succeed() - { - // Arrange - var specificDate = 1.May(2008).At(6, 32); - - var dateWithFiveHourOffset = new DateTimeOffset(specificDate - 5.Hours(), -5.Hours()); - - var dateWithSixHourOffset = new DateTimeOffset(specificDate - 6.Hours(), -6.Hours()); - - // Act / Assert - dateWithFiveHourOffset.Should().Be(dateWithSixHourOffset); - } - } - - public class NotBe - { - [Fact] - public void Should_succeed_when_asserting_datetimeoffset_value_is_not_equal_to_a_different_value() - { - // Arrange - DateTimeOffset dateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); - DateTimeOffset otherDateTime = new DateTime(2016, 06, 05).ToDateTimeOffset(); - - // Act - Action act = () => dateTime.Should().NotBe(otherDateTime); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_datetimeoffset_value_is_not_equal_to_a_nullable_different_value_notbe_should_succeed() - { - // Arrange - DateTimeOffset dateTime = 4.June(2016).ToDateTimeOffset(); - DateTimeOffset? otherDateTime = 5.June(2016).ToDateTimeOffset(); - - // Act - Action act = () => dateTime.Should().NotBe(otherDateTime); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void Should_fail_when_asserting_datetimeoffset_value_is_not_equal_to_the_same_value() - { - // Arrange - var dateTime = new DateTimeOffset(10.March(2012), 1.Hours()); - var sameDateTime = new DateTimeOffset(10.March(2012), 1.Hours()); - - // Act - Action act = - () => dateTime.Should().NotBe(sameDateTime, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Did not expect dateTime to represent the same point in time as <2012-03-10 +1h> because we want to test the failure message, but it did."); - } - - [Fact] - public void When_datetimeoffset_value_is_not_equal_to_the_same_nullable_value_notbe_should_failed() - { - // Arrange - DateTimeOffset dateTime = new(10.March(2012), 1.Hours()); - DateTimeOffset? sameDateTime = new DateTimeOffset(10.March(2012), 1.Hours()); - - // Act - Action act = - () => dateTime.Should().NotBe(sameDateTime, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Did not expect dateTime to represent the same point in time as <2012-03-10 +1h> because we want to test the failure message, but it did."); - } - - [Fact] - public void - When_asserting_different_date_time_offsets_representing_different_world_times_it_should_not_succeed() - { - // Arrange - var specificDate = 1.May(2008).At(6, 32); - - var dateWithZeroHourOffset = new DateTimeOffset(specificDate, TimeSpan.Zero); - var dateWithOneHourOffset = new DateTimeOffset(specificDate, 1.Hours()); - - // Act / Assert - dateWithZeroHourOffset.Should().NotBe(dateWithOneHourOffset); - } - } - - public class BeExactly - { - [Fact] - public void Should_succeed_when_asserting_value_is_exactly_equal_to_the_same_value() - { - // Arrange - DateTimeOffset dateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); - DateTimeOffset sameDateTime = new DateTime(2016, 06, 04).ToDateTimeOffset(); - - // Act / Assert - dateTime.Should().BeExactly(sameDateTime); - } - - [Fact] - public void Should_succeed_when_asserting_value_is_exactly_equal_to_the_same_nullable_value() - { - // Arrange - DateTimeOffset dateTime = 4.June(2016).ToDateTimeOffset(); - DateTimeOffset? sameDateTime = 4.June(2016).ToDateTimeOffset(); - - // Act / Assert - dateTime.Should().BeExactly(sameDateTime); - } - - [Fact] - public void Should_fail_when_asserting_value_is_exactly_equal_to_a_different_value() - { - // Arrange - var dateTime = 10.March(2012).WithOffset(1.Hours()); - var otherDateTime = dateTime.ToUniversalTime(); - - // Act - Action act = () => dateTime.Should().BeExactly(otherDateTime, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dateTime to be exactly <2012-03-09 23:00:00 +0h>*failure message, but it was <2012-03-10 +1h>."); - } - - [Fact] - public void Should_fail_when_asserting_value_is_exactly_equal_to_a_different_nullable_value() - { - // Arrange - DateTimeOffset dateTime = 10.March(2012).WithOffset(1.Hours()); - DateTimeOffset? otherDateTime = dateTime.ToUniversalTime(); - - // Act - Action act = () => dateTime.Should().BeExactly(otherDateTime, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Expected dateTime to be exactly <2012-03-09 23:00:00 +0h>*failure message, but it was <2012-03-10 +1h>."); - } - - [Fact] - public void Should_succeed_when_asserting_nullable_value_is_exactly_equal_to_the_same_nullable_value() - { - // Arrange - DateTimeOffset? nullableDateTimeA = new DateTime(2016, 06, 04).ToDateTimeOffset(); - DateTimeOffset? nullableDateTimeB = new DateTime(2016, 06, 04).ToDateTimeOffset(); - - // Act / Assert - nullableDateTimeA.Should().BeExactly(nullableDateTimeB); - } - - [Fact] - public void Should_succeed_when_asserting_nullable_null_value_exactly_equals_null() - { - // Arrange - DateTimeOffset? nullableDateTimeA = null; - DateTimeOffset? nullableDateTimeB = null; - - // Act / Assert - nullableDateTimeA.Should().BeExactly(nullableDateTimeB); - } - - [Fact] - public void Should_fail_when_asserting_nullable_value_exactly_equals_a_different_value() - { - // Arrange - DateTimeOffset? nullableDateTimeA = new DateTime(2016, 06, 04).ToDateTimeOffset(); - DateTimeOffset? nullableDateTimeB = new DateTime(2016, 06, 06).ToDateTimeOffset(); - - // Act - Action action = () => - nullableDateTimeA.Should().BeExactly(nullableDateTimeB); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_null_value_is_exactly_equal_to_another_value() - { - // Arrange - DateTimeOffset? nullableDateTime = null; - DateTimeOffset expectation = 27.March(2016).ToDateTimeOffset(1.Hours()); - - // Act - Action action = () => - nullableDateTime.Should().BeExactly(expectation, "because we want to test the failure {0}", "message"); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected nullableDateTime to be exactly <2016-03-27 +1h> because we want to test the failure message, but found a DateTimeOffset."); - } - } - - public class NotBeExactly - { - [Fact] - public void Should_succeed_when_asserting_value_is_not_exactly_equal_to_a_different_value() - { - // Arrange - DateTimeOffset dateTime = 10.March(2012).WithOffset(1.Hours()); - DateTimeOffset otherDateTime = dateTime.ToUniversalTime(); - - // Act / Assert - dateTime.Should().NotBeExactly(otherDateTime); - } - - [Fact] - public void Should_succeed_when_asserting_value_is_not_exactly_equal_to_a_different_nullable_value() - { - // Arrange - DateTimeOffset dateTime = 10.March(2012).WithOffset(1.Hours()); - DateTimeOffset? otherDateTime = dateTime.ToUniversalTime(); - - // Act / Assert - dateTime.Should().NotBeExactly(otherDateTime); - } - - [Fact] - public void Should_fail_when_asserting_value_is_not_exactly_equal_to_the_same_value() - { - // Arrange - var dateTime = new DateTimeOffset(10.March(2012), 1.Hours()); - var sameDateTime = new DateTimeOffset(10.March(2012), 1.Hours()); - - // Act - Action act = - () => dateTime.Should().NotBeExactly(sameDateTime, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Did not expect dateTime to be exactly <2012-03-10 +1h> because we want to test the failure message, but it was."); - } - - [Fact] - public void Should_fail_when_asserting_value_is_not_exactly_equal_to_the_same_nullable_value() - { - // Arrange - DateTimeOffset dateTime = new(10.March(2012), 1.Hours()); - DateTimeOffset? sameDateTime = new DateTimeOffset(10.March(2012), 1.Hours()); - - // Act - Action act = - () => dateTime.Should().NotBeExactly(sameDateTime, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw().WithMessage( - "Did not expect dateTime to be exactly <2012-03-10 +1h> because we want to test the failure message, but it was."); - } - } - - public class BeCloseTo - { - [Fact] - public void When_asserting_that_time_is_close_to_a_negative_precision_it_should_throw() - { - // Arrange - var dateTime = DateTimeOffset.UtcNow; - var actual = new DateTimeOffset(dateTime.Ticks - 1, TimeSpan.Zero); - - // Act - Action act = () => actual.Should().BeCloseTo(dateTime, -1.Ticks()); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_a_datetimeoffset_is_close_to_a_later_datetimeoffset_by_one_tick_it_should_succeed() - { - // Arrange - var dateTime = DateTimeOffset.UtcNow; - var actual = new DateTimeOffset(dateTime.Ticks - 1, TimeSpan.Zero); - - // Act - Action act = () => actual.Should().BeCloseTo(dateTime, TimeSpan.FromTicks(1)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_datetimeoffset_is_close_to_an_earlier_datetimeoffset_by_one_tick_it_should_succeed() - { - // Arrange - var dateTime = DateTimeOffset.UtcNow; - var actual = new DateTimeOffset(dateTime.Ticks + 1, TimeSpan.Zero); - - // Act - Action act = () => actual.Should().BeCloseTo(dateTime, TimeSpan.FromTicks(1)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_datetimeoffset_is_close_to_a_MinValue_by_one_tick_it_should_succeed() - { - // Arrange - var dateTime = DateTimeOffset.MinValue; - var actual = new DateTimeOffset(dateTime.Ticks + 1, TimeSpan.Zero); - - // Act - Action act = () => actual.Should().BeCloseTo(dateTime, TimeSpan.FromTicks(1)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_datetimeoffset_is_close_to_a_MaxValue_by_one_tick_it_should_succeed() - { - // Arrange - var dateTime = DateTimeOffset.MaxValue; - var actual = new DateTimeOffset(dateTime.Ticks - 1, TimeSpan.Zero); - - // Act - Action act = () => actual.Should().BeCloseTo(dateTime, TimeSpan.FromTicks(1)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_close_to_a_later_datetimeoffset_it_should_succeed() - { - // Arrange - DateTimeOffset time = new(2016, 06, 04, 12, 15, 30, 980, TimeSpan.Zero); - DateTimeOffset nearbyTime = new(2016, 06, 04, 12, 15, 31, 0, TimeSpan.Zero); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_close_to_an_earlier_datetimeoffset_it_should_succeed() - { - // Arrange - DateTimeOffset time = new(2016, 06, 04, 12, 15, 31, 020, TimeSpan.Zero); - DateTimeOffset nearbyTime = new(2016, 06, 04, 12, 15, 31, 0, TimeSpan.Zero); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void - When_asserting_subject_datetimeoffset_is_close_to_another_value_that_is_later_by_more_than_20ms_it_should_throw() - { - // Arrange - DateTimeOffset time = 13.March(2012).At(12, 15, 30, 979).ToDateTimeOffset(1.Hours()); - DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).ToDateTimeOffset(1.Hours()); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected time to be within 20ms from <2012-03-13 12:15:31 +1H>, but <2012-03-13 12:15:30.979 +1H> was off by 21ms."); - } - - [Fact] - public void - When_asserting_subject_datetimeoffset_is_close_to_another_value_that_is_earlier_by_more_than_20ms_it_should_throw() - { - // Arrange - DateTimeOffset time = 13.March(2012).At(12, 15, 31, 021).ToDateTimeOffset(1.Hours()); - DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).ToDateTimeOffset(1.Hours()); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected time to be within 20ms from <2012-03-13 12:15:31 +1h>, but <2012-03-13 12:15:31.021 +1h> was off by 21ms."); - } - - [Fact] - public void - When_asserting_subject_datetimeoffset_is_close_to_another_value_that_is_earlier_by_more_than_a_35ms_timespan_it_should_throw() - { - // Arrange - DateTimeOffset time = 13.March(2012).At(12, 15, 31, 036).WithOffset(1.Hours()); - DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).WithOffset(1.Hours()); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, TimeSpan.FromMilliseconds(35)); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected time to be within 35ms from <2012-03-13 12:15:31 +1h>, but <2012-03-13 12:15:31.036 +1h> was off by 36ms."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_close_to_an_earlier_datetimeoffset_by_35ms_it_should_succeed() - { - // Arrange - DateTimeOffset time = 13.March(2012).At(12, 15, 31, 035).ToDateTimeOffset(1.Hours()); - DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).ToDateTimeOffset(1.Hours()); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 35.Milliseconds()); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_is_close_to_another_it_should_throw() - { - // Arrange - DateTimeOffset? time = null; - DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).ToDateTimeOffset(5.Hours()); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 35.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage("Expected*, but found ."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_close_to_the_maximum_datetimeoffset_it_should_succeed() - { - // Arrange - DateTimeOffset time = DateTimeOffset.MaxValue - 50.Milliseconds(); - DateTimeOffset nearbyTime = DateTimeOffset.MaxValue; - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 100.Milliseconds()); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_close_to_the_minimum_datetimeoffset_it_should_succeed() - { - // Arrange - DateTimeOffset time = DateTimeOffset.MinValue + 50.Milliseconds(); - DateTimeOffset nearbyTime = DateTimeOffset.MinValue; - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 100.Milliseconds()); - - // Assert - act.Should().NotThrow(); - } - } - - public class NotBeCloseTo - { - [Fact] - public void When_asserting_that_time_is_not_close_to_a_negative_precision_it_should_throw() - { - // Arrange - var dateTime = DateTimeOffset.UtcNow; - var actual = new DateTimeOffset(dateTime.Ticks - 1, TimeSpan.Zero); - - // Act - Action act = () => actual.Should().NotBeCloseTo(dateTime, -1.Ticks()); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_a_datetimeoffset_is_close_to_a_later_datetimeoffset_by_one_tick_it_should_fail() - { - // Arrange - var dateTime = DateTimeOffset.UtcNow; - var actual = new DateTimeOffset(dateTime.Ticks - 1, TimeSpan.Zero); - - // Act - Action act = () => actual.Should().NotBeCloseTo(dateTime, TimeSpan.FromTicks(1)); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_datetimeoffset_is_close_to_an_earlier_datetimeoffset_by_one_tick_it_should_fail() - { - // Arrange - var dateTime = DateTimeOffset.UtcNow; - var actual = new DateTimeOffset(dateTime.Ticks + 1, TimeSpan.Zero); - - // Act - Action act = () => actual.Should().NotBeCloseTo(dateTime, TimeSpan.FromTicks(1)); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_datetimeoffset_is_close_to_a_MinValue_by_one_tick_it_should_fail() - { - // Arrange - var dateTime = DateTimeOffset.MinValue; - var actual = new DateTimeOffset(dateTime.Ticks + 1, TimeSpan.Zero); - - // Act - Action act = () => actual.Should().NotBeCloseTo(dateTime, TimeSpan.FromTicks(1)); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_datetimeoffset_is_close_to_a_MaxValue_by_one_tick_it_should_fail() - { - // Arrange - var dateTime = DateTimeOffset.MaxValue; - var actual = new DateTimeOffset(dateTime.Ticks - 1, TimeSpan.Zero); - - // Act - Action act = () => actual.Should().NotBeCloseTo(dateTime, TimeSpan.FromTicks(1)); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_not_close_to_a_later_datetimeoffset_it_should_throw() - { - // Arrange - DateTimeOffset time = new(2016, 06, 04, 12, 15, 30, 980, TimeSpan.Zero); - DateTimeOffset nearbyTime = new(2016, 06, 04, 12, 15, 31, 0, TimeSpan.Zero); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage( - "Did not expect time to be within 20ms from <2016-06-04 12:15:31 +0h>, but it was <2016-06-04 12:15:30.980 +0h>."); - } - - [Fact] - public void - When_asserting_subject_datetimeoffset_is_not_close_to_a_later_datetimeoffset_by_a_20ms_timespan_it_should_throw() - { - // Arrange - DateTimeOffset time = new(2016, 06, 04, 12, 15, 30, 980, TimeSpan.Zero); - DateTimeOffset nearbyTime = new(2016, 06, 04, 12, 15, 31, 0, TimeSpan.Zero); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, TimeSpan.FromMilliseconds(20)); - - // Assert - act.Should().Throw().WithMessage( - "Did not expect time to be within 20ms from <2016-06-04 12:15:31 +0h>, but it was <2016-06-04 12:15:30.980 +0h>."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_not_close_to_an_earlier_datetimeoffset_it_should_throw() - { - // Arrange - DateTimeOffset time = new(2016, 06, 04, 12, 15, 31, 020, TimeSpan.Zero); - DateTimeOffset nearbyTime = new(2016, 06, 04, 12, 15, 31, 0, TimeSpan.Zero); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage( - "Did not expect time to be within 20ms from <2016-06-04 12:15:31 +0h>, but it was <2016-06-04 12:15:31.020 +0h>."); - } - - [Fact] - public void - When_asserting_subject_datetimeoffset_is_not_close_to_another_value_that_is_later_by_more_than_20ms_it_should_succeed() - { - // Arrange - DateTimeOffset time = 13.March(2012).At(12, 15, 30, 979).ToDateTimeOffset(1.Hours()); - DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).ToDateTimeOffset(1.Hours()); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void - When_asserting_subject_datetimeoffset_is_not_close_to_another_value_that_is_earlier_by_more_than_20ms_it_should_succeed() - { - // Arrange - DateTimeOffset time = 13.March(2012).At(12, 15, 31, 021).ToDateTimeOffset(1.Hours()); - DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).ToDateTimeOffset(1.Hours()); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_not_close_to_an_earlier_datetimeoffset_by_35ms_it_should_throw() - { - // Arrange - DateTimeOffset time = 13.March(2012).At(12, 15, 31, 035).ToDateTimeOffset(1.Hours()); - DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).ToDateTimeOffset(1.Hours()); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 35.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage( - "Did not expect time to be within 35ms from <2012-03-13 12:15:31 +1h>, but it was <2012-03-13 12:15:31.035 +1h>."); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_is_not_close_to_another_it_should_throw() - { - // Arrange - DateTimeOffset? time = null; - DateTimeOffset nearbyTime = 13.March(2012).At(12, 15, 31).ToDateTimeOffset(5.Hours()); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 35.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect*, but it was ."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_not_close_to_the_minimum_datetimeoffset_it_should_throw() - { - // Arrange - DateTimeOffset time = DateTimeOffset.MinValue + 50.Milliseconds(); - DateTimeOffset nearbyTime = DateTimeOffset.MinValue; - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 100.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage( - "Did not expect time to be within 100ms from <0001-01-01 00:00:00.000>, but it was <00:00:00.050 +0h>."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_not_close_to_the_maximum_datetimeoffset_it_should_throw() - { - // Arrange - DateTimeOffset time = DateTimeOffset.MaxValue - 50.Milliseconds(); - DateTimeOffset nearbyTime = DateTimeOffset.MaxValue; - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 100.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage( - "Did not expect time to be within 100ms from <9999-12-31 23:59:59.9999999 +0h>, but it was <9999-12-31 23:59:59.9499999 +0h>."); - } - } - - public class BeBefore - { - [Fact] - public void When_asserting_a_point_of_time_is_before_a_later_point_it_should_succeed() - { - // Arrange - DateTimeOffset earlierDate = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset laterDate = new(new DateTime(2016, 06, 04, 0, 5, 0), TimeSpan.Zero); - - // Act - Action act = () => earlierDate.Should().BeBefore(laterDate); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_is_before_earlier_expected_datetimeoffset_it_should_throw() - { - // Arrange - DateTimeOffset expected = new(new DateTime(2016, 06, 03), TimeSpan.Zero); - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().BeBefore(expected); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be before <2016-06-03 +0h>, but it was <2016-06-04 +0h>."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_before_the_same_datetimeoffset_it_should_throw() - { - // Arrange - DateTimeOffset expected = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().BeBefore(expected); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be before <2016-06-04 +0h>, but it was <2016-06-04 +0h>."); - } - } - - public class NotBeBefore - { - [Fact] - public void When_asserting_a_point_of_time_is_not_before_another_it_should_throw() - { - // Arrange - DateTimeOffset earlierDate = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset laterDate = new(new DateTime(2016, 06, 04, 0, 5, 0), TimeSpan.Zero); - - // Act - Action act = () => earlierDate.Should().NotBeBefore(laterDate); - - // Assert - act.Should().Throw().WithMessage( - "Expected earlierDate to be on or after <2016-06-04 00:05:00 +0h>, but it was <2016-06-04 +0h>."); - } - - [Fact] - public void When_asserting_subject_is_not_before_earlier_expected_datetimeoffset_it_should_succeed() - { - // Arrange - DateTimeOffset expected = new(new DateTime(2016, 06, 03), TimeSpan.Zero); - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().NotBeBefore(expected); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_not_before_the_same_datetimeoffset_it_should_succeed() - { - // Arrange - DateTimeOffset expected = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().NotBeBefore(expected); - - // Assert - act.Should().NotThrow(); - } - } - - public class BeOnOrBefore - { - [Fact] - public void When_asserting_subject_datetimeoffset_is_on_or_before_expected_datetimeoffset_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 05), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().BeOnOrBefore(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void - When_asserting_subject_datetimeoffset_is_on_or_before_the_same_date_as_the_expected_datetimeoffset_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().BeOnOrBefore(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_not_on_or_before_earlier_expected_datetimeoffset_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 03), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().BeOnOrBefore(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be on or before <2016-06-03 +0h>, but it was <2016-06-04 +0h>."); - } - } - - public class NotBeOnOrBefore - { - [Fact] - public void When_asserting_subject_datetimeoffset_is_on_or_before_expected_datetimeoffset_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 05), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().NotBeOnOrBefore(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be after <2016-06-05 +0h>, but it was <2016-06-04 +0h>."); - } - - [Fact] - public void - When_asserting_subject_datetimeoffset_is_on_or_before_the_same_date_as_the_expected_datetimeoffset_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().NotBeOnOrBefore(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be after <2016-06-04 +0h>, but it was <2016-06-04 +0h>."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_not_on_or_before_earlier_expected_datetimeoffset_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 03), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().NotBeOnOrBefore(expectation); - - // Assert - act.Should().NotThrow(); - } - } - - public class BeAfter - { - [Fact] - public void When_asserting_subject_datetimeoffset_is_after_earlier_expected_datetimeoffset_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 03), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().BeAfter(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_after_later_expected_datetimeoffset_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 05), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().BeAfter(expectation); - - // Assert - act.Should().Throw().WithMessage( - "Expected subject to be after <2016-06-05 +0h>, but it was <2016-06-04 +0h>."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_after_the_same_expected_datetimeoffset_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().BeAfter(expectation); - - // Assert - act.Should().Throw().WithMessage( - "Expected subject to be after <2016-06-04 +0h>, but it was <2016-06-04 +0h>."); - } - } - - public class NotBeAfter - { - [Fact] - public void When_asserting_subject_datetimeoffset_is_not_after_earlier_expected_datetimeoffset_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 03), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().NotBeAfter(expectation); - - // Assert - act.Should().Throw().WithMessage( - "Expected subject to be on or before <2016-06-03 +0h>, but it was <2016-06-04 +0h>."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_not_after_later_expected_datetimeoffset_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 05), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().NotBeAfter(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_not_after_the_same_expected_datetimeoffset_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().NotBeAfter(expectation); - - // Assert - act.Should().NotThrow(); - } - } - - public class BeOnOrAfter - { - [Fact] - public void When_asserting_subject_datetimeoffset_is_on_or_after_earlier_expected_datetimeoffset_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 03), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().BeOnOrAfter(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_on_or_after_the_same_expected_datetimeoffset_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().BeOnOrAfter(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_on_or_after_later_expected_datetimeoffset_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 05), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().BeOnOrAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be on or after <2016-06-05 +0h>, but it was <2016-06-04 +0h>."); - } - } - - public class NotBeOnOrAfter - { - [Fact] - public void When_asserting_subject_datetimeoffset_is_not_on_or_after_earlier_expected_datetimeoffset_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 03), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().NotBeOnOrAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be before <2016-06-03 +0h>, but it was <2016-06-04 +0h>."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_not_on_or_after_the_same_expected_datetimeoffset_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().NotBeOnOrAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be before <2016-06-04 +0h>, but it was <2016-06-04 +0h>."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_is_not_on_or_after_later_expected_datetimeoffset_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2016, 06, 04), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2016, 06, 05), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().NotBeOnOrAfter(expectation); - - // Assert - act.Should().NotThrow(); - } - } - - public class HaveYear - { - [Fact] - public void When_asserting_subject_datetimeoffset_should_have_year_with_the_same_value_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 06, 04), TimeSpan.Zero); - int expectation = 2009; - - // Act - Action act = () => subject.Should().HaveYear(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_should_have_year_with_a_different_value_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 06, 04), TimeSpan.Zero); - int expectation = 2008; - - // Act - Action act = () => subject.Should().HaveYear(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the year part of subject to be 2008, but it was 2009."); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_should_have_year_should_throw() - { - // Arrange - DateTimeOffset? subject = null; - int expectation = 2008; - - // Act - Action act = () => subject.Should().HaveYear(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the year part of subject to be 2008, but found a DateTimeOffset."); - } - } - - public class NotHaveYear - { - [Fact] - public void When_asserting_subject_datetimeoffset_should_not_have_year_with_the_same_value_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 06, 04), TimeSpan.Zero); - int expectation = 2009; - - // Act - Action act = () => subject.Should().NotHaveYear(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the year part of subject to be 2009, but it was."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_should_not_have_year_with_a_different_value_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 06, 04), TimeSpan.Zero); - int expectation = 2008; - - // Act - Action act = () => subject.Should().NotHaveYear(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_should_not_have_year_should_throw() - { - // Arrange - DateTimeOffset? subject = null; - int expectation = 2008; - - // Act - Action act = () => subject.Should().NotHaveYear(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the year part of subject to be 2008, but found a DateTimeOffset."); - } - } - - public class HaveMonth - { - [Fact] - public void When_asserting_subject_datetimeoffset_should_have_month_with_the_same_value_it_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); - int expectation = 12; - - // Act - Action act = () => subject.Should().HaveMonth(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_should_have_a_month_with_a_different_value_it_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); - int expectation = 11; - - // Act - Action act = () => subject.Should().HaveMonth(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the month part of subject to be 11, but it was 12."); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_should_have_month_should_throw() - { - // Arrange - DateTimeOffset? subject = null; - int expectation = 12; - - // Act - Action act = () => subject.Should().HaveMonth(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the month part of subject to be 12, but found a DateTimeOffset."); - } - } - - public class NotHaveMonth - { - [Fact] - public void When_asserting_subject_datetimeoffset_should_not_have_month_with_the_same_value_it_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); - int expectation = 12; - - // Act - Action act = () => subject.Should().NotHaveMonth(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the month part of subject to be 12, but it was."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_should_not_have_a_month_with_a_different_value_it_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); - int expectation = 11; - - // Act - Action act = () => subject.Should().NotHaveMonth(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_should_not_have_month_should_throw() - { - // Arrange - DateTimeOffset? subject = null; - int expectation = 12; - - // Act - Action act = () => subject.Should().NotHaveMonth(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the month part of subject to be 12, but found a DateTimeOffset."); - } - } - - public class HaveDay - { - [Fact] - public void When_asserting_subject_datetimeoffset_should_have_day_with_the_same_value_it_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); - int expectation = 31; - - // Act - Action act = () => subject.Should().HaveDay(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_should_have_day_with_a_different_value_it_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); - int expectation = 30; - - // Act - Action act = () => subject.Should().HaveDay(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the day part of subject to be 30, but it was 31."); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_should_have_day_should_throw() - { - // Arrange - DateTimeOffset? subject = null; - int expectation = 22; - - // Act - Action act = () => subject.Should().HaveDay(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the day part of subject to be 22, but found a DateTimeOffset."); - } - } - - public class NotHaveDay - { - [Fact] - public void When_asserting_subject_datetimeoffset_should_not_have_day_with_the_same_value_it_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); - int expectation = 31; - - // Act - Action act = () => subject.Should().NotHaveDay(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the day part of subject to be 31, but it was."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_should_not_have_day_with_a_different_value_it_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); - int expectation = 30; - - // Act - Action act = () => subject.Should().NotHaveDay(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_should_not_have_day_should_throw() - { - // Arrange - DateTimeOffset? subject = null; - int expectation = 22; - - // Act - Action act = () => subject.Should().NotHaveDay(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the day part of subject to be 22, but found a DateTimeOffset."); - } - } - - public class HaveHour - { - [Fact] - public void When_asserting_subject_datetimeoffset_should_have_hour_with_the_same_value_it_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); - int expectation = 23; - - // Act - Action act = () => subject.Should().HaveHour(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_should_have_hour_with_different_value_it_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); - int expectation = 22; - - // Act - Action act = () => subject.Should().HaveHour(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the hour part of subject to be 22, but it was 23."); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_should_have_hour_should_throw() - { - // Arrange - DateTimeOffset? subject = null; - int expectation = 22; - - // Act - Action act = () => subject.Should().HaveHour(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the hour part of subject to be 22, but found a DateTimeOffset."); - } - } - - public class NotHaveHour - { - [Fact] - public void When_asserting_subject_datetimeoffset_should_not_have_hour_with_the_same_value_it_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); - int expectation = 23; - - // Act - Action act = () => subject.Should().NotHaveHour(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the hour part of subject to be 23, but it was."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_should_not_have_hour_with_different_value_it_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); - int expectation = 22; - - // Act - Action act = () => subject.Should().NotHaveHour(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_should_not_have_hour_should_throw() - { - // Arrange - DateTimeOffset? subject = null; - int expectation = 22; - - // Act - Action act = () => subject.Should().NotHaveHour(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the hour part of subject to be 22, but found a DateTimeOffset."); - } - } - - public class HaveMinute - { - [Fact] - public void When_asserting_subject_datetimeoffset_should_have_minutes_with_the_same_value_it_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); - int expectation = 59; - - // Act - Action act = () => subject.Should().HaveMinute(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_should_have_minutes_with_different_value_it_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); - int expectation = 58; - - // Act - Action act = () => subject.Should().HaveMinute(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the minute part of subject to be 58, but it was 59."); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_should_have_minute_should_throw() - { - // Arrange - DateTimeOffset? subject = null; - int expectation = 22; - - // Act - Action act = () => subject.Should().HaveMinute(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the minute part of subject to be 22, but found a DateTimeOffset."); - } - } - - public class NotHaveMinute - { - [Fact] - public void When_asserting_subject_datetimeoffset_should_not_have_minutes_with_the_same_value_it_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); - int expectation = 59; - - // Act - Action act = () => subject.Should().NotHaveMinute(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the minute part of subject to be 59, but it was."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_should_not_have_minutes_with_different_value_it_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); - int expectation = 58; - - // Act - Action act = () => subject.Should().NotHaveMinute(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_should_not_have_minute_should_throw() - { - // Arrange - DateTimeOffset? subject = null; - int expectation = 22; - - // Act - Action act = () => subject.Should().NotHaveMinute(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the minute part of subject to be 22, but found a DateTimeOffset."); - } - } - - public class HaveSecond - { - [Fact] - public void When_asserting_subject_datetimeoffset_should_have_seconds_with_the_same_value_it_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); - int expectation = 0; - - // Act - Action act = () => subject.Should().HaveSecond(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_should_have_seconds_with_different_value_it_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); - int expectation = 1; - - // Act - Action act = () => subject.Should().HaveSecond(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the seconds part of subject to be 1, but it was 0."); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_should_have_second_should_throw() - { - // Arrange - DateTimeOffset? subject = null; - int expectation = 22; - - // Act - Action act = () => subject.Should().HaveSecond(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the seconds part of subject to be 22, but found a DateTimeOffset."); - } - } - - public class NotHaveSecond - { - [Fact] - public void When_asserting_subject_datetimeoffset_should_not_have_seconds_with_the_same_value_it_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); - int expectation = 0; - - // Act - Action act = () => subject.Should().NotHaveSecond(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the seconds part of subject to be 0, but it was."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_should_not_have_seconds_with_different_value_it_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); - int expectation = 1; - - // Act - Action act = () => subject.Should().NotHaveSecond(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_should_not_have_second_should_throw() - { - // Arrange - DateTimeOffset? subject = null; - int expectation = 22; - - // Act - Action act = () => subject.Should().NotHaveSecond(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the seconds part of subject to be 22, but found a DateTimeOffset."); - } - } - - public class HaveOffset - { - [Fact] - public void When_asserting_subject_datetimeoffset_should_have_offset_with_the_same_value_it_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.FromHours(7)); - TimeSpan expectation = TimeSpan.FromHours(7); - - // Act - Action act = () => subject.Should().HaveOffset(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_should_have_offset_with_different_value_it_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 10), TimeSpan.Zero); - TimeSpan expectation = TimeSpan.FromHours(3); - - // Act - Action act = () => subject.Should().HaveOffset(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the offset of subject to be 3h, but it was default."); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_should_have_offset_should_throw() - { - // Arrange - DateTimeOffset? subject = null; - TimeSpan expectation = TimeSpan.FromHours(3); - - // Act - Action act = () => subject.Should().HaveOffset(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the offset of subject to be 3h, but found a DateTimeOffset."); - } - } - - public class NotHaveOffset - { - [Fact] - public void When_asserting_subject_datetimeoffset_should_not_have_offset_with_the_same_value_it_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.FromHours(7)); - TimeSpan expectation = TimeSpan.FromHours(7); - - // Act - Action act = () => subject.Should().NotHaveOffset(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the offset of subject to be 7h, but it was."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_should_not_have_offset_with_different_value_it_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00), TimeSpan.Zero); - TimeSpan expectation = TimeSpan.FromHours(3); - - // Act - Action act = () => subject.Should().NotHaveOffset(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_should_not_have_offset_should_throw() - { - // Arrange - DateTimeOffset? subject = null; - TimeSpan expectation = TimeSpan.FromHours(3); - - // Act - Action act = () => subject.Should().NotHaveOffset(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the offset of subject to be 3h, but found a DateTimeOffset."); - } - } - - public class BeSameDateAs - { - [Fact] - public void When_asserting_subject_datetimeoffset_should_be_same_date_as_another_with_the_same_date_it_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 4, 5, 6), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2009, 12, 31), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().BeSameDateAs(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void - When_asserting_subject_datetimeoffset_should_be_same_as_another_with_same_date_but_different_time_it_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 4, 5, 6), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2009, 12, 31, 11, 15, 11), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().BeSameDateAs(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_to_be_same_date_as_another_datetimeoffset_it_should_throw() - { - // Arrange - DateTimeOffset? subject = null; - DateTimeOffset expectation = new(new DateTime(2009, 12, 31), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().BeSameDateAs(expectation); - - // Assert - act.Should().Throw().WithMessage( - "Expected the date part of subject to be <2009-12-31>, but found a DateTimeOffset."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_should_have_same_date_as_another_but_it_doesnt_it_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2009, 12, 30), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().BeSameDateAs(expectation); - - // Assert - act.Should().Throw().WithMessage( - "Expected the date part of subject to be <2009-12-30>, but it was <2009-12-31>."); - } - - [Fact] - public void Can_chain_follow_up_assertions() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 4, 5, 6), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2009, 12, 31, 4, 5, 6), TimeSpan.Zero); - - // Act / Assert - subject.Should().BeSameDateAs(expectation).And.Be(subject); - } - } - - public class NotBeSameDateAs - { - [Fact] - public void When_asserting_subject_datetimeoffset_should_not_be_same_date_as_another_with_the_same_date_it_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 4, 5, 6), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2009, 12, 31), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().NotBeSameDateAs(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the date part of subject to be <2009-12-31>, but it was."); - } - - [Fact] - public void Can_chain_follow_up_assertions() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 4, 5, 6), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2009, 12, 31), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().NotBeSameDateAs(expectation).And.Be(subject); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the date part of subject to be <2009-12-31>, but it was."); - } - - [Fact] - public void - When_asserting_subject_datetimeoffset_should_not_be_same_as_another_with_same_date_but_different_time_it_should_throw() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31, 4, 5, 6), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2009, 12, 31, 11, 15, 11), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().NotBeSameDateAs(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the date part of subject to be <2009-12-31>, but it was."); - } - - [Fact] - public void When_asserting_subject_null_datetimeoffset_to_not_be_same_date_as_another_datetimeoffset_it_should_throw() - { - // Arrange - DateTimeOffset? subject = null; - DateTimeOffset expectation = new(new DateTime(2009, 12, 31), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().NotBeSameDateAs(expectation); - - // Assert - act.Should().Throw().WithMessage( - "Did not expect the date part of subject to be <2009-12-31>, but found a DateTimeOffset."); - } - - [Fact] - public void When_asserting_subject_datetimeoffset_should_not_have_same_date_as_another_but_it_doesnt_it_should_succeed() - { - // Arrange - DateTimeOffset subject = new(new DateTime(2009, 12, 31), TimeSpan.Zero); - DateTimeOffset expectation = new(new DateTime(2009, 12, 30), TimeSpan.Zero); - - // Act - Action act = () => subject.Should().NotBeSameDateAs(expectation); - - // Assert - act.Should().NotThrow(); - } - } - - public class TimespanComparison - { - [Fact] - public void When_date_is_not_more_than_the_required_one_day_before_another_it_should_throw() - { - // Arrange - var target = new DateTimeOffset(2.October(2009), 0.Hours()); - DateTimeOffset subject = target - 1.Days(); - - // Act - Action act = () => subject.Should().BeMoreThan(TimeSpan.FromDays(1)).Before(target, "we like {0}", "that"); - - // Assert - act.Should().Throw().WithMessage( - "Expected subject <2009-10-01 +0h> to be more than 1d before <2009-10-02 +0h> because we like that, but it is behind by 1d."); - } - - [Fact] - public void When_date_is_more_than_the_required_one_day_before_another_it_should_not_throw() - { - // Arrange - var target = new DateTimeOffset(2.October(2009)); - DateTimeOffset subject = target - 25.Hours(); - - // Act / Assert - subject.Should().BeMoreThan(TimeSpan.FromDays(1)).Before(target); - } - - [Fact] - public void When_date_is_not_at_least_one_day_before_another_it_should_throw() - { - // Arrange - var target = new DateTimeOffset(2.October(2009), 0.Hours()); - DateTimeOffset subject = target - 23.Hours(); - - // Act - Action act = () => subject.Should().BeAtLeast(TimeSpan.FromDays(1)).Before(target, "we like {0}", "that"); - - // Assert - act.Should().Throw().WithMessage( - "Expected subject <2009-10-01 01:00:00 +0h> to be at least 1d before <2009-10-02 +0h> because we like that, but it is behind by 23h."); - } - - [Fact] - public void When_date_is_at_least_one_day_before_another_it_should_not_throw() - { - // Arrange - var target = new DateTimeOffset(2.October(2009)); - DateTimeOffset subject = target - 24.Hours(); - - // Act / Assert - subject.Should().BeAtLeast(TimeSpan.FromDays(1)).Before(target); - } - - [Fact] - public void When_time_is_not_at_exactly_20_minutes_before_another_time_it_should_throw() - { - // Arrange - DateTimeOffset target = 1.January(0001).At(12, 55).ToDateTimeOffset(); - DateTimeOffset subject = 1.January(0001).At(12, 36).ToDateTimeOffset(); - - // Act - Action act = - () => subject.Should().BeExactly(TimeSpan.FromMinutes(20)).Before(target, "{0} minutes is enough", 20); - - // Assert - act.Should().Throw().WithMessage( - "Expected subject <12:36:00 +0h> to be exactly 20m before <12:55:00 +0h> because 20 minutes is enough, but it is behind by 19m."); - } - - [Fact] - public void When_time_is_exactly_90_seconds_before_another_time_it_should_not_throw() - { - // Arrange - DateTimeOffset target = 1.January(0001).At(12, 55).ToDateTimeOffset(); - DateTimeOffset subject = 1.January(0001).At(12, 53, 30).ToDateTimeOffset(); - - // Act / Assert - subject.Should().BeExactly(TimeSpan.FromSeconds(90)).Before(target); - } - - [Fact] - public void When_date_is_not_within_50_hours_before_another_date_it_should_throw() - { - // Arrange - var target = 10.April(2010).At(12, 0).WithOffset(0.Hours()); - DateTimeOffset subject = target - 50.Hours() - 1.Seconds(); - - // Act - Action act = - () => subject.Should().BeWithin(TimeSpan.FromHours(50)).Before(target, "{0} hours is enough", 50); - - // Assert - act.Should().Throw().WithMessage( - "Expected subject <2010-04-08 09:59:59 +0h> to be within 2d and 2h before <2010-04-10 12:00:00 +0h> because 50 hours is enough, but it is behind by 2d, 2h and 1s."); - } - - [Fact] - public void When_date_is_exactly_within_1d_before_another_date_it_should_not_throw() - { - // Arrange - var target = new DateTimeOffset(10.April(2010)); - DateTimeOffset subject = target - 1.Days(); - - // Act / Assert - subject.Should().BeWithin(TimeSpan.FromHours(24)).Before(target); - } - - [Fact] - public void When_date_is_within_1d_before_another_date_it_should_not_throw() - { - // Arrange - var target = new DateTimeOffset(10.April(2010)); - DateTimeOffset subject = target - 23.Hours(); - - // Act / Assert - subject.Should().BeWithin(TimeSpan.FromHours(24)).Before(target); - } - - [Fact] - public void When_a_utc_date_is_within_0s_before_itself_it_should_not_throw() - { - // Arrange - var date = DateTimeOffset.UtcNow; // local timezone differs from +0h - - // Act / Assert - date.Should().BeWithin(TimeSpan.Zero).Before(date); - } - - [Fact] - public void When_a_utc_date_is_within_0s_after_itself_it_should_not_throw() - { - // Arrange - var date = DateTimeOffset.UtcNow; // local timezone differs from +0h - - // Act / Assert - date.Should().BeWithin(TimeSpan.Zero).After(date); - } - - [Fact] - public void When_time_is_not_less_than_30s_after_another_time_it_should_throw() - { - // Arrange - var target = 1.January(1).At(12, 0, 30).WithOffset(1.Hours()); - DateTimeOffset subject = target + 30.Seconds(); - - // Act - Action act = - () => subject.Should().BeLessThan(TimeSpan.FromSeconds(30)).After(target, "{0}s is the max", 30); - - // Assert - act.Should().Throw().WithMessage( - "Expected subject <12:01:00 +1h> to be less than 30s after <12:00:30 +1h> because 30s is the max, but it is ahead by 30s."); - } - - [Fact] - public void When_time_is_less_than_30s_after_another_time_it_should_not_throw() - { - // Arrange - var target = new DateTimeOffset(1.January(1).At(12, 0, 30)); - DateTimeOffset subject = target + 20.Seconds(); - - // Act / Assert - subject.Should().BeLessThan(TimeSpan.FromSeconds(30)).After(target); - } - - [Fact] - public void When_asserting_subject_be_more_than_10_seconds_after_target_but_subject_is_before_target_it_should_throw() - { - // Arrange - var expectation = 1.January(0001).At(0, 0, 30).WithOffset(0.Hours()); - var subject = 1.January(0001).At(0, 0, 15).WithOffset(0.Hours()); - - // Act - Action action = () => subject.Should().BeMoreThan(10.Seconds()).After(expectation); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected subject <00:00:15 +0h> to be more than 10s after <00:00:30 +0h>, but it is behind by 15s."); - } - - [Theory] - [InlineData(30, 20)] // edge case - [InlineData(30, 15)] - public void When_asserting_subject_be_at_least_10_seconds_after_target_but_subject_is_before_target_it_should_throw( - int targetSeconds, int subjectSeconds) - { - // Arrange - var expectation = 1.January(0001).At(0, 0, targetSeconds).WithOffset(0.Hours()); - var subject = 1.January(0001).At(0, 0, subjectSeconds).WithOffset(0.Hours()); - - // Act - Action action = () => subject.Should().BeAtLeast(10.Seconds()).After(expectation); - - // Assert - action.Should().Throw() - .WithMessage( - $"Expected subject <00:00:{subjectSeconds} +0h> to be at least 10s after <00:00:30 +0h>, but it is behind by {Math.Abs(subjectSeconds - targetSeconds)}s."); - } - - [Fact] - public void When_asserting_subject_be_exactly_10_seconds_after_target_but_subject_is_before_target_it_should_throw() - { - // Arrange - var expectation = 1.January(0001).At(0, 0, 30).WithOffset(0.Hours()); - var subject = 1.January(0001).At(0, 0, 20).WithOffset(0.Hours()); - - // Act - Action action = () => subject.Should().BeExactly(10.Seconds()).After(expectation); - - // Assert - action.Should().Throw() - .WithMessage("Expected subject <00:00:20 +0h> to be exactly 10s after <00:00:30 +0h>, but it is behind by 10s."); - } - - [Theory] - [InlineData(30, 20)] // edge case - [InlineData(30, 25)] - public void When_asserting_subject_be_within_10_seconds_after_target_but_subject_is_before_target_it_should_throw( - int targetSeconds, int subjectSeconds) - { - // Arrange - var expectation = 1.January(0001).At(0, 0, targetSeconds).WithOffset(0.Hours()); - var subject = 1.January(0001).At(0, 0, subjectSeconds).WithOffset(0.Hours()); - - // Act - Action action = () => subject.Should().BeWithin(10.Seconds()).After(expectation); - - // Assert - action.Should().Throw() - .WithMessage( - $"Expected subject <00:00:{subjectSeconds} +0h> to be within 10s after <00:00:30 +0h>, but it is behind by {Math.Abs(subjectSeconds - targetSeconds)}s."); - } - - [Fact] - public void When_asserting_subject_be_less_than_10_seconds_after_target_but_subject_is_before_target_it_should_throw() - { - // Arrange - var expectation = 1.January(0001).At(0, 0, 30).WithOffset(0.Hours()); - var subject = 1.January(0001).At(0, 0, 25).WithOffset(0.Hours()); - - // Act - Action action = () => subject.Should().BeLessThan(10.Seconds()).After(expectation); - - // Assert - action.Should().Throw() - .WithMessage("Expected subject <00:00:25 +0h> to be less than 10s after <00:00:30 +0h>, but it is behind by 5s."); - } - - [Fact] - public void When_asserting_subject_be_more_than_10_seconds_before_target_but_subject_is_after_target_it_should_throw() - { - // Arrange - var expectation = 1.January(0001).At(0, 0, 30).WithOffset(0.Hours()); - var subject = 1.January(0001).At(0, 0, 45).WithOffset(0.Hours()); - - // Act - Action action = () => subject.Should().BeMoreThan(10.Seconds()).Before(expectation); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected subject <00:00:45 +0h> to be more than 10s before <00:00:30 +0h>, but it is ahead by 15s."); - } - - [Theory] - [InlineData(30, 40)] // edge case - [InlineData(30, 45)] - public void When_asserting_subject_be_at_least_10_seconds_before_target_but_subject_is_after_target_it_should_throw( - int targetSeconds, int subjectSeconds) - { - // Arrange - var expectation = 1.January(0001).At(0, 0, targetSeconds).WithOffset(0.Hours()); - var subject = 1.January(0001).At(0, 0, subjectSeconds).WithOffset(0.Hours()); - - // Act - Action action = () => subject.Should().BeAtLeast(10.Seconds()).Before(expectation); - - // Assert - action.Should().Throw() - .WithMessage( - $"Expected subject <00:00:{subjectSeconds} +0h> to be at least 10s before <00:00:30 +0h>, but it is ahead by {Math.Abs(subjectSeconds - targetSeconds)}s."); - } - - [Fact] - public void When_asserting_subject_be_exactly_10_seconds_before_target_but_subject_is_after_target_it_should_throw() - { - // Arrange - var expectation = 1.January(0001).At(0, 0, 30).WithOffset(0.Hours()); - var subject = 1.January(0001).At(0, 0, 40).WithOffset(0.Hours()); - - // Act - Action action = () => subject.Should().BeExactly(10.Seconds()).Before(expectation); - - // Assert - action.Should().Throw() - .WithMessage("Expected subject <00:00:40 +0h> to be exactly 10s before <00:00:30 +0h>, but it is ahead by 10s."); - } - - [Theory] - [InlineData(30, 40)] // edge case - [InlineData(30, 35)] - public void When_asserting_subject_be_within_10_seconds_before_target_but_subject_is_after_target_it_should_throw( - int targetSeconds, int subjectSeconds) - { - // Arrange - var expectation = 1.January(0001).At(0, 0, targetSeconds).WithOffset(0.Hours()); - var subject = 1.January(0001).At(0, 0, subjectSeconds).WithOffset(0.Hours()); - - // Act - Action action = () => subject.Should().BeWithin(10.Seconds()).Before(expectation); - - // Assert - action.Should().Throw() - .WithMessage( - $"Expected subject <00:00:{subjectSeconds} +0h> to be within 10s before <00:00:30 +0h>, but it is ahead by {Math.Abs(subjectSeconds - targetSeconds)}s."); - } - - [Fact] - public void When_asserting_subject_be_less_than_10_seconds_before_target_but_subject_is_after_target_it_should_throw() - { - // Arrange - var expectation = 1.January(0001).At(0, 0, 30).WithOffset(0.Hours()); - var subject = 1.January(0001).At(0, 0, 45).WithOffset(0.Hours()); - - // Act - Action action = () => subject.Should().BeLessThan(10.Seconds()).Before(expectation); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected subject <00:00:45 +0h> to be less than 10s before <00:00:30 +0h>, but it is ahead by 15s."); - } - - [Fact] - public void Should_throw_a_helpful_error_when_accidentally_using_equals_with_a_range() - { - // Arrange - DateTimeOffset someDateTimeOffset = new(2022, 9, 25, 13, 48, 42, 0, TimeSpan.Zero); - - // Act - var action = () => someDateTimeOffset.Should().BeLessThan(0.Seconds()).Equals(null); - - // Assert - action.Should().Throw() - .WithMessage("Equals is not part of Fluent Assertions. Did you mean Before() or After() instead?"); - } - } - public class ChainingConstraint { [Fact] @@ -2532,125 +27,6 @@ public void Should_support_chaining_constraints_with_and() } } - public class BeOneOf - { - [Fact] - public void When_a_value_is_not_one_of_the_specified_values_it_should_throw() - { - // Arrange - var value = new DateTimeOffset(31.December(2016), 1.Hours()); - - // Act - Action action = () => value.Should().BeOneOf(value + 1.Days(), value + 4.Hours()); - - // Assert - action.Should().Throw().WithMessage( - "Expected value to be one of {<2017-01-01 +1h>, <2016-12-31 04:00:00 +1h>}, but it was <2016-12-31 +1h>."); - } - - [Fact] - public void When_a_value_is_one_of_the_specified_param_values_follow_up_assertions_works() - { - // Arrange - var value = new DateTimeOffset(31.December(2016), 1.Hours()); - - // Act / Assert - value.Should().BeOneOf(value, value + 1.Hours()) - .And.Be(31.December(2016).WithOffset(1.Hours())); - } - - [Fact] - public void When_a_value_is_one_of_the_specified_nullable_params_values_follow_up_assertions_works() - { - // Arrange - var value = new DateTimeOffset(31.December(2016), 1.Hours()); - - // Act / Assert - value.Should().BeOneOf(null, value, value + 1.Hours()) - .And.Be(31.December(2016).WithOffset(1.Hours())); - } - - [Fact] - public void When_a_value_is_one_of_the_specified_enumerable_values_follow_up_assertions_works() - { - // Arrange - var value = new DateTimeOffset(31.December(2016), 1.Hours()); - var expected = new[] { value, value + 1.Hours() }.AsEnumerable(); - - // Act / Assert - value.Should().BeOneOf(expected) - .And.Be(31.December(2016).WithOffset(1.Hours())); - } - - [Fact] - public void When_a_value_is_one_of_the_specified_nullable_enumerable_follow_up_assertions_works() - { - // Arrange - var value = new DateTimeOffset(31.December(2016), 1.Hours()); - var expected = new DateTimeOffset?[] { null, value, value + 1.Hours() }.AsEnumerable(); - - // Act / Assert - value.Should().BeOneOf(expected) - .And.Be(31.December(2016).WithOffset(1.Hours())); - } - - [Fact] - public void When_a_value_is_not_one_of_the_specified_values_it_should_throw_with_descriptive_message() - { - // Arrange - DateTimeOffset value = 31.December(2016).WithOffset(1.Hours()); - - // Act - Action action = () => value.Should().BeOneOf(new[] { value + 1.Days(), value + 2.Days() }, "because it's true"); - - // Assert - action.Should().Throw().WithMessage( - "Expected value to be one of {<2017-01-01 +1h>, <2017-01-02 +1h>} because it's true, but it was <2016-12-31 +1h>."); - } - - [Fact] - public void When_a_value_is_one_of_the_specified_values_it_should_succeed() - { - // Arrange - DateTimeOffset value = new(2016, 12, 30, 23, 58, 57, TimeSpan.FromHours(4)); - - // Act - Action action = () => value.Should().BeOneOf(new DateTimeOffset(2216, 1, 30, 0, 5, 7, TimeSpan.FromHours(2)), - new DateTimeOffset(2016, 12, 30, 23, 58, 57, TimeSpan.FromHours(4))); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void When_a_null_value_is_not_one_of_the_specified_values_it_should_throw() - { - // Arrange - DateTimeOffset? value = null; - - // Act - Action action = () => value.Should().BeOneOf(new DateTimeOffset(2216, 1, 30, 0, 5, 7, TimeSpan.FromHours(1)), - new DateTimeOffset(2016, 2, 10, 2, 45, 7, TimeSpan.FromHours(2))); - - // Assert - action.Should().Throw().WithMessage( - "Expected value to be one of {<2216-01-30 00:05:07 +1h>, <2016-02-10 02:45:07 +2h>}, but it was ."); - } - - [Fact] - public void When_a_value_is_one_of_the_specified_values_it_should_succeed_when_datetimeoffset_is_null() - { - // Arrange - DateTimeOffset? value = null; - - // Act - Action action = () => value.Should().BeOneOf(new DateTimeOffset(2216, 1, 30, 0, 5, 7, TimeSpan.Zero), null); - - // Assert - action.Should().NotThrow(); - } - } - public class Miscellaneous { [Fact] From df0ffc452da0d920a12ded223137724e823fdaf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Wed, 1 Nov 2023 16:07:42 +0100 Subject: [PATCH 152/845] Split DateTimeAssertionSpecs (#2427) --- .../Primitives/DateTimeAssertionSpecs.Be.cs | 254 ++ .../DateTimeAssertionSpecs.BeAfter.cs | 101 + .../DateTimeAssertionSpecs.BeAtLeast.cs | 76 + .../DateTimeAssertionSpecs.BeBefore.cs | 101 + .../DateTimeAssertionSpecs.BeCloseTo.cs | 433 +++ .../DateTimeAssertionSpecs.BeExactly.cs | 69 + .../Primitives/DateTimeAssertionSpecs.BeIn.cs | 52 + .../DateTimeAssertionSpecs.BeLessThan.cs | 69 + .../DateTimeAssertionSpecs.BeMoreThan.cs | 68 + .../DateTimeAssertionSpecs.BeNull.cs | 68 + .../DateTimeAssertionSpecs.BeOnOrAfter.cs | 101 + .../DateTimeAssertionSpecs.BeOnOrBefore.cs | 101 + .../DateTimeAssertionSpecs.BeOneOf.cs | 84 + .../DateTimeAssertionSpecs.BeSameDateAs.cs | 125 + .../DateTimeAssertionSpecs.BeWithin.cs | 148 ++ .../DateTimeAssertionSpecs.HaveDay.cs | 102 + .../DateTimeAssertionSpecs.HaveHour.cs | 102 + .../DateTimeAssertionSpecs.HaveMinute.cs | 102 + .../DateTimeAssertionSpecs.HaveMonth.cs | 102 + .../DateTimeAssertionSpecs.HaveSecond.cs | 102 + .../DateTimeAssertionSpecs.HaveValue.cs | 68 + .../DateTimeAssertionSpecs.HaveYear.cs | 102 + .../Primitives/DateTimeAssertionSpecs.cs | 2335 +---------------- 23 files changed, 2531 insertions(+), 2334 deletions(-) create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.Be.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeAfter.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeAtLeast.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeBefore.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeCloseTo.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeExactly.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeIn.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeLessThan.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeMoreThan.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeNull.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeOnOrAfter.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeOnOrBefore.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeOneOf.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeSameDateAs.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeWithin.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveDay.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveHour.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveMinute.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveMonth.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveSecond.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveValue.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveYear.cs diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.Be.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.Be.cs new file mode 100644 index 0000000000..f9668fc0f9 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.Be.cs @@ -0,0 +1,254 @@ +using System; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class Be + { + [Fact] + public void Should_succeed_when_asserting_datetime_value_is_equal_to_the_same_value() + { + // Arrange + DateTime dateTime = new(2016, 06, 04); + DateTime sameDateTime = new(2016, 06, 04); + + // Act + Action act = () => dateTime.Should().Be(sameDateTime); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_datetime_value_is_equal_to_the_same_nullable_value_be_should_succeed() + { + // Arrange + DateTime dateTime = 4.June(2016); + DateTime? sameDateTime = 4.June(2016); + + // Act + Action act = () => dateTime.Should().Be(sameDateTime); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_both_values_are_at_their_minimum_then_it_should_succeed() + { + // Arrange + DateTime dateTime = DateTime.MinValue; + DateTime sameDateTime = DateTime.MinValue; + + // Act + Action act = () => dateTime.Should().Be(sameDateTime); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_both_values_are_at_their_maximum_then_it_should_succeed() + { + // Arrange + DateTime dateTime = DateTime.MaxValue; + DateTime sameDateTime = DateTime.MaxValue; + + // Act + Action act = () => dateTime.Should().Be(sameDateTime); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void Should_fail_when_asserting_datetime_value_is_equal_to_the_different_value() + { + // Arrange + var dateTime = new DateTime(2012, 03, 10); + var otherDateTime = new DateTime(2012, 03, 11); + + // Act + Action act = () => dateTime.Should().Be(otherDateTime, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage("Expected dateTime to be <2012-03-11>*failure message, but found <2012-03-10>."); + } + + [Fact] + public void When_datetime_value_is_equal_to_the_different_nullable_value_be_should_failed() + { + // Arrange + DateTime dateTime = 10.March(2012); + DateTime? otherDateTime = 11.March(2012); + + // Act + Action act = () => dateTime.Should().Be(otherDateTime, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage("Expected dateTime to be <2012-03-11>*failure message, but found <2012-03-10>."); + } + + [Fact] + public void Should_succeed_when_asserting_nullable_numeric_value_equals_the_same_value() + { + // Arrange + DateTime? nullableDateTimeA = new DateTime(2016, 06, 04); + DateTime? nullableDateTimeB = new DateTime(2016, 06, 04); + + // Act + Action action = () => + nullableDateTimeA.Should().Be(nullableDateTimeB); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void When_a_nullable_date_time_is_equal_to_a_normal_date_time_but_the_kinds_differ_it_should_still_succeed() + { + // Arrange + DateTime? nullableDateTime = new DateTime(2014, 4, 20, 9, 11, 0, DateTimeKind.Unspecified); + DateTime normalDateTime = new(2014, 4, 20, 9, 11, 0, DateTimeKind.Utc); + + // Act + Action action = () => + nullableDateTime.Should().Be(normalDateTime); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void When_two_date_times_are_equal_but_the_kinds_differ_it_should_still_succeed() + { + // Arrange + DateTime dateTimeA = new(2014, 4, 20, 9, 11, 0, DateTimeKind.Unspecified); + DateTime dateTimeB = new(2014, 4, 20, 9, 11, 0, DateTimeKind.Utc); + + // Act + Action action = () => + dateTimeA.Should().Be(dateTimeB); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void Should_succeed_when_asserting_nullable_numeric_null_value_equals_null() + { + // Arrange + DateTime? nullableDateTimeA = null; + DateTime? nullableDateTimeB = null; + + // Act + Action action = () => + nullableDateTimeA.Should().Be(nullableDateTimeB); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void Should_fail_when_asserting_nullable_numeric_value_equals_a_different_value() + { + // Arrange + DateTime? nullableDateTimeA = new DateTime(2016, 06, 04); + DateTime? nullableDateTimeB = new DateTime(2016, 06, 06); + + // Act + Action action = () => + nullableDateTimeA.Should().Be(nullableDateTimeB); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void Should_fail_with_descriptive_message_when_asserting_datetime_null_value_is_equal_to_another_value() + { + // Arrange + DateTime? nullableDateTime = null; + + // Act + Action action = () => + nullableDateTime.Should().Be(new DateTime(2016, 06, 04), "because we want to test the failure {0}", "message"); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected nullableDateTime to be <2016-06-04> because we want to test the failure message, but found ."); + } + } + + public class NotBe + { + [Fact] + public void Should_succeed_when_asserting_datetime_value_is_not_equal_to_a_different_value() + { + // Arrange + DateTime dateTime = new(2016, 06, 04); + DateTime otherDateTime = new(2016, 06, 05); + + // Act + Action act = () => dateTime.Should().NotBe(otherDateTime); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_datetime_value_is_not_equal_to_a_different_nullable_value_notbe_should_succeed() + { + // Arrange + DateTime dateTime = 4.June(2016); + DateTime? otherDateTime = 5.June(2016); + + // Act + Action act = () => dateTime.Should().NotBe(otherDateTime); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void Should_fail_when_asserting_datetime_value_is_not_equal_to_the_same_value() + { + // Arrange + var dateTime = DateTime.SpecifyKind(10.March(2012).At(10, 00), DateTimeKind.Local); + var sameDateTime = DateTime.SpecifyKind(10.March(2012).At(10, 00), DateTimeKind.Utc); + + // Act + Action act = + () => dateTime.Should().NotBe(sameDateTime, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected dateTime not to be <2012-03-10 10:00:00> because we want to test the failure message, but it is."); + } + + [Fact] + public void When_datetime_value_is_not_equal_to_the_same_nullable_value_notbe_should_failed() + { + // Arrange + DateTime dateTime = DateTime.SpecifyKind(10.March(2012).At(10, 00), DateTimeKind.Local); + DateTime? sameDateTime = DateTime.SpecifyKind(10.March(2012).At(10, 00), DateTimeKind.Utc); + + // Act + Action act = + () => dateTime.Should().NotBe(sameDateTime, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected dateTime not to be <2012-03-10 10:00:00> because we want to test the failure message, but it is."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeAfter.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeAfter.cs new file mode 100644 index 0000000000..4518e28545 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeAfter.cs @@ -0,0 +1,101 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class BeAfter + { + [Fact] + public void When_asserting_subject_datetime_is_after_earlier_expected_datetime_should_succeed() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 03); + + // Act + Action act = () => subject.Should().BeAfter(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_is_after_later_expected_datetime_should_throw() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 05); + + // Act + Action act = () => subject.Should().BeAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be after <2016-06-05>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_datetime_is_after_the_same_expected_datetime_should_throw() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 04); + + // Act + Action act = () => subject.Should().BeAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be after <2016-06-04>, but found <2016-06-04>."); + } + } + + public class NotBeAfter + { + [Fact] + public void When_asserting_subject_datetime_is_not_after_earlier_expected_datetime_should_throw() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 03); + + // Act + Action act = () => subject.Should().NotBeAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be on or before <2016-06-03>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_datetime_is_not_after_later_expected_datetime_should_succeed() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 05); + + // Act + Action act = () => subject.Should().NotBeAfter(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_is_not_after_the_same_expected_datetime_should_succeed() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 04); + + // Act + Action act = () => subject.Should().NotBeAfter(expectation); + + // Assert + act.Should().NotThrow(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeAtLeast.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeAtLeast.cs new file mode 100644 index 0000000000..8ad538c2e3 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeAtLeast.cs @@ -0,0 +1,76 @@ +using System; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class BeAtLeast + { + [Fact] + public void When_date_is_not_at_least_one_day_before_another_it_should_throw() + { + // Arrange + var target = new DateTime(2009, 10, 2); + DateTime subject = target - 23.Hours(); + + // Act + Action act = () => subject.Should().BeAtLeast(TimeSpan.FromDays(1)).Before(target, "we like {0}", "that"); + + // Assert + act.Should().Throw().WithMessage( + "Expected subject <2009-10-01 01:00:00> to be at least 1d before <2009-10-02> because we like that, but it is behind by 23h."); + } + + [Fact] + public void When_date_is_at_least_one_day_before_another_it_should_not_throw() + { + // Arrange + var target = new DateTime(2009, 10, 2); + DateTime subject = target - 24.Hours(); + + // Act / Assert + subject.Should().BeAtLeast(TimeSpan.FromDays(1)).Before(target); + } + + [Theory] + [InlineData(30, 20)] // edge case + [InlineData(30, 15)] + public void When_asserting_subject_be_at_least_10_seconds_after_target_but_subject_is_before_target_it_should_throw( + int targetSeconds, int subjectSeconds) + { + // Arrange + var expectation = 1.January(0001).At(0, 0, targetSeconds); + var subject = 1.January(0001).At(0, 0, subjectSeconds); + + // Act + Action action = () => subject.Should().BeAtLeast(10.Seconds()).After(expectation); + + // Assert + action.Should().Throw() + .WithMessage( + $"Expected subject <00:00:{subjectSeconds}> to be at least 10s after <00:00:30>, but it is behind by {Math.Abs(subjectSeconds - targetSeconds)}s."); + } + + [Theory] + [InlineData(30, 40)] // edge case + [InlineData(30, 45)] + public void When_asserting_subject_be_at_least_10_seconds_before_target_but_subject_is_after_target_it_should_throw( + int targetSeconds, int subjectSeconds) + { + // Arrange + var expectation = 1.January(0001).At(0, 0, targetSeconds); + var subject = 1.January(0001).At(0, 0, subjectSeconds); + + // Act + Action action = () => subject.Should().BeAtLeast(10.Seconds()).Before(expectation); + + // Assert + action.Should().Throw() + .WithMessage( + $"Expected subject <00:00:{subjectSeconds}> to be at least 10s before <00:00:30>, but it is ahead by {Math.Abs(subjectSeconds - targetSeconds)}s."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeBefore.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeBefore.cs new file mode 100644 index 0000000000..a4f47066d0 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeBefore.cs @@ -0,0 +1,101 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class BeBefore + { + [Fact] + public void When_asserting_a_point_of_time_is_before_a_later_point_it_should_succeed() + { + // Arrange + DateTime earlierDate = DateTime.SpecifyKind(new DateTime(2016, 06, 04), DateTimeKind.Unspecified); + DateTime laterDate = DateTime.SpecifyKind(new DateTime(2016, 06, 04, 0, 5, 0), DateTimeKind.Utc); + + // Act + Action act = () => earlierDate.Should().BeBefore(laterDate); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_is_before_earlier_expected_datetime_it_should_throw() + { + // Arrange + DateTime expected = new(2016, 06, 03); + DateTime subject = new(2016, 06, 04); + + // Act + Action act = () => subject.Should().BeBefore(expected); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be before <2016-06-03>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_datetime_is_before_the_same_datetime_it_should_throw() + { + // Arrange + DateTime expected = new(2016, 06, 04); + DateTime subject = new(2016, 06, 04); + + // Act + Action act = () => subject.Should().BeBefore(expected); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be before <2016-06-04>, but found <2016-06-04>."); + } + } + + public class NotBeBefore + { + [Fact] + public void When_asserting_a_point_of_time_is_not_before_another_it_should_throw() + { + // Arrange + DateTime earlierDate = DateTime.SpecifyKind(new DateTime(2016, 06, 04), DateTimeKind.Unspecified); + DateTime laterDate = DateTime.SpecifyKind(new DateTime(2016, 06, 04, 0, 5, 0), DateTimeKind.Utc); + + // Act + Action act = () => earlierDate.Should().NotBeBefore(laterDate); + + // Assert + act.Should().Throw() + .WithMessage("Expected earlierDate to be on or after <2016-06-04 00:05:00>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_is_not_before_earlier_expected_datetime_it_should_succeed() + { + // Arrange + DateTime expected = new(2016, 06, 03); + DateTime subject = new(2016, 06, 04); + + // Act + Action act = () => subject.Should().NotBeBefore(expected); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_is_not_before_the_same_datetime_it_should_succeed() + { + // Arrange + DateTime expected = new(2016, 06, 04); + DateTime subject = new(2016, 06, 04); + + // Act + Action act = () => subject.Should().NotBeBefore(expected); + + // Assert + act.Should().NotThrow(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeCloseTo.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeCloseTo.cs new file mode 100644 index 0000000000..217a7d84d3 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeCloseTo.cs @@ -0,0 +1,433 @@ +using System; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class BeCloseTo + { + [Fact] + public void When_asserting_that_time_is_close_to_a_negative_precision_it_should_throw() + { + // Arrange + var dateTime = DateTime.UtcNow; + var actual = new DateTime(dateTime.Ticks - 1); + + // Act + Action act = () => actual.Should().BeCloseTo(dateTime, -1.Ticks()); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_a_datetime_is_close_to_a_later_datetime_by_one_tick_it_should_succeed() + { + // Arrange + var dateTime = DateTime.UtcNow; + var actual = new DateTime(dateTime.Ticks - 1); + + // Act + Action act = () => actual.Should().BeCloseTo(dateTime, TimeSpan.FromTicks(1)); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_datetime_is_close_to_an_earlier_datetime_by_one_tick_it_should_succeed() + { + // Arrange + var dateTime = DateTime.UtcNow; + var actual = new DateTime(dateTime.Ticks + 1); + + // Act + Action act = () => actual.Should().BeCloseTo(dateTime, TimeSpan.FromTicks(1)); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_datetime_is_close_to_a_MinValue_by_one_tick_it_should_succeed() + { + // Arrange + var dateTime = DateTime.MinValue; + var actual = new DateTime(dateTime.Ticks + 1); + + // Act + Action act = () => actual.Should().BeCloseTo(dateTime, TimeSpan.FromTicks(1)); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_datetime_is_close_to_a_MaxValue_by_one_tick_it_should_succeed() + { + // Arrange + var dateTime = DateTime.MaxValue; + var actual = new DateTime(dateTime.Ticks - 1); + + // Act + Action act = () => actual.Should().BeCloseTo(dateTime, TimeSpan.FromTicks(1)); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_is_close_to_a_later_datetime_it_should_succeed() + { + // Arrange + DateTime time = DateTime.SpecifyKind(new DateTime(2016, 06, 04).At(12, 15, 30, 980), DateTimeKind.Unspecified); + DateTime nearbyTime = DateTime.SpecifyKind(new DateTime(2016, 06, 04).At(12, 15, 31), DateTimeKind.Utc); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_is_close_to_an_earlier_datetime_it_should_succeed() + { + // Arrange + DateTime time = new DateTime(2016, 06, 04).At(12, 15, 31, 020); + DateTime nearbyTime = new DateTime(2016, 06, 04).At(12, 15, 31); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_is_close_to_another_value_that_is_later_by_more_than_20ms_it_should_throw() + { + // Arrange + DateTime time = 13.March(2012).At(12, 15, 30, 979); + DateTime nearbyTime = 13.March(2012).At(12, 15, 31); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected time to be within 20ms from <2012-03-13 12:15:31>, but <2012-03-13 12:15:30.979> was off by 21ms."); + } + + [Fact] + public void + When_asserting_subject_datetime_is_close_to_another_value_that_is_later_by_more_than_a_20ms_timespan_it_should_throw() + { + // Arrange + DateTime time = 13.March(2012).At(12, 15, 30, 979); + DateTime nearbyTime = 13.March(2012).At(12, 15, 31); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, TimeSpan.FromMilliseconds(20)); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected time to be within 20ms from <2012-03-13 12:15:31>, but <2012-03-13 12:15:30.979> was off by 21ms."); + } + + [Fact] + public void When_asserting_subject_datetime_is_close_to_another_value_that_is_earlier_by_more_than_20ms_it_should_throw() + { + // Arrange + DateTime time = 13.March(2012).At(12, 15, 31, 021); + DateTime nearbyTime = 13.March(2012).At(12, 15, 31); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected time to be within 20ms from <2012-03-13 12:15:31>, but <2012-03-13 12:15:31.021> was off by 21ms."); + } + + [Fact] + public void When_asserting_subject_datetime_is_close_to_an_earlier_datetime_by_35ms_it_should_succeed() + { + // Arrange + DateTime time = new DateTime(2016, 06, 04).At(12, 15, 31, 035); + DateTime nearbyTime = new DateTime(2016, 06, 04).At(12, 15, 31); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 35.Milliseconds()); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetime_is_close_to_another_it_should_throw() + { + // Arrange + DateTime? time = null; + DateTime nearbyTime = new DateTime(2016, 06, 04).At(12, 15, 31); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 35.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage("Expected*, but found ."); + } + + [Fact] + public void When_asserting_subject_datetime_is_close_to_the_minimum_datetime_it_should_succeed() + { + // Arrange + DateTime time = DateTime.MinValue + 50.Milliseconds(); + DateTime nearbyTime = DateTime.MinValue; + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 100.Milliseconds()); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_is_close_to_the_maximum_datetime_it_should_succeed() + { + // Arrange + DateTime time = DateTime.MaxValue - 50.Milliseconds(); + DateTime nearbyTime = DateTime.MaxValue; + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 100.Milliseconds()); + + // Assert + act.Should().NotThrow(); + } + } + + public class NotBeCloseTo + { + [Fact] + public void When_asserting_that_time_is_not_close_to_a_negative_precision_it_should_throw() + { + // Arrange + var dateTime = DateTime.UtcNow; + var actual = new DateTime(dateTime.Ticks - 1); + + // Act + Action act = () => actual.Should().NotBeCloseTo(dateTime, -1.Ticks()); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_a_datetime_is_close_to_a_later_datetime_by_one_tick_it_should_fail() + { + // Arrange + var dateTime = DateTime.UtcNow; + var actual = new DateTime(dateTime.Ticks - 1); + + // Act + Action act = () => actual.Should().NotBeCloseTo(dateTime, TimeSpan.FromTicks(1)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_datetime_is_close_to_an_earlier_datetime_by_one_tick_it_should_fail() + { + // Arrange + var dateTime = DateTime.UtcNow; + var actual = new DateTime(dateTime.Ticks + 1); + + // Act + Action act = () => actual.Should().NotBeCloseTo(dateTime, TimeSpan.FromTicks(1)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_datetime_is_close_to_a_MinValue_by_one_tick_it_should_fail() + { + // Arrange + var dateTime = DateTime.MinValue; + var actual = new DateTime(dateTime.Ticks + 1); + + // Act + Action act = () => actual.Should().NotBeCloseTo(dateTime, TimeSpan.FromTicks(1)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_datetime_is_close_to_a_MaxValue_by_one_tick_it_should_fail() + { + // Arrange + var dateTime = DateTime.MaxValue; + var actual = new DateTime(dateTime.Ticks - 1); + + // Act + Action act = () => actual.Should().NotBeCloseTo(dateTime, TimeSpan.FromTicks(1)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_asserting_subject_datetime_is_not_close_to_a_later_datetime_it_should_throw() + { + // Arrange + DateTime time = DateTime.SpecifyKind(new DateTime(2016, 06, 04).At(12, 15, 30, 980), DateTimeKind.Unspecified); + DateTime nearbyTime = DateTime.SpecifyKind(new DateTime(2016, 06, 04).At(12, 15, 31), DateTimeKind.Utc); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage( + "Did not expect time to be within 20ms from <2016-06-04 12:15:31>, but it was <2016-06-04 12:15:30.980>."); + } + + [Fact] + public void When_asserting_subject_datetime_is_not_close_to_an_earlier_datetime_it_should_throw() + { + // Arrange + DateTime time = new DateTime(2016, 06, 04).At(12, 15, 31, 020); + DateTime nearbyTime = new DateTime(2016, 06, 04).At(12, 15, 31); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage( + "Did not expect time to be within 20ms from <2016-06-04 12:15:31>, but it was <2016-06-04 12:15:31.020>."); + } + + [Fact] + public void When_asserting_subject_datetime_is_not_close_to_an_earlier_datetime_by_a_20ms_timespan_it_should_throw() + { + // Arrange + DateTime time = new DateTime(2016, 06, 04).At(12, 15, 31, 020); + DateTime nearbyTime = new DateTime(2016, 06, 04).At(12, 15, 31); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, TimeSpan.FromMilliseconds(20)); + + // Assert + act.Should().Throw() + .WithMessage( + "Did not expect time to be within 20ms from <2016-06-04 12:15:31>, but it was <2016-06-04 12:15:31.020>."); + } + + [Fact] + public void + When_asserting_subject_datetime_is_not_close_to_another_value_that_is_later_by_more_than_20ms_it_should_succeed() + { + // Arrange + DateTime time = 13.March(2012).At(12, 15, 30, 979); + DateTime nearbyTime = 13.March(2012).At(12, 15, 31); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void + When_asserting_subject_datetime_is_not_close_to_another_value_that_is_earlier_by_more_than_20ms_it_should_succeed() + { + // Arrange + DateTime time = 13.March(2012).At(12, 15, 31, 021); + DateTime nearbyTime = 13.March(2012).At(12, 15, 31); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_is_not_close_to_an_earlier_datetime_by_35ms_it_should_throw() + { + // Arrange + DateTime time = new DateTime(2016, 06, 04).At(12, 15, 31, 035); + DateTime nearbyTime = new DateTime(2016, 06, 04).At(12, 15, 31); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 35.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage( + "Did not expect time to be within 35ms from <2016-06-04 12:15:31>, but it was <2016-06-04 12:15:31.035>."); + } + + [Fact] + public void When_asserting_subject_null_datetime_is_not_close_to_another_it_should_throw() + { + // Arrange + DateTime? time = null; + DateTime nearbyTime = new DateTime(2016, 06, 04).At(12, 15, 31); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 35.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect*, but it was ."); + } + + [Fact] + public void When_asserting_subject_datetime_is_not_close_to_the_minimum_datetime_it_should_throw() + { + // Arrange + DateTime time = DateTime.MinValue + 50.Milliseconds(); + DateTime nearbyTime = DateTime.MinValue; + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 100.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect time to be within 100ms from <0001-01-01 00:00:00.000>, but it was <00:00:00.050>."); + } + + [Fact] + public void When_asserting_subject_datetime_is_not_close_to_the_maximum_datetime_it_should_throw() + { + // Arrange + DateTime time = DateTime.MaxValue - 50.Milliseconds(); + DateTime nearbyTime = DateTime.MaxValue; + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 100.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage( + "Did not expect time to be within 100ms from <9999-12-31 23:59:59.9999999>, but it was <9999-12-31 23:59:59.9499999>."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeExactly.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeExactly.cs new file mode 100644 index 0000000000..6b5ceb3740 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeExactly.cs @@ -0,0 +1,69 @@ +using System; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class BeExactly + { + [Fact] + public void When_time_is_not_at_exactly_20_minutes_before_another_time_it_should_throw() + { + // Arrange + DateTime target = 1.January(0001).At(12, 55); + DateTime subject = 1.January(0001).At(12, 36); + + // Act + Action act = + () => subject.Should().BeExactly(TimeSpan.FromMinutes(20)).Before(target, "{0} minutes is enough", 20); + + // Assert + act.Should().Throw().WithMessage( + "Expected subject <12:36:00> to be exactly 20m before <12:55:00> because 20 minutes is enough, but it is behind by 19m."); + } + + [Fact] + public void When_time_is_exactly_90_seconds_before_another_time_it_should_not_throw() + { + // Arrange + DateTime target = 1.January(0001).At(12, 55); + DateTime subject = 1.January(0001).At(12, 53, 30); + + // Act / Assert + subject.Should().BeExactly(TimeSpan.FromSeconds(90)).Before(target); + } + + [Fact] + public void When_asserting_subject_be_exactly_10_seconds_after_target_but_subject_is_before_target_it_should_throw() + { + // Arrange + var expectation = 1.January(0001).At(0, 0, 30); + var subject = 1.January(0001).At(0, 0, 20); + + // Ac + Action action = () => subject.Should().BeExactly(10.Seconds()).After(expectation); + + // Assert + action.Should().Throw() + .WithMessage("Expected subject <00:00:20> to be exactly 10s after <00:00:30>, but it is behind by 10s."); + } + + [Fact] + public void When_asserting_subject_be_exactly_10_seconds_before_target_but_subject_is_after_target_it_should_throw() + { + // Arrange + var expectation = 1.January(0001).At(0, 0, 30); + var subject = 1.January(0001).At(0, 0, 40); + + // Act + Action action = () => subject.Should().BeExactly(10.Seconds()).Before(expectation); + + // Assert + action.Should().Throw() + .WithMessage("Expected subject <00:00:40> to be exactly 10s before <00:00:30>, but it is ahead by 10s."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeIn.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeIn.cs new file mode 100644 index 0000000000..b280b1a612 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeIn.cs @@ -0,0 +1,52 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class BeIn + { + [Fact] + public void When_asserting_subject_datetime_represents_its_own_kind_it_should_succeed() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00, DateTimeKind.Local); + + // Act + Action act = () => subject.Should().BeIn(DateTimeKind.Local); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_represents_a_different_kind_it_should_throw() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00, DateTimeKind.Local); + + // Act + Action act = () => subject.Should().BeIn(DateTimeKind.Utc); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be in Utc, but found Local."); + } + + [Fact] + public void When_asserting_subject_null_datetime_represents_a_specific_kind_it_should_throw() + { + // Arrange + DateTime? subject = null; + + // Act + Action act = () => subject.Should().BeIn(DateTimeKind.Utc); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be in Utc, but found a DateTime."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeLessThan.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeLessThan.cs new file mode 100644 index 0000000000..dd94faea31 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeLessThan.cs @@ -0,0 +1,69 @@ +using System; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class BeLessThan + { + [Fact] + public void When_time_is_not_less_than_30s_after_another_time_it_should_throw() + { + // Arrange + var target = new DateTime(1, 1, 1, 12, 0, 30); + DateTime subject = target + 30.Seconds(); + + // Act + Action act = + () => subject.Should().BeLessThan(TimeSpan.FromSeconds(30)).After(target, "{0}s is the max", 30); + + // Assert + act.Should().Throw().WithMessage( + "Expected subject <12:01:00> to be less than 30s after <12:00:30> because 30s is the max, but it is ahead by 30s."); + } + + [Fact] + public void When_time_is_less_than_30s_after_another_time_it_should_not_throw() + { + // Arrange + var target = new DateTime(1, 1, 1, 12, 0, 30); + DateTime subject = target + 20.Seconds(); + + // Act / Assert + subject.Should().BeLessThan(TimeSpan.FromSeconds(30)).After(target); + } + + [Fact] + public void When_asserting_subject_be_less_than_10_seconds_after_target_but_subject_is_before_target_it_should_throw() + { + // Arrange + var expectation = 1.January(0001).At(0, 0, 30); + var subject = 1.January(0001).At(0, 0, 25); + + // Act + Action action = () => subject.Should().BeLessThan(10.Seconds()).After(expectation); + + // Assert + action.Should().Throw() + .WithMessage("Expected subject <00:00:25> to be less than 10s after <00:00:30>, but it is behind by 5s."); + } + + [Fact] + public void When_asserting_subject_be_less_than_10_seconds_before_target_but_subject_is_after_target_it_should_throw() + { + // Arrange + var expectation = 1.January(0001).At(0, 0, 30); + var subject = 1.January(0001).At(0, 0, 45); + + // Act + Action action = () => subject.Should().BeLessThan(10.Seconds()).Before(expectation); + + // Assert + action.Should().Throw() + .WithMessage("Expected subject <00:00:45> to be less than 10s before <00:00:30>, but it is ahead by 15s."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeMoreThan.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeMoreThan.cs new file mode 100644 index 0000000000..8de4d2ba23 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeMoreThan.cs @@ -0,0 +1,68 @@ +using System; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class BeMoreThan + { + [Fact] + public void When_date_is_not_more_than_the_required_one_day_before_another_it_should_throw() + { + // Arrange + var target = new DateTime(2009, 10, 2); + DateTime subject = target - 1.Days(); + + // Act + Action act = () => subject.Should().BeMoreThan(TimeSpan.FromDays(1)).Before(target, "we like {0}", "that"); + + // Assert + act.Should().Throw().WithMessage( + "Expected subject <2009-10-01> to be more than 1d before <2009-10-02> because we like that, but it is behind by 1d."); + } + + [Fact] + public void When_date_is_more_than_the_required_one_day_before_another_it_should_not_throw() + { + // Arrange + var target = new DateTime(2009, 10, 2); + DateTime subject = target - 25.Hours(); + + // Act / Assert + subject.Should().BeMoreThan(TimeSpan.FromDays(1)).Before(target); + } + + [Fact] + public void When_asserting_subject_be_more_than_10_seconds_after_target_but_subject_is_before_target_it_should_throw() + { + // Arrange + var expectation = 1.January(0001).At(0, 0, 30); + var subject = 1.January(0001).At(0, 0, 15); + + // Act + Action action = () => subject.Should().BeMoreThan(10.Seconds()).After(expectation); + + // Assert + action.Should().Throw() + .WithMessage("Expected subject <00:00:15> to be more than 10s after <00:00:30>, but it is behind by 15s."); + } + + [Fact] + public void When_asserting_subject_be_more_than_10_seconds_before_target_but_subject_is_after_target_it_should_throw() + { + // Arrange + var expectation = 1.January(0001).At(0, 0, 30); + var subject = 1.January(0001).At(0, 0, 45); + + // Act + Action action = () => subject.Should().BeMoreThan(10.Seconds()).Before(expectation); + + // Assert + action.Should().Throw() + .WithMessage("Expected subject <00:00:45> to be more than 10s before <00:00:30>, but it is ahead by 15s."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeNull.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeNull.cs new file mode 100644 index 0000000000..637a3ebd47 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeNull.cs @@ -0,0 +1,68 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class BeNull + { + [Fact] + public void Should_succeed_when_asserting_nullable_datetime_value_without_a_value_to_be_null() + { + // Arrange + DateTime? nullableDateTime = null; + + // Act + Action action = () => + nullableDateTime.Should().BeNull(); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void Should_fail_when_asserting_nullable_datetime_value_with_a_value_to_be_null() + { + // Arrange + DateTime? nullableDateTime = new DateTime(2016, 06, 04); + + // Act + Action action = () => + nullableDateTime.Should().BeNull(); + + // Assert + action.Should().Throw(); + } + } + + public class NotBeNull + { + [Fact] + public void Should_succeed_when_asserting_nullable_datetime_value_with_a_value_to_not_be_null() + { + // Arrange + DateTime? nullableDateTime = new DateTime(2016, 06, 04); + + // Act + Action action = () => nullableDateTime.Should().NotBeNull(); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void Should_fail_when_asserting_nullable_datetime_value_without_a_value_to_not_be_null() + { + // Arrange + DateTime? nullableDateTime = null; + + // Act + Action action = () => nullableDateTime.Should().NotBeNull(); + + // Assert + action.Should().Throw(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeOnOrAfter.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeOnOrAfter.cs new file mode 100644 index 0000000000..83a826f815 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeOnOrAfter.cs @@ -0,0 +1,101 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class BeOnOrAfter + { + [Fact] + public void When_asserting_subject_datetime_is_on_or_after_earlier_expected_datetime_should_succeed() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 03); + + // Act + Action act = () => subject.Should().BeOnOrAfter(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_is_on_or_after_the_same_expected_datetime_should_succeed() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 04); + + // Act + Action act = () => subject.Should().BeOnOrAfter(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_is_on_or_after_later_expected_datetime_should_throw() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 05); + + // Act + Action act = () => subject.Should().BeOnOrAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be on or after <2016-06-05>, but found <2016-06-04>."); + } + } + + public class NotBeOnOrAfter + { + [Fact] + public void When_asserting_subject_datetime_is_not_on_or_after_earlier_expected_datetime_should_throw() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 03); + + // Act + Action act = () => subject.Should().NotBeOnOrAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be before <2016-06-03>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_datetime_is_not_on_or_after_the_same_expected_datetime_should_throw() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 04); + + // Act + Action act = () => subject.Should().NotBeOnOrAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be before <2016-06-04>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_datetime_is_not_on_or_after_later_expected_datetime_should_succeed() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 05); + + // Act + Action act = () => subject.Should().NotBeOnOrAfter(expectation); + + // Assert + act.Should().NotThrow(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeOnOrBefore.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeOnOrBefore.cs new file mode 100644 index 0000000000..10a02b0259 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeOnOrBefore.cs @@ -0,0 +1,101 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class BeOnOrBefore + { + [Fact] + public void When_asserting_subject_datetime_is_on_or_before_expected_datetime_should_succeed() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 05); + + // Act + Action act = () => subject.Should().BeOnOrBefore(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_is_on_or_before_the_same_date_as_the_expected_datetime_should_succeed() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 04); + + // Act + Action act = () => subject.Should().BeOnOrBefore(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_is_not_on_or_before_earlier_expected_datetime_should_throw() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 03); + + // Act + Action act = () => subject.Should().BeOnOrBefore(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be on or before <2016-06-03>, but found <2016-06-04>."); + } + } + + public class NotBeOnOrBefore + { + [Fact] + public void When_asserting_subject_datetime_is_on_or_before_expected_datetime_should_throw() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 05); + + // Act + Action act = () => subject.Should().NotBeOnOrBefore(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be after <2016-06-05>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_datetime_is_on_or_before_the_same_date_as_the_expected_datetime_should_throw() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 04); + + // Act + Action act = () => subject.Should().NotBeOnOrBefore(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be after <2016-06-04>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_datetime_is_not_on_or_before_earlier_expected_datetime_should_succeed() + { + // Arrange + DateTime subject = new(2016, 06, 04); + DateTime expectation = new(2016, 06, 03); + + // Act + Action act = () => subject.Should().NotBeOnOrBefore(expectation); + + // Assert + act.Should().NotThrow(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeOneOf.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeOneOf.cs new file mode 100644 index 0000000000..b40921b8e4 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeOneOf.cs @@ -0,0 +1,84 @@ +using System; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class BeOneOf + { + [Fact] + public void When_a_value_is_not_one_of_the_specified_values_it_should_throw() + { + // Arrange + DateTime value = new(2016, 12, 30, 23, 58, 57); + + // Act + Action action = () => value.Should().BeOneOf(value + 1.Days(), value + 1.Milliseconds()); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected value to be one of {<2016-12-31 23:58:57>, <2016-12-30 23:58:57.001>}, but found <2016-12-30 23:58:57>."); + } + + [Fact] + public void When_a_value_is_not_one_of_the_specified_values_it_should_throw_with_descriptive_message() + { + // Arrange + DateTime value = new(2016, 12, 30, 23, 58, 57); + + // Act + Action action = () => + value.Should().BeOneOf(new[] { value + 1.Days(), value + 1.Milliseconds() }, "because it's true"); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected value to be one of {<2016-12-31 23:58:57>, <2016-12-30 23:58:57.001>} because it's true, but found <2016-12-30 23:58:57>."); + } + + [Fact] + public void When_a_value_is_one_of_the_specified_values_it_should_succeed() + { + // Arrange + DateTime value = new(2016, 12, 30, 23, 58, 57); + + // Act + Action action = () => value.Should().BeOneOf(new DateTime(2216, 1, 30, 0, 5, 7), + new DateTime(2016, 12, 30, 23, 58, 57), new DateTime(2012, 3, 3)); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void When_a_null_value_is_not_one_of_the_specified_values_it_should_throw() + { + // Arrange + DateTime? value = null; + + // Act + Action action = () => value.Should().BeOneOf(new DateTime(2216, 1, 30, 0, 5, 7), new DateTime(1116, 4, 10, 2, 45, 7)); + + // Assert + action.Should().Throw() + .WithMessage("Expected value to be one of {<2216-01-30 00:05:07>, <1116-04-10 02:45:07>}, but found ."); + } + + [Fact] + public void When_a_value_is_one_of_the_specified_values_it_should_succeed_when_datetime_is_null() + { + // Arrange + DateTime? value = null; + + // Act + Action action = () => value.Should().BeOneOf(new DateTime(2216, 1, 30, 0, 5, 7), null); + + // Assert + action.Should().NotThrow(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeSameDateAs.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeSameDateAs.cs new file mode 100644 index 0000000000..b4d2d6a6ca --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeSameDateAs.cs @@ -0,0 +1,125 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class BeSameDateAs + { + [Fact] + public void When_asserting_subject_datetime_should_be_same_date_as_another_with_the_same_date_it_should_succeed() + { + // Arrange + var subject = new DateTime(2009, 12, 31, 4, 5, 6); + + // Act + Action act = () => subject.Should().BeSameDateAs(new DateTime(2009, 12, 31)); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void + When_asserting_subject_datetime_should_be_same_as_another_with_same_date_but_different_time_it_should_succeed() + { + // Arrange + var subject = new DateTime(2009, 12, 31, 4, 5, 6); + + // Act + Action act = () => subject.Should().BeSameDateAs(new DateTime(2009, 12, 31, 11, 15, 11)); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetime_to_be_same_date_as_another_datetime_it_should_throw() + { + // Arrange + DateTime? subject = null; + + // Act + Action act = () => subject.Should().BeSameDateAs(new DateTime(2009, 12, 31)); + + // Assert + act.Should().Throw().WithMessage( + "Expected the date part of subject to be <2009-12-31>, but found a DateTime."); + } + + [Fact] + public void When_asserting_subject_datetime_should_have_same_date_as_another_but_it_doesnt_it_should_throw() + { + // Arrange + var subject = new DateTime(2009, 12, 31); + + // Act + Action act = () => subject.Should().BeSameDateAs(new DateTime(2009, 12, 30)); + + // Assert + act.Should().Throw().WithMessage( + "Expected the date part of subject to be <2009-12-30>, but found <2009-12-31>."); + } + } + + public class NotBeSameDateAs + { + [Fact] + public void When_asserting_subject_datetime_should_not_be_same_date_as_another_with_the_same_date_it_should_throw() + { + // Arrange + var subject = new DateTime(2009, 12, 31, 4, 5, 6); + + // Act + Action act = () => subject.Should().NotBeSameDateAs(new DateTime(2009, 12, 31)); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the date part of subject to be <2009-12-31>, but it was."); + } + + [Fact] + public void + When_asserting_subject_datetime_should_not_be_same_as_another_with_same_date_but_different_time_it_should_throw() + { + // Arrange + var subject = new DateTime(2009, 12, 31, 4, 5, 6); + + // Act + Action act = () => subject.Should().NotBeSameDateAs(new DateTime(2009, 12, 31, 11, 15, 11)); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the date part of subject to be <2009-12-31>, but it was."); + } + + [Fact] + public void When_asserting_subject_null_datetime_to_not_be_same_date_as_another_datetime_it_should_throw() + { + // Arrange + DateTime? subject = null; + + // Act + Action act = () => subject.Should().NotBeSameDateAs(new DateTime(2009, 12, 31)); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect the date part of subject to be <2009-12-31>, but found a DateTime."); + } + + [Fact] + public void When_asserting_subject_datetime_should_not_have_same_date_as_another_but_it_doesnt_it_should_succeed() + { + // Arrange + var subject = new DateTime(2009, 12, 31); + + // Act + Action act = () => subject.Should().NotBeSameDateAs(new DateTime(2009, 12, 30)); + + // Assert + act.Should().NotThrow(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeWithin.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeWithin.cs new file mode 100644 index 0000000000..2535f16383 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeWithin.cs @@ -0,0 +1,148 @@ +using System; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class BeWithin + { + [Fact] + public void When_date_is_not_within_50_hours_before_another_date_it_should_throw() + { + // Arrange + var target = new DateTime(2010, 4, 10, 12, 0, 0); + DateTime subject = target - 50.Hours() - 1.Seconds(); + + // Act + Action act = + () => subject.Should().BeWithin(TimeSpan.FromHours(50)).Before(target, "{0} hours is enough", 50); + + // Assert + act.Should().Throw().WithMessage( + "Expected subject <2010-04-08 09:59:59> to be within 2d and 2h before <2010-04-10 12:00:00> because 50 hours is enough, but it is behind by 2d, 2h and 1s."); + } + + [Fact] + public void When_date_is_exactly_within_1d_before_another_date_it_should_not_throw() + { + // Arrange + var target = new DateTime(2010, 4, 10); + DateTime subject = target - 1.Days(); + + // Act / Assert + subject.Should().BeWithin(TimeSpan.FromHours(24)).Before(target); + } + + [Fact] + public void When_date_is_within_1d_before_another_date_it_should_not_throw() + { + // Arrange + var target = new DateTime(2010, 4, 10); + DateTime subject = target - 23.Hours(); + + // Act / Assert + subject.Should().BeWithin(TimeSpan.FromHours(24)).Before(target); + } + + [Fact] + public void When_a_utc_date_is_within_0s_before_itself_it_should_not_throw() + { + // Arrange + var date = DateTime.UtcNow; // local timezone differs from UTC + + // Act / Assert + date.Should().BeWithin(TimeSpan.Zero).Before(date); + } + + [Fact] + public void When_a_utc_date_is_within_0s_after_itself_it_should_not_throw() + { + // Arrange + var date = DateTime.UtcNow; // local timezone differs from UTC + + // Act / Assert + date.Should().BeWithin(TimeSpan.Zero).After(date); + } + + [Theory] + [InlineData(30, 20)] // edge case + [InlineData(30, 25)] + public void When_asserting_subject_be_within_10_seconds_after_target_but_subject_is_before_target_it_should_throw( + int targetSeconds, int subjectSeconds) + { + // Arrange + var expectation = 1.January(0001).At(0, 0, targetSeconds); + var subject = 1.January(0001).At(0, 0, subjectSeconds); + + // Act + Action action = () => subject.Should().BeWithin(10.Seconds()).After(expectation); + + // Assert + action.Should().Throw() + .WithMessage( + $"Expected subject <00:00:{subjectSeconds}> to be within 10s after <00:00:30>, but it is behind by {Math.Abs(subjectSeconds - targetSeconds)}s."); + } + + [Theory] + [InlineData(30, 40)] // edge case + [InlineData(30, 35)] + public void When_asserting_subject_be_within_10_seconds_before_target_but_subject_is_after_target_it_should_throw( + int targetSeconds, int subjectSeconds) + { + // Arrange + var expectation = 1.January(0001).At(0, 0, targetSeconds); + var subject = 1.January(0001).At(0, 0, subjectSeconds); + + // Act + Action action = () => subject.Should().BeWithin(10.Seconds()).Before(expectation); + + // Assert + action.Should().Throw() + .WithMessage( + $"Expected subject <00:00:{subjectSeconds}> to be within 10s before <00:00:30>, but it is ahead by {Math.Abs(subjectSeconds - targetSeconds)}s."); + } + + [Fact] + public void Should_throw_because_of_assertion_failure_when_asserting_null_is_within_second_before_specific_date() + { + // Arrange + DateTimeOffset? nullDateTime = null; + DateTimeOffset target = new(2000, 1, 1, 12, 0, 0, TimeSpan.Zero); + + // Act + Action action = () => + nullDateTime.Should() + .BeWithin(TimeSpan.FromSeconds(1)) + .Before(target); + + // Assert + action.Should().Throw() + .Which.Message + .Should().StartWith( + "Expected nullDateTime to be within 1s before <2000-01-01 12:00:00 +0h>, but found a DateTime"); + } + + [Fact] + public void Should_throw_because_of_assertion_failure_when_asserting_null_is_within_second_after_specific_date() + { + // Arrange + DateTimeOffset? nullDateTime = null; + DateTimeOffset target = new(2000, 1, 1, 12, 0, 0, TimeSpan.Zero); + + // Act + Action action = () => + nullDateTime.Should() + .BeWithin(TimeSpan.FromSeconds(1)) + .After(target); + + // Assert + action.Should().Throw() + .Which.Message + .Should().StartWith( + "Expected nullDateTime to be within 1s after <2000-01-01 12:00:00 +0h>, but found a DateTime"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveDay.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveDay.cs new file mode 100644 index 0000000000..30603317df --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveDay.cs @@ -0,0 +1,102 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class HaveDay + { + [Fact] + public void When_asserting_subject_datetime_should_have_day_with_the_same_value_it_should_succeed() + { + // Arrange + DateTime subject = new(2009, 12, 31); + int expectation = 31; + + // Act + Action act = () => subject.Should().HaveDay(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_should_have_day_with_a_different_value_it_should_throw() + { + // Arrange + DateTime subject = new(2009, 12, 31); + int expectation = 30; + + // Act + Action act = () => subject.Should().HaveDay(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the day part of subject to be 30, but found 31."); + } + + [Fact] + public void When_asserting_subject_null_datetime_should_have_day_should_throw() + { + // Arrange + DateTime? subject = null; + int expectation = 22; + + // Act + Action act = () => subject.Should().HaveDay(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the day part of subject to be 22, but found a DateTime."); + } + } + + public class NotHaveDay + { + [Fact] + public void When_asserting_subject_datetime_should_not_have_day_with_the_same_value_it_should_throw() + { + // Arrange + DateTime subject = new(2009, 12, 31); + int expectation = 31; + + // Act + Action act = () => subject.Should().NotHaveDay(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the day part of subject to be 31, but it was."); + } + + [Fact] + public void When_asserting_subject_datetime_should_not_have_day_with_a_different_value_it_should_succeed() + { + // Arrange + DateTime subject = new(2009, 12, 31); + int expectation = 30; + + // Act + Action act = () => subject.Should().NotHaveDay(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetime_should_not_have_day_should_throw() + { + // Arrange + DateTime? subject = null; + int expectation = 22; + + // Act + Action act = () => subject.Should().NotHaveDay(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the day part of subject to be 22, but found a DateTime."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveHour.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveHour.cs new file mode 100644 index 0000000000..0274c5c742 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveHour.cs @@ -0,0 +1,102 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class HaveHour + { + [Fact] + public void When_asserting_subject_datetime_should_have_hour_with_the_same_value_it_should_succeed() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00); + int expectation = 23; + + // Act + Action act = () => subject.Should().HaveHour(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_should_have_hour_with_different_value_it_should_throw() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00); + int expectation = 22; + + // Act + Action act = () => subject.Should().HaveHour(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the hour part of subject to be 22, but found 23."); + } + + [Fact] + public void When_asserting_subject_null_datetime_should_have_hour_should_throw() + { + // Arrange + DateTime? subject = null; + int expectation = 22; + + // Act + Action act = () => subject.Should().HaveHour(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the hour part of subject to be 22, but found a DateTime."); + } + } + + public class NotHaveHour + { + [Fact] + public void When_asserting_subject_datetime_should_not_have_hour_with_the_same_value_it_should_throw() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00); + int expectation = 23; + + // Act + Action act = () => subject.Should().NotHaveHour(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the hour part of subject to be 23, but it was."); + } + + [Fact] + public void When_asserting_subject_datetime_should_not_have_hour_with_different_value_it_should_succeed() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00); + int expectation = 22; + + // Act + Action act = () => subject.Should().NotHaveHour(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetime_should_not_have_hour_should_throw() + { + // Arrange + DateTime? subject = null; + int expectation = 22; + + // Act + Action act = () => subject.Should().NotHaveHour(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the hour part of subject to be 22, but found a DateTime."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveMinute.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveMinute.cs new file mode 100644 index 0000000000..7773e521e1 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveMinute.cs @@ -0,0 +1,102 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class HaveMinute + { + [Fact] + public void When_asserting_subject_datetime_should_have_minutes_with_the_same_value_it_should_succeed() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00); + int expectation = 59; + + // Act + Action act = () => subject.Should().HaveMinute(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_should_have_minutes_with_different_value_it_should_throw() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00); + int expectation = 58; + + // Act + Action act = () => subject.Should().HaveMinute(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the minute part of subject to be 58, but found 59."); + } + + [Fact] + public void When_asserting_subject_null_datetime_should_have_minute_should_throw() + { + // Arrange + DateTime? subject = null; + int expectation = 22; + + // Act + Action act = () => subject.Should().HaveMinute(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the minute part of subject to be 22, but found a DateTime."); + } + } + + public class NotHaveMinute + { + [Fact] + public void When_asserting_subject_datetime_should_not_have_minutes_with_the_same_value_it_should_throw() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00); + int expectation = 59; + + // Act + Action act = () => subject.Should().NotHaveMinute(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the minute part of subject to be 59, but it was."); + } + + [Fact] + public void When_asserting_subject_datetime_should_not_have_minutes_with_different_value_it_should_succeed() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00); + int expectation = 58; + + // Act + Action act = () => subject.Should().NotHaveMinute(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetime_should_not_have_minute_should_throw() + { + // Arrange + DateTime? subject = null; + int expectation = 22; + + // Act + Action act = () => subject.Should().NotHaveMinute(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the minute part of subject to be 22, but found a DateTime."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveMonth.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveMonth.cs new file mode 100644 index 0000000000..a8f34933f4 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveMonth.cs @@ -0,0 +1,102 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class HaveMonth + { + [Fact] + public void When_asserting_subject_datetime_should_have_month_with_the_same_value_it_should_succeed() + { + // Arrange + DateTime subject = new(2009, 12, 31); + int expectation = 12; + + // Act + Action act = () => subject.Should().HaveMonth(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_should_have_a_month_with_a_different_value_it_should_throw() + { + // Arrange + DateTime subject = new(2009, 12, 31); + int expectation = 11; + + // Act + Action act = () => subject.Should().HaveMonth(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the month part of subject to be 11, but found 12."); + } + + [Fact] + public void When_asserting_subject_null_datetime_should_have_month_should_throw() + { + // Arrange + DateTime? subject = null; + int expectation = 12; + + // Act + Action act = () => subject.Should().HaveMonth(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the month part of subject to be 12, but found a DateTime."); + } + } + + public class NotHaveMonth + { + [Fact] + public void When_asserting_subject_datetime_should_not_have_month_with_the_same_value_it_should_throw() + { + // Arrange + DateTime subject = new(2009, 12, 31); + int expectation = 12; + + // Act + Action act = () => subject.Should().NotHaveMonth(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the month part of subject to be 12, but it was."); + } + + [Fact] + public void When_asserting_subject_datetime_should_not_have_a_month_with_a_different_value_it_should_succeed() + { + // Arrange + DateTime subject = new(2009, 12, 31); + int expectation = 11; + + // Act + Action act = () => subject.Should().NotHaveMonth(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetime_should_not_have_month_should_throw() + { + // Arrange + DateTime? subject = null; + int expectation = 12; + + // Act + Action act = () => subject.Should().NotHaveMonth(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the month part of subject to be 12, but found a DateTime."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveSecond.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveSecond.cs new file mode 100644 index 0000000000..547896c9c0 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveSecond.cs @@ -0,0 +1,102 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class HaveSecond + { + [Fact] + public void When_asserting_subject_datetime_should_have_seconds_with_the_same_value_it_should_succeed() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00); + int expectation = 0; + + // Act + Action act = () => subject.Should().HaveSecond(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_should_have_seconds_with_different_value_it_should_throw() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00); + int expectation = 1; + + // Act + Action act = () => subject.Should().HaveSecond(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the seconds part of subject to be 1, but found 0."); + } + + [Fact] + public void When_asserting_subject_null_datetime_should_have_second_should_throw() + { + // Arrange + DateTime? subject = null; + int expectation = 22; + + // Act + Action act = () => subject.Should().HaveSecond(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the seconds part of subject to be 22, but found a DateTime."); + } + } + + public class NotHaveSecond + { + [Fact] + public void When_asserting_subject_datetime_should_not_have_seconds_with_the_same_value_it_should_throw() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00); + int expectation = 0; + + // Act + Action act = () => subject.Should().NotHaveSecond(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the seconds part of subject to be 0, but it was."); + } + + [Fact] + public void When_asserting_subject_datetime_should_not_have_seconds_with_different_value_it_should_succeed() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00); + int expectation = 1; + + // Act + Action act = () => subject.Should().NotHaveSecond(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetime_should_not_have_second_should_throw() + { + // Arrange + DateTime? subject = null; + int expectation = 22; + + // Act + Action act = () => subject.Should().NotHaveSecond(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the seconds part of subject to be 22, but found a DateTime."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveValue.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveValue.cs new file mode 100644 index 0000000000..1e017562b1 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveValue.cs @@ -0,0 +1,68 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class HaveValue + { + [Fact] + public void Should_succeed_when_asserting_nullable_datetime_value_with_a_value_to_have_a_value() + { + // Arrange + DateTime? nullableDateTime = new DateTime(2016, 06, 04); + + // Act + Action action = () => nullableDateTime.Should().HaveValue(); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void Should_fail_when_asserting_nullable_datetime_value_without_a_value_to_have_a_value() + { + // Arrange + DateTime? nullableDateTime = null; + + // Act + Action action = () => nullableDateTime.Should().HaveValue(); + + // Assert + action.Should().Throw(); + } + } + + public class NotHaveValue + { + [Fact] + public void Should_succeed_when_asserting_nullable_datetime_value_without_a_value_to_not_have_a_value() + { + // Arrange + DateTime? nullableDateTime = null; + + // Act + Action action = () => + nullableDateTime.Should().NotHaveValue(); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void Should_fail_when_asserting_nullable_datetime_value_with_a_value_to_not_have_a_value() + { + // Arrange + DateTime? nullableDateTime = new DateTime(2016, 06, 04); + + // Act + Action action = () => + nullableDateTime.Should().NotHaveValue(); + + // Assert + action.Should().Throw(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveYear.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveYear.cs new file mode 100644 index 0000000000..93743a3909 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveYear.cs @@ -0,0 +1,102 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class HaveYear + { + [Fact] + public void When_asserting_subject_datetime_should_have_year_with_the_same_value_should_succeed() + { + // Arrange + DateTime subject = new(2009, 12, 31); + int expectation = 2009; + + // Act + Action act = () => subject.Should().HaveYear(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_datetime_should_have_year_with_a_different_value_should_throw() + { + // Arrange + DateTime subject = new(2009, 12, 31); + int expectation = 2008; + + // Act + Action act = () => subject.Should().HaveYear(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the year part of subject to be 2008, but found 2009."); + } + + [Fact] + public void When_asserting_subject_null_datetime_should_have_year_should_throw() + { + // Arrange + DateTime? subject = null; + int expectation = 2008; + + // Act + Action act = () => subject.Should().HaveYear(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the year part of subject to be 2008, but found ."); + } + } + + public class NotHaveYear + { + [Fact] + public void When_asserting_subject_datetime_should_not_have_year_with_the_same_value_should_throw() + { + // Arrange + DateTime subject = new(2009, 12, 31); + int expectation = 2009; + + // Act + Action act = () => subject.Should().NotHaveYear(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the year part of subject to be 2009, but it was."); + } + + [Fact] + public void When_asserting_subject_datetime_should_not_have_year_with_a_different_value_should_succeed() + { + // Arrange + DateTime subject = new(2009, 12, 31); + int expectation = 2008; + + // Act + Action act = () => subject.Should().NotHaveYear(expectation); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_subject_null_datetime_should_not_have_year_should_throw() + { + // Arrange + DateTime? subject = null; + int expectation = 2008; + + // Act + Action act = () => subject.Should().NotHaveYear(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the year part of subject to be 2008, but found a DateTime."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.cs index e45d43156c..dcc8e89521 100644 --- a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.cs @@ -1,2231 +1,11 @@ using System; using FluentAssertions.Extensions; using Xunit; -using Xunit.Sdk; namespace FluentAssertions.Specs.Primitives; -public class DateTimeAssertionSpecs +public partial class DateTimeAssertionSpecs { - public class HaveValue - { - [Fact] - public void Should_succeed_when_asserting_nullable_datetime_value_with_a_value_to_have_a_value() - { - // Arrange - DateTime? nullableDateTime = new DateTime(2016, 06, 04); - - // Act - Action action = () => nullableDateTime.Should().HaveValue(); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void Should_fail_when_asserting_nullable_datetime_value_without_a_value_to_have_a_value() - { - // Arrange - DateTime? nullableDateTime = null; - - // Act - Action action = () => nullableDateTime.Should().HaveValue(); - - // Assert - action.Should().Throw(); - } - } - - public class NotHaveValue - { - [Fact] - public void Should_succeed_when_asserting_nullable_datetime_value_without_a_value_to_not_have_a_value() - { - // Arrange - DateTime? nullableDateTime = null; - - // Act - Action action = () => - nullableDateTime.Should().NotHaveValue(); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void Should_fail_when_asserting_nullable_datetime_value_with_a_value_to_not_have_a_value() - { - // Arrange - DateTime? nullableDateTime = new DateTime(2016, 06, 04); - - // Act - Action action = () => - nullableDateTime.Should().NotHaveValue(); - - // Assert - action.Should().Throw(); - } - } - - public class NotBeNull - { - [Fact] - public void Should_succeed_when_asserting_nullable_datetime_value_with_a_value_to_not_be_null() - { - // Arrange - DateTime? nullableDateTime = new DateTime(2016, 06, 04); - - // Act - Action action = () => nullableDateTime.Should().NotBeNull(); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void Should_fail_when_asserting_nullable_datetime_value_without_a_value_to_not_be_null() - { - // Arrange - DateTime? nullableDateTime = null; - - // Act - Action action = () => nullableDateTime.Should().NotBeNull(); - - // Assert - action.Should().Throw(); - } - } - - public class BeNull - { - [Fact] - public void Should_succeed_when_asserting_nullable_datetime_value_without_a_value_to_be_null() - { - // Arrange - DateTime? nullableDateTime = null; - - // Act - Action action = () => - nullableDateTime.Should().BeNull(); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void Should_fail_when_asserting_nullable_datetime_value_with_a_value_to_be_null() - { - // Arrange - DateTime? nullableDateTime = new DateTime(2016, 06, 04); - - // Act - Action action = () => - nullableDateTime.Should().BeNull(); - - // Assert - action.Should().Throw(); - } - } - - public class Be - { - [Fact] - public void Should_succeed_when_asserting_datetime_value_is_equal_to_the_same_value() - { - // Arrange - DateTime dateTime = new(2016, 06, 04); - DateTime sameDateTime = new(2016, 06, 04); - - // Act - Action act = () => dateTime.Should().Be(sameDateTime); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_datetime_value_is_equal_to_the_same_nullable_value_be_should_succeed() - { - // Arrange - DateTime dateTime = 4.June(2016); - DateTime? sameDateTime = 4.June(2016); - - // Act - Action act = () => dateTime.Should().Be(sameDateTime); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_both_values_are_at_their_minimum_then_it_should_succeed() - { - // Arrange - DateTime dateTime = DateTime.MinValue; - DateTime sameDateTime = DateTime.MinValue; - - // Act - Action act = () => dateTime.Should().Be(sameDateTime); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_both_values_are_at_their_maximum_then_it_should_succeed() - { - // Arrange - DateTime dateTime = DateTime.MaxValue; - DateTime sameDateTime = DateTime.MaxValue; - - // Act - Action act = () => dateTime.Should().Be(sameDateTime); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void Should_fail_when_asserting_datetime_value_is_equal_to_the_different_value() - { - // Arrange - var dateTime = new DateTime(2012, 03, 10); - var otherDateTime = new DateTime(2012, 03, 11); - - // Act - Action act = () => dateTime.Should().Be(otherDateTime, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage("Expected dateTime to be <2012-03-11>*failure message, but found <2012-03-10>."); - } - - [Fact] - public void When_datetime_value_is_equal_to_the_different_nullable_value_be_should_failed() - { - // Arrange - DateTime dateTime = 10.March(2012); - DateTime? otherDateTime = 11.March(2012); - - // Act - Action act = () => dateTime.Should().Be(otherDateTime, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage("Expected dateTime to be <2012-03-11>*failure message, but found <2012-03-10>."); - } - - [Fact] - public void Should_succeed_when_asserting_nullable_numeric_value_equals_the_same_value() - { - // Arrange - DateTime? nullableDateTimeA = new DateTime(2016, 06, 04); - DateTime? nullableDateTimeB = new DateTime(2016, 06, 04); - - // Act - Action action = () => - nullableDateTimeA.Should().Be(nullableDateTimeB); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void When_a_nullable_date_time_is_equal_to_a_normal_date_time_but_the_kinds_differ_it_should_still_succeed() - { - // Arrange - DateTime? nullableDateTime = new DateTime(2014, 4, 20, 9, 11, 0, DateTimeKind.Unspecified); - DateTime normalDateTime = new(2014, 4, 20, 9, 11, 0, DateTimeKind.Utc); - - // Act - Action action = () => - nullableDateTime.Should().Be(normalDateTime); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void When_two_date_times_are_equal_but_the_kinds_differ_it_should_still_succeed() - { - // Arrange - DateTime dateTimeA = new(2014, 4, 20, 9, 11, 0, DateTimeKind.Unspecified); - DateTime dateTimeB = new(2014, 4, 20, 9, 11, 0, DateTimeKind.Utc); - - // Act - Action action = () => - dateTimeA.Should().Be(dateTimeB); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void Should_succeed_when_asserting_nullable_numeric_null_value_equals_null() - { - // Arrange - DateTime? nullableDateTimeA = null; - DateTime? nullableDateTimeB = null; - - // Act - Action action = () => - nullableDateTimeA.Should().Be(nullableDateTimeB); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void Should_fail_when_asserting_nullable_numeric_value_equals_a_different_value() - { - // Arrange - DateTime? nullableDateTimeA = new DateTime(2016, 06, 04); - DateTime? nullableDateTimeB = new DateTime(2016, 06, 06); - - // Act - Action action = () => - nullableDateTimeA.Should().Be(nullableDateTimeB); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_datetime_null_value_is_equal_to_another_value() - { - // Arrange - DateTime? nullableDateTime = null; - - // Act - Action action = () => - nullableDateTime.Should().Be(new DateTime(2016, 06, 04), "because we want to test the failure {0}", "message"); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected nullableDateTime to be <2016-06-04> because we want to test the failure message, but found ."); - } - } - - public class NotBe - { - [Fact] - public void Should_succeed_when_asserting_datetime_value_is_not_equal_to_a_different_value() - { - // Arrange - DateTime dateTime = new(2016, 06, 04); - DateTime otherDateTime = new(2016, 06, 05); - - // Act - Action act = () => dateTime.Should().NotBe(otherDateTime); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_datetime_value_is_not_equal_to_a_different_nullable_value_notbe_should_succeed() - { - // Arrange - DateTime dateTime = 4.June(2016); - DateTime? otherDateTime = 5.June(2016); - - // Act - Action act = () => dateTime.Should().NotBe(otherDateTime); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void Should_fail_when_asserting_datetime_value_is_not_equal_to_the_same_value() - { - // Arrange - var dateTime = DateTime.SpecifyKind(10.March(2012).At(10, 00), DateTimeKind.Local); - var sameDateTime = DateTime.SpecifyKind(10.March(2012).At(10, 00), DateTimeKind.Utc); - - // Act - Action act = - () => dateTime.Should().NotBe(sameDateTime, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected dateTime not to be <2012-03-10 10:00:00> because we want to test the failure message, but it is."); - } - - [Fact] - public void When_datetime_value_is_not_equal_to_the_same_nullable_value_notbe_should_failed() - { - // Arrange - DateTime dateTime = DateTime.SpecifyKind(10.March(2012).At(10, 00), DateTimeKind.Local); - DateTime? sameDateTime = DateTime.SpecifyKind(10.March(2012).At(10, 00), DateTimeKind.Utc); - - // Act - Action act = - () => dateTime.Should().NotBe(sameDateTime, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected dateTime not to be <2012-03-10 10:00:00> because we want to test the failure message, but it is."); - } - } - - public class BeCloseTo - { - [Fact] - public void When_asserting_that_time_is_close_to_a_negative_precision_it_should_throw() - { - // Arrange - var dateTime = DateTime.UtcNow; - var actual = new DateTime(dateTime.Ticks - 1); - - // Act - Action act = () => actual.Should().BeCloseTo(dateTime, -1.Ticks()); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_a_datetime_is_close_to_a_later_datetime_by_one_tick_it_should_succeed() - { - // Arrange - var dateTime = DateTime.UtcNow; - var actual = new DateTime(dateTime.Ticks - 1); - - // Act - Action act = () => actual.Should().BeCloseTo(dateTime, TimeSpan.FromTicks(1)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_datetime_is_close_to_an_earlier_datetime_by_one_tick_it_should_succeed() - { - // Arrange - var dateTime = DateTime.UtcNow; - var actual = new DateTime(dateTime.Ticks + 1); - - // Act - Action act = () => actual.Should().BeCloseTo(dateTime, TimeSpan.FromTicks(1)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_datetime_is_close_to_a_MinValue_by_one_tick_it_should_succeed() - { - // Arrange - var dateTime = DateTime.MinValue; - var actual = new DateTime(dateTime.Ticks + 1); - - // Act - Action act = () => actual.Should().BeCloseTo(dateTime, TimeSpan.FromTicks(1)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_datetime_is_close_to_a_MaxValue_by_one_tick_it_should_succeed() - { - // Arrange - var dateTime = DateTime.MaxValue; - var actual = new DateTime(dateTime.Ticks - 1); - - // Act - Action act = () => actual.Should().BeCloseTo(dateTime, TimeSpan.FromTicks(1)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_is_close_to_a_later_datetime_it_should_succeed() - { - // Arrange - DateTime time = DateTime.SpecifyKind(new DateTime(2016, 06, 04).At(12, 15, 30, 980), DateTimeKind.Unspecified); - DateTime nearbyTime = DateTime.SpecifyKind(new DateTime(2016, 06, 04).At(12, 15, 31), DateTimeKind.Utc); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_is_close_to_an_earlier_datetime_it_should_succeed() - { - // Arrange - DateTime time = new DateTime(2016, 06, 04).At(12, 15, 31, 020); - DateTime nearbyTime = new DateTime(2016, 06, 04).At(12, 15, 31); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_is_close_to_another_value_that_is_later_by_more_than_20ms_it_should_throw() - { - // Arrange - DateTime time = 13.March(2012).At(12, 15, 30, 979); - DateTime nearbyTime = 13.March(2012).At(12, 15, 31); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected time to be within 20ms from <2012-03-13 12:15:31>, but <2012-03-13 12:15:30.979> was off by 21ms."); - } - - [Fact] - public void - When_asserting_subject_datetime_is_close_to_another_value_that_is_later_by_more_than_a_20ms_timespan_it_should_throw() - { - // Arrange - DateTime time = 13.March(2012).At(12, 15, 30, 979); - DateTime nearbyTime = 13.March(2012).At(12, 15, 31); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, TimeSpan.FromMilliseconds(20)); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected time to be within 20ms from <2012-03-13 12:15:31>, but <2012-03-13 12:15:30.979> was off by 21ms."); - } - - [Fact] - public void When_asserting_subject_datetime_is_close_to_another_value_that_is_earlier_by_more_than_20ms_it_should_throw() - { - // Arrange - DateTime time = 13.March(2012).At(12, 15, 31, 021); - DateTime nearbyTime = 13.March(2012).At(12, 15, 31); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected time to be within 20ms from <2012-03-13 12:15:31>, but <2012-03-13 12:15:31.021> was off by 21ms."); - } - - [Fact] - public void When_asserting_subject_datetime_is_close_to_an_earlier_datetime_by_35ms_it_should_succeed() - { - // Arrange - DateTime time = new DateTime(2016, 06, 04).At(12, 15, 31, 035); - DateTime nearbyTime = new DateTime(2016, 06, 04).At(12, 15, 31); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 35.Milliseconds()); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetime_is_close_to_another_it_should_throw() - { - // Arrange - DateTime? time = null; - DateTime nearbyTime = new DateTime(2016, 06, 04).At(12, 15, 31); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 35.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage("Expected*, but found ."); - } - - [Fact] - public void When_asserting_subject_datetime_is_close_to_the_minimum_datetime_it_should_succeed() - { - // Arrange - DateTime time = DateTime.MinValue + 50.Milliseconds(); - DateTime nearbyTime = DateTime.MinValue; - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 100.Milliseconds()); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_is_close_to_the_maximum_datetime_it_should_succeed() - { - // Arrange - DateTime time = DateTime.MaxValue - 50.Milliseconds(); - DateTime nearbyTime = DateTime.MaxValue; - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 100.Milliseconds()); - - // Assert - act.Should().NotThrow(); - } - } - - public class NotBeCloseTo - { - [Fact] - public void When_asserting_that_time_is_not_close_to_a_negative_precision_it_should_throw() - { - // Arrange - var dateTime = DateTime.UtcNow; - var actual = new DateTime(dateTime.Ticks - 1); - - // Act - Action act = () => actual.Should().NotBeCloseTo(dateTime, -1.Ticks()); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_a_datetime_is_close_to_a_later_datetime_by_one_tick_it_should_fail() - { - // Arrange - var dateTime = DateTime.UtcNow; - var actual = new DateTime(dateTime.Ticks - 1); - - // Act - Action act = () => actual.Should().NotBeCloseTo(dateTime, TimeSpan.FromTicks(1)); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_datetime_is_close_to_an_earlier_datetime_by_one_tick_it_should_fail() - { - // Arrange - var dateTime = DateTime.UtcNow; - var actual = new DateTime(dateTime.Ticks + 1); - - // Act - Action act = () => actual.Should().NotBeCloseTo(dateTime, TimeSpan.FromTicks(1)); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_datetime_is_close_to_a_MinValue_by_one_tick_it_should_fail() - { - // Arrange - var dateTime = DateTime.MinValue; - var actual = new DateTime(dateTime.Ticks + 1); - - // Act - Action act = () => actual.Should().NotBeCloseTo(dateTime, TimeSpan.FromTicks(1)); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_datetime_is_close_to_a_MaxValue_by_one_tick_it_should_fail() - { - // Arrange - var dateTime = DateTime.MaxValue; - var actual = new DateTime(dateTime.Ticks - 1); - - // Act - Action act = () => actual.Should().NotBeCloseTo(dateTime, TimeSpan.FromTicks(1)); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_asserting_subject_datetime_is_not_close_to_a_later_datetime_it_should_throw() - { - // Arrange - DateTime time = DateTime.SpecifyKind(new DateTime(2016, 06, 04).At(12, 15, 30, 980), DateTimeKind.Unspecified); - DateTime nearbyTime = DateTime.SpecifyKind(new DateTime(2016, 06, 04).At(12, 15, 31), DateTimeKind.Utc); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage( - "Did not expect time to be within 20ms from <2016-06-04 12:15:31>, but it was <2016-06-04 12:15:30.980>."); - } - - [Fact] - public void When_asserting_subject_datetime_is_not_close_to_an_earlier_datetime_it_should_throw() - { - // Arrange - DateTime time = new DateTime(2016, 06, 04).At(12, 15, 31, 020); - DateTime nearbyTime = new DateTime(2016, 06, 04).At(12, 15, 31); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage( - "Did not expect time to be within 20ms from <2016-06-04 12:15:31>, but it was <2016-06-04 12:15:31.020>."); - } - - [Fact] - public void When_asserting_subject_datetime_is_not_close_to_an_earlier_datetime_by_a_20ms_timespan_it_should_throw() - { - // Arrange - DateTime time = new DateTime(2016, 06, 04).At(12, 15, 31, 020); - DateTime nearbyTime = new DateTime(2016, 06, 04).At(12, 15, 31); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, TimeSpan.FromMilliseconds(20)); - - // Assert - act.Should().Throw() - .WithMessage( - "Did not expect time to be within 20ms from <2016-06-04 12:15:31>, but it was <2016-06-04 12:15:31.020>."); - } - - [Fact] - public void - When_asserting_subject_datetime_is_not_close_to_another_value_that_is_later_by_more_than_20ms_it_should_succeed() - { - // Arrange - DateTime time = 13.March(2012).At(12, 15, 30, 979); - DateTime nearbyTime = 13.March(2012).At(12, 15, 31); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void - When_asserting_subject_datetime_is_not_close_to_another_value_that_is_earlier_by_more_than_20ms_it_should_succeed() - { - // Arrange - DateTime time = 13.March(2012).At(12, 15, 31, 021); - DateTime nearbyTime = 13.March(2012).At(12, 15, 31); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_is_not_close_to_an_earlier_datetime_by_35ms_it_should_throw() - { - // Arrange - DateTime time = new DateTime(2016, 06, 04).At(12, 15, 31, 035); - DateTime nearbyTime = new DateTime(2016, 06, 04).At(12, 15, 31); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 35.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage( - "Did not expect time to be within 35ms from <2016-06-04 12:15:31>, but it was <2016-06-04 12:15:31.035>."); - } - - [Fact] - public void When_asserting_subject_null_datetime_is_not_close_to_another_it_should_throw() - { - // Arrange - DateTime? time = null; - DateTime nearbyTime = new DateTime(2016, 06, 04).At(12, 15, 31); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 35.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect*, but it was ."); - } - - [Fact] - public void When_asserting_subject_datetime_is_not_close_to_the_minimum_datetime_it_should_throw() - { - // Arrange - DateTime time = DateTime.MinValue + 50.Milliseconds(); - DateTime nearbyTime = DateTime.MinValue; - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 100.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect time to be within 100ms from <0001-01-01 00:00:00.000>, but it was <00:00:00.050>."); - } - - [Fact] - public void When_asserting_subject_datetime_is_not_close_to_the_maximum_datetime_it_should_throw() - { - // Arrange - DateTime time = DateTime.MaxValue - 50.Milliseconds(); - DateTime nearbyTime = DateTime.MaxValue; - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 100.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage( - "Did not expect time to be within 100ms from <9999-12-31 23:59:59.9999999>, but it was <9999-12-31 23:59:59.9499999>."); - } - } - - public class BeBefore - { - [Fact] - public void When_asserting_a_point_of_time_is_before_a_later_point_it_should_succeed() - { - // Arrange - DateTime earlierDate = DateTime.SpecifyKind(new DateTime(2016, 06, 04), DateTimeKind.Unspecified); - DateTime laterDate = DateTime.SpecifyKind(new DateTime(2016, 06, 04, 0, 5, 0), DateTimeKind.Utc); - - // Act - Action act = () => earlierDate.Should().BeBefore(laterDate); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_is_before_earlier_expected_datetime_it_should_throw() - { - // Arrange - DateTime expected = new(2016, 06, 03); - DateTime subject = new(2016, 06, 04); - - // Act - Action act = () => subject.Should().BeBefore(expected); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be before <2016-06-03>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_datetime_is_before_the_same_datetime_it_should_throw() - { - // Arrange - DateTime expected = new(2016, 06, 04); - DateTime subject = new(2016, 06, 04); - - // Act - Action act = () => subject.Should().BeBefore(expected); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be before <2016-06-04>, but found <2016-06-04>."); - } - } - - public class NotBeBefore - { - [Fact] - public void When_asserting_a_point_of_time_is_not_before_another_it_should_throw() - { - // Arrange - DateTime earlierDate = DateTime.SpecifyKind(new DateTime(2016, 06, 04), DateTimeKind.Unspecified); - DateTime laterDate = DateTime.SpecifyKind(new DateTime(2016, 06, 04, 0, 5, 0), DateTimeKind.Utc); - - // Act - Action act = () => earlierDate.Should().NotBeBefore(laterDate); - - // Assert - act.Should().Throw() - .WithMessage("Expected earlierDate to be on or after <2016-06-04 00:05:00>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_is_not_before_earlier_expected_datetime_it_should_succeed() - { - // Arrange - DateTime expected = new(2016, 06, 03); - DateTime subject = new(2016, 06, 04); - - // Act - Action act = () => subject.Should().NotBeBefore(expected); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_is_not_before_the_same_datetime_it_should_succeed() - { - // Arrange - DateTime expected = new(2016, 06, 04); - DateTime subject = new(2016, 06, 04); - - // Act - Action act = () => subject.Should().NotBeBefore(expected); - - // Assert - act.Should().NotThrow(); - } - } - - public class BeOnOrBefore - { - [Fact] - public void When_asserting_subject_datetime_is_on_or_before_expected_datetime_should_succeed() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 05); - - // Act - Action act = () => subject.Should().BeOnOrBefore(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_is_on_or_before_the_same_date_as_the_expected_datetime_should_succeed() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 04); - - // Act - Action act = () => subject.Should().BeOnOrBefore(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_is_not_on_or_before_earlier_expected_datetime_should_throw() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 03); - - // Act - Action act = () => subject.Should().BeOnOrBefore(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be on or before <2016-06-03>, but found <2016-06-04>."); - } - } - - public class NotBeOnOrBefore - { - [Fact] - public void When_asserting_subject_datetime_is_on_or_before_expected_datetime_should_throw() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 05); - - // Act - Action act = () => subject.Should().NotBeOnOrBefore(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be after <2016-06-05>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_datetime_is_on_or_before_the_same_date_as_the_expected_datetime_should_throw() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 04); - - // Act - Action act = () => subject.Should().NotBeOnOrBefore(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be after <2016-06-04>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_datetime_is_not_on_or_before_earlier_expected_datetime_should_succeed() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 03); - - // Act - Action act = () => subject.Should().NotBeOnOrBefore(expectation); - - // Assert - act.Should().NotThrow(); - } - } - - public class BeAfter - { - [Fact] - public void When_asserting_subject_datetime_is_after_earlier_expected_datetime_should_succeed() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 03); - - // Act - Action act = () => subject.Should().BeAfter(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_is_after_later_expected_datetime_should_throw() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 05); - - // Act - Action act = () => subject.Should().BeAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be after <2016-06-05>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_datetime_is_after_the_same_expected_datetime_should_throw() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 04); - - // Act - Action act = () => subject.Should().BeAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be after <2016-06-04>, but found <2016-06-04>."); - } - } - - public class NotBeAfter - { - [Fact] - public void When_asserting_subject_datetime_is_not_after_earlier_expected_datetime_should_throw() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 03); - - // Act - Action act = () => subject.Should().NotBeAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be on or before <2016-06-03>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_datetime_is_not_after_later_expected_datetime_should_succeed() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 05); - - // Act - Action act = () => subject.Should().NotBeAfter(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_is_not_after_the_same_expected_datetime_should_succeed() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 04); - - // Act - Action act = () => subject.Should().NotBeAfter(expectation); - - // Assert - act.Should().NotThrow(); - } - } - - public class BeOnOrAfter - { - [Fact] - public void When_asserting_subject_datetime_is_on_or_after_earlier_expected_datetime_should_succeed() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 03); - - // Act - Action act = () => subject.Should().BeOnOrAfter(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_is_on_or_after_the_same_expected_datetime_should_succeed() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 04); - - // Act - Action act = () => subject.Should().BeOnOrAfter(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_is_on_or_after_later_expected_datetime_should_throw() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 05); - - // Act - Action act = () => subject.Should().BeOnOrAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be on or after <2016-06-05>, but found <2016-06-04>."); - } - } - - public class NotBeOnOrAfter - { - [Fact] - public void When_asserting_subject_datetime_is_not_on_or_after_earlier_expected_datetime_should_throw() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 03); - - // Act - Action act = () => subject.Should().NotBeOnOrAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be before <2016-06-03>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_datetime_is_not_on_or_after_the_same_expected_datetime_should_throw() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 04); - - // Act - Action act = () => subject.Should().NotBeOnOrAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be before <2016-06-04>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_datetime_is_not_on_or_after_later_expected_datetime_should_succeed() - { - // Arrange - DateTime subject = new(2016, 06, 04); - DateTime expectation = new(2016, 06, 05); - - // Act - Action act = () => subject.Should().NotBeOnOrAfter(expectation); - - // Assert - act.Should().NotThrow(); - } - } - - public class HaveYear - { - [Fact] - public void When_asserting_subject_datetime_should_have_year_with_the_same_value_should_succeed() - { - // Arrange - DateTime subject = new(2009, 12, 31); - int expectation = 2009; - - // Act - Action act = () => subject.Should().HaveYear(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_should_have_year_with_a_different_value_should_throw() - { - // Arrange - DateTime subject = new(2009, 12, 31); - int expectation = 2008; - - // Act - Action act = () => subject.Should().HaveYear(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the year part of subject to be 2008, but found 2009."); - } - - [Fact] - public void When_asserting_subject_null_datetime_should_have_year_should_throw() - { - // Arrange - DateTime? subject = null; - int expectation = 2008; - - // Act - Action act = () => subject.Should().HaveYear(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the year part of subject to be 2008, but found ."); - } - } - - public class NotHaveYear - { - [Fact] - public void When_asserting_subject_datetime_should_not_have_year_with_the_same_value_should_throw() - { - // Arrange - DateTime subject = new(2009, 12, 31); - int expectation = 2009; - - // Act - Action act = () => subject.Should().NotHaveYear(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the year part of subject to be 2009, but it was."); - } - - [Fact] - public void When_asserting_subject_datetime_should_not_have_year_with_a_different_value_should_succeed() - { - // Arrange - DateTime subject = new(2009, 12, 31); - int expectation = 2008; - - // Act - Action act = () => subject.Should().NotHaveYear(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetime_should_not_have_year_should_throw() - { - // Arrange - DateTime? subject = null; - int expectation = 2008; - - // Act - Action act = () => subject.Should().NotHaveYear(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the year part of subject to be 2008, but found a DateTime."); - } - } - - public class HaveMonth - { - [Fact] - public void When_asserting_subject_datetime_should_have_month_with_the_same_value_it_should_succeed() - { - // Arrange - DateTime subject = new(2009, 12, 31); - int expectation = 12; - - // Act - Action act = () => subject.Should().HaveMonth(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_should_have_a_month_with_a_different_value_it_should_throw() - { - // Arrange - DateTime subject = new(2009, 12, 31); - int expectation = 11; - - // Act - Action act = () => subject.Should().HaveMonth(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the month part of subject to be 11, but found 12."); - } - - [Fact] - public void When_asserting_subject_null_datetime_should_have_month_should_throw() - { - // Arrange - DateTime? subject = null; - int expectation = 12; - - // Act - Action act = () => subject.Should().HaveMonth(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the month part of subject to be 12, but found a DateTime."); - } - } - - public class NotHaveMonth - { - [Fact] - public void When_asserting_subject_datetime_should_not_have_month_with_the_same_value_it_should_throw() - { - // Arrange - DateTime subject = new(2009, 12, 31); - int expectation = 12; - - // Act - Action act = () => subject.Should().NotHaveMonth(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the month part of subject to be 12, but it was."); - } - - [Fact] - public void When_asserting_subject_datetime_should_not_have_a_month_with_a_different_value_it_should_succeed() - { - // Arrange - DateTime subject = new(2009, 12, 31); - int expectation = 11; - - // Act - Action act = () => subject.Should().NotHaveMonth(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetime_should_not_have_month_should_throw() - { - // Arrange - DateTime? subject = null; - int expectation = 12; - - // Act - Action act = () => subject.Should().NotHaveMonth(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the month part of subject to be 12, but found a DateTime."); - } - } - - public class HaveDay - { - [Fact] - public void When_asserting_subject_datetime_should_have_day_with_the_same_value_it_should_succeed() - { - // Arrange - DateTime subject = new(2009, 12, 31); - int expectation = 31; - - // Act - Action act = () => subject.Should().HaveDay(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_should_have_day_with_a_different_value_it_should_throw() - { - // Arrange - DateTime subject = new(2009, 12, 31); - int expectation = 30; - - // Act - Action act = () => subject.Should().HaveDay(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the day part of subject to be 30, but found 31."); - } - - [Fact] - public void When_asserting_subject_null_datetime_should_have_day_should_throw() - { - // Arrange - DateTime? subject = null; - int expectation = 22; - - // Act - Action act = () => subject.Should().HaveDay(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the day part of subject to be 22, but found a DateTime."); - } - } - - public class NotHaveDay - { - [Fact] - public void When_asserting_subject_datetime_should_not_have_day_with_the_same_value_it_should_throw() - { - // Arrange - DateTime subject = new(2009, 12, 31); - int expectation = 31; - - // Act - Action act = () => subject.Should().NotHaveDay(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the day part of subject to be 31, but it was."); - } - - [Fact] - public void When_asserting_subject_datetime_should_not_have_day_with_a_different_value_it_should_succeed() - { - // Arrange - DateTime subject = new(2009, 12, 31); - int expectation = 30; - - // Act - Action act = () => subject.Should().NotHaveDay(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetime_should_not_have_day_should_throw() - { - // Arrange - DateTime? subject = null; - int expectation = 22; - - // Act - Action act = () => subject.Should().NotHaveDay(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the day part of subject to be 22, but found a DateTime."); - } - } - - public class HaveHour - { - [Fact] - public void When_asserting_subject_datetime_should_have_hour_with_the_same_value_it_should_succeed() - { - // Arrange - DateTime subject = new(2009, 12, 31, 23, 59, 00); - int expectation = 23; - - // Act - Action act = () => subject.Should().HaveHour(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_should_have_hour_with_different_value_it_should_throw() - { - // Arrange - DateTime subject = new(2009, 12, 31, 23, 59, 00); - int expectation = 22; - - // Act - Action act = () => subject.Should().HaveHour(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the hour part of subject to be 22, but found 23."); - } - - [Fact] - public void When_asserting_subject_null_datetime_should_have_hour_should_throw() - { - // Arrange - DateTime? subject = null; - int expectation = 22; - - // Act - Action act = () => subject.Should().HaveHour(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the hour part of subject to be 22, but found a DateTime."); - } - } - - public class NotHaveHour - { - [Fact] - public void When_asserting_subject_datetime_should_not_have_hour_with_the_same_value_it_should_throw() - { - // Arrange - DateTime subject = new(2009, 12, 31, 23, 59, 00); - int expectation = 23; - - // Act - Action act = () => subject.Should().NotHaveHour(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the hour part of subject to be 23, but it was."); - } - - [Fact] - public void When_asserting_subject_datetime_should_not_have_hour_with_different_value_it_should_succeed() - { - // Arrange - DateTime subject = new(2009, 12, 31, 23, 59, 00); - int expectation = 22; - - // Act - Action act = () => subject.Should().NotHaveHour(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetime_should_not_have_hour_should_throw() - { - // Arrange - DateTime? subject = null; - int expectation = 22; - - // Act - Action act = () => subject.Should().NotHaveHour(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the hour part of subject to be 22, but found a DateTime."); - } - } - - public class HaveMinute - { - [Fact] - public void When_asserting_subject_datetime_should_have_minutes_with_the_same_value_it_should_succeed() - { - // Arrange - DateTime subject = new(2009, 12, 31, 23, 59, 00); - int expectation = 59; - - // Act - Action act = () => subject.Should().HaveMinute(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_should_have_minutes_with_different_value_it_should_throw() - { - // Arrange - DateTime subject = new(2009, 12, 31, 23, 59, 00); - int expectation = 58; - - // Act - Action act = () => subject.Should().HaveMinute(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the minute part of subject to be 58, but found 59."); - } - - [Fact] - public void When_asserting_subject_null_datetime_should_have_minute_should_throw() - { - // Arrange - DateTime? subject = null; - int expectation = 22; - - // Act - Action act = () => subject.Should().HaveMinute(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the minute part of subject to be 22, but found a DateTime."); - } - } - - public class NotHaveMinute - { - [Fact] - public void When_asserting_subject_datetime_should_not_have_minutes_with_the_same_value_it_should_throw() - { - // Arrange - DateTime subject = new(2009, 12, 31, 23, 59, 00); - int expectation = 59; - - // Act - Action act = () => subject.Should().NotHaveMinute(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the minute part of subject to be 59, but it was."); - } - - [Fact] - public void When_asserting_subject_datetime_should_not_have_minutes_with_different_value_it_should_succeed() - { - // Arrange - DateTime subject = new(2009, 12, 31, 23, 59, 00); - int expectation = 58; - - // Act - Action act = () => subject.Should().NotHaveMinute(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetime_should_not_have_minute_should_throw() - { - // Arrange - DateTime? subject = null; - int expectation = 22; - - // Act - Action act = () => subject.Should().NotHaveMinute(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the minute part of subject to be 22, but found a DateTime."); - } - } - - public class HaveSecond - { - [Fact] - public void When_asserting_subject_datetime_should_have_seconds_with_the_same_value_it_should_succeed() - { - // Arrange - DateTime subject = new(2009, 12, 31, 23, 59, 00); - int expectation = 0; - - // Act - Action act = () => subject.Should().HaveSecond(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_should_have_seconds_with_different_value_it_should_throw() - { - // Arrange - DateTime subject = new(2009, 12, 31, 23, 59, 00); - int expectation = 1; - - // Act - Action act = () => subject.Should().HaveSecond(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the seconds part of subject to be 1, but found 0."); - } - - [Fact] - public void When_asserting_subject_null_datetime_should_have_second_should_throw() - { - // Arrange - DateTime? subject = null; - int expectation = 22; - - // Act - Action act = () => subject.Should().HaveSecond(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the seconds part of subject to be 22, but found a DateTime."); - } - } - - public class NotHaveSecond - { - [Fact] - public void When_asserting_subject_datetime_should_not_have_seconds_with_the_same_value_it_should_throw() - { - // Arrange - DateTime subject = new(2009, 12, 31, 23, 59, 00); - int expectation = 0; - - // Act - Action act = () => subject.Should().NotHaveSecond(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the seconds part of subject to be 0, but it was."); - } - - [Fact] - public void When_asserting_subject_datetime_should_not_have_seconds_with_different_value_it_should_succeed() - { - // Arrange - DateTime subject = new(2009, 12, 31, 23, 59, 00); - int expectation = 1; - - // Act - Action act = () => subject.Should().NotHaveSecond(expectation); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetime_should_not_have_second_should_throw() - { - // Arrange - DateTime? subject = null; - int expectation = 22; - - // Act - Action act = () => subject.Should().NotHaveSecond(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the seconds part of subject to be 22, but found a DateTime."); - } - } - - public class BeInUtcOrLocal - { - [Fact] - public void When_asserting_subject_datetime_represents_its_own_kind_it_should_succeed() - { - // Arrange - DateTime subject = new(2009, 12, 31, 23, 59, 00, DateTimeKind.Local); - - // Act - Action act = () => subject.Should().BeIn(DateTimeKind.Local); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_datetime_represents_a_different_kind_it_should_throw() - { - // Arrange - DateTime subject = new(2009, 12, 31, 23, 59, 00, DateTimeKind.Local); - - // Act - Action act = () => subject.Should().BeIn(DateTimeKind.Utc); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be in Utc, but found Local."); - } - - [Fact] - public void When_asserting_subject_null_datetime_represents_a_specific_kind_it_should_throw() - { - // Arrange - DateTime? subject = null; - - // Act - Action act = () => subject.Should().BeIn(DateTimeKind.Utc); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be in Utc, but found a DateTime."); - } - } - - public class BeSameDateAs - { - [Fact] - public void When_asserting_subject_datetime_should_be_same_date_as_another_with_the_same_date_it_should_succeed() - { - // Arrange - var subject = new DateTime(2009, 12, 31, 4, 5, 6); - - // Act - Action act = () => subject.Should().BeSameDateAs(new DateTime(2009, 12, 31)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void - When_asserting_subject_datetime_should_be_same_as_another_with_same_date_but_different_time_it_should_succeed() - { - // Arrange - var subject = new DateTime(2009, 12, 31, 4, 5, 6); - - // Act - Action act = () => subject.Should().BeSameDateAs(new DateTime(2009, 12, 31, 11, 15, 11)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_subject_null_datetime_to_be_same_date_as_another_datetime_it_should_throw() - { - // Arrange - DateTime? subject = null; - - // Act - Action act = () => subject.Should().BeSameDateAs(new DateTime(2009, 12, 31)); - - // Assert - act.Should().Throw().WithMessage( - "Expected the date part of subject to be <2009-12-31>, but found a DateTime."); - } - - [Fact] - public void When_asserting_subject_datetime_should_have_same_date_as_another_but_it_doesnt_it_should_throw() - { - // Arrange - var subject = new DateTime(2009, 12, 31); - - // Act - Action act = () => subject.Should().BeSameDateAs(new DateTime(2009, 12, 30)); - - // Assert - act.Should().Throw().WithMessage( - "Expected the date part of subject to be <2009-12-30>, but found <2009-12-31>."); - } - } - - public class NotBeSameDateAs - { - [Fact] - public void When_asserting_subject_datetime_should_not_be_same_date_as_another_with_the_same_date_it_should_throw() - { - // Arrange - var subject = new DateTime(2009, 12, 31, 4, 5, 6); - - // Act - Action act = () => subject.Should().NotBeSameDateAs(new DateTime(2009, 12, 31)); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the date part of subject to be <2009-12-31>, but it was."); - } - - [Fact] - public void - When_asserting_subject_datetime_should_not_be_same_as_another_with_same_date_but_different_time_it_should_throw() - { - // Arrange - var subject = new DateTime(2009, 12, 31, 4, 5, 6); - - // Act - Action act = () => subject.Should().NotBeSameDateAs(new DateTime(2009, 12, 31, 11, 15, 11)); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the date part of subject to be <2009-12-31>, but it was."); - } - - [Fact] - public void When_asserting_subject_null_datetime_to_not_be_same_date_as_another_datetime_it_should_throw() - { - // Arrange - DateTime? subject = null; - - // Act - Action act = () => subject.Should().NotBeSameDateAs(new DateTime(2009, 12, 31)); - - // Assert - act.Should().Throw().WithMessage( - "Did not expect the date part of subject to be <2009-12-31>, but found a DateTime."); - } - - [Fact] - public void When_asserting_subject_datetime_should_not_have_same_date_as_another_but_it_doesnt_it_should_succeed() - { - // Arrange - var subject = new DateTime(2009, 12, 31); - - // Act - Action act = () => subject.Should().NotBeSameDateAs(new DateTime(2009, 12, 30)); - - // Assert - act.Should().NotThrow(); - } - } - - public class TimespanComparison - { - [Fact] - public void When_date_is_not_more_than_the_required_one_day_before_another_it_should_throw() - { - // Arrange - var target = new DateTime(2009, 10, 2); - DateTime subject = target - 1.Days(); - - // Act - Action act = () => subject.Should().BeMoreThan(TimeSpan.FromDays(1)).Before(target, "we like {0}", "that"); - - // Assert - act.Should().Throw().WithMessage( - "Expected subject <2009-10-01> to be more than 1d before <2009-10-02> because we like that, but it is behind by 1d."); - } - - [Fact] - public void When_date_is_more_than_the_required_one_day_before_another_it_should_not_throw() - { - // Arrange - var target = new DateTime(2009, 10, 2); - DateTime subject = target - 25.Hours(); - - // Act / Assert - subject.Should().BeMoreThan(TimeSpan.FromDays(1)).Before(target); - } - - [Fact] - public void When_date_is_not_at_least_one_day_before_another_it_should_throw() - { - // Arrange - var target = new DateTime(2009, 10, 2); - DateTime subject = target - 23.Hours(); - - // Act - Action act = () => subject.Should().BeAtLeast(TimeSpan.FromDays(1)).Before(target, "we like {0}", "that"); - - // Assert - act.Should().Throw().WithMessage( - "Expected subject <2009-10-01 01:00:00> to be at least 1d before <2009-10-02> because we like that, but it is behind by 23h."); - } - - [Fact] - public void When_date_is_at_least_one_day_before_another_it_should_not_throw() - { - // Arrange - var target = new DateTime(2009, 10, 2); - DateTime subject = target - 24.Hours(); - - // Act / Assert - subject.Should().BeAtLeast(TimeSpan.FromDays(1)).Before(target); - } - - [Fact] - public void When_time_is_not_at_exactly_20_minutes_before_another_time_it_should_throw() - { - // Arrange - DateTime target = 1.January(0001).At(12, 55); - DateTime subject = 1.January(0001).At(12, 36); - - // Act - Action act = - () => subject.Should().BeExactly(TimeSpan.FromMinutes(20)).Before(target, "{0} minutes is enough", 20); - - // Assert - act.Should().Throw().WithMessage( - "Expected subject <12:36:00> to be exactly 20m before <12:55:00> because 20 minutes is enough, but it is behind by 19m."); - } - - [Fact] - public void When_time_is_exactly_90_seconds_before_another_time_it_should_not_throw() - { - // Arrange - DateTime target = 1.January(0001).At(12, 55); - DateTime subject = 1.January(0001).At(12, 53, 30); - - // Act / Assert - subject.Should().BeExactly(TimeSpan.FromSeconds(90)).Before(target); - } - - [Fact] - public void When_date_is_not_within_50_hours_before_another_date_it_should_throw() - { - // Arrange - var target = new DateTime(2010, 4, 10, 12, 0, 0); - DateTime subject = target - 50.Hours() - 1.Seconds(); - - // Act - Action act = - () => subject.Should().BeWithin(TimeSpan.FromHours(50)).Before(target, "{0} hours is enough", 50); - - // Assert - act.Should().Throw().WithMessage( - "Expected subject <2010-04-08 09:59:59> to be within 2d and 2h before <2010-04-10 12:00:00> because 50 hours is enough, but it is behind by 2d, 2h and 1s."); - } - - [Fact] - public void When_date_is_exactly_within_1d_before_another_date_it_should_not_throw() - { - // Arrange - var target = new DateTime(2010, 4, 10); - DateTime subject = target - 1.Days(); - - // Act / Assert - subject.Should().BeWithin(TimeSpan.FromHours(24)).Before(target); - } - - [Fact] - public void When_date_is_within_1d_before_another_date_it_should_not_throw() - { - // Arrange - var target = new DateTime(2010, 4, 10); - DateTime subject = target - 23.Hours(); - - // Act / Assert - subject.Should().BeWithin(TimeSpan.FromHours(24)).Before(target); - } - - [Fact] - public void When_a_utc_date_is_within_0s_before_itself_it_should_not_throw() - { - // Arrange - var date = DateTime.UtcNow; // local timezone differs from UTC - - // Act / Assert - date.Should().BeWithin(TimeSpan.Zero).Before(date); - } - - [Fact] - public void When_a_utc_date_is_within_0s_after_itself_it_should_not_throw() - { - // Arrange - var date = DateTime.UtcNow; // local timezone differs from UTC - - // Act / Assert - date.Should().BeWithin(TimeSpan.Zero).After(date); - } - - [Fact] - public void When_time_is_not_less_than_30s_after_another_time_it_should_throw() - { - // Arrange - var target = new DateTime(1, 1, 1, 12, 0, 30); - DateTime subject = target + 30.Seconds(); - - // Act - Action act = - () => subject.Should().BeLessThan(TimeSpan.FromSeconds(30)).After(target, "{0}s is the max", 30); - - // Assert - act.Should().Throw().WithMessage( - "Expected subject <12:01:00> to be less than 30s after <12:00:30> because 30s is the max, but it is ahead by 30s."); - } - - [Fact] - public void When_time_is_less_than_30s_after_another_time_it_should_not_throw() - { - // Arrange - var target = new DateTime(1, 1, 1, 12, 0, 30); - DateTime subject = target + 20.Seconds(); - - // Act / Assert - subject.Should().BeLessThan(TimeSpan.FromSeconds(30)).After(target); - } - - [Fact] - public void When_asserting_subject_be_more_than_10_seconds_after_target_but_subject_is_before_target_it_should_throw() - { - // Arrange - var expectation = 1.January(0001).At(0, 0, 30); - var subject = 1.January(0001).At(0, 0, 15); - - // Act - Action action = () => subject.Should().BeMoreThan(10.Seconds()).After(expectation); - - // Assert - action.Should().Throw() - .WithMessage("Expected subject <00:00:15> to be more than 10s after <00:00:30>, but it is behind by 15s."); - } - - [Theory] - [InlineData(30, 20)] // edge case - [InlineData(30, 15)] - public void When_asserting_subject_be_at_least_10_seconds_after_target_but_subject_is_before_target_it_should_throw( - int targetSeconds, int subjectSeconds) - { - // Arrange - var expectation = 1.January(0001).At(0, 0, targetSeconds); - var subject = 1.January(0001).At(0, 0, subjectSeconds); - - // Act - Action action = () => subject.Should().BeAtLeast(10.Seconds()).After(expectation); - - // Assert - action.Should().Throw() - .WithMessage( - $"Expected subject <00:00:{subjectSeconds}> to be at least 10s after <00:00:30>, but it is behind by {Math.Abs(subjectSeconds - targetSeconds)}s."); - } - - [Fact] - public void When_asserting_subject_be_exactly_10_seconds_after_target_but_subject_is_before_target_it_should_throw() - { - // Arrange - var expectation = 1.January(0001).At(0, 0, 30); - var subject = 1.January(0001).At(0, 0, 20); - - // Ac - Action action = () => subject.Should().BeExactly(10.Seconds()).After(expectation); - - // Assert - action.Should().Throw() - .WithMessage("Expected subject <00:00:20> to be exactly 10s after <00:00:30>, but it is behind by 10s."); - } - - [Theory] - [InlineData(30, 20)] // edge case - [InlineData(30, 25)] - public void When_asserting_subject_be_within_10_seconds_after_target_but_subject_is_before_target_it_should_throw( - int targetSeconds, int subjectSeconds) - { - // Arrange - var expectation = 1.January(0001).At(0, 0, targetSeconds); - var subject = 1.January(0001).At(0, 0, subjectSeconds); - - // Act - Action action = () => subject.Should().BeWithin(10.Seconds()).After(expectation); - - // Assert - action.Should().Throw() - .WithMessage( - $"Expected subject <00:00:{subjectSeconds}> to be within 10s after <00:00:30>, but it is behind by {Math.Abs(subjectSeconds - targetSeconds)}s."); - } - - [Fact] - public void When_asserting_subject_be_less_than_10_seconds_after_target_but_subject_is_before_target_it_should_throw() - { - // Arrange - var expectation = 1.January(0001).At(0, 0, 30); - var subject = 1.January(0001).At(0, 0, 25); - - // Act - Action action = () => subject.Should().BeLessThan(10.Seconds()).After(expectation); - - // Assert - action.Should().Throw() - .WithMessage("Expected subject <00:00:25> to be less than 10s after <00:00:30>, but it is behind by 5s."); - } - - [Fact] - public void When_asserting_subject_be_more_than_10_seconds_before_target_but_subject_is_after_target_it_should_throw() - { - // Arrange - var expectation = 1.January(0001).At(0, 0, 30); - var subject = 1.January(0001).At(0, 0, 45); - - // Act - Action action = () => subject.Should().BeMoreThan(10.Seconds()).Before(expectation); - - // Assert - action.Should().Throw() - .WithMessage("Expected subject <00:00:45> to be more than 10s before <00:00:30>, but it is ahead by 15s."); - } - - [Theory] - [InlineData(30, 40)] // edge case - [InlineData(30, 45)] - public void When_asserting_subject_be_at_least_10_seconds_before_target_but_subject_is_after_target_it_should_throw( - int targetSeconds, int subjectSeconds) - { - // Arrange - var expectation = 1.January(0001).At(0, 0, targetSeconds); - var subject = 1.January(0001).At(0, 0, subjectSeconds); - - // Act - Action action = () => subject.Should().BeAtLeast(10.Seconds()).Before(expectation); - - // Assert - action.Should().Throw() - .WithMessage( - $"Expected subject <00:00:{subjectSeconds}> to be at least 10s before <00:00:30>, but it is ahead by {Math.Abs(subjectSeconds - targetSeconds)}s."); - } - - [Fact] - public void When_asserting_subject_be_exactly_10_seconds_before_target_but_subject_is_after_target_it_should_throw() - { - // Arrange - var expectation = 1.January(0001).At(0, 0, 30); - var subject = 1.January(0001).At(0, 0, 40); - - // Act - Action action = () => subject.Should().BeExactly(10.Seconds()).Before(expectation); - - // Assert - action.Should().Throw() - .WithMessage("Expected subject <00:00:40> to be exactly 10s before <00:00:30>, but it is ahead by 10s."); - } - - [Theory] - [InlineData(30, 40)] // edge case - [InlineData(30, 35)] - public void When_asserting_subject_be_within_10_seconds_before_target_but_subject_is_after_target_it_should_throw( - int targetSeconds, int subjectSeconds) - { - // Arrange - var expectation = 1.January(0001).At(0, 0, targetSeconds); - var subject = 1.January(0001).At(0, 0, subjectSeconds); - - // Act - Action action = () => subject.Should().BeWithin(10.Seconds()).Before(expectation); - - // Assert - action.Should().Throw() - .WithMessage( - $"Expected subject <00:00:{subjectSeconds}> to be within 10s before <00:00:30>, but it is ahead by {Math.Abs(subjectSeconds - targetSeconds)}s."); - } - - [Fact] - public void When_asserting_subject_be_less_than_10_seconds_before_target_but_subject_is_after_target_it_should_throw() - { - // Arrange - var expectation = 1.January(0001).At(0, 0, 30); - var subject = 1.January(0001).At(0, 0, 45); - - // Act - Action action = () => subject.Should().BeLessThan(10.Seconds()).Before(expectation); - - // Assert - action.Should().Throw() - .WithMessage("Expected subject <00:00:45> to be less than 10s before <00:00:30>, but it is ahead by 15s."); - } - } - public class ChainingConstraint { [Fact] @@ -2245,119 +25,6 @@ public void Should_support_chaining_constraints_with_and() // Assert action.Should().NotThrow(); } - - [Fact] - public void Should_throw_because_of_assertion_failure_when_asserting_null_is_within_second_before_specific_date() - { - // Arrange - DateTimeOffset? nullDateTime = null; - DateTimeOffset target = new DateTimeOffset(2000, 1, 1, 12, 0, 0, TimeSpan.Zero); - - // Act - Action action = () => - nullDateTime.Should() - .BeWithin(TimeSpan.FromSeconds(1)) - .Before(target); - - // Assert - action.Should().Throw() - .Which.Message - .Should().StartWith("Expected nullDateTime to be within 1s before <2000-01-01 12:00:00 +0h>, but found a DateTime"); - } - - [Fact] - public void Should_throw_because_of_assertion_failure_when_asserting_null_is_within_second_after_specific_date() - { - // Arrange - DateTimeOffset? nullDateTime = null; - DateTimeOffset target = new DateTimeOffset(2000, 1, 1, 12, 0, 0, TimeSpan.Zero); - - // Act - Action action = () => - nullDateTime.Should() - .BeWithin(TimeSpan.FromSeconds(1)) - .After(target); - - // Assert - action.Should().Throw() - .Which.Message - .Should().StartWith("Expected nullDateTime to be within 1s after <2000-01-01 12:00:00 +0h>, but found a DateTime"); - } - } - - public class BeOneOf - { - [Fact] - public void When_a_value_is_not_one_of_the_specified_values_it_should_throw() - { - // Arrange - DateTime value = new(2016, 12, 30, 23, 58, 57); - - // Act - Action action = () => value.Should().BeOneOf(value + 1.Days(), value + 1.Milliseconds()); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected value to be one of {<2016-12-31 23:58:57>, <2016-12-30 23:58:57.001>}, but found <2016-12-30 23:58:57>."); - } - - [Fact] - public void When_a_value_is_not_one_of_the_specified_values_it_should_throw_with_descriptive_message() - { - // Arrange - DateTime value = new(2016, 12, 30, 23, 58, 57); - - // Act - Action action = () => - value.Should().BeOneOf(new[] { value + 1.Days(), value + 1.Milliseconds() }, "because it's true"); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected value to be one of {<2016-12-31 23:58:57>, <2016-12-30 23:58:57.001>} because it's true, but found <2016-12-30 23:58:57>."); - } - - [Fact] - public void When_a_value_is_one_of_the_specified_values_it_should_succeed() - { - // Arrange - DateTime value = new(2016, 12, 30, 23, 58, 57); - - // Act - Action action = () => value.Should().BeOneOf(new DateTime(2216, 1, 30, 0, 5, 7), - new DateTime(2016, 12, 30, 23, 58, 57), new DateTime(2012, 3, 3)); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void When_a_null_value_is_not_one_of_the_specified_values_it_should_throw() - { - // Arrange - DateTime? value = null; - - // Act - Action action = () => value.Should().BeOneOf(new DateTime(2216, 1, 30, 0, 5, 7), new DateTime(1116, 4, 10, 2, 45, 7)); - - // Assert - action.Should().Throw() - .WithMessage("Expected value to be one of {<2216-01-30 00:05:07>, <1116-04-10 02:45:07>}, but found ."); - } - - [Fact] - public void When_a_value_is_one_of_the_specified_values_it_should_succeed_when_datetime_is_null() - { - // Arrange - DateTime? value = null; - - // Act - Action action = () => value.Should().BeOneOf(new DateTime(2216, 1, 30, 0, 5, 7), null); - - // Assert - action.Should().NotThrow(); - } } public class Miscellaneous From f391fdd36c36c9563829a79f5210510b5916669c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Wed, 1 Nov 2023 14:12:04 +0100 Subject: [PATCH 153/845] Split DateOnlyAssertionSpecs --- .../Primitives/DateOnlyAssertionSpecs.Be.cs | 197 +++++ .../DateOnlyAssertionSpecs.BeAfter.cs | 170 ++++ .../DateOnlyAssertionSpecs.BeBefore.cs | 130 +++ .../DateOnlyAssertionSpecs.BeOneOf.cs | 78 ++ .../DateOnlyAssertionSpecs.HaveDay.cs | 96 ++ .../DateOnlyAssertionSpecs.HaveMonth.cs | 96 ++ .../DateOnlyAssertionSpecs.HaveYear.cs | 96 ++ .../Primitives/DateOnlyAssertionSpecs.cs | 834 +----------------- 8 files changed, 884 insertions(+), 813 deletions(-) create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.Be.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.BeAfter.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.BeBefore.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.BeOneOf.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.HaveDay.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.HaveMonth.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.HaveYear.cs diff --git a/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.Be.cs b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.Be.cs new file mode 100644 index 0000000000..eb3c050c8d --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.Be.cs @@ -0,0 +1,197 @@ +#if NET6_0_OR_GREATER +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateOnlyAssertionSpecs +{ + public class Be + { + [Fact] + public void Should_succeed_when_asserting_dateonly_value_is_equal_to_the_same_value() + { + // Arrange + DateOnly dateOnly = new(2016, 06, 04); + DateOnly sameDateOnly = new(2016, 06, 04); + + // Act/Assert + dateOnly.Should().Be(sameDateOnly); + } + + [Fact] + public void When_dateonly_value_is_equal_to_the_same_nullable_value_be_should_succeed() + { + // Arrange + DateOnly dateOnly = new(2016, 06, 04); + DateOnly? sameDateOnly = new(2016, 06, 04); + + // Act/Assert + dateOnly.Should().Be(sameDateOnly); + } + + [Fact] + public void When_both_values_are_at_their_minimum_then_it_should_succeed() + { + // Arrange + DateOnly dateOnly = DateOnly.MinValue; + DateOnly sameDateOnly = DateOnly.MinValue; + + // Act/Assert + dateOnly.Should().Be(sameDateOnly); + } + + [Fact] + public void When_both_values_are_at_their_maximum_then_it_should_succeed() + { + // Arrange + DateOnly dateOnly = DateOnly.MaxValue; + DateOnly sameDateOnly = DateOnly.MaxValue; + + // Act/Assert + dateOnly.Should().Be(sameDateOnly); + } + + [Fact] + public void Should_fail_when_asserting_dateonly_value_is_equal_to_the_different_value() + { + // Arrange + var dateOnly = new DateOnly(2012, 03, 10); + var otherDateOnly = new DateOnly(2012, 03, 11); + + // Act + Action act = () => dateOnly.Should().Be(otherDateOnly, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage("Expected dateOnly to be <2012-03-11>*failure message, but found <2012-03-10>."); + } + + [Fact] + public void Should_succeed_when_asserting_nullable_numeric_value_equals_the_same_value() + { + // Arrange + DateOnly? nullableDateOnlyA = new DateOnly(2016, 06, 04); + DateOnly? nullableDateOnlyB = new DateOnly(2016, 06, 04); + + // Act/Assert + nullableDateOnlyA.Should().Be(nullableDateOnlyB); + } + + [Fact] + public void Should_succeed_when_asserting_nullable_numeric_null_value_equals_null() + { + // Arrange + DateOnly? nullableDateOnlyA = null; + DateOnly? nullableDateOnlyB = null; + + // Act/Assert + nullableDateOnlyA.Should().Be(nullableDateOnlyB); + } + + [Fact] + public void Should_fail_when_asserting_nullable_numeric_value_equals_a_different_value() + { + // Arrange + DateOnly? nullableDateOnlyA = new DateOnly(2016, 06, 04); + DateOnly? nullableDateOnlyB = new DateOnly(2016, 06, 06); + + // Act + Action action = () => + nullableDateOnlyA.Should().Be(nullableDateOnlyB); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void Should_fail_with_descriptive_message_when_asserting_dateonly_null_value_is_equal_to_another_value() + { + // Arrange + DateOnly? nullableDateOnly = null; + + // Act + Action action = () => + nullableDateOnly.Should().Be(new DateOnly(2016, 06, 04), "because we want to test the failure {0}", + "message"); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected nullableDateOnly to be <2016-06-04> because we want to test the failure message, but found ."); + } + + [Fact] + public void Should_succeed_when_asserting_dateonly_value_is_not_equal_to_a_different_value() + { + // Arrange + DateOnly dateOnly = new(2016, 06, 04); + DateOnly otherDateOnly = new(2016, 06, 05); + + // Act/Assert + dateOnly.Should().NotBe(otherDateOnly); + } + } + + public class NotBe + { + [Fact] + public void Different_dateonly_values_are_valid() + { + // Arrange + DateOnly date = new(2020, 06, 04); + DateOnly otherDate = new(2020, 06, 05); + + // Act & Assert + date.Should().NotBe(otherDate); + } + + [Fact] + public void Different_dateonly_values_with_different_nullability_are_valid() + { + // Arrange + DateOnly date = new(2020, 06, 04); + DateOnly? otherDate = new(2020, 07, 05); + + // Act & Assert + date.Should().NotBe(otherDate); + } + + [Fact] + public void Same_dateonly_values_are_invalid() + { + // Arrange + DateOnly date = new(2020, 06, 04); + DateOnly sameDate = new(2020, 06, 04); + + // Act + Action act = + () => date.Should().NotBe(sameDate, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected date not to be <2020-06-04> because we want to test the failure message, but it is."); + } + + [Fact] + public void Same_dateonly_values_with_different_nullability_are_invalid() + { + // Arrange + DateOnly date = new(2020, 06, 04); + DateOnly? sameDate = new(2020, 06, 04); + + // Act + Action act = + () => date.Should().NotBe(sameDate, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected date not to be <2020-06-04> because we want to test the failure message, but it is."); + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.BeAfter.cs b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.BeAfter.cs new file mode 100644 index 0000000000..98032e49ef --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.BeAfter.cs @@ -0,0 +1,170 @@ +#if NET6_0_OR_GREATER +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateOnlyAssertionSpecs +{ + public class BeAfter + { + [Fact] + public void When_asserting_subject_dateonly_is_after_earlier_expected_dateonly_should_succeed() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 03); + + // Act/Assert + subject.Should().BeAfter(expectation); + } + + [Fact] + public void When_asserting_subject_dateonly_is_not_after_earlier_expected_dateonly_should_throw() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 03); + + // Act + Action act = () => subject.Should().NotBeAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be on or before <2016-06-03>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_dateonly_is_after_later_expected_dateonly_should_throw() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 05); + + // Act + Action act = () => subject.Should().BeAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be after <2016-06-05>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_dateonly_is_not_after_later_expected_dateonly_should_succeed() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 05); + + // Act/Assert + subject.Should().NotBeAfter(expectation); + } + + [Fact] + public void When_asserting_subject_dateonly_is_after_the_same_expected_dateonly_should_throw() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 04); + + // Act + Action act = () => subject.Should().BeAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be after <2016-06-04>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_dateonly_is_not_after_the_same_expected_dateonly_should_succeed() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 04); + + // Act/Assert + subject.Should().NotBeAfter(expectation); + } + + [Fact] + public void When_asserting_subject_dateonly_is_on_or_after_earlier_expected_dateonly_should_succeed() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 03); + + // Act/Assert + subject.Should().BeOnOrAfter(expectation); + } + + [Fact] + public void When_asserting_subject_dateonly_is_not_on_or_after_earlier_expected_dateonly_should_throw() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 03); + + // Act + Action act = () => subject.Should().NotBeOnOrAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be before <2016-06-03>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_dateonly_is_on_or_after_the_same_expected_dateonly_should_succeed() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 04); + + // Act/Assert + subject.Should().BeOnOrAfter(expectation); + } + + [Fact] + public void When_asserting_subject_dateonly_is_not_on_or_after_the_same_expected_dateonly_should_throw() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 04); + + // Act + Action act = () => subject.Should().NotBeOnOrAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be before <2016-06-04>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_dateonly_is_on_or_after_later_expected_dateonly_should_throw() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 05); + + // Act + Action act = () => subject.Should().BeOnOrAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be on or after <2016-06-05>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_dateonly_is_not_on_or_after_later_expected_dateonly_should_succeed() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 05); + + // Act/Assert + subject.Should().NotBeOnOrAfter(expectation); + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.BeBefore.cs b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.BeBefore.cs new file mode 100644 index 0000000000..7f33410013 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.BeBefore.cs @@ -0,0 +1,130 @@ +#if NET6_0_OR_GREATER +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateOnlyAssertionSpecs +{ + public class BeBefore + { + [Fact] + public void When_asserting_subject_is_not_before_earlier_expected_dateonly_it_should_succeed() + { + // Arrange + DateOnly expected = new(2016, 06, 03); + DateOnly subject = new(2016, 06, 04); + + // Act/Assert + subject.Should().NotBeBefore(expected); + } + + [Fact] + public void When_asserting_subject_dateonly_is_before_the_same_dateonly_it_should_throw() + { + // Arrange + DateOnly expected = new(2016, 06, 04); + DateOnly subject = new(2016, 06, 04); + + // Act + Action act = () => subject.Should().BeBefore(expected); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be before <2016-06-04>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_dateonly_is_not_before_the_same_dateonly_it_should_succeed() + { + // Arrange + DateOnly expected = new(2016, 06, 04); + DateOnly subject = new(2016, 06, 04); + + // Act/Assert + subject.Should().NotBeBefore(expected); + } + + [Fact] + public void When_asserting_subject_dateonly_is_on_or_before_expected_dateonly_should_succeed() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 05); + + // Act/Assert + subject.Should().BeOnOrBefore(expectation); + } + + [Fact] + public void When_asserting_subject_dateonly_is_on_or_before_expected_dateonly_should_throw() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 05); + + // Act + Action act = () => subject.Should().NotBeOnOrBefore(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be after <2016-06-05>, but found <2016-06-04>."); + } + + [Fact] + public void + When_asserting_subject_dateonly_is_on_or_before_the_same_date_as_the_expected_dateonly_should_succeed() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 04); + + // Act/Assert + subject.Should().BeOnOrBefore(expectation); + } + + [Fact] + public void When_asserting_subject_dateonly_is_on_or_before_the_same_date_as_the_expected_dateonly_should_throw() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 04); + + // Act + Action act = () => subject.Should().NotBeOnOrBefore(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be after <2016-06-04>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_dateonly_is_not_on_or_before_earlier_expected_dateonly_should_throw() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 03); + + // Act + Action act = () => subject.Should().BeOnOrBefore(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be on or before <2016-06-03>, but found <2016-06-04>."); + } + + [Fact] + public void When_asserting_subject_dateonly_is_not_on_or_before_earlier_expected_dateonly_should_succeed() + { + // Arrange + DateOnly subject = new(2016, 06, 04); + DateOnly expectation = new(2016, 06, 03); + + // Act/Assert + subject.Should().NotBeOnOrBefore(expectation); + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.BeOneOf.cs b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.BeOneOf.cs new file mode 100644 index 0000000000..afffcd04de --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.BeOneOf.cs @@ -0,0 +1,78 @@ +#if NET6_0_OR_GREATER +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateOnlyAssertionSpecs +{ + public class BeOneOf + { + [Fact] + public void When_a_value_is_not_one_of_the_specified_values_it_should_throw() + { + // Arrange + DateOnly value = new(2016, 12, 20); + + // Act + Action action = () => value.Should().BeOneOf(value.AddDays(1), value.AddMonths(-1)); + + // Assert + action.Should().Throw() + .WithMessage("Expected value to be one of {<2016-12-21>, <2016-11-20>}, but found <2016-12-20>."); + } + + [Fact] + public void When_a_value_is_not_one_of_the_specified_values_it_should_throw_with_descriptive_message() + { + // Arrange + DateOnly value = new(2016, 12, 20); + + // Act + Action action = () => + value.Should().BeOneOf(new[] { value.AddDays(1), value.AddDays(2) }, "because it's true"); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected value to be one of {<2016-12-21>, <2016-12-22>} because it's true, but found <2016-12-20>."); + } + + [Fact] + public void When_a_value_is_one_of_the_specified_values_it_should_succeed() + { + // Arrange + DateOnly value = new(2016, 12, 30); + + // Act/Assert + value.Should().BeOneOf(new DateOnly(2216, 1, 30), new DateOnly(2016, 12, 30)); + } + + [Fact] + public void When_a_null_value_is_not_one_of_the_specified_values_it_should_throw() + { + // Arrange + DateOnly? value = null; + + // Act + Action action = () => value.Should().BeOneOf(new DateOnly(2216, 1, 30), new DateOnly(1116, 4, 10)); + + // Assert + action.Should().Throw() + .WithMessage("Expected value to be one of {<2216-01-30>, <1116-04-10>}, but found ."); + } + + [Fact] + public void When_a_value_is_one_of_the_specified_values_it_should_succeed_when_dateonly_is_null() + { + // Arrange + DateOnly? value = null; + + // Act/Assert + value.Should().BeOneOf(new DateOnly(2216, 1, 30), null); + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.HaveDay.cs b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.HaveDay.cs new file mode 100644 index 0000000000..f043edb95a --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.HaveDay.cs @@ -0,0 +1,96 @@ +#if NET6_0_OR_GREATER +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateOnlyAssertionSpecs +{ + public class HaveDay + { + [Fact] + public void When_asserting_subject_dateonly_should_have_day_with_the_same_value_it_should_succeed() + { + // Arrange + DateOnly subject = new(2009, 12, 31); + const int expectation = 31; + + // Act/Assert + subject.Should().HaveDay(expectation); + } + + [Fact] + public void When_asserting_subject_dateonly_should_not_have_day_with_the_same_value_it_should_throw() + { + // Arrange + DateOnly subject = new(2009, 12, 31); + const int expectation = 31; + + // Act + Action act = () => subject.Should().NotHaveDay(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the day part of subject to be 31, but it was."); + } + + [Fact] + public void When_asserting_subject_dateonly_should_have_day_with_a_different_value_it_should_throw() + { + // Arrange + DateOnly subject = new(2009, 12, 31); + const int expectation = 30; + + // Act + Action act = () => subject.Should().HaveDay(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the day part of subject to be 30, but found 31."); + } + + [Fact] + public void When_asserting_subject_dateonly_should_not_have_day_with_a_different_value_it_should_succeed() + { + // Arrange + DateOnly subject = new(2009, 12, 31); + const int expectation = 30; + + // Act/Assert + subject.Should().NotHaveDay(expectation); + } + + [Fact] + public void When_asserting_subject_null_dateonly_should_have_day_should_throw() + { + // Arrange + DateOnly? subject = null; + const int expectation = 22; + + // Act + Action act = () => subject.Should().HaveDay(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the day part of subject to be 22, but found a DateOnly."); + } + + [Fact] + public void When_asserting_subject_null_dateonly_should_not_have_day_should_throw() + { + // Arrange + DateOnly? subject = null; + const int expectation = 22; + + // Act + Action act = () => subject.Should().NotHaveDay(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the day part of subject to be 22, but found a DateOnly."); + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.HaveMonth.cs b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.HaveMonth.cs new file mode 100644 index 0000000000..7747917525 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.HaveMonth.cs @@ -0,0 +1,96 @@ +#if NET6_0_OR_GREATER +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateOnlyAssertionSpecs +{ + public class HaveMonth + { + [Fact] + public void When_asserting_subject_dateonly_should_have_month_with_the_same_value_it_should_succeed() + { + // Arrange + DateOnly subject = new(2009, 12, 31); + const int expectation = 12; + + // Act/Assert + subject.Should().HaveMonth(expectation); + } + + [Fact] + public void When_asserting_subject_dateonly_should_not_have_month_with_the_same_value_it_should_throw() + { + // Arrange + DateOnly subject = new(2009, 12, 31); + const int expectation = 12; + + // Act + Action act = () => subject.Should().NotHaveMonth(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the month part of subject to be 12, but it was."); + } + + [Fact] + public void When_asserting_subject_dateonly_should_have_a_month_with_a_different_value_it_should_throw() + { + // Arrange + DateOnly subject = new(2009, 12, 31); + const int expectation = 11; + + // Act + Action act = () => subject.Should().HaveMonth(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the month part of subject to be 11, but found 12."); + } + + [Fact] + public void When_asserting_subject_dateonly_should_not_have_a_month_with_a_different_value_it_should_succeed() + { + // Arrange + DateOnly subject = new(2009, 12, 31); + const int expectation = 11; + + // Act/Assert + subject.Should().NotHaveMonth(expectation); + } + + [Fact] + public void When_asserting_subject_null_dateonly_should_have_month_should_throw() + { + // Arrange + DateOnly? subject = null; + const int expectation = 12; + + // Act + Action act = () => subject.Should().HaveMonth(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the month part of subject to be 12, but found a DateOnly."); + } + + [Fact] + public void When_asserting_subject_null_dateonly_should_not_have_month_should_throw() + { + // Arrange + DateOnly? subject = null; + const int expectation = 12; + + // Act + Action act = () => subject.Should().NotHaveMonth(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the month part of subject to be 12, but found a DateOnly."); + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.HaveYear.cs b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.HaveYear.cs new file mode 100644 index 0000000000..6181d47eaf --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.HaveYear.cs @@ -0,0 +1,96 @@ +#if NET6_0_OR_GREATER +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateOnlyAssertionSpecs +{ + public class HaveYear + { + [Fact] + public void When_asserting_subject_dateonly_should_have_year_with_the_same_value_should_succeed() + { + // Arrange + DateOnly subject = new(2009, 12, 31); + const int expectation = 2009; + + // Act/Assert + subject.Should().HaveYear(expectation); + } + + [Fact] + public void When_asserting_subject_dateonly_should_not_have_year_with_the_same_value_should_throw() + { + // Arrange + DateOnly subject = new(2009, 12, 31); + const int expectation = 2009; + + // Act + Action act = () => subject.Should().NotHaveYear(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the year part of subject to be 2009, but it was."); + } + + [Fact] + public void When_asserting_subject_dateonly_should_have_year_with_a_different_value_should_throw() + { + // Arrange + DateOnly subject = new(2009, 12, 31); + const int expectation = 2008; + + // Act + Action act = () => subject.Should().HaveYear(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the year part of subject to be 2008, but found 2009."); + } + + [Fact] + public void When_asserting_subject_dateonly_should_not_have_year_with_a_different_value_should_succeed() + { + // Arrange + DateOnly subject = new(2009, 12, 31); + const int expectation = 2008; + + // Act/Assert + subject.Should().NotHaveYear(expectation); + } + + [Fact] + public void When_asserting_subject_null_dateonly_should_have_year_should_throw() + { + // Arrange + DateOnly? subject = null; + const int expectation = 2008; + + // Act + Action act = () => subject.Should().HaveYear(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the year part of subject to be 2008, but found ."); + } + + [Fact] + public void When_asserting_subject_null_dateonly_should_not_have_year_should_throw() + { + // Arrange + DateOnly? subject = null; + const int expectation = 2008; + + // Act + Action act = () => subject.Should().NotHaveYear(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the year part of subject to be 2008, but found a DateOnly."); + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.cs index 962f38023a..5ccf150d5a 100644 --- a/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.cs @@ -1,11 +1,11 @@ +#if NET6_0_OR_GREATER using System; using Xunit; using Xunit.Sdk; -#if NET6_0_OR_GREATER namespace FluentAssertions.Specs.Primitives; -public class DateOnlyAssertionSpecs +public partial class DateOnlyAssertionSpecs { [Fact] public void Should_succeed_when_asserting_nullable_dateonly_value_with_value_to_have_a_value() @@ -37,824 +37,32 @@ public void Should_succeed_when_asserting_nullable_dateonly_value_with_null_to_b dateOnly.Should().BeNull(); } - public class Be - { - [Fact] - public void Should_succeed_when_asserting_dateonly_value_is_equal_to_the_same_value() - { - // Arrange - DateOnly dateOnly = new(2016, 06, 04); - DateOnly sameDateOnly = new(2016, 06, 04); - - // Act/Assert - dateOnly.Should().Be(sameDateOnly); - } - - [Fact] - public void When_dateonly_value_is_equal_to_the_same_nullable_value_be_should_succeed() - { - // Arrange - DateOnly dateOnly = new(2016, 06, 04); - DateOnly? sameDateOnly = new(2016, 06, 04); - - // Act/Assert - dateOnly.Should().Be(sameDateOnly); - } - - [Fact] - public void When_both_values_are_at_their_minimum_then_it_should_succeed() - { - // Arrange - DateOnly dateOnly = DateOnly.MinValue; - DateOnly sameDateOnly = DateOnly.MinValue; - - // Act/Assert - dateOnly.Should().Be(sameDateOnly); - } - - [Fact] - public void When_both_values_are_at_their_maximum_then_it_should_succeed() - { - // Arrange - DateOnly dateOnly = DateOnly.MaxValue; - DateOnly sameDateOnly = DateOnly.MaxValue; - - // Act/Assert - dateOnly.Should().Be(sameDateOnly); - } - - [Fact] - public void Should_fail_when_asserting_dateonly_value_is_equal_to_the_different_value() - { - // Arrange - var dateOnly = new DateOnly(2012, 03, 10); - var otherDateOnly = new DateOnly(2012, 03, 11); - - // Act - Action act = () => dateOnly.Should().Be(otherDateOnly, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage("Expected dateOnly to be <2012-03-11>*failure message, but found <2012-03-10>."); - } - - [Fact] - public void Should_succeed_when_asserting_nullable_numeric_value_equals_the_same_value() - { - // Arrange - DateOnly? nullableDateOnlyA = new DateOnly(2016, 06, 04); - DateOnly? nullableDateOnlyB = new DateOnly(2016, 06, 04); - - // Act/Assert - nullableDateOnlyA.Should().Be(nullableDateOnlyB); - } - - [Fact] - public void Should_succeed_when_asserting_nullable_numeric_null_value_equals_null() - { - // Arrange - DateOnly? nullableDateOnlyA = null; - DateOnly? nullableDateOnlyB = null; - - // Act/Assert - nullableDateOnlyA.Should().Be(nullableDateOnlyB); - } - - [Fact] - public void Should_fail_when_asserting_nullable_numeric_value_equals_a_different_value() - { - // Arrange - DateOnly? nullableDateOnlyA = new DateOnly(2016, 06, 04); - DateOnly? nullableDateOnlyB = new DateOnly(2016, 06, 06); - - // Act - Action action = () => - nullableDateOnlyA.Should().Be(nullableDateOnlyB); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_dateonly_null_value_is_equal_to_another_value() - { - // Arrange - DateOnly? nullableDateOnly = null; - - // Act - Action action = () => - nullableDateOnly.Should().Be(new DateOnly(2016, 06, 04), "because we want to test the failure {0}", - "message"); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected nullableDateOnly to be <2016-06-04> because we want to test the failure message, but found ."); - } - - [Fact] - public void Should_succeed_when_asserting_dateonly_value_is_not_equal_to_a_different_value() - { - // Arrange - DateOnly dateOnly = new(2016, 06, 04); - DateOnly otherDateOnly = new(2016, 06, 05); - - // Act/Assert - dateOnly.Should().NotBe(otherDateOnly); - } - } - - public class BeBefore - { - [Fact] - public void When_asserting_subject_is_not_before_earlier_expected_dateonly_it_should_succeed() - { - // Arrange - DateOnly expected = new(2016, 06, 03); - DateOnly subject = new(2016, 06, 04); - - // Act/Assert - subject.Should().NotBeBefore(expected); - } - - [Fact] - public void When_asserting_subject_dateonly_is_before_the_same_dateonly_it_should_throw() - { - // Arrange - DateOnly expected = new(2016, 06, 04); - DateOnly subject = new(2016, 06, 04); - - // Act - Action act = () => subject.Should().BeBefore(expected); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be before <2016-06-04>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_dateonly_is_not_before_the_same_dateonly_it_should_succeed() - { - // Arrange - DateOnly expected = new(2016, 06, 04); - DateOnly subject = new(2016, 06, 04); - - // Act/Assert - subject.Should().NotBeBefore(expected); - } - - [Fact] - public void When_asserting_subject_dateonly_is_on_or_before_expected_dateonly_should_succeed() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 05); - - // Act/Assert - subject.Should().BeOnOrBefore(expectation); - } - - [Fact] - public void When_asserting_subject_dateonly_is_on_or_before_expected_dateonly_should_throw() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 05); - - // Act - Action act = () => subject.Should().NotBeOnOrBefore(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be after <2016-06-05>, but found <2016-06-04>."); - } - - [Fact] - public void - When_asserting_subject_dateonly_is_on_or_before_the_same_date_as_the_expected_dateonly_should_succeed() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 04); - - // Act/Assert - subject.Should().BeOnOrBefore(expectation); - } - - [Fact] - public void When_asserting_subject_dateonly_is_on_or_before_the_same_date_as_the_expected_dateonly_should_throw() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 04); - - // Act - Action act = () => subject.Should().NotBeOnOrBefore(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be after <2016-06-04>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_dateonly_is_not_on_or_before_earlier_expected_dateonly_should_throw() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 03); - - // Act - Action act = () => subject.Should().BeOnOrBefore(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be on or before <2016-06-03>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_dateonly_is_not_on_or_before_earlier_expected_dateonly_should_succeed() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 03); - - // Act/Assert - subject.Should().NotBeOnOrBefore(expectation); - } - } - - public class BeAfter - { - [Fact] - public void When_asserting_subject_dateonly_is_after_earlier_expected_dateonly_should_succeed() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 03); - - // Act/Assert - subject.Should().BeAfter(expectation); - } - - [Fact] - public void When_asserting_subject_dateonly_is_not_after_earlier_expected_dateonly_should_throw() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 03); - - // Act - Action act = () => subject.Should().NotBeAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be on or before <2016-06-03>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_dateonly_is_after_later_expected_dateonly_should_throw() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 05); - - // Act - Action act = () => subject.Should().BeAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be after <2016-06-05>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_dateonly_is_not_after_later_expected_dateonly_should_succeed() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 05); - - // Act/Assert - subject.Should().NotBeAfter(expectation); - } - - [Fact] - public void When_asserting_subject_dateonly_is_after_the_same_expected_dateonly_should_throw() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 04); - - // Act - Action act = () => subject.Should().BeAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be after <2016-06-04>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_dateonly_is_not_after_the_same_expected_dateonly_should_succeed() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 04); - - // Act/Assert - subject.Should().NotBeAfter(expectation); - } - - [Fact] - public void When_asserting_subject_dateonly_is_on_or_after_earlier_expected_dateonly_should_succeed() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 03); - - // Act/Assert - subject.Should().BeOnOrAfter(expectation); - } - - [Fact] - public void When_asserting_subject_dateonly_is_not_on_or_after_earlier_expected_dateonly_should_throw() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 03); - - // Act - Action act = () => subject.Should().NotBeOnOrAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be before <2016-06-03>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_dateonly_is_on_or_after_the_same_expected_dateonly_should_succeed() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 04); - - // Act/Assert - subject.Should().BeOnOrAfter(expectation); - } - - [Fact] - public void When_asserting_subject_dateonly_is_not_on_or_after_the_same_expected_dateonly_should_throw() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 04); - - // Act - Action act = () => subject.Should().NotBeOnOrAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be before <2016-06-04>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_dateonly_is_on_or_after_later_expected_dateonly_should_throw() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 05); - - // Act - Action act = () => subject.Should().BeOnOrAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be on or after <2016-06-05>, but found <2016-06-04>."); - } - - [Fact] - public void When_asserting_subject_dateonly_is_not_on_or_after_later_expected_dateonly_should_succeed() - { - // Arrange - DateOnly subject = new(2016, 06, 04); - DateOnly expectation = new(2016, 06, 05); - - // Act/Assert - subject.Should().NotBeOnOrAfter(expectation); - } - } - - public class HaveYear - { - [Fact] - public void When_asserting_subject_dateonly_should_have_year_with_the_same_value_should_succeed() - { - // Arrange - DateOnly subject = new(2009, 12, 31); - const int expectation = 2009; - - // Act/Assert - subject.Should().HaveYear(expectation); - } - - [Fact] - public void When_asserting_subject_dateonly_should_not_have_year_with_the_same_value_should_throw() - { - // Arrange - DateOnly subject = new(2009, 12, 31); - const int expectation = 2009; - - // Act - Action act = () => subject.Should().NotHaveYear(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the year part of subject to be 2009, but it was."); - } - - [Fact] - public void When_asserting_subject_dateonly_should_have_year_with_a_different_value_should_throw() - { - // Arrange - DateOnly subject = new(2009, 12, 31); - const int expectation = 2008; - - // Act - Action act = () => subject.Should().HaveYear(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the year part of subject to be 2008, but found 2009."); - } - - [Fact] - public void When_asserting_subject_dateonly_should_not_have_year_with_a_different_value_should_succeed() - { - // Arrange - DateOnly subject = new(2009, 12, 31); - const int expectation = 2008; - - // Act/Assert - subject.Should().NotHaveYear(expectation); - } - - [Fact] - public void When_asserting_subject_null_dateonly_should_have_year_should_throw() - { - // Arrange - DateOnly? subject = null; - const int expectation = 2008; - - // Act - Action act = () => subject.Should().HaveYear(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the year part of subject to be 2008, but found ."); - } - - [Fact] - public void When_asserting_subject_null_dateonly_should_not_have_year_should_throw() - { - // Arrange - DateOnly? subject = null; - const int expectation = 2008; - - // Act - Action act = () => subject.Should().NotHaveYear(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the year part of subject to be 2008, but found a DateOnly."); - } - } - - public class HaveMonth - { - [Fact] - public void When_asserting_subject_dateonly_should_have_month_with_the_same_value_it_should_succeed() - { - // Arrange - DateOnly subject = new(2009, 12, 31); - const int expectation = 12; - - // Act/Assert - subject.Should().HaveMonth(expectation); - } - - [Fact] - public void When_asserting_subject_dateonly_should_not_have_month_with_the_same_value_it_should_throw() - { - // Arrange - DateOnly subject = new(2009, 12, 31); - const int expectation = 12; - - // Act - Action act = () => subject.Should().NotHaveMonth(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the month part of subject to be 12, but it was."); - } - - [Fact] - public void When_asserting_subject_dateonly_should_have_a_month_with_a_different_value_it_should_throw() - { - // Arrange - DateOnly subject = new(2009, 12, 31); - const int expectation = 11; - - // Act - Action act = () => subject.Should().HaveMonth(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the month part of subject to be 11, but found 12."); - } - - [Fact] - public void When_asserting_subject_dateonly_should_not_have_a_month_with_a_different_value_it_should_succeed() - { - // Arrange - DateOnly subject = new(2009, 12, 31); - const int expectation = 11; - - // Act/Assert - subject.Should().NotHaveMonth(expectation); - } - - [Fact] - public void When_asserting_subject_null_dateonly_should_have_month_should_throw() - { - // Arrange - DateOnly? subject = null; - const int expectation = 12; - - // Act - Action act = () => subject.Should().HaveMonth(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the month part of subject to be 12, but found a DateOnly."); - } - - [Fact] - public void When_asserting_subject_null_dateonly_should_not_have_month_should_throw() - { - // Arrange - DateOnly? subject = null; - const int expectation = 12; - - // Act - Action act = () => subject.Should().NotHaveMonth(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the month part of subject to be 12, but found a DateOnly."); - } - } - - public class NotBe - { - [Fact] - public void Different_dateonly_values_are_valid() - { - // Arrange - DateOnly date = new(2020, 06, 04); - DateOnly otherDate = new(2020, 06, 05); - - // Act & Assert - date.Should().NotBe(otherDate); - } - - [Fact] - public void Different_dateonly_values_with_different_nullability_are_valid() - { - // Arrange - DateOnly date = new(2020, 06, 04); - DateOnly? otherDate = new(2020, 07, 05); - - // Act & Assert - date.Should().NotBe(otherDate); - } - - [Fact] - public void Same_dateonly_values_are_invalid() - { - // Arrange - DateOnly date = new(2020, 06, 04); - DateOnly sameDate = new(2020, 06, 04); - - // Act - Action act = - () => date.Should().NotBe(sameDate, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected date not to be <2020-06-04> because we want to test the failure message, but it is."); - } - - [Fact] - public void Same_dateonly_values_with_different_nullability_are_invalid() - { - // Arrange - DateOnly date = new(2020, 06, 04); - DateOnly? sameDate = new(2020, 06, 04); - - // Act - Action act = - () => date.Should().NotBe(sameDate, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected date not to be <2020-06-04> because we want to test the failure message, but it is."); - } - } - - public class HaveDay - { - [Fact] - public void When_asserting_subject_dateonly_should_have_day_with_the_same_value_it_should_succeed() - { - // Arrange - DateOnly subject = new(2009, 12, 31); - const int expectation = 31; - - // Act/Assert - subject.Should().HaveDay(expectation); - } - - [Fact] - public void When_asserting_subject_dateonly_should_not_have_day_with_the_same_value_it_should_throw() - { - // Arrange - DateOnly subject = new(2009, 12, 31); - const int expectation = 31; - - // Act - Action act = () => subject.Should().NotHaveDay(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the day part of subject to be 31, but it was."); - } - - [Fact] - public void When_asserting_subject_dateonly_should_have_day_with_a_different_value_it_should_throw() - { - // Arrange - DateOnly subject = new(2009, 12, 31); - const int expectation = 30; - - // Act - Action act = () => subject.Should().HaveDay(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the day part of subject to be 30, but found 31."); - } - - [Fact] - public void When_asserting_subject_dateonly_should_not_have_day_with_a_different_value_it_should_succeed() - { - // Arrange - DateOnly subject = new(2009, 12, 31); - const int expectation = 30; - - // Act/Assert - subject.Should().NotHaveDay(expectation); - } - - [Fact] - public void When_asserting_subject_null_dateonly_should_have_day_should_throw() - { - // Arrange - DateOnly? subject = null; - const int expectation = 22; - - // Act - Action act = () => subject.Should().HaveDay(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the day part of subject to be 22, but found a DateOnly."); - } - - [Fact] - public void When_asserting_subject_null_dateonly_should_not_have_day_should_throw() - { - // Arrange - DateOnly? subject = null; - const int expectation = 22; - - // Act - Action act = () => subject.Should().NotHaveDay(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the day part of subject to be 22, but found a DateOnly."); - } - } - - public class BeOneOf - { - [Fact] - public void When_a_value_is_not_one_of_the_specified_values_it_should_throw() - { - // Arrange - DateOnly value = new(2016, 12, 20); - - // Act - Action action = () => value.Should().BeOneOf(value.AddDays(1), value.AddMonths(-1)); - - // Assert - action.Should().Throw() - .WithMessage("Expected value to be one of {<2016-12-21>, <2016-11-20>}, but found <2016-12-20>."); - } - - [Fact] - public void When_a_value_is_not_one_of_the_specified_values_it_should_throw_with_descriptive_message() - { - // Arrange - DateOnly value = new(2016, 12, 20); - - // Act - Action action = () => - value.Should().BeOneOf(new[] { value.AddDays(1), value.AddDays(2) }, "because it's true"); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected value to be one of {<2016-12-21>, <2016-12-22>} because it's true, but found <2016-12-20>."); - } - - [Fact] - public void When_a_value_is_one_of_the_specified_values_it_should_succeed() - { - // Arrange - DateOnly value = new(2016, 12, 30); - - // Act/Assert - value.Should().BeOneOf(new DateOnly(2216, 1, 30), new DateOnly(2016, 12, 30)); - } - - [Fact] - public void When_a_null_value_is_not_one_of_the_specified_values_it_should_throw() - { - // Arrange - DateOnly? value = null; - - // Act - Action action = () => value.Should().BeOneOf(new DateOnly(2216, 1, 30), new DateOnly(1116, 4, 10)); - - // Assert - action.Should().Throw() - .WithMessage("Expected value to be one of {<2216-01-30>, <1116-04-10>}, but found ."); - } - - [Fact] - public void When_a_value_is_one_of_the_specified_values_it_should_succeed_when_dateonly_is_null() - { - // Arrange - DateOnly? value = null; - - // Act/Assert - value.Should().BeOneOf(new DateOnly(2216, 1, 30), null); - } - } - - public class AndChaining + [Fact] + public void Should_support_chaining_constraints_with_and() { - [Fact] - public void Should_support_chaining_constraints_with_and() - { - // Arrange - DateOnly earlierDateOnly = new(2016, 06, 03); - DateOnly? nullableDateOnly = new(2016, 06, 04); + // Arrange + DateOnly earlierDateOnly = new(2016, 06, 03); + DateOnly? nullableDateOnly = new(2016, 06, 04); - // Act/Assert - nullableDateOnly.Should() - .HaveValue() - .And - .BeAfter(earlierDateOnly); - } + // Act/Assert + nullableDateOnly.Should() + .HaveValue() + .And + .BeAfter(earlierDateOnly); } - public class Miscellaneous + [Fact] + public void Should_throw_a_helpful_error_when_accidentally_using_equals() { - [Fact] - public void Should_throw_a_helpful_error_when_accidentally_using_equals() - { - // Arrange - DateOnly someDateOnly = new(2022, 9, 25); + // Arrange + DateOnly someDateOnly = new(2022, 9, 25); - // Act - Action action = () => someDateOnly.Should().Equals(someDateOnly); + // Act + Action action = () => someDateOnly.Should().Equals(someDateOnly); - // Assert - action.Should().Throw() - .WithMessage("Equals is not part of Fluent Assertions. Did you mean Be() instead?"); - } + // Assert + action.Should().Throw() + .WithMessage("Equals is not part of Fluent Assertions. Did you mean Be() instead?"); } } From 2fa7bfdee7408463cd3ed46842e8226df13a5a10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Wed, 1 Nov 2023 13:59:28 +0100 Subject: [PATCH 154/845] Split TimeOnlyAssertionSpecs --- .../Primitives/TimeOnlyAssertionSpecs.Be.cs | 212 +++ .../TimeOnlyAssertionSpecs.BeAfter.cs | 170 ++ .../TimeOnlyAssertionSpecs.BeBefore.cs | 130 ++ .../TimeOnlyAssertionSpecs.BeCloseTo.cs | 464 ++++++ .../TimeOnlyAssertionSpecs.BeOneOf.cs | 62 + .../TimeOnlyAssertionSpecs.HaveHours.cs | 96 ++ ...TimeOnlyAssertionSpecs.HaveMilliseconds.cs | 96 ++ .../TimeOnlyAssertionSpecs.HaveMinutes.cs | 96 ++ .../TimeOnlyAssertionSpecs.HaveSeconds.cs | 96 ++ .../Primitives/TimeOnlyAssertionSpecs.cs | 1372 +---------------- 10 files changed, 1443 insertions(+), 1351 deletions(-) create mode 100644 Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.Be.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.BeAfter.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.BeBefore.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.BeCloseTo.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.BeOneOf.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.HaveHours.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.HaveMilliseconds.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.HaveMinutes.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.HaveSeconds.cs diff --git a/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.Be.cs b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.Be.cs new file mode 100644 index 0000000000..c695144d0e --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.Be.cs @@ -0,0 +1,212 @@ +#if NET6_0_OR_GREATER +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class TimeOnlyAssertionSpecs +{ + public class Be + { + [Fact] + public void Should_succeed_when_asserting_timeonly_value_is_equal_to_the_same_value() + { + // Arrange + TimeOnly timeOnly = new(15, 06, 04, 146); + TimeOnly sameTimeOnly = new(15, 06, 04, 146); + + // Act/Assert + timeOnly.Should().Be(sameTimeOnly); + } + + [Fact] + public void When_timeonly_value_is_equal_to_the_same_nullable_value_be_should_succeed() + { + // Arrange + TimeOnly timeOnly = new(15, 06, 04, 146); + TimeOnly? sameTimeOnly = new(15, 06, 04, 146); + + // Act/Assert + timeOnly.Should().Be(sameTimeOnly); + } + + [Fact] + public void When_both_values_are_at_their_minimum_then_it_should_succeed() + { + // Arrange + TimeOnly timeOnly = TimeOnly.MinValue; + TimeOnly sameTimeOnly = TimeOnly.MinValue; + + // Act/Assert + timeOnly.Should().Be(sameTimeOnly); + } + + [Fact] + public void When_both_values_are_at_their_maximum_then_it_should_succeed() + { + // Arrange + TimeOnly timeOnly = TimeOnly.MaxValue; + TimeOnly sameTimeOnly = TimeOnly.MaxValue; + + // Act/Assert + timeOnly.Should().Be(sameTimeOnly); + } + + [Fact] + public void Should_fail_when_asserting_timeonly_value_is_equal_to_the_different_value() + { + // Arrange + var timeOnly = new TimeOnly(15, 03, 10); + var otherTimeOnly = new TimeOnly(15, 03, 11); + + // Act + Action act = () => timeOnly.Should().Be(otherTimeOnly, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage("Expected timeOnly to be <15:03:11.000>*failure message, but found <15:03:10.000>."); + } + + [Fact] + public void Should_fail_when_asserting_timeonly_value_is_equal_to_the_different_value_by_milliseconds() + { + // Arrange + var timeOnly = new TimeOnly(15, 03, 10, 556); + var otherTimeOnly = new TimeOnly(15, 03, 10, 175); + + // Act + Action act = () => timeOnly.Should().Be(otherTimeOnly, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage("Expected timeOnly to be <15:03:10.175>*failure message, but found <15:03:10.556>."); + } + + [Fact] + public void Should_succeed_when_asserting_nullable_numeric_value_equals_the_same_value() + { + // Arrange + TimeOnly? nullableTimeOnlyA = new TimeOnly(15, 06, 04, 123); + TimeOnly? nullableTimeOnlyB = new TimeOnly(15, 06, 04, 123); + + // Act/Assert + nullableTimeOnlyA.Should().Be(nullableTimeOnlyB); + } + + [Fact] + public void Should_succeed_when_asserting_nullable_numeric_null_value_equals_null() + { + // Arrange + TimeOnly? nullableTimeOnlyA = null; + TimeOnly? nullableTimeOnlyB = null; + + // Act/Assert + nullableTimeOnlyA.Should().Be(nullableTimeOnlyB); + } + + [Fact] + public void Should_fail_when_asserting_nullable_numeric_value_equals_a_different_value() + { + // Arrange + TimeOnly? nullableTimeOnlyA = new TimeOnly(15, 06, 04); + TimeOnly? nullableTimeOnlyB = new TimeOnly(15, 06, 06); + + // Act + Action action = () => + nullableTimeOnlyA.Should().Be(nullableTimeOnlyB); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void Should_fail_with_descriptive_message_when_asserting_timeonly_null_value_is_equal_to_another_value() + { + // Arrange + TimeOnly? nullableTimeOnly = null; + + // Act + Action action = () => + nullableTimeOnly.Should().Be(new TimeOnly(15, 06, 04), "because we want to test the failure {0}", + "message"); + + // Assert + action.Should().Throw() + .WithMessage( + "Expected nullableTimeOnly to be <15:06:04.000> because we want to test the failure message, but found ."); + } + + [Fact] + public void Should_succeed_when_asserting_timeonly_value_is_not_equal_to_a_different_value() + { + // Arrange + TimeOnly timeOnly = new(15, 06, 04); + TimeOnly otherTimeOnly = new(15, 06, 05); + + // Act/Assert + timeOnly.Should().NotBe(otherTimeOnly); + } + } + + public class NotBe + { + [Fact] + public void Different_timeonly_values_are_valid() + { + // Arrange + TimeOnly time = new(19, 06, 04); + TimeOnly otherTime = new(20, 06, 05); + + // Act & Assert + time.Should().NotBe(otherTime); + } + + [Fact] + public void Different_timeonly_values_with_different_nullability_are_valid() + { + // Arrange + TimeOnly time = new(19, 06, 04); + TimeOnly? otherTime = new(19, 07, 05); + + // Act & Assert + time.Should().NotBe(otherTime); + } + + [Fact] + public void Same_timeonly_values_are_invalid() + { + // Arrange + TimeOnly time = new(19, 06, 04); + TimeOnly sameTime = new(19, 06, 04); + + // Act + Action act = + () => time.Should().NotBe(sameTime, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected time not to be <19:06:04.000> because we want to test the failure message, but it is."); + } + + [Fact] + public void Same_timeonly_values_with_different_nullability_are_invalid() + { + // Arrange + TimeOnly time = new(19, 06, 04); + TimeOnly? sameTime = new(19, 06, 04); + + // Act + Action act = + () => time.Should().NotBe(sameTime, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected time not to be <19:06:04.000> because we want to test the failure message, but it is."); + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.BeAfter.cs b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.BeAfter.cs new file mode 100644 index 0000000000..30f53d3f1f --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.BeAfter.cs @@ -0,0 +1,170 @@ +#if NET6_0_OR_GREATER +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class TimeOnlyAssertionSpecs +{ + public class BeAfter + { + [Fact] + public void When_asserting_subject_timeonly_is_after_earlier_expected_timeonly_should_succeed() + { + // Arrange + TimeOnly subject = new(15, 06, 04, 123); + TimeOnly expectation = new(15, 06, 03, 45); + + // Act/Assert + subject.Should().BeAfter(expectation); + } + + [Fact] + public void When_asserting_subject_timeonly_is_not_after_earlier_expected_timeonly_should_throw() + { + // Arrange + TimeOnly subject = new(15, 06, 04); + TimeOnly expectation = new(15, 06, 03); + + // Act + Action act = () => subject.Should().NotBeAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be on or before <15:06:03.000>, but found <15:06:04.000>."); + } + + [Fact] + public void When_asserting_subject_timeonly_is_after_later_expected_timeonly_should_throw() + { + // Arrange + TimeOnly subject = new(15, 06, 04); + TimeOnly expectation = new(15, 06, 05); + + // Act + Action act = () => subject.Should().BeAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be after <15:06:05.000>, but found <15:06:04.000>."); + } + + [Fact] + public void When_asserting_subject_timeonly_is_not_after_later_expected_timeonly_should_succeed() + { + // Arrange + TimeOnly subject = new(15, 06, 04); + TimeOnly expectation = new(15, 06, 05); + + // Act/Assert + subject.Should().NotBeAfter(expectation); + } + + [Fact] + public void When_asserting_subject_timeonly_is_after_the_same_expected_timeonly_should_throw() + { + // Arrange + TimeOnly subject = new(15, 06, 04, 145); + TimeOnly expectation = new(15, 06, 04, 145); + + // Act + Action act = () => subject.Should().BeAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be after <15:06:04.145>, but found <15:06:04.145>."); + } + + [Fact] + public void When_asserting_subject_timeonly_is_not_after_the_same_expected_timeonly_should_succeed() + { + // Arrange + TimeOnly subject = new(15, 06, 04, 123); + TimeOnly expectation = new(15, 06, 04, 123); + + // Act/Assert + subject.Should().NotBeAfter(expectation); + } + + [Fact] + public void When_asserting_subject_timeonly_is_on_or_after_earlier_expected_timeonly_should_succeed() + { + // Arrange + TimeOnly subject = new(15, 07); + TimeOnly expectation = new(15, 06); + + // Act/Assert + subject.Should().BeOnOrAfter(expectation); + } + + [Fact] + public void When_asserting_subject_timeonly_is_not_on_or_after_earlier_expected_timeonly_should_throw() + { + // Arrange + TimeOnly subject = new(15, 06, 04); + TimeOnly expectation = new(15, 06, 03); + + // Act + Action act = () => subject.Should().NotBeOnOrAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be before <15:06:03.000>, but found <15:06:04.000>."); + } + + [Fact] + public void When_asserting_subject_timeonly_is_on_or_after_the_same_expected_timeonly_should_succeed() + { + // Arrange + TimeOnly subject = new(15, 06, 04); + TimeOnly expectation = new(15, 06, 04); + + // Act/Assert + subject.Should().BeOnOrAfter(expectation); + } + + [Fact] + public void When_asserting_subject_timeonly_is_not_on_or_after_the_same_expected_timeonly_should_throw() + { + // Arrange + TimeOnly subject = new(15, 06); + TimeOnly expectation = new(15, 06); + + // Act + Action act = () => subject.Should().NotBeOnOrAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be before <15:06:00.000>, but found <15:06:00.000>."); + } + + [Fact] + public void When_asserting_subject_timeonly_is_on_or_after_later_expected_timeonly_should_throw() + { + // Arrange + TimeOnly subject = new(15, 06, 04); + TimeOnly expectation = new(15, 06, 05); + + // Act + Action act = () => subject.Should().BeOnOrAfter(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be on or after <15:06:05.000>, but found <15:06:04.000>."); + } + + [Fact] + public void When_asserting_subject_timeonly_is_not_on_or_after_later_expected_timeonly_should_succeed() + { + // Arrange + TimeOnly subject = new(15, 06, 04); + TimeOnly expectation = new(15, 06, 05); + + // Act/Assert + subject.Should().NotBeOnOrAfter(expectation); + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.BeBefore.cs b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.BeBefore.cs new file mode 100644 index 0000000000..91b59a6714 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.BeBefore.cs @@ -0,0 +1,130 @@ +#if NET6_0_OR_GREATER +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class TimeOnlyAssertionSpecs +{ + public class BeBefore + { + [Fact] + public void When_asserting_subject_is_not_before_earlier_expected_timeonly_it_should_succeed() + { + // Arrange + TimeOnly expected = new(15, 06, 03); + TimeOnly subject = new(15, 06, 04); + + // Act/Assert + subject.Should().NotBeBefore(expected); + } + + [Fact] + public void When_asserting_subject_timeonly_is_before_the_same_timeonly_it_should_throw() + { + // Arrange + TimeOnly expected = new(15, 06, 04); + TimeOnly subject = new(15, 06, 04); + + // Act + Action act = () => subject.Should().BeBefore(expected); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be before <15:06:04.000>, but found <15:06:04.000>."); + } + + [Fact] + public void When_asserting_subject_timeonly_is_not_before_the_same_timeonly_it_should_succeed() + { + // Arrange + TimeOnly expected = new(15, 06, 04); + TimeOnly subject = new(15, 06, 04); + + // Act/Assert + subject.Should().NotBeBefore(expected); + } + + [Fact] + public void When_asserting_subject_timeonly_is_on_or_before_expected_timeonly_should_succeed() + { + // Arrange + TimeOnly subject = new(15, 06, 04, 175); + TimeOnly expectation = new(15, 06, 05, 23); + + // Act/Assert + subject.Should().BeOnOrBefore(expectation); + } + + [Fact] + public void When_asserting_subject_timeonly_is_on_or_before_expected_timeonly_should_throw() + { + // Arrange + TimeOnly subject = new(15, 06, 04, 150); + TimeOnly expectation = new(15, 06, 05, 340); + + // Act + Action act = () => subject.Should().NotBeOnOrBefore(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be after <15:06:05.340>, but found <15:06:04.150>."); + } + + [Fact] + public void + When_asserting_subject_timeonly_is_on_or_before_the_same_time_as_the_expected_timeonly_should_succeed() + { + // Arrange + TimeOnly subject = new(15, 06, 04); + TimeOnly expectation = new(15, 06, 04); + + // Act/Assert + subject.Should().BeOnOrBefore(expectation); + } + + [Fact] + public void When_asserting_subject_timeonly_is_on_or_before_the_same_time_as_the_expected_timeonly_should_throw() + { + // Arrange + TimeOnly subject = new(15, 06, 04, 123); + TimeOnly expectation = new(15, 06, 04, 123); + + // Act + Action act = () => subject.Should().NotBeOnOrBefore(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be after <15:06:04.123>, but found <15:06:04.123>."); + } + + [Fact] + public void When_asserting_subject_timeonly_is_not_on_or_before_earlier_expected_timeonly_should_throw() + { + // Arrange + TimeOnly subject = new(15, 07); + TimeOnly expectation = new(15, 06); + + // Act + Action act = () => subject.Should().BeOnOrBefore(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be on or before <15:06:00.000>, but found <15:07:00.000>."); + } + + [Fact] + public void When_asserting_subject_timeonly_is_not_on_or_before_earlier_expected_timeonly_should_succeed() + { + // Arrange + TimeOnly subject = new(15, 06, 04); + TimeOnly expectation = new(15, 06, 03); + + // Act/Assert + subject.Should().NotBeOnOrBefore(expectation); + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.BeCloseTo.cs b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.BeCloseTo.cs new file mode 100644 index 0000000000..0f9d0681f8 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.BeCloseTo.cs @@ -0,0 +1,464 @@ +#if NET6_0_OR_GREATER +using System; +using FluentAssertions.Execution; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class TimeOnlyAssertionSpecs +{ + public class BeCloseTo + { + [Fact] + public void When_time_is_close_to_a_negative_precision_it_should_throw() + { + // Arrange + var time = TimeOnly.FromDateTime(DateTime.UtcNow); + var actual = new TimeOnly(time.Ticks - 1); + + // Act + Action act = () => actual.Should().BeCloseTo(time, -1.Ticks()); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_a_time_is_close_to_a_later_time_by_one_tick_it_should_succeed() + { + // Arrange + var time = TimeOnly.FromDateTime(DateTime.UtcNow); + var actual = new TimeOnly(time.Ticks - 1); + + // Act / Assert + actual.Should().BeCloseTo(time, TimeSpan.FromTicks(1)); + } + + [Fact] + public void When_a_time_is_close_to_an_earlier_time_by_one_tick_it_should_succeed() + { + // Arrange + var time = TimeOnly.FromDateTime(DateTime.UtcNow); + var actual = new TimeOnly(time.Ticks + 1); + + // Act / Assert + actual.Should().BeCloseTo(time, TimeSpan.FromTicks(1)); + } + + [Fact] + public void When_subject_time_is_close_to_the_minimum_time_it_should_succeed() + { + // Arrange + TimeOnly time = TimeOnly.MinValue.Add(50.Milliseconds()); + TimeOnly nearbyTime = TimeOnly.MinValue; + + // Act / Assert + time.Should().BeCloseTo(nearbyTime, 100.Milliseconds()); + } + + [Fact] + public void When_subject_time_is_close_to_the_maximum_time_it_should_succeed() + { + // Arrange + TimeOnly time = TimeOnly.MaxValue.Add(-50.Milliseconds()); + TimeOnly nearbyTime = TimeOnly.MaxValue; + + // Act / Assert + time.Should().BeCloseTo(nearbyTime, 100.Milliseconds()); + } + + [Fact] + public void When_subject_time_is_close_to_another_value_that_is_later_by_more_than_20ms_it_should_throw() + { + // Arrange + TimeOnly time = new(12, 15, 30, 979); + TimeOnly nearbyTime = new(12, 15, 31); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected time to be within 20ms from <12:15:31.000>, but <12:15:30.979> was off by 21ms."); + } + + [Fact] + public void When_subject_time_is_close_to_another_value_that_is_earlier_by_more_than_20ms_it_should_throw() + { + // Arrange + TimeOnly time = new(12, 15, 31, 021); + TimeOnly nearbyTime = new(12, 15, 31); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected time to be within 20ms from <12:15:31.000>, but <12:15:31.021> was off by 21ms."); + } + + [Fact] + public void When_subject_time_is_close_to_an_earlier_time_by_35ms_it_should_succeed() + { + // Arrange + TimeOnly time = new(12, 15, 31, 035); + TimeOnly nearbyTime = new(12, 15, 31); + + // Act / Assert + time.Should().BeCloseTo(nearbyTime, 35.Milliseconds()); + } + + [Fact] + public void A_time_is_close_to_a_later_time_when_passing_midnight() + { + // Arrange + TimeOnly time = new(23, 59, 0); + TimeOnly nearbyTime = new(0, 1, 0); + + // Act / Assert + time.Should().BeCloseTo(nearbyTime, 2.Minutes()); + } + + [Fact] + public void A_time_is_close_to_an_earlier_time_when_passing_midnight() + { + // Arrange + TimeOnly time = new(0, 1, 0); + TimeOnly nearbyTime = new(23, 59, 0); + + // Act / Assert + time.Should().BeCloseTo(nearbyTime, 2.Minutes()); + } + + [Fact] + public void A_time_outside_of_the_precision_to_a_later_time_when_passing_midnight_fails() + { + // Arrange + TimeOnly time = new(23, 58, 59); + TimeOnly nearbyTime = new(0, 1, 0); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 2.Minutes()); + + // Assert + act.Should().Throw() + .WithMessage("Expected * to be within 2m from <00:01:00.000>*, but <23:58:59.000> was off by 2m and 1s*"); + } + + [Fact] + public void A_time_outside_of_the_precision_to_an_earlier_time_when_passing_midnight_fails() + { + // Arrange + TimeOnly time = new(0, 1, 0); + TimeOnly nearbyTime = new(23, 58, 59); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 2.Minutes()); + + // Assert + act.Should().Throw() + .WithMessage("Expected * to be within 2m from <23:58:59.000>*, but <00:01:00.000> was off by 2m and 1s*"); + } + + [Fact] + public void When_subject_nulltime_is_close_to_another_it_should_throw() + { + // Arrange + TimeOnly? time = null; + TimeOnly nearbyTime = new(12, 15, 31); + + // Act + Action act = () => time.Should().BeCloseTo(nearbyTime, 35.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage("Expected*, but found ."); + } + + [Fact] + public void A_null_time_inside_an_assertion_scope_fails() + { + // Arrange + TimeOnly? time = null; + TimeOnly nearbyTime = new(12, 15, 31); + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + time.Should().BeCloseTo(nearbyTime, 35.Milliseconds()); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expected*, but found ."); + } + } + + public class NotBeCloseTo + { + [Fact] + public void A_null_time_is_never_unclose_to_an_other_time() + { + // Arrange + TimeOnly? time = null; + TimeOnly nearbyTime = new(12, 15, 31); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 35.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect*, but found ."); + } + + [Fact] + public void A_null_time_inside_an_assertion_scope_is_never_unclose_to_an_other_time() + { + // Arrange + TimeOnly? time = null; + TimeOnly nearbyTime = new(12, 15, 31); + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + time.Should().NotBeCloseTo(nearbyTime, 35.Milliseconds()); + }; + + // Assert + act.Should().Throw() + .WithMessage("Did not expect*, but found ."); + } + + [Fact] + public void When_time_is_not_close_to_a_negative_precision_it_should_throw() + { + // Arrange + var time = TimeOnly.FromDateTime(DateTime.UtcNow); + var actual = new TimeOnly(time.Ticks - 1); + + // Act + Action act = () => actual.Should().NotBeCloseTo(time, -1.Ticks()); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_a_time_is_close_to_a_later_time_by_one_tick_it_should_fail() + { + // Arrange + var time = TimeOnly.FromDateTime(DateTime.UtcNow); + var actual = new TimeOnly(time.Ticks - 1); + + // Act + Action act = () => actual.Should().NotBeCloseTo(time, TimeSpan.FromTicks(1)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_time_is_close_to_an_earlier_time_by_one_tick_it_should_fail() + { + // Arrange + var time = TimeOnly.FromDateTime(DateTime.UtcNow); + var actual = new TimeOnly(time.Ticks + 1); + + // Act + Action act = () => actual.Should().NotBeCloseTo(time, TimeSpan.FromTicks(1)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_time_is_close_to_a_min_value_by_one_tick_it_should_fail() + { + // Arrange + var time = TimeOnly.MinValue; + var actual = new TimeOnly(time.Ticks + 1); + + // Act + Action act = () => actual.Should().NotBeCloseTo(time, TimeSpan.FromTicks(1)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_time_is_close_to_a_max_value_by_one_tick_it_should_fail() + { + // Arrange + var time = TimeOnly.MaxValue; + var actual = new TimeOnly(time.Ticks - 1); + + // Act + Action act = () => actual.Should().NotBeCloseTo(time, TimeSpan.FromTicks(1)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_asserting_subject_time_is_not_close_to_an_earlier_time_it_should_throw() + { + // Arrange + TimeOnly time = new(12, 15, 31, 020); + TimeOnly nearbyTime = new(12, 15, 31); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect time to be within 20ms from <12:15:31.000>, but it was <12:15:31.020>."); + } + + [Fact] + public void When_asserting_subject_time_is_not_close_to_an_earlier_time_by_a_20ms_timespan_it_should_throw() + { + // Arrange + TimeOnly time = new(12, 15, 31, 020); + TimeOnly nearbyTime = new(12, 15, 31); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, TimeSpan.FromMilliseconds(20)); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect time to be within 20ms from <12:15:31.000>, but it was <12:15:31.020>."); + } + + [Fact] + public void When_asserting_subject_time_is_not_close_to_another_value_that_is_later_by_more_than_20ms_it_should_succeed() + { + // Arrange + TimeOnly time = new(12, 15, 30, 979); + TimeOnly nearbyTime = new(12, 15, 31); + + // Act / Assert + time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); + } + + [Fact] + public void + When_asserting_subject_time_is_not_close_to_another_value_that_is_earlier_by_more_than_20ms_it_should_succeed() + { + // Arrange + TimeOnly time = new(12, 15, 31, 021); + TimeOnly nearbyTime = new(12, 15, 31); + + // Act / Assert + time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); + } + + [Fact] + public void When_asserting_subject_datetime_is_not_close_to_an_earlier_datetime_by_35ms_it_should_throw() + { + // Arrange + TimeOnly time = new(12, 15, 31, 035); + TimeOnly nearbyTime = new(12, 15, 31); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 35.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect time to be within 35ms from <12:15:31.000>, but it was <12:15:31.035>."); + } + + [Fact] + public void When_asserting_subject_time_is_not_close_to_the_minimum_time_it_should_throw() + { + // Arrange + TimeOnly time = TimeOnly.MinValue.Add(50.Milliseconds()); + TimeOnly nearbyTime = TimeOnly.MinValue; + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 100.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect time to be within 100ms from <00:00:00.000>, but it was <00:00:00.050>."); + } + + [Fact] + public void When_asserting_subject_time_is_not_close_to_the_maximum_time_it_should_throw() + { + // Arrange + TimeOnly time = TimeOnly.MaxValue.Add(-50.Milliseconds()); + TimeOnly nearbyTime = TimeOnly.MaxValue; + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 100.Milliseconds()); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect time to be within 100ms from <23:59:59.999>, but it was <23:59:59.949>."); + } + + [Fact] + public void A_time_is_not_close_to_a_later_time_when_passing_midnight() + { + // Arrange + TimeOnly time = new(23, 58, 0); + TimeOnly nearbyTime = new(0, 1, 0); + + // Act / Assert + time.Should().NotBeCloseTo(nearbyTime, 2.Minutes()); + } + + [Fact] + public void A_time_is_not_close_to_an_earlier_time_when_passing_midnight() + { + // Arrange + TimeOnly time = new(0, 2, 0); + TimeOnly nearbyTime = new(23, 59, 0); + + // Act / Assert + time.Should().NotBeCloseTo(nearbyTime, 2.Minutes()); + } + + [Fact] + public void A_time_inside_of_the_precision_to_a_later_time_when_passing_midnight_fails() + { + // Arrange + TimeOnly time = new(23, 59, 0); + TimeOnly nearbyTime = new(0, 1, 0); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 2.Minutes()); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect * to be within 2m from <00:01:00.000>*, but it was <23:59:00.000>*"); + } + + [Fact] + public void A_time_inside_of_the_precision_to_an_earlier_time_when_passing_midnight_fails() + { + // Arrange + TimeOnly time = new(0, 1, 0); + TimeOnly nearbyTime = new(23, 59, 0); + + // Act + Action act = () => time.Should().NotBeCloseTo(nearbyTime, 2.Minutes()); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect * to be within 2m from <23:59:00.000>*, but it was <00:01:00.000>*"); + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.BeOneOf.cs b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.BeOneOf.cs new file mode 100644 index 0000000000..85b70302c6 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.BeOneOf.cs @@ -0,0 +1,62 @@ +#if NET6_0_OR_GREATER +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class TimeOnlyAssertionSpecs +{ + public class BeOneOf + { + [Fact] + public void When_a_value_is_not_one_of_the_specified_values_it_should_throw() + { + // Arrange + TimeOnly value = new(15, 12, 20); + + // Act + Action action = () => value.Should().BeOneOf(value.AddHours(1), value.AddMinutes(-1)); + + // Assert + action.Should().Throw() + .WithMessage("Expected value to be one of {<16:12:20.000>, <15:11:20.000>}, but found <15:12:20.000>."); + } + + [Fact] + public void When_a_value_is_one_of_the_specified_values_it_should_succeed() + { + // Arrange + TimeOnly value = new(15, 12, 30); + + // Act/Assert + value.Should().BeOneOf(new TimeOnly(4, 1, 30), new TimeOnly(15, 12, 30)); + } + + [Fact] + public void When_a_null_value_is_not_one_of_the_specified_values_it_should_throw() + { + // Arrange + TimeOnly? value = null; + + // Act + Action action = () => value.Should().BeOneOf(new TimeOnly(15, 1, 30), new TimeOnly(5, 4, 10, 123)); + + // Assert + action.Should().Throw() + .WithMessage("Expected value to be one of {<15:01:30.000>, <05:04:10.123>}, but found ."); + } + + [Fact] + public void When_a_value_is_one_of_the_specified_values_it_should_succeed_when_timeonly_is_null() + { + // Arrange + TimeOnly? value = null; + + // Act/Assert + value.Should().BeOneOf(new TimeOnly(15, 1, 30), null); + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.HaveHours.cs b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.HaveHours.cs new file mode 100644 index 0000000000..9b4b4a1e6b --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.HaveHours.cs @@ -0,0 +1,96 @@ +#if NET6_0_OR_GREATER +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class TimeOnlyAssertionSpecs +{ + public class HaveHours + { + [Fact] + public void When_asserting_subject_timeonly_should_have_hours_with_the_same_value_should_succeed() + { + // Arrange + TimeOnly subject = new(15, 12, 31); + const int expectation = 15; + + // Act/Assert + subject.Should().HaveHours(expectation); + } + + [Fact] + public void When_asserting_subject_timeonly_should_not_have_hours_with_the_same_value_should_throw() + { + // Arrange + TimeOnly subject = new(15, 12, 31); + const int expectation = 15; + + // Act + Action act = () => subject.Should().NotHaveHours(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the hours part of subject to be 15, but it was."); + } + + [Fact] + public void When_asserting_subject_timeonly_should_have_hours_with_a_different_value_should_throw() + { + // Arrange + TimeOnly subject = new(15, 12, 31); + const int expectation = 14; + + // Act + Action act = () => subject.Should().HaveHours(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the hours part of subject to be 14, but found 15."); + } + + [Fact] + public void When_asserting_subject_timeonly_should_not_have_hours_with_a_different_value_should_succeed() + { + // Arrange + TimeOnly subject = new(21, 12, 31); + const int expectation = 23; + + // Act/Assert + subject.Should().NotHaveHours(expectation); + } + + [Fact] + public void When_asserting_subject_null_timeonly_should_have_hours_should_throw() + { + // Arrange + TimeOnly? subject = null; + const int expectation = 21; + + // Act + Action act = () => subject.Should().HaveHours(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the hours part of subject to be 21, but found ."); + } + + [Fact] + public void When_asserting_subject_null_timeonly_should_not_have_hours_should_throw() + { + // Arrange + TimeOnly? subject = null; + const int expectation = 19; + + // Act + Action act = () => subject.Should().NotHaveHours(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the hours part of subject to be 19, but found a TimeOnly."); + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.HaveMilliseconds.cs b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.HaveMilliseconds.cs new file mode 100644 index 0000000000..e00e8afea7 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.HaveMilliseconds.cs @@ -0,0 +1,96 @@ +#if NET6_0_OR_GREATER +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class TimeOnlyAssertionSpecs +{ + public class HaveMilliseconds + { + [Fact] + public void When_asserting_subject_timeonly_should_have_milliseconds_with_the_same_value_it_should_succeed() + { + // Arrange + TimeOnly subject = new(14, 12, 31, 123); + const int expectation = 123; + + // Act/Assert + subject.Should().HaveMilliseconds(expectation); + } + + [Fact] + public void When_asserting_subject_timeonly_should_not_have_milliseconds_with_the_same_value_it_should_throw() + { + // Arrange + TimeOnly subject = new(14, 12, 31, 445); + const int expectation = 445; + + // Act + Action act = () => subject.Should().NotHaveMilliseconds(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the milliseconds part of subject to be 445, but it was."); + } + + [Fact] + public void When_asserting_subject_timeonly_should_have_milliseconds_with_a_different_value_it_should_throw() + { + // Arrange + TimeOnly subject = new(15, 12, 31, 555); + const int expectation = 12; + + // Act + Action act = () => subject.Should().HaveMilliseconds(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the milliseconds part of subject to be 12, but found 555."); + } + + [Fact] + public void When_asserting_subject_timeonly_should_not_have_milliseconds_with_a_different_value_it_should_succeed() + { + // Arrange + TimeOnly subject = new(15, 12, 31, 445); + const int expectation = 31; + + // Act/Assert + subject.Should().NotHaveMilliseconds(expectation); + } + + [Fact] + public void When_asserting_subject_null_timeonly_should_have_milliseconds_should_throw() + { + // Arrange + TimeOnly? subject = null; + const int expectation = 22; + + // Act + Action act = () => subject.Should().HaveMilliseconds(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the milliseconds part of subject to be 22, but found a TimeOnly."); + } + + [Fact] + public void When_asserting_subject_null_timeonly_should_not_have_milliseconds_should_throw() + { + // Arrange + TimeOnly? subject = null; + const int expectation = 22; + + // Act + Action act = () => subject.Should().NotHaveMilliseconds(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the milliseconds part of subject to be 22, but found a TimeOnly."); + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.HaveMinutes.cs b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.HaveMinutes.cs new file mode 100644 index 0000000000..9e462ceda1 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.HaveMinutes.cs @@ -0,0 +1,96 @@ +#if NET6_0_OR_GREATER +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class TimeOnlyAssertionSpecs +{ + public class HaveMinutes + { + [Fact] + public void When_asserting_subject_timeonly_should_have_minutes_with_the_same_value_it_should_succeed() + { + // Arrange + TimeOnly subject = new(21, 12, 31); + const int expectation = 12; + + // Act/Assert + subject.Should().HaveMinutes(expectation); + } + + [Fact] + public void When_asserting_subject_timeonly_should_not_have_minutes_with_the_same_value_it_should_throw() + { + // Arrange + TimeOnly subject = new(21, 12, 31); + const int expectation = 12; + + // Act + Action act = () => subject.Should().NotHaveMinutes(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the minutes part of subject to be 12, but it was."); + } + + [Fact] + public void When_asserting_subject_timeonly_should_have_a_minute_with_a_different_value_it_should_throw() + { + // Arrange + TimeOnly subject = new(15, 12, 31); + const int expectation = 11; + + // Act + Action act = () => subject.Should().HaveMinutes(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the minutes part of subject to be 11, but found 12."); + } + + [Fact] + public void When_asserting_subject_timeonly_should_not_have_a_minute_with_a_different_value_it_should_succeed() + { + // Arrange + TimeOnly subject = new(15, 12, 31); + const int expectation = 11; + + // Act/Assert + subject.Should().NotHaveMinutes(expectation); + } + + [Fact] + public void When_asserting_subject_null_timeonly_should_have_minutes_should_throw() + { + // Arrange + TimeOnly? subject = null; + const int expectation = 12; + + // Act + Action act = () => subject.Should().HaveMinutes(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the minutes part of subject to be 12, but found a TimeOnly."); + } + + [Fact] + public void When_asserting_subject_null_timeonly_should_not_have_minutes_should_throw() + { + // Arrange + TimeOnly? subject = null; + const int expectation = 12; + + // Act + Action act = () => subject.Should().NotHaveMinutes(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the minutes part of subject to be 12, but found a TimeOnly."); + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.HaveSeconds.cs b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.HaveSeconds.cs new file mode 100644 index 0000000000..df13410581 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.HaveSeconds.cs @@ -0,0 +1,96 @@ +#if NET6_0_OR_GREATER +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class TimeOnlyAssertionSpecs +{ + public class HaveSeconds + { + [Fact] + public void When_asserting_subject_timeonly_should_have_seconds_with_the_same_value_it_should_succeed() + { + // Arrange + TimeOnly subject = new(14, 12, 31); + const int expectation = 31; + + // Act/Assert + subject.Should().HaveSeconds(expectation); + } + + [Fact] + public void When_asserting_subject_timeonly_should_not_have_seconds_with_the_same_value_it_should_throw() + { + // Arrange + TimeOnly subject = new(14, 12, 31); + const int expectation = 31; + + // Act + Action act = () => subject.Should().NotHaveSeconds(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the seconds part of subject to be 31, but it was."); + } + + [Fact] + public void When_asserting_subject_timeonly_should_have_seconds_with_a_different_value_it_should_throw() + { + // Arrange + TimeOnly subject = new(15, 12, 31); + const int expectation = 30; + + // Act + Action act = () => subject.Should().HaveSeconds(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the seconds part of subject to be 30, but found 31."); + } + + [Fact] + public void When_asserting_subject_timeonly_should_not_have_seconds_with_a_different_value_it_should_succeed() + { + // Arrange + TimeOnly subject = new(15, 12, 31); + const int expectation = 30; + + // Act/Assert + subject.Should().NotHaveSeconds(expectation); + } + + [Fact] + public void When_asserting_subject_null_timeonly_should_have_seconds_should_throw() + { + // Arrange + TimeOnly? subject = null; + const int expectation = 22; + + // Act + Action act = () => subject.Should().HaveSeconds(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Expected the seconds part of subject to be 22, but found a TimeOnly."); + } + + [Fact] + public void When_asserting_subject_null_timeonly_should_not_have_seconds_should_throw() + { + // Arrange + TimeOnly? subject = null; + const int expectation = 22; + + // Act + Action act = () => subject.Should().NotHaveSeconds(expectation); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the seconds part of subject to be 22, but found a TimeOnly."); + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.cs index b84f1386af..e5901fb197 100644 --- a/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/TimeOnlyAssertionSpecs.cs @@ -1,13 +1,10 @@ +#if NET6_0_OR_GREATER using System; -using FluentAssertions.Execution; -using FluentAssertions.Extensions; using Xunit; -using Xunit.Sdk; -#if NET6_0_OR_GREATER namespace FluentAssertions.Specs.Primitives; -public class TimeOnlyAssertionSpecs +public partial class TimeOnlyAssertionSpecs { [Fact] public void Should_succeed_when_asserting_nullable_timeonly_value_with_value_to_have_a_value() @@ -39,1359 +36,32 @@ public void Should_succeed_when_asserting_nullable_timeonly_value_with_null_to_b timeOnly.Should().BeNull(); } - public class Be - { - [Fact] - public void Should_succeed_when_asserting_timeonly_value_is_equal_to_the_same_value() - { - // Arrange - TimeOnly timeOnly = new(15, 06, 04, 146); - TimeOnly sameTimeOnly = new(15, 06, 04, 146); - - // Act/Assert - timeOnly.Should().Be(sameTimeOnly); - } - - [Fact] - public void When_timeonly_value_is_equal_to_the_same_nullable_value_be_should_succeed() - { - // Arrange - TimeOnly timeOnly = new(15, 06, 04, 146); - TimeOnly? sameTimeOnly = new(15, 06, 04, 146); - - // Act/Assert - timeOnly.Should().Be(sameTimeOnly); - } - - [Fact] - public void When_both_values_are_at_their_minimum_then_it_should_succeed() - { - // Arrange - TimeOnly timeOnly = TimeOnly.MinValue; - TimeOnly sameTimeOnly = TimeOnly.MinValue; - - // Act/Assert - timeOnly.Should().Be(sameTimeOnly); - } - - [Fact] - public void When_both_values_are_at_their_maximum_then_it_should_succeed() - { - // Arrange - TimeOnly timeOnly = TimeOnly.MaxValue; - TimeOnly sameTimeOnly = TimeOnly.MaxValue; - - // Act/Assert - timeOnly.Should().Be(sameTimeOnly); - } - - [Fact] - public void Should_fail_when_asserting_timeonly_value_is_equal_to_the_different_value() - { - // Arrange - var timeOnly = new TimeOnly(15, 03, 10); - var otherTimeOnly = new TimeOnly(15, 03, 11); - - // Act - Action act = () => timeOnly.Should().Be(otherTimeOnly, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage("Expected timeOnly to be <15:03:11.000>*failure message, but found <15:03:10.000>."); - } - - [Fact] - public void Should_fail_when_asserting_timeonly_value_is_equal_to_the_different_value_by_milliseconds() - { - // Arrange - var timeOnly = new TimeOnly(15, 03, 10, 556); - var otherTimeOnly = new TimeOnly(15, 03, 10, 175); - - // Act - Action act = () => timeOnly.Should().Be(otherTimeOnly, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage("Expected timeOnly to be <15:03:10.175>*failure message, but found <15:03:10.556>."); - } - - [Fact] - public void Should_succeed_when_asserting_nullable_numeric_value_equals_the_same_value() - { - // Arrange - TimeOnly? nullableTimeOnlyA = new TimeOnly(15, 06, 04, 123); - TimeOnly? nullableTimeOnlyB = new TimeOnly(15, 06, 04, 123); - - // Act/Assert - nullableTimeOnlyA.Should().Be(nullableTimeOnlyB); - } - - [Fact] - public void Should_succeed_when_asserting_nullable_numeric_null_value_equals_null() - { - // Arrange - TimeOnly? nullableTimeOnlyA = null; - TimeOnly? nullableTimeOnlyB = null; - - // Act/Assert - nullableTimeOnlyA.Should().Be(nullableTimeOnlyB); - } - - [Fact] - public void Should_fail_when_asserting_nullable_numeric_value_equals_a_different_value() - { - // Arrange - TimeOnly? nullableTimeOnlyA = new TimeOnly(15, 06, 04); - TimeOnly? nullableTimeOnlyB = new TimeOnly(15, 06, 06); - - // Act - Action action = () => - nullableTimeOnlyA.Should().Be(nullableTimeOnlyB); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_timeonly_null_value_is_equal_to_another_value() - { - // Arrange - TimeOnly? nullableTimeOnly = null; - - // Act - Action action = () => - nullableTimeOnly.Should().Be(new TimeOnly(15, 06, 04), "because we want to test the failure {0}", - "message"); - - // Assert - action.Should().Throw() - .WithMessage( - "Expected nullableTimeOnly to be <15:06:04.000> because we want to test the failure message, but found ."); - } - - [Fact] - public void Should_succeed_when_asserting_timeonly_value_is_not_equal_to_a_different_value() - { - // Arrange - TimeOnly timeOnly = new(15, 06, 04); - TimeOnly otherTimeOnly = new(15, 06, 05); - - // Act/Assert - timeOnly.Should().NotBe(otherTimeOnly); - } - } - - public class BeCloseTo - { - [Fact] - public void When_time_is_close_to_a_negative_precision_it_should_throw() - { - // Arrange - var time = TimeOnly.FromDateTime(DateTime.UtcNow); - var actual = new TimeOnly(time.Ticks - 1); - - // Act - Action act = () => actual.Should().BeCloseTo(time, -1.Ticks()); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_a_time_is_close_to_a_later_time_by_one_tick_it_should_succeed() - { - // Arrange - var time = TimeOnly.FromDateTime(DateTime.UtcNow); - var actual = new TimeOnly(time.Ticks - 1); - - // Act / Assert - actual.Should().BeCloseTo(time, TimeSpan.FromTicks(1)); - } - - [Fact] - public void When_a_time_is_close_to_an_earlier_time_by_one_tick_it_should_succeed() - { - // Arrange - var time = TimeOnly.FromDateTime(DateTime.UtcNow); - var actual = new TimeOnly(time.Ticks + 1); - - // Act / Assert - actual.Should().BeCloseTo(time, TimeSpan.FromTicks(1)); - } - - [Fact] - public void When_subject_time_is_close_to_the_minimum_time_it_should_succeed() - { - // Arrange - TimeOnly time = TimeOnly.MinValue.Add(50.Milliseconds()); - TimeOnly nearbyTime = TimeOnly.MinValue; - - // Act / Assert - time.Should().BeCloseTo(nearbyTime, 100.Milliseconds()); - } - - [Fact] - public void When_subject_time_is_close_to_the_maximum_time_it_should_succeed() - { - // Arrange - TimeOnly time = TimeOnly.MaxValue.Add(-50.Milliseconds()); - TimeOnly nearbyTime = TimeOnly.MaxValue; - - // Act / Assert - time.Should().BeCloseTo(nearbyTime, 100.Milliseconds()); - } - - [Fact] - public void When_subject_time_is_close_to_another_value_that_is_later_by_more_than_20ms_it_should_throw() - { - // Arrange - TimeOnly time = new(12, 15, 30, 979); - TimeOnly nearbyTime = new(12, 15, 31); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected time to be within 20ms from <12:15:31.000>, but <12:15:30.979> was off by 21ms."); - } - - [Fact] - public void When_subject_time_is_close_to_another_value_that_is_earlier_by_more_than_20ms_it_should_throw() - { - // Arrange - TimeOnly time = new(12, 15, 31, 021); - TimeOnly nearbyTime = new(12, 15, 31); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected time to be within 20ms from <12:15:31.000>, but <12:15:31.021> was off by 21ms."); - } - - [Fact] - public void When_subject_time_is_close_to_an_earlier_time_by_35ms_it_should_succeed() - { - // Arrange - TimeOnly time = new(12, 15, 31, 035); - TimeOnly nearbyTime = new(12, 15, 31); - - // Act / Assert - time.Should().BeCloseTo(nearbyTime, 35.Milliseconds()); - } - - [Fact] - public void A_time_is_close_to_a_later_time_when_passing_midnight() - { - // Arrange - TimeOnly time = new(23, 59, 0); - TimeOnly nearbyTime = new(0, 1, 0); - - // Act / Assert - time.Should().BeCloseTo(nearbyTime, 2.Minutes()); - } - - [Fact] - public void A_time_is_close_to_an_earlier_time_when_passing_midnight() - { - // Arrange - TimeOnly time = new(0, 1, 0); - TimeOnly nearbyTime = new(23, 59, 0); - - // Act / Assert - time.Should().BeCloseTo(nearbyTime, 2.Minutes()); - } - - [Fact] - public void A_time_outside_of_the_precision_to_a_later_time_when_passing_midnight_fails() - { - // Arrange - TimeOnly time = new(23, 58, 59); - TimeOnly nearbyTime = new(0, 1, 0); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 2.Minutes()); - - // Assert - act.Should().Throw() - .WithMessage("Expected * to be within 2m from <00:01:00.000>*, but <23:58:59.000> was off by 2m and 1s*"); - } - - [Fact] - public void A_time_outside_of_the_precision_to_an_earlier_time_when_passing_midnight_fails() - { - // Arrange - TimeOnly time = new(0, 1, 0); - TimeOnly nearbyTime = new(23, 58, 59); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 2.Minutes()); - - // Assert - act.Should().Throw() - .WithMessage("Expected * to be within 2m from <23:58:59.000>*, but <00:01:00.000> was off by 2m and 1s*"); - } - - [Fact] - public void When_subject_nulltime_is_close_to_another_it_should_throw() - { - // Arrange - TimeOnly? time = null; - TimeOnly nearbyTime = new(12, 15, 31); - - // Act - Action act = () => time.Should().BeCloseTo(nearbyTime, 35.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage("Expected*, but found ."); - } - - [Fact] - public void A_null_time_inside_an_assertion_scope_fails() - { - // Arrange - TimeOnly? time = null; - TimeOnly nearbyTime = new(12, 15, 31); - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - time.Should().BeCloseTo(nearbyTime, 35.Milliseconds()); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expected*, but found ."); - } - } - - public class NotBeCloseTo - { - [Fact] - public void A_null_time_is_never_unclose_to_an_other_time() - { - // Arrange - TimeOnly? time = null; - TimeOnly nearbyTime = new(12, 15, 31); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 35.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect*, but found ."); - } - - [Fact] - public void A_null_time_inside_an_assertion_scope_is_never_unclose_to_an_other_time() - { - // Arrange - TimeOnly? time = null; - TimeOnly nearbyTime = new(12, 15, 31); - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - time.Should().NotBeCloseTo(nearbyTime, 35.Milliseconds()); - }; - - // Assert - act.Should().Throw() - .WithMessage("Did not expect*, but found ."); - } - - [Fact] - public void When_time_is_not_close_to_a_negative_precision_it_should_throw() - { - // Arrange - var time = TimeOnly.FromDateTime(DateTime.UtcNow); - var actual = new TimeOnly(time.Ticks - 1); - - // Act - Action act = () => actual.Should().NotBeCloseTo(time, -1.Ticks()); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_a_time_is_close_to_a_later_time_by_one_tick_it_should_fail() - { - // Arrange - var time = TimeOnly.FromDateTime(DateTime.UtcNow); - var actual = new TimeOnly(time.Ticks - 1); - - // Act - Action act = () => actual.Should().NotBeCloseTo(time, TimeSpan.FromTicks(1)); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_time_is_close_to_an_earlier_time_by_one_tick_it_should_fail() - { - // Arrange - var time = TimeOnly.FromDateTime(DateTime.UtcNow); - var actual = new TimeOnly(time.Ticks + 1); - - // Act - Action act = () => actual.Should().NotBeCloseTo(time, TimeSpan.FromTicks(1)); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_time_is_close_to_a_min_value_by_one_tick_it_should_fail() - { - // Arrange - var time = TimeOnly.MinValue; - var actual = new TimeOnly(time.Ticks + 1); - - // Act - Action act = () => actual.Should().NotBeCloseTo(time, TimeSpan.FromTicks(1)); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_time_is_close_to_a_max_value_by_one_tick_it_should_fail() - { - // Arrange - var time = TimeOnly.MaxValue; - var actual = new TimeOnly(time.Ticks - 1); - - // Act - Action act = () => actual.Should().NotBeCloseTo(time, TimeSpan.FromTicks(1)); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_asserting_subject_time_is_not_close_to_an_earlier_time_it_should_throw() - { - // Arrange - TimeOnly time = new(12, 15, 31, 020); - TimeOnly nearbyTime = new(12, 15, 31); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect time to be within 20ms from <12:15:31.000>, but it was <12:15:31.020>."); - } - - [Fact] - public void When_asserting_subject_time_is_not_close_to_an_earlier_time_by_a_20ms_timespan_it_should_throw() - { - // Arrange - TimeOnly time = new(12, 15, 31, 020); - TimeOnly nearbyTime = new(12, 15, 31); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, TimeSpan.FromMilliseconds(20)); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect time to be within 20ms from <12:15:31.000>, but it was <12:15:31.020>."); - } - - [Fact] - public void When_asserting_subject_time_is_not_close_to_another_value_that_is_later_by_more_than_20ms_it_should_succeed() - { - // Arrange - TimeOnly time = new(12, 15, 30, 979); - TimeOnly nearbyTime = new(12, 15, 31); - - // Act / Assert - time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); - } - - [Fact] - public void - When_asserting_subject_time_is_not_close_to_another_value_that_is_earlier_by_more_than_20ms_it_should_succeed() - { - // Arrange - TimeOnly time = new(12, 15, 31, 021); - TimeOnly nearbyTime = new(12, 15, 31); - - // Act / Assert - time.Should().NotBeCloseTo(nearbyTime, 20.Milliseconds()); - } - - [Fact] - public void When_asserting_subject_datetime_is_not_close_to_an_earlier_datetime_by_35ms_it_should_throw() - { - // Arrange - TimeOnly time = new(12, 15, 31, 035); - TimeOnly nearbyTime = new(12, 15, 31); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 35.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect time to be within 35ms from <12:15:31.000>, but it was <12:15:31.035>."); - } - - [Fact] - public void When_asserting_subject_time_is_not_close_to_the_minimum_time_it_should_throw() - { - // Arrange - TimeOnly time = TimeOnly.MinValue.Add(50.Milliseconds()); - TimeOnly nearbyTime = TimeOnly.MinValue; - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 100.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect time to be within 100ms from <00:00:00.000>, but it was <00:00:00.050>."); - } - - [Fact] - public void When_asserting_subject_time_is_not_close_to_the_maximum_time_it_should_throw() - { - // Arrange - TimeOnly time = TimeOnly.MaxValue.Add(-50.Milliseconds()); - TimeOnly nearbyTime = TimeOnly.MaxValue; - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 100.Milliseconds()); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect time to be within 100ms from <23:59:59.999>, but it was <23:59:59.949>."); - } - - [Fact] - public void A_time_is_not_close_to_a_later_time_when_passing_midnight() - { - // Arrange - TimeOnly time = new(23, 58, 0); - TimeOnly nearbyTime = new(0, 1, 0); - - // Act / Assert - time.Should().NotBeCloseTo(nearbyTime, 2.Minutes()); - } - - [Fact] - public void A_time_is_not_close_to_an_earlier_time_when_passing_midnight() - { - // Arrange - TimeOnly time = new(0, 2, 0); - TimeOnly nearbyTime = new(23, 59, 0); - - // Act / Assert - time.Should().NotBeCloseTo(nearbyTime, 2.Minutes()); - } - - [Fact] - public void A_time_inside_of_the_precision_to_a_later_time_when_passing_midnight_fails() - { - // Arrange - TimeOnly time = new(23, 59, 0); - TimeOnly nearbyTime = new(0, 1, 0); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 2.Minutes()); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect * to be within 2m from <00:01:00.000>*, but it was <23:59:00.000>*"); - } - - [Fact] - public void A_time_inside_of_the_precision_to_an_earlier_time_when_passing_midnight_fails() - { - // Arrange - TimeOnly time = new(0, 1, 0); - TimeOnly nearbyTime = new(23, 59, 0); - - // Act - Action act = () => time.Should().NotBeCloseTo(nearbyTime, 2.Minutes()); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect * to be within 2m from <23:59:00.000>*, but it was <00:01:00.000>*"); - } - } - - public class BeBefore - { - [Fact] - public void When_asserting_subject_is_not_before_earlier_expected_timeonly_it_should_succeed() - { - // Arrange - TimeOnly expected = new(15, 06, 03); - TimeOnly subject = new(15, 06, 04); - - // Act/Assert - subject.Should().NotBeBefore(expected); - } - - [Fact] - public void When_asserting_subject_timeonly_is_before_the_same_timeonly_it_should_throw() - { - // Arrange - TimeOnly expected = new(15, 06, 04); - TimeOnly subject = new(15, 06, 04); - - // Act - Action act = () => subject.Should().BeBefore(expected); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be before <15:06:04.000>, but found <15:06:04.000>."); - } - - [Fact] - public void When_asserting_subject_timeonly_is_not_before_the_same_timeonly_it_should_succeed() - { - // Arrange - TimeOnly expected = new(15, 06, 04); - TimeOnly subject = new(15, 06, 04); - - // Act/Assert - subject.Should().NotBeBefore(expected); - } - - [Fact] - public void When_asserting_subject_timeonly_is_on_or_before_expected_timeonly_should_succeed() - { - // Arrange - TimeOnly subject = new(15, 06, 04, 175); - TimeOnly expectation = new(15, 06, 05, 23); - - // Act/Assert - subject.Should().BeOnOrBefore(expectation); - } - - [Fact] - public void When_asserting_subject_timeonly_is_on_or_before_expected_timeonly_should_throw() - { - // Arrange - TimeOnly subject = new(15, 06, 04, 150); - TimeOnly expectation = new(15, 06, 05, 340); - - // Act - Action act = () => subject.Should().NotBeOnOrBefore(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be after <15:06:05.340>, but found <15:06:04.150>."); - } - - [Fact] - public void - When_asserting_subject_timeonly_is_on_or_before_the_same_time_as_the_expected_timeonly_should_succeed() - { - // Arrange - TimeOnly subject = new(15, 06, 04); - TimeOnly expectation = new(15, 06, 04); - - // Act/Assert - subject.Should().BeOnOrBefore(expectation); - } - - [Fact] - public void When_asserting_subject_timeonly_is_on_or_before_the_same_time_as_the_expected_timeonly_should_throw() - { - // Arrange - TimeOnly subject = new(15, 06, 04, 123); - TimeOnly expectation = new(15, 06, 04, 123); - - // Act - Action act = () => subject.Should().NotBeOnOrBefore(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be after <15:06:04.123>, but found <15:06:04.123>."); - } - - [Fact] - public void When_asserting_subject_timeonly_is_not_on_or_before_earlier_expected_timeonly_should_throw() - { - // Arrange - TimeOnly subject = new(15, 07); - TimeOnly expectation = new(15, 06); - - // Act - Action act = () => subject.Should().BeOnOrBefore(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be on or before <15:06:00.000>, but found <15:07:00.000>."); - } - - [Fact] - public void When_asserting_subject_timeonly_is_not_on_or_before_earlier_expected_timeonly_should_succeed() - { - // Arrange - TimeOnly subject = new(15, 06, 04); - TimeOnly expectation = new(15, 06, 03); - - // Act/Assert - subject.Should().NotBeOnOrBefore(expectation); - } - } - - public class BeAfter - { - [Fact] - public void When_asserting_subject_timeonly_is_after_earlier_expected_timeonly_should_succeed() - { - // Arrange - TimeOnly subject = new(15, 06, 04, 123); - TimeOnly expectation = new(15, 06, 03, 45); - - // Act/Assert - subject.Should().BeAfter(expectation); - } - - [Fact] - public void When_asserting_subject_timeonly_is_not_after_earlier_expected_timeonly_should_throw() - { - // Arrange - TimeOnly subject = new(15, 06, 04); - TimeOnly expectation = new(15, 06, 03); - - // Act - Action act = () => subject.Should().NotBeAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be on or before <15:06:03.000>, but found <15:06:04.000>."); - } - - [Fact] - public void When_asserting_subject_timeonly_is_after_later_expected_timeonly_should_throw() - { - // Arrange - TimeOnly subject = new(15, 06, 04); - TimeOnly expectation = new(15, 06, 05); - - // Act - Action act = () => subject.Should().BeAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be after <15:06:05.000>, but found <15:06:04.000>."); - } - - [Fact] - public void When_asserting_subject_timeonly_is_not_after_later_expected_timeonly_should_succeed() - { - // Arrange - TimeOnly subject = new(15, 06, 04); - TimeOnly expectation = new(15, 06, 05); - - // Act/Assert - subject.Should().NotBeAfter(expectation); - } - - [Fact] - public void When_asserting_subject_timeonly_is_after_the_same_expected_timeonly_should_throw() - { - // Arrange - TimeOnly subject = new(15, 06, 04, 145); - TimeOnly expectation = new(15, 06, 04, 145); - - // Act - Action act = () => subject.Should().BeAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be after <15:06:04.145>, but found <15:06:04.145>."); - } - - [Fact] - public void When_asserting_subject_timeonly_is_not_after_the_same_expected_timeonly_should_succeed() - { - // Arrange - TimeOnly subject = new(15, 06, 04, 123); - TimeOnly expectation = new(15, 06, 04, 123); - - // Act/Assert - subject.Should().NotBeAfter(expectation); - } - - [Fact] - public void When_asserting_subject_timeonly_is_on_or_after_earlier_expected_timeonly_should_succeed() - { - // Arrange - TimeOnly subject = new(15, 07); - TimeOnly expectation = new(15, 06); - - // Act/Assert - subject.Should().BeOnOrAfter(expectation); - } - - [Fact] - public void When_asserting_subject_timeonly_is_not_on_or_after_earlier_expected_timeonly_should_throw() - { - // Arrange - TimeOnly subject = new(15, 06, 04); - TimeOnly expectation = new(15, 06, 03); - - // Act - Action act = () => subject.Should().NotBeOnOrAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be before <15:06:03.000>, but found <15:06:04.000>."); - } - - [Fact] - public void When_asserting_subject_timeonly_is_on_or_after_the_same_expected_timeonly_should_succeed() - { - // Arrange - TimeOnly subject = new(15, 06, 04); - TimeOnly expectation = new(15, 06, 04); - - // Act/Assert - subject.Should().BeOnOrAfter(expectation); - } - - [Fact] - public void When_asserting_subject_timeonly_is_not_on_or_after_the_same_expected_timeonly_should_throw() - { - // Arrange - TimeOnly subject = new(15, 06); - TimeOnly expectation = new(15, 06); - - // Act - Action act = () => subject.Should().NotBeOnOrAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be before <15:06:00.000>, but found <15:06:00.000>."); - } - - [Fact] - public void When_asserting_subject_timeonly_is_on_or_after_later_expected_timeonly_should_throw() - { - // Arrange - TimeOnly subject = new(15, 06, 04); - TimeOnly expectation = new(15, 06, 05); - - // Act - Action act = () => subject.Should().BeOnOrAfter(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected subject to be on or after <15:06:05.000>, but found <15:06:04.000>."); - } - - [Fact] - public void When_asserting_subject_timeonly_is_not_on_or_after_later_expected_timeonly_should_succeed() - { - // Arrange - TimeOnly subject = new(15, 06, 04); - TimeOnly expectation = new(15, 06, 05); - - // Act/Assert - subject.Should().NotBeOnOrAfter(expectation); - } - } - - public class HaveHours - { - [Fact] - public void When_asserting_subject_timeonly_should_have_hours_with_the_same_value_should_succeed() - { - // Arrange - TimeOnly subject = new(15, 12, 31); - const int expectation = 15; - - // Act/Assert - subject.Should().HaveHours(expectation); - } - - [Fact] - public void When_asserting_subject_timeonly_should_not_have_hours_with_the_same_value_should_throw() - { - // Arrange - TimeOnly subject = new(15, 12, 31); - const int expectation = 15; - - // Act - Action act = () => subject.Should().NotHaveHours(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the hours part of subject to be 15, but it was."); - } - - [Fact] - public void When_asserting_subject_timeonly_should_have_hours_with_a_different_value_should_throw() - { - // Arrange - TimeOnly subject = new(15, 12, 31); - const int expectation = 14; - - // Act - Action act = () => subject.Should().HaveHours(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the hours part of subject to be 14, but found 15."); - } - - [Fact] - public void When_asserting_subject_timeonly_should_not_have_hours_with_a_different_value_should_succeed() - { - // Arrange - TimeOnly subject = new(21, 12, 31); - const int expectation = 23; - - // Act/Assert - subject.Should().NotHaveHours(expectation); - } - - [Fact] - public void When_asserting_subject_null_timeonly_should_have_hours_should_throw() - { - // Arrange - TimeOnly? subject = null; - const int expectation = 21; - - // Act - Action act = () => subject.Should().HaveHours(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the hours part of subject to be 21, but found ."); - } - - [Fact] - public void When_asserting_subject_null_timeonly_should_not_have_hours_should_throw() - { - // Arrange - TimeOnly? subject = null; - const int expectation = 19; - - // Act - Action act = () => subject.Should().NotHaveHours(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the hours part of subject to be 19, but found a TimeOnly."); - } - } - - public class HaveMinutes - { - [Fact] - public void When_asserting_subject_timeonly_should_have_minutes_with_the_same_value_it_should_succeed() - { - // Arrange - TimeOnly subject = new(21, 12, 31); - const int expectation = 12; - - // Act/Assert - subject.Should().HaveMinutes(expectation); - } - - [Fact] - public void When_asserting_subject_timeonly_should_not_have_minutes_with_the_same_value_it_should_throw() - { - // Arrange - TimeOnly subject = new(21, 12, 31); - const int expectation = 12; - - // Act - Action act = () => subject.Should().NotHaveMinutes(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the minutes part of subject to be 12, but it was."); - } - - [Fact] - public void When_asserting_subject_timeonly_should_have_a_minute_with_a_different_value_it_should_throw() - { - // Arrange - TimeOnly subject = new(15, 12, 31); - const int expectation = 11; - - // Act - Action act = () => subject.Should().HaveMinutes(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the minutes part of subject to be 11, but found 12."); - } - - [Fact] - public void When_asserting_subject_timeonly_should_not_have_a_minute_with_a_different_value_it_should_succeed() - { - // Arrange - TimeOnly subject = new(15, 12, 31); - const int expectation = 11; - - // Act/Assert - subject.Should().NotHaveMinutes(expectation); - } - - [Fact] - public void When_asserting_subject_null_timeonly_should_have_minutes_should_throw() - { - // Arrange - TimeOnly? subject = null; - const int expectation = 12; - - // Act - Action act = () => subject.Should().HaveMinutes(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the minutes part of subject to be 12, but found a TimeOnly."); - } - - [Fact] - public void When_asserting_subject_null_timeonly_should_not_have_minutes_should_throw() - { - // Arrange - TimeOnly? subject = null; - const int expectation = 12; - - // Act - Action act = () => subject.Should().NotHaveMinutes(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the minutes part of subject to be 12, but found a TimeOnly."); - } - } - - public class HaveSeconds - { - [Fact] - public void When_asserting_subject_timeonly_should_have_seconds_with_the_same_value_it_should_succeed() - { - // Arrange - TimeOnly subject = new(14, 12, 31); - const int expectation = 31; - - // Act/Assert - subject.Should().HaveSeconds(expectation); - } - - [Fact] - public void When_asserting_subject_timeonly_should_not_have_seconds_with_the_same_value_it_should_throw() - { - // Arrange - TimeOnly subject = new(14, 12, 31); - const int expectation = 31; - - // Act - Action act = () => subject.Should().NotHaveSeconds(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the seconds part of subject to be 31, but it was."); - } - - [Fact] - public void When_asserting_subject_timeonly_should_have_seconds_with_a_different_value_it_should_throw() - { - // Arrange - TimeOnly subject = new(15, 12, 31); - const int expectation = 30; - - // Act - Action act = () => subject.Should().HaveSeconds(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the seconds part of subject to be 30, but found 31."); - } - - [Fact] - public void When_asserting_subject_timeonly_should_not_have_seconds_with_a_different_value_it_should_succeed() - { - // Arrange - TimeOnly subject = new(15, 12, 31); - const int expectation = 30; - - // Act/Assert - subject.Should().NotHaveSeconds(expectation); - } - - [Fact] - public void When_asserting_subject_null_timeonly_should_have_seconds_should_throw() - { - // Arrange - TimeOnly? subject = null; - const int expectation = 22; - - // Act - Action act = () => subject.Should().HaveSeconds(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the seconds part of subject to be 22, but found a TimeOnly."); - } - - [Fact] - public void When_asserting_subject_null_timeonly_should_not_have_seconds_should_throw() - { - // Arrange - TimeOnly? subject = null; - const int expectation = 22; - - // Act - Action act = () => subject.Should().NotHaveSeconds(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the seconds part of subject to be 22, but found a TimeOnly."); - } - } - - public class HaveMilliseconds - { - [Fact] - public void When_asserting_subject_timeonly_should_have_milliseconds_with_the_same_value_it_should_succeed() - { - // Arrange - TimeOnly subject = new(14, 12, 31, 123); - const int expectation = 123; - - // Act/Assert - subject.Should().HaveMilliseconds(expectation); - } - - [Fact] - public void When_asserting_subject_timeonly_should_not_have_milliseconds_with_the_same_value_it_should_throw() - { - // Arrange - TimeOnly subject = new(14, 12, 31, 445); - const int expectation = 445; - - // Act - Action act = () => subject.Should().NotHaveMilliseconds(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the milliseconds part of subject to be 445, but it was."); - } - - [Fact] - public void When_asserting_subject_timeonly_should_have_milliseconds_with_a_different_value_it_should_throw() - { - // Arrange - TimeOnly subject = new(15, 12, 31, 555); - const int expectation = 12; - - // Act - Action act = () => subject.Should().HaveMilliseconds(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the milliseconds part of subject to be 12, but found 555."); - } - - [Fact] - public void When_asserting_subject_timeonly_should_not_have_milliseconds_with_a_different_value_it_should_succeed() - { - // Arrange - TimeOnly subject = new(15, 12, 31, 445); - const int expectation = 31; - - // Act/Assert - subject.Should().NotHaveMilliseconds(expectation); - } - - [Fact] - public void When_asserting_subject_null_timeonly_should_have_milliseconds_should_throw() - { - // Arrange - TimeOnly? subject = null; - const int expectation = 22; - - // Act - Action act = () => subject.Should().HaveMilliseconds(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Expected the milliseconds part of subject to be 22, but found a TimeOnly."); - } - - [Fact] - public void When_asserting_subject_null_timeonly_should_not_have_milliseconds_should_throw() - { - // Arrange - TimeOnly? subject = null; - const int expectation = 22; - - // Act - Action act = () => subject.Should().NotHaveMilliseconds(expectation); - - // Assert - act.Should().Throw() - .WithMessage("Did not expect the milliseconds part of subject to be 22, but found a TimeOnly."); - } - } - - public class BeOneOf - { - [Fact] - public void When_a_value_is_not_one_of_the_specified_values_it_should_throw() - { - // Arrange - TimeOnly value = new(15, 12, 20); - - // Act - Action action = () => value.Should().BeOneOf(value.AddHours(1), value.AddMinutes(-1)); - - // Assert - action.Should().Throw() - .WithMessage("Expected value to be one of {<16:12:20.000>, <15:11:20.000>}, but found <15:12:20.000>."); - } - - [Fact] - public void When_a_value_is_one_of_the_specified_values_it_should_succeed() - { - // Arrange - TimeOnly value = new(15, 12, 30); - - // Act/Assert - value.Should().BeOneOf(new TimeOnly(4, 1, 30), new TimeOnly(15, 12, 30)); - } - - [Fact] - public void When_a_null_value_is_not_one_of_the_specified_values_it_should_throw() - { - // Arrange - TimeOnly? value = null; - - // Act - Action action = () => value.Should().BeOneOf(new TimeOnly(15, 1, 30), new TimeOnly(5, 4, 10, 123)); - - // Assert - action.Should().Throw() - .WithMessage("Expected value to be one of {<15:01:30.000>, <05:04:10.123>}, but found ."); - } - - [Fact] - public void When_a_value_is_one_of_the_specified_values_it_should_succeed_when_timeonly_is_null() - { - // Arrange - TimeOnly? value = null; - - // Act/Assert - value.Should().BeOneOf(new TimeOnly(15, 1, 30), null); - } - } - - public class NotBe - { - [Fact] - public void Different_timeonly_values_are_valid() - { - // Arrange - TimeOnly time = new(19, 06, 04); - TimeOnly otherTime = new(20, 06, 05); - - // Act & Assert - time.Should().NotBe(otherTime); - } - - [Fact] - public void Different_timeonly_values_with_different_nullability_are_valid() - { - // Arrange - TimeOnly time = new(19, 06, 04); - TimeOnly? otherTime = new(19, 07, 05); - - // Act & Assert - time.Should().NotBe(otherTime); - } - - [Fact] - public void Same_timeonly_values_are_invalid() - { - // Arrange - TimeOnly time = new(19, 06, 04); - TimeOnly sameTime = new(19, 06, 04); - - // Act - Action act = - () => time.Should().NotBe(sameTime, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected time not to be <19:06:04.000> because we want to test the failure message, but it is."); - } - - [Fact] - public void Same_timeonly_values_with_different_nullability_are_invalid() - { - // Arrange - TimeOnly time = new(19, 06, 04); - TimeOnly? sameTime = new(19, 06, 04); - - // Act - Action act = - () => time.Should().NotBe(sameTime, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected time not to be <19:06:04.000> because we want to test the failure message, but it is."); - } - } - - public class AndChaining + [Fact] + public void Should_support_chaining_constraints_with_and() { - [Fact] - public void Should_support_chaining_constraints_with_and() - { - // Arrange - TimeOnly earlierTimeOnly = new(15, 06, 03); - TimeOnly? nullableTimeOnly = new(15, 06, 04); + // Arrange + TimeOnly earlierTimeOnly = new(15, 06, 03); + TimeOnly? nullableTimeOnly = new(15, 06, 04); - // Act/Assert - nullableTimeOnly.Should() - .HaveValue() - .And - .BeAfter(earlierTimeOnly); - } + // Act/Assert + nullableTimeOnly.Should() + .HaveValue() + .And + .BeAfter(earlierTimeOnly); } - public class Miscellaneous + [Fact] + public void Should_throw_a_helpful_error_when_accidentally_using_equals() { - [Fact] - public void Should_throw_a_helpful_error_when_accidentally_using_equals() - { - // Arrange - TimeOnly someTimeOnly = new(21, 1); + // Arrange + TimeOnly someTimeOnly = new(21, 1); - // Act - var act = () => someTimeOnly.Should().Equals(null); + // Act + var act = () => someTimeOnly.Should().Equals(null); - // Assert - act.Should().Throw() - .WithMessage("Equals is not part of Fluent Assertions. Did you mean Be() instead?"); - } + // Assert + act.Should().Throw() + .WithMessage("Equals is not part of Fluent Assertions. Did you mean Be() instead?"); } } From 251c9ecdf818ca263eeef3d4a0313ec8ab379545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Wed, 1 Nov 2023 10:09:41 +0100 Subject: [PATCH 155/845] Split NumericAssertionSpecs --- .../Numeric/NumericAssertionSpecs.Be.cs | 537 +++ .../NumericAssertionSpecs.BeApproximately.cs | 898 ++++ .../NumericAssertionSpecs.BeCloseTo.cs | 1479 ++++++ .../NumericAssertionSpecs.BeGreaterThan.cs | 133 + ...icAssertionSpecs.BeGreaterThanOrEqualTo.cs | 146 + .../NumericAssertionSpecs.BeInRange.cs | 224 + .../NumericAssertionSpecs.BeLessThan.cs | 132 + ...mericAssertionSpecs.BeLessThanOrEqualTo.cs | 145 + .../NumericAssertionSpecs.BeNegative.cs | 106 + .../Numeric/NumericAssertionSpecs.BeOneOf.cs | 119 + .../NumericAssertionSpecs.BePositive.cs | 106 + .../Numeric/NumericAssertionSpecs.Match.cs | 49 + .../Numeric/NumericAssertionSpecs.cs | 3969 +---------------- 13 files changed, 4075 insertions(+), 3968 deletions(-) create mode 100644 Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.Be.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeApproximately.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeCloseTo.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeGreaterThan.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeGreaterThanOrEqualTo.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeInRange.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeLessThan.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeLessThanOrEqualTo.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeNegative.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeOneOf.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BePositive.cs create mode 100644 Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.Match.cs diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.Be.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.Be.cs new file mode 100644 index 0000000000..1d23cdabdd --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.Be.cs @@ -0,0 +1,537 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NumericAssertionSpecs +{ + public class Be + { + [Fact] + public void A_value_is_equal_to_the_same_value() + { + // Arrange + int value = 1; + int sameValue = 1; + + // Act + value.Should().Be(sameValue); + } + + [Fact] + public void A_value_is_not_equal_to_another_value() + { + // Arrange + int value = 1; + int differentValue = 2; + + // Act + Action act = () => value.Should().Be(differentValue, "because we want to test the failure {0}", "message"); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to be 2 because we want to test the failure message, but found 1."); + } + + [Fact] + public void A_value_is_equal_to_the_same_nullable_value() + { + // Arrange + int value = 2; + int? nullableValue = 2; + + // Act + value.Should().Be(nullableValue); + } + + [Fact] + public void A_value_is_not_equal_to_null() + { + // Arrange + int value = 2; + int? nullableValue = null; + + // Act + Action act = () => value.Should().Be(nullableValue); + + // Assert + act + .Should().Throw() + .WithMessage("Expected*, but found 2."); + } + + [Fact] + public void Null_is_not_equal_to_another_nullable_value() + { + // Arrange + int? value = 2; + + // Act + Action action = () => ((int?)null).Should().Be(value); + + // Assert + action + .Should().Throw() + .WithMessage("Expected*2, but found ."); + } + + [InlineData(0, 0)] + [InlineData(null, null)] + [Theory] + public void A_nullable_value_is_equal_to_the_same_nullable_value(int? subject, int? expected) + { + // Act / Assert + subject.Should().Be(expected); + } + + [InlineData(0, 1)] + [InlineData(0, null)] + [InlineData(null, 0)] + [Theory] + public void A_nullable_value_is_not_equal_to_another_nullable_value(int? subject, int? expected) + { + // Act + Action act = () => subject.Should().Be(expected); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Null_is_not_equal_to_another_value() + { + // Arrange + int? subject = null; + int expected = 1; + + // Act + Action act = () => subject.Should().Be(expected); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_asserting_that_a_float_value_is_equal_to_a_different_value_it_should_throw() + { + // Arrange + float value = 3.5F; + + // Act + Action act = () => value.Should().Be(3.4F, "we want to test the error message"); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to be *3.4* because we want to test the error message, but found *3.5*"); + } + + [Fact] + public void When_asserting_that_a_float_value_is_equal_to_the_same_value_it_should_not_throw() + { + // Arrange + float value = 3.5F; + + // Act + Action act = () => value.Should().Be(3.5F); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_that_a_null_float_value_is_equal_to_some_value_it_should_throw() + { + // Arrange + float? value = null; + + // Act + Action act = () => value.Should().Be(3.5F); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to be *3.5* but found ."); + } + + [Fact] + public void When_asserting_that_a_double_value_is_equal_to_a_different_value_it_should_throw() + { + // Arrange + double value = 3.5; + + // Act + Action act = () => value.Should().Be(3.4, "we want to test the error message"); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to be 3.4 because we want to test the error message, but found 3.5*."); + } + + [Fact] + public void When_asserting_that_a_double_value_is_equal_to_the_same_value_it_should_not_throw() + { + // Arrange + double value = 3.5; + + // Act + Action act = () => value.Should().Be(3.5); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_that_a_null_double_value_is_equal_to_some_value_it_should_throw() + { + // Arrange + double? value = null; + + // Act + Action act = () => value.Should().Be(3.5); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to be 3.5, but found ."); + } + + [Fact] + public void When_asserting_that_a_decimal_value_is_equal_to_a_different_value_it_should_throw() + { + // Arrange + decimal value = 3.5m; + + // Act + Action act = () => value.Should().Be(3.4m, "we want to test the error message"); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected value to be*3.4* because we want to test the error message, but found*3.5*"); + } + + [Fact] + public void When_asserting_that_a_decimal_value_is_equal_to_the_same_value_it_should_not_throw() + { + // Arrange + decimal value = 3.5m; + + // Act + Action act = () => value.Should().Be(3.5m); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_that_a_null_decimal_value_is_equal_to_some_value_it_should_throw() + { + // Arrange + decimal? value = null; + decimal someValue = 3.5m; + + // Act + Action act = () => value.Should().Be(someValue); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to be*3.5*, but found ."); + } + + [Fact] + public void Nan_is_never_equal_to_a_normal_float() + { + // Arrange + float value = float.NaN; + + // Act + Action act = () => value.Should().Be(3.4F); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to be *3.4F, but found NaN*"); + } + + [Fact] + public void NaN_can_be_compared_to_NaN_when_its_a_float() + { + // Arrange + float value = float.NaN; + + // Act + value.Should().Be(float.NaN); + } + + [Fact] + public void Nan_is_never_equal_to_a_normal_double() + { + // Arrange + double value = double.NaN; + + // Act + Action act = () => value.Should().Be(3.4D); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to be *3.4, but found NaN*"); + } + + [Fact] + public void NaN_can_be_compared_to_NaN_when_its_a_double() + { + // Arrange + double value = double.NaN; + + // Act + value.Should().Be(double.NaN); + } + } + + public class NotBe + { + [InlineData(1, 2)] + [InlineData(null, 2)] + [Theory] + public void A_nullable_value_is_not_equal_to_another_value(int? subject, int unexpected) + { + // Act + subject.Should().NotBe(unexpected); + } + + [Fact] + public void A_value_is_not_different_from_the_same_value() + { + // Arrange + int value = 1; + int sameValue = 1; + + // Act + Action act = () => value.Should().NotBe(sameValue, "because we want to test the failure {0}", "message"); + + // Assert + act + .Should().Throw() + .WithMessage("Did not expect value to be 1 because we want to test the failure message."); + } + + [InlineData(null, null)] + [InlineData(0, 0)] + [Theory] + public void A_nullable_value_is_not_different_from_the_same_value(int? subject, int? unexpected) + { + // Act + Action act = () => subject.Should().NotBe(unexpected); + + // Assert + act.Should().Throw(); + } + + [InlineData(0, 1)] + [InlineData(0, null)] + [InlineData(null, 0)] + [Theory] + public void A_nullable_value_is_different_from_another_value(int? subject, int? unexpected) + { + // Act / Assert + subject.Should().NotBe(unexpected); + } + } + + public class Bytes + { + [Fact] + public void When_asserting_a_byte_value_it_should_treat_is_any_numeric_value() + { + // Arrange + byte value = 2; + + // Act + Action act = () => value.Should().Be(2); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_a_sbyte_value_it_should_treat_is_any_numeric_value() + { + // Arrange + sbyte value = 2; + + // Act + Action act = () => value.Should().Be(2); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_a_short_value_it_should_treat_is_any_numeric_value() + { + // Arrange + short value = 2; + + // Act + Action act = () => value.Should().Be(2); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_an_ushort_value_it_should_treat_is_any_numeric_value() + { + // Arrange + ushort value = 2; + + // Act + Action act = () => value.Should().Be(2); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_an_uint_value_it_should_treat_is_any_numeric_value() + { + // Arrange + uint value = 2; + + // Act + Action act = () => value.Should().Be(2); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_a_long_value_it_should_treat_is_any_numeric_value() + { + // Arrange + long value = 2; + + // Act + Action act = () => value.Should().Be(2); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_an_ulong_value_it_should_treat_is_any_numeric_value() + { + // Arrange + ulong value = 2; + + // Act + Action act = () => value.Should().Be(2); + + // Assert + act.Should().NotThrow(); + } + } + + public class NullableBytes + { + [Fact] + public void When_asserting_a_nullable_byte_value_it_should_treat_is_any_numeric_value() + { + // Arrange + byte? value = 2; + + // Act + Action act = () => value.Should().Be(2); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_a_nullable_sbyte_value_it_should_treat_is_any_numeric_value() + { + // Arrange + sbyte? value = 2; + + // Act + Action act = () => value.Should().Be(2); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_a_nullable_short_value_it_should_treat_is_any_numeric_value() + { + // Arrange + short? value = 2; + + // Act + Action act = () => value.Should().Be(2); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_a_nullable_ushort_value_it_should_treat_is_any_numeric_value() + { + // Arrange + ushort? value = 2; + + // Act + Action act = () => value.Should().Be(2); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_a_nullable_uint_value_it_should_treat_is_any_numeric_value() + { + // Arrange + uint? value = 2; + + // Act + Action act = () => value.Should().Be(2); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_a_nullable_long_value_it_should_treat_is_any_numeric_value() + { + // Arrange + long? value = 2; + + // Act + Action act = () => value.Should().Be(2); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_a_nullable_nullable_ulong_value_it_should_treat_is_any_numeric_value() + { + // Arrange + ulong? value = 2; + + // Act + Action act = () => value.Should().Be(2); + + // Assert + act.Should().NotThrow(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeApproximately.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeApproximately.cs new file mode 100644 index 0000000000..e87fb13693 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeApproximately.cs @@ -0,0 +1,898 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NumericAssertionSpecs +{ + public class BeApproximately + { + [Fact] + public void When_approximating_a_float_with_a_negative_precision_it_should_throw() + { + // Arrange + float value = 3.1415927F; + + // Act + Action act = () => value.Should().BeApproximately(3.14F, -0.1F); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_float_is_not_approximating_a_range_it_should_throw() + { + // Arrange + float value = 3.1415927F; + + // Act + Action act = () => value.Should().BeApproximately(3.14F, 0.001F, "rockets will crash otherwise"); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to approximate *3.14* +/- *0.001* because rockets will crash otherwise, but *3.1415927* differed by *0.001592*"); + } + + [Fact] + public void When_float_is_indeed_approximating_a_value_it_should_not_throw() + { + // Arrange + float value = 3.1415927F; + + // Act + Action act = () => value.Should().BeApproximately(3.14F, 0.1F); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(9F)] + [InlineData(11F)] + [Theory] + public void When_float_is_approximating_a_value_on_boundaries_it_should_not_throw(float value) + { + // Act + Action act = () => value.Should().BeApproximately(10F, 1F); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(9F)] + [InlineData(11F)] + [Theory] + public void When_float_is_not_approximating_a_value_on_boundaries_it_should_throw(float value) + { + // Act + Action act = () => value.Should().BeApproximately(10F, 0.9F); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_approximating_a_float_towards_nan_it_should_not_throw() + { + // Arrange + float value = float.NaN; + + // Act + Action act = () => value.Should().BeApproximately(3.14F, 0.1F); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_approximating_positive_infinity_float_towards_positive_infinity_it_should_not_throw() + { + // Arrange + float value = float.PositiveInfinity; + + // Act + Action act = () => value.Should().BeApproximately(float.PositiveInfinity, 0.1F); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_approximating_negative_infinity_float_towards_negative_infinity_it_should_not_throw() + { + // Arrange + float value = float.NegativeInfinity; + + // Act + Action act = () => value.Should().BeApproximately(float.NegativeInfinity, 0.1F); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_float_is_not_approximating_positive_infinity_it_should_throw() + { + // Arrange + float value = float.PositiveInfinity; + + // Act + Action act = () => value.Should().BeApproximately(float.MaxValue, 0.1F); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_float_is_not_approximating_negative_infinity_it_should_throw() + { + // Arrange + float value = float.NegativeInfinity; + + // Act + Action act = () => value.Should().BeApproximately(float.MinValue, 0.1F); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void NaN_can_never_be_close_to_any_float() + { + // Arrange + float value = float.NaN; + + // Act + Action act = () => value.Should().BeApproximately(float.MinValue, 0.1F); + + // Assert + act.Should().Throw().WithMessage("*NaN*"); + } + + [Fact] + public void A_float_can_never_be_close_to_NaN() + { + // Arrange + float value = float.MinValue; + + // Act + Action act = () => value.Should().BeApproximately(float.NaN, 0.1F); + + // Assert + act.Should().Throw().WithMessage("*NaN*"); + } + + [Fact] + public void When_a_nullable_float_has_no_value_it_should_throw() + { + // Arrange + float? value = null; + + // Act + Action act = () => value.Should().BeApproximately(3.14F, 0.001F); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to approximate*3.14* +/-*0.001*, but it was ."); + } + + [Fact] + public void When_approximating_a_double_with_a_negative_precision_it_should_throw() + { + // Arrange + double value = 3.1415927; + + // Act + Action act = () => value.Should().BeApproximately(3.14, -0.1); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_double_is_not_approximating_a_range_it_should_throw() + { + // Arrange + double value = 3.1415927; + + // Act + Action act = () => value.Should().BeApproximately(3.14, 0.001, "rockets will crash otherwise"); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to approximate 3.14 +/- 0.001 because rockets will crash otherwise, but 3.1415927 differed by 0.001592*"); + } + + [Fact] + public void When_double_is_indeed_approximating_a_value_it_should_not_throw() + { + // Arrange + double value = 3.1415927; + + // Act + Action act = () => value.Should().BeApproximately(3.14, 0.1); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_approximating_a_double_towards_nan_it_should_not_throw() + { + // Arrange + double value = double.NaN; + + // Act + Action act = () => value.Should().BeApproximately(3.14F, 0.1F); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_approximating_positive_infinity_double_towards_positive_infinity_it_should_not_throw() + { + // Arrange + double value = double.PositiveInfinity; + + // Act + Action act = () => value.Should().BeApproximately(double.PositiveInfinity, 0.1); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_approximating_negative_infinity_double_towards_negative_infinity_it_should_not_throw() + { + // Arrange + double value = double.NegativeInfinity; + + // Act + Action act = () => value.Should().BeApproximately(double.NegativeInfinity, 0.1); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_double_is_not_approximating_positive_infinity_it_should_throw() + { + // Arrange + double value = double.PositiveInfinity; + + // Act + Action act = () => value.Should().BeApproximately(double.MaxValue, 0.1); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_double_is_not_approximating_negative_infinity_it_should_throw() + { + // Arrange + double value = double.NegativeInfinity; + + // Act + Action act = () => value.Should().BeApproximately(double.MinValue, 0.1); + + // Assert + act.Should().Throw(); + } + + [InlineData(9D)] + [InlineData(11D)] + [Theory] + public void When_double_is_approximating_a_value_on_boundaries_it_should_not_throw(double value) + { + // Act + Action act = () => value.Should().BeApproximately(10D, 1D); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(9D)] + [InlineData(11D)] + [Theory] + public void When_double_is_not_approximating_a_value_on_boundaries_it_should_throw(double value) + { + // Act + Action act = () => value.Should().BeApproximately(10D, 0.9D); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void NaN_can_never_be_close_to_any_double() + { + // Arrange + double value = double.NaN; + + // Act + Action act = () => value.Should().BeApproximately(double.MinValue, 0.1F); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void A_double_can_never_be_close_to_NaN() + { + // Arrange + double value = double.MinValue; + + // Act + Action act = () => value.Should().BeApproximately(double.NaN, 0.1F); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_approximating_a_decimal_with_a_negative_precision_it_should_throw() + { + // Arrange + decimal value = 3.1415927M; + + // Act + Action act = () => value.Should().BeApproximately(3.14m, -0.1m); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_decimal_is_not_approximating_a_range_it_should_throw() + { + // Arrange + decimal value = 3.5011m; + + // Act + Action act = () => value.Should().BeApproximately(3.5m, 0.001m, "rockets will crash otherwise"); + + // Assert + act.Should().Throw().WithMessage( + "Expected value to approximate*3.5* +/-*0.001* because rockets will crash otherwise, but *3.5011* differed by*0.0011*"); + } + + [Fact] + public void When_decimal_is_indeed_approximating_a_value_it_should_not_throw() + { + // Arrange + decimal value = 3.5011m; + + // Act + Action act = () => value.Should().BeApproximately(3.5m, 0.01m); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_decimal_is_approximating_a_value_on_lower_boundary_it_should_not_throw() + { + // Act + decimal value = 9m; + + // Act + Action act = () => value.Should().BeApproximately(10m, 1m); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_decimal_is_approximating_a_value_on_upper_boundary_it_should_not_throw() + { + // Act + decimal value = 11m; + + // Act + Action act = () => value.Should().BeApproximately(10m, 1m); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_decimal_is_not_approximating_a_value_on_lower_boundary_it_should_throw() + { + // Act + decimal value = 9m; + + // Act + Action act = () => value.Should().BeApproximately(10m, 0.9m); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_decimal_is_not_approximating_a_value_on_upper_boundary_it_should_throw() + { + // Act + decimal value = 11m; + + // Act + Action act = () => value.Should().BeApproximately(10m, 0.9m); + + // Assert + act.Should().Throw(); + } + } + + public class NotBeApproximately + { + [Fact] + public void When_not_approximating_a_float_with_a_negative_precision_it_should_throw() + { + // Arrange + float value = 3.1415927F; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14F, -0.1F); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_float_is_approximating_a_range_and_should_not_approximate_it_should_throw() + { + // Arrange + float value = 3.1415927F; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14F, 0.1F, "rockets will crash otherwise"); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to not approximate *3.14* +/- *0.1* because rockets will crash otherwise, but *3.1415927* only differed by *0.001592*"); + } + + [Fact] + public void When_float_is_not_approximating_a_value_and_should_not_approximate_it_should_not_throw() + { + // Arrange + float value = 3.1415927F; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14F, 0.001F); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_approximating_a_float_towards_nan_and_should_not_approximate_it_should_throw() + { + // Arrange + float value = float.NaN; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14F, 0.1F); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_not_approximating_a_float_towards_positive_infinity_and_should_not_approximate_it_should_not_throw() + { + // Arrange + float value = float.PositiveInfinity; + + // Act + Action act = () => value.Should().NotBeApproximately(float.MaxValue, 0.1F); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_not_approximating_a_float_towards_negative_infinity_and_should_not_approximate_it_should_not_throw() + { + // Arrange + float value = float.NegativeInfinity; + + // Act + Action act = () => value.Should().NotBeApproximately(float.MinValue, 0.1F); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void + When_approximating_positive_infinity_float_towards_positive_infinity_and_should_not_approximate_it_should_throw() + { + // Arrange + float value = float.PositiveInfinity; + + // Act + Action act = () => value.Should().NotBeApproximately(float.PositiveInfinity, 0.1F); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void + When_not_approximating_negative_infinity_float_towards_negative_infinity_and_should_not_approximate_it_should_throw() + { + // Arrange + float value = float.NegativeInfinity; + + // Act + Action act = () => value.Should().NotBeApproximately(float.NegativeInfinity, 0.1F); + + // Assert + act.Should().Throw(); + } + + [InlineData(9F)] + [InlineData(11F)] + [Theory] + public void When_float_is_not_approximating_a_value_on_boundaries_it_should_not_throw(float value) + { + // Act + Action act = () => value.Should().NotBeApproximately(10F, 0.9F); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(9F)] + [InlineData(11F)] + [Theory] + public void When_float_is_approximating_a_value_on_boundaries_it_should_throw(float value) + { + // Act + Action act = () => value.Should().NotBeApproximately(10F, 1F); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_nullable_float_has_no_value_and_should_not_approximate_it_should_not_throw() + { + // Arrange + float? value = null; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14F, 0.001F); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void NaN_can_never_be_close_to_any_float() + { + // Arrange + float value = float.NaN; + + // Act + Action act = () => value.Should().NotBeApproximately(float.MinValue, 0.1F); + + // Assert + act.Should().Throw().WithMessage("*NaN*"); + } + + [Fact] + public void A_float_can_never_be_close_to_NaN() + { + // Arrange + float value = float.MinValue; + + // Act + Action act = () => value.Should().NotBeApproximately(float.NaN, 0.1F); + + // Assert + act.Should().Throw().WithMessage("*NaN*"); + } + + [Fact] + public void When_not_approximating_a_double_with_a_negative_precision_it_should_throw() + { + // Arrange + double value = 3.1415927; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14, -0.1); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_double_is_approximating_a_range_and_should_not_approximate_it_should_throw() + { + // Arrange + double value = 3.1415927; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14, 0.1, "rockets will crash otherwise"); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to not approximate *3.14* +/- *0.1* because rockets will crash otherwise, but *3.1415927* only differed by *0.001592*"); + } + + [Fact] + public void When_double_is_not_approximating_a_value_and_should_not_approximate_it_should_not_throw() + { + // Arrange + double value = 3.1415927; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14, 0.001); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_approximating_a_double_towards_nan_and_should_not_approximate_it_should_throw() + { + // Arrange + double value = double.NaN; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14, 0.1); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_not_approximating_a_double_towards_positive_infinity_and_should_not_approximate_it_should_not_throw() + { + // Arrange + double value = double.PositiveInfinity; + + // Act + Action act = () => value.Should().NotBeApproximately(double.MaxValue, 0.1); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_not_approximating_a_double_towards_negative_infinity_and_should_not_approximate_it_should_not_throw() + { + // Arrange + double value = double.NegativeInfinity; + + // Act + Action act = () => value.Should().NotBeApproximately(double.MinValue, 0.1); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void + When_approximating_positive_infinity_double_towards_positive_infinity_and_should_not_approximate_it_should_throw() + { + // Arrange + double value = double.PositiveInfinity; + + // Act + Action act = () => value.Should().NotBeApproximately(double.PositiveInfinity, 0.1); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void + When_not_approximating_negative_infinity_double_towards_negative_infinity_and_should_not_approximate_it_should_throw() + { + // Arrange + double value = double.NegativeInfinity; + + // Act + Action act = () => value.Should().NotBeApproximately(double.NegativeInfinity, 0.1); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_nullable_double_has_no_value_and_should_not_approximate_it_should_throw() + { + // Arrange + double? value = null; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14, 0.001); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(9D)] + [InlineData(11D)] + [Theory] + public void When_double_is_not_approximating_a_value_on_boundaries_it_should_not_throw(double value) + { + // Act + Action act = () => value.Should().NotBeApproximately(10D, 0.9D); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(9D)] + [InlineData(11D)] + [Theory] + public void When_double_is_approximating_a_value_on_boundaries_it_should_throw(double value) + { + // Act + Action act = () => value.Should().NotBeApproximately(10D, 1D); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void NaN_can_never_be_close_to_any_double() + { + // Arrange + double value = double.NaN; + + // Act + Action act = () => value.Should().NotBeApproximately(double.MinValue, 0.1F); + + // Assert + act.Should().Throw().WithMessage("*NaN*"); + } + + [Fact] + public void A_double_can_never_be_close_to_NaN() + { + // Arrange + double value = double.MinValue; + + // Act + Action act = () => value.Should().NotBeApproximately(double.NaN, 0.1F); + + // Assert + act.Should().Throw().WithMessage("*NaN*"); + } + + [Fact] + public void When_not_approximating_a_decimal_with_a_negative_precision_it_should_throw() + { + // Arrange + decimal value = 3.1415927m; + + // Act + Action act = () => value.Should().NotBeApproximately(3.14m, -0.1m); + + // Assert + act.Should().Throw() + .WithParameterName("precision") + .WithMessage("*must be non-negative*"); + } + + [Fact] + public void When_decimal_is_approximating_a_range_and_should_not_approximate_it_should_throw() + { + // Arrange + decimal value = 3.5011m; + + // Act + Action act = () => value.Should().NotBeApproximately(3.5m, 0.1m, "rockets will crash otherwise"); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to not approximate *3.5* +/- *0.1* because rockets will crash otherwise, but *3.5011* only differed by *0.0011*"); + } + + [Fact] + public void When_decimal_is_not_approximating_a_value_and_should_not_approximate_it_should_not_throw() + { + // Arrange + decimal value = 3.5011m; + + // Act + Action act = () => value.Should().NotBeApproximately(3.5m, 0.001m); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_nullable_decimal_has_no_value_and_should_not_approximate_it_should_throw() + { + // Arrange + decimal? value = null; + + // Act + Action act = () => value.Should().NotBeApproximately(3.5m, 0.001m); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_decimal_is_not_approximating_a_value_on_lower_boundary_it_should_not_throw() + { + // Act + decimal value = 9m; + + // Act + Action act = () => value.Should().NotBeApproximately(10m, 0.9m); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_decimal_is_not_approximating_a_value_on_upper_boundary_it_should_not_throw() + { + // Act + decimal value = 11m; + + // Act + Action act = () => value.Should().NotBeApproximately(10m, 0.9m); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_decimal_is_approximating_a_value_on_lower_boundary_it_should_throw() + { + // Act + decimal value = 9m; + + // Act + Action act = () => value.Should().NotBeApproximately(10m, 1m); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_decimal_is_approximating_a_value_on_upper_boundary_it_should_throw() + { + // Act + decimal value = 11m; + + // Act + Action act = () => value.Should().NotBeApproximately(10m, 1m); + + // Assert + act.Should().Throw(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeCloseTo.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeCloseTo.cs new file mode 100644 index 0000000000..f801a0ce0f --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeCloseTo.cs @@ -0,0 +1,1479 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NumericAssertionSpecs +{ + public class BeCloseTo + { + [InlineData(sbyte.MinValue, sbyte.MinValue, 0)] + [InlineData(sbyte.MinValue, sbyte.MinValue, 1)] + [InlineData(sbyte.MinValue, sbyte.MinValue, sbyte.MaxValue)] + [InlineData(sbyte.MinValue, sbyte.MinValue + 1, 1)] + [InlineData(sbyte.MinValue, sbyte.MinValue + 1, sbyte.MaxValue)] + [InlineData(sbyte.MinValue, -1, sbyte.MaxValue)] + [InlineData(sbyte.MinValue + 1, sbyte.MinValue, 1)] + [InlineData(sbyte.MinValue + 1, sbyte.MinValue, sbyte.MaxValue)] + [InlineData(sbyte.MinValue + 1, 0, sbyte.MaxValue)] + [InlineData(-1, sbyte.MinValue, sbyte.MaxValue)] + [InlineData(-1, 0, 1)] + [InlineData(-1, 0, sbyte.MaxValue)] + [InlineData(0, 0, 0)] + [InlineData(0, 0, 1)] + [InlineData(0, -1, 1)] + [InlineData(0, -1, sbyte.MaxValue)] + [InlineData(0, 1, 1)] + [InlineData(0, 1, sbyte.MaxValue)] + [InlineData(0, sbyte.MaxValue, sbyte.MaxValue)] + [InlineData(0, sbyte.MinValue + 1, sbyte.MaxValue)] + [InlineData(1, 0, 1)] + [InlineData(1, 0, sbyte.MaxValue)] + [InlineData(1, sbyte.MaxValue, sbyte.MaxValue)] + [InlineData(sbyte.MaxValue - 1, sbyte.MaxValue, 1)] + [InlineData(sbyte.MaxValue - 1, sbyte.MaxValue, sbyte.MaxValue)] + [InlineData(sbyte.MaxValue, 0, sbyte.MaxValue)] + [InlineData(sbyte.MaxValue, 1, sbyte.MaxValue)] + [InlineData(sbyte.MaxValue, sbyte.MaxValue, 0)] + [InlineData(sbyte.MaxValue, sbyte.MaxValue, 1)] + [InlineData(sbyte.MaxValue, sbyte.MaxValue, sbyte.MaxValue)] + [InlineData(sbyte.MaxValue, sbyte.MaxValue - 1, 1)] + [InlineData(sbyte.MaxValue, sbyte.MaxValue - 1, sbyte.MaxValue)] + [Theory] + public void When_a_sbyte_value_is_close_to_expected_value_it_should_succeed(sbyte actual, sbyte nearbyValue, + byte delta) + { + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(sbyte.MinValue, sbyte.MaxValue, 1)] + [InlineData(sbyte.MinValue, 0, sbyte.MaxValue)] + [InlineData(sbyte.MinValue, 1, sbyte.MaxValue)] + [InlineData(-1, 0, 0)] + [InlineData(-1, 1, 1)] + [InlineData(-1, sbyte.MaxValue, sbyte.MaxValue)] + [InlineData(0, sbyte.MinValue, sbyte.MaxValue)] + [InlineData(0, -1, 0)] + [InlineData(0, 1, 0)] + [InlineData(1, -1, 1)] + [InlineData(1, 0, 0)] + [InlineData(1, sbyte.MinValue, sbyte.MaxValue)] + [InlineData(sbyte.MaxValue, sbyte.MinValue, 1)] + [InlineData(sbyte.MaxValue, -1, sbyte.MaxValue)] + [Theory] + public void When_a_sbyte_value_is_not_close_to_expected_value_it_should_fail(sbyte actual, sbyte nearbyValue, + byte delta) + { + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_sbyte_value_is_not_close_to_expected_value_it_should_fail_with_a_descriptive_message() + { + // Arrange + sbyte actual = 1; + sbyte nearbyValue = 4; + byte delta = 2; + + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw() + .WithMessage("*be within*2*from*4*but found*1*"); + } + + [Fact] + public void When_a_sbyte_value_is_returned_from_BeCloseTo_it_should_chain() + { + // Arrange + sbyte actual = sbyte.MaxValue; + + // Act + Action act = () => actual.Should().BeCloseTo(actual, 0) + .And.Be(actual); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(short.MinValue, short.MinValue, 0)] + [InlineData(short.MinValue, short.MinValue, 1)] + [InlineData(short.MinValue, short.MinValue, short.MaxValue)] + [InlineData(short.MinValue, short.MinValue + 1, 1)] + [InlineData(short.MinValue, short.MinValue + 1, short.MaxValue)] + [InlineData(short.MinValue, -1, short.MaxValue)] + [InlineData(short.MinValue + 1, short.MinValue, 1)] + [InlineData(short.MinValue + 1, short.MinValue, short.MaxValue)] + [InlineData(short.MinValue + 1, 0, short.MaxValue)] + [InlineData(-1, short.MinValue, short.MaxValue)] + [InlineData(-1, 0, 1)] + [InlineData(-1, 0, short.MaxValue)] + [InlineData(0, 0, 0)] + [InlineData(0, 0, 1)] + [InlineData(0, -1, 1)] + [InlineData(0, -1, short.MaxValue)] + [InlineData(0, 1, 1)] + [InlineData(0, 1, short.MaxValue)] + [InlineData(0, short.MaxValue, short.MaxValue)] + [InlineData(0, short.MinValue + 1, short.MaxValue)] + [InlineData(1, 0, 1)] + [InlineData(1, 0, short.MaxValue)] + [InlineData(1, short.MaxValue, short.MaxValue)] + [InlineData(short.MaxValue - 1, short.MaxValue, 1)] + [InlineData(short.MaxValue - 1, short.MaxValue, short.MaxValue)] + [InlineData(short.MaxValue, 0, short.MaxValue)] + [InlineData(short.MaxValue, 1, short.MaxValue)] + [InlineData(short.MaxValue, short.MaxValue, 0)] + [InlineData(short.MaxValue, short.MaxValue, 1)] + [InlineData(short.MaxValue, short.MaxValue, short.MaxValue)] + [InlineData(short.MaxValue, short.MaxValue - 1, 1)] + [InlineData(short.MaxValue, short.MaxValue - 1, short.MaxValue)] + [Theory] + public void When_a_short_value_is_close_to_expected_value_it_should_succeed(short actual, short nearbyValue, + ushort delta) + { + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(short.MinValue, short.MaxValue, 1)] + [InlineData(short.MinValue, 0, short.MaxValue)] + [InlineData(short.MinValue, 1, short.MaxValue)] + [InlineData(-1, 0, 0)] + [InlineData(-1, 1, 1)] + [InlineData(-1, short.MaxValue, short.MaxValue)] + [InlineData(0, short.MinValue, short.MaxValue)] + [InlineData(0, -1, 0)] + [InlineData(0, 1, 0)] + [InlineData(1, -1, 1)] + [InlineData(1, 0, 0)] + [InlineData(1, short.MinValue, short.MaxValue)] + [InlineData(short.MaxValue, short.MinValue, 1)] + [InlineData(short.MaxValue, -1, short.MaxValue)] + [Theory] + public void When_a_short_value_is_not_close_to_expected_value_it_should_fail(short actual, short nearbyValue, + ushort delta) + { + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_short_value_is_not_close_to_expected_value_it_should_fail_with_a_descriptive_message() + { + // Arrange + short actual = 1; + short nearbyValue = 4; + ushort delta = 2; + + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw() + .WithMessage("*be within*2*from*4*but found*1*"); + } + + [Fact] + public void When_a_short_value_is_returned_from_BeCloseTo_it_should_chain() + { + // Arrange + short actual = short.MaxValue; + + // Act + Action act = () => actual.Should().BeCloseTo(actual, 0) + .And.Be(actual); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(int.MinValue, int.MinValue, 0)] + [InlineData(int.MinValue, int.MinValue, 1)] + [InlineData(int.MinValue, int.MinValue, int.MaxValue)] + [InlineData(int.MinValue, int.MinValue + 1, 1)] + [InlineData(int.MinValue, int.MinValue + 1, int.MaxValue)] + [InlineData(int.MinValue, -1, int.MaxValue)] + [InlineData(int.MinValue + 1, int.MinValue, 1)] + [InlineData(int.MinValue + 1, int.MinValue, int.MaxValue)] + [InlineData(int.MinValue + 1, 0, int.MaxValue)] + [InlineData(-1, int.MinValue, int.MaxValue)] + [InlineData(-1, 0, 1)] + [InlineData(-1, 0, int.MaxValue)] + [InlineData(0, 0, 0)] + [InlineData(0, 0, 1)] + [InlineData(0, -1, 1)] + [InlineData(0, -1, int.MaxValue)] + [InlineData(0, 1, 1)] + [InlineData(0, 1, int.MaxValue)] + [InlineData(0, int.MaxValue, int.MaxValue)] + [InlineData(0, int.MinValue + 1, int.MaxValue)] + [InlineData(1, 0, 1)] + [InlineData(1, 0, int.MaxValue)] + [InlineData(1, int.MaxValue, int.MaxValue)] + [InlineData(int.MaxValue - 1, int.MaxValue, 1)] + [InlineData(int.MaxValue - 1, int.MaxValue, int.MaxValue)] + [InlineData(int.MaxValue, 0, int.MaxValue)] + [InlineData(int.MaxValue, 1, int.MaxValue)] + [InlineData(int.MaxValue, int.MaxValue, 0)] + [InlineData(int.MaxValue, int.MaxValue, 1)] + [InlineData(int.MaxValue, int.MaxValue, int.MaxValue)] + [InlineData(int.MaxValue, int.MaxValue - 1, 1)] + [InlineData(int.MaxValue, int.MaxValue - 1, int.MaxValue)] + [Theory] + public void When_an_int_value_is_close_to_expected_value_it_should_succeed(int actual, int nearbyValue, uint delta) + { + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(int.MinValue, int.MaxValue, 1)] + [InlineData(int.MinValue, 0, int.MaxValue)] + [InlineData(int.MinValue, 1, int.MaxValue)] + [InlineData(-1, 0, 0)] + [InlineData(-1, 1, 1)] + [InlineData(-1, int.MaxValue, int.MaxValue)] + [InlineData(0, int.MinValue, int.MaxValue)] + [InlineData(0, -1, 0)] + [InlineData(0, 1, 0)] + [InlineData(1, -1, 1)] + [InlineData(1, 0, 0)] + [InlineData(1, int.MinValue, int.MaxValue)] + [InlineData(int.MaxValue, int.MinValue, 1)] + [InlineData(int.MaxValue, -1, int.MaxValue)] + [Theory] + public void When_an_int_value_is_not_close_to_expected_value_it_should_fail(int actual, int nearbyValue, uint delta) + { + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_an_int_value_is_not_close_to_expected_value_it_should_fail_with_a_descriptive_message() + { + // Arrange + int actual = 1; + int nearbyValue = 4; + uint delta = 2; + + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw() + .WithMessage("*be within*2*from*4*but found*1*"); + } + + [Fact] + public void When_an_int_value_is_returned_from_BeCloseTo_it_should_chain() + { + // Arrange + int actual = int.MaxValue; + + // Act + Action act = () => actual.Should().BeCloseTo(actual, 0) + .And.Be(actual); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(long.MinValue, long.MinValue, 0)] + [InlineData(long.MinValue, long.MinValue, 1)] + [InlineData(long.MinValue, long.MinValue, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MinValue, long.MinValue, ulong.MaxValue / 2)] + [InlineData(long.MinValue, long.MinValue, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MinValue, long.MinValue, ulong.MaxValue)] + [InlineData(long.MinValue, long.MinValue + 1, 1)] + [InlineData(long.MinValue, long.MinValue + 1, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MinValue, long.MinValue + 1, ulong.MaxValue / 2)] + [InlineData(long.MinValue, long.MinValue + 1, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MinValue, long.MinValue + 1, ulong.MaxValue)] + [InlineData(long.MinValue, -1, long.MaxValue)] + [InlineData(long.MinValue + 1, long.MinValue, 1)] + [InlineData(long.MinValue + 1, long.MinValue, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MinValue + 1, long.MinValue, ulong.MaxValue / 2)] + [InlineData(long.MinValue + 1, long.MinValue, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MinValue + 1, long.MinValue, ulong.MaxValue)] + [InlineData(long.MinValue + 1, 0, ulong.MaxValue / 2)] + [InlineData(long.MinValue + 1, 0, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MinValue + 1, 0, ulong.MaxValue)] + [InlineData(long.MinValue, long.MaxValue, ulong.MaxValue)] + [InlineData(-1, long.MinValue, ulong.MaxValue / 2)] + [InlineData(-1, long.MinValue, (ulong.MaxValue / 2) + 1)] + [InlineData(-1, long.MinValue, ulong.MaxValue)] + [InlineData(-1, 0, 1)] + [InlineData(-1, 0, (ulong.MaxValue / 2) - 1)] + [InlineData(-1, 0, ulong.MaxValue / 2)] + [InlineData(-1, 0, (ulong.MaxValue / 2) + 1)] + [InlineData(-1, 0, ulong.MaxValue)] + [InlineData(0, 0, 0)] + [InlineData(0, 0, 1)] + [InlineData(0, -1, 1)] + [InlineData(0, -1, (ulong.MaxValue / 2) - 1)] + [InlineData(0, -1, ulong.MaxValue / 2)] + [InlineData(0, -1, (ulong.MaxValue / 2) + 1)] + [InlineData(0, -1, ulong.MaxValue)] + [InlineData(0, 1, 1)] + [InlineData(0, 1, (ulong.MaxValue / 2) - 1)] + [InlineData(0, 1, ulong.MaxValue / 2)] + [InlineData(0, 1, (ulong.MaxValue / 2) + 1)] + [InlineData(0, 1, ulong.MaxValue)] + [InlineData(0, long.MaxValue, ulong.MaxValue / 2)] + [InlineData(0, long.MaxValue, (ulong.MaxValue / 2) + 1)] + [InlineData(0, long.MaxValue, ulong.MaxValue)] + [InlineData(0, long.MinValue + 1, ulong.MaxValue / 2)] + [InlineData(0, long.MinValue + 1, (ulong.MaxValue / 2) + 1)] + [InlineData(0, long.MinValue + 1, ulong.MaxValue)] + [InlineData(1, 0, 1)] + [InlineData(1, 0, (ulong.MaxValue / 2) - 1)] + [InlineData(1, 0, ulong.MaxValue / 2)] + [InlineData(1, 0, (ulong.MaxValue / 2) + 1)] + [InlineData(1, 0, ulong.MaxValue)] + [InlineData(1, long.MaxValue, (ulong.MaxValue / 2) - 1)] + [InlineData(1, long.MaxValue, ulong.MaxValue / 2)] + [InlineData(1, long.MaxValue, (ulong.MaxValue / 2) + 1)] + [InlineData(1, long.MaxValue, ulong.MaxValue)] + [InlineData(long.MaxValue - 1, long.MaxValue, 1)] + [InlineData(long.MaxValue - 1, long.MaxValue, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MaxValue - 1, long.MaxValue, ulong.MaxValue / 2)] + [InlineData(long.MaxValue - 1, long.MaxValue, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MaxValue - 1, long.MaxValue, ulong.MaxValue)] + [InlineData(long.MaxValue, 0, ulong.MaxValue / 2)] + [InlineData(long.MaxValue, 0, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MaxValue, 0, ulong.MaxValue)] + [InlineData(long.MaxValue, 1, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MaxValue, 1, ulong.MaxValue / 2)] + [InlineData(long.MaxValue, 1, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MaxValue, 1, ulong.MaxValue)] + [InlineData(long.MaxValue, long.MaxValue, 0)] + [InlineData(long.MaxValue, long.MaxValue, 1)] + [InlineData(long.MaxValue, long.MaxValue, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MaxValue, long.MaxValue, ulong.MaxValue / 2)] + [InlineData(long.MaxValue, long.MaxValue, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MaxValue, long.MaxValue, ulong.MaxValue)] + [InlineData(long.MaxValue, long.MaxValue - 1, 1)] + [InlineData(long.MaxValue, long.MaxValue - 1, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MaxValue, long.MaxValue - 1, ulong.MaxValue / 2)] + [InlineData(long.MaxValue, long.MaxValue - 1, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MaxValue, long.MaxValue - 1, ulong.MaxValue)] + [Theory] + public void When_a_long_value_is_close_to_expected_value_it_should_succeed(long actual, long nearbyValue, ulong delta) + { + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(long.MinValue, long.MaxValue, 1)] + [InlineData(long.MinValue, 0, long.MaxValue)] + [InlineData(long.MinValue, 1, long.MaxValue)] + [InlineData(long.MinValue + 1, 0, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MinValue, long.MaxValue, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MinValue, long.MaxValue, ulong.MaxValue / 2)] + [InlineData(-1, 0, 0)] + [InlineData(-1, 1, 1)] + [InlineData(-1, long.MaxValue, long.MaxValue)] + [InlineData(-1, long.MinValue, (ulong.MaxValue / 2) - 1)] + [InlineData(0, long.MinValue, long.MaxValue)] + [InlineData(0, long.MinValue + 1, (ulong.MaxValue / 2) - 1)] + [InlineData(0, long.MaxValue, (ulong.MaxValue / 2) - 1)] + [InlineData(0, -1, 0)] + [InlineData(0, 1, 0)] + [InlineData(1, -1, 1)] + [InlineData(1, 0, 0)] + [InlineData(1, long.MinValue, long.MaxValue)] + [InlineData(long.MaxValue, long.MinValue, 1)] + [InlineData(long.MaxValue, -1, long.MaxValue)] + [InlineData(long.MaxValue, 0, (ulong.MaxValue / 2) - 1)] + [Theory] + public void When_a_long_value_is_not_close_to_expected_value_it_should_fail(long actual, long nearbyValue, + ulong delta) + { + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_long_value_is_not_close_to_expected_value_it_should_fail_with_a_descriptive_message() + { + // Arrange + long actual = 1; + long nearbyValue = 4; + ulong delta = 2; + + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw() + .WithMessage("*be within*2*from*4*but found*1*"); + } + + [Fact] + public void When_a_long_value_is_returned_from_BeCloseTo_it_should_chain() + { + // Arrange + long actual = long.MaxValue; + + // Act + Action act = () => actual.Should().BeCloseTo(actual, 0) + .And.Be(actual); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(0, 0, 0)] + [InlineData(0, 0, 1)] + [InlineData(0, 1, 1)] + [InlineData(1, 0, 1)] + [InlineData(1, byte.MaxValue, byte.MaxValue)] + [InlineData(byte.MinValue, byte.MinValue + 1, byte.MaxValue)] + [InlineData(byte.MinValue + 1, 0, byte.MaxValue)] + [InlineData(byte.MinValue + 1, byte.MinValue, 1)] + [InlineData(byte.MinValue + 1, byte.MinValue, byte.MaxValue)] + [InlineData(byte.MaxValue - 1, byte.MaxValue, 1)] + [InlineData(byte.MaxValue - 1, byte.MaxValue, byte.MaxValue)] + [InlineData(byte.MaxValue, 0, byte.MaxValue)] + [InlineData(byte.MaxValue, 1, byte.MaxValue)] + [InlineData(byte.MaxValue, byte.MaxValue - 1, 1)] + [InlineData(byte.MaxValue, byte.MaxValue - 1, byte.MaxValue)] + [InlineData(byte.MaxValue, byte.MaxValue, 0)] + [InlineData(byte.MaxValue, byte.MaxValue, 1)] + [Theory] + public void When_a_byte_value_is_close_to_expected_value_it_should_succeed(byte actual, byte nearbyValue, byte delta) + { + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(0, 1, 0)] + [InlineData(1, 0, 0)] + [InlineData(byte.MinValue, byte.MaxValue, 1)] + [InlineData(byte.MaxValue, byte.MinValue, 1)] + [Theory] + public void When_a_byte_value_is_not_close_to_expected_value_it_should_fail(byte actual, byte nearbyValue, byte delta) + { + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_byte_value_is_not_close_to_expected_value_it_should_fail_with_a_descriptive_message() + { + // Arrange + byte actual = 1; + byte nearbyValue = 4; + byte delta = 2; + + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw() + .WithMessage("*be within*2*from*4*but found*1*"); + } + + [Fact] + public void When_a_byte_value_is_returned_from_BeCloseTo_it_should_chain() + { + // Arrange + byte actual = byte.MaxValue; + + // Act + Action act = () => actual.Should().BeCloseTo(actual, 0) + .And.Be(actual); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(0, 0, 0)] + [InlineData(0, 0, 1)] + [InlineData(0, 1, 1)] + [InlineData(1, 0, 1)] + [InlineData(1, ushort.MaxValue, ushort.MaxValue)] + [InlineData(ushort.MinValue, ushort.MinValue + 1, ushort.MaxValue)] + [InlineData(ushort.MinValue + 1, 0, ushort.MaxValue)] + [InlineData(ushort.MinValue + 1, ushort.MinValue, 1)] + [InlineData(ushort.MinValue + 1, ushort.MinValue, ushort.MaxValue)] + [InlineData(ushort.MaxValue - 1, ushort.MaxValue, 1)] + [InlineData(ushort.MaxValue - 1, ushort.MaxValue, ushort.MaxValue)] + [InlineData(ushort.MaxValue, 0, ushort.MaxValue)] + [InlineData(ushort.MaxValue, 1, ushort.MaxValue)] + [InlineData(ushort.MaxValue, ushort.MaxValue - 1, 1)] + [InlineData(ushort.MaxValue, ushort.MaxValue - 1, ushort.MaxValue)] + [InlineData(ushort.MaxValue, ushort.MaxValue, 0)] + [InlineData(ushort.MaxValue, ushort.MaxValue, 1)] + [Theory] + public void When_an_ushort_value_is_close_to_expected_value_it_should_succeed(ushort actual, ushort nearbyValue, + ushort delta) + { + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(0, 1, 0)] + [InlineData(1, 0, 0)] + [InlineData(ushort.MinValue, ushort.MaxValue, 1)] + [InlineData(ushort.MaxValue, ushort.MinValue, 1)] + [Theory] + public void When_an_ushort_value_is_not_close_to_expected_value_it_should_fail(ushort actual, ushort nearbyValue, + ushort delta) + { + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_an_ushort_value_is_not_close_to_expected_value_it_should_fail_with_a_descriptive_message() + { + // Arrange + ushort actual = 1; + ushort nearbyValue = 4; + ushort delta = 2; + + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw() + .WithMessage("*be within*2*from*4*but found*1*"); + } + + [Fact] + public void When_an_ushort_value_is_returned_from_BeCloseTo_it_should_chain() + { + // Arrange + ushort actual = ushort.MaxValue; + + // Act + Action act = () => actual.Should().BeCloseTo(actual, 0) + .And.Be(actual); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(0, 0, 0)] + [InlineData(0, 0, 1)] + [InlineData(0, 1, 1)] + [InlineData(1, 0, 1)] + [InlineData(1, uint.MaxValue, uint.MaxValue)] + [InlineData(uint.MinValue, uint.MinValue + 1, uint.MaxValue)] + [InlineData(uint.MinValue + 1, 0, uint.MaxValue)] + [InlineData(uint.MinValue + 1, uint.MinValue, 1)] + [InlineData(uint.MinValue + 1, uint.MinValue, uint.MaxValue)] + [InlineData(uint.MaxValue - 1, uint.MaxValue, 1)] + [InlineData(uint.MaxValue - 1, uint.MaxValue, uint.MaxValue)] + [InlineData(uint.MaxValue, 0, uint.MaxValue)] + [InlineData(uint.MaxValue, 1, uint.MaxValue)] + [InlineData(uint.MaxValue, uint.MaxValue - 1, 1)] + [InlineData(uint.MaxValue, uint.MaxValue - 1, uint.MaxValue)] + [InlineData(uint.MaxValue, uint.MaxValue, 0)] + [InlineData(uint.MaxValue, uint.MaxValue, 1)] + [Theory] + public void When_an_uint_value_is_close_to_expected_value_it_should_succeed(uint actual, uint nearbyValue, uint delta) + { + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(0, 1, 0)] + [InlineData(1, 0, 0)] + [InlineData(uint.MinValue, uint.MaxValue, 1)] + [InlineData(uint.MaxValue, uint.MinValue, 1)] + [Theory] + public void When_an_uint_value_is_not_close_to_expected_value_it_should_fail(uint actual, uint nearbyValue, + uint delta) + { + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_an_uint_value_is_not_close_to_expected_value_it_should_fail_with_a_descriptive_message() + { + // Arrange + uint actual = 1; + uint nearbyValue = 4; + uint delta = 2; + + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw() + .WithMessage("*be within*2*from*4*but found*1*"); + } + + [Fact] + public void When_an_uint_value_is_returned_from_BeCloseTo_it_should_chain() + { + // Arrange + uint actual = uint.MaxValue; + + // Act + Action act = () => actual.Should().BeCloseTo(actual, 0) + .And.Be(actual); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(0, 0, 0)] + [InlineData(0, 0, 1)] + [InlineData(0, 1, 1)] + [InlineData(1, 0, 1)] + [InlineData(1, ulong.MaxValue, ulong.MaxValue)] + [InlineData(ulong.MinValue, ulong.MinValue + 1, ulong.MaxValue)] + [InlineData(ulong.MinValue + 1, 0, ulong.MaxValue)] + [InlineData(ulong.MinValue + 1, ulong.MinValue, 1)] + [InlineData(ulong.MinValue + 1, ulong.MinValue, ulong.MaxValue)] + [InlineData(ulong.MaxValue - 1, ulong.MaxValue, 1)] + [InlineData(ulong.MaxValue - 1, ulong.MaxValue, ulong.MaxValue)] + [InlineData(ulong.MaxValue, 0, ulong.MaxValue)] + [InlineData(ulong.MaxValue, 1, ulong.MaxValue)] + [InlineData(ulong.MaxValue, ulong.MaxValue - 1, 1)] + [InlineData(ulong.MaxValue, ulong.MaxValue - 1, ulong.MaxValue)] + [InlineData(ulong.MaxValue, ulong.MaxValue, 0)] + [InlineData(ulong.MaxValue, ulong.MaxValue, 1)] + [Theory] + public void When_an_ulong_value_is_close_to_expected_value_it_should_succeed(ulong actual, ulong nearbyValue, + ulong delta) + { + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(0, 1, 0)] + [InlineData(1, 0, 0)] + [InlineData(ulong.MinValue, ulong.MaxValue, 1)] + [InlineData(ulong.MaxValue, ulong.MinValue, 1)] + [Theory] + public void When_an_ulong_value_is_not_close_to_expected_value_it_should_fail(ulong actual, ulong nearbyValue, + ulong delta) + { + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_an_ulong_value_is_not_close_to_expected_value_it_should_fail_with_a_descriptive_message() + { + // Arrange + ulong actual = 1; + ulong nearbyValue = 4; + ulong delta = 2; + + // Act + Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw() + .WithMessage("*be within*2*from*4*but found*1*"); + } + + [Fact] + public void When_an_ulong_value_is_returned_from_BeCloseTo_it_should_chain() + { + // Arrange + ulong actual = ulong.MaxValue; + + // Act + Action act = () => actual.Should().BeCloseTo(actual, 0) + .And.Be(actual); + + // Assert + act.Should().NotThrow(); + } + } + + public class NotBeCloseTo + { + [InlineData(sbyte.MinValue, sbyte.MaxValue, 1)] + [InlineData(sbyte.MinValue, 0, sbyte.MaxValue)] + [InlineData(sbyte.MinValue, 1, sbyte.MaxValue)] + [InlineData(-1, 0, 0)] + [InlineData(-1, 1, 1)] + [InlineData(-1, sbyte.MaxValue, sbyte.MaxValue)] + [InlineData(0, sbyte.MinValue, sbyte.MaxValue)] + [InlineData(0, -1, 0)] + [InlineData(0, 1, 0)] + [InlineData(1, -1, 1)] + [InlineData(1, 0, 0)] + [InlineData(1, sbyte.MinValue, sbyte.MaxValue)] + [InlineData(sbyte.MaxValue, sbyte.MinValue, 1)] + [InlineData(sbyte.MaxValue, -1, sbyte.MaxValue)] + [Theory] + public void When_a_sbyte_value_is_not_close_to_expected_value_it_should_succeed(sbyte actual, sbyte distantValue, + byte delta) + { + // Act + Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(sbyte.MinValue, sbyte.MinValue, 0)] + [InlineData(sbyte.MinValue, sbyte.MinValue, 1)] + [InlineData(sbyte.MinValue, sbyte.MinValue, sbyte.MaxValue)] + [InlineData(sbyte.MinValue, sbyte.MinValue + 1, 1)] + [InlineData(sbyte.MinValue, sbyte.MinValue + 1, sbyte.MaxValue)] + [InlineData(sbyte.MinValue, -1, sbyte.MaxValue)] + [InlineData(sbyte.MinValue + 1, sbyte.MinValue, 1)] + [InlineData(sbyte.MinValue + 1, sbyte.MinValue, sbyte.MaxValue)] + [InlineData(sbyte.MinValue + 1, 0, sbyte.MaxValue)] + [InlineData(-1, sbyte.MinValue, sbyte.MaxValue)] + [InlineData(-1, 0, 1)] + [InlineData(-1, 0, sbyte.MaxValue)] + [InlineData(0, 0, 0)] + [InlineData(0, 0, 1)] + [InlineData(0, -1, 1)] + [InlineData(0, -1, sbyte.MaxValue)] + [InlineData(0, 1, 1)] + [InlineData(0, 1, sbyte.MaxValue)] + [InlineData(0, sbyte.MaxValue, sbyte.MaxValue)] + [InlineData(0, sbyte.MinValue + 1, sbyte.MaxValue)] + [InlineData(1, 0, 1)] + [InlineData(1, 0, sbyte.MaxValue)] + [InlineData(1, sbyte.MaxValue, sbyte.MaxValue)] + [InlineData(sbyte.MaxValue - 1, sbyte.MaxValue, 1)] + [InlineData(sbyte.MaxValue - 1, sbyte.MaxValue, sbyte.MaxValue)] + [InlineData(sbyte.MaxValue, 0, sbyte.MaxValue)] + [InlineData(sbyte.MaxValue, 1, sbyte.MaxValue)] + [InlineData(sbyte.MaxValue, sbyte.MaxValue, 0)] + [InlineData(sbyte.MaxValue, sbyte.MaxValue, 1)] + [InlineData(sbyte.MaxValue, sbyte.MaxValue, sbyte.MaxValue)] + [InlineData(sbyte.MaxValue, sbyte.MaxValue - 1, 1)] + [InlineData(sbyte.MaxValue, sbyte.MaxValue - 1, sbyte.MaxValue)] + [Theory] + public void When_a_sbyte_value_is_close_to_expected_value_it_should_fail(sbyte actual, sbyte distantValue, byte delta) + { + // Act + Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_sbyte_value_is_close_to_expected_value_it_should_fail_with_a_descriptive_message() + { + // Arrange + sbyte actual = 1; + sbyte nearbyValue = 3; + byte delta = 2; + + // Act + Action act = () => actual.Should().NotBeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw() + .WithMessage("*be within*2*from*3*but found*1*"); + } + + [Fact] + public void When_a_sbyte_value_is_returned_from_NotBeCloseTo_it_should_chain() + { + // Arrange + sbyte actual = sbyte.MaxValue; + + // Act + Action act = () => actual.Should().NotBeCloseTo(0, 0) + .And.Be(actual); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(short.MinValue, short.MaxValue, 1)] + [InlineData(short.MinValue, 0, short.MaxValue)] + [InlineData(short.MinValue, 1, short.MaxValue)] + [InlineData(-1, 0, 0)] + [InlineData(-1, 1, 1)] + [InlineData(-1, short.MaxValue, short.MaxValue)] + [InlineData(0, short.MinValue, short.MaxValue)] + [InlineData(0, -1, 0)] + [InlineData(0, 1, 0)] + [InlineData(1, -1, 1)] + [InlineData(1, 0, 0)] + [InlineData(1, short.MinValue, short.MaxValue)] + [InlineData(short.MaxValue, short.MinValue, 1)] + [InlineData(short.MaxValue, -1, short.MaxValue)] + [Theory] + public void When_a_short_value_is_not_close_to_expected_value_it_should_succeed(short actual, short distantValue, + ushort delta) + { + // Act + Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(short.MinValue, short.MinValue, 0)] + [InlineData(short.MinValue, short.MinValue, 1)] + [InlineData(short.MinValue, short.MinValue, short.MaxValue)] + [InlineData(short.MinValue, short.MinValue + 1, 1)] + [InlineData(short.MinValue, short.MinValue + 1, short.MaxValue)] + [InlineData(short.MinValue, -1, short.MaxValue)] + [InlineData(short.MinValue + 1, short.MinValue, 1)] + [InlineData(short.MinValue + 1, short.MinValue, short.MaxValue)] + [InlineData(short.MinValue + 1, 0, short.MaxValue)] + [InlineData(-1, short.MinValue, short.MaxValue)] + [InlineData(-1, 0, 1)] + [InlineData(-1, 0, short.MaxValue)] + [InlineData(0, 0, 0)] + [InlineData(0, 0, 1)] + [InlineData(0, -1, 1)] + [InlineData(0, -1, short.MaxValue)] + [InlineData(0, 1, 1)] + [InlineData(0, 1, short.MaxValue)] + [InlineData(0, short.MaxValue, short.MaxValue)] + [InlineData(0, short.MinValue + 1, short.MaxValue)] + [InlineData(1, 0, 1)] + [InlineData(1, 0, short.MaxValue)] + [InlineData(1, short.MaxValue, short.MaxValue)] + [InlineData(short.MaxValue - 1, short.MaxValue, 1)] + [InlineData(short.MaxValue - 1, short.MaxValue, short.MaxValue)] + [InlineData(short.MaxValue, 0, short.MaxValue)] + [InlineData(short.MaxValue, 1, short.MaxValue)] + [InlineData(short.MaxValue, short.MaxValue, 0)] + [InlineData(short.MaxValue, short.MaxValue, 1)] + [InlineData(short.MaxValue, short.MaxValue, short.MaxValue)] + [InlineData(short.MaxValue, short.MaxValue - 1, 1)] + [InlineData(short.MaxValue, short.MaxValue - 1, short.MaxValue)] + [Theory] + public void When_a_short_value_is_close_to_expected_value_it_should_fail(short actual, short distantValue, + ushort delta) + { + // Act + Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_short_value_is_close_to_expected_value_it_should_fail_with_a_descriptive_message() + { + // Arrange + short actual = 1; + short nearbyValue = 3; + ushort delta = 2; + + // Act + Action act = () => actual.Should().NotBeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw() + .WithMessage("*be within*2*from*3*but found*1*"); + } + + [Fact] + public void When_a_short_value_is_returned_from_NotBeCloseTo_it_should_chain() + { + // Arrange + short actual = short.MaxValue; + + // Act + Action act = () => actual.Should().NotBeCloseTo(0, 0) + .And.Be(actual); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(int.MinValue, int.MaxValue, 1)] + [InlineData(int.MinValue, 0, int.MaxValue)] + [InlineData(int.MinValue, 1, int.MaxValue)] + [InlineData(-1, 0, 0)] + [InlineData(-1, 1, 1)] + [InlineData(-1, int.MaxValue, int.MaxValue)] + [InlineData(0, int.MinValue, int.MaxValue)] + [InlineData(0, -1, 0)] + [InlineData(0, 1, 0)] + [InlineData(1, -1, 1)] + [InlineData(1, 0, 0)] + [InlineData(1, int.MinValue, int.MaxValue)] + [InlineData(int.MaxValue, int.MinValue, 1)] + [InlineData(int.MaxValue, -1, int.MaxValue)] + [Theory] + public void When_an_int_value_is_not_close_to_expected_value_it_should_succeed(int actual, int distantValue, + uint delta) + { + // Act + Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(int.MinValue, int.MinValue, 0)] + [InlineData(int.MinValue, int.MinValue, 1)] + [InlineData(int.MinValue, int.MinValue, int.MaxValue)] + [InlineData(int.MinValue, int.MinValue + 1, 1)] + [InlineData(int.MinValue, int.MinValue + 1, int.MaxValue)] + [InlineData(int.MinValue, -1, int.MaxValue)] + [InlineData(int.MinValue + 1, int.MinValue, 1)] + [InlineData(int.MinValue + 1, int.MinValue, int.MaxValue)] + [InlineData(int.MinValue + 1, 0, int.MaxValue)] + [InlineData(-1, int.MinValue, int.MaxValue)] + [InlineData(-1, 0, 1)] + [InlineData(-1, 0, int.MaxValue)] + [InlineData(0, 0, 0)] + [InlineData(0, 0, 1)] + [InlineData(0, -1, 1)] + [InlineData(0, -1, int.MaxValue)] + [InlineData(0, 1, 1)] + [InlineData(0, 1, int.MaxValue)] + [InlineData(0, int.MaxValue, int.MaxValue)] + [InlineData(0, int.MinValue + 1, int.MaxValue)] + [InlineData(1, 0, 1)] + [InlineData(1, 0, int.MaxValue)] + [InlineData(1, int.MaxValue, int.MaxValue)] + [InlineData(int.MaxValue - 1, int.MaxValue, 1)] + [InlineData(int.MaxValue - 1, int.MaxValue, int.MaxValue)] + [InlineData(int.MaxValue, 0, int.MaxValue)] + [InlineData(int.MaxValue, 1, int.MaxValue)] + [InlineData(int.MaxValue, int.MaxValue, 0)] + [InlineData(int.MaxValue, int.MaxValue, 1)] + [InlineData(int.MaxValue, int.MaxValue, int.MaxValue)] + [InlineData(int.MaxValue, int.MaxValue - 1, 1)] + [InlineData(int.MaxValue, int.MaxValue - 1, int.MaxValue)] + [Theory] + public void When_an_int_value_is_close_to_expected_value_it_should_fail(int actual, int distantValue, uint delta) + { + // Act + Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_an_int_value_is_close_to_expected_value_it_should_fail_with_a_descriptive_message() + { + // Arrange + int actual = 1; + int nearbyValue = 3; + uint delta = 2; + + // Act + Action act = () => actual.Should().NotBeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw() + .WithMessage("*be within*2*from*3*but found*1*"); + } + + [Fact] + public void When_an_int_value_is_returned_from_NotBeCloseTo_it_should_chain() + { + // Arrange + int actual = int.MaxValue; + + // Act + Action act = () => actual.Should().NotBeCloseTo(0, 0) + .And.Be(actual); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(long.MinValue, long.MaxValue, 1)] + [InlineData(long.MinValue, 0, long.MaxValue)] + [InlineData(long.MinValue, 1, long.MaxValue)] + [InlineData(long.MinValue + 1, 0, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MinValue, long.MaxValue, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MinValue, long.MaxValue, ulong.MaxValue / 2)] + [InlineData(-1, 0, 0)] + [InlineData(-1, 1, 1)] + [InlineData(-1, long.MaxValue, long.MaxValue)] + [InlineData(-1, long.MinValue, (ulong.MaxValue / 2) - 1)] + [InlineData(0, long.MinValue, long.MaxValue)] + [InlineData(0, long.MinValue + 1, (ulong.MaxValue / 2) - 1)] + [InlineData(0, long.MaxValue, (ulong.MaxValue / 2) - 1)] + [InlineData(0, -1, 0)] + [InlineData(0, 1, 0)] + [InlineData(1, -1, 1)] + [InlineData(1, 0, 0)] + [InlineData(1, long.MinValue, long.MaxValue)] + [InlineData(long.MaxValue, long.MinValue, 1)] + [InlineData(long.MaxValue, -1, long.MaxValue)] + [InlineData(long.MaxValue, 0, (ulong.MaxValue / 2) - 1)] + [Theory] + public void When_a_long_value_is_not_close_to_expected_value_it_should_succeed(long actual, long distantValue, + ulong delta) + { + // Act + Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(long.MinValue, long.MinValue, 0)] + [InlineData(long.MinValue, long.MinValue, 1)] + [InlineData(long.MinValue, long.MinValue, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MinValue, long.MinValue, ulong.MaxValue / 2)] + [InlineData(long.MinValue, long.MinValue, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MinValue, long.MinValue, ulong.MaxValue)] + [InlineData(long.MinValue, long.MinValue + 1, 1)] + [InlineData(long.MinValue, long.MinValue + 1, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MinValue, long.MinValue + 1, ulong.MaxValue / 2)] + [InlineData(long.MinValue, long.MinValue + 1, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MinValue, long.MinValue + 1, ulong.MaxValue)] + [InlineData(long.MinValue, -1, long.MaxValue)] + [InlineData(long.MinValue + 1, long.MinValue, 1)] + [InlineData(long.MinValue + 1, long.MinValue, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MinValue + 1, long.MinValue, ulong.MaxValue / 2)] + [InlineData(long.MinValue + 1, long.MinValue, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MinValue + 1, long.MinValue, ulong.MaxValue)] + [InlineData(long.MinValue + 1, 0, ulong.MaxValue / 2)] + [InlineData(long.MinValue + 1, 0, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MinValue + 1, 0, ulong.MaxValue)] + [InlineData(long.MinValue, long.MaxValue, ulong.MaxValue)] + [InlineData(-1, long.MinValue, ulong.MaxValue / 2)] + [InlineData(-1, long.MinValue, (ulong.MaxValue / 2) + 1)] + [InlineData(-1, long.MinValue, ulong.MaxValue)] + [InlineData(-1, 0, 1)] + [InlineData(-1, 0, (ulong.MaxValue / 2) - 1)] + [InlineData(-1, 0, ulong.MaxValue / 2)] + [InlineData(-1, 0, (ulong.MaxValue / 2) + 1)] + [InlineData(-1, 0, ulong.MaxValue)] + [InlineData(0, 0, 0)] + [InlineData(0, 0, 1)] + [InlineData(0, -1, 1)] + [InlineData(0, -1, (ulong.MaxValue / 2) - 1)] + [InlineData(0, -1, ulong.MaxValue / 2)] + [InlineData(0, -1, (ulong.MaxValue / 2) + 1)] + [InlineData(0, -1, ulong.MaxValue)] + [InlineData(0, 1, 1)] + [InlineData(0, 1, (ulong.MaxValue / 2) - 1)] + [InlineData(0, 1, ulong.MaxValue / 2)] + [InlineData(0, 1, (ulong.MaxValue / 2) + 1)] + [InlineData(0, 1, ulong.MaxValue)] + [InlineData(0, long.MaxValue, ulong.MaxValue / 2)] + [InlineData(0, long.MaxValue, (ulong.MaxValue / 2) + 1)] + [InlineData(0, long.MaxValue, ulong.MaxValue)] + [InlineData(0, long.MinValue + 1, ulong.MaxValue / 2)] + [InlineData(0, long.MinValue + 1, (ulong.MaxValue / 2) + 1)] + [InlineData(0, long.MinValue + 1, ulong.MaxValue)] + [InlineData(1, 0, 1)] + [InlineData(1, 0, (ulong.MaxValue / 2) - 1)] + [InlineData(1, 0, ulong.MaxValue / 2)] + [InlineData(1, 0, (ulong.MaxValue / 2) + 1)] + [InlineData(1, 0, ulong.MaxValue)] + [InlineData(1, long.MaxValue, (ulong.MaxValue / 2) - 1)] + [InlineData(1, long.MaxValue, ulong.MaxValue / 2)] + [InlineData(1, long.MaxValue, (ulong.MaxValue / 2) + 1)] + [InlineData(1, long.MaxValue, ulong.MaxValue)] + [InlineData(long.MaxValue - 1, long.MaxValue, 1)] + [InlineData(long.MaxValue - 1, long.MaxValue, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MaxValue - 1, long.MaxValue, ulong.MaxValue / 2)] + [InlineData(long.MaxValue - 1, long.MaxValue, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MaxValue - 1, long.MaxValue, ulong.MaxValue)] + [InlineData(long.MaxValue, 0, ulong.MaxValue / 2)] + [InlineData(long.MaxValue, 0, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MaxValue, 0, ulong.MaxValue)] + [InlineData(long.MaxValue, 1, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MaxValue, 1, ulong.MaxValue / 2)] + [InlineData(long.MaxValue, 1, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MaxValue, 1, ulong.MaxValue)] + [InlineData(long.MaxValue, long.MaxValue, 0)] + [InlineData(long.MaxValue, long.MaxValue, 1)] + [InlineData(long.MaxValue, long.MaxValue, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MaxValue, long.MaxValue, ulong.MaxValue / 2)] + [InlineData(long.MaxValue, long.MaxValue, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MaxValue, long.MaxValue, ulong.MaxValue)] + [InlineData(long.MaxValue, long.MaxValue - 1, 1)] + [InlineData(long.MaxValue, long.MaxValue - 1, (ulong.MaxValue / 2) - 1)] + [InlineData(long.MaxValue, long.MaxValue - 1, ulong.MaxValue / 2)] + [InlineData(long.MaxValue, long.MaxValue - 1, (ulong.MaxValue / 2) + 1)] + [InlineData(long.MaxValue, long.MaxValue - 1, ulong.MaxValue)] + [Theory] + public void When_a_long_value_is_close_to_expected_value_it_should_fail(long actual, long distantValue, ulong delta) + { + // Act + Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_long_value_is_close_to_expected_value_it_should_fail_with_a_descriptive_message() + { + // Arrange + long actual = 1; + long nearbyValue = 3; + ulong delta = 2; + + // Act + Action act = () => actual.Should().NotBeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw() + .WithMessage("*be within*2*from*3*but found*1*"); + } + + [Fact] + public void When_a_long_value_is_returned_from_NotBeCloseTo_it_should_chain() + { + // Arrange + long actual = long.MaxValue; + + // Act + Action act = () => actual.Should().NotBeCloseTo(0, 0) + .And.Be(actual); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(0, 1, 0)] + [InlineData(1, 0, 0)] + [InlineData(byte.MinValue, byte.MaxValue, 1)] + [InlineData(byte.MaxValue, byte.MinValue, 1)] + [Theory] + public void When_a_byte_value_is_not_close_to_expected_value_it_should_succeed(byte actual, byte distantValue, + byte delta) + { + // Act + Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(0, 0, 0)] + [InlineData(0, 0, 1)] + [InlineData(0, 1, 1)] + [InlineData(1, 0, 1)] + [InlineData(1, byte.MaxValue, byte.MaxValue)] + [InlineData(byte.MinValue, byte.MinValue + 1, byte.MaxValue)] + [InlineData(byte.MinValue + 1, 0, byte.MaxValue)] + [InlineData(byte.MinValue + 1, byte.MinValue, 1)] + [InlineData(byte.MinValue + 1, byte.MinValue, byte.MaxValue)] + [InlineData(byte.MaxValue - 1, byte.MaxValue, 1)] + [InlineData(byte.MaxValue - 1, byte.MaxValue, byte.MaxValue)] + [InlineData(byte.MaxValue, 0, byte.MaxValue)] + [InlineData(byte.MaxValue, 1, byte.MaxValue)] + [InlineData(byte.MaxValue, byte.MaxValue - 1, 1)] + [InlineData(byte.MaxValue, byte.MaxValue - 1, byte.MaxValue)] + [InlineData(byte.MaxValue, byte.MaxValue, 0)] + [InlineData(byte.MaxValue, byte.MaxValue, 1)] + [Theory] + public void When_a_byte_value_is_close_to_expected_value_it_should_fail(byte actual, byte distantValue, byte delta) + { + // Act + Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_byte_value_is_close_to_expected_value_it_should_fail_with_a_descriptive_message() + { + // Arrange + byte actual = 1; + byte nearbyValue = 3; + byte delta = 2; + + // Act + Action act = () => actual.Should().NotBeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw() + .WithMessage("*be within*2*from*3*but found*1*"); + } + + [Fact] + public void When_a_byte_value_is_returned_from_NotBeCloseTo_it_should_chain() + { + // Arrange + byte actual = byte.MaxValue; + + // Act + Action act = () => actual.Should().NotBeCloseTo(0, 0) + .And.Be(actual); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(0, 1, 0)] + [InlineData(1, 0, 0)] + [InlineData(ushort.MinValue, ushort.MaxValue, 1)] + [InlineData(ushort.MaxValue, ushort.MinValue, 1)] + [Theory] + public void When_an_ushort_value_is_not_close_to_expected_value_it_should_succeed(ushort actual, ushort distantValue, + ushort delta) + { + // Act + Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(0, 0, 0)] + [InlineData(0, 0, 1)] + [InlineData(0, 1, 1)] + [InlineData(1, 0, 1)] + [InlineData(1, ushort.MaxValue, ushort.MaxValue)] + [InlineData(ushort.MinValue, ushort.MinValue + 1, ushort.MaxValue)] + [InlineData(ushort.MinValue + 1, 0, ushort.MaxValue)] + [InlineData(ushort.MinValue + 1, ushort.MinValue, 1)] + [InlineData(ushort.MinValue + 1, ushort.MinValue, ushort.MaxValue)] + [InlineData(ushort.MaxValue - 1, ushort.MaxValue, 1)] + [InlineData(ushort.MaxValue - 1, ushort.MaxValue, ushort.MaxValue)] + [InlineData(ushort.MaxValue, 0, ushort.MaxValue)] + [InlineData(ushort.MaxValue, 1, ushort.MaxValue)] + [InlineData(ushort.MaxValue, ushort.MaxValue - 1, 1)] + [InlineData(ushort.MaxValue, ushort.MaxValue - 1, ushort.MaxValue)] + [InlineData(ushort.MaxValue, ushort.MaxValue, 0)] + [InlineData(ushort.MaxValue, ushort.MaxValue, 1)] + [Theory] + public void When_an_ushort_value_is_close_to_expected_value_it_should_fail(ushort actual, ushort distantValue, + ushort delta) + { + // Act + Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_an_ushort_value_is_close_to_expected_value_it_should_fail_with_a_descriptive_message() + { + // Arrange + ushort actual = 1; + ushort nearbyValue = 3; + ushort delta = 2; + + // Act + Action act = () => actual.Should().NotBeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw() + .WithMessage("*be within*2*from*3*but found*1*"); + } + + [Fact] + public void When_an_ushort_value_is_returned_from_NotBeCloseTo_it_should_chain() + { + // Arrange + ushort actual = ushort.MaxValue; + + // Act + Action act = () => actual.Should().NotBeCloseTo(0, 0) + .And.Be(actual); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(0, 1, 0)] + [InlineData(1, 0, 0)] + [InlineData(uint.MinValue, uint.MaxValue, 1)] + [InlineData(uint.MaxValue, uint.MinValue, 1)] + [Theory] + public void When_an_uint_value_is_not_close_to_expected_value_it_should_succeed(uint actual, uint distantValue, + uint delta) + { + // Act + Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(0, 0, 0)] + [InlineData(0, 0, 1)] + [InlineData(0, 1, 1)] + [InlineData(1, 0, 1)] + [InlineData(1, uint.MaxValue, uint.MaxValue)] + [InlineData(uint.MinValue, uint.MinValue + 1, uint.MaxValue)] + [InlineData(uint.MinValue + 1, 0, uint.MaxValue)] + [InlineData(uint.MinValue + 1, uint.MinValue, 1)] + [InlineData(uint.MinValue + 1, uint.MinValue, uint.MaxValue)] + [InlineData(uint.MaxValue - 1, uint.MaxValue, 1)] + [InlineData(uint.MaxValue - 1, uint.MaxValue, uint.MaxValue)] + [InlineData(uint.MaxValue, 0, uint.MaxValue)] + [InlineData(uint.MaxValue, 1, uint.MaxValue)] + [InlineData(uint.MaxValue, uint.MaxValue - 1, 1)] + [InlineData(uint.MaxValue, uint.MaxValue - 1, uint.MaxValue)] + [InlineData(uint.MaxValue, uint.MaxValue, 0)] + [InlineData(uint.MaxValue, uint.MaxValue, 1)] + [Theory] + public void When_an_uint_value_is_close_to_expected_value_it_should_fail(uint actual, uint distantValue, uint delta) + { + // Act + Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_an_uint_value_is_close_to_expected_value_it_should_fail_with_a_descriptive_message() + { + // Arrange + uint actual = 1; + uint nearbyValue = 3; + uint delta = 2; + + // Act + Action act = () => actual.Should().NotBeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw() + .WithMessage("*be within*2*from*3*but found*1*"); + } + + [Fact] + public void When_an_uint_value_is_returned_from_NotBeCloseTo_it_should_chain() + { + // Arrange + uint actual = uint.MaxValue; + + // Act + Action act = () => actual.Should().NotBeCloseTo(0, 0) + .And.Be(actual); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(0, 1, 0)] + [InlineData(1, 0, 0)] + [InlineData(ulong.MinValue, ulong.MaxValue, 1)] + [InlineData(ulong.MaxValue, ulong.MinValue, 1)] + [Theory] + public void When_an_ulong_value_is_not_close_to_expected_value_it_should_succeed(ulong actual, ulong distantValue, + ulong delta) + { + // Act + Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); + + // Assert + act.Should().NotThrow(); + } + + [InlineData(0, 0, 0)] + [InlineData(0, 0, 1)] + [InlineData(0, 1, 1)] + [InlineData(1, 0, 1)] + [InlineData(1, ulong.MaxValue, ulong.MaxValue)] + [InlineData(ulong.MinValue, ulong.MinValue + 1, ulong.MaxValue)] + [InlineData(ulong.MinValue + 1, 0, ulong.MaxValue)] + [InlineData(ulong.MinValue + 1, ulong.MinValue, 1)] + [InlineData(ulong.MinValue + 1, ulong.MinValue, ulong.MaxValue)] + [InlineData(ulong.MaxValue - 1, ulong.MaxValue, 1)] + [InlineData(ulong.MaxValue - 1, ulong.MaxValue, ulong.MaxValue)] + [InlineData(ulong.MaxValue, 0, ulong.MaxValue)] + [InlineData(ulong.MaxValue, 1, ulong.MaxValue)] + [InlineData(ulong.MaxValue, ulong.MaxValue - 1, 1)] + [InlineData(ulong.MaxValue, ulong.MaxValue - 1, ulong.MaxValue)] + [InlineData(ulong.MaxValue, ulong.MaxValue, 0)] + [InlineData(ulong.MaxValue, ulong.MaxValue, 1)] + [Theory] + public void When_an_ulong_value_is_close_to_expected_value_it_should_fail(ulong actual, ulong distantValue, + ulong delta) + { + // Act + Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_an_ulong_value_is_close_to_expected_value_it_should_fail_with_a_descriptive_message() + { + // Arrange + ulong actual = 1; + ulong nearbyValue = 3; + ulong delta = 2; + + // Act + Action act = () => actual.Should().NotBeCloseTo(nearbyValue, delta); + + // Assert + act.Should().Throw() + .WithMessage("*be within*2*from*3*but found*1*"); + } + + [Fact] + public void When_an_ulong_value_is_returned_from_NotBeCloseTo_it_should_chain() + { + // Arrange + ulong actual = ulong.MaxValue; + + // Act + Action act = () => actual.Should().NotBeCloseTo(0, 0) + .And.Be(actual); + + // Assert + act.Should().NotThrow(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeGreaterThan.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeGreaterThan.cs new file mode 100644 index 0000000000..85944f6ef1 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeGreaterThan.cs @@ -0,0 +1,133 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NumericAssertionSpecs +{ + public class BeGreaterThan + { + [Fact] + public void When_a_value_is_greater_than_smaller_value_it_should_not_throw() + { + // Arrange + int value = 2; + int smallerValue = 1; + + // Act + Action act = () => value.Should().BeGreaterThan(smallerValue); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_value_is_greater_than_greater_value_it_should_throw() + { + // Arrange + int value = 2; + int greaterValue = 3; + + // Act + Action act = () => value.Should().BeGreaterThan(greaterValue); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_value_is_greater_than_same_value_it_should_throw() + { + // Arrange + int value = 2; + int sameValue = 2; + + // Act + Action act = () => value.Should().BeGreaterThan(sameValue); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_value_is_greater_than_greater_value_it_should_throw_with_descriptive_message() + { + // Arrange + int value = 2; + int greaterValue = 3; + + // Act + Action act = () => + value.Should().BeGreaterThan(greaterValue, "because we want to test the failure {0}", "message"); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to be greater than 3 because we want to test the failure message, but found 2."); + } + + [Fact] + public void NaN_is_never_greater_than_another_float() + { + // Act + Action act = () => float.NaN.Should().BeGreaterThan(0); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void A_float_cannot_be_greater_than_NaN() + { + // Act + Action act = () => 3.4F.Should().BeGreaterThan(float.NaN); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void NaN_is_never_greater_than_another_double() + { + // Act + Action act = () => double.NaN.Should().BeGreaterThan(0); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void A_double_can_never_be_greater_than_NaN() + { + // Act + Action act = () => 3.4D.Should().BeGreaterThan(double.NaN); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void When_a_nullable_numeric_null_value_is_not_greater_than_it_should_throw() + { + // Arrange + int? value = null; + + // Act + Action act = () => value.Should().BeGreaterThan(0); + + // Assert + act + .Should().Throw() + .WithMessage("*null*"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeGreaterThanOrEqualTo.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeGreaterThanOrEqualTo.cs new file mode 100644 index 0000000000..66c177d734 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeGreaterThanOrEqualTo.cs @@ -0,0 +1,146 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NumericAssertionSpecs +{ + public class BeGreaterThanOrEqualTo + { + [Fact] + public void When_a_value_is_greater_than_or_equal_to_smaller_value_it_should_not_throw() + { + // Arrange + int value = 2; + int smallerValue = 1; + + // Act + Action act = () => value.Should().BeGreaterThanOrEqualTo(smallerValue); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_value_is_greater_than_or_equal_to_same_value_it_should_not_throw() + { + // Arrange + int value = 2; + int sameValue = 2; + + // Act + Action act = () => value.Should().BeGreaterThanOrEqualTo(sameValue); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_value_is_greater_than_or_equal_to_greater_value_it_should_throw() + { + // Arrange + int value = 2; + int greaterValue = 3; + + // Act + Action act = () => value.Should().BeGreaterThanOrEqualTo(greaterValue); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_value_is_greater_than_or_equal_to_greater_value_it_should_throw_with_descriptive_message() + { + // Arrange + int value = 2; + int greaterValue = 3; + + // Act + Action act = + () => value.Should() + .BeGreaterThanOrEqualTo(greaterValue, "because we want to test the failure {0}", "message"); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to be greater than or equal to 3 because we want to test the failure message, but found 2."); + } + + [Fact] + public void When_a_nullable_numeric_null_value_is_not_greater_than_or_equal_to_it_should_throw() + { + // Arrange + int? value = null; + + // Act + Action act = () => value.Should().BeGreaterThanOrEqualTo(0); + + // Assert + act + .Should().Throw() + .WithMessage("*null*"); + } + + [Fact] + public void NaN_is_never_greater_than_or_equal_to_another_float() + { + // Act + Action act = () => float.NaN.Should().BeGreaterThanOrEqualTo(0); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void A_float_cannot_be_greater_than_or_equal_to_NaN() + { + // Act + Action act = () => 3.4F.Should().BeGreaterThanOrEqualTo(float.NaN); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void NaN_is_never_greater_or_equal_to_another_double() + { + // Act + Action act = () => double.NaN.Should().BeGreaterThanOrEqualTo(0); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void A_double_can_never_be_greater_or_equal_to_NaN() + { + // Act + Action act = () => 3.4D.Should().BeGreaterThanOrEqualTo(double.NaN); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + int value = 2; + int smallerValue = 1; + + // Act / Assert + value.Should().BeGreaterThanOrEqualTo(smallerValue).And.Be(2); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeInRange.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeInRange.cs new file mode 100644 index 0000000000..a302c0eb8b --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeInRange.cs @@ -0,0 +1,224 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NumericAssertionSpecs +{ + public class BeInRange + { + [Fact] + public void When_a_value_is_outside_a_range_it_should_throw() + { + // Arrange + float value = 3.99F; + + // Act + Action act = () => value.Should().BeInRange(4, 5, "because that's the valid range"); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to be between*4* and*5* because that\'s the valid range, but found*3.99*"); + } + + [Fact] + public void When_a_value_is_inside_a_range_it_should_not_throw() + { + // Arrange + int value = 4; + + // Act + Action act = () => value.Should().BeInRange(3, 5); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_nullable_numeric_null_value_is_not_in_range_it_should_throw() + { + // Arrange + int? value = null; + + // Act + Action act = () => value.Should().BeInRange(0, 1); + + // Assert + act + .Should().Throw() + .WithMessage("*null*"); + } + + [Fact] + public void NaN_is_never_in_range_of_two_floats() + { + // Arrange + float value = float.NaN; + + // Act + Action act = () => value.Should().BeInRange(4, 5); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to be between*4* and*5*, but found*NaN*"); + } + + [Theory] + [InlineData(float.NaN, 5F)] + [InlineData(5F, float.NaN)] + public void A_float_can_never_be_in_a_range_containing_NaN(float minimumValue, float maximumValue) + { + // Arrange + float value = 4.5F; + + // Act + Action act = () => value.Should().BeInRange(minimumValue, maximumValue); + + // Assert + act + .Should().Throw() + .WithMessage( + "*NaN*"); + } + + [Fact] + public void A_NaN_is_never_in_range_of_two_doubles() + { + // Arrange + double value = double.NaN; + + // Act + Action act = () => value.Should().BeInRange(4, 5); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to be between*4* and*5*, but found*NaN*"); + } + + [Theory] + [InlineData(double.NaN, 5)] + [InlineData(5, double.NaN)] + public void A_double_can_never_be_in_a_range_containing_NaN(double minimumValue, double maximumValue) + { + // Arrange + double value = 4.5D; + + // Act + Action act = () => value.Should().BeInRange(minimumValue, maximumValue); + + // Assert + act + .Should().Throw() + .WithMessage( + "*NaN*"); + } + } + + public class NotBeInRange + { + [Fact] + public void When_a_value_is_inside_an_unexpected_range_it_should_throw() + { + // Arrange + float value = 4.99F; + + // Act + Action act = () => value.Should().NotBeInRange(4, 5, "because that's the invalid range"); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to not be between*4* and*5* because that\'s the invalid range, but found*4.99*"); + } + + [Fact] + public void When_a_value_is_outside_an_unexpected_range_it_should_not_throw() + { + // Arrange + float value = 3.99F; + + // Act + Action act = () => value.Should().NotBeInRange(4, 5); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_nullable_numeric_null_value_is_not_not_in_range_to_it_should_throw() + { + // Arrange + int? value = null; + + // Act + Action act = () => value.Should().NotBeInRange(0, 1); + + // Assert + act + .Should().Throw() + .WithMessage("*null*"); + } + + [Fact] + public void NaN_is_never_inside_any_range_of_floats() + { + // Arrange + float value = float.NaN; + + // Act / Assert + value.Should().NotBeInRange(4, 5); + } + + [Theory] + [InlineData(float.NaN, 1F)] + [InlineData(1F, float.NaN)] + public void Cannot_use_NaN_in_a_range_of_floats(float minimumValue, float maximumValue) + { + // Arrange + float value = 4.5F; + + // Act + Action act = () => value.Should().NotBeInRange(minimumValue, maximumValue); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void NaN_is_never_inside_any_range_of_doubles() + { + // Arrange + double value = double.NaN; + + // Act / Assert + value.Should().NotBeInRange(4, 5); + } + + [Theory] + [InlineData(double.NaN, 1D)] + [InlineData(1D, double.NaN)] + public void Cannot_use_NaN_in_a_range_of_doubles(double minimumValue, double maximumValue) + { + // Arrange + double value = 4.5D; + + // Act + Action act = () => value.Should().NotBeInRange(minimumValue, maximumValue); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeLessThan.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeLessThan.cs new file mode 100644 index 0000000000..0a2c32cccf --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeLessThan.cs @@ -0,0 +1,132 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NumericAssertionSpecs +{ + public class BeLessThan + { + [Fact] + public void When_a_value_is_less_than_greater_value_it_should_not_throw() + { + // Arrange + int value = 1; + int greaterValue = 2; + + // Act + Action act = () => value.Should().BeLessThan(greaterValue); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_value_is_less_than_smaller_value_it_should_throw() + { + // Arrange + int value = 2; + int smallerValue = 1; + + // Act + Action act = () => value.Should().BeLessThan(smallerValue); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_value_is_less_than_same_value_it_should_throw() + { + // Arrange + int value = 2; + int sameValue = 2; + + // Act + Action act = () => value.Should().BeLessThan(sameValue); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_value_is_less_than_smaller_value_it_should_throw_with_descriptive_message() + { + // Arrange + int value = 2; + int smallerValue = 1; + + // Act + Action act = () => value.Should().BeLessThan(smallerValue, "because we want to test the failure {0}", "message"); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to be less than 1 because we want to test the failure message, but found 2."); + } + + [Fact] + public void NaN_is_never_less_than_another_float() + { + // Act + Action act = () => float.NaN.Should().BeLessThan(0); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void A_float_can_never_be_less_than_NaN() + { + // Act + Action act = () => 3.4F.Should().BeLessThan(float.NaN); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void NaN_is_never_less_than_another_double() + { + // Act + Action act = () => double.NaN.Should().BeLessThan(0); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void A_double_can_never_be_less_than_NaN() + { + // Act + Action act = () => 3.4D.Should().BeLessThan(double.NaN); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void When_a_nullable_numeric_null_value_is_not_less_than_it_should_throw() + { + // Arrange + int? value = null; + + // Act + Action act = () => value.Should().BeLessThan(0); + + // Assert + act + .Should().Throw() + .WithMessage("*null*"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeLessThanOrEqualTo.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeLessThanOrEqualTo.cs new file mode 100644 index 0000000000..18ddf08d38 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeLessThanOrEqualTo.cs @@ -0,0 +1,145 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NumericAssertionSpecs +{ + public class BeLessThanOrEqualTo + { + [Fact] + public void When_a_value_is_less_than_or_equal_to_greater_value_it_should_not_throw() + { + // Arrange + int value = 1; + int greaterValue = 2; + + // Act + Action act = () => value.Should().BeLessThanOrEqualTo(greaterValue); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_value_is_less_than_or_equal_to_same_value_it_should_not_throw() + { + // Arrange + int value = 2; + int sameValue = 2; + + // Act + Action act = () => value.Should().BeLessThanOrEqualTo(sameValue); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_value_is_less_than_or_equal_to_smaller_value_it_should_throw() + { + // Arrange + int value = 2; + int smallerValue = 1; + + // Act + Action act = () => value.Should().BeLessThanOrEqualTo(smallerValue); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_value_is_less_than_or_equal_to_smaller_value_it_should_throw_with_descriptive_message() + { + // Arrange + int value = 2; + int smallerValue = 1; + + // Act + Action act = () => + value.Should().BeLessThanOrEqualTo(smallerValue, "because we want to test the failure {0}", "message"); + + // Assert + act + .Should().Throw() + .WithMessage( + "Expected value to be less than or equal to 1 because we want to test the failure message, but found 2."); + } + + [Fact] + public void When_a_nullable_numeric_null_value_is_not_less_than_or_equal_to_it_should_throw() + { + // Arrange + int? value = null; + + // Act + Action act = () => value.Should().BeLessThanOrEqualTo(0); + + // Assert + act + .Should().Throw() + .WithMessage("*null*"); + } + + [Fact] + public void NaN_is_never_less_than_or_equal_to_another_float() + { + // Act + Action act = () => float.NaN.Should().BeLessThanOrEqualTo(0); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void A_float_can_never_be_less_than_or_equal_to_NaN() + { + // Act + Action act = () => 3.4F.Should().BeLessThanOrEqualTo(float.NaN); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void NaN_is_never_less_than_or_equal_to_another_double() + { + // Act + Action act = () => double.NaN.Should().BeLessThanOrEqualTo(0); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void A_double_can_never_be_less_than_or_equal_to_NaN() + { + // Act + Action act = () => 3.4D.Should().BeLessThanOrEqualTo(double.NaN); + + // Assert + act + .Should().Throw() + .WithMessage("*NaN*"); + } + + [Fact] + public void Chaining_after_one_assertion() + { + // Arrange + int value = 1; + int greaterValue = 2; + + // Act / Assert + value.Should().BeLessThanOrEqualTo(greaterValue).And.Be(1); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeNegative.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeNegative.cs new file mode 100644 index 0000000000..0f2d9b5290 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeNegative.cs @@ -0,0 +1,106 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NumericAssertionSpecs +{ + public class BeNegative + { + [Fact] + public void When_a_negative_value_is_negative_it_should_not_throw() + { + // Arrange + int value = -1; + + // Act + Action act = () => value.Should().BeNegative(); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_positive_value_is_negative_it_should_throw() + { + // Arrange + int value = 1; + + // Act + Action act = () => value.Should().BeNegative(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_zero_value_is_negative_it_should_throw() + { + // Arrange + int value = 0; + + // Act + Action act = () => value.Should().BeNegative(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_positive_value_is_negative_it_should_throw_with_descriptive_message() + { + // Arrange + int value = 1; + + // Act + Action act = () => value.Should().BeNegative("because we want to test the failure {0}", "message"); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to be negative because we want to test the failure message, but found 1."); + } + + [Fact] + public void When_a_nullable_numeric_null_value_is_not_negative_it_should_throw() + { + // Arrange + int? value = null; + + // Act + Action act = () => value.Should().BeNegative(); + + // Assert + act + .Should().Throw() + .WithMessage("*null*"); + } + + [Fact] + public void NaN_is_never_a_negative_float() + { + // Arrange + float value = float.NaN; + + // Act + Action act = () => value.Should().BeNegative(); + + // Assert + act.Should().Throw().WithMessage("*but found NaN*"); + } + + [Fact] + public void NaN_is_never_a_negative_double() + { + // Arrange + double value = double.NaN; + + // Act + Action act = () => value.Should().BeNegative(); + + // Assert + act.Should().Throw().WithMessage("*but found NaN*"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeOneOf.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeOneOf.cs new file mode 100644 index 0000000000..ed15b67c85 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeOneOf.cs @@ -0,0 +1,119 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NumericAssertionSpecs +{ + public class BeOneOf + { + [Fact] + public void When_a_value_is_not_one_of_the_specified_values_it_should_throw() + { + // Arrange + int value = 3; + + // Act + Action act = () => value.Should().BeOneOf(4, 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 + int value = 3; + + // Act + Action act = () => value.Should().BeOneOf(new[] { 4, 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_one_of_the_specified_values_it_should_succeed() + { + // Arrange + int value = 4; + + // Act + Action act = () => value.Should().BeOneOf(4, 5); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_nullable_numeric_null_value_is_not_one_of_to_it_should_throw() + { + // Arrange + int? value = null; + + // Act + Action act = () => value.Should().BeOneOf(0, 1); + + // Assert + act + .Should().Throw() + .WithMessage("*null*"); + } + + [Fact] + public void Two_floats_that_are_NaN_can_be_compared() + { + // Arrange + float value = float.NaN; + + // Act / Assert + value.Should().BeOneOf(float.NaN, 4.5F); + } + + [Fact] + public void Floats_are_never_equal_to_NaN() + { + // Arrange + float value = float.NaN; + + // Act + Action act = () => value.Should().BeOneOf(1.5F, 4.5F); + + // Assert + act + .Should().Throw() + .WithMessage("Expected*1.5F*found*NaN*"); + } + + [Fact] + public void Two_doubles_that_are_NaN_can_be_compared() + { + // Arrange + double value = double.NaN; + + // Act / Assert + value.Should().BeOneOf(double.NaN, 4.5F); + } + + [Fact] + public void Doubles_are_never_equal_to_NaN() + { + // Arrange + double value = double.NaN; + + // Act + Action act = () => value.Should().BeOneOf(1.5D, 4.5D); + + // Assert + act + .Should().Throw() + .WithMessage("Expected*1.5*found NaN*"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BePositive.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BePositive.cs new file mode 100644 index 0000000000..e2610e445d --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BePositive.cs @@ -0,0 +1,106 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NumericAssertionSpecs +{ + public class BePositive + { + [Fact] + public void When_a_positive_value_is_positive_it_should_not_throw() + { + // Arrange + float value = 1F; + + // Act + Action act = () => value.Should().BePositive(); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_negative_value_is_positive_it_should_throw() + { + // Arrange + double value = -1D; + + // Act + Action act = () => value.Should().BePositive(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_a_zero_value_is_positive_it_should_throw() + { + // Arrange + int value = 0; + + // Act + Action act = () => value.Should().BePositive(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void NaN_is_never_a_positive_float() + { + // Arrange + float value = float.NaN; + + // Act + Action act = () => value.Should().BePositive(); + + // Assert + act.Should().Throw().WithMessage("*but found NaN*"); + } + + [Fact] + public void NaN_is_never_a_positive_double() + { + // Arrange + double value = double.NaN; + + // Act + Action act = () => value.Should().BePositive(); + + // Assert + act.Should().Throw().WithMessage("*but found NaN*"); + } + + [Fact] + public void When_a_negative_value_is_positive_it_should_throw_with_descriptive_message() + { + // Arrange + int value = -1; + + // Act + Action act = () => value.Should().BePositive("because we want to test the failure {0}", "message"); + + // Assert + act + .Should().Throw() + .WithMessage("Expected value to be positive because we want to test the failure message, but found -1."); + } + + [Fact] + public void When_a_nullable_numeric_null_value_is_not_positive_it_should_throw() + { + // Arrange + int? value = null; + + // Act + Action act = () => value.Should().BePositive(); + + // Assert + act + .Should().Throw() + .WithMessage("*null*"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.Match.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.Match.cs new file mode 100644 index 0000000000..6504165682 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.Match.cs @@ -0,0 +1,49 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NumericAssertionSpecs +{ + public class Match + { + [Fact] + public void When_value_satisfies_predicate_it_should_not_throw() + { + // Arrange + int value = 1; + + // Act / Assert + value.Should().Match(o => o > 0); + } + + [Fact] + public void When_value_does_not_match_the_predicate_it_should_throw() + { + // Arrange + int value = 1; + + // Act + Action act = () => value.Should().Match(o => o == 0, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage("Expected value to match (o == 0) because we want to test the failure message, but found 1."); + } + + [Fact] + public void When_value_is_matched_against_a_null_it_should_throw() + { + // Arrange + int value = 1; + + // Act + Action act = () => value.Should().Match(null); + + // Assert + act.Should().ThrowExactly() + .WithParameterName("predicate"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.cs index 84d4f7c71e..332cbddb6a 100644 --- a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.cs @@ -1,3977 +1,10 @@ using System; using Xunit; -using Xunit.Sdk; namespace FluentAssertions.Specs.Numeric; -public class NumericAssertionSpecs +public partial class NumericAssertionSpecs { - public class BePositiveOrNegative - { - [Fact] - public void When_a_positive_value_is_positive_it_should_not_throw() - { - // Arrange - float value = 1F; - - // Act - Action act = () => value.Should().BePositive(); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_negative_value_is_positive_it_should_throw() - { - // Arrange - double value = -1D; - - // Act - Action act = () => value.Should().BePositive(); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_zero_value_is_positive_it_should_throw() - { - // Arrange - int value = 0; - - // Act - Action act = () => value.Should().BePositive(); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void NaN_is_never_a_positive_float() - { - // Arrange - float value = float.NaN; - - // Act - Action act = () => value.Should().BePositive(); - - // Assert - act.Should().Throw().WithMessage("*but found NaN*"); - } - - [Fact] - public void NaN_is_never_a_positive_double() - { - // Arrange - double value = double.NaN; - - // Act - Action act = () => value.Should().BePositive(); - - // Assert - act.Should().Throw().WithMessage("*but found NaN*"); - } - - [Fact] - public void When_a_negative_value_is_positive_it_should_throw_with_descriptive_message() - { - // Arrange - int value = -1; - - // Act - Action act = () => value.Should().BePositive("because we want to test the failure {0}", "message"); - - // Assert - act - .Should().Throw() - .WithMessage("Expected value to be positive because we want to test the failure message, but found -1."); - } - - [Fact] - public void When_a_nullable_numeric_null_value_is_not_positive_it_should_throw() - { - // Arrange - int? value = null; - - // Act - Action act = () => value.Should().BePositive(); - - // Assert - act - .Should().Throw() - .WithMessage("*null*"); - } - - [Fact] - public void When_a_negative_value_is_negative_it_should_not_throw() - { - // Arrange - int value = -1; - - // Act - Action act = () => value.Should().BeNegative(); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_positive_value_is_negative_it_should_throw() - { - // Arrange - int value = 1; - - // Act - Action act = () => value.Should().BeNegative(); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_zero_value_is_negative_it_should_throw() - { - // Arrange - int value = 0; - - // Act - Action act = () => value.Should().BeNegative(); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_positive_value_is_negative_it_should_throw_with_descriptive_message() - { - // Arrange - int value = 1; - - // Act - Action act = () => value.Should().BeNegative("because we want to test the failure {0}", "message"); - - // Assert - act - .Should().Throw() - .WithMessage("Expected value to be negative because we want to test the failure message, but found 1."); - } - - [Fact] - public void When_a_nullable_numeric_null_value_is_not_negative_it_should_throw() - { - // Arrange - int? value = null; - - // Act - Action act = () => value.Should().BeNegative(); - - // Assert - act - .Should().Throw() - .WithMessage("*null*"); - } - - [Fact] - public void NaN_is_never_a_negative_float() - { - // Arrange - float value = float.NaN; - - // Act - Action act = () => value.Should().BeNegative(); - - // Assert - act.Should().Throw().WithMessage("*but found NaN*"); - } - - [Fact] - public void NaN_is_never_a_negative_double() - { - // Arrange - double value = double.NaN; - - // Act - Action act = () => value.Should().BeNegative(); - - // Assert - act.Should().Throw().WithMessage("*but found NaN*"); - } - } - - public class Be - { - [Fact] - public void A_value_is_equal_to_the_same_value() - { - // Arrange - int value = 1; - int sameValue = 1; - - // Act - value.Should().Be(sameValue); - } - - [Fact] - public void A_value_is_not_equal_to_another_value() - { - // Arrange - int value = 1; - int differentValue = 2; - - // Act - Action act = () => value.Should().Be(differentValue, "because we want to test the failure {0}", "message"); - - // Assert - act - .Should().Throw() - .WithMessage("Expected value to be 2 because we want to test the failure message, but found 1."); - } - - [Fact] - public void A_value_is_equal_to_the_same_nullable_value() - { - // Arrange - int value = 2; - int? nullableValue = 2; - - // Act - value.Should().Be(nullableValue); - } - - [Fact] - public void A_value_is_not_equal_to_null() - { - // Arrange - int value = 2; - int? nullableValue = null; - - // Act - Action act = () => value.Should().Be(nullableValue); - - // Assert - act - .Should().Throw() - .WithMessage("Expected*, but found 2."); - } - - [Fact] - public void Null_is_not_equal_to_another_nullable_value() - { - // Arrange - int? value = 2; - - // Act - Action action = () => ((int?)null).Should().Be(value); - - // Assert - action - .Should().Throw() - .WithMessage("Expected*2, but found ."); - } - - [InlineData(1, 2)] - [InlineData(null, 2)] - [Theory] - public void A_nullable_value_is_not_equal_to_another_value(int? subject, int unexpected) - { - // Act - subject.Should().NotBe(unexpected); - } - - [Fact] - public void A_value_is_not_different_from_the_same_value() - { - // Arrange - int value = 1; - int sameValue = 1; - - // Act - Action act = () => value.Should().NotBe(sameValue, "because we want to test the failure {0}", "message"); - - // Assert - act - .Should().Throw() - .WithMessage("Did not expect value to be 1 because we want to test the failure message."); - } - - [InlineData(null, null)] - [InlineData(0, 0)] - [Theory] - public void A_nullable_value_is_not_different_from_the_same_value(int? subject, int? unexpected) - { - // Act - Action act = () => subject.Should().NotBe(unexpected); - - // Assert - act.Should().Throw(); - } - - [InlineData(0, 1)] - [InlineData(0, null)] - [InlineData(null, 0)] - [Theory] - public void A_nullable_value_is_different_from_another_value(int? subject, int? unexpected) - { - // Act / Assert - subject.Should().NotBe(unexpected); - } - - [InlineData(0, 0)] - [InlineData(null, null)] - [Theory] - public void A_nullable_value_is_equal_to_the_same_nullable_value(int? subject, int? expected) - { - // Act / Assert - subject.Should().Be(expected); - } - - [InlineData(0, 1)] - [InlineData(0, null)] - [InlineData(null, 0)] - [Theory] - public void A_nullable_value_is_not_equal_to_another_nullable_value(int? subject, int? expected) - { - // Act - Action act = () => subject.Should().Be(expected); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void Null_is_not_equal_to_another_value() - { - // Arrange - int? subject = null; - int expected = 1; - - // Act - Action act = () => subject.Should().Be(expected); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_asserting_that_a_float_value_is_equal_to_a_different_value_it_should_throw() - { - // Arrange - float value = 3.5F; - - // Act - Action act = () => value.Should().Be(3.4F, "we want to test the error message"); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to be *3.4* because we want to test the error message, but found *3.5*"); - } - - [Fact] - public void When_asserting_that_a_float_value_is_equal_to_the_same_value_it_should_not_throw() - { - // Arrange - float value = 3.5F; - - // Act - Action act = () => value.Should().Be(3.5F); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_that_a_null_float_value_is_equal_to_some_value_it_should_throw() - { - // Arrange - float? value = null; - - // Act - Action act = () => value.Should().Be(3.5F); - - // Assert - act - .Should().Throw() - .WithMessage("Expected value to be *3.5* but found ."); - } - - [Fact] - public void When_asserting_that_a_double_value_is_equal_to_a_different_value_it_should_throw() - { - // Arrange - double value = 3.5; - - // Act - Action act = () => value.Should().Be(3.4, "we want to test the error message"); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to be 3.4 because we want to test the error message, but found 3.5*."); - } - - [Fact] - public void When_asserting_that_a_double_value_is_equal_to_the_same_value_it_should_not_throw() - { - // Arrange - double value = 3.5; - - // Act - Action act = () => value.Should().Be(3.5); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_that_a_null_double_value_is_equal_to_some_value_it_should_throw() - { - // Arrange - double? value = null; - - // Act - Action act = () => value.Should().Be(3.5); - - // Assert - act - .Should().Throw() - .WithMessage("Expected value to be 3.5, but found ."); - } - - [Fact] - public void When_asserting_that_a_decimal_value_is_equal_to_a_different_value_it_should_throw() - { - // Arrange - decimal value = 3.5m; - - // Act - Action act = () => value.Should().Be(3.4m, "we want to test the error message"); - - // Assert - act.Should().Throw() - .WithMessage( - "Expected value to be*3.4* because we want to test the error message, but found*3.5*"); - } - - [Fact] - public void When_asserting_that_a_decimal_value_is_equal_to_the_same_value_it_should_not_throw() - { - // Arrange - decimal value = 3.5m; - - // Act - Action act = () => value.Should().Be(3.5m); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_that_a_null_decimal_value_is_equal_to_some_value_it_should_throw() - { - // Arrange - decimal? value = null; - decimal someValue = 3.5m; - - // Act - Action act = () => value.Should().Be(someValue); - - // Assert - act - .Should().Throw() - .WithMessage("Expected value to be*3.5*, but found ."); - } - - [Fact] - public void Nan_is_never_equal_to_a_normal_float() - { - // Arrange - float value = float.NaN; - - // Act - Action act = () => value.Should().Be(3.4F); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to be *3.4F, but found NaN*"); - } - - [Fact] - public void NaN_can_be_compared_to_NaN_when_its_a_float() - { - // Arrange - float value = float.NaN; - - // Act - value.Should().Be(float.NaN); - } - - [Fact] - public void Nan_is_never_equal_to_a_normal_double() - { - // Arrange - double value = double.NaN; - - // Act - Action act = () => value.Should().Be(3.4D); - - // Assert - act - .Should().Throw() - .WithMessage("Expected value to be *3.4, but found NaN*"); - } - - [Fact] - public void NaN_can_be_compared_to_NaN_when_its_a_double() - { - // Arrange - double value = double.NaN; - - // Act - value.Should().Be(double.NaN); - } - } - - public class BeGreaterThanOrEqualTo - { - [Fact] - public void When_a_value_is_greater_than_smaller_value_it_should_not_throw() - { - // Arrange - int value = 2; - int smallerValue = 1; - - // Act - Action act = () => value.Should().BeGreaterThan(smallerValue); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_value_is_greater_than_greater_value_it_should_throw() - { - // Arrange - int value = 2; - int greaterValue = 3; - - // Act - Action act = () => value.Should().BeGreaterThan(greaterValue); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_value_is_greater_than_same_value_it_should_throw() - { - // Arrange - int value = 2; - int sameValue = 2; - - // Act - Action act = () => value.Should().BeGreaterThan(sameValue); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_value_is_greater_than_greater_value_it_should_throw_with_descriptive_message() - { - // Arrange - int value = 2; - int greaterValue = 3; - - // Act - Action act = () => - value.Should().BeGreaterThan(greaterValue, "because we want to test the failure {0}", "message"); - - // Assert - act - .Should().Throw() - .WithMessage("Expected value to be greater than 3 because we want to test the failure message, but found 2."); - } - - [Fact] - public void NaN_is_never_greater_than_another_float() - { - // Act - Action act = () => float.NaN.Should().BeGreaterThan(0); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void A_float_cannot_be_greater_than_NaN() - { - // Act - Action act = () => 3.4F.Should().BeGreaterThan(float.NaN); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void NaN_is_never_greater_than_another_double() - { - // Act - Action act = () => double.NaN.Should().BeGreaterThan(0); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void A_double_can_never_be_greater_than_NaN() - { - // Act - Action act = () => 3.4D.Should().BeGreaterThan(double.NaN); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void When_a_value_is_greater_than_or_equal_to_smaller_value_it_should_not_throw() - { - // Arrange - int value = 2; - int smallerValue = 1; - - // Act - Action act = () => value.Should().BeGreaterThanOrEqualTo(smallerValue); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_value_is_greater_than_or_equal_to_same_value_it_should_not_throw() - { - // Arrange - int value = 2; - int sameValue = 2; - - // Act - Action act = () => value.Should().BeGreaterThanOrEqualTo(sameValue); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_value_is_greater_than_or_equal_to_greater_value_it_should_throw() - { - // Arrange - int value = 2; - int greaterValue = 3; - - // Act - Action act = () => value.Should().BeGreaterThanOrEqualTo(greaterValue); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_value_is_greater_than_or_equal_to_greater_value_it_should_throw_with_descriptive_message() - { - // Arrange - int value = 2; - int greaterValue = 3; - - // Act - Action act = - () => value.Should() - .BeGreaterThanOrEqualTo(greaterValue, "because we want to test the failure {0}", "message"); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to be greater than or equal to 3 because we want to test the failure message, but found 2."); - } - - [Fact] - public void When_a_nullable_numeric_null_value_is_not_greater_than_it_should_throw() - { - // Arrange - int? value = null; - - // Act - Action act = () => value.Should().BeGreaterThan(0); - - // Assert - act - .Should().Throw() - .WithMessage("*null*"); - } - - [Fact] - public void When_a_nullable_numeric_null_value_is_not_greater_than_or_equal_to_it_should_throw() - { - // Arrange - int? value = null; - - // Act - Action act = () => value.Should().BeGreaterThanOrEqualTo(0); - - // Assert - act - .Should().Throw() - .WithMessage("*null*"); - } - - [Fact] - public void NaN_is_never_greater_than_or_equal_to_another_float() - { - // Act - Action act = () => float.NaN.Should().BeGreaterThanOrEqualTo(0); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void A_float_cannot_be_greater_than_or_equal_to_NaN() - { - // Act - Action act = () => 3.4F.Should().BeGreaterThanOrEqualTo(float.NaN); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void NaN_is_never_greater_or_equal_to_another_double() - { - // Act - Action act = () => double.NaN.Should().BeGreaterThanOrEqualTo(0); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void A_double_can_never_be_greater_or_equal_to_NaN() - { - // Act - Action act = () => 3.4D.Should().BeGreaterThanOrEqualTo(double.NaN); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void Chaining_after_one_assertion() - { - // Arrange - int value = 2; - int smallerValue = 1; - - // Act / Assert - value.Should().BeGreaterThanOrEqualTo(smallerValue).And.Be(2); - } - } - - public class LessThanOrEqualTo - { - [Fact] - public void When_a_value_is_less_than_greater_value_it_should_not_throw() - { - // Arrange - int value = 1; - int greaterValue = 2; - - // Act - Action act = () => value.Should().BeLessThan(greaterValue); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_value_is_less_than_smaller_value_it_should_throw() - { - // Arrange - int value = 2; - int smallerValue = 1; - - // Act - Action act = () => value.Should().BeLessThan(smallerValue); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_value_is_less_than_same_value_it_should_throw() - { - // Arrange - int value = 2; - int sameValue = 2; - - // Act - Action act = () => value.Should().BeLessThan(sameValue); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_value_is_less_than_smaller_value_it_should_throw_with_descriptive_message() - { - // Arrange - int value = 2; - int smallerValue = 1; - - // Act - Action act = () => value.Should().BeLessThan(smallerValue, "because we want to test the failure {0}", "message"); - - // Assert - act - .Should().Throw() - .WithMessage("Expected value to be less than 1 because we want to test the failure message, but found 2."); - } - - [Fact] - public void NaN_is_never_less_than_another_float() - { - // Act - Action act = () => float.NaN.Should().BeLessThan(0); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void A_float_can_never_be_less_than_NaN() - { - // Act - Action act = () => 3.4F.Should().BeLessThan(float.NaN); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void NaN_is_never_less_than_another_double() - { - // Act - Action act = () => double.NaN.Should().BeLessThan(0); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void A_double_can_never_be_less_than_NaN() - { - // Act - Action act = () => 3.4D.Should().BeLessThan(double.NaN); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void When_a_value_is_less_than_or_equal_to_greater_value_it_should_not_throw() - { - // Arrange - int value = 1; - int greaterValue = 2; - - // Act - Action act = () => value.Should().BeLessThanOrEqualTo(greaterValue); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_value_is_less_than_or_equal_to_same_value_it_should_not_throw() - { - // Arrange - int value = 2; - int sameValue = 2; - - // Act - Action act = () => value.Should().BeLessThanOrEqualTo(sameValue); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_value_is_less_than_or_equal_to_smaller_value_it_should_throw() - { - // Arrange - int value = 2; - int smallerValue = 1; - - // Act - Action act = () => value.Should().BeLessThanOrEqualTo(smallerValue); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_value_is_less_than_or_equal_to_smaller_value_it_should_throw_with_descriptive_message() - { - // Arrange - int value = 2; - int smallerValue = 1; - - // Act - Action act = () => - value.Should().BeLessThanOrEqualTo(smallerValue, "because we want to test the failure {0}", "message"); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to be less than or equal to 1 because we want to test the failure message, but found 2."); - } - - [Fact] - public void When_a_nullable_numeric_null_value_is_not_less_than_it_should_throw() - { - // Arrange - int? value = null; - - // Act - Action act = () => value.Should().BeLessThan(0); - - // Assert - act - .Should().Throw() - .WithMessage("*null*"); - } - - [Fact] - public void When_a_nullable_numeric_null_value_is_not_less_than_or_equal_to_it_should_throw() - { - // Arrange - int? value = null; - - // Act - Action act = () => value.Should().BeLessThanOrEqualTo(0); - - // Assert - act - .Should().Throw() - .WithMessage("*null*"); - } - - [Fact] - public void NaN_is_never_less_than_or_equal_to_another_float() - { - // Act - Action act = () => float.NaN.Should().BeLessThanOrEqualTo(0); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void A_float_can_never_be_less_than_or_equal_to_NaN() - { - // Act - Action act = () => 3.4F.Should().BeLessThanOrEqualTo(float.NaN); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void NaN_is_never_less_than_or_equal_to_another_double() - { - // Act - Action act = () => double.NaN.Should().BeLessThanOrEqualTo(0); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void A_double_can_never_be_less_than_or_equal_to_NaN() - { - // Act - Action act = () => 3.4D.Should().BeLessThanOrEqualTo(double.NaN); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void Chaining_after_one_assertion() - { - // Arrange - int value = 1; - int greaterValue = 2; - - // Act / Assert - value.Should().BeLessThanOrEqualTo(greaterValue).And.Be(1); - } - } - - public class InRange - { - [Fact] - public void When_a_value_is_outside_a_range_it_should_throw() - { - // Arrange - float value = 3.99F; - - // Act - Action act = () => value.Should().BeInRange(4, 5, "because that's the valid range"); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to be between*4* and*5* because that\'s the valid range, but found*3.99*"); - } - - [Fact] - public void When_a_value_is_inside_a_range_it_should_not_throw() - { - // Arrange - int value = 4; - - // Act - Action act = () => value.Should().BeInRange(3, 5); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_nullable_numeric_null_value_is_not_in_range_it_should_throw() - { - // Arrange - int? value = null; - - // Act - Action act = () => value.Should().BeInRange(0, 1); - - // Assert - act - .Should().Throw() - .WithMessage("*null*"); - } - - [Fact] - public void NaN_is_never_in_range_of_two_floats() - { - // Arrange - float value = float.NaN; - - // Act - Action act = () => value.Should().BeInRange(4, 5); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to be between*4* and*5*, but found*NaN*"); - } - - [Theory] - [InlineData(float.NaN, 5F)] - [InlineData(5F, float.NaN)] - public void A_float_can_never_be_in_a_range_containing_NaN(float minimumValue, float maximumValue) - { - // Arrange - float value = 4.5F; - - // Act - Action act = () => value.Should().BeInRange(minimumValue, maximumValue); - - // Assert - act - .Should().Throw() - .WithMessage( - "*NaN*"); - } - - [Fact] - public void A_NaN_is_never_in_range_of_two_doubles() - { - // Arrange - double value = double.NaN; - - // Act - Action act = () => value.Should().BeInRange(4, 5); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to be between*4* and*5*, but found*NaN*"); - } - - [Theory] - [InlineData(double.NaN, 5)] - [InlineData(5, double.NaN)] - public void A_double_can_never_be_in_a_range_containing_NaN(double minimumValue, double maximumValue) - { - // Arrange - double value = 4.5D; - - // Act - Action act = () => value.Should().BeInRange(minimumValue, maximumValue); - - // Assert - act - .Should().Throw() - .WithMessage( - "*NaN*"); - } - } - - public class NotInRange - { - [Fact] - public void When_a_value_is_inside_an_unexpected_range_it_should_throw() - { - // Arrange - float value = 4.99F; - - // Act - Action act = () => value.Should().NotBeInRange(4, 5, "because that's the invalid range"); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to not be between*4* and*5* because that\'s the invalid range, but found*4.99*"); - } - - [Fact] - public void When_a_value_is_outside_an_unexpected_range_it_should_not_throw() - { - // Arrange - float value = 3.99F; - - // Act - Action act = () => value.Should().NotBeInRange(4, 5); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_nullable_numeric_null_value_is_not_not_in_range_to_it_should_throw() - { - // Arrange - int? value = null; - - // Act - Action act = () => value.Should().NotBeInRange(0, 1); - - // Assert - act - .Should().Throw() - .WithMessage("*null*"); - } - - [Fact] - public void NaN_is_never_inside_any_range_of_floats() - { - // Arrange - float value = float.NaN; - - // Act / Assert - value.Should().NotBeInRange(4, 5); - } - - [Theory] - [InlineData(float.NaN, 1F)] - [InlineData(1F, float.NaN)] - public void Cannot_use_NaN_in_a_range_of_floats(float minimumValue, float maximumValue) - { - // Arrange - float value = 4.5F; - - // Act - Action act = () => value.Should().NotBeInRange(minimumValue, maximumValue); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - - [Fact] - public void NaN_is_never_inside_any_range_of_doubles() - { - // Arrange - double value = double.NaN; - - // Act / Assert - value.Should().NotBeInRange(4, 5); - } - - [Theory] - [InlineData(double.NaN, 1D)] - [InlineData(1D, double.NaN)] - public void Cannot_use_NaN_in_a_range_of_doubles(double minimumValue, double maximumValue) - { - // Arrange - double value = 4.5D; - - // Act - Action act = () => value.Should().NotBeInRange(minimumValue, maximumValue); - - // Assert - act - .Should().Throw() - .WithMessage("*NaN*"); - } - } - - public class BeOneOf - { - [Fact] - public void When_a_value_is_not_one_of_the_specified_values_it_should_throw() - { - // Arrange - int value = 3; - - // Act - Action act = () => value.Should().BeOneOf(4, 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 - int value = 3; - - // Act - Action act = () => value.Should().BeOneOf(new[] { 4, 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_one_of_the_specified_values_it_should_succeed() - { - // Arrange - int value = 4; - - // Act - Action act = () => value.Should().BeOneOf(4, 5); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_nullable_numeric_null_value_is_not_one_of_to_it_should_throw() - { - // Arrange - int? value = null; - - // Act - Action act = () => value.Should().BeOneOf(0, 1); - - // Assert - act - .Should().Throw() - .WithMessage("*null*"); - } - - [Fact] - public void Two_floats_that_are_NaN_can_be_compared() - { - // Arrange - float value = float.NaN; - - // Act / Assert - value.Should().BeOneOf(float.NaN, 4.5F); - } - - [Fact] - public void Floats_are_never_equal_to_NaN() - { - // Arrange - float value = float.NaN; - - // Act - Action act = () => value.Should().BeOneOf(1.5F, 4.5F); - - // Assert - act - .Should().Throw() - .WithMessage("Expected*1.5F*found*NaN*"); - } - - [Fact] - public void Two_doubles_that_are_NaN_can_be_compared() - { - // Arrange - double value = double.NaN; - - // Act / Assert - value.Should().BeOneOf(double.NaN, 4.5F); - } - - [Fact] - public void Doubles_are_never_equal_to_NaN() - { - // Arrange - double value = double.NaN; - - // Act - Action act = () => value.Should().BeOneOf(1.5D, 4.5D); - - // Assert - act - .Should().Throw() - .WithMessage("Expected*1.5*found NaN*"); - } - } - - public class Bytes - { - [Fact] - public void When_asserting_a_byte_value_it_should_treat_is_any_numeric_value() - { - // Arrange - byte value = 2; - - // Act - Action act = () => value.Should().Be(2); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_a_sbyte_value_it_should_treat_is_any_numeric_value() - { - // Arrange - sbyte value = 2; - - // Act - Action act = () => value.Should().Be(2); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_a_short_value_it_should_treat_is_any_numeric_value() - { - // Arrange - short value = 2; - - // Act - Action act = () => value.Should().Be(2); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_an_ushort_value_it_should_treat_is_any_numeric_value() - { - // Arrange - ushort value = 2; - - // Act - Action act = () => value.Should().Be(2); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_an_uint_value_it_should_treat_is_any_numeric_value() - { - // Arrange - uint value = 2; - - // Act - Action act = () => value.Should().Be(2); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_a_long_value_it_should_treat_is_any_numeric_value() - { - // Arrange - long value = 2; - - // Act - Action act = () => value.Should().Be(2); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_an_ulong_value_it_should_treat_is_any_numeric_value() - { - // Arrange - ulong value = 2; - - // Act - Action act = () => value.Should().Be(2); - - // Assert - act.Should().NotThrow(); - } - } - - public class NullableBytes - { - [Fact] - public void When_asserting_a_nullable_byte_value_it_should_treat_is_any_numeric_value() - { - // Arrange - byte? value = 2; - - // Act - Action act = () => value.Should().Be(2); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_a_nullable_sbyte_value_it_should_treat_is_any_numeric_value() - { - // Arrange - sbyte? value = 2; - - // Act - Action act = () => value.Should().Be(2); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_a_nullable_short_value_it_should_treat_is_any_numeric_value() - { - // Arrange - short? value = 2; - - // Act - Action act = () => value.Should().Be(2); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_a_nullable_ushort_value_it_should_treat_is_any_numeric_value() - { - // Arrange - ushort? value = 2; - - // Act - Action act = () => value.Should().Be(2); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_a_nullable_uint_value_it_should_treat_is_any_numeric_value() - { - // Arrange - uint? value = 2; - - // Act - Action act = () => value.Should().Be(2); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_a_nullable_long_value_it_should_treat_is_any_numeric_value() - { - // Arrange - long? value = 2; - - // Act - Action act = () => value.Should().Be(2); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_asserting_a_nullable_nullable_ulong_value_it_should_treat_is_any_numeric_value() - { - // Arrange - ulong? value = 2; - - // Act - Action act = () => value.Should().Be(2); - - // Assert - act.Should().NotThrow(); - } - } - - public class BeApproximately - { - [Fact] - public void When_approximating_a_float_with_a_negative_precision_it_should_throw() - { - // Arrange - float value = 3.1415927F; - - // Act - Action act = () => value.Should().BeApproximately(3.14F, -0.1F); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_float_is_not_approximating_a_range_it_should_throw() - { - // Arrange - float value = 3.1415927F; - - // Act - Action act = () => value.Should().BeApproximately(3.14F, 0.001F, "rockets will crash otherwise"); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to approximate *3.14* +/- *0.001* because rockets will crash otherwise, but *3.1415927* differed by *0.001592*"); - } - - [Fact] - public void When_float_is_indeed_approximating_a_value_it_should_not_throw() - { - // Arrange - float value = 3.1415927F; - - // Act - Action act = () => value.Should().BeApproximately(3.14F, 0.1F); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(9F)] - [InlineData(11F)] - [Theory] - public void When_float_is_approximating_a_value_on_boundaries_it_should_not_throw(float value) - { - // Act - Action act = () => value.Should().BeApproximately(10F, 1F); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(9F)] - [InlineData(11F)] - [Theory] - public void When_float_is_not_approximating_a_value_on_boundaries_it_should_throw(float value) - { - // Act - Action act = () => value.Should().BeApproximately(10F, 0.9F); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_approximating_a_float_towards_nan_it_should_not_throw() - { - // Arrange - float value = float.NaN; - - // Act - Action act = () => value.Should().BeApproximately(3.14F, 0.1F); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_approximating_positive_infinity_float_towards_positive_infinity_it_should_not_throw() - { - // Arrange - float value = float.PositiveInfinity; - - // Act - Action act = () => value.Should().BeApproximately(float.PositiveInfinity, 0.1F); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_approximating_negative_infinity_float_towards_negative_infinity_it_should_not_throw() - { - // Arrange - float value = float.NegativeInfinity; - - // Act - Action act = () => value.Should().BeApproximately(float.NegativeInfinity, 0.1F); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_float_is_not_approximating_positive_infinity_it_should_throw() - { - // Arrange - float value = float.PositiveInfinity; - - // Act - Action act = () => value.Should().BeApproximately(float.MaxValue, 0.1F); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_float_is_not_approximating_negative_infinity_it_should_throw() - { - // Arrange - float value = float.NegativeInfinity; - - // Act - Action act = () => value.Should().BeApproximately(float.MinValue, 0.1F); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void NaN_can_never_be_close_to_any_float() - { - // Arrange - float value = float.NaN; - - // Act - Action act = () => value.Should().BeApproximately(float.MinValue, 0.1F); - - // Assert - act.Should().Throw().WithMessage("*NaN*"); - } - - [Fact] - public void A_float_can_never_be_close_to_NaN() - { - // Arrange - float value = float.MinValue; - - // Act - Action act = () => value.Should().BeApproximately(float.NaN, 0.1F); - - // Assert - act.Should().Throw().WithMessage("*NaN*"); - } - - [Fact] - public void When_a_nullable_float_has_no_value_it_should_throw() - { - // Arrange - float? value = null; - - // Act - Action act = () => value.Should().BeApproximately(3.14F, 0.001F); - - // Assert - act - .Should().Throw() - .WithMessage("Expected value to approximate*3.14* +/-*0.001*, but it was ."); - } - - [Fact] - public void When_approximating_a_double_with_a_negative_precision_it_should_throw() - { - // Arrange - double value = 3.1415927; - - // Act - Action act = () => value.Should().BeApproximately(3.14, -0.1); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_double_is_not_approximating_a_range_it_should_throw() - { - // Arrange - double value = 3.1415927; - - // Act - Action act = () => value.Should().BeApproximately(3.14, 0.001, "rockets will crash otherwise"); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to approximate 3.14 +/- 0.001 because rockets will crash otherwise, but 3.1415927 differed by 0.001592*"); - } - - [Fact] - public void When_double_is_indeed_approximating_a_value_it_should_not_throw() - { - // Arrange - double value = 3.1415927; - - // Act - Action act = () => value.Should().BeApproximately(3.14, 0.1); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_approximating_a_double_towards_nan_it_should_not_throw() - { - // Arrange - double value = double.NaN; - - // Act - Action act = () => value.Should().BeApproximately(3.14F, 0.1F); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_approximating_positive_infinity_double_towards_positive_infinity_it_should_not_throw() - { - // Arrange - double value = double.PositiveInfinity; - - // Act - Action act = () => value.Should().BeApproximately(double.PositiveInfinity, 0.1); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_approximating_negative_infinity_double_towards_negative_infinity_it_should_not_throw() - { - // Arrange - double value = double.NegativeInfinity; - - // Act - Action act = () => value.Should().BeApproximately(double.NegativeInfinity, 0.1); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_double_is_not_approximating_positive_infinity_it_should_throw() - { - // Arrange - double value = double.PositiveInfinity; - - // Act - Action act = () => value.Should().BeApproximately(double.MaxValue, 0.1); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_double_is_not_approximating_negative_infinity_it_should_throw() - { - // Arrange - double value = double.NegativeInfinity; - - // Act - Action act = () => value.Should().BeApproximately(double.MinValue, 0.1); - - // Assert - act.Should().Throw(); - } - - [InlineData(9D)] - [InlineData(11D)] - [Theory] - public void When_double_is_approximating_a_value_on_boundaries_it_should_not_throw(double value) - { - // Act - Action act = () => value.Should().BeApproximately(10D, 1D); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(9D)] - [InlineData(11D)] - [Theory] - public void When_double_is_not_approximating_a_value_on_boundaries_it_should_throw(double value) - { - // Act - Action act = () => value.Should().BeApproximately(10D, 0.9D); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void NaN_can_never_be_close_to_any_double() - { - // Arrange - double value = double.NaN; - - // Act - Action act = () => value.Should().BeApproximately(double.MinValue, 0.1F); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void A_double_can_never_be_close_to_NaN() - { - // Arrange - double value = double.MinValue; - - // Act - Action act = () => value.Should().BeApproximately(double.NaN, 0.1F); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_approximating_a_decimal_with_a_negative_precision_it_should_throw() - { - // Arrange - decimal value = 3.1415927M; - - // Act - Action act = () => value.Should().BeApproximately(3.14m, -0.1m); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_decimal_is_not_approximating_a_range_it_should_throw() - { - // Arrange - decimal value = 3.5011m; - - // Act - Action act = () => value.Should().BeApproximately(3.5m, 0.001m, "rockets will crash otherwise"); - - // Assert - act.Should().Throw().WithMessage( - "Expected value to approximate*3.5* +/-*0.001* because rockets will crash otherwise, but *3.5011* differed by*0.0011*"); - } - - [Fact] - public void When_decimal_is_indeed_approximating_a_value_it_should_not_throw() - { - // Arrange - decimal value = 3.5011m; - - // Act - Action act = () => value.Should().BeApproximately(3.5m, 0.01m); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_decimal_is_approximating_a_value_on_lower_boundary_it_should_not_throw() - { - // Act - decimal value = 9m; - - // Act - Action act = () => value.Should().BeApproximately(10m, 1m); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_decimal_is_approximating_a_value_on_upper_boundary_it_should_not_throw() - { - // Act - decimal value = 11m; - - // Act - Action act = () => value.Should().BeApproximately(10m, 1m); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_decimal_is_not_approximating_a_value_on_lower_boundary_it_should_throw() - { - // Act - decimal value = 9m; - - // Act - Action act = () => value.Should().BeApproximately(10m, 0.9m); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_decimal_is_not_approximating_a_value_on_upper_boundary_it_should_throw() - { - // Act - decimal value = 11m; - - // Act - Action act = () => value.Should().BeApproximately(10m, 0.9m); - - // Assert - act.Should().Throw(); - } - } - - public class NotBeApproximately - { - [Fact] - public void When_not_approximating_a_float_with_a_negative_precision_it_should_throw() - { - // Arrange - float value = 3.1415927F; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14F, -0.1F); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_float_is_approximating_a_range_and_should_not_approximate_it_should_throw() - { - // Arrange - float value = 3.1415927F; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14F, 0.1F, "rockets will crash otherwise"); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to not approximate *3.14* +/- *0.1* because rockets will crash otherwise, but *3.1415927* only differed by *0.001592*"); - } - - [Fact] - public void When_float_is_not_approximating_a_value_and_should_not_approximate_it_should_not_throw() - { - // Arrange - float value = 3.1415927F; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14F, 0.001F); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_approximating_a_float_towards_nan_and_should_not_approximate_it_should_throw() - { - // Arrange - float value = float.NaN; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14F, 0.1F); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_not_approximating_a_float_towards_positive_infinity_and_should_not_approximate_it_should_not_throw() - { - // Arrange - float value = float.PositiveInfinity; - - // Act - Action act = () => value.Should().NotBeApproximately(float.MaxValue, 0.1F); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_not_approximating_a_float_towards_negative_infinity_and_should_not_approximate_it_should_not_throw() - { - // Arrange - float value = float.NegativeInfinity; - - // Act - Action act = () => value.Should().NotBeApproximately(float.MinValue, 0.1F); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void - When_approximating_positive_infinity_float_towards_positive_infinity_and_should_not_approximate_it_should_throw() - { - // Arrange - float value = float.PositiveInfinity; - - // Act - Action act = () => value.Should().NotBeApproximately(float.PositiveInfinity, 0.1F); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void - When_not_approximating_negative_infinity_float_towards_negative_infinity_and_should_not_approximate_it_should_throw() - { - // Arrange - float value = float.NegativeInfinity; - - // Act - Action act = () => value.Should().NotBeApproximately(float.NegativeInfinity, 0.1F); - - // Assert - act.Should().Throw(); - } - - [InlineData(9F)] - [InlineData(11F)] - [Theory] - public void When_float_is_not_approximating_a_value_on_boundaries_it_should_not_throw(float value) - { - // Act - Action act = () => value.Should().NotBeApproximately(10F, 0.9F); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(9F)] - [InlineData(11F)] - [Theory] - public void When_float_is_approximating_a_value_on_boundaries_it_should_throw(float value) - { - // Act - Action act = () => value.Should().NotBeApproximately(10F, 1F); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_nullable_float_has_no_value_and_should_not_approximate_it_should_not_throw() - { - // Arrange - float? value = null; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14F, 0.001F); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void NaN_can_never_be_close_to_any_float() - { - // Arrange - float value = float.NaN; - - // Act - Action act = () => value.Should().NotBeApproximately(float.MinValue, 0.1F); - - // Assert - act.Should().Throw().WithMessage("*NaN*"); - } - - [Fact] - public void A_float_can_never_be_close_to_NaN() - { - // Arrange - float value = float.MinValue; - - // Act - Action act = () => value.Should().NotBeApproximately(float.NaN, 0.1F); - - // Assert - act.Should().Throw().WithMessage("*NaN*"); - } - - [Fact] - public void When_not_approximating_a_double_with_a_negative_precision_it_should_throw() - { - // Arrange - double value = 3.1415927; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14, -0.1); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_double_is_approximating_a_range_and_should_not_approximate_it_should_throw() - { - // Arrange - double value = 3.1415927; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14, 0.1, "rockets will crash otherwise"); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to not approximate *3.14* +/- *0.1* because rockets will crash otherwise, but *3.1415927* only differed by *0.001592*"); - } - - [Fact] - public void When_double_is_not_approximating_a_value_and_should_not_approximate_it_should_not_throw() - { - // Arrange - double value = 3.1415927; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14, 0.001); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_approximating_a_double_towards_nan_and_should_not_approximate_it_should_throw() - { - // Arrange - double value = double.NaN; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14, 0.1); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_not_approximating_a_double_towards_positive_infinity_and_should_not_approximate_it_should_not_throw() - { - // Arrange - double value = double.PositiveInfinity; - - // Act - Action act = () => value.Should().NotBeApproximately(double.MaxValue, 0.1); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_not_approximating_a_double_towards_negative_infinity_and_should_not_approximate_it_should_not_throw() - { - // Arrange - double value = double.NegativeInfinity; - - // Act - Action act = () => value.Should().NotBeApproximately(double.MinValue, 0.1); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void - When_approximating_positive_infinity_double_towards_positive_infinity_and_should_not_approximate_it_should_throw() - { - // Arrange - double value = double.PositiveInfinity; - - // Act - Action act = () => value.Should().NotBeApproximately(double.PositiveInfinity, 0.1); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void - When_not_approximating_negative_infinity_double_towards_negative_infinity_and_should_not_approximate_it_should_throw() - { - // Arrange - double value = double.NegativeInfinity; - - // Act - Action act = () => value.Should().NotBeApproximately(double.NegativeInfinity, 0.1); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_nullable_double_has_no_value_and_should_not_approximate_it_should_throw() - { - // Arrange - double? value = null; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14, 0.001); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(9D)] - [InlineData(11D)] - [Theory] - public void When_double_is_not_approximating_a_value_on_boundaries_it_should_not_throw(double value) - { - // Act - Action act = () => value.Should().NotBeApproximately(10D, 0.9D); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(9D)] - [InlineData(11D)] - [Theory] - public void When_double_is_approximating_a_value_on_boundaries_it_should_throw(double value) - { - // Act - Action act = () => value.Should().NotBeApproximately(10D, 1D); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void NaN_can_never_be_close_to_any_double() - { - // Arrange - double value = double.NaN; - - // Act - Action act = () => value.Should().NotBeApproximately(double.MinValue, 0.1F); - - // Assert - act.Should().Throw().WithMessage("*NaN*"); - } - - [Fact] - public void A_double_can_never_be_close_to_NaN() - { - // Arrange - double value = double.MinValue; - - // Act - Action act = () => value.Should().NotBeApproximately(double.NaN, 0.1F); - - // Assert - act.Should().Throw().WithMessage("*NaN*"); - } - - [Fact] - public void When_not_approximating_a_decimal_with_a_negative_precision_it_should_throw() - { - // Arrange - decimal value = 3.1415927m; - - // Act - Action act = () => value.Should().NotBeApproximately(3.14m, -0.1m); - - // Assert - act.Should().Throw() - .WithParameterName("precision") - .WithMessage("*must be non-negative*"); - } - - [Fact] - public void When_decimal_is_approximating_a_range_and_should_not_approximate_it_should_throw() - { - // Arrange - decimal value = 3.5011m; - - // Act - Action act = () => value.Should().NotBeApproximately(3.5m, 0.1m, "rockets will crash otherwise"); - - // Assert - act - .Should().Throw() - .WithMessage( - "Expected value to not approximate *3.5* +/- *0.1* because rockets will crash otherwise, but *3.5011* only differed by *0.0011*"); - } - - [Fact] - public void When_decimal_is_not_approximating_a_value_and_should_not_approximate_it_should_not_throw() - { - // Arrange - decimal value = 3.5011m; - - // Act - Action act = () => value.Should().NotBeApproximately(3.5m, 0.001m); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_nullable_decimal_has_no_value_and_should_not_approximate_it_should_throw() - { - // Arrange - decimal? value = null; - - // Act - Action act = () => value.Should().NotBeApproximately(3.5m, 0.001m); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_decimal_is_not_approximating_a_value_on_lower_boundary_it_should_not_throw() - { - // Act - decimal value = 9m; - - // Act - Action act = () => value.Should().NotBeApproximately(10m, 0.9m); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_decimal_is_not_approximating_a_value_on_upper_boundary_it_should_not_throw() - { - // Act - decimal value = 11m; - - // Act - Action act = () => value.Should().NotBeApproximately(10m, 0.9m); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_decimal_is_approximating_a_value_on_lower_boundary_it_should_throw() - { - // Act - decimal value = 9m; - - // Act - Action act = () => value.Should().NotBeApproximately(10m, 1m); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_decimal_is_approximating_a_value_on_upper_boundary_it_should_throw() - { - // Act - decimal value = 11m; - - // Act - Action act = () => value.Should().NotBeApproximately(10m, 1m); - - // Assert - act.Should().Throw(); - } - } - - public class CloseTo - { - [InlineData(sbyte.MinValue, sbyte.MinValue, 0)] - [InlineData(sbyte.MinValue, sbyte.MinValue, 1)] - [InlineData(sbyte.MinValue, sbyte.MinValue, sbyte.MaxValue)] - [InlineData(sbyte.MinValue, sbyte.MinValue + 1, 1)] - [InlineData(sbyte.MinValue, sbyte.MinValue + 1, sbyte.MaxValue)] - [InlineData(sbyte.MinValue, -1, sbyte.MaxValue)] - [InlineData(sbyte.MinValue + 1, sbyte.MinValue, 1)] - [InlineData(sbyte.MinValue + 1, sbyte.MinValue, sbyte.MaxValue)] - [InlineData(sbyte.MinValue + 1, 0, sbyte.MaxValue)] - [InlineData(-1, sbyte.MinValue, sbyte.MaxValue)] - [InlineData(-1, 0, 1)] - [InlineData(-1, 0, sbyte.MaxValue)] - [InlineData(0, 0, 0)] - [InlineData(0, 0, 1)] - [InlineData(0, -1, 1)] - [InlineData(0, -1, sbyte.MaxValue)] - [InlineData(0, 1, 1)] - [InlineData(0, 1, sbyte.MaxValue)] - [InlineData(0, sbyte.MaxValue, sbyte.MaxValue)] - [InlineData(0, sbyte.MinValue + 1, sbyte.MaxValue)] - [InlineData(1, 0, 1)] - [InlineData(1, 0, sbyte.MaxValue)] - [InlineData(1, sbyte.MaxValue, sbyte.MaxValue)] - [InlineData(sbyte.MaxValue - 1, sbyte.MaxValue, 1)] - [InlineData(sbyte.MaxValue - 1, sbyte.MaxValue, sbyte.MaxValue)] - [InlineData(sbyte.MaxValue, 0, sbyte.MaxValue)] - [InlineData(sbyte.MaxValue, 1, sbyte.MaxValue)] - [InlineData(sbyte.MaxValue, sbyte.MaxValue, 0)] - [InlineData(sbyte.MaxValue, sbyte.MaxValue, 1)] - [InlineData(sbyte.MaxValue, sbyte.MaxValue, sbyte.MaxValue)] - [InlineData(sbyte.MaxValue, sbyte.MaxValue - 1, 1)] - [InlineData(sbyte.MaxValue, sbyte.MaxValue - 1, sbyte.MaxValue)] - [Theory] - public void When_a_sbyte_value_is_close_to_expected_value_it_should_succeed(sbyte actual, sbyte nearbyValue, - byte delta) - { - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(sbyte.MinValue, sbyte.MaxValue, 1)] - [InlineData(sbyte.MinValue, 0, sbyte.MaxValue)] - [InlineData(sbyte.MinValue, 1, sbyte.MaxValue)] - [InlineData(-1, 0, 0)] - [InlineData(-1, 1, 1)] - [InlineData(-1, sbyte.MaxValue, sbyte.MaxValue)] - [InlineData(0, sbyte.MinValue, sbyte.MaxValue)] - [InlineData(0, -1, 0)] - [InlineData(0, 1, 0)] - [InlineData(1, -1, 1)] - [InlineData(1, 0, 0)] - [InlineData(1, sbyte.MinValue, sbyte.MaxValue)] - [InlineData(sbyte.MaxValue, sbyte.MinValue, 1)] - [InlineData(sbyte.MaxValue, -1, sbyte.MaxValue)] - [Theory] - public void When_a_sbyte_value_is_not_close_to_expected_value_it_should_fail(sbyte actual, sbyte nearbyValue, - byte delta) - { - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_sbyte_value_is_not_close_to_expected_value_it_should_fail_with_a_descriptive_message() - { - // Arrange - sbyte actual = 1; - sbyte nearbyValue = 4; - byte delta = 2; - - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw() - .WithMessage("*be within*2*from*4*but found*1*"); - } - - [Fact] - public void When_a_sbyte_value_is_returned_from_BeCloseTo_it_should_chain() - { - // Arrange - sbyte actual = sbyte.MaxValue; - - // Act - Action act = () => actual.Should().BeCloseTo(actual, 0) - .And.Be(actual); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(short.MinValue, short.MinValue, 0)] - [InlineData(short.MinValue, short.MinValue, 1)] - [InlineData(short.MinValue, short.MinValue, short.MaxValue)] - [InlineData(short.MinValue, short.MinValue + 1, 1)] - [InlineData(short.MinValue, short.MinValue + 1, short.MaxValue)] - [InlineData(short.MinValue, -1, short.MaxValue)] - [InlineData(short.MinValue + 1, short.MinValue, 1)] - [InlineData(short.MinValue + 1, short.MinValue, short.MaxValue)] - [InlineData(short.MinValue + 1, 0, short.MaxValue)] - [InlineData(-1, short.MinValue, short.MaxValue)] - [InlineData(-1, 0, 1)] - [InlineData(-1, 0, short.MaxValue)] - [InlineData(0, 0, 0)] - [InlineData(0, 0, 1)] - [InlineData(0, -1, 1)] - [InlineData(0, -1, short.MaxValue)] - [InlineData(0, 1, 1)] - [InlineData(0, 1, short.MaxValue)] - [InlineData(0, short.MaxValue, short.MaxValue)] - [InlineData(0, short.MinValue + 1, short.MaxValue)] - [InlineData(1, 0, 1)] - [InlineData(1, 0, short.MaxValue)] - [InlineData(1, short.MaxValue, short.MaxValue)] - [InlineData(short.MaxValue - 1, short.MaxValue, 1)] - [InlineData(short.MaxValue - 1, short.MaxValue, short.MaxValue)] - [InlineData(short.MaxValue, 0, short.MaxValue)] - [InlineData(short.MaxValue, 1, short.MaxValue)] - [InlineData(short.MaxValue, short.MaxValue, 0)] - [InlineData(short.MaxValue, short.MaxValue, 1)] - [InlineData(short.MaxValue, short.MaxValue, short.MaxValue)] - [InlineData(short.MaxValue, short.MaxValue - 1, 1)] - [InlineData(short.MaxValue, short.MaxValue - 1, short.MaxValue)] - [Theory] - public void When_a_short_value_is_close_to_expected_value_it_should_succeed(short actual, short nearbyValue, - ushort delta) - { - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(short.MinValue, short.MaxValue, 1)] - [InlineData(short.MinValue, 0, short.MaxValue)] - [InlineData(short.MinValue, 1, short.MaxValue)] - [InlineData(-1, 0, 0)] - [InlineData(-1, 1, 1)] - [InlineData(-1, short.MaxValue, short.MaxValue)] - [InlineData(0, short.MinValue, short.MaxValue)] - [InlineData(0, -1, 0)] - [InlineData(0, 1, 0)] - [InlineData(1, -1, 1)] - [InlineData(1, 0, 0)] - [InlineData(1, short.MinValue, short.MaxValue)] - [InlineData(short.MaxValue, short.MinValue, 1)] - [InlineData(short.MaxValue, -1, short.MaxValue)] - [Theory] - public void When_a_short_value_is_not_close_to_expected_value_it_should_fail(short actual, short nearbyValue, - ushort delta) - { - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_short_value_is_not_close_to_expected_value_it_should_fail_with_a_descriptive_message() - { - // Arrange - short actual = 1; - short nearbyValue = 4; - ushort delta = 2; - - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw() - .WithMessage("*be within*2*from*4*but found*1*"); - } - - [Fact] - public void When_a_short_value_is_returned_from_BeCloseTo_it_should_chain() - { - // Arrange - short actual = short.MaxValue; - - // Act - Action act = () => actual.Should().BeCloseTo(actual, 0) - .And.Be(actual); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(int.MinValue, int.MinValue, 0)] - [InlineData(int.MinValue, int.MinValue, 1)] - [InlineData(int.MinValue, int.MinValue, int.MaxValue)] - [InlineData(int.MinValue, int.MinValue + 1, 1)] - [InlineData(int.MinValue, int.MinValue + 1, int.MaxValue)] - [InlineData(int.MinValue, -1, int.MaxValue)] - [InlineData(int.MinValue + 1, int.MinValue, 1)] - [InlineData(int.MinValue + 1, int.MinValue, int.MaxValue)] - [InlineData(int.MinValue + 1, 0, int.MaxValue)] - [InlineData(-1, int.MinValue, int.MaxValue)] - [InlineData(-1, 0, 1)] - [InlineData(-1, 0, int.MaxValue)] - [InlineData(0, 0, 0)] - [InlineData(0, 0, 1)] - [InlineData(0, -1, 1)] - [InlineData(0, -1, int.MaxValue)] - [InlineData(0, 1, 1)] - [InlineData(0, 1, int.MaxValue)] - [InlineData(0, int.MaxValue, int.MaxValue)] - [InlineData(0, int.MinValue + 1, int.MaxValue)] - [InlineData(1, 0, 1)] - [InlineData(1, 0, int.MaxValue)] - [InlineData(1, int.MaxValue, int.MaxValue)] - [InlineData(int.MaxValue - 1, int.MaxValue, 1)] - [InlineData(int.MaxValue - 1, int.MaxValue, int.MaxValue)] - [InlineData(int.MaxValue, 0, int.MaxValue)] - [InlineData(int.MaxValue, 1, int.MaxValue)] - [InlineData(int.MaxValue, int.MaxValue, 0)] - [InlineData(int.MaxValue, int.MaxValue, 1)] - [InlineData(int.MaxValue, int.MaxValue, int.MaxValue)] - [InlineData(int.MaxValue, int.MaxValue - 1, 1)] - [InlineData(int.MaxValue, int.MaxValue - 1, int.MaxValue)] - [Theory] - public void When_an_int_value_is_close_to_expected_value_it_should_succeed(int actual, int nearbyValue, uint delta) - { - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(int.MinValue, int.MaxValue, 1)] - [InlineData(int.MinValue, 0, int.MaxValue)] - [InlineData(int.MinValue, 1, int.MaxValue)] - [InlineData(-1, 0, 0)] - [InlineData(-1, 1, 1)] - [InlineData(-1, int.MaxValue, int.MaxValue)] - [InlineData(0, int.MinValue, int.MaxValue)] - [InlineData(0, -1, 0)] - [InlineData(0, 1, 0)] - [InlineData(1, -1, 1)] - [InlineData(1, 0, 0)] - [InlineData(1, int.MinValue, int.MaxValue)] - [InlineData(int.MaxValue, int.MinValue, 1)] - [InlineData(int.MaxValue, -1, int.MaxValue)] - [Theory] - public void When_an_int_value_is_not_close_to_expected_value_it_should_fail(int actual, int nearbyValue, uint delta) - { - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_an_int_value_is_not_close_to_expected_value_it_should_fail_with_a_descriptive_message() - { - // Arrange - int actual = 1; - int nearbyValue = 4; - uint delta = 2; - - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw() - .WithMessage("*be within*2*from*4*but found*1*"); - } - - [Fact] - public void When_an_int_value_is_returned_from_BeCloseTo_it_should_chain() - { - // Arrange - int actual = int.MaxValue; - - // Act - Action act = () => actual.Should().BeCloseTo(actual, 0) - .And.Be(actual); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(long.MinValue, long.MinValue, 0)] - [InlineData(long.MinValue, long.MinValue, 1)] - [InlineData(long.MinValue, long.MinValue, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MinValue, long.MinValue, ulong.MaxValue / 2)] - [InlineData(long.MinValue, long.MinValue, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MinValue, long.MinValue, ulong.MaxValue)] - [InlineData(long.MinValue, long.MinValue + 1, 1)] - [InlineData(long.MinValue, long.MinValue + 1, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MinValue, long.MinValue + 1, ulong.MaxValue / 2)] - [InlineData(long.MinValue, long.MinValue + 1, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MinValue, long.MinValue + 1, ulong.MaxValue)] - [InlineData(long.MinValue, -1, long.MaxValue)] - [InlineData(long.MinValue + 1, long.MinValue, 1)] - [InlineData(long.MinValue + 1, long.MinValue, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MinValue + 1, long.MinValue, ulong.MaxValue / 2)] - [InlineData(long.MinValue + 1, long.MinValue, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MinValue + 1, long.MinValue, ulong.MaxValue)] - [InlineData(long.MinValue + 1, 0, ulong.MaxValue / 2)] - [InlineData(long.MinValue + 1, 0, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MinValue + 1, 0, ulong.MaxValue)] - [InlineData(long.MinValue, long.MaxValue, ulong.MaxValue)] - [InlineData(-1, long.MinValue, ulong.MaxValue / 2)] - [InlineData(-1, long.MinValue, (ulong.MaxValue / 2) + 1)] - [InlineData(-1, long.MinValue, ulong.MaxValue)] - [InlineData(-1, 0, 1)] - [InlineData(-1, 0, (ulong.MaxValue / 2) - 1)] - [InlineData(-1, 0, ulong.MaxValue / 2)] - [InlineData(-1, 0, (ulong.MaxValue / 2) + 1)] - [InlineData(-1, 0, ulong.MaxValue)] - [InlineData(0, 0, 0)] - [InlineData(0, 0, 1)] - [InlineData(0, -1, 1)] - [InlineData(0, -1, (ulong.MaxValue / 2) - 1)] - [InlineData(0, -1, ulong.MaxValue / 2)] - [InlineData(0, -1, (ulong.MaxValue / 2) + 1)] - [InlineData(0, -1, ulong.MaxValue)] - [InlineData(0, 1, 1)] - [InlineData(0, 1, (ulong.MaxValue / 2) - 1)] - [InlineData(0, 1, ulong.MaxValue / 2)] - [InlineData(0, 1, (ulong.MaxValue / 2) + 1)] - [InlineData(0, 1, ulong.MaxValue)] - [InlineData(0, long.MaxValue, ulong.MaxValue / 2)] - [InlineData(0, long.MaxValue, (ulong.MaxValue / 2) + 1)] - [InlineData(0, long.MaxValue, ulong.MaxValue)] - [InlineData(0, long.MinValue + 1, ulong.MaxValue / 2)] - [InlineData(0, long.MinValue + 1, (ulong.MaxValue / 2) + 1)] - [InlineData(0, long.MinValue + 1, ulong.MaxValue)] - [InlineData(1, 0, 1)] - [InlineData(1, 0, (ulong.MaxValue / 2) - 1)] - [InlineData(1, 0, ulong.MaxValue / 2)] - [InlineData(1, 0, (ulong.MaxValue / 2) + 1)] - [InlineData(1, 0, ulong.MaxValue)] - [InlineData(1, long.MaxValue, (ulong.MaxValue / 2) - 1)] - [InlineData(1, long.MaxValue, ulong.MaxValue / 2)] - [InlineData(1, long.MaxValue, (ulong.MaxValue / 2) + 1)] - [InlineData(1, long.MaxValue, ulong.MaxValue)] - [InlineData(long.MaxValue - 1, long.MaxValue, 1)] - [InlineData(long.MaxValue - 1, long.MaxValue, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MaxValue - 1, long.MaxValue, ulong.MaxValue / 2)] - [InlineData(long.MaxValue - 1, long.MaxValue, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MaxValue - 1, long.MaxValue, ulong.MaxValue)] - [InlineData(long.MaxValue, 0, ulong.MaxValue / 2)] - [InlineData(long.MaxValue, 0, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MaxValue, 0, ulong.MaxValue)] - [InlineData(long.MaxValue, 1, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MaxValue, 1, ulong.MaxValue / 2)] - [InlineData(long.MaxValue, 1, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MaxValue, 1, ulong.MaxValue)] - [InlineData(long.MaxValue, long.MaxValue, 0)] - [InlineData(long.MaxValue, long.MaxValue, 1)] - [InlineData(long.MaxValue, long.MaxValue, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MaxValue, long.MaxValue, ulong.MaxValue / 2)] - [InlineData(long.MaxValue, long.MaxValue, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MaxValue, long.MaxValue, ulong.MaxValue)] - [InlineData(long.MaxValue, long.MaxValue - 1, 1)] - [InlineData(long.MaxValue, long.MaxValue - 1, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MaxValue, long.MaxValue - 1, ulong.MaxValue / 2)] - [InlineData(long.MaxValue, long.MaxValue - 1, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MaxValue, long.MaxValue - 1, ulong.MaxValue)] - [Theory] - public void When_a_long_value_is_close_to_expected_value_it_should_succeed(long actual, long nearbyValue, ulong delta) - { - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(long.MinValue, long.MaxValue, 1)] - [InlineData(long.MinValue, 0, long.MaxValue)] - [InlineData(long.MinValue, 1, long.MaxValue)] - [InlineData(long.MinValue + 1, 0, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MinValue, long.MaxValue, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MinValue, long.MaxValue, ulong.MaxValue / 2)] - [InlineData(-1, 0, 0)] - [InlineData(-1, 1, 1)] - [InlineData(-1, long.MaxValue, long.MaxValue)] - [InlineData(-1, long.MinValue, (ulong.MaxValue / 2) - 1)] - [InlineData(0, long.MinValue, long.MaxValue)] - [InlineData(0, long.MinValue + 1, (ulong.MaxValue / 2) - 1)] - [InlineData(0, long.MaxValue, (ulong.MaxValue / 2) - 1)] - [InlineData(0, -1, 0)] - [InlineData(0, 1, 0)] - [InlineData(1, -1, 1)] - [InlineData(1, 0, 0)] - [InlineData(1, long.MinValue, long.MaxValue)] - [InlineData(long.MaxValue, long.MinValue, 1)] - [InlineData(long.MaxValue, -1, long.MaxValue)] - [InlineData(long.MaxValue, 0, (ulong.MaxValue / 2) - 1)] - [Theory] - public void When_a_long_value_is_not_close_to_expected_value_it_should_fail(long actual, long nearbyValue, - ulong delta) - { - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_long_value_is_not_close_to_expected_value_it_should_fail_with_a_descriptive_message() - { - // Arrange - long actual = 1; - long nearbyValue = 4; - ulong delta = 2; - - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw() - .WithMessage("*be within*2*from*4*but found*1*"); - } - - [Fact] - public void When_a_long_value_is_returned_from_BeCloseTo_it_should_chain() - { - // Arrange - long actual = long.MaxValue; - - // Act - Action act = () => actual.Should().BeCloseTo(actual, 0) - .And.Be(actual); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(0, 0, 0)] - [InlineData(0, 0, 1)] - [InlineData(0, 1, 1)] - [InlineData(1, 0, 1)] - [InlineData(1, byte.MaxValue, byte.MaxValue)] - [InlineData(byte.MinValue, byte.MinValue + 1, byte.MaxValue)] - [InlineData(byte.MinValue + 1, 0, byte.MaxValue)] - [InlineData(byte.MinValue + 1, byte.MinValue, 1)] - [InlineData(byte.MinValue + 1, byte.MinValue, byte.MaxValue)] - [InlineData(byte.MaxValue - 1, byte.MaxValue, 1)] - [InlineData(byte.MaxValue - 1, byte.MaxValue, byte.MaxValue)] - [InlineData(byte.MaxValue, 0, byte.MaxValue)] - [InlineData(byte.MaxValue, 1, byte.MaxValue)] - [InlineData(byte.MaxValue, byte.MaxValue - 1, 1)] - [InlineData(byte.MaxValue, byte.MaxValue - 1, byte.MaxValue)] - [InlineData(byte.MaxValue, byte.MaxValue, 0)] - [InlineData(byte.MaxValue, byte.MaxValue, 1)] - [Theory] - public void When_a_byte_value_is_close_to_expected_value_it_should_succeed(byte actual, byte nearbyValue, byte delta) - { - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(0, 1, 0)] - [InlineData(1, 0, 0)] - [InlineData(byte.MinValue, byte.MaxValue, 1)] - [InlineData(byte.MaxValue, byte.MinValue, 1)] - [Theory] - public void When_a_byte_value_is_not_close_to_expected_value_it_should_fail(byte actual, byte nearbyValue, byte delta) - { - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_byte_value_is_not_close_to_expected_value_it_should_fail_with_a_descriptive_message() - { - // Arrange - byte actual = 1; - byte nearbyValue = 4; - byte delta = 2; - - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw() - .WithMessage("*be within*2*from*4*but found*1*"); - } - - [Fact] - public void When_a_byte_value_is_returned_from_BeCloseTo_it_should_chain() - { - // Arrange - byte actual = byte.MaxValue; - - // Act - Action act = () => actual.Should().BeCloseTo(actual, 0) - .And.Be(actual); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(0, 0, 0)] - [InlineData(0, 0, 1)] - [InlineData(0, 1, 1)] - [InlineData(1, 0, 1)] - [InlineData(1, ushort.MaxValue, ushort.MaxValue)] - [InlineData(ushort.MinValue, ushort.MinValue + 1, ushort.MaxValue)] - [InlineData(ushort.MinValue + 1, 0, ushort.MaxValue)] - [InlineData(ushort.MinValue + 1, ushort.MinValue, 1)] - [InlineData(ushort.MinValue + 1, ushort.MinValue, ushort.MaxValue)] - [InlineData(ushort.MaxValue - 1, ushort.MaxValue, 1)] - [InlineData(ushort.MaxValue - 1, ushort.MaxValue, ushort.MaxValue)] - [InlineData(ushort.MaxValue, 0, ushort.MaxValue)] - [InlineData(ushort.MaxValue, 1, ushort.MaxValue)] - [InlineData(ushort.MaxValue, ushort.MaxValue - 1, 1)] - [InlineData(ushort.MaxValue, ushort.MaxValue - 1, ushort.MaxValue)] - [InlineData(ushort.MaxValue, ushort.MaxValue, 0)] - [InlineData(ushort.MaxValue, ushort.MaxValue, 1)] - [Theory] - public void When_an_ushort_value_is_close_to_expected_value_it_should_succeed(ushort actual, ushort nearbyValue, - ushort delta) - { - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(0, 1, 0)] - [InlineData(1, 0, 0)] - [InlineData(ushort.MinValue, ushort.MaxValue, 1)] - [InlineData(ushort.MaxValue, ushort.MinValue, 1)] - [Theory] - public void When_an_ushort_value_is_not_close_to_expected_value_it_should_fail(ushort actual, ushort nearbyValue, - ushort delta) - { - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_an_ushort_value_is_not_close_to_expected_value_it_should_fail_with_a_descriptive_message() - { - // Arrange - ushort actual = 1; - ushort nearbyValue = 4; - ushort delta = 2; - - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw() - .WithMessage("*be within*2*from*4*but found*1*"); - } - - [Fact] - public void When_an_ushort_value_is_returned_from_BeCloseTo_it_should_chain() - { - // Arrange - ushort actual = ushort.MaxValue; - - // Act - Action act = () => actual.Should().BeCloseTo(actual, 0) - .And.Be(actual); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(0, 0, 0)] - [InlineData(0, 0, 1)] - [InlineData(0, 1, 1)] - [InlineData(1, 0, 1)] - [InlineData(1, uint.MaxValue, uint.MaxValue)] - [InlineData(uint.MinValue, uint.MinValue + 1, uint.MaxValue)] - [InlineData(uint.MinValue + 1, 0, uint.MaxValue)] - [InlineData(uint.MinValue + 1, uint.MinValue, 1)] - [InlineData(uint.MinValue + 1, uint.MinValue, uint.MaxValue)] - [InlineData(uint.MaxValue - 1, uint.MaxValue, 1)] - [InlineData(uint.MaxValue - 1, uint.MaxValue, uint.MaxValue)] - [InlineData(uint.MaxValue, 0, uint.MaxValue)] - [InlineData(uint.MaxValue, 1, uint.MaxValue)] - [InlineData(uint.MaxValue, uint.MaxValue - 1, 1)] - [InlineData(uint.MaxValue, uint.MaxValue - 1, uint.MaxValue)] - [InlineData(uint.MaxValue, uint.MaxValue, 0)] - [InlineData(uint.MaxValue, uint.MaxValue, 1)] - [Theory] - public void When_an_uint_value_is_close_to_expected_value_it_should_succeed(uint actual, uint nearbyValue, uint delta) - { - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(0, 1, 0)] - [InlineData(1, 0, 0)] - [InlineData(uint.MinValue, uint.MaxValue, 1)] - [InlineData(uint.MaxValue, uint.MinValue, 1)] - [Theory] - public void When_an_uint_value_is_not_close_to_expected_value_it_should_fail(uint actual, uint nearbyValue, - uint delta) - { - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_an_uint_value_is_not_close_to_expected_value_it_should_fail_with_a_descriptive_message() - { - // Arrange - uint actual = 1; - uint nearbyValue = 4; - uint delta = 2; - - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw() - .WithMessage("*be within*2*from*4*but found*1*"); - } - - [Fact] - public void When_an_uint_value_is_returned_from_BeCloseTo_it_should_chain() - { - // Arrange - uint actual = uint.MaxValue; - - // Act - Action act = () => actual.Should().BeCloseTo(actual, 0) - .And.Be(actual); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(0, 0, 0)] - [InlineData(0, 0, 1)] - [InlineData(0, 1, 1)] - [InlineData(1, 0, 1)] - [InlineData(1, ulong.MaxValue, ulong.MaxValue)] - [InlineData(ulong.MinValue, ulong.MinValue + 1, ulong.MaxValue)] - [InlineData(ulong.MinValue + 1, 0, ulong.MaxValue)] - [InlineData(ulong.MinValue + 1, ulong.MinValue, 1)] - [InlineData(ulong.MinValue + 1, ulong.MinValue, ulong.MaxValue)] - [InlineData(ulong.MaxValue - 1, ulong.MaxValue, 1)] - [InlineData(ulong.MaxValue - 1, ulong.MaxValue, ulong.MaxValue)] - [InlineData(ulong.MaxValue, 0, ulong.MaxValue)] - [InlineData(ulong.MaxValue, 1, ulong.MaxValue)] - [InlineData(ulong.MaxValue, ulong.MaxValue - 1, 1)] - [InlineData(ulong.MaxValue, ulong.MaxValue - 1, ulong.MaxValue)] - [InlineData(ulong.MaxValue, ulong.MaxValue, 0)] - [InlineData(ulong.MaxValue, ulong.MaxValue, 1)] - [Theory] - public void When_an_ulong_value_is_close_to_expected_value_it_should_succeed(ulong actual, ulong nearbyValue, - ulong delta) - { - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(0, 1, 0)] - [InlineData(1, 0, 0)] - [InlineData(ulong.MinValue, ulong.MaxValue, 1)] - [InlineData(ulong.MaxValue, ulong.MinValue, 1)] - [Theory] - public void When_an_ulong_value_is_not_close_to_expected_value_it_should_fail(ulong actual, ulong nearbyValue, - ulong delta) - { - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_an_ulong_value_is_not_close_to_expected_value_it_should_fail_with_a_descriptive_message() - { - // Arrange - ulong actual = 1; - ulong nearbyValue = 4; - ulong delta = 2; - - // Act - Action act = () => actual.Should().BeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw() - .WithMessage("*be within*2*from*4*but found*1*"); - } - - [Fact] - public void When_an_ulong_value_is_returned_from_BeCloseTo_it_should_chain() - { - // Arrange - ulong actual = ulong.MaxValue; - - // Act - Action act = () => actual.Should().BeCloseTo(actual, 0) - .And.Be(actual); - - // Assert - act.Should().NotThrow(); - } - } - - public class NotBeCloseTo - { - [InlineData(sbyte.MinValue, sbyte.MaxValue, 1)] - [InlineData(sbyte.MinValue, 0, sbyte.MaxValue)] - [InlineData(sbyte.MinValue, 1, sbyte.MaxValue)] - [InlineData(-1, 0, 0)] - [InlineData(-1, 1, 1)] - [InlineData(-1, sbyte.MaxValue, sbyte.MaxValue)] - [InlineData(0, sbyte.MinValue, sbyte.MaxValue)] - [InlineData(0, -1, 0)] - [InlineData(0, 1, 0)] - [InlineData(1, -1, 1)] - [InlineData(1, 0, 0)] - [InlineData(1, sbyte.MinValue, sbyte.MaxValue)] - [InlineData(sbyte.MaxValue, sbyte.MinValue, 1)] - [InlineData(sbyte.MaxValue, -1, sbyte.MaxValue)] - [Theory] - public void When_a_sbyte_value_is_not_close_to_expected_value_it_should_succeed(sbyte actual, sbyte distantValue, - byte delta) - { - // Act - Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(sbyte.MinValue, sbyte.MinValue, 0)] - [InlineData(sbyte.MinValue, sbyte.MinValue, 1)] - [InlineData(sbyte.MinValue, sbyte.MinValue, sbyte.MaxValue)] - [InlineData(sbyte.MinValue, sbyte.MinValue + 1, 1)] - [InlineData(sbyte.MinValue, sbyte.MinValue + 1, sbyte.MaxValue)] - [InlineData(sbyte.MinValue, -1, sbyte.MaxValue)] - [InlineData(sbyte.MinValue + 1, sbyte.MinValue, 1)] - [InlineData(sbyte.MinValue + 1, sbyte.MinValue, sbyte.MaxValue)] - [InlineData(sbyte.MinValue + 1, 0, sbyte.MaxValue)] - [InlineData(-1, sbyte.MinValue, sbyte.MaxValue)] - [InlineData(-1, 0, 1)] - [InlineData(-1, 0, sbyte.MaxValue)] - [InlineData(0, 0, 0)] - [InlineData(0, 0, 1)] - [InlineData(0, -1, 1)] - [InlineData(0, -1, sbyte.MaxValue)] - [InlineData(0, 1, 1)] - [InlineData(0, 1, sbyte.MaxValue)] - [InlineData(0, sbyte.MaxValue, sbyte.MaxValue)] - [InlineData(0, sbyte.MinValue + 1, sbyte.MaxValue)] - [InlineData(1, 0, 1)] - [InlineData(1, 0, sbyte.MaxValue)] - [InlineData(1, sbyte.MaxValue, sbyte.MaxValue)] - [InlineData(sbyte.MaxValue - 1, sbyte.MaxValue, 1)] - [InlineData(sbyte.MaxValue - 1, sbyte.MaxValue, sbyte.MaxValue)] - [InlineData(sbyte.MaxValue, 0, sbyte.MaxValue)] - [InlineData(sbyte.MaxValue, 1, sbyte.MaxValue)] - [InlineData(sbyte.MaxValue, sbyte.MaxValue, 0)] - [InlineData(sbyte.MaxValue, sbyte.MaxValue, 1)] - [InlineData(sbyte.MaxValue, sbyte.MaxValue, sbyte.MaxValue)] - [InlineData(sbyte.MaxValue, sbyte.MaxValue - 1, 1)] - [InlineData(sbyte.MaxValue, sbyte.MaxValue - 1, sbyte.MaxValue)] - [Theory] - public void When_a_sbyte_value_is_close_to_expected_value_it_should_fail(sbyte actual, sbyte distantValue, byte delta) - { - // Act - Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_sbyte_value_is_close_to_expected_value_it_should_fail_with_a_descriptive_message() - { - // Arrange - sbyte actual = 1; - sbyte nearbyValue = 3; - byte delta = 2; - - // Act - Action act = () => actual.Should().NotBeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw() - .WithMessage("*be within*2*from*3*but found*1*"); - } - - [Fact] - public void When_a_sbyte_value_is_returned_from_NotBeCloseTo_it_should_chain() - { - // Arrange - sbyte actual = sbyte.MaxValue; - - // Act - Action act = () => actual.Should().NotBeCloseTo(0, 0) - .And.Be(actual); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(short.MinValue, short.MaxValue, 1)] - [InlineData(short.MinValue, 0, short.MaxValue)] - [InlineData(short.MinValue, 1, short.MaxValue)] - [InlineData(-1, 0, 0)] - [InlineData(-1, 1, 1)] - [InlineData(-1, short.MaxValue, short.MaxValue)] - [InlineData(0, short.MinValue, short.MaxValue)] - [InlineData(0, -1, 0)] - [InlineData(0, 1, 0)] - [InlineData(1, -1, 1)] - [InlineData(1, 0, 0)] - [InlineData(1, short.MinValue, short.MaxValue)] - [InlineData(short.MaxValue, short.MinValue, 1)] - [InlineData(short.MaxValue, -1, short.MaxValue)] - [Theory] - public void When_a_short_value_is_not_close_to_expected_value_it_should_succeed(short actual, short distantValue, - ushort delta) - { - // Act - Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(short.MinValue, short.MinValue, 0)] - [InlineData(short.MinValue, short.MinValue, 1)] - [InlineData(short.MinValue, short.MinValue, short.MaxValue)] - [InlineData(short.MinValue, short.MinValue + 1, 1)] - [InlineData(short.MinValue, short.MinValue + 1, short.MaxValue)] - [InlineData(short.MinValue, -1, short.MaxValue)] - [InlineData(short.MinValue + 1, short.MinValue, 1)] - [InlineData(short.MinValue + 1, short.MinValue, short.MaxValue)] - [InlineData(short.MinValue + 1, 0, short.MaxValue)] - [InlineData(-1, short.MinValue, short.MaxValue)] - [InlineData(-1, 0, 1)] - [InlineData(-1, 0, short.MaxValue)] - [InlineData(0, 0, 0)] - [InlineData(0, 0, 1)] - [InlineData(0, -1, 1)] - [InlineData(0, -1, short.MaxValue)] - [InlineData(0, 1, 1)] - [InlineData(0, 1, short.MaxValue)] - [InlineData(0, short.MaxValue, short.MaxValue)] - [InlineData(0, short.MinValue + 1, short.MaxValue)] - [InlineData(1, 0, 1)] - [InlineData(1, 0, short.MaxValue)] - [InlineData(1, short.MaxValue, short.MaxValue)] - [InlineData(short.MaxValue - 1, short.MaxValue, 1)] - [InlineData(short.MaxValue - 1, short.MaxValue, short.MaxValue)] - [InlineData(short.MaxValue, 0, short.MaxValue)] - [InlineData(short.MaxValue, 1, short.MaxValue)] - [InlineData(short.MaxValue, short.MaxValue, 0)] - [InlineData(short.MaxValue, short.MaxValue, 1)] - [InlineData(short.MaxValue, short.MaxValue, short.MaxValue)] - [InlineData(short.MaxValue, short.MaxValue - 1, 1)] - [InlineData(short.MaxValue, short.MaxValue - 1, short.MaxValue)] - [Theory] - public void When_a_short_value_is_close_to_expected_value_it_should_fail(short actual, short distantValue, - ushort delta) - { - // Act - Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_short_value_is_close_to_expected_value_it_should_fail_with_a_descriptive_message() - { - // Arrange - short actual = 1; - short nearbyValue = 3; - ushort delta = 2; - - // Act - Action act = () => actual.Should().NotBeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw() - .WithMessage("*be within*2*from*3*but found*1*"); - } - - [Fact] - public void When_a_short_value_is_returned_from_NotBeCloseTo_it_should_chain() - { - // Arrange - short actual = short.MaxValue; - - // Act - Action act = () => actual.Should().NotBeCloseTo(0, 0) - .And.Be(actual); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(int.MinValue, int.MaxValue, 1)] - [InlineData(int.MinValue, 0, int.MaxValue)] - [InlineData(int.MinValue, 1, int.MaxValue)] - [InlineData(-1, 0, 0)] - [InlineData(-1, 1, 1)] - [InlineData(-1, int.MaxValue, int.MaxValue)] - [InlineData(0, int.MinValue, int.MaxValue)] - [InlineData(0, -1, 0)] - [InlineData(0, 1, 0)] - [InlineData(1, -1, 1)] - [InlineData(1, 0, 0)] - [InlineData(1, int.MinValue, int.MaxValue)] - [InlineData(int.MaxValue, int.MinValue, 1)] - [InlineData(int.MaxValue, -1, int.MaxValue)] - [Theory] - public void When_an_int_value_is_not_close_to_expected_value_it_should_succeed(int actual, int distantValue, - uint delta) - { - // Act - Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(int.MinValue, int.MinValue, 0)] - [InlineData(int.MinValue, int.MinValue, 1)] - [InlineData(int.MinValue, int.MinValue, int.MaxValue)] - [InlineData(int.MinValue, int.MinValue + 1, 1)] - [InlineData(int.MinValue, int.MinValue + 1, int.MaxValue)] - [InlineData(int.MinValue, -1, int.MaxValue)] - [InlineData(int.MinValue + 1, int.MinValue, 1)] - [InlineData(int.MinValue + 1, int.MinValue, int.MaxValue)] - [InlineData(int.MinValue + 1, 0, int.MaxValue)] - [InlineData(-1, int.MinValue, int.MaxValue)] - [InlineData(-1, 0, 1)] - [InlineData(-1, 0, int.MaxValue)] - [InlineData(0, 0, 0)] - [InlineData(0, 0, 1)] - [InlineData(0, -1, 1)] - [InlineData(0, -1, int.MaxValue)] - [InlineData(0, 1, 1)] - [InlineData(0, 1, int.MaxValue)] - [InlineData(0, int.MaxValue, int.MaxValue)] - [InlineData(0, int.MinValue + 1, int.MaxValue)] - [InlineData(1, 0, 1)] - [InlineData(1, 0, int.MaxValue)] - [InlineData(1, int.MaxValue, int.MaxValue)] - [InlineData(int.MaxValue - 1, int.MaxValue, 1)] - [InlineData(int.MaxValue - 1, int.MaxValue, int.MaxValue)] - [InlineData(int.MaxValue, 0, int.MaxValue)] - [InlineData(int.MaxValue, 1, int.MaxValue)] - [InlineData(int.MaxValue, int.MaxValue, 0)] - [InlineData(int.MaxValue, int.MaxValue, 1)] - [InlineData(int.MaxValue, int.MaxValue, int.MaxValue)] - [InlineData(int.MaxValue, int.MaxValue - 1, 1)] - [InlineData(int.MaxValue, int.MaxValue - 1, int.MaxValue)] - [Theory] - public void When_an_int_value_is_close_to_expected_value_it_should_fail(int actual, int distantValue, uint delta) - { - // Act - Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_an_int_value_is_close_to_expected_value_it_should_fail_with_a_descriptive_message() - { - // Arrange - int actual = 1; - int nearbyValue = 3; - uint delta = 2; - - // Act - Action act = () => actual.Should().NotBeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw() - .WithMessage("*be within*2*from*3*but found*1*"); - } - - [Fact] - public void When_an_int_value_is_returned_from_NotBeCloseTo_it_should_chain() - { - // Arrange - int actual = int.MaxValue; - - // Act - Action act = () => actual.Should().NotBeCloseTo(0, 0) - .And.Be(actual); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(long.MinValue, long.MaxValue, 1)] - [InlineData(long.MinValue, 0, long.MaxValue)] - [InlineData(long.MinValue, 1, long.MaxValue)] - [InlineData(long.MinValue + 1, 0, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MinValue, long.MaxValue, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MinValue, long.MaxValue, ulong.MaxValue / 2)] - [InlineData(-1, 0, 0)] - [InlineData(-1, 1, 1)] - [InlineData(-1, long.MaxValue, long.MaxValue)] - [InlineData(-1, long.MinValue, (ulong.MaxValue / 2) - 1)] - [InlineData(0, long.MinValue, long.MaxValue)] - [InlineData(0, long.MinValue + 1, (ulong.MaxValue / 2) - 1)] - [InlineData(0, long.MaxValue, (ulong.MaxValue / 2) - 1)] - [InlineData(0, -1, 0)] - [InlineData(0, 1, 0)] - [InlineData(1, -1, 1)] - [InlineData(1, 0, 0)] - [InlineData(1, long.MinValue, long.MaxValue)] - [InlineData(long.MaxValue, long.MinValue, 1)] - [InlineData(long.MaxValue, -1, long.MaxValue)] - [InlineData(long.MaxValue, 0, (ulong.MaxValue / 2) - 1)] - [Theory] - public void When_a_long_value_is_not_close_to_expected_value_it_should_succeed(long actual, long distantValue, - ulong delta) - { - // Act - Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(long.MinValue, long.MinValue, 0)] - [InlineData(long.MinValue, long.MinValue, 1)] - [InlineData(long.MinValue, long.MinValue, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MinValue, long.MinValue, ulong.MaxValue / 2)] - [InlineData(long.MinValue, long.MinValue, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MinValue, long.MinValue, ulong.MaxValue)] - [InlineData(long.MinValue, long.MinValue + 1, 1)] - [InlineData(long.MinValue, long.MinValue + 1, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MinValue, long.MinValue + 1, ulong.MaxValue / 2)] - [InlineData(long.MinValue, long.MinValue + 1, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MinValue, long.MinValue + 1, ulong.MaxValue)] - [InlineData(long.MinValue, -1, long.MaxValue)] - [InlineData(long.MinValue + 1, long.MinValue, 1)] - [InlineData(long.MinValue + 1, long.MinValue, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MinValue + 1, long.MinValue, ulong.MaxValue / 2)] - [InlineData(long.MinValue + 1, long.MinValue, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MinValue + 1, long.MinValue, ulong.MaxValue)] - [InlineData(long.MinValue + 1, 0, ulong.MaxValue / 2)] - [InlineData(long.MinValue + 1, 0, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MinValue + 1, 0, ulong.MaxValue)] - [InlineData(long.MinValue, long.MaxValue, ulong.MaxValue)] - [InlineData(-1, long.MinValue, ulong.MaxValue / 2)] - [InlineData(-1, long.MinValue, (ulong.MaxValue / 2) + 1)] - [InlineData(-1, long.MinValue, ulong.MaxValue)] - [InlineData(-1, 0, 1)] - [InlineData(-1, 0, (ulong.MaxValue / 2) - 1)] - [InlineData(-1, 0, ulong.MaxValue / 2)] - [InlineData(-1, 0, (ulong.MaxValue / 2) + 1)] - [InlineData(-1, 0, ulong.MaxValue)] - [InlineData(0, 0, 0)] - [InlineData(0, 0, 1)] - [InlineData(0, -1, 1)] - [InlineData(0, -1, (ulong.MaxValue / 2) - 1)] - [InlineData(0, -1, ulong.MaxValue / 2)] - [InlineData(0, -1, (ulong.MaxValue / 2) + 1)] - [InlineData(0, -1, ulong.MaxValue)] - [InlineData(0, 1, 1)] - [InlineData(0, 1, (ulong.MaxValue / 2) - 1)] - [InlineData(0, 1, ulong.MaxValue / 2)] - [InlineData(0, 1, (ulong.MaxValue / 2) + 1)] - [InlineData(0, 1, ulong.MaxValue)] - [InlineData(0, long.MaxValue, ulong.MaxValue / 2)] - [InlineData(0, long.MaxValue, (ulong.MaxValue / 2) + 1)] - [InlineData(0, long.MaxValue, ulong.MaxValue)] - [InlineData(0, long.MinValue + 1, ulong.MaxValue / 2)] - [InlineData(0, long.MinValue + 1, (ulong.MaxValue / 2) + 1)] - [InlineData(0, long.MinValue + 1, ulong.MaxValue)] - [InlineData(1, 0, 1)] - [InlineData(1, 0, (ulong.MaxValue / 2) - 1)] - [InlineData(1, 0, ulong.MaxValue / 2)] - [InlineData(1, 0, (ulong.MaxValue / 2) + 1)] - [InlineData(1, 0, ulong.MaxValue)] - [InlineData(1, long.MaxValue, (ulong.MaxValue / 2) - 1)] - [InlineData(1, long.MaxValue, ulong.MaxValue / 2)] - [InlineData(1, long.MaxValue, (ulong.MaxValue / 2) + 1)] - [InlineData(1, long.MaxValue, ulong.MaxValue)] - [InlineData(long.MaxValue - 1, long.MaxValue, 1)] - [InlineData(long.MaxValue - 1, long.MaxValue, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MaxValue - 1, long.MaxValue, ulong.MaxValue / 2)] - [InlineData(long.MaxValue - 1, long.MaxValue, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MaxValue - 1, long.MaxValue, ulong.MaxValue)] - [InlineData(long.MaxValue, 0, ulong.MaxValue / 2)] - [InlineData(long.MaxValue, 0, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MaxValue, 0, ulong.MaxValue)] - [InlineData(long.MaxValue, 1, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MaxValue, 1, ulong.MaxValue / 2)] - [InlineData(long.MaxValue, 1, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MaxValue, 1, ulong.MaxValue)] - [InlineData(long.MaxValue, long.MaxValue, 0)] - [InlineData(long.MaxValue, long.MaxValue, 1)] - [InlineData(long.MaxValue, long.MaxValue, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MaxValue, long.MaxValue, ulong.MaxValue / 2)] - [InlineData(long.MaxValue, long.MaxValue, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MaxValue, long.MaxValue, ulong.MaxValue)] - [InlineData(long.MaxValue, long.MaxValue - 1, 1)] - [InlineData(long.MaxValue, long.MaxValue - 1, (ulong.MaxValue / 2) - 1)] - [InlineData(long.MaxValue, long.MaxValue - 1, ulong.MaxValue / 2)] - [InlineData(long.MaxValue, long.MaxValue - 1, (ulong.MaxValue / 2) + 1)] - [InlineData(long.MaxValue, long.MaxValue - 1, ulong.MaxValue)] - [Theory] - public void When_a_long_value_is_close_to_expected_value_it_should_fail(long actual, long distantValue, ulong delta) - { - // Act - Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_long_value_is_close_to_expected_value_it_should_fail_with_a_descriptive_message() - { - // Arrange - long actual = 1; - long nearbyValue = 3; - ulong delta = 2; - - // Act - Action act = () => actual.Should().NotBeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw() - .WithMessage("*be within*2*from*3*but found*1*"); - } - - [Fact] - public void When_a_long_value_is_returned_from_NotBeCloseTo_it_should_chain() - { - // Arrange - long actual = long.MaxValue; - - // Act - Action act = () => actual.Should().NotBeCloseTo(0, 0) - .And.Be(actual); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(0, 1, 0)] - [InlineData(1, 0, 0)] - [InlineData(byte.MinValue, byte.MaxValue, 1)] - [InlineData(byte.MaxValue, byte.MinValue, 1)] - [Theory] - public void When_a_byte_value_is_not_close_to_expected_value_it_should_succeed(byte actual, byte distantValue, - byte delta) - { - // Act - Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(0, 0, 0)] - [InlineData(0, 0, 1)] - [InlineData(0, 1, 1)] - [InlineData(1, 0, 1)] - [InlineData(1, byte.MaxValue, byte.MaxValue)] - [InlineData(byte.MinValue, byte.MinValue + 1, byte.MaxValue)] - [InlineData(byte.MinValue + 1, 0, byte.MaxValue)] - [InlineData(byte.MinValue + 1, byte.MinValue, 1)] - [InlineData(byte.MinValue + 1, byte.MinValue, byte.MaxValue)] - [InlineData(byte.MaxValue - 1, byte.MaxValue, 1)] - [InlineData(byte.MaxValue - 1, byte.MaxValue, byte.MaxValue)] - [InlineData(byte.MaxValue, 0, byte.MaxValue)] - [InlineData(byte.MaxValue, 1, byte.MaxValue)] - [InlineData(byte.MaxValue, byte.MaxValue - 1, 1)] - [InlineData(byte.MaxValue, byte.MaxValue - 1, byte.MaxValue)] - [InlineData(byte.MaxValue, byte.MaxValue, 0)] - [InlineData(byte.MaxValue, byte.MaxValue, 1)] - [Theory] - public void When_a_byte_value_is_close_to_expected_value_it_should_fail(byte actual, byte distantValue, byte delta) - { - // Act - Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_a_byte_value_is_close_to_expected_value_it_should_fail_with_a_descriptive_message() - { - // Arrange - byte actual = 1; - byte nearbyValue = 3; - byte delta = 2; - - // Act - Action act = () => actual.Should().NotBeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw() - .WithMessage("*be within*2*from*3*but found*1*"); - } - - [Fact] - public void When_a_byte_value_is_returned_from_NotBeCloseTo_it_should_chain() - { - // Arrange - byte actual = byte.MaxValue; - - // Act - Action act = () => actual.Should().NotBeCloseTo(0, 0) - .And.Be(actual); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(0, 1, 0)] - [InlineData(1, 0, 0)] - [InlineData(ushort.MinValue, ushort.MaxValue, 1)] - [InlineData(ushort.MaxValue, ushort.MinValue, 1)] - [Theory] - public void When_an_ushort_value_is_not_close_to_expected_value_it_should_succeed(ushort actual, ushort distantValue, - ushort delta) - { - // Act - Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(0, 0, 0)] - [InlineData(0, 0, 1)] - [InlineData(0, 1, 1)] - [InlineData(1, 0, 1)] - [InlineData(1, ushort.MaxValue, ushort.MaxValue)] - [InlineData(ushort.MinValue, ushort.MinValue + 1, ushort.MaxValue)] - [InlineData(ushort.MinValue + 1, 0, ushort.MaxValue)] - [InlineData(ushort.MinValue + 1, ushort.MinValue, 1)] - [InlineData(ushort.MinValue + 1, ushort.MinValue, ushort.MaxValue)] - [InlineData(ushort.MaxValue - 1, ushort.MaxValue, 1)] - [InlineData(ushort.MaxValue - 1, ushort.MaxValue, ushort.MaxValue)] - [InlineData(ushort.MaxValue, 0, ushort.MaxValue)] - [InlineData(ushort.MaxValue, 1, ushort.MaxValue)] - [InlineData(ushort.MaxValue, ushort.MaxValue - 1, 1)] - [InlineData(ushort.MaxValue, ushort.MaxValue - 1, ushort.MaxValue)] - [InlineData(ushort.MaxValue, ushort.MaxValue, 0)] - [InlineData(ushort.MaxValue, ushort.MaxValue, 1)] - [Theory] - public void When_an_ushort_value_is_close_to_expected_value_it_should_fail(ushort actual, ushort distantValue, - ushort delta) - { - // Act - Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_an_ushort_value_is_close_to_expected_value_it_should_fail_with_a_descriptive_message() - { - // Arrange - ushort actual = 1; - ushort nearbyValue = 3; - ushort delta = 2; - - // Act - Action act = () => actual.Should().NotBeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw() - .WithMessage("*be within*2*from*3*but found*1*"); - } - - [Fact] - public void When_an_ushort_value_is_returned_from_NotBeCloseTo_it_should_chain() - { - // Arrange - ushort actual = ushort.MaxValue; - - // Act - Action act = () => actual.Should().NotBeCloseTo(0, 0) - .And.Be(actual); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(0, 1, 0)] - [InlineData(1, 0, 0)] - [InlineData(uint.MinValue, uint.MaxValue, 1)] - [InlineData(uint.MaxValue, uint.MinValue, 1)] - [Theory] - public void When_an_uint_value_is_not_close_to_expected_value_it_should_succeed(uint actual, uint distantValue, - uint delta) - { - // Act - Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(0, 0, 0)] - [InlineData(0, 0, 1)] - [InlineData(0, 1, 1)] - [InlineData(1, 0, 1)] - [InlineData(1, uint.MaxValue, uint.MaxValue)] - [InlineData(uint.MinValue, uint.MinValue + 1, uint.MaxValue)] - [InlineData(uint.MinValue + 1, 0, uint.MaxValue)] - [InlineData(uint.MinValue + 1, uint.MinValue, 1)] - [InlineData(uint.MinValue + 1, uint.MinValue, uint.MaxValue)] - [InlineData(uint.MaxValue - 1, uint.MaxValue, 1)] - [InlineData(uint.MaxValue - 1, uint.MaxValue, uint.MaxValue)] - [InlineData(uint.MaxValue, 0, uint.MaxValue)] - [InlineData(uint.MaxValue, 1, uint.MaxValue)] - [InlineData(uint.MaxValue, uint.MaxValue - 1, 1)] - [InlineData(uint.MaxValue, uint.MaxValue - 1, uint.MaxValue)] - [InlineData(uint.MaxValue, uint.MaxValue, 0)] - [InlineData(uint.MaxValue, uint.MaxValue, 1)] - [Theory] - public void When_an_uint_value_is_close_to_expected_value_it_should_fail(uint actual, uint distantValue, uint delta) - { - // Act - Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_an_uint_value_is_close_to_expected_value_it_should_fail_with_a_descriptive_message() - { - // Arrange - uint actual = 1; - uint nearbyValue = 3; - uint delta = 2; - - // Act - Action act = () => actual.Should().NotBeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw() - .WithMessage("*be within*2*from*3*but found*1*"); - } - - [Fact] - public void When_an_uint_value_is_returned_from_NotBeCloseTo_it_should_chain() - { - // Arrange - uint actual = uint.MaxValue; - - // Act - Action act = () => actual.Should().NotBeCloseTo(0, 0) - .And.Be(actual); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(0, 1, 0)] - [InlineData(1, 0, 0)] - [InlineData(ulong.MinValue, ulong.MaxValue, 1)] - [InlineData(ulong.MaxValue, ulong.MinValue, 1)] - [Theory] - public void When_an_ulong_value_is_not_close_to_expected_value_it_should_succeed(ulong actual, ulong distantValue, - ulong delta) - { - // Act - Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); - - // Assert - act.Should().NotThrow(); - } - - [InlineData(0, 0, 0)] - [InlineData(0, 0, 1)] - [InlineData(0, 1, 1)] - [InlineData(1, 0, 1)] - [InlineData(1, ulong.MaxValue, ulong.MaxValue)] - [InlineData(ulong.MinValue, ulong.MinValue + 1, ulong.MaxValue)] - [InlineData(ulong.MinValue + 1, 0, ulong.MaxValue)] - [InlineData(ulong.MinValue + 1, ulong.MinValue, 1)] - [InlineData(ulong.MinValue + 1, ulong.MinValue, ulong.MaxValue)] - [InlineData(ulong.MaxValue - 1, ulong.MaxValue, 1)] - [InlineData(ulong.MaxValue - 1, ulong.MaxValue, ulong.MaxValue)] - [InlineData(ulong.MaxValue, 0, ulong.MaxValue)] - [InlineData(ulong.MaxValue, 1, ulong.MaxValue)] - [InlineData(ulong.MaxValue, ulong.MaxValue - 1, 1)] - [InlineData(ulong.MaxValue, ulong.MaxValue - 1, ulong.MaxValue)] - [InlineData(ulong.MaxValue, ulong.MaxValue, 0)] - [InlineData(ulong.MaxValue, ulong.MaxValue, 1)] - [Theory] - public void When_an_ulong_value_is_close_to_expected_value_it_should_fail(ulong actual, ulong distantValue, - ulong delta) - { - // Act - Action act = () => actual.Should().NotBeCloseTo(distantValue, delta); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_an_ulong_value_is_close_to_expected_value_it_should_fail_with_a_descriptive_message() - { - // Arrange - ulong actual = 1; - ulong nearbyValue = 3; - ulong delta = 2; - - // Act - Action act = () => actual.Should().NotBeCloseTo(nearbyValue, delta); - - // Assert - act.Should().Throw() - .WithMessage("*be within*2*from*3*but found*1*"); - } - - [Fact] - public void When_an_ulong_value_is_returned_from_NotBeCloseTo_it_should_chain() - { - // Arrange - ulong actual = ulong.MaxValue; - - // Act - Action act = () => actual.Should().NotBeCloseTo(0, 0) - .And.Be(actual); - - // Assert - act.Should().NotThrow(); - } - } - - public class Match - { - [Fact] - public void When_value_satisfies_predicate_it_should_not_throw() - { - // Arrange - int value = 1; - - // Act / Assert - value.Should().Match(o => o > 0); - } - - [Fact] - public void When_value_does_not_match_the_predicate_it_should_throw() - { - // Arrange - int value = 1; - - // Act - Action act = () => value.Should().Match(o => o == 0, "because we want to test the failure {0}", "message"); - - // Assert - act.Should().Throw() - .WithMessage("Expected value to match (o == 0) because we want to test the failure message, but found 1."); - } - - [Fact] - public void When_value_is_matched_against_a_null_it_should_throw() - { - // Arrange - int value = 1; - - // Act - Action act = () => value.Should().Match(null); - - // Assert - act.Should().ThrowExactly() - .WithParameterName("predicate"); - } - } - [Fact] public void When_chaining_constraints_with_and_should_not_throw() { From 593591a306df0474cfe95c0d5151e25142f144d7 Mon Sep 17 00:00:00 2001 From: Meir Blachman Date: Sat, 4 Nov 2023 12:41:32 +0200 Subject: [PATCH 156/845] add datetime tips for date parts (#2435) --- docs/_data/tips/datetimes.yml | 144 ++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/docs/_data/tips/datetimes.yml b/docs/_data/tips/datetimes.yml index 64cc7e4b3c..3d92d73ac6 100644 --- a/docs/_data/tips/datetimes.yml +++ b/docs/_data/tips/datetimes.yml @@ -21,3 +21,147 @@ new-message: | Expected a date and time that does not have date <2017-01-01>, but found it does. + +- old: | + actual.Year.Should().Be(expected.Year); + + new: | + actual.Should().HaveYear(expected.Year); + + old-message: | + Expected actual.Year to be 2018, but found 2017 (difference of -1). + + new-message: | + Expected the year part of actual to be 2018, but found 2017. + +- old: | + actual.Year.Should().NotBe(unexpected.Year); + + new: | + actual.Should().NotHaveYear(unexpected.Year); + + old-message: | + Did not expect the year part of actual to be 2017, but it was. + + new-message: | + Did not expect actual.Year to be 2017. + +- old: | + actual.Month.Should().Be(expected.Month); + + new: | + actual.Should().HaveMonth(expected.Month); + + old-message: | + Expected actual.Month to be 2, but found 1. + + new-message: | + Expected the month part of actual to be 2, but found 1. + +- old: | + actual.Month.Should().NotBe(unexpected.Month); + + new: | + actual.Should().NotHaveMonth(unexpected.Month); + + old-message: | + Did not expect actual.Month to be 1. + + new-message: | + Did not expect the month part of actual to be 1, but it was. + +- old: | + actual.Day.Should().Be(expected.Day); + + new: | + actual.Should().HaveDay(expected.Day); + + old-message: | + Expected actual.Day to be 2, but found 1. + + new-message: | + Expected the day part of actual to be 2, but found 1. + +- old: | + actual.Day.Should().NotBe(unexpected.Day); + + new: | + actual.Should().NotHaveDay(unexpected.Day); + + old-message: | + Did not expect actual.Day to be 1. + + new-message: | + Did not expect the day part of actual to be 1, but it was. + +- old: | + actual.Hour.Should().Be(expected.Hour); + + new: | + actual.Should().HaveHour(expected.Hour); + + old-message: | + Expected actual.Hour to be 19, but found 16 (difference of -3). + + new-message: | + Expected the hour part of actual to be 19, but found 16. + +- old: | + actual.Hour.Should().NotBe(unexpected.Hour); + + new: | + actual.Should().NotHaveHour(unexpected.Hour); + + old-message: | + Did not expect actual.Hour to be 16. + + new-message: | + Did not expect the hour part of actual to be 16, but it was. + +- old: | + actual.Minute.Should().Be(expected.Minute); + + new: | + actual.Should().HaveMinute(expected.Minute); + + old-message: | + Expected actual.Minute to be 31, but found 30 (difference of -1). + + new-message: | + Expected the minute part of actual to be 31, but found 30. + +- old: | + actual.Minute.Should().NotBe(unexpected.Minute); + + new: | + actual.Should().NotHaveMinute(unexpected.Minute); + + old-message: | + Did not expect actual.Minute to be 30. + + new-message: | + Did not expect the minute part of actual to be 30, but it was. + +- old: | + actual.Second.Should().Be(expected.Second); + + new: | + actual.Should().HaveSecond(expected.Second); + + old-message: | + Expected actual.Second to be 18, but found 17 (difference of -1). + + new-message: | + Expected the seconds part of actual to be 18, but found 17. + +- old: | + actual.Second.Should().NotBe(unexpected.Second); + + new: | + actual.Should().NotHaveSecond(unexpected.Second); + + old-message: | + Did not expect actual.Second to be 17. + + new-message: | + Did not expect the seconds part of actual to be 17, but it was. From 65412a20eb09e6b397d055d559ec0f11561af385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sat, 4 Nov 2023 12:24:00 +0100 Subject: [PATCH 157/845] Add EqualityStrategyProvider for `SelfReferenceEquivalencyAssertionOptions` (#2431) --- .../Equivalency/EqualityStrategyProvider.cs | 126 ++++++++++++++++++ ...elfReferenceEquivalencyAssertionOptions.cs | 91 +++---------- 2 files changed, 142 insertions(+), 75 deletions(-) create mode 100644 Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs diff --git a/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs b/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs new file mode 100644 index 0000000000..21903e2cd2 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using FluentAssertions.Common; +using JetBrains.Annotations; + +namespace FluentAssertions.Equivalency; + +internal sealed class EqualityStrategyProvider +{ + private readonly List referenceTypes = new(); + private readonly List valueTypes = new(); + private readonly ConcurrentDictionary typeCache = new(); + + [CanBeNull] + private readonly Func defaultStrategy; + + private bool? compareRecordsByValue; + + public EqualityStrategyProvider() + { + } + + public EqualityStrategyProvider(Func defaultStrategy) + { + this.defaultStrategy = defaultStrategy; + } + + public bool? CompareRecordsByValue + { + get => compareRecordsByValue; + set + { + compareRecordsByValue = value; + typeCache.Clear(); + } + } + + public EqualityStrategy GetEqualityStrategy(Type type) + { + // As the valueFactory parameter captures instance members, + // be aware if the cache must be cleared on mutating the members. + return typeCache.GetOrAdd(type, typeKey => + { + if (!typeKey.IsPrimitive && referenceTypes.Count > 0 && referenceTypes.Exists(t => typeKey.IsSameOrInherits(t))) + { + return EqualityStrategy.ForceMembers; + } + else if (valueTypes.Count > 0 && valueTypes.Exists(t => typeKey.IsSameOrInherits(t))) + { + return EqualityStrategy.ForceEquals; + } + else if (!typeKey.IsPrimitive && referenceTypes.Count > 0 && + referenceTypes.Exists(t => typeKey.IsAssignableToOpenGeneric(t))) + { + return EqualityStrategy.ForceMembers; + } + else if (valueTypes.Count > 0 && valueTypes.Exists(t => typeKey.IsAssignableToOpenGeneric(t))) + { + return EqualityStrategy.ForceEquals; + } + else if ((compareRecordsByValue.HasValue || defaultStrategy is null) && typeKey.IsRecord()) + { + return compareRecordsByValue is true ? EqualityStrategy.ForceEquals : EqualityStrategy.ForceMembers; + } + else if (defaultStrategy is not null) + { + return defaultStrategy(typeKey); + } + + return typeKey.HasValueSemantics() ? EqualityStrategy.Equals : EqualityStrategy.Members; + }); + } + + public bool AddReferenceType(Type type) + { + if (valueTypes.Exists(t => type.IsSameOrInherits(t))) + { + return false; + } + + referenceTypes.Add(type); + typeCache.Clear(); + return true; + } + + public bool AddValueType(Type type) + { + if (referenceTypes.Exists(t => type.IsSameOrInherits(t))) + { + return false; + } + + valueTypes.Add(type); + typeCache.Clear(); + return true; + } + + public override string ToString() + { + var builder = new StringBuilder(); + + if (compareRecordsByValue is true) + { + builder.AppendLine("- Compare records by value"); + } + else + { + builder.AppendLine("- Compare records by their members"); + } + + foreach (Type valueType in valueTypes) + { + builder.AppendLine(CultureInfo.InvariantCulture, $"- Compare {valueType} by value"); + } + + foreach (Type type in referenceTypes) + { + builder.AppendLine(CultureInfo.InvariantCulture, $"- Compare {type} by its members"); + } + + return builder.ToString(); + } +} diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyAssertionOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyAssertionOptions.cs index 9417f1ab9b..3246847d7b 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyAssertionOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyAssertionOptions.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Concurrent; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; @@ -26,12 +25,7 @@ public abstract class SelfReferenceEquivalencyAssertionOptions : IEquival { #region Private Definitions - // REFACTOR: group the next three fields in a dedicated class - private readonly List referenceTypes = new(); - private readonly List valueTypes = new(); - private readonly Func getDefaultEqualityStrategy; - - private readonly ConcurrentDictionary equalityStrategyCache = new(); + private readonly EqualityStrategyProvider equalityStrategyProvider; [DebuggerBrowsable(DebuggerBrowsableState.Never)] private readonly List selectionRules = new(); @@ -62,12 +56,12 @@ public abstract class SelfReferenceEquivalencyAssertionOptions : IEquival private bool ignoreNonBrowsableOnSubject; private bool excludeNonBrowsableOnExpectation; - private bool? compareRecordsByValue; - #endregion private protected SelfReferenceEquivalencyAssertionOptions() { + equalityStrategyProvider = new EqualityStrategyProvider(); + AddMatchingRule(new MustMatchByNameRule()); OrderingRules.Add(new ByteArrayOrderingRule()); @@ -78,6 +72,11 @@ private protected SelfReferenceEquivalencyAssertionOptions() /// protected SelfReferenceEquivalencyAssertionOptions(IEquivalencyAssertionOptions defaults) { + equalityStrategyProvider = new EqualityStrategyProvider(defaults.GetEqualityStrategy) + { + CompareRecordsByValue = defaults.CompareRecordsByValue + }; + isRecursive = defaults.IsRecursive; cyclicReferenceHandling = defaults.CyclicReferenceHandling; allowInfiniteRecursion = defaults.AllowInfiniteRecursion; @@ -87,7 +86,6 @@ protected SelfReferenceEquivalencyAssertionOptions(IEquivalencyAssertionOptions includedFields = defaults.IncludedFields; ignoreNonBrowsableOnSubject = defaults.IgnoreNonBrowsableOnSubject; excludeNonBrowsableOnExpectation = defaults.ExcludeNonBrowsableOnExpectation; - compareRecordsByValue = defaults.CompareRecordsByValue; ConversionSelector = defaults.ConversionSelector.Clone(); @@ -96,7 +94,6 @@ protected SelfReferenceEquivalencyAssertionOptions(IEquivalencyAssertionOptions matchingRules.AddRange(defaults.MatchingRules); OrderingRules = new OrderingRuleCollection(defaults.OrderingRules); - getDefaultEqualityStrategy = defaults.GetEqualityStrategy; TraceWriter = defaults.TraceWriter; RemoveSelectionRule(); @@ -178,42 +175,10 @@ IEnumerable IEquivalencyAssertionOptions.SelectionRules bool IEquivalencyAssertionOptions.ExcludeNonBrowsableOnExpectation => excludeNonBrowsableOnExpectation; - public bool? CompareRecordsByValue => compareRecordsByValue; + public bool? CompareRecordsByValue => equalityStrategyProvider.CompareRecordsByValue; EqualityStrategy IEquivalencyAssertionOptions.GetEqualityStrategy(Type type) - { - // As the valueFactory parameter captures instance members, - // be aware if the cache must be cleared on mutating the members. - return equalityStrategyCache.GetOrAdd(type, typeKey => - { - if (!typeKey.IsPrimitive && referenceTypes.Count > 0 && referenceTypes.Exists(t => typeKey.IsSameOrInherits(t))) - { - return EqualityStrategy.ForceMembers; - } - else if (valueTypes.Count > 0 && valueTypes.Exists(t => typeKey.IsSameOrInherits(t))) - { - return EqualityStrategy.ForceEquals; - } - else if (!typeKey.IsPrimitive && referenceTypes.Count > 0 && referenceTypes.Exists(t => typeKey.IsAssignableToOpenGeneric(t))) - { - return EqualityStrategy.ForceMembers; - } - else if (valueTypes.Count > 0 && valueTypes.Exists(t => typeKey.IsAssignableToOpenGeneric(t))) - { - return EqualityStrategy.ForceEquals; - } - else if ((compareRecordsByValue.HasValue || getDefaultEqualityStrategy is null) && typeKey.IsRecord()) - { - return compareRecordsByValue is true ? EqualityStrategy.ForceEquals : EqualityStrategy.ForceMembers; - } - else if (getDefaultEqualityStrategy is not null) - { - return getDefaultEqualityStrategy(typeKey); - } - - return typeKey.HasValueSemantics() ? EqualityStrategy.Equals : EqualityStrategy.Members; - }); - } + => equalityStrategyProvider.GetEqualityStrategy(type); public ITraceWriter TraceWriter { get; private set; } @@ -603,8 +568,7 @@ public TSelf ComparingEnumsByValue() /// public TSelf ComparingRecordsByValue() { - compareRecordsByValue = true; - equalityStrategyCache.Clear(); + equalityStrategyProvider.CompareRecordsByValue = true; return (TSelf)this; } @@ -617,8 +581,7 @@ public TSelf ComparingRecordsByValue() /// public TSelf ComparingRecordsByMembers() { - compareRecordsByValue = false; - equalityStrategyCache.Clear(); + equalityStrategyProvider.CompareRecordsByValue = false; return (TSelf)this; } @@ -642,14 +605,12 @@ public TSelf ComparingByMembers(Type type) throw new InvalidOperationException($"Cannot compare a primitive type such as {type.Name} by its members"); } - if (valueTypes.Exists(t => type.IsSameOrInherits(t))) + if (!equalityStrategyProvider.AddReferenceType(type)) { throw new InvalidOperationException( $"Can't compare {type.Name} by its members if it already setup to be compared by value"); } - referenceTypes.Add(type); - equalityStrategyCache.Clear(); return (TSelf)this; } @@ -668,14 +629,12 @@ public TSelf ComparingByValue(Type type) { Guard.ThrowIfArgumentIsNull(type); - if (referenceTypes.Exists(t => type.IsSameOrInherits(t))) + if (!equalityStrategyProvider.AddValueType(type)) { throw new InvalidOperationException( $"Can't compare {type.Name} by value if it already setup to be compared by its members"); } - valueTypes.Add(type); - equalityStrategyCache.Clear(); return (TSelf)this; } @@ -755,26 +714,8 @@ public override string ToString() builder .AppendLine("- Compare tuples by their properties") - .AppendLine("- Compare anonymous types by their properties"); - - if (compareRecordsByValue is true) - { - builder.AppendLine("- Compare records by value"); - } - else - { - builder.AppendLine("- Compare records by their members"); - } - - foreach (Type valueType in valueTypes) - { - builder.AppendLine(CultureInfo.InvariantCulture, $"- Compare {valueType} by value"); - } - - foreach (Type type in referenceTypes) - { - builder.AppendLine(CultureInfo.InvariantCulture, $"- Compare {type} by its members"); - } + .AppendLine("- Compare anonymous types by their properties") + .Append(equalityStrategyProvider); if (excludeNonBrowsableOnExpectation) { From 57d8ea1e2bbf5e12a511714a0b9f822c4a8940c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sat, 4 Nov 2023 17:31:42 +0100 Subject: [PATCH 158/845] Rename `EquivalencyAssertionOptions` to `EquivalencyOptions` (#2414) --- Src/FluentAssertions/AssertionOptions.cs | 8 +- .../GenericCollectionAssertions.cs | 42 +++++----- .../GenericDictionaryAssertions.cs | 8 +- .../Collections/StringCollectionAssertions.cs | 16 ++-- .../Equivalency/Comparands.cs | 2 +- ...ertionOptions.cs => EquivalencyOptions.cs} | 40 ++++------ .../EquivalencyValidationContext.cs | 4 +- .../Equivalency/EquivalencyValidator.cs | 2 +- ...cs => CollectionMemberOptionsDecorator.cs} | 6 +- ...rtionOptions.cs => IEquivalencyOptions.cs} | 4 +- .../IEquivalencyValidationContext.cs | 4 +- .../Equivalency/IMemberMatchingRule.cs | 2 +- .../Matching/MappedMemberMatchingRule.cs | 2 +- .../Matching/MappedPathMatchingRule.cs | 2 +- .../Matching/MustMatchByNameRule.cs | 2 +- .../Matching/TryMatchByNameRule.cs | 2 +- .../Equivalency/MemberSelectionContext.cs | 4 +- .../NestedExclusionOptionBuilder.cs | 14 ++-- ....cs => SelfReferenceEquivalencyOptions.cs} | 38 ++++----- .../Steps/GenericDictionaryEquivalencyStep.cs | 4 +- .../StructuralEqualityEquivalencyStep.cs | 6 +- .../Numeric/ComparableTypeAssertions.cs | 8 +- .../ObjectAssertionsExtensions.cs | 8 +- .../Primitives/ObjectAssertions.cs | 14 ++-- .../FluentAssertions/net47.verified.txt | 80 +++++++++---------- .../FluentAssertions/net6.0.verified.txt | 80 +++++++++---------- .../netstandard2.0.verified.txt | 80 +++++++++---------- .../netstandard2.1.verified.txt | 80 +++++++++---------- .../UsersOfGetClosedGenericInterfaces.cs | 4 +- .../ExtensibilitySpecs.cs | 2 +- .../AssertionOptionsSpecs.cs | 10 +-- docs/_pages/releases.md | 5 ++ 32 files changed, 291 insertions(+), 292 deletions(-) rename Src/FluentAssertions/Equivalency/{EquivalencyAssertionOptions.cs => EquivalencyOptions.cs} (84%) rename Src/FluentAssertions/Equivalency/Execution/{CollectionMemberAssertionOptionsDecorator.cs => CollectionMemberOptionsDecorator.cs} (90%) rename Src/FluentAssertions/Equivalency/{IEquivalencyAssertionOptions.cs => IEquivalencyOptions.cs} (96%) rename Src/FluentAssertions/Equivalency/{SelfReferenceEquivalencyAssertionOptions.cs => SelfReferenceEquivalencyOptions.cs} (94%) diff --git a/Src/FluentAssertions/AssertionOptions.cs b/Src/FluentAssertions/AssertionOptions.cs index 7f30d1b36a..da44d66a09 100644 --- a/Src/FluentAssertions/AssertionOptions.cs +++ b/Src/FluentAssertions/AssertionOptions.cs @@ -10,7 +10,7 @@ namespace FluentAssertions; /// public static class AssertionOptions { - private static EquivalencyAssertionOptions defaults = new(); + private static EquivalencyOptions defaults = new(); static AssertionOptions() { @@ -21,9 +21,9 @@ static AssertionOptions() /// /// Creates a clone of the default options and allows the caller to modify them. /// - public static EquivalencyAssertionOptions CloneDefaults() + public static EquivalencyOptions CloneDefaults() { - return new EquivalencyAssertionOptions(defaults); + return new EquivalencyOptions(defaults); } /// @@ -38,7 +38,7 @@ public static EquivalencyAssertionOptions CloneDefaults() /// /// is . public static void AssertEquivalencyUsing( - Func defaultsConfigurer) + Func defaultsConfigurer) { Guard.ThrowIfArgumentIsNull(defaultsConfigurer); diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index 91bb48638c..fd2b8bfa97 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -164,9 +164,9 @@ public AndConstraint AllBeEquivalentTo(TExpectation e /// /// The expected element. /// - /// A reference to the configuration object that can be used + /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the + /// class. The global defaults are determined by the /// class. /// /// @@ -178,7 +178,7 @@ public AndConstraint AllBeEquivalentTo(TExpectation e /// /// is . public AndConstraint AllBeEquivalentTo(TExpectation expectation, - Func, EquivalencyAssertionOptions> config, + Func, EquivalencyOptions> config, string because = "", params object[] becauseArgs) { @@ -192,7 +192,7 @@ public AndConstraint AllBeEquivalentTo(TExpectation e // in case user needs to use them. Strict ordering improves algorithmic complexity // from O(n^2) to O(n). For bigger tables it is necessary in order to achieve acceptable // execution times. - Func, EquivalencyAssertionOptions> forceStrictOrderingConfig = + Func, EquivalencyOptions> forceStrictOrderingConfig = x => config(x).WithStrictOrderingFor(s => string.IsNullOrEmpty(s.Path)); return BeEquivalentTo(repeatedExpectation, forceStrictOrderingConfig, because, becauseArgs); @@ -338,9 +338,9 @@ public AndConstraint BeEquivalentTo(IEnumerable /// An with the expected elements. /// - /// A reference to the configuration object that can be used + /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the + /// class. The global defaults are determined by the /// class. /// /// @@ -352,12 +352,12 @@ public AndConstraint BeEquivalentTo(IEnumerable /// is . public AndConstraint BeEquivalentTo(IEnumerable expectation, - Func, EquivalencyAssertionOptions> config, string because = "", + Func, EquivalencyOptions> config, string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); - EquivalencyAssertionOptions> options = + EquivalencyOptions> options = config(AssertionOptions.CloneDefaults()).AsCollection(); var context = @@ -853,9 +853,9 @@ public AndWhichConstraint ContainEquivalentOf(TExp /// /// The expected element. /// - /// A reference to the configuration object that can be used + /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the + /// class. The global defaults are determined by the /// class. /// /// @@ -867,8 +867,8 @@ public AndWhichConstraint ContainEquivalentOf(TExp /// /// is . public AndWhichConstraint ContainEquivalentOf(TExpectation expectation, - Func, - EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) + Func, + EquivalencyOptions> config, string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -879,7 +879,7 @@ public AndWhichConstraint ContainEquivalentOf(TExp if (success) { - EquivalencyAssertionOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); using var scope = new AssertionScope(); scope.AddReportable("configuration", () => options.ToString()); @@ -1816,9 +1816,9 @@ public AndConstraint NotBeEquivalentTo(IEnumerable /// An with the unexpected elements. /// /// - /// A reference to the configuration object that can be used + /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the + /// class. The global defaults are determined by the /// class. /// /// @@ -1829,7 +1829,7 @@ public AndConstraint NotBeEquivalentTo(IEnumerable. /// public AndConstraint NotBeEquivalentTo(IEnumerable unexpected, - Func, EquivalencyAssertionOptions> config, + Func, EquivalencyOptions> config, string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot verify inequivalence against a collection."); @@ -2336,9 +2336,9 @@ public AndConstraint NotContainEquivalentOf(TExpectat /// /// The unexpected element. /// - /// A reference to the configuration object that can be used + /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the + /// class. The global defaults are determined by the /// class. /// /// @@ -2351,8 +2351,8 @@ public AndConstraint NotContainEquivalentOf(TExpectat /// is . [SuppressMessage("Design", "MA0051:Method is too long", Justification = "Needs refactoring")] public AndConstraint NotContainEquivalentOf(TExpectation unexpected, - Func, - EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) + Func, + EquivalencyOptions> config, string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -2364,7 +2364,7 @@ public AndConstraint NotContainEquivalentOf(TExpectat if (success) { - EquivalencyAssertionOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); var foundIndices = new List(); diff --git a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs index bff6dd4974..5f758f5734 100644 --- a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs @@ -198,9 +198,9 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// /// The expected element. /// - /// A reference to the configuration object that can be used + /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the + /// class. The global defaults are determined by the /// class. /// /// @@ -212,12 +212,12 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// /// is . public AndConstraint BeEquivalentTo(TExpectation expectation, - Func, EquivalencyAssertionOptions> config, string because = "", + Func, EquivalencyOptions> config, string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); - EquivalencyAssertionOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); var context = new EquivalencyValidationContext(Node.From(() => AssertionScope.Current.CallerIdentity), options) diff --git a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs index 070d50399f..6a3d0ac7c3 100644 --- a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs @@ -107,9 +107,9 @@ public AndConstraint BeEquivalentTo(IEnumerable expectation /// /// An with the expected elements. /// - /// A reference to the configuration object that can be used + /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the + /// class. The global defaults are determined by the /// class. /// /// @@ -121,12 +121,12 @@ public AndConstraint BeEquivalentTo(IEnumerable expectation /// /// is . public AndConstraint BeEquivalentTo(IEnumerable expectation, - Func, EquivalencyAssertionOptions> config, string because = "", + Func, EquivalencyOptions> config, string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); - EquivalencyAssertionOptions> + EquivalencyOptions> options = config(AssertionOptions.CloneDefaults()).AsCollection(); var context = @@ -170,9 +170,9 @@ public AndConstraint AllBe(string expectation, /// /// An expected . /// - /// A reference to the configuration object that can be used + /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the + /// class. The global defaults are determined by the /// class. /// /// @@ -184,7 +184,7 @@ public AndConstraint AllBe(string expectation, /// /// is . public AndConstraint AllBe(string expectation, - Func, EquivalencyAssertionOptions> config, + Func, EquivalencyOptions> config, string because = "", params object[] becauseArgs) { @@ -198,7 +198,7 @@ public AndConstraint AllBe(string expectation, // in case user needs to use them. Strict ordering improves algorithmic complexity // from O(n^2) to O(n). For bigger tables it is necessary in order to achieve acceptable // execution times. - Func, EquivalencyAssertionOptions> forceStringOrderingConfig = + Func, EquivalencyOptions> forceStringOrderingConfig = x => config(x).WithStrictOrderingFor(s => string.IsNullOrEmpty(s.Path)); return BeEquivalentTo(repeatedExpectation, forceStringOrderingConfig, because, becauseArgs); diff --git a/Src/FluentAssertions/Equivalency/Comparands.cs b/Src/FluentAssertions/Equivalency/Comparands.cs index 62c09762c3..af121392ab 100644 --- a/Src/FluentAssertions/Equivalency/Comparands.cs +++ b/Src/FluentAssertions/Equivalency/Comparands.cs @@ -62,7 +62,7 @@ public Type RuntimeType /// /// If the expectation is a nullable type, it should return the type of the wrapped object. /// - public Type GetExpectedType(IEquivalencyAssertionOptions options) + public Type GetExpectedType(IEquivalencyOptions options) { Type type = options.UseRuntimeTyping ? RuntimeType : CompileTimeType; diff --git a/Src/FluentAssertions/Equivalency/EquivalencyAssertionOptions.cs b/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs similarity index 84% rename from Src/FluentAssertions/Equivalency/EquivalencyAssertionOptions.cs rename to Src/FluentAssertions/Equivalency/EquivalencyOptions.cs index 8094aa0c1f..1c11e6e79f 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyAssertionOptions.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs @@ -1,5 +1,3 @@ -#region - using System; using System.Collections.Generic; using System.Linq.Expressions; @@ -9,23 +7,19 @@ using FluentAssertions.Equivalency.Ordering; using FluentAssertions.Equivalency.Selection; -#endregion - namespace FluentAssertions.Equivalency; -// REFACTOR rename to EquivalencyOptions - /// /// Represents the run-time type-specific behavior of a structural equivalency assertion. /// -public class EquivalencyAssertionOptions - : SelfReferenceEquivalencyAssertionOptions> +public class EquivalencyOptions + : SelfReferenceEquivalencyOptions> { - public EquivalencyAssertionOptions() + public EquivalencyOptions() { } - public EquivalencyAssertionOptions(IEquivalencyAssertionOptions defaults) + public EquivalencyOptions(IEquivalencyOptions defaults) : base(defaults) { } @@ -33,7 +27,7 @@ public EquivalencyAssertionOptions(IEquivalencyAssertionOptions defaults) /// /// Excludes the specified (nested) member from the structural equality check. /// - public EquivalencyAssertionOptions Excluding(Expression> expression) + public EquivalencyOptions Excluding(Expression> expression) { AddSelectionRule(new ExcludeMemberByPathSelectionRule(expression.GetMemberPath())); return this; @@ -57,7 +51,7 @@ public NestedExclusionOptionBuilder For( /// /// This overrides the default behavior of including all declared members. /// - public EquivalencyAssertionOptions Including(Expression> expression) + public EquivalencyOptions Including(Expression> expression) { AddSelectionRule(new IncludeMemberByPathSelectionRule(expression.GetMemberPath())); return this; @@ -67,7 +61,7 @@ public EquivalencyAssertionOptions Including(Expression to be compared in the order /// in which the items appear in the expectation. /// - public EquivalencyAssertionOptions WithStrictOrderingFor( + public EquivalencyOptions WithStrictOrderingFor( Expression> expression) { string expressionMemberPath = expression.GetMemberPath().ToString(); @@ -79,7 +73,7 @@ public EquivalencyAssertionOptions WithStrictOrderingFor( /// Causes the collection identified by to be compared ignoring the order /// in which the items appear in the expectation. /// - public EquivalencyAssertionOptions WithoutStrictOrderingFor( + public EquivalencyOptions WithoutStrictOrderingFor( Expression> expression) { string expressionMemberPath = expression.GetMemberPath().ToString(); @@ -93,10 +87,10 @@ public EquivalencyAssertionOptions WithoutStrictOrderingFor( /// /// Creates a new set of options based on the current instance which acts on a a collection of the . /// - public EquivalencyAssertionOptions> AsCollection() + public EquivalencyOptions> AsCollection() { - return new EquivalencyAssertionOptions>( - new CollectionMemberAssertionOptionsDecorator(this)); + return new EquivalencyOptions>( + new CollectionMemberOptionsDecorator(this)); } /// @@ -110,7 +104,7 @@ public EquivalencyAssertionOptions> AsCollection() /// If the types of the members are different, the usual logic applies depending or not if conversion options were specified. /// Fields can be mapped to properties and vice-versa. /// - public EquivalencyAssertionOptions WithMapping( + public EquivalencyOptions WithMapping( Expression> expectationMemberPath, Expression> subjectMemberPath) { @@ -134,7 +128,7 @@ public EquivalencyAssertionOptions WithMapping( /// if conversion options were specified. /// Fields can be mapped to properties and vice-versa. /// - public EquivalencyAssertionOptions WithMapping( + public EquivalencyOptions WithMapping( string expectationMemberPath, string subjectMemberPath) { @@ -155,7 +149,7 @@ public EquivalencyAssertionOptions WithMapping( /// If the types of the members are different, the usual logic applies depending or not if conversion options were specified. /// Fields can be mapped to properties and vice-versa. /// - public EquivalencyAssertionOptions WithMapping( + public EquivalencyOptions WithMapping( Expression> expectationMember, Expression> subjectMember) { @@ -177,7 +171,7 @@ public EquivalencyAssertionOptions WithMapping - public EquivalencyAssertionOptions WithMapping( + public EquivalencyOptions WithMapping( string expectationMemberName, string subjectMemberName) { @@ -192,9 +186,9 @@ public EquivalencyAssertionOptions WithMapping /// Represents the run-time type-agnostic behavior of a structural equivalency assertion. /// -public class EquivalencyAssertionOptions : SelfReferenceEquivalencyAssertionOptions +public class EquivalencyOptions : SelfReferenceEquivalencyOptions { - public EquivalencyAssertionOptions() + public EquivalencyOptions() { IncludingNestedObjects(); diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs index 5ebbe576b1..9d7215a971 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs @@ -12,7 +12,7 @@ public class EquivalencyValidationContext : IEquivalencyValidationContext { private Tracer tracer; - public EquivalencyValidationContext(INode root, IEquivalencyAssertionOptions options) + public EquivalencyValidationContext(INode root, IEquivalencyOptions options) { Options = options; CurrentNode = root; @@ -25,7 +25,7 @@ public EquivalencyValidationContext(INode root, IEquivalencyAssertionOptions opt public Tracer Tracer => tracer ??= new Tracer(CurrentNode, TraceWriter); - public IEquivalencyAssertionOptions Options { get; } + public IEquivalencyOptions Options { get; } private CyclicReferenceDetector CyclicReferenceDetector { get; set; } diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs index 332c2a185f..843774645b 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs @@ -42,7 +42,7 @@ public void RecursivelyAssertEquality(Comparands comparands, IEquivalencyValidat } } - private static bool ShouldContinueThisDeep(INode currentNode, IEquivalencyAssertionOptions options, + private static bool ShouldContinueThisDeep(INode currentNode, IEquivalencyOptions options, AssertionScope assertionScope) { bool shouldRecurse = options.AllowInfiniteRecursion || currentNode.Depth <= MaxDepth; diff --git a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberAssertionOptionsDecorator.cs b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs similarity index 90% rename from Src/FluentAssertions/Equivalency/Execution/CollectionMemberAssertionOptionsDecorator.cs rename to Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs index 93917bb3aa..760553caf9 100644 --- a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberAssertionOptionsDecorator.cs +++ b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs @@ -10,11 +10,11 @@ namespace FluentAssertions.Equivalency.Execution; /// /// Ensures that all the rules remove the collection index from the path before processing it further. /// -internal class CollectionMemberAssertionOptionsDecorator : IEquivalencyAssertionOptions +internal class CollectionMemberOptionsDecorator : IEquivalencyOptions { - private readonly IEquivalencyAssertionOptions inner; + private readonly IEquivalencyOptions inner; - public CollectionMemberAssertionOptionsDecorator(IEquivalencyAssertionOptions inner) + public CollectionMemberOptionsDecorator(IEquivalencyOptions inner) { this.inner = inner; } diff --git a/Src/FluentAssertions/Equivalency/IEquivalencyAssertionOptions.cs b/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs similarity index 96% rename from Src/FluentAssertions/Equivalency/IEquivalencyAssertionOptions.cs rename to Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs index b0ceeb4e2c..340cf5c2f7 100644 --- a/Src/FluentAssertions/Equivalency/IEquivalencyAssertionOptions.cs +++ b/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs @@ -6,9 +6,9 @@ namespace FluentAssertions.Equivalency; /// -/// Provides the run-time details of the class. +/// Provides the run-time details of the class. /// -public interface IEquivalencyAssertionOptions +public interface IEquivalencyOptions { /// /// Gets an ordered collection of selection rules that define what members (e.g. properties or fields) are included. diff --git a/Src/FluentAssertions/Equivalency/IEquivalencyValidationContext.cs b/Src/FluentAssertions/Equivalency/IEquivalencyValidationContext.cs index 62b4522706..0f17b42e34 100644 --- a/Src/FluentAssertions/Equivalency/IEquivalencyValidationContext.cs +++ b/Src/FluentAssertions/Equivalency/IEquivalencyValidationContext.cs @@ -21,11 +21,11 @@ public interface IEquivalencyValidationContext /// /// Gets an object that can be used by the equivalency algorithm to provide a trace when the - /// option is used. + /// option is used. /// Tracer Tracer { get; } - IEquivalencyAssertionOptions Options { get; } + IEquivalencyOptions Options { get; } /// /// Determines whether the specified object reference is a cyclic reference to the same object earlier in the diff --git a/Src/FluentAssertions/Equivalency/IMemberMatchingRule.cs b/Src/FluentAssertions/Equivalency/IMemberMatchingRule.cs index 20fd81b316..00f1dbcdad 100644 --- a/Src/FluentAssertions/Equivalency/IMemberMatchingRule.cs +++ b/Src/FluentAssertions/Equivalency/IMemberMatchingRule.cs @@ -27,5 +27,5 @@ public interface IMemberMatchingRule /// Returns the of the property with which to compare the subject with, or /// if no match was found. /// - IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyAssertionOptions options); + IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options); } diff --git a/Src/FluentAssertions/Equivalency/Matching/MappedMemberMatchingRule.cs b/Src/FluentAssertions/Equivalency/Matching/MappedMemberMatchingRule.cs index a324bf0bc3..51b6c43a2b 100644 --- a/Src/FluentAssertions/Equivalency/Matching/MappedMemberMatchingRule.cs +++ b/Src/FluentAssertions/Equivalency/Matching/MappedMemberMatchingRule.cs @@ -29,7 +29,7 @@ public MappedMemberMatchingRule(string expectationMemberName, string subjectMemb this.subjectMemberName = subjectMemberName; } - public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyAssertionOptions options) + public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options) { if (parent.Type.IsSameOrInherits(typeof(TExpectation)) && subject is TSubject && expectedMember.Name == expectationMemberName) diff --git a/Src/FluentAssertions/Equivalency/Matching/MappedPathMatchingRule.cs b/Src/FluentAssertions/Equivalency/Matching/MappedPathMatchingRule.cs index f612908757..ded3bcaa9f 100644 --- a/Src/FluentAssertions/Equivalency/Matching/MappedPathMatchingRule.cs +++ b/Src/FluentAssertions/Equivalency/Matching/MappedPathMatchingRule.cs @@ -42,7 +42,7 @@ public MappedPathMatchingRule(string expectationMemberPath, string subjectMember } } - public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyAssertionOptions options) + public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options) { MemberPath path = expectationPath; diff --git a/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs b/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs index 62a68d4fb9..36d220c195 100644 --- a/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs +++ b/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs @@ -9,7 +9,7 @@ namespace FluentAssertions.Equivalency.Matching; /// internal class MustMatchByNameRule : IMemberMatchingRule { - public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyAssertionOptions options) + public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options) { IMember subjectMember = null; diff --git a/Src/FluentAssertions/Equivalency/Matching/TryMatchByNameRule.cs b/Src/FluentAssertions/Equivalency/Matching/TryMatchByNameRule.cs index 36f817acb8..06cabfdf60 100644 --- a/Src/FluentAssertions/Equivalency/Matching/TryMatchByNameRule.cs +++ b/Src/FluentAssertions/Equivalency/Matching/TryMatchByNameRule.cs @@ -8,7 +8,7 @@ namespace FluentAssertions.Equivalency.Matching; /// internal class TryMatchByNameRule : IMemberMatchingRule { - public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyAssertionOptions options) + public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options) { if (options.IncludedProperties != MemberVisibility.None) { diff --git a/Src/FluentAssertions/Equivalency/MemberSelectionContext.cs b/Src/FluentAssertions/Equivalency/MemberSelectionContext.cs index 4974e4b5aa..2e5417bf16 100644 --- a/Src/FluentAssertions/Equivalency/MemberSelectionContext.cs +++ b/Src/FluentAssertions/Equivalency/MemberSelectionContext.cs @@ -10,9 +10,9 @@ public class MemberSelectionContext { private readonly Type compileTimeType; private readonly Type runtimeType; - private readonly IEquivalencyAssertionOptions options; + private readonly IEquivalencyOptions options; - public MemberSelectionContext(Type compileTimeType, Type runtimeType, IEquivalencyAssertionOptions options) + public MemberSelectionContext(Type compileTimeType, Type runtimeType, IEquivalencyOptions options) { this.runtimeType = runtimeType; this.compileTimeType = compileTimeType; diff --git a/Src/FluentAssertions/Equivalency/NestedExclusionOptionBuilder.cs b/Src/FluentAssertions/Equivalency/NestedExclusionOptionBuilder.cs index bebf18fba3..f2716a0c7c 100644 --- a/Src/FluentAssertions/Equivalency/NestedExclusionOptionBuilder.cs +++ b/Src/FluentAssertions/Equivalency/NestedExclusionOptionBuilder.cs @@ -9,27 +9,27 @@ namespace FluentAssertions.Equivalency; public class NestedExclusionOptionBuilder { /// - /// The selected path starting at the first . + /// The selected path starting at the first . /// private readonly ExcludeMemberByPathSelectionRule currentPathSelectionRule; - private readonly EquivalencyAssertionOptions capturedAssertionOptions; + private readonly EquivalencyOptions capturedOptions; - internal NestedExclusionOptionBuilder(EquivalencyAssertionOptions capturedAssertionOptions, + internal NestedExclusionOptionBuilder(EquivalencyOptions capturedOptions, ExcludeMemberByPathSelectionRule currentPathSelectionRule) { - this.capturedAssertionOptions = capturedAssertionOptions; + this.capturedOptions = capturedOptions; this.currentPathSelectionRule = currentPathSelectionRule; } /// /// Selects a nested property to exclude. This ends the chain. /// - public EquivalencyAssertionOptions Exclude(Expression> expression) + public EquivalencyOptions Exclude(Expression> expression) { var nextPath = expression.GetMemberPath(); currentPathSelectionRule.AppendPath(nextPath); - return capturedAssertionOptions; + return capturedOptions; } /// @@ -40,6 +40,6 @@ public NestedExclusionOptionBuilder For( { var nextPath = expression.GetMemberPath(); currentPathSelectionRule.AppendPath(nextPath); - return new NestedExclusionOptionBuilder(capturedAssertionOptions, currentPathSelectionRule); + return new NestedExclusionOptionBuilder(capturedOptions, currentPathSelectionRule); } } diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyAssertionOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs similarity index 94% rename from Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyAssertionOptions.cs rename to Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index 3246847d7b..f3e9fe9c62 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyAssertionOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -20,8 +20,8 @@ namespace FluentAssertions.Equivalency; /// /// Represents the run-time behavior of a structural equivalency assertion. /// -public abstract class SelfReferenceEquivalencyAssertionOptions : IEquivalencyAssertionOptions - where TSelf : SelfReferenceEquivalencyAssertionOptions +public abstract class SelfReferenceEquivalencyOptions : IEquivalencyOptions + where TSelf : SelfReferenceEquivalencyOptions { #region Private Definitions @@ -58,7 +58,7 @@ public abstract class SelfReferenceEquivalencyAssertionOptions : IEquival #endregion - private protected SelfReferenceEquivalencyAssertionOptions() + private protected SelfReferenceEquivalencyOptions() { equalityStrategyProvider = new EqualityStrategyProvider(); @@ -70,7 +70,7 @@ private protected SelfReferenceEquivalencyAssertionOptions() /// /// Creates an instance of the equivalency assertions options based on defaults previously configured by the caller. /// - protected SelfReferenceEquivalencyAssertionOptions(IEquivalencyAssertionOptions defaults) + protected SelfReferenceEquivalencyOptions(IEquivalencyOptions defaults) { equalityStrategyProvider = new EqualityStrategyProvider(defaults.GetEqualityStrategy) { @@ -103,7 +103,7 @@ protected SelfReferenceEquivalencyAssertionOptions(IEquivalencyAssertionOptions /// /// Gets an ordered collection of selection rules that define what members are included. /// - IEnumerable IEquivalencyAssertionOptions.SelectionRules + IEnumerable IEquivalencyOptions.SelectionRules { get { @@ -135,12 +135,12 @@ IEnumerable IEquivalencyAssertionOptions.SelectionRules /// Gets an ordered collection of matching rules that determine which subject members are matched with which /// expectation members. /// - IEnumerable IEquivalencyAssertionOptions.MatchingRules => matchingRules; + IEnumerable IEquivalencyOptions.MatchingRules => matchingRules; /// /// Gets an ordered collection of Equivalency steps how a subject is compared with the expectation. /// - IEnumerable IEquivalencyAssertionOptions.UserEquivalencySteps => userEquivalencySteps; + IEnumerable IEquivalencyOptions.UserEquivalencySteps => userEquivalencySteps; public ConversionSelector ConversionSelector { get; } = new(); @@ -149,35 +149,35 @@ IEnumerable IEquivalencyAssertionOptions.SelectionRules /// default, /// ordering is irrelevant. /// - OrderingRuleCollection IEquivalencyAssertionOptions.OrderingRules => OrderingRules; + OrderingRuleCollection IEquivalencyOptions.OrderingRules => OrderingRules; /// /// Gets value indicating whether the equality check will include nested collections and complex types. /// - bool IEquivalencyAssertionOptions.IsRecursive => isRecursive; + bool IEquivalencyOptions.IsRecursive => isRecursive; - bool IEquivalencyAssertionOptions.AllowInfiniteRecursion => allowInfiniteRecursion; + bool IEquivalencyOptions.AllowInfiniteRecursion => allowInfiniteRecursion; /// /// Gets value indicating how cyclic references should be handled. By default, it will throw an exception. /// - CyclicReferenceHandling IEquivalencyAssertionOptions.CyclicReferenceHandling => cyclicReferenceHandling; + CyclicReferenceHandling IEquivalencyOptions.CyclicReferenceHandling => cyclicReferenceHandling; - EnumEquivalencyHandling IEquivalencyAssertionOptions.EnumEquivalencyHandling => enumEquivalencyHandling; + EnumEquivalencyHandling IEquivalencyOptions.EnumEquivalencyHandling => enumEquivalencyHandling; - bool IEquivalencyAssertionOptions.UseRuntimeTyping => useRuntimeTyping; + bool IEquivalencyOptions.UseRuntimeTyping => useRuntimeTyping; - MemberVisibility IEquivalencyAssertionOptions.IncludedProperties => includedProperties; + MemberVisibility IEquivalencyOptions.IncludedProperties => includedProperties; - MemberVisibility IEquivalencyAssertionOptions.IncludedFields => includedFields; + MemberVisibility IEquivalencyOptions.IncludedFields => includedFields; - bool IEquivalencyAssertionOptions.IgnoreNonBrowsableOnSubject => ignoreNonBrowsableOnSubject; + bool IEquivalencyOptions.IgnoreNonBrowsableOnSubject => ignoreNonBrowsableOnSubject; - bool IEquivalencyAssertionOptions.ExcludeNonBrowsableOnExpectation => excludeNonBrowsableOnExpectation; + bool IEquivalencyOptions.ExcludeNonBrowsableOnExpectation => excludeNonBrowsableOnExpectation; public bool? CompareRecordsByValue => equalityStrategyProvider.CompareRecordsByValue; - EqualityStrategy IEquivalencyAssertionOptions.GetEqualityStrategy(Type type) + EqualityStrategy IEquivalencyOptions.GetEqualityStrategy(Type type) => equalityStrategyProvider.GetEqualityStrategy(type); public ITraceWriter TraceWriter { get; private set; } @@ -752,7 +752,7 @@ public override string ToString() } /// - /// Defines additional overrides when used with + /// Defines additional overrides when used with /// public class Restriction { diff --git a/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs index a0ad4d364c..1290cc5b59 100644 --- a/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs @@ -11,7 +11,7 @@ public class GenericDictionaryEquivalencyStep : IEquivalencyStep { #pragma warning disable SA1110 // Allow opening parenthesis on new line to reduce line length private static readonly MethodInfo AssertDictionaryEquivalenceMethod = - new Action, IDictionary> (AssertDictionaryEquivalence).GetMethodInfo().GetGenericMethodDefinition(); #pragma warning restore SA1110 @@ -158,7 +158,7 @@ private static void AssertDictionaryEquivalence(Comparands comparands, IEquivale private static void AssertDictionaryEquivalence( EquivalencyValidationContext context, IEquivalencyValidator parent, - IEquivalencyAssertionOptions options, + IEquivalencyOptions options, IDictionary subject, IDictionary expectation) where TExpectedKey : TSubjectKey diff --git a/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs index 4b8091cf94..ddb0e3dfb7 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs @@ -53,7 +53,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon } private static void AssertMemberEquality(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator parent, IMember selectedMember, IEquivalencyAssertionOptions options) + IEquivalencyValidator parent, IMember selectedMember, IEquivalencyOptions options) { IMember matchingMember = FindMatchFor(selectedMember, context.CurrentNode, comparands.Subject, options); @@ -78,7 +78,7 @@ private static void AssertMemberEquality(Comparands comparands, IEquivalencyVali } private static IMember FindMatchFor(IMember selectedMember, INode currentNode, object subject, - IEquivalencyAssertionOptions config) + IEquivalencyOptions config) { IEnumerable query = from rule in config.MatchingRules @@ -95,7 +95,7 @@ where match is not null } private static IEnumerable GetMembersFromExpectation(INode currentNode, Comparands comparands, - IEquivalencyAssertionOptions options) + IEquivalencyOptions options) { IEnumerable members = Enumerable.Empty(); diff --git a/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs b/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs index a847069d59..da9d3a37a0 100644 --- a/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs +++ b/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs @@ -89,9 +89,9 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// /// The expected element. /// - /// A reference to the configuration object that can be used + /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the + /// class. The global defaults are determined by the /// class. /// /// @@ -103,12 +103,12 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// /// is . public AndConstraint BeEquivalentTo(TExpectation expectation, - Func, EquivalencyAssertionOptions> config, string because = "", + Func, EquivalencyOptions> config, string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); - EquivalencyAssertionOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); var context = new EquivalencyValidationContext( Node.From(() => AssertionScope.Current.CallerIdentity), options) diff --git a/Src/FluentAssertions/ObjectAssertionsExtensions.cs b/Src/FluentAssertions/ObjectAssertionsExtensions.cs index 196cf8461d..a2c4e2bdd3 100644 --- a/Src/FluentAssertions/ObjectAssertionsExtensions.cs +++ b/Src/FluentAssertions/ObjectAssertionsExtensions.cs @@ -35,9 +35,9 @@ public static AndConstraint BeDataContractSerializable(this Ob /// /// /// - /// A reference to the configuration object that can be used + /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the + /// class. The global defaults are determined by the /// class. /// /// @@ -49,7 +49,7 @@ public static AndConstraint BeDataContractSerializable(this Ob /// /// is . public static AndConstraint BeDataContractSerializable(this ObjectAssertions assertions, - Func, EquivalencyAssertionOptions> options, string because = "", + Func, EquivalencyOptions> options, string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(options); @@ -58,7 +58,7 @@ public static AndConstraint BeDataContractSerializable(this { var deserializedObject = CreateCloneUsingDataContractSerializer(assertions.Subject); - EquivalencyAssertionOptions defaultOptions = AssertionOptions.CloneDefaults() + EquivalencyOptions defaultOptions = AssertionOptions.CloneDefaults() .RespectingRuntimeTypes().IncludingFields().IncludingProperties(); ((T)deserializedObject).Should().BeEquivalentTo((T)assertions.Subject, _ => options(defaultOptions)); diff --git a/Src/FluentAssertions/Primitives/ObjectAssertions.cs b/Src/FluentAssertions/Primitives/ObjectAssertions.cs index f9c9880f37..1d0cd60bf8 100644 --- a/Src/FluentAssertions/Primitives/ObjectAssertions.cs +++ b/Src/FluentAssertions/Primitives/ObjectAssertions.cs @@ -259,9 +259,9 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// /// The expected element. /// - /// A reference to the configuration object that can be used + /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the + /// class. The global defaults are determined by the /// class. /// /// @@ -273,12 +273,12 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// /// is . public AndConstraint BeEquivalentTo(TExpectation expectation, - Func, EquivalencyAssertionOptions> config, string because = "", + Func, EquivalencyOptions> config, string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); - EquivalencyAssertionOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); var context = new EquivalencyValidationContext(Node.From(() => AssertionScope.Current.CallerIdentity), options) @@ -336,9 +336,9 @@ public AndConstraint NotBeEquivalentTo( /// /// The unexpected element. /// - /// A reference to the configuration object that can be used + /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the + /// class. The global defaults are determined by the /// class. /// /// @@ -351,7 +351,7 @@ public AndConstraint NotBeEquivalentTo( /// is . public AndConstraint NotBeEquivalentTo( TExpectation unexpected, - Func, EquivalencyAssertionOptions> config, + Func, EquivalencyOptions> config, string because = "", params object[] becauseArgs) { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 7a7d238434..71fa616938 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -161,8 +161,8 @@ namespace FluentAssertions { public static FluentAssertions.EquivalencyPlan EquivalencyPlan { get; } public static FluentAssertions.Formatting.FormattingOptions FormattingOptions { get; } - public static void AssertEquivalencyUsing(System.Func defaultsConfigurer) { } - public static FluentAssertions.Equivalency.EquivalencyAssertionOptions CloneDefaults() { } + public static void AssertEquivalencyUsing(System.Func defaultsConfigurer) { } + public static FluentAssertions.Equivalency.EquivalencyOptions CloneDefaults() { } } public static class AsyncAssertionsExtensions { @@ -318,7 +318,7 @@ namespace FluentAssertions public static class ObjectAssertionsExtensions { public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> options, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } } public abstract class OccurrenceConstraint @@ -383,7 +383,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint AllBeAssignableTo(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> AllBeAssignableTo(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint AllBeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllBeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint AllBeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint AllBeOfType(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> AllBeOfType(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint AllSatisfy(System.Action expected, string because = "", params object[] becauseArgs) { } @@ -392,7 +392,7 @@ namespace FluentAssertions.Collections protected void AssertSubjectEquality(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeInAscendingOrder(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeInAscendingOrder(System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeInAscendingOrder(System.Func comparison, string because = "", params object[] becauseArgs) { } @@ -409,7 +409,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndWhichConstraint Contain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint Contain(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint ContainEquivalentOf(TExpectation expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint ContainEquivalentOf(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint ContainEquivalentOf(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint ContainInConsecutiveOrder(params T[] expected) { } public FluentAssertions.AndConstraint ContainInConsecutiveOrder(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint ContainInOrder(params T[] expected) { } @@ -437,7 +437,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint IntersectWith(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInAscendingOrder(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInAscendingOrder(System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInAscendingOrder(System.Func comparison, string because = "", params object[] becauseArgs) { } @@ -454,7 +454,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint NotContain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint NotContain(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainInConsecutiveOrder(params T[] unexpected) { } public FluentAssertions.AndConstraint NotContainInConsecutiveOrder(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainInOrder(params T[] unexpected) { } @@ -492,7 +492,7 @@ namespace FluentAssertions.Collections public GenericDictionaryAssertions(TCollection keyValuePairs) { } protected override string Identifier { get; } 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 BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Contain(params System.Collections.Generic.KeyValuePair[] expected) { } public FluentAssertions.AndConstraint Contain(System.Collections.Generic.IEnumerable> expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Contain(System.Collections.Generic.KeyValuePair expected, string because = "", params object[] becauseArgs) { } @@ -533,10 +533,10 @@ namespace FluentAssertions.Collections { public StringCollectionAssertions(TCollection actualValue) { } public FluentAssertions.AndConstraint AllBe(string expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllBe(string expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint AllBe(string expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(params string[] expectation) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint ContainMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expected) { } public FluentAssertions.AndConstraint Equal(params string[] expected) { } @@ -638,7 +638,7 @@ namespace FluentAssertions.Equivalency public object Expectation { get; set; } public System.Type RuntimeType { get; } public object Subject { get; set; } - public System.Type GetExpectedType(FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } + public System.Type GetExpectedType(FluentAssertions.Equivalency.IEquivalencyOptions options) { } public override string ToString() { } } public class ConversionSelector @@ -668,24 +668,24 @@ namespace FluentAssertions.Equivalency ForceEquals = 2, ForceMembers = 3, } - public class EquivalencyAssertionOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions + public class EquivalencyOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { - public EquivalencyAssertionOptions() { } + public EquivalencyOptions() { } } - public class EquivalencyAssertionOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions> + public class EquivalencyOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions> { - public EquivalencyAssertionOptions() { } - public EquivalencyAssertionOptions(FluentAssertions.Equivalency.IEquivalencyAssertionOptions defaults) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions> AsCollection() { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> expression) { } + public EquivalencyOptions() { } + public EquivalencyOptions(FluentAssertions.Equivalency.IEquivalencyOptions defaults) { } + public FluentAssertions.Equivalency.EquivalencyOptions> AsCollection() { } + public FluentAssertions.Equivalency.EquivalencyOptions Excluding(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.NestedExclusionOptionBuilder For(System.Linq.Expressions.Expression>> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Including(System.Linq.Expressions.Expression> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(string expectationMemberPath, string subjectMemberPath) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(System.Linq.Expressions.Expression> expectationMemberPath, System.Linq.Expressions.Expression> subjectMemberPath) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(System.Linq.Expressions.Expression> expectationMember, System.Linq.Expressions.Expression> subjectMember) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(string expectationMemberName, string subjectMemberName) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithoutStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } + public FluentAssertions.Equivalency.EquivalencyOptions Including(System.Linq.Expressions.Expression> expression) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithMapping(string expectationMemberPath, string subjectMemberPath) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithMapping(System.Linq.Expressions.Expression> expectationMemberPath, System.Linq.Expressions.Expression> subjectMemberPath) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithMapping(System.Linq.Expressions.Expression> expectationMember, System.Linq.Expressions.Expression> subjectMember) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithMapping(string expectationMemberName, string subjectMemberName) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithoutStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } } public enum EquivalencyResult { @@ -700,9 +700,9 @@ namespace FluentAssertions.Equivalency } public class EquivalencyValidationContext : FluentAssertions.Equivalency.IEquivalencyValidationContext { - public EquivalencyValidationContext(FluentAssertions.Equivalency.INode root, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } + public EquivalencyValidationContext(FluentAssertions.Equivalency.INode root, FluentAssertions.Equivalency.IEquivalencyOptions options) { } public FluentAssertions.Equivalency.INode CurrentNode { get; } - public FluentAssertions.Equivalency.IEquivalencyAssertionOptions Options { get; } + public FluentAssertions.Equivalency.IEquivalencyOptions Options { get; } public FluentAssertions.Execution.Reason Reason { get; set; } public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; set; } public FluentAssertions.Equivalency.Tracing.Tracer Tracer { get; } @@ -740,7 +740,7 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.INode SelectedNode { get; } TSubject Subject { get; } } - public interface IEquivalencyAssertionOptions + public interface IEquivalencyOptions { bool AllowInfiniteRecursion { get; } bool? CompareRecordsByValue { get; } @@ -767,7 +767,7 @@ namespace FluentAssertions.Equivalency public interface IEquivalencyValidationContext { FluentAssertions.Equivalency.INode CurrentNode { get; } - FluentAssertions.Equivalency.IEquivalencyAssertionOptions Options { get; } + FluentAssertions.Equivalency.IEquivalencyOptions Options { get; } FluentAssertions.Execution.Reason Reason { get; } FluentAssertions.Equivalency.Tracing.Tracer Tracer { get; } FluentAssertions.Equivalency.IEquivalencyValidationContext AsCollectionItem(string index); @@ -800,7 +800,7 @@ namespace FluentAssertions.Equivalency } public interface IMemberMatchingRule { - FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options); + FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyOptions options); } public interface IMemberSelectionRule { @@ -839,7 +839,7 @@ namespace FluentAssertions.Equivalency } public class MemberSelectionContext { - public MemberSelectionContext(System.Type compileTimeType, System.Type runtimeType, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } + public MemberSelectionContext(System.Type compileTimeType, System.Type runtimeType, FluentAssertions.Equivalency.IEquivalencyOptions options) { } public FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } public FluentAssertions.Equivalency.MemberVisibility IncludedProperties { get; } public System.Type Type { get; } @@ -854,7 +854,7 @@ namespace FluentAssertions.Equivalency } public class NestedExclusionOptionBuilder { - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Exclude(System.Linq.Expressions.Expression> expression) { } + public FluentAssertions.Equivalency.EquivalencyOptions Exclude(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.NestedExclusionOptionBuilder For(System.Linq.Expressions.Expression>> expression) { } } public class Node : FluentAssertions.Equivalency.INode @@ -903,10 +903,10 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } public object GetValue(object obj) { } } - public abstract class SelfReferenceEquivalencyAssertionOptions : FluentAssertions.Equivalency.IEquivalencyAssertionOptions - where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions + public abstract class SelfReferenceEquivalencyOptions : FluentAssertions.Equivalency.IEquivalencyOptions + where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { - protected SelfReferenceEquivalencyAssertionOptions(FluentAssertions.Equivalency.IEquivalencyAssertionOptions defaults) { } + protected SelfReferenceEquivalencyOptions(FluentAssertions.Equivalency.IEquivalencyOptions defaults) { } public bool? CompareRecordsByValue { get; } public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] @@ -947,7 +947,7 @@ namespace FluentAssertions.Equivalency public TSelf Using(FluentAssertions.Equivalency.IMemberMatchingRule matchingRule) { } public TSelf Using(FluentAssertions.Equivalency.IMemberSelectionRule selectionRule) { } public TSelf Using(FluentAssertions.Equivalency.IOrderingRule orderingRule) { } - public FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions.Restriction Using(System.Action> action) { } + public FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions.Restriction Using(System.Action> action) { } public TSelf Using(System.Collections.Generic.IEqualityComparer comparer) { } public TSelf Using() where TEqualityComparer : System.Collections.Generic.IEqualityComparer, new () { } @@ -1592,7 +1592,7 @@ namespace FluentAssertions.Numeric protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(T 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 BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } @@ -1958,7 +1958,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(TSubject expected, System.Collections.Generic.IEqualityComparer comparer, 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 BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> 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 FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } @@ -1966,7 +1966,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBe(TSubject unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(TSubject unexpected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } } public abstract class ReferenceTypeAssertions where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 8ab95145fa..6d29bd1c3a 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -174,8 +174,8 @@ namespace FluentAssertions { public static FluentAssertions.EquivalencyPlan EquivalencyPlan { get; } public static FluentAssertions.Formatting.FormattingOptions FormattingOptions { get; } - public static void AssertEquivalencyUsing(System.Func defaultsConfigurer) { } - public static FluentAssertions.Equivalency.EquivalencyAssertionOptions CloneDefaults() { } + public static void AssertEquivalencyUsing(System.Func defaultsConfigurer) { } + public static FluentAssertions.Equivalency.EquivalencyOptions CloneDefaults() { } } public static class AsyncAssertionsExtensions { @@ -331,7 +331,7 @@ namespace FluentAssertions public static class ObjectAssertionsExtensions { public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> options, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } } public abstract class OccurrenceConstraint @@ -396,7 +396,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint AllBeAssignableTo(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> AllBeAssignableTo(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint AllBeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllBeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint AllBeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint AllBeOfType(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> AllBeOfType(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint AllSatisfy(System.Action expected, string because = "", params object[] becauseArgs) { } @@ -405,7 +405,7 @@ namespace FluentAssertions.Collections protected void AssertSubjectEquality(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeInAscendingOrder(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeInAscendingOrder(System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeInAscendingOrder(System.Func comparison, string because = "", params object[] becauseArgs) { } @@ -422,7 +422,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndWhichConstraint Contain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint Contain(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint ContainEquivalentOf(TExpectation expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint ContainEquivalentOf(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint ContainEquivalentOf(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint ContainInConsecutiveOrder(params T[] expected) { } public FluentAssertions.AndConstraint ContainInConsecutiveOrder(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint ContainInOrder(params T[] expected) { } @@ -450,7 +450,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint IntersectWith(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInAscendingOrder(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInAscendingOrder(System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInAscendingOrder(System.Func comparison, string because = "", params object[] becauseArgs) { } @@ -467,7 +467,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint NotContain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint NotContain(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainInConsecutiveOrder(params T[] unexpected) { } public FluentAssertions.AndConstraint NotContainInConsecutiveOrder(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainInOrder(params T[] unexpected) { } @@ -505,7 +505,7 @@ namespace FluentAssertions.Collections public GenericDictionaryAssertions(TCollection keyValuePairs) { } protected override string Identifier { get; } 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 BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Contain(params System.Collections.Generic.KeyValuePair[] expected) { } public FluentAssertions.AndConstraint Contain(System.Collections.Generic.IEnumerable> expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Contain(System.Collections.Generic.KeyValuePair expected, string because = "", params object[] becauseArgs) { } @@ -546,10 +546,10 @@ namespace FluentAssertions.Collections { public StringCollectionAssertions(TCollection actualValue) { } public FluentAssertions.AndConstraint AllBe(string expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllBe(string expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint AllBe(string expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(params string[] expectation) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint ContainMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expected) { } public FluentAssertions.AndConstraint Equal(params string[] expected) { } @@ -651,7 +651,7 @@ namespace FluentAssertions.Equivalency public object Expectation { get; set; } public System.Type RuntimeType { get; } public object Subject { get; set; } - public System.Type GetExpectedType(FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } + public System.Type GetExpectedType(FluentAssertions.Equivalency.IEquivalencyOptions options) { } public override string ToString() { } } public class ConversionSelector @@ -681,24 +681,24 @@ namespace FluentAssertions.Equivalency ForceEquals = 2, ForceMembers = 3, } - public class EquivalencyAssertionOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions + public class EquivalencyOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { - public EquivalencyAssertionOptions() { } + public EquivalencyOptions() { } } - public class EquivalencyAssertionOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions> + public class EquivalencyOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions> { - public EquivalencyAssertionOptions() { } - public EquivalencyAssertionOptions(FluentAssertions.Equivalency.IEquivalencyAssertionOptions defaults) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions> AsCollection() { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> expression) { } + public EquivalencyOptions() { } + public EquivalencyOptions(FluentAssertions.Equivalency.IEquivalencyOptions defaults) { } + public FluentAssertions.Equivalency.EquivalencyOptions> AsCollection() { } + public FluentAssertions.Equivalency.EquivalencyOptions Excluding(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.NestedExclusionOptionBuilder For(System.Linq.Expressions.Expression>> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Including(System.Linq.Expressions.Expression> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(string expectationMemberPath, string subjectMemberPath) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(System.Linq.Expressions.Expression> expectationMemberPath, System.Linq.Expressions.Expression> subjectMemberPath) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(System.Linq.Expressions.Expression> expectationMember, System.Linq.Expressions.Expression> subjectMember) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(string expectationMemberName, string subjectMemberName) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithoutStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } + public FluentAssertions.Equivalency.EquivalencyOptions Including(System.Linq.Expressions.Expression> expression) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithMapping(string expectationMemberPath, string subjectMemberPath) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithMapping(System.Linq.Expressions.Expression> expectationMemberPath, System.Linq.Expressions.Expression> subjectMemberPath) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithMapping(System.Linq.Expressions.Expression> expectationMember, System.Linq.Expressions.Expression> subjectMember) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithMapping(string expectationMemberName, string subjectMemberName) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithoutStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } } public enum EquivalencyResult { @@ -713,9 +713,9 @@ namespace FluentAssertions.Equivalency } public class EquivalencyValidationContext : FluentAssertions.Equivalency.IEquivalencyValidationContext { - public EquivalencyValidationContext(FluentAssertions.Equivalency.INode root, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } + public EquivalencyValidationContext(FluentAssertions.Equivalency.INode root, FluentAssertions.Equivalency.IEquivalencyOptions options) { } public FluentAssertions.Equivalency.INode CurrentNode { get; } - public FluentAssertions.Equivalency.IEquivalencyAssertionOptions Options { get; } + public FluentAssertions.Equivalency.IEquivalencyOptions Options { get; } public FluentAssertions.Execution.Reason Reason { get; set; } public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; set; } public FluentAssertions.Equivalency.Tracing.Tracer Tracer { get; } @@ -753,7 +753,7 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.INode SelectedNode { get; } TSubject Subject { get; } } - public interface IEquivalencyAssertionOptions + public interface IEquivalencyOptions { bool AllowInfiniteRecursion { get; } bool? CompareRecordsByValue { get; } @@ -780,7 +780,7 @@ namespace FluentAssertions.Equivalency public interface IEquivalencyValidationContext { FluentAssertions.Equivalency.INode CurrentNode { get; } - FluentAssertions.Equivalency.IEquivalencyAssertionOptions Options { get; } + FluentAssertions.Equivalency.IEquivalencyOptions Options { get; } FluentAssertions.Execution.Reason Reason { get; } FluentAssertions.Equivalency.Tracing.Tracer Tracer { get; } FluentAssertions.Equivalency.IEquivalencyValidationContext AsCollectionItem(string index); @@ -813,7 +813,7 @@ namespace FluentAssertions.Equivalency } public interface IMemberMatchingRule { - FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options); + FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyOptions options); } public interface IMemberSelectionRule { @@ -852,7 +852,7 @@ namespace FluentAssertions.Equivalency } public class MemberSelectionContext { - public MemberSelectionContext(System.Type compileTimeType, System.Type runtimeType, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } + public MemberSelectionContext(System.Type compileTimeType, System.Type runtimeType, FluentAssertions.Equivalency.IEquivalencyOptions options) { } public FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } public FluentAssertions.Equivalency.MemberVisibility IncludedProperties { get; } public System.Type Type { get; } @@ -867,7 +867,7 @@ namespace FluentAssertions.Equivalency } public class NestedExclusionOptionBuilder { - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Exclude(System.Linq.Expressions.Expression> expression) { } + public FluentAssertions.Equivalency.EquivalencyOptions Exclude(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.NestedExclusionOptionBuilder For(System.Linq.Expressions.Expression>> expression) { } } public class Node : FluentAssertions.Equivalency.INode @@ -916,10 +916,10 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } public object GetValue(object obj) { } } - public abstract class SelfReferenceEquivalencyAssertionOptions : FluentAssertions.Equivalency.IEquivalencyAssertionOptions - where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions + public abstract class SelfReferenceEquivalencyOptions : FluentAssertions.Equivalency.IEquivalencyOptions + where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { - protected SelfReferenceEquivalencyAssertionOptions(FluentAssertions.Equivalency.IEquivalencyAssertionOptions defaults) { } + protected SelfReferenceEquivalencyOptions(FluentAssertions.Equivalency.IEquivalencyOptions defaults) { } public bool? CompareRecordsByValue { get; } public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] @@ -960,7 +960,7 @@ namespace FluentAssertions.Equivalency public TSelf Using(FluentAssertions.Equivalency.IMemberMatchingRule matchingRule) { } public TSelf Using(FluentAssertions.Equivalency.IMemberSelectionRule selectionRule) { } public TSelf Using(FluentAssertions.Equivalency.IOrderingRule orderingRule) { } - public FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions.Restriction Using(System.Action> action) { } + public FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions.Restriction Using(System.Action> action) { } public TSelf Using(System.Collections.Generic.IEqualityComparer comparer) { } public TSelf Using() where TEqualityComparer : System.Collections.Generic.IEqualityComparer, new () { } @@ -1617,7 +1617,7 @@ namespace FluentAssertions.Numeric protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(T 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 BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } @@ -2042,7 +2042,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(TSubject expected, System.Collections.Generic.IEqualityComparer comparer, 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 BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> 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 FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } @@ -2050,7 +2050,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBe(TSubject unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(TSubject unexpected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } } public abstract class ReferenceTypeAssertions where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 437f323d88..c39d7e7f89 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -160,8 +160,8 @@ namespace FluentAssertions { public static FluentAssertions.EquivalencyPlan EquivalencyPlan { get; } public static FluentAssertions.Formatting.FormattingOptions FormattingOptions { get; } - public static void AssertEquivalencyUsing(System.Func defaultsConfigurer) { } - public static FluentAssertions.Equivalency.EquivalencyAssertionOptions CloneDefaults() { } + public static void AssertEquivalencyUsing(System.Func defaultsConfigurer) { } + public static FluentAssertions.Equivalency.EquivalencyOptions CloneDefaults() { } } public static class AsyncAssertionsExtensions { @@ -311,7 +311,7 @@ namespace FluentAssertions public static class ObjectAssertionsExtensions { public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> options, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } } public abstract class OccurrenceConstraint @@ -376,7 +376,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint AllBeAssignableTo(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> AllBeAssignableTo(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint AllBeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllBeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint AllBeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint AllBeOfType(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> AllBeOfType(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint AllSatisfy(System.Action expected, string because = "", params object[] becauseArgs) { } @@ -385,7 +385,7 @@ namespace FluentAssertions.Collections protected void AssertSubjectEquality(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeInAscendingOrder(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeInAscendingOrder(System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeInAscendingOrder(System.Func comparison, string because = "", params object[] becauseArgs) { } @@ -402,7 +402,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndWhichConstraint Contain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint Contain(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint ContainEquivalentOf(TExpectation expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint ContainEquivalentOf(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint ContainEquivalentOf(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint ContainInConsecutiveOrder(params T[] expected) { } public FluentAssertions.AndConstraint ContainInConsecutiveOrder(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint ContainInOrder(params T[] expected) { } @@ -430,7 +430,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint IntersectWith(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInAscendingOrder(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInAscendingOrder(System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInAscendingOrder(System.Func comparison, string because = "", params object[] becauseArgs) { } @@ -447,7 +447,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint NotContain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint NotContain(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainInConsecutiveOrder(params T[] unexpected) { } public FluentAssertions.AndConstraint NotContainInConsecutiveOrder(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainInOrder(params T[] unexpected) { } @@ -485,7 +485,7 @@ namespace FluentAssertions.Collections public GenericDictionaryAssertions(TCollection keyValuePairs) { } protected override string Identifier { get; } 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 BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Contain(params System.Collections.Generic.KeyValuePair[] expected) { } public FluentAssertions.AndConstraint Contain(System.Collections.Generic.IEnumerable> expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Contain(System.Collections.Generic.KeyValuePair expected, string because = "", params object[] becauseArgs) { } @@ -526,10 +526,10 @@ namespace FluentAssertions.Collections { public StringCollectionAssertions(TCollection actualValue) { } public FluentAssertions.AndConstraint AllBe(string expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllBe(string expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint AllBe(string expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(params string[] expectation) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint ContainMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expected) { } public FluentAssertions.AndConstraint Equal(params string[] expected) { } @@ -631,7 +631,7 @@ namespace FluentAssertions.Equivalency public object Expectation { get; set; } public System.Type RuntimeType { get; } public object Subject { get; set; } - public System.Type GetExpectedType(FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } + public System.Type GetExpectedType(FluentAssertions.Equivalency.IEquivalencyOptions options) { } public override string ToString() { } } public class ConversionSelector @@ -661,24 +661,24 @@ namespace FluentAssertions.Equivalency ForceEquals = 2, ForceMembers = 3, } - public class EquivalencyAssertionOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions + public class EquivalencyOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { - public EquivalencyAssertionOptions() { } + public EquivalencyOptions() { } } - public class EquivalencyAssertionOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions> + public class EquivalencyOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions> { - public EquivalencyAssertionOptions() { } - public EquivalencyAssertionOptions(FluentAssertions.Equivalency.IEquivalencyAssertionOptions defaults) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions> AsCollection() { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> expression) { } + public EquivalencyOptions() { } + public EquivalencyOptions(FluentAssertions.Equivalency.IEquivalencyOptions defaults) { } + public FluentAssertions.Equivalency.EquivalencyOptions> AsCollection() { } + public FluentAssertions.Equivalency.EquivalencyOptions Excluding(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.NestedExclusionOptionBuilder For(System.Linq.Expressions.Expression>> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Including(System.Linq.Expressions.Expression> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(string expectationMemberPath, string subjectMemberPath) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(System.Linq.Expressions.Expression> expectationMemberPath, System.Linq.Expressions.Expression> subjectMemberPath) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(System.Linq.Expressions.Expression> expectationMember, System.Linq.Expressions.Expression> subjectMember) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(string expectationMemberName, string subjectMemberName) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithoutStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } + public FluentAssertions.Equivalency.EquivalencyOptions Including(System.Linq.Expressions.Expression> expression) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithMapping(string expectationMemberPath, string subjectMemberPath) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithMapping(System.Linq.Expressions.Expression> expectationMemberPath, System.Linq.Expressions.Expression> subjectMemberPath) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithMapping(System.Linq.Expressions.Expression> expectationMember, System.Linq.Expressions.Expression> subjectMember) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithMapping(string expectationMemberName, string subjectMemberName) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithoutStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } } public enum EquivalencyResult { @@ -693,9 +693,9 @@ namespace FluentAssertions.Equivalency } public class EquivalencyValidationContext : FluentAssertions.Equivalency.IEquivalencyValidationContext { - public EquivalencyValidationContext(FluentAssertions.Equivalency.INode root, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } + public EquivalencyValidationContext(FluentAssertions.Equivalency.INode root, FluentAssertions.Equivalency.IEquivalencyOptions options) { } public FluentAssertions.Equivalency.INode CurrentNode { get; } - public FluentAssertions.Equivalency.IEquivalencyAssertionOptions Options { get; } + public FluentAssertions.Equivalency.IEquivalencyOptions Options { get; } public FluentAssertions.Execution.Reason Reason { get; set; } public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; set; } public FluentAssertions.Equivalency.Tracing.Tracer Tracer { get; } @@ -733,7 +733,7 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.INode SelectedNode { get; } TSubject Subject { get; } } - public interface IEquivalencyAssertionOptions + public interface IEquivalencyOptions { bool AllowInfiniteRecursion { get; } bool? CompareRecordsByValue { get; } @@ -760,7 +760,7 @@ namespace FluentAssertions.Equivalency public interface IEquivalencyValidationContext { FluentAssertions.Equivalency.INode CurrentNode { get; } - FluentAssertions.Equivalency.IEquivalencyAssertionOptions Options { get; } + FluentAssertions.Equivalency.IEquivalencyOptions Options { get; } FluentAssertions.Execution.Reason Reason { get; } FluentAssertions.Equivalency.Tracing.Tracer Tracer { get; } FluentAssertions.Equivalency.IEquivalencyValidationContext AsCollectionItem(string index); @@ -793,7 +793,7 @@ namespace FluentAssertions.Equivalency } public interface IMemberMatchingRule { - FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options); + FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyOptions options); } public interface IMemberSelectionRule { @@ -832,7 +832,7 @@ namespace FluentAssertions.Equivalency } public class MemberSelectionContext { - public MemberSelectionContext(System.Type compileTimeType, System.Type runtimeType, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } + public MemberSelectionContext(System.Type compileTimeType, System.Type runtimeType, FluentAssertions.Equivalency.IEquivalencyOptions options) { } public FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } public FluentAssertions.Equivalency.MemberVisibility IncludedProperties { get; } public System.Type Type { get; } @@ -847,7 +847,7 @@ namespace FluentAssertions.Equivalency } public class NestedExclusionOptionBuilder { - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Exclude(System.Linq.Expressions.Expression> expression) { } + public FluentAssertions.Equivalency.EquivalencyOptions Exclude(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.NestedExclusionOptionBuilder For(System.Linq.Expressions.Expression>> expression) { } } public class Node : FluentAssertions.Equivalency.INode @@ -896,10 +896,10 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } public object GetValue(object obj) { } } - public abstract class SelfReferenceEquivalencyAssertionOptions : FluentAssertions.Equivalency.IEquivalencyAssertionOptions - where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions + public abstract class SelfReferenceEquivalencyOptions : FluentAssertions.Equivalency.IEquivalencyOptions + where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { - protected SelfReferenceEquivalencyAssertionOptions(FluentAssertions.Equivalency.IEquivalencyAssertionOptions defaults) { } + protected SelfReferenceEquivalencyOptions(FluentAssertions.Equivalency.IEquivalencyOptions defaults) { } public bool? CompareRecordsByValue { get; } public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] @@ -940,7 +940,7 @@ namespace FluentAssertions.Equivalency public TSelf Using(FluentAssertions.Equivalency.IMemberMatchingRule matchingRule) { } public TSelf Using(FluentAssertions.Equivalency.IMemberSelectionRule selectionRule) { } public TSelf Using(FluentAssertions.Equivalency.IOrderingRule orderingRule) { } - public FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions.Restriction Using(System.Action> action) { } + public FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions.Restriction Using(System.Action> action) { } public TSelf Using(System.Collections.Generic.IEqualityComparer comparer) { } public TSelf Using() where TEqualityComparer : System.Collections.Generic.IEqualityComparer, new () { } @@ -1543,7 +1543,7 @@ namespace FluentAssertions.Numeric protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(T 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 BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } @@ -1909,7 +1909,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(TSubject expected, System.Collections.Generic.IEqualityComparer comparer, 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 BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> 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 FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } @@ -1917,7 +1917,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBe(TSubject unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(TSubject unexpected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } } public abstract class ReferenceTypeAssertions where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 0c651a41f7..34e0f4b77d 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -161,8 +161,8 @@ namespace FluentAssertions { public static FluentAssertions.EquivalencyPlan EquivalencyPlan { get; } public static FluentAssertions.Formatting.FormattingOptions FormattingOptions { get; } - public static void AssertEquivalencyUsing(System.Func defaultsConfigurer) { } - public static FluentAssertions.Equivalency.EquivalencyAssertionOptions CloneDefaults() { } + public static void AssertEquivalencyUsing(System.Func defaultsConfigurer) { } + public static FluentAssertions.Equivalency.EquivalencyOptions CloneDefaults() { } } public static class AsyncAssertionsExtensions { @@ -318,7 +318,7 @@ namespace FluentAssertions public static class ObjectAssertionsExtensions { public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> options, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } } public abstract class OccurrenceConstraint @@ -383,7 +383,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint AllBeAssignableTo(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> AllBeAssignableTo(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint AllBeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllBeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint AllBeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint AllBeOfType(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> AllBeOfType(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint AllSatisfy(System.Action expected, string because = "", params object[] becauseArgs) { } @@ -392,7 +392,7 @@ namespace FluentAssertions.Collections protected void AssertSubjectEquality(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeInAscendingOrder(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeInAscendingOrder(System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeInAscendingOrder(System.Func comparison, string because = "", params object[] becauseArgs) { } @@ -409,7 +409,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndWhichConstraint Contain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint Contain(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint ContainEquivalentOf(TExpectation expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint ContainEquivalentOf(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint ContainEquivalentOf(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint ContainInConsecutiveOrder(params T[] expected) { } public FluentAssertions.AndConstraint ContainInConsecutiveOrder(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint ContainInOrder(params T[] expected) { } @@ -437,7 +437,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint IntersectWith(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInAscendingOrder(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInAscendingOrder(System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInAscendingOrder(System.Func comparison, string because = "", params object[] becauseArgs) { } @@ -454,7 +454,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint NotContain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint NotContain(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainInConsecutiveOrder(params T[] unexpected) { } public FluentAssertions.AndConstraint NotContainInConsecutiveOrder(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainInOrder(params T[] unexpected) { } @@ -492,7 +492,7 @@ namespace FluentAssertions.Collections public GenericDictionaryAssertions(TCollection keyValuePairs) { } protected override string Identifier { get; } 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 BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Contain(params System.Collections.Generic.KeyValuePair[] expected) { } public FluentAssertions.AndConstraint Contain(System.Collections.Generic.IEnumerable> expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Contain(System.Collections.Generic.KeyValuePair expected, string because = "", params object[] becauseArgs) { } @@ -533,10 +533,10 @@ namespace FluentAssertions.Collections { public StringCollectionAssertions(TCollection actualValue) { } public FluentAssertions.AndConstraint AllBe(string expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint AllBe(string expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint AllBe(string expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(params string[] expectation) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint ContainMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expected) { } public FluentAssertions.AndConstraint Equal(params string[] expected) { } @@ -638,7 +638,7 @@ namespace FluentAssertions.Equivalency public object Expectation { get; set; } public System.Type RuntimeType { get; } public object Subject { get; set; } - public System.Type GetExpectedType(FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } + public System.Type GetExpectedType(FluentAssertions.Equivalency.IEquivalencyOptions options) { } public override string ToString() { } } public class ConversionSelector @@ -668,24 +668,24 @@ namespace FluentAssertions.Equivalency ForceEquals = 2, ForceMembers = 3, } - public class EquivalencyAssertionOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions + public class EquivalencyOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { - public EquivalencyAssertionOptions() { } + public EquivalencyOptions() { } } - public class EquivalencyAssertionOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions> + public class EquivalencyOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions> { - public EquivalencyAssertionOptions() { } - public EquivalencyAssertionOptions(FluentAssertions.Equivalency.IEquivalencyAssertionOptions defaults) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions> AsCollection() { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Excluding(System.Linq.Expressions.Expression> expression) { } + public EquivalencyOptions() { } + public EquivalencyOptions(FluentAssertions.Equivalency.IEquivalencyOptions defaults) { } + public FluentAssertions.Equivalency.EquivalencyOptions> AsCollection() { } + public FluentAssertions.Equivalency.EquivalencyOptions Excluding(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.NestedExclusionOptionBuilder For(System.Linq.Expressions.Expression>> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Including(System.Linq.Expressions.Expression> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(string expectationMemberPath, string subjectMemberPath) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(System.Linq.Expressions.Expression> expectationMemberPath, System.Linq.Expressions.Expression> subjectMemberPath) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(System.Linq.Expressions.Expression> expectationMember, System.Linq.Expressions.Expression> subjectMember) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithMapping(string expectationMemberName, string subjectMemberName) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } - public FluentAssertions.Equivalency.EquivalencyAssertionOptions WithoutStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } + public FluentAssertions.Equivalency.EquivalencyOptions Including(System.Linq.Expressions.Expression> expression) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithMapping(string expectationMemberPath, string subjectMemberPath) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithMapping(System.Linq.Expressions.Expression> expectationMemberPath, System.Linq.Expressions.Expression> subjectMemberPath) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithMapping(System.Linq.Expressions.Expression> expectationMember, System.Linq.Expressions.Expression> subjectMember) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithMapping(string expectationMemberName, string subjectMemberName) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } + public FluentAssertions.Equivalency.EquivalencyOptions WithoutStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } } public enum EquivalencyResult { @@ -700,9 +700,9 @@ namespace FluentAssertions.Equivalency } public class EquivalencyValidationContext : FluentAssertions.Equivalency.IEquivalencyValidationContext { - public EquivalencyValidationContext(FluentAssertions.Equivalency.INode root, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } + public EquivalencyValidationContext(FluentAssertions.Equivalency.INode root, FluentAssertions.Equivalency.IEquivalencyOptions options) { } public FluentAssertions.Equivalency.INode CurrentNode { get; } - public FluentAssertions.Equivalency.IEquivalencyAssertionOptions Options { get; } + public FluentAssertions.Equivalency.IEquivalencyOptions Options { get; } public FluentAssertions.Execution.Reason Reason { get; set; } public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; set; } public FluentAssertions.Equivalency.Tracing.Tracer Tracer { get; } @@ -740,7 +740,7 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.INode SelectedNode { get; } TSubject Subject { get; } } - public interface IEquivalencyAssertionOptions + public interface IEquivalencyOptions { bool AllowInfiniteRecursion { get; } bool? CompareRecordsByValue { get; } @@ -767,7 +767,7 @@ namespace FluentAssertions.Equivalency public interface IEquivalencyValidationContext { FluentAssertions.Equivalency.INode CurrentNode { get; } - FluentAssertions.Equivalency.IEquivalencyAssertionOptions Options { get; } + FluentAssertions.Equivalency.IEquivalencyOptions Options { get; } FluentAssertions.Execution.Reason Reason { get; } FluentAssertions.Equivalency.Tracing.Tracer Tracer { get; } FluentAssertions.Equivalency.IEquivalencyValidationContext AsCollectionItem(string index); @@ -800,7 +800,7 @@ namespace FluentAssertions.Equivalency } public interface IMemberMatchingRule { - FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options); + FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyOptions options); } public interface IMemberSelectionRule { @@ -839,7 +839,7 @@ namespace FluentAssertions.Equivalency } public class MemberSelectionContext { - public MemberSelectionContext(System.Type compileTimeType, System.Type runtimeType, FluentAssertions.Equivalency.IEquivalencyAssertionOptions options) { } + public MemberSelectionContext(System.Type compileTimeType, System.Type runtimeType, FluentAssertions.Equivalency.IEquivalencyOptions options) { } public FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } public FluentAssertions.Equivalency.MemberVisibility IncludedProperties { get; } public System.Type Type { get; } @@ -854,7 +854,7 @@ namespace FluentAssertions.Equivalency } public class NestedExclusionOptionBuilder { - public FluentAssertions.Equivalency.EquivalencyAssertionOptions Exclude(System.Linq.Expressions.Expression> expression) { } + public FluentAssertions.Equivalency.EquivalencyOptions Exclude(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.NestedExclusionOptionBuilder For(System.Linq.Expressions.Expression>> expression) { } } public class Node : FluentAssertions.Equivalency.INode @@ -903,10 +903,10 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } public object GetValue(object obj) { } } - public abstract class SelfReferenceEquivalencyAssertionOptions : FluentAssertions.Equivalency.IEquivalencyAssertionOptions - where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions + public abstract class SelfReferenceEquivalencyOptions : FluentAssertions.Equivalency.IEquivalencyOptions + where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { - protected SelfReferenceEquivalencyAssertionOptions(FluentAssertions.Equivalency.IEquivalencyAssertionOptions defaults) { } + protected SelfReferenceEquivalencyOptions(FluentAssertions.Equivalency.IEquivalencyOptions defaults) { } public bool? CompareRecordsByValue { get; } public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] @@ -947,7 +947,7 @@ namespace FluentAssertions.Equivalency public TSelf Using(FluentAssertions.Equivalency.IMemberMatchingRule matchingRule) { } public TSelf Using(FluentAssertions.Equivalency.IMemberSelectionRule selectionRule) { } public TSelf Using(FluentAssertions.Equivalency.IOrderingRule orderingRule) { } - public FluentAssertions.Equivalency.SelfReferenceEquivalencyAssertionOptions.Restriction Using(System.Action> action) { } + public FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions.Restriction Using(System.Action> action) { } public TSelf Using(System.Collections.Generic.IEqualityComparer comparer) { } public TSelf Using() where TEqualityComparer : System.Collections.Generic.IEqualityComparer, new () { } @@ -1592,7 +1592,7 @@ namespace FluentAssertions.Numeric protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(T 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 BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } @@ -1958,7 +1958,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(TSubject expected, System.Collections.Generic.IEqualityComparer comparer, 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 BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> 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 FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } @@ -1966,7 +1966,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBe(TSubject unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(TSubject unexpected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } } public abstract class ReferenceTypeAssertions where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions diff --git a/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs b/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs index b8167ca9a7..dfee213a6f 100644 --- a/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs +++ b/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs @@ -29,7 +29,7 @@ private class Context : IEquivalencyValidationContext public INode CurrentNode { get; } public Reason Reason { get; } public Tracer Tracer { get; } - public IEquivalencyAssertionOptions Options { get; internal set; } + public IEquivalencyOptions Options { get; internal set; } public bool IsCyclicReference(object expectation) => throw new NotImplementedException(); public IEquivalencyValidationContext AsNestedMember(IMember expectationMember) => throw new NotImplementedException(); @@ -42,7 +42,7 @@ public IEquivalencyValidationContext AsDictionaryItem(TKey k public IEquivalencyValidationContext Clone() => throw new NotImplementedException(); } - private class Config : IEquivalencyAssertionOptions + private class Config : IEquivalencyOptions { public IEnumerable SelectionRules => throw new NotImplementedException(); diff --git a/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs index f3a389c635..454bbb54fc 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs @@ -140,7 +140,7 @@ public void When_a_matching_rule_is_added_it_should_appear_in_the_exception_mess internal class ForeignKeyMatchingRule : IMemberMatchingRule { - public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyAssertionOptions options) + public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options) { string name = expectedMember.Name; diff --git a/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs b/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs index 88869729ee..daca73fd66 100644 --- a/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs @@ -25,14 +25,14 @@ public abstract class Given_temporary_global_assertion_options : GivenWhenThen { protected override void Dispose(bool disposing) { - AssertionOptions.AssertEquivalencyUsing(_ => new EquivalencyAssertionOptions()); + AssertionOptions.AssertEquivalencyUsing(_ => new EquivalencyOptions()); base.Dispose(disposing); } } [Collection("AssertionOptionsSpecs")] - public class When_injecting_a_null_configurer : GivenSubject + public class When_injecting_a_null_configurer : GivenSubject { public When_injecting_a_null_configurer() { @@ -48,18 +48,18 @@ public void It_should_throw() } [Collection("AssertionOptionsSpecs")] - public class When_concurrently_getting_equality_strategy : GivenSubject + public class When_concurrently_getting_equality_strategy : GivenSubject { public When_concurrently_getting_equality_strategy() { When(() => { #pragma warning disable CA1859 // https://github.com/dotnet/roslyn-analyzers/issues/6704 - IEquivalencyAssertionOptions equivalencyAssertionOptions = new EquivalencyAssertionOptions(); + IEquivalencyOptions equivalencyOptions = new EquivalencyOptions(); #pragma warning restore CA1859 return () => Parallel.For(0, 10_000, new ParallelOptions { MaxDegreeOfParallelism = 8 }, - _ => equivalencyAssertionOptions.GetEqualityStrategy(typeof(IEnumerable)) + _ => equivalencyOptions.GetEqualityStrategy(typeof(IEnumerable)) ); }); } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 3620fc8565..bc6eecded1 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -54,6 +54,11 @@ sidebar: * `OnlyContain` now succeeds when asserting that an empty collection matches some predicates - [#2350](https://github.com/fluentassertions/fluentassertions/pull/2350) * Dropped support for `NSpec3` test framework - [#2356](https://github.com/fluentassertions/fluentassertions/pull/2356) * Dropped support for `BinaryFormatter` - [#2278](https://github.com/fluentassertions/fluentassertions/pull/2278) +* Renamed "...AssertionOptions" to "...Options" - [#2414](https://github.com/fluentassertions/fluentassertions/pull/2414) + * `EquivalencyAssertionOptions` to `EquivalencyOptions` + * `EquivalencyAssertionOptions` to `EquivalencyOptions` + * `IEquivalencyAssertionOptions` to `IEquivalencyOptions` + * `SelfReferenceEquivalencyAssertionOptions` to `SelfReferenceEquivalencyOptions` ### Breaking Changes (for extensions) * Add `ForConstraint` to `IAssertionsScope` to support chaining `.ForConstraint()` after `.Then` - [#2324](https://github.com/fluentassertions/fluentassertions/pull/2324) From 67233e7236e8818f5b6afa0097d47ded7c3adb2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:43:40 +0000 Subject: [PATCH 159/845] Bump BenchmarkDotNet from 0.13.9 to 0.13.10 Bumps [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet) from 0.13.9 to 0.13.10. - [Release notes](https://github.com/dotnet/BenchmarkDotNet/releases) - [Commits](https://github.com/dotnet/BenchmarkDotNet/compare/v0.13.9...v0.13.10) --- updated-dependencies: - dependency-name: BenchmarkDotNet dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Tests/Benchmarks/Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index d8334980e7..9a1f242f8c 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -9,7 +9,7 @@ - + From 7b387fcbce4e8f0c5ad86f569d6e085c9c5ca30d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:43:22 +0000 Subject: [PATCH 160/845] Bump the xunit group with 1 update Bumps the xunit group with 1 update: [xunit](https://github.com/xunit/xunit). - [Commits](https://github.com/xunit/xunit/compare/2.5.3...2.6.1) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 6e05e11a5e..68dc91b1c7 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -6,7 +6,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index f080397467..16eb4e16ee 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -11,7 +11,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index ea66748531..b5938bf7dd 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -36,7 +36,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 1ad41d31f1..3fc830590b 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -29,7 +29,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 021de3e10f..716b964f2b 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -34,7 +34,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index 0ebeb25d7f..ff3ba92f97 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 63caf70ac2..5a7c73832f 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -7,7 +7,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 43cdbb2e415b6e8f2d5a69b734d416a880c3595b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:43:29 +0000 Subject: [PATCH 161/845] Bump the nunit group with 1 update Bumps the nunit group with 1 update: [NUnit](https://github.com/nunit/nunit). - [Release notes](https://github.com/nunit/nunit/releases) - [Changelog](https://github.com/nunit/nunit/blob/master/CHANGES.md) - [Commits](https://github.com/nunit/nunit/compare/v3.13.3...v3.14.0) --- updated-dependencies: - dependency-name: NUnit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: nunit ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index 21b24e8382..39df07b814 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From c34940ec65a317e67a388f27c0ff5eb71b01dc0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Wed, 8 Nov 2023 12:04:13 +0100 Subject: [PATCH 162/845] Add tests for `Configuration` (#2438) --- .../Common/ConfigurationSpecs.cs | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 Tests/FluentAssertions.Specs/Common/ConfigurationSpecs.cs diff --git a/Tests/FluentAssertions.Specs/Common/ConfigurationSpecs.cs b/Tests/FluentAssertions.Specs/Common/ConfigurationSpecs.cs new file mode 100644 index 0000000000..141e2bfdc2 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Common/ConfigurationSpecs.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using FluentAssertions.Common; +using Xunit; + +namespace FluentAssertions.Specs.Common; + +public class ConfigurationSpecs +{ + [Fact] + public void Value_formatter_detection_mode_is_disabled_with_empty_store() + { + // Arrange + var store = new DummyConfigurationStore(new Dictionary()); + var sut = new Configuration(store); + + // Act / Assert + sut.ValueFormatterDetectionMode.Should().Be(ValueFormatterDetectionMode.Disabled); + } + + [Fact] + public void Value_formatter_detection_mode_is_specific_with_given_value_formatters_assembly() + { + // Arrange + var store = new DummyConfigurationStore(new Dictionary + { + { "valueFormattersAssembly", "foo" } + }); + + var sut = new Configuration(store); + + // Act / Assert + sut.ValueFormatterDetectionMode.Should().Be(ValueFormatterDetectionMode.Specific); + } + + [Fact] + public void Value_formatter_detection_mode_can_be_specified_in_configuration_store() + { + // Arrange + var store = new DummyConfigurationStore(new Dictionary + { + { "valueFormatters", nameof(ValueFormatterDetectionMode.Scan) } + }); + + var sut = new Configuration(store); + + // Act / Assert + sut.ValueFormatterDetectionMode.Should().Be(ValueFormatterDetectionMode.Scan); + } + + [Fact] + public void Value_formatter_detection_mode_throws_when_configured_incorrectly() + { + // Arrange + var store = new DummyConfigurationStore(new Dictionary + { + { "valueFormatters", "foo" } + }); + + var sut = new Configuration(store); + + // Act + var act = () => sut.ValueFormatterDetectionMode; + + // Assert + act.Should().Throw(); + } + + private class DummyConfigurationStore : IConfigurationStore + { + private readonly Dictionary settings; + + public DummyConfigurationStore(Dictionary settings) + { + this.settings = settings; + } + + public string GetSetting(string name) + => settings.TryGetValue(name, out var value) ? value : null; + } +} From 6549483027e20b646bab0baa7bbeb010d1a5b939 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:37:16 +0100 Subject: [PATCH 163/845] Bump LibGit2Sharp from 0.27.2 to 0.28.0 (#2442) Bumps [LibGit2Sharp](https://github.com/libgit2/libgit2sharp) from 0.27.2 to 0.28.0. - [Release notes](https://github.com/libgit2/libgit2sharp/releases) - [Changelog](https://github.com/libgit2/libgit2sharp/blob/master/CHANGES.md) - [Commits](https://github.com/libgit2/libgit2sharp/compare/0.27.2...0.28.0) --- updated-dependencies: - dependency-name: LibGit2Sharp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 476f398ae6..5cfee466ae 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -21,7 +21,7 @@ - + From 9d0daeea0cb24ef1c48c9c8f6386d5fd53549893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sat, 11 Nov 2023 15:45:03 +0100 Subject: [PATCH 164/845] Remove unused using directives (#2447) * Remove unused `using` directives * Avoid unused `using` directives --- .../Common/MemberPathSegmentEqualityComparer.cs | 4 +++- Src/FluentAssertions/Formatting/DateOnlyValueFormatter.cs | 3 ++- Src/FluentAssertions/Formatting/TimeOnlyValueFormatter.cs | 3 ++- Src/FluentAssertions/Primitives/DateOnlyAssertions.cs | 5 +++-- .../Primitives/NullableDateOnlyAssertions.cs | 3 ++- .../Primitives/NullableTimeOnlyAssertions.cs | 3 ++- Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs | 5 +++-- Tests/Benchmarks/TypeMemberReflectorBenchmarks.cs | 8 +------- Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs | 1 - ...enericDictionaryAssertionSpecs.HaveCountGreaterThan.cs | 1 - ...tionaryAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs | 1 - .../GenericDictionaryAssertionSpecs.HaveCountLessThan.cs | 1 - ...DictionaryAssertionSpecs.HaveCountLessThanOrEqualTo.cs | 1 - .../Exceptions/FunctionExceptionAssertionSpecs.cs | 1 - Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs | 1 - .../Execution/CallerIdentifierSpecs.cs | 1 - .../Primitives/DateOnlyAssertionSpecs.cs | 1 + .../Primitives/DateTimeOffsetAssertionSpecs.BeLessThan.cs | 2 -- .../Specialized/DelegateAssertionSpecs.cs | 1 - .../Specialized/TaskAssertionSpecs.cs | 1 - 20 files changed, 19 insertions(+), 28 deletions(-) diff --git a/Src/FluentAssertions/Common/MemberPathSegmentEqualityComparer.cs b/Src/FluentAssertions/Common/MemberPathSegmentEqualityComparer.cs index fc0c53a8cf..07dbccad00 100644 --- a/Src/FluentAssertions/Common/MemberPathSegmentEqualityComparer.cs +++ b/Src/FluentAssertions/Common/MemberPathSegmentEqualityComparer.cs @@ -1,4 +1,6 @@ -using System; +#if NET6_0_OR_GREATER || NETSTANDARD2_1 +using System; +#endif using System.Collections.Generic; using System.Text.RegularExpressions; diff --git a/Src/FluentAssertions/Formatting/DateOnlyValueFormatter.cs b/Src/FluentAssertions/Formatting/DateOnlyValueFormatter.cs index c3b77fa28e..030acb2ab9 100644 --- a/Src/FluentAssertions/Formatting/DateOnlyValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/DateOnlyValueFormatter.cs @@ -1,7 +1,8 @@ +#if NET6_0_OR_GREATER + using System; using System.Globalization; -#if NET6_0_OR_GREATER namespace FluentAssertions.Formatting; public class DateOnlyValueFormatter : IValueFormatter diff --git a/Src/FluentAssertions/Formatting/TimeOnlyValueFormatter.cs b/Src/FluentAssertions/Formatting/TimeOnlyValueFormatter.cs index ef8b8fd3a8..a3cc0d7487 100644 --- a/Src/FluentAssertions/Formatting/TimeOnlyValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/TimeOnlyValueFormatter.cs @@ -1,7 +1,8 @@ +#if NET6_0_OR_GREATER + using System; using System.Globalization; -#if NET6_0_OR_GREATER namespace FluentAssertions.Formatting; public class TimeOnlyValueFormatter : IValueFormatter diff --git a/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs b/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs index 9d01383966..749bdcdf17 100644 --- a/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs @@ -1,10 +1,11 @@ -using System; +#if NET6_0_OR_GREATER + +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using FluentAssertions.Execution; -#if NET6_0_OR_GREATER namespace FluentAssertions.Primitives; /// diff --git a/Src/FluentAssertions/Primitives/NullableDateOnlyAssertions.cs b/Src/FluentAssertions/Primitives/NullableDateOnlyAssertions.cs index dece5ba5d6..d4924c217a 100644 --- a/Src/FluentAssertions/Primitives/NullableDateOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableDateOnlyAssertions.cs @@ -1,8 +1,9 @@ +#if NET6_0_OR_GREATER + using System; using System.Diagnostics; using FluentAssertions.Execution; -#if NET6_0_OR_GREATER namespace FluentAssertions.Primitives; /// diff --git a/Src/FluentAssertions/Primitives/NullableTimeOnlyAssertions.cs b/Src/FluentAssertions/Primitives/NullableTimeOnlyAssertions.cs index a9011308b7..ad3b1f1cce 100644 --- a/Src/FluentAssertions/Primitives/NullableTimeOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableTimeOnlyAssertions.cs @@ -1,8 +1,9 @@ +#if NET6_0_OR_GREATER + using System; using System.Diagnostics; using FluentAssertions.Execution; -#if NET6_0_OR_GREATER namespace FluentAssertions.Primitives; /// diff --git a/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs b/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs index 70c48e5383..533d741b5f 100644 --- a/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs @@ -1,11 +1,12 @@ -using System; +#if NET6_0_OR_GREATER + +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using FluentAssertions.Common; using FluentAssertions.Execution; -#if NET6_0_OR_GREATER namespace FluentAssertions.Primitives; /// diff --git a/Tests/Benchmarks/TypeMemberReflectorBenchmarks.cs b/Tests/Benchmarks/TypeMemberReflectorBenchmarks.cs index 1833297c1b..1ae942a4f8 100644 --- a/Tests/Benchmarks/TypeMemberReflectorBenchmarks.cs +++ b/Tests/Benchmarks/TypeMemberReflectorBenchmarks.cs @@ -1,12 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; using FluentAssertions.Common; -using FluentAssertions.Equivalency; using static FluentAssertions.Equivalency.MemberVisibility; namespace Benchmarks; diff --git a/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs b/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs index daca73fd66..d22555b3e9 100644 --- a/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs @@ -6,7 +6,6 @@ using FluentAssertions.Equivalency; using FluentAssertions.Equivalency.Steps; using FluentAssertions.Execution; -using FluentAssertions.Extensions; using FluentAssertions.Formatting; using Xunit; using Xunit.Sdk; diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountGreaterThan.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountGreaterThan.cs index 2045bf26cc..57848bf2b0 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountGreaterThan.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountGreaterThan.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using FluentAssertions.Execution; using Xunit; using Xunit.Sdk; diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs index 83b1d7d156..6455493a19 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using FluentAssertions.Execution; using Xunit; using Xunit.Sdk; diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountLessThan.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountLessThan.cs index ea783d883f..7549305571 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountLessThan.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountLessThan.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using FluentAssertions.Execution; using Xunit; using Xunit.Sdk; diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountLessThanOrEqualTo.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountLessThanOrEqualTo.cs index 3c553d8170..b02679c290 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountLessThanOrEqualTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveCountLessThanOrEqualTo.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using FluentAssertions.Execution; using Xunit; using Xunit.Sdk; diff --git a/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs index d2499eb23f..b9216b09ac 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs @@ -1,5 +1,4 @@ using System; -using System.Threading.Tasks; using FluentAssertions.Execution; using FluentAssertions.Extensions; #if NET47 diff --git a/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs index a33bcdb56a..2d5ebaeecc 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs @@ -1,5 +1,4 @@ using System; -using System.Threading.Tasks; using FluentAssertions.Execution; #if NET47 using FluentAssertions.Specs.Common; diff --git a/Tests/FluentAssertions.Specs/Execution/CallerIdentifierSpecs.cs b/Tests/FluentAssertions.Specs/Execution/CallerIdentifierSpecs.cs index e3c127f626..f5a0d05f84 100644 --- a/Tests/FluentAssertions.Specs/Execution/CallerIdentifierSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/CallerIdentifierSpecs.cs @@ -7,7 +7,6 @@ using FluentAssertions.Equivalency; using FluentAssertions.Execution; using FluentAssertions.Extensions; -using FluentAssertions.Primitives; using Xunit; using Xunit.Sdk; diff --git a/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.cs index 5ccf150d5a..022e2ef6d4 100644 --- a/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.cs @@ -1,4 +1,5 @@ #if NET6_0_OR_GREATER + using System; using Xunit; using Xunit.Sdk; diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeLessThan.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeLessThan.cs index a3805b533b..eeb861a53c 100644 --- a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeLessThan.cs +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeLessThan.cs @@ -1,6 +1,4 @@ using System; -using System.Linq; -using FluentAssertions.Common; using FluentAssertions.Extensions; using Xunit; using Xunit.Sdk; diff --git a/Tests/FluentAssertions.Specs/Specialized/DelegateAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/DelegateAssertionSpecs.cs index 9a4ae8ce8f..781d70b3a6 100644 --- a/Tests/FluentAssertions.Specs/Specialized/DelegateAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/DelegateAssertionSpecs.cs @@ -1,5 +1,4 @@ using System; -using System.Threading.Tasks; using FluentAssertions.Execution; using FluentAssertions.Specialized; using Xunit; diff --git a/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs index 42d1bbe59d..71b8555df9 100644 --- a/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs @@ -3,7 +3,6 @@ using System.Threading.Tasks; using FluentAssertions.Execution; using FluentAssertions.Extensions; -using FluentAssertions.Specialized; using Xunit; using Xunit.Sdk; using static FluentAssertions.FluentActions; From ba1f30b8f07ff8f88e5b6a130b4c4a98e6ff6fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sun, 12 Nov 2023 15:36:33 +0100 Subject: [PATCH 165/845] Split SelectionRulesSpecs --- .../SelectionRulesSpecs.Accessibility.cs | 269 ++ .../SelectionRulesSpecs.Basic.cs | 299 ++ .../SelectionRulesSpecs.Browsability.cs | 589 ++++ .../SelectionRulesSpecs.Covariance.cs | 100 + .../SelectionRulesSpecs.Excluding.cs | 670 ++++ .../SelectionRulesSpecs.Including.cs | 353 ++ .../SelectionRulesSpecs.Interfaces.cs | 378 +++ .../SelectionRulesSpecs.MemberHiding.cs | 312 ++ .../SelectionRulesSpecs.cs | 2843 ----------------- 9 files changed, 2970 insertions(+), 2843 deletions(-) create mode 100644 Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Accessibility.cs create mode 100644 Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs create mode 100644 Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Browsability.cs create mode 100644 Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Covariance.cs create mode 100644 Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs create mode 100644 Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs create mode 100644 Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs create mode 100644 Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.MemberHiding.cs delete mode 100644 Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Accessibility.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Accessibility.cs new file mode 100644 index 0000000000..3a2927a06f --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Accessibility.cs @@ -0,0 +1,269 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Equivalency.Specs; + +public partial class SelectionRulesSpecs +{ + public class Accessibility + { + [Fact] + public void When_a_property_is_write_only_it_should_be_ignored() + { + // Arrange + var subject = new ClassWithWriteOnlyProperty + { + WriteOnlyProperty = 123, + SomeOtherProperty = "whatever" + }; + + var expected = new + { + SomeOtherProperty = "whatever" + }; + + // Act + Action action = () => subject.Should().BeEquivalentTo(expected); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void When_a_property_is_private_it_should_be_ignored() + { + // Arrange + var subject = new Customer("MyPassword") + { + Age = 36, + Birthdate = new DateTime(1973, 9, 20), + Name = "John" + }; + + var other = new Customer("SomeOtherPassword") + { + Age = 36, + Birthdate = new DateTime(1973, 9, 20), + Name = "John" + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(other); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_field_is_private_it_should_be_ignored() + { + // Arrange + var subject = new ClassWithAPrivateField(1234) + { + Value = 1 + }; + + var other = new ClassWithAPrivateField(54321) + { + Value = 1 + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(other); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_property_is_protected_it_should_be_ignored() + { + // Arrange + var subject = new Customer + { + Age = 36, + Birthdate = new DateTime(1973, 9, 20), + Name = "John" + }; + + subject.SetProtected("ActualValue"); + + var expected = new Customer + { + Age = 36, + Birthdate = new DateTime(1973, 9, 20), + Name = "John" + }; + + expected.SetProtected("ExpectedValue"); + + // Act + Action act = () => subject.Should().BeEquivalentTo(expected); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_property_is_internal_and_it_should_be_included_it_should_fail_the_assertion() + { + // Arrange + var actual = new ClassWithInternalProperty + { + PublicProperty = "public", + InternalProperty = "internal", + ProtectedInternalProperty = "internal" + }; + + var expected = new ClassWithInternalProperty + { + PublicProperty = "public", + InternalProperty = "also internal", + ProtectedInternalProperty = "also internal" + }; + + // Act + Action act = () => actual.Should().BeEquivalentTo(expected, options => options.IncludingInternalProperties()); + + // Assert + act.Should().Throw() + .WithMessage("*InternalProperty*internal*also internal*ProtectedInternalProperty*"); + } + + private class ClassWithInternalProperty + { + public string PublicProperty { get; set; } + + internal string InternalProperty { get; set; } + + protected internal string ProtectedInternalProperty { get; set; } + } + + [Fact] + public void When_a_field_is_internal_it_should_be_excluded_from_the_comparison() + { + // Arrange + var actual = new ClassWithInternalField + { + PublicField = "public", + InternalField = "internal", + ProtectedInternalField = "internal" + }; + + var expected = new ClassWithInternalField + { + PublicField = "public", + InternalField = "also internal", + ProtectedInternalField = "also internal" + }; + + // Act / Assert + actual.Should().BeEquivalentTo(expected); + } + + [Fact] + public void When_a_field_is_internal_and_it_should_be_included_it_should_fail_the_assertion() + { + // Arrange + var actual = new ClassWithInternalField + { + PublicField = "public", + InternalField = "internal", + ProtectedInternalField = "internal" + }; + + var expected = new ClassWithInternalField + { + PublicField = "public", + InternalField = "also internal", + ProtectedInternalField = "also internal" + }; + + // Act + Action act = () => actual.Should().BeEquivalentTo(expected, options => options.IncludingInternalFields()); + + // Assert + act.Should().Throw().WithMessage("*InternalField*internal*also internal*ProtectedInternalField*"); + } + + private class ClassWithInternalField + { + public string PublicField; + + internal string InternalField; + + protected internal string ProtectedInternalField; + } + + [Fact] + public void When_a_property_is_internal_it_should_be_excluded_from_the_comparison() + { + // Arrange + var actual = new ClassWithInternalProperty + { + PublicProperty = "public", + InternalProperty = "internal", + ProtectedInternalProperty = "internal" + }; + + var expected = new ClassWithInternalProperty + { + PublicProperty = "public", + InternalProperty = "also internal", + ProtectedInternalProperty = "also internal" + }; + + // Act / Assert + actual.Should().BeEquivalentTo(expected); + } + + [Fact] + public void Private_protected_properties_are_ignored() + { + // Arrange + var subject = new ClassWithPrivateProtectedProperty("Name", 13); + var other = new ClassWithPrivateProtectedProperty("Name", 37); + + // Act/Assert + subject.Should().BeEquivalentTo(other); + } + + private class ClassWithPrivateProtectedProperty + { + public ClassWithPrivateProtectedProperty(string name, int value) + { + Name = name; + Value = value; + } + + public string Name { get; } + + private protected int Value { get; } + } + + [Fact] + public void Private_protected_fields_are_ignored() + { + // Arrange + var subject = new ClassWithPrivateProtectedField("Name", 13); + var other = new ClassWithPrivateProtectedField("Name", 37); + + // Act/Assert + subject.Should().BeEquivalentTo(other); + } + + private class ClassWithPrivateProtectedField + { + public ClassWithPrivateProtectedField(string name, int value) + { + Name = name; + this.value = value; + } + + public string Name; + + private protected int value; + } + } +} diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs new file mode 100644 index 0000000000..9cd7c4559a --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs @@ -0,0 +1,299 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Globalization; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Equivalency.Specs; + +public partial class SelectionRulesSpecs +{ + public class Basic + { + [Fact] + public void Property_names_are_case_sensitive() + { + // Arrange + var subject = new + { + Name = "John" + }; + + var other = new + { + name = "John" + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(other); + + // Assert + act.Should().Throw().WithMessage( + "Expectation*subject.name**other*not have*"); + } + + [Fact] + public void Field_names_are_case_sensitive() + { + // Arrange + var subject = new ClassWithFieldInUpperCase + { + Name = "John" + }; + + var other = new ClassWithFieldInLowerCase + { + name = "John" + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(other); + + // Assert + act.Should().Throw().WithMessage( + "Expectation*subject.name**other*not have*"); + } + + private class ClassWithFieldInLowerCase + { + [JetBrains.Annotations.UsedImplicitly] +#pragma warning disable SA1307 + public string name; +#pragma warning restore SA1307 + } + + private class ClassWithFieldInUpperCase + { + [JetBrains.Annotations.UsedImplicitly] + public string Name; + } + + [Fact] + public void When_a_property_is_an_indexer_it_should_be_ignored() + { + // Arrange + var expected = new ClassWithIndexer + { + Foo = "test" + }; + + var result = new ClassWithIndexer + { + Foo = "test" + }; + + // Act + Action act = () => result.Should().BeEquivalentTo(expected); + + // Assert + act.Should().NotThrow(); + } + + public class ClassWithIndexer + { + public object Foo { get; set; } + + public string this[int n] => + n.ToString( + CultureInfo.InvariantCulture); + } + + [Fact] + public void When_the_expected_object_has_a_property_not_available_on_the_subject_it_should_throw() + { + // Arrange + var subject = new + { + }; + + var other = new + { + // ReSharper disable once StringLiteralTypo + City = "Rijswijk" + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(other); + + // Assert + act.Should().Throw().WithMessage( + "Expectation has property subject.City that the other object does not have*"); + } + + [Fact] + public void When_equally_named_properties_are_type_incompatible_it_should_throw() + { + // Arrange + var subject = new + { + Type = "A" + }; + + var other = new + { + Type = 36 + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(other); + + // Assert + act + .Should().Throw() + .WithMessage("Expected property subject.Type to be 36, but found*\"A\"*"); + } + + [Fact] + public void When_multiple_properties_mismatch_it_should_report_all_of_them() + { + // Arrange + var subject = new + { + Property1 = "A", + Property2 = "B", + SubType1 = new + { + SubProperty1 = "C", + SubProperty2 = "D" + } + }; + + var other = new + { + Property1 = "1", + Property2 = "2", + SubType1 = new + { + SubProperty1 = "3", + SubProperty2 = "D" + } + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(other); + + // Assert + act + .Should().Throw() + .WithMessage("*property subject.Property1*to be \"1\", but \"A\" differs near \"A\"*") + .WithMessage("*property subject.Property2*to be \"2\", but \"B\" differs near \"B\"*") + .WithMessage("*property subject.SubType1.SubProperty1*to be \"3\", but \"C\" differs near \"C\"*"); + } + + [Fact] + [SuppressMessage("ReSharper", "StringLiteralTypo")] + public void Including_all_declared_properties_excludes_all_fields() + { + // Arrange + var class1 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum", + Field3 = "dolor", + Property1 = "sit", + Property2 = "amet", + Property3 = "consectetur" + }; + + var class2 = new ClassWithSomeFieldsAndProperties + { + Field1 = "foo", + Property1 = "sit", + Property2 = "amet", + Property3 = "consectetur" + }; + + // Act + Action act = + () => class1.Should().BeEquivalentTo(class2, opts => opts.IncludingAllDeclaredProperties()); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + [SuppressMessage("ReSharper", "StringLiteralTypo")] + public void Including_all_runtime_properties_excludes_all_fields() + { + // Arrange + object class1 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum", + Field3 = "dolor", + Property1 = "sit", + Property2 = "amet", + Property3 = "consectetur" + }; + + object class2 = new ClassWithSomeFieldsAndProperties + { + Property1 = "sit", + Property2 = "amet", + Property3 = "consectetur" + }; + + // Act + Action act = + () => class1.Should().BeEquivalentTo(class2, opts => opts.IncludingAllRuntimeProperties()); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + [SuppressMessage("ReSharper", "StringLiteralTypo")] + public void Respecting_the_runtime_type_includes_both_properties_and_fields_included() + { + // Arrange + object class1 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Property1 = "sit" + }; + + object class2 = new ClassWithSomeFieldsAndProperties(); + + // Act + Action act = + () => class1.Should().BeEquivalentTo(class2, opts => opts.RespectingRuntimeTypes()); + + // Assert + act.Should().Throw().Which.Message.Should().Contain("Field1").And.Contain("Property1"); + } + + [Fact] + public void A_nested_class_without_properties_inside_a_collection_is_fine() + { + // Arrange + var sut = new List + { + new() + { + Name = "theName" + } + }; + + // Act / Assert + sut.Should().BeEquivalentTo(new[] + { + new BaseClassPointingToClassWithoutProperties + { + Name = "theName" + } + }); + } + + internal class BaseClassPointingToClassWithoutProperties + { + public string Name { get; set; } + + public ClassWithoutProperty ClassWithoutProperty { get; } = new(); + } + + internal class ClassWithoutProperty + { + } + } +} diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Browsability.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Browsability.cs new file mode 100644 index 0000000000..926e0763db --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Browsability.cs @@ -0,0 +1,589 @@ +using System; +using System.ComponentModel; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Equivalency.Specs; + +public partial class SelectionRulesSpecs +{ + public class Browsability + { + [Fact] + public void When_browsable_field_differs_excluding_non_browsable_members_should_not_affect_result() + { + // Arrange + var subject = new ClassWithNonBrowsableMembers + { + BrowsableField = 0 + }; + + var expectation = new ClassWithNonBrowsableMembers + { + BrowsableField = 1 + }; + + // Act + Action action = + () => subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void When_browsable_property_differs_excluding_non_browsable_members_should_not_affect_result() + { + // Arrange + var subject = new ClassWithNonBrowsableMembers + { + BrowsableProperty = 0 + }; + + var expectation = new ClassWithNonBrowsableMembers + { + BrowsableProperty = 1 + }; + + // Act + Action action = + () => subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void When_advanced_browsable_field_differs_excluding_non_browsable_members_should_not_affect_result() + { + // Arrange + var subject = new ClassWithNonBrowsableMembers + { + AdvancedBrowsableField = 0 + }; + + var expectation = new ClassWithNonBrowsableMembers + { + AdvancedBrowsableField = 1 + }; + + // Act + Action action = + () => subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void When_advanced_browsable_property_differs_excluding_non_browsable_members_should_not_affect_result() + { + // Arrange + var subject = new ClassWithNonBrowsableMembers + { + AdvancedBrowsableProperty = 0 + }; + + var expectation = new ClassWithNonBrowsableMembers + { + AdvancedBrowsableProperty = 1 + }; + + // Act + Action action = + () => subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void When_explicitly_browsable_field_differs_excluding_non_browsable_members_should_not_affect_result() + { + // Arrange + var subject = new ClassWithNonBrowsableMembers + { + ExplicitlyBrowsableField = 0 + }; + + var expectation = new ClassWithNonBrowsableMembers + { + ExplicitlyBrowsableField = 1 + }; + + // Act + Action action = + () => subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void When_explicitly_browsable_property_differs_excluding_non_browsable_members_should_not_affect_result() + { + // Arrange + var subject = new ClassWithNonBrowsableMembers + { + ExplicitlyBrowsableProperty = 0 + }; + + var expectation = new ClassWithNonBrowsableMembers + { + ExplicitlyBrowsableProperty = 1 + }; + + // Act + Action action = + () => subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void When_non_browsable_field_differs_excluding_non_browsable_members_should_make_it_succeed() + { + // Arrange + var subject = new ClassWithNonBrowsableMembers + { + NonBrowsableField = 0 + }; + + var expectation = new ClassWithNonBrowsableMembers + { + NonBrowsableField = 1 + }; + + // Act & Assert + subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); + } + + [Fact] + public void When_non_browsable_property_differs_excluding_non_browsable_members_should_make_it_succeed() + { + // Arrange + var subject = new ClassWithNonBrowsableMembers + { + NonBrowsableProperty = 0 + }; + + var expectation = new ClassWithNonBrowsableMembers + { + NonBrowsableProperty = 1 + }; + + // Act & Assert + subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); + } + + [Fact] + public void When_property_is_non_browsable_only_in_subject_excluding_non_browsable_members_should_not_make_it_succeed() + { + // Arrange + var subject = + new ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable + { + PropertyThatMightBeNonBrowsable = 0 + }; + + var expectation = + new ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable + { + PropertyThatMightBeNonBrowsable = 1 + }; + + // Act + Action action = + () => subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); + + // Assert + action.Should().Throw() + .WithMessage("Expected property subject.PropertyThatMightBeNonBrowsable to be 1, but found 0.*"); + } + + [Fact] + public void + When_property_is_non_browsable_only_in_subject_ignoring_non_browsable_members_on_subject_should_make_it_succeed() + { + // Arrange + var subject = + new ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable + { + PropertyThatMightBeNonBrowsable = 0 + }; + + var expectation = + new ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable + { + PropertyThatMightBeNonBrowsable = 1 + }; + + // Act & Assert + subject.Should().BeEquivalentTo( + expectation, + config => config.IgnoringNonBrowsableMembersOnSubject().ExcludingMissingMembers()); + } + + [Fact] + public void When_non_browsable_property_on_subject_is_ignored_but_is_present_on_expectation_it_should_fail() + { + // Arrange + var subject = + new ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable + { + PropertyThatMightBeNonBrowsable = 0 + }; + + var expectation = + new ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable + { + PropertyThatMightBeNonBrowsable = 1 + }; + + // Act + Action action = + () => subject.Should().BeEquivalentTo(expectation, config => config.IgnoringNonBrowsableMembersOnSubject()); + + // Assert + action.Should().Throw().WithMessage( + "Expectation has * subject.*ThatMightBeNonBrowsable that is non-browsable in the other object, and non-browsable " + + "members on the subject are ignored with the current configuration*"); + } + + [Fact] + public void Only_ignore_non_browsable_matching_members() + { + // Arrange + var subject = new + { + NonExisting = 0 + }; + + var expectation = new + { + Existing = 1 + }; + + // Act + Action action = () => subject.Should().BeEquivalentTo(expectation, config => config.IgnoringNonBrowsableMembersOnSubject()); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void When_property_is_non_browsable_only_in_expectation_excluding_non_browsable_members_should_make_it_succeed() + { + // Arrange + var subject = new ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable + { + PropertyThatMightBeNonBrowsable = 0 + }; + + var expectation = + new ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable + { + PropertyThatMightBeNonBrowsable = 1 + }; + + // Act & Assert + subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); + } + + [Fact] + public void When_field_is_non_browsable_only_in_subject_excluding_non_browsable_members_should_not_make_it_succeed() + { + // Arrange + var subject = + new ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable + { + FieldThatMightBeNonBrowsable = 0 + }; + + var expectation = + new ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable + { + FieldThatMightBeNonBrowsable = 1 + }; + + // Act + Action action = + () => subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); + + // Assert + action.Should().Throw() + .WithMessage("Expected field subject.FieldThatMightBeNonBrowsable to be 1, but found 0.*"); + } + + [Fact] + public void When_field_is_non_browsable_only_in_subject_ignoring_non_browsable_members_on_subject_should_make_it_succeed() + { + // Arrange + var subject = + new ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable + { + FieldThatMightBeNonBrowsable = 0 + }; + + var expectation = + new ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable + { + FieldThatMightBeNonBrowsable = 1 + }; + + // Act & Assert + subject.Should().BeEquivalentTo( + expectation, + config => config.IgnoringNonBrowsableMembersOnSubject().ExcludingMissingMembers()); + } + + [Fact] + public void When_field_is_non_browsable_only_in_expectation_excluding_non_browsable_members_should_make_it_succeed() + { + // Arrange + var subject = new ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable + { + FieldThatMightBeNonBrowsable = 0 + }; + + var expectation = + new ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable + { + FieldThatMightBeNonBrowsable = 1 + }; + + // Act & Assert + subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); + } + + [Fact] + public void When_property_is_missing_from_subject_excluding_non_browsable_members_should_make_it_succeed() + { + // Arrange + var subject = + new + { + BrowsableField = 1, + BrowsableProperty = 1, + ExplicitlyBrowsableField = 1, + ExplicitlyBrowsableProperty = 1, + AdvancedBrowsableField = 1, + AdvancedBrowsableProperty = 1, + NonBrowsableField = 2 + /* NonBrowsableProperty missing */ + }; + + var expected = new ClassWithNonBrowsableMembers + { + BrowsableField = 1, + BrowsableProperty = 1, + ExplicitlyBrowsableField = 1, + ExplicitlyBrowsableProperty = 1, + AdvancedBrowsableField = 1, + AdvancedBrowsableProperty = 1, + NonBrowsableField = 2, + NonBrowsableProperty = 2 + }; + + // Act & Assert + subject.Should().BeEquivalentTo(expected, opt => opt.ExcludingNonBrowsableMembers()); + } + + [Fact] + public void When_field_is_missing_from_subject_excluding_non_browsable_members_should_make_it_succeed() + { + // Arrange + var subject = + new + { + BrowsableField = 1, + BrowsableProperty = 1, + ExplicitlyBrowsableField = 1, + ExplicitlyBrowsableProperty = 1, + AdvancedBrowsableField = 1, + AdvancedBrowsableProperty = 1, + /* NonBrowsableField missing */ + NonBrowsableProperty = 2 + }; + + var expected = new ClassWithNonBrowsableMembers + { + BrowsableField = 1, + BrowsableProperty = 1, + ExplicitlyBrowsableField = 1, + ExplicitlyBrowsableProperty = 1, + AdvancedBrowsableField = 1, + AdvancedBrowsableProperty = 1, + NonBrowsableField = 2, + NonBrowsableProperty = 2 + }; + + // Act & Assert + subject.Should().BeEquivalentTo(expected, opt => opt.ExcludingNonBrowsableMembers()); + } + + [Fact] + public void When_property_is_missing_from_expectation_excluding_non_browsable_members_should_make_it_succeed() + { + // Arrange + var subject = new ClassWithNonBrowsableMembers + { + BrowsableField = 1, + BrowsableProperty = 1, + ExplicitlyBrowsableField = 1, + ExplicitlyBrowsableProperty = 1, + AdvancedBrowsableField = 1, + AdvancedBrowsableProperty = 1, + NonBrowsableField = 2, + NonBrowsableProperty = 2 + }; + + var expected = + new + { + BrowsableField = 1, + BrowsableProperty = 1, + ExplicitlyBrowsableField = 1, + ExplicitlyBrowsableProperty = 1, + AdvancedBrowsableField = 1, + AdvancedBrowsableProperty = 1, + NonBrowsableField = 2 + /* NonBrowsableProperty missing */ + }; + + // Act & Assert + subject.Should().BeEquivalentTo(expected, opt => opt.ExcludingNonBrowsableMembers()); + } + + [Fact] + public void When_field_is_missing_from_expectation_excluding_non_browsable_members_should_make_it_succeed() + { + // Arrange + var subject = new ClassWithNonBrowsableMembers + { + BrowsableField = 1, + BrowsableProperty = 1, + ExplicitlyBrowsableField = 1, + ExplicitlyBrowsableProperty = 1, + AdvancedBrowsableField = 1, + AdvancedBrowsableProperty = 1, + NonBrowsableField = 2, + NonBrowsableProperty = 2 + }; + + var expected = + new + { + BrowsableField = 1, + BrowsableProperty = 1, + ExplicitlyBrowsableField = 1, + ExplicitlyBrowsableProperty = 1, + AdvancedBrowsableField = 1, + AdvancedBrowsableProperty = 1, + /* NonBrowsableField missing */ + NonBrowsableProperty = 2 + }; + + // Act & Assert + subject.Should().BeEquivalentTo(expected, opt => opt.ExcludingNonBrowsableMembers()); + } + + [Fact] + public void + When_non_browsable_members_are_excluded_it_should_still_be_possible_to_explicitly_include_non_browsable_field() + { + // Arrange + var subject = new ClassWithNonBrowsableMembers + { + NonBrowsableField = 1 + }; + + var expectation = new ClassWithNonBrowsableMembers + { + NonBrowsableField = 2 + }; + + // Act + Action action = + () => subject.Should().BeEquivalentTo( + expectation, + opt => opt.IncludingFields().ExcludingNonBrowsableMembers().Including(e => e.NonBrowsableField)); + + // Assert + action.Should().Throw() + .WithMessage("Expected field subject.NonBrowsableField to be 2, but found 1.*"); + } + + [Fact] + public void + When_non_browsable_members_are_excluded_it_should_still_be_possible_to_explicitly_include_non_browsable_property() + { + // Arrange + var subject = new ClassWithNonBrowsableMembers + { + NonBrowsableProperty = 1 + }; + + var expectation = new ClassWithNonBrowsableMembers + { + NonBrowsableProperty = 2 + }; + + // Act + Action action = + () => subject.Should().BeEquivalentTo( + expectation, + opt => opt.IncludingProperties().ExcludingNonBrowsableMembers().Including(e => e.NonBrowsableProperty)); + + // Assert + action.Should().Throw() + .WithMessage("Expected property subject.NonBrowsableProperty to be 2, but found 1.*"); + } + + private class ClassWithNonBrowsableMembers + { + public int BrowsableField = -1; + + public int BrowsableProperty { get; set; } + + [EditorBrowsable(EditorBrowsableState.Always)] + public int ExplicitlyBrowsableField = -1; + + [EditorBrowsable(EditorBrowsableState.Always)] + public int ExplicitlyBrowsableProperty { get; set; } + + [EditorBrowsable(EditorBrowsableState.Advanced)] + public int AdvancedBrowsableField = -1; + + [EditorBrowsable(EditorBrowsableState.Advanced)] + public int AdvancedBrowsableProperty { get; set; } + + [EditorBrowsable(EditorBrowsableState.Never)] + public int NonBrowsableField = -1; + + [EditorBrowsable(EditorBrowsableState.Never)] + public int NonBrowsableProperty { get; set; } + } + + private class ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable + { + public int BrowsableProperty { get; set; } + + public int FieldThatMightBeNonBrowsable = -1; + + public int PropertyThatMightBeNonBrowsable { get; set; } + } + + private class ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable + { + public int BrowsableProperty { get; set; } + + [EditorBrowsable(EditorBrowsableState.Never)] + public int FieldThatMightBeNonBrowsable = -1; + + [EditorBrowsable(EditorBrowsableState.Never)] + public int PropertyThatMightBeNonBrowsable { get; set; } + } + } +} diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Covariance.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Covariance.cs new file mode 100644 index 0000000000..bd3ba9825a --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Covariance.cs @@ -0,0 +1,100 @@ +#if NET5_0_OR_GREATER + +using System; +using Xunit; + +namespace FluentAssertions.Equivalency.Specs; + +public partial class SelectionRulesSpecs +{ + public class Covariance + { + [Fact] + public void Excluding_a_covariant_property_should_work() + { + // Arrange + var actual = new DerivedWithCovariantOverride(new DerivedWithProperty + { + DerivedProperty = "a", + BaseProperty = "a_base" + }) + { + OtherProp = "other" + }; + + var expectation = new DerivedWithCovariantOverride(new DerivedWithProperty + { + DerivedProperty = "b", + BaseProperty = + "b_base" + }) + { + OtherProp = "other" + }; + + // Act / Assert + actual.Should().BeEquivalentTo(expectation, opts => opts + .Excluding(d => d.Property)); + } + + [Fact] + public void Excluding_a_covariant_property_through_the_base_class_excludes_the_base_class_property() + { + // Arrange + var actual = new DerivedWithCovariantOverride(new DerivedWithProperty + { + DerivedProperty = "a", + BaseProperty = "a_base" + }) + { + OtherProp = "other" + }; + + BaseWithAbstractProperty expectation = new DerivedWithCovariantOverride(new DerivedWithProperty + { + DerivedProperty = + "b", + BaseProperty = "b_base" + }) + { + OtherProp = "other" + }; + + // Act + Action act = () => actual.Should().BeEquivalentTo(expectation, opts => opts + .Excluding(d => d.Property)); + + // Assert + act.Should().Throw().WithMessage("No members*"); + } + + private class BaseWithProperty + { + public string BaseProperty { get; set; } + } + + private class DerivedWithProperty : BaseWithProperty + { + public string DerivedProperty { get; set; } + } + + private abstract class BaseWithAbstractProperty + { + public abstract BaseWithProperty Property { get; } + } + + private sealed class DerivedWithCovariantOverride : BaseWithAbstractProperty + { + public override DerivedWithProperty Property { get; } + + public string OtherProp { get; set; } + + public DerivedWithCovariantOverride(DerivedWithProperty prop) + { + Property = prop; + } + } + } +} + +#endif diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs new file mode 100644 index 0000000000..09c3858e6b --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs @@ -0,0 +1,670 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using FluentAssertions.Common; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Equivalency.Specs; + +public partial class SelectionRulesSpecs +{ + public class Excluding + { + [Fact] + public void A_member_excluded_by_path_is_described_in_the_failure_message() + { + // Arrange + var subject = new + { + Name = "John", + Age = 13 + }; + + var customer = new + { + Name = "Jack", + Age = 37 + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(customer, options => options + .Excluding(d => d.Age)); + + // Assert + act.Should().Throw() + .WithMessage("*Exclude*Age*"); + } + + [Fact] + public void A_member_excluded_by_predicate_is_described_in_the_failure_message() + { + // Arrange + var subject = new + { + Name = "John", + Age = 13 + }; + + var customer = new + { + Name = "Jack", + Age = 37 + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(customer, options => options + .Excluding(ctx => ctx.Path == "Age")); + + // Assert + act.Should().Throw() + .WithMessage("*Exclude member when*Age*"); + } + + [Fact] + public void When_only_the_excluded_property_doesnt_match_it_should_not_throw() + { + // Arrange + var dto = new CustomerDto + { + Age = 36, + Birthdate = new DateTime(1973, 9, 20), + Name = "John" + }; + + var customer = new Customer + { + Age = 36, + Birthdate = new DateTime(1973, 9, 20), + Name = "Dennis" + }; + + // Act / Assert + dto.Should().BeEquivalentTo(customer, options => options + .Excluding(d => d.Name) + .Excluding(d => d.Id)); + } + + [Fact] + public void When_only_the_excluded_property_doesnt_match_it_should_not_throw_if_root_is_a_collection() + { + // Arrange + var dto = new Customer + { + Age = 36, + Birthdate = new DateTime(1973, 9, 20), + Name = "John" + }; + + var customer = new Customer + { + Age = 36, + Birthdate = new DateTime(1973, 9, 20), + Name = "Dennis" + }; + + // Act / Assert + new[] { dto }.Should().BeEquivalentTo(new[] { customer }, options => options + .Excluding(d => d.Name) + .Excluding(d => d.Id)); + } + + [Fact] + [SuppressMessage("ReSharper", "StringLiteralTypo")] + public void When_excluding_members_it_should_pass_if_only_the_excluded_members_are_different() + { + // Arrange + var class1 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum", + Field3 = "dolor", + Property1 = "sit" + }; + + var class2 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum" + }; + + // Act + Action act = + () => + class1.Should().BeEquivalentTo(class2, + opts => opts.Excluding(o => o.Field3).Excluding(o => o.Property1)); + + // Assert + act.Should().NotThrow("the non-excluded fields have the same value"); + } + + [Fact] + [SuppressMessage("ReSharper", "StringLiteralTypo")] + public void When_excluding_members_it_should_fail_if_any_non_excluded_members_are_different() + { + // Arrange + var class1 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum", + Field3 = "dolor", + Property1 = "sit" + }; + + var class2 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum" + }; + + // Act + Action act = + () => class1.Should().BeEquivalentTo(class2, opts => opts.Excluding(o => o.Property1)); + + // Assert + act.Should().Throw().WithMessage("Expected*Field3*"); + } + + [Fact] + public void When_all_shared_properties_match_it_should_not_throw() + { + // Arrange + var dto = new CustomerDto + { + Age = 36, + Birthdate = new DateTime(1973, 9, 20), + Name = "John" + }; + + var customer = new Customer + { + Id = 1, + Age = 36, + Birthdate = new DateTime(1973, 9, 20), + Name = "John" + }; + + // Act + Action act = () => dto.Should().BeEquivalentTo(customer, options => options.ExcludingMissingMembers()); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_deeply_nested_property_with_a_value_mismatch_is_excluded_it_should_not_throw() + { + // Arrange + var subject = new Root + { + Text = "Root", + Level = new Level1 + { + Text = "Level1", + Level = new Level2 + { + Text = "Mismatch" + } + } + }; + + var expected = new RootDto + { + Text = "Root", + Level = new Level1Dto + { + Text = "Level1", + Level = new Level2Dto + { + Text = "Level2" + } + } + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expected, + options => options.Excluding(r => r.Level.Level.Text)); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_deeply_nested_property_with_a_value_mismatch_is_excluded_it_should_not_throw_if_root_is_a_collection() + { + // Arrange + var subject = new Root + { + Text = "Root", + Level = new Level1 + { + Text = "Level1", + Level = new Level2 + { + Text = "Mismatch" + } + } + }; + + var expected = new RootDto + { + Text = "Root", + Level = new Level1Dto + { + Text = "Level1", + Level = new Level2Dto + { + Text = "Level2" + } + } + }; + + // Act / Assert + new[] { subject }.Should().BeEquivalentTo(new[] { expected }, + options => options.Excluding(r => r.Level.Level.Text)); + } + + [Fact] + public void When_a_property_with_a_value_mismatch_is_excluded_using_a_predicate_it_should_not_throw() + { + // Arrange + var subject = new Root + { + Text = "Root", + Level = new Level1 + { + Text = "Level1", + Level = new Level2 + { + Text = "Mismatch" + } + } + }; + + var expected = new RootDto + { + Text = "Root", + Level = new Level1Dto + { + Text = "Level1", + Level = new Level2Dto + { + Text = "Level2" + } + } + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expected, config => + config.Excluding(ctx => ctx.Path == "Level.Level.Text")); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_members_are_excluded_by_the_access_modifier_of_the_getter_using_a_predicate_they_should_be_ignored() + { + // Arrange + var subject = new ClassWithAllAccessModifiersForMembers("public", "protected", + "internal", "protected-internal", "private", "private-protected"); + + var expected = new ClassWithAllAccessModifiersForMembers("public", "protected", + "ignored-internal", "ignored-protected-internal", "private", "private-protected"); + + // Act + Action act = () => subject.Should().BeEquivalentTo(expected, config => config + .IncludingInternalFields() + .Excluding(ctx => + ctx.WhichGetterHas(CSharpAccessModifier.Internal) || + ctx.WhichGetterHas(CSharpAccessModifier.ProtectedInternal))); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_members_are_excluded_by_the_access_modifier_of_the_setter_using_a_predicate_they_should_be_ignored() + { + // Arrange + var subject = new ClassWithAllAccessModifiersForMembers("public", "protected", + "internal", "protected-internal", "private", "private-protected"); + + var expected = new ClassWithAllAccessModifiersForMembers("public", "protected", + "ignored-internal", "ignored-protected-internal", "ignored-private", "private-protected"); + + // Act + Action act = () => subject.Should().BeEquivalentTo(expected, config => config + .IncludingInternalFields() + .Excluding(ctx => + ctx.WhichSetterHas(CSharpAccessModifier.Internal) || + ctx.WhichSetterHas(CSharpAccessModifier.ProtectedInternal) || + ctx.WhichSetterHas(CSharpAccessModifier.Private))); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + [SuppressMessage("ReSharper", "StringLiteralTypo")] + public void When_excluding_properties_it_should_still_compare_fields() + { + // Arrange + var class1 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum", + Field3 = "dolor", + Property1 = "sit", + Property2 = "amet", + Property3 = "consectetur" + }; + + var class2 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum", + Field3 = "color" + }; + + // Act + Action act = + () => class1.Should().BeEquivalentTo(class2, opts => opts.ExcludingProperties()); + + // Assert + act.Should().Throw().WithMessage("*color*dolor*"); + } + + [Fact] + public void When_excluding_fields_it_should_still_compare_properties() + { + // Arrange + var class1 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum", + Field3 = "dolor", + Property1 = "sit", + Property2 = "amet", + Property3 = "consectetur" + }; + + var class2 = new ClassWithSomeFieldsAndProperties + { + Property1 = "sit", + Property2 = "amet", + Property3 = "different" + }; + + // Act + Action act = + () => class1.Should().BeEquivalentTo(class2, opts => opts.ExcludingFields()); + + // Assert + act.Should().Throw().WithMessage("*Property3*consectetur*"); + } + + [Fact] + public void When_excluding_properties_via_non_array_indexers_it_should_exclude_the_specified_paths() + { + // Arrange + var subject = new + { + List = new[] + { + new + { + Foo = 1, + Bar = 2 + }, + new + { + Foo = 3, + Bar = 4 + } + }.ToList(), + Dictionary = new Dictionary + { + ["Foo"] = new() + { + Value = 1 + }, + ["Bar"] = new() + { + Value = 2 + } + } + }; + + var expected = new + { + List = new[] + { + new + { + Foo = 1, + Bar = 2 + }, + new + { + Foo = 2, + Bar = 4 + } + }.ToList(), + Dictionary = new Dictionary + { + ["Foo"] = new() + { + Value = 1 + }, + ["Bar"] = new() + { + Value = 3 + } + } + }; + + // Act + Action act = () => + subject.Should().BeEquivalentTo(expected, + options => options + .Excluding(x => x.List[1].Foo) + .Excluding(x => x.Dictionary["Bar"].Value)); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void + When_excluding_properties_via_non_array_indexers_it_should_exclude_the_specified_paths_if_root_is_a_collection() + { + // Arrange + var subject = new + { + List = new[] + { + new + { + Foo = 1, + Bar = 2 + }, + new + { + Foo = 3, + Bar = 4 + } + }.ToList(), + Dictionary = new Dictionary + { + ["Foo"] = new() + { + Value = 1 + }, + ["Bar"] = new() + { + Value = 2 + } + } + }; + + var expected = new + { + List = new[] + { + new + { + Foo = 1, + Bar = 2 + }, + new + { + Foo = 2, + Bar = 4 + } + }.ToList(), + Dictionary = new Dictionary + { + ["Foo"] = new() + { + Value = 1 + }, + ["Bar"] = new() + { + Value = 3 + } + } + }; + + // Act / Assert + new[] { subject }.Should().BeEquivalentTo(new[] { expected }, + options => options + .Excluding(x => x.List[1].Foo) + .Excluding(x => x.Dictionary["Bar"].Value)); + } + + [Fact] + public void When_excluding_properties_via_non_array_indexers_it_should_not_exclude_paths_with_different_indexes() + { + // Arrange + var subject = new + { + List = new[] + { + new + { + Foo = 1, + Bar = 2 + }, + new + { + Foo = 3, + Bar = 4 + } + }.ToList(), + Dictionary = new Dictionary + { + ["Foo"] = new() + { + Value = 1 + }, + ["Bar"] = new() + { + Value = 2 + } + } + }; + + var expected = new + { + List = new[] + { + new + { + Foo = 5, + Bar = 2 + }, + new + { + Foo = 2, + Bar = 4 + } + }.ToList(), + Dictionary = new Dictionary + { + ["Foo"] = new() + { + Value = 6 + }, + ["Bar"] = new() + { + Value = 3 + } + } + }; + + // Act + Action act = () => + subject.Should().BeEquivalentTo(expected, + options => options + .Excluding(x => x.List[1].Foo) + .Excluding(x => x.Dictionary["Bar"].Value)); + + // Assert + act.Should().Throw(); + } + + [Fact] + [SuppressMessage("ReSharper", "StringLiteralTypo")] + public void + When_configured_for_runtime_typing_and_properties_are_excluded_the_runtime_type_should_be_used_and_properties_should_be_ignored() + { + // Arrange + object class1 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum", + Field3 = "dolor", + Property1 = "sit", + Property2 = "amet", + Property3 = "consectetur" + }; + + object class2 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum", + Field3 = "dolor" + }; + + // Act + Action act = + () => class1.Should().BeEquivalentTo(class2, opts => opts.ExcludingProperties().RespectingRuntimeTypes()); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_excluding_virtual_or_abstract_property_exclusion_works_properly() + { + var obj1 = new Derived + { + DerivedProperty1 = "Something", + DerivedProperty2 = "A" + }; + + var obj2 = new Derived + { + DerivedProperty1 = "Something", + DerivedProperty2 = "B" + }; + + obj1.Should().BeEquivalentTo(obj2, opt => opt + .Excluding(o => o.AbstractProperty) + .Excluding(o => o.VirtualProperty) + .Excluding(o => o.DerivedProperty2)); + } + } +} diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs new file mode 100644 index 0000000000..3bdfc2a9f5 --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs @@ -0,0 +1,353 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Equivalency.Specs; + +public partial class SelectionRulesSpecs +{ + public class Including + { + [Fact] + public void When_specific_properties_have_been_specified_it_should_ignore_the_other_properties() + { + // Arrange + var subject = new + { + Age = 36, + Birthdate = new DateTime(1973, 9, 20), + Name = "John" + }; + + var customer = new + { + Age = 36, + Birthdate = new DateTime(1973, 9, 20), + Name = "Dennis" + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(customer, options => options + .Including(d => d.Age) + .Including(d => d.Birthdate)); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void A_member_included_by_path_is_described_in_the_failure_message() + { + // Arrange + var subject = new + { + Name = "John" + }; + + var customer = new + { + Name = "Jack" + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(customer, options => options + .Including(d => d.Name)); + + // Assert + act.Should().Throw() + .WithMessage("*Include*Name*"); + } + + [Fact] + public void A_member_included_by_predicate_is_described_in_the_failure_message() + { + // Arrange + var subject = new + { + Name = "John" + }; + + var customer = new + { + Name = "Jack" + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(customer, options => options + .Including(ctx => ctx.Path == "Name")); + + // Assert + act.Should().Throw() + .WithMessage("*Include member when*Name*"); + } + + [Fact] + public void When_a_predicate_for_properties_to_include_has_been_specified_it_should_ignore_the_other_properties() + { + // Arrange + var subject = new + { + Age = 36, + Birthdate = new DateTime(1973, 9, 20), + Name = "John" + }; + + var customer = new + { + Age = 36, + Birthdate = new DateTime(1973, 9, 20), + Name = "Dennis" + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(customer, options => options + .Including(info => info.Path.EndsWith("Age", StringComparison.Ordinal)) + .Including(info => info.Path.EndsWith("Birthdate", StringComparison.Ordinal))); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_a_non_property_expression_is_provided_it_should_throw() + { + // Arrange + var dto = new CustomerDto(); + + // Act + Action act = () => dto.Should().BeEquivalentTo(dto, options => options.Including(d => d.GetType())); + + // Assert + act.Should().Throw() + .WithMessage("Expression cannot be used to select a member.*") + .WithParameterName("expression"); + } + + [Fact] + public void When_including_a_property_it_should_exactly_match_the_property() + { + // Arrange + var actual = new + { + DeclaredType = LocalOtherType.NonDefault, + Type = LocalType.NonDefault + }; + + var expectation = new + { + DeclaredType = LocalOtherType.NonDefault + }; + + // Act + Action act = () => actual.Should().BeEquivalentTo(expectation, + config => config.Including(o => o.DeclaredType)); + + // Assert + act.Should().NotThrow(); + } + + private enum LocalOtherType : byte + { + Default, + NonDefault + } + + private enum LocalType : byte + { + Default, + NonDefault + } + + public class CustomType + { + public string Name { get; set; } + } + + [Fact] + public void When_including_a_property_using_an_expression_it_should_evaluate_it_from_the_root() + { + // Arrange + var list1 = new List + { + new() + { + Name = "A" + }, + new() + { + Name = "B" + } + }; + + var list2 = new List + { + new() + { + Name = "C" + }, + new() + { + Name = "D" + } + }; + + var objectA = new ClassA + { + ListOfCustomTypes = list1 + }; + + var objectB = new ClassA + { + ListOfCustomTypes = list2 + }; + + // Act + Action act = () => objectA.Should().BeEquivalentTo(objectB, options => options.Including(x => x.ListOfCustomTypes)); + + // Assert + act.Should().Throw().WithMessage("*C*but*A*D*but*B*"); + } + + private class ClassA + { + public List ListOfCustomTypes { get; set; } + } + + [Fact] + public void When_null_is_provided_as_property_expression_it_should_throw() + { + // Arrange + var dto = new CustomerDto(); + + // Act + Action act = + () => dto.Should().BeEquivalentTo(dto, options => options.Including(null)); + + // Assert + act.Should().Throw().WithMessage( + "Expected an expression, but found .*"); + } + + [Fact] + [SuppressMessage("ReSharper", "StringLiteralTypo")] + public void When_including_fields_it_should_succeed_if_just_the_included_field_match() + { + // Arrange + var class1 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum", + Field3 = "dolor", + Property1 = "sit", + Property2 = "amet", + Property3 = "consectetur" + }; + + var class2 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum" + }; + + // Act + Action act = + () => + class1.Should().BeEquivalentTo(class2, opts => opts.Including(o => o.Field1).Including(o => o.Field2)); + + // Assert + act.Should().NotThrow("the only selected fields have the same value"); + } + + [Fact] + [SuppressMessage("ReSharper", "StringLiteralTypo")] + public void When_including_fields_it_should_fail_if_any_included_field_do_not_match() + { + // Arrange + var class1 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum", + Field3 = "dolor", + Property1 = "sit", + Property2 = "amet", + Property3 = "consectetur" + }; + + var class2 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum" + }; + + // Act + Action act = + () => + class1.Should().BeEquivalentTo(class2, + opts => opts.Including(o => o.Field1).Including(o => o.Field2).Including(o => o.Field3)); + + // Assert + act.Should().Throw().WithMessage("Expected field class1.Field3*"); + } + + [Fact] + [SuppressMessage("ReSharper", "StringLiteralTypo")] + public void When_both_field_and_properties_are_configured_for_inclusion_both_should_be_included() + { + // Arrange + var class1 = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Property1 = "sit" + }; + + var class2 = new ClassWithSomeFieldsAndProperties(); + + // Act + Action act = + () => class1.Should().BeEquivalentTo(class2, opts => opts.IncludingFields().IncludingProperties()); + + // Assert + act.Should().Throw().Which.Message.Should().Contain("Field1").And.Contain("Property1"); + } + + [Fact] + public void Including_nested_objects_restores_the_default_behavior() + { + // Arrange + var subject = new Root + { + Text = "Root", + Level = new Level1 + { + Text = "Level1", + Level = new Level2 + { + Text = "Mismatch" + } + } + }; + + var expected = new RootDto + { + Text = "Root", + Level = new Level1Dto + { + Text = "Level1", + Level = new Level2Dto + { + Text = "Level2" + } + } + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expected, + options => options.ExcludingNestedObjects().IncludingNestedObjects()); + + // Assert + act.Should().Throw().WithMessage("*Level.Level.Text*Level2*Mismatch*"); + } + } +} diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs new file mode 100644 index 0000000000..33a0794b60 --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs @@ -0,0 +1,378 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Equivalency.Specs; + +public partial class SelectionRulesSpecs +{ + public class Interfaces + { + [Fact] + public void When_an_interface_hierarchy_is_used_it_should_include_all_inherited_properties() + { + // Arrange + ICar subject = new Car + { + VehicleId = 1, + Wheels = 4 + }; + + ICar expected = new Car + { + VehicleId = 99999, + Wheels = 4 + }; + + // Act + Action action = () => subject.Should().BeEquivalentTo(expected); + + // Assert + action + .Should().Throw() + .WithMessage("Expected*VehicleId*99999*but*1*"); + } + + [Fact] + public void When_a_reference_to_an_interface_is_provided_it_should_only_include_those_properties() + { + // Arrange + IVehicle expected = new Car + { + VehicleId = 1, + Wheels = 4 + }; + + IVehicle subject = new Car + { + VehicleId = 1, + Wheels = 99999 + }; + + // Act + Action action = () => subject.Should().BeEquivalentTo(expected); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void When_a_reference_to_an_explicit_interface_impl_is_provided_it_should_only_include_those_properties() + { + // Arrange + IVehicle expected = new ExplicitCar + { + Wheels = 4 + }; + + IVehicle subject = new ExplicitCar + { + Wheels = 99999 + }; + + // Act + Action action = () => subject.Should().BeEquivalentTo(expected); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void Explicitly_implemented_subject_properties_are_ignored_if_a_normal_property_exists_with_the_same_name() + { + // Arrange + IVehicle expected = new Vehicle + { + VehicleId = 1 + }; + + IVehicle subject = new ExplicitVehicle + { + VehicleId = 2 // normal property + }; + + subject.VehicleId = 1; // explicitly implemented property + + // Act + Action action = () => subject.Should().BeEquivalentTo(expected); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void Explicitly_implemented_read_only_subject_properties_are_ignored_if_a_normal_property_exists_with_the_same_name() + { + // Arrange + IReadOnlyVehicle subject = new ExplicitReadOnlyVehicle(explicitValue: 1) + { + VehicleId = 2 // normal property + }; + + var expected = new Vehicle + { + VehicleId = 1 + }; + + // Act + Action action = () => subject.Should().BeEquivalentTo(expected); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void Explicitly_implemented_subject_properties_are_ignored_if_only_fields_are_included() + { + // Arrange + var expected = new VehicleWithField + { + VehicleId = 1 // A field named like a property + }; + + var subject = new ExplicitVehicle + { + VehicleId = 2 // A real property + }; + + // Act + Action action = () => subject.Should().BeEquivalentTo(expected, opt => opt + .IncludingFields() + .ExcludingProperties()); + + // Assert + action.Should().Throw().WithMessage("*field*VehicleId*other*"); + } + + [Fact] + public void Explicitly_implemented_subject_properties_are_ignored_if_only_fields_are_included_and_they_may_be_missing() + { + // Arrange + var expected = new VehicleWithField + { + VehicleId = 1 // A field named like a property + }; + + var subject = new ExplicitVehicle + { + VehicleId = 2 // A real property + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expected, opt => opt + .IncludingFields() + .ExcludingProperties() + .ExcludingMissingMembers()); + } + + [Fact] + public void Excluding_missing_members_does_not_affect_how_explicitly_implemented_subject_properties_are_dealt_with() + { + // Arrange + IVehicle expected = new Vehicle + { + VehicleId = 1 + }; + + IVehicle subject = new ExplicitVehicle + { + VehicleId = 2 // instance member + }; + + subject.VehicleId = 1; // interface member + + // Act + Action action = () => subject.Should().BeEquivalentTo(expected, opt => opt.ExcludingMissingMembers()); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void When_respecting_declared_types_explicit_interface_member_on_interfaced_expectation_should_be_used() + { + // Arrange + IVehicle expected = new ExplicitVehicle + { + VehicleId = 2 // instance member + }; + + expected.VehicleId = 1; // interface member + + IVehicle subject = new Vehicle + { + VehicleId = 1 + }; + + // Act + Action action = () => subject.Should().BeEquivalentTo(expected, opt => opt.RespectingDeclaredTypes()); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void When_respecting_runtime_types_explicit_interface_member_on_interfaced_subject_should_not_be_used() + { + // Arrange + IVehicle expected = new Vehicle + { + VehicleId = 1 + }; + + IVehicle subject = new ExplicitVehicle + { + VehicleId = 2 // instance member + }; + + subject.VehicleId = 1; // interface member + + // Act + Action action = () => subject.Should().BeEquivalentTo(expected, opt => opt.RespectingRuntimeTypes()); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void When_respecting_runtime_types_explicit_interface_member_on_interfaced_expectation_should_not_be_used() + { + // Arrange + IVehicle expected = new ExplicitVehicle + { + VehicleId = 2 // instance member + }; + + expected.VehicleId = 1; // interface member + + IVehicle subject = new Vehicle + { + VehicleId = 1 + }; + + // Act + Action action = () => subject.Should().BeEquivalentTo(expected, opt => opt.RespectingRuntimeTypes()); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void When_respecting_declared_types_explicit_interface_member_on_expectation_should_not_be_used() + { + // Arrange + var expected = new ExplicitVehicle + { + VehicleId = 2 + }; + + ((IVehicle)expected).VehicleId = 1; + + var subject = new Vehicle + { + VehicleId = 1 + }; + + // Act + Action action = () => subject.Should().BeEquivalentTo(expected); + + // Assert + action.Should().Throw(); + } + + [Fact] + public void Can_find_explicitly_implemented_property_on_the_subject() + { + // Arrange + IPerson person = new Person(); + person.Name = "Bob"; + + // Act / Assert + person.Should().BeEquivalentTo(new { Name = "Bob" }); + } + + private interface IPerson + { + string Name { get; set; } + } + + private class Person : IPerson + { + string IPerson.Name { get; set; } + } + + [Fact] + public void Excluding_an_interface_property_through_inheritance_should_work() + { + // Arrange + IInterfaceWithTwoProperties[] actual = + { + new DerivedClassImplementingInterface + { + Value1 = 1, + Value2 = 2 + } + }; + + IInterfaceWithTwoProperties[] expected = + { + new DerivedClassImplementingInterface + { + Value1 = 999, + Value2 = 2 + } + }; + + // Act / Assert + actual.Should().BeEquivalentTo(expected, options => options + .Excluding(a => a.Value1) + .RespectingRuntimeTypes()); + } + + [Fact] + public void Including_an_interface_property_through_inheritance_should_work() + { + // Arrange + IInterfaceWithTwoProperties[] actual = + { + new DerivedClassImplementingInterface + { + Value1 = 1, + Value2 = 2 + } + }; + + IInterfaceWithTwoProperties[] expected = + { + new DerivedClassImplementingInterface + { + Value1 = 999, + Value2 = 2 + } + }; + + // Act / Assert + actual.Should().BeEquivalentTo(expected, options => options + .Including(a => a.Value2) + .RespectingRuntimeTypes()); + } + + public interface IInterfaceWithTwoProperties + { + int Value1 { get; set; } + + int Value2 { get; set; } + } + + public class BaseProvidingSamePropertiesAsInterface + { + public int Value1 { get; set; } + + public int Value2 { get; set; } + } + + public class DerivedClassImplementingInterface : BaseProvidingSamePropertiesAsInterface, IInterfaceWithTwoProperties + { + } + } +} diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.MemberHiding.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.MemberHiding.cs new file mode 100644 index 0000000000..c5ccc70e7f --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.MemberHiding.cs @@ -0,0 +1,312 @@ +using System; +using Xunit; + +namespace FluentAssertions.Equivalency.Specs; + +public partial class SelectionRulesSpecs +{ + public class MemberHiding + { + [Fact] + public void Ignores_properties_hidden_by_the_derived_class() + { + // Arrange + var subject = new SubclassAHidingProperty + { + Property = "DerivedValue" + }; + + ((BaseWithProperty)subject).Property = "ActualBaseValue"; + + var expectation = new SubclassBHidingProperty + { + Property = "DerivedValue" + }; + + ((AnotherBaseWithProperty)expectation).Property = "ExpectedBaseValue"; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation); + } + + [Fact] + public void Ignores_properties_of_the_same_runtime_types_hidden_by_the_derived_class() + { + // Arrange + var subject = new SubclassHidingStringProperty + { + Property = "DerivedValue" + }; + + ((BaseWithStringProperty)subject).Property = "ActualBaseValue"; + + var expectation = new SubclassHidingStringProperty + { + Property = "DerivedValue" + }; + + ((BaseWithStringProperty)expectation).Property = "ExpectedBaseValue"; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation); + } + + [Fact] + public void Includes_hidden_property_of_the_base_when_using_a_reference_to_the_base() + { + // Arrange + BaseWithProperty subject = new SubclassAHidingProperty + { + Property = "ActualDerivedValue" + }; + + // FA doesn't know the compile-time type of the subject, so even though we pass a reference to the base-class, + // at run-time, it'll start finding the property on the subject starting from the run-time type, and thus ignore the + // hidden base-class field + ((SubclassAHidingProperty)subject).Property = "BaseValue"; + + AnotherBaseWithProperty expectation = new SubclassBHidingProperty + { + Property = "ExpectedDerivedValue" + }; + + expectation.Property = "BaseValue"; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation); + } + + [Fact] + public void Run_type_typing_ignores_hidden_properties_even_when_using_a_reference_to_the_base_class() + { + // Arrange + var subject = new SubclassAHidingProperty + { + Property = "DerivedValue" + }; + + ((BaseWithProperty)subject).Property = "ActualBaseValue"; + + AnotherBaseWithProperty expectation = new SubclassBHidingProperty + { + Property = "DerivedValue" + }; + + expectation.Property = "ExpectedBaseValue"; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, o => o.RespectingRuntimeTypes()); + } + + [Fact] + public void Including_the_derived_property_excludes_the_hidden_property() + { + // Arrange + var subject = new SubclassAHidingProperty + { + Property = "DerivedValue" + }; + + ((BaseWithProperty)subject).Property = "ActualBaseValue"; + + var expectation = new SubclassBHidingProperty + { + Property = "DerivedValue" + }; + + ((AnotherBaseWithProperty)expectation).Property = "ExpectedBaseValue"; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, opt => opt + .Including(o => o.Property)); + } + + [Fact] + public void Excluding_the_property_hiding_the_base_class_one_does_not_reveal_the_latter() + { + // Arrange + var subject = new SubclassAHidingProperty(); + + ((BaseWithProperty)subject).Property = "ActualBaseValue"; + + var expectation = new SubclassBHidingProperty(); + + ((AnotherBaseWithProperty)expectation).Property = "ExpectedBaseValue"; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, o => o + .Excluding(b => b.Property)); + + // Assert + act.Should().Throw().WithMessage("*No members were found *"); + } + + private class BaseWithProperty + { + public object Property { get; set; } + } + + private class SubclassAHidingProperty : BaseWithProperty + { + public new T Property { get; set; } + } + + private class BaseWithStringProperty + { + public string Property { get; set; } + } + + private class SubclassHidingStringProperty : BaseWithStringProperty + { + public new string Property { get; set; } + } + + private class AnotherBaseWithProperty + { + public object Property { get; set; } + } + + private class SubclassBHidingProperty : AnotherBaseWithProperty + { + public new T Property + { + get; + set; + } + } + + [Fact] + public void Ignores_fields_hidden_by_the_derived_class() + { + // Arrange + var subject = new SubclassAHidingField + { + Field = "DerivedValue" + }; + + ((BaseWithField)subject).Field = "ActualBaseValue"; + + var expectation = new SubclassBHidingField + { + Field = "DerivedValue" + }; + + ((AnotherBaseWithField)expectation).Field = "ExpectedBaseValue"; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options.IncludingFields()); + } + + [Fact] + public void Includes_hidden_field_of_the_base_when_using_a_reference_to_the_base() + { + // Arrange + BaseWithField subject = new SubclassAHidingField + { + Field = "BaseValueFromSubject" + }; + + // FA doesn't know the compile-time type of the subject, so even though we pass a reference to the base-class, + // at run-time, it'll start finding the field on the subject starting from the run-time type, and thus ignore the + // hidden base-class field + ((SubclassAHidingField)subject).Field = "BaseValueFromExpectation"; + + AnotherBaseWithField expectation = new SubclassBHidingField + { + Field = "ExpectedDerivedValue" + }; + + expectation.Field = "BaseValueFromExpectation"; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options.IncludingFields()); + } + + [Fact] + public void Run_type_typing_ignores_hidden_fields_even_when_using_a_reference_to_the_base_class() + { + // Arrange + var subject = new SubclassAHidingField + { + Field = "DerivedValue" + }; + + ((BaseWithField)subject).Field = "ActualBaseValue"; + + AnotherBaseWithField expectation = new SubclassBHidingField + { + Field = "DerivedValue" + }; + + expectation.Field = "ExpectedBaseValue"; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options.IncludingFields().RespectingRuntimeTypes()); + } + + [Fact] + public void Including_the_derived_field_excludes_the_hidden_field() + { + // Arrange + var subject = new SubclassAHidingField + { + Field = "DerivedValue" + }; + + ((BaseWithField)subject).Field = "ActualBaseValue"; + + var expectation = new SubclassBHidingField + { + Field = "DerivedValue" + }; + + ((AnotherBaseWithField)expectation).Field = "ExpectedBaseValue"; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .IncludingFields() + .Including(o => o.Field)); + } + + [Fact] + public void Excluding_the_field_hiding_the_base_class_one_does_not_reveal_the_latter() + { + // Arrange + var subject = new SubclassAHidingField(); + + ((BaseWithField)subject).Field = "ActualBaseValue"; + + var expectation = new SubclassBHidingField(); + + ((AnotherBaseWithField)expectation).Field = "ExpectedBaseValue"; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, options => options + .IncludingFields() + .Excluding(b => b.Field)); + + // Assert + act.Should().Throw().WithMessage("*No members were found *"); + } + + private class BaseWithField + { + public string Field; + } + + private class SubclassAHidingField : BaseWithField + { + public new string Field; + } + + private class AnotherBaseWithField + { + public string Field; + } + + private class SubclassBHidingField : AnotherBaseWithField + { + public new string Field; + } + } +} diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs deleted file mode 100644 index c8c23d5f70..0000000000 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs +++ /dev/null @@ -1,2843 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq; -using FluentAssertions.Common; -using Xunit; -using Xunit.Sdk; - -namespace FluentAssertions.Equivalency.Specs; - -public class SelectionRulesSpecs -{ - public class Basic - { - [Fact] - public void Property_names_are_case_sensitive() - { - // Arrange - var subject = new - { - Name = "John" - }; - - var other = new - { - name = "John" - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(other); - - // Assert - act.Should().Throw().WithMessage( - "Expectation*subject.name**other*not have*"); - } - - [Fact] - public void Field_names_are_case_sensitive() - { - // Arrange - var subject = new ClassWithFieldInUpperCase - { - Name = "John" - }; - - var other = new ClassWithFieldInLowerCase - { - name = "John" - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(other); - - // Assert - act.Should().Throw().WithMessage( - "Expectation*subject.name**other*not have*"); - } - - private class ClassWithFieldInLowerCase - { - [JetBrains.Annotations.UsedImplicitly] -#pragma warning disable SA1307 - public string name; -#pragma warning restore SA1307 - } - - private class ClassWithFieldInUpperCase - { - [JetBrains.Annotations.UsedImplicitly] - public string Name; - } - - [Fact] - public void When_a_property_is_an_indexer_it_should_be_ignored() - { - // Arrange - var expected = new ClassWithIndexer - { - Foo = "test" - }; - - var result = new ClassWithIndexer - { - Foo = "test" - }; - - // Act - Action act = () => result.Should().BeEquivalentTo(expected); - - // Assert - act.Should().NotThrow(); - } - - public class ClassWithIndexer - { - public object Foo { get; set; } - - public string this[int n] => - n.ToString( - CultureInfo.InvariantCulture); - } - - [Fact] - public void When_the_expected_object_has_a_property_not_available_on_the_subject_it_should_throw() - { - // Arrange - var subject = new - { - }; - - var other = new - { - // ReSharper disable once StringLiteralTypo - City = "Rijswijk" - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(other); - - // Assert - act.Should().Throw().WithMessage( - "Expectation has property subject.City that the other object does not have*"); - } - - [Fact] - public void When_equally_named_properties_are_type_incompatible_it_should_throw() - { - // Arrange - var subject = new - { - Type = "A" - }; - - var other = new - { - Type = 36 - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(other); - - // Assert - act - .Should().Throw() - .WithMessage("Expected property subject.Type to be 36, but found*\"A\"*"); - } - - [Fact] - public void When_multiple_properties_mismatch_it_should_report_all_of_them() - { - // Arrange - var subject = new - { - Property1 = "A", - Property2 = "B", - SubType1 = new - { - SubProperty1 = "C", - SubProperty2 = "D" - } - }; - - var other = new - { - Property1 = "1", - Property2 = "2", - SubType1 = new - { - SubProperty1 = "3", - SubProperty2 = "D" - } - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(other); - - // Assert - act - .Should().Throw() - .WithMessage("*property subject.Property1*to be \"1\", but \"A\" differs near \"A\"*") - .WithMessage("*property subject.Property2*to be \"2\", but \"B\" differs near \"B\"*") - .WithMessage("*property subject.SubType1.SubProperty1*to be \"3\", but \"C\" differs near \"C\"*"); - } - - [Fact] - [SuppressMessage("ReSharper", "StringLiteralTypo")] - public void Including_all_declared_properties_excludes_all_fields() - { - // Arrange - var class1 = new ClassWithSomeFieldsAndProperties - { - Field1 = "Lorem", - Field2 = "ipsum", - Field3 = "dolor", - Property1 = "sit", - Property2 = "amet", - Property3 = "consectetur" - }; - - var class2 = new ClassWithSomeFieldsAndProperties - { - Property1 = "sit", - Property2 = "amet", - Property3 = "consectetur" - }; - - // Act - Action act = - () => class1.Should().BeEquivalentTo(class2, opts => opts.IncludingAllDeclaredProperties()); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - [SuppressMessage("ReSharper", "StringLiteralTypo")] - public void Including_all_runtime_properties_excludes_all_fields() - { - // Arrange - object class1 = new ClassWithSomeFieldsAndProperties - { - Field1 = "Lorem", - Field2 = "ipsum", - Field3 = "dolor", - Property1 = "sit", - Property2 = "amet", - Property3 = "consectetur" - }; - - object class2 = new ClassWithSomeFieldsAndProperties - { - Property1 = "sit", - Property2 = "amet", - Property3 = "consectetur" - }; - - // Act - Action act = - () => class1.Should().BeEquivalentTo(class2, opts => opts.IncludingAllRuntimeProperties()); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - [SuppressMessage("ReSharper", "StringLiteralTypo")] - public void Respecting_the_runtime_type_includes_both_properties_and_fields_included() - { - // Arrange - object class1 = new ClassWithSomeFieldsAndProperties - { - Field1 = "Lorem", - Property1 = "sit" - }; - - object class2 = new ClassWithSomeFieldsAndProperties(); - - // Act - Action act = - () => class1.Should().BeEquivalentTo(class2, opts => opts.RespectingRuntimeTypes()); - - // Assert - act.Should().Throw().Which.Message.Should().Contain("Field1").And.Contain("Property1"); - } - - [Fact] - public void A_nested_class_without_properties_inside_a_collection_is_fine() - { - // Arrange - var sut = new List - { - new() - { - Name = "theName" - } - }; - - // Act / Assert - sut.Should().BeEquivalentTo(new[] - { - new BaseClassPointingToClassWithoutProperties - { - Name = "theName" - } - }); - } - - internal class BaseClassPointingToClassWithoutProperties - { - public string Name { get; set; } - - public ClassWithoutProperty ClassWithoutProperty { get; } = new(); - } - - internal class ClassWithoutProperty - { - } - } - - public class Including - { - [Fact] - public void When_specific_properties_have_been_specified_it_should_ignore_the_other_properties() - { - // Arrange - var subject = new - { - Age = 36, - Birthdate = new DateTime(1973, 9, 20), - Name = "John" - }; - - var customer = new - { - Age = 36, - Birthdate = new DateTime(1973, 9, 20), - Name = "Dennis" - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(customer, options => options - .Including(d => d.Age) - .Including(d => d.Birthdate)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void A_member_included_by_path_is_described_in_the_failure_message() - { - // Arrange - var subject = new - { - Name = "John" - }; - - var customer = new - { - Name = "Jack" - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(customer, options => options - .Including(d => d.Name)); - - // Assert - act.Should().Throw() - .WithMessage("*Include*Name*"); - } - - [Fact] - public void A_member_included_by_predicate_is_described_in_the_failure_message() - { - // Arrange - var subject = new - { - Name = "John" - }; - - var customer = new - { - Name = "Jack" - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(customer, options => options - .Including(ctx => ctx.Path == "Name")); - - // Assert - act.Should().Throw() - .WithMessage("*Include member when*Name*"); - } - - [Fact] - public void When_a_predicate_for_properties_to_include_has_been_specified_it_should_ignore_the_other_properties() - { - // Arrange - var subject = new - { - Age = 36, - Birthdate = new DateTime(1973, 9, 20), - Name = "John" - }; - - var customer = new - { - Age = 36, - Birthdate = new DateTime(1973, 9, 20), - Name = "Dennis" - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(customer, options => options - .Including(info => info.Path.EndsWith("Age", StringComparison.Ordinal)) - .Including(info => info.Path.EndsWith("Birthdate", StringComparison.Ordinal))); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_non_property_expression_is_provided_it_should_throw() - { - // Arrange - var dto = new CustomerDto(); - - // Act - Action act = () => dto.Should().BeEquivalentTo(dto, options => options.Including(d => d.GetType())); - - // Assert - act.Should().Throw() - .WithMessage("Expression cannot be used to select a member.*") - .WithParameterName("expression"); - } - - [Fact] - public void When_including_a_property_it_should_exactly_match_the_property() - { - // Arrange - var actual = new - { - DeclaredType = LocalOtherType.NonDefault, - Type = LocalType.NonDefault - }; - - var expectation = new - { - DeclaredType = LocalOtherType.NonDefault - }; - - // Act - Action act = () => actual.Should().BeEquivalentTo(expectation, - config => config.Including(o => o.DeclaredType)); - - // Assert - act.Should().NotThrow(); - } - - private enum LocalOtherType : byte - { - Default, - NonDefault - } - - private enum LocalType : byte - { - Default, - NonDefault - } - - public class CustomType - { - public string Name { get; set; } - } - - [Fact] - public void When_including_a_property_using_an_expression_it_should_evaluate_it_from_the_root() - { - // Arrange - var list1 = new List - { - new() - { - Name = "A" - }, - new() - { - Name = "B" - } - }; - - var list2 = new List - { - new() - { - Name = "C" - }, - new() - { - Name = "D" - } - }; - - var objectA = new ClassA - { - ListOfCustomTypes = list1 - }; - - var objectB = new ClassA - { - ListOfCustomTypes = list2 - }; - - // Act - Action act = () => objectA.Should().BeEquivalentTo(objectB, options => options.Including(x => x.ListOfCustomTypes)); - - // Assert - act.Should().Throw().WithMessage("*C*but*A*D*but*B*"); - } - - private class ClassA - { - public List ListOfCustomTypes { get; set; } - } - - [Fact] - public void When_null_is_provided_as_property_expression_it_should_throw() - { - // Arrange - var dto = new CustomerDto(); - - // Act - Action act = - () => dto.Should().BeEquivalentTo(dto, options => options.Including(null)); - - // Assert - act.Should().Throw().WithMessage( - "Expected an expression, but found .*"); - } - - [Fact] - [SuppressMessage("ReSharper", "StringLiteralTypo")] - public void When_including_fields_it_should_succeed_if_just_the_included_field_match() - { - // Arrange - var class1 = new ClassWithSomeFieldsAndProperties - { - Field1 = "Lorem", - Field2 = "ipsum", - Field3 = "dolor", - Property1 = "sit", - Property2 = "amet", - Property3 = "consectetur" - }; - - var class2 = new ClassWithSomeFieldsAndProperties - { - Field1 = "Lorem", - Field2 = "ipsum" - }; - - // Act - Action act = - () => - class1.Should().BeEquivalentTo(class2, opts => opts.Including(o => o.Field1).Including(o => o.Field2)); - - // Assert - act.Should().NotThrow("the only selected fields have the same value"); - } - - [Fact] - [SuppressMessage("ReSharper", "StringLiteralTypo")] - public void When_including_fields_it_should_fail_if_any_included_field_do_not_match() - { - // Arrange - var class1 = new ClassWithSomeFieldsAndProperties - { - Field1 = "Lorem", - Field2 = "ipsum", - Field3 = "dolor", - Property1 = "sit", - Property2 = "amet", - Property3 = "consectetur" - }; - - var class2 = new ClassWithSomeFieldsAndProperties - { - Field1 = "Lorem", - Field2 = "ipsum" - }; - - // Act - Action act = - () => - class1.Should().BeEquivalentTo(class2, - opts => opts.Including(o => o.Field1).Including(o => o.Field2).Including(o => o.Field3)); - - // Assert - act.Should().Throw().WithMessage("Expected field class1.Field3*"); - } - - [Fact] - [SuppressMessage("ReSharper", "StringLiteralTypo")] - public void When_both_field_and_properties_are_configured_for_inclusion_both_should_be_included() - { - // Arrange - var class1 = new ClassWithSomeFieldsAndProperties - { - Field1 = "Lorem", - Property1 = "sit" - }; - - var class2 = new ClassWithSomeFieldsAndProperties(); - - // Act - Action act = - () => class1.Should().BeEquivalentTo(class2, opts => opts.IncludingFields().IncludingProperties()); - - // Assert - act.Should().Throw().Which.Message.Should().Contain("Field1").And.Contain("Property1"); - } - } - - public class Excluding - { - [Fact] - public void A_member_excluded_by_path_is_described_in_the_failure_message() - { - // Arrange - var subject = new - { - Name = "John", - Age = 13 - }; - - var customer = new - { - Name = "Jack", - Age = 37 - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(customer, options => options - .Excluding(d => d.Age)); - - // Assert - act.Should().Throw() - .WithMessage("*Exclude*Age*"); - } - - [Fact] - public void A_member_excluded_by_predicate_is_described_in_the_failure_message() - { - // Arrange - var subject = new - { - Name = "John", - Age = 13 - }; - - var customer = new - { - Name = "Jack", - Age = 37 - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(customer, options => options - .Excluding(ctx => ctx.Path == "Age")); - - // Assert - act.Should().Throw() - .WithMessage("*Exclude member when*Age*"); - } - - [Fact] - public void When_only_the_excluded_property_doesnt_match_it_should_not_throw() - { - // Arrange - var dto = new CustomerDto - { - Age = 36, - Birthdate = new DateTime(1973, 9, 20), - Name = "John" - }; - - var customer = new Customer - { - Age = 36, - Birthdate = new DateTime(1973, 9, 20), - Name = "Dennis" - }; - - // Act / Assert - dto.Should().BeEquivalentTo(customer, options => options - .Excluding(d => d.Name) - .Excluding(d => d.Id)); - } - - [Fact] - public void When_only_the_excluded_property_doesnt_match_it_should_not_throw_if_root_is_a_collection() - { - // Arrange - var dto = new Customer - { - Age = 36, - Birthdate = new DateTime(1973, 9, 20), - Name = "John" - }; - - var customer = new Customer - { - Age = 36, - Birthdate = new DateTime(1973, 9, 20), - Name = "Dennis" - }; - - // Act / Assert - new[] { dto }.Should().BeEquivalentTo(new[] { customer }, options => options - .Excluding(d => d.Name) - .Excluding(d => d.Id)); - } - - [Fact] - [SuppressMessage("ReSharper", "StringLiteralTypo")] - public void When_excluding_members_it_should_pass_if_only_the_excluded_members_are_different() - { - // Arrange - var class1 = new ClassWithSomeFieldsAndProperties - { - Field1 = "Lorem", - Field2 = "ipsum", - Field3 = "dolor", - Property1 = "sit" - }; - - var class2 = new ClassWithSomeFieldsAndProperties - { - Field1 = "Lorem", - Field2 = "ipsum" - }; - - // Act - Action act = - () => - class1.Should().BeEquivalentTo(class2, - opts => opts.Excluding(o => o.Field3).Excluding(o => o.Property1)); - - // Assert - act.Should().NotThrow("the non-excluded fields have the same value"); - } - - [Fact] - [SuppressMessage("ReSharper", "StringLiteralTypo")] - public void When_excluding_members_it_should_fail_if_any_non_excluded_members_are_different() - { - // Arrange - var class1 = new ClassWithSomeFieldsAndProperties - { - Field1 = "Lorem", - Field2 = "ipsum", - Field3 = "dolor", - Property1 = "sit" - }; - - var class2 = new ClassWithSomeFieldsAndProperties - { - Field1 = "Lorem", - Field2 = "ipsum" - }; - - // Act - Action act = - () => class1.Should().BeEquivalentTo(class2, opts => opts.Excluding(o => o.Property1)); - - // Assert - act.Should().Throw().WithMessage("Expected*Field3*"); - } - - [Fact] - public void When_all_shared_properties_match_it_should_not_throw() - { - // Arrange - var dto = new CustomerDto - { - Age = 36, - Birthdate = new DateTime(1973, 9, 20), - Name = "John" - }; - - var customer = new Customer - { - Id = 1, - Age = 36, - Birthdate = new DateTime(1973, 9, 20), - Name = "John" - }; - - // Act - Action act = () => dto.Should().BeEquivalentTo(customer, options => options.ExcludingMissingMembers()); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_deeply_nested_property_with_a_value_mismatch_is_excluded_it_should_not_throw() - { - // Arrange - var subject = new Root - { - Text = "Root", - Level = new Level1 - { - Text = "Level1", - Level = new Level2 - { - Text = "Mismatch" - } - } - }; - - var expected = new RootDto - { - Text = "Root", - Level = new Level1Dto - { - Text = "Level1", - Level = new Level2Dto - { - Text = "Level2" - } - } - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(expected, - options => options.Excluding(r => r.Level.Level.Text)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_deeply_nested_property_with_a_value_mismatch_is_excluded_it_should_not_throw_if_root_is_a_collection() - { - // Arrange - var subject = new Root - { - Text = "Root", - Level = new Level1 - { - Text = "Level1", - Level = new Level2 - { - Text = "Mismatch" - } - } - }; - - var expected = new RootDto - { - Text = "Root", - Level = new Level1Dto - { - Text = "Level1", - Level = new Level2Dto - { - Text = "Level2" - } - } - }; - - // Act / Assert - new[] { subject }.Should().BeEquivalentTo(new[] { expected }, - options => options.Excluding(r => r.Level.Level.Text)); - } - - [Fact] - public void When_a_property_with_a_value_mismatch_is_excluded_using_a_predicate_it_should_not_throw() - { - // Arrange - var subject = new Root - { - Text = "Root", - Level = new Level1 - { - Text = "Level1", - Level = new Level2 - { - Text = "Mismatch" - } - } - }; - - var expected = new RootDto - { - Text = "Root", - Level = new Level1Dto - { - Text = "Level1", - Level = new Level2Dto - { - Text = "Level2" - } - } - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(expected, config => - config.Excluding(ctx => ctx.Path == "Level.Level.Text")); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_members_are_excluded_by_the_access_modifier_of_the_getter_using_a_predicate_they_should_be_ignored() - { - // Arrange - var subject = new ClassWithAllAccessModifiersForMembers("public", "protected", - "internal", "protected-internal", "private", "private-protected"); - - var expected = new ClassWithAllAccessModifiersForMembers("public", "protected", - "ignored-internal", "ignored-protected-internal", "private", "private-protected"); - - // Act - Action act = () => subject.Should().BeEquivalentTo(expected, config => config - .IncludingInternalFields() - .Excluding(ctx => - ctx.WhichGetterHas(CSharpAccessModifier.Internal) || - ctx.WhichGetterHas(CSharpAccessModifier.ProtectedInternal))); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_members_are_excluded_by_the_access_modifier_of_the_setter_using_a_predicate_they_should_be_ignored() - { - // Arrange - var subject = new ClassWithAllAccessModifiersForMembers("public", "protected", - "internal", "protected-internal", "private", "private-protected"); - - var expected = new ClassWithAllAccessModifiersForMembers("public", "protected", - "ignored-internal", "ignored-protected-internal", "ignored-private", "private-protected"); - - // Act - Action act = () => subject.Should().BeEquivalentTo(expected, config => config - .IncludingInternalFields() - .Excluding(ctx => - ctx.WhichSetterHas(CSharpAccessModifier.Internal) || - ctx.WhichSetterHas(CSharpAccessModifier.ProtectedInternal) || - ctx.WhichSetterHas(CSharpAccessModifier.Private))); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - [SuppressMessage("ReSharper", "StringLiteralTypo")] - public void When_excluding_properties_it_should_still_compare_fields() - { - // Arrange - var class1 = new ClassWithSomeFieldsAndProperties - { - Field1 = "Lorem", - Field2 = "ipsum", - Field3 = "dolor", - Property1 = "sit", - Property2 = "amet", - Property3 = "consectetur" - }; - - var class2 = new ClassWithSomeFieldsAndProperties - { - Field1 = "Lorem", - Field2 = "ipsum", - Field3 = "color" - }; - - // Act - Action act = - () => class1.Should().BeEquivalentTo(class2, opts => opts.ExcludingProperties()); - - // Assert - act.Should().Throw().WithMessage("*color*dolor*"); - } - - [Fact] - public void When_excluding_properties_via_non_array_indexers_it_should_exclude_the_specified_paths() - { - // Arrange - var subject = new - { - List = new[] - { - new - { - Foo = 1, - Bar = 2 - }, - new - { - Foo = 3, - Bar = 4 - } - }.ToList(), - Dictionary = new Dictionary - { - ["Foo"] = new() - { - Value = 1 - }, - ["Bar"] = new() - { - Value = 2 - } - } - }; - - var expected = new - { - List = new[] - { - new - { - Foo = 1, - Bar = 2 - }, - new - { - Foo = 2, - Bar = 4 - } - }.ToList(), - Dictionary = new Dictionary - { - ["Foo"] = new() - { - Value = 1 - }, - ["Bar"] = new() - { - Value = 3 - } - } - }; - - // Act - Action act = () => - subject.Should().BeEquivalentTo(expected, - options => options - .Excluding(x => x.List[1].Foo) - .Excluding(x => x.Dictionary["Bar"].Value)); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void - When_excluding_properties_via_non_array_indexers_it_should_exclude_the_specified_paths_if_root_is_a_collection() - { - // Arrange - var subject = new - { - List = new[] - { - new - { - Foo = 1, - Bar = 2 - }, - new - { - Foo = 3, - Bar = 4 - } - }.ToList(), - Dictionary = new Dictionary - { - ["Foo"] = new() - { - Value = 1 - }, - ["Bar"] = new() - { - Value = 2 - } - } - }; - - var expected = new - { - List = new[] - { - new - { - Foo = 1, - Bar = 2 - }, - new - { - Foo = 2, - Bar = 4 - } - }.ToList(), - Dictionary = new Dictionary - { - ["Foo"] = new() - { - Value = 1 - }, - ["Bar"] = new() - { - Value = 3 - } - } - }; - - // Act / Assert - new[] { subject }.Should().BeEquivalentTo(new[] { expected }, - options => options - .Excluding(x => x.List[1].Foo) - .Excluding(x => x.Dictionary["Bar"].Value)); - } - - [Fact] - public void When_excluding_properties_via_non_array_indexers_it_should_not_exclude_paths_with_different_indexes() - { - // Arrange - var subject = new - { - List = new[] - { - new - { - Foo = 1, - Bar = 2 - }, - new - { - Foo = 3, - Bar = 4 - } - }.ToList(), - Dictionary = new Dictionary - { - ["Foo"] = new() - { - Value = 1 - }, - ["Bar"] = new() - { - Value = 2 - } - } - }; - - var expected = new - { - List = new[] - { - new - { - Foo = 5, - Bar = 2 - }, - new - { - Foo = 2, - Bar = 4 - } - }.ToList(), - Dictionary = new Dictionary - { - ["Foo"] = new() - { - Value = 6 - }, - ["Bar"] = new() - { - Value = 3 - } - } - }; - - // Act - Action act = () => - subject.Should().BeEquivalentTo(expected, - options => options - .Excluding(x => x.List[1].Foo) - .Excluding(x => x.Dictionary["Bar"].Value)); - - // Assert - act.Should().Throw(); - } - - [Fact] - [SuppressMessage("ReSharper", "StringLiteralTypo")] - public void - When_configured_for_runtime_typing_and_properties_are_excluded_the_runtime_type_should_be_used_and_properties_should_be_ignored() - { - // Arrange - object class1 = new ClassWithSomeFieldsAndProperties - { - Field1 = "Lorem", - Field2 = "ipsum", - Field3 = "dolor", - Property1 = "sit", - Property2 = "amet", - Property3 = "consectetur" - }; - - object class2 = new ClassWithSomeFieldsAndProperties - { - Field1 = "Lorem", - Field2 = "ipsum", - Field3 = "dolor" - }; - - // Act - Action act = - () => class1.Should().BeEquivalentTo(class2, opts => opts.ExcludingProperties().RespectingRuntimeTypes()); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_excluding_virtual_or_abstract_property_exclusion_works_properly() - { - var obj1 = new Derived - { - DerivedProperty1 = "Something", - DerivedProperty2 = "A" - }; - - var obj2 = new Derived - { - DerivedProperty1 = "Something", - DerivedProperty2 = "B" - }; - - obj1.Should().BeEquivalentTo(obj2, opt => opt - .Excluding(o => o.AbstractProperty) - .Excluding(o => o.VirtualProperty) - .Excluding(o => o.DerivedProperty2)); - } - } - - public class Accessibility - { - [Fact] - public void When_a_property_is_write_only_it_should_be_ignored() - { - // Arrange - var subject = new ClassWithWriteOnlyProperty - { - WriteOnlyProperty = 123, - SomeOtherProperty = "whatever" - }; - - var expected = new - { - SomeOtherProperty = "whatever" - }; - - // Act - Action action = () => subject.Should().BeEquivalentTo(expected); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void When_a_property_is_private_it_should_be_ignored() - { - // Arrange - var subject = new Customer("MyPassword") - { - Age = 36, - Birthdate = new DateTime(1973, 9, 20), - Name = "John" - }; - - var other = new Customer("SomeOtherPassword") - { - Age = 36, - Birthdate = new DateTime(1973, 9, 20), - Name = "John" - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(other); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_field_is_private_it_should_be_ignored() - { - // Arrange - var subject = new ClassWithAPrivateField(1234) - { - Value = 1 - }; - - var other = new ClassWithAPrivateField(54321) - { - Value = 1 - }; - - // Act - Action act = () => subject.Should().BeEquivalentTo(other); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_property_is_protected_it_should_be_ignored() - { - // Arrange - var subject = new Customer - { - Age = 36, - Birthdate = new DateTime(1973, 9, 20), - Name = "John" - }; - - subject.SetProtected("ActualValue"); - - var expected = new Customer - { - Age = 36, - Birthdate = new DateTime(1973, 9, 20), - Name = "John" - }; - - expected.SetProtected("ExpectedValue"); - - // Act - Action act = () => subject.Should().BeEquivalentTo(expected); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_a_property_is_internal_and_it_should_be_included_it_should_fail_the_assertion() - { - // Arrange - var actual = new ClassWithInternalProperty - { - PublicProperty = "public", - InternalProperty = "internal", - ProtectedInternalProperty = "internal" - }; - - var expected = new ClassWithInternalProperty - { - PublicProperty = "public", - InternalProperty = "also internal", - ProtectedInternalProperty = "also internal" - }; - - // Act - Action act = () => actual.Should().BeEquivalentTo(expected, options => options.IncludingInternalProperties()); - - // Assert - act.Should().Throw() - .WithMessage("*InternalProperty*internal*also internal*ProtectedInternalProperty*"); - } - - private class ClassWithInternalProperty - { - public string PublicProperty { get; set; } - - internal string InternalProperty { get; set; } - - protected internal string ProtectedInternalProperty { get; set; } - } - - [Fact] - public void When_a_field_is_internal_it_should_be_excluded_from_the_comparison() - { - // Arrange - var actual = new ClassWithInternalField - { - PublicField = "public", - InternalField = "internal", - ProtectedInternalField = "internal" - }; - - var expected = new ClassWithInternalField - { - PublicField = "public", - InternalField = "also internal", - ProtectedInternalField = "also internal" - }; - - // Act / Assert - actual.Should().BeEquivalentTo(expected); - } - - [Fact] - public void When_a_field_is_internal_and_it_should_be_included_it_should_fail_the_assertion() - { - // Arrange - var actual = new ClassWithInternalField - { - PublicField = "public", - InternalField = "internal", - ProtectedInternalField = "internal" - }; - - var expected = new ClassWithInternalField - { - PublicField = "public", - InternalField = "also internal", - ProtectedInternalField = "also internal" - }; - - // Act - Action act = () => actual.Should().BeEquivalentTo(expected, options => options.IncludingInternalFields()); - - // Assert - act.Should().Throw().WithMessage("*InternalField*internal*also internal*ProtectedInternalField*"); - } - - private class ClassWithInternalField - { - public string PublicField; - - internal string InternalField; - - protected internal string ProtectedInternalField; - } - - [Fact] - public void When_a_property_is_internal_it_should_be_excluded_from_the_comparison() - { - // Arrange - var actual = new ClassWithInternalProperty - { - PublicProperty = "public", - InternalProperty = "internal", - ProtectedInternalProperty = "internal" - }; - - var expected = new ClassWithInternalProperty - { - PublicProperty = "public", - InternalProperty = "also internal", - ProtectedInternalProperty = "also internal" - }; - - // Act / Assert - actual.Should().BeEquivalentTo(expected); - } - - [Fact] - public void Private_protected_properties_are_ignored() - { - // Arrange - var subject = new ClassWithPrivateProtectedProperty("Name", 13); - var other = new ClassWithPrivateProtectedProperty("Name", 37); - - // Act/Assert - subject.Should().BeEquivalentTo(other); - } - - private class ClassWithPrivateProtectedProperty - { - public ClassWithPrivateProtectedProperty(string name, int value) - { - Name = name; - Value = value; - } - - public string Name { get; } - - private protected int Value { get; } - } - - [Fact] - public void Private_protected_fields_are_ignored() - { - // Arrange - var subject = new ClassWithPrivateProtectedField("Name", 13); - var other = new ClassWithPrivateProtectedField("Name", 37); - - // Act/Assert - subject.Should().BeEquivalentTo(other); - } - - private class ClassWithPrivateProtectedField - { - public ClassWithPrivateProtectedField(string name, int value) - { - Name = name; - this.value = value; - } - - public string Name; - - private protected int value; - } - } - - public class MemberHiding - { - [Fact] - public void Ignores_properties_hidden_by_the_derived_class() - { - // Arrange - var subject = new SubclassAHidingProperty - { - Property = "DerivedValue" - }; - - ((BaseWithProperty)subject).Property = "ActualBaseValue"; - - var expectation = new SubclassBHidingProperty - { - Property = "DerivedValue" - }; - - ((AnotherBaseWithProperty)expectation).Property = "ExpectedBaseValue"; - - // Act / Assert - subject.Should().BeEquivalentTo(expectation); - } - - [Fact] - public void Ignores_properties_of_the_same_runtime_types_hidden_by_the_derived_class() - { - // Arrange - var subject = new SubclassHidingStringProperty - { - Property = "DerivedValue" - }; - - ((BaseWithStringProperty)subject).Property = "ActualBaseValue"; - - var expectation = new SubclassHidingStringProperty - { - Property = "DerivedValue" - }; - - ((BaseWithStringProperty)expectation).Property = "ExpectedBaseValue"; - - // Act / Assert - subject.Should().BeEquivalentTo(expectation); - } - - [Fact] - public void Includes_hidden_property_of_the_base_when_using_a_reference_to_the_base() - { - // Arrange - BaseWithProperty subject = new SubclassAHidingProperty - { - Property = "ActualDerivedValue" - }; - - // FA doesn't know the compile-time type of the subject, so even though we pass a reference to the base-class, - // at run-time, it'll start finding the property on the subject starting from the run-time type, and thus ignore the - // hidden base-class field - ((SubclassAHidingProperty)subject).Property = "BaseValue"; - - AnotherBaseWithProperty expectation = new SubclassBHidingProperty - { - Property = "ExpectedDerivedValue" - }; - - expectation.Property = "BaseValue"; - - // Act / Assert - subject.Should().BeEquivalentTo(expectation); - } - - [Fact] - public void Run_type_typing_ignores_hidden_properties_even_when_using_a_reference_to_the_base_class() - { - // Arrange - var subject = new SubclassAHidingProperty - { - Property = "DerivedValue" - }; - - ((BaseWithProperty)subject).Property = "ActualBaseValue"; - - AnotherBaseWithProperty expectation = new SubclassBHidingProperty - { - Property = "DerivedValue" - }; - - expectation.Property = "ExpectedBaseValue"; - - // Act / Assert - subject.Should().BeEquivalentTo(expectation, o => o.RespectingRuntimeTypes()); - } - - [Fact] - public void Including_the_derived_property_excludes_the_hidden_property() - { - // Arrange - var subject = new SubclassAHidingProperty - { - Property = "DerivedValue" - }; - - ((BaseWithProperty)subject).Property = "ActualBaseValue"; - - var expectation = new SubclassBHidingProperty - { - Property = "DerivedValue" - }; - - ((AnotherBaseWithProperty)expectation).Property = "ExpectedBaseValue"; - - // Act / Assert - subject.Should().BeEquivalentTo(expectation, opt => opt - .Including(o => o.Property)); - } - - [Fact] - public void Excluding_the_property_hiding_the_base_class_one_does_not_reveal_the_latter() - { - // Arrange - var subject = new SubclassAHidingProperty(); - - ((BaseWithProperty)subject).Property = "ActualBaseValue"; - - var expectation = new SubclassBHidingProperty(); - - ((AnotherBaseWithProperty)expectation).Property = "ExpectedBaseValue"; - - // Act - Action act = () => subject.Should().BeEquivalentTo(expectation, o => o - .Excluding(b => b.Property)); - - // Assert - act.Should().Throw().WithMessage("*No members were found *"); - } - - private class BaseWithProperty - { - public object Property { get; set; } - } - - private class SubclassAHidingProperty : BaseWithProperty - { - public new T Property { get; set; } - } - - private class BaseWithStringProperty - { - public string Property { get; set; } - } - - private class SubclassHidingStringProperty : BaseWithStringProperty - { - public new string Property { get; set; } - } - - private class AnotherBaseWithProperty - { - public object Property { get; set; } - } - - private class SubclassBHidingProperty : AnotherBaseWithProperty - { - public new T Property - { - get; - set; - } - } - - [Fact] - public void Ignores_fields_hidden_by_the_derived_class() - { - // Arrange - var subject = new SubclassAHidingField - { - Field = "DerivedValue" - }; - - ((BaseWithField)subject).Field = "ActualBaseValue"; - - var expectation = new SubclassBHidingField - { - Field = "DerivedValue" - }; - - ((AnotherBaseWithField)expectation).Field = "ExpectedBaseValue"; - - // Act / Assert - subject.Should().BeEquivalentTo(expectation, options => options.IncludingFields()); - } - - [Fact] - public void Includes_hidden_field_of_the_base_when_using_a_reference_to_the_base() - { - // Arrange - BaseWithField subject = new SubclassAHidingField - { - Field = "BaseValueFromSubject" - }; - - // FA doesn't know the compile-time type of the subject, so even though we pass a reference to the base-class, - // at run-time, it'll start finding the field on the subject starting from the run-time type, and thus ignore the - // hidden base-class field - ((SubclassAHidingField)subject).Field = "BaseValueFromExpectation"; - - AnotherBaseWithField expectation = new SubclassBHidingField - { - Field = "ExpectedDerivedValue" - }; - - expectation.Field = "BaseValueFromExpectation"; - - // Act / Assert - subject.Should().BeEquivalentTo(expectation, options => options.IncludingFields()); - } - - [Fact] - public void Run_type_typing_ignores_hidden_fields_even_when_using_a_reference_to_the_base_class() - { - // Arrange - var subject = new SubclassAHidingField - { - Field = "DerivedValue" - }; - - ((BaseWithField)subject).Field = "ActualBaseValue"; - - AnotherBaseWithField expectation = new SubclassBHidingField - { - Field = "DerivedValue" - }; - - expectation.Field = "ExpectedBaseValue"; - - // Act / Assert - subject.Should().BeEquivalentTo(expectation, options => options.IncludingFields().RespectingRuntimeTypes()); - } - - [Fact] - public void Including_the_derived_field_excludes_the_hidden_field() - { - // Arrange - var subject = new SubclassAHidingField - { - Field = "DerivedValue" - }; - - ((BaseWithField)subject).Field = "ActualBaseValue"; - - var expectation = new SubclassBHidingField - { - Field = "DerivedValue" - }; - - ((AnotherBaseWithField)expectation).Field = "ExpectedBaseValue"; - - // Act / Assert - subject.Should().BeEquivalentTo(expectation, options => options - .IncludingFields() - .Including(o => o.Field)); - } - - [Fact] - public void Excluding_the_field_hiding_the_base_class_one_does_not_reveal_the_latter() - { - // Arrange - var subject = new SubclassAHidingField(); - - ((BaseWithField)subject).Field = "ActualBaseValue"; - - var expectation = new SubclassBHidingField(); - - ((AnotherBaseWithField)expectation).Field = "ExpectedBaseValue"; - - // Act - Action act = () => subject.Should().BeEquivalentTo(expectation, options => options - .IncludingFields() - .Excluding(b => b.Field)); - - // Assert - act.Should().Throw().WithMessage("*No members were found *"); - } - - private class BaseWithField - { - public string Field; - } - - private class SubclassAHidingField : BaseWithField - { - public new string Field; - } - - private class AnotherBaseWithField - { - public string Field; - } - - private class SubclassBHidingField : AnotherBaseWithField - { - public new string Field; - } - } - - public class Interfaces - { - [Fact] - public void When_an_interface_hierarchy_is_used_it_should_include_all_inherited_properties() - { - // Arrange - ICar subject = new Car - { - VehicleId = 1, - Wheels = 4 - }; - - ICar expected = new Car - { - VehicleId = 99999, - Wheels = 4 - }; - - // Act - Action action = () => subject.Should().BeEquivalentTo(expected); - - // Assert - action - .Should().Throw() - .WithMessage("Expected*VehicleId*99999*but*1*"); - } - - [Fact] - public void When_a_reference_to_an_interface_is_provided_it_should_only_include_those_properties() - { - // Arrange - IVehicle expected = new Car - { - VehicleId = 1, - Wheels = 4 - }; - - IVehicle subject = new Car - { - VehicleId = 1, - Wheels = 99999 - }; - - // Act - Action action = () => subject.Should().BeEquivalentTo(expected); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void When_a_reference_to_an_explicit_interface_impl_is_provided_it_should_only_include_those_properties() - { - // Arrange - IVehicle expected = new ExplicitCar - { - Wheels = 4 - }; - - IVehicle subject = new ExplicitCar - { - Wheels = 99999 - }; - - // Act - Action action = () => subject.Should().BeEquivalentTo(expected); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void Explicitly_implemented_subject_properties_are_ignored_if_a_normal_property_exists_with_the_same_name() - { - // Arrange - IVehicle expected = new Vehicle - { - VehicleId = 1 - }; - - IVehicle subject = new ExplicitVehicle - { - VehicleId = 2 // normal property - }; - - subject.VehicleId = 1; // explicitly implemented property - - // Act - Action action = () => subject.Should().BeEquivalentTo(expected); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void Explicitly_implemented_read_only_subject_properties_are_ignored_if_a_normal_property_exists_with_the_same_name() - { - // Arrange - IReadOnlyVehicle subject = new ExplicitReadOnlyVehicle(explicitValue: 1) - { - VehicleId = 2 // normal property - }; - - var expected = new Vehicle - { - VehicleId = 1 - }; - - // Act - Action action = () => subject.Should().BeEquivalentTo(expected); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void Explicitly_implemented_subject_properties_are_ignored_if_only_fields_are_included() - { - // Arrange - var expected = new VehicleWithField - { - VehicleId = 1 // A field named like a property - }; - - var subject = new ExplicitVehicle - { - VehicleId = 2 // A real property - }; - - // Act - Action action = () => subject.Should().BeEquivalentTo(expected, opt => opt - .IncludingFields() - .ExcludingProperties()); - - // Assert - action.Should().Throw().WithMessage("*field*VehicleId*other*"); - } - - [Fact] - public void Explicitly_implemented_subject_properties_are_ignored_if_only_fields_are_included_and_they_may_be_missing() - { - // Arrange - var expected = new VehicleWithField - { - VehicleId = 1 // A field named like a property - }; - - var subject = new ExplicitVehicle - { - VehicleId = 2 // A real property - }; - - // Act / Assert - subject.Should().BeEquivalentTo(expected, opt => opt - .IncludingFields() - .ExcludingProperties() - .ExcludingMissingMembers()); - } - - [Fact] - public void Excluding_missing_members_does_not_affect_how_explicitly_implemented_subject_properties_are_dealt_with() - { - // Arrange - IVehicle expected = new Vehicle - { - VehicleId = 1 - }; - - IVehicle subject = new ExplicitVehicle - { - VehicleId = 2 // instance member - }; - - subject.VehicleId = 1; // interface member - - // Act - Action action = () => subject.Should().BeEquivalentTo(expected, opt => opt.ExcludingMissingMembers()); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_respecting_declared_types_explicit_interface_member_on_interfaced_expectation_should_be_used() - { - // Arrange - IVehicle expected = new ExplicitVehicle - { - VehicleId = 2 // instance member - }; - - expected.VehicleId = 1; // interface member - - IVehicle subject = new Vehicle - { - VehicleId = 1 - }; - - // Act - Action action = () => subject.Should().BeEquivalentTo(expected, opt => opt.RespectingDeclaredTypes()); - - // Assert - action.Should().NotThrow(); - } - - [Fact] - public void When_respecting_runtime_types_explicit_interface_member_on_interfaced_subject_should_not_be_used() - { - // Arrange - IVehicle expected = new Vehicle - { - VehicleId = 1 - }; - - IVehicle subject = new ExplicitVehicle - { - VehicleId = 2 // instance member - }; - - subject.VehicleId = 1; // interface member - - // Act - Action action = () => subject.Should().BeEquivalentTo(expected, opt => opt.RespectingRuntimeTypes()); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_respecting_runtime_types_explicit_interface_member_on_interfaced_expectation_should_not_be_used() - { - // Arrange - IVehicle expected = new ExplicitVehicle - { - VehicleId = 2 // instance member - }; - - expected.VehicleId = 1; // interface member - - IVehicle subject = new Vehicle - { - VehicleId = 1 - }; - - // Act - Action action = () => subject.Should().BeEquivalentTo(expected, opt => opt.RespectingRuntimeTypes()); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_respecting_declared_types_explicit_interface_member_on_expectation_should_not_be_used() - { - // Arrange - var expected = new ExplicitVehicle - { - VehicleId = 2 - }; - - ((IVehicle)expected).VehicleId = 1; - - var subject = new Vehicle - { - VehicleId = 1 - }; - - // Act - Action action = () => subject.Should().BeEquivalentTo(expected); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void Can_find_explicitly_implemented_property_on_the_subject() - { - // Arrange - IPerson person = new Person(); - person.Name = "Bob"; - - // Act / Assert - person.Should().BeEquivalentTo(new { Name = "Bob" }); - } - - private interface IPerson - { - string Name { get; set; } - } - - private class Person : IPerson - { - string IPerson.Name { get; set; } - } - - [Fact] - public void Excluding_an_interface_property_through_inheritance_should_work() - { - // Arrange - IInterfaceWithTwoProperties[] actual = - { - new DerivedClassImplementingInterface - { - Value1 = 1, - Value2 = 2 - } - }; - - IInterfaceWithTwoProperties[] expected = - { - new DerivedClassImplementingInterface - { - Value1 = 999, - Value2 = 2 - } - }; - - // Act / Assert - actual.Should().BeEquivalentTo(expected, options => options - .Excluding(a => a.Value1) - .RespectingRuntimeTypes()); - } - - [Fact] - public void Including_an_interface_property_through_inheritance_should_work() - { - // Arrange - IInterfaceWithTwoProperties[] actual = - { - new DerivedClassImplementingInterface - { - Value1 = 1, - Value2 = 2 - } - }; - - IInterfaceWithTwoProperties[] expected = - { - new DerivedClassImplementingInterface - { - Value1 = 999, - Value2 = 2 - } - }; - - // Act / Assert - actual.Should().BeEquivalentTo(expected, options => options - .Including(a => a.Value2) - .RespectingRuntimeTypes()); - } - - public interface IInterfaceWithTwoProperties - { - int Value1 { get; set; } - - int Value2 { get; set; } - } - - public class BaseProvidingSamePropertiesAsInterface - { - public int Value1 { get; set; } - - public int Value2 { get; set; } - } - - public class DerivedClassImplementingInterface : BaseProvidingSamePropertiesAsInterface, IInterfaceWithTwoProperties - { - } - } - -#if NET5_0_OR_GREATER - public class Covariance - { - [Fact] - public void Excluding_a_covariant_property_should_work() - { - // Arrange - var actual = new DerivedWithCovariantOverride(new DerivedWithProperty - { - DerivedProperty = "a", - BaseProperty = "a_base" - }) - { - OtherProp = "other" - }; - - var expectation = new DerivedWithCovariantOverride(new DerivedWithProperty - { - DerivedProperty = "b", - BaseProperty = - "b_base" - }) - { - OtherProp = "other" - }; - - // Act / Assert - actual.Should().BeEquivalentTo(expectation, opts => opts - .Excluding(d => d.Property)); - } - - [Fact] - public void Excluding_a_covariant_property_through_the_base_class_excludes_the_base_class_property() - { - // Arrange - var actual = new DerivedWithCovariantOverride(new DerivedWithProperty - { - DerivedProperty = "a", - BaseProperty = "a_base" - }) - { - OtherProp = "other" - }; - - BaseWithAbstractProperty expectation = new DerivedWithCovariantOverride(new DerivedWithProperty - { - DerivedProperty = - "b", - BaseProperty = "b_base" - }) - { - OtherProp = "other" - }; - - // Act - Action act = () => actual.Should().BeEquivalentTo(expectation, opts => opts - .Excluding(d => d.Property)); - - // Assert - act.Should().Throw().WithMessage("No members*"); - } - - private class BaseWithProperty - { - public string BaseProperty { get; set; } - } - - private class DerivedWithProperty : BaseWithProperty - { - public string DerivedProperty { get; set; } - } - - private abstract class BaseWithAbstractProperty - { - public abstract BaseWithProperty Property { get; } - } - - private sealed class DerivedWithCovariantOverride : BaseWithAbstractProperty - { - public override DerivedWithProperty Property { get; } - - public string OtherProp { get; set; } - - public DerivedWithCovariantOverride(DerivedWithProperty prop) - { - Property = prop; - } - } - } - -#endif - - public class Browsability - { - [Fact] - public void When_browsable_field_differs_excluding_non_browsable_members_should_not_affect_result() - { - // Arrange - var subject = new ClassWithNonBrowsableMembers - { - BrowsableField = 0 - }; - - var expectation = new ClassWithNonBrowsableMembers - { - BrowsableField = 1 - }; - - // Act - Action action = - () => subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_browsable_property_differs_excluding_non_browsable_members_should_not_affect_result() - { - // Arrange - var subject = new ClassWithNonBrowsableMembers - { - BrowsableProperty = 0 - }; - - var expectation = new ClassWithNonBrowsableMembers - { - BrowsableProperty = 1 - }; - - // Act - Action action = - () => subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_advanced_browsable_field_differs_excluding_non_browsable_members_should_not_affect_result() - { - // Arrange - var subject = new ClassWithNonBrowsableMembers - { - AdvancedBrowsableField = 0 - }; - - var expectation = new ClassWithNonBrowsableMembers - { - AdvancedBrowsableField = 1 - }; - - // Act - Action action = - () => subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_advanced_browsable_property_differs_excluding_non_browsable_members_should_not_affect_result() - { - // Arrange - var subject = new ClassWithNonBrowsableMembers - { - AdvancedBrowsableProperty = 0 - }; - - var expectation = new ClassWithNonBrowsableMembers - { - AdvancedBrowsableProperty = 1 - }; - - // Act - Action action = - () => subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_explicitly_browsable_field_differs_excluding_non_browsable_members_should_not_affect_result() - { - // Arrange - var subject = new ClassWithNonBrowsableMembers - { - ExplicitlyBrowsableField = 0 - }; - - var expectation = new ClassWithNonBrowsableMembers - { - ExplicitlyBrowsableField = 1 - }; - - // Act - Action action = - () => subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_explicitly_browsable_property_differs_excluding_non_browsable_members_should_not_affect_result() - { - // Arrange - var subject = new ClassWithNonBrowsableMembers - { - ExplicitlyBrowsableProperty = 0 - }; - - var expectation = new ClassWithNonBrowsableMembers - { - ExplicitlyBrowsableProperty = 1 - }; - - // Act - Action action = - () => subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_non_browsable_field_differs_excluding_non_browsable_members_should_make_it_succeed() - { - // Arrange - var subject = new ClassWithNonBrowsableMembers - { - NonBrowsableField = 0 - }; - - var expectation = new ClassWithNonBrowsableMembers - { - NonBrowsableField = 1 - }; - - // Act & Assert - subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); - } - - [Fact] - public void When_non_browsable_property_differs_excluding_non_browsable_members_should_make_it_succeed() - { - // Arrange - var subject = new ClassWithNonBrowsableMembers - { - NonBrowsableProperty = 0 - }; - - var expectation = new ClassWithNonBrowsableMembers - { - NonBrowsableProperty = 1 - }; - - // Act & Assert - subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); - } - - [Fact] - public void When_property_is_non_browsable_only_in_subject_excluding_non_browsable_members_should_not_make_it_succeed() - { - // Arrange - var subject = - new ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable - { - PropertyThatMightBeNonBrowsable = 0 - }; - - var expectation = - new ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable - { - PropertyThatMightBeNonBrowsable = 1 - }; - - // Act - Action action = - () => subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); - - // Assert - action.Should().Throw() - .WithMessage("Expected property subject.PropertyThatMightBeNonBrowsable to be 1, but found 0.*"); - } - - [Fact] - public void - When_property_is_non_browsable_only_in_subject_ignoring_non_browsable_members_on_subject_should_make_it_succeed() - { - // Arrange - var subject = - new ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable - { - PropertyThatMightBeNonBrowsable = 0 - }; - - var expectation = - new ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable - { - PropertyThatMightBeNonBrowsable = 1 - }; - - // Act & Assert - subject.Should().BeEquivalentTo( - expectation, - config => config.IgnoringNonBrowsableMembersOnSubject().ExcludingMissingMembers()); - } - - [Fact] - public void When_non_browsable_property_on_subject_is_ignored_but_is_present_on_expectation_it_should_fail() - { - // Arrange - var subject = - new ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable - { - PropertyThatMightBeNonBrowsable = 0 - }; - - var expectation = - new ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable - { - PropertyThatMightBeNonBrowsable = 1 - }; - - // Act - Action action = - () => subject.Should().BeEquivalentTo(expectation, config => config.IgnoringNonBrowsableMembersOnSubject()); - - // Assert - action.Should().Throw().WithMessage( - "Expectation has * subject.*ThatMightBeNonBrowsable that is non-browsable in the other object, and non-browsable " + - "members on the subject are ignored with the current configuration*"); - } - - [Fact] - public void Only_ignore_non_browsable_matching_members() - { - // Arrange - var subject = new - { - NonExisting = 0 - }; - - var expectation = new - { - Existing = 1 - }; - - // Act - Action action = () => subject.Should().BeEquivalentTo(expectation, config => config.IgnoringNonBrowsableMembersOnSubject()); - - // Assert - action.Should().Throw(); - } - - [Fact] - public void When_property_is_non_browsable_only_in_expectation_excluding_non_browsable_members_should_make_it_succeed() - { - // Arrange - var subject = new ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable - { - PropertyThatMightBeNonBrowsable = 0 - }; - - var expectation = - new ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable - { - PropertyThatMightBeNonBrowsable = 1 - }; - - // Act & Assert - subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); - } - - [Fact] - public void When_field_is_non_browsable_only_in_subject_excluding_non_browsable_members_should_not_make_it_succeed() - { - // Arrange - var subject = - new ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable - { - FieldThatMightBeNonBrowsable = 0 - }; - - var expectation = - new ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable - { - FieldThatMightBeNonBrowsable = 1 - }; - - // Act - Action action = - () => subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); - - // Assert - action.Should().Throw() - .WithMessage("Expected field subject.FieldThatMightBeNonBrowsable to be 1, but found 0.*"); - } - - [Fact] - public void When_field_is_non_browsable_only_in_subject_ignoring_non_browsable_members_on_subject_should_make_it_succeed() - { - // Arrange - var subject = - new ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable - { - FieldThatMightBeNonBrowsable = 0 - }; - - var expectation = - new ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable - { - FieldThatMightBeNonBrowsable = 1 - }; - - // Act & Assert - subject.Should().BeEquivalentTo( - expectation, - config => config.IgnoringNonBrowsableMembersOnSubject().ExcludingMissingMembers()); - } - - [Fact] - public void When_field_is_non_browsable_only_in_expectation_excluding_non_browsable_members_should_make_it_succeed() - { - // Arrange - var subject = new ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable - { - FieldThatMightBeNonBrowsable = 0 - }; - - var expectation = - new ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable - { - FieldThatMightBeNonBrowsable = 1 - }; - - // Act & Assert - subject.Should().BeEquivalentTo(expectation, config => config.ExcludingNonBrowsableMembers()); - } - - [Fact] - public void When_property_is_missing_from_subject_excluding_non_browsable_members_should_make_it_succeed() - { - // Arrange - var subject = - new - { - BrowsableField = 1, - BrowsableProperty = 1, - ExplicitlyBrowsableField = 1, - ExplicitlyBrowsableProperty = 1, - AdvancedBrowsableField = 1, - AdvancedBrowsableProperty = 1, - NonBrowsableField = 2 - /* NonBrowsableProperty missing */ - }; - - var expected = new ClassWithNonBrowsableMembers - { - BrowsableField = 1, - BrowsableProperty = 1, - ExplicitlyBrowsableField = 1, - ExplicitlyBrowsableProperty = 1, - AdvancedBrowsableField = 1, - AdvancedBrowsableProperty = 1, - NonBrowsableField = 2, - NonBrowsableProperty = 2 - }; - - // Act & Assert - subject.Should().BeEquivalentTo(expected, opt => opt.ExcludingNonBrowsableMembers()); - } - - [Fact] - public void When_field_is_missing_from_subject_excluding_non_browsable_members_should_make_it_succeed() - { - // Arrange - var subject = - new - { - BrowsableField = 1, - BrowsableProperty = 1, - ExplicitlyBrowsableField = 1, - ExplicitlyBrowsableProperty = 1, - AdvancedBrowsableField = 1, - AdvancedBrowsableProperty = 1, - /* NonBrowsableField missing */ - NonBrowsableProperty = 2 - }; - - var expected = new ClassWithNonBrowsableMembers - { - BrowsableField = 1, - BrowsableProperty = 1, - ExplicitlyBrowsableField = 1, - ExplicitlyBrowsableProperty = 1, - AdvancedBrowsableField = 1, - AdvancedBrowsableProperty = 1, - NonBrowsableField = 2, - NonBrowsableProperty = 2 - }; - - // Act & Assert - subject.Should().BeEquivalentTo(expected, opt => opt.ExcludingNonBrowsableMembers()); - } - - [Fact] - public void When_property_is_missing_from_expectation_excluding_non_browsable_members_should_make_it_succeed() - { - // Arrange - var subject = new ClassWithNonBrowsableMembers - { - BrowsableField = 1, - BrowsableProperty = 1, - ExplicitlyBrowsableField = 1, - ExplicitlyBrowsableProperty = 1, - AdvancedBrowsableField = 1, - AdvancedBrowsableProperty = 1, - NonBrowsableField = 2, - NonBrowsableProperty = 2 - }; - - var expected = - new - { - BrowsableField = 1, - BrowsableProperty = 1, - ExplicitlyBrowsableField = 1, - ExplicitlyBrowsableProperty = 1, - AdvancedBrowsableField = 1, - AdvancedBrowsableProperty = 1, - NonBrowsableField = 2 - /* NonBrowsableProperty missing */ - }; - - // Act & Assert - subject.Should().BeEquivalentTo(expected, opt => opt.ExcludingNonBrowsableMembers()); - } - - [Fact] - public void When_field_is_missing_from_expectation_excluding_non_browsable_members_should_make_it_succeed() - { - // Arrange - var subject = new ClassWithNonBrowsableMembers - { - BrowsableField = 1, - BrowsableProperty = 1, - ExplicitlyBrowsableField = 1, - ExplicitlyBrowsableProperty = 1, - AdvancedBrowsableField = 1, - AdvancedBrowsableProperty = 1, - NonBrowsableField = 2, - NonBrowsableProperty = 2 - }; - - var expected = - new - { - BrowsableField = 1, - BrowsableProperty = 1, - ExplicitlyBrowsableField = 1, - ExplicitlyBrowsableProperty = 1, - AdvancedBrowsableField = 1, - AdvancedBrowsableProperty = 1, - /* NonBrowsableField missing */ - NonBrowsableProperty = 2 - }; - - // Act & Assert - subject.Should().BeEquivalentTo(expected, opt => opt.ExcludingNonBrowsableMembers()); - } - - [Fact] - public void - When_non_browsable_members_are_excluded_it_should_still_be_possible_to_explicitly_include_non_browsable_field() - { - // Arrange - var subject = new ClassWithNonBrowsableMembers - { - NonBrowsableField = 1 - }; - - var expectation = new ClassWithNonBrowsableMembers - { - NonBrowsableField = 2 - }; - - // Act - Action action = - () => subject.Should().BeEquivalentTo( - expectation, - opt => opt.IncludingFields().ExcludingNonBrowsableMembers().Including(e => e.NonBrowsableField)); - - // Assert - action.Should().Throw() - .WithMessage("Expected field subject.NonBrowsableField to be 2, but found 1.*"); - } - - [Fact] - public void - When_non_browsable_members_are_excluded_it_should_still_be_possible_to_explicitly_include_non_browsable_property() - { - // Arrange - var subject = new ClassWithNonBrowsableMembers - { - NonBrowsableProperty = 1 - }; - - var expectation = new ClassWithNonBrowsableMembers - { - NonBrowsableProperty = 2 - }; - - // Act - Action action = - () => subject.Should().BeEquivalentTo( - expectation, - opt => opt.IncludingProperties().ExcludingNonBrowsableMembers().Including(e => e.NonBrowsableProperty)); - - // Assert - action.Should().Throw() - .WithMessage("Expected property subject.NonBrowsableProperty to be 2, but found 1.*"); - } - - private class ClassWithNonBrowsableMembers - { - public int BrowsableField = -1; - - public int BrowsableProperty { get; set; } - - [EditorBrowsable(EditorBrowsableState.Always)] - public int ExplicitlyBrowsableField = -1; - - [EditorBrowsable(EditorBrowsableState.Always)] - public int ExplicitlyBrowsableProperty { get; set; } - - [EditorBrowsable(EditorBrowsableState.Advanced)] - public int AdvancedBrowsableField = -1; - - [EditorBrowsable(EditorBrowsableState.Advanced)] - public int AdvancedBrowsableProperty { get; set; } - - [EditorBrowsable(EditorBrowsableState.Never)] - public int NonBrowsableField = -1; - - [EditorBrowsable(EditorBrowsableState.Never)] - public int NonBrowsableProperty { get; set; } - } - - private class ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable - { - public int BrowsableProperty { get; set; } - - public int FieldThatMightBeNonBrowsable = -1; - - public int PropertyThatMightBeNonBrowsable { get; set; } - } - - private class ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable - { - public int BrowsableProperty { get; set; } - - [EditorBrowsable(EditorBrowsableState.Never)] - public int FieldThatMightBeNonBrowsable = -1; - - [EditorBrowsable(EditorBrowsableState.Never)] - public int PropertyThatMightBeNonBrowsable { get; set; } - } - } -} From 190fb067362664c6766fb04634921cd4ce19d929 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 17:47:57 +0100 Subject: [PATCH 166/845] Bump JetBrains.Annotations from 2023.2.0 to 2023.3.0 (#2462) Bumps [JetBrains.Annotations](https://github.com/JetBrains/JetBrains.Annotations) from 2023.2.0 to 2023.3.0. - [Commits](https://github.com/JetBrains/JetBrains.Annotations/compare/v2023.2.0...2023.3) --- updated-dependencies: - dependency-name: JetBrains.Annotations dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Src/FluentAssertions/FluentAssertions.csproj | 4 ++-- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index c72f01136a..62344d9c8b 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -1,4 +1,4 @@ - + @@ -45,7 +45,7 @@ - + diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index b5938bf7dd..13a521cc2b 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -34,7 +34,7 @@ - + From bdad50938890c11a0f3576f728435f170006293d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 17:48:33 +0100 Subject: [PATCH 167/845] Bump Meziantou.Analyzer from 2.0.103 to 2.0.109 (#2461) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.103 to 2.0.109. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.103...2.0.109) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index ad74a503b5..583df09cf1 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 16228b6f6f54d321d6c6ce5b5ac584c235dd7245 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 17:49:28 +0100 Subject: [PATCH 168/845] Bump Microsoft.NET.Test.Sdk from 17.7.2 to 17.8.0 (#2460) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.7.2 to 17.8.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.7.2...v17.8.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 2 +- Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 68dc91b1c7..061e2d073d 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -5,7 +5,7 @@ - + all diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 16eb4e16ee..2afde294fb 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -10,7 +10,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 13a521cc2b..033204d051 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -25,7 +25,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 3fc830590b..c40cc701ce 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -17,7 +17,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 716b964f2b..828105ca92 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -25,7 +25,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 1c1aa37c46..02db63db6a 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj index caa549fd78..e0c56b744d 100644 --- a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj +++ b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index 39df07b814..7a59ad8781 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index ff3ba92f97..82d51c72ec 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 5a7c73832f..9dfc05394e 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -6,7 +6,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive From 296dcb214f4f311028d2af60677c05ed7add0476 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 17:49:53 +0100 Subject: [PATCH 169/845] Bump Roslynator.Analyzers from 4.6.1 to 4.6.2 (#2463) Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.6.1 to 4.6.2. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.6.1...v4.6.2) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 583df09cf1..de1b307257 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From de781511db13e753353c58b2bb0bac708051e6f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 17:50:28 +0100 Subject: [PATCH 170/845] Bump the xunit group with 1 update (#2459) Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify). - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/22.1.4...22.2.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 061e2d073d..7fef11556f 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From afbef60075ce5e9bebe102bba8cc7671f22cb128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Tue, 14 Nov 2023 08:40:43 +0100 Subject: [PATCH 171/845] Avoid possible 'System.NullReferenceException' in `PredicateLambdaExpressionValueFormatter` (#2453) * Fix possible 'System.NullReferenceException' in PredicateLambdaExpressionValueFormatter. * Implement review comment to replace `?` with `!` --- .../Formatting/PredicateLambdaExpressionValueFormatter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs b/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs index 2528b91b33..3e8a4bb1ba 100644 --- a/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs @@ -134,7 +134,7 @@ private sealed class AndOperatorChainExtractor : ExpressionVisitor public override Expression Visit(Expression node) { - if (node.NodeType == ExpressionType.AndAlso) + if (node!.NodeType == ExpressionType.AndAlso) { var binaryExpression = (BinaryExpression)node; Visit(binaryExpression.Left); From f7490a0acb263045b23681d482f74f637fe82495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Tue, 14 Nov 2023 13:34:23 +0100 Subject: [PATCH 172/845] Allow fluently calling `WithoutMatchingRules` and `WithoutSelectionRules` while using `BeEquivalentTo` (#2457) --- .../SelfReferenceEquivalencyOptions.cs | 6 +- .../FluentAssertions/net47.verified.txt | 4 +- .../FluentAssertions/net6.0.verified.txt | 4 +- .../netstandard2.0.verified.txt | 4 +- .../netstandard2.1.verified.txt | 4 +- .../SelectionRulesSpecs.cs | 66 +++++++++++++++++++ docs/_pages/releases.md | 1 + 7 files changed, 79 insertions(+), 10 deletions(-) create mode 100644 Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index f3e9fe9c62..db6097d3b8 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -427,17 +427,19 @@ public TSelf AllowingInfiniteRecursion() /// /// Clears all selection rules, including those that were added by default. /// - public void WithoutSelectionRules() + public TSelf WithoutSelectionRules() { selectionRules.Clear(); + return (TSelf)this; } /// /// Clears all matching rules, including those that were added by default. /// - public void WithoutMatchingRules() + public TSelf WithoutMatchingRules() { matchingRules.Clear(); + return (TSelf)this; } /// diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 71fa616938..39344dce75 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -957,8 +957,8 @@ namespace FluentAssertions.Equivalency public TSelf WithStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithTracing(FluentAssertions.Equivalency.Tracing.ITraceWriter writer = null) { } public TSelf WithoutAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } - public void WithoutMatchingRules() { } - public void WithoutSelectionRules() { } + public TSelf WithoutMatchingRules() { } + public TSelf WithoutSelectionRules() { } public TSelf WithoutStrictOrdering() { } public TSelf WithoutStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } public class Restriction diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 6d29bd1c3a..05e30d6602 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -970,8 +970,8 @@ namespace FluentAssertions.Equivalency public TSelf WithStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithTracing(FluentAssertions.Equivalency.Tracing.ITraceWriter writer = null) { } public TSelf WithoutAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } - public void WithoutMatchingRules() { } - public void WithoutSelectionRules() { } + public TSelf WithoutMatchingRules() { } + public TSelf WithoutSelectionRules() { } public TSelf WithoutStrictOrdering() { } public TSelf WithoutStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } public class Restriction diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index c39d7e7f89..44f9a2d9d1 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -950,8 +950,8 @@ namespace FluentAssertions.Equivalency public TSelf WithStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithTracing(FluentAssertions.Equivalency.Tracing.ITraceWriter writer = null) { } public TSelf WithoutAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } - public void WithoutMatchingRules() { } - public void WithoutSelectionRules() { } + public TSelf WithoutMatchingRules() { } + public TSelf WithoutSelectionRules() { } public TSelf WithoutStrictOrdering() { } public TSelf WithoutStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } public class Restriction diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 34e0f4b77d..eb06a6654b 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -957,8 +957,8 @@ namespace FluentAssertions.Equivalency public TSelf WithStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithTracing(FluentAssertions.Equivalency.Tracing.ITraceWriter writer = null) { } public TSelf WithoutAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } - public void WithoutMatchingRules() { } - public void WithoutSelectionRules() { } + public TSelf WithoutMatchingRules() { } + public TSelf WithoutSelectionRules() { } public TSelf WithoutStrictOrdering() { } public TSelf WithoutStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } public class Restriction diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs new file mode 100644 index 0000000000..7e31ed3481 --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs @@ -0,0 +1,66 @@ +using System; +using FluentAssertions.Equivalency.Matching; +using FluentAssertions.Equivalency.Ordering; +using FluentAssertions.Equivalency.Selection; +using Xunit; + +namespace FluentAssertions.Equivalency.Specs; + +public partial class SelectionRulesSpecs +{ + [Fact] + public void Public_methods_follow_fluent_syntax() + { + // Arrange + var subject = new Root(); + var expected = new RootDto(); + + // Act / Assert + subject.Should().BeEquivalentTo(expected, + options => options + .AllowingInfiniteRecursion() + .ComparingByMembers(typeof(Root)) + .ComparingByMembers() + .ComparingByValue(typeof(Customer)) + .ComparingByValue() + .ComparingEnumsByName() + .ComparingEnumsByValue() + .ComparingRecordsByMembers() + .ComparingRecordsByValue() + .Excluding(r => r.Level) + .ExcludingFields() + .ExcludingMissingMembers() + .ExcludingNestedObjects() + .ExcludingNonBrowsableMembers() + .ExcludingProperties() + .IgnoringCyclicReferences() + .IgnoringNonBrowsableMembersOnSubject() + .Including(r => r.Level) + .IncludingAllDeclaredProperties() + .IncludingAllRuntimeProperties() + .IncludingFields() + .IncludingInternalFields() + .IncludingInternalProperties() + .IncludingNestedObjects() + .IncludingProperties() + .RespectingDeclaredTypes() + .RespectingRuntimeTypes() + .ThrowingOnMissingMembers() + .Using(new ExtensibilitySpecs.DoEquivalencyStep(() => { })) + .Using(new MustMatchByNameRule()) + .Using(new AllFieldsSelectionRule()) + .Using(new ByteArrayOrderingRule()) + .Using(StringComparer.OrdinalIgnoreCase) + .WithAutoConversion() + .WithAutoConversionFor(_ => false) + .WithoutAutoConversionFor(_ => true) + .WithoutMatchingRules() + .WithoutSelectionRules() + .WithoutStrictOrdering() + .WithoutStrictOrderingFor(r => r.Level) + .WithStrictOrdering() + .WithStrictOrderingFor(r => r.Level) + .WithTracing() + ); + } +} diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index bc6eecded1..b8752b4320 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -59,6 +59,7 @@ sidebar: * `EquivalencyAssertionOptions` to `EquivalencyOptions` * `IEquivalencyAssertionOptions` to `IEquivalencyOptions` * `SelfReferenceEquivalencyAssertionOptions` to `SelfReferenceEquivalencyOptions` +* Allow fluently calling `WithoutMatchingRules` and `WithoutSelectionRules` while using `BeEquivalentTo` - [#2457](https://github.com/fluentassertions/fluentassertions/pull/2457) ### Breaking Changes (for extensions) * Add `ForConstraint` to `IAssertionsScope` to support chaining `.ForConstraint()` after `.Then` - [#2324](https://github.com/fluentassertions/fluentassertions/pull/2324) From 8dca977bf60d3d2e5b5ea5605aa93c267f188d99 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Tue, 14 Nov 2023 14:51:11 +0100 Subject: [PATCH 173/845] Bump cSpell to 8.0.0 --- Build/Build.cs | 6 +- Build/_build.csproj | 2 +- package.json | 2 +- yarn.lock | 348 +++++++++++++++++++++----------------------- 4 files changed, 169 insertions(+), 189 deletions(-) diff --git a/Build/Build.cs b/Build/Build.cs index 44ec118547..fd01e4bd9e 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -63,11 +63,11 @@ class Build : NukeBuild readonly GitRepository GitRepository; #if OS_WINDOWS - [NuGetPackage("Node.js.redist", "node.exe", Version = "16.20.0", Framework = "win-x64")] + [NuGetPackage("Node.js.redist", "node.exe", Version = "20.9.0", Framework = "win-x64")] #elif OS_MAC - [NuGetPackage("Node.js.redist", "node", Version = "16.20.0", Framework = "osx-x64")] + [NuGetPackage("Node.js.redist", "node", Version = "20.9.0", Framework = "osx-x64")] #else - [NuGetPackage("Node.js.redist", "node", Version = "16.20.0", Framework = "linux-x64")] + [NuGetPackage("Node.js.redist", "node", Version = "20.9.0", Framework = "linux-x64")] #endif Tool Node; diff --git a/Build/_build.csproj b/Build/_build.csproj index 5cfee466ae..afdafd38b3 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -20,7 +20,7 @@ - + diff --git a/package.json b/package.json index 5694b22a56..ceba537213 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^7.3.8" + "cspell": "^8.0.0" } } diff --git a/yarn.lock b/yarn.lock index 929d7c6a2c..282e46ea75 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,16 +23,16 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@cspell/cspell-bundled-dicts@7.3.8": - version "7.3.8" - resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-7.3.8.tgz#2d170f0c680555ebc8cfb3cebd764496cb9707bc" - integrity sha512-Dj8iSGQyfgIsCjmXk9D/SjV7EpbpQSogeaGcBM66H33pd0GyGmLhn3biRN+vqi/vqWmsp75rT3kd5MKa8X5W9Q== +"@cspell/cspell-bundled-dicts@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.0.0.tgz#39b57038fbbd8c01a0e714e83ddceecc4cc49734" + integrity sha512-Phbb1ij1TQQuqxuuvxf5P6fvV9U+EVoATNLmDqFHvRZfUyuhgbJuCMzIPeBx4GfTTDWlPs51FYRvZ/Q8xBHsyA== dependencies: "@cspell/dict-ada" "^4.0.2" "@cspell/dict-aws" "^4.0.0" "@cspell/dict-bash" "^4.1.2" - "@cspell/dict-companies" "^3.0.26" - "@cspell/dict-cpp" "^5.0.8" + "@cspell/dict-companies" "^3.0.27" + "@cspell/dict-cpp" "^5.0.9" "@cspell/dict-cryptocurrencies" "^4.0.0" "@cspell/dict-csharp" "^4.0.2" "@cspell/dict-css" "^4.0.12" @@ -43,67 +43,68 @@ "@cspell/dict-elixir" "^4.0.3" "@cspell/dict-en-common-misspellings" "^1.0.2" "@cspell/dict-en-gb" "1.1.33" - "@cspell/dict-en_us" "^4.3.9" - "@cspell/dict-filetypes" "^3.0.1" + "@cspell/dict-en_us" "^4.3.11" + "@cspell/dict-filetypes" "^3.0.2" "@cspell/dict-fonts" "^4.0.0" - "@cspell/dict-fsharp" "^1.0.0" + "@cspell/dict-fsharp" "^1.0.1" "@cspell/dict-fullstack" "^3.1.5" "@cspell/dict-gaming-terms" "^1.0.4" "@cspell/dict-git" "^2.0.0" - "@cspell/dict-golang" "^6.0.3" + "@cspell/dict-golang" "^6.0.4" "@cspell/dict-haskell" "^4.0.1" "@cspell/dict-html" "^4.0.5" "@cspell/dict-html-symbol-entities" "^4.0.0" "@cspell/dict-java" "^5.0.6" - "@cspell/dict-k8s" "^1.0.1" + "@cspell/dict-k8s" "^1.0.2" "@cspell/dict-latex" "^4.0.0" "@cspell/dict-lorem-ipsum" "^4.0.0" "@cspell/dict-lua" "^4.0.2" + "@cspell/dict-makefile" "^1.0.0" "@cspell/dict-node" "^4.0.3" "@cspell/dict-npm" "^5.0.12" - "@cspell/dict-php" "^4.0.3" + "@cspell/dict-php" "^4.0.4" "@cspell/dict-powershell" "^5.0.2" "@cspell/dict-public-licenses" "^2.0.5" - "@cspell/dict-python" "^4.1.9" + "@cspell/dict-python" "^4.1.10" "@cspell/dict-r" "^2.0.1" "@cspell/dict-ruby" "^5.0.1" "@cspell/dict-rust" "^4.0.1" "@cspell/dict-scala" "^5.0.0" - "@cspell/dict-software-terms" "^3.3.6" + "@cspell/dict-software-terms" "^3.3.9" "@cspell/dict-sql" "^2.1.2" "@cspell/dict-svelte" "^1.0.2" "@cspell/dict-swift" "^2.0.1" "@cspell/dict-typescript" "^3.1.2" "@cspell/dict-vue" "^3.0.0" -"@cspell/cspell-json-reporter@7.3.8": - version "7.3.8" - resolved "https://registry.yarnpkg.com/@cspell/cspell-json-reporter/-/cspell-json-reporter-7.3.8.tgz#517245b15f862794706d21bbc40b59d25ae2092b" - integrity sha512-FxYJWtDgxIQYxdP0RWwRV8nzLfxVx8D8D5L2sbbP/0NFczDbq/zWYep4nSAHJT10aUJrogsVUYwNwdkr562wKA== +"@cspell/cspell-json-reporter@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.0.0.tgz#b41b057ba85b47a853c0d39f0dabf384a4bd3057" + integrity sha512-1ltK5N4xMGWjDSIkU+GJd3rXV8buXgO/lAgnpM1RhKWqAmG+u0k6pnhk2vIo/4qZQpgfK0l3J3h/Ky2FcE95vA== dependencies: - "@cspell/cspell-types" "7.3.8" + "@cspell/cspell-types" "8.0.0" -"@cspell/cspell-pipe@7.3.8": - version "7.3.8" - resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-7.3.8.tgz#4a8053764d9012125632a11f5a572227b6971b8c" - integrity sha512-/vKPfiHM5bJUkNX12w9j533Lm2JvvSMKUCChM2AxYjy6vL8prc/7ei++4g2xAWwRxLZPg2OfpDJS5EirZNBJdA== +"@cspell/cspell-pipe@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-8.0.0.tgz#811a5ca79debd7ef02cb4063fc1f4dee9781c8b9" + integrity sha512-1MH+9q3AmbzwK1BYhSGla8e4MAAYzzPApGvv8eyv0rWDmgmDTkGqJPTTvYj1wFvll5ximQ5OolpPQGv3JoWvtQ== -"@cspell/cspell-resolver@7.3.8": - version "7.3.8" - resolved "https://registry.yarnpkg.com/@cspell/cspell-resolver/-/cspell-resolver-7.3.8.tgz#13e026e9f1315956c498fa119a93aece619f9a48" - integrity sha512-CeyQmhqZI5a+T7a6oiVN90TFlzU3qVVYqCaZ9grFrVOsmzY9ipH5gmqfgMavaBOqb0di/+VZS8d02suMOXcKLQ== +"@cspell/cspell-resolver@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@cspell/cspell-resolver/-/cspell-resolver-8.0.0.tgz#94ee2f58403c0d41444001ac230ab2f79da30cc0" + integrity sha512-gtALHFLT2vSZ7BZlIg26AY3W9gkiqxPGE75iypWz06JHJs05ngnAR+h6VOu0+rmgx98hNfzPPEh4g+Tjm8Ma0A== dependencies: global-dirs "^3.0.1" -"@cspell/cspell-service-bus@7.3.8": - version "7.3.8" - resolved "https://registry.yarnpkg.com/@cspell/cspell-service-bus/-/cspell-service-bus-7.3.8.tgz#93326a7e775da7f609052de56649438e1995ec16" - integrity sha512-3E7gwY6QILrZH83p69i9CERbRBEqeBiKCIKnAd7U2PbxfFqG/P47fqpnarzSWFwFpU92oyGsYry+wC8TEGISRQ== +"@cspell/cspell-service-bus@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@cspell/cspell-service-bus/-/cspell-service-bus-8.0.0.tgz#7f13e30ecb2758bcef4f918e56a03a37f28637c3" + integrity sha512-1EYhIHoZnhxpfEp6Bno6yVWYBuYfaQrwIfeDMntnezUcSmi7RyroQEcp5U7sLv69vhRD2c81o7r8iUaAbPSmIg== -"@cspell/cspell-types@7.3.8": - version "7.3.8" - resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-7.3.8.tgz#6d6b5633ee3f3f46ef78da8adee056d48402ae10" - integrity sha512-hsOtaULDnawEL4pU0fga941GhvE8mbTbywrJBx+eGX3fnJsaUr8XQzCtnLsW2ko7WCLWFItNEhSSTPQHBFRLsw== +"@cspell/cspell-types@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-8.0.0.tgz#fc083dad9fc9aa9b2dfeaa8e1db13596dbb9e65d" + integrity sha512-dPdxQI8dLJoJEjylaPYfCJNnm2XNMYPuowHE2FMcsnFR9hEchQAhnKVc/aD63IUYnUtUrPxPlUJdoAoj569e+g== "@cspell/dict-ada@^4.0.2": version "4.0.2" @@ -120,15 +121,15 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-bash/-/dict-bash-4.1.2.tgz#47696a13f6294c310801b811e75fc62e6151d28c" integrity sha512-AEBWjbaMaJEyAjOHW0F15P2izBjli2cNerG3NjuVH7xX/HUUeNoTj8FF1nwpMufKwGQCvuyO2hCmkVxhJ0y55Q== -"@cspell/dict-companies@^3.0.26": - version "3.0.26" - resolved "https://registry.yarnpkg.com/@cspell/dict-companies/-/dict-companies-3.0.26.tgz#bb6ac17fb6fee0e1d3f5614175a1db40660c444b" - integrity sha512-BGRZ/Uykx+IgQoTGqvRqbBMQy7QSuY0pbTHgtmKtc1scgzZMJQKMDwyuE6LJzlhdlrV7TsVY0lyXREybnDpQPQ== +"@cspell/dict-companies@^3.0.27": + version "3.0.27" + resolved "https://registry.yarnpkg.com/@cspell/dict-companies/-/dict-companies-3.0.27.tgz#c2fd0d82959c7b12a0876cf68f4140d05e6cbfe8" + integrity sha512-gaPR/luf+4oKGyxvW4GbxGGPdHiC5kj/QefnmQqrLFrLiCSXMZg5/NL+Lr4E5lcHsd35meX61svITQAvsT7lyQ== -"@cspell/dict-cpp@^5.0.8": - version "5.0.8" - resolved "https://registry.yarnpkg.com/@cspell/dict-cpp/-/dict-cpp-5.0.8.tgz#e3e6608a32309f1ac769e5ab08137e628c14774f" - integrity sha512-QZ1k3jsGmoP2mfECWp1h9q26KiNA3yxWWkt4GtNGAoqNVUrID93E8RGk2vWR/KNgCu8X15mD3TuYUfQxT72aRw== +"@cspell/dict-cpp@^5.0.9": + version "5.0.9" + resolved "https://registry.yarnpkg.com/@cspell/dict-cpp/-/dict-cpp-5.0.9.tgz#9de9b8532af22597ee1c97292a94b2bfa6cf38d4" + integrity sha512-ql9WPNp8c+fhdpVpjpZEUWmxBHJXs9CJuiVVfW/iwv5AX7VuMHyEwid+9/6nA8qnCxkUQ5pW83Ums1lLjn8ScA== "@cspell/dict-cryptocurrencies@^4.0.0": version "4.0.0" @@ -185,25 +186,25 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz#7f1fd90fc364a5cb77111b5438fc9fcf9cc6da0e" integrity sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g== -"@cspell/dict-en_us@^4.3.9": - version "4.3.9" - resolved "https://registry.yarnpkg.com/@cspell/dict-en_us/-/dict-en_us-4.3.9.tgz#580e697ec9d7cca63f094b5f8907fbfe7a85a8f5" - integrity sha512-7cSTSxokwkQXJdh9ZkPy3Vih/GheSEVFzN0R/1Ak1inHOWCRNSWQCdMqd6DCmfyVgzCk6fDGS+8Uphe/5JTBZQ== +"@cspell/dict-en_us@^4.3.11": + version "4.3.11" + resolved "https://registry.yarnpkg.com/@cspell/dict-en_us/-/dict-en_us-4.3.11.tgz#3adef0c99a97c8ebb20a96be7647215263a5d5dc" + integrity sha512-GhdavZFlS2YbUNcRtPbgJ9j6aUyq116LmDQ2/Q5SpQxJ5/6vVs8Yj5WxV1JD+Zh/Zim1NJDcneTOuLsUGi+Czw== -"@cspell/dict-filetypes@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-filetypes/-/dict-filetypes-3.0.1.tgz#61642b14af90894e6acf4c00f20ab2d097c1ed12" - integrity sha512-8z8mY1IbrTyTRumx2vvD9yzRhNMk9SajM/GtI5hdMM2pPpNSp25bnuauzjRf300eqlqPY2MNb5MmhBFO014DJw== +"@cspell/dict-filetypes@^3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@cspell/dict-filetypes/-/dict-filetypes-3.0.2.tgz#d9b36dbc84b5e92f7d0feb3879374a74a0c0bb09" + integrity sha512-StoC0wPmFNav6F6P8/FYFN1BpZfPgOmktb8gQ9wTauelWofPeBW+A0t5ncZt9hXHtnbGDA98v4ukacV+ucbnUg== "@cspell/dict-fonts@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@cspell/dict-fonts/-/dict-fonts-4.0.0.tgz#9bc8beb2a7b068b4fdb45cb994b36fd184316327" integrity sha512-t9V4GeN/m517UZn63kZPUYP3OQg5f0OBLSd3Md5CU3eH1IFogSvTzHHnz4Wqqbv8NNRiBZ3HfdY/pqREZ6br3Q== -"@cspell/dict-fsharp@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-fsharp/-/dict-fsharp-1.0.0.tgz#420df73069f7bb8efe82bf823eef620647a571bc" - integrity sha512-dHPkMHwW4dWv3Lv9VWxHuVm4IylqvcfRBSnZ7usJTRThraetSVrOPIJwr6UJh7F5un/lGJx2lxWVApf2WQaB/A== +"@cspell/dict-fsharp@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@cspell/dict-fsharp/-/dict-fsharp-1.0.1.tgz#d62c699550a39174f182f23c8c1330a795ab5f53" + integrity sha512-23xyPcD+j+NnqOjRHgW3IU7Li912SX9wmeefcY0QxukbAxJ/vAN4rBpjSwwYZeQPAn3fxdfdNZs03fg+UM+4yQ== "@cspell/dict-fullstack@^3.1.5": version "3.1.5" @@ -220,10 +221,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-git/-/dict-git-2.0.0.tgz#fa5cb298845da9c69efc01c6af07a99097718dc9" integrity sha512-n1AxyX5Kgxij/sZFkxFJlzn3K9y/sCcgVPg/vz4WNJ4K9YeTsUmyGLA2OQI7d10GJeiuAo2AP1iZf2A8j9aj2w== -"@cspell/dict-golang@^6.0.3": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@cspell/dict-golang/-/dict-golang-6.0.3.tgz#e24fecf139db4dc9f771efc754dcd7948994f31e" - integrity sha512-KiNnjAeqDBq6zH4s46hzBrKgqIrkSZ9bbHzQ54PbHfe+jurZkSZ4lXz6E+315RNh2TkRLcNppFvaZqJvKZXomA== +"@cspell/dict-golang@^6.0.4": + version "6.0.4" + resolved "https://registry.yarnpkg.com/@cspell/dict-golang/-/dict-golang-6.0.4.tgz#a7bece30fc491babe0c36a93eacd7e8bb81844ae" + integrity sha512-jOfewPEyN6U9Q80okE3b1PTYBfqZgHh7w4o271GSuAX+VKJ1lUDhdR4bPKRxSDdO5jHArw2u5C8nH2CWGuygbQ== "@cspell/dict-haskell@^4.0.1": version "4.0.1" @@ -245,10 +246,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-java/-/dict-java-5.0.6.tgz#2462d6fc15f79ec15eb88ecf875b6ad2a7bf7a6a" integrity sha512-kdE4AHHHrixyZ5p6zyms1SLoYpaJarPxrz8Tveo6gddszBVVwIUZ+JkQE1bWNLK740GWzIXdkznpUfw1hP9nXw== -"@cspell/dict-k8s@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-k8s/-/dict-k8s-1.0.1.tgz#6c0cc521dd42fee2c807368ebfef77137686f3a1" - integrity sha512-gc5y4Nm3hVdMZNBZfU2M1AsAmObZsRWjCUk01NFPfGhFBXyVne41T7E62rpnzu5330FV/6b/TnFcPgRmak9lLw== +"@cspell/dict-k8s@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@cspell/dict-k8s/-/dict-k8s-1.0.2.tgz#b19e66f4ac8a4264c0f3981ac6e23e88a60f1c91" + integrity sha512-tLT7gZpNPnGa+IIFvK9SP1LrSpPpJ94a/DulzAPOb1Q2UBFwdpFd82UWhio0RNShduvKG/WiMZf/wGl98pn+VQ== "@cspell/dict-latex@^4.0.0": version "4.0.0" @@ -265,6 +266,11 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-lua/-/dict-lua-4.0.2.tgz#74f080296f94eda4e65f79d14be00cb0f8fdcb22" integrity sha512-eeC20Q+UnHcTVBK6pgwhSjGIVugO2XqU7hv4ZfXp2F9DxGx1RME0+1sKX4qAGhdFGwOBsEzb2fwUsAEP6Mibpg== +"@cspell/dict-makefile@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@cspell/dict-makefile/-/dict-makefile-1.0.0.tgz#5afb2910873ebbc01ab8d9c38661c4c93d0e5a40" + integrity sha512-3W9tHPcSbJa6s0bcqWo6VisEDTSN5zOtDbnPabF7rbyjRpNo0uHXHRJQF8gAbFzoTzBBhgkTmrfSiuyQm7vBUQ== + "@cspell/dict-node@^4.0.3": version "4.0.3" resolved "https://registry.yarnpkg.com/@cspell/dict-node/-/dict-node-4.0.3.tgz#5ae0222d72871e82978049f8e11ea627ca42fca3" @@ -275,10 +281,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-npm/-/dict-npm-5.0.12.tgz#dc752a4a22875c3835910266398d70c732648610" integrity sha512-T/+WeQmtbxo7ad6hrdI8URptYstKJP+kXyWJZfuVJJGWJQ7yubxrI5Z5AfM+Dh/ff4xHmdzapxD9adaEQ727uw== -"@cspell/dict-php@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@cspell/dict-php/-/dict-php-4.0.3.tgz#07d6288472f2fe433c9aaf6cd47aa5ef7404aade" - integrity sha512-PxtSmWJCDEB4M8R9ER9ijxBum/tvUqYT26QeuV58q2IFs5IrPZ6hocQKvnFGXItjCWH4oYXyAEAAzINlBC4Opg== +"@cspell/dict-php@^4.0.4": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@cspell/dict-php/-/dict-php-4.0.4.tgz#7510c0fe4bdbb049c143eb3c471820d1e681bbb9" + integrity sha512-fRlLV730fJbulDsLIouZxXoxHt3KIH6hcLFwxaupHL+iTXDg0lo7neRpbqD5MScr/J3idEr7i9G8XWzIikKFug== "@cspell/dict-powershell@^5.0.2": version "5.0.2" @@ -290,10 +296,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.5.tgz#86948b29bd36184943955eaa80bf594488c4dd8a" integrity sha512-91HK4dSRri/HqzAypHgduRMarJAleOX5NugoI8SjDLPzWYkwZ1ftuCXSk+fy8DLc3wK7iOaFcZAvbjmnLhVs4A== -"@cspell/dict-python@^4.1.9": - version "4.1.9" - resolved "https://registry.yarnpkg.com/@cspell/dict-python/-/dict-python-4.1.9.tgz#d576ee258e4f42e6eafd28da1f041709cbde3ebd" - integrity sha512-JMA4v/ZPJWuDt3PPFz+23VIY3iDIB+xOTQ6nw+WkcJU5yr6FUl5zMU9ModKrgujg3jGRuuJqofErZVPqHNHYAA== +"@cspell/dict-python@^4.1.10": + version "4.1.10" + resolved "https://registry.yarnpkg.com/@cspell/dict-python/-/dict-python-4.1.10.tgz#bae6557e7b828a1701d3733b7766c4d95f279175" + integrity sha512-ErF/Ohcu6Xk4QVNzFgo8p7CxkxvAKAmFszvso41qOOhu8CVpB35ikBRpGVDw9gsCUtZzi15Yl0izi4do6WcLkA== dependencies: "@cspell/dict-data-science" "^1.0.11" @@ -317,10 +323,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-scala/-/dict-scala-5.0.0.tgz#b64365ad559110a36d44ccd90edf7151ea648022" integrity sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ== -"@cspell/dict-software-terms@^3.3.6": - version "3.3.6" - resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-3.3.6.tgz#8ed7899b185dbb99e6b6c3154df53c982ff81fb7" - integrity sha512-nr2UPjyDq+4NEQ4V//VL8L3EumL1FylpuRcwiWSUdZdh3b1nh4TV9aEYYUXdgHFxd8qXU2YJ9Kj2hmq0mS/lWQ== +"@cspell/dict-software-terms@^3.3.9": + version "3.3.9" + resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-3.3.9.tgz#0350f46d796be1c08e45d5d4a465bcfcb66f3bb3" + integrity sha512-/O3EWe0SIznx18S7J3GAXPDe7sexn3uTsf4IlnGYK9WY6ZRuEywkXCB+5/USLTGf4+QC05pkHofphdvVSifDyA== "@cspell/dict-sql@^2.1.2": version "2.1.2" @@ -347,17 +353,17 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-vue/-/dict-vue-3.0.0.tgz#68ccb432ad93fcb0fd665352d075ae9a64ea9250" integrity sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A== -"@cspell/dynamic-import@7.3.8": - version "7.3.8" - resolved "https://registry.yarnpkg.com/@cspell/dynamic-import/-/dynamic-import-7.3.8.tgz#677ce11983780d4e88d00552eac685181ae3c989" - integrity sha512-s8x7dH/ScfW0pFEIvNFo4JOR7YmvM2wZSHOykmWTJCQ8k2EQ/+uECPp6ZxkoJoukTz8sj+3KzF0fRl5mKxPd6g== +"@cspell/dynamic-import@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@cspell/dynamic-import/-/dynamic-import-8.0.0.tgz#68d7b6c407fccb62a0f706c8cc99e4d77dc82a12" + integrity sha512-HNkCepopgiEGuI1QGA6ob4+ayvoSMxvAqetLxP0u1sZzc50LH2DEWwotcNrpVdzZOtERHvIBcGaQKIBEx8pPRQ== dependencies: - import-meta-resolve "^3.0.0" + import-meta-resolve "^3.1.1" -"@cspell/strong-weak-map@7.3.8": - version "7.3.8" - resolved "https://registry.yarnpkg.com/@cspell/strong-weak-map/-/strong-weak-map-7.3.8.tgz#8505ed746ac7c6a324b3cc28cd3f9e130a8ec61c" - integrity sha512-qNnt2wG45wb8JP54mENarnQgxfSYKPp3zlYID/2przbMNmVJRqUlcIBOdLI6plCgGeNkzJTl3T9T1ATbnN+LLw== +"@cspell/strong-weak-map@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@cspell/strong-weak-map/-/strong-weak-map-8.0.0.tgz#9f1dc029b86146cd2b01cb563bc470cff1cb0009" + integrity sha512-fRlqPSdpdub52vFtulDgLPzGPGe75I04ScId1zOO9ABP7/ro8VmaG//m1k7hsPkm6h7FG4jWympoA3aXDAcXaA== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -522,68 +528,67 @@ crypto-random-string@^4.0.0: dependencies: type-fest "^1.0.1" -cspell-dictionary@7.3.8: - version "7.3.8" - resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-7.3.8.tgz#ed9ef0626c11a467884e05fd99e802310f35c4ba" - integrity sha512-gkq4t78eLR0xC3P0vDDHPeNY4iZRd5YE6Z8uDJ7RM4UaX/TSdVUN9KNFr34RnJ119NYVHujpL9+uW7wPSAe8Eg== +cspell-dictionary@8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-8.0.0.tgz#7486d2dea00b6b9f8f98726c0a526ebfdeecd153" + integrity sha512-R/AzUj7W7F4O4fAOL8jvIiUqPYGy6jIBlDkxO9SZe/A6D2kOICZZzGSXMZ0M7OKYqxc6cioQUMKOJsLkDXfDXw== dependencies: - "@cspell/cspell-pipe" "7.3.8" - "@cspell/cspell-types" "7.3.8" - cspell-trie-lib "7.3.8" + "@cspell/cspell-pipe" "8.0.0" + "@cspell/cspell-types" "8.0.0" + cspell-trie-lib "8.0.0" fast-equals "^4.0.3" gensequence "^6.0.0" -cspell-gitignore@7.3.8: - version "7.3.8" - resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-7.3.8.tgz#5fffc53daa0d27965f044ab3d0819d731ac2c219" - integrity sha512-vJzCOUEiw6/MwV/U4Ux3bgSdj9mXB+X5eHL+qzVoyFI7ArlvrkuGTL+iFJThQcS8McM3SGqtvaBNCiKBmAeCkA== +cspell-gitignore@8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-8.0.0.tgz#b2fba587712f8f8fb7d70231a3ebfe1ea370b88d" + integrity sha512-Uv+ENdUm+EXwQuG9187lKmE1t8b2KW+6VaQHP7r01WiuhkwhfzmWA7C30iXVcwRcsMw07wKiWvMEtG6Zlzi6lQ== dependencies: - cspell-glob "7.3.8" + cspell-glob "8.0.0" find-up "^5.0.0" -cspell-glob@7.3.8: - version "7.3.8" - resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-7.3.8.tgz#d774aa82b879d41a56330bf7054ca068dfe33e6b" - integrity sha512-wUZC6znyxEs0wlhzGfZ4XHkATPJyazJIFi/VvAdj+KHe7U8SoSgitJVDQqdgectI2y3MxR7lQdVLX9dONFh+7A== +cspell-glob@8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-8.0.0.tgz#8719f5e62a00536f2dc9bda0d4155e48ac93eaaf" + integrity sha512-wOkRA1OTIPhyN7a+k9Qq45yFXM+tBFi9DS5ObiLv6t6VTBIeMQpwRK0KLViHmjTgiA6eWx53Dnr+DZfxcAkcZA== dependencies: micromatch "^4.0.5" -cspell-grammar@7.3.8: - version "7.3.8" - resolved "https://registry.yarnpkg.com/cspell-grammar/-/cspell-grammar-7.3.8.tgz#3411f1ba50744474b25e81b42a3846839be577cf" - integrity sha512-nTjAlMAZAVSFhBd9U3MB9l5FfC5JCCr9DTOA2wWxusVOm+36MbSEH90ucLPkhPa9/+0HtbpDhqVMwXCZllRpsg== - dependencies: - "@cspell/cspell-pipe" "7.3.8" - "@cspell/cspell-types" "7.3.8" - -cspell-io@7.3.8: - version "7.3.8" - resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-7.3.8.tgz#6bd59848a0b1f353b9997f07713c4617d0bddebe" - integrity sha512-XrxPbaiek7EZh+26k9RYVz2wKclaMqM6mXBiu/kpFAHRHHfz91ado6xWvyxZ7UAxQ8ixEwZ+oz9TU+k21gHzyw== - dependencies: - "@cspell/cspell-service-bus" "7.3.8" - node-fetch "^2.7.0" - -cspell-lib@7.3.8: - version "7.3.8" - resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-7.3.8.tgz#6140cca31b32a89b4847e6d50d6d69948b1f13d2" - integrity sha512-2L770sI5DdsAKVzO3jxmfP2fz4LryW6dzL93BpN7WU+ebFC6rg4ioa5liOJV4WoDo2fNQMSeqfW4Aawu9zWR7A== - dependencies: - "@cspell/cspell-bundled-dicts" "7.3.8" - "@cspell/cspell-pipe" "7.3.8" - "@cspell/cspell-resolver" "7.3.8" - "@cspell/cspell-types" "7.3.8" - "@cspell/dynamic-import" "7.3.8" - "@cspell/strong-weak-map" "7.3.8" +cspell-grammar@8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/cspell-grammar/-/cspell-grammar-8.0.0.tgz#e45f4229eeec96313d115cdcaf987f162b4b272d" + integrity sha512-uxpRvbBxOih6SjFQvKTBPTA+YyqYM5UFTNTFuRnA6g6WZeg+NJaTkbQrTgXja4B2r8MJ6XU22YrKTtHNNcP7bQ== + dependencies: + "@cspell/cspell-pipe" "8.0.0" + "@cspell/cspell-types" "8.0.0" + +cspell-io@8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-8.0.0.tgz#f62250bbcaaa39fca51ac72235d15f976dc255d2" + integrity sha512-NVdVmQd7SU/nxYwWtO/6gzux/kp1Dt36zKds0+QHZhQ18JJjXduF5e+WUttqKi2oj/vvmjiG4HGFKQVDBcBz3w== + dependencies: + "@cspell/cspell-service-bus" "8.0.0" + +cspell-lib@8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-8.0.0.tgz#6fb28bd87c764296367d2828d8490c5579646789" + integrity sha512-X/BzUjrzHOx7YlhvSph/OlMu1RmCTnybeZvIE67d1Pd7wT1TmZhFTnmvruUhoHxWEudOEe4HjzuNL9ph6Aw+aA== + dependencies: + "@cspell/cspell-bundled-dicts" "8.0.0" + "@cspell/cspell-pipe" "8.0.0" + "@cspell/cspell-resolver" "8.0.0" + "@cspell/cspell-types" "8.0.0" + "@cspell/dynamic-import" "8.0.0" + "@cspell/strong-weak-map" "8.0.0" clear-module "^4.1.2" comment-json "^4.2.3" configstore "^6.0.0" cosmiconfig "8.0.0" - cspell-dictionary "7.3.8" - cspell-glob "7.3.8" - cspell-grammar "7.3.8" - cspell-io "7.3.8" - cspell-trie-lib "7.3.8" + cspell-dictionary "8.0.0" + cspell-glob "8.0.0" + cspell-grammar "8.0.0" + cspell-io "8.0.0" + cspell-trie-lib "8.0.0" fast-equals "^5.0.1" find-up "^6.3.0" gensequence "^6.0.0" @@ -592,32 +597,32 @@ cspell-lib@7.3.8: vscode-languageserver-textdocument "^1.0.11" vscode-uri "^3.0.8" -cspell-trie-lib@7.3.8: - version "7.3.8" - resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-7.3.8.tgz#1cbabd9473aa3603ee8a8d2f182d905e3f6c9212" - integrity sha512-UQx1Bazbyz2eQJ/EnMohINnUdZvAQL+OcQU3EPPbNWM1DWF4bJGgmFXKNCRYfJk6wtOZVXG5g5AZXx9KnHeN9A== +cspell-trie-lib@8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-8.0.0.tgz#9a4fb5e073d9b4d82da301278bc45e0469eafb2c" + integrity sha512-0rC5e1C0uM78uuS+lC1T18EojWZyNvq4bPOPCisnwuhuWrAfCqrFrX/qDNslWk3VTOPbsEMlFj6OnIGQnfwSKg== dependencies: - "@cspell/cspell-pipe" "7.3.8" - "@cspell/cspell-types" "7.3.8" + "@cspell/cspell-pipe" "8.0.0" + "@cspell/cspell-types" "8.0.0" gensequence "^6.0.0" -cspell@^7.3.8: - version "7.3.8" - resolved "https://registry.yarnpkg.com/cspell/-/cspell-7.3.8.tgz#69b7bca7decaca54b101389c749d3eb53e797d3c" - integrity sha512-8AkqsBQAMsKYV5XyJLB6rBs5hgspL4+MPOg6mBKG2j5EvQgRVc6dIfAPWDNLpIeW2a3+7K5BIWqKHapKPeiknQ== +cspell@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/cspell/-/cspell-8.0.0.tgz#f44dd022ac91a8c098a3f09596315cb4e1d166d0" + integrity sha512-Nayy25Dh+GAlDFDpVZaQhmidP947rpj1Pn9lmZ3nUFjD9W/yj0h0vrjMLMN4dbonddkmKh4t51C+7NuMP405hg== dependencies: - "@cspell/cspell-json-reporter" "7.3.8" - "@cspell/cspell-pipe" "7.3.8" - "@cspell/cspell-types" "7.3.8" - "@cspell/dynamic-import" "7.3.8" + "@cspell/cspell-json-reporter" "8.0.0" + "@cspell/cspell-pipe" "8.0.0" + "@cspell/cspell-types" "8.0.0" + "@cspell/dynamic-import" "8.0.0" chalk "^5.3.0" chalk-template "^1.1.0" commander "^11.1.0" - cspell-gitignore "7.3.8" - cspell-glob "7.3.8" - cspell-io "7.3.8" - cspell-lib "7.3.8" - fast-glob "^3.3.1" + cspell-gitignore "8.0.0" + cspell-glob "8.0.0" + cspell-io "8.0.0" + cspell-lib "8.0.0" + fast-glob "^3.3.2" fast-json-stable-stringify "^2.1.0" file-entry-cache "^7.0.1" get-stdin "^9.0.0" @@ -659,10 +664,10 @@ fast-equals@^5.0.1: resolved "https://registry.yarnpkg.com/fast-equals/-/fast-equals-5.0.1.tgz#a4eefe3c5d1c0d021aeed0bc10ba5e0c12ee405d" integrity sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ== -fast-glob@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" - integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== +fast-glob@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" + integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" @@ -790,10 +795,10 @@ import-fresh@^3.2.1, import-fresh@^3.3.0: parent-module "^1.0.0" resolve-from "^4.0.0" -import-meta-resolve@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/import-meta-resolve/-/import-meta-resolve-3.0.0.tgz#94a6aabc623874fbc2f3525ec1300db71c6cbc11" - integrity sha512-4IwhLhNNA8yy445rPjD/lWh++7hMDOml2eHtd58eG7h+qK3EryMuuRbsHGPikCoAgIkkDnckKfWSk2iDla/ejg== +import-meta-resolve@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/import-meta-resolve/-/import-meta-resolve-3.1.1.tgz#75d194ae465d17c15736f414734310c87d4c45d7" + integrity sha512-qeywsE/KC3w9Fd2ORrRDUw6nS/nLwZpXgfrOc2IILvZYnCaEMd+D56Vfg9k4G29gIeVi3XKql1RQatME8iYsiw== imurmurhash@^0.1.4: version "0.1.4" @@ -925,13 +930,6 @@ minimatch@^3.1.1: dependencies: brace-expansion "^1.1.7" -node-fetch@^2.7.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" - integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== - dependencies: - whatwg-url "^5.0.0" - once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -1088,11 +1086,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - type-fest@^1.0.1: version "1.4.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-1.4.0.tgz#e9fb813fe3bf1744ec359d55d1affefa76f14be1" @@ -1122,19 +1115,6 @@ vscode-uri@^3.0.8: resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f" integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw== -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" From 1a35079c1bfc39c7ee1c8e7cf60a7b1b701ac37c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Thu, 9 Nov 2023 10:04:39 +0100 Subject: [PATCH 174/845] Fix "Namespace does not correspond to file location" --- Src/FluentAssertions/AssertionExtensions.cs | 1 - .../Specialized/AssemblyAssertions.cs | 2 +- .../StringBuilderExtensions.cs | 6 +++-- Src/FluentAssertions/SystemExtensions.cs | 4 ++- .../{Xml => }/XmlAssertionExtensions.cs | 0 .../FluentAssertions/net47.verified.txt | 25 ++++++++----------- .../FluentAssertions/net6.0.verified.txt | 25 ++++++++----------- .../netstandard2.0.verified.txt | 25 ++++++++----------- .../netstandard2.1.verified.txt | 25 ++++++++----------- 9 files changed, 52 insertions(+), 61 deletions(-) rename Src/FluentAssertions/{Xml => }/XmlAssertionExtensions.cs (100%) diff --git a/Src/FluentAssertions/AssertionExtensions.cs b/Src/FluentAssertions/AssertionExtensions.cs index d2ed6822d9..d4f4274992 100644 --- a/Src/FluentAssertions/AssertionExtensions.cs +++ b/Src/FluentAssertions/AssertionExtensions.cs @@ -13,7 +13,6 @@ using FluentAssertions.Common; using FluentAssertions.Numeric; using FluentAssertions.Primitives; -using FluentAssertions.Reflection; using FluentAssertions.Specialized; using FluentAssertions.Streams; using FluentAssertions.Types; diff --git a/Src/FluentAssertions/Specialized/AssemblyAssertions.cs b/Src/FluentAssertions/Specialized/AssemblyAssertions.cs index 646ce0827b..a054a8aa99 100644 --- a/Src/FluentAssertions/Specialized/AssemblyAssertions.cs +++ b/Src/FluentAssertions/Specialized/AssemblyAssertions.cs @@ -6,7 +6,7 @@ using FluentAssertions.Execution; using FluentAssertions.Primitives; -namespace FluentAssertions.Reflection; +namespace FluentAssertions.Specialized; /// /// Contains a number of methods to assert that an is in the expected state. diff --git a/Src/FluentAssertions/StringBuilderExtensions.cs b/Src/FluentAssertions/StringBuilderExtensions.cs index 3c20ee549e..de90a5c1ee 100644 --- a/Src/FluentAssertions/StringBuilderExtensions.cs +++ b/Src/FluentAssertions/StringBuilderExtensions.cs @@ -1,6 +1,8 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using System.Text; -namespace System.Text; +namespace FluentAssertions; /// /// Since net6.0 StringBuilder has additional overloads taking an AppendInterpolatedStringHandler diff --git a/Src/FluentAssertions/SystemExtensions.cs b/Src/FluentAssertions/SystemExtensions.cs index 9594e97654..cec5942003 100644 --- a/Src/FluentAssertions/SystemExtensions.cs +++ b/Src/FluentAssertions/SystemExtensions.cs @@ -1,4 +1,6 @@ -namespace System; +using System; + +namespace FluentAssertions; internal static class SystemExtensions { diff --git a/Src/FluentAssertions/Xml/XmlAssertionExtensions.cs b/Src/FluentAssertions/XmlAssertionExtensions.cs similarity index 100% rename from Src/FluentAssertions/Xml/XmlAssertionExtensions.cs rename to Src/FluentAssertions/XmlAssertionExtensions.cs diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 39344dce75..5ba1403cd5 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -69,7 +69,7 @@ namespace FluentAssertions public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Reflection.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } + public static FluentAssertions.Specialized.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } @@ -2080,19 +2080,6 @@ namespace FluentAssertions.Primitives LessThan = 4, } } -namespace FluentAssertions.Reflection -{ - public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public AssemblyAssertions(System.Reflection.Assembly assembly) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - } -} namespace FluentAssertions.Specialized { public class ActionAssertions : FluentAssertions.Specialized.DelegateAssertions @@ -2104,6 +2091,16 @@ namespace FluentAssertions.Specialized public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } } + public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions + { + public AssemblyAssertions(System.Reflection.Assembly assembly) { } + protected override string Identifier { get; } + public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } + } public class AsyncFunctionAssertions : FluentAssertions.Specialized.DelegateAssertionsBase, TAssertions> where TTask : System.Threading.Tasks.Task where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 05e30d6602..d953cd01cb 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -71,7 +71,7 @@ namespace FluentAssertions public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Reflection.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } + public static FluentAssertions.Specialized.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } @@ -2201,19 +2201,6 @@ namespace FluentAssertions.Primitives LessThan = 4, } } -namespace FluentAssertions.Reflection -{ - public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public AssemblyAssertions(System.Reflection.Assembly assembly) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - } -} namespace FluentAssertions.Specialized { public class ActionAssertions : FluentAssertions.Specialized.DelegateAssertions @@ -2225,6 +2212,16 @@ namespace FluentAssertions.Specialized public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } } + public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions + { + public AssemblyAssertions(System.Reflection.Assembly assembly) { } + protected override string Identifier { get; } + public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } + } public class AsyncFunctionAssertions : FluentAssertions.Specialized.DelegateAssertionsBase, TAssertions> where TTask : System.Threading.Tasks.Task where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 44f9a2d9d1..1b2bfe8911 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -68,7 +68,7 @@ namespace FluentAssertions public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Reflection.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } + public static FluentAssertions.Specialized.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } @@ -2031,19 +2031,6 @@ namespace FluentAssertions.Primitives LessThan = 4, } } -namespace FluentAssertions.Reflection -{ - public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public AssemblyAssertions(System.Reflection.Assembly assembly) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - } -} namespace FluentAssertions.Specialized { public class ActionAssertions : FluentAssertions.Specialized.DelegateAssertions @@ -2055,6 +2042,16 @@ namespace FluentAssertions.Specialized public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } } + public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions + { + public AssemblyAssertions(System.Reflection.Assembly assembly) { } + protected override string Identifier { get; } + public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } + } public class AsyncFunctionAssertions : FluentAssertions.Specialized.DelegateAssertionsBase, TAssertions> where TTask : System.Threading.Tasks.Task where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index eb06a6654b..81c8f962a5 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -69,7 +69,7 @@ namespace FluentAssertions public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Reflection.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } + public static FluentAssertions.Specialized.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } @@ -2080,19 +2080,6 @@ namespace FluentAssertions.Primitives LessThan = 4, } } -namespace FluentAssertions.Reflection -{ - public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public AssemblyAssertions(System.Reflection.Assembly assembly) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - } -} namespace FluentAssertions.Specialized { public class ActionAssertions : FluentAssertions.Specialized.DelegateAssertions @@ -2104,6 +2091,16 @@ namespace FluentAssertions.Specialized public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } } + public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions + { + public AssemblyAssertions(System.Reflection.Assembly assembly) { } + protected override string Identifier { get; } + public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } + } public class AsyncFunctionAssertions : FluentAssertions.Specialized.DelegateAssertionsBase, TAssertions> where TTask : System.Threading.Tasks.Task where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions From 686a5c8a78e1d7e8bf56074fe968a989f7e7f19c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sat, 11 Nov 2023 17:26:19 +0100 Subject: [PATCH 175/845] Move Polyfill classes to separate directory and exclude them from Qodana --- .../{ => Polyfill}/StringBuilderExtensions.cs | 11 +++++----- .../{ => Polyfill}/SystemExtensions.cs | 7 ++++-- .../AssemblyAssertions.cs | 2 +- .../FluentAssertions/net47.verified.txt | 22 +++++++++---------- .../FluentAssertions/net6.0.verified.txt | 22 +++++++++---------- .../netstandard2.0.verified.txt | 22 +++++++++---------- .../netstandard2.1.verified.txt | 22 +++++++++---------- qodana.yaml | 3 +++ 8 files changed, 59 insertions(+), 52 deletions(-) rename Src/FluentAssertions/{ => Polyfill}/StringBuilderExtensions.cs (87%) rename Src/FluentAssertions/{ => Polyfill}/SystemExtensions.cs (92%) rename Src/FluentAssertions/{Specialized => Types}/AssemblyAssertions.cs (99%) diff --git a/Src/FluentAssertions/StringBuilderExtensions.cs b/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs similarity index 87% rename from Src/FluentAssertions/StringBuilderExtensions.cs rename to Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs index de90a5c1ee..bfe221227c 100644 --- a/Src/FluentAssertions/StringBuilderExtensions.cs +++ b/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs @@ -1,8 +1,9 @@ -using System; +#if NET47 || NETSTANDARD2_0 || NETSTANDARD2_1 + using System.Collections.Generic; -using System.Text; -namespace FluentAssertions; +// ReSharper disable once CheckNamespace +namespace System.Text; /// /// Since net6.0 StringBuilder has additional overloads taking an AppendInterpolatedStringHandler @@ -15,8 +16,8 @@ internal static class StringBuilderExtensions public static StringBuilder AppendLine(this StringBuilder stringBuilder, IFormatProvider _, string value) => stringBuilder.AppendLine(value); -#if NET47 || NETSTANDARD2_0 public static StringBuilder AppendJoin(this StringBuilder stringBuilder, string separator, IEnumerable values) => stringBuilder.Append(string.Join(separator, values)); -#endif } + +#endif diff --git a/Src/FluentAssertions/SystemExtensions.cs b/Src/FluentAssertions/Polyfill/SystemExtensions.cs similarity index 92% rename from Src/FluentAssertions/SystemExtensions.cs rename to Src/FluentAssertions/Polyfill/SystemExtensions.cs index cec5942003..88a5af634d 100644 --- a/Src/FluentAssertions/SystemExtensions.cs +++ b/Src/FluentAssertions/Polyfill/SystemExtensions.cs @@ -1,6 +1,7 @@ -using System; +#if NET47 || NETSTANDARD2_0 -namespace FluentAssertions; +// ReSharper disable once CheckNamespace +namespace System; internal static class SystemExtensions { @@ -23,3 +24,5 @@ public static bool Contains(this string str, char value, StringComparison compar public static bool StartsWith(this string str, char value) => str.Length != 0 && str[0] == value; } + +#endif diff --git a/Src/FluentAssertions/Specialized/AssemblyAssertions.cs b/Src/FluentAssertions/Types/AssemblyAssertions.cs similarity index 99% rename from Src/FluentAssertions/Specialized/AssemblyAssertions.cs rename to Src/FluentAssertions/Types/AssemblyAssertions.cs index a054a8aa99..fbe8a5a23f 100644 --- a/Src/FluentAssertions/Specialized/AssemblyAssertions.cs +++ b/Src/FluentAssertions/Types/AssemblyAssertions.cs @@ -6,7 +6,7 @@ using FluentAssertions.Execution; using FluentAssertions.Primitives; -namespace FluentAssertions.Specialized; +namespace FluentAssertions.Types; /// /// Contains a number of methods to assert that an is in the expected state. diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 5ba1403cd5..2bccb50035 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -69,7 +69,7 @@ namespace FluentAssertions public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Specialized.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } + public static FluentAssertions.Types.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } @@ -2091,16 +2091,6 @@ namespace FluentAssertions.Specialized public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } } - public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public AssemblyAssertions(System.Reflection.Assembly assembly) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - } public class AsyncFunctionAssertions : FluentAssertions.Specialized.DelegateAssertionsBase, TAssertions> where TTask : System.Threading.Tasks.Task where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions @@ -2264,6 +2254,16 @@ namespace FluentAssertions.Types { public static FluentAssertions.Types.TypeSelector From(System.Reflection.Assembly assembly) { } } + public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions + { + public AssemblyAssertions(System.Reflection.Assembly assembly) { } + protected override string Identifier { get; } + public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } + } public class ConstructorInfoAssertions : FluentAssertions.Types.MethodBaseAssertions { public ConstructorInfoAssertions(System.Reflection.ConstructorInfo constructorInfo) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index d953cd01cb..918c7e823c 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -71,7 +71,7 @@ namespace FluentAssertions public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Specialized.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } + public static FluentAssertions.Types.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } @@ -2212,16 +2212,6 @@ namespace FluentAssertions.Specialized public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } } - public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public AssemblyAssertions(System.Reflection.Assembly assembly) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - } public class AsyncFunctionAssertions : FluentAssertions.Specialized.DelegateAssertionsBase, TAssertions> where TTask : System.Threading.Tasks.Task where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions @@ -2394,6 +2384,16 @@ namespace FluentAssertions.Types { public static FluentAssertions.Types.TypeSelector From(System.Reflection.Assembly assembly) { } } + public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions + { + public AssemblyAssertions(System.Reflection.Assembly assembly) { } + protected override string Identifier { get; } + public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } + } public class ConstructorInfoAssertions : FluentAssertions.Types.MethodBaseAssertions { public ConstructorInfoAssertions(System.Reflection.ConstructorInfo constructorInfo) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 1b2bfe8911..e2aa85b289 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -68,7 +68,7 @@ namespace FluentAssertions public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Specialized.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } + public static FluentAssertions.Types.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } @@ -2042,16 +2042,6 @@ namespace FluentAssertions.Specialized public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } } - public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public AssemblyAssertions(System.Reflection.Assembly assembly) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - } public class AsyncFunctionAssertions : FluentAssertions.Specialized.DelegateAssertionsBase, TAssertions> where TTask : System.Threading.Tasks.Task where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions @@ -2215,6 +2205,16 @@ namespace FluentAssertions.Types { public static FluentAssertions.Types.TypeSelector From(System.Reflection.Assembly assembly) { } } + public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions + { + public AssemblyAssertions(System.Reflection.Assembly assembly) { } + protected override string Identifier { get; } + public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } + } public class ConstructorInfoAssertions : FluentAssertions.Types.MethodBaseAssertions { public ConstructorInfoAssertions(System.Reflection.ConstructorInfo constructorInfo) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 81c8f962a5..c59678e007 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -69,7 +69,7 @@ namespace FluentAssertions public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Specialized.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } + public static FluentAssertions.Types.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } @@ -2091,16 +2091,6 @@ namespace FluentAssertions.Specialized public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotThrowAfter(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } } - public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions - { - public AssemblyAssertions(System.Reflection.Assembly assembly) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } - } public class AsyncFunctionAssertions : FluentAssertions.Specialized.DelegateAssertionsBase, TAssertions> where TTask : System.Threading.Tasks.Task where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions @@ -2266,6 +2256,16 @@ namespace FluentAssertions.Types { public static FluentAssertions.Types.TypeSelector From(System.Reflection.Assembly assembly) { } } + public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions + { + public AssemblyAssertions(System.Reflection.Assembly assembly) { } + protected override string Identifier { get; } + public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint DefineType(string @namespace, string name, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotReference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint Reference(System.Reflection.Assembly assembly, string because = "", params object[] becauseArgs) { } + } public class ConstructorInfoAssertions : FluentAssertions.Types.MethodBaseAssertions { public ConstructorInfoAssertions(System.Reflection.ConstructorInfo constructorInfo) { } diff --git a/qodana.yaml b/qodana.yaml index caf1cfb08b..540010267c 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -26,3 +26,6 @@ exclude: - name: ConvertToLambdaExpression - name: SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault - name: UnusedMemberInSuper.Global + - name: CheckNamespace + paths: + - Src\FluentAssertions\Polyfill From 3d5ba14454a2d274c791588de30cd60b760afdd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sat, 11 Nov 2023 17:46:14 +0100 Subject: [PATCH 176/845] Remove unnecessary compile exclusions from csproj --- Src/FluentAssertions/FluentAssertions.csproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 62344d9c8b..2eba518e1e 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -55,8 +55,6 @@ - - @@ -66,7 +64,6 @@ - From 95010ce4416ac09c97ea01de22455937cfaecf53 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Thu, 16 Nov 2023 11:24:51 +0100 Subject: [PATCH 177/845] Remove .NET Core 2.1.x and 3.1.x from build SDK setup (#2467) --- .github/workflows/build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a082a5c344..90eca1100b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,8 +19,6 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | - 2.1.x - 3.1.x 6.0.x 7.0.x @@ -63,8 +61,6 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | - 2.1.x - 3.1.x 6.0.x 7.0.x From 79edc6ae777dfdfc7b2c3098e43599d79dcffd8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Fri, 17 Nov 2023 13:04:55 +0100 Subject: [PATCH 178/845] Add missing tests for ActionAssertions and DelegateAssertions (#2454) * Add tests to avoid Qodana issue "Method 'xxx' return value is never used" * Remove incorrect tests for `ActionAssertions` * Add tests for `null` clock --- .../Specialized/ActionAssertionSpecs.cs | 50 +++++++++++++++++++ .../Specialized/DelegateAssertionSpecs.cs | 33 ++++++------ 2 files changed, 66 insertions(+), 17 deletions(-) create mode 100644 Tests/FluentAssertions.Specs/Specialized/ActionAssertionSpecs.cs diff --git a/Tests/FluentAssertions.Specs/Specialized/ActionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/ActionAssertionSpecs.cs new file mode 100644 index 0000000000..fd60ac85a8 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Specialized/ActionAssertionSpecs.cs @@ -0,0 +1,50 @@ +using System; +using Xunit; + +namespace FluentAssertions.Specs.Specialized; + +public class ActionAssertionSpecs +{ + [Fact] + public void Null_clock_throws_exception() + { + // Arrange + Action subject = () => { }; + + // Act + var act = void () => subject.Should(clock: null).NotThrow(); + + // Assert + act.Should().ThrowExactly() + .WithParameterName("clock"); + } + + public class Throw + { + [Fact] + public void Allow_additional_assertions_on_return_value() + { + // Arrange + var exception = new Exception("foo"); + Action subject = () => throw exception; + + // Act / Assert + subject.Should().Throw() + .Which.Message.Should().Be("foo"); + } + } + + public class NotThrow + { + [Fact] + public void Allow_additional_assertions_on_return_value() + { + // Arrange + Action subject = () => { }; + + // Act / Assert + subject.Should().NotThrow() + .And.NotBeNull(); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Specialized/DelegateAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/DelegateAssertionSpecs.cs index 781d70b3a6..68e8253b52 100644 --- a/Tests/FluentAssertions.Specs/Specialized/DelegateAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/DelegateAssertionSpecs.cs @@ -1,6 +1,5 @@ using System; using FluentAssertions.Execution; -using FluentAssertions.Specialized; using Xunit; namespace FluentAssertions.Specs.Specialized; @@ -8,32 +7,32 @@ namespace FluentAssertions.Specs.Specialized; public class DelegateAssertionSpecs { [Fact] - public void When_injecting_a_null_extractor_it_should_throw() + public void Null_clock_throws_exception() { // Arrange - Action subject = () => { }; + Func subject = () => 1; // Act - Func act = () => new ActionAssertions(subject, extractor: null); + var act = void () => subject.Should(clock: null).NotThrow(); - // Act + // Assert act.Should().ThrowExactly() - .WithParameterName("extractor"); + .WithParameterName("clock"); } - [Fact] - public void When_injecting_a_null_clock_it_should_throw() + public class Throw { - // Arrange - Action subject = () => { }; - IExtractExceptions extractor = new AggregateExceptionExtractor(); - - // Act - Func act = () => new ActionAssertions(subject, extractor, clock: null); + [Fact] + public void Allow_additional_assertions_on_return_value() + { + // Arrange + var exception = new Exception("foo"); + Action subject = () => throw exception; - // Act - act.Should().ThrowExactly() - .WithParameterName("clock"); + // Act / Assert + subject.Should().Throw() + .Which.Message.Should().Be("foo"); + } } public class ThrowExactly From 4dc9e5d03ba87b1ffb8ed79ee7b648b653975fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Fri, 17 Nov 2023 13:13:04 +0100 Subject: [PATCH 179/845] Avoid possible 'null' assignment in `CallerIdentifier` (#2448) * Fix "Possible 'null' assignment to non-nullable entity" * Add null check only when not NET6 or greater --- Src/FluentAssertions/CallerIdentifier.cs | 26 ++++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Src/FluentAssertions/CallerIdentifier.cs b/Src/FluentAssertions/CallerIdentifier.cs index cdc91b31ec..23ff3854b3 100644 --- a/Src/FluentAssertions/CallerIdentifier.cs +++ b/Src/FluentAssertions/CallerIdentifier.cs @@ -27,9 +27,7 @@ public static string DetermineCallerIdentity() { var stack = new StackTrace(fNeedFileInfo: true); - var allStackFrames = stack.GetFrames() - .Where(frame => frame is not null && !IsCompilerServices(frame)) - .ToArray(); + var allStackFrames = GetFrames(stack); int searchStart = allStackFrames.Length - 1; @@ -83,9 +81,7 @@ public StackFrameReference() { var stack = new StackTrace(); - var allStackFrames = stack.GetFrames() - .Where(frame => frame is not null && !IsCompilerServices(frame)) - .ToArray(); + var allStackFrames = GetFrames(stack); int firstUserCodeFrameIndex = 0; @@ -116,9 +112,7 @@ internal static IDisposable OverrideStackSearchUsingCurrentScope() internal static bool OnlyOneFluentAssertionScopeOnCallStack() { - var allStackFrames = new StackTrace().GetFrames() - .Where(frame => frame is not null && !IsCompilerServices(frame)) - .ToArray(); + var allStackFrames = GetFrames(new StackTrace()); int firstNonFluentAssertionsStackFrameIndex = Array.FindIndex( allStackFrames, @@ -267,4 +261,18 @@ private static bool IsBooleanLiteral(string candidate) { return candidate is "true" or "false"; } + + private static StackFrame[] GetFrames(StackTrace stack) + { + var frames = stack.GetFrames(); +#if !NET6_0_OR_GREATER + if (frames == null) + { + return Array.Empty(); + } +#endif + return frames + .Where(frame => !IsCompilerServices(frame)) + .ToArray(); + } } From 2eba66d6330d9c55fba4b0e8a4bccb993e819bfd Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Sat, 4 Nov 2023 18:31:59 +0100 Subject: [PATCH 180/845] Fix Qodana `failThreshold` --- qodana.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qodana.yaml b/qodana.yaml index 540010267c..36e1f2efa8 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,7 +1,7 @@ version: "1.0" linter: jetbrains/qodana-dotnet:latest -failThreshold: 13 +failThreshold: 19 dotnet: solution: FluentAssertions.sln From e588b97f9535926bf5df648b62fe42d1e208b4fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sun, 29 Oct 2023 14:53:54 +0100 Subject: [PATCH 181/845] Add `releases.md` to solution items --- FluentAssertions.sln | 1 + 1 file changed, 1 insertion(+) diff --git a/FluentAssertions.sln b/FluentAssertions.sln index 3a4453f573..f76afb9714 100644 --- a/FluentAssertions.sln +++ b/FluentAssertions.sln @@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Src\JetBrainsAnnotations.cs = Src\JetBrainsAnnotations.cs nuget.config = nuget.config README.md = README.md + docs\_pages\releases.md = docs\_pages\releases.md EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "Build\_build.csproj", "{364DD16C-D759-49DC-A04A-64D40205295B}" From 214d3b643c5c76b45f16731db37e31e578182fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sun, 19 Nov 2023 16:48:54 +0100 Subject: [PATCH 182/845] =?UTF-8?q?Fix=20=EF=BB=BF"Variable=20in=20local?= =?UTF-8?q?=20function=20hides=20variable=20from=20outer=20scope"=20(#2471?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Src\FluentAssertions\Formatting\Formatter.cs:111 Parameter 'output' hides outer local variable with the same name - Build\Build.cs:127 Parameter '_' hides outer parameter with the same name - Build\Build.cs:133 Parameter '_' hides outer parameter with the same name - Build\Build.cs:179 Parameter '_' hides outer parameter with the same name - Build\Build.cs:209 Parameter '_' hides outer parameter with the same name - Build\Build.cs:242 Parameter '_' hides outer parameter with the same name - Build\Build.cs:245 Parameter '_' hides outer parameter with the same name - Build\Build.cs:301 Parameter '_' hides outer parameter with the same name - Build\Build.cs:319 Parameter '_' hides outer parameter with the same name - Build\Build.cs: Parameter '_' hides outer parameter with the same name --- Build/Build.cs | 18 +++++++++--------- Src/FluentAssertions/Formatting/Formatter.cs | 5 +++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Build/Build.cs b/Build/Build.cs index fd01e4bd9e..a1e03959d4 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -124,13 +124,13 @@ class Build : NukeBuild .Executes(() => { ReportSummary(s => s - .WhenNotNull(GitVersion, (_, o) => _ + .WhenNotNull(GitVersion, (v, o) => v .AddPair("Version", o.SemVer))); DotNetBuild(s => s .SetProjectFile(Solution) .SetConfiguration(Configuration) - .When(GenerateBinLog is true, _ => _ + .When(GenerateBinLog is true, c => c .SetBinaryLog(ArtifactsDirectory / $"{Solution.Core.FluentAssertions.Name}.binlog") ) .EnableNoLogo() @@ -176,7 +176,7 @@ class Build : NukeBuild { string[] testAssemblies = Projects .SelectMany(project => project.Directory.GlobFiles("bin/Debug/net47/*.Specs.dll")) - .Select(_ => _.ToString()) + .Select(p => p.ToString()) .ToArray(); Assert.NotEmpty(testAssemblies.ToList()); @@ -206,11 +206,11 @@ class Build : NukeBuild "DoesNotReturnAttribute") .CombineWith( Projects, - (_, project) => _ + (settings, project) => settings .SetProjectFile(project) .CombineWith( project.GetTargetFrameworks().Except(new[] { net47 }), - (_, framework) => _ + (frameworkSettings, framework) => frameworkSettings .SetFramework(framework) .AddLoggers($"trx;LogFileName={project.Name}_{framework}.trx") ) @@ -239,10 +239,10 @@ void ReportTestOutcome(params string[] globFilters) var skippedTests = outcomes.Count(outcome => outcome is "NotExecuted"); ReportSummary(_ => _ - .When(failedTests > 0, _ => _ + .When(failedTests > 0, c => c .AddPair("Failed", failedTests.ToString())) .AddPair("Passed", passedTests.ToString()) - .When(skippedTests > 0, _ => _ + .When(skippedTests > 0, c => c .AddPair("Skipped", skippedTests.ToString()))); } @@ -298,7 +298,7 @@ from framework in supportedFrameworks "DoesNotReturnAttribute") .CombineWith( testCombinations, - (_, v) => _ + (settings, v) => settings .SetProjectFile(v.project) .SetFramework(v.framework) .AddLoggers($"trx;LogFileName={v.project.Name}_{v.framework}.trx")), completeOnFailure: true); @@ -316,7 +316,7 @@ from framework in supportedFrameworks .Executes(() => { ReportSummary(s => s - .WhenNotNull(SemVer, (_, semVer) => _ + .WhenNotNull(SemVer, (c, semVer) => c .AddPair("Packed version", semVer))); DotNetPack(s => s diff --git a/Src/FluentAssertions/Formatting/Formatter.cs b/Src/FluentAssertions/Formatting/Formatter.cs index 206d2b16d3..90e79192c9 100644 --- a/Src/FluentAssertions/Formatting/Formatter.cs +++ b/Src/FluentAssertions/Formatting/Formatter.cs @@ -107,8 +107,9 @@ public static string ToString(object value, FormattingOptions options = null) try { - Format(value, output, context, (path, childValue, - output) => FormatChild(path, childValue, output, context, options, graph)); + Format(value, output, context, + (path, childValue, childOutput) + => FormatChild(path, childValue, childOutput, context, options, graph)); } catch (MaxLinesExceededException) { From c0c9b3109aa2aa97f5a9a24e75b31c87997570d2 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Sun, 19 Nov 2023 17:00:40 +0100 Subject: [PATCH 183/845] Disable all Qodana rules for polyfills (#2468) --- Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs | 2 +- qodana.yaml | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs b/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs index bfe221227c..45191e7fa5 100644 --- a/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs +++ b/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs @@ -9,7 +9,7 @@ namespace System.Text; /// Since net6.0 StringBuilder has additional overloads taking an AppendInterpolatedStringHandler /// and optionally an IFormatProvider. /// The overload here is polyfill for older target frameworks to avoid littering the code base with #ifs -/// in order to silence analyzers about dependending on the current culture instead of an invariant culture. +/// in order to silence analyzers about depending on the current culture instead of an invariant culture. /// internal static class StringBuilderExtensions { diff --git a/qodana.yaml b/qodana.yaml index 36e1f2efa8..ef2cb7ae4a 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,7 +1,7 @@ version: "1.0" linter: jetbrains/qodana-dotnet:latest -failThreshold: 19 +failThreshold: 20 dotnet: solution: FluentAssertions.sln @@ -20,12 +20,10 @@ exclude: - Tests/AssemblyB - Tests/Benchmarks - Tests/UWP.Specs + - Src/FluentAssertions/Polyfill - name: UnusedMember.Global - name: ArrangeTrailingCommaInMultilineLists - name: ArrangeTrailingCommaInSinglelineLists - name: ConvertToLambdaExpression - name: SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault - name: UnusedMemberInSuper.Global - - name: CheckNamespace - paths: - - Src\FluentAssertions\Polyfill From 8b14324d5fec20ff7bda6bcb1cf0b364064ab8d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sun, 19 Nov 2023 17:02:21 +0100 Subject: [PATCH 184/845] Run tests under .NET 8 (#2466) --- .github/workflows/build.yml | 2 ++ README.md | 2 +- Src/FluentAssertions/FluentAssertions.csproj | 2 +- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/Benchmarks/BeEquivalentToWithDeeplyNestedStructures.cs | 2 +- Tests/Benchmarks/Benchmarks.csproj | 2 +- Tests/Benchmarks/CollectionEqual.cs | 2 +- Tests/Benchmarks/Issue1657.cs | 2 +- Tests/Benchmarks/TypeMemberReflectorBenchmarks.cs | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 4 ++-- .../FluentAssertions.Extensibility.Specs.csproj | 4 ++-- Tests/FluentAssertions.Specs/FakeClock.cs | 3 +++ Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 4 ++-- docs/_config.yml | 2 +- docs/_pages/releases.md | 1 + docs/index.html | 4 ++-- global.json | 2 +- 17 files changed, 24 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90eca1100b..93f4addee0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,7 @@ jobs: dotnet-version: | 6.0.x 7.0.x + 8.0.x - name: Run NUKE run: ./build.ps1 @@ -63,6 +64,7 @@ jobs: dotnet-version: | 6.0.x 7.0.x + 8.0.x - name: Run NUKE run: ./build.sh UnitTests diff --git a/README.md b/README.md index 8e78319c6b..799cd3c399 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ [![open issues](https://img.shields.io/github/issues/fluentassertions/fluentassertions)](https://github.com/fluentassertions/fluentassertions/issues) ![](https://img.shields.io/badge/release%20strategy-githubflow-orange.svg) -A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Targets .NET Framework 4.7, as well as .NET 6, .NET Standard 2.0 and 2.1. +A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher. See https://www.fluentassertions.com for [background information](https://fluentassertions.com/about/), [usage documentation](https://fluentassertions.com/introduction), an [extensibility guide](https://fluentassertions.com/extensibility/), support information and more [tips & tricks](https://fluentassertions.com/tips/). diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 2eba518e1e..a65b7add7b 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -18,7 +18,7 @@ Dennis Doomen;Jonas Nyrup A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or - BDD-style unit tests. Targets .NET Framework 4.7, .NET 6, as well as .NET Standard 2.0 and 2.1. + BDD-style unit tests. Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher. Supports the unit test frameworks MSTest2, NUnit3, XUnit2 and MSpec. Supported by InfoSupport B.V. diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 7fef11556f..5a50f63f30 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 diff --git a/Tests/Benchmarks/BeEquivalentToWithDeeplyNestedStructures.cs b/Tests/Benchmarks/BeEquivalentToWithDeeplyNestedStructures.cs index 3cd1072b9e..a247d830b1 100644 --- a/Tests/Benchmarks/BeEquivalentToWithDeeplyNestedStructures.cs +++ b/Tests/Benchmarks/BeEquivalentToWithDeeplyNestedStructures.cs @@ -8,7 +8,7 @@ namespace Benchmarks; [MemoryDiagnoser] [SimpleJob(RuntimeMoniker.Net472)] -[SimpleJob(RuntimeMoniker.Net60)] +[SimpleJob(RuntimeMoniker.Net80)] public class BeEquivalentToWithDeeplyNestedStructures { public class ComplexType diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index 9a1f242f8c..c1233eb1cc 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -1,6 +1,6 @@ - net6;net472 + net472;net8.0 True ..\..\Src\FluentAssertions\FluentAssertions.snk Exe diff --git a/Tests/Benchmarks/CollectionEqual.cs b/Tests/Benchmarks/CollectionEqual.cs index 2173f235cc..38d013a57f 100644 --- a/Tests/Benchmarks/CollectionEqual.cs +++ b/Tests/Benchmarks/CollectionEqual.cs @@ -8,7 +8,7 @@ namespace Benchmarks; [MemoryDiagnoser] [SimpleJob(RuntimeMoniker.Net472)] -[SimpleJob(RuntimeMoniker.Net60)] +[SimpleJob(RuntimeMoniker.Net80)] public class CollectionEqualBenchmarks { private IEnumerable collection1; diff --git a/Tests/Benchmarks/Issue1657.cs b/Tests/Benchmarks/Issue1657.cs index 167bf97771..44f42ad421 100644 --- a/Tests/Benchmarks/Issue1657.cs +++ b/Tests/Benchmarks/Issue1657.cs @@ -9,7 +9,7 @@ namespace Benchmarks; [MemoryDiagnoser] [SimpleJob(RuntimeMoniker.Net472)] -[SimpleJob(RuntimeMoniker.Net60)] +[SimpleJob(RuntimeMoniker.Net80)] public class Issue1657 { private List list; diff --git a/Tests/Benchmarks/TypeMemberReflectorBenchmarks.cs b/Tests/Benchmarks/TypeMemberReflectorBenchmarks.cs index 1ae942a4f8..60a8fd3909 100644 --- a/Tests/Benchmarks/TypeMemberReflectorBenchmarks.cs +++ b/Tests/Benchmarks/TypeMemberReflectorBenchmarks.cs @@ -6,7 +6,7 @@ namespace Benchmarks; [MemoryDiagnoser] -[SimpleJob(RuntimeMoniker.Net60)] +[SimpleJob(RuntimeMoniker.Net80)] public class TypeMemberReflectorBenchmarks { [Benchmark] diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 033204d051..6d1abd7251 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -1,7 +1,7 @@ - net47;net6.0 + net47;net6.0;net8.0 True ..\..\Src\FluentAssertions\FluentAssertions.snk false @@ -24,7 +24,7 @@ - + all diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index c40cc701ce..49a486e32e 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -1,7 +1,7 @@ - net6.0;net47 + net47;net6.0;net8.0 True ..\..\Src\FluentAssertions\FluentAssertions.snk false @@ -16,7 +16,7 @@ - + all diff --git a/Tests/FluentAssertions.Specs/FakeClock.cs b/Tests/FluentAssertions.Specs/FakeClock.cs index 3ecdfd3afd..a29ed2d721 100644 --- a/Tests/FluentAssertions.Specs/FakeClock.cs +++ b/Tests/FluentAssertions.Specs/FakeClock.cs @@ -2,6 +2,9 @@ using System.Threading; using System.Threading.Tasks; using FluentAssertions.Common; +#if NET8_0_OR_GREATER +using ITimer = FluentAssertions.Common.ITimer; +#endif namespace FluentAssertions.Specs; diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 828105ca92..a91f752131 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -1,7 +1,7 @@ - net47;net6.0 + net47;net6.0;net8.0 True ..\..\Src\FluentAssertions\FluentAssertions.snk false @@ -24,7 +24,7 @@ - + all diff --git a/docs/_config.yml b/docs/_config.yml index 15429a99d2..52ceb3badd 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -19,7 +19,7 @@ locale : "en-US" title : "Fluent Assertions" title_separator : "-" name : "Dennis Doomen" -description : "A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Targets .NET Framework 4.7, .NET 6.0, as well as .NET Standard 2.0 and 2.1." +description : "A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher." url : "http://www.fluentassertions.com" # the base hostname & protocol for your site e.g. "https://mmistakes.github.io" baseurl : # the subpath of your site, e.g. "/blog" repository : "fluentassertions/fluentassertions" # GitHub username/repo-name e.g. "mmistakes/minimal-mistakes" diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index b8752b4320..c19accfc83 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -12,6 +12,7 @@ sidebar: ### What's new * Introduced a new assembly-level attribute that you can use to initialize Fluent Assertions before the first assertion - [#2292](https://github.com/fluentassertions/fluentassertions/pull/2292) +* Ensure compatibility with .NET 8 - [#2466](https://github.com/fluentassertions/fluentassertions/pull/2466) ### Improvements * Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) diff --git a/docs/index.html b/docs/index.html index 6a02040ba1..1defbf592c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -29,7 +29,7 @@ [ Buy us a coffee](https://ko-fi.com/dennisdoomen){: .btn .btn--paypal}
A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or - BDD-style unit tests. Targets .NET Framework 4.7, as well as .NET 6, .NET Standard 2.0 and 2.1.' + BDD-style unit tests. Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher.' feature_row: - title: "Intention-Revealing Unit Tests" image_path: /assets/images/binoculars.svg @@ -53,7 +53,7 @@ - title: "Feature Complete" image_path: /assets/images/checklist.svg excerpt: ' -Targets .NET 4.7, .NET 6, .NET Standard 2.0 and 2.1. +Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher. Supports MSTest2, xUnit2, NUnit3 and MSpec. ' - title: "Great Support" diff --git a/global.json b/global.json index 87f1d59214..368a14e31c 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.101", + "version": "8.0.100", "rollForward": "latestMajor" } } From 00e57c9055050eb176dbc5264ce610d6ffeb2ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sun, 19 Nov 2023 21:50:16 +0100 Subject: [PATCH 185/845] Add `-EAP` to arguments for Qodana Scan --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index 5071c42883..2582987856 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -21,7 +21,7 @@ jobs: uses: JetBrains/qodana-action@v2023.2 with: upload-result: ${{ github.ref_name == 'master' || github.ref_name == 'develop' }} - args: --baseline,qodana.sarif.json,--ide,QDNET + args: --baseline,qodana.sarif.json,--ide,QDNET-EAP pr-mode: ${{ github.event_name == 'pull_request_target' }} env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} From 93c49dd7b739b18097d39e858954cd0d3be337b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 15:47:50 +0000 Subject: [PATCH 186/845] Bump Meziantou.Analyzer from 2.0.109 to 2.0.110 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.109 to 2.0.110. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.109...2.0.110) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index de1b307257..67656d0be2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive
- + all runtime; build; native; contentfiles; analyzers; buildtransitive From 2c2ad83adb6e7044a05ee070c4a0b5a0db464d72 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 18:41:52 +0100 Subject: [PATCH 187/845] Bump the xunit group with 3 updates (#2475) * Bump the xunit group with 3 updates Bumps the xunit group with 3 updates: [xunit](https://github.com/xunit/xunit), [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) and [Verify.Xunit](https://github.com/VerifyTests/Verify). Updates `xunit` from 2.6.1 to 2.6.2 - [Commits](https://github.com/xunit/xunit/compare/2.6.1...2.6.2) Updates `xunit.runner.visualstudio` from 2.5.3 to 2.5.4 - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.5.3...2.5.4) Updates `Verify.Xunit` from 22.2.0 to 22.5.0 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/commits) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit ... Signed-off-by: dependabot[bot] * Bump xunit.runner.console --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jonas Nyrup --- Build/_build.csproj | 2 +- Tests/Approval.Tests/Approval.Tests.csproj | 6 +++--- Tests/FSharp.Specs/FSharp.Specs.fsproj | 4 ++-- .../FluentAssertions.Equivalency.Specs.csproj | 6 +++--- .../FluentAssertions.Extensibility.Specs.csproj | 6 +++--- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 6 +++--- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 4 ++-- Tests/VB.Specs/VB.Specs.vbproj | 4 ++-- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index afdafd38b3..b6159e891a 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -19,7 +19,7 @@ - + diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 5a50f63f30..42e0e5f5d3 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -6,14 +6,14 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - +
diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 2afde294fb..a6e252b5cb 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -11,8 +11,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 6d1abd7251..252ee5c13a 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -18,7 +18,7 @@ Upgrading to 1.6.0 gives "Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0" --> - + all runtime; build; native; contentfiles; analyzers @@ -26,7 +26,7 @@ - + all runtime; build; native; contentfiles; analyzers @@ -36,7 +36,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 49a486e32e..677a2ee4e5 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -10,7 +10,7 @@ - + all runtime; build; native; contentfiles; analyzers @@ -18,7 +18,7 @@ - + all runtime; build; native; contentfiles; analyzers @@ -29,7 +29,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index a91f752131..a748c1589c 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -18,7 +18,7 @@ Upgrading to 1.6.0 gives "Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0" --> - + all runtime; build; native; contentfiles; analyzers @@ -26,7 +26,7 @@ - + all runtime; build; native; contentfiles; analyzers @@ -34,7 +34,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index 82d51c72ec..3a54b0e2c3 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -12,8 +12,8 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 9dfc05394e..3cc3d050aa 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -7,8 +7,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all From b5da515fd00167185ec56a7dc773ffec1aca240a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 10:12:45 +0100 Subject: [PATCH 188/845] Bump Microsoft.SourceLink.GitHub from 1.1.1 to 8.0.0 (#2476) Bumps [Microsoft.SourceLink.GitHub](https://github.com/dotnet/sourcelink) from 1.1.1 to 8.0.0. - [Release notes](https://github.com/dotnet/sourcelink/releases) - [Commits](https://github.com/dotnet/sourcelink/compare/1.1.1...8.0.0) --- updated-dependencies: - dependency-name: Microsoft.SourceLink.GitHub dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Src/FluentAssertions/FluentAssertions.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index a65b7add7b..14f7632cce 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -46,7 +46,7 @@ - + From e62e123938e49c8f9d4ded2bbf48237fbf0e218c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:16:06 +0000 Subject: [PATCH 189/845] Bump Roslynator.Analyzers from 4.6.2 to 4.6.4 Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.6.2 to 4.6.4. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.6.2...v4.6.4) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 67656d0be2..3052d07be3 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 29e969944d74182432e620652d8a27d96d6bf77d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:15:54 +0000 Subject: [PATCH 190/845] Bump Meziantou.Analyzer from 2.0.110 to 2.0.112 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.110 to 2.0.112. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.110...2.0.112) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 3052d07be3..f5d8f9a083 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 9a60062a9d2e7a8acd83238c59f273ee9d1066b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:15:40 +0000 Subject: [PATCH 191/845] Bump the xunit group with 1 update Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify). - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/commits/22.6.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 42e0e5f5d3..250e1af477 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From d0175f949c004a11603691c5d7051a5a7a6a1a21 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Wed, 29 Nov 2023 15:08:25 +0100 Subject: [PATCH 192/845] Update the required minimum VS and SDK versions (#2491) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 799cd3c399..b59d912d39 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ See https://www.fluentassertions.com for [background information](https://fluent Originally authored by Dennis Doomen with Jonas Nyrup as the productive side-kick. Notable contributions were provided by Artur Krajewski, Lukas Grützmacher and David Omid. # How do I build this? -Install Visual Studio 2022 17.0+ or JetBrains Rider 2021.3 as well as the Build Tools 2022 (including the Universal Windows Platform build tools). You will also need to have .NET Framework 4.7 SDK and .NET 7.0 SDK installed. Check [global.json](global.json) for the current minimum required version. +Install Visual Studio 2022 17.8+ or JetBrains Rider 2021.3 as well as the Build Tools 2022 (including the Universal Windows Platform build tools). You will also need to have .NET Framework 4.7 SDK and .NET 8.0 SDK installed. Check [global.json](global.json) for the current minimum required version. # What are these Approval.Tests? This is a special set of tests that use the [Verify](https://github.com/VerifyTests/Verify) project to verify whether you've introduced any breaking changes in the public API of the library. From 2f56211b769b7a9a10b619d8f3a2d868dd473735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Thu, 30 Nov 2023 09:09:48 +0100 Subject: [PATCH 193/845] Add support for NUnit4 (#2483) --- Build/Build.cs | 1 + FluentAssertions.sln | 25 +++++++++++++------ Src/FluentAssertions/FluentAssertions.csproj | 2 +- .../NUnit4.Specs/FrameworkSpecs.cs | 19 ++++++++++++++ .../NUnit4.Specs/NUnit4.Specs.csproj | 21 ++++++++++++++++ docs/_pages/releases.md | 1 + docs/index.html | 2 +- 7 files changed, 61 insertions(+), 10 deletions(-) create mode 100644 Tests/TestFrameworks/NUnit4.Specs/FrameworkSpecs.cs create mode 100644 Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj diff --git a/Build/Build.cs b/Build/Build.cs index a1e03959d4..6110d6c3b4 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -277,6 +277,7 @@ void ReportTestOutcome(params string[] globFilters) Solution.TestFrameworks.MSpec_Specs, Solution.TestFrameworks.MSTestV2_Specs, Solution.TestFrameworks.NUnit3_Specs, + Solution.TestFrameworks.NUnit4_Specs, Solution.TestFrameworks.XUnit2_Specs }; diff --git a/FluentAssertions.sln b/FluentAssertions.sln index f76afb9714..2e6167875b 100644 --- a/FluentAssertions.sln +++ b/FluentAssertions.sln @@ -36,6 +36,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentAssertions", "Src\Flu EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NUnit3.Specs", "Tests\TestFrameworks\NUnit3.Specs\NUnit3.Specs.csproj", "{C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NUnit4.Specs", "Tests\TestFrameworks\NUnit4.Specs\NUnit4.Specs.csproj", "{23891E7D-05CE-4893-AC38-A95CC9D3603E}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSpec.Specs", "Tests\TestFrameworks\MSpec.Specs\MSpec.Specs.csproj", "{4F210C41-7E8E-424A-B956-FC1AA47663C9}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks", "Tests\Benchmarks\Benchmarks.csproj", "{FCAFB0F1-79EA-4D49-813B-188D4BC4BE71}" @@ -52,9 +54,9 @@ Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "VB.Specs", "Tests\VB.Specs\ EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Specs", "Tests\FSharp.Specs\FSharp.Specs.fsproj", "{0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleExtensions", "Tests\ExampleExtensions\ExampleExtensions.csproj", "{8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExampleExtensions", "Tests\ExampleExtensions\ExampleExtensions.csproj", "{8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentAssertions.Extensibility.Specs", "Tests\FluentAssertions.Extensibility.Specs\FluentAssertions.Extensibility.Specs.csproj", "{450FC408-A4E2-4483-B064-2007024D6CF1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentAssertions.Extensibility.Specs", "Tests\FluentAssertions.Extensibility.Specs\FluentAssertions.Extensibility.Specs.csproj", "{450FC408-A4E2-4483-B064-2007024D6CF1}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -102,6 +104,12 @@ Global {C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2}.Debug|Any CPU.Build.0 = Debug|Any CPU {C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2}.Release|Any CPU.ActiveCfg = Debug|Any CPU {C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2}.Release|Any CPU.Build.0 = Debug|Any CPU + {23891E7D-05CE-4893-AC38-A95CC9D3603E}.CI|Any CPU.ActiveCfg = Debug|Any CPU + {23891E7D-05CE-4893-AC38-A95CC9D3603E}.CI|Any CPU.Build.0 = Debug|Any CPU + {23891E7D-05CE-4893-AC38-A95CC9D3603E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23891E7D-05CE-4893-AC38-A95CC9D3603E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23891E7D-05CE-4893-AC38-A95CC9D3603E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23891E7D-05CE-4893-AC38-A95CC9D3603E}.Release|Any CPU.Build.0 = Release|Any CPU {4F210C41-7E8E-424A-B956-FC1AA47663C9}.CI|Any CPU.ActiveCfg = Debug|Any CPU {4F210C41-7E8E-424A-B956-FC1AA47663C9}.CI|Any CPU.Build.0 = Debug|Any CPU {4F210C41-7E8E-424A-B956-FC1AA47663C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -146,18 +154,18 @@ Global {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}.Debug|Any CPU.Build.0 = Debug|Any CPU {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}.Release|Any CPU.ActiveCfg = Release|Any CPU {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}.Release|Any CPU.Build.0 = Release|Any CPU - {450FC408-A4E2-4483-B064-2007024D6CF1}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {450FC408-A4E2-4483-B064-2007024D6CF1}.CI|Any CPU.Build.0 = Debug|Any CPU - {450FC408-A4E2-4483-B064-2007024D6CF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {450FC408-A4E2-4483-B064-2007024D6CF1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {450FC408-A4E2-4483-B064-2007024D6CF1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {450FC408-A4E2-4483-B064-2007024D6CF1}.Release|Any CPU.Build.0 = Release|Any CPU {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.CI|Any CPU.ActiveCfg = Debug|Any CPU {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.CI|Any CPU.Build.0 = Debug|Any CPU {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.Debug|Any CPU.Build.0 = Debug|Any CPU {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.Release|Any CPU.ActiveCfg = Release|Any CPU {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.Release|Any CPU.Build.0 = Release|Any CPU + {450FC408-A4E2-4483-B064-2007024D6CF1}.CI|Any CPU.ActiveCfg = Debug|Any CPU + {450FC408-A4E2-4483-B064-2007024D6CF1}.CI|Any CPU.Build.0 = Debug|Any CPU + {450FC408-A4E2-4483-B064-2007024D6CF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {450FC408-A4E2-4483-B064-2007024D6CF1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {450FC408-A4E2-4483-B064-2007024D6CF1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {450FC408-A4E2-4483-B064-2007024D6CF1}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -169,6 +177,7 @@ Global {A4E37052-5581-4E70-A9C3-FF8364B2F332} = {4D8FA213-8724-4C43-B68A-F018148D238C} {34E3713D-C02F-4868-BBE7-47DAD2C7F03D} = {31891850-3EDC-480A-9B6C-F60540E9C90F} {C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2} = {4D8FA213-8724-4C43-B68A-F018148D238C} + {23891E7D-05CE-4893-AC38-A95CC9D3603E} = {4D8FA213-8724-4C43-B68A-F018148D238C} {4F210C41-7E8E-424A-B956-FC1AA47663C9} = {4D8FA213-8724-4C43-B68A-F018148D238C} {FCAFB0F1-79EA-4D49-813B-188D4BC4BE71} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} {F5115158-A038-4D14-A04E-46E7863E40B9} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 14f7632cce..eb39a33eb6 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -19,7 +19,7 @@ A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher. - Supports the unit test frameworks MSTest2, NUnit3, XUnit2 and MSpec. + Supports the unit test frameworks MSTest2, NUnit3, NUnit4, XUnit2 and MSpec. Supported by InfoSupport B.V. diff --git a/Tests/TestFrameworks/NUnit4.Specs/FrameworkSpecs.cs b/Tests/TestFrameworks/NUnit4.Specs/FrameworkSpecs.cs new file mode 100644 index 0000000000..a3d1bcf2c3 --- /dev/null +++ b/Tests/TestFrameworks/NUnit4.Specs/FrameworkSpecs.cs @@ -0,0 +1,19 @@ +using System; +using FluentAssertions; +using NUnit.Framework; + +namespace NUnit4.Specs; + +[TestFixture] +public class FrameworkSpecs +{ + [Test] + public void Throw_nunit_framework_exception_for_nunit4_tests() + { + // Act + Action act = () => 0.Should().Be(1); + + // Assert + act.Should().Throw(); + } +} diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj new file mode 100644 index 0000000000..749ed71e4a --- /dev/null +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -0,0 +1,21 @@ + + + net6.0 + NUnit4.Specs + NUnit4.Specs + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index c19accfc83..1a7e2bf760 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -13,6 +13,7 @@ sidebar: * Introduced a new assembly-level attribute that you can use to initialize Fluent Assertions before the first assertion - [#2292](https://github.com/fluentassertions/fluentassertions/pull/2292) * Ensure compatibility with .NET 8 - [#2466](https://github.com/fluentassertions/fluentassertions/pull/2466) +* Add support for NUnit 4 - [#2483](https://github.com/fluentassertions/fluentassertions/pull/2483) ### Improvements * Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) diff --git a/docs/index.html b/docs/index.html index 1defbf592c..a43c695d57 100644 --- a/docs/index.html +++ b/docs/index.html @@ -54,7 +54,7 @@ image_path: /assets/images/checklist.svg excerpt: ' Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher. -Supports MSTest2, xUnit2, NUnit3 and MSpec. +Supports MSTest2, xUnit2, NUnit3, NUnit4 and MSpec. ' - title: "Great Support" image_path: /assets/images/customer-service.svg From 4d16830e2e62902edf87946ecccb8eeb48c81268 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 15:59:44 +0000 Subject: [PATCH 194/845] Bump PolySharp from 1.13.2 to 1.14.0 Bumps [PolySharp](https://github.com/Sergio0694/PolySharp) from 1.13.2 to 1.14.0. - [Release notes](https://github.com/Sergio0694/PolySharp/releases) - [Commits](https://github.com/Sergio0694/PolySharp/compare/1.13.2...1.14.0) --- updated-dependencies: - dependency-name: PolySharp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Src/FluentAssertions/FluentAssertions.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index eb39a33eb6..67414d5c59 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -47,7 +47,7 @@ - + From 266a5be43a8840cc6396b0d57e3c7cc1286337f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 15:58:22 +0000 Subject: [PATCH 195/845] Bump Meziantou.Analyzer from 2.0.112 to 2.0.118 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.112 to 2.0.118. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.112...2.0.118) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index f5d8f9a083..83f48c606d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From f5997574a99101beacf82f62d93434ea062bb693 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Tue, 5 Dec 2023 08:32:41 +0100 Subject: [PATCH 196/845] Switch back to the release version of Qodana (to officially support .NET 8) (#2495) --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index 2582987856..5071c42883 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -21,7 +21,7 @@ jobs: uses: JetBrains/qodana-action@v2023.2 with: upload-result: ${{ github.ref_name == 'master' || github.ref_name == 'develop' }} - args: --baseline,qodana.sarif.json,--ide,QDNET-EAP + args: --baseline,qodana.sarif.json,--ide,QDNET pr-mode: ${{ github.event_name == 'pull_request_target' }} env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} From 2e9efd3a3a17971807179c1109679ec257d09494 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 15:55:27 +0000 Subject: [PATCH 197/845] Bump LibGit2Sharp from 0.28.0 to 0.29.0 Bumps [LibGit2Sharp](https://github.com/libgit2/libgit2sharp) from 0.28.0 to 0.29.0. - [Release notes](https://github.com/libgit2/libgit2sharp/releases) - [Changelog](https://github.com/libgit2/libgit2sharp/blob/master/CHANGES.md) - [Commits](https://github.com/libgit2/libgit2sharp/compare/0.28.0...0.29.0) --- updated-dependencies: - dependency-name: LibGit2Sharp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index b6159e891a..11b4f487e9 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -21,7 +21,7 @@ - + From 94d4372e5e8676edaed66480106cc18b595dfe79 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 15:39:32 +0000 Subject: [PATCH 198/845] Bump actions/setup-dotnet from 3 to 4 Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 3 to 4. - [Release notes](https://github.com/actions/setup-dotnet/releases) - [Commits](https://github.com/actions/setup-dotnet/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-dotnet dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93f4addee0..875d373bb2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: fetch-depth: 0 - name: Setup .NET SDKs - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 6.0.x @@ -59,7 +59,7 @@ jobs: fetch-depth: 0 - name: Setup .NET SDKs - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 6.0.x From 01e28945cc1dbb930d5734f923e95e2f306529ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 15:33:46 +0000 Subject: [PATCH 199/845] Bump cspell from 8.0.0 to 8.1.2 Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 8.0.0 to 8.1.2. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/compare/v8.0.0...v8.1.2) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 543 +++++++++++++++++---------------------------------- 2 files changed, 175 insertions(+), 370 deletions(-) diff --git a/package.json b/package.json index ceba537213..2d8ef53343 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.0.0" + "cspell": "^8.1.2" } } diff --git a/yarn.lock b/yarn.lock index 282e46ea75..265a31d90d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,37 +2,16 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" - integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== - dependencies: - "@babel/highlight" "^7.18.6" - -"@babel/helper-validator-identifier@^7.18.6": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" - integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== - -"@babel/highlight@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" - integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== - dependencies: - "@babel/helper-validator-identifier" "^7.18.6" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@cspell/cspell-bundled-dicts@8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.0.0.tgz#39b57038fbbd8c01a0e714e83ddceecc4cc49734" - integrity sha512-Phbb1ij1TQQuqxuuvxf5P6fvV9U+EVoATNLmDqFHvRZfUyuhgbJuCMzIPeBx4GfTTDWlPs51FYRvZ/Q8xBHsyA== +"@cspell/cspell-bundled-dicts@8.1.2": + version "8.1.2" + resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.1.2.tgz#d4097d0ed24e204777feb3d989f9de7240352edc" + integrity sha512-K/+0HJs6ka8y+f4D5nO24vz8aVIFaOOUfvRdQl1sB8zvAPymtEYy4TOF/F2GUD5aDl1+bHIPJOPgbGDl3ANl+w== dependencies: "@cspell/dict-ada" "^4.0.2" "@cspell/dict-aws" "^4.0.0" "@cspell/dict-bash" "^4.1.2" - "@cspell/dict-companies" "^3.0.27" - "@cspell/dict-cpp" "^5.0.9" + "@cspell/dict-companies" "^3.0.28" + "@cspell/dict-cpp" "^5.0.10" "@cspell/dict-cryptocurrencies" "^4.0.0" "@cspell/dict-csharp" "^4.0.2" "@cspell/dict-css" "^4.0.12" @@ -43,14 +22,14 @@ "@cspell/dict-elixir" "^4.0.3" "@cspell/dict-en-common-misspellings" "^1.0.2" "@cspell/dict-en-gb" "1.1.33" - "@cspell/dict-en_us" "^4.3.11" - "@cspell/dict-filetypes" "^3.0.2" + "@cspell/dict-en_us" "^4.3.12" + "@cspell/dict-filetypes" "^3.0.3" "@cspell/dict-fonts" "^4.0.0" "@cspell/dict-fsharp" "^1.0.1" "@cspell/dict-fullstack" "^3.1.5" "@cspell/dict-gaming-terms" "^1.0.4" "@cspell/dict-git" "^2.0.0" - "@cspell/dict-golang" "^6.0.4" + "@cspell/dict-golang" "^6.0.5" "@cspell/dict-haskell" "^4.0.1" "@cspell/dict-html" "^4.0.5" "@cspell/dict-html-symbol-entities" "^4.0.0" @@ -61,7 +40,7 @@ "@cspell/dict-lua" "^4.0.2" "@cspell/dict-makefile" "^1.0.0" "@cspell/dict-node" "^4.0.3" - "@cspell/dict-npm" "^5.0.12" + "@cspell/dict-npm" "^5.0.13" "@cspell/dict-php" "^4.0.4" "@cspell/dict-powershell" "^5.0.2" "@cspell/dict-public-licenses" "^2.0.5" @@ -70,41 +49,41 @@ "@cspell/dict-ruby" "^5.0.1" "@cspell/dict-rust" "^4.0.1" "@cspell/dict-scala" "^5.0.0" - "@cspell/dict-software-terms" "^3.3.9" + "@cspell/dict-software-terms" "^3.3.11" "@cspell/dict-sql" "^2.1.2" "@cspell/dict-svelte" "^1.0.2" "@cspell/dict-swift" "^2.0.1" "@cspell/dict-typescript" "^3.1.2" "@cspell/dict-vue" "^3.0.0" -"@cspell/cspell-json-reporter@8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.0.0.tgz#b41b057ba85b47a853c0d39f0dabf384a4bd3057" - integrity sha512-1ltK5N4xMGWjDSIkU+GJd3rXV8buXgO/lAgnpM1RhKWqAmG+u0k6pnhk2vIo/4qZQpgfK0l3J3h/Ky2FcE95vA== +"@cspell/cspell-json-reporter@8.1.2": + version "8.1.2" + resolved "https://registry.yarnpkg.com/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.1.2.tgz#b295e91a293aa1568fbc60f7a7afcb8a07cea0e2" + integrity sha512-IDKXMgBdgRK7gLFajkGZ9iwKRwtPzsxUFd/srTF6Tm4u823B9f88nIpHbIIKYvgFGRFq06KSIUsEepH54M1ymA== dependencies: - "@cspell/cspell-types" "8.0.0" + "@cspell/cspell-types" "8.1.2" -"@cspell/cspell-pipe@8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-8.0.0.tgz#811a5ca79debd7ef02cb4063fc1f4dee9781c8b9" - integrity sha512-1MH+9q3AmbzwK1BYhSGla8e4MAAYzzPApGvv8eyv0rWDmgmDTkGqJPTTvYj1wFvll5ximQ5OolpPQGv3JoWvtQ== +"@cspell/cspell-pipe@8.1.2": + version "8.1.2" + resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-8.1.2.tgz#741b0fcb7494ae82590bf39ef3cd2549e3302d50" + integrity sha512-RIWQQphAtMYtIeclBdLnd/vc8kr9spWdrmTtiVYkBKG1B+BvEXfGzYc6BGT5tSWxYVTjzbyRJxZJ9pEIw5LUgw== -"@cspell/cspell-resolver@8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@cspell/cspell-resolver/-/cspell-resolver-8.0.0.tgz#94ee2f58403c0d41444001ac230ab2f79da30cc0" - integrity sha512-gtALHFLT2vSZ7BZlIg26AY3W9gkiqxPGE75iypWz06JHJs05ngnAR+h6VOu0+rmgx98hNfzPPEh4g+Tjm8Ma0A== +"@cspell/cspell-resolver@8.1.2": + version "8.1.2" + resolved "https://registry.yarnpkg.com/@cspell/cspell-resolver/-/cspell-resolver-8.1.2.tgz#d0c06fcc8b0848b3d96975f7e7313456a95d4873" + integrity sha512-fZwLkyFToxzA+HZ6YL7nJazrvZTqnSYD/Fy1PR9u6M90jGUY6nIcr7LBKtfDYB6wWE3ygtAUCx0soGssSlmyMw== dependencies: - global-dirs "^3.0.1" + global-directory "^4.0.1" -"@cspell/cspell-service-bus@8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@cspell/cspell-service-bus/-/cspell-service-bus-8.0.0.tgz#7f13e30ecb2758bcef4f918e56a03a37f28637c3" - integrity sha512-1EYhIHoZnhxpfEp6Bno6yVWYBuYfaQrwIfeDMntnezUcSmi7RyroQEcp5U7sLv69vhRD2c81o7r8iUaAbPSmIg== +"@cspell/cspell-service-bus@8.1.2": + version "8.1.2" + resolved "https://registry.yarnpkg.com/@cspell/cspell-service-bus/-/cspell-service-bus-8.1.2.tgz#a96c013025cdaf051fa879a3ecbd955c0778779e" + integrity sha512-bvocFYE1LYe8aBYzG6qMSAj3JWdvRY1zaaoXXV7jkIs2jdBBsSvb6wXAKXn6Z2mjeKAD4y38tD6f9aq17hcSyQ== -"@cspell/cspell-types@8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-8.0.0.tgz#fc083dad9fc9aa9b2dfeaa8e1db13596dbb9e65d" - integrity sha512-dPdxQI8dLJoJEjylaPYfCJNnm2XNMYPuowHE2FMcsnFR9hEchQAhnKVc/aD63IUYnUtUrPxPlUJdoAoj569e+g== +"@cspell/cspell-types@8.1.2": + version "8.1.2" + resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-8.1.2.tgz#295f8ff6794778f4516c9bab363404deea50a868" + integrity sha512-ApVEfLN7G9uBpZOVCjBCTayhEJ1N++P9kBfsS1LWQk14qeTm/char9reVQq2s9kkGrPYEEda+hvGC8K0Y07UUg== "@cspell/dict-ada@^4.0.2": version "4.0.2" @@ -121,15 +100,15 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-bash/-/dict-bash-4.1.2.tgz#47696a13f6294c310801b811e75fc62e6151d28c" integrity sha512-AEBWjbaMaJEyAjOHW0F15P2izBjli2cNerG3NjuVH7xX/HUUeNoTj8FF1nwpMufKwGQCvuyO2hCmkVxhJ0y55Q== -"@cspell/dict-companies@^3.0.27": - version "3.0.27" - resolved "https://registry.yarnpkg.com/@cspell/dict-companies/-/dict-companies-3.0.27.tgz#c2fd0d82959c7b12a0876cf68f4140d05e6cbfe8" - integrity sha512-gaPR/luf+4oKGyxvW4GbxGGPdHiC5kj/QefnmQqrLFrLiCSXMZg5/NL+Lr4E5lcHsd35meX61svITQAvsT7lyQ== +"@cspell/dict-companies@^3.0.28": + version "3.0.28" + resolved "https://registry.yarnpkg.com/@cspell/dict-companies/-/dict-companies-3.0.28.tgz#d617be3e036955d2f656d568f0cc6d1bdf198819" + integrity sha512-UinHkMYB/1pUkLKm1PGIm9PBFYxeAa6YvbB1Rq/RAAlrs0WDwiDBr3BAYdxydukG1IqqwT5z9WtU+8D/yV/5lw== -"@cspell/dict-cpp@^5.0.9": - version "5.0.9" - resolved "https://registry.yarnpkg.com/@cspell/dict-cpp/-/dict-cpp-5.0.9.tgz#9de9b8532af22597ee1c97292a94b2bfa6cf38d4" - integrity sha512-ql9WPNp8c+fhdpVpjpZEUWmxBHJXs9CJuiVVfW/iwv5AX7VuMHyEwid+9/6nA8qnCxkUQ5pW83Ums1lLjn8ScA== +"@cspell/dict-cpp@^5.0.10": + version "5.0.10" + resolved "https://registry.yarnpkg.com/@cspell/dict-cpp/-/dict-cpp-5.0.10.tgz#08c3eb438b631dd3f0fc04f5a6d4b6cab87c8d9b" + integrity sha512-WCRuDrkFdpmeIR6uXQYKU9loMQKNFS4bUhtHdv5fu4qVyJSh3k/kgmtTm1h1BDTj8EwPRc/RGxS+9Z3b2mnabA== "@cspell/dict-cryptocurrencies@^4.0.0": version "4.0.0" @@ -186,15 +165,15 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz#7f1fd90fc364a5cb77111b5438fc9fcf9cc6da0e" integrity sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g== -"@cspell/dict-en_us@^4.3.11": - version "4.3.11" - resolved "https://registry.yarnpkg.com/@cspell/dict-en_us/-/dict-en_us-4.3.11.tgz#3adef0c99a97c8ebb20a96be7647215263a5d5dc" - integrity sha512-GhdavZFlS2YbUNcRtPbgJ9j6aUyq116LmDQ2/Q5SpQxJ5/6vVs8Yj5WxV1JD+Zh/Zim1NJDcneTOuLsUGi+Czw== +"@cspell/dict-en_us@^4.3.12": + version "4.3.12" + resolved "https://registry.yarnpkg.com/@cspell/dict-en_us/-/dict-en_us-4.3.12.tgz#3b0ceaf5ed3cf30b225834ca7d528e4dc96e9605" + integrity sha512-1bsUxFjgxF30FTzcU5uvmCvH3lyqVKR9dbwsJhomBlUM97f0edrd6590SiYBXDm7ruE68m3lJd4vs0Ev2D6FtQ== -"@cspell/dict-filetypes@^3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@cspell/dict-filetypes/-/dict-filetypes-3.0.2.tgz#d9b36dbc84b5e92f7d0feb3879374a74a0c0bb09" - integrity sha512-StoC0wPmFNav6F6P8/FYFN1BpZfPgOmktb8gQ9wTauelWofPeBW+A0t5ncZt9hXHtnbGDA98v4ukacV+ucbnUg== +"@cspell/dict-filetypes@^3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@cspell/dict-filetypes/-/dict-filetypes-3.0.3.tgz#ab0723ca2f4d3d5674e9c9745efc9f144e49c905" + integrity sha512-J9UP+qwwBLfOQ8Qg9tAsKtSY/WWmjj21uj6zXTI9hRLD1eG1uUOLcfVovAmtmVqUWziPSKMr87F6SXI3xmJXgw== "@cspell/dict-fonts@^4.0.0": version "4.0.0" @@ -221,10 +200,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-git/-/dict-git-2.0.0.tgz#fa5cb298845da9c69efc01c6af07a99097718dc9" integrity sha512-n1AxyX5Kgxij/sZFkxFJlzn3K9y/sCcgVPg/vz4WNJ4K9YeTsUmyGLA2OQI7d10GJeiuAo2AP1iZf2A8j9aj2w== -"@cspell/dict-golang@^6.0.4": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@cspell/dict-golang/-/dict-golang-6.0.4.tgz#a7bece30fc491babe0c36a93eacd7e8bb81844ae" - integrity sha512-jOfewPEyN6U9Q80okE3b1PTYBfqZgHh7w4o271GSuAX+VKJ1lUDhdR4bPKRxSDdO5jHArw2u5C8nH2CWGuygbQ== +"@cspell/dict-golang@^6.0.5": + version "6.0.5" + resolved "https://registry.yarnpkg.com/@cspell/dict-golang/-/dict-golang-6.0.5.tgz#4dd2e2fda419730a21fb77ade3b90241ad4a5bcc" + integrity sha512-w4mEqGz4/wV+BBljLxduFNkMrd3rstBNDXmoX5kD4UTzIb4Sy0QybWCtg2iVT+R0KWiRRA56QKOvBsgXiddksA== "@cspell/dict-haskell@^4.0.1": version "4.0.1" @@ -276,10 +255,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-node/-/dict-node-4.0.3.tgz#5ae0222d72871e82978049f8e11ea627ca42fca3" integrity sha512-sFlUNI5kOogy49KtPg8SMQYirDGIAoKBO3+cDLIwD4MLdsWy1q0upc7pzGht3mrjuyMiPRUV14Bb0rkVLrxOhg== -"@cspell/dict-npm@^5.0.12": - version "5.0.12" - resolved "https://registry.yarnpkg.com/@cspell/dict-npm/-/dict-npm-5.0.12.tgz#dc752a4a22875c3835910266398d70c732648610" - integrity sha512-T/+WeQmtbxo7ad6hrdI8URptYstKJP+kXyWJZfuVJJGWJQ7yubxrI5Z5AfM+Dh/ff4xHmdzapxD9adaEQ727uw== +"@cspell/dict-npm@^5.0.13": + version "5.0.13" + resolved "https://registry.yarnpkg.com/@cspell/dict-npm/-/dict-npm-5.0.13.tgz#81051f791ee29563430145b360947f711316ccd1" + integrity sha512-uPb3DlQA/FvlmzT5RjZoy7fy91mxMRZW1B+K3atVM5A/cmP1QlDaSW/iCtde5kHET1MOV7uxz+vy0Yha2OI5pQ== "@cspell/dict-php@^4.0.4": version "4.0.4" @@ -323,10 +302,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-scala/-/dict-scala-5.0.0.tgz#b64365ad559110a36d44ccd90edf7151ea648022" integrity sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ== -"@cspell/dict-software-terms@^3.3.9": - version "3.3.9" - resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-3.3.9.tgz#0350f46d796be1c08e45d5d4a465bcfcb66f3bb3" - integrity sha512-/O3EWe0SIznx18S7J3GAXPDe7sexn3uTsf4IlnGYK9WY6ZRuEywkXCB+5/USLTGf4+QC05pkHofphdvVSifDyA== +"@cspell/dict-software-terms@^3.3.11": + version "3.3.11" + resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-3.3.11.tgz#caa173f5489a426c495b73eaf57654f692d55c05" + integrity sha512-a2Zml4G47dbQ6GDdN7+YlIWs3nFnIcJkZOLT88m/LzxjApiF7AOZLqQiKwow03hyvGSuZy8itgQZmQHoPlw2vQ== "@cspell/dict-sql@^2.1.2": version "2.1.2" @@ -353,17 +332,17 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-vue/-/dict-vue-3.0.0.tgz#68ccb432ad93fcb0fd665352d075ae9a64ea9250" integrity sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A== -"@cspell/dynamic-import@8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dynamic-import/-/dynamic-import-8.0.0.tgz#68d7b6c407fccb62a0f706c8cc99e4d77dc82a12" - integrity sha512-HNkCepopgiEGuI1QGA6ob4+ayvoSMxvAqetLxP0u1sZzc50LH2DEWwotcNrpVdzZOtERHvIBcGaQKIBEx8pPRQ== +"@cspell/dynamic-import@8.1.2": + version "8.1.2" + resolved "https://registry.yarnpkg.com/@cspell/dynamic-import/-/dynamic-import-8.1.2.tgz#d6790861f4fb5bebeb24ee05794f0c3367f52662" + integrity sha512-S0I/VoZvuJvrVgqhxyHCrvHFGAZR6KxoPAr4FMrzVx00hYWZUdCanA494DYXwA5NXisyHlZrpga6H18mVjvIUw== dependencies: - import-meta-resolve "^3.1.1" + import-meta-resolve "^4.0.0" -"@cspell/strong-weak-map@8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@cspell/strong-weak-map/-/strong-weak-map-8.0.0.tgz#9f1dc029b86146cd2b01cb563bc470cff1cb0009" - integrity sha512-fRlqPSdpdub52vFtulDgLPzGPGe75I04ScId1zOO9ABP7/ro8VmaG//m1k7hsPkm6h7FG4jWympoA3aXDAcXaA== +"@cspell/strong-weak-map@8.1.2": + version "8.1.2" + resolved "https://registry.yarnpkg.com/@cspell/strong-weak-map/-/strong-weak-map-8.1.2.tgz#35b32b05cebc5c50d388c088969b791744ba0acf" + integrity sha512-oG3Iz9FV0rTAu34BgXIv5JUyR1legUyFzKWboFCsW9iyTAjViA8aIG6q0ZD7xK84Ugi385jW8XfJB0vb8A1qIQ== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -391,18 +370,6 @@ ansi-regex@^6.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - array-timsort@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/array-timsort/-/array-timsort-1.0.3.tgz#3c9e4199e54fb2b9c3fe5976396a21614ef0d926" @@ -440,15 +407,6 @@ chalk-template@^1.1.0: dependencies: chalk "^5.2.0" -chalk@^2.0.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - chalk@^5.2.0, chalk@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" @@ -462,18 +420,6 @@ clear-module@^4.1.2: parent-module "^2.0.0" resolve-from "^5.0.0" -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - commander@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/commander/-/commander-11.1.0.tgz#62fdce76006a68e5c1ab3314dc92e800eb83d906" @@ -511,16 +457,6 @@ core-util-is@^1.0.3: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== -cosmiconfig@8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.0.0.tgz#e9feae014eab580f858f8a0288f38997a7bebe97" - integrity sha512-da1EafcpH6b/TD8vDRaWV7xFINlHlF6zKsGwS1TsuVJTZRkquaS5HTMq7uq6h31619QjbsYl21gVDOm32KM1vQ== - dependencies: - import-fresh "^3.2.1" - js-yaml "^4.1.0" - parse-json "^5.0.0" - path-type "^4.0.0" - crypto-random-string@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-4.0.0.tgz#5a3cc53d7dd86183df5da0312816ceeeb5bb1fc2" @@ -528,103 +464,111 @@ crypto-random-string@^4.0.0: dependencies: type-fest "^1.0.1" -cspell-dictionary@8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-8.0.0.tgz#7486d2dea00b6b9f8f98726c0a526ebfdeecd153" - integrity sha512-R/AzUj7W7F4O4fAOL8jvIiUqPYGy6jIBlDkxO9SZe/A6D2kOICZZzGSXMZ0M7OKYqxc6cioQUMKOJsLkDXfDXw== +cspell-config-lib@8.1.2: + version "8.1.2" + resolved "https://registry.yarnpkg.com/cspell-config-lib/-/cspell-config-lib-8.1.2.tgz#d39b47119da8b2d19b1c69890f0559ffcb3bb000" + integrity sha512-iJKSY895AnnGAhjZN7HLfRZ3bAUuJKmZ9kmpFB9CJcMTERazBQuxGSx5AjjpB3b1kOM4T9Dgm++jcvbgwH5DbQ== + dependencies: + "@cspell/cspell-types" "8.1.2" + comment-json "^4.2.3" + yaml "^2.3.4" + +cspell-dictionary@8.1.2: + version "8.1.2" + resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-8.1.2.tgz#b62adf65a06425743b7a7854c6cc09b055fbc6d2" + integrity sha512-MB244J4hSFlEqZ/3DP1yM5VN4DAaL6ki4axjgrOaJJyHcVe6WRIbiJBxOcBw0WmWzyZHFZVBXC/dnV0ydpXL8A== dependencies: - "@cspell/cspell-pipe" "8.0.0" - "@cspell/cspell-types" "8.0.0" - cspell-trie-lib "8.0.0" - fast-equals "^4.0.3" + "@cspell/cspell-pipe" "8.1.2" + "@cspell/cspell-types" "8.1.2" + cspell-trie-lib "8.1.2" + fast-equals "^5.0.1" gensequence "^6.0.0" -cspell-gitignore@8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-8.0.0.tgz#b2fba587712f8f8fb7d70231a3ebfe1ea370b88d" - integrity sha512-Uv+ENdUm+EXwQuG9187lKmE1t8b2KW+6VaQHP7r01WiuhkwhfzmWA7C30iXVcwRcsMw07wKiWvMEtG6Zlzi6lQ== +cspell-gitignore@8.1.2: + version "8.1.2" + resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-8.1.2.tgz#775dd36acc25219a296becb91329d88812ebe067" + integrity sha512-fytNCWAyd7oX5oDstx63pLf43YY43CvRWi5gi2E2EUj8VzzbfXwkCwBlIfjupoZ0HFk85LSy9ESVoJ7uO1Of9g== dependencies: - cspell-glob "8.0.0" - find-up "^5.0.0" + cspell-glob "8.1.2" + find-up-simple "^1.0.0" -cspell-glob@8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-8.0.0.tgz#8719f5e62a00536f2dc9bda0d4155e48ac93eaaf" - integrity sha512-wOkRA1OTIPhyN7a+k9Qq45yFXM+tBFi9DS5ObiLv6t6VTBIeMQpwRK0KLViHmjTgiA6eWx53Dnr+DZfxcAkcZA== +cspell-glob@8.1.2: + version "8.1.2" + resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-8.1.2.tgz#4cdc38c0682d232f3c1c278385a928c0c3491695" + integrity sha512-fd4GVUhHMbikSIQjFrHJILPj7X6qfhnQYYMRLx3oIARhQAvbQpx6KzVVUKJ6yMP++dqLFBSs+9KIe/IJyRx5zw== dependencies: micromatch "^4.0.5" -cspell-grammar@8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/cspell-grammar/-/cspell-grammar-8.0.0.tgz#e45f4229eeec96313d115cdcaf987f162b4b272d" - integrity sha512-uxpRvbBxOih6SjFQvKTBPTA+YyqYM5UFTNTFuRnA6g6WZeg+NJaTkbQrTgXja4B2r8MJ6XU22YrKTtHNNcP7bQ== +cspell-grammar@8.1.2: + version "8.1.2" + resolved "https://registry.yarnpkg.com/cspell-grammar/-/cspell-grammar-8.1.2.tgz#02bd5354bda13c5a80fbde9e2bba43bd93f04bfe" + integrity sha512-642YdsUWpGgAih7Dibrxa9g4+drC/DYWlGj0tiRWd9Ge93QC9Iz3344D3RBD11yXs7+uvCQcLCJBDK+49LGE8A== dependencies: - "@cspell/cspell-pipe" "8.0.0" - "@cspell/cspell-types" "8.0.0" + "@cspell/cspell-pipe" "8.1.2" + "@cspell/cspell-types" "8.1.2" -cspell-io@8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-8.0.0.tgz#f62250bbcaaa39fca51ac72235d15f976dc255d2" - integrity sha512-NVdVmQd7SU/nxYwWtO/6gzux/kp1Dt36zKds0+QHZhQ18JJjXduF5e+WUttqKi2oj/vvmjiG4HGFKQVDBcBz3w== +cspell-io@8.1.2: + version "8.1.2" + resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-8.1.2.tgz#ebc51bc1bebaf022e40cb9b3c96a5df79d22cf0a" + integrity sha512-4KUJd2Q8k9stb//iDHpORTBBz0uM8YHa8KA2iSUdJj4D6eA5nTLc0Vzt6y89MrUjPlkzk8kyV848McZfodQtRQ== dependencies: - "@cspell/cspell-service-bus" "8.0.0" + "@cspell/cspell-service-bus" "8.1.2" -cspell-lib@8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-8.0.0.tgz#6fb28bd87c764296367d2828d8490c5579646789" - integrity sha512-X/BzUjrzHOx7YlhvSph/OlMu1RmCTnybeZvIE67d1Pd7wT1TmZhFTnmvruUhoHxWEudOEe4HjzuNL9ph6Aw+aA== +cspell-lib@8.1.2: + version "8.1.2" + resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-8.1.2.tgz#b076ac234b812f61a10f863943494ef82af92d9f" + integrity sha512-UJjuaZ/ZXIXiWFVLGgVJu6VftWHujQaeUgjlQxePvAqI0QdzR9G5vsJ80BGaoldhhKyWxCCq/Gx6PaeWWNzJ5Q== dependencies: - "@cspell/cspell-bundled-dicts" "8.0.0" - "@cspell/cspell-pipe" "8.0.0" - "@cspell/cspell-resolver" "8.0.0" - "@cspell/cspell-types" "8.0.0" - "@cspell/dynamic-import" "8.0.0" - "@cspell/strong-weak-map" "8.0.0" + "@cspell/cspell-bundled-dicts" "8.1.2" + "@cspell/cspell-pipe" "8.1.2" + "@cspell/cspell-resolver" "8.1.2" + "@cspell/cspell-types" "8.1.2" + "@cspell/dynamic-import" "8.1.2" + "@cspell/strong-weak-map" "8.1.2" clear-module "^4.1.2" comment-json "^4.2.3" configstore "^6.0.0" - cosmiconfig "8.0.0" - cspell-dictionary "8.0.0" - cspell-glob "8.0.0" - cspell-grammar "8.0.0" - cspell-io "8.0.0" - cspell-trie-lib "8.0.0" + cspell-config-lib "8.1.2" + cspell-dictionary "8.1.2" + cspell-glob "8.1.2" + cspell-grammar "8.1.2" + cspell-io "8.1.2" + cspell-trie-lib "8.1.2" fast-equals "^5.0.1" - find-up "^6.3.0" gensequence "^6.0.0" import-fresh "^3.3.0" resolve-from "^5.0.0" vscode-languageserver-textdocument "^1.0.11" vscode-uri "^3.0.8" -cspell-trie-lib@8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-8.0.0.tgz#9a4fb5e073d9b4d82da301278bc45e0469eafb2c" - integrity sha512-0rC5e1C0uM78uuS+lC1T18EojWZyNvq4bPOPCisnwuhuWrAfCqrFrX/qDNslWk3VTOPbsEMlFj6OnIGQnfwSKg== +cspell-trie-lib@8.1.2: + version "8.1.2" + resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-8.1.2.tgz#8a42a2275ae179910a54caea4edf0470b55ff0a5" + integrity sha512-TfNRr8XI8ObHjSalnbeF256HyG+cHNDeQSSy5n0Y+UomaSo3Cyy7Z91+0WtND8hdw206jhKiqZqGtzf8ojniDg== dependencies: - "@cspell/cspell-pipe" "8.0.0" - "@cspell/cspell-types" "8.0.0" + "@cspell/cspell-pipe" "8.1.2" + "@cspell/cspell-types" "8.1.2" gensequence "^6.0.0" -cspell@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/cspell/-/cspell-8.0.0.tgz#f44dd022ac91a8c098a3f09596315cb4e1d166d0" - integrity sha512-Nayy25Dh+GAlDFDpVZaQhmidP947rpj1Pn9lmZ3nUFjD9W/yj0h0vrjMLMN4dbonddkmKh4t51C+7NuMP405hg== +cspell@^8.1.2: + version "8.1.2" + resolved "https://registry.yarnpkg.com/cspell/-/cspell-8.1.2.tgz#e1a220de8597ee136de8755e4c4e72185e2ea843" + integrity sha512-MOU+lwbzzXT1mcrLCYb9ecfPtquuys9RQy6KehU4S1Oub4715LiXct6+DqDt8NK6w4R3WRo9ixh1bnL3LoVEMw== dependencies: - "@cspell/cspell-json-reporter" "8.0.0" - "@cspell/cspell-pipe" "8.0.0" - "@cspell/cspell-types" "8.0.0" - "@cspell/dynamic-import" "8.0.0" + "@cspell/cspell-json-reporter" "8.1.2" + "@cspell/cspell-pipe" "8.1.2" + "@cspell/cspell-types" "8.1.2" + "@cspell/dynamic-import" "8.1.2" chalk "^5.3.0" chalk-template "^1.1.0" commander "^11.1.0" - cspell-gitignore "8.0.0" - cspell-glob "8.0.0" - cspell-io "8.0.0" - cspell-lib "8.0.0" + cspell-gitignore "8.1.2" + cspell-glob "8.1.2" + cspell-io "8.1.2" + cspell-lib "8.1.2" fast-glob "^3.3.2" fast-json-stable-stringify "^2.1.0" - file-entry-cache "^7.0.1" + file-entry-cache "^7.0.2" get-stdin "^9.0.0" semver "^7.5.4" strip-ansi "^7.1.0" @@ -637,28 +581,11 @@ dot-prop@^6.0.1: dependencies: is-obj "^2.0.0" -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - esprima@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -fast-equals@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/fast-equals/-/fast-equals-4.0.3.tgz#72884cc805ec3c6679b99875f6b7654f39f0e8c7" - integrity sha512-G3BSX9cfKttjr+2o1O22tYMLq0DPluZnYtq1rXumE1SpL/F/SLIfHx08WYQoWSIpeMYf8sRbJ8++71+v6Pnxfg== - fast-equals@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/fast-equals/-/fast-equals-5.0.1.tgz#a4eefe3c5d1c0d021aeed0bc10ba5e0c12ee405d" @@ -687,12 +614,12 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -file-entry-cache@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-7.0.1.tgz#c71b3509badb040f362255a53e21f15a4e74fc0f" - integrity sha512-uLfFktPmRetVCbHe5UPuekWrQ6hENufnA46qEGbfACkK5drjTTdQYUragRgMjHldcbYG+nslUerqMPjbBSHXjQ== +file-entry-cache@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-7.0.2.tgz#2d61bb70ba89b9548e3035b7c9173fe91deafff0" + integrity sha512-TfW7/1iI4Cy7Y8L6iqNdZQVvdXn0f8B4QcIXmkIbtTIe/Okm/nSlHb4IwGzRVOd3WfSieCgvf5cMzEfySAIl0g== dependencies: - flat-cache "^3.1.1" + flat-cache "^3.2.0" fill-range@^7.0.1: version "7.0.1" @@ -701,26 +628,15 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" -find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -find-up@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-6.3.0.tgz#2abab3d3280b2dc7ac10199ef324c4e002c8c790" - integrity sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw== - dependencies: - locate-path "^7.1.0" - path-exists "^5.0.0" +find-up-simple@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/find-up-simple/-/find-up-simple-1.0.0.tgz#21d035fde9fdbd56c8f4d2f63f32fd93a1cfc368" + integrity sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw== -flat-cache@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.1.1.tgz#a02a15fdec25a8f844ff7cc658f03dd99eb4609b" - integrity sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q== +flat-cache@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" + integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== dependencies: flatted "^3.2.9" keyv "^4.5.3" @@ -765,29 +681,24 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -global-dirs@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-3.0.1.tgz#0c488971f066baceda21447aecb1a8b911d22485" - integrity sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA== +global-directory@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/global-directory/-/global-directory-4.0.1.tgz#4d7ac7cfd2cb73f304c53b8810891748df5e361e" + integrity sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q== dependencies: - ini "2.0.0" + ini "4.1.1" graceful-fs@^4.2.6: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - has-own-prop@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-own-prop/-/has-own-prop-2.0.0.tgz#f0f95d58f65804f5d218db32563bb85b8e0417af" integrity sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ== -import-fresh@^3.2.1, import-fresh@^3.3.0: +import-fresh@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== @@ -795,10 +706,10 @@ import-fresh@^3.2.1, import-fresh@^3.3.0: parent-module "^1.0.0" resolve-from "^4.0.0" -import-meta-resolve@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/import-meta-resolve/-/import-meta-resolve-3.1.1.tgz#75d194ae465d17c15736f414734310c87d4c45d7" - integrity sha512-qeywsE/KC3w9Fd2ORrRDUw6nS/nLwZpXgfrOc2IILvZYnCaEMd+D56Vfg9k4G29gIeVi3XKql1RQatME8iYsiw== +import-meta-resolve@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz#0b1195915689f60ab00f830af0f15cc841e8919e" + integrity sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA== imurmurhash@^0.1.4: version "0.1.4" @@ -818,15 +729,10 @@ inherits@2: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -ini@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ini/-/ini-2.0.0.tgz#e5fd556ecdd5726be978fa1001862eacb0a94bc5" - integrity sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA== - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== +ini@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ini/-/ini-4.1.1.tgz#d95b3d843b1e906e56d6747d5447904ff50ce7a1" + integrity sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g== is-extglob@^2.1.1: version "2.1.1" @@ -855,28 +761,11 @@ is-typedarray@^1.0.0: resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - json-buffer@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - keyv@^4.5.3: version "4.5.3" resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.3.tgz#00873d2b046df737963157bd04f294ca818c9c25" @@ -884,25 +773,6 @@ keyv@^4.5.3: dependencies: json-buffer "3.0.1" -lines-and-columns@^1.1.6: - version "1.2.4" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" - integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -locate-path@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-7.2.0.tgz#69cb1779bd90b35ab1e771e1f2f89a202c2a8a8a" - integrity sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA== - dependencies: - p-locate "^6.0.0" - lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -937,34 +807,6 @@ once@^1.3.0: dependencies: wrappy "1" -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-limit@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-4.0.0.tgz#914af6544ed32bfa54670b061cafcbd04984b644" - integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ== - dependencies: - yocto-queue "^1.0.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -p-locate@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-6.0.0.tgz#3da9a49d4934b901089dca3302fa65dc5a05c04f" - integrity sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw== - dependencies: - p-limit "^4.0.0" - parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -979,36 +821,11 @@ parent-module@^2.0.0: dependencies: callsites "^3.1.0" -parse-json@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-exists@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-5.0.0.tgz#a6aad9489200b21fab31e49cf09277e5116fb9e7" - integrity sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ== - path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" @@ -1072,13 +889,6 @@ strip-ansi@^7.1.0: dependencies: ansi-regex "^6.0.1" -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -1140,12 +950,7 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== - -yocto-queue@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" - integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== +yaml@^2.3.4: + version "2.3.4" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2" + integrity sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA== From a38a271f3c13158f90abc8ca9606a2339032af06 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 15:56:56 +0000 Subject: [PATCH 200/845] Bump Roslynator.Analyzers from 4.6.4 to 4.7.0 Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.6.4 to 4.7.0. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.6.4...v4.7.0) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 83f48c606d..f5edc41cfe 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From ddd98107990f04400c62292c3fdeeeb834add005 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 5 Dec 2023 12:29:37 +0100 Subject: [PATCH 201/845] De-escalate RCS1228 from error to suggestion --- .editorconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.editorconfig b/.editorconfig index 8da38cb2b0..0d1a93930b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -366,6 +366,9 @@ dotnet_diagnostic.RCS1186.severity = none # Use bit shift operator. dotnet_diagnostic.RCS1237.severity = none +# RCS1228: Unused element in documentation comment. (Equivalent to SA1614) +dotnet_diagnostic.RCS1228.severity = suggestion + # Use an overload that has a IEqualityComparer or IComparer parameter dotnet_diagnostic.MA0002.severity = suggestion From 91bfb57604802d9ad69a5603a1d6bf37e8350e75 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 18:41:17 +0100 Subject: [PATCH 202/845] Bump cspell from 8.1.2 to 8.1.3 (#2506) Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 8.1.2 to 8.1.3. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/compare/v8.1.2...v8.1.3) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 218 +++++++++++++++++++++++++-------------------------- 2 files changed, 110 insertions(+), 110 deletions(-) diff --git a/package.json b/package.json index 2d8ef53343..b7d24badb9 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.1.2" + "cspell": "^8.1.3" } } diff --git a/yarn.lock b/yarn.lock index 265a31d90d..8e88a321f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,14 +2,14 @@ # yarn lockfile v1 -"@cspell/cspell-bundled-dicts@8.1.2": - version "8.1.2" - resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.1.2.tgz#d4097d0ed24e204777feb3d989f9de7240352edc" - integrity sha512-K/+0HJs6ka8y+f4D5nO24vz8aVIFaOOUfvRdQl1sB8zvAPymtEYy4TOF/F2GUD5aDl1+bHIPJOPgbGDl3ANl+w== +"@cspell/cspell-bundled-dicts@8.1.3": + version "8.1.3" + resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.1.3.tgz#39d92ebeb9eeeeb943cc7e05525731a06b2f388a" + integrity sha512-TwLyL2bCtetXGhMudjOIgFPAsWF2UkT0E7T+DAZG8aUBfHoC/eco/sTmR6UJVpi6Crjs0YOQkFUBGrQ2pxJPcA== dependencies: "@cspell/dict-ada" "^4.0.2" "@cspell/dict-aws" "^4.0.0" - "@cspell/dict-bash" "^4.1.2" + "@cspell/dict-bash" "^4.1.3" "@cspell/dict-companies" "^3.0.28" "@cspell/dict-cpp" "^5.0.10" "@cspell/dict-cryptocurrencies" "^4.0.0" @@ -37,7 +37,7 @@ "@cspell/dict-k8s" "^1.0.2" "@cspell/dict-latex" "^4.0.0" "@cspell/dict-lorem-ipsum" "^4.0.0" - "@cspell/dict-lua" "^4.0.2" + "@cspell/dict-lua" "^4.0.3" "@cspell/dict-makefile" "^1.0.0" "@cspell/dict-node" "^4.0.3" "@cspell/dict-npm" "^5.0.13" @@ -56,34 +56,34 @@ "@cspell/dict-typescript" "^3.1.2" "@cspell/dict-vue" "^3.0.0" -"@cspell/cspell-json-reporter@8.1.2": - version "8.1.2" - resolved "https://registry.yarnpkg.com/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.1.2.tgz#b295e91a293aa1568fbc60f7a7afcb8a07cea0e2" - integrity sha512-IDKXMgBdgRK7gLFajkGZ9iwKRwtPzsxUFd/srTF6Tm4u823B9f88nIpHbIIKYvgFGRFq06KSIUsEepH54M1ymA== +"@cspell/cspell-json-reporter@8.1.3": + version "8.1.3" + resolved "https://registry.yarnpkg.com/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.1.3.tgz#5645bead06de8bbacedc654b61663b05c57bd8d0" + integrity sha512-9iOU0Y733XuF0cqC7xwzJkOKFdJ65rYGnHFdUHzr5lxEqeG9X/jhlkzyHuGGOhPxkUeFP1x9XoLhXo1isMDbKA== dependencies: - "@cspell/cspell-types" "8.1.2" + "@cspell/cspell-types" "8.1.3" -"@cspell/cspell-pipe@8.1.2": - version "8.1.2" - resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-8.1.2.tgz#741b0fcb7494ae82590bf39ef3cd2549e3302d50" - integrity sha512-RIWQQphAtMYtIeclBdLnd/vc8kr9spWdrmTtiVYkBKG1B+BvEXfGzYc6BGT5tSWxYVTjzbyRJxZJ9pEIw5LUgw== +"@cspell/cspell-pipe@8.1.3": + version "8.1.3" + resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-8.1.3.tgz#728567a69d7c315377c5a1178bbe9151da82048a" + integrity sha512-/dcnyLDeyFuoX4seZv7VsDQyRpt3ZY0vjZiDpqFul8hPydM8czLyRPPMD6Za+Gqg6dZmh9+VsQWK52hVsqc0QA== -"@cspell/cspell-resolver@8.1.2": - version "8.1.2" - resolved "https://registry.yarnpkg.com/@cspell/cspell-resolver/-/cspell-resolver-8.1.2.tgz#d0c06fcc8b0848b3d96975f7e7313456a95d4873" - integrity sha512-fZwLkyFToxzA+HZ6YL7nJazrvZTqnSYD/Fy1PR9u6M90jGUY6nIcr7LBKtfDYB6wWE3ygtAUCx0soGssSlmyMw== +"@cspell/cspell-resolver@8.1.3": + version "8.1.3" + resolved "https://registry.yarnpkg.com/@cspell/cspell-resolver/-/cspell-resolver-8.1.3.tgz#e54bbb0b5d06813907c92cdead6d1dea12a54263" + integrity sha512-bGyJYqkHRilqhyKGL/NvODN5U+UvCuQo7kxgt0i3Vd7m7k6XYLsSLYZ4w6r1S5IQ/ybU8I5lh6/6fNqKwvo9eg== dependencies: global-directory "^4.0.1" -"@cspell/cspell-service-bus@8.1.2": - version "8.1.2" - resolved "https://registry.yarnpkg.com/@cspell/cspell-service-bus/-/cspell-service-bus-8.1.2.tgz#a96c013025cdaf051fa879a3ecbd955c0778779e" - integrity sha512-bvocFYE1LYe8aBYzG6qMSAj3JWdvRY1zaaoXXV7jkIs2jdBBsSvb6wXAKXn6Z2mjeKAD4y38tD6f9aq17hcSyQ== +"@cspell/cspell-service-bus@8.1.3": + version "8.1.3" + resolved "https://registry.yarnpkg.com/@cspell/cspell-service-bus/-/cspell-service-bus-8.1.3.tgz#2b34012d7905a596adf4a8a8daaead86c0d32666" + integrity sha512-8E5ZveQKneNfK+cuFMy0y6tDsho71UPppEHNoLZsEFDbIxDdtQcAfs0pk4nwEzxPBt+dBB+Yl8KExQ6x2FAYQw== -"@cspell/cspell-types@8.1.2": - version "8.1.2" - resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-8.1.2.tgz#295f8ff6794778f4516c9bab363404deea50a868" - integrity sha512-ApVEfLN7G9uBpZOVCjBCTayhEJ1N++P9kBfsS1LWQk14qeTm/char9reVQq2s9kkGrPYEEda+hvGC8K0Y07UUg== +"@cspell/cspell-types@8.1.3": + version "8.1.3" + resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-8.1.3.tgz#aaba55f4a8f6496a30ccf2235675ec6c21b9e33a" + integrity sha512-j14FENj+DzWu6JjzTl+0X5/OJv9AEckpEp6Jaw9YglxirrBBzTkZGfoLePe/AWo/MlIYp0asl92C1UHEjgz+FQ== "@cspell/dict-ada@^4.0.2": version "4.0.2" @@ -95,10 +95,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-aws/-/dict-aws-4.0.0.tgz#ab71fe0c05d9ad662d27495e74361bdcb5b470eb" integrity sha512-1YkCMWuna/EGIDN/zKkW+j98/55mxigftrSFgsehXhPld+ZMJM5J9UuBA88YfL7+/ETvBdd7mwW6IwWsC+/ltQ== -"@cspell/dict-bash@^4.1.2": - version "4.1.2" - resolved "https://registry.yarnpkg.com/@cspell/dict-bash/-/dict-bash-4.1.2.tgz#47696a13f6294c310801b811e75fc62e6151d28c" - integrity sha512-AEBWjbaMaJEyAjOHW0F15P2izBjli2cNerG3NjuVH7xX/HUUeNoTj8FF1nwpMufKwGQCvuyO2hCmkVxhJ0y55Q== +"@cspell/dict-bash@^4.1.3": + version "4.1.3" + resolved "https://registry.yarnpkg.com/@cspell/dict-bash/-/dict-bash-4.1.3.tgz#25fba40825ac10083676ab2c777e471c3f71b36e" + integrity sha512-tOdI3QVJDbQSwPjUkOiQFhYcu2eedmX/PtEpVWg0aFps/r6AyjUQINtTgpqMYnYuq8O1QUIQqnpx21aovcgZCw== "@cspell/dict-companies@^3.0.28": version "3.0.28" @@ -240,10 +240,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.0.tgz#2793a5dbfde474a546b0caecc40c38fdf076306e" integrity sha512-1l3yjfNvMzZPibW8A7mQU4kTozwVZVw0AvFEdy+NcqtbxH+TvbSkNMqROOFWrkD2PjnKG0+Ea0tHI2Pi6Gchnw== -"@cspell/dict-lua@^4.0.2": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@cspell/dict-lua/-/dict-lua-4.0.2.tgz#74f080296f94eda4e65f79d14be00cb0f8fdcb22" - integrity sha512-eeC20Q+UnHcTVBK6pgwhSjGIVugO2XqU7hv4ZfXp2F9DxGx1RME0+1sKX4qAGhdFGwOBsEzb2fwUsAEP6Mibpg== +"@cspell/dict-lua@^4.0.3": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@cspell/dict-lua/-/dict-lua-4.0.3.tgz#2d23c8f7e74b4e62000678d80e7d1ebb10b003e0" + integrity sha512-lDHKjsrrbqPaea13+G9s0rtXjMO06gPXPYRjRYawbNmo4E/e3XFfVzeci3OQDQNDmf2cPOwt9Ef5lu2lDmwfJg== "@cspell/dict-makefile@^1.0.0": version "1.0.0" @@ -332,17 +332,17 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-vue/-/dict-vue-3.0.0.tgz#68ccb432ad93fcb0fd665352d075ae9a64ea9250" integrity sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A== -"@cspell/dynamic-import@8.1.2": - version "8.1.2" - resolved "https://registry.yarnpkg.com/@cspell/dynamic-import/-/dynamic-import-8.1.2.tgz#d6790861f4fb5bebeb24ee05794f0c3367f52662" - integrity sha512-S0I/VoZvuJvrVgqhxyHCrvHFGAZR6KxoPAr4FMrzVx00hYWZUdCanA494DYXwA5NXisyHlZrpga6H18mVjvIUw== +"@cspell/dynamic-import@8.1.3": + version "8.1.3" + resolved "https://registry.yarnpkg.com/@cspell/dynamic-import/-/dynamic-import-8.1.3.tgz#7bfa0dc1dbbd44bced42677ff7129932bf325d3e" + integrity sha512-/lXFLa92v4oOcZ2PbdRpOqBvnqWlYmGaV7iCy8+QhIWlMdzi+7tBX3LVTm9Jzvt/rJseVHQQ6RvfTsSmhbUMFQ== dependencies: import-meta-resolve "^4.0.0" -"@cspell/strong-weak-map@8.1.2": - version "8.1.2" - resolved "https://registry.yarnpkg.com/@cspell/strong-weak-map/-/strong-weak-map-8.1.2.tgz#35b32b05cebc5c50d388c088969b791744ba0acf" - integrity sha512-oG3Iz9FV0rTAu34BgXIv5JUyR1legUyFzKWboFCsW9iyTAjViA8aIG6q0ZD7xK84Ugi385jW8XfJB0vb8A1qIQ== +"@cspell/strong-weak-map@8.1.3": + version "8.1.3" + resolved "https://registry.yarnpkg.com/@cspell/strong-weak-map/-/strong-weak-map-8.1.3.tgz#8c782d32bea999999c761a46b4010ee1569d07c1" + integrity sha512-GhWyximzk8tumo0zhrDV3+nFYiETYefiTBWAEVbXJMibuvitFocVZwddqN85J0UdZ2M7q6tvBleEaI9ME/16gA== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -464,76 +464,76 @@ crypto-random-string@^4.0.0: dependencies: type-fest "^1.0.1" -cspell-config-lib@8.1.2: - version "8.1.2" - resolved "https://registry.yarnpkg.com/cspell-config-lib/-/cspell-config-lib-8.1.2.tgz#d39b47119da8b2d19b1c69890f0559ffcb3bb000" - integrity sha512-iJKSY895AnnGAhjZN7HLfRZ3bAUuJKmZ9kmpFB9CJcMTERazBQuxGSx5AjjpB3b1kOM4T9Dgm++jcvbgwH5DbQ== +cspell-config-lib@8.1.3: + version "8.1.3" + resolved "https://registry.yarnpkg.com/cspell-config-lib/-/cspell-config-lib-8.1.3.tgz#5cd4a8e4d844e9b5737825bda5b445ed50795f88" + integrity sha512-whzJYxcxos3vnywn0alCFZ+Myc0K/C62pUurfOGhgvIba7ArmlXhNRaL2r5noBxWARtpBOtzz3vrzSBK7Lq6jg== dependencies: - "@cspell/cspell-types" "8.1.2" + "@cspell/cspell-types" "8.1.3" comment-json "^4.2.3" yaml "^2.3.4" -cspell-dictionary@8.1.2: - version "8.1.2" - resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-8.1.2.tgz#b62adf65a06425743b7a7854c6cc09b055fbc6d2" - integrity sha512-MB244J4hSFlEqZ/3DP1yM5VN4DAaL6ki4axjgrOaJJyHcVe6WRIbiJBxOcBw0WmWzyZHFZVBXC/dnV0ydpXL8A== +cspell-dictionary@8.1.3: + version "8.1.3" + resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-8.1.3.tgz#7294ade35ceb388cb841a6ac8435b631aa1cac68" + integrity sha512-nkRQDPNnA6tw+hJFBqq26M0nK306q5rtyv/AUIWa8ZHhQkwzACnpMSpuJA7/DV5GVvPKltMK5M4A6vgfpoaFHw== dependencies: - "@cspell/cspell-pipe" "8.1.2" - "@cspell/cspell-types" "8.1.2" - cspell-trie-lib "8.1.2" + "@cspell/cspell-pipe" "8.1.3" + "@cspell/cspell-types" "8.1.3" + cspell-trie-lib "8.1.3" fast-equals "^5.0.1" gensequence "^6.0.0" -cspell-gitignore@8.1.2: - version "8.1.2" - resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-8.1.2.tgz#775dd36acc25219a296becb91329d88812ebe067" - integrity sha512-fytNCWAyd7oX5oDstx63pLf43YY43CvRWi5gi2E2EUj8VzzbfXwkCwBlIfjupoZ0HFk85LSy9ESVoJ7uO1Of9g== +cspell-gitignore@8.1.3: + version "8.1.3" + resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-8.1.3.tgz#1d2ec9dc8d97ea8291a197e5acf6d6b6c9634193" + integrity sha512-NHx5lg44eCKb6yJmUPOCz4prcuYowzoo5GJ5hOcCfbk7ZEBWV1E2/kDRuQMOK2W0y1hNGr45CSxO3UxWJlYg7w== dependencies: - cspell-glob "8.1.2" + cspell-glob "8.1.3" find-up-simple "^1.0.0" -cspell-glob@8.1.2: - version "8.1.2" - resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-8.1.2.tgz#4cdc38c0682d232f3c1c278385a928c0c3491695" - integrity sha512-fd4GVUhHMbikSIQjFrHJILPj7X6qfhnQYYMRLx3oIARhQAvbQpx6KzVVUKJ6yMP++dqLFBSs+9KIe/IJyRx5zw== +cspell-glob@8.1.3: + version "8.1.3" + resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-8.1.3.tgz#3eeecbf6ecbfab184107021fdf8691ce4e8fa6c5" + integrity sha512-Likr7UVUXBpthQnM5r6yao3X0YBNRbJ9AHWXTC2RJfzwZOFKF+pKPfeo3FU+Px8My96M4RC2bVMbrbZUwN5NJw== dependencies: micromatch "^4.0.5" -cspell-grammar@8.1.2: - version "8.1.2" - resolved "https://registry.yarnpkg.com/cspell-grammar/-/cspell-grammar-8.1.2.tgz#02bd5354bda13c5a80fbde9e2bba43bd93f04bfe" - integrity sha512-642YdsUWpGgAih7Dibrxa9g4+drC/DYWlGj0tiRWd9Ge93QC9Iz3344D3RBD11yXs7+uvCQcLCJBDK+49LGE8A== +cspell-grammar@8.1.3: + version "8.1.3" + resolved "https://registry.yarnpkg.com/cspell-grammar/-/cspell-grammar-8.1.3.tgz#8ee7d4cef92053c53b320ae105e64b771c73d21e" + integrity sha512-dTOwNq6a5wcVzOsi4xY5/tq2r2w/+wLVU+WfyySTsPe66Rjqx/QceFl4OinImks/ZMKF7Zyjd3WGyQ5TcSsJFQ== dependencies: - "@cspell/cspell-pipe" "8.1.2" - "@cspell/cspell-types" "8.1.2" + "@cspell/cspell-pipe" "8.1.3" + "@cspell/cspell-types" "8.1.3" -cspell-io@8.1.2: - version "8.1.2" - resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-8.1.2.tgz#ebc51bc1bebaf022e40cb9b3c96a5df79d22cf0a" - integrity sha512-4KUJd2Q8k9stb//iDHpORTBBz0uM8YHa8KA2iSUdJj4D6eA5nTLc0Vzt6y89MrUjPlkzk8kyV848McZfodQtRQ== +cspell-io@8.1.3: + version "8.1.3" + resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-8.1.3.tgz#57e99a78d998d5ab6a7a09468892174f1233b62b" + integrity sha512-QkcFeYd79oIl7PgSqFSZyvwXnZQhXmdCI733n54IN2+iXDcf7W0mwptxoC/cE19RkEwAwEFLG81UAy6L/BXI6A== dependencies: - "@cspell/cspell-service-bus" "8.1.2" + "@cspell/cspell-service-bus" "8.1.3" -cspell-lib@8.1.2: - version "8.1.2" - resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-8.1.2.tgz#b076ac234b812f61a10f863943494ef82af92d9f" - integrity sha512-UJjuaZ/ZXIXiWFVLGgVJu6VftWHujQaeUgjlQxePvAqI0QdzR9G5vsJ80BGaoldhhKyWxCCq/Gx6PaeWWNzJ5Q== +cspell-lib@8.1.3: + version "8.1.3" + resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-8.1.3.tgz#5c1f87c4adb2643baa510cf1bec083bd9145b5ab" + integrity sha512-Kk8bpHVkDZO4MEiPkDvRf/LgJ0h5mufbKLTWModq6k0Ca8EkZ/qgQlZ0ve0rIivbleSqebuWjpJHKDM+IHmzHA== dependencies: - "@cspell/cspell-bundled-dicts" "8.1.2" - "@cspell/cspell-pipe" "8.1.2" - "@cspell/cspell-resolver" "8.1.2" - "@cspell/cspell-types" "8.1.2" - "@cspell/dynamic-import" "8.1.2" - "@cspell/strong-weak-map" "8.1.2" + "@cspell/cspell-bundled-dicts" "8.1.3" + "@cspell/cspell-pipe" "8.1.3" + "@cspell/cspell-resolver" "8.1.3" + "@cspell/cspell-types" "8.1.3" + "@cspell/dynamic-import" "8.1.3" + "@cspell/strong-weak-map" "8.1.3" clear-module "^4.1.2" comment-json "^4.2.3" configstore "^6.0.0" - cspell-config-lib "8.1.2" - cspell-dictionary "8.1.2" - cspell-glob "8.1.2" - cspell-grammar "8.1.2" - cspell-io "8.1.2" - cspell-trie-lib "8.1.2" + cspell-config-lib "8.1.3" + cspell-dictionary "8.1.3" + cspell-glob "8.1.3" + cspell-grammar "8.1.3" + cspell-io "8.1.3" + cspell-trie-lib "8.1.3" fast-equals "^5.0.1" gensequence "^6.0.0" import-fresh "^3.3.0" @@ -541,31 +541,31 @@ cspell-lib@8.1.2: vscode-languageserver-textdocument "^1.0.11" vscode-uri "^3.0.8" -cspell-trie-lib@8.1.2: - version "8.1.2" - resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-8.1.2.tgz#8a42a2275ae179910a54caea4edf0470b55ff0a5" - integrity sha512-TfNRr8XI8ObHjSalnbeF256HyG+cHNDeQSSy5n0Y+UomaSo3Cyy7Z91+0WtND8hdw206jhKiqZqGtzf8ojniDg== +cspell-trie-lib@8.1.3: + version "8.1.3" + resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-8.1.3.tgz#0831429f898f816c301ac440dc1f2b199d51f7ba" + integrity sha512-EDSYU9MCtzPSJDrfvDrTKmc0rzl50Ehjg1c5rUCqn33p2LCRe/G8hW0FxXe0mxrZxrMO2b8l0PVSGlrCXCQ8RQ== dependencies: - "@cspell/cspell-pipe" "8.1.2" - "@cspell/cspell-types" "8.1.2" + "@cspell/cspell-pipe" "8.1.3" + "@cspell/cspell-types" "8.1.3" gensequence "^6.0.0" -cspell@^8.1.2: - version "8.1.2" - resolved "https://registry.yarnpkg.com/cspell/-/cspell-8.1.2.tgz#e1a220de8597ee136de8755e4c4e72185e2ea843" - integrity sha512-MOU+lwbzzXT1mcrLCYb9ecfPtquuys9RQy6KehU4S1Oub4715LiXct6+DqDt8NK6w4R3WRo9ixh1bnL3LoVEMw== +cspell@^8.1.3: + version "8.1.3" + resolved "https://registry.yarnpkg.com/cspell/-/cspell-8.1.3.tgz#c8643b86d7e06b69e7032bf2ddf3b27563f85c43" + integrity sha512-SU4Su6002bPoJYaiMeNV4wwLoS8TwaOgIwaTxhys3GDbJIxZV6CrDgwksezHcG7TZrC4yrveDVsdpnrzmQ7T5Q== dependencies: - "@cspell/cspell-json-reporter" "8.1.2" - "@cspell/cspell-pipe" "8.1.2" - "@cspell/cspell-types" "8.1.2" - "@cspell/dynamic-import" "8.1.2" + "@cspell/cspell-json-reporter" "8.1.3" + "@cspell/cspell-pipe" "8.1.3" + "@cspell/cspell-types" "8.1.3" + "@cspell/dynamic-import" "8.1.3" chalk "^5.3.0" chalk-template "^1.1.0" commander "^11.1.0" - cspell-gitignore "8.1.2" - cspell-glob "8.1.2" - cspell-io "8.1.2" - cspell-lib "8.1.2" + cspell-gitignore "8.1.3" + cspell-glob "8.1.3" + cspell-io "8.1.3" + cspell-lib "8.1.3" fast-glob "^3.3.2" fast-json-stable-stringify "^2.1.0" file-entry-cache "^7.0.2" From 00f7425d1dd7f888ffcba13ae3d60e0423674c42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 18:41:45 +0100 Subject: [PATCH 203/845] Bump Meziantou.Analyzer from 2.0.118 to 2.0.120 (#2510) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.118 to 2.0.120. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.118...2.0.120) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index f5edc41cfe..f6335c061c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 0fe6d0808e7f3fd58643c35569d2e2686d9a8341 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 18:42:28 +0100 Subject: [PATCH 204/845] Bump PolySharp from 1.13.2 to 1.14.0 (#2508) Bumps [PolySharp](https://github.com/Sergio0694/PolySharp) from 1.13.2 to 1.14.0. - [Release notes](https://github.com/Sergio0694/PolySharp/releases) - [Commits](https://github.com/Sergio0694/PolySharp/compare/1.13.2...1.14.0) --- updated-dependencies: - dependency-name: PolySharp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 677a2ee4e5..0da4a8e133 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -25,7 +25,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 7e95604196ef7d9a2b5019e5beb9a1fc788940f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 18:43:02 +0100 Subject: [PATCH 205/845] Bump PublicApiGenerator from 11.0.0 to 11.1.0 (#2509) Bumps [PublicApiGenerator](https://github.com/PublicApiGenerator/PublicApiGenerator) from 11.0.0 to 11.1.0. - [Release notes](https://github.com/PublicApiGenerator/PublicApiGenerator/releases) - [Commits](https://github.com/PublicApiGenerator/PublicApiGenerator/compare/11.0.0...11.1.0) --- updated-dependencies: - dependency-name: PublicApiGenerator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 250e1af477..49b09de19e 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -11,7 +11,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + From d4261b66d34eeb40a56b3aca05734a27bdd824f8 Mon Sep 17 00:00:00 2001 From: hybloid <48032702+hybloid@users.noreply.github.com> Date: Thu, 14 Dec 2023 10:10:29 +0100 Subject: [PATCH 206/845] Turn off RoslynAnalyzers in Qodana WF (#2504) * Create profile.yaml * Update qodana.yaml * Update profile.yaml * Update code_quality.yml * Update code_quality.yml --- .github/workflows/code_quality.yml | 2 +- profile.yaml | 12 ++++++++++++ qodana.yaml | 5 ++++- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 profile.yaml diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index 5071c42883..8c8478eef9 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.merge_commit_sha }} fetch-depth: 0 - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2023.2 + uses: JetBrains/qodana-action@v2023.3 with: upload-result: ${{ github.ref_name == 'master' || github.ref_name == 'develop' }} args: --baseline,qodana.sarif.json,--ide,QDNET diff --git a/profile.yaml b/profile.yaml new file mode 100644 index 0000000000..1e0a0d7d1d --- /dev/null +++ b/profile.yaml @@ -0,0 +1,12 @@ +name: "Custom profile" + +baseProfile: qodana.starter + +groups: # List of configured groups + - groupId: InspectionsToExclude + groups: + - "category:C#/Roslyn Analyzers" + +inspections: # Group invocation + - group: InspectionsToExclude + enabled: false # Disable the InspectionsToExclude group diff --git a/qodana.yaml b/qodana.yaml index ef2cb7ae4a..cb2072cee3 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,8 +1,11 @@ version: "1.0" -linter: jetbrains/qodana-dotnet:latest +ide: QDNET failThreshold: 20 +profile: + path: profile.yaml + dotnet: solution: FluentAssertions.sln From af4fce2ec0e30254b0e2c8e6068901e4962e4194 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Fri, 15 Dec 2023 10:34:39 +0100 Subject: [PATCH 207/845] Fix issue when an empty ArraySegment is a member of a class (#2511) * Fix issue when an empty ArraySegmnet is a member of a class. With latest, it crashes when trying to access the array members. * Fix PR comments. * Fix Qodana complaints * Update releases.md * Address review comments --------- Co-authored-by: Shahar Prish --- .../Steps/EnumerableEquivalencyStep.cs | 11 +++++++++-- .../BasicSpecs.cs | 16 ++++++++++++++++ docs/_pages/releases.md | 2 +- qodana.yaml | 1 + 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs index bb11a573f0..51e110041c 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs @@ -61,10 +61,17 @@ internal static object[] ToArray(object value) { return ((IEnumerable)value).Cast().ToArray(); } - catch (InvalidOperationException) when (value.GetType().Name.Equals("ImmutableArray`1", StringComparison.Ordinal)) + catch (InvalidOperationException) when (IsIgnorableArrayLikeType(value)) { - // This is probably a default ImmutableArray + // This is probably a default ImmutableArray or an empty ArraySegment. return Array.Empty(); } } + + private static bool IsIgnorableArrayLikeType(object value) + { + var type = value.GetType(); + return type.Name.Equals("ImmutableArray`1", StringComparison.Ordinal) || + (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(ArraySegment<>)); + } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs index d6754fb9f1..b33a110d42 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs @@ -645,4 +645,20 @@ public void When_the_graph_contains_guids_it_should_properly_format_them() // Assert act.Should().Throw().WithMessage("Expected property actual[0].Id*to be *-*, but found *-*"); } + + [Fact] + public void Empty_array_segments_can_be_compared_for_equivalency() + { + // Arrange + var actual = new ClassWithArraySegment(); + var expected = new ClassWithArraySegment(); + + // Act / Assert + actual.Should().BeEquivalentTo(expected); + } + + private class ClassWithArraySegment + { + public ArraySegment Segment { get; set; } + } } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 1a7e2bf760..3327e557b1 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -33,7 +33,7 @@ sidebar: * Improved the failure message for `[Not]HaveExplicitProperty` when wrapped in an `AssertionScope` and not implementing the interface - [#2403](https://github.com/fluentassertions/fluentassertions/pull/2403) * Improved the failure message for `[Not]HaveExplicitMethod` when wrapped in an `AssertionScope` and not implementing the interface - [#2403](https://github.com/fluentassertions/fluentassertions/pull/2403) * Changed `BeEquivalentTo` to exclude `private protected` members from the comparison - [#2417](https://github.com/fluentassertions/fluentassertions/pull/2417) - +* Fixed using `BeEquivalentTo` on an empty `ArraySegment` - [#2445](https://github.com/fluentassertions/fluentassertions/pull/2445), [#2511](https://github.com/fluentassertions/fluentassertions/pull/2511) ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) diff --git a/qodana.yaml b/qodana.yaml index cb2072cee3..0210df1b95 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -14,6 +14,7 @@ exclude: - name: ConvertIfStatementToConditionalTernaryExpression - name: InvertIf - name: SimilarAnonymousTypeNearby + - name: UnusedMember.Local paths: - Tests - name: All From aa18a02c2deea62ebd84b4ee5567c9a3d6dca5a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 15:59:29 +0000 Subject: [PATCH 208/845] Bump Bogus from 34.0.2 to 35.0.1 Bumps [Bogus](https://github.com/bchavez/Bogus) from 34.0.2 to 35.0.1. - [Release notes](https://github.com/bchavez/Bogus/releases) - [Changelog](https://github.com/bchavez/Bogus/blob/master/HISTORY.md) - [Commits](https://github.com/bchavez/Bogus/compare/v34.0.2...v35.0.1) --- updated-dependencies: - dependency-name: Bogus dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- Tests/Benchmarks/Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index c1233eb1cc..56d5c5d760 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -10,7 +10,7 @@ - + From 472abcc17b5fd55e8ac4314ccacfc53b32dc0b01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 15:58:55 +0000 Subject: [PATCH 209/845] Bump PolySharp from 1.14.0 to 1.14.1 Bumps [PolySharp](https://github.com/Sergio0694/PolySharp) from 1.14.0 to 1.14.1. - [Release notes](https://github.com/Sergio0694/PolySharp/releases) - [Commits](https://github.com/Sergio0694/PolySharp/compare/1.14.0...1.14.1) --- updated-dependencies: - dependency-name: PolySharp dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Src/FluentAssertions/FluentAssertions.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 67414d5c59..5346917822 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -47,7 +47,7 @@ - + diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 0da4a8e133..1ca2b05477 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -25,7 +25,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 0fd0d5a0a04befeaf26666010c4856003a80cb99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 16:02:54 +0000 Subject: [PATCH 210/845] Bump Meziantou.Analyzer from 2.0.120 to 2.0.123 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.120 to 2.0.123. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.120...2.0.123) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index f6335c061c..4d82587f35 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From fa9cd027ff8786b15cb9820c490d7d29a432a8c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 16:07:09 +0000 Subject: [PATCH 211/845] Bump actions/upload-artifact from 3 to 4 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 875d373bb2..bded11602b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,7 @@ jobs: file: TestResults/reports/lcov.info - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: ./Artifacts/* only-unit-tests: From ebf172dea722edf4f3885019d565546b73ffa238 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Thu, 21 Dec 2023 18:12:53 +0100 Subject: [PATCH 212/845] StyleCop.Analyzers 1.2.0-beta.507 -> 1.2.0-beta.556 This version has support for collection expressions --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 4d82587f35..1b5cfc07bf 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -22,7 +22,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From de664efa8c09d7a7c3cc6b9aad11a89741af180d Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Thu, 21 Dec 2023 18:16:47 +0100 Subject: [PATCH 213/845] Bump to C# 12 and .NET 8 analyzers --- Directory.Build.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 1b5cfc07bf..43c781e4b9 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 11.0 + 12.0 false true @@ -13,7 +13,7 @@ true - 7.0 + 8.0 All true From 39fb0ef52afe39e8829b0dfb9a9e43acd8972cdc Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Thu, 21 Dec 2023 18:11:58 +0100 Subject: [PATCH 214/845] Ignore CA1859 (for now) Rider and Roslyn analyzers conflict on this matter, so for now just silence CA1859 to get the solution to build. See e.g. https://youtrack.jetbrains.com/issue/RSRP-492496/ReturnTypeCanBeEnumerable-appears-to-behave-differently-to-CA1859-UseConcreteTypes --- .editorconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.editorconfig b/.editorconfig index 0d1a93930b..5432624a17 100644 --- a/.editorconfig +++ b/.editorconfig @@ -152,6 +152,8 @@ dotnet_diagnostic.CA1724.severity = none dotnet_diagnostic.CA1819.severity = none # CA1851: Possible multiple enumerations of IEnumerable collection. Related to GH-issue #2000 dotnet_diagnostic.CA1851.severity = suggestion +# CA1859: Use concrete types when possible for improved performance +dotnet_diagnostic.CA1859.severity = suggestion # CA1860: Avoid using 'Enumerable.Any()' extension method dotnet_diagnostic.CA1860.severity = warning # CA1861: Avoid constant arrays as arguments From 08194b2d16c01cdd5635f90f974c8392493f5f38 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 7 Nov 2023 15:01:17 +0100 Subject: [PATCH 215/845] Use collection expressions --- Build/Build.cs | 12 ++-- .../AggregateExceptionExtractor.cs | 2 +- .../CallerStatementBuilder.cs | 6 +- Src/FluentAssertions/CallerIdentifier.cs | 2 +- .../GenericCollectionAssertions.cs | 20 +++--- .../GenericDictionaryAssertions.cs | 4 +- .../MaximumMatching/MaximumMatchingProblem.cs | 4 +- .../MaximumMatching/MaximumMatchingSolver.cs | 8 +-- .../Collections/StringCollectionAssertions.cs | 2 +- .../Common/FullFrameworkReflector.cs | 4 +- Src/FluentAssertions/Common/Services.cs | 2 +- Src/FluentAssertions/Common/TypeExtensions.cs | 8 +-- .../Common/TypeMemberReflector.cs | 4 +- .../Equivalency/ConversionSelector.cs | 2 +- .../Equivalency/EqualityStrategyProvider.cs | 4 +- .../Execution/CyclicReferenceDetector.cs | 2 +- .../Equivalency/OrderingRuleCollection.cs | 2 +- .../SelfReferenceEquivalencyOptions.cs | 8 +-- .../Equivalency/Steps/AssertionResultSet.cs | 4 +- .../Steps/DictionaryInterfaceInfo.cs | 4 +- .../Steps/EnumerableEquivalencyStep.cs | 2 +- .../Steps/EnumerableEquivalencyValidator.cs | 3 +- .../Steps/GenericDictionaryEquivalencyStep.cs | 2 +- .../Steps/GenericEnumerableEquivalencyStep.cs | 6 +- .../StructuralEqualityEquivalencyStep.cs | 2 +- .../Tracing/StringBuilderTraceWriter.cs | 2 +- Src/FluentAssertions/EquivalencyPlan.cs | 6 +- Src/FluentAssertions/Events/EventRecorder.cs | 2 +- .../Execution/CollectingAssertionStrategy.cs | 2 +- .../Execution/ContextDataItems.cs | 2 +- .../Execution/DefaultAssertionStrategy.cs | 13 +--- .../Execution/MessageBuilder.cs | 2 +- .../Formatting/AttributeBasedFormatter.cs | 2 +- .../Formatting/FormattedObjectGraph.cs | 4 +- Src/FluentAssertions/Formatting/Formatter.cs | 8 +-- ...PredicateLambdaExpressionValueFormatter.cs | 2 +- .../Formatting/XElementValueFormatter.cs | 2 +- .../Specialized/AsyncFunctionAssertions.cs | 8 +-- .../Specialized/DelegateAssertions.cs | 6 +- .../Types/AssemblyAssertions.cs | 2 +- .../Types/MemberInfoAssertions.cs | 2 +- .../Types/MethodInfoSelector.cs | 2 +- .../Types/PropertyInfoSelector.cs | 2 +- Src/FluentAssertions/Types/TypeAssertions.cs | 4 +- Src/FluentAssertions/Types/TypeSelector.cs | 2 +- Src/FluentAssertions/Xml/Equivalency/Node.cs | 2 +- .../Xml/XDocumentAssertions.cs | 2 +- .../Xml/XElementAssertions.cs | 2 +- .../BasicSpecs.cs | 16 ++--- .../CollectionSpecs.cs | 26 +++---- .../DictionarySpecs.cs | 8 +-- .../EnumSpecs.cs | 2 +- .../MemberMatchingSpecs.cs | 60 ++++++++-------- .../NestedPropertiesSpecs.cs | 4 +- .../RecordSpecs.cs | 24 +++---- .../TupleSpecs.cs | 4 +- .../AndWhichConstraintSpecs.cs | 2 +- .../AssertionExtensionsSpecs.cs | 4 +- ...lectionAssertionSpecs.AllBeAssignableTo.cs | 16 ++--- .../CollectionAssertionSpecs.AllBeOfType.cs | 14 ++-- .../CollectionAssertionSpecs.AllSatisfy.cs | 10 +-- .../CollectionAssertionSpecs.BeEmpty.cs | 6 +- ...CollectionAssertionSpecs.BeEquivalentTo.cs | 46 ++++++------ ...ectionAssertionSpecs.BeInAscendingOrder.cs | 70 +++++++++---------- ...ctionAssertionSpecs.BeInDescendingOrder.cs | 40 +++++------ .../CollectionAssertionSpecs.BeNullOrEmpty.cs | 4 +- .../CollectionAssertionSpecs.BeSubsetOf.cs | 32 ++++----- .../CollectionAssertionSpecs.Contain.cs | 64 ++++++++--------- ...ctionAssertionSpecs.ContainEquivalentOf.cs | 18 ++--- ...ssertionSpecs.ContainInConsecutiveOrder.cs | 50 ++++++------- ...CollectionAssertionSpecs.ContainInOrder.cs | 34 ++++----- ...AssertionSpecs.ContainItemsAssignableTo.cs | 2 +- .../CollectionAssertionSpecs.ContainSingle.cs | 22 +++--- .../CollectionAssertionSpecs.EndWith.cs | 2 +- .../CollectionAssertionSpecs.Equal.cs | 64 ++++++++--------- .../CollectionAssertionSpecs.HaveCount.cs | 28 ++++---- ...tionAssertionSpecs.HaveCountGreaterThan.cs | 6 +- ...tionSpecs.HaveCountGreaterThanOrEqualTo.cs | 8 +-- ...lectionAssertionSpecs.HaveCountLessThan.cs | 6 +- ...sertionSpecs.HaveCountLessThanOrEqualTo.cs | 8 +-- .../CollectionAssertionSpecs.HaveElementAt.cs | 6 +- .../CollectionAssertionSpecs.HaveSameCount.cs | 34 ++++----- .../CollectionAssertionSpecs.IntersectWith.cs | 22 +++--- ...ertionSpecs.NotContainItemsAssignableTo.cs | 6 +- ...ollectionAssertionSpecs.NotContainNulls.cs | 4 +- .../CollectionAssertionSpecs.OnlyContain.cs | 8 +-- ...ctionAssertionSpecs.OnlyHaveUniqueItems.cs | 12 ++-- .../CollectionAssertionSpecs.Satisfy.cs | 18 ++--- ...ctionAssertionSpecs.SatisfyRespectively.cs | 14 ++-- .../CollectionAssertionSpecs.StartWith.cs | 2 +- .../Collections/CollectionAssertionSpecs.cs | 2 +- ...ectionAssertionOfStringSpecs.AllSatisfy.cs | 4 +- ...onAssertionOfStringSpecs.BeEquivalentTo.cs | 4 +- ...ectionAssertionOfStringSpecs.BeSubsetOf.cs | 2 +- ...tionAssertionOfStringSpecs.ContainMatch.cs | 2 +- ...ertionOfStringSpecs.SatisfyRespectively.cs | 4 +- ...GenericDictionaryAssertionSpecs.Contain.cs | 16 ++--- ...ricDictionaryAssertionSpecs.ContainKeys.cs | 10 +-- ...cDictionaryAssertionSpecs.HaveSameCount.cs | 16 ++--- .../GenericDictionaryAssertionSpecs.cs | 8 +-- .../CulturedFactAttributeDiscoverer.cs | 4 +- .../CulturedTheoryAttributeDiscoverer.cs | 4 +- .../Events/EventAssertionSpecs.cs | 2 +- .../Execution/AssertionScopeSpecs.cs | 2 +- .../Extensions/ObjectExtensionsSpecs.cs | 12 ++-- .../Formatting/FormatterSpecs.cs | 18 ++--- .../MultidimensionalArrayFormatterSpecs.cs | 6 +- ...cateLambdaExpressionValueFormatterSpecs.cs | 2 +- .../Numeric/NumericAssertionSpecs.BeOneOf.cs | 2 +- .../Primitives/EnumAssertionSpecs.cs | 2 +- .../ObjectAssertionSpecs.BeOneOf.cs | 10 +-- .../StringAssertionSpecs.ContainAll.cs | 4 +- .../StringAssertionSpecs.ContainAny.cs | 4 +- .../TypeEnumerableExtensionsSpecs.cs | 18 ++--- .../Types/MethodInfoAssertionSpecs.cs | 2 +- .../TypeAssertionSpecs.HaveConstructor.cs | 12 ++-- .../Types/TypeAssertionSpecs.HaveIndexer.cs | 16 ++--- .../Types/TypeAssertionSpecs.HaveMethod.cs | 24 +++---- .../Types/TypeExtensionsSpecs.cs | 2 +- .../Types/TypeSelectorSpecs.cs | 6 +- 120 files changed, 618 insertions(+), 628 deletions(-) diff --git a/Build/Build.cs b/Build/Build.cs index 6110d6c3b4..f49eedb083 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -99,7 +99,7 @@ class Build : NukeBuild "Branch spec {branchspec} is a pull request. Adding build number {buildnumber}", BranchSpec, BuildNumber); - SemVer = string.Join('.', GitVersion.SemVer.Split('.').Take(3).Union(new[] { BuildNumber })); + SemVer = string.Join('.', GitVersion.SemVer.Split('.').Take(3).Union([BuildNumber])); } Information("SemVer = {semver}", SemVer); @@ -159,14 +159,14 @@ class Build : NukeBuild ReportTestOutcome(globFilters: $"*{project.Name}.trx"); }); - Project[] Projects => new[] - { + Project[] Projects => + [ Solution.Specs.FluentAssertions_Specs, Solution.Specs.FluentAssertions_Equivalency_Specs, Solution.Specs.FluentAssertions_Extensibility_Specs, Solution.Specs.FSharp_Specs, Solution.Specs.VB_Specs - }; + ]; Target UnitTestsNet47 => _ => _ .Unlisted() @@ -209,7 +209,7 @@ class Build : NukeBuild (settings, project) => settings .SetProjectFile(project) .CombineWith( - project.GetTargetFrameworks().Except(new[] { net47 }), + project.GetTargetFrameworks().Except([net47]), (frameworkSettings, framework) => frameworkSettings .SetFramework(framework) .AddLoggers($"trx;LogFileName={project.Name}_{framework}.trx") @@ -284,7 +284,7 @@ void ReportTestOutcome(params string[] globFilters) var testCombinations = from project in projects let frameworks = project.GetTargetFrameworks() - let supportedFrameworks = EnvironmentInfo.IsWin ? frameworks : frameworks.Except(new[] { "net47" }) + let supportedFrameworks = EnvironmentInfo.IsWin ? frameworks : frameworks.Except(["net47"]) from framework in supportedFrameworks select new { project, framework }; diff --git a/Src/FluentAssertions/AggregateExceptionExtractor.cs b/Src/FluentAssertions/AggregateExceptionExtractor.cs index b94e03e7fc..9f697b2776 100644 --- a/Src/FluentAssertions/AggregateExceptionExtractor.cs +++ b/Src/FluentAssertions/AggregateExceptionExtractor.cs @@ -13,7 +13,7 @@ public IEnumerable OfType(Exception actualException) { if (typeof(T).IsSameOrInherits(typeof(AggregateException))) { - return actualException is T exception ? new[] { exception } : Enumerable.Empty(); + return actualException is T exception ? [exception] : []; } return GetExtractedExceptions(actualException); diff --git a/Src/FluentAssertions/CallerIdentification/CallerStatementBuilder.cs b/Src/FluentAssertions/CallerIdentification/CallerStatementBuilder.cs index 75f4ff0f18..7f922f2009 100644 --- a/Src/FluentAssertions/CallerIdentification/CallerStatementBuilder.cs +++ b/Src/FluentAssertions/CallerIdentification/CallerStatementBuilder.cs @@ -14,8 +14,8 @@ internal CallerStatementBuilder() { statement = new StringBuilder(); - priorityOrderedParsingStrategies = new List - { + priorityOrderedParsingStrategies = + [ new QuotesParsingStrategy(), new MultiLineCommentParsingStrategy(), new SingleLineCommentParsingStrategy(), @@ -23,7 +23,7 @@ internal CallerStatementBuilder() new ShouldCallParsingStrategy(), new AwaitParsingStrategy(), new AddNonEmptySymbolParsingStrategy() - }; + ]; } internal void Append(string symbols) diff --git a/Src/FluentAssertions/CallerIdentifier.cs b/Src/FluentAssertions/CallerIdentifier.cs index 23ff3854b3..fc815fc972 100644 --- a/Src/FluentAssertions/CallerIdentifier.cs +++ b/Src/FluentAssertions/CallerIdentifier.cs @@ -268,7 +268,7 @@ private static StackFrame[] GetFrames(StackTrace stack) #if !NET6_0_OR_GREATER if (frames == null) { - return Array.Empty(); + return []; } #endif return frames diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index fd2b8bfa97..d9e836c44c 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -71,7 +71,7 @@ public AndWhichConstraint> AllBeAssignabl .FailWith("Expected type to be {0}{reason}, but found {context:the collection} is .", typeof(TExpectation).FullName); - IEnumerable matches = Enumerable.Empty(); + IEnumerable matches = []; if (success) { @@ -218,7 +218,7 @@ public AndWhichConstraint> AllBeOfType.", typeof(TExpectation).FullName); - IEnumerable matches = Enumerable.Empty(); + IEnumerable matches = []; if (success) { @@ -701,7 +701,7 @@ public AndWhichConstraint Contain(T expected, string because = " .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to contain {0}{reason}, but found .", expected); - IEnumerable matches = Enumerable.Empty(); + IEnumerable matches = []; if (success) { @@ -740,7 +740,7 @@ public AndWhichConstraint Contain(Expression> pred .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to contain {0}{reason}, but found .", predicate.Body); - IEnumerable matches = Enumerable.Empty(); + IEnumerable matches = []; if (success) { @@ -1204,7 +1204,7 @@ public AndWhichConstraint ContainSingle(Expression .ForCondition(Subject is not null) .FailWith(expectationPrefix + "but found .", predicate); - T[] matches = Array.Empty(); + T[] matches = []; if (success) { @@ -1304,7 +1304,7 @@ public AndConstraint EndWith( /// public AndConstraint EndWith(T element, string because = "", params object[] becauseArgs) { - return EndWith(new[] { element }, ObjectExtensions.GetComparer(), because, becauseArgs); + return EndWith([element], ObjectExtensions.GetComparer(), because, becauseArgs); } /// @@ -2182,7 +2182,7 @@ public AndWhichConstraint NotContain(T unexpected, string becaus .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to not contain {0}{reason}, but found .", unexpected); - IEnumerable matched = Enumerable.Empty(); + IEnumerable matched = []; if (success) { @@ -3259,7 +3259,7 @@ public AndConstraint StartWith( /// public AndConstraint StartWith(T element, string because = "", params object[] becauseArgs) { - return StartWith(new[] { element }, ObjectExtensions.GetComparer(), because, becauseArgs); + return StartWith([element], ObjectExtensions.GetComparer(), because, becauseArgs); } internal AndConstraint> BeOrderedBy( @@ -3312,7 +3312,7 @@ protected static IEnumerable RepeatAsManyAs(TExpecta { if (enumerable is null) { - return Enumerable.Empty(); + return []; } return RepeatAsManyAsIterator(value, enumerable); @@ -3534,7 +3534,7 @@ private AndConstraint> BeInOrder( .ForCondition(Subject is not null) .FailWith($"Expected {{context:collection}} to be in {sortOrder} order{{reason}}, but found ."); - IOrderedEnumerable ordering = new List(0).OrderBy(x => x); + IOrderedEnumerable ordering = Array.Empty().OrderBy(x => x); if (success) { diff --git a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs index 5f758f5734..f0b65a1b93 100644 --- a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs @@ -255,7 +255,7 @@ public AndConstraint BeEquivalentTo(TExpectation expe public WhoseValueConstraint ContainKey(TKey expected, string because = "", params object[] becauseArgs) { - AndConstraint andConstraint = ContainKeys(new[] { expected }, because, becauseArgs); + AndConstraint andConstraint = ContainKeys([expected], because, becauseArgs); _ = TryGetValue(Subject, expected, out TValue value); @@ -447,7 +447,7 @@ public AndWhichConstraint ContainValue(TValue expected, string because = "", params object[] becauseArgs) { AndWhichConstraint> innerConstraint = - ContainValuesAndWhich(new[] { expected }, because, becauseArgs); + ContainValuesAndWhich([expected], because, becauseArgs); return new AndWhichConstraint( diff --git a/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingProblem.cs b/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingProblem.cs index 23110182a8..b5955cbe83 100644 --- a/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingProblem.cs +++ b/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingProblem.cs @@ -23,9 +23,9 @@ public MaximumMatchingProblem( Elements.AddRange(elements.Select((element, index) => new Element(element, index))); } - public List> Predicates { get; } = new(); + public List> Predicates { get; } = []; - public List> Elements { get; } = new(); + public List> Elements { get; } = []; public MaximumMatchingSolution Solve() => new MaximumMatchingSolver(this).Solve(); } diff --git a/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingSolver.cs b/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingSolver.cs index b096f61c99..8bf25ee394 100644 --- a/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingSolver.cs +++ b/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingSolver.cs @@ -14,7 +14,7 @@ namespace FluentAssertions.Collections.MaximumMatching; internal class MaximumMatchingSolver { private readonly MaximumMatchingProblem problem; - private readonly Dictionary, List>> matchingElementsByPredicate = new(); + private readonly Dictionary, List>> matchingElementsByPredicate = []; public MaximumMatchingSolver(MaximumMatchingProblem problem) { @@ -76,7 +76,7 @@ private IEnumerable FindMatchForPredicate(Predicate predicate, Ma } } - return Enumerable.Empty(); + return []; } private List> GetMatchingElements(Predicate predicate) @@ -98,7 +98,7 @@ private struct Match private sealed class MatchCollection : IEnumerable { - private readonly Dictionary, Match> matchesByElement = new(); + private readonly Dictionary, Match> matchesByElement = []; public void UpdateFrom(IEnumerable matches) { @@ -123,7 +123,7 @@ public Predicate GetMatchedPredicate(Element element) private sealed class BreadthFirstSearchTracker { private readonly Queue> unmatchedPredicatesQueue = new(); - private readonly Dictionary, Match> previousMatchByPredicate = new(); + private readonly Dictionary, Match> previousMatchByPredicate = []; private readonly MatchCollection originalMatches; diff --git a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs index 6a3d0ac7c3..0dcd616cf5 100644 --- a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs @@ -253,7 +253,7 @@ public AndWhichConstraint ContainMatch(string wildcardPatte .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to contain a match of {0}{reason}, but found .", wildcardPattern); - IEnumerable matched = new List(0); + IEnumerable matched = []; if (success) { diff --git a/Src/FluentAssertions/Common/FullFrameworkReflector.cs b/Src/FluentAssertions/Common/FullFrameworkReflector.cs index 3c54cbe1d3..f9fba7a4a8 100644 --- a/Src/FluentAssertions/Common/FullFrameworkReflector.cs +++ b/Src/FluentAssertions/Common/FullFrameworkReflector.cs @@ -47,11 +47,11 @@ private static IEnumerable GetExportedTypes(Assembly assembly) } catch (FileLoadException) { - return Enumerable.Empty(); + return []; } catch (Exception) { - return Array.Empty(); + return []; } } } diff --git a/Src/FluentAssertions/Common/Services.cs b/Src/FluentAssertions/Common/Services.cs index a20c7562a7..551b09f2d2 100644 --- a/Src/FluentAssertions/Common/Services.cs +++ b/Src/FluentAssertions/Common/Services.cs @@ -76,7 +76,7 @@ private static void ExecuteCustomInitializers() var currentAssembly = Assembly.GetExecutingAssembly(); var currentAssemblyName = currentAssembly.GetName(); - var attributes = Array.Empty(); + AssertionEngineInitializerAttribute[] attributes = []; try { diff --git a/Src/FluentAssertions/Common/TypeExtensions.cs b/Src/FluentAssertions/Common/TypeExtensions.cs index a84af752ad..63b9ea6146 100644 --- a/Src/FluentAssertions/Common/TypeExtensions.cs +++ b/Src/FluentAssertions/Common/TypeExtensions.cs @@ -152,7 +152,7 @@ public static Type[] GetClosedGenericInterfaces(this Type type, Type openGeneric { if (type.IsGenericType && type.GetGenericTypeDefinition() == openGenericType) { - return new[] { type }; + return [type]; } Type[] interfaces = type.GetInterfaces(); @@ -166,7 +166,7 @@ public static Type[] GetClosedGenericInterfaces(this Type type, Type openGeneric public static bool OverridesEquals(this Type type) { MethodInfo method = type - .GetMethod("Equals", new[] { typeof(object) }); + .GetMethod("Equals", [typeof(object)]); return method is not null && method.GetBaseDefinition().DeclaringType != method.DeclaringType; @@ -499,9 +499,9 @@ private static bool IsRecordStruct(this Type type) // and heuristic testing, apparently giving good results but not supported by official documentation. return type.BaseType == typeof(ValueType) && type.GetMethod("PrintMembers", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly, null, - new[] { typeof(StringBuilder) }, null) is { } && + [typeof(StringBuilder)], null) is { } && type.GetMethod("op_Equality", BindingFlags.Static | BindingFlags.Public | BindingFlags.DeclaredOnly, null, - new[] { type, type }, null)? + [type, type], null)? .IsDecoratedWith() == true; } diff --git a/Src/FluentAssertions/Common/TypeMemberReflector.cs b/Src/FluentAssertions/Common/TypeMemberReflector.cs index ea65969cdf..5f1d685f64 100644 --- a/Src/FluentAssertions/Common/TypeMemberReflector.cs +++ b/Src/FluentAssertions/Common/TypeMemberReflector.cs @@ -113,7 +113,7 @@ private static List GetInterfaceMembers(Type typeToRef Func> getMembers) where TMemberInfo : MemberInfo { - List members = new(); + List members = []; var considered = new List(); var queue = new Queue(); @@ -149,7 +149,7 @@ private static List GetClassMembers(Type typeToReflect Func> getMembers) where TMemberInfo : MemberInfo { - List members = new(); + List members = []; while (typeToReflect != null) { diff --git a/Src/FluentAssertions/Equivalency/ConversionSelector.cs b/Src/FluentAssertions/Equivalency/ConversionSelector.cs index d93c92fe9b..c2985fcae1 100644 --- a/Src/FluentAssertions/Equivalency/ConversionSelector.cs +++ b/Src/FluentAssertions/Equivalency/ConversionSelector.cs @@ -30,7 +30,7 @@ public ConversionSelectorRule(Func predicate, string descript private readonly List exclusions; public ConversionSelector() - : this(new List(), new List()) + : this([], []) { } diff --git a/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs b/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs index 21903e2cd2..57d58d62d7 100644 --- a/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs +++ b/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs @@ -10,8 +10,8 @@ namespace FluentAssertions.Equivalency; internal sealed class EqualityStrategyProvider { - private readonly List referenceTypes = new(); - private readonly List valueTypes = new(); + private readonly List referenceTypes = []; + private readonly List valueTypes = []; private readonly ConcurrentDictionary typeCache = new(); [CanBeNull] diff --git a/Src/FluentAssertions/Equivalency/Execution/CyclicReferenceDetector.cs b/Src/FluentAssertions/Equivalency/Execution/CyclicReferenceDetector.cs index 626e0367c5..600823aee9 100644 --- a/Src/FluentAssertions/Equivalency/Execution/CyclicReferenceDetector.cs +++ b/Src/FluentAssertions/Equivalency/Execution/CyclicReferenceDetector.cs @@ -11,7 +11,7 @@ internal class CyclicReferenceDetector : ICloneable2 { #region Private Definitions - private HashSet observedReferences = new(); + private HashSet observedReferences = []; #endregion diff --git a/Src/FluentAssertions/Equivalency/OrderingRuleCollection.cs b/Src/FluentAssertions/Equivalency/OrderingRuleCollection.cs index 5b6395b6c3..645bba4ad2 100644 --- a/Src/FluentAssertions/Equivalency/OrderingRuleCollection.cs +++ b/Src/FluentAssertions/Equivalency/OrderingRuleCollection.cs @@ -9,7 +9,7 @@ namespace FluentAssertions.Equivalency; /// public class OrderingRuleCollection : IEnumerable { - private readonly List rules = new(); + private readonly List rules = []; /// /// Initializes a new collection of ordering rules. diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index db6097d3b8..d6ded7a071 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -28,19 +28,19 @@ public abstract class SelfReferenceEquivalencyOptions : IEquivalencyOptio private readonly EqualityStrategyProvider equalityStrategyProvider; [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private readonly List selectionRules = new(); + private readonly List selectionRules = []; [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private readonly List matchingRules = new(); + private readonly List matchingRules = []; [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private readonly List userEquivalencySteps = new(); + private readonly List userEquivalencySteps = []; [DebuggerBrowsable(DebuggerBrowsableState.Never)] private CyclicReferenceHandling cyclicReferenceHandling = CyclicReferenceHandling.ThrowException; [DebuggerBrowsable(DebuggerBrowsableState.Never)] - protected OrderingRuleCollection OrderingRules { get; } = new(); + protected OrderingRuleCollection OrderingRules { get; } = []; [DebuggerBrowsable(DebuggerBrowsableState.Never)] private bool isRecursive; diff --git a/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs b/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs index f7bae2311d..c6ea007df9 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs @@ -10,7 +10,7 @@ namespace FluentAssertions.Equivalency.Steps; /// internal class AssertionResultSet { - private readonly Dictionary set = new(); + private readonly Dictionary set = []; /// /// Adds the failures (if any) resulting from executing an assertion within a @@ -33,7 +33,7 @@ public string[] SelectClosestMatchFor(object key = null) { if (ContainsSuccessfulSet()) { - return Array.Empty(); + return []; } KeyValuePair[] bestResultSets = GetBestResultSets(); diff --git a/Src/FluentAssertions/Equivalency/Steps/DictionaryInterfaceInfo.cs b/Src/FluentAssertions/Equivalency/Steps/DictionaryInterfaceInfo.cs index bbe431fc26..f24ac8a726 100644 --- a/Src/FluentAssertions/Equivalency/Steps/DictionaryInterfaceInfo.cs +++ b/Src/FluentAssertions/Equivalency/Steps/DictionaryInterfaceInfo.cs @@ -94,7 +94,7 @@ private static DictionaryInterfaceInfo[] GetDictionaryInterfacesFrom(Type target { if (Type.GetTypeCode(key) != TypeCode.Object) { - return Array.Empty(); + return []; } return key @@ -125,7 +125,7 @@ public object ConvertFrom(object convertable) Type pairValueType = suitableKeyValuePairCollection.GenericTypeArguments[^1]; var methodInfo = ConvertToDictionaryMethod.MakeGenericMethod(Key, pairValueType); - return methodInfo.Invoke(null, new[] { convertable }); + return methodInfo.Invoke(null, [convertable]); } return null; diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs index 51e110041c..996224f5aa 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs @@ -64,7 +64,7 @@ internal static object[] ToArray(object value) catch (InvalidOperationException) when (IsIgnorableArrayLikeType(value)) { // This is probably a default ImmutableArray or an empty ArraySegment. - return Array.Empty(); + return []; } } diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs index 4231b55890..f9005628be 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs @@ -76,8 +76,7 @@ private static Continuation AssertCollectionsHaveSameCount(ICollection(object[] subjects, T[] expectations, INode currentNode) { - unmatchedSubjectIndexes = new List(subjects.Length); - unmatchedSubjectIndexes.AddRange(Enumerable.Range(0, subjects.Length)); + unmatchedSubjectIndexes = Enumerable.Range(0, subjects.Length).ToList(); if (OrderingRules.IsOrderingStrictFor(new ObjectInfo(new Comparands(subjects, expectations, typeof(T[])), currentNode))) { diff --git a/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs index 1290cc5b59..e642b4b40a 100644 --- a/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs @@ -152,7 +152,7 @@ private static void AssertDictionaryEquivalence(Comparands comparands, IEquivale { AssertDictionaryEquivalenceMethod .MakeGenericMethod(actualDictionary.Key, actualDictionary.Value, expectedDictionary.Key, expectedDictionary.Value) - .Invoke(null, new[] { context, parent, context.Options, comparands.Subject, comparands.Expectation }); + .Invoke(null, [context, parent, context.Options, comparands.Subject, comparands.Expectation]); } private static void AssertDictionaryEquivalence( diff --git a/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs index 1830ec61a0..a8853b1380 100644 --- a/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs @@ -48,7 +48,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon try { HandleMethod.MakeGenericMethod(typeOfEnumeration) - .Invoke(null, new[] { validator, subjectAsArray, comparands.Expectation }); + .Invoke(null, [validator, subjectAsArray, comparands.Expectation]); } catch (TargetInvocationException e) { @@ -95,7 +95,7 @@ private static Type[] GetIEnumerableInterfaces(Type type) // Avoid expensive calculation when the type in question can't possibly implement IEnumerable<>. if (Type.GetTypeCode(type) != TypeCode.Object) { - return Array.Empty(); + return []; } Type soughtType = typeof(IEnumerable<>); @@ -119,7 +119,7 @@ private static T[] ToArray(IEnumerable value) catch (InvalidOperationException) when (value.GetType().Name.Equals("ImmutableArray`1", StringComparison.Ordinal)) { // This is probably a default ImmutableArray - return Array.Empty(); + return []; } } } diff --git a/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs index ddb0e3dfb7..2f3eb9abcf 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs @@ -97,7 +97,7 @@ where match is not null private static IEnumerable GetMembersFromExpectation(INode currentNode, Comparands comparands, IEquivalencyOptions options) { - IEnumerable members = Enumerable.Empty(); + IEnumerable members = []; foreach (IMemberSelectionRule rule in options.SelectionRules) { diff --git a/Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs b/Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs index cb1047defc..9e6fcd72f7 100644 --- a/Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs +++ b/Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs @@ -28,7 +28,7 @@ public IDisposable AddBlock(string trace) private void WriteLine(string trace) { - foreach (string traceLine in trace.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries)) + foreach (string traceLine in trace.Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries)) { builder.Append(new string(' ', depth * 2)).AppendLine(traceLine); } diff --git a/Src/FluentAssertions/EquivalencyPlan.cs b/Src/FluentAssertions/EquivalencyPlan.cs index 59e241da60..13ee80b49c 100644 --- a/Src/FluentAssertions/EquivalencyPlan.cs +++ b/Src/FluentAssertions/EquivalencyPlan.cs @@ -139,8 +139,8 @@ public void Reset() private static List GetDefaultSteps() { - return new List(18) - { + return + [ new RunAllUserStepsEquivalencyStep(), new AutoConversionStep(), new ReferenceEqualityEquivalencyStep(), @@ -157,6 +157,6 @@ private static List GetDefaultSteps() new ValueTypeEquivalencyStep(), new StructuralEqualityEquivalencyStep(), new SimpleEqualityEquivalencyStep(), - }; + ]; } } diff --git a/Src/FluentAssertions/Events/EventRecorder.cs b/Src/FluentAssertions/Events/EventRecorder.cs index 11933f1fd2..768449083e 100644 --- a/Src/FluentAssertions/Events/EventRecorder.cs +++ b/Src/FluentAssertions/Events/EventRecorder.cs @@ -15,7 +15,7 @@ namespace FluentAssertions.Events; internal sealed class EventRecorder : IEventRecording, IDisposable { private readonly Func utcNow; - private readonly BlockingCollection raisedEvents = new(); + private readonly BlockingCollection raisedEvents = []; private readonly object lockable = new(); private Action cleanup; diff --git a/Src/FluentAssertions/Execution/CollectingAssertionStrategy.cs b/Src/FluentAssertions/Execution/CollectingAssertionStrategy.cs index 9a9394c63b..96b801d73f 100644 --- a/Src/FluentAssertions/Execution/CollectingAssertionStrategy.cs +++ b/Src/FluentAssertions/Execution/CollectingAssertionStrategy.cs @@ -9,7 +9,7 @@ namespace FluentAssertions.Execution; internal class CollectingAssertionStrategy : IAssertionStrategy { - private readonly List failureMessages = new(); + private readonly List failureMessages = []; /// /// Returns the messages for the assertion failures that happened until now. diff --git a/Src/FluentAssertions/Execution/ContextDataItems.cs b/Src/FluentAssertions/Execution/ContextDataItems.cs index 519200f7e4..6ddf42eba4 100644 --- a/Src/FluentAssertions/Execution/ContextDataItems.cs +++ b/Src/FluentAssertions/Execution/ContextDataItems.cs @@ -9,7 +9,7 @@ namespace FluentAssertions.Execution; /// internal class ContextDataItems { - private readonly List items = new(); + private readonly List items = []; public IDictionary GetReportable() { diff --git a/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs b/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs index 3af8859666..229277eb9f 100644 --- a/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs +++ b/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs @@ -9,13 +9,7 @@ internal class DefaultAssertionStrategy : IAssertionStrategy /// /// Returns the messages for the assertion failures that happened until now. /// - public IEnumerable FailureMessages - { - get - { - return Array.Empty(); - } - } + public IEnumerable FailureMessages => []; /// /// Instructs the strategy to handle a assertion failure. @@ -28,10 +22,7 @@ public void HandleFailure(string message) /// /// Discards and returns the failure messages that happened up to now. /// - public IEnumerable DiscardFailures() - { - return Array.Empty(); - } + public IEnumerable DiscardFailures() => []; /// /// Will throw a combined exception for any failures have been collected. diff --git a/Src/FluentAssertions/Execution/MessageBuilder.cs b/Src/FluentAssertions/Execution/MessageBuilder.cs index 27f1b82e2a..faecdcb59b 100644 --- a/Src/FluentAssertions/Execution/MessageBuilder.cs +++ b/Src/FluentAssertions/Execution/MessageBuilder.cs @@ -20,7 +20,7 @@ internal class MessageBuilder #region Private Definitions - private readonly char[] blanks = { '\r', '\n', ' ', '\t' }; + private readonly char[] blanks = ['\r', '\n', ' ', '\t']; #endregion diff --git a/Src/FluentAssertions/Formatting/AttributeBasedFormatter.cs b/Src/FluentAssertions/Formatting/AttributeBasedFormatter.cs index e76edb2b34..430b8241d1 100644 --- a/Src/FluentAssertions/Formatting/AttributeBasedFormatter.cs +++ b/Src/FluentAssertions/Formatting/AttributeBasedFormatter.cs @@ -36,7 +36,7 @@ public void Format(object value, FormattedObjectGraph formattedGraph, Formatting { MethodInfo method = GetFormatter(value); - object[] parameters = { value, formattedGraph }; + object[] parameters = [value, formattedGraph]; method.Invoke(null, parameters); } diff --git a/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs b/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs index b668e290b8..b551d31495 100644 --- a/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs +++ b/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs @@ -18,7 +18,7 @@ namespace FluentAssertions.Formatting; public class FormattedObjectGraph { private readonly int maxLines; - private readonly List lines = new(); + private readonly List lines = []; private readonly StringBuilder lineBuilder = new(); private int indentation; private string lineBuilderWhitespace = string.Empty; @@ -148,7 +148,7 @@ public IDisposable WithIndentation() /// public override string ToString() { - return string.Join(Environment.NewLine, lines.Concat(new[] { lineBuilder.ToString() })); + return string.Join(Environment.NewLine, lines.Concat([lineBuilder.ToString()])); } internal PossibleMultilineFragment KeepOnSingleLineAsLongAsPossible() diff --git a/Src/FluentAssertions/Formatting/Formatter.cs b/Src/FluentAssertions/Formatting/Formatter.cs index 90e79192c9..c87add95ed 100644 --- a/Src/FluentAssertions/Formatting/Formatter.cs +++ b/Src/FluentAssertions/Formatting/Formatter.cs @@ -16,10 +16,10 @@ public static class Formatter { #region Private Definitions - private static readonly List CustomFormatters = new(); + private static readonly List CustomFormatters = []; - private static readonly List DefaultFormatters = new() - { + private static readonly List DefaultFormatters = + [ new XmlReaderValueFormatter(), new XmlNodeFormatter(), new AttributeBasedFormatter(), @@ -57,7 +57,7 @@ public static class Formatter new EnumerableValueFormatter(), new EnumValueFormatter(), new DefaultValueFormatter() - }; + ]; /// /// Is used to detect recursive calls by implementations. diff --git a/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs b/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs index 3e8a4bb1ba..ecd921b3b4 100644 --- a/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs @@ -130,7 +130,7 @@ private static bool ExpressionIsConstant(Expression expression) /// private sealed class AndOperatorChainExtractor : ExpressionVisitor { - public List AndChain { get; } = new(); + public List AndChain { get; } = []; public override Expression Visit(Expression node) { diff --git a/Src/FluentAssertions/Formatting/XElementValueFormatter.cs b/Src/FluentAssertions/Formatting/XElementValueFormatter.cs index d50d3a596d..0845dc96ed 100644 --- a/Src/FluentAssertions/Formatting/XElementValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/XElementValueFormatter.cs @@ -48,6 +48,6 @@ private static string FormatElementWithChildren(XElement element) private static string[] SplitIntoSeparateLines(XElement element) { string formattedXml = element.ToString(); - return formattedXml.Split(new[] { Environment.NewLine }, StringSplitOptions.None); + return formattedXml.Split([Environment.NewLine], StringSplitOptions.None); } } diff --git a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs index c698345e25..7c2027c5c6 100644 --- a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs @@ -101,10 +101,10 @@ public async Task> ThrowExactlyAsync exception.Should().BeOfType(expectedType, because, becauseArgs); } - return new ExceptionAssertions(new[] { exception as TException }); + return new ExceptionAssertions([exception as TException]); } - return new ExceptionAssertions(Array.Empty()); + return new ExceptionAssertions([]); } /// @@ -133,7 +133,7 @@ public async Task> ThrowAsync(string return ThrowInternal(exception, because, becauseArgs); } - return new ExceptionAssertions(Array.Empty()); + return new ExceptionAssertions([]); } /// @@ -165,7 +165,7 @@ public async Task> ThrowWithinAsync( return AssertThrows(caughtException, timeSpan, because, becauseArgs); } - return new ExceptionAssertions(Array.Empty()); + return new ExceptionAssertions([]); } private ExceptionAssertions AssertThrows( diff --git a/Src/FluentAssertions/Specialized/DelegateAssertions.cs b/Src/FluentAssertions/Specialized/DelegateAssertions.cs index e9787b927b..240983b9d9 100644 --- a/Src/FluentAssertions/Specialized/DelegateAssertions.cs +++ b/Src/FluentAssertions/Specialized/DelegateAssertions.cs @@ -50,7 +50,7 @@ public ExceptionAssertions Throw(string because = "", pa return ThrowInternal(exception, because, becauseArgs); } - return new ExceptionAssertions(Array.Empty()); + return new ExceptionAssertions([]); } /// @@ -123,10 +123,10 @@ public ExceptionAssertions ThrowExactly(string because = exception.Should().BeOfType(expectedType, because, becauseArgs); } - return new ExceptionAssertions(new[] { exception as TException }); + return new ExceptionAssertions([exception as TException]); } - return new ExceptionAssertions(Array.Empty()); + return new ExceptionAssertions([]); } protected abstract void InvokeSubject(); diff --git a/Src/FluentAssertions/Types/AssemblyAssertions.cs b/Src/FluentAssertions/Types/AssemblyAssertions.cs index fbe8a5a23f..2285e48f25 100644 --- a/Src/FluentAssertions/Types/AssemblyAssertions.cs +++ b/Src/FluentAssertions/Types/AssemblyAssertions.cs @@ -188,7 +188,7 @@ public AndConstraint BeSignedWithPublicKey(string publicKey, if (success) { - var bytes = Subject!.GetName().GetPublicKey() ?? Array.Empty(); + var bytes = Subject!.GetName().GetPublicKey() ?? []; string assemblyKey = ToHexString(bytes); Execute.Assertion diff --git a/Src/FluentAssertions/Types/MemberInfoAssertions.cs b/Src/FluentAssertions/Types/MemberInfoAssertions.cs index 97d80fccb2..c39940b663 100644 --- a/Src/FluentAssertions/Types/MemberInfoAssertions.cs +++ b/Src/FluentAssertions/Types/MemberInfoAssertions.cs @@ -86,7 +86,7 @@ public AndWhichConstraint, TAttribut $"Expected {Identifier} to be decorated with {typeof(TAttribute)}{{reason}}" + ", but {context:member} is ."); - IEnumerable attributes = Array.Empty(); + IEnumerable attributes = []; if (success) { diff --git a/Src/FluentAssertions/Types/MethodInfoSelector.cs b/Src/FluentAssertions/Types/MethodInfoSelector.cs index b2d129c9b2..511309ae7a 100644 --- a/Src/FluentAssertions/Types/MethodInfoSelector.cs +++ b/Src/FluentAssertions/Types/MethodInfoSelector.cs @@ -21,7 +21,7 @@ public class MethodInfoSelector : IEnumerable /// The type from which to select methods. /// is . public MethodInfoSelector(Type type) - : this(new[] { type }) + : this([type]) { } diff --git a/Src/FluentAssertions/Types/PropertyInfoSelector.cs b/Src/FluentAssertions/Types/PropertyInfoSelector.cs index 3081c9727e..db860f3879 100644 --- a/Src/FluentAssertions/Types/PropertyInfoSelector.cs +++ b/Src/FluentAssertions/Types/PropertyInfoSelector.cs @@ -20,7 +20,7 @@ public class PropertyInfoSelector : IEnumerable /// The type from which to select properties. /// is . public PropertyInfoSelector(Type type) - : this(new[] { type }) + : this([type]) { } diff --git a/Src/FluentAssertions/Types/TypeAssertions.cs b/Src/FluentAssertions/Types/TypeAssertions.cs index 8c25e0bc7d..6a5bf16c4a 100644 --- a/Src/FluentAssertions/Types/TypeAssertions.cs +++ b/Src/FluentAssertions/Types/TypeAssertions.cs @@ -1474,7 +1474,7 @@ public AndWhichConstraint HaveConstructor( public AndWhichConstraint HaveDefaultConstructor( string because = "", params object[] becauseArgs) { - return HaveConstructor(Array.Empty(), because, becauseArgs); + return HaveConstructor([], because, becauseArgs); } /// @@ -1531,7 +1531,7 @@ public AndWhichConstraint NotHaveConstructor( public AndWhichConstraint NotHaveDefaultConstructor( string because = "", params object[] becauseArgs) { - return NotHaveConstructor(Array.Empty(), because, becauseArgs); + return NotHaveConstructor([], because, becauseArgs); } private static string GetParameterString(IEnumerable parameterTypes) diff --git a/Src/FluentAssertions/Types/TypeSelector.cs b/Src/FluentAssertions/Types/TypeSelector.cs index c2138ff550..e6d46458d9 100644 --- a/Src/FluentAssertions/Types/TypeSelector.cs +++ b/Src/FluentAssertions/Types/TypeSelector.cs @@ -15,7 +15,7 @@ public class TypeSelector : IEnumerable private List types; public TypeSelector(Type type) - : this(new[] { type }) + : this([type]) { } diff --git a/Src/FluentAssertions/Xml/Equivalency/Node.cs b/Src/FluentAssertions/Xml/Equivalency/Node.cs index 2d6e383aee..8e19a40132 100644 --- a/Src/FluentAssertions/Xml/Equivalency/Node.cs +++ b/Src/FluentAssertions/Xml/Equivalency/Node.cs @@ -7,7 +7,7 @@ namespace FluentAssertions.Xml.Equivalency; internal sealed class Node { - private readonly List children = new(); + private readonly List children = []; private readonly string name; private int count; diff --git a/Src/FluentAssertions/Xml/XDocumentAssertions.cs b/Src/FluentAssertions/Xml/XDocumentAssertions.cs index 583eb25de4..912592271f 100644 --- a/Src/FluentAssertions/Xml/XDocumentAssertions.cs +++ b/Src/FluentAssertions/Xml/XDocumentAssertions.cs @@ -308,7 +308,7 @@ public AndWhichConstraint> HaveElemen .BecauseOf(because, becauseArgs) .FailWith("Cannot assert the count if the document itself is ."); - IEnumerable xElements = Enumerable.Empty(); + IEnumerable xElements = []; if (success) { diff --git a/Src/FluentAssertions/Xml/XElementAssertions.cs b/Src/FluentAssertions/Xml/XElementAssertions.cs index 1a86b49d58..b83160e5d7 100644 --- a/Src/FluentAssertions/Xml/XElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XElementAssertions.cs @@ -327,7 +327,7 @@ public AndWhichConstraint> HaveElement "Expected {context:subject} to have an element with count of {0}{reason}, but the element itself is .", expected.ToString()); - IEnumerable xElements = Enumerable.Empty(); + IEnumerable xElements = []; if (success) { diff --git a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs index b33a110d42..4ca65c9a3e 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs @@ -57,9 +57,9 @@ public void When_expectation_is_null_it_should_throw() public void When_comparing_nested_collection_with_a_null_value_it_should_fail_with_the_correct_message() { // Arrange - var subject = new[] { new MyClass { Items = new[] { "a" } } }; + MyClass[] subject = [new MyClass { Items = new[] { "a" } }]; - var expectation = new[] { new MyClass() }; + MyClass[] expectation = [new MyClass()]; // Act Action act = () => subject.Should().BeEquivalentTo(expectation); @@ -344,8 +344,8 @@ public void When_treating_a_null_type_as_reference_type_it_should_throw() public void When_comparing_an_open_type_by_members_it_should_succeed() { // Arrange - var subject = new Option(new[] { 1, 3, 2 }); - var expected = new Option(new[] { 1, 2, 3 }); + var subject = new Option([1, 3, 2]); + var expected = new Option([1, 2, 3]); // Act Action act = () => subject.Should().BeEquivalentTo(expected, opt => opt @@ -359,8 +359,8 @@ public void When_comparing_an_open_type_by_members_it_should_succeed() public void When_threating_open_type_as_reference_type_and_a_closed_type_as_value_type_it_should_compare_by_value() { // Arrange - var subject = new Option(new[] { 1, 3, 2 }); - var expected = new Option(new[] { 1, 2, 3 }); + var subject = new Option([1, 3, 2]); + var expected = new Option([1, 2, 3]); // Act Action act = () => subject.Should().BeEquivalentTo(expected, opt => opt @@ -375,8 +375,8 @@ public void When_threating_open_type_as_reference_type_and_a_closed_type_as_valu public void When_threating_open_type_as_value_type_and_a_closed_type_as_reference_type_it_should_compare_by_members() { // Arrange - var subject = new Option(new[] { 1, 3, 2 }); - var expected = new Option(new[] { 1, 2, 3 }); + var subject = new Option([1, 3, 2]); + var expected = new Option([1, 2, 3]); // Act Action act = () => subject.Should().BeEquivalentTo(expected, opt => opt diff --git a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs index 648b9d80be..c7b699f859 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs @@ -146,7 +146,7 @@ private class SelectNoMembersSelectionRule : IMemberSelectionRule public IEnumerable SelectMembers(INode currentNode, IEnumerable selectedMembers, MemberSelectionContext context) { - return Enumerable.Empty(); + return []; } bool IMemberSelectionRule.IncludesMembers => OverridesStandardIncludeRules; @@ -154,7 +154,7 @@ public IEnumerable SelectMembers(INode currentNode, IEnumerable> innerRoles = new(); + private readonly Dictionary> innerRoles = []; public virtual Dictionary> Roles => innerRoles.ToDictionary(x => x.Key, y => y.Value.Select(z => z)); @@ -200,7 +200,7 @@ public void When_the_expectation_has_fewer_dimensions_than_a_multi_dimensional_s object objectA = new(); object objectB = new(); - var actual = new[] { new[] { objectA, objectB } }; + object[][] actual = [[objectA, objectB]]; var expected = actual[0]; // Act @@ -279,9 +279,9 @@ public void public void When_a_collection_does_not_match_it_should_include_items_in_message() { // Arrange - var subject = new[] { 1, 2 }; + int[] subject = [1, 2]; - var expectation = new[] { 3, 2, 1 }; + int[] expectation = [3, 2, 1]; // Act Action action = () => subject.Should().BeEquivalentTo(expectation); @@ -440,11 +440,11 @@ public void When_a_collection_property_contains_objects_with_matching_properties public void When_two_deeply_nested_collections_are_equivalent_while_ignoring_the_order_it_should_not_throw() { // Arrange - var items = new[] { new int[0], new[] { 42 } }; + var items = new[] { new int[0], [42] }; // Act / Assert items.Should().BeEquivalentTo( - new[] { new[] { 42 }, new int[0] } + new[] { [42], new int[0] } ); } @@ -472,7 +472,7 @@ public void When_the_subject_is_a_non_generic_collection_it_should_still_work() { // Arrange object item = new(); - object[] array = { item }; + object[] array = [item]; IList readOnlyList = ArrayList.ReadOnly(array); // Act / Assert @@ -643,7 +643,7 @@ public void When_property_in_collection_is_excluded_it_should_not_throw_if_root_ }; // Act / Assert - new[] { subject }.Should().BeEquivalentTo(new[] { expected }, + new[] { subject }.Should().BeEquivalentTo([expected], options => options .For(x => x.Level.Collection) .Exclude(x => x.Number)); @@ -1118,7 +1118,7 @@ public void When_a_specific_property_is_included_it_should_ignore_the_rest_of_th var expected = new { A = "aaa", B = "ccc" }; // Act - Action act = () => result.Should().BeEquivalentTo(new[] { expected }, options => options.Including(x => x.A)); + Action act = () => result.Should().BeEquivalentTo([expected], options => options.Including(x => x.A)); // Assert act.Should().NotThrow(); @@ -1683,7 +1683,7 @@ public void When_custom_assertion_rules_are_utilized_the_rules_should_be_respect public void When_expectation_is_null_enumerable_it_should_throw() { // Arrange - var subject = Enumerable.Empty(); + IEnumerable subject = []; // Act Action act = () => subject.Should().BeEquivalentTo((IEnumerable)null); @@ -2142,13 +2142,13 @@ public void // Arrange var company1 = new MyCompany { Name = "Company" }; var user1 = new MyUser { Name = "User", Company = company1 }; - company1.Users = new List { user1 }; + company1.Users = [user1]; var logo1 = new MyCompanyLogo { Url = "blank", Company = company1, CreatedBy = user1 }; company1.Logo = logo1; var company2 = new MyCompany { Name = "Company" }; var user2 = new MyUser { Name = "User", Company = company2 }; - company2.Users = new List { user2 }; + company2.Users = [user2]; var logo2 = new MyCompanyLogo { Url = "blank", Company = company2, CreatedBy = user2 }; company2.Logo = logo2; diff --git a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs index b2330eb16e..41fd559b0f 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs @@ -76,7 +76,7 @@ public object this[object key] private class GenericDictionaryNotImplementingIDictionary : IDictionary { - private readonly Dictionary dictionary = new(); + private readonly Dictionary dictionary = []; IEnumerator IEnumerable.GetEnumerator() { @@ -233,7 +233,7 @@ private int Parse(string key) public class UserRolesLookupElement { - private readonly Dictionary> innerRoles = new(); + private readonly Dictionary> innerRoles = []; public virtual Dictionary> Roles => innerRoles.ToDictionary(x => x.Key, y => y.Value.Select(z => z)); @@ -362,7 +362,7 @@ public void When_a_dictionary_is_compared_to_null_it_should_not_throw_a_NullRefe { // Arrange Dictionary subject = null; - Dictionary expectation = new(); + Dictionary expectation = []; // Act Action act = () => subject.Should().BeEquivalentTo(expectation, "because we do expect a valid dictionary"); @@ -1289,7 +1289,7 @@ internal class NonGenericChildDictionary : Dictionary internal class NonGenericDictionary : IDictionary { - private readonly Dictionary innerDictionary = new(); + private readonly Dictionary innerDictionary = []; public int this[string key] { diff --git a/Tests/FluentAssertions.Equivalency.Specs/EnumSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/EnumSpecs.cs index 93321bdc57..64b285c96a 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/EnumSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/EnumSpecs.cs @@ -102,7 +102,7 @@ public void Comparing_collections_of_enums_by_name_includes_custom_message() public void Comparing_collections_of_numerics_with_collections_of_enums_includes_custom_message() { // Arrange - var actual = new[] { 1 }; + int[] actual = [1]; var expected = new[] { TestEnum.First }; diff --git a/Tests/FluentAssertions.Equivalency.Specs/MemberMatchingSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/MemberMatchingSpecs.cs index 231c68de0a..1fdd15a919 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/MemberMatchingSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/MemberMatchingSpecs.cs @@ -51,12 +51,12 @@ public void When_a_property_shared_by_anonymous_types_doesnt_match_it_should_thr public void Nested_properties_can_be_mapped_using_a_nested_expression() { // Arrange - var subject = new ParentOfSubjectWithProperty1(new[] { new SubjectWithProperty1 { Property1 = "Hello" } }); + var subject = new ParentOfSubjectWithProperty1([new SubjectWithProperty1 { Property1 = "Hello" }]); - var expectation = new ParentOfExpectationWithProperty2(new[] - { + var expectation = new ParentOfExpectationWithProperty2( + [ new ExpectationWithProperty2 { Property2 = "Hello" } - }); + ]); // Act / Assert subject.Should() @@ -70,12 +70,12 @@ public void Nested_properties_can_be_mapped_using_a_nested_expression() public void Nested_properties_can_be_mapped_using_a_nested_type_and_property_names() { // Arrange - var subject = new ParentOfSubjectWithProperty1(new[] { new SubjectWithProperty1 { Property1 = "Hello" } }); + var subject = new ParentOfSubjectWithProperty1([new SubjectWithProperty1 { Property1 = "Hello" }]); - var expectation = new ParentOfExpectationWithProperty2(new[] - { + var expectation = new ParentOfExpectationWithProperty2( + [ new ExpectationWithProperty2 { Property2 = "Hello" } - }); + ]); // Act / Assert subject.Should() @@ -87,14 +87,14 @@ public void Nested_properties_can_be_mapped_using_a_nested_type_and_property_nam public void Nested_explicitly_implemented_properties_can_be_mapped_using_a_nested_type_and_property_names() { // Arrange - var subject = new ParentOfSubjectWithExplicitlyImplementedProperty(new[] { new SubjectWithExplicitImplementedProperty() }); + var subject = new ParentOfSubjectWithExplicitlyImplementedProperty([new SubjectWithExplicitImplementedProperty()]); ((IProperty)subject.Children[0]).Property = "Hello"; - var expectation = new ParentOfExpectationWithProperty2(new[] - { + var expectation = new ParentOfExpectationWithProperty2( + [ new ExpectationWithProperty2 { Property2 = "Hello" } - }); + ]); // Act / Assert subject.Should() @@ -121,12 +121,12 @@ public void Nested_fields_can_be_mapped_using_a_nested_type_and_field_names() public void Nested_properties_can_be_mapped_using_a_nested_type_and_a_property_expression() { // Arrange - var subject = new ParentOfSubjectWithProperty1(new[] { new SubjectWithProperty1 { Property1 = "Hello" } }); + var subject = new ParentOfSubjectWithProperty1([new SubjectWithProperty1 { Property1 = "Hello" }]); - var expectation = new ParentOfExpectationWithProperty2(new[] - { + var expectation = new ParentOfExpectationWithProperty2( + [ new ExpectationWithProperty2 { Property2 = "Hello" } - }); + ]); // Act / Assert subject.Should() @@ -405,12 +405,12 @@ public void A_null_subject_should_result_in_a_normal_assertion_failure() public void Nested_types_and_dotted_expectation_member_paths_cannot_be_combined() { // Arrange - var subject = new ParentOfSubjectWithProperty1(new[] { new SubjectWithProperty1 { Property1 = "Hello" } }); + var subject = new ParentOfSubjectWithProperty1([new SubjectWithProperty1 { Property1 = "Hello" }]); - var expectation = new ParentOfExpectationWithProperty2(new[] - { + var expectation = new ParentOfExpectationWithProperty2( + [ new ExpectationWithProperty2 { Property2 = "Hello" } - }); + ]); // Act Action act = () => subject.Should() @@ -427,12 +427,12 @@ public void Nested_types_and_dotted_expectation_member_paths_cannot_be_combined( public void Nested_types_and_dotted_subject_member_paths_cannot_be_combined() { // Arrange - var subject = new ParentOfSubjectWithProperty1(new[] { new SubjectWithProperty1 { Property1 = "Hello" } }); + var subject = new ParentOfSubjectWithProperty1([new SubjectWithProperty1 { Property1 = "Hello" }]); - var expectation = new ParentOfExpectationWithProperty2(new[] - { + var expectation = new ParentOfExpectationWithProperty2( + [ new ExpectationWithProperty2 { Property2 = "Hello" } - }); + ]); // Act Action act = () => subject.Should() @@ -449,12 +449,12 @@ public void Nested_types_and_dotted_subject_member_paths_cannot_be_combined() public void The_member_name_on_a_nested_type_mapping_must_be_a_valid_member() { // Arrange - var subject = new ParentOfSubjectWithProperty1(new[] { new SubjectWithProperty1 { Property1 = "Hello" } }); + var subject = new ParentOfSubjectWithProperty1([new SubjectWithProperty1 { Property1 = "Hello" }]); - var expectation = new ParentOfExpectationWithProperty2(new[] - { + var expectation = new ParentOfExpectationWithProperty2( + [ new ExpectationWithProperty2 { Property2 = "Hello" } - }); + ]); // Act Action act = () => subject.Should() @@ -529,8 +529,8 @@ public void Can_map_members_of_a_root_collection() Name = "Test" }; - var entityCol = new[] { entity }; - var dtoCol = new[] { dto }; + Entity[] entityCol = [entity]; + EntityDto[] dtoCol = [dto]; // Act / Assert dtoCol.Should().BeEquivalentTo(entityCol, c => diff --git a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs index 3996fff1fb..274187c89e 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs @@ -307,9 +307,9 @@ public void When_a_property_of_a_nested_object_doesnt_match_it_should_clearly_in public void Should_support_nested_collections_containing_empty_objects() { // Arrange - var orig = new[] { new OuterWithObject { MyProperty = new[] { new Inner() } } }; + var orig = new[] { new OuterWithObject { MyProperty = [new Inner()] } }; - var expectation = new[] { new OuterWithObject { MyProperty = new[] { new Inner() } } }; + var expectation = new[] { new OuterWithObject { MyProperty = [new Inner()] } }; // Act / Assert orig.Should().BeEquivalentTo(expectation); diff --git a/Tests/FluentAssertions.Equivalency.Specs/RecordSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/RecordSpecs.cs index 9ce6473ae1..8158da2f73 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/RecordSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/RecordSpecs.cs @@ -9,9 +9,9 @@ public class RecordSpecs [Fact] public void When_the_subject_is_a_record_it_should_compare_it_by_its_members() { - var actual = new MyRecord { StringField = "foo", CollectionProperty = new[] { "bar", "zip", "foo" } }; + var actual = new MyRecord { StringField = "foo", CollectionProperty = ["bar", "zip", "foo"] }; - var expected = new MyRecord { StringField = "foo", CollectionProperty = new[] { "foo", "bar", "zip" } }; + var expected = new MyRecord { StringField = "foo", CollectionProperty = ["foo", "bar", "zip"] }; actual.Should().BeEquivalentTo(expected); } @@ -19,9 +19,9 @@ public void When_the_subject_is_a_record_it_should_compare_it_by_its_members() [Fact] public void When_the_subject_is_a_record_struct_it_should_compare_it_by_its_members() { - var actual = new MyRecordStruct("foo", new[] { "bar", "zip", "foo" }); + var actual = new MyRecordStruct("foo", ["bar", "zip", "foo"]); - var expected = new MyRecordStruct("foo", new[] { "bar", "zip", "foo" }); + var expected = new MyRecordStruct("foo", ["bar", "zip", "foo"]); actual.Should().BeEquivalentTo(expected); } @@ -42,9 +42,9 @@ public void When_the_subject_is_a_record_it_should_mention_that_in_the_configura [Fact] public void When_a_record_should_be_treated_as_a_value_type_it_should_use_its_equality_for_comparing() { - var actual = new MyRecord { StringField = "foo", CollectionProperty = new[] { "bar", "zip", "foo" } }; + var actual = new MyRecord { StringField = "foo", CollectionProperty = ["bar", "zip", "foo"] }; - var expected = new MyRecord { StringField = "foo", CollectionProperty = new[] { "foo", "bar", "zip" } }; + var expected = new MyRecord { StringField = "foo", CollectionProperty = ["foo", "bar", "zip"] }; Action act = () => actual.Should().BeEquivalentTo(expected, o => o .ComparingByValue()); @@ -57,9 +57,9 @@ public void When_a_record_should_be_treated_as_a_value_type_it_should_use_its_eq [Fact] public void When_all_records_should_be_treated_as_value_types_it_should_use_equality_for_comparing() { - var actual = new MyRecord { StringField = "foo", CollectionProperty = new[] { "bar", "zip", "foo" } }; + var actual = new MyRecord { StringField = "foo", CollectionProperty = ["bar", "zip", "foo"] }; - var expected = new MyRecord { StringField = "foo", CollectionProperty = new[] { "foo", "bar", "zip" } }; + var expected = new MyRecord { StringField = "foo", CollectionProperty = ["foo", "bar", "zip"] }; Action act = () => actual.Should().BeEquivalentTo(expected, o => o .ComparingRecordsByValue()); @@ -73,9 +73,9 @@ public void When_all_records_should_be_treated_as_value_types_it_should_use_equa public void When_all_records_except_a_specific_type_should_be_treated_as_value_types_it_should_compare_that_specific_type_by_its_members() { - var actual = new MyRecord { StringField = "foo", CollectionProperty = new[] { "bar", "zip", "foo" } }; + var actual = new MyRecord { StringField = "foo", CollectionProperty = ["bar", "zip", "foo"] }; - var expected = new MyRecord { StringField = "foo", CollectionProperty = new[] { "foo", "bar", "zip" } }; + var expected = new MyRecord { StringField = "foo", CollectionProperty = ["foo", "bar", "zip"] }; actual.Should().BeEquivalentTo(expected, o => o .ComparingRecordsByValue() @@ -85,9 +85,9 @@ public void [Fact] public void When_global_record_comparing_options_are_chained_it_should_ensure_the_last_one_wins() { - var actual = new MyRecord { CollectionProperty = new[] { "bar", "zip", "foo" } }; + var actual = new MyRecord { CollectionProperty = ["bar", "zip", "foo"] }; - var expected = new MyRecord { CollectionProperty = new[] { "foo", "bar", "zip" } }; + var expected = new MyRecord { CollectionProperty = ["foo", "bar", "zip"] }; actual.Should().BeEquivalentTo(expected, o => o .ComparingRecordsByValue() diff --git a/Tests/FluentAssertions.Equivalency.Specs/TupleSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/TupleSpecs.cs index 229af8373e..17e0ee6a92 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/TupleSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/TupleSpecs.cs @@ -24,8 +24,8 @@ public void When_a_nested_member_is_a_tuple_it_should_compare_its_property_for_e public void When_a_tuple_is_compared_it_should_compare_its_components() { // Arrange - var actual = new Tuple("Hello", true, new[] { 3, 2, 1 }); - var expected = new Tuple("Hello", true, new[] { 1, 2, 3 }); + var actual = new Tuple("Hello", true, [3, 2, 1]); + var expected = new Tuple("Hello", true, [1, 2, 3]); // Act Action act = () => actual.Should().BeEquivalentTo(expected); diff --git a/Tests/FluentAssertions.Specs/AndWhichConstraintSpecs.cs b/Tests/FluentAssertions.Specs/AndWhichConstraintSpecs.cs index b102f96dc4..a4aa52a96c 100644 --- a/Tests/FluentAssertions.Specs/AndWhichConstraintSpecs.cs +++ b/Tests/FluentAssertions.Specs/AndWhichConstraintSpecs.cs @@ -11,7 +11,7 @@ public class AndWhichConstraintSpecs public void When_many_objects_are_provided_accessing_which_should_throw_a_descriptive_exception() { // Arrange - var continuation = new AndWhichConstraint(null, new[] { "hello", "world" }); + var continuation = new AndWhichConstraint(null, ["hello", "world"]); // Act Action act = () => _ = continuation.Which; diff --git a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs index 0b71d3a8b4..b77309a2b8 100644 --- a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs @@ -32,7 +32,7 @@ public void Assertions_classes_override_equals() private static bool OverridesEquals(Type t) { MethodInfo equals = t.GetMethod("Equals", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public, - null, new[] { typeof(object) }, null); + null, [typeof(object)], null); return equals is not null; } @@ -108,7 +108,7 @@ public void Fake_should_method_throws(Type type) } // Act - Action act = () => fakeOverload.Invoke(null, new object[] { null }); + Action act = () => fakeOverload.Invoke(null, [null]); // Assert act.Should() diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllBeAssignableTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllBeAssignableTo.cs index cc046bd50b..662aa1c2dd 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllBeAssignableTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllBeAssignableTo.cs @@ -17,7 +17,7 @@ public class AllBeAssignableTo public void When_the_types_in_a_collection_is_matched_against_a_null_type_it_should_throw() { // Arrange - var collection = Array.Empty(); + int[] collection = []; // Act Action act = () => collection.Should().AllBeAssignableTo(null); @@ -31,7 +31,7 @@ public void When_the_types_in_a_collection_is_matched_against_a_null_type_it_sho public void All_items_in_an_empty_collection_are_assignable_to_a_generic_type() { // Arrange - var collection = Array.Empty(); + int[] collection = []; // Act / Assert collection.Should().AllBeAssignableTo(); @@ -59,7 +59,7 @@ public void When_collection_is_null_then_all_be_assignable_to_should_fail() public void All_items_in_an_empty_collection_are_assignable_to_a_type() { // Arrange - var collection = Array.Empty(); + int[] collection = []; // Act / Assert collection.Should().AllBeAssignableTo(typeof(int)); @@ -69,7 +69,7 @@ public void All_items_in_an_empty_collection_are_assignable_to_a_type() public void When_all_of_the_types_in_a_collection_match_expected_type_it_should_succeed() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().AllBeAssignableTo(typeof(int)); @@ -79,7 +79,7 @@ public void When_all_of_the_types_in_a_collection_match_expected_type_it_should_ public void When_all_of_the_types_in_a_collection_match_expected_generic_type_it_should_succeed() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().AllBeAssignableTo(); @@ -89,7 +89,7 @@ public void When_all_of_the_types_in_a_collection_match_expected_generic_type_it public void When_matching_a_collection_against_a_type_it_should_return_the_casted_items() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().AllBeAssignableTo() @@ -152,7 +152,7 @@ public void When_one_of_the_elements_is_null_it_should_throw_with_a_clear_explan public void When_collection_is_of_matching_types_it_should_succeed() { // Arrange - var collection = new[] { typeof(Exception), typeof(ArgumentException) }; + Type[] collection = [typeof(Exception), typeof(ArgumentException)]; // Act / Assert collection.Should().AllBeAssignableTo(); @@ -162,7 +162,7 @@ public void When_collection_is_of_matching_types_it_should_succeed() public void When_collection_of_types_contains_one_type_that_does_not_match_it_should_throw_with_a_clear_explanation() { // Arrange - var collection = new[] { typeof(int), typeof(string), typeof(int) }; + Type[] collection = [typeof(int), typeof(string), typeof(int)]; // Act Action act = () => collection.Should().AllBeAssignableTo("because they are of different type"); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllBeOfType.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllBeOfType.cs index bb8af531a1..9258ad4d01 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllBeOfType.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllBeOfType.cs @@ -17,7 +17,7 @@ public class AllBeOfType public void When_the_types_in_a_collection_is_matched_against_a_null_type_exactly_it_should_throw() { // Arrange - var collection = Array.Empty(); + int[] collection = []; // Act Action act = () => collection.Should().AllBeOfType(null); @@ -31,7 +31,7 @@ public void When_the_types_in_a_collection_is_matched_against_a_null_type_exactl public void All_items_in_an_empty_collection_are_of_a_generic_type() { // Arrange - var collection = Array.Empty(); + int[] collection = []; // Act / Assert collection.Should().AllBeOfType(); @@ -41,7 +41,7 @@ public void All_items_in_an_empty_collection_are_of_a_generic_type() public void All_items_in_an_empty_collection_are_of_a_type() { // Arrange - var collection = Array.Empty(); + int[] collection = []; // Act / Assert collection.Should().AllBeOfType(typeof(int)); @@ -69,7 +69,7 @@ public void When_collection_is_null_then_all_be_of_type_should_fail() public void When_all_of_the_types_in_a_collection_match_expected_type_exactly_it_should_succeed() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().AllBeOfType(typeof(int)); @@ -79,7 +79,7 @@ public void When_all_of_the_types_in_a_collection_match_expected_type_exactly_it public void When_all_of_the_types_in_a_collection_match_expected_generic_type_exactly_it_should_succeed() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().AllBeOfType(); @@ -89,7 +89,7 @@ public void When_all_of_the_types_in_a_collection_match_expected_generic_type_ex public void When_matching_a_collection_against_an_exact_type_it_should_return_the_casted_items() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().AllBeOfType() @@ -142,7 +142,7 @@ public void When_one_of_the_elements_is_null_for_an_exact_match_it_should_throw_ public void When_collection_of_types_match_expected_type_exactly_it_should_succeed() { // Arrange - var collection = new[] { typeof(int), typeof(int), typeof(int) }; + Type[] collection = [typeof(int), typeof(int), typeof(int)]; // Act / Assert collection.Should().AllBeOfType(); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllSatisfy.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllSatisfy.cs index 0496898d0d..7e327a012a 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllSatisfy.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllSatisfy.cs @@ -18,7 +18,7 @@ public class AllSatisfy public void A_null_inspector_should_throw() { // Arrange - IEnumerable collection = new[] { 1, 2 }; + IEnumerable collection = [1, 2]; // Act Action act = () => collection.Should().AllSatisfy(null); @@ -53,7 +53,7 @@ public void A_null_collection_should_throw() public void An_empty_collection_should_succeed() { // Arrange - var collection = Enumerable.Empty(); + IEnumerable collection = []; // Act / Assert collection.Should().AllSatisfy(x => x.Should().Be(1)); @@ -75,8 +75,8 @@ public void Any_items_not_satisfying_inspector_should_throw() // Arrange var customers = new[] { - new CustomerWithItems { Age = 21, Items = new[] { 1, 2 } }, - new CustomerWithItems { Age = 22, Items = new[] { 3 } } + new CustomerWithItems { Age = 21, Items = [1, 2] }, + new CustomerWithItems { Age = 22, Items = [3] } }; // Act @@ -113,7 +113,7 @@ public void Any_items_not_satisfying_inspector_should_throw() public void Inspector_message_that_is_not_reformatable_should_not_throw() { // Arrange - byte[][] subject = { new byte[] { 1 } }; + byte[][] subject = [[1]]; // Act Action act = () => subject.Should().AllSatisfy(e => e.Should().BeEquivalentTo(new byte[] { 2, 3, 4 })); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEmpty.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEmpty.cs index 4274caa438..7ff0f22980 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEmpty.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEmpty.cs @@ -28,7 +28,7 @@ public void When_collection_is_empty_as_expected_it_should_not_throw() public void When_collection_is_not_empty_unexpectedly_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().BeEmpty("that's what we expect"); @@ -42,7 +42,7 @@ public void When_collection_is_not_empty_unexpectedly_it_should_throw() public void When_asserting_collection_with_items_is_not_empty_it_should_succeed() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().NotBeEmpty(); @@ -171,7 +171,7 @@ public void When_asserting_collection_to_be_not_empty_but_collection_is_null_it_ public void When_asserting_collection_to_be_not_empty_it_should_enumerate_only_once() { // Arrange - var collection = new CountingGenericEnumerable(new[] { 42 }); + var collection = new CountingGenericEnumerable([42]); // Act collection.Should().NotBeEmpty(); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs index b640358a17..6e669510e7 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs @@ -18,8 +18,8 @@ public class BeEquivalentTo public void When_two_collections_contain_the_same_elements_it_should_treat_them_as_equivalent() { // Arrange - var collection1 = new[] { 1, 2, 3 }; - var collection2 = new[] { 3, 1, 2 }; + int[] collection1 = [1, 2, 3]; + int[] collection2 = [3, 1, 2]; // Act / Assert collection1.Should().BeEquivalentTo(collection2); @@ -29,10 +29,10 @@ public void When_two_collections_contain_the_same_elements_it_should_treat_them_ public void When_a_collection_contains_same_elements_it_should_treat_it_as_equivalent() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert - collection.Should().BeEquivalentTo(new[] { 3, 1, 2 }); + collection.Should().BeEquivalentTo([3, 1, 2]); } [Fact] @@ -50,8 +50,8 @@ public void When_character_collections_are_equivalent_it_should_not_throw() public void When_collections_are_not_equivalent_it_should_throw() { // Arrange - var collection1 = new[] { 1, 2, 3 }; - var collection2 = new[] { 1, 2 }; + int[] collection1 = [1, 2, 3]; + int[] collection2 = [1, 2]; // Act Action act = () => collection1.Should().BeEquivalentTo(collection2, "we treat {0} alike", "all"); @@ -65,8 +65,8 @@ public void When_collections_are_not_equivalent_it_should_throw() public void When_collections_with_duplicates_are_not_equivalent_it_should_throw() { // Arrange - var collection1 = new[] { 1, 2, 3, 1 }; - var collection2 = new[] { 1, 2, 3, 3 }; + int[] collection1 = [1, 2, 3, 1]; + int[] collection2 = [1, 2, 3, 3]; // Act Action act = () => collection1.Should().BeEquivalentTo(collection2); @@ -80,8 +80,8 @@ public void When_collections_with_duplicates_are_not_equivalent_it_should_throw( public void When_testing_for_equivalence_against_empty_collection_it_should_throw() { // Arrange - var subject = new[] { 1, 2, 3 }; - var otherCollection = new int[0]; + int[] subject = [1, 2, 3]; + int[] otherCollection = []; // Act Action act = () => subject.Should().BeEquivalentTo(otherCollection); @@ -109,7 +109,7 @@ public void When_two_collections_are_both_empty_it_should_treat_them_as_equivale public void When_testing_for_equivalence_against_null_collection_it_should_throw() { // Arrange - var collection1 = new[] { 1, 2, 3 }; + int[] collection1 = [1, 2, 3]; int[] collection2 = null; // Act @@ -125,7 +125,7 @@ public void When_asserting_collections_to_be_equivalent_but_subject_collection_i { // Arrange int[] collection = null; - var collection1 = new[] { 1, 2, 3 }; + int[] collection1 = [1, 2, 3]; // Act Action act = @@ -166,8 +166,8 @@ public class NotBeEquivalentTo public void When_collection_is_not_equivalent_to_another_smaller_collection_it_should_succeed() { // Arrange - var collection1 = new[] { 1, 2, 3 }; - var collection2 = new[] { 3, 1 }; + int[] collection1 = [1, 2, 3]; + int[] collection2 = [3, 1]; // Act / Assert collection1.Should().NotBeEquivalentTo(collection2); @@ -191,8 +191,8 @@ public void When_large_collection_is_equivalent_to_another_equally_size_collecti public void When_collection_is_not_equivalent_to_another_equally_sized_collection_it_should_succeed() { // Arrange - var collection1 = new[] { 1, 2, 3 }; - var collection2 = new[] { 3, 1, 4 }; + int[] collection1 = [1, 2, 3]; + int[] collection2 = [3, 1, 4]; // Act / Assert collection1.Should().NotBeEquivalentTo(collection2); @@ -202,8 +202,8 @@ public void When_collection_is_not_equivalent_to_another_equally_sized_collectio public void When_collections_are_unexpectedly_equivalent_it_should_throw() { // Arrange - var collection1 = new[] { 1, 2, 3 }; - var collection2 = new[] { 3, 1, 2 }; + int[] collection1 = [1, 2, 3]; + int[] collection2 = [3, 1, 2]; // Act Action act = () => collection1.Should().NotBeEquivalentTo(collection2); @@ -218,7 +218,7 @@ public void When_asserting_collections_not_to_be_equivalent_but_subject_collecti { // Arrange int[] actual = null; - var expectation = new[] { 1, 2, 3 }; + int[] expectation = [1, 2, 3]; // Act Action act = () => @@ -236,7 +236,7 @@ public void When_asserting_collections_not_to_be_equivalent_but_subject_collecti public void When_non_empty_collection_is_not_expected_to_be_equivalent_to_an_empty_collection_it_should_succeed() { // Arrange - var collection1 = new[] { 1, 2, 3 }; + int[] collection1 = [1, 2, 3]; var collection2 = new int[0]; // Act @@ -250,7 +250,7 @@ public void When_non_empty_collection_is_not_expected_to_be_equivalent_to_an_emp public void When_testing_collections_not_to_be_equivalent_against_null_collection_it_should_throw() { // Arrange - var collection1 = new[] { 1, 2, 3 }; + int[] collection1 = [1, 2, 3]; int[] collection2 = null; // Act @@ -266,7 +266,7 @@ public void When_testing_collections_not_to_be_equivalent_against_null_collectio public void When_testing_collections_not_to_be_equivalent_against_same_collection_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; var collection1 = collection; // Act @@ -301,7 +301,7 @@ public void When_asserting_collections_not_to_be_equivalent_with_options_but_sub { // Arrange int[] actual = null; - int[] expectation = { 1, 2, 3 }; + int[] expectation = [1, 2, 3]; // Act Action act = () => diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInAscendingOrder.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInAscendingOrder.cs index faf106ce2b..61a96d42df 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInAscendingOrder.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInAscendingOrder.cs @@ -37,7 +37,7 @@ public void When_asserting_a_null_collection_to_be_in_ascending_order_it_should_ public void When_asserting_the_items_in_an_ascendingly_ordered_collection_are_ordered_ascending_it_should_succeed() { // Arrange - var collection = new[] { 1, 2, 2, 3 }; + int[] collection = [1, 2, 2, 3]; // Act / Assert collection.Should().BeInAscendingOrder(); @@ -48,7 +48,7 @@ public void When_asserting_the_items_in_an_ascendingly_ordered_collection_are_ordered_ascending_using_the_given_comparer_it_should_succeed() { // Arrange - var collection = new[] { 1, 2, 2, 3 }; + int[] collection = [1, 2, 2, 3]; // Act / Assert collection.Should().BeInAscendingOrder(Comparer.Default); @@ -58,7 +58,7 @@ public void public void When_asserting_the_items_in_an_unordered_collection_are_ordered_ascending_it_should_throw() { // Arrange - var collection = new[] { 1, 6, 12, 15, 12, 17, 26 }; + int[] collection = [1, 6, 12, 15, 12, 17, 26]; // Act Action action = () => collection.Should().BeInAscendingOrder("because numbers are ordered"); @@ -74,7 +74,7 @@ public void When_asserting_the_items_in_an_unordered_collection_are_ordered_ascending_using_the_given_comparer_it_should_throw() { // Arrange - var collection = new[] { 1, 6, 12, 15, 12, 17, 26 }; + int[] collection = [1, 6, 12, 15, 12, 17, 26]; // Act Action action = () => collection.Should().BeInAscendingOrder(Comparer.Default, "because numbers are ordered"); @@ -89,7 +89,7 @@ public void public void Items_can_be_ordered_by_the_identity_function() { // Arrange - var collection = new[] { 1, 2 }; + int[] collection = [1, 2]; // Act Action action = () => collection.Should().BeInAscendingOrder(x => x); @@ -102,7 +102,7 @@ public void Items_can_be_ordered_by_the_identity_function() public void When_asserting_empty_collection_with_no_parameters_ordered_in_ascending_it_should_succeed() { // Arrange - var collection = new int[] { }; + int[] collection = []; // Act Action act = () => collection.Should().BeInAscendingOrder(); @@ -115,7 +115,7 @@ public void When_asserting_empty_collection_with_no_parameters_ordered_in_ascend public void When_asserting_empty_collection_by_property_expression_ordered_in_ascending_it_should_succeed() { // Arrange - var collection = Enumerable.Empty(); + IEnumerable collection = []; // Act Action act = () => collection.Should().BeInAscendingOrder(o => o.Number); @@ -128,7 +128,7 @@ public void When_asserting_empty_collection_by_property_expression_ordered_in_as public void When_asserting_single_element_collection_with_no_parameters_ordered_in_ascending_it_should_succeed() { // Arrange - var collection = new[] { 42 }; + int[] collection = [42]; // Act Action act = () => collection.Should().BeInAscendingOrder(); @@ -292,7 +292,7 @@ public void public void When_strings_are_in_ascending_order_it_should_succeed() { // Arrange - string[] strings = { "alpha", "beta", "theta" }; + string[] strings = ["alpha", "beta", "theta"]; // Act Action act = () => strings.Should().BeInAscendingOrder(); @@ -305,7 +305,7 @@ public void When_strings_are_in_ascending_order_it_should_succeed() public void When_strings_are_not_in_ascending_order_it_should_throw() { // Arrange - string[] strings = { "theta", "alpha", "beta" }; + string[] strings = ["theta", "alpha", "beta"]; // Act Action act = () => strings.Should().BeInAscendingOrder("of {0}", "reasons"); @@ -320,7 +320,7 @@ public void When_strings_are_not_in_ascending_order_it_should_throw() public void When_strings_are_in_ascending_order_according_to_a_custom_comparer_it_should_succeed() { // Arrange - string[] strings = { "alpha", "beta", "theta" }; + string[] strings = ["alpha", "beta", "theta"]; // Act Action act = () => strings.Should().BeInAscendingOrder(new ByLastCharacterComparer()); @@ -333,7 +333,7 @@ public void When_strings_are_in_ascending_order_according_to_a_custom_comparer_i public void When_strings_are_not_in_ascending_order_according_to_a_custom_comparer_it_should_throw() { // Arrange - string[] strings = { "dennis", "roy", "thomas" }; + string[] strings = ["dennis", "roy", "thomas"]; // Act Action act = () => strings.Should().BeInAscendingOrder(new ByLastCharacterComparer(), "of {0}", "reasons"); @@ -348,7 +348,7 @@ public void When_strings_are_not_in_ascending_order_according_to_a_custom_compar public void When_strings_are_in_ascending_order_according_to_a_custom_lambda_it_should_succeed() { // Arrange - string[] strings = { "alpha", "beta", "theta" }; + string[] strings = ["alpha", "beta", "theta"]; // Act Action act = () => strings.Should().BeInAscendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last())); @@ -361,7 +361,7 @@ public void When_strings_are_in_ascending_order_according_to_a_custom_lambda_it_ public void When_strings_are_not_in_ascending_order_according_to_a_custom_lambda_it_should_throw() { // Arrange - string[] strings = { "dennis", "roy", "thomas" }; + string[] strings = ["dennis", "roy", "thomas"]; // Act Action act = () => @@ -420,7 +420,7 @@ public void public void When_asserting_the_items_in_a_collection_are_ordered_and_the_specified_property_is_null_it_should_throw() { // Arrange - var collection = Enumerable.Empty(); + IEnumerable collection = []; // Act Action act = () => collection.Should().BeInAscendingOrder((Expression>)null); @@ -435,7 +435,7 @@ public void When_asserting_the_items_in_a_collection_are_ordered_and_the_specifi public void When_asserting_the_items_in_a_collection_are_ordered_and_the_given_comparer_is_null_it_should_throw() { // Arrange - var collection = Enumerable.Empty(); + IEnumerable collection = []; // Act Action act = () => collection.Should().BeInAscendingOrder(comparer: null); @@ -450,7 +450,7 @@ public void When_asserting_the_items_in_a_collection_are_ordered_and_the_given_c public void When_asserting_the_items_in_ay_collection_are_ordered_using_an_invalid_property_expression_it_should_throw() { // Arrange - var collection = Enumerable.Empty(); + IEnumerable collection = []; // Act Action act = () => collection.Should().BeInAscendingOrder(o => o.GetHashCode()); @@ -481,7 +481,7 @@ public void When_asserting_a_null_collection_to_not_be_in_ascending_order_it_sho public void When_asserting_the_items_in_an_unordered_collection_are_not_in_ascending_order_it_should_succeed() { // Arrange - var collection = new[] { 1, 5, 3 }; + int[] collection = [1, 5, 3]; // Act / Assert collection.Should().NotBeInAscendingOrder(); @@ -492,7 +492,7 @@ public void When_asserting_the_items_in_an_unordered_collection_are_not_in_ascending_order_using_the_given_comparer_it_should_succeed() { // Arrange - var collection = new[] { 1, 5, 3 }; + int[] collection = [1, 5, 3]; // Act / Assert collection.Should().NotBeInAscendingOrder(Comparer.Default); @@ -502,7 +502,7 @@ public void public void When_asserting_the_items_in_an_ascendingly_ordered_collection_are_not_in_ascending_order_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 2, 3 }; + int[] collection = [1, 2, 2, 3]; // Act Action action = () => collection.Should().NotBeInAscendingOrder("because numbers are not ordered"); @@ -518,7 +518,7 @@ public void When_asserting_the_items_in_an_ascendingly_ordered_collection_are_not_in_ascending_order_using_the_given_comparer_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 2, 3 }; + int[] collection = [1, 2, 2, 3]; // Act Action action = () => @@ -534,7 +534,7 @@ public void public void When_asserting_empty_collection_by_property_expression_to_not_be_ordered_in_ascending_it_should_throw() { // Arrange - var collection = Enumerable.Empty(); + IEnumerable collection = []; // Act Action act = () => collection.Should().NotBeInAscendingOrder(o => o.Number); @@ -548,7 +548,7 @@ public void When_asserting_empty_collection_by_property_expression_to_not_be_ord public void When_asserting_empty_collection_with_no_parameters_not_be_ordered_in_ascending_it_should_throw() { // Arrange - var collection = new int[] { }; + int[] collection = []; // Act Action act = () => collection.Should().NotBeInAscendingOrder("because I say {0}", "so"); @@ -562,7 +562,7 @@ public void When_asserting_empty_collection_with_no_parameters_not_be_ordered_in public void When_asserting_single_element_collection_with_no_parameters_not_be_ordered_in_ascending_it_should_throw() { // Arrange - var collection = new[] { 42 }; + int[] collection = [42]; // Act Action act = () => collection.Should().NotBeInAscendingOrder(); @@ -594,7 +594,7 @@ public void When_asserting_the_items_in_a_ascending_ordered_collection_are_not_ordered_ascending_using_the_given_comparer_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().NotBeInAscendingOrder(Comparer.Default, "it should not be sorted"); @@ -609,7 +609,7 @@ public void When_asserting_the_items_not_in_an_ascendingly_ordered_collection_are_not_ordered_ascending_using_the_given_comparer_it_should_succeed() { // Arrange - var collection = new[] { 3, 2, 1 }; + int[] collection = [3, 2, 1]; // Act Action act = () => collection.Should().NotBeInAscendingOrder(Comparer.Default); @@ -702,7 +702,7 @@ public void public void When_strings_are_not_in_ascending_order_it_should_succeed() { // Arrange - string[] strings = { "beta", "alpha", "theta" }; + string[] strings = ["beta", "alpha", "theta"]; // Act Action act = () => strings.Should().NotBeInAscendingOrder(); @@ -715,7 +715,7 @@ public void When_strings_are_not_in_ascending_order_it_should_succeed() public void When_strings_are_in_ascending_order_unexpectedly_it_should_throw() { // Arrange - string[] strings = { "alpha", "beta", "theta" }; + string[] strings = ["alpha", "beta", "theta"]; // Act Action act = () => strings.Should().NotBeInAscendingOrder("of {0}", "reasons"); @@ -730,7 +730,7 @@ public void When_strings_are_in_ascending_order_unexpectedly_it_should_throw() public void When_strings_are_not_in_ascending_order_according_to_a_custom_comparer_it_should_succeed() { // Arrange - string[] strings = { "dennis", "roy", "barbara" }; + string[] strings = ["dennis", "roy", "barbara"]; // Act Action act = () => strings.Should().NotBeInAscendingOrder(new ByLastCharacterComparer()); @@ -743,7 +743,7 @@ public void When_strings_are_not_in_ascending_order_according_to_a_custom_compar public void When_strings_are_unexpectedly_in_ascending_order_according_to_a_custom_comparer_it_should_throw() { // Arrange - string[] strings = { "dennis", "thomas", "roy" }; + string[] strings = ["dennis", "thomas", "roy"]; // Act Action act = () => strings.Should().NotBeInAscendingOrder(new ByLastCharacterComparer(), "of {0}", "reasons"); @@ -758,7 +758,7 @@ public void When_strings_are_unexpectedly_in_ascending_order_according_to_a_cust public void When_strings_are_not_in_ascending_order_according_to_a_custom_lambda_it_should_succeed() { // Arrange - string[] strings = { "roy", "dennis", "thomas" }; + string[] strings = ["roy", "dennis", "thomas"]; // Act Action act = () => strings.Should().NotBeInAscendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last())); @@ -771,7 +771,7 @@ public void When_strings_are_not_in_ascending_order_according_to_a_custom_lambda public void When_strings_are_unexpectedly_in_ascending_order_according_to_a_custom_lambda_it_should_throw() { // Arrange - string[] strings = { "barbara", "dennis", "roy" }; + string[] strings = ["barbara", "dennis", "roy"]; // Act Action act = () => @@ -838,7 +838,7 @@ public void public void When_asserting_the_items_in_a_collection_are_not_ordered_and_the_specified_property_is_null_it_should_throw() { // Arrange - var collection = Enumerable.Empty(); + IEnumerable collection = []; // Act Action act = () => collection.Should().NotBeInAscendingOrder((Expression>)null); @@ -852,7 +852,7 @@ public void When_asserting_the_items_in_a_collection_are_not_ordered_and_the_spe public void When_asserting_the_items_in_a_collection_are_not_ordered_and_the_given_comparer_is_null_it_should_throw() { // Arrange - var collection = Enumerable.Empty(); + IEnumerable collection = []; // Act Action act = () => collection.Should().NotBeInAscendingOrder(comparer: null); @@ -867,7 +867,7 @@ public void When_asserting_the_items_in_ay_collection_are_not_ordered_using_an_invalid_property_expression_it_should_throw() { // Arrange - var collection = Enumerable.Empty(); + IEnumerable collection = []; // Act Action act = () => collection.Should().NotBeInAscendingOrder(o => o.GetHashCode()); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInDescendingOrder.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInDescendingOrder.cs index 702fb674c0..a7d6e2ca26 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInDescendingOrder.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInDescendingOrder.cs @@ -42,7 +42,7 @@ public void When_asserting_the_items_in_an_unordered_collection_are_ordered_desc public void When_asserting_empty_collection_by_property_expression_ordered_in_descending_it_should_succeed() { // Arrange - var collection = Enumerable.Empty(); + IEnumerable collection = []; // Act Action act = () => collection.Should().BeInDescendingOrder(o => o.Number); @@ -55,7 +55,7 @@ public void When_asserting_empty_collection_by_property_expression_ordered_in_de public void When_asserting_empty_collection_with_no_parameters_ordered_in_descending_it_should_succeed() { // Arrange - var collection = new int[] { }; + int[] collection = []; // Act Action act = () => collection.Should().BeInDescendingOrder(); @@ -68,7 +68,7 @@ public void When_asserting_empty_collection_with_no_parameters_ordered_in_descen public void When_asserting_single_element_collection_with_no_parameters_ordered_in_descending_it_should_succeed() { // Arrange - var collection = new[] { 42 }; + int[] collection = [42]; // Act Action act = () => collection.Should().BeInDescendingOrder(); @@ -204,7 +204,7 @@ public void public void When_strings_are_in_descending_order_it_should_succeed() { // Arrange - string[] strings = { "theta", "beta", "alpha" }; + string[] strings = ["theta", "beta", "alpha"]; // Act Action act = () => strings.Should().BeInDescendingOrder(); @@ -217,7 +217,7 @@ public void When_strings_are_in_descending_order_it_should_succeed() public void When_strings_are_not_in_descending_order_it_should_throw() { // Arrange - string[] strings = { "theta", "alpha", "beta" }; + string[] strings = ["theta", "alpha", "beta"]; // Act Action act = () => strings.Should().BeInDescendingOrder("of {0}", "reasons"); @@ -232,7 +232,7 @@ public void When_strings_are_not_in_descending_order_it_should_throw() public void When_strings_are_in_descending_order_based_on_a_custom_comparer_it_should_succeed() { // Arrange - string[] strings = { "roy", "dennis", "barbara" }; + string[] strings = ["roy", "dennis", "barbara"]; // Act Action act = () => strings.Should().BeInDescendingOrder(new ByLastCharacterComparer()); @@ -245,7 +245,7 @@ public void When_strings_are_in_descending_order_based_on_a_custom_comparer_it_s public void When_strings_are_not_in_descending_order_based_on_a_custom_comparer_it_should_throw() { // Arrange - string[] strings = { "dennis", "roy", "barbara" }; + string[] strings = ["dennis", "roy", "barbara"]; // Act Action act = () => strings.Should().BeInDescendingOrder(new ByLastCharacterComparer(), "of {0}", "reasons"); @@ -260,7 +260,7 @@ public void When_strings_are_not_in_descending_order_based_on_a_custom_comparer_ public void When_strings_are_in_descending_order_based_on_a_custom_lambda_it_should_succeed() { // Arrange - string[] strings = { "roy", "dennis", "barbara" }; + string[] strings = ["roy", "dennis", "barbara"]; // Act Action act = () => strings.Should().BeInDescendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last())); @@ -273,7 +273,7 @@ public void When_strings_are_in_descending_order_based_on_a_custom_lambda_it_sho public void When_strings_are_not_in_descending_order_based_on_a_custom_lambda_it_should_throw() { // Arrange - string[] strings = { "dennis", "roy", "barbara" }; + string[] strings = ["dennis", "roy", "barbara"]; // Act Action act = () => @@ -345,7 +345,7 @@ public void public void When_asserting_empty_collection_by_property_expression_to_not_be_ordered_in_descending_it_should_throw() { // Arrange - var collection = Enumerable.Empty(); + IEnumerable collection = []; // Act Action act = () => collection.Should().NotBeInDescendingOrder(o => o.Number); @@ -359,7 +359,7 @@ public void When_asserting_empty_collection_by_property_expression_to_not_be_ord public void When_asserting_empty_collection_with_no_parameters_not_be_ordered_in_descending_it_should_throw() { // Arrange - var collection = new int[] { }; + int[] collection = []; // Act Action act = () => collection.Should().NotBeInDescendingOrder("because I say {0}", "so"); @@ -373,7 +373,7 @@ public void When_asserting_empty_collection_with_no_parameters_not_be_ordered_in public void When_asserting_single_element_collection_with_no_parameters_not_be_ordered_in_descending_it_should_throw() { // Arrange - var collection = new[] { 42 }; + int[] collection = [42]; // Act Action act = () => collection.Should().NotBeInDescendingOrder(); @@ -405,7 +405,7 @@ public void When_asserting_the_items_in_a_descending_ordered_collection_are_not_ordered_descending_using_the_given_comparer_it_should_throw() { // Arrange - var collection = new[] { 3, 2, 1 }; + int[] collection = [3, 2, 1]; // Act Action act = () => collection.Should().NotBeInDescendingOrder(Comparer.Default, "it should not be sorted"); @@ -420,7 +420,7 @@ public void When_asserting_the_items_not_in_an_descendingly_ordered_collection_are_not_ordered_descending_using_the_given_comparer_it_should_succeed() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().NotBeInDescendingOrder(Comparer.Default); @@ -513,7 +513,7 @@ public void public void When_strings_are_not_in_descending_order_it_should_succeed() { // Arrange - string[] strings = { "beta", "theta", "alpha" }; + string[] strings = ["beta", "theta", "alpha"]; // Act Action act = () => strings.Should().NotBeInDescendingOrder(); @@ -526,7 +526,7 @@ public void When_strings_are_not_in_descending_order_it_should_succeed() public void When_strings_are_unexpectedly_in_descending_order_it_should_throw() { // Arrange - string[] strings = { "theta", "beta", "alpha" }; + string[] strings = ["theta", "beta", "alpha"]; // Act Action act = () => strings.Should().NotBeInDescendingOrder("of {0}", "reasons"); @@ -541,7 +541,7 @@ public void When_strings_are_unexpectedly_in_descending_order_it_should_throw() public void When_strings_are_not_in_descending_order_based_on_a_custom_comparer_it_should_succeed() { // Arrange - string[] strings = { "roy", "barbara", "dennis" }; + string[] strings = ["roy", "barbara", "dennis"]; // Act Action act = () => strings.Should().NotBeInDescendingOrder(new ByLastCharacterComparer()); @@ -554,7 +554,7 @@ public void When_strings_are_not_in_descending_order_based_on_a_custom_comparer_ public void When_strings_are_unexpectedly_in_descending_order_based_on_a_custom_comparer_it_should_throw() { // Arrange - string[] strings = { "roy", "dennis", "barbara" }; + string[] strings = ["roy", "dennis", "barbara"]; // Act Action act = () => strings.Should().NotBeInDescendingOrder(new ByLastCharacterComparer(), "of {0}", "reasons"); @@ -569,7 +569,7 @@ public void When_strings_are_unexpectedly_in_descending_order_based_on_a_custom_ public void When_strings_are_not_in_descending_order_based_on_a_custom_lambda_it_should_succeed() { // Arrange - string[] strings = { "dennis", "roy", "barbara" }; + string[] strings = ["dennis", "roy", "barbara"]; // Act Action act = () => strings.Should().NotBeInDescendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last())); @@ -582,7 +582,7 @@ public void When_strings_are_not_in_descending_order_based_on_a_custom_lambda_it public void When_strings_are_unexpectedly_in_descending_order_based_on_a_custom_lambda_it_should_throw() { // Arrange - string[] strings = { "roy", "dennis", "barbara" }; + string[] strings = ["roy", "dennis", "barbara"]; // Act Action act = () => diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeNullOrEmpty.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeNullOrEmpty.cs index 5015bf3f5f..99137dd355 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeNullOrEmpty.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeNullOrEmpty.cs @@ -38,7 +38,7 @@ public void When_asserting_non_empty_collection_to_be_null_or_empty_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().BeNullOrEmpty("because we want to test the failure {0}", "message"); @@ -108,7 +108,7 @@ public void public void When_asserting_collection_to_not_be_null_or_empty_it_should_enumerate_only_once() { // Arrange - var collection = new CountingGenericEnumerable(new[] { 42 }); + var collection = new CountingGenericEnumerable([42]); // Act collection.Should().NotBeNullOrEmpty(); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeSubsetOf.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeSubsetOf.cs index 5c4deecc10..42a9ab342f 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeSubsetOf.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeSubsetOf.cs @@ -16,8 +16,8 @@ public class BeSubsetOf public void When_collection_is_subset_of_a_specified_collection_it_should_not_throw() { // Arrange - var subset = new[] { 1, 2 }; - var superset = new[] { 1, 2, 3 }; + int[] subset = [1, 2]; + int[] superset = [1, 2, 3]; // Act / Assert subset.Should().BeSubsetOf(superset); @@ -27,8 +27,8 @@ public void When_collection_is_subset_of_a_specified_collection_it_should_not_th public void When_collection_is_not_a_subset_of_another_it_should_throw_with_the_reason() { // Arrange - var subset = new[] { 1, 2, 3, 6 }; - var superset = new[] { 1, 2, 4, 5 }; + int[] subset = [1, 2, 3, 6]; + int[] superset = [1, 2, 4, 5]; // Act Action act = () => subset.Should().BeSubsetOf(superset, "because we want to test the failure {0}", "message"); @@ -43,8 +43,8 @@ public void When_collection_is_not_a_subset_of_another_it_should_throw_with_the_ public void When_an_empty_collection_is_tested_against_a_superset_it_should_succeed() { // Arrange - var subset = new int[0]; - var superset = new[] { 1, 2, 4, 5 }; + int[] subset = []; + int[] superset = [1, 2, 4, 5]; // Act Action act = () => subset.Should().BeSubsetOf(superset); @@ -57,7 +57,7 @@ public void When_an_empty_collection_is_tested_against_a_superset_it_should_succ public void When_a_subset_is_tested_against_a_null_superset_it_should_throw_with_a_clear_explanation() { // Arrange - var subset = new[] { 1, 2, 3 }; + int[] subset = [1, 2, 3]; int[] superset = null; // Act @@ -72,8 +72,8 @@ public void When_a_subset_is_tested_against_a_null_superset_it_should_throw_with public void When_a_set_is_expected_to_be_not_a_subset_it_should_succeed() { // Arrange - var subject = new[] { 1, 2, 4 }; - var otherSet = new[] { 1, 2, 3 }; + int[] subject = [1, 2, 4]; + int[] otherSet = [1, 2, 3]; // Act / Assert subject.Should().NotBeSubsetOf(otherSet); @@ -86,8 +86,8 @@ public class NotBeSubsetOf public void When_an_empty_set_is_not_supposed_to_be_a_subset_of_another_set_it_should_throw() { // Arrange - var subject = new int[] { }; - var otherSet = new[] { 1, 2, 3 }; + int[] subject = []; + int[] otherSet = [1, 2, 3]; // Act Action act = () => subject.Should().NotBeSubsetOf(otherSet); @@ -101,8 +101,8 @@ public void When_an_empty_set_is_not_supposed_to_be_a_subset_of_another_set_it_s public void Should_fail_when_asserting_collection_is_not_subset_of_a_superset_collection() { // Arrange - var subject = new[] { 1, 2 }; - var otherSet = new[] { 1, 2, 3 }; + int[] subject = [1, 2]; + int[] otherSet = [1, 2, 3]; // Act Action act = () => subject.Should().NotBeSubsetOf(otherSet, "because I'm {0}", "mistaken"); @@ -117,7 +117,7 @@ public void When_asserting_collection_to_be_subset_against_null_collection_it_sh { // Arrange int[] collection = null; - var collection1 = new[] { 1, 2, 3 }; + int[] collection1 = [1, 2, 3]; // Act Action act = () => @@ -135,7 +135,7 @@ public void When_asserting_collection_to_be_subset_against_null_collection_it_sh public void When_asserting_collection_to_not_be_subset_against_same_collection_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; var collection1 = collection; // Act @@ -157,7 +157,7 @@ public void When_asserting_collection_to_not_be_subset_against_null_collection_i Action act = () => { using var _ = new AssertionScope(); - collection.Should().NotBeSubsetOf(new[] { 1, 2, 3 }, "we want to test the failure {0}", "message"); + collection.Should().NotBeSubsetOf([1, 2, 3], "we want to test the failure {0}", "message"); }; // Assert diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Contain.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Contain.cs index fba270d0b8..f4845cdc0a 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Contain.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Contain.cs @@ -17,7 +17,7 @@ public class Contain public void Should_succeed_when_asserting_collection_contains_an_item_from_the_collection() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().Contain(1); @@ -27,17 +27,17 @@ public void Should_succeed_when_asserting_collection_contains_an_item_from_the_c public void Should_succeed_when_asserting_collection_contains_multiple_items_from_the_collection_in_any_order() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert - collection.Should().Contain(new[] { 2, 1 }); + collection.Should().Contain([2, 1]); } [Fact] public void When_a_collection_does_not_contain_single_item_it_should_throw_with_clear_explanation() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().Contain(4, "because {0}", "we do"); @@ -69,10 +69,10 @@ public void When_asserting_collection_does_contain_item_against_null_collection_ public void When_a_collection_does_not_contain_another_collection_it_should_throw_with_clear_explanation() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act - Action act = () => collection.Should().Contain(new[] { 3, 4, 5 }, "because {0}", "we do"); + Action act = () => collection.Should().Contain([3, 4, 5], "because {0}", "we do"); // Assert act.Should().Throw().WithMessage( @@ -83,10 +83,10 @@ public void When_a_collection_does_not_contain_another_collection_it_should_thro public void When_a_collection_does_not_contain_a_single_element_collection_it_should_throw_with_clear_explanation() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act - Action act = () => collection.Should().Contain(new[] { 4 }, "because {0}", "we do"); + Action act = () => collection.Should().Contain([4], "because {0}", "we do"); // Assert act.Should().Throw().WithMessage( @@ -98,13 +98,13 @@ public void When_a_collection_does_not_contain_other_collection_with_assertion_scope_it_should_throw_with_clear_explanation() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => { using var _ = new AssertionScope(); - collection.Should().Contain(new[] { 4 }).And.Contain(new[] { 5, 6 }); + collection.Should().Contain([4]).And.Contain([5, 6]); }; // Assert @@ -116,7 +116,7 @@ public void public void When_the_contents_of_a_collection_are_checked_against_an_empty_collection_it_should_throw_clear_explanation() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().Contain(new int[0]); @@ -136,7 +136,7 @@ public void When_asserting_collection_does_contain_a_list_of_items_against_null_ Action act = () => { using var _ = new AssertionScope(); - collection.Should().Contain(new[] { 1, 2 }, "we want to test the failure {0}", "message"); + collection.Should().Contain([1, 2], "we want to test the failure {0}", "message"); }; // Assert @@ -148,7 +148,7 @@ public void When_asserting_collection_does_contain_a_list_of_items_against_null_ public void When_injecting_a_null_predicate_into_Contain_it_should_throw() { // Arrange - IEnumerable collection = new int[] { }; + IEnumerable collection = []; // Act Action act = () => collection.Should().Contain(predicate: null); @@ -162,7 +162,7 @@ public void When_injecting_a_null_predicate_into_Contain_it_should_throw() public void When_collection_does_not_contain_an_expected_item_matching_a_predicate_it_should_throw() { // Arrange - IEnumerable collection = new[] { 1, 2, 3 }; + IEnumerable collection = [1, 2, 3]; // Act Action act = () => collection.Should().Contain(item => item > 3, "at least {0} item should be larger than 3", 1); @@ -176,7 +176,7 @@ public void When_collection_does_not_contain_an_expected_item_matching_a_predica public void When_collection_does_contain_an_expected_item_matching_a_predicate_it_should_allow_chaining_it() { // Arrange - IEnumerable collection = new[] { 1, 2, 3 }; + IEnumerable collection = [1, 2, 3]; // Act Action act = () => collection.Should().Contain(item => item == 2).Which.Should().BeGreaterThan(4); @@ -190,7 +190,7 @@ public void When_collection_does_contain_an_expected_item_matching_a_predicate_i public void When_collection_does_contain_an_expected_item_matching_a_predicate_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { 1, 2, 3 }; + IEnumerable collection = [1, 2, 3]; // Act / Assert collection.Should().Contain(item => item == 2); @@ -278,7 +278,7 @@ public class NotContain public void Should_succeed_when_asserting_collection_does_not_contain_an_item_that_is_not_in_the_collection() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().NotContain(4); @@ -288,17 +288,17 @@ public void Should_succeed_when_asserting_collection_does_not_contain_an_item_th public void Should_succeed_when_asserting_collection_does_not_contain_any_items_that_is_not_in_the_collection() { // Arrange - IEnumerable collection = new[] { 1, 2, 3 }; + IEnumerable collection = [1, 2, 3]; // Act / Assert - collection.Should().NotContain(new[] { 4, 5 }); + collection.Should().NotContain([4, 5]); } [Fact] public void When_collection_contains_an_unexpected_item_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().NotContain(1, "because we {0} like it, but found it anyhow", "don't"); @@ -312,7 +312,7 @@ public void When_collection_contains_an_unexpected_item_it_should_throw() public void When_injecting_a_null_predicate_into_NotContain_it_should_throw() { // Arrange - IEnumerable collection = new int[] { }; + IEnumerable collection = []; // Act Action act = () => collection.Should().NotContain(predicate: null); @@ -326,7 +326,7 @@ public void When_injecting_a_null_predicate_into_NotContain_it_should_throw() public void When_collection_does_contain_an_unexpected_item_matching_a_predicate_it_should_throw() { // Arrange - IEnumerable collection = new[] { 1, 2, 3 }; + IEnumerable collection = [1, 2, 3]; // Act Action act = () => collection.Should().NotContain(item => item == 2, "because {0}s are evil", 2); @@ -340,7 +340,7 @@ public void When_collection_does_contain_an_unexpected_item_matching_a_predicate public void When_collection_does_not_contain_an_unexpected_item_matching_a_predicate_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { 1, 2, 3 }; + IEnumerable collection = [1, 2, 3]; // Act / Assert collection.Should().NotContain(item => item == 4); @@ -368,11 +368,11 @@ public void When_asserting_collection_does_not_contain_item_against_null_collect public void When_collection_contains_unexpected_item_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should() - .NotContain(new[] { 2 }, "because we {0} like them", "don't"); + .NotContain([2], "because we {0} like them", "don't"); // Assert act.Should().Throw().WithMessage( @@ -383,11 +383,11 @@ public void When_collection_contains_unexpected_item_it_should_throw() public void When_collection_contains_unexpected_items_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should() - .NotContain(new[] { 1, 2, 4 }, "because we {0} like them", "don't"); + .NotContain([1, 2, 4], "because we {0} like them", "don't"); // Assert act.Should().Throw().WithMessage( @@ -398,13 +398,13 @@ public void When_collection_contains_unexpected_items_it_should_throw() public void When_asserting_multiple_collection_in_assertion_scope_all_should_be_reported() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => { using var _ = new AssertionScope(); - collection.Should().NotContain(new[] { 1, 2 }).And.NotContain(new[] { 3 }); + collection.Should().NotContain([1, 2]).And.NotContain([3]); }; // Assert @@ -416,10 +416,10 @@ public void When_asserting_multiple_collection_in_assertion_scope_all_should_be_ public void When_asserting_collection_to_not_contain_an_empty_collection_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act - Action act = () => collection.Should().NotContain(Array.Empty()); + Action act = () => collection.Should().NotContain([]); // Assert act.Should().Throw().WithMessage("Cannot verify*"); @@ -453,7 +453,7 @@ public void When_asserting_collection_does_not_contain_a_list_of_items_against_n Action act = () => { using var _ = new AssertionScope(); - collection.Should().NotContain(new[] { 1, 2, 4 }, "we want to test the failure {0}", "message"); + collection.Should().NotContain([1, 2, 4], "we want to test the failure {0}", "message"); }; // Assert diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainEquivalentOf.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainEquivalentOf.cs index 44fbdec445..b17d0a3c10 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainEquivalentOf.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainEquivalentOf.cs @@ -49,7 +49,7 @@ public void When_character_collection_does_contain_equivalent_it_should_succeed( public void When_string_collection_does_contain_same_string_with_other_case_it_should_throw() { // Arrange - string[] collection = { "a", "b", "c" }; + string[] collection = ["a", "b", "c"]; string item = "C"; // Act @@ -64,7 +64,7 @@ public void When_string_collection_does_contain_same_string_with_other_case_it_s public void When_string_collection_does_contain_same_string_it_should_throw_with_a_useful_message() { // Arrange - string[] collection = { "a" }; + string[] collection = ["a"]; string item = "b"; // Act @@ -80,7 +80,7 @@ public void When_string_collection_does_contain_same_string_it_should_throw_with public void When_collection_does_not_contain_object_equivalent_of_another_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; int item = 4; // Act @@ -127,7 +127,7 @@ public void When_collection_contains_equivalent_null_object_it_should_succeed() public void When_collection_does_not_contain_equivalent_null_object_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; int? item = null; // Act @@ -248,7 +248,7 @@ public void When_injecting_a_null_config_to_ContainEquivalentOf_it_should_throw( public void When_collection_contains_object_equivalent_of_boxed_object_it_should_succeed() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; object boxedValue = 2; // Act / Assert @@ -263,7 +263,7 @@ public void When_collection_contains_object_equal_to_another_it_should_throw() { // Arrange var item = 1; - var collection = new[] { 0, 1 }; + int[] collection = [0, 1]; // Act Action act = () => @@ -280,7 +280,7 @@ public void When_collection_contains_several_objects_equal_to_another_it_should_ { // Arrange var item = 1; - var collection = new[] { 0, 1, 1 }; + int[] collection = [0, 1, 1]; // Act Action act = () => @@ -354,7 +354,7 @@ public void When_asserting_a_null_collection_to_not_contain_equivalent_of__then_ public void When_collection_does_not_contain_object_equivalent_of_unexpected_it_should_succeed() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; int item = 4; // Act / Assert @@ -392,7 +392,7 @@ public void When_asserting_collection_to_not_contain_equivalent_it_should_respec public void When_asserting_collection_to_not_contain_equivalent_it_should_allow_combining_inside_assertion_scope() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; int another = 3; // Act diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainInConsecutiveOrder.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainInConsecutiveOrder.cs index 788e6865cf..3105cc3201 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainInConsecutiveOrder.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainInConsecutiveOrder.cs @@ -16,7 +16,7 @@ public class ContainInConsecutiveOrder public void When_the_first_collection_contains_a_duplicate_item_without_affecting_the_explicit_order_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3, 2 }; + int[] collection = [1, 2, 3, 2]; // Act / Assert collection.Should().ContainInConsecutiveOrder(1, 2, 3); @@ -26,7 +26,7 @@ public void When_the_first_collection_contains_a_duplicate_item_without_affectin public void When_the_second_collection_contains_just_1_item_included_in_the_first_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3, 2 }; + int[] collection = [1, 2, 3, 2]; // Act / Assert collection.Should().ContainInConsecutiveOrder(2); @@ -37,7 +37,7 @@ public void When_the_first_collection_contains_a_partial_duplicate_sequence_at_the_start_without_affecting_the_explicit_order_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 1, 2, 3, 2 }; + int[] collection = [1, 2, 1, 2, 3, 2]; // Act / Assert collection.Should().ContainInConsecutiveOrder(1, 2, 3); @@ -47,7 +47,7 @@ public void public void When_two_collections_contain_the_same_duplicate_items_in_the_same_explicit_order_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 1, 2, 12, 2, 2 }; + int[] collection = [1, 2, 1, 2, 12, 2, 2]; // Act / Assert collection.Should().ContainInConsecutiveOrder(1, 2, 1, 2, 12, 2, 2); @@ -57,7 +57,7 @@ public void When_two_collections_contain_the_same_duplicate_items_in_the_same_ex public void When_checking_for_an_empty_list_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 1, 2, 12, 2, 2 }; + int[] collection = [1, 2, 1, 2, 12, 2, 2]; // Act / Assert collection.Should().ContainInConsecutiveOrder(); @@ -77,7 +77,7 @@ public void When_collection_contains_null_value_it_should_not_throw() public void When_two_collections_contain_the_same_items_but_not_in_the_same_explicit_order_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 2, 3 }; + int[] collection = [1, 2, 2, 3]; // Act / Assert Action act = () => collection.Should().ContainInConsecutiveOrder(1, 2, 3); @@ -91,7 +91,7 @@ public void When_two_collections_contain_the_same_items_but_not_in_the_same_expl public void When_the_second_collection_contains_just_1_item_not_included_in_the_first_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 2, 3 }; + int[] collection = [1, 2, 2, 3]; // Act / Assert Action act = () => collection.Should().ContainInConsecutiveOrder(4); @@ -105,7 +105,7 @@ public void When_the_second_collection_contains_just_1_item_not_included_in_the_ public void When_end_of_first_collection_is_a_partial_match_of_second_at_end_it_should_throw() { // Arrange - var collection = new[] { 1, 3, 1, 2 }; + int[] collection = [1, 3, 1, 2]; // Act / Assert Action act = () => collection.Should().ContainInConsecutiveOrder(1, 2, 3); @@ -119,7 +119,7 @@ public void When_end_of_first_collection_is_a_partial_match_of_second_at_end_it_ public void When_a_collection_does_not_contain_a_range_twice_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 1, 2, 3, 12, 2, 2 }; + int[] collection = [1, 2, 1, 2, 3, 12, 2, 2]; // Act Action act = () => collection.Should().ContainInConsecutiveOrder(1, 2, 1, 1, 2); @@ -133,7 +133,7 @@ public void When_a_collection_does_not_contain_a_range_twice_it_should_throw() public void When_two_collections_contain_the_same_items_but_in_different_order_it_should_throw_with_a_clear_explanation() { // Act - Action act = () => new[] { 1, 2, 3 }.Should().ContainInConsecutiveOrder(new[] { 3, 1 }, "because we said so"); + Action act = () => new[] { 1, 2, 3 }.Should().ContainInConsecutiveOrder([3, 1], "because we said so"); // Assert act.Should().Throw().WithMessage( @@ -144,7 +144,7 @@ public void When_two_collections_contain_the_same_items_but_in_different_order_i public void When_a_collection_does_not_contain_an_ordered_item_it_should_throw_with_a_clear_explanation() { // Act - Action act = () => new[] { 1, 2, 3 }.Should().ContainInConsecutiveOrder(new[] { 4, 1 }, "we failed"); + Action act = () => new[] { 1, 2, 3 }.Should().ContainInConsecutiveOrder([4, 1], "we failed"); // Assert act.Should().Throw().WithMessage( @@ -175,7 +175,7 @@ public void When_asserting_collection_contains_some_values_in_order_but_collecti using var _ = new AssertionScope(); collection.Should() - .ContainInConsecutiveOrder(new[] { 4 }, "because we're checking how it reacts to a null subject"); + .ContainInConsecutiveOrder([4], "because we're checking how it reacts to a null subject"); }; // Assert @@ -190,7 +190,7 @@ public class NotContainInConsecutiveOrder public void When_two_collections_contain_the_same_items_but_in_different_order_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().NotContainInConsecutiveOrder(2, 1); @@ -200,7 +200,7 @@ public void When_two_collections_contain_the_same_items_but_in_different_order_i public void When_the_second_collection_contains_just_1_item_not_included_in_the_first_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().NotContainInConsecutiveOrder(4); @@ -210,7 +210,7 @@ public void When_the_second_collection_contains_just_1_item_not_included_in_the_ public void When_a_collection_does_not_contain_an_ordered_item_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().NotContainInConsecutiveOrder(4, 1); @@ -220,7 +220,7 @@ public void When_a_collection_does_not_contain_an_ordered_item_it_should_not_thr public void When_checking_for_an_empty_list_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().NotContainInConsecutiveOrder(); @@ -230,7 +230,7 @@ public void When_checking_for_an_empty_list_it_should_not_throw() public void When_a_collection_contains_less_items_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2 }; + int[] collection = [1, 2]; // Act / Assert collection.Should().NotContainInConsecutiveOrder(1, 2, 3); @@ -240,7 +240,7 @@ public void When_a_collection_contains_less_items_it_should_not_throw() public void When_a_collection_does_not_contain_a_range_twice_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 1, 2, 3, 12, 2, 2 }; + int[] collection = [1, 2, 1, 2, 3, 12, 2, 2]; // Act / Assert collection.Should().NotContainInConsecutiveOrder(1, 2, 1, 1, 2); @@ -250,10 +250,10 @@ public void When_a_collection_does_not_contain_a_range_twice_it_should_not_throw public void When_two_collections_contain_the_same_items_not_in_the_same_explicit_order_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 1, 2, 2, 3 }; + int[] collection = [1, 2, 1, 2, 2, 3]; // Act - collection.Should().NotContainInConsecutiveOrder(new[] { 1, 2, 3 }, "that's what we expect"); + collection.Should().NotContainInConsecutiveOrder([1, 2, 3], "that's what we expect"); } [Fact] @@ -280,7 +280,7 @@ public void When_collection_is_null_then_not_contain_in_order_should_fail() Action act = () => { using var _ = new AssertionScope(); - collection.Should().NotContainInConsecutiveOrder(new[] { 1, 2, 3 }, "we want to test the failure {0}", "message"); + collection.Should().NotContainInConsecutiveOrder([1, 2, 3], "we want to test the failure {0}", "message"); }; // Assert @@ -322,7 +322,7 @@ public void When_the_second_collection_contains_just_1_item_included_in_the_firs public void When_the_first_collection_contains_a_duplicate_item_without_affecting_the_order_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3, 2 }; + int[] collection = [1, 2, 3, 2]; // Act Action act = () => collection.Should().NotContainInConsecutiveOrder(1, 2, 3); @@ -337,7 +337,7 @@ public void When_the_first_collection_contains_a_duplicate_item_without_affectin public void When_the_first_collection_contains_a_duplicate_item_not_at_start_without_affecting_the_order_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 1, 2, 3, 4, 5, 1, 2 }; + int[] collection = [1, 2, 1, 2, 3, 4, 5, 1, 2]; // Act Action act = () => collection.Should().NotContainInConsecutiveOrder(1, 2, 3); @@ -352,7 +352,7 @@ public void When_the_first_collection_contains_a_duplicate_item_not_at_start_wit public void When_two_collections_contain_the_same_duplicate_items_in_the_same_order_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 1, 2, 12, 2, 2 }; + int[] collection = [1, 2, 1, 2, 12, 2, 2]; // Act Action act = () => collection.Should().NotContainInConsecutiveOrder(1, 2, 1, 2, 12, 2, 2); @@ -367,7 +367,7 @@ public void When_two_collections_contain_the_same_duplicate_items_in_the_same_or public void When_passing_in_null_while_checking_for_absence_of_ordered_containment_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().NotContainInConsecutiveOrder(null); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainInOrder.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainInOrder.cs index 2ad07202f5..da7dafbc61 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainInOrder.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainInOrder.cs @@ -16,7 +16,7 @@ public class ContainInOrder public void When_two_collections_contain_the_same_items_in_the_same_order_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 2, 3 }; + int[] collection = [1, 2, 2, 3]; // Act / Assert collection.Should().ContainInOrder(1, 2, 3); @@ -36,7 +36,7 @@ public void When_collection_contains_null_value_it_should_not_throw() public void When_the_first_collection_contains_a_duplicate_item_without_affecting_the_order_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3, 2 }; + int[] collection = [1, 2, 3, 2]; // Act / Assert collection.Should().ContainInOrder(1, 2, 3); @@ -46,7 +46,7 @@ public void When_the_first_collection_contains_a_duplicate_item_without_affectin public void When_two_collections_contain_the_same_duplicate_items_in_the_same_order_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 1, 2, 12, 2, 2 }; + int[] collection = [1, 2, 1, 2, 12, 2, 2]; // Act / Assert collection.Should().ContainInOrder(1, 2, 1, 2, 12, 2, 2); @@ -56,7 +56,7 @@ public void When_two_collections_contain_the_same_duplicate_items_in_the_same_or public void When_a_collection_does_not_contain_a_range_twice_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 1, 3, 12, 2, 2 }; + int[] collection = [1, 2, 1, 3, 12, 2, 2]; // Act Action act = () => collection.Should().ContainInOrder(1, 2, 1, 1, 2); @@ -70,7 +70,7 @@ public void When_a_collection_does_not_contain_a_range_twice_it_should_throw() public void When_two_collections_contain_the_same_items_but_in_different_order_it_should_throw_with_a_clear_explanation() { // Act - Action act = () => new[] { 1, 2, 3 }.Should().ContainInOrder(new[] { 3, 1 }, "because we said so"); + Action act = () => new[] { 1, 2, 3 }.Should().ContainInOrder([3, 1], "because we said so"); // Assert act.Should().Throw().WithMessage( @@ -81,7 +81,7 @@ public void When_two_collections_contain_the_same_items_but_in_different_order_i public void When_a_collection_does_not_contain_an_ordered_item_it_should_throw_with_a_clear_explanation() { // Act - Action act = () => new[] { 1, 2, 3 }.Should().ContainInOrder(new[] { 4, 1 }, "we failed"); + Action act = () => new[] { 1, 2, 3 }.Should().ContainInOrder([4, 1], "we failed"); // Assert act.Should().Throw().WithMessage( @@ -139,7 +139,7 @@ public void When_asserting_collection_contains_some_values_in_order_but_collecti Action act = () => { using var _ = new AssertionScope(); - ints.Should().ContainInOrder(new[] { 4 }, "because we're checking how it reacts to a null subject"); + ints.Should().ContainInOrder([4], "because we're checking how it reacts to a null subject"); }; // Assert @@ -154,7 +154,7 @@ public class NotContainInOrder public void When_two_collections_contain_the_same_items_but_in_different_order_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().NotContainInOrder(2, 1); @@ -164,7 +164,7 @@ public void When_two_collections_contain_the_same_items_but_in_different_order_i public void When_a_collection_does_not_contain_an_ordered_item_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().NotContainInOrder(4, 1); @@ -174,7 +174,7 @@ public void When_a_collection_does_not_contain_an_ordered_item_it_should_not_thr public void When_a_collection_contains_less_items_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2 }; + int[] collection = [1, 2]; // Act / Assert collection.Should().NotContainInOrder(1, 2, 3); @@ -184,7 +184,7 @@ public void When_a_collection_contains_less_items_it_should_not_throw() public void When_a_collection_does_not_contain_a_range_twice_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 1, 3, 12, 2, 2 }; + int[] collection = [1, 2, 1, 3, 12, 2, 2]; // Act / Assert collection.Should().NotContainInOrder(1, 2, 1, 1, 2); @@ -208,10 +208,10 @@ public void When_asserting_collection_does_not_contain_some_values_in_order_but_ public void When_two_collections_contain_the_same_items_in_the_same_order_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 2, 3 }; + int[] collection = [1, 2, 2, 3]; // Act - Action act = () => collection.Should().NotContainInOrder(new[] { 1, 2, 3 }, "that's what we expect"); + Action act = () => collection.Should().NotContainInOrder([1, 2, 3], "that's what we expect"); // Assert act.Should().Throw().WithMessage( @@ -229,7 +229,7 @@ public void When_collection_is_null_then_not_contain_in_order_should_fail() Action act = () => { using var _ = new AssertionScope(); - collection.Should().NotContainInOrder(new[] { 1, 2, 3 }, "we want to test the failure {0}", "message"); + collection.Should().NotContainInOrder([1, 2, 3], "we want to test the failure {0}", "message"); }; // Assert @@ -256,7 +256,7 @@ public void When_collection_contains_contain_the_same_items_in_the_same_order_wi public void When_the_first_collection_contains_a_duplicate_item_without_affecting_the_order_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3, 2 }; + int[] collection = [1, 2, 3, 2]; // Act Action act = () => collection.Should().NotContainInOrder(1, 2, 3); @@ -271,7 +271,7 @@ public void When_the_first_collection_contains_a_duplicate_item_without_affectin public void When_two_collections_contain_the_same_duplicate_items_in_the_same_order_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 1, 2, 12, 2, 2 }; + int[] collection = [1, 2, 1, 2, 12, 2, 2]; // Act Action act = () => collection.Should().NotContainInOrder(1, 2, 1, 2, 12, 2, 2); @@ -286,7 +286,7 @@ public void When_two_collections_contain_the_same_duplicate_items_in_the_same_or public void When_passing_in_null_while_checking_for_absence_of_ordered_containment_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().NotContainInOrder(null); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainItemsAssignableTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainItemsAssignableTo.cs index 8faa500717..6008695b50 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainItemsAssignableTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainItemsAssignableTo.cs @@ -59,7 +59,7 @@ public void When_asserting_collection_contains_item_assignable_to_against_null_c public void When_a_collection_is_empty_an_exception_should_be_thrown() { // Arrange - int[] collection = Array.Empty(); + int[] collection = []; // Act Action act = () => collection.Should().ContainItemsAssignableTo(); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainSingle.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainSingle.cs index c64c1c21bb..524b786a94 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainSingle.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainSingle.cs @@ -17,7 +17,7 @@ public partial class CollectionAssertionSpecs public void When_injecting_a_null_predicate_into_ContainSingle_it_should_throw() { // Arrange - IEnumerable collection = new int[] { }; + IEnumerable collection = []; // Act Action act = () => collection.Should().ContainSingle(predicate: null); @@ -31,7 +31,7 @@ public void When_injecting_a_null_predicate_into_ContainSingle_it_should_throw() public void When_a_collection_contains_a_single_item_matching_a_predicate_it_should_succeed() { // Arrange - IEnumerable collection = new[] { 1, 2, 3 }; + IEnumerable collection = [1, 2, 3]; Expression> expression = item => item == 2; // Act @@ -45,7 +45,7 @@ public void When_a_collection_contains_a_single_item_matching_a_predicate_it_sho public void When_asserting_an_empty_collection_contains_a_single_item_matching_a_predicate_it_should_throw() { // Arrange - IEnumerable collection = Enumerable.Empty(); + IEnumerable collection = []; Expression> expression = item => item == 2; // Act @@ -83,7 +83,7 @@ public void When_asserting_a_null_collection_contains_a_single_item_matching_a_p public void When_non_empty_collection_does_not_contain_a_single_item_matching_a_predicate_it_should_throw() { // Arrange - IEnumerable collection = new[] { 1, 3 }; + IEnumerable collection = [1, 3]; Expression> expression = item => item == 2; // Act @@ -100,7 +100,7 @@ public void When_non_empty_collection_does_not_contain_a_single_item_matching_a_ public void When_non_empty_collection_contains_more_than_a_single_item_matching_a_predicate_it_should_throw() { // Arrange - IEnumerable collection = new[] { 1, 2, 2, 2, 3 }; + IEnumerable collection = [1, 2, 2, 2, 3]; Expression> expression = item => item == 2; // Act @@ -117,7 +117,7 @@ public void When_non_empty_collection_contains_more_than_a_single_item_matching_ public void When_single_item_matching_a_predicate_is_found_it_should_allow_continuation() { // Arrange - IEnumerable collection = new[] { 1, 2, 3 }; + IEnumerable collection = [1, 2, 3]; // Act Action act = () => collection.Should().ContainSingle(item => item == 2).Which.Should().BeGreaterThan(4); @@ -158,7 +158,7 @@ public void When_single_item_contains_string_interpolation_it_should_format_brac public void When_a_collection_contains_a_single_item_it_should_succeed() { // Arrange - IEnumerable collection = new[] { 1 }; + IEnumerable collection = [1]; // Act Action act = () => collection.Should().ContainSingle(); @@ -171,7 +171,7 @@ public void When_a_collection_contains_a_single_item_it_should_succeed() public void When_asserting_an_empty_collection_contains_a_single_item_it_should_throw() { // Arrange - IEnumerable collection = Enumerable.Empty(); + IEnumerable collection = []; // Act Action act = () => collection.Should().ContainSingle("more is not allowed"); @@ -204,7 +204,7 @@ public void When_asserting_a_null_collection_contains_a_single_item_it_should_th public void When_non_empty_collection_does_not_contain_a_single_item_it_should_throw() { // Arrange - IEnumerable collection = new[] { 1, 3 }; + IEnumerable collection = [1, 3]; // Act Action act = () => collection.Should().ContainSingle(); @@ -219,7 +219,7 @@ public void When_non_empty_collection_does_not_contain_a_single_item_it_should_t public void When_non_empty_collection_contains_more_than_a_single_item_it_should_throw() { // Arrange - IEnumerable collection = new[] { 1, 2 }; + IEnumerable collection = [1, 2]; // Act Action act = () => collection.Should().ContainSingle(); @@ -234,7 +234,7 @@ public void When_non_empty_collection_contains_more_than_a_single_item_it_should public void When_single_item_is_found_it_should_allow_continuation() { // Arrange - IEnumerable collection = new[] { 3 }; + IEnumerable collection = [3]; // Act Action act = () => collection.Should().ContainSingle().Which.Should().BeGreaterThan(4); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.EndWith.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.EndWith.cs index c29465afe3..e9b1996652 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.EndWith.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.EndWith.cs @@ -229,7 +229,7 @@ public void When_non_empty_collection_ends_with_the_empty_sequence_it_should_not public void When_empty_collection_ends_with_the_empty_sequence_it_should_not_throw() { // Arrange - var collection = new string[] { }; + string[] collection = []; // Act Action act = () => collection.Should().EndWith(new string[] { }); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Equal.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Equal.cs index 0f87d4b6fa..0953aa4fd3 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Equal.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Equal.cs @@ -17,8 +17,8 @@ public class Equal public void Should_succeed_when_asserting_collection_is_equal_to_the_same_collection() { // Arrange - var collection1 = new[] { 1, 2, 3 }; - var collection2 = new[] { 1, 2, 3 }; + int[] collection1 = [1, 2, 3]; + int[] collection2 = [1, 2, 3]; // Act / Assert collection1.Should().Equal(collection2); @@ -28,7 +28,7 @@ public void Should_succeed_when_asserting_collection_is_equal_to_the_same_collec public void Should_succeed_when_asserting_collection_is_equal_to_the_same_list_of_elements() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().Equal(1, 2, 3); @@ -65,8 +65,8 @@ public void When_two_collections_containing_nulls_are_equal_it_should_not_throw( public void When_two_collections_are_not_equal_because_one_item_differs_it_should_throw_using_the_reason() { // Arrange - var collection1 = new[] { 1, 2, 3 }; - var collection2 = new[] { 1, 2, 5 }; + int[] collection1 = [1, 2, 3]; + int[] collection2 = [1, 2, 5]; // Act Action act = () => collection1.Should().Equal(collection2, "because we want to test the failure {0}", "message"); @@ -81,8 +81,8 @@ public void When_two_collections_are_not_equal_because_the_actual_collection_contains_more_items_it_should_throw_using_the_reason() { // Arrange - var collection1 = new[] { 1, 2, 3 }; - var collection2 = new[] { 1, 2 }; + int[] collection1 = [1, 2, 3]; + int[] collection2 = [1, 2]; // Act Action act = () => collection1.Should().Equal(collection2, "because we want to test the failure {0}", "message"); @@ -97,8 +97,8 @@ public void When_two_collections_are_not_equal_because_the_actual_collection_contains_less_items_it_should_throw_using_the_reason() { // Arrange - var collection1 = new[] { 1, 2, 3 }; - var collection2 = new[] { 1, 2, 3, 4 }; + int[] collection1 = [1, 2, 3]; + int[] collection2 = [1, 2, 3, 4]; // Act Action act = () => collection1.Should().Equal(collection2, "because we want to test the failure {0}", "message"); @@ -112,8 +112,8 @@ public void public void When_two_multidimensional_collections_are_not_equal_and_it_should_format_the_collections_properly() { // Arrange - var collection1 = new[] { new[] { 1, 2 }, new[] { 3, 4 } }; - var collection2 = new[] { new[] { 5, 6 }, new[] { 7, 8 } }; + object[][] collection1 = [[1, 2], [3, 4]]; + object[][] collection2 = [[5, 6], [7, 8]]; // Act Action act = () => collection1.Should().Equal(collection2); @@ -128,7 +128,7 @@ public void When_asserting_collections_to_be_equal_but_subject_collection_is_nul { // Arrange int[] collection = null; - var collection1 = new[] { 1, 2, 3 }; + int[] collection1 = [1, 2, 3]; // Act Action act = () => @@ -143,7 +143,7 @@ public void When_asserting_collections_to_be_equal_but_subject_collection_is_nul public void When_asserting_collections_to_be_equal_but_expected_collection_is_null_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; int[] collection1 = null; // Act @@ -161,7 +161,7 @@ public void When_an_empty_collection_is_compared_for_equality_to_a_non_empty_col { // Arrange var collection1 = new int[0]; - var collection2 = new[] { 1, 2, 3 }; + int[] collection2 = [1, 2, 3]; // Act Action act = () => collection1.Should().Equal(collection2); @@ -175,7 +175,7 @@ public void When_an_empty_collection_is_compared_for_equality_to_a_non_empty_col public void When_a_non_empty_collection_is_compared_for_equality_to_an_empty_collection_it_should_throw() { // Arrange - var collection1 = new[] { 1, 2, 3 }; + int[] collection1 = [1, 2, 3]; var collection2 = new int[0]; // Act @@ -250,8 +250,8 @@ public void When_both_collections_are_empty_it_should_them_as_equal() public void When_asserting_identical_collections_to_be_equal_it_should_enumerate_the_subject_only_once() { // Arrange - var actual = new CountingGenericEnumerable(new[] { 1, 2, 3 }); - var expected = new[] { 1, 2, 3 }; + var actual = new CountingGenericEnumerable([1, 2, 3]); + int[] expected = [1, 2, 3]; // Act actual.Should().Equal(expected); @@ -264,8 +264,8 @@ public void When_asserting_identical_collections_to_be_equal_it_should_enumerate public void When_asserting_identical_collections_to_not_be_equal_it_should_enumerate_the_subject_only_once() { // Arrange - var actual = new CountingGenericEnumerable(new[] { 1, 2, 3 }); - var expected = new[] { 1, 2, 3 }; + var actual = new CountingGenericEnumerable([1, 2, 3]); + int[] expected = [1, 2, 3]; // Act try @@ -285,8 +285,8 @@ public void When_asserting_identical_collections_to_not_be_equal_it_should_enume public void When_asserting_different_collections_to_be_equal_it_should_enumerate_the_subject_once() { // Arrange - var actual = new CountingGenericEnumerable(new[] { 1, 2, 3 }); - var expected = new[] { 1, 2, 4 }; + var actual = new CountingGenericEnumerable([1, 2, 3]); + int[] expected = [1, 2, 4]; // Act try @@ -306,8 +306,8 @@ public void When_asserting_different_collections_to_be_equal_it_should_enumerate public void When_asserting_different_collections_to_not_be_equal_it_should_enumerate_the_subject_only_once() { // Arrange - var actual = new CountingGenericEnumerable(new[] { 1, 2, 3 }); - var expected = new[] { 1, 2, 4 }; + var actual = new CountingGenericEnumerable([1, 2, 3]); + int[] expected = [1, 2, 4]; // Act actual.Should().NotEqual(expected); @@ -321,7 +321,7 @@ public void When_asserting_equality_with_a_collection_built_from_params_arguments_that_are_assignable_to_the_subjects_type_parameter_it_should_succeed_by_treating_the_arguments_as_of_that_type() { // Arrange - byte[] byteArray = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }; + byte[] byteArray = [0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10]; // Act Action act = () => byteArray.Should().Equal(0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10); @@ -337,8 +337,8 @@ public class NotEqual public void Should_succeed_when_asserting_collection_is_not_equal_to_a_different_collection() { // Arrange - var collection1 = new[] { 1, 2, 3 }; - var collection2 = new[] { 3, 1, 2 }; + int[] collection1 = [1, 2, 3]; + int[] collection2 = [3, 1, 2]; // Act / Assert collection1.Should() @@ -349,8 +349,8 @@ public void Should_succeed_when_asserting_collection_is_not_equal_to_a_different public void When_two_equal_collections_are_not_expected_to_be_equal_it_should_throw() { // Arrange - var collection1 = new[] { 1, 2, 3 }; - var collection2 = new[] { 1, 2, 3 }; + int[] collection1 = [1, 2, 3]; + int[] collection2 = [1, 2, 3]; // Act Action act = () => collection1.Should().NotEqual(collection2); @@ -364,8 +364,8 @@ public void When_two_equal_collections_are_not_expected_to_be_equal_it_should_th public void When_two_equal_collections_are_not_expected_to_be_equal_it_should_report_a_clear_explanation() { // Arrange - var collection1 = new[] { 1, 2, 3 }; - var collection2 = new[] { 1, 2, 3 }; + int[] collection1 = [1, 2, 3]; + int[] collection2 = [1, 2, 3]; // Act Action act = () => collection1.Should().NotEqual(collection2, "because we want to test the failure {0}", "message"); @@ -380,7 +380,7 @@ public void When_asserting_collections_not_to_be_equal_subject_but_collection_is { // Arrange int[] collection = null; - var collection1 = new[] { 1, 2, 3 }; + int[] collection1 = [1, 2, 3]; // Act Action act = () => @@ -398,7 +398,7 @@ public void When_asserting_collections_not_to_be_equal_subject_but_collection_is public void When_asserting_collections_not_to_be_equal_but_expected_collection_is_null_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; int[] collection1 = null; // Act diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCount.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCount.cs index 1b08a6d9b0..bc0022bbdc 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCount.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCount.cs @@ -16,7 +16,7 @@ public class HaveCount public void Should_succeed_when_asserting_collection_has_a_count_that_equals_the_number_of_items() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().HaveCount(3); @@ -26,7 +26,7 @@ public void Should_succeed_when_asserting_collection_has_a_count_that_equals_the public void Should_fail_when_asserting_collection_has_a_count_that_is_different_from_the_number_of_items() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().HaveCount(4); @@ -40,7 +40,7 @@ public void When_collection_has_a_count_that_is_different_from_the_number_of_items_it_should_fail_with_descriptive_message_() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action action = () => collection.Should().HaveCount(4, "because we want to test the failure {0}", "message"); @@ -55,7 +55,7 @@ public void public void When_collection_has_a_count_larger_than_the_minimum_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().HaveCount(c => c >= 3); @@ -65,7 +65,7 @@ public void When_collection_has_a_count_larger_than_the_minimum_it_should_not_th public void When_asserting_a_collection_with_incorrect_predicates_in_assertion_scope_all_are_reported() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => @@ -83,7 +83,7 @@ public void When_asserting_a_collection_with_incorrect_predicates_in_assertion_s public void When_collection_has_a_count_that_not_matches_the_predicate_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().HaveCount(c => c >= 4, "a minimum of 4 is required"); @@ -97,7 +97,7 @@ public void When_collection_has_a_count_that_not_matches_the_predicate_it_should public void When_collection_count_is_matched_against_a_null_predicate_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().HaveCount(null); @@ -147,7 +147,7 @@ public void When_collection_count_is_matched_against_a_predicate_and_collection_ public void When_collection_count_is_matched_against_a_predicate_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().HaveCount(c => (c % 2) == 1); @@ -160,7 +160,7 @@ public void When_collection_count_is_matched_against_a_predicate_it_should_not_t public void When_collection_count_is_matched_against_a_predicate_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().HaveCount(c => (c % 2) == 0); @@ -173,7 +173,7 @@ public void When_collection_count_is_matched_against_a_predicate_it_should_throw public void When_counting_generic_enumerable_it_should_enumerate() { // Arrange - var enumerable = new CountingGenericEnumerable(new[] { 1, 2, 3 }); + var enumerable = new CountingGenericEnumerable([1, 2, 3]); // Act enumerable.Should().HaveCount(3); @@ -186,7 +186,7 @@ public void When_counting_generic_enumerable_it_should_enumerate() public void When_counting_generic_collection_it_should_not_enumerate() { // Arrange - var collection = new CountingGenericCollection(new[] { 1, 2, 3 }); + var collection = new CountingGenericCollection([1, 2, 3]); // Act collection.Should().HaveCount(3); @@ -203,7 +203,7 @@ public class NotHaveCount public void Should_succeed_when_asserting_collection_has_a_count_different_from_the_number_of_items() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().NotHaveCount(2); @@ -213,7 +213,7 @@ public void Should_succeed_when_asserting_collection_has_a_count_different_from_ public void Should_fail_when_asserting_collection_has_a_count_that_equals_the_number_of_items() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().NotHaveCount(3); @@ -226,7 +226,7 @@ public void Should_fail_when_asserting_collection_has_a_count_that_equals_the_nu public void When_collection_has_a_count_that_equals_than_the_number_of_items_it_should_fail_with_descriptive_message_() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action action = () => collection.Should().NotHaveCount(3, "because we want to test the failure {0}", "message"); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountGreaterThan.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountGreaterThan.cs index ee4f8b9b85..f8ccf91f8f 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountGreaterThan.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountGreaterThan.cs @@ -17,7 +17,7 @@ public class HaveCountGreaterThan public void Should_succeed_when_asserting_collection_has_a_count_greater_than_less_the_number_of_items() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().HaveCountGreaterThan(2); @@ -27,7 +27,7 @@ public void Should_succeed_when_asserting_collection_has_a_count_greater_than_le public void Should_fail_when_asserting_collection_has_a_count_greater_than_the_number_of_items() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().HaveCountGreaterThan(3); @@ -40,7 +40,7 @@ public void Should_fail_when_asserting_collection_has_a_count_greater_than_the_n public void When_collection_has_a_count_greater_than_the_number_of_items_it_should_fail_with_descriptive_message_() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action action = () => diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs index 2941effa41..753f249016 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountGreaterThanOrEqualTo.cs @@ -16,7 +16,7 @@ public class HaveCountGreaterThanOrEqualTo public void Should_succeed_when_asserting_collection_has_a_count_greater_than_or_equal_to_less_the_number_of_items() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().HaveCountGreaterThanOrEqualTo(3); @@ -26,7 +26,7 @@ public void Should_succeed_when_asserting_collection_has_a_count_greater_than_or public void Should_fail_when_asserting_collection_has_a_count_greater_than_or_equal_to_the_number_of_items() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().HaveCountGreaterThanOrEqualTo(4); @@ -40,7 +40,7 @@ public void When_collection_has_a_count_greater_than_or_equal_to_the_number_of_items_it_should_fail_with_descriptive_message_() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action action = () => @@ -74,7 +74,7 @@ public void When_collection_count_is_greater_than_or_equal_to_and_collection_is_ public void Chaining_after_one_assertion() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().HaveCountGreaterThanOrEqualTo(3).And.Contain(1); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountLessThan.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountLessThan.cs index 190002e44a..7f9af0675a 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountLessThan.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountLessThan.cs @@ -16,7 +16,7 @@ public class HaveCountLessThan public void Should_succeed_when_asserting_collection_has_a_count_less_than_less_the_number_of_items() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().HaveCountLessThan(4); @@ -26,7 +26,7 @@ public void Should_succeed_when_asserting_collection_has_a_count_less_than_less_ public void Should_fail_when_asserting_collection_has_a_count_less_than_the_number_of_items() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().HaveCountLessThan(3); @@ -39,7 +39,7 @@ public void Should_fail_when_asserting_collection_has_a_count_less_than_the_numb public void When_collection_has_a_count_less_than_the_number_of_items_it_should_fail_with_descriptive_message_() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action action = () => collection.Should().HaveCountLessThan(3, "because we want to test the failure {0}", "message"); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountLessThanOrEqualTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountLessThanOrEqualTo.cs index 777fb3baa5..7d249f8deb 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountLessThanOrEqualTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCountLessThanOrEqualTo.cs @@ -16,7 +16,7 @@ public class HaveCountLessThanOrEqualTo public void Should_succeed_when_asserting_collection_has_a_count_less_than_or_equal_to_less_the_number_of_items() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().HaveCountLessThanOrEqualTo(3); @@ -26,7 +26,7 @@ public void Should_succeed_when_asserting_collection_has_a_count_less_than_or_eq public void Should_fail_when_asserting_collection_has_a_count_less_than_or_equal_to_the_number_of_items() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().HaveCountLessThanOrEqualTo(2); @@ -40,7 +40,7 @@ public void When_collection_has_a_count_less_than_or_equal_to_the_number_of_items_it_should_fail_with_descriptive_message_() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action action = () => @@ -74,7 +74,7 @@ public void When_collection_count_is_less_than_or_equal_to_and_collection_is_nul public void Chaining_after_one_assertion() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().HaveCountLessThanOrEqualTo(3).And.Contain(1); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveElementAt.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveElementAt.cs index 0f3765f8a3..efad04183c 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveElementAt.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveElementAt.cs @@ -16,7 +16,7 @@ public class HaveElementAt public void When_collection_has_expected_element_at_specific_index_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().HaveElementAt(1, 2); @@ -26,7 +26,7 @@ public void When_collection_has_expected_element_at_specific_index_it_should_not public void When_collection_does_not_have_the_expected_element_at_specific_index_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().HaveElementAt(1, 3, "we put it {0}", "there"); @@ -40,7 +40,7 @@ public void When_collection_does_not_have_the_expected_element_at_specific_index public void When_collection_does_not_have_an_element_at_the_specific_index_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().HaveElementAt(4, 3, "we put it {0}", "there"); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveSameCount.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveSameCount.cs index 43a3947f6f..760ee56397 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveSameCount.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveSameCount.cs @@ -16,8 +16,8 @@ public class HaveSameCount public void When_both_collections_have_the_same_number_elements_it_should_succeed() { // Arrange - var firstCollection = new[] { 1, 2, 3 }; - var secondCollection = new[] { 4, 5, 6 }; + int[] firstCollection = [1, 2, 3]; + int[] secondCollection = [4, 5, 6]; // Act / Assert firstCollection.Should().HaveSameCount(secondCollection); @@ -27,8 +27,8 @@ public void When_both_collections_have_the_same_number_elements_it_should_succee public void When_both_collections_do_not_have_the_same_number_of_elements_it_should_fail() { // Arrange - var firstCollection = new[] { 1, 2, 3 }; - var secondCollection = new[] { 4, 6 }; + int[] firstCollection = [1, 2, 3]; + int[] secondCollection = [4, 6]; // Act Action act = () => firstCollection.Should().HaveSameCount(secondCollection); @@ -42,8 +42,8 @@ public void When_both_collections_do_not_have_the_same_number_of_elements_it_sho public void When_comparing_item_counts_and_a_reason_is_specified_it_should_it_in_the_exception() { // Arrange - var firstCollection = new[] { 1, 2, 3 }; - var secondCollection = new[] { 4, 6 }; + int[] firstCollection = [1, 2, 3]; + int[] secondCollection = [4, 6]; // Act Action act = () => firstCollection.Should().HaveSameCount(secondCollection, "we want to test the {0}", "reason"); @@ -58,7 +58,7 @@ public void When_asserting_collections_to_have_same_count_against_null_collectio { // Arrange int[] collection = null; - var collection1 = new[] { 1, 2, 3 }; + int[] collection1 = [1, 2, 3]; // Act Action act = () => @@ -76,7 +76,7 @@ public void When_asserting_collections_to_have_same_count_against_null_collectio public void When_asserting_collections_to_have_same_count_against_an_other_null_collection_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; int[] otherCollection = null; // Act @@ -94,8 +94,8 @@ public class NotHaveSameCount public void When_asserting_not_same_count_and_collections_have_different_number_elements_it_should_succeed() { // Arrange - var firstCollection = new[] { 1, 2, 3 }; - var secondCollection = new[] { 4, 6 }; + int[] firstCollection = [1, 2, 3]; + int[] secondCollection = [4, 6]; // Act / Assert firstCollection.Should().NotHaveSameCount(secondCollection); @@ -105,8 +105,8 @@ public void When_asserting_not_same_count_and_collections_have_different_number_ public void When_asserting_not_same_count_and_both_collections_have_the_same_number_elements_it_should_fail() { // Arrange - var firstCollection = new[] { 1, 2, 3 }; - var secondCollection = new[] { 4, 5, 6 }; + int[] firstCollection = [1, 2, 3]; + int[] secondCollection = [4, 5, 6]; // Act Action act = () => firstCollection.Should().NotHaveSameCount(secondCollection); @@ -120,8 +120,8 @@ public void When_asserting_not_same_count_and_both_collections_have_the_same_num public void When_comparing_not_same_item_counts_and_a_reason_is_specified_it_should_it_in_the_exception() { // Arrange - var firstCollection = new[] { 1, 2, 3 }; - var secondCollection = new[] { 4, 5, 6 }; + int[] firstCollection = [1, 2, 3]; + int[] secondCollection = [4, 5, 6]; // Act Action act = () => firstCollection.Should().NotHaveSameCount(secondCollection, "we want to test the {0}", "reason"); @@ -136,7 +136,7 @@ public void When_asserting_collections_to_not_have_same_count_against_null_colle { // Arrange int[] collection = null; - var collection1 = new[] { 1, 2, 3 }; + int[] collection1 = [1, 2, 3]; // Act Action act = () => @@ -154,7 +154,7 @@ public void When_asserting_collections_to_not_have_same_count_against_null_colle public void When_asserting_collections_to_not_have_same_count_against_an_other_null_collection_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; int[] otherCollection = null; // Act @@ -170,7 +170,7 @@ public void When_asserting_collections_to_not_have_same_count_but_both_collections_references_the_same_object_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; var collection1 = collection; // Act diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.IntersectWith.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.IntersectWith.cs index 69aaffb3be..574743fff5 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.IntersectWith.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.IntersectWith.cs @@ -17,8 +17,8 @@ public class IntersectWith public void When_asserting_the_items_in_an_two_intersecting_collections_intersect_it_should_succeed() { // Arrange - var collection = new[] { 1, 2, 3 }; - var otherCollection = new[] { 3, 4, 5 }; + int[] collection = [1, 2, 3]; + int[] otherCollection = [3, 4, 5]; // Act / Assert collection.Should().IntersectWith(otherCollection); @@ -28,8 +28,8 @@ public void When_asserting_the_items_in_an_two_intersecting_collections_intersec public void When_asserting_the_items_in_an_two_non_intersecting_collections_intersect_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; - var otherCollection = new[] { 4, 5 }; + int[] collection = [1, 2, 3]; + int[] otherCollection = [4, 5]; // Act Action action = () => collection.Should().IntersectWith(otherCollection, "they should share items"); @@ -50,7 +50,7 @@ public void When_collection_is_null_then_intersect_with_should_fail() Action act = () => { using var _ = new AssertionScope(); - collection.Should().IntersectWith(new[] { 4, 5 }, "we want to test the failure {0}", "message"); + collection.Should().IntersectWith([4, 5], "we want to test the failure {0}", "message"); }; // Assert @@ -65,8 +65,8 @@ public class NotIntersectWith public void When_asserting_the_items_in_an_two_non_intersecting_collections_do_not_intersect_it_should_succeed() { // Arrange - var collection = new[] { 1, 2, 3 }; - var otherCollection = new[] { 4, 5 }; + int[] collection = [1, 2, 3]; + int[] otherCollection = [4, 5]; // Act / Assert collection.Should().NotIntersectWith(otherCollection); @@ -76,8 +76,8 @@ public void When_asserting_the_items_in_an_two_non_intersecting_collections_do_n public void When_asserting_the_items_in_an_two_intersecting_collections_do_not_intersect_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; - var otherCollection = new[] { 2, 3, 4 }; + int[] collection = [1, 2, 3]; + int[] otherCollection = [2, 3, 4]; // Act Action action = () => collection.Should().NotIntersectWith(otherCollection, "they should not share items"); @@ -92,7 +92,7 @@ public void When_asserting_the_items_in_an_two_intersecting_collections_do_not_i public void When_asserting_collection_to_not_intersect_with_same_collection_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; var otherCollection = collection; // Act @@ -114,7 +114,7 @@ public void When_collection_is_null_then_not_intersect_with_should_fail() Action act = () => { using var _ = new AssertionScope(); - collection.Should().NotIntersectWith(new[] { 4, 5 }, "we want to test the failure {0}", "message"); + collection.Should().NotIntersectWith([4, 5], "we want to test the failure {0}", "message"); }; // Assert diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainItemsAssignableTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainItemsAssignableTo.cs index 8ded54716e..cf95e3f4f9 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainItemsAssignableTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainItemsAssignableTo.cs @@ -43,7 +43,7 @@ public void Throws_when_the_collection_contains_an_item_of_the_unexpected_type() public void Succeeds_when_collection_is_empty() { // Arrange - var collection = Array.Empty(); + int[] collection = []; // Act / Assert collection.Should().NotContainItemsAssignableTo(); @@ -53,7 +53,7 @@ public void Succeeds_when_collection_is_empty() public void Throws_when_the_passed_type_argument_is_null() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act var act = () => collection.Should().NotContainItemsAssignableTo(null); @@ -66,7 +66,7 @@ public void Throws_when_the_passed_type_argument_is_null() public void Succeed_when_type_as_parameter_is_valid_type() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().NotContainItemsAssignableTo(typeof(string)); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainNulls.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainNulls.cs index 1243c9cc28..2fb3da2b67 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainNulls.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainNulls.cs @@ -17,7 +17,7 @@ public class NotContainNulls public void When_collection_does_not_contain_nulls_it_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should().NotContainNulls(); @@ -105,7 +105,7 @@ public void When_asserting_collection_to_not_contain_nulls_but_collection_is_nul public void When_injecting_a_null_predicate_into_NotContainNulls_it_should_throw() { // Arrange - IEnumerable collection = new SomeClass[] { }; + IEnumerable collection = []; // Act Action act = () => collection.Should().NotContainNulls(predicate: null); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyContain.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyContain.cs index 47704b1c61..3054eb981d 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyContain.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyContain.cs @@ -32,7 +32,7 @@ public void When_a_collection_does_not_contain_the_unexpected_items_it_should_no public void When_injecting_a_null_predicate_into_OnlyContain_it_should_throw() { // Arrange - IEnumerable collection = new int[] { }; + IEnumerable collection = []; // Act Action act = () => collection.Should().OnlyContain(predicate: null); @@ -46,7 +46,7 @@ public void When_injecting_a_null_predicate_into_OnlyContain_it_should_throw() public void When_a_collection_contains_items_not_matching_a_predicate_it_should_throw() { // Arrange - IEnumerable collection = new[] { 2, 12, 3, 11, 2 }; + IEnumerable collection = [2, 12, 3, 11, 2]; // Act Action act = () => collection.Should().OnlyContain(i => i <= 10, "10 is the maximum"); @@ -60,7 +60,7 @@ public void When_a_collection_contains_items_not_matching_a_predicate_it_should_ public void When_a_collection_is_empty_and_should_contain_only_items_matching_a_predicate_it_should_throw() { // Arrange - IEnumerable strings = Enumerable.Empty(); + IEnumerable strings = []; // Act / Assert strings.Should().OnlyContain(e => e.Length > 0); @@ -70,7 +70,7 @@ public void When_a_collection_is_empty_and_should_contain_only_items_matching_a_ public void When_a_collection_contains_only_items_matching_a_predicate_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { 2, 9, 3, 8, 2 }; + IEnumerable collection = [2, 9, 3, 8, 2]; // Act Action act = () => collection.Should().OnlyContain(i => i <= 10); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyHaveUniqueItems.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyHaveUniqueItems.cs index f658ff8553..7a0be4c16e 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyHaveUniqueItems.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyHaveUniqueItems.cs @@ -17,7 +17,7 @@ public class OnlyHaveUniqueItems public void Should_succeed_when_asserting_collection_with_unique_items_contains_only_unique_items() { // Arrange - var collection = new[] { 1, 2, 3, 4 }; + int[] collection = [1, 2, 3, 4]; // Act / Assert collection.Should().OnlyHaveUniqueItems(); @@ -27,7 +27,7 @@ public void Should_succeed_when_asserting_collection_with_unique_items_contains_ public void When_a_collection_contains_duplicate_items_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 3, 3 }; + int[] collection = [1, 2, 3, 3]; // Act Action act = () => collection.Should().OnlyHaveUniqueItems("{0} don't like {1}", "we", "duplicates"); @@ -41,7 +41,7 @@ public void When_a_collection_contains_duplicate_items_it_should_throw() public void When_a_collection_contains_duplicate_items_it_supports_chaining() { // Arrange - var collection = new[] { 1, 2, 3, 3 }; + int[] collection = [1, 2, 3, 3]; // Act Action act = () => @@ -59,7 +59,7 @@ public void When_a_collection_contains_duplicate_items_it_supports_chaining() public void When_a_collection_contains_multiple_duplicate_items_it_should_throw() { // Arrange - var collection = new[] { 1, 2, 2, 3, 3 }; + int[] collection = [1, 2, 2, 3, 3]; // Act Action act = () => collection.Should().OnlyHaveUniqueItems("{0} don't like {1}", "we", "duplicates"); @@ -73,7 +73,7 @@ public void When_a_collection_contains_multiple_duplicate_items_it_should_throw( public void When_a_collection_contains_multiple_duplicate_items_it_supports_chaining() { // Arrange - var collection = new[] { 1, 2, 2, 3, 3 }; + int[] collection = [1, 2, 2, 3, 3]; // Act Action act = () => @@ -109,7 +109,7 @@ public void When_asserting_collection_to_only_have_unique_items_but_collection_i public void When_injecting_a_null_predicate_into_OnlyHaveUniqueItems_it_should_throw() { // Arrange - IEnumerable collection = new SomeClass[] { }; + IEnumerable collection = []; // Act Action act = () => collection.Should().OnlyHaveUniqueItems(predicate: null); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Satisfy.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Satisfy.cs index 0a8be1f50c..289ba5b50e 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Satisfy.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Satisfy.cs @@ -19,7 +19,7 @@ public class Satisfy public void When_collection_element_at_each_position_matches_predicate_at_same_position_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().Satisfy( @@ -35,7 +35,7 @@ public void When_collection_element_at_each_position_matches_predicate_at_same_p public void When_collection_element_at_each_position_matches_predicate_at_reverse_position_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().Satisfy( @@ -51,7 +51,7 @@ public void When_collection_element_at_each_position_matches_predicate_at_revers public void When_one_element_does_not_have_matching_predicate_Satisfy_should_throw() { // Arrange - var collection = new[] { 1, 2 }; + int[] collection = [1, 2]; // Act Action act = () => collection.Should().Satisfy( @@ -71,7 +71,7 @@ public void When_some_predicates_have_multiple_matching_elements_and_most_restricitve_predicates_are_last_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3, 4 }; + int[] collection = [1, 2, 3, 4]; // Act Action act = () => collection.Should().Satisfy( @@ -89,7 +89,7 @@ public void When_some_predicates_have_multiple_matching_elements_and_most_restricitve_predicates_are_first_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3, 4 }; + int[] collection = [1, 2, 3, 4]; // Act Action act = () => collection.Should().Satisfy( @@ -106,7 +106,7 @@ public void public void When_second_predicate_matches_first_and_last_element_and_solution_exists_should_not_throw() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().Satisfy( @@ -156,7 +156,7 @@ public void public void When_Satisfy_asserting_against_null_inspectors_it_should_throw_with_clear_explanation() { // Arrange - IEnumerable collection = new[] { 1, 2 }; + IEnumerable collection = [1, 2]; // Act Action act = () => collection.Should().Satisfy(null); @@ -170,7 +170,7 @@ public void When_Satisfy_asserting_against_null_inspectors_it_should_throw_with_ public void When_asserting_against_empty_inspectors_should_throw_with_clear_explanation() { // Arrange - IEnumerable collection = new[] { 1, 2 }; + IEnumerable collection = [1, 2]; // Act Action act = () => collection.Should().Satisfy(); @@ -210,7 +210,7 @@ public void When_asserting_collection_which_is_null_should_throw() public void When_asserting_collection_which_is_empty_should_throw() { // Arrange - var collection = Enumerable.Empty(); + IEnumerable collection = []; // Act Action act = () => collection.Should().Satisfy( diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.SatisfyRespectively.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.SatisfyRespectively.cs index a905e8a8e6..e85c6a4827 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.SatisfyRespectively.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.SatisfyRespectively.cs @@ -18,7 +18,7 @@ public class SatisfyRespectively public void When_collection_asserting_against_null_inspectors_it_should_throw_with_clear_explanation() { // Arrange - IEnumerable collection = new[] { 1, 2 }; + IEnumerable collection = [1, 2]; // Act Action act = () => collection.Should().SatisfyRespectively(null); @@ -32,7 +32,7 @@ public void When_collection_asserting_against_null_inspectors_it_should_throw_wi public void When_collection_asserting_against_empty_inspectors_it_should_throw_with_clear_explanation() { // Arrange - IEnumerable collection = new[] { 1, 2 }; + IEnumerable collection = [1, 2]; // Act Action act = () => collection.Should().SatisfyRespectively(); @@ -66,7 +66,7 @@ public void When_collection_which_is_asserting_against_inspectors_is_null_it_sho public void When_collection_which_is_asserting_against_inspectors_is_empty_it_should_throw() { // Arrange - var collection = Enumerable.Empty(); + IEnumerable collection = []; // Act Action act = () => collection.Should().SatisfyRespectively(new Action[] { x => x.Should().Be(1) }, @@ -103,8 +103,8 @@ public void When_asserting_collection_does_not_satisfy_any_inspector_it_should_t // Arrange var customers = new[] { - new CustomerWithItems { Age = 21, Items = new[] { 1, 2 } }, - new CustomerWithItems { Age = 22, Items = new[] { 3 } } + new CustomerWithItems { Age = 21, Items = [1, 2] }, + new CustomerWithItems { Age = 22, Items = [3] } }; // Act @@ -148,7 +148,7 @@ public void When_asserting_collection_does_not_satisfy_any_inspector_it_should_t public void When_inspector_message_is_not_reformatable_it_should_not_throw() { // Arrange - byte[][] subject = { new byte[] { 1 } }; + byte[][] subject = [[1]]; // Act Action act = () => subject.Should().SatisfyRespectively(e => e.Should().BeEquivalentTo(new byte[] { 2, 3, 4 })); @@ -161,7 +161,7 @@ public void When_inspector_message_is_not_reformatable_it_should_not_throw() public void When_inspectors_count_does_not_equal_asserting_collection_length_it_should_throw_with_a_useful_message() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => collection.Should().SatisfyRespectively( diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.StartWith.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.StartWith.cs index d39342f3d1..7f64ae6a1c 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.StartWith.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.StartWith.cs @@ -156,7 +156,7 @@ public void When_non_empty_collection_starts_with_the_empty_sequence_it_should_n public void When_empty_collection_starts_with_the_empty_sequence_it_should_not_throw() { // Arrange - var collection = new string[] { }; + string[] collection = []; // Act Action act = () => collection.Should().StartWith(new string[] { }); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs index 49c2f4b692..7f065cf876 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs @@ -18,7 +18,7 @@ public class Chainings public void Should_support_chaining_constraints_with_and() { // Arrange - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act / Assert collection.Should() diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.AllSatisfy.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.AllSatisfy.cs index e1b7d8067a..a620661cf4 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.AllSatisfy.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.AllSatisfy.cs @@ -12,7 +12,7 @@ public class AllSatisfy public void All_items_satisfying_inspector_should_succeed() { // Arrange - string[] collection = { "John", "John" }; + string[] collection = ["John", "John"]; // Act / Assert collection.Should().AllSatisfy(value => value.Should().Be("John")); @@ -22,7 +22,7 @@ public void All_items_satisfying_inspector_should_succeed() public void Any_items_not_satisfying_inspector_should_throw() { // Arrange - string[] collection = { "Jack", "Jessica" }; + string[] collection = ["Jack", "Jessica"]; // Act Action act = () => collection.Should() diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEquivalentTo.cs index 0e7a9bab74..5a9ce6fa06 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEquivalentTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEquivalentTo.cs @@ -100,8 +100,8 @@ public void When_two_collections_contain_the_same_elements_it_should_treat_them_ public void When_two_arrays_contain_the_same_elements_it_should_treat_them_as_equivalent() { // Arrange - string[] array1 = { "one", "two", "three" }; - string[] array2 = { "three", "two", "one" }; + string[] array1 = ["one", "two", "three"]; + string[] array2 = ["three", "two", "one"]; // Act / Assert array1.Should().BeEquivalentTo(array2); diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeSubsetOf.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeSubsetOf.cs index 533694d1be..259cf7051e 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeSubsetOf.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeSubsetOf.cs @@ -114,7 +114,7 @@ public void When_a_set_is_expected_to_be_not_a_subset_it_should_succeed() public void When_an_empty_set_is_not_supposed_to_be_a_subset_of_another_set_it_should_throw() { // Arrange - IEnumerable subject = new string[] { }; + IEnumerable subject = []; IEnumerable otherSet = new[] { "one", "two", "three" }; // Act diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainMatch.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainMatch.cs index d83e756215..a83aecc480 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainMatch.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainMatch.cs @@ -84,7 +84,7 @@ public void When_collection_contains_a_match_that_differs_in_casing_it_should_th public void When_asserting_empty_collection_for_match_it_should_throw() { // Arrange - IEnumerable collection = new string[] { }; + IEnumerable collection = []; // Act Action action = () => collection.Should().ContainMatch("* failed"); diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.SatisfyRespectively.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.SatisfyRespectively.cs index 98c669795b..2880d6f88b 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.SatisfyRespectively.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.SatisfyRespectively.cs @@ -12,7 +12,7 @@ public class SatisfyRespectively public void When_string_collection_satisfies_all_inspectors_it_should_succeed() { // Arrange - string[] collection = { "John", "Jane" }; + string[] collection = ["John", "Jane"]; // Act / Assert collection.Should().SatisfyRespectively( @@ -25,7 +25,7 @@ public void When_string_collection_satisfies_all_inspectors_it_should_succeed() public void When_string_collection_does_not_satisfy_all_inspectors_it_should_throw() { // Arrange - string[] collection = { "Jack", "Jessica" }; + string[] collection = ["Jack", "Jessica"]; // Act Action act = () => collection.Should().SatisfyRespectively(new Action[] diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.Contain.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.Contain.cs index 92ff7c8b4e..757461a10b 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.Contain.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.Contain.cs @@ -171,11 +171,11 @@ public void When_asserting_dictionary_contains_key_value_pairs_against_null_dict // Arrange Dictionary dictionary = null; - List> keyValuePairs = new() - { + List> keyValuePairs = + [ new KeyValuePair(1, "One"), new KeyValuePair(1, "Two") - }; + ]; // Act Action act = () => @@ -199,7 +199,7 @@ public void When_asserting_dictionary_contains_key_value_pairs_but_expected_key_ [2] = "Two" }; - List> keyValuePairs = new(); + List> keyValuePairs = []; // Act Action act = () => dictionary1.Should().Contain(keyValuePairs, @@ -558,11 +558,11 @@ public void When_asserting_dictionary_does_not_contain_key_value_pairs_against_n // Arrange Dictionary dictionary = null; - List> keyValuePairs = new() - { + List> keyValuePairs = + [ new KeyValuePair(1, "One"), new KeyValuePair(1, "Two") - }; + ]; // Act Action act = () => @@ -587,7 +587,7 @@ public void [2] = "Two" }; - List> keyValuePair = new(); + List> keyValuePair = []; // Act Action act = () => dictionary1.Should().NotContain(keyValuePair, diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainKeys.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainKeys.cs index b336e31236..90c5ba3979 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainKeys.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainKeys.cs @@ -35,7 +35,7 @@ public void When_a_dictionary_does_not_contain_a_list_of_keys_it_should_throw_wi }; // Act - Action act = () => dictionary.Should().ContainKeys(new[] { 2, 3 }, "because {0}", "we do"); + Action act = () => dictionary.Should().ContainKeys([2, 3], "because {0}", "we do"); // Assert act.Should().Throw().WithMessage( @@ -52,7 +52,7 @@ public void Null_dictionaries_do_not_contain_any_keys() Action act = () => { using var _ = new AssertionScope(); - dictionary.Should().ContainKeys(new[] { 2, 3 }, "because {0}", "we do"); + dictionary.Should().ContainKeys([2, 3], "because {0}", "we do"); }; // Assert @@ -110,7 +110,7 @@ public void When_a_dictionary_contains_a_list_of_keys_it_should_throw_with_clear }; // Act - Action act = () => dictionary.Should().NotContainKeys(new[] { 2, 3 }, "because {0}", "we do"); + Action act = () => dictionary.Should().NotContainKeys([2, 3], "because {0}", "we do"); // Assert act.Should().Throw().WithMessage( @@ -128,7 +128,7 @@ public void When_a_dictionary_contains_exactly_one_of_the_keys_it_should_throw_w }; // Act - Action act = () => dictionary.Should().NotContainKeys(new[] { 2 }, "because {0}", "we do"); + Action act = () => dictionary.Should().NotContainKeys([2], "because {0}", "we do"); // Assert act.Should().Throw().WithMessage( @@ -145,7 +145,7 @@ public void Null_dictionaries_do_not_contain_any_keys() Action act = () => { using var _ = new AssertionScope(); - dictionary.Should().NotContainKeys(new[] { 2 }, "because {0}", "we do"); + dictionary.Should().NotContainKeys([2], "because {0}", "we do"); }; // Assert diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveSameCount.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveSameCount.cs index a931cc04d4..5ae939d0e6 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveSameCount.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.HaveSameCount.cs @@ -20,7 +20,7 @@ public void When_dictionary_and_collection_have_the_same_number_elements_it_shou [3] = "Three" }; - var collection = new[] { 4, 5, 6 }; + int[] collection = [4, 5, 6]; // Act / Assert dictionary.Should().HaveSameCount(collection); @@ -37,7 +37,7 @@ public void When_dictionary_and_collection_do_not_have_the_same_number_of_elemen [3] = "Three" }; - var collection = new[] { 4, 6 }; + int[] collection = [4, 6]; // Act Action act = () => dictionary.Should().HaveSameCount(collection); @@ -58,7 +58,7 @@ public void When_comparing_item_counts_and_a_reason_is_specified_it_should_it_in [3] = "Three" }; - var collection = new[] { 4, 6 }; + int[] collection = [4, 6]; // Act Action act = () => dictionary.Should().HaveSameCount(collection, "we want to test the {0}", "reason"); @@ -73,7 +73,7 @@ public void When_asserting_dictionary_and_collection_have_same_count_against_nul { // Arrange Dictionary dictionary = null; - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => dictionary.Should().HaveSameCount(collection, @@ -119,7 +119,7 @@ public void When_asserting_not_same_count_and_collections_have_different_number_ [3] = "Three" }; - var collection = new[] { 4, 6 }; + int[] collection = [4, 6]; // Act / Assert dictionary.Should().NotHaveSameCount(collection); @@ -136,7 +136,7 @@ public void When_asserting_not_same_count_and_both_collections_have_the_same_num [3] = "Three" }; - var collection = new[] { 4, 5, 6 }; + int[] collection = [4, 5, 6]; // Act Action act = () => dictionary.Should().NotHaveSameCount(collection); @@ -157,7 +157,7 @@ public void When_comparing_not_same_item_counts_and_a_reason_is_specified_it_sho [3] = "Three" }; - var collection = new[] { 4, 5, 6 }; + int[] collection = [4, 5, 6]; // Act Action act = () => dictionary.Should().NotHaveSameCount(collection, "we want to test the {0}", "reason"); @@ -172,7 +172,7 @@ public void When_asserting_dictionary_and_collection_to_not_have_same_count_agai { // Arrange Dictionary dictionary = null; - var collection = new[] { 1, 2, 3 }; + int[] collection = [1, 2, 3]; // Act Action act = () => dictionary.Should().NotHaveSameCount(collection, diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.cs index 54b69a1a10..51b013d7fb 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.cs @@ -135,12 +135,12 @@ public static IEnumerable SingleDictionaryData() => public static object[] Dictionaries() { - return new object[] - { + return + [ new Dictionary { [1] = 42 }, new TrueReadOnlyDictionary(new Dictionary { [1] = 42 }), new List> { new(1, 42) } - }; + ]; } public static IEnumerable DictionariesData() @@ -346,7 +346,7 @@ object IEnumerator.Current internal class DictionaryNotImplementingIReadOnlyDictionary : IDictionary { - private readonly Dictionary dictionary = new(); + private readonly Dictionary dictionary = []; public TValue this[TKey key] { get => dictionary[key]; set => throw new NotImplementedException(); } diff --git a/Tests/FluentAssertions.Specs/CultureAwareTesting/CulturedFactAttributeDiscoverer.cs b/Tests/FluentAssertions.Specs/CultureAwareTesting/CulturedFactAttributeDiscoverer.cs index 49182923dd..aad91bb599 100644 --- a/Tests/FluentAssertions.Specs/CultureAwareTesting/CulturedFactAttributeDiscoverer.cs +++ b/Tests/FluentAssertions.Specs/CultureAwareTesting/CulturedFactAttributeDiscoverer.cs @@ -18,11 +18,11 @@ public IEnumerable Discover(ITestFrameworkDiscoveryOptions disco IAttributeInfo factAttribute) { var ctorArgs = factAttribute.GetConstructorArguments().ToArray(); - var cultures = Reflector.ConvertArguments(ctorArgs, new[] { typeof(string[]) }).Cast().Single(); + var cultures = Reflector.ConvertArguments(ctorArgs, [typeof(string[])]).Cast().Single(); if (cultures is null || cultures.Length == 0) { - cultures = new[] { "en-US", "fr-FR" }; + cultures = ["en-US", "fr-FR"]; } TestMethodDisplay methodDisplay = discoveryOptions.MethodDisplayOrDefault(); diff --git a/Tests/FluentAssertions.Specs/CultureAwareTesting/CulturedTheoryAttributeDiscoverer.cs b/Tests/FluentAssertions.Specs/CultureAwareTesting/CulturedTheoryAttributeDiscoverer.cs index 4c7ce5153f..5df9b30c7a 100644 --- a/Tests/FluentAssertions.Specs/CultureAwareTesting/CulturedTheoryAttributeDiscoverer.cs +++ b/Tests/FluentAssertions.Specs/CultureAwareTesting/CulturedTheoryAttributeDiscoverer.cs @@ -35,11 +35,11 @@ protected override IEnumerable CreateTestCasesForTheory(ITestFra private static string[] GetCultures(IAttributeInfo culturedTheoryAttribute) { var ctorArgs = culturedTheoryAttribute.GetConstructorArguments().ToArray(); - var cultures = Reflector.ConvertArguments(ctorArgs, new[] { typeof(string[]) }).Cast().Single(); + var cultures = Reflector.ConvertArguments(ctorArgs, [typeof(string[])]).Cast().Single(); if (cultures is null || cultures.Length == 0) { - cultures = new[] { "en-US", "fr-FR" }; + cultures = ["en-US", "fr-FR"]; } return cultures; diff --git a/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs index 892d199047..b133dce666 100644 --- a/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs @@ -744,7 +744,7 @@ private object CreateProxyObject() string typeName = baseType.Name + "_GeneratedForTest"; TypeBuilder typeBuilder = - moduleBuilder.DefineType(typeName, TypeAttributes.Public, baseType, new[] { interfaceType }); + moduleBuilder.DefineType(typeName, TypeAttributes.Public, baseType, [interfaceType]); MethodBuilder addHandler = EmitAddRemoveEventHandler("add"); typeBuilder.DefineMethodOverride(addHandler, interfaceType.GetMethod("add_InterfaceEvent")); diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs index 93707aa0e4..931c352e65 100644 --- a/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs @@ -288,7 +288,7 @@ public void Formatting_options_passed_to_inner_assertion_scopes() public class CustomAssertionStrategy : IAssertionStrategy { - private readonly List failureMessages = new(); + private readonly List failureMessages = []; public IEnumerable FailureMessages => failureMessages; diff --git a/Tests/FluentAssertions.Specs/Extensions/ObjectExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/Extensions/ObjectExtensionsSpecs.cs index 8c0d4f524f..7c9bd2b1a7 100644 --- a/Tests/FluentAssertions.Specs/Extensions/ObjectExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Extensions/ObjectExtensionsSpecs.cs @@ -135,8 +135,8 @@ from y in nonNumerics private static object[] GetNumericIConvertibles() { - return new object[] - { + return + [ (byte)1, (sbyte)1, (short)1, @@ -148,18 +148,18 @@ private static object[] GetNumericIConvertibles() 1F, 1D, 1M, - }; + ]; } private static object[] GetNonNumericIConvertibles() { - return new object[] - { + return + [ true, '\u0001', new DateTime(1), DBNull.Value, "1" - }; + ]; } } diff --git a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs index d178b86cdf..931e43cafb 100644 --- a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs +++ b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs @@ -179,13 +179,13 @@ public void When_the_object_is_a_generic_type_without_custom_string_representati { StuffId = 1, Description = "Stuff_1", - Children = new List { 1, 2, 3, 4 } + Children = [1, 2, 3, 4] }, new() { StuffId = 2, Description = "Stuff_2", - Children = new List { 1, 2, 3, 4 } + Children = [1, 2, 3, 4] } }; @@ -195,13 +195,13 @@ public void When_the_object_is_a_generic_type_without_custom_string_representati { StuffId = 1, Description = "Stuff_1", - Children = new List { 1, 2, 3, 4 } + Children = [1, 2, 3, 4] }, new() { StuffId = 2, Description = "WRONG_DESCRIPTION", - Children = new List { 1, 2, 3, 4 } + Children = [1, 2, 3, 4] } }; @@ -249,7 +249,7 @@ Expected stuff to be equal to public void When_the_object_is_a_user_defined_type_it_should_show_the_name_on_the_initial_line() { // Arrange - var stuff = new StuffRecord(42, "description", new(24), new List { 10, 20, 30, 40 }); + var stuff = new StuffRecord(42, "description", new(24), [10, 20, 30, 40]); // Act Action act = () => stuff.Should().BeNull(); @@ -396,7 +396,7 @@ public void When_the_object_is_an_empty_anonymous_type_it_should_show_braces_on_ public void When_the_object_is_a_tuple_it_should_show_the_properties_recursively() { // Arrange - (int TupleId, string Description, List Children) stuff = (1, "description", new() { 1, 2, 3, 4 }); + (int TupleId, string Description, List Children) stuff = (1, "description", [1, 2, 3, 4]); (int, string, List) expectedStuff = (2, "WRONG_DESCRIPTION", new List { 4, 5, 6, 7 }); @@ -429,7 +429,7 @@ public void When_the_object_is_a_record_it_should_show_the_properties_recursivel RecordId: 9, RecordDescription: "descriptive", SingleChild: new(ChildRecordId: 80), - RecordChildren: new() { 4, 5, 6, 7 }); + RecordChildren: [4, 5, 6, 7]); var expectedStuff = new { @@ -910,7 +910,7 @@ public void When_formatting_multiple_items_with_a_custom_string_representation_using_line_breaks_it_should_end_lines_with_a_comma() { // Arrange - var subject = new[] { typeof(A), typeof(B) }; + Type[] subject = [typeof(A), typeof(B)]; // Act string result = Formatter.ToString(subject, new FormattingOptions { UseLineBreaks = true }); @@ -1257,7 +1257,7 @@ internal class Node { public Node() { - Children = new List(); + Children = []; } public static Node Default { get; } = new(); diff --git a/Tests/FluentAssertions.Specs/Formatting/MultidimensionalArrayFormatterSpecs.cs b/Tests/FluentAssertions.Specs/Formatting/MultidimensionalArrayFormatterSpecs.cs index d9ab77b8b6..eeb94d9800 100644 --- a/Tests/FluentAssertions.Specs/Formatting/MultidimensionalArrayFormatterSpecs.cs +++ b/Tests/FluentAssertions.Specs/Formatting/MultidimensionalArrayFormatterSpecs.cs @@ -54,8 +54,8 @@ public void When_formatting_a_multi_dimensional_array_it_should_show_structure(o public void When_formatting_a_multi_dimensional_array_with_bounds_it_should_show_structure() { // Arrange - var lengthsArray = new[] { 2, 3, 4 }; - var boundsArray = new[] { 1, 5, 7 }; + int[] lengthsArray = [2, 3, 4]; + int[] boundsArray = [1, 5, 7]; var value = Array.CreateInstance(typeof(string), lengthsArray, boundsArray); for (int i = value.GetLowerBound(0); i <= value.GetUpperBound(0); i++) @@ -64,7 +64,7 @@ public void When_formatting_a_multi_dimensional_array_with_bounds_it_should_show { for (int k = value.GetLowerBound(2); k <= value.GetUpperBound(2); k++) { - var indices = new[] { i, j, k }; + int[] indices = [i, j, k]; value.SetValue($"{i}-{j}-{k}", indices); } } diff --git a/Tests/FluentAssertions.Specs/Formatting/PredicateLambdaExpressionValueFormatterSpecs.cs b/Tests/FluentAssertions.Specs/Formatting/PredicateLambdaExpressionValueFormatterSpecs.cs index b70ce9c4e5..f8ac7d281e 100644 --- a/Tests/FluentAssertions.Specs/Formatting/PredicateLambdaExpressionValueFormatterSpecs.cs +++ b/Tests/FluentAssertions.Specs/Formatting/PredicateLambdaExpressionValueFormatterSpecs.cs @@ -92,7 +92,7 @@ public void When_condition_contains_extension_method_then_extension_method_must_ public void When_condition_contains_linq_extension_method_then_extension_method_must_be_formatted() { // Arrange - var allowed = new[] { 1, 2, 3 }; + int[] allowed = [1, 2, 3]; // Act string result = Format(a => allowed.Contains(a)); diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeOneOf.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeOneOf.cs index ed15b67c85..ae02c601ad 100644 --- a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeOneOf.cs +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeOneOf.cs @@ -30,7 +30,7 @@ public void When_a_value_is_not_one_of_the_specified_values_it_should_throw_with int value = 3; // Act - Action act = () => value.Should().BeOneOf(new[] { 4, 5 }, "because those are the valid values"); + Action act = () => value.Should().BeOneOf([4, 5], "because those are the valid values"); // Assert act diff --git a/Tests/FluentAssertions.Specs/Primitives/EnumAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/EnumAssertionSpecs.cs index c5bb469ec2..e8240e41fa 100644 --- a/Tests/FluentAssertions.Specs/Primitives/EnumAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/EnumAssertionSpecs.cs @@ -783,7 +783,7 @@ public void An_enum_cannot_be_part_of_an_empty_list() BindingFlags flags = BindingFlags.DeclaredOnly; // Act / Assert - Action act = () => flags.Should().BeOneOf(Array.Empty()); + Action act = () => flags.Should().BeOneOf([]); act.Should() .Throw() diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOneOf.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOneOf.cs index 99cd091f3d..d6be143328 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOneOf.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOneOf.cs @@ -97,7 +97,7 @@ public void An_untyped_value_is_not_one_of_no_values() object value = new SomeClass(3); // Act - Action act = () => value.Should().BeOneOf(Array.Empty(), new SomeClassEqualityComparer()); + Action act = () => value.Should().BeOneOf([], new SomeClassEqualityComparer()); // Assert act.Should().Throw(); @@ -125,7 +125,7 @@ public void A_typed_value_is_not_one_of_no_values() var value = new SomeClass(3); // Act - Action act = () => value.Should().BeOneOf(Array.Empty(), new SomeClassEqualityComparer()); + Action act = () => value.Should().BeOneOf([], new SomeClassEqualityComparer()); // Assert act.Should().Throw(); @@ -179,7 +179,7 @@ public void An_untyped_value_requires_a_comparer() object value = new SomeClass(3); // Act - Action act = () => value.Should().BeOneOf(Array.Empty(), comparer: null); + Action act = () => value.Should().BeOneOf([], comparer: null); // Assert act.Should().Throw().WithParameterName("comparer"); @@ -192,7 +192,7 @@ public void A_typed_value_requires_a_comparer() var value = new SomeClass(3); // Act - Action act = () => value.Should().BeOneOf(Array.Empty(), comparer: null); + Action act = () => value.Should().BeOneOf([], comparer: null); // Assert act.Should().Throw().WithParameterName("comparer"); @@ -215,7 +215,7 @@ public void Can_chain_multiple_assertions() var value = new object(); // Act / Assert - value.Should().BeOneOf(new[] { value }, new DumbObjectEqualityComparer()).And.NotBeNull(); + value.Should().BeOneOf([value], new DumbObjectEqualityComparer()).And.NotBeNull(); } } } diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.ContainAll.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.ContainAll.cs index 1bf0a1b4a4..06721878ec 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.ContainAll.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.ContainAll.cs @@ -103,7 +103,7 @@ public void var testString = $"{red} {green}"; // Act - Action act = () => testString.Should().ContainAll(new[] { yellow, blue }, "some {0} reason", "special"); + Action act = () => testString.Should().ContainAll([yellow, blue], "some {0} reason", "special"); // Assert act @@ -187,7 +187,7 @@ public void When_exclusion_of_all_strings_is_asserted_with_reason_and_assertion_ var testString = $"{red} {green} {yellow}"; // Act - Action act = () => testString.Should().NotContainAll(new[] { red, green, yellow }, "some {0} reason", "special"); + Action act = () => testString.Should().NotContainAll([red, green, yellow], "some {0} reason", "special"); // Assert act diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.ContainAny.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.ContainAny.cs index 4fb6232cbb..c75b204e4e 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.ContainAny.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.ContainAny.cs @@ -121,7 +121,7 @@ public void var testString = $"{red} {green}"; // Act - Action act = () => testString.Should().ContainAny(new[] { blue, purple }, "some {0} reason", "special"); + Action act = () => testString.Should().ContainAny([blue, purple], "some {0} reason", "special"); // Assert act @@ -204,7 +204,7 @@ public void When_exclusion_of_any_strings_is_asserted_with_reason_and_assertion_ var testString = $"{red} {green} {yellow}"; // Act - Action act = () => testString.Should().NotContainAny(new[] { red }, "some {0} reason", "special"); + Action act = () => testString.Should().NotContainAny([red], "some {0} reason", "special"); // Assert act diff --git a/Tests/FluentAssertions.Specs/TypeEnumerableExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/TypeEnumerableExtensionsSpecs.cs index b65812c4c2..6346798105 100644 --- a/Tests/FluentAssertions.Specs/TypeEnumerableExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/TypeEnumerableExtensionsSpecs.cs @@ -71,7 +71,7 @@ public void When_selecting_types_that_not_decorated_with_attribute_or_inherit_it [Fact] public void When_selecting_types_in_namespace_it_should_return_the_correct_type() { - var types = new[] { typeof(JustAClass), typeof(BaseNamespaceClass), typeof(NestedNamespaceClass) }; + Type[] types = [typeof(JustAClass), typeof(BaseNamespaceClass), typeof(NestedNamespaceClass)]; types.ThatAreInNamespace(typeof(BaseNamespaceClass).Namespace) .Should() @@ -82,7 +82,7 @@ public void When_selecting_types_in_namespace_it_should_return_the_correct_type( [Fact] public void When_selecting_types_under_namespace_it_should_return_the_correct_type() { - var types = new[] { typeof(JustAClass), typeof(BaseNamespaceClass), typeof(NestedNamespaceClass) }; + Type[] types = [typeof(JustAClass), typeof(BaseNamespaceClass), typeof(NestedNamespaceClass)]; types.ThatAreUnderNamespace(typeof(BaseNamespaceClass).Namespace) .Should() @@ -94,7 +94,7 @@ public void When_selecting_types_under_namespace_it_should_return_the_correct_ty [Fact] public void When_selecting_derived_classes_it_should_return_the_correct_type() { - var types = new[] { typeof(JustAClass), typeof(SomeBaseClass), typeof(SomeClassDerivedFromSomeBaseClass) }; + Type[] types = [typeof(JustAClass), typeof(SomeBaseClass), typeof(SomeClassDerivedFromSomeBaseClass)]; types.ThatDeriveFrom() .Should() @@ -105,7 +105,7 @@ public void When_selecting_derived_classes_it_should_return_the_correct_type() [Fact] public void When_selecting_types_that_implement_interface_it_should_return_the_correct_type() { - var types = new[] { typeof(JustAClass), typeof(ClassImplementingJustAnInterface), typeof(IJustAnInterface) }; + Type[] types = [typeof(JustAClass), typeof(ClassImplementingJustAnInterface), typeof(IJustAnInterface)]; types.ThatImplement() .Should() @@ -116,7 +116,7 @@ public void When_selecting_types_that_implement_interface_it_should_return_the_c [Fact] public void When_selecting_only_the_classes_it_should_return_the_correct_type() { - var types = new[] { typeof(JustAClass), typeof(IJustAnInterface) }; + Type[] types = [typeof(JustAClass), typeof(IJustAnInterface)]; types.ThatAreClasses() .Should() @@ -127,7 +127,7 @@ public void When_selecting_only_the_classes_it_should_return_the_correct_type() [Fact] public void When_selecting_not_a_classes_it_should_return_the_correct_type() { - var types = new[] { typeof(JustAClass), typeof(IJustAnInterface) }; + Type[] types = [typeof(JustAClass), typeof(IJustAnInterface)]; types.ThatAreNotClasses() .Should() @@ -138,7 +138,7 @@ public void When_selecting_not_a_classes_it_should_return_the_correct_type() [Fact] public void When_selecting_static_classes_it_should_return_the_correct_type() { - var types = new[] { typeof(JustAClass), typeof(AStaticClass) }; + Type[] types = [typeof(JustAClass), typeof(AStaticClass)]; types.ThatAreStatic() .Should() @@ -149,7 +149,7 @@ public void When_selecting_static_classes_it_should_return_the_correct_type() [Fact] public void When_selecting_not_a_static_classes_it_should_return_the_correct_type() { - var types = new[] { typeof(JustAClass), typeof(AStaticClass) }; + Type[] types = [typeof(JustAClass), typeof(AStaticClass)]; types.ThatAreNotStatic() .Should() @@ -160,7 +160,7 @@ public void When_selecting_not_a_static_classes_it_should_return_the_correct_typ [Fact] public void When_selecting_types_with_predicate_it_should_return_the_correct_type() { - var types = new[] { typeof(JustAClass), typeof(AStaticClass) }; + Type[] types = [typeof(JustAClass), typeof(AStaticClass)]; types.ThatSatisfy(t => t.IsSealed && t.IsAbstract) .Should() diff --git a/Tests/FluentAssertions.Specs/Types/MethodInfoAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Types/MethodInfoAssertionSpecs.cs index 770e490ac5..83787028e9 100644 --- a/Tests/FluentAssertions.Specs/Types/MethodInfoAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/MethodInfoAssertionSpecs.cs @@ -414,7 +414,7 @@ public void When_asserting_a_constructor_is_not_decorated_with_MethodImpl_attrib { // Arrange ConstructorInfo constructorMethodInfo = - typeof(ClassWithMethodWithImplementationAttribute).GetConstructor(new[] { typeof(string) }); + typeof(ClassWithMethodWithImplementationAttribute).GetConstructor([typeof(string)]); // Act Action act = () => diff --git a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveConstructor.cs b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveConstructor.cs index f02269e598..f51027030d 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveConstructor.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveConstructor.cs @@ -21,7 +21,7 @@ public void When_asserting_a_type_has_a_constructor_which_it_does_it_succeeds() // Act Action act = () => type.Should() - .HaveConstructor(new[] { typeof(string) }) + .HaveConstructor([typeof(string)]) .Which.Should().HaveAccessModifier(CSharpAccessModifier.Private); // Assert @@ -36,7 +36,7 @@ public void When_asserting_a_type_has_a_constructor_which_it_does_not_it_fails() // Act Action act = () => - type.Should().HaveConstructor(new[] { typeof(int), typeof(Type) }, "we want to test the failure {0}", "message"); + type.Should().HaveConstructor([typeof(int), typeof(Type)], "we want to test the failure {0}", "message"); // Assert act.Should().Throw() @@ -53,7 +53,7 @@ public void When_subject_is_null_have_constructor_should_fail() // Act Action act = () => - type.Should().HaveConstructor(new[] { typeof(string) }, "we want to test the failure {0}", "message"); + type.Should().HaveConstructor([typeof(string)], "we want to test the failure {0}", "message"); // Assert act.Should().Throw() @@ -87,7 +87,7 @@ public void When_asserting_a_type_does_not_have_a_constructor_which_it_does_not_ // Act Action act = () => type.Should() - .NotHaveConstructor(new[] { typeof(string) }); + .NotHaveConstructor([typeof(string)]); // Assert act.Should().NotThrow(); @@ -101,7 +101,7 @@ public void When_asserting_a_type_does_not_have_a_constructor_which_it_does_it_f // Act Action act = () => - type.Should().NotHaveConstructor(new[] { typeof(string) }, "we want to test the failure {0}", "message"); + type.Should().NotHaveConstructor([typeof(string)], "we want to test the failure {0}", "message"); // Assert act.Should().Throw() @@ -117,7 +117,7 @@ public void When_subject_is_null_not_have_constructor_should_fail() // Act Action act = () => - type.Should().NotHaveConstructor(new[] { typeof(string) }, "we want to test the failure {0}", "message"); + type.Should().NotHaveConstructor([typeof(string)], "we want to test the failure {0}", "message"); // Assert act.Should().Throw() diff --git a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveIndexer.cs b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveIndexer.cs index 8e603f7871..9f3bd5022f 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveIndexer.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveIndexer.cs @@ -21,7 +21,7 @@ public void When_asserting_a_type_has_an_indexer_which_it_does_then_it_succeeds( // Act Action act = () => type.Should() - .HaveIndexer(typeof(string), new[] { typeof(string) }) + .HaveIndexer(typeof(string), [typeof(string)]) .Which.Should() .BeWritable(CSharpAccessModifier.Internal) .And.BeReadable(CSharpAccessModifier.Private); @@ -39,7 +39,7 @@ public void When_asserting_a_type_has_an_indexer_which_it_does_not_it_fails() // Act Action act = () => type.Should().HaveIndexer( - typeof(string), new[] { typeof(int), typeof(Type) }, "we want to test the failure {0}", "message"); + typeof(string), [typeof(int), typeof(Type)], "we want to test the failure {0}", "message"); // Assert act.Should().Throw() @@ -57,7 +57,7 @@ public void When_asserting_a_type_has_an_indexer_with_different_parameters_it_fa // Act Action act = () => type.Should().HaveIndexer( - typeof(string), new[] { typeof(int), typeof(Type) }, "we want to test the failure {0}", "message"); + typeof(string), [typeof(int), typeof(Type)], "we want to test the failure {0}", "message"); // Assert act.Should().Throw() @@ -73,7 +73,7 @@ public void When_subject_is_null_have_indexer_should_fail() // Act Action act = () => - type.Should().HaveIndexer(typeof(string), new[] { typeof(string) }, "we want to test the failure {0}", "message"); + type.Should().HaveIndexer(typeof(string), [typeof(string)], "we want to test the failure {0}", "message"); // Assert act.Should().Throw() @@ -88,7 +88,7 @@ public void When_asserting_a_type_has_an_indexer_for_null_it_should_throw() // Act Action act = () => - type.Should().HaveIndexer(null, new[] { typeof(string) }); + type.Should().HaveIndexer(null, [typeof(string)]); // Assert act.Should().ThrowExactly() @@ -121,7 +121,7 @@ public void When_asserting_a_type_does_not_have_an_indexer_which_it_does_not_it_ // Act Action act = () => - type.Should().NotHaveIndexer(new[] { typeof(string) }); + type.Should().NotHaveIndexer([typeof(string)]); // Assert act.Should().NotThrow(); @@ -135,7 +135,7 @@ public void When_asserting_a_type_does_not_have_an_indexer_which_it_does_it_fail // Act Action act = () => - type.Should().NotHaveIndexer(new[] { typeof(string) }, "we want to test the failure {0}", "message"); + type.Should().NotHaveIndexer([typeof(string)], "we want to test the failure {0}", "message"); // Assert act.Should().Throw() @@ -150,7 +150,7 @@ public void When_subject_is_null_not_have_indexer_should_fail() // Act Action act = () => - type.Should().NotHaveIndexer(new[] { typeof(string) }, "we want to test the failure {0}", "message"); + type.Should().NotHaveIndexer([typeof(string)], "we want to test the failure {0}", "message"); // Assert act.Should().Throw() diff --git a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveMethod.cs b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveMethod.cs index ef6db085ce..663994168d 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveMethod.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveMethod.cs @@ -21,7 +21,7 @@ public void When_asserting_a_type_has_a_method_which_it_does_it_succeeds() // Act Action act = () => type.Should() - .HaveMethod("VoidMethod", new Type[] { }) + .HaveMethod("VoidMethod", []) .Which.Should() .HaveAccessModifier(CSharpAccessModifier.Private) .And.ReturnVoid(); @@ -39,7 +39,7 @@ public void When_asserting_a_type_has_a_method_which_it_does_not_it_fails() // Act Action act = () => type.Should().HaveMethod( - "NonExistentMethod", new[] { typeof(int), typeof(Type) }, "we want to test the failure {0}", "message"); + "NonExistentMethod", [typeof(int), typeof(Type)], "we want to test the failure {0}", "message"); // Assert act.Should().Throw() @@ -57,7 +57,7 @@ public void When_asserting_a_type_has_a_method_with_different_parameter_types_it // Act Action act = () => type.Should().HaveMethod( - "VoidMethod", new[] { typeof(int), typeof(Type) }, "we want to test the failure {0}", "message"); + "VoidMethod", [typeof(int), typeof(Type)], "we want to test the failure {0}", "message"); // Assert act.Should().Throw() @@ -74,7 +74,7 @@ public void When_subject_is_null_have_method_should_fail() // Act Action act = () => - type.Should().HaveMethod("Name", new[] { typeof(string) }, "we want to test the failure {0}", "message"); + type.Should().HaveMethod("Name", [typeof(string)], "we want to test the failure {0}", "message"); // Assert act.Should().Throw() @@ -89,7 +89,7 @@ public void When_asserting_a_type_has_a_method_with_a_null_name_it_should_throw( // Act Action act = () => - type.Should().HaveMethod(null, new[] { typeof(string) }); + type.Should().HaveMethod(null, [typeof(string)]); // Assert act.Should().ThrowExactly() @@ -104,7 +104,7 @@ public void When_asserting_a_type_has_a_method_with_an_empty_name_it_should_thro // Act Action act = () => - type.Should().HaveMethod(string.Empty, new[] { typeof(string) }); + type.Should().HaveMethod(string.Empty, [typeof(string)]); // Assert act.Should().ThrowExactly() @@ -137,7 +137,7 @@ public void When_asserting_a_type_does_not_have_a_method_which_it_does_not_it_su // Act Action act = () => - type.Should().NotHaveMethod("NonExistentMethod", new Type[] { }); + type.Should().NotHaveMethod("NonExistentMethod", []); // Assert act.Should().NotThrow(); @@ -151,7 +151,7 @@ public void When_asserting_a_type_does_not_have_a_method_which_it_has_with_diffe // Act Action act = () => - type.Should().NotHaveMethod("VoidMethod", new[] { typeof(int) }); + type.Should().NotHaveMethod("VoidMethod", [typeof(int)]); // Assert act.Should().NotThrow(); @@ -165,7 +165,7 @@ public void When_asserting_a_type_does_not_have_that_method_which_it_does_it_fai // Act Action act = () => - type.Should().NotHaveMethod("VoidMethod", new Type[] { }, "we want to test the failure {0}", "message"); + type.Should().NotHaveMethod("VoidMethod", [], "we want to test the failure {0}", "message"); // Assert act.Should().Throw() @@ -180,7 +180,7 @@ public void When_subject_is_null_not_have_method_should_fail() // Act Action act = () => - type.Should().NotHaveMethod("Name", new[] { typeof(string) }, "we want to test the failure {0}", "message"); + type.Should().NotHaveMethod("Name", [typeof(string)], "we want to test the failure {0}", "message"); // Assert act.Should().Throw() @@ -195,7 +195,7 @@ public void When_asserting_a_type_does_not_have_a_method_with_a_null_name_it_sho // Act Action act = () => - type.Should().NotHaveMethod(null, new[] { typeof(string) }); + type.Should().NotHaveMethod(null, [typeof(string)]); // Assert act.Should().ThrowExactly() @@ -210,7 +210,7 @@ public void When_asserting_a_type_does_not_have_a_method_with_an_empty_name_it_s // Act Action act = () => - type.Should().NotHaveMethod(string.Empty, new[] { typeof(string) }); + type.Should().NotHaveMethod(string.Empty, [typeof(string)]); // Assert act.Should().ThrowExactly() diff --git a/Tests/FluentAssertions.Specs/Types/TypeExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/Types/TypeExtensionsSpecs.cs index 73ef4247ed..5a802d33f7 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeExtensionsSpecs.cs @@ -204,7 +204,7 @@ private static MethodInfo GetFakeConversionOperator(Type type, string name, Bind return methods.SingleOrDefault(m => m.Name == name && m.ReturnType == returnType - && m.GetParameters().Select(p => p.ParameterType).SequenceEqual(new[] { type }) + && m.GetParameters().Select(p => p.ParameterType).SequenceEqual([type]) ); } diff --git a/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs b/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs index e1a8d5a3b7..a19a1897eb 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs @@ -667,7 +667,7 @@ public void When_unwrap_task_types_it_should_return_the_correct_types() .UnwrapTaskTypes(); types.Should() - .BeEquivalentTo(new[] { typeof(int), typeof(void), typeof(void), typeof(string), typeof(bool) }); + .BeEquivalentTo([typeof(int), typeof(void), typeof(void), typeof(string), typeof(bool)]); } [Fact] @@ -897,8 +897,8 @@ internal class ClassToExploreUnwrappedEnumerableTypes internal class ClassImplementingMultipleEnumerable : IEnumerable, IEnumerable { - private readonly IEnumerable integers = Enumerable.Empty(); - private readonly IEnumerable strings = Enumerable.Empty(); + private readonly IEnumerable integers = []; + private readonly IEnumerable strings = []; public IEnumerator GetEnumerator() => integers.GetEnumerator(); From 722843b1fff69057dab3f598c17ee8234dc9cb9c Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Fri, 22 Dec 2023 01:06:57 +0100 Subject: [PATCH 216/845] ReportGenerator 5.1.23 -> 5.2.0 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 11b4f487e9..a8684f0ac9 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -18,7 +18,7 @@ - + From 1c1c1eb8dfc44746fcdf85e5982446469512b6df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 15:32:29 +0000 Subject: [PATCH 217/845] Bump Meziantou.Analyzer from 2.0.123 to 2.0.127 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.123 to 2.0.127. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.123...2.0.127) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 43c781e4b9..4001b419f7 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 607aded8b81476c09f3330b1dab6fcebdfa8c6a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 15:49:48 +0000 Subject: [PATCH 218/845] Bump cspell from 8.1.3 to 8.2.3 Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 8.1.3 to 8.2.3. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/compare/v8.1.3...v8.2.3) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 559 ++++++++++++++++++++++++++++++++------------------- 2 files changed, 353 insertions(+), 208 deletions(-) diff --git a/package.json b/package.json index b7d24badb9..7b1f6285c1 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.1.3" + "cspell": "^8.2.3" } } diff --git a/yarn.lock b/yarn.lock index 8e88a321f8..9ed7faf150 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,13 +2,13 @@ # yarn lockfile v1 -"@cspell/cspell-bundled-dicts@8.1.3": - version "8.1.3" - resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.1.3.tgz#39d92ebeb9eeeeb943cc7e05525731a06b2f388a" - integrity sha512-TwLyL2bCtetXGhMudjOIgFPAsWF2UkT0E7T+DAZG8aUBfHoC/eco/sTmR6UJVpi6Crjs0YOQkFUBGrQ2pxJPcA== +"@cspell/cspell-bundled-dicts@8.2.3": + version "8.2.3" + resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.2.3.tgz#1684eb43442440daeec45d5e4e7813d76b9cc2ea" + integrity sha512-AmKr/laSnmuTlECsIkf71N8FPd/ualJx13OdIJNIvUjIE741x/EACITIWLnTK9qFbsefOYp7bUeo9Xtbdw5JSA== dependencies: "@cspell/dict-ada" "^4.0.2" - "@cspell/dict-aws" "^4.0.0" + "@cspell/dict-aws" "^4.0.1" "@cspell/dict-bash" "^4.1.3" "@cspell/dict-companies" "^3.0.28" "@cspell/dict-cpp" "^5.0.10" @@ -40,60 +40,60 @@ "@cspell/dict-lua" "^4.0.3" "@cspell/dict-makefile" "^1.0.0" "@cspell/dict-node" "^4.0.3" - "@cspell/dict-npm" "^5.0.13" + "@cspell/dict-npm" "^5.0.14" "@cspell/dict-php" "^4.0.4" - "@cspell/dict-powershell" "^5.0.2" + "@cspell/dict-powershell" "^5.0.3" "@cspell/dict-public-licenses" "^2.0.5" "@cspell/dict-python" "^4.1.10" "@cspell/dict-r" "^2.0.1" - "@cspell/dict-ruby" "^5.0.1" + "@cspell/dict-ruby" "^5.0.2" "@cspell/dict-rust" "^4.0.1" "@cspell/dict-scala" "^5.0.0" - "@cspell/dict-software-terms" "^3.3.11" - "@cspell/dict-sql" "^2.1.2" + "@cspell/dict-software-terms" "^3.3.14" + "@cspell/dict-sql" "^2.1.3" "@cspell/dict-svelte" "^1.0.2" "@cspell/dict-swift" "^2.0.1" "@cspell/dict-typescript" "^3.1.2" "@cspell/dict-vue" "^3.0.0" -"@cspell/cspell-json-reporter@8.1.3": - version "8.1.3" - resolved "https://registry.yarnpkg.com/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.1.3.tgz#5645bead06de8bbacedc654b61663b05c57bd8d0" - integrity sha512-9iOU0Y733XuF0cqC7xwzJkOKFdJ65rYGnHFdUHzr5lxEqeG9X/jhlkzyHuGGOhPxkUeFP1x9XoLhXo1isMDbKA== +"@cspell/cspell-json-reporter@8.2.3": + version "8.2.3" + resolved "https://registry.yarnpkg.com/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.2.3.tgz#729955ac25ec9361dbab33766d233342e9b936a7" + integrity sha512-603qzkEQZueKauvzCeAMKZqcTBEEJEfs3yBsDKx1jYqyMPuTXnh3vmxkPy0paiJuE625BjzlCuvok225u6x9Qw== dependencies: - "@cspell/cspell-types" "8.1.3" + "@cspell/cspell-types" "8.2.3" -"@cspell/cspell-pipe@8.1.3": - version "8.1.3" - resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-8.1.3.tgz#728567a69d7c315377c5a1178bbe9151da82048a" - integrity sha512-/dcnyLDeyFuoX4seZv7VsDQyRpt3ZY0vjZiDpqFul8hPydM8czLyRPPMD6Za+Gqg6dZmh9+VsQWK52hVsqc0QA== +"@cspell/cspell-pipe@8.2.3": + version "8.2.3" + resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-8.2.3.tgz#49de2c9324e11ceebd995ecfacabf28a494bd1f1" + integrity sha512-ga39z+K2ZaSQczaRayNUTrz10z7umEdFiK7AdWOQpGmym5JTtTK0ntnKvKKsdSJ9F5I7TZVxgZH6r4CCEPlEEg== -"@cspell/cspell-resolver@8.1.3": - version "8.1.3" - resolved "https://registry.yarnpkg.com/@cspell/cspell-resolver/-/cspell-resolver-8.1.3.tgz#e54bbb0b5d06813907c92cdead6d1dea12a54263" - integrity sha512-bGyJYqkHRilqhyKGL/NvODN5U+UvCuQo7kxgt0i3Vd7m7k6XYLsSLYZ4w6r1S5IQ/ybU8I5lh6/6fNqKwvo9eg== +"@cspell/cspell-resolver@8.2.3": + version "8.2.3" + resolved "https://registry.yarnpkg.com/@cspell/cspell-resolver/-/cspell-resolver-8.2.3.tgz#aac8a0a76b7ebb4c7a16aa474014901c512caad0" + integrity sha512-H0855Lg0DxWDcT0FtJyqLvUqOJuE1qSg9X3ENs/ltZntQeaU8wZc+B34bXJrGpJVMuiiqHp4w6rcNN3lsOcshQ== dependencies: global-directory "^4.0.1" -"@cspell/cspell-service-bus@8.1.3": - version "8.1.3" - resolved "https://registry.yarnpkg.com/@cspell/cspell-service-bus/-/cspell-service-bus-8.1.3.tgz#2b34012d7905a596adf4a8a8daaead86c0d32666" - integrity sha512-8E5ZveQKneNfK+cuFMy0y6tDsho71UPppEHNoLZsEFDbIxDdtQcAfs0pk4nwEzxPBt+dBB+Yl8KExQ6x2FAYQw== +"@cspell/cspell-service-bus@8.2.3": + version "8.2.3" + resolved "https://registry.yarnpkg.com/@cspell/cspell-service-bus/-/cspell-service-bus-8.2.3.tgz#0fe5ab25d2c0967ae95ef7ffda6f947a483a60de" + integrity sha512-hMLEzE2MkFir3kii046RecR1JAAfA6RQhLddjwQTq1c8YCWJ4lQEKUdM5x7nr/UpJtsMj8eYZ7CtbbnxQyn7Zg== -"@cspell/cspell-types@8.1.3": - version "8.1.3" - resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-8.1.3.tgz#aaba55f4a8f6496a30ccf2235675ec6c21b9e33a" - integrity sha512-j14FENj+DzWu6JjzTl+0X5/OJv9AEckpEp6Jaw9YglxirrBBzTkZGfoLePe/AWo/MlIYp0asl92C1UHEjgz+FQ== +"@cspell/cspell-types@8.2.3": + version "8.2.3" + resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-8.2.3.tgz#39dded504b053c8cb886b51bb0a0e9d17903b8f5" + integrity sha512-AZIC1n7veQSylp9ZAcVDvIaY+oS/vpzFNJ77rzuhEy/B6X/9jzeI8wg/+vWkmhO59q4iF/ZlswWK3UXfeSnUFg== "@cspell/dict-ada@^4.0.2": version "4.0.2" resolved "https://registry.yarnpkg.com/@cspell/dict-ada/-/dict-ada-4.0.2.tgz#8da2216660aeb831a0d9055399a364a01db5805a" integrity sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA== -"@cspell/dict-aws@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-aws/-/dict-aws-4.0.0.tgz#ab71fe0c05d9ad662d27495e74361bdcb5b470eb" - integrity sha512-1YkCMWuna/EGIDN/zKkW+j98/55mxigftrSFgsehXhPld+ZMJM5J9UuBA88YfL7+/ETvBdd7mwW6IwWsC+/ltQ== +"@cspell/dict-aws@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@cspell/dict-aws/-/dict-aws-4.0.1.tgz#a0e758531ae81792b928a3f406618296291a658a" + integrity sha512-NXO+kTPQGqaaJKa4kO92NAXoqS+i99dQzf3/L1BxxWVSBS3/k1f3uhmqIh7Crb/n22W793lOm0D9x952BFga3Q== "@cspell/dict-bash@^4.1.3": version "4.1.3" @@ -255,20 +255,20 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-node/-/dict-node-4.0.3.tgz#5ae0222d72871e82978049f8e11ea627ca42fca3" integrity sha512-sFlUNI5kOogy49KtPg8SMQYirDGIAoKBO3+cDLIwD4MLdsWy1q0upc7pzGht3mrjuyMiPRUV14Bb0rkVLrxOhg== -"@cspell/dict-npm@^5.0.13": - version "5.0.13" - resolved "https://registry.yarnpkg.com/@cspell/dict-npm/-/dict-npm-5.0.13.tgz#81051f791ee29563430145b360947f711316ccd1" - integrity sha512-uPb3DlQA/FvlmzT5RjZoy7fy91mxMRZW1B+K3atVM5A/cmP1QlDaSW/iCtde5kHET1MOV7uxz+vy0Yha2OI5pQ== +"@cspell/dict-npm@^5.0.14": + version "5.0.14" + resolved "https://registry.yarnpkg.com/@cspell/dict-npm/-/dict-npm-5.0.14.tgz#1ca3d305390f393bbfa75f41c4db0fd590ce1a9c" + integrity sha512-k0kC7/W2qG5YII+SW6s+JtvKrkZg651vizi5dv/5G2HmJaeLNgDqBVeeDk/uV+ntBorM66XG4BPMjSxoaIlC5w== "@cspell/dict-php@^4.0.4": version "4.0.4" resolved "https://registry.yarnpkg.com/@cspell/dict-php/-/dict-php-4.0.4.tgz#7510c0fe4bdbb049c143eb3c471820d1e681bbb9" integrity sha512-fRlLV730fJbulDsLIouZxXoxHt3KIH6hcLFwxaupHL+iTXDg0lo7neRpbqD5MScr/J3idEr7i9G8XWzIikKFug== -"@cspell/dict-powershell@^5.0.2": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@cspell/dict-powershell/-/dict-powershell-5.0.2.tgz#2b1d7d514354b6d7de405d5faaef30f8eca0ef09" - integrity sha512-IHfWLme3FXE7vnOmMncSBxOsMTdNWd1Vcyhag03WS8oANSgX8IZ+4lMI00mF0ptlgchf16/OU8WsV4pZfikEFw== +"@cspell/dict-powershell@^5.0.3": + version "5.0.3" + resolved "https://registry.yarnpkg.com/@cspell/dict-powershell/-/dict-powershell-5.0.3.tgz#7bceb4e7db39f87479a6d2af3a033ce26796ae49" + integrity sha512-lEdzrcyau6mgzu1ie98GjOEegwVHvoaWtzQnm1ie4DyZgMr+N6D0Iyj1lzvtmt0snvsDFa5F2bsYzf3IMKcpcA== "@cspell/dict-public-licenses@^2.0.5": version "2.0.5" @@ -287,10 +287,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-r/-/dict-r-2.0.1.tgz#73474fb7cce45deb9094ebf61083fbf5913f440a" integrity sha512-KCmKaeYMLm2Ip79mlYPc8p+B2uzwBp4KMkzeLd5E6jUlCL93Y5Nvq68wV5fRLDRTf7N1LvofkVFWfDcednFOgA== -"@cspell/dict-ruby@^5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-ruby/-/dict-ruby-5.0.1.tgz#a59df952d66781d811e7aac9208c145680e8cdf9" - integrity sha512-rruTm7Emhty/BSYavSm8ZxRuVw0OBqzJkwIFXcV0cX7To8D1qbmS9HFHRuRg8IL11+/nJvtdDz+lMFBSmPUagQ== +"@cspell/dict-ruby@^5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@cspell/dict-ruby/-/dict-ruby-5.0.2.tgz#cf1a71380c633dec0857143d3270cb503b10679a" + integrity sha512-cIh8KTjpldzFzKGgrqUX4bFyav5lC52hXDKo4LbRuMVncs3zg4hcSf4HtURY+f2AfEZzN6ZKzXafQpThq3dl2g== "@cspell/dict-rust@^4.0.1": version "4.0.1" @@ -302,15 +302,15 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-scala/-/dict-scala-5.0.0.tgz#b64365ad559110a36d44ccd90edf7151ea648022" integrity sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ== -"@cspell/dict-software-terms@^3.3.11": - version "3.3.11" - resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-3.3.11.tgz#caa173f5489a426c495b73eaf57654f692d55c05" - integrity sha512-a2Zml4G47dbQ6GDdN7+YlIWs3nFnIcJkZOLT88m/LzxjApiF7AOZLqQiKwow03hyvGSuZy8itgQZmQHoPlw2vQ== +"@cspell/dict-software-terms@^3.3.14": + version "3.3.14" + resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-3.3.14.tgz#4d3f987e4d5a47009ba07a167cc9d0384beceafd" + integrity sha512-xLUtqrrvMgMEOn8grsl7p2vwf3qh4+0rZLIU0kpKSkMA8tKK3JJxJFfDyoQpZeoUGdpofhrishx3ZfIdpN/RSg== -"@cspell/dict-sql@^2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@cspell/dict-sql/-/dict-sql-2.1.2.tgz#80492b887e7986dd8bc39a9c5ea513ede2b17cb1" - integrity sha512-Pi0hAcvsSGtZZeyyAN1VfGtQJbrXos5x2QjJU0niAQKhmITSOrXU/1II1Gogk+FYDjWyV9wP2De0U2f7EWs6oQ== +"@cspell/dict-sql@^2.1.3": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@cspell/dict-sql/-/dict-sql-2.1.3.tgz#8d9666a82e35b310d0be4064032c0d891fbd2702" + integrity sha512-SEyTNKJrjqD6PAzZ9WpdSu6P7wgdNtGV2RV8Kpuw1x6bV+YsSptuClYG+JSdRExBTE6LwIe1bTklejUp3ZP8TQ== "@cspell/dict-svelte@^1.0.2": version "1.0.2" @@ -332,17 +332,29 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-vue/-/dict-vue-3.0.0.tgz#68ccb432ad93fcb0fd665352d075ae9a64ea9250" integrity sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A== -"@cspell/dynamic-import@8.1.3": - version "8.1.3" - resolved "https://registry.yarnpkg.com/@cspell/dynamic-import/-/dynamic-import-8.1.3.tgz#7bfa0dc1dbbd44bced42677ff7129932bf325d3e" - integrity sha512-/lXFLa92v4oOcZ2PbdRpOqBvnqWlYmGaV7iCy8+QhIWlMdzi+7tBX3LVTm9Jzvt/rJseVHQQ6RvfTsSmhbUMFQ== +"@cspell/dynamic-import@8.2.3": + version "8.2.3" + resolved "https://registry.yarnpkg.com/@cspell/dynamic-import/-/dynamic-import-8.2.3.tgz#d6654a79dc5493022283e49171d8fef21425ba83" + integrity sha512-udJF+88F4UMH2eVKe3Utsh4X1PyNwqPJclIeD3/MDMFWm16lLkFYMqqrdr51tNLKVi4cXceGrUEapmGwf87l/w== dependencies: import-meta-resolve "^4.0.0" -"@cspell/strong-weak-map@8.1.3": - version "8.1.3" - resolved "https://registry.yarnpkg.com/@cspell/strong-weak-map/-/strong-weak-map-8.1.3.tgz#8c782d32bea999999c761a46b4010ee1569d07c1" - integrity sha512-GhWyximzk8tumo0zhrDV3+nFYiETYefiTBWAEVbXJMibuvitFocVZwddqN85J0UdZ2M7q6tvBleEaI9ME/16gA== +"@cspell/strong-weak-map@8.2.3": + version "8.2.3" + resolved "https://registry.yarnpkg.com/@cspell/strong-weak-map/-/strong-weak-map-8.2.3.tgz#5a1d342f9c13974d32a5dc903bef683021907c80" + integrity sha512-/0gQZw87MqGX8f28E+LhFfrsWdRdQEL8EEQeMXrrzSoPnfSz+ItHMhhrwPF+bMePPjaaUNYoRXvX7hxiDsGm0w== + +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -365,11 +377,33 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + ansi-regex@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== +ansi-styles@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + array-timsort@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/array-timsort/-/array-timsort-1.0.3.tgz#3c9e4199e54fb2b9c3fe5976396a21614ef0d926" @@ -380,13 +414,12 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== dependencies: balanced-match "^1.0.0" - concat-map "0.0.1" braces@^3.0.2: version "3.0.2" @@ -420,6 +453,18 @@ clear-module@^4.1.2: parent-module "^2.0.0" resolve-from "^5.0.0" +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + commander@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/commander/-/commander-11.1.0.tgz#62fdce76006a68e5c1ab3314dc92e800eb83d906" @@ -436,11 +481,6 @@ comment-json@^4.2.3: has-own-prop "^2.0.0" repeat-string "^1.6.1" -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - configstore@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/configstore/-/configstore-6.0.0.tgz#49eca2ebc80983f77e09394a1a56e0aca8235566" @@ -457,6 +497,15 @@ core-util-is@^1.0.3: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== +cross-spawn@^7.0.0: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + crypto-random-string@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-4.0.0.tgz#5a3cc53d7dd86183df5da0312816ceeeb5bb1fc2" @@ -464,76 +513,76 @@ crypto-random-string@^4.0.0: dependencies: type-fest "^1.0.1" -cspell-config-lib@8.1.3: - version "8.1.3" - resolved "https://registry.yarnpkg.com/cspell-config-lib/-/cspell-config-lib-8.1.3.tgz#5cd4a8e4d844e9b5737825bda5b445ed50795f88" - integrity sha512-whzJYxcxos3vnywn0alCFZ+Myc0K/C62pUurfOGhgvIba7ArmlXhNRaL2r5noBxWARtpBOtzz3vrzSBK7Lq6jg== +cspell-config-lib@8.2.3: + version "8.2.3" + resolved "https://registry.yarnpkg.com/cspell-config-lib/-/cspell-config-lib-8.2.3.tgz#aec076058e0dc97300b46f8761e9b755ba2d8ee3" + integrity sha512-ATbOR06GKBIFM5SPKMF4fgo5G2qmOfdV8TbpyzNtw1AGL7PoOgDNFiKSutEzO5EHyZuXE71ZFxH3rVr2gIV7Dw== dependencies: - "@cspell/cspell-types" "8.1.3" + "@cspell/cspell-types" "8.2.3" comment-json "^4.2.3" yaml "^2.3.4" -cspell-dictionary@8.1.3: - version "8.1.3" - resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-8.1.3.tgz#7294ade35ceb388cb841a6ac8435b631aa1cac68" - integrity sha512-nkRQDPNnA6tw+hJFBqq26M0nK306q5rtyv/AUIWa8ZHhQkwzACnpMSpuJA7/DV5GVvPKltMK5M4A6vgfpoaFHw== +cspell-dictionary@8.2.3: + version "8.2.3" + resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-8.2.3.tgz#988ca1a208343ae2d2e20ee83fe5a4e9633227e5" + integrity sha512-M/idc3TLjYMpT4+8PlIg7kzoeGkR7o6h6pTwRfy/ZkBkEaV+U/35ZtVLO4qjxnuX6wrmawYmHhYqgzyKLEJIhw== dependencies: - "@cspell/cspell-pipe" "8.1.3" - "@cspell/cspell-types" "8.1.3" - cspell-trie-lib "8.1.3" + "@cspell/cspell-pipe" "8.2.3" + "@cspell/cspell-types" "8.2.3" + cspell-trie-lib "8.2.3" fast-equals "^5.0.1" gensequence "^6.0.0" -cspell-gitignore@8.1.3: - version "8.1.3" - resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-8.1.3.tgz#1d2ec9dc8d97ea8291a197e5acf6d6b6c9634193" - integrity sha512-NHx5lg44eCKb6yJmUPOCz4prcuYowzoo5GJ5hOcCfbk7ZEBWV1E2/kDRuQMOK2W0y1hNGr45CSxO3UxWJlYg7w== +cspell-gitignore@8.2.3: + version "8.2.3" + resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-8.2.3.tgz#e8430ede1d10a8a0f66924702da63d9398614b5b" + integrity sha512-tPUI+Aoq1b1shD04CLprrS8wEriiF4G1J+qBiCZK2KWOh6IcufuuDhP1Jtkzz9uONgGWFPF6jj/9TXRFlQexbQ== dependencies: - cspell-glob "8.1.3" + cspell-glob "8.2.3" find-up-simple "^1.0.0" -cspell-glob@8.1.3: - version "8.1.3" - resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-8.1.3.tgz#3eeecbf6ecbfab184107021fdf8691ce4e8fa6c5" - integrity sha512-Likr7UVUXBpthQnM5r6yao3X0YBNRbJ9AHWXTC2RJfzwZOFKF+pKPfeo3FU+Px8My96M4RC2bVMbrbZUwN5NJw== +cspell-glob@8.2.3: + version "8.2.3" + resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-8.2.3.tgz#02d144018b52774b5c31a3df955e44bfc107233a" + integrity sha512-byP2kBblO5d9rZr73MPor+KfoFdry4uu/MQmwLiK5mxgmokZYv5GVDX2DrO16Ni4yJ6/2rBPWLfq+DfCXSWqyw== dependencies: micromatch "^4.0.5" -cspell-grammar@8.1.3: - version "8.1.3" - resolved "https://registry.yarnpkg.com/cspell-grammar/-/cspell-grammar-8.1.3.tgz#8ee7d4cef92053c53b320ae105e64b771c73d21e" - integrity sha512-dTOwNq6a5wcVzOsi4xY5/tq2r2w/+wLVU+WfyySTsPe66Rjqx/QceFl4OinImks/ZMKF7Zyjd3WGyQ5TcSsJFQ== +cspell-grammar@8.2.3: + version "8.2.3" + resolved "https://registry.yarnpkg.com/cspell-grammar/-/cspell-grammar-8.2.3.tgz#0bb737f514278b9fe68efa9abc2a932fbe739a33" + integrity sha512-z57Qyu24BsHHp/nZ9ftN377cSCgSJg+6oywIglau7ws7vRpUgYKVoKxn+ZJfOrIZpXfZUqgph5IwAGFI+aRN6w== dependencies: - "@cspell/cspell-pipe" "8.1.3" - "@cspell/cspell-types" "8.1.3" + "@cspell/cspell-pipe" "8.2.3" + "@cspell/cspell-types" "8.2.3" -cspell-io@8.1.3: - version "8.1.3" - resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-8.1.3.tgz#57e99a78d998d5ab6a7a09468892174f1233b62b" - integrity sha512-QkcFeYd79oIl7PgSqFSZyvwXnZQhXmdCI733n54IN2+iXDcf7W0mwptxoC/cE19RkEwAwEFLG81UAy6L/BXI6A== +cspell-io@8.2.3: + version "8.2.3" + resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-8.2.3.tgz#dd788a91714f7987f9fa998dc7b03ddc50c34552" + integrity sha512-mPbLXiIje9chncy/Xb9C6AxqjJm9AFHz/nmIIP5bc6gd4w/yaGlQNyO8jjHF1u2JBVbIxPQSMjFgEuqasPy4Sg== dependencies: - "@cspell/cspell-service-bus" "8.1.3" + "@cspell/cspell-service-bus" "8.2.3" -cspell-lib@8.1.3: - version "8.1.3" - resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-8.1.3.tgz#5c1f87c4adb2643baa510cf1bec083bd9145b5ab" - integrity sha512-Kk8bpHVkDZO4MEiPkDvRf/LgJ0h5mufbKLTWModq6k0Ca8EkZ/qgQlZ0ve0rIivbleSqebuWjpJHKDM+IHmzHA== +cspell-lib@8.2.3: + version "8.2.3" + resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-8.2.3.tgz#bc73797d2a3919306e3d55163c5bdde8b53e5caf" + integrity sha512-NA4FsGomGPNp15TWbXx13bfknLGU8B66j0QlU3i4oDrWBj/t5m7O1nmiQqcaDSKd9s5HtdTHfxLc83hdzmmizg== dependencies: - "@cspell/cspell-bundled-dicts" "8.1.3" - "@cspell/cspell-pipe" "8.1.3" - "@cspell/cspell-resolver" "8.1.3" - "@cspell/cspell-types" "8.1.3" - "@cspell/dynamic-import" "8.1.3" - "@cspell/strong-weak-map" "8.1.3" + "@cspell/cspell-bundled-dicts" "8.2.3" + "@cspell/cspell-pipe" "8.2.3" + "@cspell/cspell-resolver" "8.2.3" + "@cspell/cspell-types" "8.2.3" + "@cspell/dynamic-import" "8.2.3" + "@cspell/strong-weak-map" "8.2.3" clear-module "^4.1.2" comment-json "^4.2.3" configstore "^6.0.0" - cspell-config-lib "8.1.3" - cspell-dictionary "8.1.3" - cspell-glob "8.1.3" - cspell-grammar "8.1.3" - cspell-io "8.1.3" - cspell-trie-lib "8.1.3" + cspell-config-lib "8.2.3" + cspell-dictionary "8.2.3" + cspell-glob "8.2.3" + cspell-grammar "8.2.3" + cspell-io "8.2.3" + cspell-trie-lib "8.2.3" fast-equals "^5.0.1" gensequence "^6.0.0" import-fresh "^3.3.0" @@ -541,34 +590,34 @@ cspell-lib@8.1.3: vscode-languageserver-textdocument "^1.0.11" vscode-uri "^3.0.8" -cspell-trie-lib@8.1.3: - version "8.1.3" - resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-8.1.3.tgz#0831429f898f816c301ac440dc1f2b199d51f7ba" - integrity sha512-EDSYU9MCtzPSJDrfvDrTKmc0rzl50Ehjg1c5rUCqn33p2LCRe/G8hW0FxXe0mxrZxrMO2b8l0PVSGlrCXCQ8RQ== +cspell-trie-lib@8.2.3: + version "8.2.3" + resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-8.2.3.tgz#54fc0605cfc8af11ed1398e4037ea8a872791272" + integrity sha512-yN2PwceN9ViCjXUhhi3MTWfi15Rpc9CsSFFPV3A6cOWoB0qBnuTXk8hBSx+427UGYjtlXPP6EZKY8w8OK6PweA== dependencies: - "@cspell/cspell-pipe" "8.1.3" - "@cspell/cspell-types" "8.1.3" + "@cspell/cspell-pipe" "8.2.3" + "@cspell/cspell-types" "8.2.3" gensequence "^6.0.0" -cspell@^8.1.3: - version "8.1.3" - resolved "https://registry.yarnpkg.com/cspell/-/cspell-8.1.3.tgz#c8643b86d7e06b69e7032bf2ddf3b27563f85c43" - integrity sha512-SU4Su6002bPoJYaiMeNV4wwLoS8TwaOgIwaTxhys3GDbJIxZV6CrDgwksezHcG7TZrC4yrveDVsdpnrzmQ7T5Q== +cspell@^8.2.3: + version "8.2.3" + resolved "https://registry.yarnpkg.com/cspell/-/cspell-8.2.3.tgz#9e861887a9babf0d1c2c7b709e9bc0b39c2f4a18" + integrity sha512-lJEIglmBINLW4Jwn+5W1k6Zb5EjyRFLnTvc1uQ268/9pcsB+GWUZruplIe5+erR3AxZ+N7Tqp7IY9j2Jf1+/Fg== dependencies: - "@cspell/cspell-json-reporter" "8.1.3" - "@cspell/cspell-pipe" "8.1.3" - "@cspell/cspell-types" "8.1.3" - "@cspell/dynamic-import" "8.1.3" + "@cspell/cspell-json-reporter" "8.2.3" + "@cspell/cspell-pipe" "8.2.3" + "@cspell/cspell-types" "8.2.3" + "@cspell/dynamic-import" "8.2.3" chalk "^5.3.0" chalk-template "^1.1.0" commander "^11.1.0" - cspell-gitignore "8.1.3" - cspell-glob "8.1.3" - cspell-io "8.1.3" - cspell-lib "8.1.3" + cspell-gitignore "8.2.3" + cspell-glob "8.2.3" + cspell-io "8.2.3" + cspell-lib "8.2.3" fast-glob "^3.3.2" fast-json-stable-stringify "^2.1.0" - file-entry-cache "^7.0.2" + file-entry-cache "^8.0.0" get-stdin "^9.0.0" semver "^7.5.4" strip-ansi "^7.1.0" @@ -581,6 +630,21 @@ dot-prop@^6.0.1: dependencies: is-obj "^2.0.0" +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + esprima@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" @@ -614,12 +678,12 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -file-entry-cache@^7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-7.0.2.tgz#2d61bb70ba89b9548e3035b7c9173fe91deafff0" - integrity sha512-TfW7/1iI4Cy7Y8L6iqNdZQVvdXn0f8B4QcIXmkIbtTIe/Okm/nSlHb4IwGzRVOd3WfSieCgvf5cMzEfySAIl0g== +file-entry-cache@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f" + integrity sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ== dependencies: - flat-cache "^3.2.0" + flat-cache "^4.0.0" fill-range@^7.0.1: version "7.0.1" @@ -633,24 +697,27 @@ find-up-simple@^1.0.0: resolved "https://registry.yarnpkg.com/find-up-simple/-/find-up-simple-1.0.0.tgz#21d035fde9fdbd56c8f4d2f63f32fd93a1cfc368" integrity sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw== -flat-cache@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" - integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== +flat-cache@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.0.tgz#d12437636f83bb8a12b8f300c36fd1614e1c7224" + integrity sha512-EryKbCE/wxpxKniQlyas6PY1I9vwtF3uCBweX+N8KYTCn3Y12RTGtQAJ/bd5pl7kxUAc8v/R3Ake/N17OZiFqA== dependencies: flatted "^3.2.9" - keyv "^4.5.3" - rimraf "^3.0.2" + keyv "^4.5.4" + rimraf "^5.0.5" flatted@^3.2.9: version "3.2.9" resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== +foreground-child@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" + integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" gensequence@^6.0.0: version "6.0.0" @@ -669,17 +736,16 @@ glob-parent@^5.1.2: dependencies: is-glob "^4.0.1" -glob@^7.1.3: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== +glob@^10.3.7: + version "10.3.10" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.10.tgz#0351ebb809fd187fe421ab96af83d3a70715df4b" + integrity sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g== dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" + foreground-child "^3.1.0" + jackspeak "^2.3.5" + minimatch "^9.0.1" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-scurry "^1.10.1" global-directory@^4.0.1: version "4.0.1" @@ -716,19 +782,6 @@ imurmurhash@^0.1.4: resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - ini@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ini/-/ini-4.1.1.tgz#d95b3d843b1e906e56d6747d5447904ff50ce7a1" @@ -739,6 +792,11 @@ is-extglob@^2.1.1: resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + is-glob@^4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" @@ -761,15 +819,29 @@ is-typedarray@^1.0.0: resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +jackspeak@^2.3.5: + version "2.3.6" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.3.6.tgz#647ecc472238aee4b06ac0e461acc21a8c505ca8" + integrity sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + json-buffer@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== -keyv@^4.5.3: - version "4.5.3" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.3.tgz#00873d2b046df737963157bd04f294ca818c9c25" - integrity sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug== +keyv@^4.5.4: + version "4.5.4" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" + integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== dependencies: json-buffer "3.0.1" @@ -780,6 +852,11 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +"lru-cache@^9.1.1 || ^10.0.0": + version "10.1.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.1.0.tgz#2098d41c2dc56500e6c88584aa656c84de7d0484" + integrity sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag== + merge2@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" @@ -793,19 +870,17 @@ micromatch@^4.0.4, micromatch@^4.0.5: braces "^3.0.2" picomatch "^2.3.1" -minimatch@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== +minimatch@^9.0.1: + version "9.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== dependencies: - brace-expansion "^1.1.7" + brace-expansion "^2.0.1" -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0": + version "7.0.4" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.4.tgz#dbce03740f50a4786ba994c1fb908844d27b038c" + integrity sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ== parent-module@^1.0.0: version "1.0.1" @@ -821,10 +896,18 @@ parent-module@^2.0.0: dependencies: callsites "^3.1.0" -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-scurry@^1.10.1: + version "1.10.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.10.1.tgz#9ba6bf5aa8500fe9fd67df4f0d9483b2b0bfc698" + integrity sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ== + dependencies: + lru-cache "^9.1.1 || ^10.0.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" picomatch@^2.3.1: version "2.3.1" @@ -856,12 +939,12 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== +rimraf@^5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-5.0.5.tgz#9be65d2d6e683447d2e9013da2bf451139a61ccf" + integrity sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A== dependencies: - glob "^7.1.3" + glob "^10.3.7" run-parallel@^1.1.9: version "1.2.0" @@ -877,12 +960,54 @@ semver@^7.5.4: dependencies: lru-cache "^6.0.0" +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + signal-exit@^3.0.2: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== -strip-ansi@^7.1.0: +signal-exit@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^7.0.1, strip-ansi@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== @@ -925,10 +1050,30 @@ vscode-uri@^3.0.8: resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f" integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw== -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" write-file-atomic@^3.0.3: version "3.0.3" From 666c3486c65249dc2d6da218fcd2024b1537c316 Mon Sep 17 00:00:00 2001 From: Martin Demberger <3066149+MartinDemberger@users.noreply.github.com> Date: Fri, 29 Dec 2023 16:30:39 +0100 Subject: [PATCH 219/845] Correct null handling when using a custom comparer (#2489) * Correct null handling when having a nullable struct propertywith a custom comparer. #2480 * Release notes added * typo corrected * Removed the check for only value types and added the null check for the expectation. Also added more tests for all cases. * typo corrected * Warnings solved * Added a comment for the changed code * Comment cleaned * Update docs/_pages/releases.md Co-authored-by: Jonas Nyrup * Typo corrected Co-authored-by: ITaluone <44049228+ITaluone@users.noreply.github.com> * Corrected Qodana issues * cleanups --------- Co-authored-by: Martin Demberger Co-authored-by: Jonas Nyrup Co-authored-by: ITaluone <44049228+ITaluone@users.noreply.github.com> Co-authored-by: Jonas Nyrup --- .../Steps/EqualityComparerEquivalencyStep.cs | 6 + .../ExtensibilitySpecs.cs | 262 ++++++++++++++++++ docs/_pages/releases.md | 1 + 3 files changed, 269 insertions(+) diff --git a/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs index d704ef80f6..94c070ba3f 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs @@ -21,6 +21,12 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon return EquivalencyResult.ContinueWithNext; } + if (comparands.Subject is null || comparands.Expectation is null) + { + // The later check for `comparands.Subject is T` leads to a failure even if the expectation is null. + return EquivalencyResult.ContinueWithNext; + } + Execute.Assertion .BecauseOf(context.Reason.FormattedMessage, context.Reason.Arguments) .ForCondition(comparands.Subject is T) diff --git a/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs index 454bbb54fc..1aea6c008c 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs @@ -862,5 +862,267 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon } } + [Fact] + public void Can_compare_null_against_null_with_custom_comparer_for_nullable_property() + { + // Arrange + var subject = new ClassWithNullableStructProperty(); + + // Act / Assert + subject.Should().BeEquivalentTo(new ClassWithNullableStructProperty(), o => o + .Using() + ); + } + + [Fact] + public void Can_compare_null_against_not_null_with_custom_comparer_for_nullable_property() + { + // Arrange + var subject = new ClassWithNullableStructProperty(); + var unexpected = new ClassWithNullableStructProperty + { + Value = new StructWithProperties + { + Value = 42 + }, + }; + + // Act / Assert + subject.Should().NotBeEquivalentTo(unexpected, o => o + .Using() + ); + } + + [Fact] + public void Can_compare_not_null_against_null_with_custom_comparer_for_nullable_property() + { + // Arrange + var subject = new ClassWithNullableStructProperty + { + Value = new StructWithProperties + { + Value = 42 + }, + }; + + // Act / Assert + subject.Should().NotBeEquivalentTo(new ClassWithNullableStructProperty(), o => o + .Using() + ); + } + + [Fact] + public void Can_compare_not_null_against_not_null_with_custom_comparer_for_nullable_property() + { + // Arrange + var subject = new ClassWithNullableStructProperty + { + Value = new StructWithProperties + { + Value = 42 + }, + }; + var expected = new ClassWithNullableStructProperty + { + Value = new StructWithProperties + { + Value = 42 + }, + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expected, o => o + .Using() + ); + } + + [Fact] + public void Can_compare_null_against_null_with_custom_nullable_comparer_for_nullable_property() + { + // Arrange + var subject = new ClassWithNullableStructProperty(); + + // Act / Assert + subject.Should().BeEquivalentTo(new ClassWithNullableStructProperty(), o => o + .Using() + ); + } + + [Fact] + public void Can_compare_null_against_not_null_with_custom_nullable_comparer_for_nullable_property() + { + // Arrange + var subject = new ClassWithNullableStructProperty(); + var unexpected = new ClassWithNullableStructProperty + { + Value = new StructWithProperties + { + Value = 42 + }, + }; + + // Act / Assert + subject.Should().NotBeEquivalentTo(unexpected, o => o + .Using() + ); + } + + [Fact] + public void Can_compare_not_null_against_null_with_custom_nullable_comparer_for_nullable_property() + { + // Arrange + var subject = new ClassWithNullableStructProperty + { + Value = new StructWithProperties + { + Value = 42 + }, + }; + + // Act / Assert + subject.Should().NotBeEquivalentTo(new ClassWithNullableStructProperty(), o => o + .Using() + ); + } + + [Fact] + public void Can_compare_not_null_against_not_null_with_custom_nullable_comparer_for_nullable_property() + { + // Arrange + var subject = new ClassWithNullableStructProperty + { + Value = new StructWithProperties + { + Value = 42 + }, + }; + var expected = new ClassWithNullableStructProperty + { + Value = new StructWithProperties + { + Value = 42 + }, + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expected, o => o + .Using() + ); + } + + private class ClassWithNullableStructProperty + { + public StructWithProperties? Value { get; set; } + } + + private struct StructWithProperties + { + // ReSharper disable once UnusedAutoPropertyAccessor.Local + public int Value { get; set; } + } + + private class StructWithPropertiesComparer : IEqualityComparer, IEqualityComparer + { + public bool Equals(StructWithProperties x, StructWithProperties y) => Equals(x.Value, y.Value); + + public int GetHashCode(StructWithProperties obj) => obj.Value; + + public bool Equals(StructWithProperties? x, StructWithProperties? y) => Equals(x?.Value, y?.Value); + + public int GetHashCode(StructWithProperties? obj) => obj?.Value ?? 0; + } + + [Fact] + public void Can_compare_null_against_null_with_custom_comparer_for_property() + { + // Arrange + var subject = new ClassWithClassProperty(); + + // Act / Assert + subject.Should().BeEquivalentTo(new ClassWithClassProperty(), o => o + .Using() + ); + } + + [Fact] + public void Can_compare_null_against_not_null_with_custom_comparer_for_property() + { + // Arrange + var subject = new ClassWithClassProperty(); + var unexpected = new ClassWithClassProperty + { + Value = new ClassProperty + { + Value = 42 + }, + }; + + // Act / Assert + subject.Should().NotBeEquivalentTo(unexpected, o => o + .Using() + ); + } + + [Fact] + public void Can_compare_not_null_against_null_with_custom_comparer_for_property() + { + // Arrange + var subject = new ClassWithClassProperty + { + Value = new ClassProperty + { + Value = 42 + }, + }; + + // Act / Assert + subject.Should().NotBeEquivalentTo(new ClassWithClassProperty(), o => o + .Using() + ); + } + + [Fact] + public void Can_compare_not_null_against_not_null_with_custom_comparer_for_property() + { + // Arrange + var subject = new ClassWithClassProperty + { + Value = new ClassProperty + { + Value = 42 + }, + }; + var expected = new ClassWithClassProperty + { + Value = new ClassProperty + { + Value = 42 + }, + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expected, o => o + .Using() + ); + } + + private class ClassWithClassProperty + { + // ReSharper disable once UnusedAutoPropertyAccessor.Local + public ClassProperty Value { get; set; } + } + + public class ClassProperty + { + public int Value { get; set; } + } + + private class ClassPropertyComparer : IEqualityComparer + { + public bool Equals(ClassProperty x, ClassProperty y) => Equals(x?.Value, y?.Value); + + public int GetHashCode(ClassProperty obj) => obj.Value; + } + #endregion } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 3327e557b1..cc421d4a38 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -34,6 +34,7 @@ sidebar: * Improved the failure message for `[Not]HaveExplicitMethod` when wrapped in an `AssertionScope` and not implementing the interface - [#2403](https://github.com/fluentassertions/fluentassertions/pull/2403) * Changed `BeEquivalentTo` to exclude `private protected` members from the comparison - [#2417](https://github.com/fluentassertions/fluentassertions/pull/2417) * Fixed using `BeEquivalentTo` on an empty `ArraySegment` - [#2445](https://github.com/fluentassertions/fluentassertions/pull/2445), [#2511](https://github.com/fluentassertions/fluentassertions/pull/2511) +* `BeEquivalentTo` with a custom comparer can now handle null values - [#2489](https://github.com/fluentassertions/fluentassertions/pull/2489) ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) From 6e89b8a86eef73f1645d0c8f8aacbf0b8f24aafd Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Fri, 29 Dec 2023 16:54:44 +0100 Subject: [PATCH 220/845] Use primary constructors for empty types --- Src/FluentAssertions/Common/Guard.cs | 4 +- .../CustomAssertionAttribute.cs | 4 +- .../CustomAssertionsAssemblyAttribute.cs | 4 +- .../Formatting/ValueFormatterAttribute.cs | 4 +- Tests/AssemblyB/ClassB.cs | 4 +- Tests/AssemblyB/ClassC.cs | 4 +- .../AssertionRuleSpecs.cs | 4 +- .../IsExternalInit.cs | 4 +- .../NestedPropertiesSpecs.cs | 4 +- .../SelectionRulesSpecs.Basic.cs | 4 +- .../SelectionRulesSpecs.Interfaces.cs | 4 +- .../TestTypes.cs | 8 +- .../AssertionOptionsSpecs.cs | 4 +- .../ConfigurationSpecs.cs | 4 +- .../Events/EventAssertionSpecs.cs | 12 +- .../Extensions/ObjectCastingSpecs.cs | 4 +- .../Formatting/FormatterSpecs.cs | 20 +-- .../FluentAssertions.Specs/IsExternalInit.cs | 4 +- .../Primitives/ObjectAssertionSpecs.cs | 4 +- .../ReferenceTypeAssertionsSpecs.cs | 3 +- .../Primitives/StringComparisonSpecs.cs | 4 +- .../Specialized/AssemblyAssertionSpecs.cs | 4 +- .../TypeEnumerableExtensionsSpecs.cs | 44 ++----- ...peAssertionSpecs.HaveDefaultConstructor.cs | 8 +- .../Types/TypeAssertionSpecs.cs | 120 +++++------------- .../Types/TypeExtensionsSpecs.cs | 8 +- .../Types/TypeSelectorSpecs.cs | 108 ++++------------ .../UIFactsDefinition.cs | 4 +- 28 files changed, 102 insertions(+), 305 deletions(-) diff --git a/Src/FluentAssertions/Common/Guard.cs b/Src/FluentAssertions/Common/Guard.cs index 046a5581ea..2ca3fa22f9 100644 --- a/Src/FluentAssertions/Common/Guard.cs +++ b/Src/FluentAssertions/Common/Guard.cs @@ -120,7 +120,5 @@ public static void ThrowIfArgumentIsNegative(decimal value, [CallerArgumentExpre /// https://github.com/dotnet/roslyn-analyzers/issues/3451#issuecomment-606690452 /// [AttributeUsage(AttributeTargets.Parameter)] - private sealed class ValidatedNotNullAttribute : Attribute - { - } + private sealed class ValidatedNotNullAttribute : Attribute; } diff --git a/Src/FluentAssertions/CustomAssertionAttribute.cs b/Src/FluentAssertions/CustomAssertionAttribute.cs index 3dcde4a46c..6078c1457f 100644 --- a/Src/FluentAssertions/CustomAssertionAttribute.cs +++ b/Src/FluentAssertions/CustomAssertionAttribute.cs @@ -8,6 +8,4 @@ namespace FluentAssertions; /// [AttributeUsage(AttributeTargets.Method)] #pragma warning disable CA1813 // Avoid unsealed attributes. This type has shipped. -public class CustomAssertionAttribute : Attribute -{ -} +public class CustomAssertionAttribute : Attribute; diff --git a/Src/FluentAssertions/CustomAssertionsAssemblyAttribute.cs b/Src/FluentAssertions/CustomAssertionsAssemblyAttribute.cs index ce016d9dd3..faaff8e2b3 100644 --- a/Src/FluentAssertions/CustomAssertionsAssemblyAttribute.cs +++ b/Src/FluentAssertions/CustomAssertionsAssemblyAttribute.cs @@ -7,6 +7,4 @@ namespace FluentAssertions; /// internally, or directly uses the Execute.Assertion. /// [AttributeUsage(AttributeTargets.Assembly)] -public sealed class CustomAssertionsAssemblyAttribute : Attribute -{ -} +public sealed class CustomAssertionsAssemblyAttribute : Attribute; diff --git a/Src/FluentAssertions/Formatting/ValueFormatterAttribute.cs b/Src/FluentAssertions/Formatting/ValueFormatterAttribute.cs index bac15f0878..518b0411c7 100644 --- a/Src/FluentAssertions/Formatting/ValueFormatterAttribute.cs +++ b/Src/FluentAssertions/Formatting/ValueFormatterAttribute.cs @@ -7,6 +7,4 @@ namespace FluentAssertions.Formatting; /// [AttributeUsage(AttributeTargets.Method)] #pragma warning disable CA1813 // Avoid unsealed attributes. This type has shipped. -public class ValueFormatterAttribute : Attribute -{ -} +public class ValueFormatterAttribute : Attribute; diff --git a/Tests/AssemblyB/ClassB.cs b/Tests/AssemblyB/ClassB.cs index 691f012b41..c532a61c6b 100644 --- a/Tests/AssemblyB/ClassB.cs +++ b/Tests/AssemblyB/ClassB.cs @@ -1,5 +1,3 @@ namespace AssemblyB; -public class ClassB -{ -} +public class ClassB; diff --git a/Tests/AssemblyB/ClassC.cs b/Tests/AssemblyB/ClassC.cs index c1cff72c21..8d8ba5ffa0 100644 --- a/Tests/AssemblyB/ClassC.cs +++ b/Tests/AssemblyB/ClassC.cs @@ -1,5 +1,3 @@ namespace AssemblyB; -public class ClassC -{ -} +public class ClassC; diff --git a/Tests/FluentAssertions.Equivalency.Specs/AssertionRuleSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/AssertionRuleSpecs.cs index e13c43491b..b5c4b9132d 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/AssertionRuleSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/AssertionRuleSpecs.cs @@ -245,9 +245,7 @@ public void When_the_runtime_type_does_match_the_equality_comparer_type_it_shoul act.Should().Throw().WithMessage("*ConcreteClassEqualityComparer*"); } - private interface IInterface - { - } + private interface IInterface; private class ConcreteClass : IInterface { diff --git a/Tests/FluentAssertions.Equivalency.Specs/IsExternalInit.cs b/Tests/FluentAssertions.Equivalency.Specs/IsExternalInit.cs index a8fc5f92e0..e4b143e44e 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/IsExternalInit.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/IsExternalInit.cs @@ -8,6 +8,4 @@ namespace System.Runtime.CompilerServices; /// This class should not be used by developers in source code. /// [EditorBrowsable(EditorBrowsableState.Never)] -internal static class IsExternalInit -{ -} +internal static class IsExternalInit; diff --git a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs index 274187c89e..47e80a69eb 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs @@ -315,9 +315,7 @@ public void Should_support_nested_collections_containing_empty_objects() orig.Should().BeEquivalentTo(expectation); } - public class Inner - { - } + public class Inner; public class OuterWithObject { diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs index 9cd7c4559a..6c48353d0e 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs @@ -292,8 +292,6 @@ internal class BaseClassPointingToClassWithoutProperties public ClassWithoutProperty ClassWithoutProperty { get; } = new(); } - internal class ClassWithoutProperty - { - } + internal class ClassWithoutProperty; } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs index 33a0794b60..5f1b9c2457 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs @@ -371,8 +371,6 @@ public class BaseProvidingSamePropertiesAsInterface public int Value2 { get; set; } } - public class DerivedClassImplementingInterface : BaseProvidingSamePropertiesAsInterface, IInterfaceWithTwoProperties - { - } + public class DerivedClassImplementingInterface : BaseProvidingSamePropertiesAsInterface, IInterfaceWithTwoProperties; } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/TestTypes.cs b/Tests/FluentAssertions.Equivalency.Specs/TestTypes.cs index 01cef098d1..2865e5c7e7 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/TestTypes.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/TestTypes.cs @@ -114,9 +114,7 @@ internal class ClassWithEnumFour public EnumFour Enum { get; set; } } -internal class ClassWithNoMembers -{ -} +internal class ClassWithNoMembers; internal class ClassWithOnlyAField { @@ -138,9 +136,7 @@ internal class ClassWithOnlyAProperty public int Value { get; set; } } -internal struct StructWithNoMembers -{ -} +internal struct StructWithNoMembers; internal class ClassWithSomeFieldsAndProperties { diff --git a/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs b/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs index d22555b3e9..0a2ed6569d 100644 --- a/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs @@ -16,9 +16,7 @@ public class AssertionOptionsSpecs { // Due to tests that call AssertionOptions [CollectionDefinition("AssertionOptionsSpecs", DisableParallelization = true)] - public class AssertionOptionsSpecsDefinition - { - } + public class AssertionOptionsSpecsDefinition; public abstract class Given_temporary_global_assertion_options : GivenWhenThen { diff --git a/Tests/FluentAssertions.Specs/ConfigurationSpecs.cs b/Tests/FluentAssertions.Specs/ConfigurationSpecs.cs index ae08e821a0..36cbc680ef 100644 --- a/Tests/FluentAssertions.Specs/ConfigurationSpecs.cs +++ b/Tests/FluentAssertions.Specs/ConfigurationSpecs.cs @@ -33,6 +33,4 @@ public void When_concurrently_accessing_current_Configuration_no_exception_shoul // Due to tests that call Configuration.Current [CollectionDefinition("ConfigurationSpecs", DisableParallelization = true)] -public class ConfigurationSpecsDefinition -{ -} +public class ConfigurationSpecsDefinition; diff --git a/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs index b133dce666..d79684ba0f 100644 --- a/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs @@ -984,13 +984,9 @@ public void OnEvent(object o) } } - public class B - { - } + public class B; - public class C - { - } + public class C; public class ClassThatRaisesEventsItself : IInheritsEventRaisingInterface { @@ -1055,9 +1051,7 @@ public interface IEventRaisingInterface3 event EventHandler Interface3Event; } - public interface IInheritsEventRaisingInterface : IEventRaisingInterface - { - } + public interface IInheritsEventRaisingInterface : IEventRaisingInterface; public class EventRaisingClass : INotifyPropertyChanged { diff --git a/Tests/FluentAssertions.Specs/Extensions/ObjectCastingSpecs.cs b/Tests/FluentAssertions.Specs/Extensions/ObjectCastingSpecs.cs index f9bca56315..c663ded608 100644 --- a/Tests/FluentAssertions.Specs/Extensions/ObjectCastingSpecs.cs +++ b/Tests/FluentAssertions.Specs/Extensions/ObjectCastingSpecs.cs @@ -20,9 +20,7 @@ public void When_casting_an_object_using_the_as_operator_it_should_return_the_ex derivedInstance.DerivedProperty.Should().Be("hello"); } - private class SomeBaseClass - { - } + private class SomeBaseClass; private class SomeDerivedClass : SomeBaseClass { diff --git a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs index 931e43cafb..4d6853ee72 100644 --- a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs +++ b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs @@ -51,9 +51,7 @@ public void When_the_same_object_appears_twice_in_the_graph_at_different_paths() exception.Message.Should().NotContainEquivalentOf("cyclic"); } - private class A - { - } + private class A; private class B { @@ -1095,17 +1093,11 @@ public override string ToString() } } - public class SomeClassInheritedFromClassWithCustomFormatterLvl1 : SomeClassWithCustomFormatter - { - } + public class SomeClassInheritedFromClassWithCustomFormatterLvl1 : SomeClassWithCustomFormatter; - public class SomeClassInheritedFromClassWithCustomFormatterLvl2 : SomeClassInheritedFromClassWithCustomFormatterLvl1 - { - } + public class SomeClassInheritedFromClassWithCustomFormatterLvl2 : SomeClassInheritedFromClassWithCustomFormatterLvl1; - public class SomeClassInheritedFromClassWithCustomFormatterLvl3 : SomeClassInheritedFromClassWithCustomFormatterLvl2 - { - } + public class SomeClassInheritedFromClassWithCustomFormatterLvl3 : SomeClassInheritedFromClassWithCustomFormatterLvl2; public static class CustomFormatter { @@ -1229,9 +1221,7 @@ public FormatterScope(IValueFormatter formatter) // Due to the tests that call Configuration.Current [CollectionDefinition("FormatterSpecs", DisableParallelization = true)] -public class FormatterSpecsDefinition -{ -} +public class FormatterSpecsDefinition; internal class ExceptionThrowingClass { diff --git a/Tests/FluentAssertions.Specs/IsExternalInit.cs b/Tests/FluentAssertions.Specs/IsExternalInit.cs index a8fc5f92e0..e4b143e44e 100644 --- a/Tests/FluentAssertions.Specs/IsExternalInit.cs +++ b/Tests/FluentAssertions.Specs/IsExternalInit.cs @@ -8,6 +8,4 @@ namespace System.Runtime.CompilerServices; /// This class should not be used by developers in source code. /// [EditorBrowsable(EditorBrowsableState.Never)] -internal static class IsExternalInit -{ -} +internal static class IsExternalInit; diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs index 567b5e2f17..53bf614720 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs @@ -45,9 +45,7 @@ internal class DumbObjectEqualityComparer : IEqualityComparer } } -internal class DummyBaseClass -{ -} +internal class DummyBaseClass; internal sealed class DummyImplementingClass : DummyBaseClass, IDisposable { diff --git a/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs index 116284854e..79deff5d52 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs @@ -538,8 +538,7 @@ public override string ToString() } } -public abstract class SimpleComplexBase -{ } +public abstract class SimpleComplexBase; public class Simple : SimpleComplexBase { diff --git a/Tests/FluentAssertions.Specs/Primitives/StringComparisonSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/StringComparisonSpecs.cs index bb936f0b06..5ece34c048 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringComparisonSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringComparisonSpecs.cs @@ -371,6 +371,4 @@ public void Culture_is_ignored_when_sorting_strings() // Due to CulturedTheory changing CultureInfo [CollectionDefinition(nameof(StringComparisonSpecs), DisableParallelization = true)] -public class StringComparisonDefinition -{ -} +public class StringComparisonDefinition; diff --git a/Tests/FluentAssertions.Specs/Specialized/AssemblyAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/AssemblyAssertionSpecs.cs index 7736ea9f54..50ec7d4f01 100644 --- a/Tests/FluentAssertions.Specs/Specialized/AssemblyAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/AssemblyAssertionSpecs.cs @@ -387,6 +387,4 @@ public void Chaining_after_one_assertion() } [DummyClass("name", true)] -public class WellKnownClassWithAttribute -{ -} +public class WellKnownClassWithAttribute; diff --git a/Tests/FluentAssertions.Specs/TypeEnumerableExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/TypeEnumerableExtensionsSpecs.cs index 6346798105..41e1fdce5b 100644 --- a/Tests/FluentAssertions.Specs/TypeEnumerableExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/TypeEnumerableExtensionsSpecs.cs @@ -198,57 +198,35 @@ public void When_unwrap_enumerable_types_it_should_return_the_correct_type() namespace TypeEnumerableExtensionsSpecs.BaseNamespace { - internal class BaseNamespaceClass - { - } + internal class BaseNamespaceClass; } namespace TypeEnumerableExtensionsSpecs.BaseNamespace.Nested { - internal class NestedNamespaceClass - { - } + internal class NestedNamespaceClass; } namespace TypeEnumerableExtensionsSpecs.Internal { - internal interface IJustAnInterface - { - } + internal interface IJustAnInterface; - internal class JustAClass - { - } + internal class JustAClass; - internal static class AStaticClass - { - } + internal static class AStaticClass; - internal class SomeBaseClass - { - } + internal class SomeBaseClass; - internal class SomeClassDerivedFromSomeBaseClass : SomeBaseClass - { - } + internal class SomeClassDerivedFromSomeBaseClass : SomeBaseClass; - internal class ClassImplementingJustAnInterface : IJustAnInterface - { - } + internal class ClassImplementingJustAnInterface : IJustAnInterface; [Some] - internal class ClassWithSomeAttribute - { - } + internal class ClassWithSomeAttribute; - internal class ClassDerivedFromClassWithSomeAttribute : ClassWithSomeAttribute - { - } + internal class ClassDerivedFromClassWithSomeAttribute : ClassWithSomeAttribute; [AttributeUsage(AttributeTargets.Class)] - internal class SomeAttribute : Attribute - { - } + internal class SomeAttribute : Attribute; } #endregion diff --git a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveDefaultConstructor.cs b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveDefaultConstructor.cs index 126639b843..14a7a5a8d8 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveDefaultConstructor.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveDefaultConstructor.cs @@ -179,13 +179,9 @@ public void When_subject_is_null_not_have_default_constructor_should_fail() } } - internal class ClassWithNoMembers - { - } + internal class ClassWithNoMembers; - internal class ClassWithCctor - { - } + internal class ClassWithCctor; internal class ClassWithCctorAndNonDefaultConstructor { diff --git a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.cs index fdc767d3f7..0ec9bf2ade 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.cs @@ -6,28 +6,18 @@ namespace FluentAssertions.Specs.Types /// /// Type assertion specs. /// - public partial class TypeAssertionSpecs - { - } + public partial class TypeAssertionSpecs; #region Internal classes used in unit tests [DummyClass("Expected", true)] - public class ClassWithAttribute - { - } + public class ClassWithAttribute; - public class ClassWithInheritedAttribute : ClassWithAttribute - { - } + public class ClassWithInheritedAttribute : ClassWithAttribute; - public class ClassWithoutAttribute - { - } + public class ClassWithoutAttribute; - public class OtherClassWithoutAttribute - { - } + public class OtherClassWithoutAttribute; [AttributeUsage(AttributeTargets.Class)] public class DummyClassAttribute : Attribute @@ -43,29 +33,17 @@ public DummyClassAttribute(string name, bool isEnabled) } } - public interface IDummyInterface - { - } + public interface IDummyInterface; - public interface IDummyInterface - { - } + public interface IDummyInterface; - public class ClassThatImplementsInterface : IDummyInterface, IDummyInterface - { - } + public class ClassThatImplementsInterface : IDummyInterface, IDummyInterface; - public class ClassThatDoesNotImplementInterface - { - } + public class ClassThatDoesNotImplementInterface; - public class DummyBaseType : IDummyInterface - { - } + public class DummyBaseType : IDummyInterface; - public class ClassWithGenericBaseType : DummyBaseType - { - } + public class ClassWithGenericBaseType : DummyBaseType; public class ClassWithMembers { @@ -132,25 +110,15 @@ public interface IExplicitInterface void ExplicitImplicitMethod(string overload); } - public class ClassWithoutMembers - { - } + public class ClassWithoutMembers; - public interface IPublicInterface - { - } + public interface IPublicInterface; - internal interface IInternalInterface - { - } + internal interface IInternalInterface; - internal class InternalClass - { - } + internal class InternalClass; - internal struct InternalStruct - { - } + internal struct InternalStruct; internal enum InternalEnum { @@ -160,23 +128,15 @@ internal enum InternalEnum internal class Nested { - private class PrivateClass - { - } + private class PrivateClass; protected enum ProtectedEnum { } - public interface IPublicInterface - { - } + public interface IPublicInterface; - internal class InternalClass - { - } + internal class InternalClass; - protected internal interface IProtectedInternalInterface - { - } + protected internal interface IProtectedInternalInterface; } internal readonly struct TypeWithConversionOperators @@ -195,31 +155,19 @@ public static explicit operator byte(TypeWithConversionOperators typeWithConvers (byte)typeWithConversionOperators.value; } - internal sealed class Sealed - { - } + internal sealed class Sealed; - internal abstract class Abstract - { - } + internal abstract class Abstract; - internal static class Static - { - } + internal static class Static; - internal struct Struct - { - } + internal struct Struct; public delegate void ExampleDelegate(); - internal class ClassNotInDummyNamespace - { - } + internal class ClassNotInDummyNamespace; - internal class OtherClassNotInDummyNamespace - { - } + internal class OtherClassNotInDummyNamespace; #endregion } @@ -232,9 +180,7 @@ namespace AssemblyB /// A class that intentionally has the exact same name and namespace as the ClassC from the AssemblyB /// assembly. This class is used to test the behavior of comparisons on such types. /// - internal class ClassC - { - } + internal class ClassC; #pragma warning restore 436 } @@ -243,23 +189,17 @@ internal class ClassC namespace DummyNamespace { - internal class ClassInDummyNamespace - { - } + internal class ClassInDummyNamespace; namespace InnerDummyNamespace { - internal class ClassInInnerDummyNamespace - { - } + internal class ClassInInnerDummyNamespace; } } namespace DummyNamespaceTwo { - internal class ClassInDummyNamespaceTwo - { - } + internal class ClassInDummyNamespaceTwo; } #endregion diff --git a/Tests/FluentAssertions.Specs/Types/TypeExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/Types/TypeExtensionsSpecs.cs index 5a802d33f7..2ea5de12c7 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeExtensionsSpecs.cs @@ -208,13 +208,9 @@ private static MethodInfo GetFakeConversionOperator(Type type, string name, Bind ); } - private class InheritedType - { - } + private class InheritedType; - private class InheritingType : InheritedType - { - } + private class InheritingType : InheritedType; private readonly struct TypeWithFakeConversionOperators { diff --git a/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs b/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs index a19a1897eb..7049d03774 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs @@ -727,40 +727,26 @@ public void When_selecting_types_that_are_not_interfaces_it_should_return_the_co namespace Internal.Main.Test { - internal class SomeBaseClass - { - } + internal class SomeBaseClass; - internal class ClassDerivedFromSomeBaseClass : SomeBaseClass - { - } + internal class ClassDerivedFromSomeBaseClass : SomeBaseClass; internal class SomeGenericBaseClass { public T Value { get; set; } } - internal class ClassDerivedFromSomeGenericBaseClass : SomeGenericBaseClass - { - } + internal class ClassDerivedFromSomeGenericBaseClass : SomeGenericBaseClass; - internal interface ISomeInterface - { - } + internal interface ISomeInterface; - internal class ClassImplementingSomeInterface : ISomeInterface - { - } + internal class ClassImplementingSomeInterface : ISomeInterface; [AttributeUsage(AttributeTargets.Class)] - internal class SomeAttribute : Attribute - { - } + internal class SomeAttribute : Attribute; [AttributeUsage(AttributeTargets.Class, Inherited = false)] - internal class SomeNonInheritableAttribute : Attribute - { - } + internal class SomeNonInheritableAttribute : Attribute; [Some] internal class ClassWithSomeAttribute @@ -772,9 +758,7 @@ public void Method1() } } - internal class ClassWithSomeAttributeDerived : ClassWithSomeAttribute - { - } + internal class ClassWithSomeAttributeDerived : ClassWithSomeAttribute; [SomeNonInheritable] internal class ClassWithSomeNonInheritableAttribute @@ -786,9 +770,7 @@ public void Method1() } } - internal class ClassWithSomeNonInheritableAttributeDerived : ClassWithSomeNonInheritableAttribute - { - } + internal class ClassWithSomeNonInheritableAttributeDerived : ClassWithSomeNonInheritableAttribute; [Some] internal class ClassWithSomeAttributeThatImplementsSomeInterface : ISomeInterface @@ -803,72 +785,48 @@ public void Method2() namespace Internal.Other.Test { - internal class SomeOtherClass - { - } + internal class SomeOtherClass; } namespace Internal.Other.Test.Common { - internal class SomeCommonClass - { - } + internal class SomeCommonClass; } namespace Internal.NotOnlyClasses.Test { - internal class NotOnlyClassesClass - { - } + internal class NotOnlyClassesClass; internal enum NotOnlyClassesEnumeration { } - internal interface INotOnlyClassesInterface - { - } + internal interface INotOnlyClassesInterface; } namespace Internal.StaticAndNonStaticClasses.Test { - internal static class StaticClass - { - } + internal static class StaticClass; - internal class NotAStaticClass - { - } + internal class NotAStaticClass; } namespace Internal.AbstractAndNotAbstractClasses.Test { - internal abstract class AbstractClass - { - } + internal abstract class AbstractClass; - internal class NotAbstractClass - { - } + internal class NotAbstractClass; - internal static class NotAbstractStaticClass - { - } + internal static class NotAbstractStaticClass; } namespace Internal.InterfaceAndClasses.Test { - internal interface InternalInterface - { - } + internal interface InternalInterface; - internal abstract class InternalAbstractClass - { - } + internal abstract class InternalAbstractClass; - internal class InternalNotInterfaceClass - { - } + internal class InternalNotInterfaceClass; } namespace Internal.UnwrapSelectorTestTypes.Test @@ -910,26 +868,18 @@ internal class ClassImplementingMultipleEnumerable : IEnumerable, IEnumerab namespace Internal.SealedAndNotSealedClasses.Test { - internal sealed class SealedClass - { - } + internal sealed class SealedClass; - internal class NotSealedClass - { - } + internal class NotSealedClass; } namespace Internal.ValueTypesAndNotValueTypes.Test { - internal struct InternalStructValueType - { - } + internal struct InternalStructValueType; internal record struct InternalRecordStructValueType; - internal class InternalClassNotValueType - { - } + internal class InternalClassNotValueType; internal record class InternalRecordClass; @@ -937,15 +887,11 @@ internal enum InternalEnumValueType { } - internal interface InternalInterfaceNotValueType - { - } + internal interface InternalInterfaceNotValueType; } #pragma warning disable RCS1110, S3903 // Declare type inside namespace. -internal class ClassInGlobalNamespace -{ -} +internal class ClassInGlobalNamespace; #pragma warning restore RCS1110, S3903 #endregion diff --git a/Tests/FluentAssertions.Specs/UIFactsDefinition.cs b/Tests/FluentAssertions.Specs/UIFactsDefinition.cs index 26d6621799..8bfe2df071 100644 --- a/Tests/FluentAssertions.Specs/UIFactsDefinition.cs +++ b/Tests/FluentAssertions.Specs/UIFactsDefinition.cs @@ -4,6 +4,4 @@ namespace FluentAssertions.Specs; // Try to stabilize UIFact tests [CollectionDefinition("UIFacts", DisableParallelization = true)] -public class UIFactsDefinition -{ -} +public class UIFactsDefinition; From 043fedb836a8c607f8ea7d16e7eaff83567a4800 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Fri, 29 Dec 2023 16:59:47 +0100 Subject: [PATCH 221/845] Remove unused usings --- Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs | 1 - .../Collections/CollectionAssertionSpecs.AllSatisfy.cs | 1 - .../Collections/CollectionAssertionSpecs.ContainSingle.cs | 1 - .../Collections/CollectionAssertionSpecs.OnlyContain.cs | 1 - .../Collections/CollectionAssertionSpecs.Satisfy.cs | 1 - .../Collections/CollectionAssertionSpecs.SatisfyRespectively.cs | 1 - Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs | 1 - 7 files changed, 7 deletions(-) diff --git a/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs b/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs index 229277eb9f..a9739648d3 100644 --- a/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs +++ b/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using FluentAssertions.Common; diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllSatisfy.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllSatisfy.cs index 7e327a012a..e6ff937c2a 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllSatisfy.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllSatisfy.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using FluentAssertions.Execution; using Xunit; using Xunit.Sdk; diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainSingle.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainSingle.cs index 524b786a94..ffee01bbe8 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainSingle.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainSingle.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Linq.Expressions; using FluentAssertions.Execution; using Xunit; diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyContain.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyContain.cs index 3054eb981d..8a01b6dd19 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyContain.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyContain.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using FluentAssertions.Execution; using Xunit; using Xunit.Sdk; diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Satisfy.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Satisfy.cs index 289ba5b50e..3f9d53f195 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Satisfy.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Satisfy.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Linq.Expressions; using FluentAssertions.Execution; using Xunit; diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.SatisfyRespectively.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.SatisfyRespectively.cs index e85c6a4827..186cb46993 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.SatisfyRespectively.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.SatisfyRespectively.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using FluentAssertions.Execution; using Xunit; using Xunit.Sdk; diff --git a/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs b/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs index 7049d03774..80ab2af50f 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs @@ -1,7 +1,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Linq; using System.Reflection; using System.Threading.Tasks; using FluentAssertions.Types; From 6480d5dc1fe35dc90f98b1c7043e43e1e27f00be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 16:00:38 +0000 Subject: [PATCH 222/845] Bump Bogus from 35.0.1 to 35.2.0 Bumps [Bogus](https://github.com/bchavez/Bogus) from 35.0.1 to 35.2.0. - [Release notes](https://github.com/bchavez/Bogus/releases) - [Changelog](https://github.com/bchavez/Bogus/blob/master/HISTORY.md) - [Commits](https://github.com/bchavez/Bogus/compare/v35.0.1...v35.2.0) --- updated-dependencies: - dependency-name: Bogus dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Tests/Benchmarks/Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index 56d5c5d760..436dc0bcfe 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -10,7 +10,7 @@ - + From c61005d2bd6dbfab05c2635c41f9cc1491f3d6f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 15:09:37 +0000 Subject: [PATCH 223/845] Bump cspell from 8.2.3 to 8.3.1 Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 8.2.3 to 8.3.1. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/compare/v8.2.3...v8.3.1) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 280 ++++++++++++++++++++++++++------------------------- 2 files changed, 142 insertions(+), 140 deletions(-) diff --git a/package.json b/package.json index 7b1f6285c1..ba102d65c2 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.2.3" + "cspell": "^8.3.1" } } diff --git a/yarn.lock b/yarn.lock index 9ed7faf150..218580b319 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,17 +2,17 @@ # yarn lockfile v1 -"@cspell/cspell-bundled-dicts@8.2.3": - version "8.2.3" - resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.2.3.tgz#1684eb43442440daeec45d5e4e7813d76b9cc2ea" - integrity sha512-AmKr/laSnmuTlECsIkf71N8FPd/ualJx13OdIJNIvUjIE741x/EACITIWLnTK9qFbsefOYp7bUeo9Xtbdw5JSA== +"@cspell/cspell-bundled-dicts@8.3.1": + version "8.3.1" + resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.3.1.tgz#342f205d79ba4c074023d67f30531dece66e37b6" + integrity sha512-pITQe2B9CGm7WFe/BsKyzOlBtuTRtP4uSC6baijCOJX5xduTCfJsS/l4iX3oXNx2ewYny+K3yUE9KRI0QPKtQA== dependencies: "@cspell/dict-ada" "^4.0.2" "@cspell/dict-aws" "^4.0.1" "@cspell/dict-bash" "^4.1.3" - "@cspell/dict-companies" "^3.0.28" + "@cspell/dict-companies" "^3.0.29" "@cspell/dict-cpp" "^5.0.10" - "@cspell/dict-cryptocurrencies" "^4.0.0" + "@cspell/dict-cryptocurrencies" "^5.0.0" "@cspell/dict-csharp" "^4.0.2" "@cspell/dict-css" "^4.0.12" "@cspell/dict-dart" "^2.0.3" @@ -20,15 +20,15 @@ "@cspell/dict-docker" "^1.1.7" "@cspell/dict-dotnet" "^5.0.0" "@cspell/dict-elixir" "^4.0.3" - "@cspell/dict-en-common-misspellings" "^1.0.2" + "@cspell/dict-en-common-misspellings" "^2.0.0" "@cspell/dict-en-gb" "1.1.33" - "@cspell/dict-en_us" "^4.3.12" + "@cspell/dict-en_us" "^4.3.13" "@cspell/dict-filetypes" "^3.0.3" "@cspell/dict-fonts" "^4.0.0" "@cspell/dict-fsharp" "^1.0.1" "@cspell/dict-fullstack" "^3.1.5" "@cspell/dict-gaming-terms" "^1.0.4" - "@cspell/dict-git" "^2.0.0" + "@cspell/dict-git" "^3.0.0" "@cspell/dict-golang" "^6.0.5" "@cspell/dict-haskell" "^4.0.1" "@cspell/dict-html" "^4.0.5" @@ -41,49 +41,49 @@ "@cspell/dict-makefile" "^1.0.0" "@cspell/dict-node" "^4.0.3" "@cspell/dict-npm" "^5.0.14" - "@cspell/dict-php" "^4.0.4" + "@cspell/dict-php" "^4.0.5" "@cspell/dict-powershell" "^5.0.3" "@cspell/dict-public-licenses" "^2.0.5" - "@cspell/dict-python" "^4.1.10" + "@cspell/dict-python" "^4.1.11" "@cspell/dict-r" "^2.0.1" "@cspell/dict-ruby" "^5.0.2" "@cspell/dict-rust" "^4.0.1" "@cspell/dict-scala" "^5.0.0" - "@cspell/dict-software-terms" "^3.3.14" + "@cspell/dict-software-terms" "^3.3.15" "@cspell/dict-sql" "^2.1.3" "@cspell/dict-svelte" "^1.0.2" "@cspell/dict-swift" "^2.0.1" "@cspell/dict-typescript" "^3.1.2" "@cspell/dict-vue" "^3.0.0" -"@cspell/cspell-json-reporter@8.2.3": - version "8.2.3" - resolved "https://registry.yarnpkg.com/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.2.3.tgz#729955ac25ec9361dbab33766d233342e9b936a7" - integrity sha512-603qzkEQZueKauvzCeAMKZqcTBEEJEfs3yBsDKx1jYqyMPuTXnh3vmxkPy0paiJuE625BjzlCuvok225u6x9Qw== +"@cspell/cspell-json-reporter@8.3.1": + version "8.3.1" + resolved "https://registry.yarnpkg.com/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.3.1.tgz#fd3da0ca08c5afe86a92f9552bac6dc742e258f0" + integrity sha512-E7kO01UnKD/FUMq53ehNBrksHR3mfLv8lShR2Xa6pnHmhiciqMhQuBkbv9/9ReSn7+E8ZAqrrl+5hNr3Sj3mUA== dependencies: - "@cspell/cspell-types" "8.2.3" + "@cspell/cspell-types" "8.3.1" -"@cspell/cspell-pipe@8.2.3": - version "8.2.3" - resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-8.2.3.tgz#49de2c9324e11ceebd995ecfacabf28a494bd1f1" - integrity sha512-ga39z+K2ZaSQczaRayNUTrz10z7umEdFiK7AdWOQpGmym5JTtTK0ntnKvKKsdSJ9F5I7TZVxgZH6r4CCEPlEEg== +"@cspell/cspell-pipe@8.3.1": + version "8.3.1" + resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-8.3.1.tgz#3f68ff141811dbb3465deb612d24db837318d186" + integrity sha512-aq5qgB0w9Gm1//WpA1EuLhwDFc74b3UWKdpE4QHdaoWLCNyly4xW9DTpVLU9eMhtpsJl6q4+pnlsqdJ95LsDXg== -"@cspell/cspell-resolver@8.2.3": - version "8.2.3" - resolved "https://registry.yarnpkg.com/@cspell/cspell-resolver/-/cspell-resolver-8.2.3.tgz#aac8a0a76b7ebb4c7a16aa474014901c512caad0" - integrity sha512-H0855Lg0DxWDcT0FtJyqLvUqOJuE1qSg9X3ENs/ltZntQeaU8wZc+B34bXJrGpJVMuiiqHp4w6rcNN3lsOcshQ== +"@cspell/cspell-resolver@8.3.1": + version "8.3.1" + resolved "https://registry.yarnpkg.com/@cspell/cspell-resolver/-/cspell-resolver-8.3.1.tgz#444dd61987ae2a39bc48a8d5d2a734334a666273" + integrity sha512-IbTiJ2MRF24WDsgzc31ZH1I5eyZNLOoKqM9fHyYaIilVLN28SlLFtjS4dOJJLpMWJeCdIYrQcu2r5ZsNc6nL8A== dependencies: global-directory "^4.0.1" -"@cspell/cspell-service-bus@8.2.3": - version "8.2.3" - resolved "https://registry.yarnpkg.com/@cspell/cspell-service-bus/-/cspell-service-bus-8.2.3.tgz#0fe5ab25d2c0967ae95ef7ffda6f947a483a60de" - integrity sha512-hMLEzE2MkFir3kii046RecR1JAAfA6RQhLddjwQTq1c8YCWJ4lQEKUdM5x7nr/UpJtsMj8eYZ7CtbbnxQyn7Zg== +"@cspell/cspell-service-bus@8.3.1": + version "8.3.1" + resolved "https://registry.yarnpkg.com/@cspell/cspell-service-bus/-/cspell-service-bus-8.3.1.tgz#9862e3c9db9b3c408c27d859b1b7369a828d7b23" + integrity sha512-GkhG2RroZ+0TKLAvlvHbQAes8jHUvhvxTy1jbI6GK9vANUOw9kwJeSmvfzKAVbcNNzkMFF7ALiUIojMIpXww1g== -"@cspell/cspell-types@8.2.3": - version "8.2.3" - resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-8.2.3.tgz#39dded504b053c8cb886b51bb0a0e9d17903b8f5" - integrity sha512-AZIC1n7veQSylp9ZAcVDvIaY+oS/vpzFNJ77rzuhEy/B6X/9jzeI8wg/+vWkmhO59q4iF/ZlswWK3UXfeSnUFg== +"@cspell/cspell-types@8.3.1": + version "8.3.1" + resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-8.3.1.tgz#92f043bb91df97a4737acdf77f69920d51e0ba82" + integrity sha512-M2qsbEFS07NURgMH8XPZPAtRsbcMZQuclJ+3gplkZSWHurYtf+WWXMI+D/LcvWv1pEjTSDjI1tvtpFnqB5TnhQ== "@cspell/dict-ada@^4.0.2": version "4.0.2" @@ -100,20 +100,20 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-bash/-/dict-bash-4.1.3.tgz#25fba40825ac10083676ab2c777e471c3f71b36e" integrity sha512-tOdI3QVJDbQSwPjUkOiQFhYcu2eedmX/PtEpVWg0aFps/r6AyjUQINtTgpqMYnYuq8O1QUIQqnpx21aovcgZCw== -"@cspell/dict-companies@^3.0.28": - version "3.0.28" - resolved "https://registry.yarnpkg.com/@cspell/dict-companies/-/dict-companies-3.0.28.tgz#d617be3e036955d2f656d568f0cc6d1bdf198819" - integrity sha512-UinHkMYB/1pUkLKm1PGIm9PBFYxeAa6YvbB1Rq/RAAlrs0WDwiDBr3BAYdxydukG1IqqwT5z9WtU+8D/yV/5lw== +"@cspell/dict-companies@^3.0.29": + version "3.0.29" + resolved "https://registry.yarnpkg.com/@cspell/dict-companies/-/dict-companies-3.0.29.tgz#0c102c852a9b1c879cd926c0870e2cfbaf1cd176" + integrity sha512-F/8XnkqjU7jmSDAcD3LSSX+WxCVUWPssqlO4lzGMIK3MNIUt+d48eSIt3pFAIB/Z9y0ojoLHUtWX9HJ1ZtGrXQ== "@cspell/dict-cpp@^5.0.10": version "5.0.10" resolved "https://registry.yarnpkg.com/@cspell/dict-cpp/-/dict-cpp-5.0.10.tgz#08c3eb438b631dd3f0fc04f5a6d4b6cab87c8d9b" integrity sha512-WCRuDrkFdpmeIR6uXQYKU9loMQKNFS4bUhtHdv5fu4qVyJSh3k/kgmtTm1h1BDTj8EwPRc/RGxS+9Z3b2mnabA== -"@cspell/dict-cryptocurrencies@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-4.0.0.tgz#6517a7e1b0ed184cf3fc18f03230c82508369dec" - integrity sha512-EiZp91ATyRxTmauIQfOX9adLYCunKjHEh092rrM7o2eMXP9n7zpXAL9BK7LviL+LbB8VDOm21q+s83cKrrRrsg== +"@cspell/dict-cryptocurrencies@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-5.0.0.tgz#19fbc7bdbec76ce64daf7d53a6d0f3cfff7d0038" + integrity sha512-Z4ARIw5+bvmShL+4ZrhDzGhnc9znaAGHOEMaB/GURdS/jdoreEDY34wdN0NtdLHDO5KO7GduZnZyqGdRoiSmYA== "@cspell/dict-csharp@^4.0.2": version "4.0.2" @@ -155,20 +155,20 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-elixir/-/dict-elixir-4.0.3.tgz#57c25843e46cf3463f97da72d9ef8e37c818296f" integrity sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q== -"@cspell/dict-en-common-misspellings@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-1.0.2.tgz#3c4ebab8e9e906d66d60f53c8f8c2e77b7f108e7" - integrity sha512-jg7ZQZpZH7+aAxNBlcAG4tGhYF6Ksy+QS5Df73Oo+XyckBjC9QS+PrRwLTeYoFIgXy5j3ICParK5r3MSSoL4gw== +"@cspell/dict-en-common-misspellings@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.0.tgz#708f424d75dc65237a6fcb8d253bc1e7ab641380" + integrity sha512-NOg8dlv37/YqLkCfBs5OXeJm/Wcfb/CzeOmOZJ2ZXRuxwsNuolb4TREUce0yAXRqMhawahY5TSDRJJBgKjBOdw== "@cspell/dict-en-gb@1.1.33": version "1.1.33" resolved "https://registry.yarnpkg.com/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz#7f1fd90fc364a5cb77111b5438fc9fcf9cc6da0e" integrity sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g== -"@cspell/dict-en_us@^4.3.12": - version "4.3.12" - resolved "https://registry.yarnpkg.com/@cspell/dict-en_us/-/dict-en_us-4.3.12.tgz#3b0ceaf5ed3cf30b225834ca7d528e4dc96e9605" - integrity sha512-1bsUxFjgxF30FTzcU5uvmCvH3lyqVKR9dbwsJhomBlUM97f0edrd6590SiYBXDm7ruE68m3lJd4vs0Ev2D6FtQ== +"@cspell/dict-en_us@^4.3.13": + version "4.3.13" + resolved "https://registry.yarnpkg.com/@cspell/dict-en_us/-/dict-en_us-4.3.13.tgz#4176be1e1510ac696a0fa33d9773aaffbf83a50d" + integrity sha512-T6lHiGCjloGNE0d8CogF+efJZPCAP8zdzn+KnlI0Bmjaz5nvG2LTX7CXl1zkOl1nYYev0FuIk9WJ9YPVRjcFbQ== "@cspell/dict-filetypes@^3.0.3": version "3.0.3" @@ -195,10 +195,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.0.4.tgz#b67d89d014d865da6cb40de4269d4c162a00658e" integrity sha512-hbDduNXlk4AOY0wFxcDMWBPpm34rpqJBeqaySeoUH70eKxpxm+dvjpoRLJgyu0TmymEICCQSl6lAHTHSDiWKZg== -"@cspell/dict-git@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-git/-/dict-git-2.0.0.tgz#fa5cb298845da9c69efc01c6af07a99097718dc9" - integrity sha512-n1AxyX5Kgxij/sZFkxFJlzn3K9y/sCcgVPg/vz4WNJ4K9YeTsUmyGLA2OQI7d10GJeiuAo2AP1iZf2A8j9aj2w== +"@cspell/dict-git@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@cspell/dict-git/-/dict-git-3.0.0.tgz#c275af86041a2b59a7facce37525e2af05653b95" + integrity sha512-simGS/lIiXbEaqJu9E2VPoYW1OTC2xrwPPXNXFMa2uo/50av56qOuaxDrZ5eH1LidFXwoc8HROCHYeKoNrDLSw== "@cspell/dict-golang@^6.0.5": version "6.0.5" @@ -260,10 +260,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-npm/-/dict-npm-5.0.14.tgz#1ca3d305390f393bbfa75f41c4db0fd590ce1a9c" integrity sha512-k0kC7/W2qG5YII+SW6s+JtvKrkZg651vizi5dv/5G2HmJaeLNgDqBVeeDk/uV+ntBorM66XG4BPMjSxoaIlC5w== -"@cspell/dict-php@^4.0.4": - version "4.0.4" - resolved "https://registry.yarnpkg.com/@cspell/dict-php/-/dict-php-4.0.4.tgz#7510c0fe4bdbb049c143eb3c471820d1e681bbb9" - integrity sha512-fRlLV730fJbulDsLIouZxXoxHt3KIH6hcLFwxaupHL+iTXDg0lo7neRpbqD5MScr/J3idEr7i9G8XWzIikKFug== +"@cspell/dict-php@^4.0.5": + version "4.0.5" + resolved "https://registry.yarnpkg.com/@cspell/dict-php/-/dict-php-4.0.5.tgz#fa16350d907180a42f16d5e4666e61a97ae9b8b3" + integrity sha512-9r8ao7Z/mH9Z8pSB7yLtyvcCJWw+/MnQpj7xGVYzIV7V2ZWDRjXZAMgteHMJ37m8oYz64q5d4tiipD300QSetQ== "@cspell/dict-powershell@^5.0.3": version "5.0.3" @@ -275,10 +275,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.5.tgz#86948b29bd36184943955eaa80bf594488c4dd8a" integrity sha512-91HK4dSRri/HqzAypHgduRMarJAleOX5NugoI8SjDLPzWYkwZ1ftuCXSk+fy8DLc3wK7iOaFcZAvbjmnLhVs4A== -"@cspell/dict-python@^4.1.10": - version "4.1.10" - resolved "https://registry.yarnpkg.com/@cspell/dict-python/-/dict-python-4.1.10.tgz#bae6557e7b828a1701d3733b7766c4d95f279175" - integrity sha512-ErF/Ohcu6Xk4QVNzFgo8p7CxkxvAKAmFszvso41qOOhu8CVpB35ikBRpGVDw9gsCUtZzi15Yl0izi4do6WcLkA== +"@cspell/dict-python@^4.1.11": + version "4.1.11" + resolved "https://registry.yarnpkg.com/@cspell/dict-python/-/dict-python-4.1.11.tgz#4e339def01bf468b32d459c46ecb6894970b7eb8" + integrity sha512-XG+v3PumfzUW38huSbfT15Vqt3ihNb462ulfXifpQllPok5OWynhszCLCRQjQReV+dgz784ST4ggRxW452/kVg== dependencies: "@cspell/dict-data-science" "^1.0.11" @@ -302,10 +302,10 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-scala/-/dict-scala-5.0.0.tgz#b64365ad559110a36d44ccd90edf7151ea648022" integrity sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ== -"@cspell/dict-software-terms@^3.3.14": - version "3.3.14" - resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-3.3.14.tgz#4d3f987e4d5a47009ba07a167cc9d0384beceafd" - integrity sha512-xLUtqrrvMgMEOn8grsl7p2vwf3qh4+0rZLIU0kpKSkMA8tKK3JJxJFfDyoQpZeoUGdpofhrishx3ZfIdpN/RSg== +"@cspell/dict-software-terms@^3.3.15": + version "3.3.15" + resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-3.3.15.tgz#713f748a6276788db01e75e07950c867bc285fca" + integrity sha512-1qqMGFi1TUNq9gQj4FTLPTlqVzQLXrj80MsKoXVpysr+823kMWesQAjqHiPg+MYsQ3DlTcpGWcjq/EbYonqueQ== "@cspell/dict-sql@^2.1.3": version "2.1.3" @@ -332,17 +332,17 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-vue/-/dict-vue-3.0.0.tgz#68ccb432ad93fcb0fd665352d075ae9a64ea9250" integrity sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A== -"@cspell/dynamic-import@8.2.3": - version "8.2.3" - resolved "https://registry.yarnpkg.com/@cspell/dynamic-import/-/dynamic-import-8.2.3.tgz#d6654a79dc5493022283e49171d8fef21425ba83" - integrity sha512-udJF+88F4UMH2eVKe3Utsh4X1PyNwqPJclIeD3/MDMFWm16lLkFYMqqrdr51tNLKVi4cXceGrUEapmGwf87l/w== +"@cspell/dynamic-import@8.3.1": + version "8.3.1" + resolved "https://registry.yarnpkg.com/@cspell/dynamic-import/-/dynamic-import-8.3.1.tgz#921674f130b9d172f0c4afec359f9d67edc25662" + integrity sha512-kr3xBaLH6RuyeTwT6AAXw77ClW1ibJmpmvPVbkt6f7HVZLij7ETq//O/R7WDpYzJALxzrYAPxGl5fyuAj19Cjg== dependencies: import-meta-resolve "^4.0.0" -"@cspell/strong-weak-map@8.2.3": - version "8.2.3" - resolved "https://registry.yarnpkg.com/@cspell/strong-weak-map/-/strong-weak-map-8.2.3.tgz#5a1d342f9c13974d32a5dc903bef683021907c80" - integrity sha512-/0gQZw87MqGX8f28E+LhFfrsWdRdQEL8EEQeMXrrzSoPnfSz+ItHMhhrwPF+bMePPjaaUNYoRXvX7hxiDsGm0w== +"@cspell/strong-weak-map@8.3.1": + version "8.3.1" + resolved "https://registry.yarnpkg.com/@cspell/strong-weak-map/-/strong-weak-map-8.3.1.tgz#25af2df01765025143d089eda461cb6e13f800eb" + integrity sha512-657/0Ii0UP3sjwthUPOzlMbr5lwN26G2i6oYkOYjRgFL+Jni/7AHRShjI4BtkUYEmZZblwTkXcuNiWEJ+bm6MQ== "@isaacs/cliui@^8.0.2": version "8.0.2" @@ -513,76 +513,76 @@ crypto-random-string@^4.0.0: dependencies: type-fest "^1.0.1" -cspell-config-lib@8.2.3: - version "8.2.3" - resolved "https://registry.yarnpkg.com/cspell-config-lib/-/cspell-config-lib-8.2.3.tgz#aec076058e0dc97300b46f8761e9b755ba2d8ee3" - integrity sha512-ATbOR06GKBIFM5SPKMF4fgo5G2qmOfdV8TbpyzNtw1AGL7PoOgDNFiKSutEzO5EHyZuXE71ZFxH3rVr2gIV7Dw== +cspell-config-lib@8.3.1: + version "8.3.1" + resolved "https://registry.yarnpkg.com/cspell-config-lib/-/cspell-config-lib-8.3.1.tgz#c226ac6191a25295e56e9c1e5a59a8ddf793dc19" + integrity sha512-3ilnVPQG6MVYQ0svVTIM1ODvABq6cYaQviH8OdbiRAh8izaAZ7B8NZRgzwm0Q74V76VRCLeanJzfGB2t5ujslw== dependencies: - "@cspell/cspell-types" "8.2.3" + "@cspell/cspell-types" "8.3.1" comment-json "^4.2.3" yaml "^2.3.4" -cspell-dictionary@8.2.3: - version "8.2.3" - resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-8.2.3.tgz#988ca1a208343ae2d2e20ee83fe5a4e9633227e5" - integrity sha512-M/idc3TLjYMpT4+8PlIg7kzoeGkR7o6h6pTwRfy/ZkBkEaV+U/35ZtVLO4qjxnuX6wrmawYmHhYqgzyKLEJIhw== +cspell-dictionary@8.3.1: + version "8.3.1" + resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-8.3.1.tgz#c66faa0e7d09c4ae01ba50adc4f7b10cd3356bdb" + integrity sha512-T78mv1BpWl7Na+BAfgu1ETnWiB5z+gQ53+W5CNjOf90MFLTI0VpAKQ1DTUrhB7KoPDFxvqW5s6KNLTAmn6o9PA== dependencies: - "@cspell/cspell-pipe" "8.2.3" - "@cspell/cspell-types" "8.2.3" - cspell-trie-lib "8.2.3" + "@cspell/cspell-pipe" "8.3.1" + "@cspell/cspell-types" "8.3.1" + cspell-trie-lib "8.3.1" fast-equals "^5.0.1" gensequence "^6.0.0" -cspell-gitignore@8.2.3: - version "8.2.3" - resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-8.2.3.tgz#e8430ede1d10a8a0f66924702da63d9398614b5b" - integrity sha512-tPUI+Aoq1b1shD04CLprrS8wEriiF4G1J+qBiCZK2KWOh6IcufuuDhP1Jtkzz9uONgGWFPF6jj/9TXRFlQexbQ== +cspell-gitignore@8.3.1: + version "8.3.1" + resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-8.3.1.tgz#78c04ea2785b9cf34d17e3e8d1bf52db45489ec0" + integrity sha512-70olNEUpHvR8pODI/bmi8nJz98d/yDEw4bLgg89/0s6lP7Lgo5cVp4bnrdjuDT+C7ki1XfWT/UoSo64RCS8ueA== dependencies: - cspell-glob "8.2.3" + cspell-glob "8.3.1" find-up-simple "^1.0.0" -cspell-glob@8.2.3: - version "8.2.3" - resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-8.2.3.tgz#02d144018b52774b5c31a3df955e44bfc107233a" - integrity sha512-byP2kBblO5d9rZr73MPor+KfoFdry4uu/MQmwLiK5mxgmokZYv5GVDX2DrO16Ni4yJ6/2rBPWLfq+DfCXSWqyw== +cspell-glob@8.3.1: + version "8.3.1" + resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-8.3.1.tgz#86d3940f5c50ce5d09468f69d75f56f5d0a664cc" + integrity sha512-OJrgC17hn/CL8XK9Li6p5LBut42Pu/yKOIz0mCgbU/E08jNopZCkMsaZjm6ozDuFHx+B1gqW/Y4wd35sum8DTg== dependencies: micromatch "^4.0.5" -cspell-grammar@8.2.3: - version "8.2.3" - resolved "https://registry.yarnpkg.com/cspell-grammar/-/cspell-grammar-8.2.3.tgz#0bb737f514278b9fe68efa9abc2a932fbe739a33" - integrity sha512-z57Qyu24BsHHp/nZ9ftN377cSCgSJg+6oywIglau7ws7vRpUgYKVoKxn+ZJfOrIZpXfZUqgph5IwAGFI+aRN6w== +cspell-grammar@8.3.1: + version "8.3.1" + resolved "https://registry.yarnpkg.com/cspell-grammar/-/cspell-grammar-8.3.1.tgz#896150b956172244228ac1632651162c44a8cf63" + integrity sha512-SdlUlQVHYtjeoebCKyrVG112jNCyP/ihit3jNiwk5gQ7LLqdV43crHFi13peSIhp9FR5Qn0JjnerpY89+256YA== dependencies: - "@cspell/cspell-pipe" "8.2.3" - "@cspell/cspell-types" "8.2.3" + "@cspell/cspell-pipe" "8.3.1" + "@cspell/cspell-types" "8.3.1" -cspell-io@8.2.3: - version "8.2.3" - resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-8.2.3.tgz#dd788a91714f7987f9fa998dc7b03ddc50c34552" - integrity sha512-mPbLXiIje9chncy/Xb9C6AxqjJm9AFHz/nmIIP5bc6gd4w/yaGlQNyO8jjHF1u2JBVbIxPQSMjFgEuqasPy4Sg== +cspell-io@8.3.1: + version "8.3.1" + resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-8.3.1.tgz#01656fdb9f874c1fc10561843606897f2323f3a0" + integrity sha512-l3R5kfTj4Ov56IHGZp32mCrY1Wh9qM4ZJQGCNYuj2iaCVwTMR/5IoyvufTEm+Axqh8NJ/x5wfnq22wB6PateeA== dependencies: - "@cspell/cspell-service-bus" "8.2.3" + "@cspell/cspell-service-bus" "8.3.1" -cspell-lib@8.2.3: - version "8.2.3" - resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-8.2.3.tgz#bc73797d2a3919306e3d55163c5bdde8b53e5caf" - integrity sha512-NA4FsGomGPNp15TWbXx13bfknLGU8B66j0QlU3i4oDrWBj/t5m7O1nmiQqcaDSKd9s5HtdTHfxLc83hdzmmizg== +cspell-lib@8.3.1: + version "8.3.1" + resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-8.3.1.tgz#ad36fa87b745d30f4ca3fc9485a20f8b0adb53f3" + integrity sha512-OuvJxzgyKWT39wbLAiaAmOrNVcbGXBDzOHAchYrQfClQ9w4eCdK1CvvFj+vyE6asaCDDpgw7icK0KhW6zHitGw== dependencies: - "@cspell/cspell-bundled-dicts" "8.2.3" - "@cspell/cspell-pipe" "8.2.3" - "@cspell/cspell-resolver" "8.2.3" - "@cspell/cspell-types" "8.2.3" - "@cspell/dynamic-import" "8.2.3" - "@cspell/strong-weak-map" "8.2.3" + "@cspell/cspell-bundled-dicts" "8.3.1" + "@cspell/cspell-pipe" "8.3.1" + "@cspell/cspell-resolver" "8.3.1" + "@cspell/cspell-types" "8.3.1" + "@cspell/dynamic-import" "8.3.1" + "@cspell/strong-weak-map" "8.3.1" clear-module "^4.1.2" comment-json "^4.2.3" configstore "^6.0.0" - cspell-config-lib "8.2.3" - cspell-dictionary "8.2.3" - cspell-glob "8.2.3" - cspell-grammar "8.2.3" - cspell-io "8.2.3" - cspell-trie-lib "8.2.3" + cspell-config-lib "8.3.1" + cspell-dictionary "8.3.1" + cspell-glob "8.3.1" + cspell-grammar "8.3.1" + cspell-io "8.3.1" + cspell-trie-lib "8.3.1" fast-equals "^5.0.1" gensequence "^6.0.0" import-fresh "^3.3.0" @@ -590,31 +590,31 @@ cspell-lib@8.2.3: vscode-languageserver-textdocument "^1.0.11" vscode-uri "^3.0.8" -cspell-trie-lib@8.2.3: - version "8.2.3" - resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-8.2.3.tgz#54fc0605cfc8af11ed1398e4037ea8a872791272" - integrity sha512-yN2PwceN9ViCjXUhhi3MTWfi15Rpc9CsSFFPV3A6cOWoB0qBnuTXk8hBSx+427UGYjtlXPP6EZKY8w8OK6PweA== +cspell-trie-lib@8.3.1: + version "8.3.1" + resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-8.3.1.tgz#f30f3e062a23ab2c83508a087aa9a9c129b5e2da" + integrity sha512-vbMDQfbAJQLVytHP5FkppEKkjnP1Emv6KEgYkkXWFAVM1ufQepx9VIAftLb+h4p9vJ6G5XZOiJZD1xStM4/OVQ== dependencies: - "@cspell/cspell-pipe" "8.2.3" - "@cspell/cspell-types" "8.2.3" + "@cspell/cspell-pipe" "8.3.1" + "@cspell/cspell-types" "8.3.1" gensequence "^6.0.0" -cspell@^8.2.3: - version "8.2.3" - resolved "https://registry.yarnpkg.com/cspell/-/cspell-8.2.3.tgz#9e861887a9babf0d1c2c7b709e9bc0b39c2f4a18" - integrity sha512-lJEIglmBINLW4Jwn+5W1k6Zb5EjyRFLnTvc1uQ268/9pcsB+GWUZruplIe5+erR3AxZ+N7Tqp7IY9j2Jf1+/Fg== +cspell@^8.3.1: + version "8.3.1" + resolved "https://registry.yarnpkg.com/cspell/-/cspell-8.3.1.tgz#0b4529de0b207c930408735e1f168ebeb69bad3b" + integrity sha512-VA7Z1jHyhr0+ZYGzrLSKouoZ1U1dFMQ38B4pMnKwx/qbngBPqFHOZXJfNRrHgbgicC7fwDjsm+4OvxUluOKR9A== dependencies: - "@cspell/cspell-json-reporter" "8.2.3" - "@cspell/cspell-pipe" "8.2.3" - "@cspell/cspell-types" "8.2.3" - "@cspell/dynamic-import" "8.2.3" + "@cspell/cspell-json-reporter" "8.3.1" + "@cspell/cspell-pipe" "8.3.1" + "@cspell/cspell-types" "8.3.1" + "@cspell/dynamic-import" "8.3.1" chalk "^5.3.0" chalk-template "^1.1.0" commander "^11.1.0" - cspell-gitignore "8.2.3" - cspell-glob "8.2.3" - cspell-io "8.2.3" - cspell-lib "8.2.3" + cspell-gitignore "8.3.1" + cspell-glob "8.3.1" + cspell-io "8.3.1" + cspell-lib "8.3.1" fast-glob "^3.3.2" fast-json-stable-stringify "^2.1.0" file-entry-cache "^8.0.0" @@ -983,6 +983,7 @@ signal-exit@^4.0.1: integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== "string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0: + name string-width-cjs version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -1001,6 +1002,7 @@ string-width@^5.0.1, string-width@^5.1.2: strip-ansi "^7.0.1" "strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: + name strip-ansi-cjs version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== From a99e14de870c0dc1d985db5ec9e24a6468a2bd91 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Thu, 21 Dec 2023 21:25:19 +0100 Subject: [PATCH 224/845] Use Tuple.Create --- Tests/FluentAssertions.Equivalency.Specs/TupleSpecs.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/FluentAssertions.Equivalency.Specs/TupleSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/TupleSpecs.cs index 17e0ee6a92..945caef1ca 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/TupleSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/TupleSpecs.cs @@ -24,8 +24,8 @@ public void When_a_nested_member_is_a_tuple_it_should_compare_its_property_for_e public void When_a_tuple_is_compared_it_should_compare_its_components() { // Arrange - var actual = new Tuple("Hello", true, [3, 2, 1]); - var expected = new Tuple("Hello", true, [1, 2, 3]); + var actual = Tuple.Create("Hello", true, new[] { 3, 2, 1 }); + var expected = Tuple.Create("Hello", true, new[] { 1, 2, 3 }); // Act Action act = () => actual.Should().BeEquivalentTo(expected); From 9222e0f5eec886af7c70588b33aa6e296e1129a4 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Thu, 21 Dec 2023 22:15:44 +0100 Subject: [PATCH 225/845] Collection expressions --- Build/Build.cs | 6 +- .../BasicSpecs.cs | 10 +- .../CollectionSpecs.cs | 79 +++++----- .../CyclicReferencesSpecs.cs | 2 +- .../DictionarySpecs.cs | 16 +- .../EnumSpecs.cs | 10 +- .../ExtensibilitySpecs.cs | 8 +- .../NestedPropertiesSpecs.cs | 18 +-- .../SelectionRulesSpecs.Basic.cs | 6 +- .../SelectionRulesSpecs.Interfaces.cs | 16 +- .../CollectionAssertionSpecs.AllSatisfy.cs | 8 +- .../CollectionAssertionSpecs.BeEmpty.cs | 8 +- ...CollectionAssertionSpecs.BeEquivalentTo.cs | 10 +- ...ectionAssertionSpecs.BeInAscendingOrder.cs | 16 +- ...ctionAssertionSpecs.BeInDescendingOrder.cs | 16 +- .../CollectionAssertionSpecs.BeNullOrEmpty.cs | 8 +- .../CollectionAssertionSpecs.Contain.cs | 8 +- ...ctionAssertionSpecs.ContainEquivalentOf.cs | 34 ++--- ...AssertionSpecs.ContainItemsAssignableTo.cs | 2 +- .../CollectionAssertionSpecs.ContainSingle.cs | 4 +- .../CollectionAssertionSpecs.EndWith.cs | 40 ++--- .../CollectionAssertionSpecs.Equal.cs | 6 +- ...tionAssertionSpecs.HaveElementPreceding.cs | 14 +- ...ionAssertionSpecs.HaveElementSucceeding.cs | 14 +- ...ertionSpecs.NotContainItemsAssignableTo.cs | 2 +- ...ollectionAssertionSpecs.NotContainNulls.cs | 26 ++-- ...ctionAssertionSpecs.OnlyHaveUniqueItems.cs | 24 +-- .../CollectionAssertionSpecs.Satisfy.cs | 6 +- ...ctionAssertionSpecs.SatisfyRespectively.cs | 10 +- .../CollectionAssertionSpecs.StartWith.cs | 38 ++--- .../Collections/CollectionAssertionSpecs.cs | 48 +++--- ...ollectionAssertionOfStringSpecs.BeEmpty.cs | 6 +- ...onAssertionOfStringSpecs.BeEquivalentTo.cs | 30 ++-- ...ectionAssertionOfStringSpecs.BeSubsetOf.cs | 26 ++-- ...ollectionAssertionOfStringSpecs.Contain.cs | 24 +-- ...onAssertionOfStringSpecs.ContainInOrder.cs | 36 ++--- ...tionAssertionOfStringSpecs.ContainMatch.cs | 28 ++-- ...cCollectionAssertionOfStringSpecs.Equal.cs | 42 +++--- ...lectionAssertionOfStringSpecs.HaveCount.cs | 14 +- ...ionAssertionOfStringSpecs.HaveElementAt.cs | 6 +- ...ionAssertionOfStringSpecs.HaveSameCount.cs | 34 ++--- ...ionAssertionOfStringSpecs.IntersectWith.cs | 18 +-- ...nAssertionOfStringSpecs.NotContainNulls.cs | 6 +- ...ertionOfStringSpecs.OnlyHaveUniqueItems.cs | 6 +- ...GenericCollectionAssertionOfStringSpecs.cs | 6 +- ...cDictionaryAssertionSpecs.ContainValues.cs | 8 +- .../Common/ConfigurationSpecs.cs | 2 +- .../Events/EventAssertionSpecs.cs | 18 +-- .../AsyncFunctionExceptionAssertionSpecs.cs | 12 +- .../Exceptions/ExceptionAssertionSpecs.cs | 12 +- .../FunctionExceptionAssertionSpecs.cs | 12 +- .../DateTimeOffsetAssertionSpecs.BeOneOf.cs | 6 +- .../Primitives/EnumAssertionSpecs.cs | 2 +- .../ObjectAssertionSpecs.BeOneOf.cs | 12 +- .../StringAssertionSpecs.BeOneOf.cs | 2 +- .../TypeEnumerableExtensionsSpecs.cs | 28 ++-- .../Types/PropertyInfoSelectorSpecs.cs | 6 +- .../Types/TypeSelectorAssertionSpecs.cs | 138 +++++++++--------- 58 files changed, 524 insertions(+), 529 deletions(-) diff --git a/Build/Build.cs b/Build/Build.cs index f49eedb083..7383e2d7c8 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -272,14 +272,14 @@ void ReportTestOutcome(params string[] globFilters) .OnlyWhenDynamic(() => RunAllTargets || HasSourceChanges) .Executes(() => { - var projects = new[] - { + Project[] projects = + [ Solution.TestFrameworks.MSpec_Specs, Solution.TestFrameworks.MSTestV2_Specs, Solution.TestFrameworks.NUnit3_Specs, Solution.TestFrameworks.NUnit4_Specs, Solution.TestFrameworks.XUnit2_Specs - }; + ]; var testCombinations = from project in projects diff --git a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs index 4ca65c9a3e..1936a02b89 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs @@ -57,7 +57,7 @@ public void When_expectation_is_null_it_should_throw() public void When_comparing_nested_collection_with_a_null_value_it_should_fail_with_the_correct_message() { // Arrange - MyClass[] subject = [new MyClass { Items = new[] { "a" } }]; + MyClass[] subject = [new MyClass { Items = ["a"] }]; MyClass[] expectation = [new MyClass()]; @@ -209,12 +209,8 @@ public class VirtualClassOverride : VirtualClass public void When_treating_a_value_type_in_a_collection_as_a_complex_type_it_should_compare_them_by_members() { // Arrange - var subject = new[] { new ClassWithValueSemanticsOnSingleProperty { Key = "SameKey", NestedProperty = "SomeValue" } }; - - var expected = new[] - { - new ClassWithValueSemanticsOnSingleProperty { Key = "SameKey", NestedProperty = "OtherValue" } - }; + ClassWithValueSemanticsOnSingleProperty[] subject = [new() { Key = "SameKey", NestedProperty = "SomeValue" }]; + ClassWithValueSemanticsOnSingleProperty[] expected = [new() { Key = "SameKey", NestedProperty = "OtherValue" }]; // Act Action act = () => subject.Should().BeEquivalentTo(expected, diff --git a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs index c7b699f859..89bb439aa3 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs @@ -338,13 +338,13 @@ public void var logbookEntry = new LogbookEntryProjection { Logbook = logbook, - LogbookRelations = new[] { new LogbookRelation { Logbook = logbook } } + LogbookRelations = [new LogbookRelation { Logbook = logbook }] }; var equivalentLogbookEntry = new LogbookEntryProjection { Logbook = logbook, - LogbookRelations = new[] { new LogbookRelation { Logbook = logbook } } + LogbookRelations = [new LogbookRelation { Logbook = logbook }] }; // Act @@ -440,12 +440,11 @@ public void When_a_collection_property_contains_objects_with_matching_properties public void When_two_deeply_nested_collections_are_equivalent_while_ignoring_the_order_it_should_not_throw() { // Arrange - var items = new[] { new int[0], [42] }; + int[][] subject = [[], [42]]; + int[][] expectation = [[42], []]; // Act / Assert - items.Should().BeEquivalentTo( - new[] { [42], new int[0] } - ); + subject.Should().BeEquivalentTo(expectation); } [Fact] @@ -1170,7 +1169,7 @@ public void When_all_strings_in_the_collection_are_equal_to_the_expected_string_ public void When_some_string_in_the_collection_is_not_equal_to_the_expected_string_it_should_throw() { // Arrange - var subject = new[] { "one", "two", "six" }; + string[] subject = ["one", "two", "six"]; // Act Action action = () => subject.Should().AllBe("one"); @@ -1185,7 +1184,7 @@ public void When_some_string_in_the_collection_is_not_equal_to_the_expected_stri public void When_some_string_in_the_collection_is_in_different_case_than_expected_string_it_should_throw() { // Arrange - var subject = new[] { "one", "One", "ONE" }; + string[] subject = ["one", "One", "ONE"]; // Act Action action = () => subject.Should().AllBe("one"); @@ -1296,7 +1295,7 @@ public void When_all_subject_items_are_equivalent_to_expectation_object_it_shoul public void When_some_subject_items_are_not_equivalent_to_expectation_object_it_should_throw() { // Arrange - var subject = new[] { 1, 2, 3 }; + int[] subject = [1, 2, 3]; // Act Action action = () => subject.Should().AllBeEquivalentTo(1); @@ -1611,8 +1610,8 @@ public void When_asserting_equivalence_of_collections_and_configured_to_use_runtime_properties_it_should_respect_the_runtime_type() { // Arrange - ICollection collection1 = new NonGenericCollection(new[] { new Customer() }); - ICollection collection2 = new NonGenericCollection(new[] { new Car() }); + ICollection collection1 = new NonGenericCollection([new Customer()]); + ICollection collection2 = new NonGenericCollection([new Car()]); // Act Action act = @@ -1642,8 +1641,8 @@ public void When_asserting_equivalence_of_generic_collections_it_should_respect_ public void When_asserting_equivalence_of_non_generic_collections_it_should_respect_the_runtime_type() { // Arrange - ICollection subject = new NonGenericCollection(new[] { new Customer() }); - ICollection expectation = new NonGenericCollection(new[] { new Car() }); + ICollection subject = new NonGenericCollection([new Customer()]); + ICollection expectation = new NonGenericCollection([new Car()]); // Act Action act = () => subject.Should().BeEquivalentTo(expectation); @@ -1971,7 +1970,7 @@ public void When_subject_is_null_and_expectation_is_enumerable_it_should_throw() public void When_the_expectation_is_null_it_should_throw() { // Arrange - var actual = new[,] + int[,] actual = { { 1, 2, 3 }, { 4, 5, 6 } @@ -1991,7 +1990,7 @@ public void When_a_multi_dimensional_array_is_compared_to_null_it_should_throw() // Arrange Array actual = null; - var expectation = new[,] + int[,] expectation = { { 1, 2, 3 }, { 4, 5, 6 } @@ -2011,7 +2010,7 @@ public void When_a_multi_dimensional_array_is_compared_to_a_non_array_it_should_ // Arrange var actual = new object(); - var expectation = new[,] + int[,] expectation = { { 1, 2, 3 }, { 4, 5, 6 } @@ -2029,13 +2028,13 @@ public void When_a_multi_dimensional_array_is_compared_to_a_non_array_it_should_ public void When_the_length_of_the_2nd_dimension_differs_between_the_arrays_it_should_throw() { // Arrange - var actual = new[,] + int[,] actual = { { 1, 2, 3 }, { 4, 5, 6 } }; - var expectation = new[,] { { 1, 2, 3 } }; + int[,] expectation = { { 1, 2, 3 } }; // Act Action act = () => actual.Should().BeEquivalentTo(expectation); @@ -2049,13 +2048,13 @@ public void When_the_length_of_the_2nd_dimension_differs_between_the_arrays_it_s public void When_the_length_of_the_first_dimension_differs_between_the_arrays_it_should_throw() { // Arrange - var actual = new[,] + int[,] actual = { { 1, 2, 3 }, { 4, 5, 6 } }; - var expectation = new[,] + int[,] expectation = { { 1, 2 }, { 4, 5 } @@ -2074,7 +2073,7 @@ public void When_the_number_of_dimensions_of_the_arrays_are_not_the_same_it_shou { // Arrange #pragma warning disable format // VS and Rider disagree on how to format a multidimensional array initializer - var actual = new[,,] + int[,,] actual = { { { 1 }, @@ -2089,7 +2088,7 @@ public void When_the_number_of_dimensions_of_the_arrays_are_not_the_same_it_shou }; #pragma warning restore format - var expectation = new[,] + int[,] expectation = { { 1, 2, 3 }, { 4, 5, 6 } @@ -2308,8 +2307,8 @@ public void When_two_collections_have_properties_of_the_contained_items_excluded_but_still_differ_it_should_throw() { // Arrange - var list1 = new[] { new KeyValuePair(1, 123) }; - var list2 = new[] { new KeyValuePair(2, 321) }; + KeyValuePair[] list1 = [new(1, 123)]; + KeyValuePair[] list2 = [new(2, 321)]; // Act Action act = () => list1.Should().BeEquivalentTo(list2, config => config @@ -2409,13 +2408,13 @@ public void When_two_lists_only_differ_in_excluded_properties_it_should_not_thro public void When_two_multi_dimensional_arrays_are_equivalent_it_should_not_throw() { // Arrange - var subject = new[,] + int[,] subject = { { 1, 2, 3 }, { 4, 5, 6 } }; - var expectation = new[,] + int[,] expectation = { { 1, 2, 3 }, { 4, 5, 6 } @@ -2432,13 +2431,13 @@ public void When_two_multi_dimensional_arrays_are_equivalent_it_should_not_throw public void When_two_multi_dimensional_arrays_are_not_equivalent_it_should_throw() { // Arrange - var actual = new[,] + int[,] actual = { { 1, 2, 3 }, { 4, 5, 6 } }; - var expectation = new[,] + int[,] expectation = { { 1, 2, 4 }, { 4, -5, 6 } @@ -2561,10 +2560,10 @@ public void When_two_ordered_lists_are_structurally_equivalent_it_should_succeed public void When_two_unordered_lists_are_structurally_equivalent_and_order_is_strict_it_should_fail() { // Arrange - var subject = new[] - { + Customer[] subject = + [ new Customer { Name = "John", Age = 27, Id = 1 }, new Customer { Name = "Jane", Age = 24, Id = 2 } - }; + ]; var expectation = new Collection { @@ -2585,10 +2584,10 @@ public void When_two_unordered_lists_are_structurally_equivalent_and_order_is_st public void When_two_unordered_lists_are_structurally_equivalent_and_order_was_reset_to_strict_it_should_fail() { // Arrange - var subject = new[] - { + Customer[] subject = + [ new Customer { Name = "John", Age = 27, Id = 1 }, new Customer { Name = "Jane", Age = 24, Id = 2 } - }; + ]; var expectation = new Collection { @@ -2614,10 +2613,10 @@ public void When_two_unordered_lists_are_structurally_equivalent_and_order_was_r public void When_two_unordered_lists_are_structurally_equivalent_and_order_was_reset_to_not_strict_it_should_succeed() { // Arrange - var subject = new[] - { + Customer[] subject = + [ new Customer { Name = "John", Age = 27, Id = 1 }, new Customer { Name = "Jane", Age = 24, Id = 2 } - }; + ]; var expectation = new Collection { @@ -2637,10 +2636,10 @@ public void When_two_unordered_lists_are_structurally_equivalent_and_order_was_r public void When_two_unordered_lists_are_structurally_equivalent_it_should_succeed() { // Arrange - var subject = new[] - { + Customer[] subject = + [ new Customer { Name = "John", Age = 27, Id = 1 }, new Customer { Name = "Jane", Age = 24, Id = 2 } - }; + ]; var expectation = new Collection { diff --git a/Tests/FluentAssertions.Equivalency.Specs/CyclicReferencesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/CyclicReferencesSpecs.cs index 569682ce9b..93fd4b22bf 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/CyclicReferencesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/CyclicReferencesSpecs.cs @@ -234,7 +234,7 @@ public void Can_detect_cyclic_references_in_enumerables() // Assert Action act = () => actual.Should().BeEquivalentTo( - new[] { new SelfReturningEnumerable(), new SelfReturningEnumerable() }, + [new SelfReturningEnumerable(), new SelfReturningEnumerable()], "we want to test the failure {0}", "message"); // Assert diff --git a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs index 41fd559b0f..ea5f509b56 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs @@ -319,15 +319,15 @@ public void When_a_read_only_dictionary_matches_the_expectation_it_should_succee new ReadOnlyDictionary>( new Dictionary> { - ["Key2"] = new[] { "Value2" }, - ["Key1"] = new[] { "Value1" } + ["Key2"] = ["Value2"], + ["Key1"] = ["Value1"] }); // Act Action act = () => dictionary.Should().BeEquivalentTo(new Dictionary> { - ["Key1"] = new[] { "Value1" }, - ["Key2"] = new[] { "Value2" } + ["Key1"] = ["Value1"], + ["Key2"] = ["Value2"] }); // Assert @@ -342,15 +342,15 @@ public void When_a_read_only_dictionary_does_not_match_the_expectation_it_should new ReadOnlyDictionary>( new Dictionary> { - ["Key2"] = new[] { "Value2" }, - ["Key1"] = new[] { "Value1" } + ["Key2"] = ["Value2"], + ["Key1"] = ["Value1"] }); // Act Action act = () => dictionary.Should().BeEquivalentTo(new Dictionary> { - ["Key2"] = new[] { "Value3" }, - ["Key1"] = new[] { "Value1" } + ["Key2"] = ["Value3"], + ["Key1"] = ["Value1"] }); // Assert diff --git a/Tests/FluentAssertions.Equivalency.Specs/EnumSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/EnumSpecs.cs index 64b285c96a..b30e8ff7b7 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/EnumSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/EnumSpecs.cs @@ -71,8 +71,8 @@ public void When_asserting_different_enum_members_are_equivalent_it_should_fail( public void Comparing_collections_of_enums_by_value_includes_custom_message() { // Arrange - var subject = new[] { EnumOne.One }; - var expectation = new[] { EnumOne.Two }; + EnumOne[] subject = [EnumOne.One]; + EnumOne[] expectation = [EnumOne.Two]; // Act Action act = () => subject.Should().BeEquivalentTo(expectation, "some {0}", "reason"); @@ -86,8 +86,8 @@ public void Comparing_collections_of_enums_by_value_includes_custom_message() public void Comparing_collections_of_enums_by_name_includes_custom_message() { // Arrange - var subject = new[] { EnumOne.Two }; - var expectation = new[] { EnumFour.Three }; + EnumOne[] subject = [EnumOne.Two]; + EnumFour[] expectation = [EnumFour.Three]; // Act Action act = () => subject.Should().BeEquivalentTo(expectation, config => config.ComparingEnumsByName(), @@ -104,7 +104,7 @@ public void Comparing_collections_of_numerics_with_collections_of_enums_includes // Arrange int[] actual = [1]; - var expected = new[] { TestEnum.First }; + TestEnum[] expected = [TestEnum.First]; // Act Action act = () => actual.Should().BeEquivalentTo(expected, options => options.ComparingEnumsByValue(), diff --git a/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs index 1aea6c008c..2c38ac073e 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs @@ -162,8 +162,8 @@ public IMember Match(IMember expectedMember, object subject, INode parent, IEqui public void When_an_ordering_rule_is_added_it_should_be_evaluated_after_all_existing_rules() { // Arrange - var subject = new[] { "First", "Second" }; - var expected = new[] { "First", "Second" }; + string[] subject = ["First", "Second"]; + string[] expected = ["First", "Second"]; // Act Action act = () => subject.Should().BeEquivalentTo( @@ -178,8 +178,8 @@ public void When_an_ordering_rule_is_added_it_should_be_evaluated_after_all_exis public void When_an_ordering_rule_is_added_it_should_appear_in_the_exception_message() { // Arrange - var subject = new[] { "First", "Second" }; - var expected = new[] { "Second", "First" }; + string[] subject = ["First", "Second"]; + string[] expected = ["Second", "First"]; // Act Action act = () => subject.Should().BeEquivalentTo( diff --git a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs index 47e80a69eb..a193fc1d42 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs @@ -155,7 +155,7 @@ public class StringContainer public StringContainer(string mainValue, string subValue = null) { MainValue = mainValue; - SubValues = new[] { new StringSubContainer { SubValue = subValue } }; + SubValues = [new StringSubContainer { SubValue = subValue }]; } public string MainValue { get; set; } @@ -174,20 +174,20 @@ public class MyClass2 public void When_deeply_nested_strings_dont_match_it_should_properly_report_the_mismatches() { // Arrange - var expected = new[] - { + MyClass2[] expected = + [ new MyClass2 { One = new StringContainer("EXPECTED", "EXPECTED"), Two = new StringContainer("CORRECT") }, new MyClass2() - }; + ]; - var actual = new[] - { + MyClass2[] actual = + [ new MyClass2 { One = new StringContainer("INCORRECT", "INCORRECT"), Two = new StringContainer("CORRECT") }, new MyClass2() - }; + ]; // Act Action act = () => actual.Should().BeEquivalentTo(expected); @@ -307,9 +307,9 @@ public void When_a_property_of_a_nested_object_doesnt_match_it_should_clearly_in public void Should_support_nested_collections_containing_empty_objects() { // Arrange - var orig = new[] { new OuterWithObject { MyProperty = [new Inner()] } }; + OuterWithObject[] orig = [new OuterWithObject { MyProperty = [new Inner()] }]; - var expectation = new[] { new OuterWithObject { MyProperty = [new Inner()] } }; + OuterWithObject[] expectation = [new OuterWithObject { MyProperty = [new Inner()] }]; // Act / Assert orig.Should().BeEquivalentTo(expectation); diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs index 6c48353d0e..7edae85eb6 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs @@ -276,13 +276,13 @@ public void A_nested_class_without_properties_inside_a_collection_is_fine() }; // Act / Assert - sut.Should().BeEquivalentTo(new[] - { + sut.Should().BeEquivalentTo( + [ new BaseClassPointingToClassWithoutProperties { Name = "theName" } - }); + ]); } internal class BaseClassPointingToClassWithoutProperties diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs index 5f1b9c2457..9146e70da9 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs @@ -306,22 +306,22 @@ public void Excluding_an_interface_property_through_inheritance_should_work() { // Arrange IInterfaceWithTwoProperties[] actual = - { + [ new DerivedClassImplementingInterface { Value1 = 1, Value2 = 2 } - }; + ]; IInterfaceWithTwoProperties[] expected = - { + [ new DerivedClassImplementingInterface { Value1 = 999, Value2 = 2 } - }; + ]; // Act / Assert actual.Should().BeEquivalentTo(expected, options => options @@ -334,22 +334,22 @@ public void Including_an_interface_property_through_inheritance_should_work() { // Arrange IInterfaceWithTwoProperties[] actual = - { + [ new DerivedClassImplementingInterface { Value1 = 1, Value2 = 2 } - }; + ]; IInterfaceWithTwoProperties[] expected = - { + [ new DerivedClassImplementingInterface { Value1 = 999, Value2 = 2 } - }; + ]; // Act / Assert actual.Should().BeEquivalentTo(expected, options => options diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllSatisfy.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllSatisfy.cs index e6ff937c2a..8cd0f65fa9 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllSatisfy.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllSatisfy.cs @@ -62,7 +62,7 @@ public void An_empty_collection_should_succeed() public void All_items_satisfying_inspector_should_succeed() { // Arrange - var collection = new[] { new Customer { Age = 21, Name = "John" }, new Customer { Age = 21, Name = "Jane" } }; + Customer[] collection = [new Customer { Age = 21, Name = "John" }, new Customer { Age = 21, Name = "Jane" }]; // Act / Assert collection.Should().AllSatisfy(x => x.Age.Should().Be(21)); @@ -72,11 +72,11 @@ public void All_items_satisfying_inspector_should_succeed() public void Any_items_not_satisfying_inspector_should_throw() { // Arrange - var customers = new[] - { + CustomerWithItems[] customers = + [ new CustomerWithItems { Age = 21, Items = [1, 2] }, new CustomerWithItems { Age = 22, Items = [3] } - }; + ]; // Act Action act = () => customers.Should() diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEmpty.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEmpty.cs index 7ff0f22980..9fc68015bc 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEmpty.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEmpty.cs @@ -18,7 +18,7 @@ public class BeEmpty public void When_collection_is_empty_as_expected_it_should_not_throw() { // Arrange - var collection = new int[0]; + int[] collection = []; // Act / Assert collection.Should().BeEmpty(); @@ -65,7 +65,7 @@ public void When_asserting_collection_with_items_is_not_empty_it_should_enumerat public void When_asserting_collection_without_items_is_not_empty_it_should_fail() { // Arrange - var collection = new int[0]; + int[] collection = []; // Act Action act = () => collection.Should().NotBeEmpty(); @@ -78,7 +78,7 @@ public void When_asserting_collection_without_items_is_not_empty_it_should_fail( public void When_asserting_collection_without_items_is_not_empty_it_should_fail_with_descriptive_message_() { // Arrange - var collection = new int[0]; + int[] collection = []; // Act Action act = () => collection.Should().NotBeEmpty("because we want to test the failure {0}", "message"); @@ -110,7 +110,7 @@ public void When_asserting_collection_to_be_empty_but_collection_is_null_it_shou public void When_asserting_collection_to_be_empty_it_should_enumerate_only_once() { // Arrange - var collection = new CountingGenericEnumerable(new int[0]); + var collection = new CountingGenericEnumerable([]); // Act collection.Should().BeEmpty(); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs index 6e669510e7..eefc78f235 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs @@ -95,8 +95,8 @@ public void When_testing_for_equivalence_against_empty_collection_it_should_thro public void When_two_collections_are_both_empty_it_should_treat_them_as_equivalent() { // Arrange - var subject = new int[0]; - var otherCollection = new int[0]; + int[] subject = []; + int[] otherCollection = []; // Act Action act = () => subject.Should().BeEquivalentTo(otherCollection); @@ -237,7 +237,7 @@ public void When_non_empty_collection_is_not_expected_to_be_equivalent_to_an_emp { // Arrange int[] collection1 = [1, 2, 3]; - var collection2 = new int[0]; + int[] collection2 = []; // Act Action act = () => collection1.Should().NotBeEquivalentTo(collection2); @@ -282,8 +282,8 @@ public void When_testing_collections_not_to_be_equivalent_against_same_collectio public void When_a_collections_is_equivalent_to_an_approximate_copy_it_should_throw() { // Arrange - var collection = new[] { 1.0, 2.0, 3.0 }; - var collection1 = new[] { 1.5, 2.5, 3.5 }; + double[] collection = [1.0, 2.0, 3.0]; + double[] collection1 = [1.5, 2.5, 3.5]; // Act Action act = () => collection.Should().NotBeEquivalentTo(collection1, opt => opt diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInAscendingOrder.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInAscendingOrder.cs index 61a96d42df..4c5d296714 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInAscendingOrder.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInAscendingOrder.cs @@ -170,10 +170,10 @@ public void Can_use_a_cast_expression_in_the_ordering_expression() public void Can_use_an_index_into_a_list_in_the_ordering_expression() { // Arrange - var collection = new[] - { - new List { new() { Text = "a", Number = 1 } } - }; + List[] collection = + [ + [new() { Text = "a", Number = 1 }] + ]; // Act & Assert collection.Should().BeInAscendingOrder(o => o[0].Number); @@ -183,10 +183,10 @@ public void Can_use_an_index_into_a_list_in_the_ordering_expression() public void Can_use_an_index_into_an_array_in_the_ordering_expression() { // Arrange - var collection = new[] - { - new[] { new SomeClass { Text = "a", Number = 1 } } - }; + SomeClass[][] collection = + [ + [new SomeClass { Text = "a", Number = 1 }] + ]; // Act & Assert collection.Should().BeInAscendingOrder(o => o[0].Number); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInDescendingOrder.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInDescendingOrder.cs index a7d6e2ca26..ac27e75299 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInDescendingOrder.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInDescendingOrder.cs @@ -17,7 +17,7 @@ public class BeInDescendingOrder public void When_asserting_the_items_in_an_descendingly_ordered_collection_are_ordered_descending_it_should_succeed() { // Arrange - var collection = new[] { "z", "y", "x" }; + string[] collection = ["z", "y", "x"]; // Act / Assert collection.Should().BeInDescendingOrder(); @@ -27,7 +27,7 @@ public void When_asserting_the_items_in_an_descendingly_ordered_collection_are_o public void When_asserting_the_items_in_an_unordered_collection_are_ordered_descending_it_should_throw() { // Arrange - var collection = new[] { "z", "x", "y" }; + string[] collection = ["z", "x", "y"]; // Act Action action = () => collection.Should().BeInDescendingOrder("because letters are ordered"); @@ -98,7 +98,7 @@ public void When_asserting_the_items_in_an_unordered_collection_are_ordered_descending_using_the_given_comparer_it_should_throw() { // Arrange - var collection = new[] { "z", "x", "y" }; + string[] collection = ["z", "x", "y"]; // Act Action action = () => @@ -115,7 +115,7 @@ public void When_asserting_the_items_in_an_descendingly_ordered_collection_are_ordered_descending_using_the_given_comparer_it_should_succeed() { // Arrange - var collection = new[] { "z", "y", "x" }; + string[] collection = ["z", "y", "x"]; // Act / Assert collection.Should().BeInDescendingOrder(Comparer.Default); @@ -292,7 +292,7 @@ public class NotBeInDescendingOrder public void When_asserting_the_items_in_an_unordered_collection_are_not_in_descending_order_it_should_succeed() { // Arrange - var collection = new[] { "x", "y", "x" }; + string[] collection = ["x", "y", "x"]; // Act / Assert collection.Should().NotBeInDescendingOrder(); @@ -303,7 +303,7 @@ public void When_asserting_the_items_in_an_unordered_collection_are_not_in_descending_order_using_the_given_comparer_it_should_succeed() { // Arrange - var collection = new[] { "x", "y", "x" }; + string[] collection = ["x", "y", "x"]; // Act / Assert collection.Should().NotBeInDescendingOrder(Comparer.Default); @@ -313,7 +313,7 @@ public void public void When_asserting_the_items_in_a_descending_ordered_collection_are_not_in_descending_order_it_should_throw() { // Arrange - var collection = new[] { "c", "b", "a" }; + string[] collection = ["c", "b", "a"]; // Act Action action = () => collection.Should().NotBeInDescendingOrder("because numbers are not ordered"); @@ -329,7 +329,7 @@ public void When_asserting_the_items_in_a_descending_ordered_collection_are_not_in_descending_order_using_the_given_comparer_it_should_throw() { // Arrange - var collection = new[] { "c", "b", "a" }; + string[] collection = ["c", "b", "a"]; // Act Action action = () => diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeNullOrEmpty.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeNullOrEmpty.cs index 99137dd355..d4b3f7ef65 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeNullOrEmpty.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeNullOrEmpty.cs @@ -27,7 +27,7 @@ public void When_asserting_an_empty_collection_to_be_null_or_empty_it_should_succeed() { // Arrange - var collection = new int[0]; + int[] collection = []; // Act / Assert collection.Should().BeNullOrEmpty(); @@ -53,7 +53,7 @@ public void public void When_asserting_collection_to_be_null_or_empty_it_should_enumerate_only_once() { // Arrange - var collection = new CountingGenericEnumerable(new int[0]); + var collection = new CountingGenericEnumerable([]); // Act collection.Should().BeNullOrEmpty(); @@ -70,7 +70,7 @@ public void When_asserting_non_empty_collection_to_not_be_null_or_empty_it_should_succeed() { // Arrange - var collection = new[] { new object() }; + object[] collection = [new object()]; // Act / Assert collection.Should().NotBeNullOrEmpty(); @@ -95,7 +95,7 @@ public void When_asserting_empty_collection_to_not_be_null_or_empty_it_should_throw() { // Arrange - var collection = new int[0]; + int[] collection = []; // Act Action act = () => collection.Should().NotBeNullOrEmpty(); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Contain.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Contain.cs index f4845cdc0a..4c95e2abc2 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Contain.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Contain.cs @@ -119,7 +119,7 @@ public void When_the_contents_of_a_collection_are_checked_against_an_empty_colle int[] collection = [1, 2, 3]; // Act - Action act = () => collection.Should().Contain(new int[0]); + Action act = () => collection.Should().Contain([]); // Assert act.Should().Throw().WithMessage( @@ -200,7 +200,7 @@ public void When_collection_does_contain_an_expected_item_matching_a_predicate_i public void When_a_collection_of_strings_contains_the_expected_string_it_should_not_throw() { // Arrange - IEnumerable strings = new[] { "string1", "string2", "string3" }; + IEnumerable strings = ["string1", "string2", "string3"]; // Act / Assert strings.Should().Contain("string2"); @@ -210,7 +210,7 @@ public void When_a_collection_of_strings_contains_the_expected_string_it_should_ public void When_a_collection_of_strings_does_not_contain_the_expected_string_it_should_throw() { // Arrange - IEnumerable strings = new[] { "string1", "string2", "string3" }; + IEnumerable strings = ["string1", "string2", "string3"]; // Act Action act = () => strings.Should().Contain("string4", "because {0} is required", "4"); @@ -244,7 +244,7 @@ public void When_the_multiple_matching_objects_exists_it_continuation_using_the_ // Arrange DateTime now = DateTime.Now; - IEnumerable collection = new[] { now, DateTime.SpecifyKind(now, DateTimeKind.Unspecified) }; + IEnumerable collection = [now, DateTime.SpecifyKind(now, DateTimeKind.Unspecified)]; // Act Action act = () => collection.Should().Contain(now).Which.Kind.Should().Be(DateTimeKind.Local); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainEquivalentOf.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainEquivalentOf.cs index b17d0a3c10..1a07b2b20a 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainEquivalentOf.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainEquivalentOf.cs @@ -17,7 +17,7 @@ public void When_collection_contains_object_equal_of_another_it_should_succeed() { // Arrange var item = new Customer { Name = "John" }; - var collection = new[] { new Customer { Name = "Jane" }, item }; + Customer[] collection = [new Customer { Name = "Jane" }, item]; // Act / Assert collection.Should().ContainEquivalentOf(item); @@ -27,7 +27,7 @@ public void When_collection_contains_object_equal_of_another_it_should_succeed() public void When_collection_contains_object_equivalent_of_another_it_should_succeed() { // Arrange - var collection = new[] { new Customer { Name = "Jane" }, new Customer { Name = "John" } }; + Customer[] collection = [new Customer { Name = "Jane" }, new Customer { Name = "John" }]; var item = new Customer { Name = "John" }; // Act / Assert @@ -113,7 +113,7 @@ public void When_asserting_collection_to_contain_equivalent_but_collection_is_nu public void When_collection_contains_equivalent_null_object_it_should_succeed() { // Arrange - var collection = new[] { 1, 2, 3, (int?)null }; + int?[] collection = [1, 2, 3, null]; int? item = null; // Act @@ -141,7 +141,7 @@ public void When_collection_does_not_contain_equivalent_null_object_it_should_th public void When_empty_collection_does_not_contain_equivalent_it_should_throw() { // Arrange - var collection = new int[0]; + int[] collection = []; int item = 1; // Act @@ -155,8 +155,8 @@ public void When_empty_collection_does_not_contain_equivalent_it_should_throw() public void When_collection_does_not_contain_equivalent_because_of_second_property_it_should_throw() { // Arrange - var subject = new[] - { + Customer[] subject = + [ new Customer { Name = "John", @@ -167,7 +167,7 @@ public void When_collection_does_not_contain_equivalent_because_of_second_proper Name = "Jane", Age = 18 } - }; + ]; var item = new Customer { Name = "John", Age = 20 }; @@ -182,8 +182,8 @@ public void When_collection_does_not_contain_equivalent_because_of_second_proper public void When_collection_does_contain_equivalent_by_including_single_property_it_should_not_throw() { // Arrange - var collection = new[] - { + Customer[] collection = + [ new Customer { Name = "John", @@ -194,7 +194,7 @@ public void When_collection_does_contain_equivalent_by_including_single_property Name = "Jane", Age = 18 } - }; + ]; var item = new Customer { Name = "John", Age = 20 }; @@ -206,8 +206,8 @@ public void When_collection_does_contain_equivalent_by_including_single_property public void Tracing_should_be_included_in_the_assertion_output() { // Arrange - var collection = new[] - { + Customer[] collection = + [ new Customer { Name = "John", @@ -218,7 +218,7 @@ public void Tracing_should_be_included_in_the_assertion_output() Name = "Jane", Age = 18 } - }; + ]; var item = new Customer { Name = "John", Age = 21 }; @@ -325,7 +325,7 @@ public void When_injecting_a_null_config_to_NotContainEquivalentOf_it_should_thr public void When_asserting_empty_collection_to_not_contain_equivalent_it_should_succeed() { // Arrange - var collection = new int[0]; + int[] collection = []; int item = 4; // Act / Assert @@ -365,8 +365,8 @@ public void When_collection_does_not_contain_object_equivalent_of_unexpected_it_ public void When_asserting_collection_to_not_contain_equivalent_it_should_respect_config() { // Arrange - var collection = new[] - { + Customer[] collection = + [ new Customer { Name = "John", @@ -377,7 +377,7 @@ public void When_asserting_collection_to_not_contain_equivalent_it_should_respec Name = "Jane", Age = 18 } - }; + ]; var item = new Customer { Name = "John", Age = 20 }; diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainItemsAssignableTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainItemsAssignableTo.cs index 6008695b50..9d06884ecb 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainItemsAssignableTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainItemsAssignableTo.cs @@ -17,7 +17,7 @@ public class ContainItemsAssignableTo public void Should_succeed_when_asserting_collection_with_all_items_of_same_type_only_contains_item_of_one_type() { // Arrange - var collection = new[] { "1", "2", "3" }; + string[] collection = ["1", "2", "3"]; // Act / Assert collection.Should().ContainItemsAssignableTo(); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainSingle.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainSingle.cs index ffee01bbe8..260662bc6e 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainSingle.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainSingle.cs @@ -129,7 +129,7 @@ public void When_single_item_matching_a_predicate_is_found_it_should_allow_conti public void When_single_item_contains_brackets_it_should_format_them_properly() { // Arrange - IEnumerable collection = new[] { "" }; + IEnumerable collection = [""]; // Act Action act = () => collection.Should().ContainSingle(item => item == "{123}"); @@ -143,7 +143,7 @@ public void When_single_item_contains_brackets_it_should_format_them_properly() public void When_single_item_contains_string_interpolation_it_should_format_brackets_properly() { // Arrange - IEnumerable collection = new[] { "" }; + IEnumerable collection = [""]; // Act Action act = () => collection.Should().ContainSingle(item => item == $"{123}"); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.EndWith.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.EndWith.cs index e9b1996652..90417e69a9 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.EndWith.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.EndWith.cs @@ -17,7 +17,7 @@ public class EndWith public void When_collection_does_not_end_with_a_specific_element_it_should_throw() { // Arrange - var collection = new[] { "john", "jane", "mike" }; + string[] collection = ["john", "jane", "mike"]; // Act Action act = () => collection.Should().EndWith("ryan", "of some reason"); @@ -31,7 +31,7 @@ public void When_collection_does_not_end_with_a_specific_element_it_should_throw public void When_collection_does_end_with_a_specific_element_and_because_format_is_incorrect_it_should_not_fail() { // Arrange - var collection = new[] { "john", "jane", "mike" }; + string[] collection = ["john", "jane", "mike"]; // Act Action act = () => collection.Should().EndWith("mike", "of some reason {0,abc}", 1, 2); @@ -44,10 +44,10 @@ public void When_collection_does_end_with_a_specific_element_and_because_format_ public void When_collection_does_not_end_with_a_specific_element_in_a_sequence_it_should_throw() { // Arrange - var collection = new[] { "john", "bill", "jane", "mike" }; + string[] collection = ["john", "bill", "jane", "mike"]; // Act - Action act = () => collection.Should().EndWith(new[] { "bill", "ryan", "mike" }, "of some reason"); + Action act = () => collection.Should().EndWith(["bill", "ryan", "mike"], "of some reason"); // Assert act.Should().Throw().WithMessage( @@ -58,7 +58,7 @@ public void When_collection_does_not_end_with_a_specific_element_in_a_sequence_i public void When_collection_does_not_end_with_a_null_sequence_it_should_throw() { // Arrange - var collection = new[] { "john" }; + string[] collection = ["john"]; // Act Action act = () => collection.Should().EndWith((IEnumerable)null); @@ -72,7 +72,7 @@ public void When_collection_does_not_end_with_a_null_sequence_it_should_throw() public void When_collection_does_not_end_with_a_null_sequence_using_a_comparer_it_should_throw() { // Arrange - var collection = new[] { "john" }; + string[] collection = ["john"]; // Act Action act = () => collection.Should().EndWith((IEnumerable)null, (_, _) => true); @@ -87,10 +87,10 @@ public void When_collection_does_not_end_with_a_specific_element_in_a_sequence_using_custom_equality_comparison_it_should_throw() { // Arrange - var collection = new[] { "john", "bill", "jane", "mike" }; + string[] collection = ["john", "bill", "jane", "mike"]; // Act - Action act = () => collection.Should().EndWith(new[] { "bill", "ryan", "mike" }, + Action act = () => collection.Should().EndWith(["bill", "ryan", "mike"], (s1, s2) => string.Equals(s1, s2, StringComparison.Ordinal), "of some reason"); // Assert @@ -102,7 +102,7 @@ public void public void When_collection_ends_with_the_specific_element_it_should_not_throw() { // Arrange - var collection = new[] { "john", "jane", "mike" }; + string[] collection = ["john", "jane", "mike"]; // Act Action act = () => collection.Should().EndWith("mike"); @@ -115,10 +115,10 @@ public void When_collection_ends_with_the_specific_element_it_should_not_throw() public void When_collection_ends_with_the_specific_sequence_of_elements_it_should_not_throw() { // Arrange - var collection = new[] { "john", "bill", "jane", "mike" }; + string[] collection = ["john", "bill", "jane", "mike"]; // Act - Action act = () => collection.Should().EndWith(new[] { "jane", "mike" }); + Action act = () => collection.Should().EndWith(["jane", "mike"]); // Assert act.Should().NotThrow(); @@ -129,10 +129,10 @@ public void When_collection_ends_with_the_specific_sequence_of_elements_using_custom_equality_comparison_it_should_not_throw() { // Arrange - var collection = new[] { "john", "bill", "jane", "mike" }; + string[] collection = ["john", "bill", "jane", "mike"]; // Act - Action act = () => collection.Should().EndWith(new[] { "JaNe", "mIkE" }, + Action act = () => collection.Should().EndWith(["JaNe", "mIkE"], (s1, s2) => string.Equals(s1, s2, StringComparison.OrdinalIgnoreCase)); // Assert @@ -143,7 +143,7 @@ public void public void When_collection_ends_with_the_specific_null_element_it_should_not_throw() { // Arrange - var collection = new[] { "jane", "mike", null }; + string[] collection = ["jane", "mike", null]; // Act Action act = () => collection.Should().EndWith((string)null); @@ -156,10 +156,10 @@ public void When_collection_ends_with_the_specific_null_element_it_should_not_th public void When_collection_ends_with_the_specific_sequence_with_null_elements_it_should_not_throw() { // Arrange - var collection = new[] { "john", "bill", "jane", null, "mike", null }; + string[] collection = ["john", "bill", "jane", null, "mike", null]; // Act - Action act = () => collection.Should().EndWith(new[] { "jane", null, "mike", null }); + Action act = () => collection.Should().EndWith(["jane", null, "mike", null]); // Assert act.Should().NotThrow(); @@ -170,10 +170,10 @@ public void When_collection_ends_with_the_specific_sequence_with_null_elements_using_custom_equality_comparison_it_should_not_throw() { // Arrange - var collection = new[] { "john", "bill", "jane", null, "mike", null }; + string[] collection = ["john", "bill", "jane", null, "mike", null]; // Act - Action act = () => collection.Should().EndWith(new[] { "JaNe", null, "mIkE", null }, + Action act = () => collection.Should().EndWith(["JaNe", null, "mIkE", null], (s1, s2) => string.Equals(s1, s2, StringComparison.OrdinalIgnoreCase)); // Assert @@ -184,7 +184,7 @@ public void public void When_collection_ends_with_null_but_that_wasnt_expected_it_should_throw() { // Arrange - var collection = new[] { "jane", "mike", null }; + string[] collection = ["jane", "mike", null]; // Act Action act = () => collection.Should().EndWith("john"); @@ -216,7 +216,7 @@ public void When_null_collection_is_expected_to_end_with_an_element_it_should_th public void When_non_empty_collection_ends_with_the_empty_sequence_it_should_not_throw() { // Arrange - var collection = new[] { "jane", "mike" }; + string[] collection = ["jane", "mike"]; // Act Action act = () => collection.Should().EndWith(new string[] { }); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Equal.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Equal.cs index 0953aa4fd3..18fd6120af 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Equal.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Equal.cs @@ -160,7 +160,7 @@ public void When_asserting_collections_to_be_equal_but_expected_collection_is_nu public void When_an_empty_collection_is_compared_for_equality_to_a_non_empty_collection_it_should_throw() { // Arrange - var collection1 = new int[0]; + int[] collection1 = []; int[] collection2 = [1, 2, 3]; // Act @@ -176,7 +176,7 @@ public void When_a_non_empty_collection_is_compared_for_equality_to_an_empty_col { // Arrange int[] collection1 = [1, 2, 3]; - var collection2 = new int[0]; + int[] collection2 = []; // Act Action act = () => collection1.Should().Equal(collection2); @@ -414,7 +414,7 @@ public void When_asserting_collections_not_to_be_equal_but_expected_collection_i [Fact] public void When_asserting_collections_not_to_be_equal_but_both_collections_reference_the_same_object_it_should_throw() { - var collection1 = new[] { "one", "two", "three" }; + string[] collection1 = ["one", "two", "three"]; var collection2 = collection1; // Act diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveElementPreceding.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveElementPreceding.cs index e4d736cae3..001364c140 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveElementPreceding.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveElementPreceding.cs @@ -19,7 +19,7 @@ public class HaveElementPreceding public void When_collection_has_the_correct_element_preceding_another_it_should_not_throw() { // Arrange - var collection = new[] { "cris", "mick", "john" }; + string[] collection = ["cris", "mick", "john"]; // Act Action act = () => collection.Should().HaveElementPreceding("mick", "cris"); @@ -33,7 +33,7 @@ public void When_collection_has_the_correct_element_preceding_another_it_should_ public void When_collection_has_the_wrong_element_preceding_another_it_should_not_throw() { // Arrange - var collection = new[] { "cris", "mick", "john" }; + string[] collection = ["cris", "mick", "john"]; // Act Action act = () => collection.Should().HaveElementPreceding("john", "cris", "because of some reason"); @@ -48,7 +48,7 @@ public void When_collection_has_the_wrong_element_preceding_another_it_should_no public void When_nothing_is_preceding_an_element_it_should_throw() { // Arrange - var collection = new[] { "cris", "mick", "john" }; + string[] collection = ["cris", "mick", "john"]; // Act Action act = () => collection.Should().HaveElementPreceding("cris", "jane"); @@ -77,7 +77,7 @@ public void When_expecting_an_element_to_precede_another_but_collection_is_empty public void When_a_null_element_is_preceding_another_element_it_should_not_throw() { // Arrange - var collection = new[] { null, "mick", "john" }; + string[] collection = [null, "mick", "john"]; // Act Action act = () => collection.Should().HaveElementPreceding("mick", null); @@ -91,7 +91,7 @@ public void When_a_null_element_is_preceding_another_element_it_should_not_throw public void When_a_null_element_is_not_preceding_another_element_it_should_throw() { // Arrange - var collection = new[] { "cris", "mick", "john" }; + string[] collection = ["cris", "mick", "john"]; // Act Action act = () => collection.Should().HaveElementPreceding("mick", null); @@ -105,7 +105,7 @@ public void When_a_null_element_is_not_preceding_another_element_it_should_throw public void When_an_element_is_preceding_a_null_element_it_should_not_throw() { // Arrange - var collection = new[] { "mick", null, "john" }; + string[] collection = ["mick", null, "john"]; // Act Action act = () => collection.Should().HaveElementPreceding(null, "mick"); @@ -118,7 +118,7 @@ public void When_an_element_is_preceding_a_null_element_it_should_not_throw() public void When_an_element_is_not_preceding_a_null_element_it_should_throw() { // Arrange - var collection = new[] { "mick", null, "john" }; + string[] collection = ["mick", null, "john"]; // Act Action act = () => collection.Should().HaveElementPreceding(null, "cris"); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveElementSucceeding.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveElementSucceeding.cs index 61981764a5..038dcf0f8e 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveElementSucceeding.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveElementSucceeding.cs @@ -19,7 +19,7 @@ public class HaveElementSucceeding public void When_collection_has_the_correct_element_succeeding_another_it_should_not_throw() { // Arrange - var collection = new[] { "cris", "mick", "john" }; + string[] collection = ["cris", "mick", "john"]; // Act Action act = () => collection.Should().HaveElementSucceeding("cris", "mick"); @@ -33,7 +33,7 @@ public void When_collection_has_the_correct_element_succeeding_another_it_should public void When_collection_has_the_wrong_element_succeeding_another_it_should_not_throw() { // Arrange - var collection = new[] { "cris", "mick", "john" }; + string[] collection = ["cris", "mick", "john"]; // Act Action act = () => collection.Should().HaveElementSucceeding("mick", "cris", "because of some reason"); @@ -48,7 +48,7 @@ public void When_collection_has_the_wrong_element_succeeding_another_it_should_n public void When_nothing_is_succeeding_an_element_it_should_throw() { // Arrange - var collection = new[] { "cris", "mick", "john" }; + string[] collection = ["cris", "mick", "john"]; // Act Action act = () => collection.Should().HaveElementSucceeding("john", "jane"); @@ -76,7 +76,7 @@ public void When_expecting_an_element_to_succeed_another_but_the_collection_is_e public void When_a_null_element_is_succeeding_another_element_it_should_not_throw() { // Arrange - var collection = new[] { "mick", null, "john" }; + string[] collection = ["mick", null, "john"]; // Act Action act = () => collection.Should().HaveElementSucceeding("mick", null); @@ -89,7 +89,7 @@ public void When_a_null_element_is_succeeding_another_element_it_should_not_thro public void When_a_null_element_is_not_succeeding_another_element_it_should_throw() { // Arrange - var collection = new[] { "cris", "mick", "john" }; + string[] collection = ["cris", "mick", "john"]; // Act Action act = () => collection.Should().HaveElementSucceeding("mick", null); @@ -103,7 +103,7 @@ public void When_a_null_element_is_not_succeeding_another_element_it_should_thro public void When_an_element_is_succeeding_a_null_element_it_should_not_throw() { // Arrange - var collection = new[] { "mick", null, "john" }; + string[] collection = ["mick", null, "john"]; // Act Action act = () => collection.Should().HaveElementSucceeding(null, "john"); @@ -116,7 +116,7 @@ public void When_an_element_is_succeeding_a_null_element_it_should_not_throw() public void When_an_element_is_not_succeeding_a_null_element_it_should_throw() { // Arrange - var collection = new[] { "mick", null, "john" }; + string[] collection = ["mick", null, "john"]; // Act Action act = () => collection.Should().HaveElementSucceeding(null, "cris"); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainItemsAssignableTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainItemsAssignableTo.cs index cf95e3f4f9..66f3a9c02d 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainItemsAssignableTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainItemsAssignableTo.cs @@ -12,7 +12,7 @@ public class NotContainItemsAssignableTo public void Succeeds_when_the_collection_does_not_contain_items_of_the_unexpected_type() { // Arrange - var collection = new[] { "1", "2", "3" }; + string[] collection = ["1", "2", "3"]; // Act / Assert collection.Should().NotContainItemsAssignableTo(); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainNulls.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainNulls.cs index 2fb3da2b67..af3d47a559 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainNulls.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.NotContainNulls.cs @@ -27,7 +27,7 @@ public void When_collection_does_not_contain_nulls_it_should_not_throw() public void When_collection_contains_nulls_that_are_unexpected_it_should_throw() { // Arrange - var collection = new[] { new object(), null }; + object[] collection = [new object(), null]; // Act Action act = () => collection.Should().NotContainNulls("because they are {0}", "evil"); @@ -41,7 +41,7 @@ public void When_collection_contains_nulls_that_are_unexpected_it_should_throw() public void When_collection_contains_nulls_that_are_unexpected_it_supports_chaining() { // Arrange - var collection = new[] { new object(), null }; + object[] collection = [new object(), null]; // Act Action act = () => @@ -59,7 +59,7 @@ public void When_collection_contains_nulls_that_are_unexpected_it_supports_chain public void When_collection_contains_multiple_nulls_that_are_unexpected_it_should_throw() { // Arrange - var collection = new[] { new object(), null, new object(), null }; + object[] collection = [new object(), null, new object(), null]; // Act Action act = () => collection.Should().NotContainNulls("because they are {0}", "evil"); @@ -73,7 +73,7 @@ public void When_collection_contains_multiple_nulls_that_are_unexpected_it_shoul public void When_collection_contains_multiple_nulls_that_are_unexpected_it_supports_chaining() { // Arrange - var collection = new[] { new object(), null, new object(), null }; + object[] collection = [new object(), null, new object(), null]; // Act Action act = () => @@ -119,12 +119,12 @@ public void When_injecting_a_null_predicate_into_NotContainNulls_it_should_throw public void When_collection_does_not_contain_nulls_with_a_predicate_it_should_not_throw() { // Arrange - IEnumerable collection = new[] - { + IEnumerable collection = + [ new SomeClass { Text = "one" }, new SomeClass { Text = "two" }, new SomeClass { Text = "three" } - }; + ]; // Act / Assert collection.Should().NotContainNulls(e => e.Text); @@ -134,11 +134,11 @@ public void When_collection_does_not_contain_nulls_with_a_predicate_it_should_no public void When_collection_contains_nulls_that_are_unexpected_with_a_predicate_it_should_throw() { // Arrange - IEnumerable collection = new[] - { + IEnumerable collection = + [ new SomeClass { Text = "" }, new SomeClass { Text = null } - }; + ]; // Act Action act = () => collection.Should().NotContainNulls(e => e.Text, "because they are {0}", "evil"); @@ -152,13 +152,13 @@ public void When_collection_contains_nulls_that_are_unexpected_with_a_predicate_ public void When_collection_contains_multiple_nulls_that_are_unexpected_with_a_predicate_it_should_throw() { // Arrange - IEnumerable collection = new[] - { + IEnumerable collection = + [ new SomeClass { Text = "" }, new SomeClass { Text = null }, new SomeClass { Text = "" }, new SomeClass { Text = null } - }; + ]; // Act Action act = () => collection.Should().NotContainNulls(e => e.Text, "because they are {0}", "evil"); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyHaveUniqueItems.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyHaveUniqueItems.cs index 7a0be4c16e..6c86ba71c4 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyHaveUniqueItems.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyHaveUniqueItems.cs @@ -123,13 +123,13 @@ public void When_injecting_a_null_predicate_into_OnlyHaveUniqueItems_it_should_t public void Should_succeed_when_asserting_with_a_predicate_a_collection_with_unique_items_contains_only_unique_items() { // Arrange - IEnumerable collection = new[] - { + IEnumerable collection = + [ new SomeClass { Text = "one" }, new SomeClass { Text = "two" }, new SomeClass { Text = "three" }, new SomeClass { Text = "four" } - }; + ]; // Act / Assert collection.Should().OnlyHaveUniqueItems(e => e.Text); @@ -139,13 +139,13 @@ public void Should_succeed_when_asserting_with_a_predicate_a_collection_with_uni public void When_a_collection_contains_duplicate_items_with_predicate_it_should_throw() { // Arrange - IEnumerable collection = new[] - { + IEnumerable collection = + [ new SomeClass { Text = "one" }, new SomeClass { Text = "two" }, new SomeClass { Text = "three" }, new SomeClass { Text = "three" } - }; + ]; // Act Action act = () => collection.Should().OnlyHaveUniqueItems(e => e.Text, "{0} don't like {1}", "we", "duplicates"); @@ -159,14 +159,14 @@ public void When_a_collection_contains_duplicate_items_with_predicate_it_should_ public void When_a_collection_contains_multiple_duplicate_items_with_a_predicate_it_should_throw() { // Arrange - IEnumerable collection = new[] - { + IEnumerable collection = + [ new SomeClass { Text = "one" }, new SomeClass { Text = "two" }, new SomeClass { Text = "two" }, new SomeClass { Text = "three" }, new SomeClass { Text = "three" } - }; + ]; // Act Action act = () => collection.Should().OnlyHaveUniqueItems(e => e.Text, "{0} don't like {1}", "we", "duplicates"); @@ -180,14 +180,14 @@ public void When_a_collection_contains_multiple_duplicate_items_with_a_predicate public void When_a_collection_contains_multiple_duplicates_on_different_properties_all_should_be_reported() { // Arrange - IEnumerable collection = new[] - { + IEnumerable collection = + [ new SomeClass { Text = "one", Number = 1 }, new SomeClass { Text = "two", Number = 2 }, new SomeClass { Text = "two", Number = 2 }, new SomeClass { Text = "three", Number = 3 }, new SomeClass { Text = "three", Number = 4 } - }; + ]; // Act Action act = () => diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Satisfy.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Satisfy.cs index 3f9d53f195..6d356b9fb1 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Satisfy.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Satisfy.cs @@ -122,13 +122,13 @@ public void When_assertion_fails_then_failure_message_must_contain_predicates_without_matching_elements_and_elements_without_matching_predicates() { // Arrange - IEnumerable collection = new[] - { + IEnumerable collection = + [ new SomeClass { Text = "one", Number = 1 }, new SomeClass { Text = "two", Number = 3 }, new SomeClass { Text = "three", Number = 3 }, new SomeClass { Text = "four", Number = 4 }, - }; + ]; // Act Action act = () => collection.Should().Satisfy( diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.SatisfyRespectively.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.SatisfyRespectively.cs index 186cb46993..9f7cd2a1b1 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.SatisfyRespectively.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.SatisfyRespectively.cs @@ -80,7 +80,7 @@ public void When_collection_which_is_asserting_against_inspectors_is_empty_it_sh public void When_asserting_collection_satisfies_all_inspectors_it_should_succeed() { // Arrange - var collection = new[] { new Customer { Age = 21, Name = "John" }, new Customer { Age = 22, Name = "Jane" } }; + Customer[] collection = [new Customer { Age = 21, Name = "John" }, new Customer { Age = 22, Name = "Jane" }]; // Act / Assert collection.Should().SatisfyRespectively( @@ -100,11 +100,11 @@ public void When_asserting_collection_satisfies_all_inspectors_it_should_succeed public void When_asserting_collection_does_not_satisfy_any_inspector_it_should_throw() { // Arrange - var customers = new[] - { + CustomerWithItems[] customers = + [ new CustomerWithItems { Age = 21, Items = [1, 2] }, new CustomerWithItems { Age = 22, Items = [3] } - }; + ]; // Act Action act = () => customers.Should().SatisfyRespectively( @@ -176,7 +176,7 @@ public void When_inspectors_count_does_not_equal_asserting_collection_length_it_ public void When_inspectors_count_does_not_equal_asserting_collection_length_it_should_fail_with_a_useful_message() { // Arrange - var collection = new int[0]; + int[] collection = []; // Act Action act = () => collection.Should().SatisfyRespectively( diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.StartWith.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.StartWith.cs index 7f64ae6a1c..b1933d949c 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.StartWith.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.StartWith.cs @@ -17,7 +17,7 @@ public class StartWith public void When_collection_does_not_start_with_a_specific_element_it_should_throw() { // Arrange - var collection = new[] { "john", "jane", "mike" }; + string[] collection = ["john", "jane", "mike"]; // Act Action act = () => collection.Should().StartWith("ryan", "of some reason"); @@ -31,7 +31,7 @@ public void When_collection_does_not_start_with_a_specific_element_it_should_thr public void When_collection_does_not_start_with_a_null_sequence_it_should_throw() { // Arrange - var collection = new[] { "john" }; + string[] collection = ["john"]; // Act Action act = () => collection.Should().StartWith((IEnumerable)null); @@ -45,7 +45,7 @@ public void When_collection_does_not_start_with_a_null_sequence_it_should_throw( public void When_collection_does_not_start_with_a_null_sequence_using_a_comparer_it_should_throw() { // Arrange - var collection = new[] { "john" }; + string[] collection = ["john"]; // Act Action act = () => collection.Should().StartWith((IEnumerable)null, (_, _) => true); @@ -59,10 +59,10 @@ public void When_collection_does_not_start_with_a_null_sequence_using_a_comparer public void When_collection_does_not_start_with_a_specific_element_in_a_sequence_it_should_throw() { // Arrange - var collection = new[] { "john", "bill", "jane", "mike" }; + string[] collection = ["john", "bill", "jane", "mike"]; // Act - Action act = () => collection.Should().StartWith(new[] { "john", "ryan", "jane" }, "of some reason"); + Action act = () => collection.Should().StartWith(["john", "ryan", "jane"], "of some reason"); // Assert act.Should().Throw().WithMessage( @@ -74,10 +74,10 @@ public void When_collection_does_not_start_with_a_specific_element_in_a_sequence_using_custom_equality_comparison_it_should_throw() { // Arrange - var collection = new[] { "john", "bill", "jane", "mike" }; + string[] collection = ["john", "bill", "jane", "mike"]; // Act - Action act = () => collection.Should().StartWith(new[] { "john", "ryan", "jane" }, + Action act = () => collection.Should().StartWith(["john", "ryan", "jane"], (s1, s2) => string.Equals(s1, s2, StringComparison.Ordinal), "of some reason"); // Assert @@ -89,7 +89,7 @@ public void public void When_collection_starts_with_the_specific_element_it_should_not_throw() { // Arrange - var collection = new[] { "john", "jane", "mike" }; + string[] collection = ["john", "jane", "mike"]; // Act Action act = () => collection.Should().StartWith("john"); @@ -102,10 +102,10 @@ public void When_collection_starts_with_the_specific_element_it_should_not_throw public void When_collection_starts_with_the_specific_sequence_of_elements_it_should_not_throw() { // Arrange - var collection = new[] { "john", "bill", "jane", "mike" }; + string[] collection = ["john", "bill", "jane", "mike"]; // Act - Action act = () => collection.Should().StartWith(new[] { "john", "bill" }); + Action act = () => collection.Should().StartWith(["john", "bill"]); // Assert act.Should().NotThrow(); @@ -116,10 +116,10 @@ public void When_collection_starts_with_the_specific_sequence_of_elements_using_custom_equality_comparison_it_should_not_throw() { // Arrange - var collection = new[] { "john", "bill", "jane", "mike" }; + string[] collection = ["john", "bill", "jane", "mike"]; // Act - Action act = () => collection.Should().StartWith(new[] { "JoHn", "bIlL" }, + Action act = () => collection.Should().StartWith(["JoHn", "bIlL"], (s1, s2) => string.Equals(s1, s2, StringComparison.OrdinalIgnoreCase)); // Assert @@ -130,7 +130,7 @@ public void public void When_collection_starts_with_the_specific_null_element_it_should_not_throw() { // Arrange - var collection = new[] { null, "jane", "mike" }; + string[] collection = [null, "jane", "mike"]; // Act Action act = () => collection.Should().StartWith((string)null); @@ -143,7 +143,7 @@ public void When_collection_starts_with_the_specific_null_element_it_should_not_ public void When_non_empty_collection_starts_with_the_empty_sequence_it_should_not_throw() { // Arrange - var collection = new[] { "jane", "mike" }; + string[] collection = ["jane", "mike"]; // Act Action act = () => collection.Should().StartWith(new string[] { }); @@ -169,10 +169,10 @@ public void When_empty_collection_starts_with_the_empty_sequence_it_should_not_t public void When_collection_starts_with_the_specific_sequence_with_null_elements_it_should_not_throw() { // Arrange - var collection = new[] { null, "john", null, "bill", "jane", "mike" }; + string[] collection = [null, "john", null, "bill", "jane", "mike"]; // Act - Action act = () => collection.Should().StartWith(new[] { null, "john", null, "bill" }); + Action act = () => collection.Should().StartWith([null, "john", null, "bill"]); // Assert act.Should().NotThrow(); @@ -183,10 +183,10 @@ public void When_collection_starts_with_the_specific_sequence_with_null_elements_using_custom_equality_comparison_it_should_not_throw() { // Arrange - var collection = new[] { null, "john", null, "bill", "jane", "mike" }; + string[] collection = [null, "john", null, "bill", "jane", "mike"]; // Act - Action act = () => collection.Should().StartWith(new[] { null, "JoHn", null, "bIlL" }, + Action act = () => collection.Should().StartWith([null, "JoHn", null, "bIlL"], (s1, s2) => string.Equals(s1, s2, StringComparison.OrdinalIgnoreCase)); // Assert @@ -197,7 +197,7 @@ public void public void When_collection_starts_with_null_but_that_wasnt_expected_it_should_throw() { // Arrange - var collection = new[] { null, "jane", "mike" }; + string[] collection = [null, "jane", "mike"]; // Act Action act = () => collection.Should().StartWith("john"); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs index 7f065cf876..308756a26c 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs @@ -33,13 +33,13 @@ public void Should_support_chaining_constraints_with_and() public void When_the_collection_is_ordered_according_to_the_subsequent_ascending_assertion_it_should_succeed() { // Arrange - var collection = new[] - { + (int, string)[] collection = + [ (1, "a"), (2, "b"), (2, "c"), (3, "a") - }; + ]; // Act Action action = () => collection.Should() @@ -55,13 +55,13 @@ public void When_the_collection_is_ordered_according_to_the_subsequent_ascending public void When_the_collection_is_not_ordered_according_to_the_subsequent_ascending_assertion_it_should_fail() { // Arrange - var collection = new[] - { + (int, string)[] collection = + [ (1, "a"), (2, "b"), (2, "c"), (3, "a") - }; + ]; // Act Action action = () => collection.Should() @@ -79,13 +79,13 @@ public void When_the_collection_is_ordered_according_to_the_subsequent_ascending_assertion_with_comparer_it_should_succeed() { // Arrange - var collection = new[] - { + (int, string)[] collection = + [ (1, "a"), (2, "B"), (2, "b"), (3, "a") - }; + ]; // Act Action action = () => collection.Should() @@ -101,13 +101,13 @@ public void public void When_the_collection_is_ordered_according_to_the_multiple_subsequent_ascending_assertions_it_should_succeed() { // Arrange - var collection = new[] - { + (int, string, double)[] collection = + [ (1, "a", 1.1), (2, "b", 1.2), (2, "c", 1.3), (3, "a", 1.1) - }; + ]; // Act Action action = () => collection.Should() @@ -125,13 +125,13 @@ public void When_the_collection_is_ordered_according_to_the_multiple_subsequent_ public void When_the_collection_is_ordered_according_to_the_subsequent_descending_assertion_it_should_succeed() { // Arrange - var collection = new[] - { + (int, string)[] collection = + [ (3, "a"), (2, "c"), (2, "b"), (1, "a") - }; + ]; // Act Action action = () => collection.Should() @@ -147,13 +147,13 @@ public void When_the_collection_is_ordered_according_to_the_subsequent_descendin public void When_the_collection_is_not_ordered_according_to_the_subsequent_descending_assertion_it_should_fail() { // Arrange - var collection = new[] - { + (int, string)[] collection = + [ (3, "a"), (2, "c"), (2, "b"), (1, "a") - }; + ]; // Act Action action = () => collection.Should() @@ -171,13 +171,13 @@ public void When_the_collection_is_ordered_according_to_the_subsequent_descending_assertion_with_comparer_it_should_succeed() { // Arrange - var collection = new[] - { + (int, string)[] collection = + [ (3, "a"), (2, "b"), (2, "B"), (1, "a") - }; + ]; // Act Action action = () => collection.Should() @@ -193,13 +193,13 @@ public void public void When_the_collection_is_ordered_according_to_the_multiple_subsequent_descending_assertions_it_should_succeed() { // Arrange - var collection = new[] - { + (int, string, double)[] collection = + [ (3, "a", 1.1), (2, "c", 1.3), (2, "b", 1.2), (1, "a", 1.1) - }; + ]; // Act Action action = () => collection.Should() diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEmpty.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEmpty.cs index efe51fe01a..39dab11a47 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEmpty.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEmpty.cs @@ -13,7 +13,7 @@ public class BeEmpty public void Should_fail_when_asserting_collection_with_items_is_empty() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act Action act = () => collection.Should().BeEmpty(); @@ -50,7 +50,7 @@ public void When_asserting_collection_to_be_empty_but_collection_is_null_it_shou public void When_the_collection_is_not_empty_unexpectedly_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act Action act = () => collection.Should().BeEmpty("because we want to test the failure {0}", "message"); @@ -83,7 +83,7 @@ public void When_asserting_collection_to_be_not_empty_but_collection_is_null_it_ public void When_asserting_collection_with_items_is_not_empty_it_should_succeed() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act / Assert collection.Should().NotBeEmpty(); diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEquivalentTo.cs index 5a9ce6fa06..d23523d701 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEquivalentTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEquivalentTo.cs @@ -14,7 +14,7 @@ public void When_asserting_collections_to_be_equivalent_but_subject_collection_i { // Arrange IEnumerable collection = null; - IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection1 = ["one", "two", "three"]; // Act Action act = @@ -30,8 +30,8 @@ public void When_asserting_collections_to_be_equivalent_but_subject_collection_i public void When_collections_with_duplicates_are_not_equivalent_it_should_throw() { // Arrange - IEnumerable collection1 = new[] { "one", "two", "three", "one" }; - IEnumerable collection2 = new[] { "one", "two", "three", "three" }; + IEnumerable collection1 = ["one", "two", "three", "one"]; + IEnumerable collection2 = ["one", "two", "three", "three"]; // Act Action act = () => collection1.Should().BeEquivalentTo(collection2); @@ -45,7 +45,7 @@ public void When_collections_with_duplicates_are_not_equivalent_it_should_throw( public void When_testing_for_equivalence_against_empty_collection_it_should_throw() { // Arrange - IEnumerable subject = new[] { "one", "two", "three" }; + IEnumerable subject = ["one", "two", "three"]; IEnumerable otherCollection = new string[0]; // Act @@ -60,7 +60,7 @@ public void When_testing_for_equivalence_against_empty_collection_it_should_thro public void When_testing_for_equivalence_against_null_collection_it_should_throw() { // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection1 = ["one", "two", "three"]; IEnumerable collection2 = null; // Act @@ -89,8 +89,8 @@ public void When_two_collections_are_both_empty_it_should_treat_them_as_equivale public void When_two_collections_contain_the_same_elements_it_should_treat_them_as_equivalent() { // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "three", "two", "one" }; + IEnumerable collection1 = ["one", "two", "three"]; + IEnumerable collection2 = ["three", "two", "one"]; // Act / Assert collection1.Should().BeEquivalentTo(collection2); @@ -114,8 +114,8 @@ public class NotBeEquivalentTo public void Should_succeed_when_asserting_collection_is_not_equivalent_to_a_different_collection() { // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "three", "one" }; + IEnumerable collection1 = ["one", "two", "three"]; + IEnumerable collection2 = ["three", "one"]; // Act / Assert collection1.Should().NotBeEquivalentTo(collection2); @@ -126,7 +126,7 @@ public void When_asserting_collections_not_to_be_equivalent_but_subject_collecti { // Arrange IEnumerable actual = null; - IEnumerable expectation = new[] { "one", "two", "three" }; + IEnumerable expectation = ["one", "two", "three"]; // Act Action act = () => actual.Should().NotBeEquivalentTo(expectation, @@ -141,8 +141,8 @@ public void When_asserting_collections_not_to_be_equivalent_but_subject_collecti public void When_collections_are_unexpectedly_equivalent_it_should_throw() { // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "three", "one", "two" }; + IEnumerable collection1 = ["one", "two", "three"]; + IEnumerable collection2 = ["three", "one", "two"]; // Act Action act = () => collection1.Should().NotBeEquivalentTo(collection2); @@ -156,7 +156,7 @@ public void When_collections_are_unexpectedly_equivalent_it_should_throw() public void When_non_empty_collection_is_not_expected_to_be_equivalent_to_an_empty_collection_it_should_succeed() { // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection1 = ["one", "two", "three"]; IEnumerable collection2 = new string[0]; // Act @@ -170,7 +170,7 @@ public void When_non_empty_collection_is_not_expected_to_be_equivalent_to_an_emp public void When_testing_collections_not_to_be_equivalent_against_null_collection_it_should_throw() { // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection1 = ["one", "two", "three"]; IEnumerable collection2 = null; // Act @@ -185,7 +185,7 @@ public void When_testing_collections_not_to_be_equivalent_against_null_collectio public void When_testing_collections_not_to_be_equivalent_against_same_collection_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; IEnumerable collection1 = collection; // Act diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeSubsetOf.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeSubsetOf.cs index 259cf7051e..d6f8fa106b 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeSubsetOf.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeSubsetOf.cs @@ -13,7 +13,7 @@ public class BeSubsetOf public void When_a_subset_is_tested_against_a_null_superset_it_should_throw_with_a_clear_explanation() { // Arrange - IEnumerable subset = new[] { "one", "two", "three" }; + IEnumerable subset = ["one", "two", "three"]; IEnumerable superset = null; // Act @@ -29,7 +29,7 @@ public void When_an_empty_collection_is_tested_against_a_superset_it_should_succ { // Arrange IEnumerable subset = new string[0]; - IEnumerable superset = new[] { "one", "two", "four", "five" }; + IEnumerable superset = ["one", "two", "four", "five"]; // Act Action act = () => subset.Should().BeSubsetOf(superset); @@ -43,7 +43,7 @@ public void When_asserting_collection_to_be_subset_against_null_collection_it_sh { // Arrange IEnumerable collection = null; - IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection1 = ["one", "two", "three"]; // Act Action act = @@ -58,8 +58,8 @@ public void When_asserting_collection_to_be_subset_against_null_collection_it_sh public void When_collection_is_not_a_subset_of_another_it_should_throw_with_the_reason() { // Arrange - IEnumerable subset = new[] { "one", "two", "three", "six" }; - IEnumerable superset = new[] { "one", "two", "four", "five" }; + IEnumerable subset = ["one", "two", "three", "six"]; + IEnumerable superset = ["one", "two", "four", "five"]; // Act Action act = () => subset.Should().BeSubsetOf(superset, "because we want to test the failure {0}", "message"); @@ -74,8 +74,8 @@ public void When_collection_is_not_a_subset_of_another_it_should_throw_with_the_ public void When_collection_is_subset_of_a_specified_collection_it_should_not_throw() { // Arrange - IEnumerable subset = new[] { "one", "two" }; - IEnumerable superset = new[] { "one", "two", "three" }; + IEnumerable subset = ["one", "two"]; + IEnumerable superset = ["one", "two", "three"]; // Act / Assert subset.Should().BeSubsetOf(superset); @@ -88,8 +88,8 @@ public class NotBeSubsetOf public void Should_fail_when_asserting_collection_is_not_subset_of_a_superset_collection() { // Arrange - IEnumerable subject = new[] { "one", "two" }; - IEnumerable otherSet = new[] { "one", "two", "three" }; + IEnumerable subject = ["one", "two"]; + IEnumerable otherSet = ["one", "two", "three"]; // Act Action act = () => subject.Should().NotBeSubsetOf(otherSet, "because I'm {0}", "mistaken"); @@ -103,8 +103,8 @@ public void Should_fail_when_asserting_collection_is_not_subset_of_a_superset_co public void When_a_set_is_expected_to_be_not_a_subset_it_should_succeed() { // Arrange - IEnumerable subject = new[] { "one", "two", "four" }; - IEnumerable otherSet = new[] { "one", "two", "three" }; + IEnumerable subject = ["one", "two", "four"]; + IEnumerable otherSet = ["one", "two", "three"]; // Act / Assert subject.Should().NotBeSubsetOf(otherSet); @@ -115,7 +115,7 @@ public void When_an_empty_set_is_not_supposed_to_be_a_subset_of_another_set_it_s { // Arrange IEnumerable subject = []; - IEnumerable otherSet = new[] { "one", "two", "three" }; + IEnumerable otherSet = ["one", "two", "three"]; // Act Action act = () => subject.Should().NotBeSubsetOf(otherSet); @@ -129,7 +129,7 @@ public void When_an_empty_set_is_not_supposed_to_be_a_subset_of_another_set_it_s public void When_asserting_collection_to_not_be_subset_against_same_collection_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; IEnumerable otherCollection = collection; // Act diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.Contain.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.Contain.cs index 422acb5173..fc150f0483 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.Contain.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.Contain.cs @@ -13,10 +13,10 @@ public class Contain public void When_a_collection_does_not_contain_another_collection_it_should_throw_with_clear_explanation() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act - Action act = () => collection.Should().Contain(new[] { "three", "four", "five" }, "because {0}", "we do"); + Action act = () => collection.Should().Contain(["three", "four", "five"], "because {0}", "we do"); // Assert act.Should().Throw().WithMessage( @@ -27,7 +27,7 @@ public void When_a_collection_does_not_contain_another_collection_it_should_thro public void When_a_collection_does_not_contain_single_item_it_should_throw_with_clear_explanation() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act Action act = () => collection.Should().Contain("four", "because {0}", "we do"); @@ -56,7 +56,7 @@ public void public void When_asserting_collection_contains_an_item_from_the_collection_it_should_succeed() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act Action act = () => collection.Should().Contain("one"); @@ -69,10 +69,10 @@ public void When_asserting_collection_contains_an_item_from_the_collection_it_sh public void When_asserting_collection_contains_multiple_items_from_the_collection_in_any_order_it_should_succeed() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act - Action act = () => collection.Should().Contain(new[] { "two", "one" }); + Action act = () => collection.Should().Contain(["two", "one"]); // Assert act.Should().NotThrow(); @@ -82,7 +82,7 @@ public void When_asserting_collection_contains_multiple_items_from_the_collectio public void When_the_contents_of_a_collection_are_checked_against_an_empty_collection_it_should_throw_clear_explanation() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act Action act = () => collection.Should().Contain(new string[0]); @@ -96,7 +96,7 @@ public void When_the_contents_of_a_collection_are_checked_against_an_empty_colle public void When_the_expected_object_exists_it_should_allow_chaining_additional_assertions() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act Action act = () => collection.Should().Contain("one").Which.Should().HaveLength(4); @@ -127,7 +127,7 @@ public void When_asserting_collection_does_not_contain_item_against_null_collect public void When_collection_contains_an_unexpected_item_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act Action act = () => collection.Should().NotContain("one", "because we {0} like it, but found it anyhow", "don't"); @@ -141,7 +141,7 @@ public void When_collection_contains_an_unexpected_item_it_should_throw() public void When_collection_does_contain_an_unexpected_item_matching_a_predicate_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act Action act = () => collection.Should().NotContain(item => item == "two", "because {0}s are evil", "two"); @@ -155,7 +155,7 @@ public void When_collection_does_contain_an_unexpected_item_matching_a_predicate public void When_collection_does_not_contain_an_item_that_is_not_in_the_collection_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act Action act = () => collection.Should().NotContain("four"); @@ -168,7 +168,7 @@ public void When_collection_does_not_contain_an_item_that_is_not_in_the_collecti public void When_collection_does_not_contain_an_unexpected_item_matching_a_predicate_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act / Assert collection.Should().NotContain(item => item == "four"); diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainInOrder.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainInOrder.cs index 15348015a9..8b0dc7af79 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainInOrder.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainInOrder.cs @@ -13,7 +13,7 @@ public class ContainInOrder public void When_a_collection_does_not_contain_a_range_twice_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "one", "three", "twelve", "two", "two" }; + IEnumerable collection = ["one", "two", "one", "three", "twelve", "two", "two"]; // Act Action act = () => collection.Should().ContainInOrder("one", "two", "one", "one", "two"); @@ -27,7 +27,7 @@ public void When_a_collection_does_not_contain_a_range_twice_it_should_throw() public void When_a_collection_does_not_contain_an_ordered_item_it_should_throw_with_a_clear_explanation() { // Act - Action act = () => new[] { "one", "two", "three" }.Should().ContainInOrder(new[] { "four", "one" }, "we failed"); + Action act = () => new[] { "one", "two", "three" }.Should().ContainInOrder(["four", "one"], "we failed"); // Assert act.Should().Throw().WithMessage( @@ -44,7 +44,7 @@ public void When_asserting_collection_contains_some_values_in_order_but_collecti // Act Action act = () => strings.Should() - .ContainInOrder(new[] { "string4" }, "because we're checking how it reacts to a null subject"); + .ContainInOrder(["string4"], "because we're checking how it reacts to a null subject"); // Assert act.Should().Throw().WithMessage( @@ -55,7 +55,7 @@ public void When_asserting_collection_contains_some_values_in_order_but_collecti public void When_collection_contains_null_value_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "one", null, "two", "string" }; + IEnumerable collection = ["one", null, "two", "string"]; // Act / Assert collection.Should().ContainInOrder("one", null, "string"); @@ -76,7 +76,7 @@ public void When_passing_in_null_while_checking_for_ordered_containment_it_shoul public void When_the_first_collection_contains_a_duplicate_item_without_affecting_the_order_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three", "two" }; + IEnumerable collection = ["one", "two", "three", "two"]; // Act / Assert collection.Should().ContainInOrder("one", "two", "three"); @@ -86,7 +86,7 @@ public void When_the_first_collection_contains_a_duplicate_item_without_affectin public void When_two_collections_contain_the_same_duplicate_items_in_the_same_order_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "one", "two", "twelve", "two", "two" }; + IEnumerable collection = ["one", "two", "one", "two", "twelve", "two", "two"]; // Act / Assert collection.Should().ContainInOrder("one", "two", "one", "two", "twelve", "two", "two"); @@ -97,7 +97,7 @@ public void When_two_collections_contain_the_same_items_but_in_different_order_i { // Act Action act = () => - new[] { "one", "two", "three" }.Should().ContainInOrder(new[] { "three", "one" }, "because we said so"); + new[] { "one", "two", "three" }.Should().ContainInOrder(["three", "one"], "because we said so"); // Assert act.Should().Throw().WithMessage( @@ -108,7 +108,7 @@ public void When_two_collections_contain_the_same_items_but_in_different_order_i public void When_two_collections_contain_the_same_items_in_the_same_order_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "two", "three" }; + IEnumerable collection = ["one", "two", "two", "three"]; // Act / Assert collection.Should().ContainInOrder("one", "two", "three"); @@ -121,7 +121,7 @@ public class NotContainInOrder public void When_two_collections_contain_the_same_items_but_in_different_order_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act / Assert collection.Should().NotContainInOrder("two", "one"); @@ -131,7 +131,7 @@ public void When_two_collections_contain_the_same_items_but_in_different_order_i public void When_a_collection_does_not_contain_an_ordered_item_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act / Assert collection.Should().NotContainInOrder("four", "one"); @@ -141,7 +141,7 @@ public void When_a_collection_does_not_contain_an_ordered_item_it_should_not_thr public void When_a_collection_contains_less_items_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "one", "two" }; + IEnumerable collection = ["one", "two"]; // Act / Assert collection.Should().NotContainInOrder("one", "two", "three"); @@ -151,7 +151,7 @@ public void When_a_collection_contains_less_items_it_should_not_throw() public void When_a_collection_does_not_contain_a_range_twice_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "one", "three", "twelve", "two", "two" }; + IEnumerable collection = ["one", "two", "one", "three", "twelve", "two", "two"]; // Act / Assert collection.Should().NotContainInOrder("one", "two", "one", "one", "two"); @@ -175,10 +175,10 @@ public void When_asserting_collection_does_not_contain_some_values_in_order_but_ public void When_two_collections_contain_the_same_items_in_the_same_order_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "two", "three" }; + IEnumerable collection = ["one", "two", "two", "three"]; // Act - Action act = () => collection.Should().NotContainInOrder(new[] { "one", "two", "three" }, "that's what we expect"); + Action act = () => collection.Should().NotContainInOrder(["one", "two", "three"], "that's what we expect"); // Assert act.Should().Throw().WithMessage( @@ -190,7 +190,7 @@ public void When_two_collections_contain_the_same_items_in_the_same_order_it_sho public void When_collection_contains_contain_the_same_items_in_the_same_order_with_null_value_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", null, "two", "three" }; + IEnumerable collection = ["one", null, "two", "three"]; // Act Action act = () => collection.Should().NotContainInOrder("one", null, "three"); @@ -205,7 +205,7 @@ public void When_collection_contains_contain_the_same_items_in_the_same_order_wi public void When_the_first_collection_contains_a_duplicate_item_without_affecting_the_order_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three", "two" }; + IEnumerable collection = ["one", "two", "three", "two"]; // Act Action act = () => collection.Should().NotContainInOrder("one", "two", "three"); @@ -220,7 +220,7 @@ public void When_the_first_collection_contains_a_duplicate_item_without_affectin public void When_two_collections_contain_the_same_duplicate_items_in_the_same_order_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "one", "twelve", "two" }; + IEnumerable collection = ["one", "two", "one", "twelve", "two"]; // Act Action act = () => collection.Should().NotContainInOrder("one", "two", "one", "twelve", "two"); @@ -235,7 +235,7 @@ public void When_two_collections_contain_the_same_duplicate_items_in_the_same_or public void When_passing_in_null_while_checking_for_absence_of_ordered_containment_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act Action act = () => collection.Should().NotContainInOrder(null); diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainMatch.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainMatch.cs index a83aecc480..d274fe904f 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainMatch.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainMatch.cs @@ -14,7 +14,7 @@ public class ContainMatch public void When_collection_contains_a_match_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; + IEnumerable collection = ["build succeded", "test failed"]; // Act Action action = () => collection.Should().ContainMatch("* failed"); @@ -27,7 +27,7 @@ public void When_collection_contains_a_match_it_should_not_throw() public void When_collection_contains_multiple_matches_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "build succeded", "test failed", "pack failed" }; + IEnumerable collection = ["build succeded", "test failed", "pack failed"]; // Act Action action = () => collection.Should().ContainMatch("* failed"); @@ -40,7 +40,7 @@ public void When_collection_contains_multiple_matches_it_should_not_throw() public void When_collection_contains_multiple_matches_which_should_throw() { // Arrange - IEnumerable collection = new[] { "build succeded", "test failed", "pack failed" }; + IEnumerable collection = ["build succeded", "test failed", "pack failed"]; // Act Action action = () => _ = collection.Should().ContainMatch("* failed").Which; @@ -55,7 +55,7 @@ public void When_collection_contains_multiple_matches_which_should_throw() public void When_collection_does_not_contain_a_match_it_should_throw() { // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; + IEnumerable collection = ["build succeded", "test failed"]; // Act Action action = () => collection.Should().ContainMatch("* stopped", "because {0}", "we do"); @@ -70,7 +70,7 @@ public void When_collection_does_not_contain_a_match_it_should_throw() public void When_collection_contains_a_match_that_differs_in_casing_it_should_throw() { // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; + IEnumerable collection = ["build succeded", "test failed"]; // Act Action action = () => collection.Should().ContainMatch("* Failed"); @@ -116,7 +116,7 @@ public void When_asserting_null_collection_for_match_it_should_throw() public void When_asserting_collection_to_have_null_match_it_should_throw() { // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; + IEnumerable collection = ["build succeded", "test failed"]; // Act Action action = () => collection.Should().ContainMatch(null); @@ -132,7 +132,7 @@ public void When_asserting_collection_to_have_null_match_it_should_throw() public void When_asserting_collection_to_have_empty_string_match_it_should_throw() { // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; + IEnumerable collection = ["build succeded", "test failed"]; // Act Action action = () => collection.Should().ContainMatch(string.Empty); @@ -151,7 +151,7 @@ public class NotContainMatch public void When_collection_doesnt_contain_a_match_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "build succeded", "test" }; + IEnumerable collection = ["build succeded", "test"]; // Act Action action = () => collection.Should().NotContainMatch("* failed"); @@ -164,7 +164,7 @@ public void When_collection_doesnt_contain_a_match_it_should_not_throw() public void When_collection_doesnt_contain_multiple_matches_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "build succeded", "test", "pack" }; + IEnumerable collection = ["build succeded", "test", "pack"]; // Act Action action = () => collection.Should().NotContainMatch("* failed"); @@ -177,7 +177,7 @@ public void When_collection_doesnt_contain_multiple_matches_it_should_not_throw( public void When_collection_contains_a_match_it_should_throw() { // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; + IEnumerable collection = ["build succeded", "test failed"]; // Act Action action = () => collection.Should().NotContainMatch("* failed", "because {0}", "it shouldn't"); @@ -192,7 +192,7 @@ public void When_collection_contains_a_match_it_should_throw() public void When_collection_contains_multiple_matches_it_should_throw() { // Arrange - IEnumerable collection = new[] { "build failed", "test failed" }; + IEnumerable collection = ["build failed", "test failed"]; // Act Action action = () => collection.Should().NotContainMatch("* failed", "because {0}", "it shouldn't"); @@ -207,7 +207,7 @@ public void When_collection_contains_multiple_matches_it_should_throw() public void When_collection_contains_a_match_with_different_casing_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; + IEnumerable collection = ["build succeded", "test failed"]; // Act Action action = () => collection.Should().NotContainMatch("* Failed"); @@ -220,7 +220,7 @@ public void When_collection_contains_a_match_with_different_casing_it_should_not public void When_asserting_collection_to_not_have_null_match_it_should_throw() { // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; + IEnumerable collection = ["build succeded", "test failed"]; // Act Action action = () => collection.Should().NotContainMatch(null); @@ -236,7 +236,7 @@ public void When_asserting_collection_to_not_have_null_match_it_should_throw() public void When_asserting_collection_to_not_have_empty_string_match_it_should_throw() { // Arrange - IEnumerable collection = new[] { "build succeded", "test failed" }; + IEnumerable collection = ["build succeded", "test failed"]; // Act Action action = () => collection.Should().NotContainMatch(string.Empty); diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.Equal.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.Equal.cs index 1c1a23c369..1a3ffbfe3f 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.Equal.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.Equal.cs @@ -13,8 +13,8 @@ public class Equal public void Should_succeed_when_asserting_collection_is_equal_to_the_same_collection() { // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "one", "two", "three" }; + IEnumerable collection1 = ["one", "two", "three"]; + IEnumerable collection2 = ["one", "two", "three"]; // Act / Assert collection1.Should().Equal(collection2); @@ -24,7 +24,7 @@ public void Should_succeed_when_asserting_collection_is_equal_to_the_same_collec public void Should_succeed_when_asserting_collection_is_equal_to_the_same_list_of_elements() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act / Assert collection.Should().Equal("one", "two", "three"); @@ -50,7 +50,7 @@ public void When_an_empty_collection_is_compared_for_equality_to_a_non_empty_col { // Arrange var collection1 = new string[0]; - IEnumerable collection2 = new[] { "one", "two", "three" }; + IEnumerable collection2 = ["one", "two", "three"]; // Act Action act = () => collection1.Should().Equal(collection2); @@ -97,7 +97,7 @@ public void When_injecting_a_null_comparer_it_should_throw() public void When_asserting_collections_to_be_equal_but_expected_collection_is_null_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; IEnumerable collection1 = null; // Act @@ -115,7 +115,7 @@ public void When_asserting_collections_to_be_equal_but_subject_collection_is_nul { // Arrange IEnumerable collection = null; - IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection1 = ["one", "two", "three"]; // Act Action act = () => @@ -143,8 +143,8 @@ public void When_both_collections_are_null_it_should_succeed() public void When_two_collections_are_not_equal_because_one_item_differs_it_should_throw_using_the_reason() { // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "one", "two", "five" }; + IEnumerable collection1 = ["one", "two", "three"]; + IEnumerable collection2 = ["one", "two", "five"]; // Act Action act = () => collection1.Should().Equal(collection2, "because we want to test the failure {0}", "message"); @@ -159,8 +159,8 @@ public void When_two_collections_are_not_equal_because_the_actual_collection_contains_less_items_it_should_throw_using_the_reason() { // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "one", "two", "three", "four" }; + IEnumerable collection1 = ["one", "two", "three"]; + IEnumerable collection2 = ["one", "two", "three", "four"]; // Act Action act = () => collection1.Should().Equal(collection2, "because we want to test the failure {0}", "message"); @@ -175,8 +175,8 @@ public void When_two_collections_are_not_equal_because_the_actual_collection_contains_more_items_it_should_throw_using_the_reason() { // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "one", "two" }; + IEnumerable collection1 = ["one", "two", "three"]; + IEnumerable collection2 = ["one", "two"]; // Act Action act = () => collection1.Should().Equal(collection2, "because we want to test the failure {0}", "message"); @@ -207,8 +207,8 @@ public class NotEqual public void Should_succeed_when_asserting_collection_is_not_equal_to_a_different_collection() { // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "three", "one", "two" }; + IEnumerable collection1 = ["one", "two", "three"]; + IEnumerable collection2 = ["three", "one", "two"]; // Act / Assert collection1.Should() @@ -218,7 +218,7 @@ public void Should_succeed_when_asserting_collection_is_not_equal_to_a_different [Fact] public void When_asserting_collections_not_to_be_equal_but_both_collections_reference_the_same_object_it_should_throw() { - IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection1 = ["one", "two", "three"]; IEnumerable collection2 = collection1; // Act @@ -234,7 +234,7 @@ public void When_asserting_collections_not_to_be_equal_but_both_collections_refe public void When_asserting_collections_not_to_be_equal_but_expected_collection_is_null_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; IEnumerable collection1 = null; // Act @@ -252,7 +252,7 @@ public void When_asserting_collections_not_to_be_equal_subject_but_collection_is { // Arrange IEnumerable collection = null; - IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection1 = ["one", "two", "three"]; // Act Action act = @@ -267,8 +267,8 @@ public void When_asserting_collections_not_to_be_equal_subject_but_collection_is public void When_two_equal_collections_are_not_expected_to_be_equal_it_should_report_a_clear_explanation() { // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "one", "two", "three" }; + IEnumerable collection1 = ["one", "two", "three"]; + IEnumerable collection2 = ["one", "two", "three"]; // Act Action act = () => collection1.Should().NotEqual(collection2, "because we want to test the failure {0}", "message"); @@ -282,8 +282,8 @@ public void When_two_equal_collections_are_not_expected_to_be_equal_it_should_re public void When_two_equal_collections_are_not_expected_to_be_equal_it_should_throw() { // Arrange - IEnumerable collection1 = new[] { "one", "two", "three" }; - IEnumerable collection2 = new[] { "one", "two", "three" }; + IEnumerable collection1 = ["one", "two", "three"]; + IEnumerable collection2 = ["one", "two", "three"]; // Act Action act = () => collection1.Should().NotEqual(collection2); diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveCount.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveCount.cs index 73544ce47b..a52842604e 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveCount.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveCount.cs @@ -13,7 +13,7 @@ public class HaveCount public void Should_fail_when_asserting_collection_has_a_count_that_is_different_from_the_number_of_items() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act Action act = () => collection.Should().HaveCount(4); @@ -26,7 +26,7 @@ public void Should_fail_when_asserting_collection_has_a_count_that_is_different_ public void Should_succeed_when_asserting_collection_has_a_count_that_equals_the_number_of_items() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act / Assert collection.Should().HaveCount(3); @@ -36,7 +36,7 @@ public void Should_succeed_when_asserting_collection_has_a_count_that_equals_the public void Should_support_chaining_constraints_with_and() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act / Assert collection.Should() @@ -50,7 +50,7 @@ public void Should_support_chaining_constraints_with_and() public void When_collection_count_is_matched_against_a_null_predicate_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act Action act = () => collection.Should().HaveCount(null); @@ -93,7 +93,7 @@ public void When_collection_count_is_matched_and_collection_is_null_it_should_th public void When_collection_has_a_count_larger_than_the_minimum_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act / Assert collection.Should().HaveCount(c => c >= 3); @@ -104,7 +104,7 @@ public void When_collection_has_a_count_that_is_different_from_the_number_of_items_it_should_fail_with_descriptive_message_() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act Action action = () => collection.Should().HaveCount(4, "because we want to test the failure {0}", "message"); @@ -119,7 +119,7 @@ public void public void When_collection_has_a_count_that_not_matches_the_predicate_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act Action act = () => collection.Should().HaveCount(c => c >= 4, "a minimum of 4 is required"); diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveElementAt.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveElementAt.cs index a4fb37ff99..e3a2f2245e 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveElementAt.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveElementAt.cs @@ -28,7 +28,7 @@ public void When_asserting_collection_has_element_at_specific_index_against_null public void When_collection_does_not_have_an_element_at_the_specific_index_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act Action act = () => collection.Should().HaveElementAt(4, "three", "we put it {0}", "there"); @@ -42,7 +42,7 @@ public void When_collection_does_not_have_an_element_at_the_specific_index_it_sh public void When_collection_does_not_have_the_expected_element_at_specific_index_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act Action act = () => collection.Should().HaveElementAt(1, "three", "we put it {0}", "there"); @@ -56,7 +56,7 @@ public void When_collection_does_not_have_the_expected_element_at_specific_index public void When_collection_has_expected_element_at_specific_index_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act / Assert collection.Should().HaveElementAt(1, "two"); diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveSameCount.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveSameCount.cs index abc30ae906..593c1bb7e3 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveSameCount.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.HaveSameCount.cs @@ -13,7 +13,7 @@ public class HaveSameCount public void When_asserting_collections_to_have_same_count_against_an_other_null_collection_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; IEnumerable otherCollection = null; // Act @@ -29,7 +29,7 @@ public void When_asserting_collections_to_have_same_count_against_null_collectio { // Arrange IEnumerable collection = null; - IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection1 = ["one", "two", "three"]; // Act Action act = () => collection.Should().HaveSameCount(collection1, @@ -44,8 +44,8 @@ public void When_asserting_collections_to_have_same_count_against_null_collectio public void When_both_collections_do_not_have_the_same_number_of_elements_it_should_fail() { // Arrange - IEnumerable firstCollection = new[] { "one", "two", "three" }; - IEnumerable secondCollection = new[] { "four", "six" }; + IEnumerable firstCollection = ["one", "two", "three"]; + IEnumerable secondCollection = ["four", "six"]; // Act Action act = () => firstCollection.Should().HaveSameCount(secondCollection); @@ -59,8 +59,8 @@ public void When_both_collections_do_not_have_the_same_number_of_elements_it_sho public void When_both_collections_have_the_same_number_elements_it_should_succeed() { // Arrange - IEnumerable firstCollection = new[] { "one", "two", "three" }; - IEnumerable secondCollection = new[] { "four", "five", "six" }; + IEnumerable firstCollection = ["one", "two", "three"]; + IEnumerable secondCollection = ["four", "five", "six"]; // Act / Assert firstCollection.Should().HaveSameCount(secondCollection); @@ -70,8 +70,8 @@ public void When_both_collections_have_the_same_number_elements_it_should_succee public void When_comparing_item_counts_and_a_reason_is_specified_it_should_it_in_the_exception() { // Arrange - IEnumerable firstCollection = new[] { "one", "two", "three" }; - IEnumerable secondCollection = new[] { "four", "six" }; + IEnumerable firstCollection = ["one", "two", "three"]; + IEnumerable secondCollection = ["four", "six"]; // Act Action act = () => firstCollection.Should().HaveSameCount(secondCollection, "we want to test the {0}", "reason"); @@ -88,7 +88,7 @@ public class NotHaveSameCount public void When_asserting_collections_to_not_have_same_count_against_an_other_null_collection_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; IEnumerable otherCollection = null; // Act @@ -104,7 +104,7 @@ public void When_asserting_collections_to_not_have_same_count_against_null_colle { // Arrange IEnumerable collection = null; - IEnumerable collection1 = new[] { "one", "two", "three" }; + IEnumerable collection1 = ["one", "two", "three"]; // Act Action act = () => collection.Should().NotHaveSameCount(collection1, @@ -120,7 +120,7 @@ public void When_asserting_collections_to_not_have_same_count_but_both_collections_references_the_same_object_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; IEnumerable otherCollection = collection; // Act @@ -136,8 +136,8 @@ public void public void When_asserting_not_same_count_and_both_collections_have_the_same_number_elements_it_should_fail() { // Arrange - IEnumerable firstCollection = new[] { "one", "two", "three" }; - IEnumerable secondCollection = new[] { "four", "five", "six" }; + IEnumerable firstCollection = ["one", "two", "three"]; + IEnumerable secondCollection = ["four", "five", "six"]; // Act Action act = () => firstCollection.Should().NotHaveSameCount(secondCollection); @@ -151,8 +151,8 @@ public void When_asserting_not_same_count_and_both_collections_have_the_same_num public void When_asserting_not_same_count_and_collections_have_different_number_elements_it_should_succeed() { // Arrange - IEnumerable firstCollection = new[] { "one", "two", "three" }; - IEnumerable secondCollection = new[] { "four", "six" }; + IEnumerable firstCollection = ["one", "two", "three"]; + IEnumerable secondCollection = ["four", "six"]; // Act / Assert firstCollection.Should().NotHaveSameCount(secondCollection); @@ -162,8 +162,8 @@ public void When_asserting_not_same_count_and_collections_have_different_number_ public void When_comparing_not_same_item_counts_and_a_reason_is_specified_it_should_it_in_the_exception() { // Arrange - IEnumerable firstCollection = new[] { "one", "two", "three" }; - IEnumerable secondCollection = new[] { "four", "five", "six" }; + IEnumerable firstCollection = ["one", "two", "three"]; + IEnumerable secondCollection = ["four", "five", "six"]; // Act Action act = () => firstCollection.Should().NotHaveSameCount(secondCollection, "we want to test the {0}", "reason"); diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.IntersectWith.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.IntersectWith.cs index e9c9541d89..c61dfa7646 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.IntersectWith.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.IntersectWith.cs @@ -13,8 +13,8 @@ public class IntersectWith public void When_asserting_the_items_in_an_two_intersecting_collections_intersect_it_should_succeed() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - IEnumerable otherCollection = new[] { "three", "four", "five" }; + IEnumerable collection = ["one", "two", "three"]; + IEnumerable otherCollection = ["three", "four", "five"]; // Act / Assert collection.Should().IntersectWith(otherCollection); @@ -24,8 +24,8 @@ public void When_asserting_the_items_in_an_two_intersecting_collections_intersec public void When_asserting_the_items_in_an_two_non_intersecting_collections_intersect_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - IEnumerable otherCollection = new[] { "four", "five" }; + IEnumerable collection = ["one", "two", "three"]; + IEnumerable otherCollection = ["four", "five"]; // Act Action action = () => collection.Should().IntersectWith(otherCollection, "they should share items"); @@ -43,7 +43,7 @@ public class NotIntersectWith public void When_asserting_collection_to_not_intersect_with_same_collection_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; IEnumerable otherCollection = collection; // Act @@ -59,8 +59,8 @@ public void When_asserting_collection_to_not_intersect_with_same_collection_it_s public void When_asserting_the_items_in_an_two_intersecting_collections_do_not_intersect_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - IEnumerable otherCollection = new[] { "two", "three", "four" }; + IEnumerable collection = ["one", "two", "three"]; + IEnumerable otherCollection = ["two", "three", "four"]; // Act Action action = () => collection.Should().NotIntersectWith(otherCollection, "they should not share items"); @@ -76,8 +76,8 @@ public void When_asserting_the_items_in_an_two_intersecting_collections_do_not_i public void When_asserting_the_items_in_an_two_non_intersecting_collections_do_not_intersect_it_should_succeed() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; - IEnumerable otherCollection = new[] { "four", "five" }; + IEnumerable collection = ["one", "two", "three"]; + IEnumerable otherCollection = ["four", "five"]; // Act / Assert collection.Should().NotIntersectWith(otherCollection); diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.NotContainNulls.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.NotContainNulls.cs index b4ecdadc19..f55ec7d36e 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.NotContainNulls.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.NotContainNulls.cs @@ -27,7 +27,7 @@ public void When_asserting_collection_to_not_contain_nulls_but_collection_is_nul public void When_collection_contains_multiple_nulls_that_are_unexpected_it_should_throw() { // Arrange - IEnumerable collection = new[] { "", null, "", null }; + IEnumerable collection = ["", null, "", null]; // Act Action act = () => collection.Should().NotContainNulls("because they are {0}", "evil"); @@ -41,7 +41,7 @@ public void When_collection_contains_multiple_nulls_that_are_unexpected_it_shoul public void When_collection_contains_nulls_that_are_unexpected_it_should_throw() { // Arrange - IEnumerable collection = new[] { "", null }; + IEnumerable collection = ["", null]; // Act Action act = () => collection.Should().NotContainNulls("because they are {0}", "evil"); @@ -55,7 +55,7 @@ public void When_collection_contains_nulls_that_are_unexpected_it_should_throw() public void When_collection_does_not_contain_nulls_it_should_not_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three" }; + IEnumerable collection = ["one", "two", "three"]; // Act / Assert collection.Should().NotContainNulls(); diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.OnlyHaveUniqueItems.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.OnlyHaveUniqueItems.cs index c30a1bd5d5..242e08b4a3 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.OnlyHaveUniqueItems.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.OnlyHaveUniqueItems.cs @@ -13,7 +13,7 @@ public class OnlyHaveUniqueItems public void Should_succeed_when_asserting_collection_with_unique_items_contains_only_unique_items() { // Arrange - IEnumerable collection = new[] { "one", "two", "three", "four" }; + IEnumerable collection = ["one", "two", "three", "four"]; // Act / Assert collection.Should().OnlyHaveUniqueItems(); @@ -23,7 +23,7 @@ public void Should_succeed_when_asserting_collection_with_unique_items_contains_ public void When_a_collection_contains_duplicate_items_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "three", "three" }; + IEnumerable collection = ["one", "two", "three", "three"]; // Act Action act = () => collection.Should().OnlyHaveUniqueItems("{0} don't like {1}", "we", "duplicates"); @@ -37,7 +37,7 @@ public void When_a_collection_contains_duplicate_items_it_should_throw() public void When_a_collection_contains_multiple_duplicate_items_it_should_throw() { // Arrange - IEnumerable collection = new[] { "one", "two", "two", "three", "three" }; + IEnumerable collection = ["one", "two", "two", "three", "three"]; // Act Action act = () => collection.Should().OnlyHaveUniqueItems("{0} don't like {1}", "we", "duplicates"); diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.cs index 6d5b90c9a4..bf4d5fbdc5 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.cs @@ -29,11 +29,11 @@ from method in methodInfo select new { method.Name, method.ReturnType }; // Assert - var expectedTypes = new[] - { + Type[] expectedTypes = + [ typeof(AndConstraint>>), typeof(AndConstraint>) - }; + ]; methods.Should().OnlyContain(method => expectedTypes.Any(e => e.IsAssignableFrom(method.ReturnType))); } diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValues.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValues.cs index f31f4d6f3a..ec0247fb4d 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValues.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValues.cs @@ -38,7 +38,7 @@ public void When_a_dictionary_does_not_contain_a_number_of_values_it_should_thro }; // Act - Action act = () => dictionary.Should().ContainValues(new[] { "Two", "Three" }, "because {0}", "we do"); + Action act = () => dictionary.Should().ContainValues(["Two", "Three"], "because {0}", "we do"); // Assert act.Should().Throw().WithMessage( @@ -95,7 +95,7 @@ public void When_a_dictionary_contains_a_exactly_one_of_the_values_it_should_thr }; // Act - Action act = () => dictionary.Should().NotContainValues(new[] { "Two" }, "because {0}", "we do"); + Action act = () => dictionary.Should().NotContainValues(["Two"], "because {0}", "we do"); // Assert act.Should().Throw().WithMessage( @@ -113,7 +113,7 @@ public void When_a_dictionary_contains_a_number_of_values_it_should_throw_with_c }; // Act - Action act = () => dictionary.Should().NotContainValues(new[] { "Two", "Three" }, "because {0}", "we do"); + Action act = () => dictionary.Should().NotContainValues(["Two", "Three"], "because {0}", "we do"); // Assert act.Should().Throw().WithMessage( @@ -149,7 +149,7 @@ public void Null_dictionaries_do_not_contain_any_values() Action act = () => { using var _ = new AssertionScope(); - dictionary.Should().NotContainValues(new[] { "Two", "Three" }, "because {0}", "we do"); + dictionary.Should().NotContainValues(["Two", "Three"], "because {0}", "we do"); }; // Assert diff --git a/Tests/FluentAssertions.Specs/Common/ConfigurationSpecs.cs b/Tests/FluentAssertions.Specs/Common/ConfigurationSpecs.cs index 141e2bfdc2..43ed874d6d 100644 --- a/Tests/FluentAssertions.Specs/Common/ConfigurationSpecs.cs +++ b/Tests/FluentAssertions.Specs/Common/ConfigurationSpecs.cs @@ -11,7 +11,7 @@ public class ConfigurationSpecs public void Value_formatter_detection_mode_is_disabled_with_empty_store() { // Arrange - var store = new DummyConfigurationStore(new Dictionary()); + var store = new DummyConfigurationStore([]); var sut = new Configuration(store); // Act / Assert diff --git a/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs index d79684ba0f..5705d70b04 100644 --- a/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs @@ -665,8 +665,8 @@ public void When_monitoring_an_object_it_should_monitor_all_the_events_it_expose EventMetadata[] metadata = eventMonitor.MonitoredEvents; // Assert - metadata.Should().BeEquivalentTo(new[] - { + metadata.Should().BeEquivalentTo( + [ new { EventName = nameof(ClassThatRaisesEventsItself.InterfaceEvent), @@ -677,7 +677,7 @@ public void When_monitoring_an_object_it_should_monitor_all_the_events_it_expose EventName = nameof(ClassThatRaisesEventsItself.PropertyChanged), HandlerType = typeof(PropertyChangedEventHandler) } - }); + ]); } [Fact] @@ -691,14 +691,14 @@ public void When_monitoring_an_object_through_an_interface_it_should_monitor_onl EventMetadata[] metadata = monitor.MonitoredEvents; // Assert - metadata.Should().BeEquivalentTo(new[] - { + metadata.Should().BeEquivalentTo( + [ new { EventName = nameof(IEventRaisingInterface.InterfaceEvent), HandlerType = typeof(EventHandler) } - }); + ]); } #if NETFRAMEWORK // DefineDynamicAssembly is obsolete in .NET Core @@ -804,8 +804,8 @@ public void When_an_object_raises_two_events_it_should_provide_the_data_about_th eventSource.RaiseNonConventionalEvent("first", 123, "third"); // Assert - monitor.OccurredEvents.Should().BeEquivalentTo(new[] - { + monitor.OccurredEvents.Should().BeEquivalentTo( + [ new { EventName = "PropertyChanged", @@ -818,7 +818,7 @@ public void When_an_object_raises_two_events_it_should_provide_the_data_about_th TimestampUtc = utcNow, Parameters = new object[] { "first", 123, "third" } } - }, o => o.WithStrictOrdering()); + ], o => o.WithStrictOrdering()); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs index eeff68e60b..50fbce28d8 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs @@ -213,18 +213,18 @@ public async Task When_the_expected_exception_is_not_wrapped_on_UI_thread_async_ public static TheoryData, Exception> AggregateExceptionTestData() { - var tasks = new[] - { + Func[] tasks = + [ AggregateExceptionWithLeftNestedException, AggregateExceptionWithRightNestedException - }; + ]; - var types = new Exception[] - { + Exception[] types = + [ new AggregateException(), new ArgumentNullException(), new InvalidOperationException() - }; + ]; var data = new TheoryData, Exception>(); diff --git a/Tests/FluentAssertions.Specs/Exceptions/ExceptionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/ExceptionAssertionSpecs.cs index d55e32acc4..ed8b09b890 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/ExceptionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/ExceptionAssertionSpecs.cs @@ -45,18 +45,18 @@ public void When_the_expected_exception_is_not_wrapped_it_should_fail(Action public static TheoryData AggregateExceptionTestData() { - var tasks = new[] - { + Action[] tasks = + [ AggregateExceptionWithLeftNestedException, AggregateExceptionWithRightNestedException - }; + ]; - var types = new Exception[] - { + Exception[] types = + [ new AggregateException(), new ArgumentNullException(), new InvalidOperationException() - }; + ]; var data = new TheoryData(); diff --git a/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs index b9216b09ac..9933c52a5c 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs @@ -68,18 +68,18 @@ public void When_the_expected_exception_is_not_wrapped_it_should_fail(Func, Exception> AggregateExceptionTestData() { - var tasks = new[] - { + Func[] tasks = + [ AggregateExceptionWithLeftNestedException, AggregateExceptionWithRightNestedException - }; + ]; - var types = new Exception[] - { + Exception[] types = + [ new AggregateException(), new ArgumentNullException(), new InvalidOperationException() - }; + ]; var data = new TheoryData, Exception>(); diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeOneOf.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeOneOf.cs index 60fc3abc32..d60ab13c0d 100644 --- a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeOneOf.cs +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.BeOneOf.cs @@ -1,5 +1,5 @@ using System; -using System.Linq; +using System.Collections.Generic; using FluentAssertions.Extensions; using Xunit; using Xunit.Sdk; @@ -51,7 +51,7 @@ public void When_a_value_is_one_of_the_specified_enumerable_values_follow_up_ass { // Arrange var value = new DateTimeOffset(31.December(2016), 1.Hours()); - var expected = new[] { value, value + 1.Hours() }.AsEnumerable(); + IEnumerable expected = [value, value + 1.Hours()]; // Act / Assert value.Should().BeOneOf(expected) @@ -63,7 +63,7 @@ public void When_a_value_is_one_of_the_specified_nullable_enumerable_follow_up_a { // Arrange var value = new DateTimeOffset(31.December(2016), 1.Hours()); - var expected = new DateTimeOffset?[] { null, value, value + 1.Hours() }.AsEnumerable(); + IEnumerable expected = [null, value, value + 1.Hours()]; // Act / Assert value.Should().BeOneOf(expected) diff --git a/Tests/FluentAssertions.Specs/Primitives/EnumAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/EnumAssertionSpecs.cs index e8240e41fa..b7ced5ff5e 100644 --- a/Tests/FluentAssertions.Specs/Primitives/EnumAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/EnumAssertionSpecs.cs @@ -769,7 +769,7 @@ public void Throws_when_the_enums_is_not_one_of_the_expected_enums() // Act / Assert Action act = () => - flags.Should().BeOneOf(new[] { BindingFlags.Public, BindingFlags.ExactBinding }, "that's what we need"); + flags.Should().BeOneOf([BindingFlags.Public, BindingFlags.ExactBinding], "that's what we need"); act.Should() .Throw() diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOneOf.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOneOf.cs index d6be143328..d66a82f1d2 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOneOf.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOneOf.cs @@ -32,7 +32,7 @@ public void When_a_value_is_not_one_of_the_specified_values_it_should_throw_with // Act Action act = () => - value.Should().BeOneOf(new[] { new ClassWithCustomEqualMethod(4), new ClassWithCustomEqualMethod(5) }, + value.Should().BeOneOf([new ClassWithCustomEqualMethod(4), new ClassWithCustomEqualMethod(5)], "because those are the valid values"); // Assert @@ -62,7 +62,7 @@ public void An_untyped_value_is_one_of_the_specified_values() object value = new SomeClass(5); // Act / Assert - value.Should().BeOneOf(new[] { new SomeClass(4), new SomeClass(5) }, new SomeClassEqualityComparer()); + value.Should().BeOneOf([new SomeClass(4), new SomeClass(5)], new SomeClassEqualityComparer()); } [Fact] @@ -72,7 +72,7 @@ public void A_typed_value_is_one_of_the_specified_values() var value = new SomeClass(5); // Act / Assert - value.Should().BeOneOf(new[] { new SomeClass(4), new SomeClass(5) }, new SomeClassEqualityComparer()); + value.Should().BeOneOf([new SomeClass(4), new SomeClass(5)], new SomeClassEqualityComparer()); } [Fact] @@ -82,7 +82,7 @@ public void An_untyped_value_is_not_one_of_the_specified_values() object value = new SomeClass(3); // Act - Action act = () => value.Should().BeOneOf(new[] { new SomeClass(4), new SomeClass(5) }, + Action act = () => value.Should().BeOneOf([new SomeClass(4), new SomeClass(5)], new SomeClassEqualityComparer(), "I said so"); // Assert @@ -110,7 +110,7 @@ public void A_typed_value_is_not_one_of_the_specified_values() var value = new SomeClass(3); // Act - Action act = () => value.Should().BeOneOf(new[] { new SomeClass(4), new SomeClass(5) }, + Action act = () => value.Should().BeOneOf([new SomeClass(4), new SomeClass(5)], new SomeClassEqualityComparer(), "I said so"); // Assert @@ -138,7 +138,7 @@ public void A_typed_value_is_not_the_same_type_as_the_specified_values() var value = new ClassWithCustomEqualMethod(3); // Act - Action act = () => value.Should().BeOneOf(new[] { new SomeClass(4), new SomeClass(5) }, + Action act = () => value.Should().BeOneOf([new SomeClass(4), new SomeClass(5)], new SomeClassEqualityComparer(), "I said so"); // Assert diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeOneOf.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeOneOf.cs index 39d7e24c2a..7cf04c3d4b 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeOneOf.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeOneOf.cs @@ -32,7 +32,7 @@ public void When_a_value_is_not_one_of_the_specified_values_it_should_throw_with string value = "abc"; // Act - Action action = () => value.Should().BeOneOf(new[] { "def", "xyz" }, "because those are the valid values"); + Action action = () => value.Should().BeOneOf(["def", "xyz"], "because those are the valid values"); // Assert action.Should().Throw() diff --git a/Tests/FluentAssertions.Specs/TypeEnumerableExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/TypeEnumerableExtensionsSpecs.cs index 41e1fdce5b..5a3ea26cd5 100644 --- a/Tests/FluentAssertions.Specs/TypeEnumerableExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/TypeEnumerableExtensionsSpecs.cs @@ -13,10 +13,10 @@ public class TypeEnumerableExtensionsSpecs [Fact] public void When_selecting_types_that_decorated_with_attribute_it_should_return_the_correct_type() { - var types = new[] - { + Type[] types = + [ typeof(JustAClass), typeof(ClassWithSomeAttribute), typeof(ClassDerivedFromClassWithSomeAttribute) - }; + ]; types.ThatAreDecoratedWith() .Should() @@ -27,10 +27,10 @@ public void When_selecting_types_that_decorated_with_attribute_it_should_return_ [Fact] public void When_selecting_types_that_decorated_with_attribute_or_inherit_it_should_return_the_correct_type() { - var types = new[] - { + Type[] types = + [ typeof(JustAClass), typeof(ClassWithSomeAttribute), typeof(ClassDerivedFromClassWithSomeAttribute) - }; + ]; types.ThatAreDecoratedWithOrInherit() .Should() @@ -42,10 +42,10 @@ public void When_selecting_types_that_decorated_with_attribute_or_inherit_it_sho [Fact] public void When_selecting_types_that_not_decorated_with_attribute_it_should_return_the_correct_type() { - var types = new[] - { + Type[] types = + [ typeof(JustAClass), typeof(ClassWithSomeAttribute), typeof(ClassDerivedFromClassWithSomeAttribute) - }; + ]; types.ThatAreNotDecoratedWith() .Should() @@ -57,10 +57,10 @@ public void When_selecting_types_that_not_decorated_with_attribute_it_should_ret [Fact] public void When_selecting_types_that_not_decorated_with_attribute_or_inherit_it_should_return_the_correct_type() { - var types = new[] - { + Type[] types = + [ typeof(JustAClass), typeof(ClassWithSomeAttribute), typeof(ClassDerivedFromClassWithSomeAttribute) - }; + ]; types.ThatAreNotDecoratedWithOrInherit() .Should() @@ -171,7 +171,7 @@ public void When_selecting_types_with_predicate_it_should_return_the_correct_typ [Fact] public void When_unwrap_task_types_it_should_return_the_correct_type() { - var types = new[] { typeof(Task), typeof(List) }; + Type[] types = [typeof(Task), typeof(List)]; types.UnwrapTaskTypes() .Should() @@ -183,7 +183,7 @@ public void When_unwrap_task_types_it_should_return_the_correct_type() [Fact] public void When_unwrap_enumerable_types_it_should_return_the_correct_type() { - var types = new[] { typeof(Task), typeof(List) }; + Type[] types = [typeof(Task), typeof(List)]; types.UnwrapEnumerableTypes() .Should() diff --git a/Tests/FluentAssertions.Specs/Types/PropertyInfoSelectorSpecs.cs b/Tests/FluentAssertions.Specs/Types/PropertyInfoSelectorSpecs.cs index 4517255b21..7eb8480a9d 100644 --- a/Tests/FluentAssertions.Specs/Types/PropertyInfoSelectorSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/PropertyInfoSelectorSpecs.cs @@ -344,11 +344,11 @@ public void When_selecting_properties_return_types_it_should_return_the_correct_ // Assert returnTypes.Should() - .BeEquivalentTo(new[] - { + .BeEquivalentTo( + [ typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(int), typeof(int), typeof(int), typeof(int) - }); + ]); } public class ThatArePublicOrInternal diff --git a/Tests/FluentAssertions.Specs/Types/TypeSelectorAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Types/TypeSelectorAssertionSpecs.cs index cbe7bc2c7f..38cc5e931b 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeSelectorAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeSelectorAssertionSpecs.cs @@ -16,10 +16,10 @@ public class BeSealed public void When_all_types_are_sealed_it_succeeds() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(Sealed) - }); + ]); // Act / Assert types.Should().BeSealed(); @@ -29,11 +29,11 @@ public void When_all_types_are_sealed_it_succeeds() public void When_any_type_is_not_sealed_it_fails_with_a_meaningful_message() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(Sealed), typeof(Abstract) - }); + ]); // Act Action act = () => types.Should().BeSealed("we want to test the failure {0}", "message"); @@ -51,10 +51,10 @@ public class NotBeSealed public void When_all_types_are_not_sealed_it_succeeds() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(Abstract) - }); + ]); // Act / Assert types.Should().NotBeSealed(); @@ -64,11 +64,11 @@ public void When_all_types_are_not_sealed_it_succeeds() public void When_any_type_is_sealed_it_fails_with_a_meaningful_message() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(Abstract), typeof(Sealed) - }); + ]); // Act Action act = () => types.Should().NotBeSealed("we want to test the failure {0}", "message"); @@ -85,10 +85,10 @@ public class BeDecoratedWith public void When_asserting_a_selection_of_decorated_types_is_decorated_with_an_attribute_it_succeeds() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassWithAttribute) - }); + ]); // Act Action act = () => @@ -102,12 +102,12 @@ public void When_asserting_a_selection_of_decorated_types_is_decorated_with_an_a public void When_asserting_a_selection_of_non_decorated_types_is_decorated_with_an_attribute_it_fails() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassWithAttribute), typeof(ClassWithoutAttribute), typeof(OtherClassWithoutAttribute) - }); + ]); // Act Action act = () => @@ -140,12 +140,12 @@ public void When_injecting_a_null_predicate_into_TypeSelector_BeDecoratedWith_it public void When_asserting_a_selection_of_types_with_unexpected_attribute_property_it_fails() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassWithAttribute), typeof(ClassWithoutAttribute), typeof(OtherClassWithoutAttribute) - }); + ]); // Act Action act = () => @@ -168,10 +168,10 @@ public class BeDecoratedWithOrInherit public void When_asserting_a_selection_of_decorated_types_inheriting_an_attribute_it_succeeds() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassWithInheritedAttribute) - }); + ]); // Act Action act = () => @@ -185,12 +185,12 @@ public void When_asserting_a_selection_of_decorated_types_inheriting_an_attribut public void When_asserting_a_selection_of_non_decorated_types_inheriting_an_attribute_it_fails() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassWithAttribute), typeof(ClassWithoutAttribute), typeof(OtherClassWithoutAttribute) - }); + ]); // Act Action act = () => @@ -224,13 +224,13 @@ public void When_asserting_a_selection_of_types_with_some_inheriting_attributes_with_unexpected_attribute_property_it_fails() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassWithAttribute), typeof(ClassWithInheritedAttribute), typeof(ClassWithoutAttribute), typeof(OtherClassWithoutAttribute) - }); + ]); // Act Action act = () => @@ -253,11 +253,11 @@ public class NotBeDecoratedWith public void When_asserting_a_selection_of_non_decorated_types_is_not_decorated_with_an_attribute_it_succeeds() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassWithoutAttribute), typeof(OtherClassWithoutAttribute) - }); + ]); // Act Action act = () => @@ -271,11 +271,11 @@ public void When_asserting_a_selection_of_non_decorated_types_is_not_decorated_w public void When_asserting_a_selection_of_decorated_types_is_not_decorated_with_an_attribute_it_fails() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassWithoutAttribute), typeof(ClassWithAttribute) - }); + ]); // Act Action act = () => @@ -307,11 +307,11 @@ public void When_injecting_a_null_predicate_into_TypeSelector_NotBeDecoratedWith public void When_asserting_a_selection_of_types_with_unexpected_attribute_and_unexpected_attribute_property_it_fails() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassWithoutAttribute), typeof(ClassWithAttribute) - }); + ]); // Act Action act = () => @@ -334,11 +334,11 @@ public class NotBeDecoratedWithOrInherit public void When_asserting_a_selection_of_non_decorated_types_does_not_inherit_an_attribute_it_succeeds() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassWithoutAttribute), typeof(OtherClassWithoutAttribute) - }); + ]); // Act Action act = () => @@ -352,11 +352,11 @@ public void When_asserting_a_selection_of_non_decorated_types_does_not_inherit_a public void When_asserting_a_selection_of_decorated_types_does_not_inherit_an_attribute_it_fails() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassWithoutAttribute), typeof(ClassWithInheritedAttribute) - }); + ]); // Act Action act = () => @@ -437,12 +437,12 @@ public void When_a_type_is_in_the_expected_namespace_it_should_not_throw() public void When_a_type_is_not_in_the_expected_namespace_it_should_throw() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassInDummyNamespace), typeof(ClassNotInDummyNamespace), typeof(OtherClassNotInDummyNamespace) - }); + ]); // Act Action act = () => @@ -488,12 +488,12 @@ public void When_a_type_in_the_global_namespace_is_not_in_the_expected_namespace public void When_a_type_is_not_in_the_expected_global_namespace_it_should_throw() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassInDummyNamespace), typeof(ClassNotInDummyNamespace), typeof(OtherClassNotInDummyNamespace) - }); + ]); // Act Action act = () => types.Should().BeInNamespace(null); @@ -539,12 +539,12 @@ public void When_a_type_is_not_in_the_unexpected_parent_namespace_it_should_not_ public void When_a_type_is_in_the_unexpected_namespace_it_should_throw() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassInDummyNamespace), typeof(ClassNotInDummyNamespace), typeof(OtherClassNotInDummyNamespace) - }); + ]); // Act Action act = () => @@ -617,12 +617,12 @@ public void When_a_type_is_exactly_under_the_expected_global_namespace_it_should public void When_a_type_is_under_the_expected_global_namespace_it_should_not_throw() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassInDummyNamespace), typeof(ClassNotInDummyNamespace), typeof(OtherClassNotInDummyNamespace) - }); + ]); // Act Action act = () => types.Should().BeUnderNamespace(null); @@ -651,11 +651,11 @@ public void When_a_type_only_shares_a_prefix_with_the_expected_namespace_it_shou public void When_asserting_a_selection_of_types_not_under_a_namespace_is_under_that_namespace_it_fails() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassInDummyNamespace), typeof(ClassInInnerDummyNamespace) - }); + ]); // Act Action act = () => @@ -675,12 +675,12 @@ public class NotBeUnderNamespace public void When_a_types_is_not_under_the_unexpected_namespace_it_should_not_throw() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassInDummyNamespace), typeof(ClassNotInDummyNamespace), typeof(OtherClassNotInDummyNamespace) - }); + ]); // Act Action act = () => @@ -760,12 +760,12 @@ public void When_a_type_is_under_the_unexpected_global_namespace_it_should_throw public void When_a_type_is_under_the_unexpected_parent_global_namespace_it_should_throw() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassInDummyNamespace), typeof(ClassNotInDummyNamespace), typeof(OtherClassNotInDummyNamespace) - }); + ]); // Act Action act = () => types.Should().NotBeUnderNamespace(null); @@ -797,10 +797,10 @@ public class Miscellaneous public void When_accidentally_using_equals_it_should_throw_a_helpful_error() { // Arrange - var types = new TypeSelector(new[] - { + var types = new TypeSelector( + [ typeof(ClassWithAttribute) - }); + ]); // Act var action = () => types.Should().Equals(null); From e1f7606b0c9c0e337d690fce75fdfffcb8261f5b Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Thu, 21 Dec 2023 22:47:00 +0100 Subject: [PATCH 226/845] Use spread operator --- .../Common/TypeMemberReflector.cs | 2 +- .../AssertionExtensionsSpecs.cs | 30 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Src/FluentAssertions/Common/TypeMemberReflector.cs b/Src/FluentAssertions/Common/TypeMemberReflector.cs index 5f1d685f64..e4e899a877 100644 --- a/Src/FluentAssertions/Common/TypeMemberReflector.cs +++ b/Src/FluentAssertions/Common/TypeMemberReflector.cs @@ -18,7 +18,7 @@ public TypeMemberReflector(Type typeToReflect, MemberVisibility visibility) { Properties = LoadProperties(typeToReflect, visibility); Fields = LoadFields(typeToReflect, visibility); - Members = Properties.Concat(Fields).ToArray(); + Members = [.. Properties, .. Fields]; } public MemberInfo[] Members { get; } diff --git a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs index b77309a2b8..b8f66ddf93 100644 --- a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs @@ -129,21 +129,21 @@ public void Should_methods_have_a_matching_overload_to_guard_against_chaining_an .Where(m => m.Name == "Should") .ToList(); - List realOverloads = shouldOverloads - .Where(m => !IsGuardOverload(m)) - .Select(t => GetMostParentType(t.ReturnType)) - .Distinct() - .Concat(new[] - { - // @jnyrup: DateTimeRangeAssertions and DateTimeOffsetRangeAssertions are manually added here, - // because they expose AndConstraints, - // and hence should have a guarding Should(DateTimeRangeAssertions _) overloads, - // but they do not have a regular Should() overload, - // as they are always constructed through the fluent API. - typeof(DateTimeRangeAssertions<>), - typeof(DateTimeOffsetRangeAssertions<>), - }) - .ToList(); + List realOverloads = + [ + ..shouldOverloads + .Where(m => !IsGuardOverload(m)) + .Select(t => GetMostParentType(t.ReturnType)) + .Distinct(), + + // @jnyrup: DateTimeRangeAssertions and DateTimeOffsetRangeAssertions are manually added here, + // because they expose AndConstraints, + // and hence should have a guarding Should(DateTimeRangeAssertions _) overloads, + // but they do not have a regular Should() overload, + // as they are always constructed through the fluent API. + typeof(DateTimeRangeAssertions<>), + typeof(DateTimeOffsetRangeAssertions<>) + ]; List fakeOverloads = shouldOverloads .Where(m => IsGuardOverload(m)) From 6f73a4978be31d491b3a1bd4352e3ce7b02193e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 16:02:22 +0000 Subject: [PATCH 227/845] Bump Meziantou.Analyzer from 2.0.127 to 2.0.132 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.127 to 2.0.132. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.127...2.0.132) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 4001b419f7..7707e2941e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 80038360e97960f2d730b451c901acd86bccb0aa Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Thu, 4 Jan 2024 20:44:35 +0100 Subject: [PATCH 228/845] Disable MA0147 for intentional use of async+void --- .../Exceptions/AsyncFunctionExceptionAssertionSpecs.cs | 2 ++ Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs index 50fbce28d8..5f1eb7ab67 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs @@ -1022,6 +1022,7 @@ public async Task When_async_method_does_not_throw_the_expected_exception_it_sho await action.Should().ThrowAsync().WithMessage("*InvalidOperation*Argument*"); } +#pragma warning disable MA0147 [Fact] public void When_asserting_async_void_method_should_throw_it_should_fail() { @@ -1077,6 +1078,7 @@ public void When_asserting_async_void_method_should_not_throw_specific_exception // Assert action.Should().Throw("*async*void*"); } +#pragma warning restore MA0147 [Fact] public async Task When_a_method_throws_with_a_matching_parameter_name_it_should_succeed() diff --git a/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs index 2d5ebaeecc..04013c0a39 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs @@ -104,7 +104,7 @@ public void When_subject_is_null_when_it_should_not_throw_it_should_throw() .Where(e => !e.Message.Contains("NullReferenceException")); } -#pragma warning disable CS1998 +#pragma warning disable CS1998, MA0147 [Fact] public void When_subject_is_async_it_should_throw() { @@ -119,7 +119,7 @@ public void When_subject_is_async_it_should_throw() action.Should().Throw() .WithMessage("Cannot use action assertions on an async void method.*"); } -#pragma warning restore CS1998 +#pragma warning restore CS1998, MA0147 [Fact] public void When_wait_time_is_negative_it_should_throw() From d2dbf777cd8def2af0868ab62307828854dd5f3b Mon Sep 17 00:00:00 2001 From: Louis Zanella Date: Fri, 5 Jan 2024 02:17:56 -0500 Subject: [PATCH 229/845] BeEmpty() materializes IEnumerable only once, even on failure (#2530) * BeEmpty() materializes IEnumerable only once, even on failure - Make BeEmpty() materialize only the first item, as no further processing is needed for validation - The error message now mentions "but found at least 1 item" and outputs the said item * Tweak error message & fix tests * Make similar changes for BeNullOrEmpty * Add test, as per request --- .../Collections/GenericCollectionAssertions.cs | 14 ++++++++------ .../CollectionAssertionSpecs.BeEmpty.cs | 17 ++++++++++++++++- .../CollectionAssertionSpecs.BeNullOrEmpty.cs | 17 ++++++++++++++++- ...cCollectionAssertionOfStringSpecs.BeEmpty.cs | 2 +- .../GenericDictionaryAssertionSpecs.BeEmpty.cs | 2 +- .../Primitives/ReferenceTypeAssertionsSpecs.cs | 5 ++--- 6 files changed, 44 insertions(+), 13 deletions(-) diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index d9e836c44c..42cef42b33 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -285,15 +285,16 @@ public AndConstraint AllBeOfType(Type expectedType, string because /// public AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { + var singleItemArray = Subject?.Take(1).ToArray(); Execute.Assertion .BecauseOf(because, becauseArgs) .WithExpectation("Expected {context:collection} to be empty{reason}, ") - .Given(() => Subject) + .Given(() => singleItemArray) .ForCondition(subject => subject is not null) .FailWith("but found .") .Then - .ForCondition(subject => !subject.Any()) - .FailWith("but found {0}.", Subject) + .ForCondition(subject => subject.Length == 0) + .FailWith("but found at least one item {0}.", singleItemArray) .Then .ClearExpectation(); @@ -638,13 +639,14 @@ public AndConstraint> BeInDescendingOrder(Func public AndConstraint BeNullOrEmpty(string because = "", params object[] becauseArgs) { - var nullOrEmpty = Subject is null || !Subject.Any(); + var singleItemArray = Subject?.Take(1).ToArray(); + var nullOrEmpty = singleItemArray is null || singleItemArray.Length == 0; Execute.Assertion.ForCondition(nullOrEmpty) .BecauseOf(because, becauseArgs) .FailWith( - "Expected {context:collection} to be null or empty{reason}, but found {0}.", - Subject); + "Expected {context:collection} to be null or empty{reason}, but found at least one item {0}.", + singleItemArray); return new AndConstraint((TAssertions)this); } diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEmpty.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEmpty.cs index 9fc68015bc..caf3daec76 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEmpty.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEmpty.cs @@ -35,7 +35,7 @@ public void When_collection_is_not_empty_unexpectedly_it_should_throw() // Assert act.Should().Throw() - .WithMessage("*to be empty because that's what we expect, but found*1*2*3*"); + .WithMessage("*to be empty because that's what we expect, but found at least one item*1*"); } [Fact] @@ -119,6 +119,21 @@ public void When_asserting_collection_to_be_empty_it_should_enumerate_only_once( collection.GetEnumeratorCallCount.Should().Be(1); } + [Fact] + public void When_asserting_non_empty_collection_is_empty_it_should_enumerate_only_once() + { + // Arrange + var collection = new CountingGenericEnumerable([1, 2, 3]); + + // Act + Action act = () => collection.Should().BeEmpty(); + + // Assert + act.Should().Throw() + .WithMessage("*to be empty, but found at least one item {1}."); + collection.GetEnumeratorCallCount.Should().Be(1); + } + [Fact] public void When_asserting_collection_to_not_be_empty_but_collection_is_null_it_should_throw() { diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeNullOrEmpty.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeNullOrEmpty.cs index d4b3f7ef65..46c06c14af 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeNullOrEmpty.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeNullOrEmpty.cs @@ -46,7 +46,7 @@ public void // Assert act.Should().Throw() .WithMessage( - "Expected collection to be null or empty because we want to test the failure message, but found {1, 2, 3}."); + "Expected collection to be null or empty because we want to test the failure message, but found at least one item {1}."); } [Fact] @@ -61,6 +61,21 @@ public void When_asserting_collection_to_be_null_or_empty_it_should_enumerate_on // Assert collection.GetEnumeratorCallCount.Should().Be(1); } + + [Fact] + public void When_asserting_non_empty_collection_is_null_or_empty_it_should_enumerate_only_once() + { + // Arrange + var collection = new CountingGenericEnumerable([1, 2, 3]); + + // Act + Action act = () => collection.Should().BeNullOrEmpty(); + + // Assert + act.Should().Throw() + .WithMessage("*to be null or empty, but found at least one item {1}."); + collection.GetEnumeratorCallCount.Should().Be(1); + } } public class NotBeNullOrEmpty diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEmpty.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEmpty.cs index 39dab11a47..d51df7c328 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEmpty.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEmpty.cs @@ -59,7 +59,7 @@ public void When_the_collection_is_not_empty_unexpectedly_it_should_throw() act .Should().Throw() .WithMessage( - "Expected collection to be empty because we want to test the failure message, but found*one*two*three*"); + "Expected collection to be empty because we want to test the failure message, but found at least one item*one*"); } } diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.BeEmpty.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.BeEmpty.cs index 1a388efd45..651fe9151f 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.BeEmpty.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.BeEmpty.cs @@ -50,7 +50,7 @@ public void Should_fail_with_descriptive_message_when_asserting_dictionary_with_ // Assert act.Should().Throw() .WithMessage( - "Expected dictionary to be empty because we want to test the failure message, but found {[1] = \"One\"}."); + "Expected dictionary to be empty because we want to test the failure message, but found at least one item {[1, One]}."); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs index 79deff5d52..1f2369981a 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs @@ -56,14 +56,13 @@ Expected subject to refer to [Fact] public void When_a_derived_class_has_longer_formatting_than_the_base_class() { - var subject = new SimpleComplexBase[] { new Simple(), new Complex("goodbye") }; + var subject = new SimpleComplexBase[] { new Complex("goodbye"), new Simple() }; Action act = () => subject.Should().BeEmpty(); act.Should().Throw() .WithMessage( """ - Expected subject to be empty, but found + Expected subject to be empty, but found at least one item { - Simple(Hello), FluentAssertions.Specs.Primitives.Complex { Statement = "goodbye" From 28c4fc25d27c65e103f3389f2d2b7e54e8203548 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Fri, 5 Jan 2024 16:04:20 +0100 Subject: [PATCH 230/845] Bump yarn to latest 8 --- yarn.lock | 216 +++++++++++++++++++++++++++--------------------------- 1 file changed, 107 insertions(+), 109 deletions(-) diff --git a/yarn.lock b/yarn.lock index 218580b319..5f908887e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@cspell/cspell-bundled-dicts@8.3.1": - version "8.3.1" - resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.3.1.tgz#342f205d79ba4c074023d67f30531dece66e37b6" - integrity sha512-pITQe2B9CGm7WFe/BsKyzOlBtuTRtP4uSC6baijCOJX5xduTCfJsS/l4iX3oXNx2ewYny+K3yUE9KRI0QPKtQA== +"@cspell/cspell-bundled-dicts@8.3.2": + version "8.3.2" + resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.3.2.tgz#649ed168a72cb49a7d83f3840ab6933a8beba68d" + integrity sha512-3ubOgz1/MDixJbq//0rQ2omB3cSdhVJDviERZeiREGz4HOq84aaK1Fqbw5SjNZHvhpoq+AYXm6kJbIAH8YhKgg== dependencies: "@cspell/dict-ada" "^4.0.2" "@cspell/dict-aws" "^4.0.1" @@ -56,34 +56,34 @@ "@cspell/dict-typescript" "^3.1.2" "@cspell/dict-vue" "^3.0.0" -"@cspell/cspell-json-reporter@8.3.1": - version "8.3.1" - resolved "https://registry.yarnpkg.com/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.3.1.tgz#fd3da0ca08c5afe86a92f9552bac6dc742e258f0" - integrity sha512-E7kO01UnKD/FUMq53ehNBrksHR3mfLv8lShR2Xa6pnHmhiciqMhQuBkbv9/9ReSn7+E8ZAqrrl+5hNr3Sj3mUA== +"@cspell/cspell-json-reporter@8.3.2": + version "8.3.2" + resolved "https://registry.yarnpkg.com/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.3.2.tgz#314f7b7deb465a7b94b03405c3498d9b96d410ab" + integrity sha512-gHSz4jXMJPcxx+lOGfXhHuoyenAWQ8PVA/atHFrWYKo1LzKTbpkEkrsDnlX8QNJubc3EMH63Uy+lOIaFDVyHiQ== dependencies: - "@cspell/cspell-types" "8.3.1" + "@cspell/cspell-types" "8.3.2" -"@cspell/cspell-pipe@8.3.1": - version "8.3.1" - resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-8.3.1.tgz#3f68ff141811dbb3465deb612d24db837318d186" - integrity sha512-aq5qgB0w9Gm1//WpA1EuLhwDFc74b3UWKdpE4QHdaoWLCNyly4xW9DTpVLU9eMhtpsJl6q4+pnlsqdJ95LsDXg== +"@cspell/cspell-pipe@8.3.2": + version "8.3.2" + resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-8.3.2.tgz#72b986c6c03ed9894d5ddafdcb435973336216b9" + integrity sha512-GZmDwvQGOjQi3IjD4k9xXeVTDANczksOsgVKb3v2QZk9mR4Qj8c6Uarjd4AgSiIhu/wBliJfzr5rWFJu4X2VfQ== -"@cspell/cspell-resolver@8.3.1": - version "8.3.1" - resolved "https://registry.yarnpkg.com/@cspell/cspell-resolver/-/cspell-resolver-8.3.1.tgz#444dd61987ae2a39bc48a8d5d2a734334a666273" - integrity sha512-IbTiJ2MRF24WDsgzc31ZH1I5eyZNLOoKqM9fHyYaIilVLN28SlLFtjS4dOJJLpMWJeCdIYrQcu2r5ZsNc6nL8A== +"@cspell/cspell-resolver@8.3.2": + version "8.3.2" + resolved "https://registry.yarnpkg.com/@cspell/cspell-resolver/-/cspell-resolver-8.3.2.tgz#e4a981ed8fc2029804d8fa5847e47934a26c5c86" + integrity sha512-w2Tmb95bzdEz9L4W5qvsP5raZbyEzKL7N2ksU/+yh8NEJcTuExmAl/nMnb3aIk7m2b+kPHnMOcJuwfUMLmyv4A== dependencies: global-directory "^4.0.1" -"@cspell/cspell-service-bus@8.3.1": - version "8.3.1" - resolved "https://registry.yarnpkg.com/@cspell/cspell-service-bus/-/cspell-service-bus-8.3.1.tgz#9862e3c9db9b3c408c27d859b1b7369a828d7b23" - integrity sha512-GkhG2RroZ+0TKLAvlvHbQAes8jHUvhvxTy1jbI6GK9vANUOw9kwJeSmvfzKAVbcNNzkMFF7ALiUIojMIpXww1g== +"@cspell/cspell-service-bus@8.3.2": + version "8.3.2" + resolved "https://registry.yarnpkg.com/@cspell/cspell-service-bus/-/cspell-service-bus-8.3.2.tgz#b1c6620232c22c0a7c8b68051e524963285f4768" + integrity sha512-skTHNyVi74//W/O+f4IauDhm6twA9S2whkylonsIzPxEl4Pn3y2ZEMXNki/MWUwZfDIzKKSxlcREH61g7zCvhg== -"@cspell/cspell-types@8.3.1": - version "8.3.1" - resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-8.3.1.tgz#92f043bb91df97a4737acdf77f69920d51e0ba82" - integrity sha512-M2qsbEFS07NURgMH8XPZPAtRsbcMZQuclJ+3gplkZSWHurYtf+WWXMI+D/LcvWv1pEjTSDjI1tvtpFnqB5TnhQ== +"@cspell/cspell-types@8.3.2": + version "8.3.2" + resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-8.3.2.tgz#35a6d0f1a4c7c2a8a5275bcd41dacf85618f44c3" + integrity sha512-qS/gWd9ItOrN6ZX5pwC9lJjnBoyiAyhxYq0GUXuV892LQvwrBmECGk6KhsA1lPW7JJS7o57YTAS1jmXnmXMEpg== "@cspell/dict-ada@^4.0.2": version "4.0.2" @@ -106,9 +106,9 @@ integrity sha512-F/8XnkqjU7jmSDAcD3LSSX+WxCVUWPssqlO4lzGMIK3MNIUt+d48eSIt3pFAIB/Z9y0ojoLHUtWX9HJ1ZtGrXQ== "@cspell/dict-cpp@^5.0.10": - version "5.0.10" - resolved "https://registry.yarnpkg.com/@cspell/dict-cpp/-/dict-cpp-5.0.10.tgz#08c3eb438b631dd3f0fc04f5a6d4b6cab87c8d9b" - integrity sha512-WCRuDrkFdpmeIR6uXQYKU9loMQKNFS4bUhtHdv5fu4qVyJSh3k/kgmtTm1h1BDTj8EwPRc/RGxS+9Z3b2mnabA== + version "5.1.1" + resolved "https://registry.yarnpkg.com/@cspell/dict-cpp/-/dict-cpp-5.1.1.tgz#f3628a10355e217dc5ba1f5a26e6d9e1f177e6ea" + integrity sha512-Qy9fNsR/5RcQ6G85gDKFjvzh0AdgAilLQeSXPtqY21Fx1kCjUqdVVJYMmHUREgcxH6ptAxtn5knTWU4PIhQtOw== "@cspell/dict-cryptocurrencies@^5.0.0": version "5.0.0" @@ -303,9 +303,9 @@ integrity sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ== "@cspell/dict-software-terms@^3.3.15": - version "3.3.15" - resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-3.3.15.tgz#713f748a6276788db01e75e07950c867bc285fca" - integrity sha512-1qqMGFi1TUNq9gQj4FTLPTlqVzQLXrj80MsKoXVpysr+823kMWesQAjqHiPg+MYsQ3DlTcpGWcjq/EbYonqueQ== + version "3.3.16" + resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-3.3.16.tgz#c088501687e6a19625800cc612dae8aebaf0f086" + integrity sha512-ixorEP80LGxAU+ODVSn/CYIDjV0XAlZ2VrBu7CT+PwUFJ7h8o3JX1ywKB4qnt0hHru3JjWFtBoBThmZdrXnREQ== "@cspell/dict-sql@^2.1.3": version "2.1.3" @@ -332,17 +332,17 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-vue/-/dict-vue-3.0.0.tgz#68ccb432ad93fcb0fd665352d075ae9a64ea9250" integrity sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A== -"@cspell/dynamic-import@8.3.1": - version "8.3.1" - resolved "https://registry.yarnpkg.com/@cspell/dynamic-import/-/dynamic-import-8.3.1.tgz#921674f130b9d172f0c4afec359f9d67edc25662" - integrity sha512-kr3xBaLH6RuyeTwT6AAXw77ClW1ibJmpmvPVbkt6f7HVZLij7ETq//O/R7WDpYzJALxzrYAPxGl5fyuAj19Cjg== +"@cspell/dynamic-import@8.3.2": + version "8.3.2" + resolved "https://registry.yarnpkg.com/@cspell/dynamic-import/-/dynamic-import-8.3.2.tgz#96fea6b1139164449a8ef92530de670d4c2fb36e" + integrity sha512-4t0xM5luA3yQhar2xWvYK4wQSDB2r0u8XkpzzJqd57MnJXd7uIAxI0awGUrDXukadRaCo0tDIlMUBemH48SNVg== dependencies: import-meta-resolve "^4.0.0" -"@cspell/strong-weak-map@8.3.1": - version "8.3.1" - resolved "https://registry.yarnpkg.com/@cspell/strong-weak-map/-/strong-weak-map-8.3.1.tgz#25af2df01765025143d089eda461cb6e13f800eb" - integrity sha512-657/0Ii0UP3sjwthUPOzlMbr5lwN26G2i6oYkOYjRgFL+Jni/7AHRShjI4BtkUYEmZZblwTkXcuNiWEJ+bm6MQ== +"@cspell/strong-weak-map@8.3.2": + version "8.3.2" + resolved "https://registry.yarnpkg.com/@cspell/strong-weak-map/-/strong-weak-map-8.3.2.tgz#5a9490e042bbc472089817b50cf51262dfedef65" + integrity sha512-Mte/2000ap278kRYOUhiGWI7MNr1+A7WSWJmlcdP4CAH5SO20sZI3/cyZLjJJEyapdhK5vaP1L5J9sUcVDHd3A== "@isaacs/cliui@^8.0.2": version "8.0.2" @@ -513,76 +513,76 @@ crypto-random-string@^4.0.0: dependencies: type-fest "^1.0.1" -cspell-config-lib@8.3.1: - version "8.3.1" - resolved "https://registry.yarnpkg.com/cspell-config-lib/-/cspell-config-lib-8.3.1.tgz#c226ac6191a25295e56e9c1e5a59a8ddf793dc19" - integrity sha512-3ilnVPQG6MVYQ0svVTIM1ODvABq6cYaQviH8OdbiRAh8izaAZ7B8NZRgzwm0Q74V76VRCLeanJzfGB2t5ujslw== +cspell-config-lib@8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/cspell-config-lib/-/cspell-config-lib-8.3.2.tgz#050a6d782072a810cb6655efe11c08c80ae7636b" + integrity sha512-Wc98XhBNLwDxnxCzMtgRJALI9a69cu3C5Gf1rGjNTKSFo9JYiQmju0Ur3z25Pkx9Sa86f+2IjvNCf33rUDSoBQ== dependencies: - "@cspell/cspell-types" "8.3.1" + "@cspell/cspell-types" "8.3.2" comment-json "^4.2.3" yaml "^2.3.4" -cspell-dictionary@8.3.1: - version "8.3.1" - resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-8.3.1.tgz#c66faa0e7d09c4ae01ba50adc4f7b10cd3356bdb" - integrity sha512-T78mv1BpWl7Na+BAfgu1ETnWiB5z+gQ53+W5CNjOf90MFLTI0VpAKQ1DTUrhB7KoPDFxvqW5s6KNLTAmn6o9PA== +cspell-dictionary@8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-8.3.2.tgz#6627a94501811a143f3b638e0e77f7262335dbd4" + integrity sha512-xyK95hO2BMPFxIo8zBwGml8035qOxSBdga1BMhwW/p2wDrQP8S4Cdm/54//tCDmKn6uRkFQvyOfWGaX2l8WMEg== dependencies: - "@cspell/cspell-pipe" "8.3.1" - "@cspell/cspell-types" "8.3.1" - cspell-trie-lib "8.3.1" + "@cspell/cspell-pipe" "8.3.2" + "@cspell/cspell-types" "8.3.2" + cspell-trie-lib "8.3.2" fast-equals "^5.0.1" gensequence "^6.0.0" -cspell-gitignore@8.3.1: - version "8.3.1" - resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-8.3.1.tgz#78c04ea2785b9cf34d17e3e8d1bf52db45489ec0" - integrity sha512-70olNEUpHvR8pODI/bmi8nJz98d/yDEw4bLgg89/0s6lP7Lgo5cVp4bnrdjuDT+C7ki1XfWT/UoSo64RCS8ueA== +cspell-gitignore@8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-8.3.2.tgz#5cf244be494bf87257ca8715ac88b0849dd5fef3" + integrity sha512-3Qc9P5BVvl/cg//s2s+zIMGKcoH5v7oOtRgwn4UQry8yiyo19h0tiTKkSR574FMhF5NtcShTnwIwPSIXVBPFHA== dependencies: - cspell-glob "8.3.1" + cspell-glob "8.3.2" find-up-simple "^1.0.0" -cspell-glob@8.3.1: - version "8.3.1" - resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-8.3.1.tgz#86d3940f5c50ce5d09468f69d75f56f5d0a664cc" - integrity sha512-OJrgC17hn/CL8XK9Li6p5LBut42Pu/yKOIz0mCgbU/E08jNopZCkMsaZjm6ozDuFHx+B1gqW/Y4wd35sum8DTg== +cspell-glob@8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-8.3.2.tgz#4c208e4ddd5604d2871df534a3054c7a3fdc9998" + integrity sha512-KtIFxE+3l5dGEofND4/CdZffXP8XN1+XGQKxJ96lIzWsc01mkotfhxTkla6mgvfH039t7BsY/SWv0460KyGslQ== dependencies: micromatch "^4.0.5" -cspell-grammar@8.3.1: - version "8.3.1" - resolved "https://registry.yarnpkg.com/cspell-grammar/-/cspell-grammar-8.3.1.tgz#896150b956172244228ac1632651162c44a8cf63" - integrity sha512-SdlUlQVHYtjeoebCKyrVG112jNCyP/ihit3jNiwk5gQ7LLqdV43crHFi13peSIhp9FR5Qn0JjnerpY89+256YA== +cspell-grammar@8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/cspell-grammar/-/cspell-grammar-8.3.2.tgz#69d7980c036c206745d5d417d32c95edaaff6107" + integrity sha512-tYCkOmRzJe1a6/R+8QGSwG7TwTgznLPqsHtepKzLmnS4YX54VXjKRI9zMARxXDzUVfyCSVdW5MyiY/0WTNoy+A== dependencies: - "@cspell/cspell-pipe" "8.3.1" - "@cspell/cspell-types" "8.3.1" + "@cspell/cspell-pipe" "8.3.2" + "@cspell/cspell-types" "8.3.2" -cspell-io@8.3.1: - version "8.3.1" - resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-8.3.1.tgz#01656fdb9f874c1fc10561843606897f2323f3a0" - integrity sha512-l3R5kfTj4Ov56IHGZp32mCrY1Wh9qM4ZJQGCNYuj2iaCVwTMR/5IoyvufTEm+Axqh8NJ/x5wfnq22wB6PateeA== +cspell-io@8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-8.3.2.tgz#8ddd865fa9a1391852e3288789f5b2a6613239bd" + integrity sha512-WYpKsyBCQP0SY4gXnhW5fPuxcYchKYKG1PIXVV3ezFU4muSgW6GuLNbGuSfwv/8YNXRgFSN0e3hYH0rdBK2Aow== dependencies: - "@cspell/cspell-service-bus" "8.3.1" + "@cspell/cspell-service-bus" "8.3.2" -cspell-lib@8.3.1: - version "8.3.1" - resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-8.3.1.tgz#ad36fa87b745d30f4ca3fc9485a20f8b0adb53f3" - integrity sha512-OuvJxzgyKWT39wbLAiaAmOrNVcbGXBDzOHAchYrQfClQ9w4eCdK1CvvFj+vyE6asaCDDpgw7icK0KhW6zHitGw== +cspell-lib@8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-8.3.2.tgz#8225f8d3a20596bda4b9689a2ad958f7831f5a7d" + integrity sha512-wTvdaev/TyGB/ln6CVD1QbVs2D7/+QiajQ67S7yj1suLHM6YcNQQb/5sPAM8VPtj0E7PgwgPXf3bq18OtPvnFg== dependencies: - "@cspell/cspell-bundled-dicts" "8.3.1" - "@cspell/cspell-pipe" "8.3.1" - "@cspell/cspell-resolver" "8.3.1" - "@cspell/cspell-types" "8.3.1" - "@cspell/dynamic-import" "8.3.1" - "@cspell/strong-weak-map" "8.3.1" + "@cspell/cspell-bundled-dicts" "8.3.2" + "@cspell/cspell-pipe" "8.3.2" + "@cspell/cspell-resolver" "8.3.2" + "@cspell/cspell-types" "8.3.2" + "@cspell/dynamic-import" "8.3.2" + "@cspell/strong-weak-map" "8.3.2" clear-module "^4.1.2" comment-json "^4.2.3" configstore "^6.0.0" - cspell-config-lib "8.3.1" - cspell-dictionary "8.3.1" - cspell-glob "8.3.1" - cspell-grammar "8.3.1" - cspell-io "8.3.1" - cspell-trie-lib "8.3.1" + cspell-config-lib "8.3.2" + cspell-dictionary "8.3.2" + cspell-glob "8.3.2" + cspell-grammar "8.3.2" + cspell-io "8.3.2" + cspell-trie-lib "8.3.2" fast-equals "^5.0.1" gensequence "^6.0.0" import-fresh "^3.3.0" @@ -590,31 +590,31 @@ cspell-lib@8.3.1: vscode-languageserver-textdocument "^1.0.11" vscode-uri "^3.0.8" -cspell-trie-lib@8.3.1: - version "8.3.1" - resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-8.3.1.tgz#f30f3e062a23ab2c83508a087aa9a9c129b5e2da" - integrity sha512-vbMDQfbAJQLVytHP5FkppEKkjnP1Emv6KEgYkkXWFAVM1ufQepx9VIAftLb+h4p9vJ6G5XZOiJZD1xStM4/OVQ== +cspell-trie-lib@8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-8.3.2.tgz#e1e8c9926f41a094bec7f0af85b931be06019fe7" + integrity sha512-8qh2FqzkLMwzlTlvO/5Z+89fhi30rrfekocpight/BmqKbE2XFJQD7wS2ml24e7q/rdHJLXVpJbY/V5mByucCA== dependencies: - "@cspell/cspell-pipe" "8.3.1" - "@cspell/cspell-types" "8.3.1" + "@cspell/cspell-pipe" "8.3.2" + "@cspell/cspell-types" "8.3.2" gensequence "^6.0.0" cspell@^8.3.1: - version "8.3.1" - resolved "https://registry.yarnpkg.com/cspell/-/cspell-8.3.1.tgz#0b4529de0b207c930408735e1f168ebeb69bad3b" - integrity sha512-VA7Z1jHyhr0+ZYGzrLSKouoZ1U1dFMQ38B4pMnKwx/qbngBPqFHOZXJfNRrHgbgicC7fwDjsm+4OvxUluOKR9A== + version "8.3.2" + resolved "https://registry.yarnpkg.com/cspell/-/cspell-8.3.2.tgz#56e7e919d87d38016b4c34b8c8ee745404c230a7" + integrity sha512-V8Ub3RO/a5lwSsltW/ib3Z3G/sczKtSpBBN1JChzbSCfEgaY2mJY8JW0BpkSV+Ug6uJitpXNOOaxa3Xr489i7g== dependencies: - "@cspell/cspell-json-reporter" "8.3.1" - "@cspell/cspell-pipe" "8.3.1" - "@cspell/cspell-types" "8.3.1" - "@cspell/dynamic-import" "8.3.1" + "@cspell/cspell-json-reporter" "8.3.2" + "@cspell/cspell-pipe" "8.3.2" + "@cspell/cspell-types" "8.3.2" + "@cspell/dynamic-import" "8.3.2" chalk "^5.3.0" chalk-template "^1.1.0" commander "^11.1.0" - cspell-gitignore "8.3.1" - cspell-glob "8.3.1" - cspell-io "8.3.1" - cspell-lib "8.3.1" + cspell-gitignore "8.3.2" + cspell-glob "8.3.2" + cspell-io "8.3.2" + cspell-lib "8.3.2" fast-glob "^3.3.2" fast-json-stable-stringify "^2.1.0" file-entry-cache "^8.0.0" @@ -672,9 +672,9 @@ fast-json-stable-stringify@^2.1.0: integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== fastq@^1.6.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" - integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== + version "1.16.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.16.0.tgz#83b9a9375692db77a822df081edb6a9cf6839320" + integrity sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA== dependencies: reusify "^1.0.4" @@ -983,7 +983,6 @@ signal-exit@^4.0.1: integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== "string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0: - name string-width-cjs version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -1002,7 +1001,6 @@ string-width@^5.0.1, string-width@^5.1.2: strip-ansi "^7.0.1" "strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: - name strip-ansi-cjs version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== From c031a0ebf483ff7a9c7637ac2e6bfe3c7794ab25 Mon Sep 17 00:00:00 2001 From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> Date: Sat, 6 Jan 2024 15:13:42 +0100 Subject: [PATCH 231/845] Ignore `yarn install` errors (#2538) * Ignore `yarn install` errors * Update Build/Build.cs Co-authored-by: Jonas Nyrup --------- Co-authored-by: Jonas Nyrup --- Build/Build.cs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Build/Build.cs b/Build/Build.cs index 7383e2d7c8..167665c396 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -354,12 +354,34 @@ from framework in supportedFrameworks .ProceedAfterFailure() .Executes(() => { - Node($"{YarnCli} --silent install", workingDirectory: RootDirectory); + Node($"{YarnCli} --silent install", workingDirectory: RootDirectory, + logger: YarnInstallLogger); Node($"{YarnCli} --silent run cspell", workingDirectory: RootDirectory, logger: (_, msg) => Error(msg)); }); + Action YarnInstallLogger = (_, msg) => + { + // See this PR here: https://github.com/fluentassertions/fluentassertions/pull/2537 + // and several comments and references. + // This seems to be a bug in yarn and the package 'Yarn.MSBuild' is no longer maintained; + // So: ignore 'yarn install' errors when the same cache directory is defined in yarn.lock. + // This errors have the pattern like: 'Error: warning Pattern [packagename@version]...' + + if (!msg.Contains("is trying to unpack in the same destination")) + { + if (msg.StartsWith("warning")) + { + Warning(msg); + } + else + { + Error(msg); + } + } + }; + bool HasDocumentationChanges => Changes.Any(x => IsDocumentation(x)); bool HasSourceChanges => Changes.Any(x => !IsDocumentation(x)); From 855943dfde8af9bbd799916cdd07c1feb23dd820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sat, 6 Jan 2024 16:21:28 +0100 Subject: [PATCH 232/845] Avoid redundancies in code (#2470) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove redundant using directive * Remove redundant explicit size specification in array creation * Remove redundant 'class' keyword in record declaration * Remove redundant type arguments of method * Explicitely allow redundant string interpolation * Explicitely allow Expression is always true or false in `NullableBooleanAssertionSpecs` * Fix "The field is always assigned before being used and can be converted into a local variable" * Explicitely allow Expression is always true or false in `BooleanAssertionSpecs` * Implement review comments from @jnyrup --- Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs | 6 ++---- .../Collections/CollectionAssertionSpecs.cs | 5 +---- .../Execution/CallerIdentifierSpecs.cs | 2 +- .../Primitives/BooleanAssertionSpecs.cs | 1 + .../Primitives/DateOnlyAssertionSpecs.cs | 1 - .../Primitives/NullableBooleanAssertionSpecs.cs | 1 + .../Primitives/ObjectAssertionSpecs.Be.cs | 4 ++-- .../Primitives/ObjectAssertionSpecs.BeOneOf.cs | 2 +- Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs | 2 +- 9 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs index 89bb439aa3..75e22cfdf5 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs @@ -295,11 +295,9 @@ public void When_a_collection_does_not_match_it_should_include_items_in_message( public void When_collection_of_same_count_does_not_match_it_should_include_at_most_10_items_in_message() { // Arrange - const int commonLength = 11; - // Subjects contains different values, because we want to distinguish them in the assertion message - var subject = new int[commonLength] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; - var expectation = Enumerable.Repeat(20, commonLength).ToArray(); + var subject = new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; + var expectation = Enumerable.Repeat(20, subject.Length).ToArray(); // Act Action action = () => subject.Should().BeEquivalentTo(expectation); diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs index 308756a26c..03e2740b50 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs @@ -295,12 +295,9 @@ public int Count internal sealed class TrackingTestEnumerable : IEnumerable { - private readonly int[] values; - public TrackingTestEnumerable(params int[] values) { - this.values = values; - Enumerator = new TrackingEnumerator(this.values); + Enumerator = new TrackingEnumerator(values); } public TrackingEnumerator Enumerator { get; } diff --git a/Tests/FluentAssertions.Specs/Execution/CallerIdentifierSpecs.cs b/Tests/FluentAssertions.Specs/Execution/CallerIdentifierSpecs.cs index f5a0d05f84..c508ade7c9 100644 --- a/Tests/FluentAssertions.Specs/Execution/CallerIdentifierSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/CallerIdentifierSpecs.cs @@ -11,7 +11,7 @@ using Xunit.Sdk; #pragma warning disable RCS1192, RCS1214, S4144 // verbatim string literals and interpolated strings - +// ReSharper disable RedundantStringInterpolation namespace FluentAssertions.Specs.Execution { public class CallerIdentifierSpecs diff --git a/Tests/FluentAssertions.Specs/Primitives/BooleanAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/BooleanAssertionSpecs.cs index 63e8cf8cb5..8288817edd 100644 --- a/Tests/FluentAssertions.Specs/Primitives/BooleanAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/BooleanAssertionSpecs.cs @@ -4,6 +4,7 @@ namespace FluentAssertions.Specs.Primitives; +// ReSharper disable ConditionIsAlwaysTrueOrFalse public class BooleanAssertionSpecs { public class BeTrue diff --git a/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.cs index 022e2ef6d4..3859ed3fb9 100644 --- a/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/DateOnlyAssertionSpecs.cs @@ -2,7 +2,6 @@ using System; using Xunit; -using Xunit.Sdk; namespace FluentAssertions.Specs.Primitives; diff --git a/Tests/FluentAssertions.Specs/Primitives/NullableBooleanAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/NullableBooleanAssertionSpecs.cs index 6703fb54e9..4eb2097533 100644 --- a/Tests/FluentAssertions.Specs/Primitives/NullableBooleanAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/NullableBooleanAssertionSpecs.cs @@ -4,6 +4,7 @@ namespace FluentAssertions.Specs.Primitives; +// ReSharper disable ConditionIsAlwaysTrueOrFalse public class NullableBooleanAssertionSpecs { [Fact] diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.Be.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.Be.cs index 93a2900427..e617d5b309 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.Be.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.Be.cs @@ -193,7 +193,7 @@ public void Can_chain_multiple_assertions() var value = new object(); // Act / Assert - value.Should().Be(value, new DumbObjectEqualityComparer()).And.NotBeNull(); + value.Should().Be(value, new DumbObjectEqualityComparer()).And.NotBeNull(); } } @@ -342,7 +342,7 @@ public void Can_chain_multiple_assertions() var value = new object(); // Act / Assert - value.Should().NotBe(new object(), new DumbObjectEqualityComparer()).And.NotBeNull(); + value.Should().NotBe(new object(), new DumbObjectEqualityComparer()).And.NotBeNull(); } } diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOneOf.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOneOf.cs index d66a82f1d2..868c732342 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOneOf.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeOneOf.cs @@ -215,7 +215,7 @@ public void Can_chain_multiple_assertions() var value = new object(); // Act / Assert - value.Should().BeOneOf([value], new DumbObjectEqualityComparer()).And.NotBeNull(); + value.Should().BeOneOf([value], new DumbObjectEqualityComparer()).And.NotBeNull(); } } } diff --git a/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs b/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs index 80ab2af50f..456738a868 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs @@ -880,7 +880,7 @@ internal record struct InternalRecordStructValueType; internal class InternalClassNotValueType; - internal record class InternalRecordClass; + internal record InternalRecordClass; internal enum InternalEnumValueType { From 5b2ff792434416017b29e25512a0edafd4b5b7b8 Mon Sep 17 00:00:00 2001 From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> Date: Sat, 6 Jan 2024 22:09:20 +0100 Subject: [PATCH 233/845] Add missing `NotBeIn(DateTimeKind)` `DateTime` assertion (#2536) --- .../Primitives/DateTimeAssertions.cs | 30 ++++++++++++ .../FluentAssertions/net47.verified.txt | 1 + .../FluentAssertions/net6.0.verified.txt | 1 + .../netstandard2.0.verified.txt | 1 + .../netstandard2.1.verified.txt | 1 + .../Primitives/DateTimeAssertionSpecs.BeIn.cs | 47 +++++++++++++++++++ docs/_pages/datetimespans.md | 1 + docs/_pages/releases.md | 1 + 8 files changed, 83 insertions(+) diff --git a/Src/FluentAssertions/Primitives/DateTimeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeAssertions.cs index 0606a6a0ae..a70965cad0 100644 --- a/Src/FluentAssertions/Primitives/DateTimeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeAssertions.cs @@ -928,6 +928,36 @@ public AndConstraint BeIn(DateTimeKind expectedKind, string because return new AndConstraint((TAssertions)this); } + /// + /// Asserts that the does not represent a value in a specific kind. + /// + /// + /// The that the current value should not represent. + /// + /// + /// 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 NotBeIn(DateTimeKind unexpectedKind, string because = "", params object[] becauseArgs) + { + Execute.Assertion + .BecauseOf(because, becauseArgs) + .WithExpectation("Did not expect {context:the date and time} to be in " + unexpectedKind + "{reason}") + .Given(() => Subject) + .ForCondition(subject => subject.HasValue) + .FailWith(", but found a DateTime.") + .Then + .ForCondition(subject => subject.GetValueOrDefault().Kind != unexpectedKind) + .FailWith(", but it was.") + .Then + .ClearExpectation(); + + 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() instead?"); diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 2bccb50035..2bc40ba7f7 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -1709,6 +1709,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBeAfter(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeBefore(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeCloseTo(System.DateTime distantTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeIn(System.DateTimeKind unexpectedKind, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeOnOrAfter(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeOnOrBefore(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeSameDateAs(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 918c7e823c..6ed06ba856 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -1767,6 +1767,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBeAfter(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeBefore(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeCloseTo(System.DateTime distantTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeIn(System.DateTimeKind unexpectedKind, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeOnOrAfter(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeOnOrBefore(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeSameDateAs(System.DateTime 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 e2aa85b289..cc72431b8c 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -1660,6 +1660,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBeAfter(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeBefore(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeCloseTo(System.DateTime distantTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeIn(System.DateTimeKind unexpectedKind, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeOnOrAfter(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeOnOrBefore(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeSameDateAs(System.DateTime 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 c59678e007..eddae6d711 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -1709,6 +1709,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBeAfter(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeBefore(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeCloseTo(System.DateTime distantTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeIn(System.DateTimeKind unexpectedKind, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeOnOrAfter(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeOnOrBefore(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeSameDateAs(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeIn.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeIn.cs index b280b1a612..0d7fdc16cb 100644 --- a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeIn.cs +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.BeIn.cs @@ -1,4 +1,6 @@ using System; +using FluentAssertions.Execution; +using FluentAssertions.Extensions; using Xunit; using Xunit.Sdk; @@ -49,4 +51,49 @@ public void When_asserting_subject_null_datetime_represents_a_specific_kind_it_s .WithMessage("Expected subject to be in Utc, but found a DateTime."); } } + + public class NotBeIn + { + [Fact] + public void Date_is_not_in_kind() + { + // Arrange + DateTime subject = 5.January(2024).AsLocal(); + + // Act / Assert + subject.Should().NotBeIn(DateTimeKind.Utc); + } + + [Fact] + public void Date_is_in_kind_but_should_not() + { + // Arrange + DateTime subject = 5.January(2024).AsLocal(); + + // Act + Action act = () => subject.Should().NotBeIn(DateTimeKind.Local); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect subject to be in Local, but it was."); + } + + [Fact] + public void Date_is_null_on_kind_check() + { + // Arrange + DateTime? subject = null; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + subject.Should().NotBeIn(DateTimeKind.Utc); + }; + + // Assert + act.Should().Throw() + .WithMessage("Did not**"); + } + } } diff --git a/docs/_pages/datetimespans.md b/docs/_pages/datetimespans.md index 2edcbd3598..a42b49bed3 100644 --- a/docs/_pages/datetimespans.md +++ b/docs/_pages/datetimespans.md @@ -30,6 +30,7 @@ theDatetime.Should().NotBeBefore(1.February(2010)); theDatetime.Should().NotBeOnOrAfter(2.March(2010)); theDatetime.Should().NotBeOnOrBefore(1.February(2010)); theDatetime.Should().NotBeSameDateAs(2.March(2010)); +theDatetime.Should().NotBeIn(DateTimeKind.Utc); theDatetime.Should().BeOneOf( 1.March(2010).At(21, 15), diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index cc421d4a38..58e9d11b12 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -14,6 +14,7 @@ sidebar: * Introduced a new assembly-level attribute that you can use to initialize Fluent Assertions before the first assertion - [#2292](https://github.com/fluentassertions/fluentassertions/pull/2292) * Ensure compatibility with .NET 8 - [#2466](https://github.com/fluentassertions/fluentassertions/pull/2466) * Add support for NUnit 4 - [#2483](https://github.com/fluentassertions/fluentassertions/pull/2483) +* Added `NotBeIn` to check if a `DateTime` is not in a given `DateTimeKind` - [#2536](https://github.com/fluentassertions/fluentassertions/pull/2536) ### Improvements * Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) From 6a3d548fb58ec60038fc6525cb57381aec56f4b9 Mon Sep 17 00:00:00 2001 From: Louis Zanella Date: Sun, 7 Jan 2024 02:49:21 -0500 Subject: [PATCH 234/845] Update release notes (#2541) --- docs/_pages/releases.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 58e9d11b12..81f21c6577 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -19,6 +19,7 @@ sidebar: ### Improvements * Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) * You can mark all assertions in an assembly as custom assertions using the `[CustomAssertionsAssembly]` attribute - [#2389](https://github.com/fluentassertions/fluentassertions/pull/2389) +* Improve `BeEmpty()` and `BeNullOrEmpty()` performance for `IEnumerable`, by materializing only the first item - [#2530](https://github.com/fluentassertions/fluentassertions/pull/2530) ### Fixes * Fixed formatting error when checking nullable `DateTimeOffset` with From 0d17938873e7f272748f118d3bb5dac834c66185 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 7 Jan 2024 10:23:19 +0100 Subject: [PATCH 235/845] Added an extra assertion engine initializer that throws for extra coverage (#2542) --- .../AssertionEngineInitializer.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Tests/FluentAssertions.Extensibility.Specs/AssertionEngineInitializer.cs b/Tests/FluentAssertions.Extensibility.Specs/AssertionEngineInitializer.cs index 80cf5b9c4a..6aaaaa6b4b 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/AssertionEngineInitializer.cs +++ b/Tests/FluentAssertions.Extensibility.Specs/AssertionEngineInitializer.cs @@ -1,10 +1,15 @@ -using System.Threading; +using System; +using System.Threading; // With specific initialization code to invoke before the first assertion happens [assembly: FluentAssertions.Extensibility.AssertionEngineInitializer( typeof(FluentAssertions.Extensibility.Specs.AssertionEngineInitializer), nameof(FluentAssertions.Extensibility.Specs.AssertionEngineInitializer.InitializeBeforeFirstAssertion))] +[assembly: FluentAssertions.Extensibility.AssertionEngineInitializer( + typeof(FluentAssertions.Extensibility.Specs.AssertionEngineInitializer), + nameof(FluentAssertions.Extensibility.Specs.AssertionEngineInitializer.InitializeBeforeFirstAssertionButThrow))] + namespace FluentAssertions.Extensibility.Specs; public static class AssertionEngineInitializer @@ -17,4 +22,9 @@ public static void InitializeBeforeFirstAssertion() { Interlocked.Increment(ref shouldBeCalledOnlyOnce); } + + public static void InitializeBeforeFirstAssertionButThrow() + { + throw new InvalidOperationException("Bogus exception to make sure the engine ignores them"); + } } From a6626ad1804d93340ce3a16169c2a71ba1130546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sun, 7 Jan 2024 16:15:31 +0100 Subject: [PATCH 236/845] Mention "Prefer Rebase over Merge when updating your local branch." in Contributing.md --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4e7c5110ab..8b15ce80d3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,6 +67,7 @@ Contributions must also satisfy the other published guidelines defined in this d Please do: * Target the [Pull Request](https://help.github.com/articles/using-pull-requests) at the `develop` branch. +* Prefer rebase over merge when updating your local branch. * Follow the style presented in the [Coding Guidelines for C#](https://csharpcodingguidelines.com/). * Align with the [Design Principles](https://github.com/fluentassertions/fluentassertions/issues/1340) * Ensure that changes are covered by a new or existing set of unit tests which follow the Arrange-Act-Assert syntax such as is used [in this example](https://github.com/fluentassertions/fluentassertions/blob/daaf35b9b59b622c96d0c034e8972a020b2bee55/Tests/FluentAssertions.Shared.Specs/BasicEquivalencySpecs.cs#L33). From 5ba6c686d7bbb2f38c84ecbceb616200d990bba0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 15:15:07 +0000 Subject: [PATCH 237/845] Bump Bogus from 35.2.0 to 35.3.0 Bumps [Bogus](https://github.com/bchavez/Bogus) from 35.2.0 to 35.3.0. - [Release notes](https://github.com/bchavez/Bogus/releases) - [Changelog](https://github.com/bchavez/Bogus/blob/master/HISTORY.md) - [Commits](https://github.com/bchavez/Bogus/compare/v35.2.0...v35.3.0) --- updated-dependencies: - dependency-name: Bogus dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Tests/Benchmarks/Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index 436dc0bcfe..bd21f2afef 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -10,7 +10,7 @@ - + From 24e63bc6423dd1848a5edc00b6783535aad80579 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 15:18:00 +0000 Subject: [PATCH 238/845] Bump Meziantou.Analyzer from 2.0.132 to 2.0.135 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.132 to 2.0.135. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.132...2.0.135) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 7707e2941e..d2eb8a08c6 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From aff3f7829056083c5280f7c0f530df5645d83dc0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 15:46:26 +0000 Subject: [PATCH 239/845] Bump Roslynator.Analyzers from 4.7.0 to 4.8.0 Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.7.0 to 4.8.0. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.7.0...v4.8.0) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index d2eb8a08c6..47b397e4c1 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 98ef3f6d8486ee0641584ac59c9bc84a1df56e49 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 8 Jan 2024 16:35:16 +0100 Subject: [PATCH 240/845] Limit NUnit3.Specs to NUnit <4 --- Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index 7a59ad8781..10b5d19fba 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -1,4 +1,4 @@ - + net6.0 NUnit3.Specs @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 090250dd2e93d6b1786219237b1d5b3edb362eaa Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 8 Jan 2024 16:45:08 +0100 Subject: [PATCH 241/845] NUnit 4.0.0 -> 4.0.1 --- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index 749ed71e4a..1dcd4f159e 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 2b8551da0e31fff2a6e9ddc850dc66c0201aab44 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 8 Jan 2024 16:48:01 +0100 Subject: [PATCH 242/845] xunit 2.6.2 -> 2.6.5 --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 49b09de19e..4a79b62d69 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -6,7 +6,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index a6e252b5cb..928a5244f6 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -11,7 +11,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 252ee5c13a..e4c26d3739 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -36,7 +36,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 1ca2b05477..74564950e2 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -29,7 +29,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index a748c1589c..097b54cf79 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -34,7 +34,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index 3a54b0e2c3..5db8c6c55c 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 3cc3d050aa..b5f868fc87 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -7,7 +7,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From c629310f46e1e0662c637e0ac8ceb36899fbeaca Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 8 Jan 2024 16:36:09 +0100 Subject: [PATCH 243/845] xunit.runner.console 2.6.2 -> 2.6.5 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index a8684f0ac9..d4edec84bc 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -19,7 +19,7 @@ - + From ffeb435da1e726e86c12b9184834ea026db01299 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 8 Jan 2024 16:48:48 +0100 Subject: [PATCH 244/845] xunit.runner.visualstudio 2.5.4 -> 2.5.6 --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 12 ++++-------- .../FluentAssertions.Extensibility.Specs.csproj | 15 ++++----------- .../FluentAssertions.Specs.csproj | 12 ++++-------- .../XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 7 files changed, 16 insertions(+), 31 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 4a79b62d69..8c2450fd88 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -7,7 +7,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 928a5244f6..9d3b903659 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -12,7 +12,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index e4c26d3739..7658dcc4e3 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -18,18 +18,10 @@ Upgrading to 1.6.0 gives "Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0" --> - - all - runtime; build; native; contentfiles; analyzers - - - all - runtime; build; native; contentfiles; analyzers - @@ -37,6 +29,10 @@ + + all + runtime; build; native; contentfiles; analyzers + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 74564950e2..d2c2ebc4cd 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -9,19 +9,8 @@ full - - - all - runtime; build; native; contentfiles; analyzers - - - - - all - runtime; build; native; contentfiles; analyzers - @@ -30,6 +19,10 @@ runtime; build; native; contentfiles; analyzers; buildtransitive + + all + runtime; build; native; contentfiles; analyzers + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 097b54cf79..c0eeecace5 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -18,23 +18,19 @@ Upgrading to 1.6.0 gives "Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0" --> - - all - runtime; build; native; contentfiles; analyzers - - - all - runtime; build; native; contentfiles; analyzers - + + all + runtime; build; native; contentfiles; analyzers + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index 5db8c6c55c..01180124de 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -13,7 +13,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index b5f868fc87..fc86c9f82d 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 9e06eea64249bbde608da52b4e889796432a0c51 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 8 Jan 2024 16:49:33 +0100 Subject: [PATCH 245/845] Verify.Xunit 22.6.0 -> 22.11.4 --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 8c2450fd88..db85c84410 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 2cb065c9227dff8b7170a3cae299117a80f93d82 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 8 Jan 2024 16:57:15 +0100 Subject: [PATCH 246/845] BenchmarkDotNet 0.13.10 -> 0.13.12 --- Tests/Benchmarks/Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index bd21f2afef..cc07cc5ac8 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -9,7 +9,7 @@ - + From fb93aa04940604e87f4b1f2e589d7ebded0b4c11 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 8 Jan 2024 18:18:39 +0100 Subject: [PATCH 247/845] Add CodeQL scanning --- .github/workflows/codeql.yml | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000000..7cc2c66f69 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,50 @@ +name: "CodeQL" + +on: + push: + branches: [ "develop", "master" ] + pull_request: + branches: [ "develop", "master" ] + schedule: + - cron: '00 15 * * 1' + +jobs: + analyze: + name: Analyze + runs-on: 'ubuntu-latest' + timeout-minutes: 360 + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'csharp' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + - name: Build + run: | + dotnet restore FluentAssertions.sln --configfile nuget.config + dotnet build FluentAssertions.sln --configuration CI --no-restore + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" From 1c7e207df7a19c83ef68b3f5d7398bf512a3f229 Mon Sep 17 00:00:00 2001 From: hybloid <48032702+hybloid@users.noreply.github.com> Date: Thu, 11 Jan 2024 07:05:06 +0100 Subject: [PATCH 248/845] Update qodana.yaml to limit target frameworks to analyze (#2515) --- qodana.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/qodana.yaml b/qodana.yaml index 0210df1b95..1033508fa5 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -8,6 +8,7 @@ profile: dotnet: solution: FluentAssertions.sln + frameworks: "!netstandard2.0;!netstandard2.1" exclude: - name: ConvertIfStatementToReturnStatement From db5d1c0d1691faa103c5d046639abdbdfe6a2fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Luthi?= Date: Sun, 14 Jan 2024 00:02:09 +0100 Subject: [PATCH 249/845] Simplify the API approval test [xUnit.net 2.6.5][1] introduced a new `AddRange` method that can be used to simplify the implementation of `TargetFrameworksTheoryData`. [1]: https://xunit.net/releases/v2/2.6.5 --- Tests/Approval.Tests/ApiApproval.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Tests/Approval.Tests/ApiApproval.cs b/Tests/Approval.Tests/ApiApproval.cs index 44163b414e..071d5a0f61 100644 --- a/Tests/Approval.Tests/ApiApproval.cs +++ b/Tests/Approval.Tests/ApiApproval.cs @@ -42,11 +42,7 @@ public TargetFrameworksTheoryData() var csproj = CombinedPaths("Src", "FluentAssertions", "FluentAssertions.csproj"); var project = XDocument.Load(csproj); var targetFrameworks = project.XPathSelectElement("/Project/PropertyGroup/TargetFrameworks"); - - foreach (string targetFramework in targetFrameworks!.Value.Split(';')) - { - Add(targetFramework); - } + AddRange(targetFrameworks!.Value.Split(';')); } } From ca87a816e50659cad9a3f1cb32756bce84527ed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Luthi?= Date: Sun, 14 Jan 2024 18:09:23 +0100 Subject: [PATCH 250/845] Add [NotNull] attribute on the Should() method for object assertions (#2380) * Add [NotNull] attribute on the Should() method of reference types Compelling example: ```csharp [Theory] [InlineData(true)] [InlineData(false)] public void Test1(bool currentUser) { IPrincipal principal = currentUser ? new WindowsPrincipal(WindowsIdentity.GetCurrent()) : new ClaimsPrincipal(); IIdentity? identity = principal.Identity; identity.Should().NotBeOfType(); identity.IsAuthenticated.Should().BeFalse(); } ``` Fixes #1115 * Add entry in the release notes under improvements --- Src/FluentAssertions/AssertionExtensions.cs | 49 +++++++++--------- .../XmlAssertionExtensions.cs | 5 +- .../FluentAssertions/net47.verified.txt | 50 +++++++++---------- .../FluentAssertions/net6.0.verified.txt | 50 +++++++++---------- .../netstandard2.0.verified.txt | 50 +++++++++---------- .../netstandard2.1.verified.txt | 50 +++++++++---------- .../AssertionExtensionsSpecs.cs | 34 +++++++++++++ docs/_pages/releases.md | 1 + 8 files changed, 163 insertions(+), 126 deletions(-) diff --git a/Src/FluentAssertions/AssertionExtensions.cs b/Src/FluentAssertions/AssertionExtensions.cs index d4f4274992..d317092f78 100644 --- a/Src/FluentAssertions/AssertionExtensions.cs +++ b/Src/FluentAssertions/AssertionExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; @@ -18,6 +18,7 @@ using FluentAssertions.Types; using FluentAssertions.Xml; using JetBrains.Annotations; +using NotNullAttribute = System.Diagnostics.CodeAnalysis.NotNullAttribute; #if !NETSTANDARD2_0 using FluentAssertions.Events; #endif @@ -174,7 +175,7 @@ public static ExecutionTimeAssertions Should(this ExecutionTime executionTime) /// current . /// [Pure] - public static AssemblyAssertions Should(this Assembly assembly) + public static AssemblyAssertions Should([NotNull] this Assembly assembly) { return new AssemblyAssertions(assembly); } @@ -184,7 +185,7 @@ public static AssemblyAssertions Should(this Assembly assembly) /// current . /// [Pure] - public static XDocumentAssertions Should(this XDocument actualValue) + public static XDocumentAssertions Should([NotNull] this XDocument actualValue) { return new XDocumentAssertions(actualValue); } @@ -194,7 +195,7 @@ public static XDocumentAssertions Should(this XDocument actualValue) /// current . /// [Pure] - public static XElementAssertions Should(this XElement actualValue) + public static XElementAssertions Should([NotNull] this XElement actualValue) { return new XElementAssertions(actualValue); } @@ -204,7 +205,7 @@ public static XElementAssertions Should(this XElement actualValue) /// current . /// [Pure] - public static XAttributeAssertions Should(this XAttribute actualValue) + public static XAttributeAssertions Should([NotNull] this XAttribute actualValue) { return new XAttributeAssertions(actualValue); } @@ -214,7 +215,7 @@ public static XAttributeAssertions Should(this XAttribute actualValue) /// current . /// [Pure] - public static StreamAssertions Should(this Stream actualValue) + public static StreamAssertions Should([NotNull] this Stream actualValue) { return new StreamAssertions(actualValue); } @@ -224,7 +225,7 @@ public static StreamAssertions Should(this Stream actualValue) /// current . /// [Pure] - public static BufferedStreamAssertions Should(this BufferedStream actualValue) + public static BufferedStreamAssertions Should([NotNull] this BufferedStream actualValue) { return new BufferedStreamAssertions(actualValue); } @@ -281,7 +282,7 @@ private static void ForceEnumeration(T subject, Func enumerab /// current . /// [Pure] - public static ObjectAssertions Should(this object actualValue) + public static ObjectAssertions Should([NotNull] this object actualValue) { return new ObjectAssertions(actualValue); } @@ -311,7 +312,7 @@ public static NullableBooleanAssertions Should(this bool? actualValue) /// current . /// [Pure] - public static HttpResponseMessageAssertions Should(this HttpResponseMessage actualValue) + public static HttpResponseMessageAssertions Should([NotNull] this HttpResponseMessage actualValue) { return new HttpResponseMessageAssertions(actualValue); } @@ -341,7 +342,7 @@ public static NullableGuidAssertions Should(this Guid? actualValue) /// current . /// [Pure] - public static GenericCollectionAssertions Should(this IEnumerable actualValue) + public static GenericCollectionAssertions Should([NotNull] this IEnumerable actualValue) { return new GenericCollectionAssertions(actualValue); } @@ -351,7 +352,7 @@ public static GenericCollectionAssertions Should(this IEnumerable actua /// current . /// [Pure] - public static StringCollectionAssertions Should(this IEnumerable @this) + public static StringCollectionAssertions Should([NotNull] this IEnumerable @this) { return new StringCollectionAssertions(@this); } @@ -362,7 +363,7 @@ public static StringCollectionAssertions Should(this IEnumerable @this) /// [Pure] public static GenericDictionaryAssertions, TKey, TValue> Should( - this IDictionary actualValue) + [NotNull] this IDictionary actualValue) { return new GenericDictionaryAssertions, TKey, TValue>(actualValue); } @@ -373,7 +374,7 @@ public static GenericDictionaryAssertions, TKey, TValu /// [Pure] public static GenericDictionaryAssertions>, TKey, TValue> Should( - this IEnumerable> actualValue) + [NotNull] this IEnumerable> actualValue) { return new GenericDictionaryAssertions>, TKey, TValue>(actualValue); } @@ -384,7 +385,7 @@ public static GenericDictionaryAssertions /// [Pure] public static GenericDictionaryAssertions Should( - this TCollection actualValue) + [NotNull] this TCollection actualValue) where TCollection : IEnumerable> { return new GenericDictionaryAssertions(actualValue); @@ -478,7 +479,7 @@ public static NullableTimeOnlyAssertions Should(this TimeOnly? actualValue) /// current . /// [Pure] - public static ComparableTypeAssertions Should(this IComparable comparableValue) + public static ComparableTypeAssertions Should([NotNull] this IComparable comparableValue) { return new ComparableTypeAssertions(comparableValue); } @@ -708,7 +709,7 @@ public static NullableNumericAssertions Should(this double? actualValue) /// current . /// [Pure] - public static StringAssertions Should(this string actualValue) + public static StringAssertions Should([NotNull] this string actualValue) { return new StringAssertions(actualValue); } @@ -738,7 +739,7 @@ public static NullableSimpleTimeSpanAssertions Should(this TimeSpan? actualValue /// current . /// [Pure] - public static TypeAssertions Should(this Type subject) + public static TypeAssertions Should([NotNull] this Type subject) { return new TypeAssertions(subject); } @@ -762,7 +763,7 @@ public static TypeSelectorAssertions Should(this TypeSelector typeSelector) /// /// [Pure] - public static ConstructorInfoAssertions Should(this ConstructorInfo constructorInfo) + public static ConstructorInfoAssertions Should([NotNull] this ConstructorInfo constructorInfo) { return new ConstructorInfoAssertions(constructorInfo); } @@ -772,7 +773,7 @@ public static ConstructorInfoAssertions Should(this ConstructorInfo constructorI /// /// [Pure] - public static MethodInfoAssertions Should(this MethodInfo methodInfo) + public static MethodInfoAssertions Should([NotNull] this MethodInfo methodInfo) { return new MethodInfoAssertions(methodInfo); } @@ -797,7 +798,7 @@ public static MethodInfoSelectorAssertions Should(this MethodInfoSelector method /// /// [Pure] - public static PropertyInfoAssertions Should(this PropertyInfo propertyInfo) + public static PropertyInfoAssertions Should([NotNull] this PropertyInfo propertyInfo) { return new PropertyInfoAssertions(propertyInfo); } @@ -821,7 +822,7 @@ public static PropertyInfoSelectorAssertions Should(this PropertyInfoSelector pr /// current . /// [Pure] - public static ActionAssertions Should(this Action action) + public static ActionAssertions Should([NotNull] this Action action) { return new ActionAssertions(action, Extractor); } @@ -831,7 +832,7 @@ public static ActionAssertions Should(this Action action) /// current . /// [Pure] - public static NonGenericAsyncFunctionAssertions Should(this Func action) + public static NonGenericAsyncFunctionAssertions Should([NotNull] this Func action) { return new NonGenericAsyncFunctionAssertions(action, Extractor); } @@ -841,7 +842,7 @@ public static NonGenericAsyncFunctionAssertions Should(this Func action) /// current System.Func{Task{T}}. /// [Pure] - public static GenericAsyncFunctionAssertions Should(this Func> action) + public static GenericAsyncFunctionAssertions Should([NotNull] this Func> action) { return new GenericAsyncFunctionAssertions(action, Extractor); } @@ -851,7 +852,7 @@ public static GenericAsyncFunctionAssertions Should(this Func> act /// current . /// [Pure] - public static FunctionAssertions Should(this Func func) + public static FunctionAssertions Should([NotNull] this Func func) { return new FunctionAssertions(func, Extractor); } diff --git a/Src/FluentAssertions/XmlAssertionExtensions.cs b/Src/FluentAssertions/XmlAssertionExtensions.cs index 771bd359be..2db9562915 100644 --- a/Src/FluentAssertions/XmlAssertionExtensions.cs +++ b/Src/FluentAssertions/XmlAssertionExtensions.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Xml; using FluentAssertions.Xml; @@ -7,12 +8,12 @@ namespace FluentAssertions; [DebuggerNonUserCode] public static class XmlAssertionExtensions { - public static XmlNodeAssertions Should(this XmlNode actualValue) + public static XmlNodeAssertions Should([NotNull] this XmlNode actualValue) { return new XmlNodeAssertions(actualValue); } - public static XmlElementAssertions Should(this XmlElement actualValue) + public static XmlElementAssertions Should([NotNull] this XmlElement actualValue) { return new XmlElementAssertions(actualValue); } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 2bc40ba7f7..755cb9c53d 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -57,28 +57,28 @@ namespace FluentAssertions [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } - public static FluentAssertions.Specialized.ActionAssertions Should(this System.Action action) { } - public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Collections.Generic.IEnumerable @this) { } + public static FluentAssertions.Specialized.ActionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Action action) { } + public static FluentAssertions.Collections.StringCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable @this) { } public static FluentAssertions.Primitives.DateTimeAssertions Should(this System.DateTime actualValue) { } public static FluentAssertions.Primitives.NullableDateTimeAssertions Should(this System.DateTime? actualValue) { } public static FluentAssertions.Primitives.DateTimeOffsetAssertions Should(this System.DateTimeOffset actualValue) { } public static FluentAssertions.Primitives.NullableDateTimeOffsetAssertions Should(this System.DateTimeOffset? actualValue) { } - public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should(this System.Func action) { } + public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func action) { } public static FluentAssertions.Primitives.GuidAssertions Should(this System.Guid actualValue) { } public static FluentAssertions.Primitives.NullableGuidAssertions Should(this System.Guid? actualValue) { } - public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } - public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } - public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Types.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } - public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } - public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } - public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } + public static FluentAssertions.Streams.BufferedStreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.BufferedStream actualValue) { } + public static FluentAssertions.Streams.StreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.Stream actualValue) { } + public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Net.Http.HttpResponseMessage actualValue) { } + public static FluentAssertions.Types.AssemblyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.Assembly assembly) { } + public static FluentAssertions.Types.ConstructorInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.ConstructorInfo constructorInfo) { } + public static FluentAssertions.Types.MethodInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.MethodInfo methodInfo) { } + public static FluentAssertions.Types.PropertyInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.PropertyInfo propertyInfo) { } public static FluentAssertions.Primitives.SimpleTimeSpanAssertions Should(this System.TimeSpan actualValue) { } public static FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions Should(this System.TimeSpan? actualValue) { } - public static FluentAssertions.Types.TypeAssertions Should(this System.Type subject) { } - public static FluentAssertions.Xml.XAttributeAssertions Should(this System.Xml.Linq.XAttribute actualValue) { } - public static FluentAssertions.Xml.XDocumentAssertions Should(this System.Xml.Linq.XDocument actualValue) { } - public static FluentAssertions.Xml.XElementAssertions Should(this System.Xml.Linq.XElement actualValue) { } + public static FluentAssertions.Types.TypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Type subject) { } + public static FluentAssertions.Xml.XAttributeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XAttribute actualValue) { } + public static FluentAssertions.Xml.XDocumentAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XDocument actualValue) { } + public static FluentAssertions.Xml.XElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XElement actualValue) { } public static FluentAssertions.Primitives.BooleanAssertions Should(this bool actualValue) { } public static FluentAssertions.Primitives.NullableBooleanAssertions Should(this bool? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this byte actualValue) { } @@ -93,12 +93,12 @@ namespace FluentAssertions public static FluentAssertions.Numeric.NullableNumericAssertions Should(this int? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this long actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this long? actualValue) { } - public static FluentAssertions.Primitives.ObjectAssertions Should(this object actualValue) { } + public static FluentAssertions.Primitives.ObjectAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this object actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this sbyte actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this sbyte? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this short actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this short? actualValue) { } - public static FluentAssertions.Primitives.StringAssertions Should(this string actualValue) { } + public static FluentAssertions.Primitives.StringAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this string actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this uint actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this uint? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this ulong actualValue) { } @@ -133,10 +133,10 @@ namespace FluentAssertions "ly following \'And\'", true)] public static void Should(this FluentAssertions.Primitives.SimpleTimeSpanAssertions _) where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Collections.Generic.IEnumerable actualValue) { } - public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should(this System.Func> action) { } - public static FluentAssertions.Specialized.FunctionAssertions Should(this System.Func func) { } - public static FluentAssertions.Numeric.ComparableTypeAssertions Should(this System.IComparable comparableValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable actualValue) { } + public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func> action) { } + public static FluentAssertions.Specialized.FunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func func) { } + public static FluentAssertions.Numeric.ComparableTypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IComparable comparableValue) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] @@ -152,9 +152,9 @@ namespace FluentAssertions "ly following \'And\'", true)] public static void Should(this FluentAssertions.Primitives.ReferenceTypeAssertions _) where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { } - public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should(this System.Collections.Generic.IDictionary actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should(this System.Collections.Generic.IEnumerable> actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions Should(this TCollection actualValue) + public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IDictionary actualValue) { } + public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable> actualValue) { } + public static FluentAssertions.Collections.GenericDictionaryAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TCollection actualValue) where TCollection : System.Collections.Generic.IEnumerable> { } } public static class AssertionOptions @@ -359,8 +359,8 @@ namespace FluentAssertions } public static class XmlAssertionExtensions { - public static FluentAssertions.Xml.XmlElementAssertions Should(this System.Xml.XmlElement actualValue) { } - public static FluentAssertions.Xml.XmlNodeAssertions Should(this System.Xml.XmlNode actualValue) { } + public static FluentAssertions.Xml.XmlElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlElement actualValue) { } + public static FluentAssertions.Xml.XmlNodeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlNode actualValue) { } } } namespace FluentAssertions.Collections diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 6ed06ba856..6cfe491e28 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -57,33 +57,33 @@ namespace FluentAssertions [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } - public static FluentAssertions.Specialized.ActionAssertions Should(this System.Action action) { } - public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Collections.Generic.IEnumerable @this) { } + public static FluentAssertions.Specialized.ActionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Action action) { } + public static FluentAssertions.Collections.StringCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable @this) { } public static FluentAssertions.Primitives.DateOnlyAssertions Should(this System.DateOnly actualValue) { } public static FluentAssertions.Primitives.NullableDateOnlyAssertions Should(this System.DateOnly? actualValue) { } public static FluentAssertions.Primitives.DateTimeAssertions Should(this System.DateTime actualValue) { } public static FluentAssertions.Primitives.NullableDateTimeAssertions Should(this System.DateTime? actualValue) { } public static FluentAssertions.Primitives.DateTimeOffsetAssertions Should(this System.DateTimeOffset actualValue) { } public static FluentAssertions.Primitives.NullableDateTimeOffsetAssertions Should(this System.DateTimeOffset? actualValue) { } - public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should(this System.Func action) { } + public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func action) { } public static FluentAssertions.Primitives.GuidAssertions Should(this System.Guid actualValue) { } public static FluentAssertions.Primitives.NullableGuidAssertions Should(this System.Guid? actualValue) { } - public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } - public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } - public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Types.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } - public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } - public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } - public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } + public static FluentAssertions.Streams.BufferedStreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.BufferedStream actualValue) { } + public static FluentAssertions.Streams.StreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.Stream actualValue) { } + public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Net.Http.HttpResponseMessage actualValue) { } + public static FluentAssertions.Types.AssemblyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.Assembly assembly) { } + public static FluentAssertions.Types.ConstructorInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.ConstructorInfo constructorInfo) { } + public static FluentAssertions.Types.MethodInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.MethodInfo methodInfo) { } + public static FluentAssertions.Types.PropertyInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.PropertyInfo propertyInfo) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } public static FluentAssertions.Primitives.TimeOnlyAssertions Should(this System.TimeOnly actualValue) { } public static FluentAssertions.Primitives.NullableTimeOnlyAssertions Should(this System.TimeOnly? actualValue) { } public static FluentAssertions.Primitives.SimpleTimeSpanAssertions Should(this System.TimeSpan actualValue) { } public static FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions Should(this System.TimeSpan? actualValue) { } - public static FluentAssertions.Types.TypeAssertions Should(this System.Type subject) { } - public static FluentAssertions.Xml.XAttributeAssertions Should(this System.Xml.Linq.XAttribute actualValue) { } - public static FluentAssertions.Xml.XDocumentAssertions Should(this System.Xml.Linq.XDocument actualValue) { } - public static FluentAssertions.Xml.XElementAssertions Should(this System.Xml.Linq.XElement actualValue) { } + public static FluentAssertions.Types.TypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Type subject) { } + public static FluentAssertions.Xml.XAttributeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XAttribute actualValue) { } + public static FluentAssertions.Xml.XDocumentAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XDocument actualValue) { } + public static FluentAssertions.Xml.XElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XElement actualValue) { } public static FluentAssertions.Primitives.BooleanAssertions Should(this bool actualValue) { } public static FluentAssertions.Primitives.NullableBooleanAssertions Should(this bool? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this byte actualValue) { } @@ -98,12 +98,12 @@ namespace FluentAssertions public static FluentAssertions.Numeric.NullableNumericAssertions Should(this int? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this long actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this long? actualValue) { } - public static FluentAssertions.Primitives.ObjectAssertions Should(this object actualValue) { } + public static FluentAssertions.Primitives.ObjectAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this object actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this sbyte actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this sbyte? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this short actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this short? actualValue) { } - public static FluentAssertions.Primitives.StringAssertions Should(this string actualValue) { } + public static FluentAssertions.Primitives.StringAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this string actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this uint actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this uint? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this ulong actualValue) { } @@ -146,10 +146,10 @@ namespace FluentAssertions "ly following \'And\'", true)] public static void Should(this FluentAssertions.Primitives.TimeOnlyAssertions _) where TAssertions : FluentAssertions.Primitives.TimeOnlyAssertions { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Collections.Generic.IEnumerable actualValue) { } - public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should(this System.Func> action) { } - public static FluentAssertions.Specialized.FunctionAssertions Should(this System.Func func) { } - public static FluentAssertions.Numeric.ComparableTypeAssertions Should(this System.IComparable comparableValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable actualValue) { } + public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func> action) { } + public static FluentAssertions.Specialized.FunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func func) { } + public static FluentAssertions.Numeric.ComparableTypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IComparable comparableValue) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] @@ -165,9 +165,9 @@ namespace FluentAssertions "ly following \'And\'", true)] public static void Should(this FluentAssertions.Primitives.ReferenceTypeAssertions _) where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { } - public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should(this System.Collections.Generic.IDictionary actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should(this System.Collections.Generic.IEnumerable> actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions Should(this TCollection actualValue) + public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IDictionary actualValue) { } + public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable> actualValue) { } + public static FluentAssertions.Collections.GenericDictionaryAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TCollection actualValue) where TCollection : System.Collections.Generic.IEnumerable> { } } public static class AssertionOptions @@ -372,8 +372,8 @@ namespace FluentAssertions } public static class XmlAssertionExtensions { - public static FluentAssertions.Xml.XmlElementAssertions Should(this System.Xml.XmlElement actualValue) { } - public static FluentAssertions.Xml.XmlNodeAssertions Should(this System.Xml.XmlNode actualValue) { } + public static FluentAssertions.Xml.XmlElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlElement actualValue) { } + public static FluentAssertions.Xml.XmlNodeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlNode actualValue) { } } } namespace FluentAssertions.Collections diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index cc72431b8c..9e80ec66ba 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -56,28 +56,28 @@ namespace FluentAssertions [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } - public static FluentAssertions.Specialized.ActionAssertions Should(this System.Action action) { } - public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Collections.Generic.IEnumerable @this) { } + public static FluentAssertions.Specialized.ActionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Action action) { } + public static FluentAssertions.Collections.StringCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable @this) { } public static FluentAssertions.Primitives.DateTimeAssertions Should(this System.DateTime actualValue) { } public static FluentAssertions.Primitives.NullableDateTimeAssertions Should(this System.DateTime? actualValue) { } public static FluentAssertions.Primitives.DateTimeOffsetAssertions Should(this System.DateTimeOffset actualValue) { } public static FluentAssertions.Primitives.NullableDateTimeOffsetAssertions Should(this System.DateTimeOffset? actualValue) { } - public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should(this System.Func action) { } + public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func action) { } public static FluentAssertions.Primitives.GuidAssertions Should(this System.Guid actualValue) { } public static FluentAssertions.Primitives.NullableGuidAssertions Should(this System.Guid? actualValue) { } - public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } - public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } - public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Types.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } - public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } - public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } - public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } + public static FluentAssertions.Streams.BufferedStreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.BufferedStream actualValue) { } + public static FluentAssertions.Streams.StreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.Stream actualValue) { } + public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Net.Http.HttpResponseMessage actualValue) { } + public static FluentAssertions.Types.AssemblyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.Assembly assembly) { } + public static FluentAssertions.Types.ConstructorInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.ConstructorInfo constructorInfo) { } + public static FluentAssertions.Types.MethodInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.MethodInfo methodInfo) { } + public static FluentAssertions.Types.PropertyInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.PropertyInfo propertyInfo) { } public static FluentAssertions.Primitives.SimpleTimeSpanAssertions Should(this System.TimeSpan actualValue) { } public static FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions Should(this System.TimeSpan? actualValue) { } - public static FluentAssertions.Types.TypeAssertions Should(this System.Type subject) { } - public static FluentAssertions.Xml.XAttributeAssertions Should(this System.Xml.Linq.XAttribute actualValue) { } - public static FluentAssertions.Xml.XDocumentAssertions Should(this System.Xml.Linq.XDocument actualValue) { } - public static FluentAssertions.Xml.XElementAssertions Should(this System.Xml.Linq.XElement actualValue) { } + public static FluentAssertions.Types.TypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Type subject) { } + public static FluentAssertions.Xml.XAttributeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XAttribute actualValue) { } + public static FluentAssertions.Xml.XDocumentAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XDocument actualValue) { } + public static FluentAssertions.Xml.XElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XElement actualValue) { } public static FluentAssertions.Primitives.BooleanAssertions Should(this bool actualValue) { } public static FluentAssertions.Primitives.NullableBooleanAssertions Should(this bool? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this byte actualValue) { } @@ -92,12 +92,12 @@ namespace FluentAssertions public static FluentAssertions.Numeric.NullableNumericAssertions Should(this int? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this long actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this long? actualValue) { } - public static FluentAssertions.Primitives.ObjectAssertions Should(this object actualValue) { } + public static FluentAssertions.Primitives.ObjectAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this object actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this sbyte actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this sbyte? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this short actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this short? actualValue) { } - public static FluentAssertions.Primitives.StringAssertions Should(this string actualValue) { } + public static FluentAssertions.Primitives.StringAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this string actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this uint actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this uint? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this ulong actualValue) { } @@ -132,10 +132,10 @@ namespace FluentAssertions "ly following \'And\'", true)] public static void Should(this FluentAssertions.Primitives.SimpleTimeSpanAssertions _) where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Collections.Generic.IEnumerable actualValue) { } - public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should(this System.Func> action) { } - public static FluentAssertions.Specialized.FunctionAssertions Should(this System.Func func) { } - public static FluentAssertions.Numeric.ComparableTypeAssertions Should(this System.IComparable comparableValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable actualValue) { } + public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func> action) { } + public static FluentAssertions.Specialized.FunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func func) { } + public static FluentAssertions.Numeric.ComparableTypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IComparable comparableValue) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] @@ -151,9 +151,9 @@ namespace FluentAssertions "ly following \'And\'", true)] public static void Should(this FluentAssertions.Primitives.ReferenceTypeAssertions _) where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { } - public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should(this System.Collections.Generic.IDictionary actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should(this System.Collections.Generic.IEnumerable> actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions Should(this TCollection actualValue) + public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IDictionary actualValue) { } + public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable> actualValue) { } + public static FluentAssertions.Collections.GenericDictionaryAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TCollection actualValue) where TCollection : System.Collections.Generic.IEnumerable> { } } public static class AssertionOptions @@ -352,8 +352,8 @@ namespace FluentAssertions } public static class XmlAssertionExtensions { - public static FluentAssertions.Xml.XmlElementAssertions Should(this System.Xml.XmlElement actualValue) { } - public static FluentAssertions.Xml.XmlNodeAssertions Should(this System.Xml.XmlNode actualValue) { } + public static FluentAssertions.Xml.XmlElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlElement actualValue) { } + public static FluentAssertions.Xml.XmlNodeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlNode actualValue) { } } } namespace FluentAssertions.Collections diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index eddae6d711..08e7215e61 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -57,28 +57,28 @@ namespace FluentAssertions [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } - public static FluentAssertions.Specialized.ActionAssertions Should(this System.Action action) { } - public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Collections.Generic.IEnumerable @this) { } + public static FluentAssertions.Specialized.ActionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Action action) { } + public static FluentAssertions.Collections.StringCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable @this) { } public static FluentAssertions.Primitives.DateTimeAssertions Should(this System.DateTime actualValue) { } public static FluentAssertions.Primitives.NullableDateTimeAssertions Should(this System.DateTime? actualValue) { } public static FluentAssertions.Primitives.DateTimeOffsetAssertions Should(this System.DateTimeOffset actualValue) { } public static FluentAssertions.Primitives.NullableDateTimeOffsetAssertions Should(this System.DateTimeOffset? actualValue) { } - public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should(this System.Func action) { } + public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func action) { } public static FluentAssertions.Primitives.GuidAssertions Should(this System.Guid actualValue) { } public static FluentAssertions.Primitives.NullableGuidAssertions Should(this System.Guid? actualValue) { } - public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } - public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } - public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Types.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } - public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } - public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } - public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } + public static FluentAssertions.Streams.BufferedStreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.BufferedStream actualValue) { } + public static FluentAssertions.Streams.StreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.Stream actualValue) { } + public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Net.Http.HttpResponseMessage actualValue) { } + public static FluentAssertions.Types.AssemblyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.Assembly assembly) { } + public static FluentAssertions.Types.ConstructorInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.ConstructorInfo constructorInfo) { } + public static FluentAssertions.Types.MethodInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.MethodInfo methodInfo) { } + public static FluentAssertions.Types.PropertyInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.PropertyInfo propertyInfo) { } public static FluentAssertions.Primitives.SimpleTimeSpanAssertions Should(this System.TimeSpan actualValue) { } public static FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions Should(this System.TimeSpan? actualValue) { } - public static FluentAssertions.Types.TypeAssertions Should(this System.Type subject) { } - public static FluentAssertions.Xml.XAttributeAssertions Should(this System.Xml.Linq.XAttribute actualValue) { } - public static FluentAssertions.Xml.XDocumentAssertions Should(this System.Xml.Linq.XDocument actualValue) { } - public static FluentAssertions.Xml.XElementAssertions Should(this System.Xml.Linq.XElement actualValue) { } + public static FluentAssertions.Types.TypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Type subject) { } + public static FluentAssertions.Xml.XAttributeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XAttribute actualValue) { } + public static FluentAssertions.Xml.XDocumentAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XDocument actualValue) { } + public static FluentAssertions.Xml.XElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XElement actualValue) { } public static FluentAssertions.Primitives.BooleanAssertions Should(this bool actualValue) { } public static FluentAssertions.Primitives.NullableBooleanAssertions Should(this bool? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this byte actualValue) { } @@ -93,12 +93,12 @@ namespace FluentAssertions public static FluentAssertions.Numeric.NullableNumericAssertions Should(this int? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this long actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this long? actualValue) { } - public static FluentAssertions.Primitives.ObjectAssertions Should(this object actualValue) { } + public static FluentAssertions.Primitives.ObjectAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this object actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this sbyte actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this sbyte? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this short actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this short? actualValue) { } - public static FluentAssertions.Primitives.StringAssertions Should(this string actualValue) { } + public static FluentAssertions.Primitives.StringAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this string actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this uint actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this uint? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this ulong actualValue) { } @@ -133,10 +133,10 @@ namespace FluentAssertions "ly following \'And\'", true)] public static void Should(this FluentAssertions.Primitives.SimpleTimeSpanAssertions _) where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Collections.Generic.IEnumerable actualValue) { } - public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should(this System.Func> action) { } - public static FluentAssertions.Specialized.FunctionAssertions Should(this System.Func func) { } - public static FluentAssertions.Numeric.ComparableTypeAssertions Should(this System.IComparable comparableValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable actualValue) { } + public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func> action) { } + public static FluentAssertions.Specialized.FunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func func) { } + public static FluentAssertions.Numeric.ComparableTypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IComparable comparableValue) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] @@ -152,9 +152,9 @@ namespace FluentAssertions "ly following \'And\'", true)] public static void Should(this FluentAssertions.Primitives.ReferenceTypeAssertions _) where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { } - public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should(this System.Collections.Generic.IDictionary actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should(this System.Collections.Generic.IEnumerable> actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions Should(this TCollection actualValue) + public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IDictionary actualValue) { } + public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable> actualValue) { } + public static FluentAssertions.Collections.GenericDictionaryAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TCollection actualValue) where TCollection : System.Collections.Generic.IEnumerable> { } } public static class AssertionOptions @@ -359,8 +359,8 @@ namespace FluentAssertions } public static class XmlAssertionExtensions { - public static FluentAssertions.Xml.XmlElementAssertions Should(this System.Xml.XmlElement actualValue) { } - public static FluentAssertions.Xml.XmlNodeAssertions Should(this System.Xml.XmlNode actualValue) { } + public static FluentAssertions.Xml.XmlElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlElement actualValue) { } + public static FluentAssertions.Xml.XmlNodeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlNode actualValue) { } } } namespace FluentAssertions.Collections diff --git a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs index b8f66ddf93..9ee81a9033 100644 --- a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; using FluentAssertions.Common; @@ -157,6 +158,39 @@ public void Should_methods_have_a_matching_overload_to_guard_against_chaining_an "AssertionExtensions.cs should have a guard overload of Should calling InvalidShouldCall()"); } + [Theory] + [MemberData(nameof(GetShouldMethods), true)] + public void Should_methods_returning_reference_type_assertions_are_annotated_with_not_null_attribute(MethodInfo method) + { + var notNullAttribute = method.GetParameters().Single().GetCustomAttribute(); + notNullAttribute.Should().NotBeNull(); + } + + [Theory] + [MemberData(nameof(GetShouldMethods), false)] + public void Should_methods_not_returning_reference_type_assertions_are_not_annotated_with_not_null_attribute(MethodInfo method) + { + var notNullAttribute = method.GetParameters().Single().GetCustomAttribute(); + notNullAttribute.Should().BeNull(); + } + + public static IEnumerable GetShouldMethods(bool referenceTypes) + { + return AllTypes.From(typeof(FluentAssertions.AssertionExtensions).Assembly) + .ThatAreClasses() + .ThatAreStatic() + .Where(t => t.IsPublic) + .SelectMany(t => t.GetMethods(BindingFlags.Static | BindingFlags.Public)) + .Where(m => m.Name == "Should" + && !IsGuardOverload(m) + && m.GetParameters().Length == 1 + && (referenceTypes ? ReturnsReferenceTypeAssertions(m) : !ReturnsReferenceTypeAssertions(m))) + .Select(m => new object[] { m }); + } + + private static bool ReturnsReferenceTypeAssertions(MethodInfo m) => + m.ReturnType.IsAssignableToOpenGeneric(typeof(ReferenceTypeAssertions<,>)); + private static bool IsGuardOverload(MethodInfo m) => m.ReturnType == typeof(void) && m.IsDefined(typeof(ObsoleteAttribute)); diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 81f21c6577..60e4646c24 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -20,6 +20,7 @@ sidebar: * Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) * You can mark all assertions in an assembly as custom assertions using the `[CustomAssertionsAssembly]` attribute - [#2389](https://github.com/fluentassertions/fluentassertions/pull/2389) * Improve `BeEmpty()` and `BeNullOrEmpty()` performance for `IEnumerable`, by materializing only the first item - [#2530](https://github.com/fluentassertions/fluentassertions/pull/2530) +* All `Should()` methods on reference types are now annotated with the `[NotNull]` attribute for a better Fluent Assertions experience when nullable reference types are enabled - [#2380](https://github.com/fluentassertions/fluentassertions/pull/2380) ### Fixes * Fixed formatting error when checking nullable `DateTimeOffset` with From f3ff0ff2b8f2cbf5864871d0748fc291a2d0edfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sun, 14 Jan 2024 18:10:22 +0100 Subject: [PATCH 251/845] Allow specifying `EquivalencyOptions` in string assertions (#2413) --- .../Common/StringExtensions.cs | 32 +- .../CollectionMemberOptionsDecorator.cs | 6 + .../Equivalency/IEquivalencyOptions.cs | 15 + .../SelfReferenceEquivalencyOptions.cs | 61 ++ .../Steps/StringEqualityEquivalencyStep.cs | 30 +- .../Primitives/NegatedStringStartStrategy.cs | 33 - .../Primitives/StringAssertions.cs | 727 +++++++++++++++--- .../Primitives/StringContainsStrategy.cs | 30 + .../Primitives/StringEndStrategy.cs | 41 + .../Primitives/StringEqualityStrategy.cs | 31 +- .../Primitives/StringStartStrategy.cs | 28 +- .../StringValidatorSupportingNull.cs | 32 + .../FluentAssertions/net47.verified.txt | 21 + .../FluentAssertions/net6.0.verified.txt | 21 + .../netstandard2.0.verified.txt | 21 + .../netstandard2.1.verified.txt | 21 + .../UsersOfGetClosedGenericInterfaces.cs | 8 + ...lectionAssertionSpecs.AllBeEquivalentTo.cs | 42 + ...CollectionAssertionSpecs.BeEquivalentTo.cs | 33 + .../ObjectAssertionSpecs.BeEquivalentTo.cs | 42 + .../StringAssertionSpecs.BeEquivalentTo.cs | 129 ++++ ...tringAssertionSpecs.ContainEquivalentOf.cs | 159 +++- .../StringAssertionSpecs.EndWith.cs | 10 +- ...tringAssertionSpecs.EndWithEquivalentOf.cs | 143 +++- .../StringAssertionSpecs.MatchEquivalentOf.cs | 75 ++ .../StringAssertionSpecs.StartWith.cs | 37 +- ...ingAssertionSpecs.StartWithEquivalentOf.cs | 139 +++- .../Primitives/StringAssertionSpecs.cs | 29 +- docs/_pages/releases.md | 2 + docs/_pages/strings.md | 20 + qodana.yaml | 1 + 31 files changed, 1760 insertions(+), 259 deletions(-) delete mode 100644 Src/FluentAssertions/Primitives/NegatedStringStartStrategy.cs create mode 100644 Src/FluentAssertions/Primitives/StringContainsStrategy.cs create mode 100644 Src/FluentAssertions/Primitives/StringEndStrategy.cs create mode 100644 Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllBeEquivalentTo.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeEquivalentTo.cs diff --git a/Src/FluentAssertions/Common/StringExtensions.cs b/Src/FluentAssertions/Common/StringExtensions.cs index e464129d4b..0c51b94a26 100644 --- a/Src/FluentAssertions/Common/StringExtensions.cs +++ b/Src/FluentAssertions/Common/StringExtensions.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using FluentAssertions.Formatting; @@ -9,15 +10,13 @@ internal static class StringExtensions { /// /// Finds the first index at which the does not match the - /// string anymore, accounting for the specified . + /// string anymore, accounting for the specified . /// - public static int IndexOfFirstMismatch(this string value, string expected, StringComparison stringComparison) + public static int IndexOfFirstMismatch(this string value, string expected, IEqualityComparer comparer) { - Func comparer = GetCharComparer(stringComparison); - for (int index = 0; index < value.Length; index++) { - if (index >= expected.Length || !comparer(value[index], expected[index])) + if (index >= expected.Length || !comparer.Equals(value[index..(index + 1)], expected[index..(index + 1)])) { return index; } @@ -26,11 +25,6 @@ public static int IndexOfFirstMismatch(this string value, string expected, Strin return -1; } - private static Func GetCharComparer(StringComparison stringComparison) => - stringComparison == StringComparison.Ordinal - ? (x, y) => x == y - : (x, y) => char.ToUpperInvariant(x) == char.ToUpperInvariant(y); - /// /// Gets the quoted three characters at the specified index of a string, including the index itself. /// @@ -129,23 +123,21 @@ public static string RemoveNewLines(this string @this) } /// - /// Counts the number of times a substring appears within a string by using the specified . + /// Counts the number of times the appears within a string by using the specified . /// - /// The string to search in. - /// The substring to search for. - /// The option to use for comparison. - public static int CountSubstring(this string str, string substring, StringComparison comparisonType) + public static int CountSubstring(this string str, string substring, IEqualityComparer comparer) { string actual = str ?? string.Empty; string search = substring ?? string.Empty; int count = 0; - int index = 0; - - while ((index = actual.IndexOf(search, index, comparisonType)) >= 0) + int maxIndex = actual.Length - search.Length; + for (int index = 0; index <= maxIndex; index++) { - index += search.Length; - count++; + if (comparer.Equals(actual[index..(index + search.Length)], search)) + { + count++; + } } return count; diff --git a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs index 760553caf9..a9dbb88892 100644 --- a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs +++ b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs @@ -73,5 +73,11 @@ public EqualityStrategy GetEqualityStrategy(Type type) return inner.GetEqualityStrategy(type); } + public bool IgnoreLeadingWhitespace => inner.IgnoreLeadingWhitespace; + + public bool IgnoreTrailingWhitespace => inner.IgnoreTrailingWhitespace; + + public bool IgnoreCase => inner.IgnoreCase; + public ITraceWriter TraceWriter => inner.TraceWriter; } diff --git a/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs index 340cf5c2f7..4f00effa3e 100644 --- a/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs @@ -98,4 +98,19 @@ public interface IEquivalencyOptions /// Determines the right strategy for evaluating the equality of objects of this type. /// EqualityStrategy GetEqualityStrategy(Type type); + + /// + /// Gets a value indicating whether leading whitespace is ignored when comparing s. + /// + bool IgnoreLeadingWhitespace { get; } + + /// + /// Gets a value indicating whether trailing whitespace is ignored when comparing s. + /// + bool IgnoreTrailingWhitespace { get; } + + /// + /// Gets a value indicating whether a case-insensitive comparer is used when comparing s. + /// + bool IgnoreCase { get; } } diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index d6ded7a071..eb7f447f82 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -56,6 +56,8 @@ public abstract class SelfReferenceEquivalencyOptions : IEquivalencyOptio private bool ignoreNonBrowsableOnSubject; private bool excludeNonBrowsableOnExpectation; + private IEqualityComparer stringComparer; + #endregion private protected SelfReferenceEquivalencyOptions() @@ -86,6 +88,9 @@ protected SelfReferenceEquivalencyOptions(IEquivalencyOptions defaults) includedFields = defaults.IncludedFields; ignoreNonBrowsableOnSubject = defaults.IgnoreNonBrowsableOnSubject; excludeNonBrowsableOnExpectation = defaults.ExcludeNonBrowsableOnExpectation; + IgnoreLeadingWhitespace = defaults.IgnoreLeadingWhitespace; + IgnoreTrailingWhitespace = defaults.IgnoreTrailingWhitespace; + IgnoreCase = defaults.IgnoreCase; ConversionSelector = defaults.ConversionSelector.Clone(); @@ -180,6 +185,12 @@ IEnumerable IEquivalencyOptions.SelectionRules EqualityStrategy IEquivalencyOptions.GetEqualityStrategy(Type type) => equalityStrategyProvider.GetEqualityStrategy(type); + public bool IgnoreLeadingWhitespace { get; private set; } + + public bool IgnoreTrailingWhitespace { get; private set; } + + public bool IgnoreCase { get; private set; } + public ITraceWriter TraceWriter { get; private set; } /// @@ -497,6 +508,18 @@ public TSelf Using(IEqualityComparer comparer) return (TSelf)this; } + /// + /// Ensures the equivalency comparison will use the specified implementation of + /// any time when a property is a . + /// + public TSelf Using(IEqualityComparer comparer) + { + userEquivalencySteps.Insert(0, new EqualityComparerEquivalencyStep(comparer)); + stringComparer = comparer; + + return (TSelf)this; + } + /// /// Causes all collections to be compared in the order in which the items appear in the expectation. /// @@ -679,6 +702,44 @@ public TSelf WithoutAutoConversionFor(Expression> predic return (TSelf)this; } + /// + /// Instructs the comparison to ignore leading whitespace when comparing s. + /// + /// + /// Note: This affects the index of first mismatch, as the removed whitespace is also ignored for the index calculation! + /// + public TSelf IgnoringLeadingWhitespace() + { + IgnoreLeadingWhitespace = true; + return (TSelf)this; + } + + /// + /// Instructs the comparison to ignore trailing whitespace when comparing s. + /// + public TSelf IgnoringTrailingWhitespace() + { + IgnoreTrailingWhitespace = true; + return (TSelf)this; + } + + /// + /// Instructs the comparison to compare s case-insensitive. + /// + public TSelf IgnoringCase() + { + IgnoreCase = true; + return (TSelf)this; + } + + /// + /// Returns the comparer for strings, which is either an explicitly specified comparer via or an ordinal comparer depending on . + /// + internal IEqualityComparer GetStringComparerOrDefault() + { + return stringComparer ?? (IgnoreCase ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal); + } + /// /// Returns a string that represents the current object. /// diff --git a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs index ce7f0f5ef9..692a375c61 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs @@ -28,12 +28,40 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon string expectation = (string)comparands.Expectation; subject.Should() - .Be(expectation, context.Reason.FormattedMessage, context.Reason.Arguments); + .Be(expectation, CreateOptions(context.Options), + context.Reason.FormattedMessage, context.Reason.Arguments); } return EquivalencyResult.AssertionCompleted; } + private static Func, EquivalencyOptions> + CreateOptions(IEquivalencyOptions existingOptions) => + o => + { + if (existingOptions is EquivalencyOptions equivalencyOptions) + { + return equivalencyOptions; + } + + if (existingOptions.IgnoreLeadingWhitespace) + { + o.IgnoringLeadingWhitespace(); + } + + if (existingOptions.IgnoreTrailingWhitespace) + { + o.IgnoringTrailingWhitespace(); + } + + if (existingOptions.IgnoreCase) + { + o.IgnoringCase(); + } + + return o; + }; + private static bool ValidateAgainstNulls(Comparands comparands, INode currentNode) { object expected = comparands.Expectation; diff --git a/Src/FluentAssertions/Primitives/NegatedStringStartStrategy.cs b/Src/FluentAssertions/Primitives/NegatedStringStartStrategy.cs deleted file mode 100644 index 32e3429e2b..0000000000 --- a/Src/FluentAssertions/Primitives/NegatedStringStartStrategy.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using FluentAssertions.Execution; - -namespace FluentAssertions.Primitives; - -internal class NegatedStringStartStrategy : IStringComparisonStrategy -{ - private readonly StringComparison stringComparison; - - public NegatedStringStartStrategy(StringComparison stringComparison) - { - this.stringComparison = stringComparison; - } - - public string ExpectationDescription - { - get - { - string predicateDescription = IgnoreCase ? "start with equivalent of" : "start with"; - return "Expected {context:string} that does not " + predicateDescription + " "; - } - } - - private bool IgnoreCase - => stringComparison == StringComparison.OrdinalIgnoreCase; - - public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected) - { - assertion - .ForCondition(!subject.StartsWith(expected, stringComparison)) - .FailWith(ExpectationDescription + "{0}{reason}, but found {1}.", expected, subject); - } -} diff --git a/Src/FluentAssertions/Primitives/StringAssertions.cs b/Src/FluentAssertions/Primitives/StringAssertions.cs index ba82219096..9a045dc0cc 100644 --- a/Src/FluentAssertions/Primitives/StringAssertions.cs +++ b/Src/FluentAssertions/Primitives/StringAssertions.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Text.RegularExpressions; using FluentAssertions.Common; +using FluentAssertions.Equivalency; using FluentAssertions.Execution; using JetBrains.Annotations; @@ -54,7 +55,7 @@ public StringAssertions(string value) public AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { var stringEqualityValidator = new StringValidator( - new StringEqualityStrategy(StringComparison.Ordinal), + new StringEqualityStrategy(StringComparer.Ordinal, "be"), because, becauseArgs); stringEqualityValidator.Validate(Subject, expected); @@ -110,11 +111,11 @@ public AndConstraint BeOneOf(IEnumerable validValues, strin /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeEquivalentTo(string expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeEquivalentTo(string expected, + string because = "", params object[] becauseArgs) { var expectation = new StringValidator( - new StringEqualityStrategy(StringComparison.OrdinalIgnoreCase), + new StringEqualityStrategy(StringComparer.OrdinalIgnoreCase, "be equivalent to"), because, becauseArgs); expectation.Validate(Subject, expected); @@ -122,6 +123,41 @@ public AndConstraint BeEquivalentTo(string expected, string because return new AndConstraint((TAssertions)this); } + /// + /// Asserts that a string is exactly the same as another string, using the provided . + /// + /// + /// The string that the subject is expected to be equivalent to. + /// + /// + /// The equivalency options. + /// + /// + /// 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 BeEquivalentTo(string expected, + Func, EquivalencyOptions> config, + string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(config); + + EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + + var expectation = new StringValidator( + new StringEqualityStrategy(options.GetStringComparerOrDefault(), "be equivalent to"), + because, becauseArgs); + + var subject = ApplyStringSettings(Subject, options); + expected = ApplyStringSettings(expected, options); + + expectation.Validate(subject, expected); + return new AndConstraint((TAssertions)this); + } + /// /// Asserts that a string is not exactly the same as another string, including any leading or trailing whitespace, with /// the exception of the casing. @@ -136,8 +172,8 @@ public AndConstraint BeEquivalentTo(string expected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeEquivalentTo(string unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeEquivalentTo(string unexpected, + string because = "", params object[] becauseArgs) { bool notEquivalent; @@ -155,6 +191,44 @@ public AndConstraint NotBeEquivalentTo(string unexpected, string be return new AndConstraint((TAssertions)this); } + /// + /// Asserts that a string is not exactly the same as another string, using the provided . + /// + /// + /// The string that the subject is not expected to be equivalent to. + /// + /// + /// The equivalency options. + /// + /// + /// 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 NotBeEquivalentTo(string unexpected, + Func, EquivalencyOptions> config, + string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(config); + + bool notEquivalent; + + using (var scope = new AssertionScope()) + { + Subject.Should().BeEquivalentTo(unexpected, config); + notEquivalent = scope.Discard().Length > 0; + } + + Execute.Assertion + .ForCondition(notEquivalent) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:string} not to be equivalent to {0}{reason}, but they are.", unexpected); + + return new AndConstraint((TAssertions)this); + } + /// /// Asserts that a string is not exactly the same as the specified , /// including the casing and any leading or trailing whitespace. @@ -319,8 +393,8 @@ public AndConstraint NotMatch(string wildcardPattern, string becaus /// /// is . /// is empty. - public AndConstraint MatchEquivalentOf(string wildcardPattern, string because = "", - params object[] becauseArgs) + public AndConstraint MatchEquivalentOf(string wildcardPattern, + string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(wildcardPattern, nameof(wildcardPattern), "Cannot match string against . Provide a wildcard pattern or use the BeNull method."); @@ -341,6 +415,72 @@ public AndConstraint MatchEquivalentOf(string wildcardPattern, stri return new AndConstraint((TAssertions)this); } + /// + /// Asserts that a string matches the , using the provided . + /// + /// + /// The pattern to match against the subject. This parameter can contain a combination of literal text and wildcard + /// (* and ?) characters, but it doesn't support regular expressions. + /// + /// + /// The equivalency options. + /// + /// + /// 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 . + /// + /// + /// can be a combination of literal and wildcard characters, + /// but it doesn't support regular expressions. The following wildcard specifiers are permitted in + /// . + /// + /// + /// Wildcard character + /// Description + /// + /// + /// * (asterisk) + /// Zero or more characters in that position. + /// + /// + /// ? (question mark) + /// Exactly one character in that position. + /// + /// + /// + /// is . + /// is empty. + public AndConstraint MatchEquivalentOf(string wildcardPattern, + Func, EquivalencyOptions> config, + string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(wildcardPattern, nameof(wildcardPattern), + "Cannot match string against . Provide a wildcard pattern or use the BeNull method."); + + Guard.ThrowIfArgumentIsEmpty(wildcardPattern, nameof(wildcardPattern), + "Cannot match string against an empty string. Provide a wildcard pattern or use the BeEmpty method."); + + Guard.ThrowIfArgumentIsNull(config); + + EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + + var stringWildcardMatchingValidator = new StringValidator( + new StringWildcardMatchingStrategy + { + IgnoreCase = options.IgnoreCase + }, + because, becauseArgs); + + var subject = ApplyStringSettings(Subject, options); + wildcardPattern = ApplyStringSettings(wildcardPattern, options); + + stringWildcardMatchingValidator.Validate(subject, wildcardPattern); + return new AndConstraint((TAssertions)this); + } + /// /// Asserts that a string does not match the . /// @@ -376,8 +516,8 @@ public AndConstraint MatchEquivalentOf(string wildcardPattern, stri /// /// is . /// is empty. - public AndConstraint NotMatchEquivalentOf(string wildcardPattern, string because = "", - params object[] becauseArgs) + public AndConstraint NotMatchEquivalentOf(string wildcardPattern, + string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(wildcardPattern, nameof(wildcardPattern), "Cannot match string against . Provide a wildcard pattern or use the NotBeNull method."); @@ -399,6 +539,73 @@ public AndConstraint NotMatchEquivalentOf(string wildcardPattern, s return new AndConstraint((TAssertions)this); } + /// + /// Asserts that a string does not match the , using the provided . + /// + /// + /// The pattern to match against the subject. This parameter can contain a combination of literal text and wildcard + /// (* and ?) characters, but it doesn't support regular expressions. + /// + /// + /// The equivalency options. + /// + /// + /// 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 . + /// + /// + /// can be a combination of literal and wildcard characters, + /// but it doesn't support regular expressions. The following wildcard specifiers are permitted in + /// . + /// + /// + /// Wildcard character + /// Description + /// + /// + /// * (asterisk) + /// Zero or more characters in that position. + /// + /// + /// ? (question mark) + /// Exactly one character in that position. + /// + /// + /// + /// is . + /// is empty. + public AndConstraint NotMatchEquivalentOf(string wildcardPattern, + Func, EquivalencyOptions> config, + string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(wildcardPattern, nameof(wildcardPattern), + "Cannot match string against . Provide a wildcard pattern or use the NotBeNull method."); + + Guard.ThrowIfArgumentIsEmpty(wildcardPattern, nameof(wildcardPattern), + "Cannot match string against an empty string. Provide a wildcard pattern or use the NotBeEmpty method."); + + Guard.ThrowIfArgumentIsNull(config); + + EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + + var stringWildcardMatchingValidator = new StringValidator( + new StringWildcardMatchingStrategy + { + IgnoreCase = options.IgnoreCase, + Negate = true + }, + because, becauseArgs); + + var subject = ApplyStringSettings(Subject, options); + wildcardPattern = ApplyStringSettings(wildcardPattern, options); + + stringWildcardMatchingValidator.Validate(subject, wildcardPattern); + return new AndConstraint((TAssertions)this); + } + /// /// Asserts that a string matches a regular expression with expected occurrence /// @@ -501,7 +708,8 @@ public AndConstraint MatchRegex([RegexPattern][StringSyntax("Regex" /// is . /// is empty. public AndConstraint MatchRegex(Regex regularExpression, - OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) + OccurrenceConstraint occurrenceConstraint, + string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(regularExpression, nameof(regularExpression), "Cannot match string against . Provide a regex pattern or use the BeNull method."); @@ -519,7 +727,7 @@ public AndConstraint MatchRegex(Regex regularExpression, if (success) { - int actual = regularExpression.Matches(Subject).Count; + int actual = regularExpression.Matches(Subject!).Count; Execute.Assertion .ForConstraint(occurrenceConstraint, actual) @@ -568,7 +776,7 @@ public AndConstraint MatchRegex(Regex regularExpression, if (success) { Execute.Assertion - .ForCondition(regularExpression.IsMatch(Subject)) + .ForCondition(regularExpression.IsMatch(Subject!)) .BecauseOf(because, becauseArgs) .UsingLineBreaks .FailWith("Expected {context:string} to match regex {0}{reason}, but {1} does not match.", regexStr, Subject); @@ -648,7 +856,7 @@ public AndConstraint NotMatchRegex(Regex regularExpression, string if (success) { Execute.Assertion - .ForCondition(!regularExpression.IsMatch(Subject)) + .ForCondition(!regularExpression.IsMatch(Subject!)) .BecauseOf(because, becauseArgs) .UsingLineBreaks .FailWith("Did not expect {context:string} to match regex {0}{reason}, but {1} matches.", regexStr, Subject); @@ -675,7 +883,7 @@ public AndConstraint StartWith(string expected, string because = "" Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare start of string with ."); var stringStartValidator = new StringValidator( - new StringStartStrategy(StringComparison.Ordinal), + new StringStartStrategy(StringComparer.Ordinal, "start with"), because, becauseArgs); stringStartValidator.Validate(Subject, expected); @@ -700,11 +908,18 @@ public AndConstraint NotStartWith(string unexpected, string because { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare start of string with ."); - var negatedStringStartValidator = new StringValidator( - new NegatedStringStartStrategy(StringComparison.Ordinal), - because, becauseArgs); + bool notEquivalent; + + using (var scope = new AssertionScope()) + { + Subject.Should().StartWith(unexpected); + notEquivalent = scope.Discard().Length > 0; + } - negatedStringStartValidator.Validate(Subject, unexpected); + Execute.Assertion + .ForCondition(Subject != null && notEquivalent) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:string} not to start with {0}{reason}, but found {1}.", unexpected, Subject); return new AndConstraint((TAssertions)this); } @@ -722,13 +937,13 @@ public AndConstraint NotStartWith(string unexpected, string because /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint StartWithEquivalentOf(string expected, string because = "", - params object[] becauseArgs) + public AndConstraint StartWithEquivalentOf(string expected, + string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare string start equivalence with ."); var stringStartValidator = new StringValidator( - new StringStartStrategy(StringComparison.OrdinalIgnoreCase), + new StringStartStrategy(StringComparer.OrdinalIgnoreCase, "start with equivalent of"), because, becauseArgs); stringStartValidator.Validate(Subject, expected); @@ -736,6 +951,41 @@ public AndConstraint StartWithEquivalentOf(string expected, string return new AndConstraint((TAssertions)this); } + /// + /// Asserts that a string starts with the specified , using the provided . + /// + /// The string that the subject is expected to start with. + /// + /// The equivalency options. + /// + /// + /// 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 . + /// + /// is . + public AndConstraint StartWithEquivalentOf(string expected, + Func, EquivalencyOptions> config, + string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare string start equivalence with ."); + Guard.ThrowIfArgumentIsNull(config); + + EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + + var stringStartValidator = new StringValidator( + new StringStartStrategy(options.GetStringComparerOrDefault(), "start with equivalent of"), + because, becauseArgs); + + var subject = ApplyStringSettings(Subject, options); + expected = ApplyStringSettings(expected, options); + + stringStartValidator.Validate(subject, expected); + return new AndConstraint((TAssertions)this); + } + /// /// Asserts that a string does not start with the specified value, /// including any leading or trailing whitespace, with the exception of the casing. @@ -749,16 +999,61 @@ public AndConstraint StartWithEquivalentOf(string expected, string /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotStartWithEquivalentOf(string unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotStartWithEquivalentOf(string unexpected, + string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare start of string with ."); - var negatedStringStartValidator = new StringValidator( - new NegatedStringStartStrategy(StringComparison.OrdinalIgnoreCase), - because, becauseArgs); + bool notEquivalent; - negatedStringStartValidator.Validate(Subject, unexpected); + using (var scope = new AssertionScope()) + { + Subject.Should().StartWithEquivalentOf(unexpected); + notEquivalent = scope.Discard().Length > 0; + } + + Execute.Assertion + .ForCondition(Subject != null && notEquivalent) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:string} not to start with equivalent of {0}{reason}, but found {1}.", unexpected, Subject); + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that a string does not start with the specified value, using the provided . + /// + /// The string that the subject is not expected to start with. + /// + /// The equivalency options. + /// + /// + /// 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 . + /// + /// is . + public AndConstraint NotStartWithEquivalentOf(string unexpected, + Func, EquivalencyOptions> config, + string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare start of string with ."); + Guard.ThrowIfArgumentIsNull(config); + + bool notEquivalent; + + using (var scope = new AssertionScope()) + { + Subject.Should().StartWithEquivalentOf(unexpected, config); + notEquivalent = scope.Discard().Length > 0; + } + + Execute.Assertion + .ForCondition(Subject != null && notEquivalent) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:string} not to start with equivalent of {0}{reason}, but found {1}.", unexpected, Subject); return new AndConstraint((TAssertions)this); } @@ -780,26 +1075,11 @@ public AndConstraint EndWith(string expected, string because = "", { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare string end with ."); - bool success = Execute.Assertion - .BecauseOf(because, becauseArgs) - .ForCondition(Subject is not null) - .FailWith("Expected {context:string} {0} to end with {1}{reason}.", Subject, expected); - - if (success) - { - success = Execute.Assertion - .BecauseOf(because, becauseArgs) - .ForCondition(Subject.Length >= expected.Length) - .FailWith("Expected {context:string} to end with {0}{reason}, but {1} is too short.", expected, Subject); + var stringEndValidator = new StringValidator( + new StringEndStrategy(StringComparer.Ordinal, "end with"), + because, becauseArgs); - if (success) - { - Execute.Assertion - .ForCondition(Subject.EndsWith(expected, StringComparison.Ordinal)) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:string} {0} to end with {1}{reason}.", Subject, expected); - } - } + stringEndValidator.Validate(Subject, expected); return new AndConstraint((TAssertions)this); } @@ -821,19 +1101,19 @@ public AndConstraint NotEndWith(string unexpected, string because = { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare end of string with ."); - bool success = Execute.Assertion - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:string} that does not end with {1}{reason}, but found {0}.", Subject, unexpected); + bool notEquivalent; - if (success) + using (var scope = new AssertionScope()) { - Execute.Assertion - .ForCondition(!Subject.EndsWith(unexpected, StringComparison.Ordinal)) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:string} {0} not to end with {1}{reason}.", Subject, unexpected); + Subject.Should().EndWith(unexpected); + notEquivalent = scope.Discard().Length > 0; } + Execute.Assertion + .ForCondition(Subject != null && notEquivalent) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:string} not to end with {0}{reason}, but found {1}.", unexpected, Subject); + return new AndConstraint((TAssertions)this); } @@ -850,36 +1130,52 @@ public AndConstraint NotEndWith(string unexpected, string because = /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint EndWithEquivalentOf(string expected, string because = "", params object[] becauseArgs) + public AndConstraint EndWithEquivalentOf(string expected, + string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare string end equivalence with ."); - bool success = Execute.Assertion - .BecauseOf(because, becauseArgs) - .ForCondition(Subject is not null) - .FailWith( - "Expected {context:string} that ends with equivalent of {0}{reason}, but found {1}.", expected, Subject); + var stringEndValidator = new StringValidator( + new StringEndStrategy(StringComparer.OrdinalIgnoreCase, "end with equivalent of"), + because, becauseArgs); - if (success) - { - success = Execute.Assertion - .BecauseOf(because, becauseArgs) - .ForCondition(Subject.Length >= expected.Length) - .FailWith( - "Expected {context:string} to end with equivalent of {0}{reason}, but {1} is too short.", - expected, Subject); + stringEndValidator.Validate(Subject, expected); - if (success) - { - Execute.Assertion - .ForCondition(Subject.EndsWith(expected, StringComparison.OrdinalIgnoreCase)) - .BecauseOf(because, becauseArgs) - .FailWith( - "Expected {context:string} that ends with equivalent of {0}{reason}, but found {1}.", - expected, Subject); - } - } + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that a string ends with the specified , using the provided . + /// + /// The string that the subject is expected to end with. + /// + /// The equivalency options. + /// + /// + /// 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 . + /// + /// is . + public AndConstraint EndWithEquivalentOf(string expected, + Func, EquivalencyOptions> config, + string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare string end equivalence with ."); + Guard.ThrowIfArgumentIsNull(config); + + EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + + var stringEndValidator = new StringValidator( + new StringEndStrategy(options.GetStringComparerOrDefault(), "end with equivalent of"), + because, becauseArgs); + + var subject = ApplyStringSettings(Subject, options); + expected = ApplyStringSettings(expected, options); + stringEndValidator.Validate(subject, expected); return new AndConstraint((TAssertions)this); } @@ -896,27 +1192,62 @@ public AndConstraint EndWithEquivalentOf(string expected, string be /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotEndWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotEndWithEquivalentOf(string unexpected, + string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare end of string with ."); - var success = Execute.Assertion + bool notEquivalent; + + using (var scope = new AssertionScope()) + { + Subject.Should().EndWithEquivalentOf(unexpected); + notEquivalent = scope.Discard().Length > 0; + } + + Execute.Assertion + .ForCondition(Subject != null && notEquivalent) .BecauseOf(because, becauseArgs) - .ForCondition(Subject is not null) - .FailWith( - "Expected {context:string} that does not end with equivalent of {0}{reason}, but found {1}.", - unexpected, Subject); + .FailWith("Expected {context:string} not to end with equivalent of {0}{reason}, but found {1}.", unexpected, Subject); - if (success) + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that a string does not end with the specified , using the provided . + /// + /// The string that the subject is not expected to end with. + /// + /// The equivalency options. + /// + /// + /// 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 . + /// + /// is . + public AndConstraint NotEndWithEquivalentOf(string unexpected, + Func, EquivalencyOptions> config, + string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare end of string with ."); + Guard.ThrowIfArgumentIsNull(config); + + bool notEquivalent; + + using (var scope = new AssertionScope()) { - Execute.Assertion - .ForCondition(!Subject.EndsWith(unexpected, StringComparison.OrdinalIgnoreCase)) - .BecauseOf(because, becauseArgs) - .FailWith( - "Expected {context:string} that does not end with equivalent of {0}{reason}, but found {1}.", - unexpected, Subject); + Subject.Should().EndWithEquivalentOf(unexpected, config); + notEquivalent = scope.Discard().Length > 0; } + Execute.Assertion + .ForCondition(Subject != null && notEquivalent) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:string} not to end with equivalent of {0}{reason}, but found {1}.", unexpected, Subject); + return new AndConstraint((TAssertions)this); } @@ -975,7 +1306,7 @@ public AndConstraint Contain(string expected, OccurrenceConstraint Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert string containment against ."); Guard.ThrowIfArgumentIsEmpty(expected, nameof(expected), "Cannot assert string containment against an empty string."); - int actual = Subject.CountSubstring(expected, StringComparison.Ordinal); + int actual = Subject.CountSubstring(expected, StringComparer.Ordinal); Execute.Assertion .ForConstraint(occurrenceConstraint, actual) @@ -1001,19 +1332,89 @@ public AndConstraint Contain(string expected, OccurrenceConstraint /// /// is . /// is empty. - public AndConstraint ContainEquivalentOf(string expected, string because = "", params object[] becauseArgs) + public AndConstraint ContainEquivalentOf(string expected, + string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert string containment against ."); Guard.ThrowIfArgumentIsEmpty(expected, nameof(expected), "Cannot assert string containment against an empty string."); - Execute.Assertion - .ForCondition(Contains(Subject, expected, StringComparison.OrdinalIgnoreCase)) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:string} {0} to contain the equivalent of {1}{reason}.", Subject, expected); + var stringContainValidator = new StringValidatorSupportingNull( + new StringContainsStrategy(StringComparer.OrdinalIgnoreCase, AtLeast.Once()), + because, becauseArgs); + + stringContainValidator.Validate(Subject, expected); return new AndConstraint((TAssertions)this); } + /// + /// Asserts that a string contains the specified , using the provided . + /// + /// The string that the subject is expected to contain. + /// + /// The equivalency options. + /// + /// + /// 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 . + /// + /// is . + /// is empty. + public AndConstraint ContainEquivalentOf(string expected, + Func, EquivalencyOptions> config, + string because = "", params object[] becauseArgs) + { + return ContainEquivalentOf(expected, AtLeast.Once(), config, because, becauseArgs); + } + + /// + /// Asserts that a string contains the specified , using the provided . + /// + /// The string that the subject is expected to contain. + /// + /// A constraint specifying the amount of times a substring should be present within the test subject. + /// It can be created by invoking static methods Once, Twice, Thrice, or Times(int) + /// on the classes , , , , and . + /// For example, or . + /// + /// + /// The equivalency options. + /// + /// + /// 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 . + /// + /// is . + /// is empty. + public AndConstraint ContainEquivalentOf(string expected, + OccurrenceConstraint occurrenceConstraint, + Func, EquivalencyOptions> config, + string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert string containment against ."); + Guard.ThrowIfArgumentIsEmpty(expected, nameof(expected), "Cannot assert string containment against an empty string."); + Guard.ThrowIfArgumentIsNull(occurrenceConstraint); + Guard.ThrowIfArgumentIsNull(config); + + EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + + var stringContainValidator = new StringValidatorSupportingNull( + new StringContainsStrategy(options.GetStringComparerOrDefault(), occurrenceConstraint), + because, becauseArgs); + + var subject = ApplyStringSettings(Subject, options); + expected = ApplyStringSettings(expected, options); + + stringContainValidator.Validate(subject, expected); + return new AndConstraint((TAssertions)this); + } + /// /// Asserts that a string contains the specified a set amount of times, /// including any leading or trailing whitespace, with the exception of the casing. @@ -1036,20 +1437,19 @@ public AndConstraint ContainEquivalentOf(string expected, string be /// /// is . /// is empty. - public AndConstraint ContainEquivalentOf(string expected, OccurrenceConstraint occurrenceConstraint, + public AndConstraint ContainEquivalentOf(string expected, + OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert string containment against ."); Guard.ThrowIfArgumentIsEmpty(expected, nameof(expected), "Cannot assert string containment against an empty string."); + Guard.ThrowIfArgumentIsNull(occurrenceConstraint); - int actual = Subject.CountSubstring(expected, StringComparison.OrdinalIgnoreCase); + var stringContainValidator = new StringValidatorSupportingNull( + new StringContainsStrategy(StringComparer.OrdinalIgnoreCase, occurrenceConstraint), + because, becauseArgs); - Execute.Assertion - .ForConstraint(occurrenceConstraint, actual) - .BecauseOf(because, becauseArgs) - .FailWith( - $"Expected {{context:string}} {{0}} to contain equivalent of {{1}} {{expectedOccurrence}}{{reason}}, but found it {actual.Times()}.", - Subject, expected); + stringContainValidator.Validate(Subject, expected); return new AndConstraint((TAssertions)this); } @@ -1143,8 +1543,8 @@ public AndConstraint ContainAny(params string[] values) /// /// is . /// is empty. - public AndConstraint NotContain(string unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotContain(string unexpected, + string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot assert string containment against ."); Guard.ThrowIfArgumentIsEmpty(unexpected, nameof(unexpected), "Cannot assert string containment against an empty string."); @@ -1249,20 +1649,69 @@ public AndConstraint NotContainAny(params string[] values) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotContainEquivalentOf(string unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotContainEquivalentOf(string unexpected, + string because = "", params object[] becauseArgs) { Execute.Assertion - .ForCondition(!Contains(Subject, unexpected, StringComparison.OrdinalIgnoreCase)) + .ForCondition(!string.IsNullOrEmpty(unexpected) && Subject != null) + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect {context:string} to contain the equivalent of {0}{reason}, but found {1}.", unexpected, Subject); + + bool notEquivalent; + + using (var scope = new AssertionScope()) + { + Subject.Should().ContainEquivalentOf(unexpected); + notEquivalent = scope.Discard().Length > 0; + } + + Execute.Assertion + .ForCondition(notEquivalent) .BecauseOf(because, becauseArgs) - .FailWith("Did not expect {context:string} to contain equivalent of {0}{reason} but found {1}.", unexpected, Subject); + .FailWith("Did not expect {context:string} to contain the equivalent of {0}{reason} but found {1}.", unexpected, Subject); return new AndConstraint((TAssertions)this); } - private static bool Contains(string actual, string expected, StringComparison comparison) + /// + /// Asserts that a string does not contain the specified string, using the provided . + /// + /// The string that the subject is not expected to contain. + /// + /// The equivalency options. + /// + /// + /// 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 NotContainEquivalentOf(string unexpected, + Func, EquivalencyOptions> config, + string because = "", params object[] becauseArgs) { - return (actual ?? string.Empty).Contains(expected ?? string.Empty, comparison); + Guard.ThrowIfArgumentIsNull(config); + + Execute.Assertion + .ForCondition(!string.IsNullOrEmpty(unexpected) && Subject != null) + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect {context:string} to contain the equivalent of {0}{reason}, but found {1}.", unexpected, Subject); + + bool notEquivalent; + + using (var scope = new AssertionScope()) + { + Subject.Should().ContainEquivalentOf(unexpected, config); + notEquivalent = scope.Discard().Length > 0; + } + + Execute.Assertion + .ForCondition(notEquivalent) + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect {context:string} to contain the equivalent of {0}{reason}, but found {1}.", unexpected, Subject); + + return new AndConstraint((TAssertions)this); } /// @@ -1327,7 +1776,7 @@ public AndConstraint HaveLength(int expected, string because = "", { Execute.Assertion .BecauseOf(because, becauseArgs) - .ForCondition(Subject.Length == expected) + .ForCondition(Subject!.Length == expected) .FailWith("Expected {context:string} with length {0}{reason}, but found string {1} with length {2}.", expected, Subject, Subject.Length); } @@ -1505,6 +1954,30 @@ public AndConstraint NotBeLowerCased(string because = "", params ob return new AndConstraint((TAssertions)this); } + internal AndConstraint Be(string expected, + Func, EquivalencyOptions> config, + string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(config); + + EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + + var expectation = new StringValidator( + new StringEqualityStrategy(options.GetStringComparerOrDefault(), "be"), + because, becauseArgs); + + var subject = ApplyStringSettings(Subject, options); + expected = ApplyStringSettings(expected, options); + + expectation.Validate(subject, expected); + return new AndConstraint((TAssertions)this); + } + + private static bool Contains(string actual, string expected, StringComparison comparison) + { + return (actual ?? string.Empty).Contains(expected ?? string.Empty, comparison); + } + private static void ThrowIfValuesNullOrEmpty(IEnumerable values) { Guard.ThrowIfArgumentIsNull(values, nameof(values), "Cannot assert string containment of values in null collection"); @@ -1515,6 +1988,28 @@ private static void ThrowIfValuesNullOrEmpty(IEnumerable values) } } + /// + /// Applies the string-specific to the . + /// + /// + /// When is set, whitespace is removed from the start of the .
+ /// When is set, whitespace is removed from the end of the .
+ ///
+ private static string ApplyStringSettings(string value, IEquivalencyOptions options) + { + if (options.IgnoreLeadingWhitespace) + { + value = value.TrimStart(); + } + + if (options.IgnoreTrailingWhitespace) + { + value = value.TrimEnd(); + } + + return value; + } + /// /// Returns the type of the subject the assertion applies on. /// diff --git a/Src/FluentAssertions/Primitives/StringContainsStrategy.cs b/Src/FluentAssertions/Primitives/StringContainsStrategy.cs new file mode 100644 index 0000000000..46c8b5b2e1 --- /dev/null +++ b/Src/FluentAssertions/Primitives/StringContainsStrategy.cs @@ -0,0 +1,30 @@ +using System.Collections.Generic; +using FluentAssertions.Common; +using FluentAssertions.Execution; + +namespace FluentAssertions.Primitives; + +internal class StringContainsStrategy : IStringComparisonStrategy +{ + private readonly IEqualityComparer comparer; + private readonly OccurrenceConstraint occurrenceConstraint; + + public StringContainsStrategy(IEqualityComparer comparer, OccurrenceConstraint occurrenceConstraint) + { + this.comparer = comparer; + this.occurrenceConstraint = occurrenceConstraint; + } + + public string ExpectationDescription => "Expected {context:string} to contain the equivalent of "; + + public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected) + { + int actual = subject.CountSubstring(expected, comparer); + + assertion + .ForConstraint(occurrenceConstraint, actual) + .FailWith( + $"Expected {{context:string}} {{0}} to contain the equivalent of {{1}} {{expectedOccurrence}}{{reason}}, but found it {actual.Times()}.", + subject, expected); + } +} diff --git a/Src/FluentAssertions/Primitives/StringEndStrategy.cs b/Src/FluentAssertions/Primitives/StringEndStrategy.cs new file mode 100644 index 0000000000..bdb59f9cbf --- /dev/null +++ b/Src/FluentAssertions/Primitives/StringEndStrategy.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; +using FluentAssertions.Common; +using FluentAssertions.Execution; + +namespace FluentAssertions.Primitives; + +internal class StringEndStrategy : IStringComparisonStrategy +{ + private readonly IEqualityComparer comparer; + private readonly string predicateDescription; + + public StringEndStrategy(IEqualityComparer comparer, string predicateDescription) + { + this.comparer = comparer; + this.predicateDescription = predicateDescription; + } + + public string ExpectationDescription => "Expected {context:string} to " + predicateDescription + " "; + + public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected) + { + if (!assertion + .ForCondition(subject!.Length >= expected.Length) + .FailWith(ExpectationDescription + "{0}{reason}, but {1} is too short.", expected, subject)) + { + return; + } + + int indexOfMismatch = subject.Substring(subject.Length - expected.Length).IndexOfFirstMismatch(expected, comparer); + + if (indexOfMismatch < 0) + { + return; + } + + assertion.FailWith( + ExpectationDescription + "{0}{reason}, but {1} differs near " + subject.IndexedSegmentAt(indexOfMismatch) + + ".", + expected, subject); + } +} diff --git a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs index 211c8595cb..37ad2a72e5 100644 --- a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Text; using FluentAssertions.Common; @@ -8,11 +9,13 @@ namespace FluentAssertions.Primitives; internal class StringEqualityStrategy : IStringComparisonStrategy { - private readonly StringComparison comparisonMode; + private readonly IEqualityComparer comparer; + private readonly string predicateDescription; - public StringEqualityStrategy(StringComparison comparisonMode) + public StringEqualityStrategy(IEqualityComparer comparer, string predicateDescription) { - this.comparisonMode = comparisonMode; + this.comparer = comparer; + this.predicateDescription = predicateDescription; } public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected) @@ -21,7 +24,7 @@ public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, s if (expected.IsLongOrMultiline() || subject.IsLongOrMultiline()) { - int indexOfMismatch = subject.IndexOfFirstMismatch(expected, comparisonMode); + int indexOfMismatch = subject.IndexOfFirstMismatch(expected, comparer); if (indexOfMismatch == -1) { @@ -47,7 +50,7 @@ public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, s } else if (ValidateAgainstLengthDifferences(assertion, subject, expected)) { - int indexOfMismatch = subject.IndexOfFirstMismatch(expected, comparisonMode); + int indexOfMismatch = subject.IndexOfFirstMismatch(expected, comparer); if (indexOfMismatch != -1) { @@ -59,25 +62,15 @@ public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, s } } - public string ExpectationDescription - { - get - { - string predicateDescription = IgnoreCase ? "be equivalent to" : "be"; - return "Expected {context:string} to " + predicateDescription + " "; - } - } - - private bool IgnoreCase - => comparisonMode == StringComparison.OrdinalIgnoreCase; + public string ExpectationDescription => "Expected {context:string} to " + predicateDescription + " "; private void ValidateAgainstSuperfluousWhitespace(IAssertionScope assertion, string subject, string expected) { assertion - .ForCondition(!(expected.Length > subject.Length && expected.TrimEnd().Equals(subject, comparisonMode))) + .ForCondition(!(expected.Length > subject.Length && comparer.Equals(expected.TrimEnd(), subject))) .FailWith(ExpectationDescription + "{0}{reason}, but it misses some extra whitespace at the end.", expected) .Then - .ForCondition(!(subject.Length > expected.Length && subject.TrimEnd().Equals(expected, comparisonMode))) + .ForCondition(!(subject.Length > expected.Length && comparer.Equals(subject.TrimEnd(), expected))) .FailWith(ExpectationDescription + "{0}{reason}, but it has unexpected whitespace at the end.", expected); } @@ -98,7 +91,7 @@ private bool ValidateAgainstLengthDifferences(IAssertionScope assertion, string private string GetMismatchSegmentForStringsOfDifferentLengths(string subject, string expected) { - int indexOfMismatch = subject.IndexOfFirstMismatch(expected, comparisonMode); + int indexOfMismatch = subject.IndexOfFirstMismatch(expected, comparer); // If there is no difference it means that expected starts with subject and subject is shorter than expected if (indexOfMismatch == -1) diff --git a/Src/FluentAssertions/Primitives/StringStartStrategy.cs b/Src/FluentAssertions/Primitives/StringStartStrategy.cs index 394ecaea1e..e8bd42c53d 100644 --- a/Src/FluentAssertions/Primitives/StringStartStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringStartStrategy.cs @@ -1,4 +1,4 @@ -using System; +using System.Collections.Generic; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -6,24 +6,16 @@ namespace FluentAssertions.Primitives; internal class StringStartStrategy : IStringComparisonStrategy { - private readonly StringComparison stringComparison; + private readonly IEqualityComparer comparer; + private readonly string predicateDescription; - public StringStartStrategy(StringComparison stringComparison) + public StringStartStrategy(IEqualityComparer comparer, string predicateDescription) { - this.stringComparison = stringComparison; + this.comparer = comparer; + this.predicateDescription = predicateDescription; } - public string ExpectationDescription - { - get - { - string predicateDescription = IgnoreCase ? "start with equivalent of" : "start with"; - return "Expected {context:string} to " + predicateDescription + " "; - } - } - - private bool IgnoreCase - => stringComparison == StringComparison.OrdinalIgnoreCase; + public string ExpectationDescription => "Expected {context:string} to " + predicateDescription + " "; public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected) { @@ -34,13 +26,13 @@ public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, s return; } - if (subject.StartsWith(expected, stringComparison)) + int indexOfMismatch = subject.IndexOfFirstMismatch(expected, comparer); + + if (indexOfMismatch < 0 || indexOfMismatch >= expected.Length) { return; } - int indexOfMismatch = subject.IndexOfFirstMismatch(expected, stringComparison); - assertion.FailWith( ExpectationDescription + "{0}{reason}, but {1} differs near " + subject.IndexedSegmentAt(indexOfMismatch) + ".", diff --git a/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs b/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs new file mode 100644 index 0000000000..03a4699378 --- /dev/null +++ b/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs @@ -0,0 +1,32 @@ +using FluentAssertions.Common; +using FluentAssertions.Execution; + +namespace FluentAssertions.Primitives; + +internal class StringValidatorSupportingNull +{ + private readonly IStringComparisonStrategy comparisonStrategy; + private IAssertionScope assertion; + + public StringValidatorSupportingNull(IStringComparisonStrategy comparisonStrategy, string because, object[] becauseArgs) + { + this.comparisonStrategy = comparisonStrategy; + assertion = Execute.Assertion.BecauseOf(because, becauseArgs); + } + + public void Validate(string subject, string expected) + { + if (expected is null && subject is null) + { + return; + } + + if (expected?.IsLongOrMultiline() == true || + subject?.IsLongOrMultiline() == true) + { + assertion = assertion.UsingLineBreaks; + } + + comparisonStrategy.ValidateAgainstMismatch(assertion, subject, expected); + } +} diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 755cb9c53d..cf5df524cd 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -748,7 +748,10 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.CyclicReferenceHandling CyclicReferenceHandling { get; } FluentAssertions.Equivalency.EnumEquivalencyHandling EnumEquivalencyHandling { get; } bool ExcludeNonBrowsableOnExpectation { get; } + bool IgnoreCase { get; } + bool IgnoreLeadingWhitespace { get; } bool IgnoreNonBrowsableOnSubject { get; } + bool IgnoreTrailingWhitespace { get; } FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } FluentAssertions.Equivalency.MemberVisibility IncludedProperties { get; } bool IsRecursive { get; } @@ -909,6 +912,9 @@ namespace FluentAssertions.Equivalency protected SelfReferenceEquivalencyOptions(FluentAssertions.Equivalency.IEquivalencyOptions defaults) { } public bool? CompareRecordsByValue { get; } public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } + public bool IgnoreCase { get; } + public bool IgnoreLeadingWhitespace { get; } + public bool IgnoreTrailingWhitespace { get; } [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } @@ -929,8 +935,11 @@ namespace FluentAssertions.Equivalency public TSelf ExcludingNestedObjects() { } public TSelf ExcludingNonBrowsableMembers() { } public TSelf ExcludingProperties() { } + public TSelf IgnoringCase() { } public TSelf IgnoringCyclicReferences() { } + public TSelf IgnoringLeadingWhitespace() { } public TSelf IgnoringNonBrowsableMembersOnSubject() { } + public TSelf IgnoringTrailingWhitespace() { } public TSelf Including(System.Linq.Expressions.Expression> predicate) { } public TSelf IncludingAllDeclaredProperties() { } public TSelf IncludingAllRuntimeProperties() { } @@ -947,6 +956,7 @@ namespace FluentAssertions.Equivalency public TSelf Using(FluentAssertions.Equivalency.IMemberMatchingRule matchingRule) { } public TSelf Using(FluentAssertions.Equivalency.IMemberSelectionRule selectionRule) { } public TSelf Using(FluentAssertions.Equivalency.IOrderingRule orderingRule) { } + public TSelf Using(System.Collections.Generic.IEqualityComparer comparer) { } public FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions.Restriction Using(System.Action> action) { } public TSelf Using(System.Collections.Generic.IEqualityComparer comparer) { } public TSelf Using() @@ -2025,6 +2035,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEquivalentTo(string expected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLowerCased(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNullOrEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNullOrWhiteSpace(string because = "", params object[] becauseArgs) { } @@ -2039,11 +2050,15 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint ContainAny(System.Collections.Generic.IEnumerable values, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint EndWith(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint EndWithEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint EndWithEquivalentOf(string expected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveLength(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(string regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } @@ -2051,6 +2066,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(string unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEquivalentTo(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeLowerCased(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNullOrEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNullOrWhiteSpace(string because = "", params object[] becauseArgs) { } @@ -2061,16 +2077,21 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotContainAny(params string[] values) { } public FluentAssertions.AndConstraint NotContainAny(System.Collections.Generic.IEnumerable values, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotContainEquivalentOf(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotEndWith(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotEndWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotEndWithEquivalentOf(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWith(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint StartWith(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint StartWithEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint StartWithEquivalentOf(string expected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } } public enum TimeSpanCondition { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 6cfe491e28..f00bba5ff5 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -761,7 +761,10 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.CyclicReferenceHandling CyclicReferenceHandling { get; } FluentAssertions.Equivalency.EnumEquivalencyHandling EnumEquivalencyHandling { get; } bool ExcludeNonBrowsableOnExpectation { get; } + bool IgnoreCase { get; } + bool IgnoreLeadingWhitespace { get; } bool IgnoreNonBrowsableOnSubject { get; } + bool IgnoreTrailingWhitespace { get; } FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } FluentAssertions.Equivalency.MemberVisibility IncludedProperties { get; } bool IsRecursive { get; } @@ -922,6 +925,9 @@ namespace FluentAssertions.Equivalency protected SelfReferenceEquivalencyOptions(FluentAssertions.Equivalency.IEquivalencyOptions defaults) { } public bool? CompareRecordsByValue { get; } public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } + public bool IgnoreCase { get; } + public bool IgnoreLeadingWhitespace { get; } + public bool IgnoreTrailingWhitespace { get; } [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } @@ -942,8 +948,11 @@ namespace FluentAssertions.Equivalency public TSelf ExcludingNestedObjects() { } public TSelf ExcludingNonBrowsableMembers() { } public TSelf ExcludingProperties() { } + public TSelf IgnoringCase() { } public TSelf IgnoringCyclicReferences() { } + public TSelf IgnoringLeadingWhitespace() { } public TSelf IgnoringNonBrowsableMembersOnSubject() { } + public TSelf IgnoringTrailingWhitespace() { } public TSelf Including(System.Linq.Expressions.Expression> predicate) { } public TSelf IncludingAllDeclaredProperties() { } public TSelf IncludingAllRuntimeProperties() { } @@ -960,6 +969,7 @@ namespace FluentAssertions.Equivalency public TSelf Using(FluentAssertions.Equivalency.IMemberMatchingRule matchingRule) { } public TSelf Using(FluentAssertions.Equivalency.IMemberSelectionRule selectionRule) { } public TSelf Using(FluentAssertions.Equivalency.IOrderingRule orderingRule) { } + public TSelf Using(System.Collections.Generic.IEqualityComparer comparer) { } public FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions.Restriction Using(System.Action> action) { } public TSelf Using(System.Collections.Generic.IEqualityComparer comparer) { } public TSelf Using() @@ -2109,6 +2119,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEquivalentTo(string expected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLowerCased(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNullOrEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNullOrWhiteSpace(string because = "", params object[] becauseArgs) { } @@ -2123,11 +2134,15 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint ContainAny(System.Collections.Generic.IEnumerable values, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint EndWith(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint EndWithEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint EndWithEquivalentOf(string expected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveLength(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(string regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } @@ -2135,6 +2150,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(string unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEquivalentTo(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeLowerCased(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNullOrEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNullOrWhiteSpace(string because = "", params object[] becauseArgs) { } @@ -2145,16 +2161,21 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotContainAny(params string[] values) { } public FluentAssertions.AndConstraint NotContainAny(System.Collections.Generic.IEnumerable values, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotContainEquivalentOf(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotEndWith(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotEndWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotEndWithEquivalentOf(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWith(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint StartWith(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint StartWithEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint StartWithEquivalentOf(string expected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } } public class TimeOnlyAssertions : FluentAssertions.Primitives.TimeOnlyAssertions { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 9e80ec66ba..295dcf2c5a 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -741,7 +741,10 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.CyclicReferenceHandling CyclicReferenceHandling { get; } FluentAssertions.Equivalency.EnumEquivalencyHandling EnumEquivalencyHandling { get; } bool ExcludeNonBrowsableOnExpectation { get; } + bool IgnoreCase { get; } + bool IgnoreLeadingWhitespace { get; } bool IgnoreNonBrowsableOnSubject { get; } + bool IgnoreTrailingWhitespace { get; } FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } FluentAssertions.Equivalency.MemberVisibility IncludedProperties { get; } bool IsRecursive { get; } @@ -902,6 +905,9 @@ namespace FluentAssertions.Equivalency protected SelfReferenceEquivalencyOptions(FluentAssertions.Equivalency.IEquivalencyOptions defaults) { } public bool? CompareRecordsByValue { get; } public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } + public bool IgnoreCase { get; } + public bool IgnoreLeadingWhitespace { get; } + public bool IgnoreTrailingWhitespace { get; } [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } @@ -922,8 +928,11 @@ namespace FluentAssertions.Equivalency public TSelf ExcludingNestedObjects() { } public TSelf ExcludingNonBrowsableMembers() { } public TSelf ExcludingProperties() { } + public TSelf IgnoringCase() { } public TSelf IgnoringCyclicReferences() { } + public TSelf IgnoringLeadingWhitespace() { } public TSelf IgnoringNonBrowsableMembersOnSubject() { } + public TSelf IgnoringTrailingWhitespace() { } public TSelf Including(System.Linq.Expressions.Expression> predicate) { } public TSelf IncludingAllDeclaredProperties() { } public TSelf IncludingAllRuntimeProperties() { } @@ -940,6 +949,7 @@ namespace FluentAssertions.Equivalency public TSelf Using(FluentAssertions.Equivalency.IMemberMatchingRule matchingRule) { } public TSelf Using(FluentAssertions.Equivalency.IMemberSelectionRule selectionRule) { } public TSelf Using(FluentAssertions.Equivalency.IOrderingRule orderingRule) { } + public TSelf Using(System.Collections.Generic.IEqualityComparer comparer) { } public FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions.Restriction Using(System.Action> action) { } public TSelf Using(System.Collections.Generic.IEqualityComparer comparer) { } public TSelf Using() @@ -1976,6 +1986,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEquivalentTo(string expected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLowerCased(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNullOrEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNullOrWhiteSpace(string because = "", params object[] becauseArgs) { } @@ -1990,11 +2001,15 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint ContainAny(System.Collections.Generic.IEnumerable values, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint EndWith(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint EndWithEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint EndWithEquivalentOf(string expected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveLength(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(string regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } @@ -2002,6 +2017,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(string unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEquivalentTo(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeLowerCased(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNullOrEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNullOrWhiteSpace(string because = "", params object[] becauseArgs) { } @@ -2012,16 +2028,21 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotContainAny(params string[] values) { } public FluentAssertions.AndConstraint NotContainAny(System.Collections.Generic.IEnumerable values, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotContainEquivalentOf(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotEndWith(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotEndWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotEndWithEquivalentOf(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWith(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint StartWith(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint StartWithEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint StartWithEquivalentOf(string expected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } } public enum TimeSpanCondition { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 08e7215e61..f84632f17f 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -748,7 +748,10 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.CyclicReferenceHandling CyclicReferenceHandling { get; } FluentAssertions.Equivalency.EnumEquivalencyHandling EnumEquivalencyHandling { get; } bool ExcludeNonBrowsableOnExpectation { get; } + bool IgnoreCase { get; } + bool IgnoreLeadingWhitespace { get; } bool IgnoreNonBrowsableOnSubject { get; } + bool IgnoreTrailingWhitespace { get; } FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } FluentAssertions.Equivalency.MemberVisibility IncludedProperties { get; } bool IsRecursive { get; } @@ -909,6 +912,9 @@ namespace FluentAssertions.Equivalency protected SelfReferenceEquivalencyOptions(FluentAssertions.Equivalency.IEquivalencyOptions defaults) { } public bool? CompareRecordsByValue { get; } public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } + public bool IgnoreCase { get; } + public bool IgnoreLeadingWhitespace { get; } + public bool IgnoreTrailingWhitespace { get; } [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } @@ -929,8 +935,11 @@ namespace FluentAssertions.Equivalency public TSelf ExcludingNestedObjects() { } public TSelf ExcludingNonBrowsableMembers() { } public TSelf ExcludingProperties() { } + public TSelf IgnoringCase() { } public TSelf IgnoringCyclicReferences() { } + public TSelf IgnoringLeadingWhitespace() { } public TSelf IgnoringNonBrowsableMembersOnSubject() { } + public TSelf IgnoringTrailingWhitespace() { } public TSelf Including(System.Linq.Expressions.Expression> predicate) { } public TSelf IncludingAllDeclaredProperties() { } public TSelf IncludingAllRuntimeProperties() { } @@ -947,6 +956,7 @@ namespace FluentAssertions.Equivalency public TSelf Using(FluentAssertions.Equivalency.IMemberMatchingRule matchingRule) { } public TSelf Using(FluentAssertions.Equivalency.IMemberSelectionRule selectionRule) { } public TSelf Using(FluentAssertions.Equivalency.IOrderingRule orderingRule) { } + public TSelf Using(System.Collections.Generic.IEqualityComparer comparer) { } public FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions.Restriction Using(System.Action> action) { } public TSelf Using(System.Collections.Generic.IEqualityComparer comparer) { } public TSelf Using() @@ -2025,6 +2035,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEquivalentTo(string expected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeLowerCased(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNullOrEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNullOrWhiteSpace(string because = "", params object[] becauseArgs) { } @@ -2039,11 +2050,15 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint ContainAny(System.Collections.Generic.IEnumerable values, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint ContainEquivalentOf(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint EndWith(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint EndWithEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint EndWithEquivalentOf(string expected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveLength(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(string regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } @@ -2051,6 +2066,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(string unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEquivalentTo(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeLowerCased(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNullOrEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNullOrWhiteSpace(string because = "", params object[] becauseArgs) { } @@ -2061,16 +2077,21 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotContainAny(params string[] values) { } public FluentAssertions.AndConstraint NotContainAny(System.Collections.Generic.IEnumerable values, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotContainEquivalentOf(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotEndWith(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotEndWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotEndWithEquivalentOf(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWith(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint StartWith(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint StartWithEquivalentOf(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint StartWithEquivalentOf(string expected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } } public enum TimeSpanCondition { diff --git a/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs b/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs index dfee213a6f..d2f62df92e 100644 --- a/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs +++ b/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs @@ -77,6 +77,14 @@ private class Config : IEquivalencyOptions public ITraceWriter TraceWriter => throw new NotImplementedException(); public EqualityStrategy GetEqualityStrategy(Type type) => throw new NotImplementedException(); + + public bool IgnoreLeadingWhitespace => throw new NotImplementedException(); + + public bool IgnoreTrailingWhitespace => throw new NotImplementedException(); + + public bool IgnoreNewlines => throw new NotImplementedException(); + + public bool IgnoreCase => throw new NotImplementedException(); } [Params(typeof(DBNull), typeof(bool), typeof(char), typeof(sbyte), typeof(byte), typeof(short), typeof(ushort), diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllBeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllBeEquivalentTo.cs new file mode 100644 index 0000000000..c3fb4692fc --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllBeEquivalentTo.cs @@ -0,0 +1,42 @@ +using Xunit; + +namespace FluentAssertions.Specs.Collections; + +public partial class CollectionAssertionSpecs +{ + public class AllBeEquivalentTo + { + [Fact] + public void Can_ignore_casing_while_comparing_collections_of_strings() + { + // Arrange + var actual = new[] { "test", "tEst", "Test", "TEst", "teST" }; + var expectation = "test"; + + // Act / Assert + actual.Should().AllBeEquivalentTo(expectation, o => o.IgnoringCase()); + } + + [Fact] + public void Can_ignore_leading_whitespace_while_comparing_collections_of_strings() + { + // Arrange + var actual = new[] { " test", "test", "\ttest", "\ntest", " \t \n test" }; + var expectation = "test"; + + // Act / Assert + actual.Should().AllBeEquivalentTo(expectation, o => o.IgnoringLeadingWhitespace()); + } + + [Fact] + public void Can_ignore_trailing_whitespace_while_comparing_collections_of_strings() + { + // Arrange + var actual = new[] { "test ", "test", "test\t", "test\n", "test \t \n " }; + var expectation = "test"; + + // Act / Assert + actual.Should().AllBeEquivalentTo(expectation, o => o.IgnoringTrailingWhitespace()); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs index eefc78f235..fe55fdc977 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs @@ -158,6 +158,39 @@ public void Default_immutable_lists_should_be_equivalent() // Act / Assert collection.Should().BeEquivalentTo(collection1); } + + [Fact] + public void Can_ignore_casing_while_comparing_collections_of_strings() + { + // Arrange + var actual = new[] { "first", "test", "last" }; + var expectation = new[] { "first", "TEST", "last" }; + + // Act / Assert + actual.Should().BeEquivalentTo(expectation, o => o.IgnoringCase()); + } + + [Fact] + public void Can_ignore_leading_whitespace_while_comparing_collections_of_strings() + { + // Arrange + var actual = new[] { "first", " test", "last" }; + var expectation = new[] { "first", "test", "last" }; + + // Act / Assert + actual.Should().BeEquivalentTo(expectation, o => o.IgnoringLeadingWhitespace()); + } + + [Fact] + public void Can_ignore_trailing_whitespace_while_comparing_collections_of_strings() + { + // Arrange + var actual = new[] { "first", "test ", "last" }; + var expectation = new[] { "first", "test", "last" }; + + // Act / Assert + actual.Should().BeEquivalentTo(expectation, o => o.IgnoringTrailingWhitespace()); + } } public class NotBeEquivalentTo diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeEquivalentTo.cs new file mode 100644 index 0000000000..5eb71291b7 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeEquivalentTo.cs @@ -0,0 +1,42 @@ +using Xunit; + +namespace FluentAssertions.Specs.Primitives; + +public partial class ObjectAssertionSpecs +{ + public class BeEquivalentTo + { + [Fact] + public void Can_ignore_casing_while_comparing_objects_with_string_properties() + { + // Arrange + var actual = new { foo = "test" }; + var expectation = new { foo = "TEST" }; + + // Act / Assert + actual.Should().BeEquivalentTo(expectation, o => o.IgnoringCase()); + } + + [Fact] + public void Can_ignore_leading_whitespace_while_comparing_objects_with_string_properties() + { + // Arrange + var actual = new { foo = " test" }; + var expectation = new { foo = "test" }; + + // Act / Assert + actual.Should().BeEquivalentTo(expectation, o => o.IgnoringLeadingWhitespace()); + } + + [Fact] + public void Can_ignore_trailing_whitespace_while_comparing_objects_with_string_properties() + { + // Arrange + var actual = new { foo = "test " }; + var expectation = new { foo = "test" }; + + // Act / Assert + actual.Should().BeEquivalentTo(expectation, o => o.IgnoringTrailingWhitespace()); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeEquivalentTo.cs index 5bdf8fbe81..39c00ceba5 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeEquivalentTo.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeEquivalentTo.cs @@ -12,6 +12,66 @@ public partial class StringAssertionSpecs { public class BeEquivalentTo { + [Fact] + public void Succeed_for_different_strings_using_custom_matching_comparer() + { + // Arrange + var comparer = new AlwaysMatchingEqualityComparer(); + string actual = "ABC"; + string expect = "XYZ"; + + // Act / Assert + actual.Should().BeEquivalentTo(expect, o => o.Using(comparer)); + } + + [Fact] + public void Fail_for_same_strings_using_custom_not_matching_comparer() + { + // Arrange + var comparer = new NeverMatchingEqualityComparer(); + string actual = "ABC"; + string expect = "ABC"; + + // Act + Action act = () => actual.Should().BeEquivalentTo(expect, o => o.Using(comparer)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_casing_while_comparing_strings_to_be_equivalent() + { + // Arrange + string actual = "test"; + string expect = "TEST"; + + // Act / Assert + actual.Should().BeEquivalentTo(expect, o => o.IgnoringCase()); + } + + [Fact] + public void Can_ignore_leading_whitespace_while_comparing_strings_to_be_equivalent() + { + // Arrange + string actual = " test"; + string expect = "test"; + + // Act / Assert + actual.Should().BeEquivalentTo(expect, o => o.IgnoringLeadingWhitespace()); + } + + [Fact] + public void Can_ignore_trailing_whitespace_while_comparing_strings_to_be_equivalent() + { + // Arrange + string actual = "test "; + string expect = "test"; + + // Act / Assert + actual.Should().BeEquivalentTo(expect, o => o.IgnoringTrailingWhitespace()); + } + [Fact] public void When_strings_are_the_same_while_ignoring_case_it_should_not_throw() { @@ -108,6 +168,75 @@ public void public class NotBeEquivalentTo { + [Fact] + public void Succeed_for_same_strings_using_custom_not_matching_comparer() + { + // Arrange + var comparer = new NeverMatchingEqualityComparer(); + string actual = "ABC"; + string expect = "ABC"; + + // Act / Assert + actual.Should().NotBeEquivalentTo(expect, o => o.Using(comparer)); + } + + [Fact] + public void Fail_for_different_strings_using_custom_matching_comparer() + { + // Arrange + var comparer = new AlwaysMatchingEqualityComparer(); + string actual = "ABC"; + string expect = "XYZ"; + + // Act + Action act = () => actual.Should().NotBeEquivalentTo(expect, o => o.Using(comparer)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_casing_while_comparing_strings_to_not_be_equivalent() + { + // Arrange + string actual = "test"; + string expect = "TEST"; + + // Act + Action act = () => actual.Should().NotBeEquivalentTo(expect, o => o.IgnoringCase()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_leading_whitespace_while_comparing_strings_to_not_be_equivalent() + { + // Arrange + string actual = " test"; + string expect = "test"; + + // Act + Action act = () => actual.Should().NotBeEquivalentTo(expect, o => o.IgnoringLeadingWhitespace()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_trailing_whitespace_while_comparing_strings_to_not_be_equivalent() + { + // Arrange + string actual = "test "; + string expect = "test"; + + // Act + Action act = () => actual.Should().NotBeEquivalentTo(expect, o => o.IgnoringTrailingWhitespace()); + + // Assert + act.Should().Throw(); + } + [Fact] public void When_strings_are_the_same_while_ignoring_case_it_should_throw() { diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.ContainEquivalentOf.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.ContainEquivalentOf.cs index 69c7796239..8ebda8e627 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.ContainEquivalentOf.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.ContainEquivalentOf.cs @@ -11,6 +11,66 @@ public partial class StringAssertionSpecs { public class ContainEquivalentOf { + [Fact] + public void Succeed_for_different_strings_using_custom_matching_comparer() + { + // Arrange + var comparer = new AlwaysMatchingEqualityComparer(); + string actual = "ABC"; + string expect = "XYZ"; + + // Act / Assert + actual.Should().ContainEquivalentOf(expect, o => o.Using(comparer)); + } + + [Fact] + public void Fail_for_same_strings_using_custom_not_matching_comparer() + { + // Arrange + var comparer = new NeverMatchingEqualityComparer(); + string actual = "ABC"; + string expect = "ABC"; + + // Act + Action act = () => actual.Should().ContainEquivalentOf(expect, o => o.Using(comparer)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_casing_while_checking_a_string_to_contain_another() + { + // Arrange + string actual = "this is a string containing test."; + string expect = "TEST"; + + // Act / Assert + actual.Should().ContainEquivalentOf(expect, o => o.IgnoringCase()); + } + + [Fact] + public void Can_ignore_leading_whitespace_while_checking_a_string_to_contain_another() + { + // Arrange + string actual = " this is a string containing test."; + string expect = "test"; + + // Act / Assert + actual.Should().ContainEquivalentOf(expect, o => o.IgnoringLeadingWhitespace()); + } + + [Fact] + public void Can_ignore_trailing_whitespace_while_checking_a_string_to_contain_another() + { + // Arrange + string actual = "this is a string containing test. "; + string expect = "test"; + + // Act / Assert + actual.Should().ContainEquivalentOf(expect, o => o.IgnoringTrailingWhitespace()); + } + [InlineData("aa", "A")] [InlineData("aCCa", "acca")] [Theory] @@ -29,7 +89,7 @@ public void Should_fail_contain_equivalent_of_when_not_contains() // Assert act.Should().Throw() - .WithMessage("Expected string \"a\" to contain the equivalent of \"aa\"."); + .WithMessage("Expected string \"a\" to contain the equivalent of \"aa\" at least 1 time, but found it 0 times."); } [Fact] @@ -91,7 +151,7 @@ public void // Assert act.Should().Throw() .WithMessage( - "Expected * to contain equivalent of \"XyZ\" exactly 1 time because that is required, but found it 0 times."); + "Expected * to contain the equivalent of \"XyZ\" exactly 1 time because that is required, but found it 0 times."); } [Fact] @@ -123,7 +183,7 @@ public void // Assert act.Should().Throw() .WithMessage( - "Expected * \"abCDEBcDF\" to contain equivalent of \"Bcd\" exactly 3 times, but found it 2 times."); + "Expected * \"abCDEBcDF\" to contain the equivalent of \"Bcd\" exactly 3 times, but found it 2 times."); } [Fact] @@ -139,7 +199,7 @@ public void // Assert act.Should().Throw() - .WithMessage("Expected * \"abCDEf\" to contain equivalent of \"xyS\" exactly 1 time, but found it 0 times."); + .WithMessage("Expected * \"abCDEf\" to contain the equivalent of \"xyS\" exactly 1 time, but found it 0 times."); } [Fact] @@ -190,7 +250,7 @@ public void // Assert act.Should().Throw() - .WithMessage("Expected * \"abCDEBcDF\" to contain equivalent of \"Bcd\" at least 3 times, but found it 2 times."); + .WithMessage("Expected * \"abCDEBcDF\" to contain the equivalent of \"Bcd\" at least 3 times, but found it 2 times."); } [Fact] @@ -206,7 +266,7 @@ public void // Assert act.Should().Throw() - .WithMessage("Expected * \"abCDEf\" to contain equivalent of \"xyS\" at least 1 time, but found it 0 times."); + .WithMessage("Expected * \"abCDEf\" to contain the equivalent of \"xyS\" at least 1 time, but found it 0 times."); } [Fact] @@ -222,7 +282,7 @@ public void // Assert act.Should().Throw() - .WithMessage("Expected * to contain equivalent of \"XyZ\" at least 1 time, but found it 0 times."); + .WithMessage("Expected * to contain the equivalent of \"XyZ\" at least 1 time, but found it 0 times."); } } @@ -257,7 +317,7 @@ public void // Assert act.Should().Throw() .WithMessage( - "Expected * \"abCDEBcDF\" to contain equivalent of \"Bcd\" more than 2 times, but found it 2 times."); + "Expected * \"abCDEBcDF\" to contain the equivalent of \"Bcd\" more than 2 times, but found it 2 times."); } [Fact] @@ -273,7 +333,7 @@ public void // Assert act.Should().Throw() - .WithMessage("Expected * \"abCDEf\" to contain equivalent of \"xyS\" more than 1 time, but found it 0 times."); + .WithMessage("Expected * \"abCDEf\" to contain the equivalent of \"xyS\" more than 1 time, but found it 0 times."); } [Fact] @@ -289,7 +349,7 @@ public void // Assert act.Should().Throw() - .WithMessage("Expected * to contain equivalent of \"XyZ\" more than 1 time, but found it 0 times."); + .WithMessage("Expected * to contain the equivalent of \"XyZ\" more than 1 time, but found it 0 times."); } } @@ -323,7 +383,7 @@ public void // Assert act.Should().Throw() - .WithMessage("Expected * \"abCDEBcDF\" to contain equivalent of \"Bcd\" at most 1 time, but found it 2 times."); + .WithMessage("Expected * \"abCDEBcDF\" to contain the equivalent of \"Bcd\" at most 1 time, but found it 2 times."); } [Fact] @@ -388,7 +448,7 @@ public void // Assert act.Should().Throw() .WithMessage( - "Expected * \"abCDEBcDF\" to contain equivalent of \"Bcd\" less than 2 times, but found it 2 times."); + "Expected * \"abCDEBcDF\" to contain the equivalent of \"Bcd\" less than 2 times, but found it 2 times."); } [Fact] @@ -424,6 +484,75 @@ public void public class NotContainEquivalentOf { + [Fact] + public void Succeed_for_same_strings_using_custom_not_matching_comparer() + { + // Arrange + var comparer = new NeverMatchingEqualityComparer(); + string actual = "ABC"; + string expect = "ABC"; + + // Act / Assert + actual.Should().NotContainEquivalentOf(expect, o => o.Using(comparer)); + } + + [Fact] + public void Fail_for_different_strings_using_custom_matching_comparer() + { + // Arrange + var comparer = new AlwaysMatchingEqualityComparer(); + string actual = "ABC"; + string expect = "XYZ"; + + // Act + Action act = () => actual.Should().NotContainEquivalentOf(expect, o => o.Using(comparer)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_casing_while_checking_a_string_to_not_contain_another() + { + // Arrange + string actual = "this is a string containing test."; + string expect = "TEST"; + + // Act + Action act = () => actual.Should().NotContainEquivalentOf(expect, o => o.IgnoringCase()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_leading_whitespace_while_checking_a_string_to_not_contain_another() + { + // Arrange + string actual = " this is a string containing test."; + string expect = "test"; + + // Act + Action act = () => actual.Should().NotContainEquivalentOf(expect, o => o.IgnoringLeadingWhitespace()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_trailing_whitespace_while_checking_a_string_to_not_contain_another() + { + // Arrange + string actual = "this is a string containing test. "; + string expect = "test"; + + // Act + Action act = () => actual.Should().NotContainEquivalentOf(expect, o => o.IgnoringTrailingWhitespace()); + + // Assert + act.Should().Throw(); + } + [Fact] public void Should_fail_when_asserting_string_does_not_contain_equivalent_of_null() { @@ -433,7 +562,7 @@ public void Should_fail_when_asserting_string_does_not_contain_equivalent_of_nul // Assert act.Should().Throw() - .WithMessage("Did not expect string to contain equivalent of but found \"a\"."); + .WithMessage("Did not expect string to contain the equivalent of , but found \"a\"."); } [Fact] @@ -445,7 +574,7 @@ public void Should_fail_when_asserting_string_does_not_contain_equivalent_of_emp // Assert act.Should().Throw() - .WithMessage("Did not expect string to contain equivalent of \"\" but found \"a\"."); + .WithMessage("Did not expect string to contain the equivalent of \"\", but found \"a\"."); } [Fact] @@ -457,7 +586,7 @@ public void Should_fail_when_asserting_string_does_not_contain_equivalent_of_ano // Assert act.Should().Throw() - .WithMessage("Did not expect string to contain equivalent of \", worLD!\" but found \"Hello, world!\"."); + .WithMessage("Did not expect string to contain the equivalent of \", worLD!\" but found \"Hello, world!\"."); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.EndWith.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.EndWith.cs index 768baf7af0..1be9e8ce94 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.EndWith.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.EndWith.cs @@ -46,7 +46,7 @@ public void When_string_does_not_end_with_expected_phrase_it_should_throw() // Assert act.Should().Throw().WithMessage( - "Expected string \"ABC\" to end with \"AB\" because it should."); + "Expected string to end with \"AB\" because it should, but \"ABC\" differs near \"ABC\" (index 0)."); } [Fact] @@ -98,7 +98,7 @@ public void When_string_ending_is_compared_and_actual_value_is_null_then_it_shou // Assert act.Should().Throw().WithMessage( - "Expected someString to end with \"ABC\"."); + "Expected someString to end with \"ABC\", but found ."); } } @@ -130,7 +130,7 @@ public void When_asserting_string_does_not_end_with_a_value_but_it_does_it_shoul // Assert action.Should().Throw().WithMessage( - "Expected value \"ABC\" not to end with \"BC\" because of some reason."); + "Expected value not to end with \"BC\" because of some reason, but found \"ABC\"."); } [Fact] @@ -160,7 +160,7 @@ public void When_asserting_string_does_not_end_with_a_value_that_is_empty_it_sho // Assert action.Should().Throw().WithMessage( - "Expected value \"ABC\" not to end with \"\"."); + "Expected value not to end with \"\", but found \"ABC\"."); } [Fact] @@ -178,7 +178,7 @@ public void When_asserting_string_does_not_end_with_a_value_and_actual_value_is_ // Assert act.Should().Throw().WithMessage( - "Expected someString that does not end with \"ABC\"*some reason*, but found ."); + "Expected someString not to end with \"ABC\"*some reason*, but found ."); } } } diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.EndWithEquivalentOf.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.EndWithEquivalentOf.cs index e4d9e3e247..9fa4c6c089 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.EndWithEquivalentOf.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.EndWithEquivalentOf.cs @@ -10,8 +10,68 @@ namespace FluentAssertions.Specs.Primitives; /// public partial class StringAssertionSpecs { - public class EndWithEquivalent + public class EndWithEquivalentOf { + [Fact] + public void Succeed_for_different_strings_using_custom_matching_comparer() + { + // Arrange + var comparer = new AlwaysMatchingEqualityComparer(); + string actual = "ABC"; + string expect = "XYZ"; + + // Act / Assert + actual.Should().EndWithEquivalentOf(expect, o => o.Using(comparer)); + } + + [Fact] + public void Fail_for_same_strings_using_custom_not_matching_comparer() + { + // Arrange + var comparer = new NeverMatchingEqualityComparer(); + string actual = "ABC"; + string expect = "ABC"; + + // Act + Action act = () => actual.Should().EndWithEquivalentOf(expect, o => o.Using(comparer)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_casing_while_checking_a_string_to_end_with_another() + { + // Arrange + string actual = "prefix for test"; + string expect = "TEST"; + + // Act / Assert + actual.Should().EndWithEquivalentOf(expect, o => o.IgnoringCase()); + } + + [Fact] + public void Can_ignore_leading_whitespace_while_checking_a_string_to_end_with_another() + { + // Arrange + string actual = " prefix for test"; + string expect = "test"; + + // Act / Assert + actual.Should().EndWithEquivalentOf(expect, o => o.IgnoringLeadingWhitespace()); + } + + [Fact] + public void Can_ignore_trailing_whitespace_while_checking_a_string_to_end_with_another() + { + // Arrange + string actual = "prefix for test "; + string expect = "test"; + + // Act / Assert + actual.Should().EndWithEquivalentOf(expect, o => o.IgnoringTrailingWhitespace()); + } + [Fact] public void When_suffix_of_string_differs_by_case_only_it_should_not_throw() { @@ -42,7 +102,7 @@ public void When_end_of_string_does_not_meet_equivalent_it_should_throw() // Assert act.Should().Throw().WithMessage( - "Expected string that ends with equivalent of \"ab\" because it should end, but found \"ABC\"."); + "Expected string to end with equivalent of \"ab\" because it should end, but \"ABC\" differs near \"ABC\" (index 0)."); } [Fact] @@ -94,12 +154,81 @@ public void When_string_ending_is_compared_with_equivalent_and_actual_value_is_n // Assert act.Should().Throw().WithMessage( - "Expected someString that ends with equivalent of \"abC\", but found ."); + "Expected someString to end with equivalent of \"abC\", but found ."); } } - public class NotEndWithEquivalent + public class NotEndWithEquivalentOf { + [Fact] + public void Succeed_for_same_strings_using_custom_not_matching_comparer() + { + // Arrange + var comparer = new NeverMatchingEqualityComparer(); + string actual = "ABC"; + string expect = "ABC"; + + // Act / Assert + actual.Should().NotEndWithEquivalentOf(expect, o => o.Using(comparer)); + } + + [Fact] + public void Fail_for_different_strings_using_custom_matching_comparer() + { + // Arrange + var comparer = new AlwaysMatchingEqualityComparer(); + string actual = "ABC"; + string expect = "XYZ"; + + // Act + Action act = () => actual.Should().NotEndWithEquivalentOf(expect, o => o.Using(comparer)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_casing_while_checking_a_string_to_not_end_with_another() + { + // Arrange + string actual = "prefix for test"; + string expect = "TEST"; + + // Act + Action act = () => actual.Should().NotEndWithEquivalentOf(expect, o => o.IgnoringCase()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_leading_whitespace_while_checking_a_string_to_not_end_with_another() + { + // Arrange + string actual = " prefix for test"; + string expect = "test"; + + // Act + Action act = () => actual.Should().NotEndWithEquivalentOf(expect, o => o.IgnoringLeadingWhitespace()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_trailing_whitespace_while_checking_a_string_to_not_end_with_another() + { + // Arrange + string actual = "prefix for test "; + string expect = "test"; + + // Act + Action act = () => actual.Should().NotEndWithEquivalentOf(expect, o => o.IgnoringTrailingWhitespace()); + + // Assert + act.Should().Throw(); + } + [Fact] public void When_asserting_string_does_not_end_with_equivalent_of_a_value_and_it_does_not_it_should_succeed() { @@ -127,7 +256,7 @@ public void // Assert action.Should().Throw().WithMessage( - "Expected value that does not end with equivalent of \"Bc\" because of some reason, but found \"ABC\"."); + "Expected value not to end with equivalent of \"Bc\" because of some reason, but found \"ABC\"."); } [Fact] @@ -157,7 +286,7 @@ public void When_asserting_string_does_not_end_with_equivalent_of_a_value_that_i // Assert action.Should().Throw().WithMessage( - "Expected value that does not end with equivalent of \"\", but found \"ABC\"."); + "Expected value not to end with equivalent of \"\", but found \"ABC\"."); } [Fact] @@ -175,7 +304,7 @@ public void When_asserting_string_does_not_end_with_equivalent_of_a_value_and_ac // Assert act.Should().Throw().WithMessage( - "Expected someString that does not end with equivalent of \"Abc\"*some reason*, but found ."); + "Expected someString not to end with equivalent of \"Abc\"*some reason*, but found ."); } } } diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.MatchEquivalentOf.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.MatchEquivalentOf.cs index 1d3c3e9d88..ae7092f420 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.MatchEquivalentOf.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.MatchEquivalentOf.cs @@ -11,6 +11,39 @@ public partial class StringAssertionSpecs { public class MatchEquivalentOf { + [Fact] + public void Can_ignore_casing_while_checking_a_string_to_match_another() + { + // Arrange + string actual = "test"; + string expect = "T*T"; + + // Act / Assert + actual.Should().MatchEquivalentOf(expect, o => o.IgnoringCase()); + } + + [Fact] + public void Can_ignore_leading_whitespace_while_checking_a_string_to_match_another() + { + // Arrange + string actual = " test"; + string expect = "t*t"; + + // Act / Assert + actual.Should().MatchEquivalentOf(expect, o => o.IgnoringLeadingWhitespace()); + } + + [Fact] + public void Can_ignore_trailing_whitespace_while_checking_a_string_to_match_another() + { + // Arrange + string actual = "test "; + string expect = "t*t"; + + // Act / Assert + actual.Should().MatchEquivalentOf(expect, o => o.IgnoringTrailingWhitespace()); + } + [Fact] public void When_a_string_does_not_match_the_equivalent_of_a_wildcard_pattern_it_should_throw() { @@ -86,6 +119,48 @@ public void When_a_string_is_matched_against_the_equivalent_of_an_empty_string_i public class NotMatchEquivalentOf { + [Fact] + public void Can_ignore_casing_while_checking_a_string_to_not_match_another() + { + // Arrange + string actual = "test"; + string expect = "T*T"; + + // Act + Action act = () => actual.Should().NotMatchEquivalentOf(expect, o => o.IgnoringCase()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_leading_whitespace_while_checking_a_string_to_not_match_another() + { + // Arrange + string actual = " test"; + string expect = "t*t"; + + // Act + Action act = () => actual.Should().NotMatchEquivalentOf(expect, o => o.IgnoringLeadingWhitespace()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_trailing_whitespace_while_checking_a_string_to_not_match_another() + { + // Arrange + string actual = "test "; + string expect = "t*t"; + + // Act + Action act = () => actual.Should().NotMatchEquivalentOf(expect, o => o.IgnoringTrailingWhitespace()); + + // Assert + act.Should().Throw(); + } + [Fact] public void When_a_string_is_not_equivalent_to_a_pattern_and_that_is_expected_it_should_not_throw() { diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.StartWith.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.StartWith.cs index 1ffccec4f7..74edf7c660 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.StartWith.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.StartWith.cs @@ -18,12 +18,18 @@ public void When_asserting_string_starts_with_the_same_value_it_should_not_throw // Arrange string value = "ABC"; - // Act - Action action = () => - value.Should().StartWith("AB"); + // Act / Assert + value.Should().StartWith("AB"); + } - // Assert - action.Should().NotThrow(); + [Fact] + public void When_expected_string_is_the_same_value_it_should_not_throw() + { + // Arrange + string value = "ABC"; + + // Act / Assert + value.Should().StartWith(value); } [Fact] @@ -67,11 +73,8 @@ public void When_string_start_is_compared_with_null_it_should_throw() [Fact] public void When_string_start_is_compared_with_empty_string_it_should_not_throw() { - // Act - Action act = () => "ABC".Should().StartWith(""); - - // Assert - act.Should().NotThrow(); + // Act / Assert + "ABC".Should().StartWith(""); } [Fact] @@ -107,12 +110,8 @@ public void When_asserting_string_does_not_start_with_a_value_and_it_does_not_it // Arrange string value = "ABC"; - // Act - Action action = () => - value.Should().NotStartWith("DE"); - - // Assert - action.Should().NotThrow(); + // Act / Assert + value.Should().NotStartWith("DE"); } [Fact] @@ -127,7 +126,7 @@ public void When_asserting_string_does_not_start_with_a_value_but_it_does_it_sho // Assert action.Should().Throw().WithMessage( - "Expected value that does not start with \"AB\" because of some reason, but found \"ABC\"."); + "Expected value not to start with \"AB\" because of some reason, but found \"ABC\"."); } [Fact] @@ -157,7 +156,7 @@ public void When_asserting_string_does_not_start_with_a_value_that_is_empty_it_s // Assert action.Should().Throw().WithMessage( - "Expected value that does not start with \"\", but found \"ABC\"."); + "Expected value not to start with \"\", but found \"ABC\"."); } [Fact] @@ -169,7 +168,7 @@ public void When_asserting_string_does_not_start_with_a_value_and_actual_value_i // Assert act.Should().Throw().WithMessage( - "Expected someString that does not start with \"ABC\", but found ."); + "Expected someString not to start with \"ABC\", but found ."); } } } diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.StartWithEquivalentOf.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.StartWithEquivalentOf.cs index 5a092d8785..7752da1c74 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.StartWithEquivalentOf.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.StartWithEquivalentOf.cs @@ -10,8 +10,68 @@ namespace FluentAssertions.Specs.Primitives; /// public partial class StringAssertionSpecs { - public class StartWithEquivalent + public class StartWithEquivalentOf { + [Fact] + public void Succeed_for_different_strings_using_custom_matching_comparer() + { + // Arrange + var comparer = new AlwaysMatchingEqualityComparer(); + string actual = "ABC"; + string expect = "XYZ"; + + // Act / Assert + actual.Should().StartWithEquivalentOf(expect, o => o.Using(comparer)); + } + + [Fact] + public void Fail_for_same_strings_using_custom_not_matching_comparer() + { + // Arrange + var comparer = new NeverMatchingEqualityComparer(); + string actual = "ABC"; + string expect = "ABC"; + + // Act + Action act = () => actual.Should().StartWithEquivalentOf(expect, o => o.Using(comparer)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_casing_while_checking_a_string_to_start_with_another() + { + // Arrange + string actual = "test with suffix"; + string expect = "TEST"; + + // Act / Assert + actual.Should().StartWithEquivalentOf(expect, o => o.IgnoringCase()); + } + + [Fact] + public void Can_ignore_leading_whitespace_while_checking_a_string_to_start_with_another() + { + // Arrange + string actual = " test with suffix"; + string expect = "test"; + + // Act / Assert + actual.Should().StartWithEquivalentOf(expect, o => o.IgnoringLeadingWhitespace()); + } + + [Fact] + public void Can_ignore_trailing_whitespace_while_checking_a_string_to_start_with_another() + { + // Arrange + string actual = "test with suffix "; + string expect = "test"; + + // Act / Assert + actual.Should().StartWithEquivalentOf(expect, o => o.IgnoringTrailingWhitespace()); + } + [Fact] public void When_start_of_string_differs_by_case_only_it_should_not_throw() { @@ -97,8 +157,77 @@ public void When_string_start_is_compared_with_equivalent_and_actual_value_is_nu } } - public class NotStartWithEquivalent + public class NotStartWithEquivalentOf { + [Fact] + public void Succeed_for_same_strings_using_custom_not_matching_comparer() + { + // Arrange + var comparer = new NeverMatchingEqualityComparer(); + string actual = "ABC"; + string expect = "ABC"; + + // Act / Assert + actual.Should().NotStartWithEquivalentOf(expect, o => o.Using(comparer)); + } + + [Fact] + public void Fail_for_different_strings_using_custom_matching_comparer() + { + // Arrange + var comparer = new AlwaysMatchingEqualityComparer(); + string actual = "ABC"; + string expect = "XYZ"; + + // Act + Action act = () => actual.Should().NotStartWithEquivalentOf(expect, o => o.Using(comparer)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_casing_while_checking_a_string_to_not_start_with_another() + { + // Arrange + string actual = "test with suffix"; + string expect = "TEST"; + + // Act + Action act = () => actual.Should().NotStartWithEquivalentOf(expect, o => o.IgnoringCase()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_leading_whitespace_while_checking_a_string_to_not_start_with_another() + { + // Arrange + string actual = " test with suffix"; + string expect = "test"; + + // Act + Action act = () => actual.Should().NotStartWithEquivalentOf(expect, o => o.IgnoringLeadingWhitespace()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ignore_trailing_whitespace_while_checking_a_string_to_not_start_with_another() + { + // Arrange + string actual = "test with suffix "; + string expect = "test"; + + // Act + Action act = () => actual.Should().NotStartWithEquivalentOf(expect, o => o.IgnoringTrailingWhitespace()); + + // Assert + act.Should().Throw(); + } + [Fact] public void When_asserting_string_does_not_start_with_equivalent_of_a_value_and_it_does_not_it_should_succeed() { @@ -126,7 +255,7 @@ public void // Assert action.Should().Throw().WithMessage( - "Expected value that does not start with equivalent of \"aB\" because of some reason, but found \"ABC\"."); + "Expected value not to start with equivalent of \"aB\" because of some reason, but found \"ABC\"."); } [Fact] @@ -156,7 +285,7 @@ public void When_asserting_string_does_not_start_with_equivalent_of_a_value_that // Assert action.Should().Throw().WithMessage( - "Expected value that does not start with equivalent of \"\", but found \"ABC\"."); + "Expected value not to start with equivalent of \"\", but found \"ABC\"."); } [Fact] @@ -170,7 +299,7 @@ public void When_asserting_string_does_not_start_with_equivalent_of_a_value_and_ // Assert act.Should().Throw().WithMessage( - "Expected someString that does not start with equivalent of \"ABC\", but found ."); + "Expected someString not to start with equivalent of \"ABC\", but found ."); } } } diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.cs index 5a51095fd0..6a66c2ecb4 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.cs @@ -1,4 +1,5 @@ -using System.Diagnostics.CodeAnalysis; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using Xunit; namespace FluentAssertions.Specs.Primitives; @@ -23,4 +24,30 @@ public void When_chaining_multiple_assertions_it_should_assert_all_conditions() .Contain(substring).And .HaveLength(length); } + + private sealed class AlwaysMatchingEqualityComparer : IEqualityComparer + { + public bool Equals(string x, string y) + { + return true; + } + + public int GetHashCode(string obj) + { + return obj.GetHashCode(); + } + } + + private sealed class NeverMatchingEqualityComparer : IEqualityComparer + { + public bool Equals(string x, string y) + { + return false; + } + + public int GetHashCode(string obj) + { + return obj.GetHashCode(); + } + } } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 60e4646c24..8c8d3b77a6 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -18,6 +18,8 @@ sidebar: ### Improvements * Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) +* Allow specifying `EquivalencyOptions` in string assertions - [#2413](https://github.com/fluentassertions/fluentassertions/pull/2413) + * This also adds the capability to ignore casing, leading or trailing whitespace on strings when using `BeEquivalentTo` on object graphs or collections. * You can mark all assertions in an assembly as custom assertions using the `[CustomAssertionsAssembly]` attribute - [#2389](https://github.com/fluentassertions/fluentassertions/pull/2389) * Improve `BeEmpty()` and `BeNullOrEmpty()` performance for `IEnumerable`, by materializing only the first item - [#2530](https://github.com/fluentassertions/fluentassertions/pull/2530) * All `Should()` methods on reference types are now annotated with the `[NotNull]` attribute for a better Fluent Assertions experience when nullable reference types are enabled - [#2380](https://github.com/fluentassertions/fluentassertions/pull/2380) diff --git a/docs/_pages/strings.md b/docs/_pages/strings.md index 6c9c08a6a8..7ad2f91492 100644 --- a/docs/_pages/strings.md +++ b/docs/_pages/strings.md @@ -75,6 +75,26 @@ theString.Should().EndWithEquivalentOf("a string"); theString.Should().NotEndWithEquivalentOf("a string"); ``` +All equivalency methods which end with "EquivalentOf" can be fine-tuned in its behavior what differences to ignore. +For instance, if you want to ignore leading whitespace, use this: + +```csharp +theString.Should().BeEquivalentTo("This is a string", o => o.IgnoringLeadingWhitespace()); +``` + +The supported options are: + +| Option | Behavior | +| ---------------------------- | --------------------------------------------------------------- | +| `IgnoringLeadingWhitespace` | Ignores leading whitespace in the subject and the expectation. | +| `IgnoringTrailingWhitespace` | Ignores trailing whitespace in the subject and the expectation. | +| `IgnoringCase` | Compares the strings case-insensitive. | + +You can also specify a custom string comparer via +```csharp +theString.Should().BeEquivalentTo("THIS IS A STRING", o => o.Using(StringComparer.OrdinalIgnoreCase)); +``` + For the `Match`, `NotMatch`, `MatchEquivalentOf`, and `NotMatchEquivalentOf` methods we support wildcards. The pattern can be a combination of literal and wildcard characters, but it doesn't support regular expressions. diff --git a/qodana.yaml b/qodana.yaml index 1033508fa5..b00f17de29 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -32,3 +32,4 @@ exclude: - name: ConvertToLambdaExpression - name: SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault - name: UnusedMemberInSuper.Global + - name: ArrangeAccessorOwnerBody From ec05234f5f84b1a84f9e84a32c83a6534bf2fc8f Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sat, 13 Jan 2024 10:12:47 +0100 Subject: [PATCH 252/845] Make implicit usage more explicit --- .../ExtensibilitySpecs.cs | 2 ++ .../SelectionRulesSpecs.Accessibility.cs | 11 +++++++++++ .../SelectionRulesSpecs.Basic.cs | 8 ++++++-- .../SelectionRulesSpecs.Browsability.cs | 15 +++++++++++++++ .../SelectionRulesSpecs.Covariance.cs | 4 ++++ .../SelectionRulesSpecs.Including.cs | 2 ++ .../SelectionRulesSpecs.MemberHiding.cs | 10 ++++++++++ .../FluentAssertions.Specs.csproj | 1 + ...ctAssertionSpecs.BeDataContractSerializable.cs | 2 ++ .../ObjectAssertionSpecs.BeXmlSerializable.cs | 4 ++++ 10 files changed, 57 insertions(+), 2 deletions(-) diff --git a/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs index 2c38ac073e..5bd36b35f2 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Reflection; using FluentAssertions.Extensions; +using JetBrains.Annotations; using Xunit; using Xunit.Sdk; @@ -1012,6 +1013,7 @@ public void Can_compare_not_null_against_not_null_with_custom_nullable_comparer_ private class ClassWithNullableStructProperty { + [UsedImplicitly] public StructWithProperties? Value { get; set; } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Accessibility.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Accessibility.cs index 3a2927a06f..54a9322509 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Accessibility.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Accessibility.cs @@ -1,4 +1,5 @@ using System; +using JetBrains.Annotations; using Xunit; using Xunit.Sdk; @@ -133,10 +134,13 @@ public void When_a_property_is_internal_and_it_should_be_included_it_should_fail private class ClassWithInternalProperty { + [UsedImplicitly] public string PublicProperty { get; set; } + [UsedImplicitly] internal string InternalProperty { get; set; } + [UsedImplicitly] protected internal string ProtectedInternalProperty { get; set; } } @@ -189,10 +193,13 @@ public void When_a_field_is_internal_and_it_should_be_included_it_should_fail_th private class ClassWithInternalField { + [UsedImplicitly] public string PublicField; + [UsedImplicitly] internal string InternalField; + [UsedImplicitly] protected internal string ProtectedInternalField; } @@ -237,8 +244,10 @@ public ClassWithPrivateProtectedProperty(string name, int value) Value = value; } + [UsedImplicitly] public string Name { get; } + [UsedImplicitly] private protected int Value { get; } } @@ -261,8 +270,10 @@ public ClassWithPrivateProtectedField(string name, int value) this.value = value; } + [UsedImplicitly] public string Name; + [UsedImplicitly] private protected int value; } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs index 7edae85eb6..b57b5b0252 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; +using JetBrains.Annotations; using Xunit; using Xunit.Sdk; @@ -57,7 +58,7 @@ public void Field_names_are_case_sensitive() private class ClassWithFieldInLowerCase { - [JetBrains.Annotations.UsedImplicitly] + [UsedImplicitly] #pragma warning disable SA1307 public string name; #pragma warning restore SA1307 @@ -65,7 +66,7 @@ private class ClassWithFieldInLowerCase private class ClassWithFieldInUpperCase { - [JetBrains.Annotations.UsedImplicitly] + [UsedImplicitly] public string Name; } @@ -92,6 +93,7 @@ public void When_a_property_is_an_indexer_it_should_be_ignored() public class ClassWithIndexer { + [UsedImplicitly] public object Foo { get; set; } public string this[int n] => @@ -287,8 +289,10 @@ public void A_nested_class_without_properties_inside_a_collection_is_fine() internal class BaseClassPointingToClassWithoutProperties { + [UsedImplicitly] public string Name { get; set; } + [UsedImplicitly] public ClassWithoutProperty ClassWithoutProperty { get; } = new(); } diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Browsability.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Browsability.cs index 926e0763db..2754452d5e 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Browsability.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Browsability.cs @@ -1,5 +1,6 @@ using System; using System.ComponentModel; +using JetBrains.Annotations; using Xunit; using Xunit.Sdk; @@ -543,46 +544,60 @@ public void private class ClassWithNonBrowsableMembers { + [UsedImplicitly] public int BrowsableField = -1; + [UsedImplicitly] public int BrowsableProperty { get; set; } + [UsedImplicitly] [EditorBrowsable(EditorBrowsableState.Always)] public int ExplicitlyBrowsableField = -1; + [UsedImplicitly] [EditorBrowsable(EditorBrowsableState.Always)] public int ExplicitlyBrowsableProperty { get; set; } + [UsedImplicitly] [EditorBrowsable(EditorBrowsableState.Advanced)] public int AdvancedBrowsableField = -1; + [UsedImplicitly] [EditorBrowsable(EditorBrowsableState.Advanced)] public int AdvancedBrowsableProperty { get; set; } + [UsedImplicitly] [EditorBrowsable(EditorBrowsableState.Never)] public int NonBrowsableField = -1; + [UsedImplicitly] [EditorBrowsable(EditorBrowsableState.Never)] public int NonBrowsableProperty { get; set; } } private class ClassWhereMemberThatCouldBeNonBrowsableIsBrowsable { + [UsedImplicitly] public int BrowsableProperty { get; set; } + [UsedImplicitly] public int FieldThatMightBeNonBrowsable = -1; + [UsedImplicitly] public int PropertyThatMightBeNonBrowsable { get; set; } } private class ClassWhereMemberThatCouldBeNonBrowsableIsNonBrowsable { + [UsedImplicitly] public int BrowsableProperty { get; set; } [EditorBrowsable(EditorBrowsableState.Never)] + [UsedImplicitly] public int FieldThatMightBeNonBrowsable = -1; [EditorBrowsable(EditorBrowsableState.Never)] + [UsedImplicitly] public int PropertyThatMightBeNonBrowsable { get; set; } } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Covariance.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Covariance.cs index bd3ba9825a..c776012494 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Covariance.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Covariance.cs @@ -1,6 +1,7 @@ #if NET5_0_OR_GREATER using System; +using JetBrains.Annotations; using Xunit; namespace FluentAssertions.Equivalency.Specs; @@ -70,11 +71,13 @@ public void Excluding_a_covariant_property_through_the_base_class_excludes_the_b private class BaseWithProperty { + [UsedImplicitly] public string BaseProperty { get; set; } } private class DerivedWithProperty : BaseWithProperty { + [UsedImplicitly] public string DerivedProperty { get; set; } } @@ -87,6 +90,7 @@ private sealed class DerivedWithCovariantOverride : BaseWithAbstractProperty { public override DerivedWithProperty Property { get; } + [UsedImplicitly] public string OtherProp { get; set; } public DerivedWithCovariantOverride(DerivedWithProperty prop) diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs index 3bdfc2a9f5..dc938d5949 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using JetBrains.Annotations; using Xunit; using Xunit.Sdk; @@ -162,6 +163,7 @@ private enum LocalType : byte public class CustomType { + [UsedImplicitly] public string Name { get; set; } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.MemberHiding.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.MemberHiding.cs index c5ccc70e7f..04dcb44071 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.MemberHiding.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.MemberHiding.cs @@ -1,4 +1,5 @@ using System; +using JetBrains.Annotations; using Xunit; namespace FluentAssertions.Equivalency.Specs; @@ -143,26 +144,31 @@ public void Excluding_the_property_hiding_the_base_class_one_does_not_reveal_the private class BaseWithProperty { + [UsedImplicitly] public object Property { get; set; } } private class SubclassAHidingProperty : BaseWithProperty { + [UsedImplicitly] public new T Property { get; set; } } private class BaseWithStringProperty { + [UsedImplicitly] public string Property { get; set; } } private class SubclassHidingStringProperty : BaseWithStringProperty { + [UsedImplicitly] public new string Property { get; set; } } private class AnotherBaseWithProperty { + [UsedImplicitly] public object Property { get; set; } } @@ -291,21 +297,25 @@ public void Excluding_the_field_hiding_the_base_class_one_does_not_reveal_the_la private class BaseWithField { + [UsedImplicitly] public string Field; } private class SubclassAHidingField : BaseWithField { + [UsedImplicitly] public new string Field; } private class AnotherBaseWithField { + [UsedImplicitly] public string Field; } private class SubclassBHidingField : AnotherBaseWithField { + [UsedImplicitly] public new string Field; } } diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index c0eeecace5..dc24101f13 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -26,6 +26,7 @@ + all diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeDataContractSerializable.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeDataContractSerializable.cs index 3cab6d97b3..81eab5b349 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeDataContractSerializable.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeDataContractSerializable.cs @@ -1,6 +1,7 @@ using System; using System.Runtime.Serialization; using FluentAssertions.Extensions; +using JetBrains.Annotations; using Xunit; using Xunit.Sdk; @@ -103,6 +104,7 @@ public class NonDataContractSerializableClass public class DataContractSerializableClass { + [UsedImplicitly] public string Name { get; set; } public int Id; diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs index bf1cd3fc4d..ea773f33bf 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs @@ -4,6 +4,7 @@ using System.Xml.Schema; using System.Xml.Serialization; using FluentAssertions.Extensions; +using JetBrains.Annotations; using Xunit; using Xunit.Sdk; @@ -69,6 +70,7 @@ public void When_an_object_is_xml_serializable_but_doesnt_restore_all_properties public class XmlSerializableClass { + [UsedImplicitly] public string Name { get; set; } public int Id; @@ -76,6 +78,7 @@ public class XmlSerializableClass public class XmlSerializableClassNotRestoringAllProperties : IXmlSerializable { + [UsedImplicitly] public string Name { get; set; } public DateTime BirthDay { get; set; } @@ -98,6 +101,7 @@ public void WriteXml(XmlWriter writer) internal class NonPublicClass { + [UsedImplicitly] public string Name { get; set; } } } From b8b6821fc2723ad6264eddc0a6bf9260af427df2 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sat, 13 Jan 2024 10:13:11 +0100 Subject: [PATCH 253/845] Silence false positive about disposing undisposable enumerators --- .../Formatting/MultidimensionalArrayFormatter.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Src/FluentAssertions/Formatting/MultidimensionalArrayFormatter.cs b/Src/FluentAssertions/Formatting/MultidimensionalArrayFormatter.cs index 340a490edd..02bdca8483 100644 --- a/Src/FluentAssertions/Formatting/MultidimensionalArrayFormatter.cs +++ b/Src/FluentAssertions/Formatting/MultidimensionalArrayFormatter.cs @@ -33,6 +33,9 @@ public void Format(object value, FormattedObjectGraph formattedGraph, Formatting int[] dimensionIndices = Enumerable.Range(0, arr.Rank).Select(dimension => arr.GetLowerBound(dimension)).ToArray(); int currentLoopIndex = 0; + + // ReSharper disable once NotDisposedResource (false positive) + // See https://youtrack.jetbrains.com/issue/QD-8114/It-is-not-a-problem-Local-variable-enumerator-is-never-disposed IEnumerator enumerator = arr.GetEnumerator(); // Emulate n-ary loop From a45997e8ad4f2a61128c25c4ff3dc9f3ddf26a2e Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sat, 13 Jan 2024 10:13:50 +0100 Subject: [PATCH 254/845] Remove empty enum declarations We had to disable RCS1055 to prevent Roslyn from complaining about missing semicolons. --- Tests/.editorconfig | 4 ++++ Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.cs | 2 +- Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs | 8 ++------ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Tests/.editorconfig b/Tests/.editorconfig index d7c1e5c6d3..5af84a1e03 100644 --- a/Tests/.editorconfig +++ b/Tests/.editorconfig @@ -162,6 +162,10 @@ resharper_keep_user_linebreaks = true # Make class static dotnet_diagnostic.RCS1102.severity = none +# Unnecessary semicolon at the end of declaration +# see https://github.com/dotnet/roslynator/issues/1359 +dotnet_diagnostic.RCS1055.severity = none + # Mark local variable as const. dotnet_diagnostic.RCS1118.severity = none diff --git a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.cs index 0ec9bf2ade..ac0d89b03f 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.cs @@ -130,7 +130,7 @@ internal class Nested { private class PrivateClass; - protected enum ProtectedEnum { } + protected enum ProtectedEnum; public interface IPublicInterface; diff --git a/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs b/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs index 456738a868..3d2306a0e3 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs @@ -796,9 +796,7 @@ namespace Internal.NotOnlyClasses.Test { internal class NotOnlyClassesClass; - internal enum NotOnlyClassesEnumeration - { - } + internal enum NotOnlyClassesEnumeration; internal interface INotOnlyClassesInterface; } @@ -882,9 +880,7 @@ internal class InternalClassNotValueType; internal record InternalRecordClass; - internal enum InternalEnumValueType - { - } + internal enum InternalEnumValueType; internal interface InternalInterfaceNotValueType; } From 077e01c251e4201f55a1dc91cb6a015bcf89c3cc Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sat, 13 Jan 2024 10:14:27 +0100 Subject: [PATCH 255/845] Resolve accessing potentially null values --- .../CollectionSpecs.cs | 2 +- .../Primitives/ObjectAssertionSpecs.cs | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs index 75e22cfdf5..64e036548d 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs @@ -2716,7 +2716,7 @@ public void When_an_exception_is_thrown_during_data_access_the_stack_trace_conta var genericCollectionB = new List { new() }; var expectedTargetSite = typeof(ExceptionThrowingClass) - .GetProperty(nameof(ExceptionThrowingClass.ExceptionThrowingProperty)).GetMethod; + .GetProperty(nameof(ExceptionThrowingClass.ExceptionThrowingProperty))!.GetMethod; // Act Action act = () => genericCollectionA.Should().BeEquivalentTo(genericCollectionB); diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs index 53bf614720..e83f7a0394 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs @@ -39,7 +39,11 @@ public void Should_throw_a_helpful_error_when_accidentally_using_equals() internal class DumbObjectEqualityComparer : IEqualityComparer { - public new bool Equals(object x, object y) => x.Equals(y); + // ReSharper disable once MemberHidesStaticFromOuterClass + public new bool Equals(object x, object y) + { + return (x == y) || (x is not null && y is not null && x.Equals(y)); + } public int GetHashCode(object obj) => obj.GetHashCode(); } @@ -69,7 +73,10 @@ public SomeClass(int key) internal class SomeClassEqualityComparer : IEqualityComparer { - public bool Equals(SomeClass x, SomeClass y) => x.Key == y.Key; + public bool Equals(SomeClass x, SomeClass y) + { + return (x == y) || (x is not null && y is not null && x.Key.Equals(y.Key)); + } public int GetHashCode(SomeClass obj) => obj.Key; } From 7d3983f9b8560fcbb3664d565bb6141046529cf7 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sat, 13 Jan 2024 10:14:53 +0100 Subject: [PATCH 256/845] Properly using a using-block when needed --- .../Execution/AssertionScope.ChainingApiSpecs.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScope.ChainingApiSpecs.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScope.ChainingApiSpecs.cs index 3213116475..11f21eae89 100644 --- a/Tests/FluentAssertions.Specs/Execution/AssertionScope.ChainingApiSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/AssertionScope.ChainingApiSpecs.cs @@ -186,7 +186,7 @@ public void When_the_previous_assertion_failed_it_should_not_evaluate_the_succee public void When_the_previous_assertion_failed_it_should_not_execute_the_succeeding_failure() { // Arrange - using var scope = new AssertionScope(); + var scope = new AssertionScope(); // Act Execute.Assertion @@ -532,7 +532,7 @@ public void Continuing_an_assertion_with_occurrence_check_before_defining_expect public void Does_not_continue_a_chained_assertion_after_the_first_one_failed_the_occurrence_check() { // Arrange - using var scope = new AssertionScope(); + var scope = new AssertionScope(); // Act Execute.Assertion From d97b94cbb54f1e6cb57b8d730390697683e516f7 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sat, 13 Jan 2024 10:15:16 +0100 Subject: [PATCH 257/845] Silence certain Qodana issues for tests --- qodana.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qodana.yaml b/qodana.yaml index b00f17de29..8d10c93246 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -33,3 +33,9 @@ exclude: - name: SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault - name: UnusedMemberInSuper.Global - name: ArrangeAccessorOwnerBody + - name: CollectionNeverUpdated.Local + paths: + - Tests + - name: PossibleMultipleEnumeration + paths: + - Tests From 8c5045c638224766bd64eda992fc38322ff66b82 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sat, 13 Jan 2024 10:15:48 +0100 Subject: [PATCH 258/845] Set the Qodana threshold to 0 again after solving all issues --- qodana.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qodana.yaml b/qodana.yaml index 8d10c93246..3145633150 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,7 +1,7 @@ version: "1.0" ide: QDNET -failThreshold: 20 +failThreshold: 0 profile: path: profile.yaml From 3ce7286453e05dbf55ff17338f29201ee8775c3d Mon Sep 17 00:00:00 2001 From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:44:59 +0100 Subject: [PATCH 259/845] Switch from `yarn` to `npm` (#2545) * Switch from yarn to npm * Download node + npm * Refactor `SpellCheck` and `InstallNode` logic to a custom `NpmTasks` implementation Co-authored-by: ITaluone <44049228+ITaluone@users.noreply.github.com> * Cache local node installation * Add cache step for CI builds * Add `CompressionExtension` for unpacking .tar.xz * Keep all previous defined env vars on windows * Remove unused tool `Node` * Update _build.csproj Co-authored-by: Jonas Nyrup * Update CustomNpmTasks.cs * Update build.yml * Revert spellcheck tests * Add custom logger which ignores `wslpath` errors --------- Co-authored-by: ITaluone <44049228+ITaluone@users.noreply.github.com> Co-authored-by: Jonas Nyrup --- .github/workflows/build.yml | 7 + .nuke/build.schema.json | 2 + Build/Build.cs | 57 +- Build/CompressionExtensions.cs | 28 + Build/CustomNpmTasks.cs | 200 ++++ Build/_build.csproj | 3 +- NodeVersion | 1 + package-lock.json | 1809 ++++++++++++++++++++++++++++++++ yarn.lock | 1101 ------------------- 9 files changed, 2069 insertions(+), 1139 deletions(-) create mode 100644 Build/CompressionExtensions.cs create mode 100644 Build/CustomNpmTasks.cs create mode 100644 NodeVersion create mode 100644 package-lock.json delete mode 100644 yarn.lock diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bded11602b..29556b52ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,13 @@ jobs: 7.0.x 8.0.x + - name: Cache .nuke/temp + uses: actions/cache@v3 + with: + path: | + .nuke/temp + key: ${{ runner.os }}-${{ hashFiles('NodeVersion') }} + - name: Run NUKE run: ./build.ps1 env: diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index b828be0d11..8984315e77 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -86,6 +86,7 @@ "Clean", "CodeCoverage", "Compile", + "InstallNode", "Pack", "Push", "Restore", @@ -112,6 +113,7 @@ "Clean", "CodeCoverage", "Compile", + "InstallNode", "Pack", "Push", "Restore", diff --git a/Build/Build.cs b/Build/Build.cs index 167665c396..72fb909072 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -1,6 +1,10 @@ using System; +using System.Collections.Generic; using System.Linq; +using System.Net.Http; +using System.Runtime.InteropServices; using LibGit2Sharp; +using Microsoft.Build.Tasks; using Nuke.Common; using Nuke.Common.CI.GitHubActions; using Nuke.Common.Execution; @@ -18,6 +22,7 @@ using static Nuke.Common.Tools.ReportGenerator.ReportGeneratorTasks; using static Nuke.Common.Tools.Xunit.XunitTasks; using static Serilog.Log; +using static CustomNpmTasks; [UnsetVisualStudioEnvironmentVariables] [DotNetVerbosityMapping] @@ -61,18 +66,6 @@ class Build : NukeBuild [Required] [GitRepository] readonly GitRepository GitRepository; - -#if OS_WINDOWS - [NuGetPackage("Node.js.redist", "node.exe", Version = "20.9.0", Framework = "win-x64")] -#elif OS_MAC - [NuGetPackage("Node.js.redist", "node", Version = "20.9.0", Framework = "osx-x64")] -#else - [NuGetPackage("Node.js.redist", "node", Version = "20.9.0", Framework = "linux-x64")] -#endif - Tool Node; - - string YarnCli => $"{NuGetToolPathResolver.GetPackageExecutable("Yarn.MSBuild", "yarn.js", "1.22.19")}"; - AbsolutePath ArtifactsDirectory => RootDirectory / "Artifacts"; AbsolutePath TestResultsDirectory => RootDirectory / "TestResults"; @@ -351,36 +344,27 @@ from framework in supportedFrameworks Target SpellCheck => _ => _ .OnlyWhenDynamic(() => RunAllTargets || HasDocumentationChanges) + .DependsOn(InstallNode) .ProceedAfterFailure() .Executes(() => { - Node($"{YarnCli} --silent install", workingDirectory: RootDirectory, - logger: YarnInstallLogger); - - Node($"{YarnCli} --silent run cspell", workingDirectory: RootDirectory, - logger: (_, msg) => Error(msg)); + NpmInstall(silent: true, workingDirectory: RootDirectory); + NpmRun("cspell", silent: true); }); - Action YarnInstallLogger = (_, msg) => - { - // See this PR here: https://github.com/fluentassertions/fluentassertions/pull/2537 - // and several comments and references. - // This seems to be a bug in yarn and the package 'Yarn.MSBuild' is no longer maintained; - // So: ignore 'yarn install' errors when the same cache directory is defined in yarn.lock. - // This errors have the pattern like: 'Error: warning Pattern [packagename@version]...' - - if (!msg.Contains("is trying to unpack in the same destination")) + Target InstallNode => _ => _ + .OnlyWhenDynamic(() => RunAllTargets || HasDocumentationChanges) + .ProceedAfterFailure() + .Executes(() => { - if (msg.StartsWith("warning")) - { - Warning(msg); - } - else - { - Error(msg); - } - } - }; + Initialize(RootDirectory); + + NpmFetchRuntime(); + + ReportSummary(s => s + .When(HasCachedNodeModules, conf => conf + .AddPair("Skipped", "Downloading and extracting"))); + }); bool HasDocumentationChanges => Changes.Any(x => IsDocumentation(x)); @@ -392,6 +376,7 @@ static bool IsDocumentation(string x) => x.StartsWith("cSpell.json") || x.StartsWith("LICENSE") || x.StartsWith("package.json") || + x.StartsWith("package-lock.json") || x.StartsWith("README.md"); string[] Changes => diff --git a/Build/CompressionExtensions.cs b/Build/CompressionExtensions.cs new file mode 100644 index 0000000000..334960480d --- /dev/null +++ b/Build/CompressionExtensions.cs @@ -0,0 +1,28 @@ +using Nuke.Common.IO; +using SharpCompress.Common; +using SharpCompress.Readers; +using System.IO; + +public static class CompressionExtensions +{ + public static void UnTarXzTo(this AbsolutePath archive, AbsolutePath directory) + { + using Stream stream = File.OpenRead(archive); + + using var reader = ReaderFactory.Open(stream); + + while (reader.MoveToNextEntry()) + { + if (reader.Entry.IsDirectory) + { + continue; + } + + reader.WriteEntryToDirectory(directory, new ExtractionOptions + { + ExtractFullPath = true, + Overwrite = true + }); + } + } +} diff --git a/Build/CustomNpmTasks.cs b/Build/CustomNpmTasks.cs new file mode 100644 index 0000000000..775414dac6 --- /dev/null +++ b/Build/CustomNpmTasks.cs @@ -0,0 +1,200 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Nuke.Common; +using Nuke.Common.IO; +using Nuke.Common.Tooling; +using Nuke.Common.Utilities; +using Nuke.Common.Utilities.Collections; +using static Serilog.Log; + +public static class CustomNpmTasks +{ + static AbsolutePath RootDirectory; + static AbsolutePath TempDir; + static AbsolutePath NodeDir; + static AbsolutePath NodeDirPerOs; + static AbsolutePath WorkingDirectory; + + static IReadOnlyDictionary NpmEnvironmentVariables = null; + + static Tool Npm; + + static string Version; + + public static bool HasCachedNodeModules; + + public static void Initialize(AbsolutePath root) + { + RootDirectory = root; + NodeDir = RootDirectory / ".nuke" / "temp"; + + Version = (RootDirectory / "NodeVersion").ReadAllText().Trim(); + HasCachedNodeModules = NodeDir.GlobFiles($"node*{Version}*/**/node*", $"node*{Version}*/**/npm*").Count != 0; + } + + public static void NpmFetchRuntime() + { + DownloadNodeArchive().ExtractNodeArchive(); + + LinkTools(); + } + + static AbsolutePath DownloadNodeArchive() + { + AbsolutePath archive = NodeDir; + string os = null; + string archiveType = null; + + if (EnvironmentInfo.IsWin) + { + os = "win-x64"; + archiveType = ".zip"; + } + else if (EnvironmentInfo.IsOsx) + { + os = "darwin-x64"; + archiveType = ".tar.gz"; + } + else if (EnvironmentInfo.IsLinux) + { + os = "linux-x64"; + archiveType = ".tar.xz"; + } + + os.NotNull(); + archiveType.NotNull(); + + os = EnvironmentInfo.IsArm64 ? os!.Replace("x64", "arm64") : os; + + if (!HasCachedNodeModules) + { + Information($"Fetching node.js ({Version}) for {os}"); + + string downloadUrl = $"https://nodejs.org/dist/v{Version}/node-v{Version}-{os}{archiveType}"; + archive = NodeDir / $"node{archiveType}"; + + HttpTasks.HttpDownloadFile(downloadUrl, archive, clientConfigurator: c => + { + c.Timeout = TimeSpan.FromSeconds(50); + + return c; + }); + } + else + { + Information("Skipping archive download due to cache"); + } + + NodeDirPerOs = NodeDir / $"node-v{Version}-{os}"; + WorkingDirectory = NodeDirPerOs; + + return archive; + } + + static void ExtractNodeArchive(this AbsolutePath archive) + { + if (HasCachedNodeModules) + { + Information("Skipping archive extraction due to cache"); + + return; + } + + Information($"Extracting node.js binary archive ({archive}) to {NodeDir}"); + + if (EnvironmentInfo.IsWin) + { + archive.UnZipTo(NodeDir); + } + else if (EnvironmentInfo.IsOsx) + { + archive.UnTarGZipTo(NodeDir); + } + else if (EnvironmentInfo.IsLinux) + { + archive.UnTarXzTo(NodeDir); + } + } + + static void LinkTools() + { + if (EnvironmentInfo.IsWin) + { + Information("Resolve tool npm..."); + Npm = ToolResolver.GetTool(NodeDirPerOs / "npm.cmd"); + NpmVersion(); + } + else + { + WorkingDirectory /= "bin"; + + var nodeExecutable = WorkingDirectory / "node"; + var npmNodeModules = NodeDirPerOs / "lib" / "node_modules"; + var npmExecutable = npmNodeModules / "npm" / "bin" / "npm"; + var npmSymlink = WorkingDirectory / "npm"; + + Information($"Set execution permissions for {nodeExecutable}..."); + nodeExecutable.SetExecutable(); + + Information($"Set execution permissions for {npmExecutable}..."); + npmExecutable.SetExecutable(); + + Information("Linking binaries..."); + Tool ln = ToolResolver.GetPathTool("ln"); + ln($"-sf {npmExecutable} npm", workingDirectory: WorkingDirectory); + ln($"-sf {npmNodeModules} node_modules", workingDirectory: WorkingDirectory); + + Information("Resolve tool npm..."); + Npm = ToolResolver.GetTool(npmSymlink); + NpmVersion(); + } + + SetEnvVars(); + } + + static void SetEnvVars() + { + NpmEnvironmentVariables = EnvironmentInfo.Variables + .ToDictionary(x => x.Key, x => x.Value) + .SetKeyValue("path", WorkingDirectory).AsReadOnly(); + } + + public static void NpmInstall(bool silent = false, string workingDirectory = null) + { + Npm($"install {(silent ? "--silent" : "")}", + workingDirectory, + logger: NpmLogger); + } + + public static void NpmRun(string args, bool silent = false) + { + Npm($"run {(silent ? "--silent" : "")} {args}".TrimMatchingDoubleQuotes(), + environmentVariables: NpmEnvironmentVariables, + logger: NpmLogger); + } + + static void NpmVersion() + { + Npm("--version", + workingDirectory: WorkingDirectory, + logInvocation: false, + logger: NpmLogger, + environmentVariables: NpmEnvironmentVariables); + } + + static Action NpmLogger = (outputType, msg) => + { + if (EnvironmentInfo.IsWsl && msg.Contains("wslpath")) + return; + + if (outputType == OutputType.Err) + { + Error(msg); + + return; + } + + Information(msg); + }; +} diff --git a/Build/_build.csproj b/Build/_build.csproj index d4edec84bc..7fe341896f 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -20,10 +20,9 @@ - - + diff --git a/NodeVersion b/NodeVersion new file mode 100644 index 0000000000..8b0beab16a --- /dev/null +++ b/NodeVersion @@ -0,0 +1 @@ +20.11.0 diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000..5542feb3d9 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1809 @@ +{ + "name": "fluentassertions", + "version": "1.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "version": "1.0.1", + "dependencies": { + "cspell": "^8.3.1" + } + }, + "node_modules/@cspell/cspell-bundled-dicts": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.3.2.tgz", + "integrity": "sha512-3ubOgz1/MDixJbq//0rQ2omB3cSdhVJDviERZeiREGz4HOq84aaK1Fqbw5SjNZHvhpoq+AYXm6kJbIAH8YhKgg==", + "license": "MIT", + "dependencies": { + "@cspell/dict-ada": "^4.0.2", + "@cspell/dict-aws": "^4.0.1", + "@cspell/dict-bash": "^4.1.3", + "@cspell/dict-companies": "^3.0.29", + "@cspell/dict-cpp": "^5.0.10", + "@cspell/dict-cryptocurrencies": "^5.0.0", + "@cspell/dict-csharp": "^4.0.2", + "@cspell/dict-css": "^4.0.12", + "@cspell/dict-dart": "^2.0.3", + "@cspell/dict-django": "^4.1.0", + "@cspell/dict-docker": "^1.1.7", + "@cspell/dict-dotnet": "^5.0.0", + "@cspell/dict-elixir": "^4.0.3", + "@cspell/dict-en_us": "^4.3.13", + "@cspell/dict-en-common-misspellings": "^2.0.0", + "@cspell/dict-en-gb": "1.1.33", + "@cspell/dict-filetypes": "^3.0.3", + "@cspell/dict-fonts": "^4.0.0", + "@cspell/dict-fsharp": "^1.0.1", + "@cspell/dict-fullstack": "^3.1.5", + "@cspell/dict-gaming-terms": "^1.0.4", + "@cspell/dict-git": "^3.0.0", + "@cspell/dict-golang": "^6.0.5", + "@cspell/dict-haskell": "^4.0.1", + "@cspell/dict-html": "^4.0.5", + "@cspell/dict-html-symbol-entities": "^4.0.0", + "@cspell/dict-java": "^5.0.6", + "@cspell/dict-k8s": "^1.0.2", + "@cspell/dict-latex": "^4.0.0", + "@cspell/dict-lorem-ipsum": "^4.0.0", + "@cspell/dict-lua": "^4.0.3", + "@cspell/dict-makefile": "^1.0.0", + "@cspell/dict-node": "^4.0.3", + "@cspell/dict-npm": "^5.0.14", + "@cspell/dict-php": "^4.0.5", + "@cspell/dict-powershell": "^5.0.3", + "@cspell/dict-public-licenses": "^2.0.5", + "@cspell/dict-python": "^4.1.11", + "@cspell/dict-r": "^2.0.1", + "@cspell/dict-ruby": "^5.0.2", + "@cspell/dict-rust": "^4.0.1", + "@cspell/dict-scala": "^5.0.0", + "@cspell/dict-software-terms": "^3.3.15", + "@cspell/dict-sql": "^2.1.3", + "@cspell/dict-svelte": "^1.0.2", + "@cspell/dict-swift": "^2.0.1", + "@cspell/dict-typescript": "^3.1.2", + "@cspell/dict-vue": "^3.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/cspell-json-reporter": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.3.2.tgz", + "integrity": "sha512-gHSz4jXMJPcxx+lOGfXhHuoyenAWQ8PVA/atHFrWYKo1LzKTbpkEkrsDnlX8QNJubc3EMH63Uy+lOIaFDVyHiQ==", + "license": "MIT", + "dependencies": { + "@cspell/cspell-types": "8.3.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/cspell-pipe": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.3.2.tgz", + "integrity": "sha512-GZmDwvQGOjQi3IjD4k9xXeVTDANczksOsgVKb3v2QZk9mR4Qj8c6Uarjd4AgSiIhu/wBliJfzr5rWFJu4X2VfQ==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/cspell-resolver": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.3.2.tgz", + "integrity": "sha512-w2Tmb95bzdEz9L4W5qvsP5raZbyEzKL7N2ksU/+yh8NEJcTuExmAl/nMnb3aIk7m2b+kPHnMOcJuwfUMLmyv4A==", + "license": "MIT", + "dependencies": { + "global-directory": "^4.0.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/cspell-service-bus": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.3.2.tgz", + "integrity": "sha512-skTHNyVi74//W/O+f4IauDhm6twA9S2whkylonsIzPxEl4Pn3y2ZEMXNki/MWUwZfDIzKKSxlcREH61g7zCvhg==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/cspell-types": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.3.2.tgz", + "integrity": "sha512-qS/gWd9ItOrN6ZX5pwC9lJjnBoyiAyhxYq0GUXuV892LQvwrBmECGk6KhsA1lPW7JJS7o57YTAS1jmXnmXMEpg==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspell/dict-ada": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.0.2.tgz", + "integrity": "sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA==", + "license": "MIT" + }, + "node_modules/@cspell/dict-aws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.1.tgz", + "integrity": "sha512-NXO+kTPQGqaaJKa4kO92NAXoqS+i99dQzf3/L1BxxWVSBS3/k1f3uhmqIh7Crb/n22W793lOm0D9x952BFga3Q==", + "license": "MIT" + }, + "node_modules/@cspell/dict-bash": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.1.3.tgz", + "integrity": "sha512-tOdI3QVJDbQSwPjUkOiQFhYcu2eedmX/PtEpVWg0aFps/r6AyjUQINtTgpqMYnYuq8O1QUIQqnpx21aovcgZCw==", + "license": "MIT" + }, + "node_modules/@cspell/dict-companies": { + "version": "3.0.29", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.0.29.tgz", + "integrity": "sha512-F/8XnkqjU7jmSDAcD3LSSX+WxCVUWPssqlO4lzGMIK3MNIUt+d48eSIt3pFAIB/Z9y0ojoLHUtWX9HJ1ZtGrXQ==", + "license": "MIT" + }, + "node_modules/@cspell/dict-cpp": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.1.tgz", + "integrity": "sha512-Qy9fNsR/5RcQ6G85gDKFjvzh0AdgAilLQeSXPtqY21Fx1kCjUqdVVJYMmHUREgcxH6ptAxtn5knTWU4PIhQtOw==", + "license": "MIT" + }, + "node_modules/@cspell/dict-cryptocurrencies": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-5.0.0.tgz", + "integrity": "sha512-Z4ARIw5+bvmShL+4ZrhDzGhnc9znaAGHOEMaB/GURdS/jdoreEDY34wdN0NtdLHDO5KO7GduZnZyqGdRoiSmYA==", + "license": "MIT" + }, + "node_modules/@cspell/dict-csharp": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.2.tgz", + "integrity": "sha512-1JMofhLK+4p4KairF75D3A924m5ERMgd1GvzhwK2geuYgd2ZKuGW72gvXpIV7aGf52E3Uu1kDXxxGAiZ5uVG7g==", + "license": "MIT" + }, + "node_modules/@cspell/dict-css": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.12.tgz", + "integrity": "sha512-vGBgPM92MkHQF5/2jsWcnaahOZ+C6OE/fPvd5ScBP72oFY9tn5GLuomcyO0z8vWCr2e0nUSX1OGimPtcQAlvSw==", + "license": "MIT" + }, + "node_modules/@cspell/dict-dart": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.0.3.tgz", + "integrity": "sha512-cLkwo1KT5CJY5N5RJVHks2genFkNCl/WLfj+0fFjqNR+tk3tBI1LY7ldr9piCtSFSm4x9pO1x6IV3kRUY1lLiw==", + "license": "MIT" + }, + "node_modules/@cspell/dict-data-science": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-1.0.11.tgz", + "integrity": "sha512-TaHAZRVe0Zlcc3C23StZqqbzC0NrodRwoSAc8dis+5qLeLLnOCtagYQeROQvDlcDg3X/VVEO9Whh4W/z4PAmYQ==", + "license": "MIT" + }, + "node_modules/@cspell/dict-django": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.0.tgz", + "integrity": "sha512-bKJ4gPyrf+1c78Z0Oc4trEB9MuhcB+Yg+uTTWsvhY6O2ncFYbB/LbEZfqhfmmuK/XJJixXfI1laF2zicyf+l0w==", + "license": "MIT" + }, + "node_modules/@cspell/dict-docker": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.7.tgz", + "integrity": "sha512-XlXHAr822euV36GGsl2J1CkBIVg3fZ6879ZOg5dxTIssuhUOCiV2BuzKZmt6aIFmcdPmR14+9i9Xq+3zuxeX0A==", + "license": "MIT" + }, + "node_modules/@cspell/dict-dotnet": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.0.tgz", + "integrity": "sha512-EOwGd533v47aP5QYV8GlSSKkmM9Eq8P3G/eBzSpH3Nl2+IneDOYOBLEUraHuiCtnOkNsz0xtZHArYhAB2bHWAw==", + "license": "MIT" + }, + "node_modules/@cspell/dict-elixir": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-4.0.3.tgz", + "integrity": "sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q==", + "license": "MIT" + }, + "node_modules/@cspell/dict-en_us": { + "version": "4.3.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.13.tgz", + "integrity": "sha512-T6lHiGCjloGNE0d8CogF+efJZPCAP8zdzn+KnlI0Bmjaz5nvG2LTX7CXl1zkOl1nYYev0FuIk9WJ9YPVRjcFbQ==", + "license": "MIT" + }, + "node_modules/@cspell/dict-en-common-misspellings": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.0.tgz", + "integrity": "sha512-NOg8dlv37/YqLkCfBs5OXeJm/Wcfb/CzeOmOZJ2ZXRuxwsNuolb4TREUce0yAXRqMhawahY5TSDRJJBgKjBOdw==", + "license": "CC BY-SA 4.0" + }, + "node_modules/@cspell/dict-en-gb": { + "version": "1.1.33", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz", + "integrity": "sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==", + "license": "MIT" + }, + "node_modules/@cspell/dict-filetypes": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.3.tgz", + "integrity": "sha512-J9UP+qwwBLfOQ8Qg9tAsKtSY/WWmjj21uj6zXTI9hRLD1eG1uUOLcfVovAmtmVqUWziPSKMr87F6SXI3xmJXgw==", + "license": "MIT" + }, + "node_modules/@cspell/dict-fonts": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.0.tgz", + "integrity": "sha512-t9V4GeN/m517UZn63kZPUYP3OQg5f0OBLSd3Md5CU3eH1IFogSvTzHHnz4Wqqbv8NNRiBZ3HfdY/pqREZ6br3Q==", + "license": "MIT" + }, + "node_modules/@cspell/dict-fsharp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-fsharp/-/dict-fsharp-1.0.1.tgz", + "integrity": "sha512-23xyPcD+j+NnqOjRHgW3IU7Li912SX9wmeefcY0QxukbAxJ/vAN4rBpjSwwYZeQPAn3fxdfdNZs03fg+UM+4yQ==", + "license": "MIT" + }, + "node_modules/@cspell/dict-fullstack": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.1.5.tgz", + "integrity": "sha512-6ppvo1dkXUZ3fbYn/wwzERxCa76RtDDl5Afzv2lijLoijGGUw5yYdLBKJnx8PJBGNLh829X352ftE7BElG4leA==", + "license": "MIT" + }, + "node_modules/@cspell/dict-gaming-terms": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.0.4.tgz", + "integrity": "sha512-hbDduNXlk4AOY0wFxcDMWBPpm34rpqJBeqaySeoUH70eKxpxm+dvjpoRLJgyu0TmymEICCQSl6lAHTHSDiWKZg==", + "license": "MIT" + }, + "node_modules/@cspell/dict-git": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.0.tgz", + "integrity": "sha512-simGS/lIiXbEaqJu9E2VPoYW1OTC2xrwPPXNXFMa2uo/50av56qOuaxDrZ5eH1LidFXwoc8HROCHYeKoNrDLSw==", + "license": "MIT" + }, + "node_modules/@cspell/dict-golang": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.5.tgz", + "integrity": "sha512-w4mEqGz4/wV+BBljLxduFNkMrd3rstBNDXmoX5kD4UTzIb4Sy0QybWCtg2iVT+R0KWiRRA56QKOvBsgXiddksA==", + "license": "MIT" + }, + "node_modules/@cspell/dict-haskell": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-haskell/-/dict-haskell-4.0.1.tgz", + "integrity": "sha512-uRrl65mGrOmwT7NxspB4xKXFUenNC7IikmpRZW8Uzqbqcu7ZRCUfstuVH7T1rmjRgRkjcIjE4PC11luDou4wEQ==", + "license": "MIT" + }, + "node_modules/@cspell/dict-html": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.5.tgz", + "integrity": "sha512-p0brEnRybzSSWi8sGbuVEf7jSTDmXPx7XhQUb5bgG6b54uj+Z0Qf0V2n8b/LWwIPJNd1GygaO9l8k3HTCy1h4w==", + "license": "MIT" + }, + "node_modules/@cspell/dict-html-symbol-entities": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.0.tgz", + "integrity": "sha512-HGRu+48ErJjoweR5IbcixxETRewrBb0uxQBd6xFGcxbEYCX8CnQFTAmKI5xNaIt2PKaZiJH3ijodGSqbKdsxhw==", + "license": "MIT" + }, + "node_modules/@cspell/dict-java": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.6.tgz", + "integrity": "sha512-kdE4AHHHrixyZ5p6zyms1SLoYpaJarPxrz8Tveo6gddszBVVwIUZ+JkQE1bWNLK740GWzIXdkznpUfw1hP9nXw==", + "license": "MIT" + }, + "node_modules/@cspell/dict-k8s": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.2.tgz", + "integrity": "sha512-tLT7gZpNPnGa+IIFvK9SP1LrSpPpJ94a/DulzAPOb1Q2UBFwdpFd82UWhio0RNShduvKG/WiMZf/wGl98pn+VQ==", + "license": "MIT" + }, + "node_modules/@cspell/dict-latex": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-4.0.0.tgz", + "integrity": "sha512-LPY4y6D5oI7D3d+5JMJHK/wxYTQa2lJMSNxps2JtuF8hbAnBQb3igoWEjEbIbRRH1XBM0X8dQqemnjQNCiAtxQ==", + "license": "MIT" + }, + "node_modules/@cspell/dict-lorem-ipsum": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.0.tgz", + "integrity": "sha512-1l3yjfNvMzZPibW8A7mQU4kTozwVZVw0AvFEdy+NcqtbxH+TvbSkNMqROOFWrkD2PjnKG0+Ea0tHI2Pi6Gchnw==", + "license": "MIT" + }, + "node_modules/@cspell/dict-lua": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-4.0.3.tgz", + "integrity": "sha512-lDHKjsrrbqPaea13+G9s0rtXjMO06gPXPYRjRYawbNmo4E/e3XFfVzeci3OQDQNDmf2cPOwt9Ef5lu2lDmwfJg==", + "license": "MIT" + }, + "node_modules/@cspell/dict-makefile": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-makefile/-/dict-makefile-1.0.0.tgz", + "integrity": "sha512-3W9tHPcSbJa6s0bcqWo6VisEDTSN5zOtDbnPabF7rbyjRpNo0uHXHRJQF8gAbFzoTzBBhgkTmrfSiuyQm7vBUQ==", + "license": "MIT" + }, + "node_modules/@cspell/dict-node": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-4.0.3.tgz", + "integrity": "sha512-sFlUNI5kOogy49KtPg8SMQYirDGIAoKBO3+cDLIwD4MLdsWy1q0upc7pzGht3mrjuyMiPRUV14Bb0rkVLrxOhg==", + "license": "MIT" + }, + "node_modules/@cspell/dict-npm": { + "version": "5.0.14", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.14.tgz", + "integrity": "sha512-k0kC7/W2qG5YII+SW6s+JtvKrkZg651vizi5dv/5G2HmJaeLNgDqBVeeDk/uV+ntBorM66XG4BPMjSxoaIlC5w==", + "license": "MIT" + }, + "node_modules/@cspell/dict-php": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.5.tgz", + "integrity": "sha512-9r8ao7Z/mH9Z8pSB7yLtyvcCJWw+/MnQpj7xGVYzIV7V2ZWDRjXZAMgteHMJ37m8oYz64q5d4tiipD300QSetQ==", + "license": "MIT" + }, + "node_modules/@cspell/dict-powershell": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.3.tgz", + "integrity": "sha512-lEdzrcyau6mgzu1ie98GjOEegwVHvoaWtzQnm1ie4DyZgMr+N6D0Iyj1lzvtmt0snvsDFa5F2bsYzf3IMKcpcA==", + "license": "MIT" + }, + "node_modules/@cspell/dict-public-licenses": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.5.tgz", + "integrity": "sha512-91HK4dSRri/HqzAypHgduRMarJAleOX5NugoI8SjDLPzWYkwZ1ftuCXSk+fy8DLc3wK7iOaFcZAvbjmnLhVs4A==", + "license": "MIT" + }, + "node_modules/@cspell/dict-python": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.1.11.tgz", + "integrity": "sha512-XG+v3PumfzUW38huSbfT15Vqt3ihNb462ulfXifpQllPok5OWynhszCLCRQjQReV+dgz784ST4ggRxW452/kVg==", + "license": "MIT", + "dependencies": { + "@cspell/dict-data-science": "^1.0.11" + } + }, + "node_modules/@cspell/dict-r": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-r/-/dict-r-2.0.1.tgz", + "integrity": "sha512-KCmKaeYMLm2Ip79mlYPc8p+B2uzwBp4KMkzeLd5E6jUlCL93Y5Nvq68wV5fRLDRTf7N1LvofkVFWfDcednFOgA==", + "license": "MIT" + }, + "node_modules/@cspell/dict-ruby": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.2.tgz", + "integrity": "sha512-cIh8KTjpldzFzKGgrqUX4bFyav5lC52hXDKo4LbRuMVncs3zg4hcSf4HtURY+f2AfEZzN6ZKzXafQpThq3dl2g==", + "license": "MIT" + }, + "node_modules/@cspell/dict-rust": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.1.tgz", + "integrity": "sha512-xJSSzHDK2z6lSVaOmMxl3PTOtfoffaxMo7fTcbZUF+SCJzfKbO6vnN9TCGX2sx1RHFDz66Js6goz6SAZQdOwaw==", + "license": "MIT" + }, + "node_modules/@cspell/dict-scala": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.0.tgz", + "integrity": "sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ==", + "license": "MIT" + }, + "node_modules/@cspell/dict-software-terms": { + "version": "3.3.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.3.16.tgz", + "integrity": "sha512-ixorEP80LGxAU+ODVSn/CYIDjV0XAlZ2VrBu7CT+PwUFJ7h8o3JX1ywKB4qnt0hHru3JjWFtBoBThmZdrXnREQ==", + "license": "MIT" + }, + "node_modules/@cspell/dict-sql": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.1.3.tgz", + "integrity": "sha512-SEyTNKJrjqD6PAzZ9WpdSu6P7wgdNtGV2RV8Kpuw1x6bV+YsSptuClYG+JSdRExBTE6LwIe1bTklejUp3ZP8TQ==", + "license": "MIT" + }, + "node_modules/@cspell/dict-svelte": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-svelte/-/dict-svelte-1.0.2.tgz", + "integrity": "sha512-rPJmnn/GsDs0btNvrRBciOhngKV98yZ9SHmg8qI6HLS8hZKvcXc0LMsf9LLuMK1TmS2+WQFAan6qeqg6bBxL2Q==", + "license": "MIT" + }, + "node_modules/@cspell/dict-swift": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-2.0.1.tgz", + "integrity": "sha512-gxrCMUOndOk7xZFmXNtkCEeroZRnS2VbeaIPiymGRHj5H+qfTAzAKxtv7jJbVA3YYvEzWcVE2oKDP4wcbhIERw==", + "license": "MIT" + }, + "node_modules/@cspell/dict-typescript": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.2.tgz", + "integrity": "sha512-lcNOYWjLUvDZdLa0UMNd/LwfVdxhE9rKA+agZBGjL3lTA3uNvH7IUqSJM/IXhJoBpLLMVEOk8v1N9xi+vDuCdA==", + "license": "MIT" + }, + "node_modules/@cspell/dict-vue": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.0.tgz", + "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==", + "license": "MIT" + }, + "node_modules/@cspell/dynamic-import": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.3.2.tgz", + "integrity": "sha512-4t0xM5luA3yQhar2xWvYK4wQSDB2r0u8XkpzzJqd57MnJXd7uIAxI0awGUrDXukadRaCo0tDIlMUBemH48SNVg==", + "license": "MIT", + "dependencies": { + "import-meta-resolve": "^4.0.0" + }, + "engines": { + "node": ">=18.0" + } + }, + "node_modules/@cspell/strong-weak-map": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.3.2.tgz", + "integrity": "sha512-Mte/2000ap278kRYOUhiGWI7MNr1+A7WSWJmlcdP4CAH5SO20sZI3/cyZLjJJEyapdhK5vaP1L5J9sUcVDHd3A==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/array-timsort": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", + "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", + "license": "MIT" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk-template": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-1.1.0.tgz", + "integrity": "sha512-T2VJbcDuZQ0Tb2EWwSotMPJjgpy1/tGee1BTpUNsGZ/qgNjV2t7Mvu+d4600U564nbLesN1x2dPL+xii174Ekg==", + "license": "MIT", + "dependencies": { + "chalk": "^5.2.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/chalk/chalk-template?sponsor=1" + } + }, + "node_modules/clear-module": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/clear-module/-/clear-module-4.1.2.tgz", + "integrity": "sha512-LWAxzHqdHsAZlPlEyJ2Poz6AIs384mPeqLVCru2p0BrP9G/kVGuhNyZYClLO6cXlnuJjzC8xtsJIuMjKqLXoAw==", + "license": "MIT", + "dependencies": { + "parent-module": "^2.0.0", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/clear-module/node_modules/parent-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz", + "integrity": "sha512-uo0Z9JJeWzv8BG+tRcapBKNJ0dro9cLyczGzulS6EfeyAdeC9sbojtW6XwvYxJkEne9En+J2XEl4zyglVeIwFg==", + "license": "MIT", + "dependencies": { + "callsites": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "node_modules/comment-json": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz", + "integrity": "sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==", + "license": "MIT", + "dependencies": { + "array-timsort": "^1.0.3", + "core-util-is": "^1.0.3", + "esprima": "^4.0.1", + "has-own-prop": "^2.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/configstore": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz", + "integrity": "sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA==", + "license": "BSD-2-Clause", + "dependencies": { + "dot-prop": "^6.0.1", + "graceful-fs": "^4.2.6", + "unique-string": "^3.0.0", + "write-file-atomic": "^3.0.3", + "xdg-basedir": "^5.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/yeoman/configstore?sponsor=1" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/crypto-random-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", + "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", + "license": "MIT", + "dependencies": { + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cspell": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.3.2.tgz", + "integrity": "sha512-V8Ub3RO/a5lwSsltW/ib3Z3G/sczKtSpBBN1JChzbSCfEgaY2mJY8JW0BpkSV+Ug6uJitpXNOOaxa3Xr489i7g==", + "license": "MIT", + "dependencies": { + "@cspell/cspell-json-reporter": "8.3.2", + "@cspell/cspell-pipe": "8.3.2", + "@cspell/cspell-types": "8.3.2", + "@cspell/dynamic-import": "8.3.2", + "chalk": "^5.3.0", + "chalk-template": "^1.1.0", + "commander": "^11.1.0", + "cspell-gitignore": "8.3.2", + "cspell-glob": "8.3.2", + "cspell-io": "8.3.2", + "cspell-lib": "8.3.2", + "fast-glob": "^3.3.2", + "fast-json-stable-stringify": "^2.1.0", + "file-entry-cache": "^8.0.0", + "get-stdin": "^9.0.0", + "semver": "^7.5.4", + "strip-ansi": "^7.1.0", + "vscode-uri": "^3.0.8" + }, + "bin": { + "cspell": "bin.mjs", + "cspell-esm": "bin.mjs" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/streetsidesoftware/cspell?sponsor=1" + } + }, + "node_modules/cspell-config-lib": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.3.2.tgz", + "integrity": "sha512-Wc98XhBNLwDxnxCzMtgRJALI9a69cu3C5Gf1rGjNTKSFo9JYiQmju0Ur3z25Pkx9Sa86f+2IjvNCf33rUDSoBQ==", + "license": "MIT", + "dependencies": { + "@cspell/cspell-types": "8.3.2", + "comment-json": "^4.2.3", + "yaml": "^2.3.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-dictionary": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.3.2.tgz", + "integrity": "sha512-xyK95hO2BMPFxIo8zBwGml8035qOxSBdga1BMhwW/p2wDrQP8S4Cdm/54//tCDmKn6uRkFQvyOfWGaX2l8WMEg==", + "license": "MIT", + "dependencies": { + "@cspell/cspell-pipe": "8.3.2", + "@cspell/cspell-types": "8.3.2", + "cspell-trie-lib": "8.3.2", + "fast-equals": "^5.0.1", + "gensequence": "^6.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-gitignore": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.3.2.tgz", + "integrity": "sha512-3Qc9P5BVvl/cg//s2s+zIMGKcoH5v7oOtRgwn4UQry8yiyo19h0tiTKkSR574FMhF5NtcShTnwIwPSIXVBPFHA==", + "license": "MIT", + "dependencies": { + "cspell-glob": "8.3.2", + "find-up-simple": "^1.0.0" + }, + "bin": { + "cspell-gitignore": "bin.mjs" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-glob": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.3.2.tgz", + "integrity": "sha512-KtIFxE+3l5dGEofND4/CdZffXP8XN1+XGQKxJ96lIzWsc01mkotfhxTkla6mgvfH039t7BsY/SWv0460KyGslQ==", + "license": "MIT", + "dependencies": { + "micromatch": "^4.0.5" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-grammar": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.3.2.tgz", + "integrity": "sha512-tYCkOmRzJe1a6/R+8QGSwG7TwTgznLPqsHtepKzLmnS4YX54VXjKRI9zMARxXDzUVfyCSVdW5MyiY/0WTNoy+A==", + "license": "MIT", + "dependencies": { + "@cspell/cspell-pipe": "8.3.2", + "@cspell/cspell-types": "8.3.2" + }, + "bin": { + "cspell-grammar": "bin.mjs" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-io": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.3.2.tgz", + "integrity": "sha512-WYpKsyBCQP0SY4gXnhW5fPuxcYchKYKG1PIXVV3ezFU4muSgW6GuLNbGuSfwv/8YNXRgFSN0e3hYH0rdBK2Aow==", + "license": "MIT", + "dependencies": { + "@cspell/cspell-service-bus": "8.3.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-lib": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.3.2.tgz", + "integrity": "sha512-wTvdaev/TyGB/ln6CVD1QbVs2D7/+QiajQ67S7yj1suLHM6YcNQQb/5sPAM8VPtj0E7PgwgPXf3bq18OtPvnFg==", + "license": "MIT", + "dependencies": { + "@cspell/cspell-bundled-dicts": "8.3.2", + "@cspell/cspell-pipe": "8.3.2", + "@cspell/cspell-resolver": "8.3.2", + "@cspell/cspell-types": "8.3.2", + "@cspell/dynamic-import": "8.3.2", + "@cspell/strong-weak-map": "8.3.2", + "clear-module": "^4.1.2", + "comment-json": "^4.2.3", + "configstore": "^6.0.0", + "cspell-config-lib": "8.3.2", + "cspell-dictionary": "8.3.2", + "cspell-glob": "8.3.2", + "cspell-grammar": "8.3.2", + "cspell-io": "8.3.2", + "cspell-trie-lib": "8.3.2", + "fast-equals": "^5.0.1", + "gensequence": "^6.0.0", + "import-fresh": "^3.3.0", + "resolve-from": "^5.0.0", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-uri": "^3.0.8" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cspell-trie-lib": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.3.2.tgz", + "integrity": "sha512-8qh2FqzkLMwzlTlvO/5Z+89fhi30rrfekocpight/BmqKbE2XFJQD7wS2ml24e7q/rdHJLXVpJbY/V5mByucCA==", + "license": "MIT", + "dependencies": { + "@cspell/cspell-pipe": "8.3.2", + "@cspell/cspell-types": "8.3.2", + "gensequence": "^6.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dot-prop": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", + "license": "MIT", + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fast-equals": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.0.1.tgz", + "integrity": "sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz", + "integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==", + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up-simple": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz", + "integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.0.tgz", + "integrity": "sha512-EryKbCE/wxpxKniQlyas6PY1I9vwtF3uCBweX+N8KYTCn3Y12RTGtQAJ/bd5pl7kxUAc8v/R3Ake/N17OZiFqA==", + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4", + "rimraf": "^5.0.5" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", + "license": "ISC" + }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/gensequence": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/gensequence/-/gensequence-6.0.0.tgz", + "integrity": "sha512-8WwuywE9pokJRAcg2QFR/plk3cVPebSUqRPzpGQh3WQ0wIiHAw+HyOQj5IuHyUTQBHpBKFoB2JUMu9zT3vJ16Q==", + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "node_modules/get-stdin": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-9.0.0.tgz", + "integrity": "sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/global-directory": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", + "integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==", + "license": "MIT", + "dependencies": { + "ini": "4.1.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/has-own-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", + "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/import-meta-resolve": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz", + "integrity": "sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/ini": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", + "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "license": "MIT" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", + "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^9.1.1 || ^10.0.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.1.0.tgz", + "integrity": "sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==", + "license": "ISC", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.5.tgz", + "integrity": "sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A==", + "license": "ISC", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "license": "MIT" + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "license": "MIT", + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/unique-string": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", + "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", + "license": "MIT", + "dependencies": { + "crypto-random-string": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz", + "integrity": "sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==", + "license": "MIT" + }, + "node_modules/vscode-uri": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==", + "license": "MIT" + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "node_modules/xdg-basedir": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", + "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, + "node_modules/yaml": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "license": "ISC", + "engines": { + "node": ">= 14" + } + } + } +} diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index 5f908887e7..0000000000 --- a/yarn.lock +++ /dev/null @@ -1,1101 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@cspell/cspell-bundled-dicts@8.3.2": - version "8.3.2" - resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.3.2.tgz#649ed168a72cb49a7d83f3840ab6933a8beba68d" - integrity sha512-3ubOgz1/MDixJbq//0rQ2omB3cSdhVJDviERZeiREGz4HOq84aaK1Fqbw5SjNZHvhpoq+AYXm6kJbIAH8YhKgg== - dependencies: - "@cspell/dict-ada" "^4.0.2" - "@cspell/dict-aws" "^4.0.1" - "@cspell/dict-bash" "^4.1.3" - "@cspell/dict-companies" "^3.0.29" - "@cspell/dict-cpp" "^5.0.10" - "@cspell/dict-cryptocurrencies" "^5.0.0" - "@cspell/dict-csharp" "^4.0.2" - "@cspell/dict-css" "^4.0.12" - "@cspell/dict-dart" "^2.0.3" - "@cspell/dict-django" "^4.1.0" - "@cspell/dict-docker" "^1.1.7" - "@cspell/dict-dotnet" "^5.0.0" - "@cspell/dict-elixir" "^4.0.3" - "@cspell/dict-en-common-misspellings" "^2.0.0" - "@cspell/dict-en-gb" "1.1.33" - "@cspell/dict-en_us" "^4.3.13" - "@cspell/dict-filetypes" "^3.0.3" - "@cspell/dict-fonts" "^4.0.0" - "@cspell/dict-fsharp" "^1.0.1" - "@cspell/dict-fullstack" "^3.1.5" - "@cspell/dict-gaming-terms" "^1.0.4" - "@cspell/dict-git" "^3.0.0" - "@cspell/dict-golang" "^6.0.5" - "@cspell/dict-haskell" "^4.0.1" - "@cspell/dict-html" "^4.0.5" - "@cspell/dict-html-symbol-entities" "^4.0.0" - "@cspell/dict-java" "^5.0.6" - "@cspell/dict-k8s" "^1.0.2" - "@cspell/dict-latex" "^4.0.0" - "@cspell/dict-lorem-ipsum" "^4.0.0" - "@cspell/dict-lua" "^4.0.3" - "@cspell/dict-makefile" "^1.0.0" - "@cspell/dict-node" "^4.0.3" - "@cspell/dict-npm" "^5.0.14" - "@cspell/dict-php" "^4.0.5" - "@cspell/dict-powershell" "^5.0.3" - "@cspell/dict-public-licenses" "^2.0.5" - "@cspell/dict-python" "^4.1.11" - "@cspell/dict-r" "^2.0.1" - "@cspell/dict-ruby" "^5.0.2" - "@cspell/dict-rust" "^4.0.1" - "@cspell/dict-scala" "^5.0.0" - "@cspell/dict-software-terms" "^3.3.15" - "@cspell/dict-sql" "^2.1.3" - "@cspell/dict-svelte" "^1.0.2" - "@cspell/dict-swift" "^2.0.1" - "@cspell/dict-typescript" "^3.1.2" - "@cspell/dict-vue" "^3.0.0" - -"@cspell/cspell-json-reporter@8.3.2": - version "8.3.2" - resolved "https://registry.yarnpkg.com/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.3.2.tgz#314f7b7deb465a7b94b03405c3498d9b96d410ab" - integrity sha512-gHSz4jXMJPcxx+lOGfXhHuoyenAWQ8PVA/atHFrWYKo1LzKTbpkEkrsDnlX8QNJubc3EMH63Uy+lOIaFDVyHiQ== - dependencies: - "@cspell/cspell-types" "8.3.2" - -"@cspell/cspell-pipe@8.3.2": - version "8.3.2" - resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-8.3.2.tgz#72b986c6c03ed9894d5ddafdcb435973336216b9" - integrity sha512-GZmDwvQGOjQi3IjD4k9xXeVTDANczksOsgVKb3v2QZk9mR4Qj8c6Uarjd4AgSiIhu/wBliJfzr5rWFJu4X2VfQ== - -"@cspell/cspell-resolver@8.3.2": - version "8.3.2" - resolved "https://registry.yarnpkg.com/@cspell/cspell-resolver/-/cspell-resolver-8.3.2.tgz#e4a981ed8fc2029804d8fa5847e47934a26c5c86" - integrity sha512-w2Tmb95bzdEz9L4W5qvsP5raZbyEzKL7N2ksU/+yh8NEJcTuExmAl/nMnb3aIk7m2b+kPHnMOcJuwfUMLmyv4A== - dependencies: - global-directory "^4.0.1" - -"@cspell/cspell-service-bus@8.3.2": - version "8.3.2" - resolved "https://registry.yarnpkg.com/@cspell/cspell-service-bus/-/cspell-service-bus-8.3.2.tgz#b1c6620232c22c0a7c8b68051e524963285f4768" - integrity sha512-skTHNyVi74//W/O+f4IauDhm6twA9S2whkylonsIzPxEl4Pn3y2ZEMXNki/MWUwZfDIzKKSxlcREH61g7zCvhg== - -"@cspell/cspell-types@8.3.2": - version "8.3.2" - resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-8.3.2.tgz#35a6d0f1a4c7c2a8a5275bcd41dacf85618f44c3" - integrity sha512-qS/gWd9ItOrN6ZX5pwC9lJjnBoyiAyhxYq0GUXuV892LQvwrBmECGk6KhsA1lPW7JJS7o57YTAS1jmXnmXMEpg== - -"@cspell/dict-ada@^4.0.2": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@cspell/dict-ada/-/dict-ada-4.0.2.tgz#8da2216660aeb831a0d9055399a364a01db5805a" - integrity sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA== - -"@cspell/dict-aws@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-aws/-/dict-aws-4.0.1.tgz#a0e758531ae81792b928a3f406618296291a658a" - integrity sha512-NXO+kTPQGqaaJKa4kO92NAXoqS+i99dQzf3/L1BxxWVSBS3/k1f3uhmqIh7Crb/n22W793lOm0D9x952BFga3Q== - -"@cspell/dict-bash@^4.1.3": - version "4.1.3" - resolved "https://registry.yarnpkg.com/@cspell/dict-bash/-/dict-bash-4.1.3.tgz#25fba40825ac10083676ab2c777e471c3f71b36e" - integrity sha512-tOdI3QVJDbQSwPjUkOiQFhYcu2eedmX/PtEpVWg0aFps/r6AyjUQINtTgpqMYnYuq8O1QUIQqnpx21aovcgZCw== - -"@cspell/dict-companies@^3.0.29": - version "3.0.29" - resolved "https://registry.yarnpkg.com/@cspell/dict-companies/-/dict-companies-3.0.29.tgz#0c102c852a9b1c879cd926c0870e2cfbaf1cd176" - integrity sha512-F/8XnkqjU7jmSDAcD3LSSX+WxCVUWPssqlO4lzGMIK3MNIUt+d48eSIt3pFAIB/Z9y0ojoLHUtWX9HJ1ZtGrXQ== - -"@cspell/dict-cpp@^5.0.10": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-cpp/-/dict-cpp-5.1.1.tgz#f3628a10355e217dc5ba1f5a26e6d9e1f177e6ea" - integrity sha512-Qy9fNsR/5RcQ6G85gDKFjvzh0AdgAilLQeSXPtqY21Fx1kCjUqdVVJYMmHUREgcxH6ptAxtn5knTWU4PIhQtOw== - -"@cspell/dict-cryptocurrencies@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-5.0.0.tgz#19fbc7bdbec76ce64daf7d53a6d0f3cfff7d0038" - integrity sha512-Z4ARIw5+bvmShL+4ZrhDzGhnc9znaAGHOEMaB/GURdS/jdoreEDY34wdN0NtdLHDO5KO7GduZnZyqGdRoiSmYA== - -"@cspell/dict-csharp@^4.0.2": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@cspell/dict-csharp/-/dict-csharp-4.0.2.tgz#e55659dbe594e744d86b1baf0f3397fe57b1e283" - integrity sha512-1JMofhLK+4p4KairF75D3A924m5ERMgd1GvzhwK2geuYgd2ZKuGW72gvXpIV7aGf52E3Uu1kDXxxGAiZ5uVG7g== - -"@cspell/dict-css@^4.0.12": - version "4.0.12" - resolved "https://registry.yarnpkg.com/@cspell/dict-css/-/dict-css-4.0.12.tgz#59abf3512ae729835c933c38f64a3d8a5f09ce3d" - integrity sha512-vGBgPM92MkHQF5/2jsWcnaahOZ+C6OE/fPvd5ScBP72oFY9tn5GLuomcyO0z8vWCr2e0nUSX1OGimPtcQAlvSw== - -"@cspell/dict-dart@^2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@cspell/dict-dart/-/dict-dart-2.0.3.tgz#75e7ffe47d5889c2c831af35acdd92ebdbd4cf12" - integrity sha512-cLkwo1KT5CJY5N5RJVHks2genFkNCl/WLfj+0fFjqNR+tk3tBI1LY7ldr9piCtSFSm4x9pO1x6IV3kRUY1lLiw== - -"@cspell/dict-data-science@^1.0.11": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@cspell/dict-data-science/-/dict-data-science-1.0.11.tgz#4eabba75c21d27253c1114b4fbbade0ead739ffc" - integrity sha512-TaHAZRVe0Zlcc3C23StZqqbzC0NrodRwoSAc8dis+5qLeLLnOCtagYQeROQvDlcDg3X/VVEO9Whh4W/z4PAmYQ== - -"@cspell/dict-django@^4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-django/-/dict-django-4.1.0.tgz#2d4b765daf3c83e733ef3e06887ea34403a4de7a" - integrity sha512-bKJ4gPyrf+1c78Z0Oc4trEB9MuhcB+Yg+uTTWsvhY6O2ncFYbB/LbEZfqhfmmuK/XJJixXfI1laF2zicyf+l0w== - -"@cspell/dict-docker@^1.1.7": - version "1.1.7" - resolved "https://registry.yarnpkg.com/@cspell/dict-docker/-/dict-docker-1.1.7.tgz#bcf933283fbdfef19c71a642e7e8c38baf9014f2" - integrity sha512-XlXHAr822euV36GGsl2J1CkBIVg3fZ6879ZOg5dxTIssuhUOCiV2BuzKZmt6aIFmcdPmR14+9i9Xq+3zuxeX0A== - -"@cspell/dict-dotnet@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-dotnet/-/dict-dotnet-5.0.0.tgz#13690aafe14b240ad17a30225ac1ec29a5a6a510" - integrity sha512-EOwGd533v47aP5QYV8GlSSKkmM9Eq8P3G/eBzSpH3Nl2+IneDOYOBLEUraHuiCtnOkNsz0xtZHArYhAB2bHWAw== - -"@cspell/dict-elixir@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@cspell/dict-elixir/-/dict-elixir-4.0.3.tgz#57c25843e46cf3463f97da72d9ef8e37c818296f" - integrity sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q== - -"@cspell/dict-en-common-misspellings@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.0.tgz#708f424d75dc65237a6fcb8d253bc1e7ab641380" - integrity sha512-NOg8dlv37/YqLkCfBs5OXeJm/Wcfb/CzeOmOZJ2ZXRuxwsNuolb4TREUce0yAXRqMhawahY5TSDRJJBgKjBOdw== - -"@cspell/dict-en-gb@1.1.33": - version "1.1.33" - resolved "https://registry.yarnpkg.com/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz#7f1fd90fc364a5cb77111b5438fc9fcf9cc6da0e" - integrity sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g== - -"@cspell/dict-en_us@^4.3.13": - version "4.3.13" - resolved "https://registry.yarnpkg.com/@cspell/dict-en_us/-/dict-en_us-4.3.13.tgz#4176be1e1510ac696a0fa33d9773aaffbf83a50d" - integrity sha512-T6lHiGCjloGNE0d8CogF+efJZPCAP8zdzn+KnlI0Bmjaz5nvG2LTX7CXl1zkOl1nYYev0FuIk9WJ9YPVRjcFbQ== - -"@cspell/dict-filetypes@^3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@cspell/dict-filetypes/-/dict-filetypes-3.0.3.tgz#ab0723ca2f4d3d5674e9c9745efc9f144e49c905" - integrity sha512-J9UP+qwwBLfOQ8Qg9tAsKtSY/WWmjj21uj6zXTI9hRLD1eG1uUOLcfVovAmtmVqUWziPSKMr87F6SXI3xmJXgw== - -"@cspell/dict-fonts@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-fonts/-/dict-fonts-4.0.0.tgz#9bc8beb2a7b068b4fdb45cb994b36fd184316327" - integrity sha512-t9V4GeN/m517UZn63kZPUYP3OQg5f0OBLSd3Md5CU3eH1IFogSvTzHHnz4Wqqbv8NNRiBZ3HfdY/pqREZ6br3Q== - -"@cspell/dict-fsharp@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-fsharp/-/dict-fsharp-1.0.1.tgz#d62c699550a39174f182f23c8c1330a795ab5f53" - integrity sha512-23xyPcD+j+NnqOjRHgW3IU7Li912SX9wmeefcY0QxukbAxJ/vAN4rBpjSwwYZeQPAn3fxdfdNZs03fg+UM+4yQ== - -"@cspell/dict-fullstack@^3.1.5": - version "3.1.5" - resolved "https://registry.yarnpkg.com/@cspell/dict-fullstack/-/dict-fullstack-3.1.5.tgz#35d18678161f214575cc613dd95564e05422a19c" - integrity sha512-6ppvo1dkXUZ3fbYn/wwzERxCa76RtDDl5Afzv2lijLoijGGUw5yYdLBKJnx8PJBGNLh829X352ftE7BElG4leA== - -"@cspell/dict-gaming-terms@^1.0.4": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.0.4.tgz#b67d89d014d865da6cb40de4269d4c162a00658e" - integrity sha512-hbDduNXlk4AOY0wFxcDMWBPpm34rpqJBeqaySeoUH70eKxpxm+dvjpoRLJgyu0TmymEICCQSl6lAHTHSDiWKZg== - -"@cspell/dict-git@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-git/-/dict-git-3.0.0.tgz#c275af86041a2b59a7facce37525e2af05653b95" - integrity sha512-simGS/lIiXbEaqJu9E2VPoYW1OTC2xrwPPXNXFMa2uo/50av56qOuaxDrZ5eH1LidFXwoc8HROCHYeKoNrDLSw== - -"@cspell/dict-golang@^6.0.5": - version "6.0.5" - resolved "https://registry.yarnpkg.com/@cspell/dict-golang/-/dict-golang-6.0.5.tgz#4dd2e2fda419730a21fb77ade3b90241ad4a5bcc" - integrity sha512-w4mEqGz4/wV+BBljLxduFNkMrd3rstBNDXmoX5kD4UTzIb4Sy0QybWCtg2iVT+R0KWiRRA56QKOvBsgXiddksA== - -"@cspell/dict-haskell@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-haskell/-/dict-haskell-4.0.1.tgz#e9fca7c452411ff11926e23ffed2b50bb9b95e47" - integrity sha512-uRrl65mGrOmwT7NxspB4xKXFUenNC7IikmpRZW8Uzqbqcu7ZRCUfstuVH7T1rmjRgRkjcIjE4PC11luDou4wEQ== - -"@cspell/dict-html-symbol-entities@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.0.tgz#4d86ac18a4a11fdb61dfb6f5929acd768a52564f" - integrity sha512-HGRu+48ErJjoweR5IbcixxETRewrBb0uxQBd6xFGcxbEYCX8CnQFTAmKI5xNaIt2PKaZiJH3ijodGSqbKdsxhw== - -"@cspell/dict-html@^4.0.5": - version "4.0.5" - resolved "https://registry.yarnpkg.com/@cspell/dict-html/-/dict-html-4.0.5.tgz#03a5182148d80e6c25f71339dbb2b7c5b9894ef8" - integrity sha512-p0brEnRybzSSWi8sGbuVEf7jSTDmXPx7XhQUb5bgG6b54uj+Z0Qf0V2n8b/LWwIPJNd1GygaO9l8k3HTCy1h4w== - -"@cspell/dict-java@^5.0.6": - version "5.0.6" - resolved "https://registry.yarnpkg.com/@cspell/dict-java/-/dict-java-5.0.6.tgz#2462d6fc15f79ec15eb88ecf875b6ad2a7bf7a6a" - integrity sha512-kdE4AHHHrixyZ5p6zyms1SLoYpaJarPxrz8Tveo6gddszBVVwIUZ+JkQE1bWNLK740GWzIXdkznpUfw1hP9nXw== - -"@cspell/dict-k8s@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@cspell/dict-k8s/-/dict-k8s-1.0.2.tgz#b19e66f4ac8a4264c0f3981ac6e23e88a60f1c91" - integrity sha512-tLT7gZpNPnGa+IIFvK9SP1LrSpPpJ94a/DulzAPOb1Q2UBFwdpFd82UWhio0RNShduvKG/WiMZf/wGl98pn+VQ== - -"@cspell/dict-latex@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-latex/-/dict-latex-4.0.0.tgz#85054903db834ea867174795d162e2a8f0e9c51e" - integrity sha512-LPY4y6D5oI7D3d+5JMJHK/wxYTQa2lJMSNxps2JtuF8hbAnBQb3igoWEjEbIbRRH1XBM0X8dQqemnjQNCiAtxQ== - -"@cspell/dict-lorem-ipsum@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.0.tgz#2793a5dbfde474a546b0caecc40c38fdf076306e" - integrity sha512-1l3yjfNvMzZPibW8A7mQU4kTozwVZVw0AvFEdy+NcqtbxH+TvbSkNMqROOFWrkD2PjnKG0+Ea0tHI2Pi6Gchnw== - -"@cspell/dict-lua@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@cspell/dict-lua/-/dict-lua-4.0.3.tgz#2d23c8f7e74b4e62000678d80e7d1ebb10b003e0" - integrity sha512-lDHKjsrrbqPaea13+G9s0rtXjMO06gPXPYRjRYawbNmo4E/e3XFfVzeci3OQDQNDmf2cPOwt9Ef5lu2lDmwfJg== - -"@cspell/dict-makefile@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-makefile/-/dict-makefile-1.0.0.tgz#5afb2910873ebbc01ab8d9c38661c4c93d0e5a40" - integrity sha512-3W9tHPcSbJa6s0bcqWo6VisEDTSN5zOtDbnPabF7rbyjRpNo0uHXHRJQF8gAbFzoTzBBhgkTmrfSiuyQm7vBUQ== - -"@cspell/dict-node@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@cspell/dict-node/-/dict-node-4.0.3.tgz#5ae0222d72871e82978049f8e11ea627ca42fca3" - integrity sha512-sFlUNI5kOogy49KtPg8SMQYirDGIAoKBO3+cDLIwD4MLdsWy1q0upc7pzGht3mrjuyMiPRUV14Bb0rkVLrxOhg== - -"@cspell/dict-npm@^5.0.14": - version "5.0.14" - resolved "https://registry.yarnpkg.com/@cspell/dict-npm/-/dict-npm-5.0.14.tgz#1ca3d305390f393bbfa75f41c4db0fd590ce1a9c" - integrity sha512-k0kC7/W2qG5YII+SW6s+JtvKrkZg651vizi5dv/5G2HmJaeLNgDqBVeeDk/uV+ntBorM66XG4BPMjSxoaIlC5w== - -"@cspell/dict-php@^4.0.5": - version "4.0.5" - resolved "https://registry.yarnpkg.com/@cspell/dict-php/-/dict-php-4.0.5.tgz#fa16350d907180a42f16d5e4666e61a97ae9b8b3" - integrity sha512-9r8ao7Z/mH9Z8pSB7yLtyvcCJWw+/MnQpj7xGVYzIV7V2ZWDRjXZAMgteHMJ37m8oYz64q5d4tiipD300QSetQ== - -"@cspell/dict-powershell@^5.0.3": - version "5.0.3" - resolved "https://registry.yarnpkg.com/@cspell/dict-powershell/-/dict-powershell-5.0.3.tgz#7bceb4e7db39f87479a6d2af3a033ce26796ae49" - integrity sha512-lEdzrcyau6mgzu1ie98GjOEegwVHvoaWtzQnm1ie4DyZgMr+N6D0Iyj1lzvtmt0snvsDFa5F2bsYzf3IMKcpcA== - -"@cspell/dict-public-licenses@^2.0.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.5.tgz#86948b29bd36184943955eaa80bf594488c4dd8a" - integrity sha512-91HK4dSRri/HqzAypHgduRMarJAleOX5NugoI8SjDLPzWYkwZ1ftuCXSk+fy8DLc3wK7iOaFcZAvbjmnLhVs4A== - -"@cspell/dict-python@^4.1.11": - version "4.1.11" - resolved "https://registry.yarnpkg.com/@cspell/dict-python/-/dict-python-4.1.11.tgz#4e339def01bf468b32d459c46ecb6894970b7eb8" - integrity sha512-XG+v3PumfzUW38huSbfT15Vqt3ihNb462ulfXifpQllPok5OWynhszCLCRQjQReV+dgz784ST4ggRxW452/kVg== - dependencies: - "@cspell/dict-data-science" "^1.0.11" - -"@cspell/dict-r@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-r/-/dict-r-2.0.1.tgz#73474fb7cce45deb9094ebf61083fbf5913f440a" - integrity sha512-KCmKaeYMLm2Ip79mlYPc8p+B2uzwBp4KMkzeLd5E6jUlCL93Y5Nvq68wV5fRLDRTf7N1LvofkVFWfDcednFOgA== - -"@cspell/dict-ruby@^5.0.2": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@cspell/dict-ruby/-/dict-ruby-5.0.2.tgz#cf1a71380c633dec0857143d3270cb503b10679a" - integrity sha512-cIh8KTjpldzFzKGgrqUX4bFyav5lC52hXDKo4LbRuMVncs3zg4hcSf4HtURY+f2AfEZzN6ZKzXafQpThq3dl2g== - -"@cspell/dict-rust@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-rust/-/dict-rust-4.0.1.tgz#ef0b88cb3a45265824e2c9ce31b0baa4e1050351" - integrity sha512-xJSSzHDK2z6lSVaOmMxl3PTOtfoffaxMo7fTcbZUF+SCJzfKbO6vnN9TCGX2sx1RHFDz66Js6goz6SAZQdOwaw== - -"@cspell/dict-scala@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-scala/-/dict-scala-5.0.0.tgz#b64365ad559110a36d44ccd90edf7151ea648022" - integrity sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ== - -"@cspell/dict-software-terms@^3.3.15": - version "3.3.16" - resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-3.3.16.tgz#c088501687e6a19625800cc612dae8aebaf0f086" - integrity sha512-ixorEP80LGxAU+ODVSn/CYIDjV0XAlZ2VrBu7CT+PwUFJ7h8o3JX1ywKB4qnt0hHru3JjWFtBoBThmZdrXnREQ== - -"@cspell/dict-sql@^2.1.3": - version "2.1.3" - resolved "https://registry.yarnpkg.com/@cspell/dict-sql/-/dict-sql-2.1.3.tgz#8d9666a82e35b310d0be4064032c0d891fbd2702" - integrity sha512-SEyTNKJrjqD6PAzZ9WpdSu6P7wgdNtGV2RV8Kpuw1x6bV+YsSptuClYG+JSdRExBTE6LwIe1bTklejUp3ZP8TQ== - -"@cspell/dict-svelte@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@cspell/dict-svelte/-/dict-svelte-1.0.2.tgz#0c866b08a7a6b33bbc1a3bdbe6a1b484ca15cdaa" - integrity sha512-rPJmnn/GsDs0btNvrRBciOhngKV98yZ9SHmg8qI6HLS8hZKvcXc0LMsf9LLuMK1TmS2+WQFAan6qeqg6bBxL2Q== - -"@cspell/dict-swift@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-swift/-/dict-swift-2.0.1.tgz#06ec86e52e9630c441d3c19605657457e33d7bb6" - integrity sha512-gxrCMUOndOk7xZFmXNtkCEeroZRnS2VbeaIPiymGRHj5H+qfTAzAKxtv7jJbVA3YYvEzWcVE2oKDP4wcbhIERw== - -"@cspell/dict-typescript@^3.1.2": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@cspell/dict-typescript/-/dict-typescript-3.1.2.tgz#14d05f54db2984feaa24ea133b583d19c04cc104" - integrity sha512-lcNOYWjLUvDZdLa0UMNd/LwfVdxhE9rKA+agZBGjL3lTA3uNvH7IUqSJM/IXhJoBpLLMVEOk8v1N9xi+vDuCdA== - -"@cspell/dict-vue@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-vue/-/dict-vue-3.0.0.tgz#68ccb432ad93fcb0fd665352d075ae9a64ea9250" - integrity sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A== - -"@cspell/dynamic-import@8.3.2": - version "8.3.2" - resolved "https://registry.yarnpkg.com/@cspell/dynamic-import/-/dynamic-import-8.3.2.tgz#96fea6b1139164449a8ef92530de670d4c2fb36e" - integrity sha512-4t0xM5luA3yQhar2xWvYK4wQSDB2r0u8XkpzzJqd57MnJXd7uIAxI0awGUrDXukadRaCo0tDIlMUBemH48SNVg== - dependencies: - import-meta-resolve "^4.0.0" - -"@cspell/strong-weak-map@8.3.2": - version "8.3.2" - resolved "https://registry.yarnpkg.com/@cspell/strong-weak-map/-/strong-weak-map-8.3.2.tgz#5a9490e042bbc472089817b50cf51262dfedef65" - integrity sha512-Mte/2000ap278kRYOUhiGWI7MNr1+A7WSWJmlcdP4CAH5SO20sZI3/cyZLjJJEyapdhK5vaP1L5J9sUcVDHd3A== - -"@isaacs/cliui@^8.0.2": - version "8.0.2" - resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" - integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== - dependencies: - string-width "^5.1.2" - string-width-cjs "npm:string-width@^4.2.0" - strip-ansi "^7.0.1" - strip-ansi-cjs "npm:strip-ansi@^6.0.1" - wrap-ansi "^8.1.0" - wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" - -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - -"@pkgjs/parseargs@^0.11.0": - version "0.11.0" - resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" - integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-regex@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" - integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== - -ansi-styles@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -ansi-styles@^6.1.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" - integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== - -array-timsort@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-timsort/-/array-timsort-1.0.3.tgz#3c9e4199e54fb2b9c3fe5976396a21614ef0d926" - integrity sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ== - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== - dependencies: - balanced-match "^1.0.0" - -braces@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -callsites@^3.0.0, callsites@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -chalk-template@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/chalk-template/-/chalk-template-1.1.0.tgz#ffc55db6dd745e9394b85327c8ac8466edb7a7b1" - integrity sha512-T2VJbcDuZQ0Tb2EWwSotMPJjgpy1/tGee1BTpUNsGZ/qgNjV2t7Mvu+d4600U564nbLesN1x2dPL+xii174Ekg== - dependencies: - chalk "^5.2.0" - -chalk@^5.2.0, chalk@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" - integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== - -clear-module@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/clear-module/-/clear-module-4.1.2.tgz#5a58a5c9f8dccf363545ad7284cad3c887352a80" - integrity sha512-LWAxzHqdHsAZlPlEyJ2Poz6AIs384mPeqLVCru2p0BrP9G/kVGuhNyZYClLO6cXlnuJjzC8xtsJIuMjKqLXoAw== - dependencies: - parent-module "^2.0.0" - resolve-from "^5.0.0" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -commander@^11.1.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-11.1.0.tgz#62fdce76006a68e5c1ab3314dc92e800eb83d906" - integrity sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ== - -comment-json@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/comment-json/-/comment-json-4.2.3.tgz#50b487ebbf43abe44431f575ebda07d30d015365" - integrity sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw== - dependencies: - array-timsort "^1.0.3" - core-util-is "^1.0.3" - esprima "^4.0.1" - has-own-prop "^2.0.0" - repeat-string "^1.6.1" - -configstore@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/configstore/-/configstore-6.0.0.tgz#49eca2ebc80983f77e09394a1a56e0aca8235566" - integrity sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA== - dependencies: - dot-prop "^6.0.1" - graceful-fs "^4.2.6" - unique-string "^3.0.0" - write-file-atomic "^3.0.3" - xdg-basedir "^5.0.1" - -core-util-is@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -cross-spawn@^7.0.0: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -crypto-random-string@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-4.0.0.tgz#5a3cc53d7dd86183df5da0312816ceeeb5bb1fc2" - integrity sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA== - dependencies: - type-fest "^1.0.1" - -cspell-config-lib@8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/cspell-config-lib/-/cspell-config-lib-8.3.2.tgz#050a6d782072a810cb6655efe11c08c80ae7636b" - integrity sha512-Wc98XhBNLwDxnxCzMtgRJALI9a69cu3C5Gf1rGjNTKSFo9JYiQmju0Ur3z25Pkx9Sa86f+2IjvNCf33rUDSoBQ== - dependencies: - "@cspell/cspell-types" "8.3.2" - comment-json "^4.2.3" - yaml "^2.3.4" - -cspell-dictionary@8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-8.3.2.tgz#6627a94501811a143f3b638e0e77f7262335dbd4" - integrity sha512-xyK95hO2BMPFxIo8zBwGml8035qOxSBdga1BMhwW/p2wDrQP8S4Cdm/54//tCDmKn6uRkFQvyOfWGaX2l8WMEg== - dependencies: - "@cspell/cspell-pipe" "8.3.2" - "@cspell/cspell-types" "8.3.2" - cspell-trie-lib "8.3.2" - fast-equals "^5.0.1" - gensequence "^6.0.0" - -cspell-gitignore@8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-8.3.2.tgz#5cf244be494bf87257ca8715ac88b0849dd5fef3" - integrity sha512-3Qc9P5BVvl/cg//s2s+zIMGKcoH5v7oOtRgwn4UQry8yiyo19h0tiTKkSR574FMhF5NtcShTnwIwPSIXVBPFHA== - dependencies: - cspell-glob "8.3.2" - find-up-simple "^1.0.0" - -cspell-glob@8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-8.3.2.tgz#4c208e4ddd5604d2871df534a3054c7a3fdc9998" - integrity sha512-KtIFxE+3l5dGEofND4/CdZffXP8XN1+XGQKxJ96lIzWsc01mkotfhxTkla6mgvfH039t7BsY/SWv0460KyGslQ== - dependencies: - micromatch "^4.0.5" - -cspell-grammar@8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/cspell-grammar/-/cspell-grammar-8.3.2.tgz#69d7980c036c206745d5d417d32c95edaaff6107" - integrity sha512-tYCkOmRzJe1a6/R+8QGSwG7TwTgznLPqsHtepKzLmnS4YX54VXjKRI9zMARxXDzUVfyCSVdW5MyiY/0WTNoy+A== - dependencies: - "@cspell/cspell-pipe" "8.3.2" - "@cspell/cspell-types" "8.3.2" - -cspell-io@8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-8.3.2.tgz#8ddd865fa9a1391852e3288789f5b2a6613239bd" - integrity sha512-WYpKsyBCQP0SY4gXnhW5fPuxcYchKYKG1PIXVV3ezFU4muSgW6GuLNbGuSfwv/8YNXRgFSN0e3hYH0rdBK2Aow== - dependencies: - "@cspell/cspell-service-bus" "8.3.2" - -cspell-lib@8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-8.3.2.tgz#8225f8d3a20596bda4b9689a2ad958f7831f5a7d" - integrity sha512-wTvdaev/TyGB/ln6CVD1QbVs2D7/+QiajQ67S7yj1suLHM6YcNQQb/5sPAM8VPtj0E7PgwgPXf3bq18OtPvnFg== - dependencies: - "@cspell/cspell-bundled-dicts" "8.3.2" - "@cspell/cspell-pipe" "8.3.2" - "@cspell/cspell-resolver" "8.3.2" - "@cspell/cspell-types" "8.3.2" - "@cspell/dynamic-import" "8.3.2" - "@cspell/strong-weak-map" "8.3.2" - clear-module "^4.1.2" - comment-json "^4.2.3" - configstore "^6.0.0" - cspell-config-lib "8.3.2" - cspell-dictionary "8.3.2" - cspell-glob "8.3.2" - cspell-grammar "8.3.2" - cspell-io "8.3.2" - cspell-trie-lib "8.3.2" - fast-equals "^5.0.1" - gensequence "^6.0.0" - import-fresh "^3.3.0" - resolve-from "^5.0.0" - vscode-languageserver-textdocument "^1.0.11" - vscode-uri "^3.0.8" - -cspell-trie-lib@8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-8.3.2.tgz#e1e8c9926f41a094bec7f0af85b931be06019fe7" - integrity sha512-8qh2FqzkLMwzlTlvO/5Z+89fhi30rrfekocpight/BmqKbE2XFJQD7wS2ml24e7q/rdHJLXVpJbY/V5mByucCA== - dependencies: - "@cspell/cspell-pipe" "8.3.2" - "@cspell/cspell-types" "8.3.2" - gensequence "^6.0.0" - -cspell@^8.3.1: - version "8.3.2" - resolved "https://registry.yarnpkg.com/cspell/-/cspell-8.3.2.tgz#56e7e919d87d38016b4c34b8c8ee745404c230a7" - integrity sha512-V8Ub3RO/a5lwSsltW/ib3Z3G/sczKtSpBBN1JChzbSCfEgaY2mJY8JW0BpkSV+Ug6uJitpXNOOaxa3Xr489i7g== - dependencies: - "@cspell/cspell-json-reporter" "8.3.2" - "@cspell/cspell-pipe" "8.3.2" - "@cspell/cspell-types" "8.3.2" - "@cspell/dynamic-import" "8.3.2" - chalk "^5.3.0" - chalk-template "^1.1.0" - commander "^11.1.0" - cspell-gitignore "8.3.2" - cspell-glob "8.3.2" - cspell-io "8.3.2" - cspell-lib "8.3.2" - fast-glob "^3.3.2" - fast-json-stable-stringify "^2.1.0" - file-entry-cache "^8.0.0" - get-stdin "^9.0.0" - semver "^7.5.4" - strip-ansi "^7.1.0" - vscode-uri "^3.0.8" - -dot-prop@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-6.0.1.tgz#fc26b3cf142b9e59b74dbd39ed66ce620c681083" - integrity sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA== - dependencies: - is-obj "^2.0.0" - -eastasianwidth@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" - integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -emoji-regex@^9.2.2: - version "9.2.2" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" - integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== - -esprima@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -fast-equals@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/fast-equals/-/fast-equals-5.0.1.tgz#a4eefe3c5d1c0d021aeed0bc10ba5e0c12ee405d" - integrity sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ== - -fast-glob@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" - integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-json-stable-stringify@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fastq@^1.6.0: - version "1.16.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.16.0.tgz#83b9a9375692db77a822df081edb6a9cf6839320" - integrity sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA== - dependencies: - reusify "^1.0.4" - -file-entry-cache@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f" - integrity sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ== - dependencies: - flat-cache "^4.0.0" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -find-up-simple@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/find-up-simple/-/find-up-simple-1.0.0.tgz#21d035fde9fdbd56c8f4d2f63f32fd93a1cfc368" - integrity sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw== - -flat-cache@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.0.tgz#d12437636f83bb8a12b8f300c36fd1614e1c7224" - integrity sha512-EryKbCE/wxpxKniQlyas6PY1I9vwtF3uCBweX+N8KYTCn3Y12RTGtQAJ/bd5pl7kxUAc8v/R3Ake/N17OZiFqA== - dependencies: - flatted "^3.2.9" - keyv "^4.5.4" - rimraf "^5.0.5" - -flatted@^3.2.9: - version "3.2.9" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" - integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== - -foreground-child@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" - integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== - dependencies: - cross-spawn "^7.0.0" - signal-exit "^4.0.1" - -gensequence@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/gensequence/-/gensequence-6.0.0.tgz#ae46a0f89ebd7cc334e45cfb8f1c99a65248694e" - integrity sha512-8WwuywE9pokJRAcg2QFR/plk3cVPebSUqRPzpGQh3WQ0wIiHAw+HyOQj5IuHyUTQBHpBKFoB2JUMu9zT3vJ16Q== - -get-stdin@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-9.0.0.tgz#3983ff82e03d56f1b2ea0d3e60325f39d703a575" - integrity sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA== - -glob-parent@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob@^10.3.7: - version "10.3.10" - resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.10.tgz#0351ebb809fd187fe421ab96af83d3a70715df4b" - integrity sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g== - dependencies: - foreground-child "^3.1.0" - jackspeak "^2.3.5" - minimatch "^9.0.1" - minipass "^5.0.0 || ^6.0.2 || ^7.0.0" - path-scurry "^1.10.1" - -global-directory@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/global-directory/-/global-directory-4.0.1.tgz#4d7ac7cfd2cb73f304c53b8810891748df5e361e" - integrity sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q== - dependencies: - ini "4.1.1" - -graceful-fs@^4.2.6: - version "4.2.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" - integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== - -has-own-prop@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-own-prop/-/has-own-prop-2.0.0.tgz#f0f95d58f65804f5d218db32563bb85b8e0417af" - integrity sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ== - -import-fresh@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -import-meta-resolve@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz#0b1195915689f60ab00f830af0f15cc841e8919e" - integrity sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA== - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== - -ini@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ini/-/ini-4.1.1.tgz#d95b3d843b1e906e56d6747d5447904ff50ce7a1" - integrity sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g== - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-glob@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-obj@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" - integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== - -is-typedarray@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== - -jackspeak@^2.3.5: - version "2.3.6" - resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.3.6.tgz#647ecc472238aee4b06ac0e461acc21a8c505ca8" - integrity sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ== - dependencies: - "@isaacs/cliui" "^8.0.2" - optionalDependencies: - "@pkgjs/parseargs" "^0.11.0" - -json-buffer@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" - integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== - -keyv@^4.5.4: - version "4.5.4" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" - integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== - dependencies: - json-buffer "3.0.1" - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -"lru-cache@^9.1.1 || ^10.0.0": - version "10.1.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.1.0.tgz#2098d41c2dc56500e6c88584aa656c84de7d0484" - integrity sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag== - -merge2@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - -micromatch@^4.0.4, micromatch@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== - dependencies: - braces "^3.0.2" - picomatch "^2.3.1" - -minimatch@^9.0.1: - version "9.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" - integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== - dependencies: - brace-expansion "^2.0.1" - -"minipass@^5.0.0 || ^6.0.2 || ^7.0.0": - version "7.0.4" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.4.tgz#dbce03740f50a4786ba994c1fb908844d27b038c" - integrity sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ== - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -parent-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-2.0.0.tgz#fa71f88ff1a50c27e15d8ff74e0e3a9523bf8708" - integrity sha512-uo0Z9JJeWzv8BG+tRcapBKNJ0dro9cLyczGzulS6EfeyAdeC9sbojtW6XwvYxJkEne9En+J2XEl4zyglVeIwFg== - dependencies: - callsites "^3.1.0" - -path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-scurry@^1.10.1: - version "1.10.1" - resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.10.1.tgz#9ba6bf5aa8500fe9fd67df4f0d9483b2b0bfc698" - integrity sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ== - dependencies: - lru-cache "^9.1.1 || ^10.0.0" - minipass "^5.0.0 || ^6.0.2 || ^7.0.0" - -picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - -rimraf@^5.0.5: - version "5.0.5" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-5.0.5.tgz#9be65d2d6e683447d2e9013da2bf451139a61ccf" - integrity sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A== - dependencies: - glob "^10.3.7" - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - -semver@^7.5.4: - version "7.5.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" - integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== - dependencies: - lru-cache "^6.0.0" - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -signal-exit@^3.0.2: - version "3.0.7" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - -signal-exit@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" - integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== - -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^5.0.1, string-width@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" - integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== - dependencies: - eastasianwidth "^0.2.0" - emoji-regex "^9.2.2" - strip-ansi "^7.0.1" - -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^7.0.1, strip-ansi@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" - integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== - dependencies: - ansi-regex "^6.0.1" - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -type-fest@^1.0.1: - version "1.4.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-1.4.0.tgz#e9fb813fe3bf1744ec359d55d1affefa76f14be1" - integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA== - -typedarray-to-buffer@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== - dependencies: - is-typedarray "^1.0.0" - -unique-string@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-3.0.0.tgz#84a1c377aff5fd7a8bc6b55d8244b2bd90d75b9a" - integrity sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ== - dependencies: - crypto-random-string "^4.0.0" - -vscode-languageserver-textdocument@^1.0.11: - version "1.0.11" - resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz#0822a000e7d4dc083312580d7575fe9e3ba2e2bf" - integrity sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA== - -vscode-uri@^3.0.8: - version "3.0.8" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f" - integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw== - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrap-ansi@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" - integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== - dependencies: - ansi-styles "^6.1.0" - string-width "^5.0.1" - strip-ansi "^7.0.1" - -write-file-atomic@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" - integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== - dependencies: - imurmurhash "^0.1.4" - is-typedarray "^1.0.0" - signal-exit "^3.0.2" - typedarray-to-buffer "^3.1.5" - -xdg-basedir@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-5.1.0.tgz#1efba19425e73be1bc6f2a6ceb52a3d2c884c0c9" - integrity sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yaml@^2.3.4: - version "2.3.4" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2" - integrity sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA== From fc4ab4b049f02524a5eec39e976968ad9b26ddf3 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Mon, 15 Jan 2024 14:35:15 +0100 Subject: [PATCH 260/845] Disable `npm` update notification (#2561) * Disable `npm` update notification * De-duplicate code --- Build/CustomNpmTasks.cs | 50 ++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/Build/CustomNpmTasks.cs b/Build/CustomNpmTasks.cs index 775414dac6..252b17fb07 100644 --- a/Build/CustomNpmTasks.cs +++ b/Build/CustomNpmTasks.cs @@ -16,7 +16,7 @@ public static class CustomNpmTasks static AbsolutePath NodeDirPerOs; static AbsolutePath WorkingDirectory; - static IReadOnlyDictionary NpmEnvironmentVariables = null; + static IReadOnlyDictionary NpmEnvironmentVariables; static Tool Npm; @@ -48,24 +48,28 @@ static AbsolutePath DownloadNodeArchive() if (EnvironmentInfo.IsWin) { - os = "win-x64"; + os = "win"; archiveType = ".zip"; } else if (EnvironmentInfo.IsOsx) { - os = "darwin-x64"; + os = "darwin"; archiveType = ".tar.gz"; } else if (EnvironmentInfo.IsLinux) { - os = "linux-x64"; + os = "linux"; archiveType = ".tar.xz"; } os.NotNull(); archiveType.NotNull(); - os = EnvironmentInfo.IsArm64 ? os!.Replace("x64", "arm64") : os; + string architecture = + EnvironmentInfo.IsArm64 ? "arm64" : + EnvironmentInfo.Is64Bit ? "x64" : "x86"; + + os = $"{os}-{architecture}"; if (!HasCachedNodeModules) { @@ -119,11 +123,11 @@ static void ExtractNodeArchive(this AbsolutePath archive) static void LinkTools() { + AbsolutePath npmExecutable; + if (EnvironmentInfo.IsWin) { - Information("Resolve tool npm..."); - Npm = ToolResolver.GetTool(NodeDirPerOs / "npm.cmd"); - NpmVersion(); + npmExecutable = NodeDirPerOs / "npm.cmd"; } else { @@ -131,8 +135,7 @@ static void LinkTools() var nodeExecutable = WorkingDirectory / "node"; var npmNodeModules = NodeDirPerOs / "lib" / "node_modules"; - var npmExecutable = npmNodeModules / "npm" / "bin" / "npm"; - var npmSymlink = WorkingDirectory / "npm"; + npmExecutable = npmNodeModules / "npm" / "bin" / "npm"; Information($"Set execution permissions for {nodeExecutable}..."); nodeExecutable.SetExecutable(); @@ -145,19 +148,24 @@ static void LinkTools() ln($"-sf {npmExecutable} npm", workingDirectory: WorkingDirectory); ln($"-sf {npmNodeModules} node_modules", workingDirectory: WorkingDirectory); - Information("Resolve tool npm..."); - Npm = ToolResolver.GetTool(npmSymlink); - NpmVersion(); + npmExecutable = WorkingDirectory / "npm"; } + Information("Resolve tool npm..."); + npmExecutable.NotNull(); + Npm = ToolResolver.GetTool(npmExecutable); + + NpmConfig("set update-notifier false"); + NpmVersion(); + SetEnvVars(); } static void SetEnvVars() { NpmEnvironmentVariables = EnvironmentInfo.Variables - .ToDictionary(x => x.Key, x => x.Value) - .SetKeyValue("path", WorkingDirectory).AsReadOnly(); + .ToDictionary(x => x.Key, x => x.Value) + .SetKeyValue("path", WorkingDirectory).AsReadOnly(); } public static void NpmInstall(bool silent = false, string workingDirectory = null) @@ -183,7 +191,17 @@ static void NpmVersion() environmentVariables: NpmEnvironmentVariables); } - static Action NpmLogger = (outputType, msg) => + static void NpmConfig(string args) + { + Npm($"config {args}".TrimMatchingDoubleQuotes(), + workingDirectory: WorkingDirectory, + logInvocation: false, + logOutput: false, + logger: NpmLogger, + environmentVariables: NpmEnvironmentVariables); + } + + static readonly Action NpmLogger = (outputType, msg) => { if (EnvironmentInfo.IsWsl && msg.Contains("wslpath")) return; From 18bd70038d92342a60880e44fcbcd38443596044 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 15:43:36 +0000 Subject: [PATCH 261/845] Bump Bogus from 35.3.0 to 35.4.0 Bumps [Bogus](https://github.com/bchavez/Bogus) from 35.3.0 to 35.4.0. - [Release notes](https://github.com/bchavez/Bogus/releases) - [Changelog](https://github.com/bchavez/Bogus/blob/master/HISTORY.md) - [Commits](https://github.com/bchavez/Bogus/compare/v35.3.0...v35.4.0) --- updated-dependencies: - dependency-name: Bogus dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Tests/Benchmarks/Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index cc07cc5ac8..e25ba09b24 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -10,7 +10,7 @@ - + From 7a2132eda2a087f740b78e8b859912ac1f4f4605 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 15:52:54 +0000 Subject: [PATCH 262/845] Bump Meziantou.Analyzer from 2.0.135 to 2.0.136 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.135 to 2.0.136. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.135...2.0.136) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 47b397e4c1..0ae90f1595 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 600d3603f35638bfe139cdcb7d2ac2f9f3ea0e97 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 15:59:22 +0000 Subject: [PATCH 263/845] Bump Roslynator.Analyzers from 4.8.0 to 4.9.0 Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.8.0 to 4.9.0. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.8.0...v4.9.0) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 0ae90f1595..99dcf43e6b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From dcfafaeb5bee4664bb6865f8e940cfce44f9896b Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Fri, 19 Jan 2024 11:54:59 +0100 Subject: [PATCH 264/845] Bump nuke and build project to 8.0 (#2568) * Bump NUKE to 8.0.0 * Bump .NET to 8.0 --- Build/CustomNpmTasks.cs | 5 +++-- Build/_build.csproj | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Build/CustomNpmTasks.cs b/Build/CustomNpmTasks.cs index 252b17fb07..3f3742a790 100644 --- a/Build/CustomNpmTasks.cs +++ b/Build/CustomNpmTasks.cs @@ -6,6 +6,7 @@ using Nuke.Common.Tooling; using Nuke.Common.Utilities; using Nuke.Common.Utilities.Collections; +using NukeDictionaryExtensions = Nuke.Common.Utilities.Collections.DictionaryExtensions; using static Serilog.Log; public static class CustomNpmTasks @@ -163,9 +164,9 @@ static void LinkTools() static void SetEnvVars() { - NpmEnvironmentVariables = EnvironmentInfo.Variables + NpmEnvironmentVariables = NukeDictionaryExtensions.AsReadOnly(EnvironmentInfo.Variables .ToDictionary(x => x.Key, x => x.Value) - .SetKeyValue("path", WorkingDirectory).AsReadOnly(); + .SetKeyValue("path", WorkingDirectory)); } public static void NpmInstall(bool silent = false, string workingDirectory = null) diff --git a/Build/_build.csproj b/Build/_build.csproj index 7fe341896f..b067c50e54 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -1,7 +1,7 @@ Exe - net6.0 + net8.0 CS0649;CS0169 ..\ @@ -21,8 +21,8 @@ - - + + From deea2e49a03bcfa2004ba9444b03e9f3bededeeb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:35:19 +0000 Subject: [PATCH 265/845] Bump actions/cache from 3 to 4 Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29556b52ae..a9eaff3f47 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: 8.0.x - name: Cache .nuke/temp - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | .nuke/temp From b078f79260905a62099f30ec7f3ea329e6f1d40c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:13:55 +0000 Subject: [PATCH 266/845] Bump Meziantou.Analyzer from 2.0.136 to 2.0.139 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.136 to 2.0.139. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.136...2.0.139) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 99dcf43e6b..b333686840 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 6e15827cf79d7eceda4212758c091ddf8e27b9b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:11:55 +0000 Subject: [PATCH 267/845] Bump andstor/file-existence-action from 2 to 3 Bumps [andstor/file-existence-action](https://github.com/andstor/file-existence-action) from 2 to 3. - [Release notes](https://github.com/andstor/file-existence-action/releases) - [Commits](https://github.com/andstor/file-existence-action/compare/v2...v3) --- updated-dependencies: - dependency-name: andstor/file-existence-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9eaff3f47..ae376dc3a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: - name: Check for 'lcov.info' existence id: check_files - uses: andstor/file-existence-action@v2 + uses: andstor/file-existence-action@v3 with: files: "TestResults/reports/lcov.info" From 97187efb0b91fa077d9271b3cc5bc86939ac0b7c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:15:43 +0000 Subject: [PATCH 268/845] Bump Roslynator.Analyzers from 4.9.0 to 4.10.0 Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.9.0 to 4.10.0. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.9.0...v4.10.0) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index b333686840..771e7547b6 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 034aa1065a0daf9b36c71a955a171bfca14dfb54 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 29 Jan 2024 16:52:06 +0100 Subject: [PATCH 269/845] Use native ns2.1 AppendJoin --- Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs b/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs index 45191e7fa5..d2d901b678 100644 --- a/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs +++ b/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs @@ -16,8 +16,10 @@ internal static class StringBuilderExtensions public static StringBuilder AppendLine(this StringBuilder stringBuilder, IFormatProvider _, string value) => stringBuilder.AppendLine(value); +#if NET47 || NETSTANDARD2_0 public static StringBuilder AppendJoin(this StringBuilder stringBuilder, string separator, IEnumerable values) => stringBuilder.Append(string.Join(separator, values)); +#endif } #endif From ec1d2ab4401e082c646f2ef5b30f14a299497d80 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 29 Jan 2024 16:53:32 +0100 Subject: [PATCH 270/845] RCS1055 was fixed with Roslynator 4.10.0 --- Tests/.editorconfig | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Tests/.editorconfig b/Tests/.editorconfig index 5af84a1e03..d7c1e5c6d3 100644 --- a/Tests/.editorconfig +++ b/Tests/.editorconfig @@ -162,10 +162,6 @@ resharper_keep_user_linebreaks = true # Make class static dotnet_diagnostic.RCS1102.severity = none -# Unnecessary semicolon at the end of declaration -# see https://github.com/dotnet/roslynator/issues/1359 -dotnet_diagnostic.RCS1055.severity = none - # Mark local variable as const. dotnet_diagnostic.RCS1118.severity = none From 5322b921cbefce49c098d2593cd6880d8d93d013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Thu, 1 Feb 2024 15:36:39 +0100 Subject: [PATCH 271/845] Avoid treating `"\\r\\n"` as new line. (#2569) * Avoid treating verbatim `@"\r\n"` as new line. * Add unit test and release note entry --- Src/FluentAssertions/Common/StringExtensions.cs | 3 +-- .../StringAssertionSpecs.MatchEquivalentOf.cs | 11 +++++++++++ docs/_pages/releases.md | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Src/FluentAssertions/Common/StringExtensions.cs b/Src/FluentAssertions/Common/StringExtensions.cs index 0c51b94a26..ef486429ef 100644 --- a/Src/FluentAssertions/Common/StringExtensions.cs +++ b/Src/FluentAssertions/Common/StringExtensions.cs @@ -118,8 +118,7 @@ public static string IndentLines(this string @this) public static string RemoveNewLines(this string @this) { return @this.Replace("\n", string.Empty, StringComparison.Ordinal) - .Replace("\r", string.Empty, StringComparison.Ordinal) - .Replace(@"\r\n", string.Empty, StringComparison.Ordinal); + .Replace("\r", string.Empty, StringComparison.Ordinal); } /// diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.MatchEquivalentOf.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.MatchEquivalentOf.cs index ae7092f420..6dddc65b62 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.MatchEquivalentOf.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.MatchEquivalentOf.cs @@ -235,5 +235,16 @@ public void "Cannot match string against an empty string. Provide a wildcard pattern or use the NotBeEmpty method.*") .WithParameterName("wildcardPattern"); } + + [Fact] + public void Does_not_treat_escaped_newlines_as_newlines() + { + // Arrange + string actual = "te\r\nst"; + string expect = "te\\r\\nst"; + + // Act / Assert + actual.Should().NotMatchEquivalentOf(expect); + } } } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 8c8d3b77a6..b8c4dcc2eb 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -40,6 +40,7 @@ sidebar: * Changed `BeEquivalentTo` to exclude `private protected` members from the comparison - [#2417](https://github.com/fluentassertions/fluentassertions/pull/2417) * Fixed using `BeEquivalentTo` on an empty `ArraySegment` - [#2445](https://github.com/fluentassertions/fluentassertions/pull/2445), [#2511](https://github.com/fluentassertions/fluentassertions/pull/2511) * `BeEquivalentTo` with a custom comparer can now handle null values - [#2489](https://github.com/fluentassertions/fluentassertions/pull/2489) +* Fixed incorrect treatment of "\\r\\n" as new line - [#2569](https://github.com/fluentassertions/fluentassertions/pull/2569) ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) From ede5bc66e308404289693c19d528fef8e3f45c96 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Tue, 30 Jan 2024 17:13:10 +0800 Subject: [PATCH 272/845] Simplify InternalsVisibleTo PublicKey --- Src/FluentAssertions/FluentAssertions.csproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 5346917822..30c318120d 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -11,7 +11,7 @@ $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb true true - 00240000048000009400000006020000002400005253413100040000010001002d25ff515c85b13ba08f61d466cff5d80a7f28ba197bbf8796085213e7a3406f970d2a4874932fed35db546e89af2da88c194bf1b7f7ac70de7988c78406f7629c547283061282a825616eb7eb48a9514a7570942936020a9bb37dca9ff60b778309900851575614491c6d25018fadb75828f4c7a17bf2d7dc86e7b6eafc5d8f + 00240000048000009400000006020000002400005253413100040000010001002d25ff515c85b13ba08f61d466cff5d80a7f28ba197bbf8796085213e7a3406f970d2a4874932fed35db546e89af2da88c194bf1b7f7ac70de7988c78406f7629c547283061282a825616eb7eb48a9514a7570942936020a9bb37dca9ff60b778309900851575614491c6d25018fadb75828f4c7a17bf2d7dc86e7b6eafc5d8f @@ -34,9 +34,9 @@ - - - + + + From 5d75286ef24fb38c18ad1fe70f85042b52e73c76 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 07:42:57 +0100 Subject: [PATCH 273/845] Bump nokogiri from 1.15.4 to 1.16.2 in /docs (#2577) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.15.4 to 1.16.2. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.15.4...v1.16.2) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/Gemfile.lock | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 7bacd6f6aa..eb999357fb 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -210,7 +210,9 @@ GEM jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) minitest (5.19.0) - nokogiri (1.15.4-x64-mingw-ucrt) + nokogiri (1.16.2-x64-mingw-ucrt) + racc (~> 1.4) + nokogiri (1.16.2-x86_64-linux) racc (~> 1.4) octokit (4.25.1) faraday (>= 1, < 3) @@ -218,7 +220,7 @@ GEM pathutil (0.16.2) forwardable-extended (~> 2.6) public_suffix (4.0.7) - racc (1.7.1) + racc (1.7.3) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) @@ -251,6 +253,7 @@ GEM PLATFORMS x64-mingw-ucrt + x86_64-linux DEPENDENCIES github-pages From 15536a1d82ba6188ec08419b0a78dd2d306cbc69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 08:10:50 +1100 Subject: [PATCH 274/845] Bump github-pages from 228 to 229 in /docs (#2582) Bumps [github-pages](https://github.com/github/pages-gem) from 228 to 229. - [Release notes](https://github.com/github/pages-gem/releases) - [Commits](https://github.com/github/pages-gem/compare/v228...v229) --- updated-dependencies: - dependency-name: github-pages dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/Gemfile.lock | 104 ++++++++++++++++++++++++++-------------------- 1 file changed, 60 insertions(+), 44 deletions(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index eb999357fb..0f1b78fb48 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,53 +1,64 @@ GEM remote: https://rubygems.org/ specs: - activesupport (7.0.7.2) + activesupport (7.1.3) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) - addressable (2.8.5) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) + base64 (0.2.0) + bigdecimal (3.1.6) coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.11.1) + coffee-script-source (1.12.2) colorator (1.1.0) commonmarker (0.23.10) - concurrent-ruby (1.2.2) + concurrent-ruby (1.2.3) + connection_pool (2.4.1) dnsruby (1.70.0) simpleidn (~> 0.2.1) + drb (2.2.0) + ruby2_keywords em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) ethon (0.16.0) ffi (>= 1.15.0) eventmachine (1.2.7) - execjs (2.8.1) - faraday (2.7.10) - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) - ffi (1.15.5) + execjs (2.9.1) + faraday (2.9.0) + faraday-net_http (>= 2.0, < 3.2) + faraday-net_http (3.1.0) + net-http + ffi (1.16.3) + ffi (1.16.3-x64-mingw-ucrt) forwardable-extended (2.6.0) - gemoji (3.0.1) - github-pages (228) - github-pages-health-check (= 1.17.9) - jekyll (= 3.9.3) - jekyll-avatar (= 0.7.0) - jekyll-coffeescript (= 1.1.1) + gemoji (4.1.0) + github-pages (229) + github-pages-health-check (= 1.18.2) + jekyll (= 3.9.4) + jekyll-avatar (= 0.8.0) + jekyll-coffeescript (= 1.2.2) jekyll-commonmark-ghpages (= 0.4.0) - jekyll-default-layout (= 0.1.4) - jekyll-feed (= 0.15.1) + jekyll-default-layout (= 0.1.5) + jekyll-feed (= 0.17.0) jekyll-gist (= 1.5.0) - jekyll-github-metadata (= 2.13.0) + jekyll-github-metadata (= 2.16.1) jekyll-include-cache (= 0.2.1) jekyll-mentions (= 1.6.0) jekyll-optional-front-matter (= 0.3.2) jekyll-paginate (= 1.1.0) jekyll-readme-index (= 0.3.0) jekyll-redirect-from (= 0.16.0) - jekyll-relative-links (= 0.6.1) + jekyll-relative-links (= 0.7.0) jekyll-remote-theme (= 0.4.3) jekyll-sass-converter (= 1.5.2) jekyll-seo-tag (= 2.8.0) @@ -67,20 +78,20 @@ GEM jekyll-theme-tactile (= 0.2.0) jekyll-theme-time-machine (= 0.2.0) jekyll-titles-from-headings (= 0.5.3) - jemoji (= 0.12.0) - kramdown (= 2.3.2) + jemoji (= 0.13.0) + kramdown (= 2.4.0) kramdown-parser-gfm (= 1.1.0) liquid (= 4.0.4) mercenary (~> 0.3) minima (= 2.5.1) nokogiri (>= 1.13.6, < 2.0) - rouge (= 3.26.0) + rouge (= 3.30.0) terminal-table (~> 1.4) - github-pages-health-check (1.17.9) + github-pages-health-check (1.18.2) addressable (~> 2.3) dnsruby (~> 1.60) - octokit (~> 4.0) - public_suffix (>= 3.0, < 5.0) + octokit (>= 4, < 8) + public_suffix (>= 3.0, < 6.0) typhoeus (~> 1.3) html-pipeline (2.14.3) activesupport (>= 2) @@ -88,7 +99,7 @@ GEM http_parser.rb (0.8.0) i18n (1.14.1) concurrent-ruby (~> 1.0) - jekyll (3.9.3) + jekyll (3.9.4) addressable (~> 2.4) colorator (~> 1.0) em-websocket (~> 0.5) @@ -101,11 +112,11 @@ GEM pathutil (~> 0.9) rouge (>= 1.7, < 4) safe_yaml (~> 1.0) - jekyll-avatar (0.7.0) + jekyll-avatar (0.8.0) jekyll (>= 3.0, < 5.0) - jekyll-coffeescript (1.1.1) + jekyll-coffeescript (1.2.2) coffee-script (~> 2.2) - coffee-script-source (~> 1.11.1) + coffee-script-source (~> 1.12) jekyll-commonmark (1.4.0) commonmarker (~> 0.22) jekyll-commonmark-ghpages (0.4.0) @@ -113,15 +124,15 @@ GEM jekyll (~> 3.9.0) jekyll-commonmark (~> 1.4.0) rouge (>= 2.0, < 5.0) - jekyll-default-layout (0.1.4) - jekyll (~> 3.0) - jekyll-feed (0.15.1) + jekyll-default-layout (0.1.5) + jekyll (>= 3.0, < 5.0) + jekyll-feed (0.17.0) jekyll (>= 3.7, < 5.0) jekyll-gist (1.5.0) octokit (~> 4.2) - jekyll-github-metadata (2.13.0) + jekyll-github-metadata (2.16.1) jekyll (>= 3.4, < 5.0) - octokit (~> 4.0, != 4.4.0) + octokit (>= 4, < 7, != 4.4.0) jekyll-include-cache (0.2.1) jekyll (>= 3.7, < 5.0) jekyll-mentions (1.6.0) @@ -134,7 +145,7 @@ GEM jekyll (>= 3.0, < 5.0) jekyll-redirect-from (0.16.0) jekyll (>= 3.3, < 5.0) - jekyll-relative-links (0.6.1) + jekyll-relative-links (0.7.0) jekyll (>= 3.3, < 5.0) jekyll-remote-theme (0.4.3) addressable (~> 2.0) @@ -192,11 +203,11 @@ GEM jekyll (>= 3.3, < 5.0) jekyll-watch (2.2.1) listen (~> 3.0) - jemoji (0.12.0) - gemoji (~> 3.0) + jemoji (0.13.0) + gemoji (>= 3, < 5) html-pipeline (~> 2.2) jekyll (>= 3.0, < 5.0) - kramdown (2.3.2) + kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) @@ -209,7 +220,10 @@ GEM jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - minitest (5.19.0) + minitest (5.22.2) + mutex_m (0.2.0) + net-http (0.4.1) + uri nokogiri (1.16.2-x64-mingw-ucrt) racc (~> 1.4) nokogiri (1.16.2-x86_64-linux) @@ -219,13 +233,13 @@ GEM sawyer (~> 0.9) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (4.0.7) + public_suffix (5.0.4) racc (1.7.3) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) rexml (3.2.6) - rouge (3.26.0) + rouge (3.30.0) ruby2_keywords (0.0.5) rubyzip (2.3.2) safe_yaml (1.0.5) @@ -241,14 +255,16 @@ GEM unf (~> 0.1.4) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) - typhoeus (1.4.0) + typhoeus (1.4.1) ethon (>= 0.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unf (0.1.4) unf_ext - unf_ext (0.0.8.2) + unf_ext (0.0.9.1) + unf_ext (0.0.9.1-x64-mingw-ucrt) unicode-display_width (1.8.0) + uri (0.13.0) webrick (1.8.1) PLATFORMS From db4d1ec378261e392dfa6164224800e99d68026e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 08:11:29 +1100 Subject: [PATCH 275/845] Bump Microsoft.NET.Test.Sdk from 17.8.0 to 17.9.0 (#2580) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.8.0 to 17.9.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.8.0...v17.9.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 2 +- Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index db85c84410..769356543b 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -5,7 +5,7 @@ - + all diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 9d3b903659..0d4c555b6f 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -10,7 +10,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 7658dcc4e3..4a1ad6b1cd 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -21,7 +21,7 @@ - + diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index d2c2ebc4cd..c5a1b09a84 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -10,7 +10,7 @@ - + diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index dc24101f13..b8b21b77db 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -21,7 +21,7 @@ - + diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 02db63db6a..e2de0a1480 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj index e0c56b744d..3b42e48927 100644 --- a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj +++ b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index 10b5d19fba..dccc01d782 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index 1dcd4f159e..ecc9059e2c 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index 01180124de..665d86b16f 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index fc86c9f82d..f3c123d082 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -6,7 +6,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive From 09245eb20c58f6eee7ab2863b7319e17abae5576 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 08:11:53 +1100 Subject: [PATCH 276/845] Bump Meziantou.Analyzer from 2.0.139 to 2.0.141 (#2581) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.139 to 2.0.141. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.139...2.0.141) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 771e7547b6..8eac375edf 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 861899b61797f2b7b97c450dfcc4cb425a6b5cbc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:37:12 +0000 Subject: [PATCH 277/845] Bump cspell from 8.3.2 to 8.4.0 Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 8.3.2 to 8.4.0. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/compare/v8.3.2...v8.4.0) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 485 ++++++++++++++++++---------------------------- package.json | 2 +- 2 files changed, 191 insertions(+), 296 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5542feb3d9..37831f56a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,20 +7,19 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.3.1" + "cspell": "^8.4.0" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.3.2.tgz", - "integrity": "sha512-3ubOgz1/MDixJbq//0rQ2omB3cSdhVJDviERZeiREGz4HOq84aaK1Fqbw5SjNZHvhpoq+AYXm6kJbIAH8YhKgg==", - "license": "MIT", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.4.0.tgz", + "integrity": "sha512-eaDE8sen039fD8dCGQ3Hu6N4DWu/ZBuQocXhrx+8yfBEM1YaBsubKGdQUZrDGFcHenvaFJPq6aH84t3guYaVgA==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.1", "@cspell/dict-bash": "^4.1.3", - "@cspell/dict-companies": "^3.0.29", - "@cspell/dict-cpp": "^5.0.10", + "@cspell/dict-companies": "^3.0.31", + "@cspell/dict-cpp": "^5.1.3", "@cspell/dict-cryptocurrencies": "^5.0.0", "@cspell/dict-csharp": "^4.0.2", "@cspell/dict-css": "^4.0.12", @@ -29,14 +28,14 @@ "@cspell/dict-docker": "^1.1.7", "@cspell/dict-dotnet": "^5.0.0", "@cspell/dict-elixir": "^4.0.3", - "@cspell/dict-en_us": "^4.3.13", + "@cspell/dict-en_us": "^4.3.16", "@cspell/dict-en-common-misspellings": "^2.0.0", "@cspell/dict-en-gb": "1.1.33", "@cspell/dict-filetypes": "^3.0.3", "@cspell/dict-fonts": "^4.0.0", "@cspell/dict-fsharp": "^1.0.1", "@cspell/dict-fullstack": "^3.1.5", - "@cspell/dict-gaming-terms": "^1.0.4", + "@cspell/dict-gaming-terms": "^1.0.5", "@cspell/dict-git": "^3.0.0", "@cspell/dict-golang": "^6.0.5", "@cspell/dict-haskell": "^4.0.1", @@ -49,16 +48,16 @@ "@cspell/dict-lua": "^4.0.3", "@cspell/dict-makefile": "^1.0.0", "@cspell/dict-node": "^4.0.3", - "@cspell/dict-npm": "^5.0.14", - "@cspell/dict-php": "^4.0.5", + "@cspell/dict-npm": "^5.0.15", + "@cspell/dict-php": "^4.0.6", "@cspell/dict-powershell": "^5.0.3", "@cspell/dict-public-licenses": "^2.0.5", "@cspell/dict-python": "^4.1.11", "@cspell/dict-r": "^2.0.1", "@cspell/dict-ruby": "^5.0.2", - "@cspell/dict-rust": "^4.0.1", + "@cspell/dict-rust": "^4.0.2", "@cspell/dict-scala": "^5.0.0", - "@cspell/dict-software-terms": "^3.3.15", + "@cspell/dict-software-terms": "^3.3.18", "@cspell/dict-sql": "^2.1.3", "@cspell/dict-svelte": "^1.0.2", "@cspell/dict-swift": "^2.0.1", @@ -70,31 +69,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.3.2.tgz", - "integrity": "sha512-gHSz4jXMJPcxx+lOGfXhHuoyenAWQ8PVA/atHFrWYKo1LzKTbpkEkrsDnlX8QNJubc3EMH63Uy+lOIaFDVyHiQ==", - "license": "MIT", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.4.0.tgz", + "integrity": "sha512-JH2qufHilC6xduDONe1QKHwA3a1ST+Nz+q+Vd0nUHZ53OBgk59vH9YfNk90ikjm/Cfocs/Wrz7TX2di1n8bHsA==", "dependencies": { - "@cspell/cspell-types": "8.3.2" + "@cspell/cspell-types": "8.4.0" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.3.2.tgz", - "integrity": "sha512-GZmDwvQGOjQi3IjD4k9xXeVTDANczksOsgVKb3v2QZk9mR4Qj8c6Uarjd4AgSiIhu/wBliJfzr5rWFJu4X2VfQ==", - "license": "MIT", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.4.0.tgz", + "integrity": "sha512-qHd01Lenjmipybt9CsfZcjEeU1aTsp0TpKmuxT+ixJ+fEYc/dfPyBxsCreKSo8jXw6GTkj86g3vcnhKc/QH5BQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.3.2.tgz", - "integrity": "sha512-w2Tmb95bzdEz9L4W5qvsP5raZbyEzKL7N2ksU/+yh8NEJcTuExmAl/nMnb3aIk7m2b+kPHnMOcJuwfUMLmyv4A==", - "license": "MIT", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.4.0.tgz", + "integrity": "sha512-2WOuYzroYxXbrosYcbu2xpJZQU7ILOj57/dmlFu/3Z+bNnao/CfJ5aiRarqQrwA8qvCqQbAZPjJwf725IiO0lA==", "dependencies": { "global-directory": "^4.0.1" }, @@ -103,19 +99,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.3.2.tgz", - "integrity": "sha512-skTHNyVi74//W/O+f4IauDhm6twA9S2whkylonsIzPxEl4Pn3y2ZEMXNki/MWUwZfDIzKKSxlcREH61g7zCvhg==", - "license": "MIT", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.4.0.tgz", + "integrity": "sha512-vl4iVrHW8kYa8LIDx7aMMX9q67w9Es4QiemWXlOObaOKNS95NBvQdE8r9x2wBKCGpZyMG5n6Nafla5mG9Bcpsg==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.3.2.tgz", - "integrity": "sha512-qS/gWd9ItOrN6ZX5pwC9lJjnBoyiAyhxYq0GUXuV892LQvwrBmECGk6KhsA1lPW7JJS7o57YTAS1jmXnmXMEpg==", - "license": "MIT", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.4.0.tgz", + "integrity": "sha512-bxt1cX9hDiQ7E/ZvLv4Oq4jBPsEGzI5dH+EJ5NQOy64Edc92X7WLTYbMgu3t7cxkkwVnc7Iv48uBUdJrFsc9Ig==", "engines": { "node": ">=18" } @@ -123,236 +117,197 @@ "node_modules/@cspell/dict-ada": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.0.2.tgz", - "integrity": "sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA==", - "license": "MIT" + "integrity": "sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA==" }, "node_modules/@cspell/dict-aws": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.1.tgz", - "integrity": "sha512-NXO+kTPQGqaaJKa4kO92NAXoqS+i99dQzf3/L1BxxWVSBS3/k1f3uhmqIh7Crb/n22W793lOm0D9x952BFga3Q==", - "license": "MIT" + "integrity": "sha512-NXO+kTPQGqaaJKa4kO92NAXoqS+i99dQzf3/L1BxxWVSBS3/k1f3uhmqIh7Crb/n22W793lOm0D9x952BFga3Q==" }, "node_modules/@cspell/dict-bash": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.1.3.tgz", - "integrity": "sha512-tOdI3QVJDbQSwPjUkOiQFhYcu2eedmX/PtEpVWg0aFps/r6AyjUQINtTgpqMYnYuq8O1QUIQqnpx21aovcgZCw==", - "license": "MIT" + "integrity": "sha512-tOdI3QVJDbQSwPjUkOiQFhYcu2eedmX/PtEpVWg0aFps/r6AyjUQINtTgpqMYnYuq8O1QUIQqnpx21aovcgZCw==" }, "node_modules/@cspell/dict-companies": { - "version": "3.0.29", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.0.29.tgz", - "integrity": "sha512-F/8XnkqjU7jmSDAcD3LSSX+WxCVUWPssqlO4lzGMIK3MNIUt+d48eSIt3pFAIB/Z9y0ojoLHUtWX9HJ1ZtGrXQ==", - "license": "MIT" + "version": "3.0.31", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.0.31.tgz", + "integrity": "sha512-hKVpV/lcGKP4/DpEPS8P4osPvFH/YVLJaDn9cBIOH6/HSmL5LbFgJNKpMGaYRbhm2FEX56MKE3yn/MNeNYuesQ==" }, "node_modules/@cspell/dict-cpp": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.1.tgz", - "integrity": "sha512-Qy9fNsR/5RcQ6G85gDKFjvzh0AdgAilLQeSXPtqY21Fx1kCjUqdVVJYMmHUREgcxH6ptAxtn5knTWU4PIhQtOw==", - "license": "MIT" + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.3.tgz", + "integrity": "sha512-sqnriXRAInZH9W75C+APBh6dtben9filPqVbIsiRMUXGg+s02ekz0z6LbS7kXeJ5mD2qXoMLBrv13qH2eIwutQ==" }, "node_modules/@cspell/dict-cryptocurrencies": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-5.0.0.tgz", - "integrity": "sha512-Z4ARIw5+bvmShL+4ZrhDzGhnc9znaAGHOEMaB/GURdS/jdoreEDY34wdN0NtdLHDO5KO7GduZnZyqGdRoiSmYA==", - "license": "MIT" + "integrity": "sha512-Z4ARIw5+bvmShL+4ZrhDzGhnc9znaAGHOEMaB/GURdS/jdoreEDY34wdN0NtdLHDO5KO7GduZnZyqGdRoiSmYA==" }, "node_modules/@cspell/dict-csharp": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.2.tgz", - "integrity": "sha512-1JMofhLK+4p4KairF75D3A924m5ERMgd1GvzhwK2geuYgd2ZKuGW72gvXpIV7aGf52E3Uu1kDXxxGAiZ5uVG7g==", - "license": "MIT" + "integrity": "sha512-1JMofhLK+4p4KairF75D3A924m5ERMgd1GvzhwK2geuYgd2ZKuGW72gvXpIV7aGf52E3Uu1kDXxxGAiZ5uVG7g==" }, "node_modules/@cspell/dict-css": { "version": "4.0.12", "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.12.tgz", - "integrity": "sha512-vGBgPM92MkHQF5/2jsWcnaahOZ+C6OE/fPvd5ScBP72oFY9tn5GLuomcyO0z8vWCr2e0nUSX1OGimPtcQAlvSw==", - "license": "MIT" + "integrity": "sha512-vGBgPM92MkHQF5/2jsWcnaahOZ+C6OE/fPvd5ScBP72oFY9tn5GLuomcyO0z8vWCr2e0nUSX1OGimPtcQAlvSw==" }, "node_modules/@cspell/dict-dart": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.0.3.tgz", - "integrity": "sha512-cLkwo1KT5CJY5N5RJVHks2genFkNCl/WLfj+0fFjqNR+tk3tBI1LY7ldr9piCtSFSm4x9pO1x6IV3kRUY1lLiw==", - "license": "MIT" + "integrity": "sha512-cLkwo1KT5CJY5N5RJVHks2genFkNCl/WLfj+0fFjqNR+tk3tBI1LY7ldr9piCtSFSm4x9pO1x6IV3kRUY1lLiw==" }, "node_modules/@cspell/dict-data-science": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-1.0.11.tgz", - "integrity": "sha512-TaHAZRVe0Zlcc3C23StZqqbzC0NrodRwoSAc8dis+5qLeLLnOCtagYQeROQvDlcDg3X/VVEO9Whh4W/z4PAmYQ==", - "license": "MIT" + "integrity": "sha512-TaHAZRVe0Zlcc3C23StZqqbzC0NrodRwoSAc8dis+5qLeLLnOCtagYQeROQvDlcDg3X/VVEO9Whh4W/z4PAmYQ==" }, "node_modules/@cspell/dict-django": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.0.tgz", - "integrity": "sha512-bKJ4gPyrf+1c78Z0Oc4trEB9MuhcB+Yg+uTTWsvhY6O2ncFYbB/LbEZfqhfmmuK/XJJixXfI1laF2zicyf+l0w==", - "license": "MIT" + "integrity": "sha512-bKJ4gPyrf+1c78Z0Oc4trEB9MuhcB+Yg+uTTWsvhY6O2ncFYbB/LbEZfqhfmmuK/XJJixXfI1laF2zicyf+l0w==" }, "node_modules/@cspell/dict-docker": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.7.tgz", - "integrity": "sha512-XlXHAr822euV36GGsl2J1CkBIVg3fZ6879ZOg5dxTIssuhUOCiV2BuzKZmt6aIFmcdPmR14+9i9Xq+3zuxeX0A==", - "license": "MIT" + "integrity": "sha512-XlXHAr822euV36GGsl2J1CkBIVg3fZ6879ZOg5dxTIssuhUOCiV2BuzKZmt6aIFmcdPmR14+9i9Xq+3zuxeX0A==" }, "node_modules/@cspell/dict-dotnet": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.0.tgz", - "integrity": "sha512-EOwGd533v47aP5QYV8GlSSKkmM9Eq8P3G/eBzSpH3Nl2+IneDOYOBLEUraHuiCtnOkNsz0xtZHArYhAB2bHWAw==", - "license": "MIT" + "integrity": "sha512-EOwGd533v47aP5QYV8GlSSKkmM9Eq8P3G/eBzSpH3Nl2+IneDOYOBLEUraHuiCtnOkNsz0xtZHArYhAB2bHWAw==" }, "node_modules/@cspell/dict-elixir": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-4.0.3.tgz", - "integrity": "sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q==", - "license": "MIT" + "integrity": "sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q==" }, "node_modules/@cspell/dict-en_us": { - "version": "4.3.13", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.13.tgz", - "integrity": "sha512-T6lHiGCjloGNE0d8CogF+efJZPCAP8zdzn+KnlI0Bmjaz5nvG2LTX7CXl1zkOl1nYYev0FuIk9WJ9YPVRjcFbQ==", - "license": "MIT" + "version": "4.3.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.16.tgz", + "integrity": "sha512-fyNuAvYpkllmsMpfAJaMip250LRAnEDp2EZbkjYwAJXXjtgQ4/1yh6sLityxPMDtJZN65Eko+8rJzGJHez4zbA==" }, "node_modules/@cspell/dict-en-common-misspellings": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.0.tgz", - "integrity": "sha512-NOg8dlv37/YqLkCfBs5OXeJm/Wcfb/CzeOmOZJ2ZXRuxwsNuolb4TREUce0yAXRqMhawahY5TSDRJJBgKjBOdw==", - "license": "CC BY-SA 4.0" + "integrity": "sha512-NOg8dlv37/YqLkCfBs5OXeJm/Wcfb/CzeOmOZJ2ZXRuxwsNuolb4TREUce0yAXRqMhawahY5TSDRJJBgKjBOdw==" }, "node_modules/@cspell/dict-en-gb": { "version": "1.1.33", "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz", - "integrity": "sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==", - "license": "MIT" + "integrity": "sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==" }, "node_modules/@cspell/dict-filetypes": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.3.tgz", - "integrity": "sha512-J9UP+qwwBLfOQ8Qg9tAsKtSY/WWmjj21uj6zXTI9hRLD1eG1uUOLcfVovAmtmVqUWziPSKMr87F6SXI3xmJXgw==", - "license": "MIT" + "integrity": "sha512-J9UP+qwwBLfOQ8Qg9tAsKtSY/WWmjj21uj6zXTI9hRLD1eG1uUOLcfVovAmtmVqUWziPSKMr87F6SXI3xmJXgw==" }, "node_modules/@cspell/dict-fonts": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.0.tgz", - "integrity": "sha512-t9V4GeN/m517UZn63kZPUYP3OQg5f0OBLSd3Md5CU3eH1IFogSvTzHHnz4Wqqbv8NNRiBZ3HfdY/pqREZ6br3Q==", - "license": "MIT" + "integrity": "sha512-t9V4GeN/m517UZn63kZPUYP3OQg5f0OBLSd3Md5CU3eH1IFogSvTzHHnz4Wqqbv8NNRiBZ3HfdY/pqREZ6br3Q==" }, "node_modules/@cspell/dict-fsharp": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@cspell/dict-fsharp/-/dict-fsharp-1.0.1.tgz", - "integrity": "sha512-23xyPcD+j+NnqOjRHgW3IU7Li912SX9wmeefcY0QxukbAxJ/vAN4rBpjSwwYZeQPAn3fxdfdNZs03fg+UM+4yQ==", - "license": "MIT" + "integrity": "sha512-23xyPcD+j+NnqOjRHgW3IU7Li912SX9wmeefcY0QxukbAxJ/vAN4rBpjSwwYZeQPAn3fxdfdNZs03fg+UM+4yQ==" }, "node_modules/@cspell/dict-fullstack": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.1.5.tgz", - "integrity": "sha512-6ppvo1dkXUZ3fbYn/wwzERxCa76RtDDl5Afzv2lijLoijGGUw5yYdLBKJnx8PJBGNLh829X352ftE7BElG4leA==", - "license": "MIT" + "integrity": "sha512-6ppvo1dkXUZ3fbYn/wwzERxCa76RtDDl5Afzv2lijLoijGGUw5yYdLBKJnx8PJBGNLh829X352ftE7BElG4leA==" }, "node_modules/@cspell/dict-gaming-terms": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.0.4.tgz", - "integrity": "sha512-hbDduNXlk4AOY0wFxcDMWBPpm34rpqJBeqaySeoUH70eKxpxm+dvjpoRLJgyu0TmymEICCQSl6lAHTHSDiWKZg==", - "license": "MIT" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.0.5.tgz", + "integrity": "sha512-C3riccZDD3d9caJQQs1+MPfrUrQ+0KHdlj9iUR1QD92FgTOF6UxoBpvHUUZ9YSezslcmpFQK4xQQ5FUGS7uWfw==" }, "node_modules/@cspell/dict-git": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.0.tgz", - "integrity": "sha512-simGS/lIiXbEaqJu9E2VPoYW1OTC2xrwPPXNXFMa2uo/50av56qOuaxDrZ5eH1LidFXwoc8HROCHYeKoNrDLSw==", - "license": "MIT" + "integrity": "sha512-simGS/lIiXbEaqJu9E2VPoYW1OTC2xrwPPXNXFMa2uo/50av56qOuaxDrZ5eH1LidFXwoc8HROCHYeKoNrDLSw==" }, "node_modules/@cspell/dict-golang": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.5.tgz", - "integrity": "sha512-w4mEqGz4/wV+BBljLxduFNkMrd3rstBNDXmoX5kD4UTzIb4Sy0QybWCtg2iVT+R0KWiRRA56QKOvBsgXiddksA==", - "license": "MIT" + "integrity": "sha512-w4mEqGz4/wV+BBljLxduFNkMrd3rstBNDXmoX5kD4UTzIb4Sy0QybWCtg2iVT+R0KWiRRA56QKOvBsgXiddksA==" }, "node_modules/@cspell/dict-haskell": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@cspell/dict-haskell/-/dict-haskell-4.0.1.tgz", - "integrity": "sha512-uRrl65mGrOmwT7NxspB4xKXFUenNC7IikmpRZW8Uzqbqcu7ZRCUfstuVH7T1rmjRgRkjcIjE4PC11luDou4wEQ==", - "license": "MIT" + "integrity": "sha512-uRrl65mGrOmwT7NxspB4xKXFUenNC7IikmpRZW8Uzqbqcu7ZRCUfstuVH7T1rmjRgRkjcIjE4PC11luDou4wEQ==" }, "node_modules/@cspell/dict-html": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.5.tgz", - "integrity": "sha512-p0brEnRybzSSWi8sGbuVEf7jSTDmXPx7XhQUb5bgG6b54uj+Z0Qf0V2n8b/LWwIPJNd1GygaO9l8k3HTCy1h4w==", - "license": "MIT" + "integrity": "sha512-p0brEnRybzSSWi8sGbuVEf7jSTDmXPx7XhQUb5bgG6b54uj+Z0Qf0V2n8b/LWwIPJNd1GygaO9l8k3HTCy1h4w==" }, "node_modules/@cspell/dict-html-symbol-entities": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.0.tgz", - "integrity": "sha512-HGRu+48ErJjoweR5IbcixxETRewrBb0uxQBd6xFGcxbEYCX8CnQFTAmKI5xNaIt2PKaZiJH3ijodGSqbKdsxhw==", - "license": "MIT" + "integrity": "sha512-HGRu+48ErJjoweR5IbcixxETRewrBb0uxQBd6xFGcxbEYCX8CnQFTAmKI5xNaIt2PKaZiJH3ijodGSqbKdsxhw==" }, "node_modules/@cspell/dict-java": { "version": "5.0.6", "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.6.tgz", - "integrity": "sha512-kdE4AHHHrixyZ5p6zyms1SLoYpaJarPxrz8Tveo6gddszBVVwIUZ+JkQE1bWNLK740GWzIXdkznpUfw1hP9nXw==", - "license": "MIT" + "integrity": "sha512-kdE4AHHHrixyZ5p6zyms1SLoYpaJarPxrz8Tveo6gddszBVVwIUZ+JkQE1bWNLK740GWzIXdkznpUfw1hP9nXw==" }, "node_modules/@cspell/dict-k8s": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.2.tgz", - "integrity": "sha512-tLT7gZpNPnGa+IIFvK9SP1LrSpPpJ94a/DulzAPOb1Q2UBFwdpFd82UWhio0RNShduvKG/WiMZf/wGl98pn+VQ==", - "license": "MIT" + "integrity": "sha512-tLT7gZpNPnGa+IIFvK9SP1LrSpPpJ94a/DulzAPOb1Q2UBFwdpFd82UWhio0RNShduvKG/WiMZf/wGl98pn+VQ==" }, "node_modules/@cspell/dict-latex": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-4.0.0.tgz", - "integrity": "sha512-LPY4y6D5oI7D3d+5JMJHK/wxYTQa2lJMSNxps2JtuF8hbAnBQb3igoWEjEbIbRRH1XBM0X8dQqemnjQNCiAtxQ==", - "license": "MIT" + "integrity": "sha512-LPY4y6D5oI7D3d+5JMJHK/wxYTQa2lJMSNxps2JtuF8hbAnBQb3igoWEjEbIbRRH1XBM0X8dQqemnjQNCiAtxQ==" }, "node_modules/@cspell/dict-lorem-ipsum": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.0.tgz", - "integrity": "sha512-1l3yjfNvMzZPibW8A7mQU4kTozwVZVw0AvFEdy+NcqtbxH+TvbSkNMqROOFWrkD2PjnKG0+Ea0tHI2Pi6Gchnw==", - "license": "MIT" + "integrity": "sha512-1l3yjfNvMzZPibW8A7mQU4kTozwVZVw0AvFEdy+NcqtbxH+TvbSkNMqROOFWrkD2PjnKG0+Ea0tHI2Pi6Gchnw==" }, "node_modules/@cspell/dict-lua": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-4.0.3.tgz", - "integrity": "sha512-lDHKjsrrbqPaea13+G9s0rtXjMO06gPXPYRjRYawbNmo4E/e3XFfVzeci3OQDQNDmf2cPOwt9Ef5lu2lDmwfJg==", - "license": "MIT" + "integrity": "sha512-lDHKjsrrbqPaea13+G9s0rtXjMO06gPXPYRjRYawbNmo4E/e3XFfVzeci3OQDQNDmf2cPOwt9Ef5lu2lDmwfJg==" }, "node_modules/@cspell/dict-makefile": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@cspell/dict-makefile/-/dict-makefile-1.0.0.tgz", - "integrity": "sha512-3W9tHPcSbJa6s0bcqWo6VisEDTSN5zOtDbnPabF7rbyjRpNo0uHXHRJQF8gAbFzoTzBBhgkTmrfSiuyQm7vBUQ==", - "license": "MIT" + "integrity": "sha512-3W9tHPcSbJa6s0bcqWo6VisEDTSN5zOtDbnPabF7rbyjRpNo0uHXHRJQF8gAbFzoTzBBhgkTmrfSiuyQm7vBUQ==" }, "node_modules/@cspell/dict-node": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-4.0.3.tgz", - "integrity": "sha512-sFlUNI5kOogy49KtPg8SMQYirDGIAoKBO3+cDLIwD4MLdsWy1q0upc7pzGht3mrjuyMiPRUV14Bb0rkVLrxOhg==", - "license": "MIT" + "integrity": "sha512-sFlUNI5kOogy49KtPg8SMQYirDGIAoKBO3+cDLIwD4MLdsWy1q0upc7pzGht3mrjuyMiPRUV14Bb0rkVLrxOhg==" }, "node_modules/@cspell/dict-npm": { - "version": "5.0.14", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.14.tgz", - "integrity": "sha512-k0kC7/W2qG5YII+SW6s+JtvKrkZg651vizi5dv/5G2HmJaeLNgDqBVeeDk/uV+ntBorM66XG4BPMjSxoaIlC5w==", - "license": "MIT" + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.15.tgz", + "integrity": "sha512-sX0X5YWNW54F4baW7b5JJB6705OCBIZtUqjOghlJNORS5No7QY1IX1zc5FxNNu4gsaCZITAmfMi4ityXEsEThA==" }, "node_modules/@cspell/dict-php": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.5.tgz", - "integrity": "sha512-9r8ao7Z/mH9Z8pSB7yLtyvcCJWw+/MnQpj7xGVYzIV7V2ZWDRjXZAMgteHMJ37m8oYz64q5d4tiipD300QSetQ==", - "license": "MIT" + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.6.tgz", + "integrity": "sha512-ySAXisf7twoVFZqBV2o/DKiCLIDTHNqfnj0EfH9OoOUR7HL3rb6zJkm0viLUFDO2G/8SyIi6YrN/6KX+Scjjjg==" }, "node_modules/@cspell/dict-powershell": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.3.tgz", - "integrity": "sha512-lEdzrcyau6mgzu1ie98GjOEegwVHvoaWtzQnm1ie4DyZgMr+N6D0Iyj1lzvtmt0snvsDFa5F2bsYzf3IMKcpcA==", - "license": "MIT" + "integrity": "sha512-lEdzrcyau6mgzu1ie98GjOEegwVHvoaWtzQnm1ie4DyZgMr+N6D0Iyj1lzvtmt0snvsDFa5F2bsYzf3IMKcpcA==" }, "node_modules/@cspell/dict-public-licenses": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.5.tgz", - "integrity": "sha512-91HK4dSRri/HqzAypHgduRMarJAleOX5NugoI8SjDLPzWYkwZ1ftuCXSk+fy8DLc3wK7iOaFcZAvbjmnLhVs4A==", - "license": "MIT" + "integrity": "sha512-91HK4dSRri/HqzAypHgduRMarJAleOX5NugoI8SjDLPzWYkwZ1ftuCXSk+fy8DLc3wK7iOaFcZAvbjmnLhVs4A==" }, "node_modules/@cspell/dict-python": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.1.11.tgz", "integrity": "sha512-XG+v3PumfzUW38huSbfT15Vqt3ihNb462ulfXifpQllPok5OWynhszCLCRQjQReV+dgz784ST4ggRxW452/kVg==", - "license": "MIT", "dependencies": { "@cspell/dict-data-science": "^1.0.11" } @@ -360,68 +315,57 @@ "node_modules/@cspell/dict-r": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@cspell/dict-r/-/dict-r-2.0.1.tgz", - "integrity": "sha512-KCmKaeYMLm2Ip79mlYPc8p+B2uzwBp4KMkzeLd5E6jUlCL93Y5Nvq68wV5fRLDRTf7N1LvofkVFWfDcednFOgA==", - "license": "MIT" + "integrity": "sha512-KCmKaeYMLm2Ip79mlYPc8p+B2uzwBp4KMkzeLd5E6jUlCL93Y5Nvq68wV5fRLDRTf7N1LvofkVFWfDcednFOgA==" }, "node_modules/@cspell/dict-ruby": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.2.tgz", - "integrity": "sha512-cIh8KTjpldzFzKGgrqUX4bFyav5lC52hXDKo4LbRuMVncs3zg4hcSf4HtURY+f2AfEZzN6ZKzXafQpThq3dl2g==", - "license": "MIT" + "integrity": "sha512-cIh8KTjpldzFzKGgrqUX4bFyav5lC52hXDKo4LbRuMVncs3zg4hcSf4HtURY+f2AfEZzN6ZKzXafQpThq3dl2g==" }, "node_modules/@cspell/dict-rust": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.1.tgz", - "integrity": "sha512-xJSSzHDK2z6lSVaOmMxl3PTOtfoffaxMo7fTcbZUF+SCJzfKbO6vnN9TCGX2sx1RHFDz66Js6goz6SAZQdOwaw==", - "license": "MIT" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.2.tgz", + "integrity": "sha512-RhziKDrklzOntxAbY3AvNR58wnFGIo3YS8+dNeLY36GFuWOvXDHFStYw5Pod4f/VXbO/+1tXtywCC4zWfB2p1w==" }, "node_modules/@cspell/dict-scala": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.0.tgz", - "integrity": "sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ==", - "license": "MIT" + "integrity": "sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ==" }, "node_modules/@cspell/dict-software-terms": { - "version": "3.3.16", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.3.16.tgz", - "integrity": "sha512-ixorEP80LGxAU+ODVSn/CYIDjV0XAlZ2VrBu7CT+PwUFJ7h8o3JX1ywKB4qnt0hHru3JjWFtBoBThmZdrXnREQ==", - "license": "MIT" + "version": "3.3.18", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.3.18.tgz", + "integrity": "sha512-LJZGGMGqS8KzgXJrSMs3T+6GoqHG9z8Bc+rqLzLzbtoR3FbsMasE9U8oP2PmS3q7jJLFjQkzmg508DrcuZuo2g==" }, "node_modules/@cspell/dict-sql": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.1.3.tgz", - "integrity": "sha512-SEyTNKJrjqD6PAzZ9WpdSu6P7wgdNtGV2RV8Kpuw1x6bV+YsSptuClYG+JSdRExBTE6LwIe1bTklejUp3ZP8TQ==", - "license": "MIT" + "integrity": "sha512-SEyTNKJrjqD6PAzZ9WpdSu6P7wgdNtGV2RV8Kpuw1x6bV+YsSptuClYG+JSdRExBTE6LwIe1bTklejUp3ZP8TQ==" }, "node_modules/@cspell/dict-svelte": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@cspell/dict-svelte/-/dict-svelte-1.0.2.tgz", - "integrity": "sha512-rPJmnn/GsDs0btNvrRBciOhngKV98yZ9SHmg8qI6HLS8hZKvcXc0LMsf9LLuMK1TmS2+WQFAan6qeqg6bBxL2Q==", - "license": "MIT" + "integrity": "sha512-rPJmnn/GsDs0btNvrRBciOhngKV98yZ9SHmg8qI6HLS8hZKvcXc0LMsf9LLuMK1TmS2+WQFAan6qeqg6bBxL2Q==" }, "node_modules/@cspell/dict-swift": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-2.0.1.tgz", - "integrity": "sha512-gxrCMUOndOk7xZFmXNtkCEeroZRnS2VbeaIPiymGRHj5H+qfTAzAKxtv7jJbVA3YYvEzWcVE2oKDP4wcbhIERw==", - "license": "MIT" + "integrity": "sha512-gxrCMUOndOk7xZFmXNtkCEeroZRnS2VbeaIPiymGRHj5H+qfTAzAKxtv7jJbVA3YYvEzWcVE2oKDP4wcbhIERw==" }, "node_modules/@cspell/dict-typescript": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.2.tgz", - "integrity": "sha512-lcNOYWjLUvDZdLa0UMNd/LwfVdxhE9rKA+agZBGjL3lTA3uNvH7IUqSJM/IXhJoBpLLMVEOk8v1N9xi+vDuCdA==", - "license": "MIT" + "integrity": "sha512-lcNOYWjLUvDZdLa0UMNd/LwfVdxhE9rKA+agZBGjL3lTA3uNvH7IUqSJM/IXhJoBpLLMVEOk8v1N9xi+vDuCdA==" }, "node_modules/@cspell/dict-vue": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.0.tgz", - "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==", - "license": "MIT" + "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.3.2.tgz", - "integrity": "sha512-4t0xM5luA3yQhar2xWvYK4wQSDB2r0u8XkpzzJqd57MnJXd7uIAxI0awGUrDXukadRaCo0tDIlMUBemH48SNVg==", - "license": "MIT", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.4.0.tgz", + "integrity": "sha512-GV6LFOsNvtBpMLY5a087YyHqehe1+a3mH+LvAwYO5gBZvh9te/rHx14e6/shEYNh59mM24lm7MLCaHhmP8dhyQ==", "dependencies": { "import-meta-resolve": "^4.0.0" }, @@ -430,10 +374,9 @@ } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.3.2.tgz", - "integrity": "sha512-Mte/2000ap278kRYOUhiGWI7MNr1+A7WSWJmlcdP4CAH5SO20sZI3/cyZLjJJEyapdhK5vaP1L5J9sUcVDHd3A==", - "license": "MIT", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.4.0.tgz", + "integrity": "sha512-R/fWW9S3oypKOTkxRZeJqcWl4f+v5w8Bejaj5rcRwztwAM/xdOGSelGhPdNnTazciINegbmTa4XiurUCN9E8Mg==", "engines": { "node": ">=18" } @@ -527,8 +470,7 @@ "node_modules/array-timsort": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", - "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", - "license": "MIT" + "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==" }, "node_modules/balanced-match": { "version": "1.0.2", @@ -561,7 +503,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "license": "MIT", "engines": { "node": ">=6" } @@ -597,7 +538,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/clear-module/-/clear-module-4.1.2.tgz", "integrity": "sha512-LWAxzHqdHsAZlPlEyJ2Poz6AIs384mPeqLVCru2p0BrP9G/kVGuhNyZYClLO6cXlnuJjzC8xtsJIuMjKqLXoAw==", - "license": "MIT", "dependencies": { "parent-module": "^2.0.0", "resolve-from": "^5.0.0" @@ -609,18 +549,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/clear-module/node_modules/parent-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz", - "integrity": "sha512-uo0Z9JJeWzv8BG+tRcapBKNJ0dro9cLyczGzulS6EfeyAdeC9sbojtW6XwvYxJkEne9En+J2XEl4zyglVeIwFg==", - "license": "MIT", - "dependencies": { - "callsites": "^3.1.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -640,19 +568,17 @@ "license": "MIT" }, "node_modules/commander": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", - "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", - "license": "MIT", + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz", + "integrity": "sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==", "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/comment-json": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz", "integrity": "sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==", - "license": "MIT", "dependencies": { "array-timsort": "^1.0.3", "core-util-is": "^1.0.3", @@ -668,7 +594,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz", "integrity": "sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA==", - "license": "BSD-2-Clause", "dependencies": { "dot-prop": "^6.0.1", "graceful-fs": "^4.2.6", @@ -686,8 +611,7 @@ "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "license": "MIT" + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cross-spawn": { "version": "7.0.3", @@ -707,7 +631,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", - "license": "MIT", "dependencies": { "type-fest": "^1.0.1" }, @@ -719,27 +642,26 @@ } }, "node_modules/cspell": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.3.2.tgz", - "integrity": "sha512-V8Ub3RO/a5lwSsltW/ib3Z3G/sczKtSpBBN1JChzbSCfEgaY2mJY8JW0BpkSV+Ug6uJitpXNOOaxa3Xr489i7g==", - "license": "MIT", - "dependencies": { - "@cspell/cspell-json-reporter": "8.3.2", - "@cspell/cspell-pipe": "8.3.2", - "@cspell/cspell-types": "8.3.2", - "@cspell/dynamic-import": "8.3.2", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.4.0.tgz", + "integrity": "sha512-1PW0w51V9n6NApf8Jbfji09jyRg7gHDm4acn1UbOd+v3gkefuaofYeMyLyupY5igloeIukTkvi3mxo+vu0hpxg==", + "dependencies": { + "@cspell/cspell-json-reporter": "8.4.0", + "@cspell/cspell-pipe": "8.4.0", + "@cspell/cspell-types": "8.4.0", + "@cspell/dynamic-import": "8.4.0", "chalk": "^5.3.0", "chalk-template": "^1.1.0", - "commander": "^11.1.0", - "cspell-gitignore": "8.3.2", - "cspell-glob": "8.3.2", - "cspell-io": "8.3.2", - "cspell-lib": "8.3.2", + "commander": "^12.0.0", + "cspell-gitignore": "8.4.0", + "cspell-glob": "8.4.0", + "cspell-io": "8.4.0", + "cspell-lib": "8.4.0", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^8.0.0", "get-stdin": "^9.0.0", - "semver": "^7.5.4", + "semver": "^7.6.0", "strip-ansi": "^7.1.0", "vscode-uri": "^3.0.8" }, @@ -755,12 +677,11 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.3.2.tgz", - "integrity": "sha512-Wc98XhBNLwDxnxCzMtgRJALI9a69cu3C5Gf1rGjNTKSFo9JYiQmju0Ur3z25Pkx9Sa86f+2IjvNCf33rUDSoBQ==", - "license": "MIT", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.4.0.tgz", + "integrity": "sha512-lgvQrsOKTPfwjtkkyPTPQ/oC1y80wdSRqW9aiDl5OGVr6sGZz5lUC5oIHcu6jUOfiR7/CNPhIlVQ01faIW/5IA==", "dependencies": { - "@cspell/cspell-types": "8.3.2", + "@cspell/cspell-types": "8.4.0", "comment-json": "^4.2.3", "yaml": "^2.3.4" }, @@ -769,14 +690,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.3.2.tgz", - "integrity": "sha512-xyK95hO2BMPFxIo8zBwGml8035qOxSBdga1BMhwW/p2wDrQP8S4Cdm/54//tCDmKn6uRkFQvyOfWGaX2l8WMEg==", - "license": "MIT", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.4.0.tgz", + "integrity": "sha512-eibij29R+1IjdsFAkboMtcfiRxBc+uOcNevJNQmVkU8Mwlx2gUopG8e+a22P4b6ufFrBT6S+/UsGBZtHky+eew==", "dependencies": { - "@cspell/cspell-pipe": "8.3.2", - "@cspell/cspell-types": "8.3.2", - "cspell-trie-lib": "8.3.2", + "@cspell/cspell-pipe": "8.4.0", + "@cspell/cspell-types": "8.4.0", + "cspell-trie-lib": "8.4.0", "fast-equals": "^5.0.1", "gensequence": "^6.0.0" }, @@ -785,12 +705,11 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.3.2.tgz", - "integrity": "sha512-3Qc9P5BVvl/cg//s2s+zIMGKcoH5v7oOtRgwn4UQry8yiyo19h0tiTKkSR574FMhF5NtcShTnwIwPSIXVBPFHA==", - "license": "MIT", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.4.0.tgz", + "integrity": "sha512-azFZRA04yXZlXUztgbtjhKk4ddKI3yEMz+wMN4yIhDYRG+rwQyng0tIv5b/Hw26ptDFBrW9Vnec9rnSXHzkVWA==", "dependencies": { - "cspell-glob": "8.3.2", + "cspell-glob": "8.4.0", "find-up-simple": "^1.0.0" }, "bin": { @@ -801,10 +720,9 @@ } }, "node_modules/cspell-glob": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.3.2.tgz", - "integrity": "sha512-KtIFxE+3l5dGEofND4/CdZffXP8XN1+XGQKxJ96lIzWsc01mkotfhxTkla6mgvfH039t7BsY/SWv0460KyGslQ==", - "license": "MIT", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.4.0.tgz", + "integrity": "sha512-3KuqpdiDkLCUdjCEyXhyUyFgRlrF/LbGoQO5J8ZnO8hLQDxyaW/3sDRCp0q9Ec6HF+0C1/ECOdulx7C0VRcOMw==", "dependencies": { "micromatch": "^4.0.5" }, @@ -813,13 +731,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.3.2.tgz", - "integrity": "sha512-tYCkOmRzJe1a6/R+8QGSwG7TwTgznLPqsHtepKzLmnS4YX54VXjKRI9zMARxXDzUVfyCSVdW5MyiY/0WTNoy+A==", - "license": "MIT", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.4.0.tgz", + "integrity": "sha512-0p7E55v9C9El2/jKrenEtOYVj3Rl+FeEM9QcJBxQ6IYX/7QnoCLth09/BacaZmQfawxzkPtRoXbwhH5472vAgw==", "dependencies": { - "@cspell/cspell-pipe": "8.3.2", - "@cspell/cspell-types": "8.3.2" + "@cspell/cspell-pipe": "8.4.0", + "@cspell/cspell-types": "8.4.0" }, "bin": { "cspell-grammar": "bin.mjs" @@ -829,38 +746,36 @@ } }, "node_modules/cspell-io": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.3.2.tgz", - "integrity": "sha512-WYpKsyBCQP0SY4gXnhW5fPuxcYchKYKG1PIXVV3ezFU4muSgW6GuLNbGuSfwv/8YNXRgFSN0e3hYH0rdBK2Aow==", - "license": "MIT", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.4.0.tgz", + "integrity": "sha512-CvC5XMJ4ENkdSZdhtJ6aJ7jez0PF9bAT0lGrSyGYId8fXS+lZ1jszllY3s4mSTdILVCDd8jVSSSogkqh6DKxUA==", "dependencies": { - "@cspell/cspell-service-bus": "8.3.2" + "@cspell/cspell-service-bus": "8.4.0" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.3.2.tgz", - "integrity": "sha512-wTvdaev/TyGB/ln6CVD1QbVs2D7/+QiajQ67S7yj1suLHM6YcNQQb/5sPAM8VPtj0E7PgwgPXf3bq18OtPvnFg==", - "license": "MIT", - "dependencies": { - "@cspell/cspell-bundled-dicts": "8.3.2", - "@cspell/cspell-pipe": "8.3.2", - "@cspell/cspell-resolver": "8.3.2", - "@cspell/cspell-types": "8.3.2", - "@cspell/dynamic-import": "8.3.2", - "@cspell/strong-weak-map": "8.3.2", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.4.0.tgz", + "integrity": "sha512-ZFd8a9NZXR0kGEIjMWoISXUj+buCaE9MGYbDi0sj1X1/YtHThC6nHWUwJvvT4fRa8iHT3fb6l5U0tyJFRV4Z7w==", + "dependencies": { + "@cspell/cspell-bundled-dicts": "8.4.0", + "@cspell/cspell-pipe": "8.4.0", + "@cspell/cspell-resolver": "8.4.0", + "@cspell/cspell-types": "8.4.0", + "@cspell/dynamic-import": "8.4.0", + "@cspell/strong-weak-map": "8.4.0", "clear-module": "^4.1.2", "comment-json": "^4.2.3", "configstore": "^6.0.0", - "cspell-config-lib": "8.3.2", - "cspell-dictionary": "8.3.2", - "cspell-glob": "8.3.2", - "cspell-grammar": "8.3.2", - "cspell-io": "8.3.2", - "cspell-trie-lib": "8.3.2", + "cspell-config-lib": "8.4.0", + "cspell-dictionary": "8.4.0", + "cspell-glob": "8.4.0", + "cspell-grammar": "8.4.0", + "cspell-io": "8.4.0", + "cspell-trie-lib": "8.4.0", "fast-equals": "^5.0.1", "gensequence": "^6.0.0", "import-fresh": "^3.3.0", @@ -873,13 +788,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.3.2.tgz", - "integrity": "sha512-8qh2FqzkLMwzlTlvO/5Z+89fhi30rrfekocpight/BmqKbE2XFJQD7wS2ml24e7q/rdHJLXVpJbY/V5mByucCA==", - "license": "MIT", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.4.0.tgz", + "integrity": "sha512-hsldLrvXnkjTPbhN2isDpJv3qLFWpmt0S3CFpQMUVo10f2CVrcRRXMXXjXnrlHBkMSDLx2eewUjLP2RifXJJyQ==", "dependencies": { - "@cspell/cspell-pipe": "8.3.2", - "@cspell/cspell-types": "8.3.2", + "@cspell/cspell-pipe": "8.4.0", + "@cspell/cspell-types": "8.4.0", "gensequence": "^6.0.0" }, "engines": { @@ -890,7 +804,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", - "license": "MIT", "dependencies": { "is-obj": "^2.0.0" }, @@ -917,7 +830,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -930,7 +842,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.0.1.tgz", "integrity": "sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ==", - "license": "MIT", "engines": { "node": ">=6.0.0" } @@ -994,7 +905,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz", "integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==", - "license": "MIT", "engines": { "node": ">=18" }, @@ -1054,7 +964,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/gensequence/-/gensequence-6.0.0.tgz", "integrity": "sha512-8WwuywE9pokJRAcg2QFR/plk3cVPebSUqRPzpGQh3WQ0wIiHAw+HyOQj5IuHyUTQBHpBKFoB2JUMu9zT3vJ16Q==", - "license": "MIT", "engines": { "node": ">=16" } @@ -1109,7 +1018,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", "integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==", - "license": "MIT", "dependencies": { "ini": "4.1.1" }, @@ -1123,14 +1031,12 @@ "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "license": "ISC" + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "node_modules/has-own-prop": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", - "license": "MIT", "engines": { "node": ">=8" } @@ -1139,7 +1045,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -1151,11 +1056,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/import-fresh/node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/import-fresh/node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "license": "MIT", "engines": { "node": ">=4" } @@ -1164,7 +1079,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz", "integrity": "sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -1174,7 +1088,6 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "license": "MIT", "engines": { "node": ">=0.8.19" } @@ -1183,7 +1096,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", - "license": "ISC", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } @@ -1231,7 +1143,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "license": "MIT", "engines": { "node": ">=8" } @@ -1239,8 +1150,7 @@ "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "license": "MIT" + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" }, "node_modules/isexe": { "version": "2.0.0", @@ -1285,7 +1195,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -1340,15 +1249,14 @@ } }, "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "license": "MIT", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz", + "integrity": "sha512-uo0Z9JJeWzv8BG+tRcapBKNJ0dro9cLyczGzulS6EfeyAdeC9sbojtW6XwvYxJkEne9En+J2XEl4zyglVeIwFg==", "dependencies": { - "callsites": "^3.0.0" + "callsites": "^3.1.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/path-key": { @@ -1421,7 +1329,6 @@ "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", - "license": "MIT", "engines": { "node": ">=0.10" } @@ -1430,7 +1337,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "license": "MIT", "engines": { "node": ">=8" } @@ -1487,10 +1393,9 @@ } }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "license": "ISC", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -1525,8 +1430,7 @@ "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "license": "ISC" + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "node_modules/string-width": { "version": "5.1.2", @@ -1634,7 +1538,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -1646,7 +1549,6 @@ "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "license": "MIT", "dependencies": { "is-typedarray": "^1.0.0" } @@ -1655,7 +1557,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", - "license": "MIT", "dependencies": { "crypto-random-string": "^4.0.0" }, @@ -1669,14 +1570,12 @@ "node_modules/vscode-languageserver-textdocument": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz", - "integrity": "sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==", - "license": "MIT" + "integrity": "sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==" }, "node_modules/vscode-uri": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", - "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==", - "license": "MIT" + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" }, "node_modules/which": { "version": "2.0.2", @@ -1770,7 +1669,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", "is-typedarray": "^1.0.0", @@ -1782,7 +1680,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", - "license": "MIT", "engines": { "node": ">=12" }, @@ -1793,14 +1690,12 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "license": "ISC" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yaml": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", - "license": "ISC", "engines": { "node": ">= 14" } diff --git a/package.json b/package.json index ba102d65c2..3d64423e9a 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.3.1" + "cspell": "^8.4.0" } } From d66403c40efe5e839cb96959e5c7e2f8b7ea6497 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:54:58 +0000 Subject: [PATCH 278/845] Bump github-pages from 229 to 230 in /docs Bumps [github-pages](https://github.com/github/pages-gem) from 229 to 230. - [Release notes](https://github.com/github/pages-gem/releases) - [Commits](https://github.com/github/pages-gem/compare/v229...v230) --- updated-dependencies: - dependency-name: github-pages dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- docs/Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 0f1b78fb48..88e3c933dc 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -42,9 +42,9 @@ GEM ffi (1.16.3-x64-mingw-ucrt) forwardable-extended (2.6.0) gemoji (4.1.0) - github-pages (229) + github-pages (230) github-pages-health-check (= 1.18.2) - jekyll (= 3.9.4) + jekyll (= 3.9.5) jekyll-avatar (= 0.8.0) jekyll-coffeescript (= 1.2.2) jekyll-commonmark-ghpages (= 0.4.0) @@ -99,7 +99,7 @@ GEM http_parser.rb (0.8.0) i18n (1.14.1) concurrent-ruby (~> 1.0) - jekyll (3.9.4) + jekyll (3.9.5) addressable (~> 2.4) colorator (~> 1.0) em-websocket (~> 0.5) From daebdf3c107afe5293e17f453d8b5af1705a6c26 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 16:19:03 +0000 Subject: [PATCH 279/845] Bump Meziantou.Analyzer from 2.0.141 to 2.0.142 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.141 to 2.0.142. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.141...2.0.142) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 8eac375edf..14348c7ac0 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From eedb883771cafc7f7dfeed735c51f62a83a51739 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 16:21:46 +0000 Subject: [PATCH 280/845] bump Roslynator.Analyzers from 4.10.0 to 4.11.0 --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 14348c7ac0..8f787ea9f5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 8c2ae2a551460e45206ccf110c51d84a34db3e73 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 19 Feb 2024 17:39:50 +0100 Subject: [PATCH 281/845] Use raw string literals for prettier multiline strings --- .../CollectionAssertionSpecs.AllSatisfy.cs | 24 ++++++------ .../CollectionAssertionSpecs.Satisfy.cs | 37 ++++++++++--------- ...ctionAssertionSpecs.SatisfyRespectively.cs | 30 +++++++-------- .../Xml/XElementFormatterSpecs.cs | 9 +++-- 4 files changed, 52 insertions(+), 48 deletions(-) diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllSatisfy.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllSatisfy.cs index 8cd0f65fa9..eafd9542da 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllSatisfy.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllSatisfy.cs @@ -94,18 +94,18 @@ public void Any_items_not_satisfying_inspector_should_throw() // Assert act.Should() .Throw() - .WithMessage( - @"Expected customers to contain only items satisfying the inspector because we want to test nested assertions: -*At index 0: -*Expected customer.Age to be less than 21, but found 21 -*Expected customer.Items to contain only items satisfying the inspector: -*At index 0: -*Expected item to be 3, but found 1 -*At index 1: -*Expected item to be 3, but found 2 -*At index 1: -*Expected customer.Age to be less than 21, but found 22 (difference of 1)" - ); + .WithMessage(""" + Expected customers to contain only items satisfying the inspector because we want to test nested assertions: + *At index 0: + *Expected customer.Age to be less than 21, but found 21 + *Expected customer.Items to contain only items satisfying the inspector: + *At index 0: + *Expected item to be 3, but found 1 + *At index 1: + *Expected item to be 3, but found 2 + *At index 1: + *Expected customer.Age to be less than 21, but found 22 (difference of 1) + """); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Satisfy.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Satisfy.cs index 6d356b9fb1..d5e2769c1a 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Satisfy.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Satisfy.cs @@ -59,10 +59,11 @@ public void When_one_element_does_not_have_matching_predicate_Satisfy_should_thr element => element == 2); // Assert - act.Should().Throw().WithMessage( - @"Expected collection to satisfy all predicates, but: -*The following predicates did not have matching elements: -*(element == 3)"); + act.Should().Throw().WithMessage(""" + Expected collection to satisfy all predicates, but: + *The following predicates did not have matching elements: + *(element == 3) + """); } [Fact] @@ -141,14 +142,15 @@ public void becauseArgs: "args"); // Assert - act.Should().Throw().WithMessage( - @"Expected collection to satisfy all predicates because we want to test formatting (args), but: -*The following predicates did not have matching elements: -*(element.Text == ""two"") AndAlso (element.Number == 2) -*The following elements did not match any predicate: -*Index: 0, Element:*FluentAssertions.Specs.Collections.CollectionAssertionSpecs+SomeClass*{*Number = 1*Text = ""one""*} -*Index: 1, Element:*FluentAssertions.Specs.Collections.CollectionAssertionSpecs+SomeClass*{*Number = 3*Text = ""two""*} -*Index: 2, Element:*FluentAssertions.Specs.Collections.CollectionAssertionSpecs+SomeClass*{*Number = 3*Text = ""three""*}"); + act.Should().Throw().WithMessage(""" + Expected collection to satisfy all predicates because we want to test formatting (args), but: + *The following predicates did not have matching elements: + *(element.Text == "two") AndAlso (element.Number == 2) + *The following elements did not match any predicate: + *Index: 0, Element:*FluentAssertions.Specs.Collections.CollectionAssertionSpecs+SomeClass*{*Number = 1*Text = "one"*} + *Index: 1, Element:*FluentAssertions.Specs.Collections.CollectionAssertionSpecs+SomeClass*{*Number = 3*Text = "two"*} + *Index: 2, Element:*FluentAssertions.Specs.Collections.CollectionAssertionSpecs+SomeClass*{*Number = 3*Text = "three"*} + """); } [Fact] @@ -237,11 +239,12 @@ public void When_elements_are_integers_assertion_fails_then_failure_message_must element => element == 2); // Assert - act.Should().Throw().WithMessage( - @"Expected collection to satisfy all predicates, but: -*The following elements did not match any predicate: -*Index: 0, Element: 1 -*Index: 2, Element: 3"); + act.Should().Throw().WithMessage(""" + Expected collection to satisfy all predicates, but: + *The following elements did not match any predicate: + *Index: 0, Element: 1 + *Index: 2, Element: 3 + """); } } diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.SatisfyRespectively.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.SatisfyRespectively.cs index 9f7cd2a1b1..9273fdc5fa 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.SatisfyRespectively.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.SatisfyRespectively.cs @@ -126,21 +126,21 @@ public void When_asserting_collection_does_not_satisfy_any_inspector_it_should_t }, "because we want to test {0}", "nested assertions"); // Assert - act.Should().Throw().WithMessage( - @"Expected customers to satisfy all inspectors because we want to test nested assertions, but some inspectors are not satisfied: -*At index 0: -*Expected customer.Age to be less than 21, but found 21 -*Expected customer.Items to satisfy all inspectors, but some inspectors are not satisfied: -*At index 0: -*Expected item to be 2, but found 1 -*At index 1: -*Expected item to be 1, but found 2 -*At index 1: -*Expected customer.Age to be less than 22, but found 22 -*Expected customer.Items to satisfy all inspectors, but some inspectors are not satisfied: -*At index 0: -*Expected item to be 2, but found 3" - ); + act.Should().Throw().WithMessage(""" + Expected customers to satisfy all inspectors because we want to test nested assertions, but some inspectors are not satisfied: + *At index 0: + *Expected customer.Age to be less than 21, but found 21 + *Expected customer.Items to satisfy all inspectors, but some inspectors are not satisfied: + *At index 0: + *Expected item to be 2, but found 1 + *At index 1: + *Expected item to be 1, but found 2 + *At index 1: + *Expected customer.Age to be less than 22, but found 22 + *Expected customer.Items to satisfy all inspectors, but some inspectors are not satisfied: + *At index 0: + *Expected item to be 2, but found 3 + """); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Xml/XElementFormatterSpecs.cs b/Tests/FluentAssertions.Specs/Xml/XElementFormatterSpecs.cs index 5542a49200..6d90cbce5d 100644 --- a/Tests/FluentAssertions.Specs/Xml/XElementFormatterSpecs.cs +++ b/Tests/FluentAssertions.Specs/Xml/XElementFormatterSpecs.cs @@ -21,10 +21,11 @@ public void When_element_has_attributes_it_should_include_them_in_the_output() public void When_element_has_child_element_it_should_not_include_them_in_the_output() { // Act - var element = XElement.Parse( - @" - - "); + var element = XElement.Parse(""" + + + + """); string result = Formatter.ToString(element); From 73af9e3edb1fc30d902cd0a24ab1128226fd046a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 15:18:35 +0000 Subject: [PATCH 282/845] Bump github-pages from 230 to 231 in /docs Bumps [github-pages](https://github.com/github/pages-gem) from 230 to 231. - [Release notes](https://github.com/github/pages-gem/releases) - [Commits](https://github.com/github/pages-gem/compare/v230...v231) --- updated-dependencies: - dependency-name: github-pages dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- docs/Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 88e3c933dc..2530974e8e 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - activesupport (7.1.3) + activesupport (7.1.3.2) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -42,7 +42,7 @@ GEM ffi (1.16.3-x64-mingw-ucrt) forwardable-extended (2.6.0) gemoji (4.1.0) - github-pages (230) + github-pages (231) github-pages-health-check (= 1.18.2) jekyll (= 3.9.5) jekyll-avatar (= 0.8.0) @@ -58,7 +58,7 @@ GEM jekyll-paginate (= 1.1.0) jekyll-readme-index (= 0.3.0) jekyll-redirect-from (= 0.16.0) - jekyll-relative-links (= 0.7.0) + jekyll-relative-links (= 0.6.1) jekyll-remote-theme (= 0.4.3) jekyll-sass-converter (= 1.5.2) jekyll-seo-tag (= 2.8.0) @@ -145,7 +145,7 @@ GEM jekyll (>= 3.0, < 5.0) jekyll-redirect-from (0.16.0) jekyll (>= 3.3, < 5.0) - jekyll-relative-links (0.7.0) + jekyll-relative-links (0.6.1) jekyll (>= 3.3, < 5.0) jekyll-remote-theme (0.4.3) addressable (~> 2.0) @@ -212,7 +212,7 @@ GEM kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) liquid (4.0.4) - listen (3.8.0) + listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.3.6) From e70248d67e26e312b457c0a87cb5b12bdb59827d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 15:18:50 +0000 Subject: [PATCH 283/845] Bump cspell from 8.4.0 to 8.4.1 Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 8.4.0 to 8.4.1. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/compare/v8.4.0...v8.4.1) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 191 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 98 insertions(+), 95 deletions(-) diff --git a/package-lock.json b/package-lock.json index 37831f56a4..4628ca8a16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.4.0" + "cspell": "^8.4.1" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.4.0.tgz", - "integrity": "sha512-eaDE8sen039fD8dCGQ3Hu6N4DWu/ZBuQocXhrx+8yfBEM1YaBsubKGdQUZrDGFcHenvaFJPq6aH84t3guYaVgA==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.4.1.tgz", + "integrity": "sha512-rOMupwDktbAAFfc6X/VCNl0nNFL7kH/G2KuZF3VCpXR6YR8FsQjbl1WLmEd0zVVeO+JWM99JcZS2OO/HAR3www==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.1", @@ -69,28 +69,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.4.0.tgz", - "integrity": "sha512-JH2qufHilC6xduDONe1QKHwA3a1ST+Nz+q+Vd0nUHZ53OBgk59vH9YfNk90ikjm/Cfocs/Wrz7TX2di1n8bHsA==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.4.1.tgz", + "integrity": "sha512-/IrWJeOBiGz4JvrYUan2zmmVACRCb0Nw9kM31QH4CkhVZ3vF2MeZ81gNaO9rPxNsm742EeJ2FYHmDhy/0T80Gg==", "dependencies": { - "@cspell/cspell-types": "8.4.0" + "@cspell/cspell-types": "8.4.1" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.4.0.tgz", - "integrity": "sha512-qHd01Lenjmipybt9CsfZcjEeU1aTsp0TpKmuxT+ixJ+fEYc/dfPyBxsCreKSo8jXw6GTkj86g3vcnhKc/QH5BQ==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.4.1.tgz", + "integrity": "sha512-xlIcZpqZni4eznazDIs1sJB38r0jH5nnbsLu0Y1LeRXmznyRv5xma6J/4jkQmVAsF2DmVWOqJeKwQqpVB5lHzw==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.4.0.tgz", - "integrity": "sha512-2WOuYzroYxXbrosYcbu2xpJZQU7ILOj57/dmlFu/3Z+bNnao/CfJ5aiRarqQrwA8qvCqQbAZPjJwf725IiO0lA==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.4.1.tgz", + "integrity": "sha512-rerJ013neN4NMw5EeJNmAiPdkHimwLndoEGhzQi9Yz7oCV78oq9wxK6H6UNZt8oveJG3Utj7hTYRzUyswKneNg==", "dependencies": { "global-directory": "^4.0.1" }, @@ -99,17 +99,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.4.0.tgz", - "integrity": "sha512-vl4iVrHW8kYa8LIDx7aMMX9q67w9Es4QiemWXlOObaOKNS95NBvQdE8r9x2wBKCGpZyMG5n6Nafla5mG9Bcpsg==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.4.1.tgz", + "integrity": "sha512-pr5bd5bM46vmD4UN/l1rS7VGCkgPTwrwBB+4IWYAztnDtOOoTzPtzIVBKbamaEru7Wabwna/lICntVlmiBNbhQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.4.0.tgz", - "integrity": "sha512-bxt1cX9hDiQ7E/ZvLv4Oq4jBPsEGzI5dH+EJ5NQOy64Edc92X7WLTYbMgu3t7cxkkwVnc7Iv48uBUdJrFsc9Ig==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.4.1.tgz", + "integrity": "sha512-z/bU98oLtii2xGKO5zYhpElAUUh6x6PmKPIulDfPu+3MItjLWdNxzD5OWNSg9iv0sZbWQCQ3lOMNX2EF+8QyUA==", "engines": { "node": ">=18" } @@ -185,9 +185,9 @@ "integrity": "sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q==" }, "node_modules/@cspell/dict-en_us": { - "version": "4.3.16", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.16.tgz", - "integrity": "sha512-fyNuAvYpkllmsMpfAJaMip250LRAnEDp2EZbkjYwAJXXjtgQ4/1yh6sLityxPMDtJZN65Eko+8rJzGJHez4zbA==" + "version": "4.3.17", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.17.tgz", + "integrity": "sha512-CS0Tb2f2YwQZ4VZ6+WLAO5uOzb0iO/iYSRl34kX4enq6quXxLYzwdfGAwv85wSYHPdga8tGiZFP+p8GPsi2JEg==" }, "node_modules/@cspell/dict-en-common-misspellings": { "version": "2.0.0", @@ -300,9 +300,9 @@ "integrity": "sha512-lEdzrcyau6mgzu1ie98GjOEegwVHvoaWtzQnm1ie4DyZgMr+N6D0Iyj1lzvtmt0snvsDFa5F2bsYzf3IMKcpcA==" }, "node_modules/@cspell/dict-public-licenses": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.5.tgz", - "integrity": "sha512-91HK4dSRri/HqzAypHgduRMarJAleOX5NugoI8SjDLPzWYkwZ1ftuCXSk+fy8DLc3wK7iOaFcZAvbjmnLhVs4A==" + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.6.tgz", + "integrity": "sha512-bHqpSpJvLCUcWxj1ov/Ki8WjmESpYwRpQlqfdchekOTc93Huhvjm/RXVN1R4fVf4Hspyem1QVkCGqAmjJMj6sw==" }, "node_modules/@cspell/dict-python": { "version": "4.1.11", @@ -363,9 +363,9 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.4.0.tgz", - "integrity": "sha512-GV6LFOsNvtBpMLY5a087YyHqehe1+a3mH+LvAwYO5gBZvh9te/rHx14e6/shEYNh59mM24lm7MLCaHhmP8dhyQ==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.4.1.tgz", + "integrity": "sha512-H+zZ7MpoiJyZ9zMdifsF/uBWOsovwWr40MBW+f1Tgpu2H6e3A1knRvxRy52fEK8eVhANrGVPVVZix4lI1XtBsw==", "dependencies": { "import-meta-resolve": "^4.0.0" }, @@ -374,9 +374,9 @@ } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.4.0.tgz", - "integrity": "sha512-R/fWW9S3oypKOTkxRZeJqcWl4f+v5w8Bejaj5rcRwztwAM/xdOGSelGhPdNnTazciINegbmTa4XiurUCN9E8Mg==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.4.1.tgz", + "integrity": "sha512-TWIA9SrtQTvpT+RN1RJUA2OWH1qNbjsjby8EmHteHjrueFr4a9nRxl4etQ1EoiGaBwt2w1w1iatnfpRY0U15Zg==", "engines": { "node": ">=18" } @@ -642,21 +642,21 @@ } }, "node_modules/cspell": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.4.0.tgz", - "integrity": "sha512-1PW0w51V9n6NApf8Jbfji09jyRg7gHDm4acn1UbOd+v3gkefuaofYeMyLyupY5igloeIukTkvi3mxo+vu0hpxg==", - "dependencies": { - "@cspell/cspell-json-reporter": "8.4.0", - "@cspell/cspell-pipe": "8.4.0", - "@cspell/cspell-types": "8.4.0", - "@cspell/dynamic-import": "8.4.0", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.4.1.tgz", + "integrity": "sha512-QoyUroQiMXak4bfVq1oM5PK78rO1R2/BbZMtZl4ZIFxWh2VapkYhK6tiG2wvK/wSD2jXe+n3UflD6CD8663dIw==", + "dependencies": { + "@cspell/cspell-json-reporter": "8.4.1", + "@cspell/cspell-pipe": "8.4.1", + "@cspell/cspell-types": "8.4.1", + "@cspell/dynamic-import": "8.4.1", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.0.0", - "cspell-gitignore": "8.4.0", - "cspell-glob": "8.4.0", - "cspell-io": "8.4.0", - "cspell-lib": "8.4.0", + "cspell-gitignore": "8.4.1", + "cspell-glob": "8.4.1", + "cspell-io": "8.4.1", + "cspell-lib": "8.4.1", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^8.0.0", @@ -677,11 +677,11 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.4.0.tgz", - "integrity": "sha512-lgvQrsOKTPfwjtkkyPTPQ/oC1y80wdSRqW9aiDl5OGVr6sGZz5lUC5oIHcu6jUOfiR7/CNPhIlVQ01faIW/5IA==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.4.1.tgz", + "integrity": "sha512-Z1Krm0LBp+qe7jewRH6nxHzoeFgDCqlkihGDh09Q37JIlBzxzIv3FIG/RFZ9qw9B4waU00G+dCvWmec8j1y08Q==", "dependencies": { - "@cspell/cspell-types": "8.4.0", + "@cspell/cspell-types": "8.4.1", "comment-json": "^4.2.3", "yaml": "^2.3.4" }, @@ -690,13 +690,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.4.0.tgz", - "integrity": "sha512-eibij29R+1IjdsFAkboMtcfiRxBc+uOcNevJNQmVkU8Mwlx2gUopG8e+a22P4b6ufFrBT6S+/UsGBZtHky+eew==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.4.1.tgz", + "integrity": "sha512-aN3Ei7MHQrG+EaAfBM3Y+w+KRuWTKxKsc2OYTEtgfLh6htxxdCzk/voA3OEHS8e+NXw2HMwrKmCPGGsKY9QkmA==", "dependencies": { - "@cspell/cspell-pipe": "8.4.0", - "@cspell/cspell-types": "8.4.0", - "cspell-trie-lib": "8.4.0", + "@cspell/cspell-pipe": "8.4.1", + "@cspell/cspell-types": "8.4.1", + "cspell-trie-lib": "8.4.1", "fast-equals": "^5.0.1", "gensequence": "^6.0.0" }, @@ -705,11 +705,11 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.4.0.tgz", - "integrity": "sha512-azFZRA04yXZlXUztgbtjhKk4ddKI3yEMz+wMN4yIhDYRG+rwQyng0tIv5b/Hw26ptDFBrW9Vnec9rnSXHzkVWA==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.4.1.tgz", + "integrity": "sha512-yVt1zHKp6XctEK8TgwYkgkpiAQQdiBlpG3PNGtyn2MDwsZkRMzVMhvugcLd6jeLGKl8S6rWA2CK7egmOQITwig==", "dependencies": { - "cspell-glob": "8.4.0", + "cspell-glob": "8.4.1", "find-up-simple": "^1.0.0" }, "bin": { @@ -720,9 +720,9 @@ } }, "node_modules/cspell-glob": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.4.0.tgz", - "integrity": "sha512-3KuqpdiDkLCUdjCEyXhyUyFgRlrF/LbGoQO5J8ZnO8hLQDxyaW/3sDRCp0q9Ec6HF+0C1/ECOdulx7C0VRcOMw==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.4.1.tgz", + "integrity": "sha512-W3kJPFpWO0L5XPMlJAiey0XfzdIG/bQFcQo2LgPX0ViGned2piH09F5aXpwSCfw2clGo4SWw0WYVOnTxMF89hg==", "dependencies": { "micromatch": "^4.0.5" }, @@ -731,12 +731,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.4.0.tgz", - "integrity": "sha512-0p7E55v9C9El2/jKrenEtOYVj3Rl+FeEM9QcJBxQ6IYX/7QnoCLth09/BacaZmQfawxzkPtRoXbwhH5472vAgw==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.4.1.tgz", + "integrity": "sha512-JRbCuKWY5Ja39zmPUQPHM7WnnX4ODQo4kBNk4NJGnrADvHyor6Z60YPqy45IRnt/Z7B4U7J+T8M6bHlLFk3f2w==", "dependencies": { - "@cspell/cspell-pipe": "8.4.0", - "@cspell/cspell-types": "8.4.0" + "@cspell/cspell-pipe": "8.4.1", + "@cspell/cspell-types": "8.4.1" }, "bin": { "cspell-grammar": "bin.mjs" @@ -746,36 +746,36 @@ } }, "node_modules/cspell-io": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.4.0.tgz", - "integrity": "sha512-CvC5XMJ4ENkdSZdhtJ6aJ7jez0PF9bAT0lGrSyGYId8fXS+lZ1jszllY3s4mSTdILVCDd8jVSSSogkqh6DKxUA==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.4.1.tgz", + "integrity": "sha512-FVOhg+rQP7YvX06t5to9oj83/COFnowW9J6ShY5Cp64s6yoQCTiPpTcKbHMiE4rwXpp5/FRAs86mr4jrR/zNUQ==", "dependencies": { - "@cspell/cspell-service-bus": "8.4.0" + "@cspell/cspell-service-bus": "8.4.1" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.4.0.tgz", - "integrity": "sha512-ZFd8a9NZXR0kGEIjMWoISXUj+buCaE9MGYbDi0sj1X1/YtHThC6nHWUwJvvT4fRa8iHT3fb6l5U0tyJFRV4Z7w==", - "dependencies": { - "@cspell/cspell-bundled-dicts": "8.4.0", - "@cspell/cspell-pipe": "8.4.0", - "@cspell/cspell-resolver": "8.4.0", - "@cspell/cspell-types": "8.4.0", - "@cspell/dynamic-import": "8.4.0", - "@cspell/strong-weak-map": "8.4.0", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.4.1.tgz", + "integrity": "sha512-R86NdkgyT4vCpBuNGd47WO9tNS2GQW8pGQZGdtqHcgf5gIl8U5tj4T0q0cQvR6WEsNTo+ElMf0GZ2TK3hXaZDg==", + "dependencies": { + "@cspell/cspell-bundled-dicts": "8.4.1", + "@cspell/cspell-pipe": "8.4.1", + "@cspell/cspell-resolver": "8.4.1", + "@cspell/cspell-types": "8.4.1", + "@cspell/dynamic-import": "8.4.1", + "@cspell/strong-weak-map": "8.4.1", "clear-module": "^4.1.2", "comment-json": "^4.2.3", "configstore": "^6.0.0", - "cspell-config-lib": "8.4.0", - "cspell-dictionary": "8.4.0", - "cspell-glob": "8.4.0", - "cspell-grammar": "8.4.0", - "cspell-io": "8.4.0", - "cspell-trie-lib": "8.4.0", + "cspell-config-lib": "8.4.1", + "cspell-dictionary": "8.4.1", + "cspell-glob": "8.4.1", + "cspell-grammar": "8.4.1", + "cspell-io": "8.4.1", + "cspell-trie-lib": "8.4.1", "fast-equals": "^5.0.1", "gensequence": "^6.0.0", "import-fresh": "^3.3.0", @@ -788,12 +788,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.4.0.tgz", - "integrity": "sha512-hsldLrvXnkjTPbhN2isDpJv3qLFWpmt0S3CFpQMUVo10f2CVrcRRXMXXjXnrlHBkMSDLx2eewUjLP2RifXJJyQ==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.4.1.tgz", + "integrity": "sha512-qKPfHWsZlH1aZYMhScbWpdBn1xccQO++UZ4YgYikyNOJNyPS7SAgGvVgT8wE3f++dGfM77QKUwgLLfe6/udbHA==", "dependencies": { - "@cspell/cspell-pipe": "8.4.0", - "@cspell/cspell-types": "8.4.0", + "@cspell/cspell-pipe": "8.4.1", + "@cspell/cspell-types": "8.4.1", "gensequence": "^6.0.0" }, "engines": { @@ -1693,9 +1693,12 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.0.tgz", + "integrity": "sha512-j9iR8g+/t0lArF4V6NE/QCfT+CO7iLqrXAHZbJdo+LfjqP1vR8Fg5bSiaq6Q2lOD1AUEVrEVIgABvBFYojJVYQ==", + "bin": { + "yaml": "bin.mjs" + }, "engines": { "node": ">= 14" } diff --git a/package.json b/package.json index 3d64423e9a..5284207141 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.4.0" + "cspell": "^8.4.1" } } From 889b771421f23cad9a43e6b5022315376c01017f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 16:29:18 +0000 Subject: [PATCH 284/845] bump coverlet.collector from 6.0.0 to 6.0.1 --- updated-dependencies: - dependency-name: coverlet.collector dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 2 +- Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 0d4c555b6f..3f2bb38139 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -16,7 +16,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 4a1ad6b1cd..ea2ec42334 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -34,7 +34,7 @@ runtime; build; native; contentfiles; analyzers - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index c5a1b09a84..938291c3a1 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -23,7 +23,7 @@ all runtime; build; native; contentfiles; analyzers - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index b8b21b77db..c0697779d7 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -33,7 +33,7 @@ runtime; build; native; contentfiles; analyzers - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index e2de0a1480..f509acad4c 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj index 3b42e48927..3156b53e75 100644 --- a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj +++ b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index dccc01d782..ea4473f10b 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index ecc9059e2c..c6186e612f 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index 665d86b16f..2c27c28fad 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index f3c123d082..5f2a3112de 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 8ffa2984cd182d128b9ef4a9e8efe6acc338153e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 16:19:29 +0000 Subject: [PATCH 285/845] bump Meziantou.Analyzer from 2.0.142 to 2.0.145 --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 8f787ea9f5..a1e16ff115 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 3cd92729a3463874e1c4ae08d285b0fcf99516d7 Mon Sep 17 00:00:00 2001 From: Paul Kirchner <98046631+PKirch-SE@users.noreply.github.com> Date: Sat, 2 Mar 2024 03:50:23 -0700 Subject: [PATCH 286/845] Correct spelling in 'Then' property summary xml documentation. (#2594) --- Src/FluentAssertions/Execution/Continuation.cs | 2 +- Src/FluentAssertions/Execution/ContinuationOfGiven.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/FluentAssertions/Execution/Continuation.cs b/Src/FluentAssertions/Execution/Continuation.cs index 42264aae15..b59ad7f4e7 100644 --- a/Src/FluentAssertions/Execution/Continuation.cs +++ b/Src/FluentAssertions/Execution/Continuation.cs @@ -15,7 +15,7 @@ internal Continuation(AssertionScope sourceScope, bool continueAsserting) } /// - /// Continuous the assertion chain if the previous assertion was successful. + /// Continues the assertion chain if the previous assertion was successful. /// public IAssertionScope Then { diff --git a/Src/FluentAssertions/Execution/ContinuationOfGiven.cs b/Src/FluentAssertions/Execution/ContinuationOfGiven.cs index f080c83d08..47ca54a889 100644 --- a/Src/FluentAssertions/Execution/ContinuationOfGiven.cs +++ b/Src/FluentAssertions/Execution/ContinuationOfGiven.cs @@ -14,7 +14,7 @@ internal ContinuationOfGiven(GivenSelector parent, bool succeeded) } /// - /// Continuous the assertion chain if the previous assertion was successful. + /// Continues the assertion chain if the previous assertion was successful. /// public GivenSelector Then { get; } From 587cab7ad1b516b535d740bad7a57e2d252d60a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 18:30:57 +0100 Subject: [PATCH 287/845] Bump Bogus from 35.4.0 to 35.4.1 (#2600) Bumps [Bogus](https://github.com/bchavez/Bogus) from 35.4.0 to 35.4.1. - [Release notes](https://github.com/bchavez/Bogus/releases) - [Changelog](https://github.com/bchavez/Bogus/blob/master/HISTORY.md) - [Commits](https://github.com/bchavez/Bogus/compare/v35.4.0...v35.4.1) --- updated-dependencies: - dependency-name: Bogus dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Benchmarks/Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index e25ba09b24..24bcd95d60 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -10,7 +10,7 @@ - + From 4abd32a2a86ae8c7e3df3818509c3a7503766209 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 18:42:51 +0100 Subject: [PATCH 288/845] Bump cspell from 8.4.1 to 8.5.0 (#2601) Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 8.4.1 to 8.5.0. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/compare/v8.4.1...v8.5.0) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 190 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 96 insertions(+), 96 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4628ca8a16..8f974da38a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.4.1" + "cspell": "^8.5.0" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.4.1.tgz", - "integrity": "sha512-rOMupwDktbAAFfc6X/VCNl0nNFL7kH/G2KuZF3VCpXR6YR8FsQjbl1WLmEd0zVVeO+JWM99JcZS2OO/HAR3www==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.5.0.tgz", + "integrity": "sha512-bwiu+D3UZlLn4buaehtkn8BuVEMtJcmfudci5/NmbuSwS1ayzl17T76D4R2e1kalad0cR+yYMrd+eshMx3loaw==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.1", @@ -28,7 +28,7 @@ "@cspell/dict-docker": "^1.1.7", "@cspell/dict-dotnet": "^5.0.0", "@cspell/dict-elixir": "^4.0.3", - "@cspell/dict-en_us": "^4.3.16", + "@cspell/dict-en_us": "^4.3.17", "@cspell/dict-en-common-misspellings": "^2.0.0", "@cspell/dict-en-gb": "1.1.33", "@cspell/dict-filetypes": "^3.0.3", @@ -51,7 +51,7 @@ "@cspell/dict-npm": "^5.0.15", "@cspell/dict-php": "^4.0.6", "@cspell/dict-powershell": "^5.0.3", - "@cspell/dict-public-licenses": "^2.0.5", + "@cspell/dict-public-licenses": "^2.0.6", "@cspell/dict-python": "^4.1.11", "@cspell/dict-r": "^2.0.1", "@cspell/dict-ruby": "^5.0.2", @@ -69,28 +69,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.4.1.tgz", - "integrity": "sha512-/IrWJeOBiGz4JvrYUan2zmmVACRCb0Nw9kM31QH4CkhVZ3vF2MeZ81gNaO9rPxNsm742EeJ2FYHmDhy/0T80Gg==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.5.0.tgz", + "integrity": "sha512-9oQWdQYZP+z3GHyKj0yrfDEOd3oVAkPLxfBrELdk1+igFl63jSYz3TyH0/x07yhEQtjdb2K7Vem58mP1mXQlUg==", "dependencies": { - "@cspell/cspell-types": "8.4.1" + "@cspell/cspell-types": "8.5.0" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.4.1.tgz", - "integrity": "sha512-xlIcZpqZni4eznazDIs1sJB38r0jH5nnbsLu0Y1LeRXmznyRv5xma6J/4jkQmVAsF2DmVWOqJeKwQqpVB5lHzw==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.5.0.tgz", + "integrity": "sha512-PDg6TgH4COs/v5dq+Isfxzk8omuJ86bZBR9UCuK2zwn5EsGouAPsdcFoNLcEdDkjKLObGzM0o9XSj0/TdaOmIQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.4.1.tgz", - "integrity": "sha512-rerJ013neN4NMw5EeJNmAiPdkHimwLndoEGhzQi9Yz7oCV78oq9wxK6H6UNZt8oveJG3Utj7hTYRzUyswKneNg==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.5.0.tgz", + "integrity": "sha512-zv1lk21OneXuAF4wWe1eEw9zTMJCRUQifslM3IuzfcpahttgjLSfCiFv0x58YqCwtY7hD4M+vwXHmxV5p1Q/5g==", "dependencies": { "global-directory": "^4.0.1" }, @@ -99,17 +99,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.4.1.tgz", - "integrity": "sha512-pr5bd5bM46vmD4UN/l1rS7VGCkgPTwrwBB+4IWYAztnDtOOoTzPtzIVBKbamaEru7Wabwna/lICntVlmiBNbhQ==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.5.0.tgz", + "integrity": "sha512-GnCK2jSWflvvHUurwCxVxJpupr3G1xAUeUNG1R3+sFRF51/kZ2ZtjJxUOby1a3lyHLBte4o6N3GbqxFFvh27nw==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.4.1.tgz", - "integrity": "sha512-z/bU98oLtii2xGKO5zYhpElAUUh6x6PmKPIulDfPu+3MItjLWdNxzD5OWNSg9iv0sZbWQCQ3lOMNX2EF+8QyUA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.5.0.tgz", + "integrity": "sha512-2C7BFF9TzQsA0972/TriDRtwD5X1UUuSNWZ/NCpWzgZAw9JXmTIXj6D5QQWq2fcQ2KzcKaEeL6TanOl2iZfxlA==", "engines": { "node": ">=18" } @@ -363,9 +363,9 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.4.1.tgz", - "integrity": "sha512-H+zZ7MpoiJyZ9zMdifsF/uBWOsovwWr40MBW+f1Tgpu2H6e3A1knRvxRy52fEK8eVhANrGVPVVZix4lI1XtBsw==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.5.0.tgz", + "integrity": "sha512-IBrPx+Eo1yZF43oY4Iy5ESGsVkhHrfbYNcOAwfE3IJm2lbuWkR1aWIuWA/b69O88e/G0dEOFAlPfztrZVDG/Qw==", "dependencies": { "import-meta-resolve": "^4.0.0" }, @@ -374,9 +374,9 @@ } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.4.1.tgz", - "integrity": "sha512-TWIA9SrtQTvpT+RN1RJUA2OWH1qNbjsjby8EmHteHjrueFr4a9nRxl4etQ1EoiGaBwt2w1w1iatnfpRY0U15Zg==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.5.0.tgz", + "integrity": "sha512-9pmhmYJVOUtO4G3mtSI0qjgxGQsz6rbFjm5dewolIEK+8rha3rcrlBqXy/h6RDgLVuBfA7kEcBZQ70wzEwETwA==", "engines": { "node": ">=18" } @@ -642,21 +642,21 @@ } }, "node_modules/cspell": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.4.1.tgz", - "integrity": "sha512-QoyUroQiMXak4bfVq1oM5PK78rO1R2/BbZMtZl4ZIFxWh2VapkYhK6tiG2wvK/wSD2jXe+n3UflD6CD8663dIw==", - "dependencies": { - "@cspell/cspell-json-reporter": "8.4.1", - "@cspell/cspell-pipe": "8.4.1", - "@cspell/cspell-types": "8.4.1", - "@cspell/dynamic-import": "8.4.1", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.5.0.tgz", + "integrity": "sha512-Kg10itkOZKoIcKE2KSQWVVt0Yo2pssvd66kuzo5S3x7lc25yggz8W+piHzUH99E2aNQ7CTzH7H78ReI53pt4tA==", + "dependencies": { + "@cspell/cspell-json-reporter": "8.5.0", + "@cspell/cspell-pipe": "8.5.0", + "@cspell/cspell-types": "8.5.0", + "@cspell/dynamic-import": "8.5.0", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.0.0", - "cspell-gitignore": "8.4.1", - "cspell-glob": "8.4.1", - "cspell-io": "8.4.1", - "cspell-lib": "8.4.1", + "cspell-gitignore": "8.5.0", + "cspell-glob": "8.5.0", + "cspell-io": "8.5.0", + "cspell-lib": "8.5.0", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^8.0.0", @@ -677,39 +677,39 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.4.1.tgz", - "integrity": "sha512-Z1Krm0LBp+qe7jewRH6nxHzoeFgDCqlkihGDh09Q37JIlBzxzIv3FIG/RFZ9qw9B4waU00G+dCvWmec8j1y08Q==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.5.0.tgz", + "integrity": "sha512-J89uUFPANN4R+uwRh2WP4PYe9sVYbtKVzyJ53nPehv0RlJ+6XiQyqu6dnsT9rAjqHaAwf57iPBkMJiDir103eA==", "dependencies": { - "@cspell/cspell-types": "8.4.1", + "@cspell/cspell-types": "8.5.0", "comment-json": "^4.2.3", - "yaml": "^2.3.4" + "yaml": "^2.4.0" }, "engines": { "node": ">=18" } }, "node_modules/cspell-dictionary": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.4.1.tgz", - "integrity": "sha512-aN3Ei7MHQrG+EaAfBM3Y+w+KRuWTKxKsc2OYTEtgfLh6htxxdCzk/voA3OEHS8e+NXw2HMwrKmCPGGsKY9QkmA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.5.0.tgz", + "integrity": "sha512-cr8wnSdfkNWtWsstZgTtvMNBns+pVHYMXwLWQ05VC6KyXfNW5zWNThrvzmaL9bLLXIUUOUkC2WWVa8bD20RcmQ==", "dependencies": { - "@cspell/cspell-pipe": "8.4.1", - "@cspell/cspell-types": "8.4.1", - "cspell-trie-lib": "8.4.1", + "@cspell/cspell-pipe": "8.5.0", + "@cspell/cspell-types": "8.5.0", + "cspell-trie-lib": "8.5.0", "fast-equals": "^5.0.1", - "gensequence": "^6.0.0" + "gensequence": "^7.0.0" }, "engines": { "node": ">=18" } }, "node_modules/cspell-gitignore": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.4.1.tgz", - "integrity": "sha512-yVt1zHKp6XctEK8TgwYkgkpiAQQdiBlpG3PNGtyn2MDwsZkRMzVMhvugcLd6jeLGKl8S6rWA2CK7egmOQITwig==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.5.0.tgz", + "integrity": "sha512-dWZp915edBaDImGmUhqFC1fqn4dmadGBefarcwFPCfowC3HX06Ac2/mfQ6SsdKzGif6Hahf44i3cupyJCCgagg==", "dependencies": { - "cspell-glob": "8.4.1", + "cspell-glob": "8.5.0", "find-up-simple": "^1.0.0" }, "bin": { @@ -720,9 +720,9 @@ } }, "node_modules/cspell-glob": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.4.1.tgz", - "integrity": "sha512-W3kJPFpWO0L5XPMlJAiey0XfzdIG/bQFcQo2LgPX0ViGned2piH09F5aXpwSCfw2clGo4SWw0WYVOnTxMF89hg==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.5.0.tgz", + "integrity": "sha512-jvEGCwToql//WAAyoaOP+GtYAMyfjTkqOMSxZ0tMbj2T4TEC/xUH2/tTI8Xug3PDOr5a3J75inSzl9tC8ZVtWQ==", "dependencies": { "micromatch": "^4.0.5" }, @@ -731,12 +731,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.4.1.tgz", - "integrity": "sha512-JRbCuKWY5Ja39zmPUQPHM7WnnX4ODQo4kBNk4NJGnrADvHyor6Z60YPqy45IRnt/Z7B4U7J+T8M6bHlLFk3f2w==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.5.0.tgz", + "integrity": "sha512-29U4KFThztK9LBPrcdLJLld3uWIEAg8M5umfwrkDoGQA0jtdBe+4895rGuth4QcPxMT1jxn7cInv199Hx2R4XQ==", "dependencies": { - "@cspell/cspell-pipe": "8.4.1", - "@cspell/cspell-types": "8.4.1" + "@cspell/cspell-pipe": "8.5.0", + "@cspell/cspell-types": "8.5.0" }, "bin": { "cspell-grammar": "bin.mjs" @@ -746,38 +746,38 @@ } }, "node_modules/cspell-io": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.4.1.tgz", - "integrity": "sha512-FVOhg+rQP7YvX06t5to9oj83/COFnowW9J6ShY5Cp64s6yoQCTiPpTcKbHMiE4rwXpp5/FRAs86mr4jrR/zNUQ==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.5.0.tgz", + "integrity": "sha512-XiAhF/nX2M8xUX9OqXoGixePTmy7s0+Bfg07+nGTDKhLj0Ydpg/asxWVkd//YAX9kkpU3YukDon4Q4km95WgiA==", "dependencies": { - "@cspell/cspell-service-bus": "8.4.1" + "@cspell/cspell-service-bus": "8.5.0" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.4.1.tgz", - "integrity": "sha512-R86NdkgyT4vCpBuNGd47WO9tNS2GQW8pGQZGdtqHcgf5gIl8U5tj4T0q0cQvR6WEsNTo+ElMf0GZ2TK3hXaZDg==", - "dependencies": { - "@cspell/cspell-bundled-dicts": "8.4.1", - "@cspell/cspell-pipe": "8.4.1", - "@cspell/cspell-resolver": "8.4.1", - "@cspell/cspell-types": "8.4.1", - "@cspell/dynamic-import": "8.4.1", - "@cspell/strong-weak-map": "8.4.1", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.5.0.tgz", + "integrity": "sha512-TSi2K8Xf7Ptti6EtSeG6A9kTaleMNwcayjXTBxsiCoVnW/bSTQ7cSzuO2JqT3wUK54XUu4HullTgoUv/tvqjCg==", + "dependencies": { + "@cspell/cspell-bundled-dicts": "8.5.0", + "@cspell/cspell-pipe": "8.5.0", + "@cspell/cspell-resolver": "8.5.0", + "@cspell/cspell-types": "8.5.0", + "@cspell/dynamic-import": "8.5.0", + "@cspell/strong-weak-map": "8.5.0", "clear-module": "^4.1.2", "comment-json": "^4.2.3", "configstore": "^6.0.0", - "cspell-config-lib": "8.4.1", - "cspell-dictionary": "8.4.1", - "cspell-glob": "8.4.1", - "cspell-grammar": "8.4.1", - "cspell-io": "8.4.1", - "cspell-trie-lib": "8.4.1", + "cspell-config-lib": "8.5.0", + "cspell-dictionary": "8.5.0", + "cspell-glob": "8.5.0", + "cspell-grammar": "8.5.0", + "cspell-io": "8.5.0", + "cspell-trie-lib": "8.5.0", "fast-equals": "^5.0.1", - "gensequence": "^6.0.0", + "gensequence": "^7.0.0", "import-fresh": "^3.3.0", "resolve-from": "^5.0.0", "vscode-languageserver-textdocument": "^1.0.11", @@ -788,13 +788,13 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.4.1.tgz", - "integrity": "sha512-qKPfHWsZlH1aZYMhScbWpdBn1xccQO++UZ4YgYikyNOJNyPS7SAgGvVgT8wE3f++dGfM77QKUwgLLfe6/udbHA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.5.0.tgz", + "integrity": "sha512-RPKhJowuGpUc21GpREE9fdpds5JqdUmF1A/GXeFFzo1rwDiWA0Ojt60A72R90t2vygkAnD+kKtQkWX3LSoT3pQ==", "dependencies": { - "@cspell/cspell-pipe": "8.4.1", - "@cspell/cspell-types": "8.4.1", - "gensequence": "^6.0.0" + "@cspell/cspell-pipe": "8.5.0", + "@cspell/cspell-types": "8.5.0", + "gensequence": "^7.0.0" }, "engines": { "node": ">=18" @@ -961,11 +961,11 @@ } }, "node_modules/gensequence": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/gensequence/-/gensequence-6.0.0.tgz", - "integrity": "sha512-8WwuywE9pokJRAcg2QFR/plk3cVPebSUqRPzpGQh3WQ0wIiHAw+HyOQj5IuHyUTQBHpBKFoB2JUMu9zT3vJ16Q==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/gensequence/-/gensequence-7.0.0.tgz", + "integrity": "sha512-47Frx13aZh01afHJTB3zTtKIlFI6vWY+MYCN9Qpew6i52rfKjnhCF/l1YlC8UmEMvvntZZ6z4PiCcmyuedR2aQ==", "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/get-stdin": { diff --git a/package.json b/package.json index 5284207141..b98c1eece3 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.4.1" + "cspell": "^8.5.0" } } From 3c0603ace3bda46731a788a31f3a2f3c99bde1ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 15:11:17 +0000 Subject: [PATCH 289/845] Bump cspell from 8.5.0 to 8.6.0 Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 8.5.0 to 8.6.0. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/compare/v8.5.0...v8.6.0) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 176 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 89 insertions(+), 89 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8f974da38a..f17ffa47b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.5.0" + "cspell": "^8.6.0" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.5.0.tgz", - "integrity": "sha512-bwiu+D3UZlLn4buaehtkn8BuVEMtJcmfudci5/NmbuSwS1ayzl17T76D4R2e1kalad0cR+yYMrd+eshMx3loaw==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.6.0.tgz", + "integrity": "sha512-hRVvir4G4276Kz/Cru34AJg1FObIw5MrzezAwHkD3obNMwZkof8aX3MEN6AzWusJSVG2ZxZxZAEnYbgqvGr2Fg==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.1", @@ -69,28 +69,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.5.0.tgz", - "integrity": "sha512-9oQWdQYZP+z3GHyKj0yrfDEOd3oVAkPLxfBrELdk1+igFl63jSYz3TyH0/x07yhEQtjdb2K7Vem58mP1mXQlUg==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.6.0.tgz", + "integrity": "sha512-fPpE4a3zpdfwgTyfLgCmxZn4owkZ4IP6A/oL4XLW22IxW5xBIbXEveOSY+uiWAnVfEnqfrMNRLAGj7JoXnJ1Vg==", "dependencies": { - "@cspell/cspell-types": "8.5.0" + "@cspell/cspell-types": "8.6.0" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.5.0.tgz", - "integrity": "sha512-PDg6TgH4COs/v5dq+Isfxzk8omuJ86bZBR9UCuK2zwn5EsGouAPsdcFoNLcEdDkjKLObGzM0o9XSj0/TdaOmIQ==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.6.0.tgz", + "integrity": "sha512-gbAZksz38OHaN8s4fOmmgtgQfie1K8dRGlo9z/uxSx5FIELV48GWTbHn9t1TY2yBXBwJ7+4NF2+r624rtlPoHQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.5.0.tgz", - "integrity": "sha512-zv1lk21OneXuAF4wWe1eEw9zTMJCRUQifslM3IuzfcpahttgjLSfCiFv0x58YqCwtY7hD4M+vwXHmxV5p1Q/5g==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.6.0.tgz", + "integrity": "sha512-ARwO6TWKy8fLHNhC/ls5Wo/AK86E1oLVChwWtHdq7eVyEUIykQaXGLqoRThkIT2jyLfGDrhSvaU+yqcXVLE48Q==", "dependencies": { "global-directory": "^4.0.1" }, @@ -99,17 +99,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.5.0.tgz", - "integrity": "sha512-GnCK2jSWflvvHUurwCxVxJpupr3G1xAUeUNG1R3+sFRF51/kZ2ZtjJxUOby1a3lyHLBte4o6N3GbqxFFvh27nw==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.6.0.tgz", + "integrity": "sha512-veCGlhlNGmYMgzX/rMiDp8j7ndLxFHIZq3h6DNlIsIoSjP1v5Rk6UcCwEoWYexwKmNXo7c2VooB0GM9LSBcPAQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.5.0.tgz", - "integrity": "sha512-2C7BFF9TzQsA0972/TriDRtwD5X1UUuSNWZ/NCpWzgZAw9JXmTIXj6D5QQWq2fcQ2KzcKaEeL6TanOl2iZfxlA==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.6.0.tgz", + "integrity": "sha512-+CU/nuFOpswJAA3IS2TcKGskfM/o/4aNG1IMUVaOEQi1Sc5qZQ4Wj1qDIWJArSHFYW1Q4XFa4U8K1jnVHkAhZQ==", "engines": { "node": ">=18" } @@ -363,9 +363,9 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.5.0.tgz", - "integrity": "sha512-IBrPx+Eo1yZF43oY4Iy5ESGsVkhHrfbYNcOAwfE3IJm2lbuWkR1aWIuWA/b69O88e/G0dEOFAlPfztrZVDG/Qw==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.6.0.tgz", + "integrity": "sha512-yDJZ/uXCpZcAkXwaWa0JcCZHZFxnF3qtiFiq2WG5cEw8tiJiNdawjSCd8/D35dT3QFNaInMP+H3sOf68dNueew==", "dependencies": { "import-meta-resolve": "^4.0.0" }, @@ -374,9 +374,9 @@ } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.5.0.tgz", - "integrity": "sha512-9pmhmYJVOUtO4G3mtSI0qjgxGQsz6rbFjm5dewolIEK+8rha3rcrlBqXy/h6RDgLVuBfA7kEcBZQ70wzEwETwA==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.6.0.tgz", + "integrity": "sha512-QenBOdIT1zRa0kF3Z1mwObcvmdhxn+rzQDdmkxwSyRB/9KsNnib6XXTUo8P+Z/ZKXOYbP9Wmf4FX+vKd3yVX0Q==", "engines": { "node": ">=18" } @@ -642,21 +642,21 @@ } }, "node_modules/cspell": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.5.0.tgz", - "integrity": "sha512-Kg10itkOZKoIcKE2KSQWVVt0Yo2pssvd66kuzo5S3x7lc25yggz8W+piHzUH99E2aNQ7CTzH7H78ReI53pt4tA==", - "dependencies": { - "@cspell/cspell-json-reporter": "8.5.0", - "@cspell/cspell-pipe": "8.5.0", - "@cspell/cspell-types": "8.5.0", - "@cspell/dynamic-import": "8.5.0", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.6.0.tgz", + "integrity": "sha512-aAaVD3v1105OQePCpcdYkHnHxxkxKxxQzFcfJ4tKsH06dlW04Sp1oQLlsjgWDa3y6cdYTpSYj1eSenavBvfOFg==", + "dependencies": { + "@cspell/cspell-json-reporter": "8.6.0", + "@cspell/cspell-pipe": "8.6.0", + "@cspell/cspell-types": "8.6.0", + "@cspell/dynamic-import": "8.6.0", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.0.0", - "cspell-gitignore": "8.5.0", - "cspell-glob": "8.5.0", - "cspell-io": "8.5.0", - "cspell-lib": "8.5.0", + "cspell-gitignore": "8.6.0", + "cspell-glob": "8.6.0", + "cspell-io": "8.6.0", + "cspell-lib": "8.6.0", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^8.0.0", @@ -677,11 +677,11 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.5.0.tgz", - "integrity": "sha512-J89uUFPANN4R+uwRh2WP4PYe9sVYbtKVzyJ53nPehv0RlJ+6XiQyqu6dnsT9rAjqHaAwf57iPBkMJiDir103eA==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.6.0.tgz", + "integrity": "sha512-Q1rvQFUDJTu4hUtxwL6+q83Hjx/a5grEjMS5axxFJzjJuFRbRsXCagncdSCx/YBqLkNM5noBbRP/0rVh7ufqxw==", "dependencies": { - "@cspell/cspell-types": "8.5.0", + "@cspell/cspell-types": "8.6.0", "comment-json": "^4.2.3", "yaml": "^2.4.0" }, @@ -690,13 +690,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.5.0.tgz", - "integrity": "sha512-cr8wnSdfkNWtWsstZgTtvMNBns+pVHYMXwLWQ05VC6KyXfNW5zWNThrvzmaL9bLLXIUUOUkC2WWVa8bD20RcmQ==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.6.0.tgz", + "integrity": "sha512-ohToeOQznIrb2/z7RfKxX3NID0WiO4sXK3IxKdnbn2viGgdn17tQ8Z2f4Xuy9egjSGRKyr6N25Z5AOes1C8R3w==", "dependencies": { - "@cspell/cspell-pipe": "8.5.0", - "@cspell/cspell-types": "8.5.0", - "cspell-trie-lib": "8.5.0", + "@cspell/cspell-pipe": "8.6.0", + "@cspell/cspell-types": "8.6.0", + "cspell-trie-lib": "8.6.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0" }, @@ -705,11 +705,11 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.5.0.tgz", - "integrity": "sha512-dWZp915edBaDImGmUhqFC1fqn4dmadGBefarcwFPCfowC3HX06Ac2/mfQ6SsdKzGif6Hahf44i3cupyJCCgagg==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.6.0.tgz", + "integrity": "sha512-6INRlNb17iKtQH7NmDM/EsX5OZOD2TzIwHiJnnWci0Y5l10V/zN9WGLDegTjMh9HU3TS6uUuN4I/ffkCs9m+LA==", "dependencies": { - "cspell-glob": "8.5.0", + "cspell-glob": "8.6.0", "find-up-simple": "^1.0.0" }, "bin": { @@ -720,9 +720,9 @@ } }, "node_modules/cspell-glob": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.5.0.tgz", - "integrity": "sha512-jvEGCwToql//WAAyoaOP+GtYAMyfjTkqOMSxZ0tMbj2T4TEC/xUH2/tTI8Xug3PDOr5a3J75inSzl9tC8ZVtWQ==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.6.0.tgz", + "integrity": "sha512-AyuExc34F8JsEYNl4inx1m1v5VoSRA/cTptREq/AoNTcMTyG5s+wt5J+VWBfvJjEDEEpd9Cb2it0j8TMo/Tpjw==", "dependencies": { "micromatch": "^4.0.5" }, @@ -731,12 +731,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.5.0.tgz", - "integrity": "sha512-29U4KFThztK9LBPrcdLJLld3uWIEAg8M5umfwrkDoGQA0jtdBe+4895rGuth4QcPxMT1jxn7cInv199Hx2R4XQ==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.6.0.tgz", + "integrity": "sha512-wVpZ4pPOqRoOmzLUc34wyOQnBi/6RsV3Y1KiPn8BNSkObb9XSohb1xJJMJ69unEmgE0snQDMHIeUaLTQH414MA==", "dependencies": { - "@cspell/cspell-pipe": "8.5.0", - "@cspell/cspell-types": "8.5.0" + "@cspell/cspell-pipe": "8.6.0", + "@cspell/cspell-types": "8.6.0" }, "bin": { "cspell-grammar": "bin.mjs" @@ -746,36 +746,36 @@ } }, "node_modules/cspell-io": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.5.0.tgz", - "integrity": "sha512-XiAhF/nX2M8xUX9OqXoGixePTmy7s0+Bfg07+nGTDKhLj0Ydpg/asxWVkd//YAX9kkpU3YukDon4Q4km95WgiA==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.6.0.tgz", + "integrity": "sha512-jx7ccRpcshqxN6xnOiGnX4VycaqTpmatRjHITn4vLoDmQNfxQeU69YT62bhyjogCBuJsZS9ksjo7GQIsrYBekA==", "dependencies": { - "@cspell/cspell-service-bus": "8.5.0" + "@cspell/cspell-service-bus": "8.6.0" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.5.0.tgz", - "integrity": "sha512-TSi2K8Xf7Ptti6EtSeG6A9kTaleMNwcayjXTBxsiCoVnW/bSTQ7cSzuO2JqT3wUK54XUu4HullTgoUv/tvqjCg==", - "dependencies": { - "@cspell/cspell-bundled-dicts": "8.5.0", - "@cspell/cspell-pipe": "8.5.0", - "@cspell/cspell-resolver": "8.5.0", - "@cspell/cspell-types": "8.5.0", - "@cspell/dynamic-import": "8.5.0", - "@cspell/strong-weak-map": "8.5.0", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.6.0.tgz", + "integrity": "sha512-l1bBxBz8noPOxEIIu1Ahvd4e/j6Re1PNDD9FwZgaRmvMyIPZbupTxzCM0MZWvYz1VymBmrrVEKRwtZ34VocaCw==", + "dependencies": { + "@cspell/cspell-bundled-dicts": "8.6.0", + "@cspell/cspell-pipe": "8.6.0", + "@cspell/cspell-resolver": "8.6.0", + "@cspell/cspell-types": "8.6.0", + "@cspell/dynamic-import": "8.6.0", + "@cspell/strong-weak-map": "8.6.0", "clear-module": "^4.1.2", "comment-json": "^4.2.3", "configstore": "^6.0.0", - "cspell-config-lib": "8.5.0", - "cspell-dictionary": "8.5.0", - "cspell-glob": "8.5.0", - "cspell-grammar": "8.5.0", - "cspell-io": "8.5.0", - "cspell-trie-lib": "8.5.0", + "cspell-config-lib": "8.6.0", + "cspell-dictionary": "8.6.0", + "cspell-glob": "8.6.0", + "cspell-grammar": "8.6.0", + "cspell-io": "8.6.0", + "cspell-trie-lib": "8.6.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", "import-fresh": "^3.3.0", @@ -788,12 +788,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.5.0.tgz", - "integrity": "sha512-RPKhJowuGpUc21GpREE9fdpds5JqdUmF1A/GXeFFzo1rwDiWA0Ojt60A72R90t2vygkAnD+kKtQkWX3LSoT3pQ==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.6.0.tgz", + "integrity": "sha512-S8nGCnEJBL1maiKPd3FhI54QG+OgtOkcJ/yUDXGXGrokSruWFdNocioPirlFAHf959ax1GBUVEYNIgnu/EIWNg==", "dependencies": { - "@cspell/cspell-pipe": "8.5.0", - "@cspell/cspell-types": "8.5.0", + "@cspell/cspell-pipe": "8.6.0", + "@cspell/cspell-types": "8.6.0", "gensequence": "^7.0.0" }, "engines": { @@ -1693,9 +1693,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yaml": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.0.tgz", - "integrity": "sha512-j9iR8g+/t0lArF4V6NE/QCfT+CO7iLqrXAHZbJdo+LfjqP1vR8Fg5bSiaq6Q2lOD1AUEVrEVIgABvBFYojJVYQ==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.1.tgz", + "integrity": "sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==", "bin": { "yaml": "bin.mjs" }, diff --git a/package.json b/package.json index b98c1eece3..8dab92b1af 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.5.0" + "cspell": "^8.6.0" } } From e969354869d5ba62dba0d0acf2239d05ccf38e19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 15:59:01 +0000 Subject: [PATCH 290/845] Bump Bogus from 35.4.1 to 35.5.0 Bumps [Bogus](https://github.com/bchavez/Bogus) from 35.4.1 to 35.5.0. - [Release notes](https://github.com/bchavez/Bogus/releases) - [Changelog](https://github.com/bchavez/Bogus/blob/master/HISTORY.md) - [Commits](https://github.com/bchavez/Bogus/compare/v35.4.1...v35.5.0) --- updated-dependencies: - dependency-name: Bogus dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Tests/Benchmarks/Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index 24bcd95d60..ab229fee85 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -10,7 +10,7 @@ - + From 05cb9869a02e08eb9da33d7ca4973e7f57d62d70 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 15:46:23 +0000 Subject: [PATCH 291/845] Bump Meziantou.Analyzer from 2.0.145 to 2.0.146 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.145 to 2.0.146. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.145...2.0.146) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index a1e16ff115..86a6f88ad6 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From b0458446a2e78b79686260a0e5d579dbde07d84f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 15:50:46 +0000 Subject: [PATCH 292/845] Bump coverlet.collector from 6.0.1 to 6.0.2 Bumps [coverlet.collector](https://github.com/coverlet-coverage/coverlet) from 6.0.1 to 6.0.2. - [Release notes](https://github.com/coverlet-coverage/coverlet/releases) - [Commits](https://github.com/coverlet-coverage/coverlet/compare/v6.0.1...v6.0.2) --- updated-dependencies: - dependency-name: coverlet.collector dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 2 +- Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 3f2bb38139..58e3564623 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -16,7 +16,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index ea2ec42334..4a812c12ab 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -34,7 +34,7 @@ runtime; build; native; contentfiles; analyzers - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 938291c3a1..dca66d81da 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -23,7 +23,7 @@ all runtime; build; native; contentfiles; analyzers - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index c0697779d7..61eb7ee858 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -33,7 +33,7 @@ runtime; build; native; contentfiles; analyzers - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index f509acad4c..74c39c5461 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj index 3156b53e75..435348227f 100644 --- a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj +++ b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index ea4473f10b..dbc83d0bad 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index c6186e612f..576e2bd63e 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index 2c27c28fad..9bea9f502f 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 5f2a3112de..e898ccbc61 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 1dc38aedff72da65f7affe5d797b684410cde895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Rocheleau?= <71142100+arocheleau@users.noreply.github.com> Date: Tue, 19 Mar 2024 12:45:55 -0400 Subject: [PATCH 293/845] Add BeNaN and NotBeNaN assertions (#2606) --- .../NumericAssertionsExtensions.cs | 202 ++++++++ .../FluentAssertions/net47.verified.txt | 8 + .../FluentAssertions/net6.0.verified.txt | 8 + .../netstandard2.0.verified.txt | 8 + .../netstandard2.1.verified.txt | 8 + .../Numeric/NumericAssertionSpecs.BeNaN.cs | 442 ++++++++++++++++++ docs/_pages/numerictypes.md | 14 + docs/_pages/releases.md | 3 +- 8 files changed, 692 insertions(+), 1 deletion(-) create mode 100644 Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeNaN.cs diff --git a/Src/FluentAssertions/NumericAssertionsExtensions.cs b/Src/FluentAssertions/NumericAssertionsExtensions.cs index 4bb65302f8..1a4e1cd63b 100644 --- a/Src/FluentAssertions/NumericAssertionsExtensions.cs +++ b/Src/FluentAssertions/NumericAssertionsExtensions.cs @@ -1481,6 +1481,208 @@ private static void FailIfDifferenceWithinPrecision( #endregion + #region BeNaN + + /// + /// Asserts that the number is seen as not a number (NaN). + /// + /// + /// 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 static AndConstraint> BeNaN(this NumericAssertions parent, + string because = "", + params object[] becauseArgs) + { + float actualValue = parent.Subject.Value; + + Execute.Assertion + .ForCondition(float.IsNaN(actualValue)) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:value} to be NaN{reason}, but found {0}.", actualValue); + + return new AndConstraint>(parent); + } + + /// + /// Asserts that the number is seen as not a number (NaN). + /// + /// + /// 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 static AndConstraint> BeNaN(this NumericAssertions parent, + string because = "", + params object[] becauseArgs) + { + double actualValue = parent.Subject.Value; + + Execute.Assertion + .ForCondition(double.IsNaN(actualValue)) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:value} to be NaN{reason}, but found {0}.", actualValue); + + return new AndConstraint>(parent); + } + + /// + /// Asserts that the number is seen as not a number (NaN). + /// + /// + /// 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 static AndConstraint> BeNaN(this NullableNumericAssertions parent, + string because = "", + params object[] becauseArgs) + { + float? actualValue = parent.Subject; + + Execute.Assertion + .ForCondition(actualValue is { } value && float.IsNaN(value)) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:value} to be NaN{reason}, but found {0}.", actualValue); + + return new AndConstraint>(parent); + } + + /// + /// Asserts that the number is seen as not a number (NaN). + /// + /// + /// 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 static AndConstraint> BeNaN(this NullableNumericAssertions parent, + string because = "", + params object[] becauseArgs) + { + double? actualValue = parent.Subject; + + Execute.Assertion + .ForCondition(actualValue is { } value && double.IsNaN(value)) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:value} to be NaN{reason}, but found {0}.", actualValue); + + return new AndConstraint>(parent); + } + + #endregion + + #region NotBeNaN + + /// + /// Asserts that the number is not seen as the special value not a number (NaN). + /// + /// + /// 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 static AndConstraint> NotBeNaN(this NumericAssertions parent, + string because = "", + params object[] becauseArgs) + { + float actualValue = parent.Subject.Value; + + Execute.Assertion + .ForCondition(!float.IsNaN(actualValue)) + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect {context:value} to be NaN{reason}."); + + return new AndConstraint>(parent); + } + + /// + /// Asserts that the number is not seen as the special value not a number (NaN). + /// + /// + /// 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 static AndConstraint> NotBeNaN(this NumericAssertions parent, + string because = "", + params object[] becauseArgs) + { + double actualValue = parent.Subject.Value; + + Execute.Assertion + .ForCondition(!double.IsNaN(actualValue)) + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect {context:value} to be NaN{reason}."); + + return new AndConstraint>(parent); + } + + /// + /// Asserts that the number is not seen as the special value not a number (NaN). + /// + /// + /// 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 static AndConstraint> NotBeNaN(this NullableNumericAssertions parent, + string because = "", + params object[] becauseArgs) + { + float? actualValue = parent.Subject; + bool actualValueIsNaN = actualValue is { } value && float.IsNaN(value); + + Execute.Assertion + .ForCondition(!actualValueIsNaN) + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect {context:value} to be NaN{reason}."); + + return new AndConstraint>(parent); + } + + /// + /// Asserts that the number is not seen as the special value not a number (NaN). + /// + /// + /// 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 static AndConstraint> NotBeNaN(this NullableNumericAssertions parent, + string because = "", + params object[] becauseArgs) + { + double? actualValue = parent.Subject; + bool actualValueIsNaN = actualValue is { } value && double.IsNaN(value); + + Execute.Assertion + .ForCondition(!actualValueIsNaN) + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect {context:value} to be NaN{reason}."); + + return new AndConstraint>(parent); + } + + #endregion + private static long GetMinValue(long value, ulong delta) { long minValue; diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index cf5df524cd..67b570a31f 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -297,6 +297,10 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint nearbyValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong nearbyValue, ulong delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, decimal unexpectedValue, decimal precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, decimal? unexpectedValue, decimal precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, double unexpectedValue, double precision, string because = "", params object[] becauseArgs) { } @@ -314,6 +318,10 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort distantValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint distantValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong distantValue, ulong delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } } public static class ObjectAssertionsExtensions { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index f00bba5ff5..d2525735ea 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -310,6 +310,10 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint nearbyValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong nearbyValue, ulong delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, decimal unexpectedValue, decimal precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, decimal? unexpectedValue, decimal precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, double unexpectedValue, double precision, string because = "", params object[] becauseArgs) { } @@ -327,6 +331,10 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort distantValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint distantValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong distantValue, ulong delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } } public static class ObjectAssertionsExtensions { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 295dcf2c5a..cd69462dae 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -290,6 +290,10 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint nearbyValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong nearbyValue, ulong delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, decimal unexpectedValue, decimal precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, decimal? unexpectedValue, decimal precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, double unexpectedValue, double precision, string because = "", params object[] becauseArgs) { } @@ -307,6 +311,10 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort distantValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint distantValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong distantValue, ulong delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } } public static class ObjectAssertionsExtensions { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index f84632f17f..d5001a9e2e 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -297,6 +297,10 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint nearbyValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong nearbyValue, ulong delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, decimal unexpectedValue, decimal precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, decimal? unexpectedValue, decimal precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NullableNumericAssertions parent, double unexpectedValue, double precision, string because = "", params object[] becauseArgs) { } @@ -314,6 +318,10 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort distantValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint distantValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong distantValue, ulong delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } } public static class ObjectAssertionsExtensions { diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeNaN.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeNaN.cs new file mode 100644 index 0000000000..d5b4383b28 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeNaN.cs @@ -0,0 +1,442 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Numeric; + +public partial class NumericAssertionSpecs +{ + public class BeNaN + { + [Fact] + public void NaN_is_equal_to_NaN_when_its_a_float() + { + // Arrange + float actual = float.NaN; + + // Act / Assert + actual.Should().BeNaN(); + } + + [InlineData(-1f)] + [InlineData(0f)] + [InlineData(1f)] + [InlineData(float.MinValue)] + [InlineData(float.MaxValue)] + [InlineData(float.Epsilon)] + [InlineData(float.NegativeInfinity)] + [InlineData(float.PositiveInfinity)] + [Theory] + public void Should_fail_when_asserting_normal_float_value_to_be_NaN(float actual) + { + // Act + Action act = () => actual.Should().BeNaN(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Should_fail_with_a_descriptive_message_when_asserting_normal_float_value_to_be_NaN() + { + // Arrange + float actual = 1; + + // Act + Action act = () => actual.Should().BeNaN(); + + // Assert + act.Should().Throw() + .WithMessage("Expected actual to be NaN, but found 1F."); + } + + [Fact] + public void Should_chain_when_asserting_NaN_as_float() + { + // Arrange + float actual = float.NaN; + + // Act / Assert + actual.Should().BeNaN() + .And.Be(actual); + } + + [Fact] + public void NaN_is_equal_to_NaN_when_its_a_double() + { + // Arrange + double actual = double.NaN; + + // Act / Assert + actual.Should().BeNaN(); + } + + [InlineData(-1d)] + [InlineData(0d)] + [InlineData(1d)] + [InlineData(double.MinValue)] + [InlineData(double.MaxValue)] + [InlineData(double.Epsilon)] + [InlineData(double.NegativeInfinity)] + [InlineData(double.PositiveInfinity)] + [Theory] + public void Should_fail_when_asserting_normal_double_value_to_be_NaN(double actual) + { + // Act + Action act = () => actual.Should().BeNaN(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Should_fail_with_a_descriptive_message_when_asserting_normal_double_value_to_be_NaN() + { + // Arrange + double actual = 1; + + // Act + Action act = () => actual.Should().BeNaN(); + + // Assert + act.Should().Throw() + .WithMessage("Expected actual to be NaN, but found 1.0."); + } + + [Fact] + public void Should_chain_when_asserting_NaN_as_double() + { + // Arrange + double actual = double.NaN; + + // Act / Assert + actual.Should().BeNaN() + .And.Be(actual); + } + + [Fact] + public void NaN_is_equal_to_NaN_when_its_a_nullable_float() + { + // Arrange + float? actual = float.NaN; + + // Act / Assert + actual.Should().BeNaN(); + } + + [InlineData(null)] + [InlineData(-1f)] + [InlineData(0f)] + [InlineData(1f)] + [InlineData(float.MinValue)] + [InlineData(float.MaxValue)] + [InlineData(float.Epsilon)] + [InlineData(float.NegativeInfinity)] + [InlineData(float.PositiveInfinity)] + [Theory] + public void Should_fail_when_asserting_nullable_normal_float_value_to_be_NaN(float? actual) + { + // Act + Action act = () => actual.Should().BeNaN(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Should_fail_with_a_descriptive_message_when_asserting_nullable_normal_float_value_to_be_NaN() + { + // Arrange + float? actual = 1; + + // Act + Action act = () => actual.Should().BeNaN(); + + // Assert + act.Should().Throw() + .WithMessage("Expected actual to be NaN, but found 1F."); + } + + [Fact] + public void Should_chain_when_asserting_NaN_as_nullable_float() + { + // Arrange + float? actual = float.NaN; + + // Act / Assert + actual.Should().BeNaN() + .And.Be(actual); + } + + [Fact] + public void NaN_is_equal_to_NaN_when_its_a_nullable_double() + { + // Arrange + double? actual = double.NaN; + + // Act / Assert + actual.Should().BeNaN(); + } + + [InlineData(null)] + [InlineData(-1d)] + [InlineData(0d)] + [InlineData(1d)] + [InlineData(double.MinValue)] + [InlineData(double.MaxValue)] + [InlineData(double.Epsilon)] + [InlineData(double.NegativeInfinity)] + [InlineData(double.PositiveInfinity)] + [Theory] + public void Should_fail_when_asserting_nullable_normal_double_value_to_be_NaN(double? actual) + { + // Act + Action act = () => actual.Should().BeNaN(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Should_fail_with_a_descriptive_message_when_asserting_nullable_normal_double_value_to_be_NaN() + { + // Arrange + double? actual = 1; + + // Act + Action act = () => actual.Should().BeNaN(); + + // Assert + act.Should().Throw() + .WithMessage("Expected actual to be NaN, but found 1.0."); + } + + [Fact] + public void Should_chain_when_asserting_NaN_as_nullable_double() + { + // Arrange + double? actual = double.NaN; + + // Act / Assert + actual.Should().BeNaN() + .And.Be(actual); + } + } + + public class NotBeNaN + { + [InlineData(-1f)] + [InlineData(0f)] + [InlineData(1f)] + [InlineData(float.MinValue)] + [InlineData(float.MaxValue)] + [InlineData(float.Epsilon)] + [InlineData(float.NegativeInfinity)] + [InlineData(float.PositiveInfinity)] + [Theory] + public void Normal_float_is_never_equal_to_NaN(float actual) + { + // Act / Assert + actual.Should().NotBeNaN(); + } + + [Fact] + public void Should_fail_when_asserting_NaN_as_float() + { + // Arrange + float actual = float.NaN; + + // Act + Action act = () => actual.Should().NotBeNaN(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Should_fail_with_a_descriptive_message_when_asserting_NaN_as_float() + { + // Arrange + float actual = float.NaN; + + // Act + Action act = () => actual.Should().NotBeNaN(); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect actual to be NaN."); + } + + [Fact] + public void Should_chain_when_asserting_normal_float_value() + { + // Arrange + float actual = 1; + + // Act / Assert + actual.Should().NotBeNaN() + .And.Be(actual); + } + + [InlineData(-1d)] + [InlineData(0d)] + [InlineData(1d)] + [InlineData(double.MinValue)] + [InlineData(double.MaxValue)] + [InlineData(double.Epsilon)] + [InlineData(double.NegativeInfinity)] + [InlineData(double.PositiveInfinity)] + [Theory] + public void Normal_double_is_never_equal_to_NaN(double actual) + { + // Act / Assert + actual.Should().NotBeNaN(); + } + + [Fact] + public void Should_fail_when_asserting_NaN_as_double() + { + // Arrange + double actual = double.NaN; + + // Act + Action act = () => actual.Should().NotBeNaN(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Should_fail_with_a_descriptive_message_when_asserting_NaN_as_double() + { + // Arrange + double actual = double.NaN; + + // Act + Action act = () => actual.Should().NotBeNaN(); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect actual to be NaN."); + } + + [Fact] + public void Should_chain_when_asserting_normal_double_value() + { + // Arrange + double actual = 1; + + // Act / Assert + actual.Should().NotBeNaN() + .And.Be(actual); + } + + [InlineData(null)] + [InlineData(-1f)] + [InlineData(0f)] + [InlineData(1f)] + [InlineData(float.MinValue)] + [InlineData(float.MaxValue)] + [InlineData(float.Epsilon)] + [InlineData(float.NegativeInfinity)] + [InlineData(float.PositiveInfinity)] + [Theory] + public void Normal_nullable_float_is_never_equal_to_NaN(float? actual) + { + // Act / Assert + actual.Should().NotBeNaN(); + } + + [Fact] + public void Should_fail_when_asserting_NaN_as_nullable_float() + { + // Arrange + float? actual = float.NaN; + + // Act + Action act = () => actual.Should().NotBeNaN(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Should_fail_with_a_descriptive_message_when_asserting_NaN_as_nullable_float() + { + // Arrange + float? actual = float.NaN; + + // Act + Action act = () => actual.Should().NotBeNaN(); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect actual to be NaN."); + } + + [Fact] + public void Should_chain_when_asserting_normal_nullable_float_value() + { + // Arrange + float? actual = 1; + + // Act / Assert + actual.Should().NotBeNaN() + .And.Be(actual); + } + + [InlineData(null)] + [InlineData(-1d)] + [InlineData(0d)] + [InlineData(1d)] + [InlineData(double.MinValue)] + [InlineData(double.MaxValue)] + [InlineData(double.Epsilon)] + [InlineData(double.NegativeInfinity)] + [InlineData(double.PositiveInfinity)] + [Theory] + public void Normal_nullable_double_is_never_equal_to_NaN(double? actual) + { + // Act / Assert + actual.Should().NotBeNaN(); + } + + [Fact] + public void Should_fail_when_asserting_NaN_as_nullable_double() + { + // Arrange + double? actual = double.NaN; + + // Act + Action act = () => actual.Should().NotBeNaN(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Should_fail_with_a_descriptive_message_when_asserting_NaN_as_nullable_double() + { + // Arrange + double? actual = double.NaN; + + // Act + Action act = () => actual.Should().NotBeNaN(); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect actual to be NaN."); + } + + [Fact] + public void Should_chain_when_asserting_normal_nullable_double_value() + { + // Arrange + double? actual = 1; + + // Act / Assert + actual.Should().NotBeNaN() + .And.Be(actual); + } + } +} diff --git a/docs/_pages/numerictypes.md b/docs/_pages/numerictypes.md index 9f8eaa15ce..f193fe7163 100644 --- a/docs/_pages/numerictypes.md +++ b/docs/_pages/numerictypes.md @@ -54,6 +54,20 @@ value.Should().NotBeApproximately(2.5F, 0.5F); This will verify that the value of the float is not between 2.0 and 3.0. +Float and double values may take the special value NaN. To verify, you can do this. + +```csharp +float value = float.NaN; +value.Should().BeNaN(); +``` + +This will verify that the value of the float is anything other than the special value NaN. + +```csharp +float value = float.NaN; +value.Should().NotBeNaN(); +``` + To assert that a value matches one of the provided values, you can do this (works for numeric types and `IComparable`s). ```csharp diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index b8c4dcc2eb..77a600fd10 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,7 +7,7 @@ sidebar: nav: "sidebar" --- -## 7.0 Alpha 1 +## 7.0 Alpha X ### What's new @@ -15,6 +15,7 @@ sidebar: * Ensure compatibility with .NET 8 - [#2466](https://github.com/fluentassertions/fluentassertions/pull/2466) * Add support for NUnit 4 - [#2483](https://github.com/fluentassertions/fluentassertions/pull/2483) * Added `NotBeIn` to check if a `DateTime` is not in a given `DateTimeKind` - [#2536](https://github.com/fluentassertions/fluentassertions/pull/2536) +* Added `BeNaN` and `NotBeNaN` for assertions on `float` and `double` - [#2606](https://github.com/fluentassertions/fluentassertions/pull/2606) ### Improvements * Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) From ebc3ce99862db5d521ddcd8873344409cd3ac034 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Wed, 20 Mar 2024 16:13:03 +0100 Subject: [PATCH 294/845] Revert coveralls badge to `master` (#2610) * Revert coveralls badge to `master` * Fix actual link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b59d912d39..7e797f2b3b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Extension methods to fluently assert the outcome of .NET tests [![](https://img.shields.io/github/actions/workflow/status/fluentassertions/fluentassertions/build.yml?branch=develop)](https://github.com/fluentassertions/fluentassertions/actions?query=branch%3Adevelop) -[![Coveralls branch](https://img.shields.io/coverallsCoverage/github/fluentassertions/fluentassertions?branch=develop)](https://coveralls.io/github/fluentassertions/fluentassertions?branch=develop) +[![Coveralls branch](https://img.shields.io/coverallsCoverage/github/fluentassertions/fluentassertions?branch=master)](https://coveralls.io/github/fluentassertions/fluentassertions?branch=master) [![qodana](https://github.com/fluentassertions/fluentassertions/actions/workflows/code_quality.yml/badge.svg)](https://github.com/fluentassertions/fluentassertions/actions/workflows/code_quality.yml) [![](https://img.shields.io/github/release/FluentAssertions/FluentAssertions.svg?label=latest%20release&color=007edf)](https://github.com/FluentAssertions/FluentAssertions/releases/latest) [![](https://img.shields.io/nuget/dt/FluentAssertions.svg?label=downloads&color=007edf&logo=nuget)](https://www.nuget.org/packages/FluentAssertions) From e760ba4fa8a17987a761c713a6bd92813ce8f764 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Wed, 20 Mar 2024 16:52:03 +0100 Subject: [PATCH 295/845] Ensured that nested assertion scopes produce a nested context (#2607) Also fixed an inconsistency in which one overload of the assertion scope constructor would not actually affect AssertionScope.Current. --- .../Execution/AssertionScope.cs | 44 +++++++++++-------- .../AssertionScope.MessageFormatingSpecs.cs | 16 +++++++ docs/_pages/releases.md | 2 + 3 files changed, 44 insertions(+), 18 deletions(-) diff --git a/Src/FluentAssertions/Execution/AssertionScope.cs b/Src/FluentAssertions/Execution/AssertionScope.cs index d8bde7cbf5..65f24d703f 100644 --- a/Src/FluentAssertions/Execution/AssertionScope.cs +++ b/Src/FluentAssertions/Execution/AssertionScope.cs @@ -28,7 +28,9 @@ public sealed class AssertionScope : IAssertionScope private static readonly AsyncLocal CurrentScope = new(); private Func callerIdentityProvider = () => CallerIdentifier.DetermineCallerIdentity(); +#pragma warning disable CA2213 private AssertionScope parent; +#pragma warning restore CA2213 private Func expectation; private string fallbackIdentifier = "object"; private bool? succeeded; @@ -48,25 +50,23 @@ public DeferredReportable(Func valueFunc) #endregion /// - /// Starts a named scope within which multiple assertions can be executed + /// Starts an unnamed scope within which multiple assertions can be executed /// and which will not throw until the scope is disposed. /// - public AssertionScope(string context) - : this() + public AssertionScope() + : this(new CollectingAssertionStrategy(), context: null) { - if (!string.IsNullOrEmpty(context)) - { - Context = new Lazy(() => context); - } + SetCurrentAssertionScope(this); } /// - /// Starts an unnamed scope within which multiple assertions can be executed + /// Starts a named scope within which multiple assertions can be executed /// and which will not throw until the scope is disposed. /// - public AssertionScope() - : this(new CollectingAssertionStrategy()) + public AssertionScope(string context) + : this(new CollectingAssertionStrategy(), new Lazy(() => context)) { + SetCurrentAssertionScope(this); } /// @@ -75,7 +75,7 @@ public AssertionScope() /// The assertion strategy for this scope. /// is . public AssertionScope(IAssertionStrategy assertionStrategy) - : this(assertionStrategy, GetCurrentAssertionScope()) + : this(assertionStrategy, context: null) { SetCurrentAssertionScope(this); } @@ -85,32 +85,40 @@ public AssertionScope(IAssertionStrategy assertionStrategy) /// and which will not throw until the scope is disposed. /// public AssertionScope(Lazy context) - : this() + : this(new CollectingAssertionStrategy(), context) { - Context = context; + SetCurrentAssertionScope(this); } /// /// Starts a new scope based on the given assertion strategy and parent assertion scope /// /// The assertion strategy for this scope. - /// The parent assertion scope for this scope. /// is . - private AssertionScope(IAssertionStrategy assertionStrategy, AssertionScope parent) + private AssertionScope(IAssertionStrategy assertionStrategy, Lazy context) { this.assertionStrategy = assertionStrategy ?? throw new ArgumentNullException(nameof(assertionStrategy)); - this.parent = parent; + parent = GetCurrentAssertionScope(); if (parent is not null) { contextData.Add(parent.contextData); - Context = parent.Context; reason = parent.reason; callerIdentityProvider = parent.callerIdentityProvider; FormattingOptions = parent.FormattingOptions.Clone(); + Context = new Lazy(() => JoinContext(parent.Context, context)); } + else + { + Context = context; + } + } + + private static string JoinContext(params Lazy[] contexts) + { + return string.Join("/", contexts.Where(ctx => ctx is not null).Select(x => x.Value)); } /// @@ -128,7 +136,7 @@ public static AssertionScope Current #pragma warning disable CA2000 // AssertionScope should not be disposed here get { - return GetCurrentAssertionScope() ?? new AssertionScope(new DefaultAssertionStrategy(), parent: null); + return GetCurrentAssertionScope() ?? new AssertionScope(new DefaultAssertionStrategy(), context: null); } #pragma warning restore CA2000 private set => SetCurrentAssertionScope(value); diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs index 6043015730..b299d87796 100644 --- a/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs @@ -66,6 +66,22 @@ public void Message_should_use_the_lazy_name_of_the_scope_as_context() .WithMessage("Expected lazy foo to be equal to*"); } + [Fact] + public void Nested_scopes_use_the_name_of_their_outer_scope_as_context() + { + // Act + Action act = () => + { + using var outerScope = new AssertionScope("outer"); + using var innerScope = new AssertionScope("inner"); + new[] { 1, 2, 3 }.Should().Equal(3, 2, 1); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expected outer/inner to be equal to*"); + } + [Fact] public void Message_should_contain_each_unique_failed_assertion_seperately() { diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 77a600fd10..7898382281 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -42,6 +42,8 @@ sidebar: * Fixed using `BeEquivalentTo` on an empty `ArraySegment` - [#2445](https://github.com/fluentassertions/fluentassertions/pull/2445), [#2511](https://github.com/fluentassertions/fluentassertions/pull/2511) * `BeEquivalentTo` with a custom comparer can now handle null values - [#2489](https://github.com/fluentassertions/fluentassertions/pull/2489) * Fixed incorrect treatment of "\\r\\n" as new line - [#2569](https://github.com/fluentassertions/fluentassertions/pull/2569) +* Ensured that nested calls to `AssertionScope(context)` create a chained context - [#2607](https://github.com/fluentassertions/fluentassertions/pull/2607) +* One overload of the `AssertionScope` constructor would not create an actual scope associated with the thread - [#2607](https://github.com/fluentassertions/fluentassertions/pull/2607) ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) From a9dea11a3b81ecb31573448a24e3b699b2579556 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 24 Mar 2024 11:27:49 +0100 Subject: [PATCH 296/845] Only allocate Lazy<> and lambda when necessary The local function avoid allocating a lambda when not used. For more details, see: https://github.com/dotnet/roslyn/issues/20777 --- Src/FluentAssertions/Execution/AssertionScope.cs | 15 ++++++++++++--- .../AssertionScope.MessageFormatingSpecs.cs | 16 ++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/Execution/AssertionScope.cs b/Src/FluentAssertions/Execution/AssertionScope.cs index 65f24d703f..d45c6eacb5 100644 --- a/Src/FluentAssertions/Execution/AssertionScope.cs +++ b/Src/FluentAssertions/Execution/AssertionScope.cs @@ -108,7 +108,7 @@ private AssertionScope(IAssertionStrategy assertionStrategy, Lazy contex reason = parent.reason; callerIdentityProvider = parent.callerIdentityProvider; FormattingOptions = parent.FormattingOptions.Clone(); - Context = new Lazy(() => JoinContext(parent.Context, context)); + Context = JoinContexts(parent.Context, context); } else { @@ -116,9 +116,18 @@ private AssertionScope(IAssertionStrategy assertionStrategy, Lazy contex } } - private static string JoinContext(params Lazy[] contexts) + private static Lazy JoinContexts(Lazy outer, Lazy inner) { - return string.Join("/", contexts.Where(ctx => ctx is not null).Select(x => x.Value)); + return (outer, inner) switch + { + (null, null) => null, + ({ } a, null) => a, + (null, { } b) => b, + ({ } a, { } b) => Join(a, b) + }; + + static Lazy Join(Lazy outer, Lazy inner) => + new(() => outer.Value + "/" + inner.Value); } /// diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs index b299d87796..c7a7db682d 100644 --- a/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs @@ -82,6 +82,22 @@ public void Nested_scopes_use_the_name_of_their_outer_scope_as_context() .WithMessage("Expected outer/inner to be equal to*"); } + [Fact] + public void The_inner_scope_is_used_when_the_outer_scope_does_not_have_a_context() + { + // Act + Action act = () => + { + using var outerScope = new AssertionScope(); + using var innerScope = new AssertionScope("inner"); + new[] { 1, 2, 3 }.Should().Equal(3, 2, 1); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expected inner to be equal to*"); + } + [Fact] public void Message_should_contain_each_unique_failed_assertion_seperately() { From 30ea6a2aff582e3be439747cf024aae6b624310e Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 24 Mar 2024 12:52:43 +0100 Subject: [PATCH 297/845] Simplify deferred allocation with local function https://github.com/fluentassertions/fluentassertions/pull/1939#discussion_r883906079 --- Src/FluentAssertions/Equivalency/EquivalencyValidator.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs index 843774645b..928236ed78 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs @@ -66,14 +66,16 @@ private void TryToProveNodesAreEquivalent(Comparands comparands, IEquivalencyVal { using var _ = context.Tracer.WriteBlock(node => node.Description); - Func getMessage = step => _ => $"Equivalency was proven by {step.GetType().Name}"; - foreach (IEquivalencyStep step in AssertionOptions.EquivalencyPlan) { var result = step.Handle(comparands, context, this); if (result == EquivalencyResult.AssertionCompleted) { - context.Tracer.WriteLine(getMessage(step)); + context.Tracer.WriteLine(GetMessage(step)); + + static GetTraceMessage GetMessage(IEquivalencyStep step) => + _ => $"Equivalency was proven by {step.GetType().Name}"; + return; } } From dab540e12f0cfdc2ad12daed5db1dcb5b23088e6 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 25 Mar 2024 07:16:57 +0100 Subject: [PATCH 298/845] Make ThrowWithinAsync respect canceled tasks (#2614) --- .../Specialized/AsyncFunctionAssertions.cs | 10 +++- .../Specialized/TaskAssertionSpecs.cs | 46 +++++++++++++++++++ docs/_pages/releases.md | 1 + 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs index 7c2027c5c6..a47c773ab7 100644 --- a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs @@ -288,8 +288,8 @@ private protected async Task CompletesWithinTimeoutAsync(Task target, Time { using var delayCancellationTokenSource = new CancellationTokenSource(); - Task completedTask = - await Task.WhenAny(target, Clock.DelayAsync(remainingTime, delayCancellationTokenSource.Token)); + Task delayTask = Clock.DelayAsync(remainingTime, delayCancellationTokenSource.Token); + Task completedTask = await Task.WhenAny(target, delayTask); if (completedTask.IsFaulted) { @@ -303,6 +303,12 @@ private protected async Task CompletesWithinTimeoutAsync(Task target, Time return false; } + if (target.IsCanceled) + { + // Rethrow the exception causing the task be canceled. + await target; + } + // The monitored task is completed, we shall cancel the clock. delayCancellationTokenSource.Cancel(); return true; diff --git a/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs index 71b8555df9..ac64d822a1 100644 --- a/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs @@ -503,6 +503,52 @@ await action.Should().ThrowAsync().WithMessage( "Expected a to be thrown within 1s," + " but found :*foo*"); } + + [Fact] + public async Task When_task_is_canceled_before_timeout_it_succeeds() + { + // Arrange + var timer = new FakeClock(); + var taskFactory = new TaskCompletionSource(); + + // Act + Func action = () => + { + return Awaiting(() => (Task)taskFactory.Task) + .Should(timer).ThrowWithinAsync(1.Seconds()); + }; + + _ = action.Invoke(); + + taskFactory.SetCanceled(); + timer.Complete(); + + // Assert + await action.Should().NotThrowAsync(); + } + + [Fact] + public async Task When_task_is_canceled_after_timeout_it_fails() + { + // Arrange + var timer = new FakeClock(); + var taskFactory = new TaskCompletionSource(); + + // Act + Func action = () => + { + return Awaiting(() => (Task)taskFactory.Task) + .Should(timer).ThrowWithinAsync(1.Seconds()); + }; + + _ = action.Invoke(); + + timer.Delay(1.Seconds()); + taskFactory.SetCanceled(); + + // Assert + await action.Should().ThrowAsync(); + } } public class ThrowExactlyAsync diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 7898382281..0d6f466d5c 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -44,6 +44,7 @@ sidebar: * Fixed incorrect treatment of "\\r\\n" as new line - [#2569](https://github.com/fluentassertions/fluentassertions/pull/2569) * Ensured that nested calls to `AssertionScope(context)` create a chained context - [#2607](https://github.com/fluentassertions/fluentassertions/pull/2607) * One overload of the `AssertionScope` constructor would not create an actual scope associated with the thread - [#2607](https://github.com/fluentassertions/fluentassertions/pull/2607) +* Fixed `ThrowWithinAsync` not respecting `OperationCanceledException` - [#2614](https://github.com/fluentassertions/fluentassertions/pull/2614) ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) From 1336c8d61c94b8e38820db3dac1d8b4da8d07ab7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:16:59 +0100 Subject: [PATCH 299/845] Bump cspell from 8.6.0 to 8.6.1 (#2616) Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.6.0 to 8.6.1. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.6.1/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 184 ++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 99 insertions(+), 87 deletions(-) diff --git a/package-lock.json b/package-lock.json index f17ffa47b5..df6cb29770 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.6.0" + "cspell": "^8.6.1" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.6.0.tgz", - "integrity": "sha512-hRVvir4G4276Kz/Cru34AJg1FObIw5MrzezAwHkD3obNMwZkof8aX3MEN6AzWusJSVG2ZxZxZAEnYbgqvGr2Fg==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.6.1.tgz", + "integrity": "sha512-s6Av1xIgctYLuUiazKZjQ2WRUXc9dU38BOZXwM/lb7y8grQMEuTjST1c+8MOkZkppx48/sO7GHIF3k9rEzD3fg==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.1", @@ -42,6 +42,7 @@ "@cspell/dict-html": "^4.0.5", "@cspell/dict-html-symbol-entities": "^4.0.0", "@cspell/dict-java": "^5.0.6", + "@cspell/dict-julia": "^1.0.1", "@cspell/dict-k8s": "^1.0.2", "@cspell/dict-latex": "^4.0.0", "@cspell/dict-lorem-ipsum": "^4.0.0", @@ -61,6 +62,7 @@ "@cspell/dict-sql": "^2.1.3", "@cspell/dict-svelte": "^1.0.2", "@cspell/dict-swift": "^2.0.1", + "@cspell/dict-terraform": "^1.0.0", "@cspell/dict-typescript": "^3.1.2", "@cspell/dict-vue": "^3.0.0" }, @@ -69,28 +71,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.6.0.tgz", - "integrity": "sha512-fPpE4a3zpdfwgTyfLgCmxZn4owkZ4IP6A/oL4XLW22IxW5xBIbXEveOSY+uiWAnVfEnqfrMNRLAGj7JoXnJ1Vg==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.6.1.tgz", + "integrity": "sha512-75cmJgU9iQgrDnLFIUyvgybySJJi29BPw71z+8ZO9WhNofufxoSjaWepZeYV2nK0nHXM+MbdQG5Mmj/Lv6J1FA==", "dependencies": { - "@cspell/cspell-types": "8.6.0" + "@cspell/cspell-types": "8.6.1" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.6.0.tgz", - "integrity": "sha512-gbAZksz38OHaN8s4fOmmgtgQfie1K8dRGlo9z/uxSx5FIELV48GWTbHn9t1TY2yBXBwJ7+4NF2+r624rtlPoHQ==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.6.1.tgz", + "integrity": "sha512-guIlGhhOLQwfqevBSgp26b+SX4I1hCH+puAksWAk93bybKkcGtGpcavAQSN9qvamox4zcHnvGutEPF+UcXuceQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.6.0.tgz", - "integrity": "sha512-ARwO6TWKy8fLHNhC/ls5Wo/AK86E1oLVChwWtHdq7eVyEUIykQaXGLqoRThkIT2jyLfGDrhSvaU+yqcXVLE48Q==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.6.1.tgz", + "integrity": "sha512-ZUbYcvEhfokHG9qfUlIylUqEobG84PiDozCkE8U4h/rTSmYkf/nAD+M6yg+jQ0F2aTFGNbvpKKGFlfXFXveX7A==", "dependencies": { "global-directory": "^4.0.1" }, @@ -99,17 +101,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.6.0.tgz", - "integrity": "sha512-veCGlhlNGmYMgzX/rMiDp8j7ndLxFHIZq3h6DNlIsIoSjP1v5Rk6UcCwEoWYexwKmNXo7c2VooB0GM9LSBcPAQ==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.6.1.tgz", + "integrity": "sha512-WpI3fSW8t00UMetfd6tS8f9+xE3+ElIUO/bQ1YKK95TMIRdEUcH+QDxcHM66pJXEm4WiaN3H/MfWk1fIhGlJ8g==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.6.0.tgz", - "integrity": "sha512-+CU/nuFOpswJAA3IS2TcKGskfM/o/4aNG1IMUVaOEQi1Sc5qZQ4Wj1qDIWJArSHFYW1Q4XFa4U8K1jnVHkAhZQ==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.6.1.tgz", + "integrity": "sha512-MXa9v6sXbbwyiNno7v7vczNph6AsMNWnpMRCcW3h/siXNQYRuMssdxqT5sQJ8Kurh3M/Wo7DlKX4n74elKL3iQ==", "engines": { "node": ">=18" } @@ -254,6 +256,11 @@ "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.6.tgz", "integrity": "sha512-kdE4AHHHrixyZ5p6zyms1SLoYpaJarPxrz8Tveo6gddszBVVwIUZ+JkQE1bWNLK740GWzIXdkznpUfw1hP9nXw==" }, + "node_modules/@cspell/dict-julia": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-julia/-/dict-julia-1.0.1.tgz", + "integrity": "sha512-4JsCLCRhhLMLiaHpmR7zHFjj1qOauzDI5ZzCNQS31TUMfsOo26jAKDfo0jljFAKgw5M2fEG7sKr8IlPpQAYrmQ==" + }, "node_modules/@cspell/dict-k8s": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.2.tgz", @@ -352,6 +359,11 @@ "resolved": "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-2.0.1.tgz", "integrity": "sha512-gxrCMUOndOk7xZFmXNtkCEeroZRnS2VbeaIPiymGRHj5H+qfTAzAKxtv7jJbVA3YYvEzWcVE2oKDP4wcbhIERw==" }, + "node_modules/@cspell/dict-terraform": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.0.0.tgz", + "integrity": "sha512-Ak+vy4HP/bOgzf06BAMC30+ZvL9mzv21xLM2XtfnBLTDJGdxlk/nK0U6QT8VfFLqJ0ZZSpyOxGsUebWDCTr/zQ==" + }, "node_modules/@cspell/dict-typescript": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.2.tgz", @@ -363,9 +375,9 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.6.0.tgz", - "integrity": "sha512-yDJZ/uXCpZcAkXwaWa0JcCZHZFxnF3qtiFiq2WG5cEw8tiJiNdawjSCd8/D35dT3QFNaInMP+H3sOf68dNueew==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.6.1.tgz", + "integrity": "sha512-Fjvkcb5umIAcHfw/iiciYWgO2mXVuRZzQAWPSub6UFCxxcJlRz39YPXa+3O/m3lnXCeo8ChoaEN8qnuV4ogk6g==", "dependencies": { "import-meta-resolve": "^4.0.0" }, @@ -374,9 +386,9 @@ } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.6.0.tgz", - "integrity": "sha512-QenBOdIT1zRa0kF3Z1mwObcvmdhxn+rzQDdmkxwSyRB/9KsNnib6XXTUo8P+Z/ZKXOYbP9Wmf4FX+vKd3yVX0Q==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.6.1.tgz", + "integrity": "sha512-X6/7cy+GGVJFXsfrZapxVKn5mtehNTr7hTlg0bVj3iFoNYEPW9zq9l6WIcI4psmaU8G4DSrNsBK7pp87W3u16A==", "engines": { "node": ">=18" } @@ -642,21 +654,21 @@ } }, "node_modules/cspell": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.6.0.tgz", - "integrity": "sha512-aAaVD3v1105OQePCpcdYkHnHxxkxKxxQzFcfJ4tKsH06dlW04Sp1oQLlsjgWDa3y6cdYTpSYj1eSenavBvfOFg==", - "dependencies": { - "@cspell/cspell-json-reporter": "8.6.0", - "@cspell/cspell-pipe": "8.6.0", - "@cspell/cspell-types": "8.6.0", - "@cspell/dynamic-import": "8.6.0", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.6.1.tgz", + "integrity": "sha512-/Qle15v4IQe7tViSWX0+RCZJ2HJ4HUCZV9Z4uOVasNUz+DWCrxysNR+pfCRYuLX/6lQdqCM9QCR9GZc7a2KIVA==", + "dependencies": { + "@cspell/cspell-json-reporter": "8.6.1", + "@cspell/cspell-pipe": "8.6.1", + "@cspell/cspell-types": "8.6.1", + "@cspell/dynamic-import": "8.6.1", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.0.0", - "cspell-gitignore": "8.6.0", - "cspell-glob": "8.6.0", - "cspell-io": "8.6.0", - "cspell-lib": "8.6.0", + "cspell-gitignore": "8.6.1", + "cspell-glob": "8.6.1", + "cspell-io": "8.6.1", + "cspell-lib": "8.6.1", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^8.0.0", @@ -677,26 +689,26 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.6.0.tgz", - "integrity": "sha512-Q1rvQFUDJTu4hUtxwL6+q83Hjx/a5grEjMS5axxFJzjJuFRbRsXCagncdSCx/YBqLkNM5noBbRP/0rVh7ufqxw==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.6.1.tgz", + "integrity": "sha512-I6LatgXJb8mxKFzIywO81TlUD/qWnUDrhB6yTUPdP90bwZcXMmGoCsZxhd2Rvl9fz5fWne0T839I1coShfm86g==", "dependencies": { - "@cspell/cspell-types": "8.6.0", + "@cspell/cspell-types": "8.6.1", "comment-json": "^4.2.3", - "yaml": "^2.4.0" + "yaml": "^2.4.1" }, "engines": { "node": ">=18" } }, "node_modules/cspell-dictionary": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.6.0.tgz", - "integrity": "sha512-ohToeOQznIrb2/z7RfKxX3NID0WiO4sXK3IxKdnbn2viGgdn17tQ8Z2f4Xuy9egjSGRKyr6N25Z5AOes1C8R3w==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.6.1.tgz", + "integrity": "sha512-0SfKPi1QoWbGpZ/rWMR7Jn0+GaQT9PAMLWjVOu66PUNUXI5f4oCTHpnZE1Xts+5VX8shZC3TAMHEgtgKuQn4RQ==", "dependencies": { - "@cspell/cspell-pipe": "8.6.0", - "@cspell/cspell-types": "8.6.0", - "cspell-trie-lib": "8.6.0", + "@cspell/cspell-pipe": "8.6.1", + "@cspell/cspell-types": "8.6.1", + "cspell-trie-lib": "8.6.1", "fast-equals": "^5.0.1", "gensequence": "^7.0.0" }, @@ -705,11 +717,11 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.6.0.tgz", - "integrity": "sha512-6INRlNb17iKtQH7NmDM/EsX5OZOD2TzIwHiJnnWci0Y5l10V/zN9WGLDegTjMh9HU3TS6uUuN4I/ffkCs9m+LA==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.6.1.tgz", + "integrity": "sha512-3gtt351sSDfN826aMXTqGHVLz2lz9ZHr8uemImUc24Q+676sXkJM9lXzqP8PUqwGhLyt5qSf+9pt0ieNwQy/cA==", "dependencies": { - "cspell-glob": "8.6.0", + "cspell-glob": "8.6.1", "find-up-simple": "^1.0.0" }, "bin": { @@ -720,9 +732,9 @@ } }, "node_modules/cspell-glob": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.6.0.tgz", - "integrity": "sha512-AyuExc34F8JsEYNl4inx1m1v5VoSRA/cTptREq/AoNTcMTyG5s+wt5J+VWBfvJjEDEEpd9Cb2it0j8TMo/Tpjw==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.6.1.tgz", + "integrity": "sha512-QjtngIR0XsUQLmHHDO86hps/JR5sRxSBwCvcsNCEmSdpdofLFc8cuxi3o33JWge7UAPBCQOLGfpA7/Wx31srmw==", "dependencies": { "micromatch": "^4.0.5" }, @@ -731,12 +743,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.6.0.tgz", - "integrity": "sha512-wVpZ4pPOqRoOmzLUc34wyOQnBi/6RsV3Y1KiPn8BNSkObb9XSohb1xJJMJ69unEmgE0snQDMHIeUaLTQH414MA==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.6.1.tgz", + "integrity": "sha512-MaG0e/F0b2FnIRULCZ61JxEiJgTP/6rsbUoR5nG9X+WmJYItYmxC1F/FPPrVeTu+jJr/8O4pdnslE20pimHaCw==", "dependencies": { - "@cspell/cspell-pipe": "8.6.0", - "@cspell/cspell-types": "8.6.0" + "@cspell/cspell-pipe": "8.6.1", + "@cspell/cspell-types": "8.6.1" }, "bin": { "cspell-grammar": "bin.mjs" @@ -746,36 +758,36 @@ } }, "node_modules/cspell-io": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.6.0.tgz", - "integrity": "sha512-jx7ccRpcshqxN6xnOiGnX4VycaqTpmatRjHITn4vLoDmQNfxQeU69YT62bhyjogCBuJsZS9ksjo7GQIsrYBekA==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.6.1.tgz", + "integrity": "sha512-ofxBB8QtUPvh/bOwKLYsqU1hwQCet8E98jkn/5f4jtG+/x5Zd80I0Ez+tlbjiBmrrQfOKh+i8ipfzHD8JtoreQ==", "dependencies": { - "@cspell/cspell-service-bus": "8.6.0" + "@cspell/cspell-service-bus": "8.6.1" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.6.0.tgz", - "integrity": "sha512-l1bBxBz8noPOxEIIu1Ahvd4e/j6Re1PNDD9FwZgaRmvMyIPZbupTxzCM0MZWvYz1VymBmrrVEKRwtZ34VocaCw==", - "dependencies": { - "@cspell/cspell-bundled-dicts": "8.6.0", - "@cspell/cspell-pipe": "8.6.0", - "@cspell/cspell-resolver": "8.6.0", - "@cspell/cspell-types": "8.6.0", - "@cspell/dynamic-import": "8.6.0", - "@cspell/strong-weak-map": "8.6.0", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.6.1.tgz", + "integrity": "sha512-kGeDUypRtThFT81IdUK7yU8eUwO5MYWj8pGQ0N8WFsqbCahJrUdcocceVSpnCX48W3CXu12DkqYG9kv5Umn7Xw==", + "dependencies": { + "@cspell/cspell-bundled-dicts": "8.6.1", + "@cspell/cspell-pipe": "8.6.1", + "@cspell/cspell-resolver": "8.6.1", + "@cspell/cspell-types": "8.6.1", + "@cspell/dynamic-import": "8.6.1", + "@cspell/strong-weak-map": "8.6.1", "clear-module": "^4.1.2", "comment-json": "^4.2.3", "configstore": "^6.0.0", - "cspell-config-lib": "8.6.0", - "cspell-dictionary": "8.6.0", - "cspell-glob": "8.6.0", - "cspell-grammar": "8.6.0", - "cspell-io": "8.6.0", - "cspell-trie-lib": "8.6.0", + "cspell-config-lib": "8.6.1", + "cspell-dictionary": "8.6.1", + "cspell-glob": "8.6.1", + "cspell-grammar": "8.6.1", + "cspell-io": "8.6.1", + "cspell-trie-lib": "8.6.1", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", "import-fresh": "^3.3.0", @@ -788,12 +800,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.6.0.tgz", - "integrity": "sha512-S8nGCnEJBL1maiKPd3FhI54QG+OgtOkcJ/yUDXGXGrokSruWFdNocioPirlFAHf959ax1GBUVEYNIgnu/EIWNg==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.6.1.tgz", + "integrity": "sha512-iuJuAyWoqTH/TpFAR/ISJGQQoW3oiw54GyvXIucPoCJt/jgQONDuzqPW+skiLvcgcTbXCN9dutZTb2gImIkmpw==", "dependencies": { - "@cspell/cspell-pipe": "8.6.0", - "@cspell/cspell-types": "8.6.0", + "@cspell/cspell-pipe": "8.6.1", + "@cspell/cspell-types": "8.6.1", "gensequence": "^7.0.0" }, "engines": { diff --git a/package.json b/package.json index 8dab92b1af..f88c818041 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.6.0" + "cspell": "^8.6.1" } } From 4f5d27256317252a9c4cd1f3da9940f120f24a9d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:17:35 +0100 Subject: [PATCH 300/845] Bump LibGit2Sharp from 0.29.0 to 0.30.0 (#2617) Bumps [LibGit2Sharp](https://github.com/libgit2/libgit2sharp) from 0.29.0 to 0.30.0. - [Release notes](https://github.com/libgit2/libgit2sharp/releases) - [Changelog](https://github.com/libgit2/libgit2sharp/blob/master/CHANGES.md) - [Commits](https://github.com/libgit2/libgit2sharp/compare/0.29.0...0.30.0) --- updated-dependencies: - dependency-name: LibGit2Sharp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index b067c50e54..c78b1cc1ac 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -20,7 +20,7 @@ - + From 7632b789cee6dc4a739d12131fff8b3b467a6bed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:18:10 +0100 Subject: [PATCH 301/845] Bump Roslynator.Analyzers from 4.11.0 to 4.12.0 (#2618) Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.11.0 to 4.12.0. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.11.0...v4.12.0) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 86a6f88ad6..659076885a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From e8f1e1d1f24998225b89bea7a4783fab7ffc6094 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 14:23:30 +0000 Subject: [PATCH 302/845] Bump the nunit group with 2 updates Bumps the nunit group with 2 updates: [NUnit](https://github.com/nunit/nunit) and [System.Threading.Tasks.Extensions](https://github.com/dotnet/corefx). Updates `NUnit` from 4.0.1 to 4.1.0 - [Release notes](https://github.com/nunit/nunit/releases) - [Changelog](https://github.com/nunit/nunit/blob/master/CHANGES.md) - [Commits](https://github.com/nunit/nunit/compare/v4.0.1...4.1.0) Updates `System.Threading.Tasks.Extensions` from 4.5.0 to 4.5.4 - [Release notes](https://github.com/dotnet/corefx/releases) - [Commits](https://github.com/dotnet/corefx/commits) --- updated-dependencies: - dependency-name: NUnit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: nunit - dependency-name: System.Threading.Tasks.Extensions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: nunit ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index 576e2bd63e..81eb5f5fcd 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From d1a9b36f06af495fb47fa99196be6d81cef77579 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 14:24:21 +0000 Subject: [PATCH 303/845] Bump SharpCompress and System.Threading.Tasks.Extensions Bumps [SharpCompress](https://github.com/adamhathcock/sharpcompress) and [System.Threading.Tasks.Extensions](https://github.com/dotnet/corefx). These dependencies needed to be updated together. Updates `SharpCompress` from 0.35.0 to 0.36.0 - [Release notes](https://github.com/adamhathcock/sharpcompress/releases) - [Commits](https://github.com/adamhathcock/sharpcompress/compare/0.35.0...0.36.0) Updates `System.Threading.Tasks.Extensions` from 4.5.0 to 4.5.4 - [Release notes](https://github.com/dotnet/corefx/releases) - [Commits](https://github.com/dotnet/corefx/commits) --- updated-dependencies: - dependency-name: SharpCompress dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: System.Threading.Tasks.Extensions dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index c78b1cc1ac..b7ef57c8f8 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -23,6 +23,6 @@ - + From 3ab793137e9d28e351aebc920a9f92102ff6a8cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 14:19:43 +0000 Subject: [PATCH 304/845] Bump the xunit group with 5 updates Bumps the xunit group with 5 updates: | Package | From | To | | --- | --- | --- | | [xunit](https://github.com/xunit/xunit) | `2.6.5` | `2.7.0` | | [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) | `2.5.6` | `2.5.7` | | [Verify.Xunit](https://github.com/VerifyTests/Verify) | `22.11.4` | `23.7.1` | | [System.Collections.Immutable](https://github.com/dotnet/runtime) | `1.5.0` | `8.0.0` | | [System.Threading.Tasks.Extensions](https://github.com/dotnet/corefx) | `4.5.0` | `4.5.4` | Updates `xunit` from 2.6.5 to 2.7.0 - [Commits](https://github.com/xunit/xunit/compare/2.6.5...2.7.0) Updates `xunit.runner.visualstudio` from 2.5.6 to 2.5.7 - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.5.6...2.5.7) Updates `Verify.Xunit` from 22.11.4 to 23.7.1 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/22.11.4...23.7.1) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) Updates `System.Threading.Tasks.Extensions` from 4.5.0 to 4.5.4 - [Release notes](https://github.com/dotnet/corefx/releases) - [Commits](https://github.com/dotnet/corefx/commits) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: System.Threading.Tasks.Extensions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 6 +++--- Tests/FSharp.Specs/FSharp.Specs.fsproj | 4 ++-- .../FluentAssertions.Equivalency.Specs.csproj | 4 ++-- .../FluentAssertions.Extensibility.Specs.csproj | 4 ++-- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 4 ++-- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 4 ++-- Tests/VB.Specs/VB.Specs.vbproj | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 769356543b..fdd4b48b8d 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -6,14 +6,14 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 58e3564623..a730211fce 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -11,8 +11,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 4a812c12ab..f8aa29f222 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -28,8 +28,8 @@ - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index dca66d81da..fce9b4b1e4 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -18,8 +18,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 61eb7ee858..58b5159534 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -27,8 +27,8 @@ - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index 9bea9f502f..dd6233a747 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -12,8 +12,8 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index e898ccbc61..9fa4e0fdeb 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -7,8 +7,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all From d9207a86f3fffc8e1aba5a222835b19a7478f649 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 10 Apr 2024 18:05:27 +0200 Subject: [PATCH 305/845] Remove [UsesVerify] This is unneeded since v23.0.0 https://github.com/VerifyTests/Verify/milestone/312 --- Tests/Approval.Tests/ApiApproval.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Tests/Approval.Tests/ApiApproval.cs b/Tests/Approval.Tests/ApiApproval.cs index 071d5a0f61..0f44845123 100644 --- a/Tests/Approval.Tests/ApiApproval.cs +++ b/Tests/Approval.Tests/ApiApproval.cs @@ -13,7 +13,6 @@ namespace Approval.Tests; -[UsesVerify] public class ApiApproval { static ApiApproval() => VerifyDiffPlex.Initialize(OutputType.Minimal); From 26dfe171e2dd880f8b449439f3572a717e712cf9 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 10 Apr 2024 18:24:30 +0200 Subject: [PATCH 306/845] xunit.runner.console 2.6.5 -> 2.7.0 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index b7ef57c8f8..d6fd4f71b6 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -19,7 +19,7 @@ - + From fe24bb61fc8a2e7cd27cf10dbd3677a0e3083bc2 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 10 Apr 2024 19:25:19 +0200 Subject: [PATCH 307/845] MSTest 3.1.1 -> 3.3.1 --- .../TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 4 ++-- Tests/UWP.Specs/UWP.Specs.csproj | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 74c39c5461..77ffc88a76 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + \ No newline at end of file diff --git a/Tests/UWP.Specs/UWP.Specs.csproj b/Tests/UWP.Specs/UWP.Specs.csproj index 9c40f4b002..32318e9106 100644 --- a/Tests/UWP.Specs/UWP.Specs.csproj +++ b/Tests/UWP.Specs/UWP.Specs.csproj @@ -1,4 +1,4 @@ - + Debug @@ -19,6 +19,7 @@ false $(NoWarn);2008 true + true true @@ -86,14 +87,14 @@ 6.2.14 - 3.0.4 + 3.3.1 - 3.0.4 + 3.3.1 4.3.0 - + \ No newline at end of file From 767ab784b88d64e8ba71065aeb85d19c6656c36b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sun, 14 Apr 2024 19:21:33 +0200 Subject: [PATCH 308/845] Add option to ignore newline style when comparing strings for equivalency (#2565) --- .../Common/StringExtensions.cs | 6 +++++ .../CollectionMemberOptionsDecorator.cs | 2 ++ .../Equivalency/IEquivalencyOptions.cs | 8 ++++++ .../SelfReferenceEquivalencyOptions.cs | 15 +++++++++++ .../Steps/StringEqualityEquivalencyStep.cs | 5 ++++ .../Primitives/StringAssertions.cs | 14 ++++++++--- .../StringWildcardMatchingStrategy.cs | 19 ++++++++++++-- .../FluentAssertions/net47.verified.txt | 3 +++ .../FluentAssertions/net6.0.verified.txt | 3 +++ .../netstandard2.0.verified.txt | 3 +++ .../netstandard2.1.verified.txt | 3 +++ .../UsersOfGetClosedGenericInterfaces.cs | 4 +-- ...lectionAssertionSpecs.AllBeEquivalentTo.cs | 11 ++++++++ ...CollectionAssertionSpecs.BeEquivalentTo.cs | 11 ++++++++ .../ObjectAssertionSpecs.BeEquivalentTo.cs | 11 ++++++++ .../StringAssertionSpecs.BeEquivalentTo.cs | 25 +++++++++++++++++++ ...tringAssertionSpecs.ContainEquivalentOf.cs | 25 +++++++++++++++++++ ...tringAssertionSpecs.EndWithEquivalentOf.cs | 25 +++++++++++++++++++ .../StringAssertionSpecs.MatchEquivalentOf.cs | 25 +++++++++++++++++++ ...ingAssertionSpecs.StartWithEquivalentOf.cs | 25 +++++++++++++++++++ docs/_pages/releases.md | 1 + docs/_pages/strings.md | 11 ++++---- 22 files changed, 243 insertions(+), 12 deletions(-) diff --git a/Src/FluentAssertions/Common/StringExtensions.cs b/Src/FluentAssertions/Common/StringExtensions.cs index ef486429ef..e83ab55b24 100644 --- a/Src/FluentAssertions/Common/StringExtensions.cs +++ b/Src/FluentAssertions/Common/StringExtensions.cs @@ -121,6 +121,12 @@ public static string RemoveNewLines(this string @this) .Replace("\r", string.Empty, StringComparison.Ordinal); } + public static string RemoveNewlineStyle(this string @this) + { + return @this.Replace("\r\n", "\n", StringComparison.Ordinal) + .Replace("\r", "\n", StringComparison.Ordinal); + } + /// /// Counts the number of times the appears within a string by using the specified . /// diff --git a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs index a9dbb88892..acdf0654b5 100644 --- a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs +++ b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs @@ -79,5 +79,7 @@ public EqualityStrategy GetEqualityStrategy(Type type) public bool IgnoreCase => inner.IgnoreCase; + public bool IgnoreNewlineStyle => inner.IgnoreNewlineStyle; + public ITraceWriter TraceWriter => inner.TraceWriter; } diff --git a/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs index 4f00effa3e..c9bd15afff 100644 --- a/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs @@ -113,4 +113,12 @@ public interface IEquivalencyOptions /// Gets a value indicating whether a case-insensitive comparer is used when comparing s. /// bool IgnoreCase { get; } + + /// + /// Gets a value indicating whether the newline style is ignored when comparing s. + /// + /// + /// Enabling this option will replace all occurrences of \r\n and \r with \n in the strings before comparing them. + /// + bool IgnoreNewlineStyle { get; } } diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index eb7f447f82..f006bd7364 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -91,6 +91,7 @@ protected SelfReferenceEquivalencyOptions(IEquivalencyOptions defaults) IgnoreLeadingWhitespace = defaults.IgnoreLeadingWhitespace; IgnoreTrailingWhitespace = defaults.IgnoreTrailingWhitespace; IgnoreCase = defaults.IgnoreCase; + IgnoreNewlineStyle = defaults.IgnoreNewlineStyle; ConversionSelector = defaults.ConversionSelector.Clone(); @@ -191,6 +192,8 @@ EqualityStrategy IEquivalencyOptions.GetEqualityStrategy(Type type) public bool IgnoreCase { get; private set; } + public bool IgnoreNewlineStyle { get; private set; } + public ITraceWriter TraceWriter { get; private set; } /// @@ -732,6 +735,18 @@ public TSelf IgnoringCase() return (TSelf)this; } + /// + /// Instructs the comparison to ignore the newline style when comparing s. + /// + /// + /// Enabling this option will replace all occurences of \r\n and \r with \n in the strings before comparing them. + /// + public TSelf IgnoringNewlineStyle() + { + IgnoreNewlineStyle = true; + return (TSelf)this; + } + /// /// Returns the comparer for strings, which is either an explicitly specified comparer via or an ordinal comparer depending on . /// diff --git a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs index 692a375c61..502e42b43e 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs @@ -59,6 +59,11 @@ private static Func, EquivalencyOptions> o.IgnoringCase(); } + if (existingOptions.IgnoreNewlineStyle) + { + o.IgnoringNewlineStyle(); + } + return o; }; diff --git a/Src/FluentAssertions/Primitives/StringAssertions.cs b/Src/FluentAssertions/Primitives/StringAssertions.cs index 9a045dc0cc..ff968ea59d 100644 --- a/Src/FluentAssertions/Primitives/StringAssertions.cs +++ b/Src/FluentAssertions/Primitives/StringAssertions.cs @@ -406,7 +406,7 @@ public AndConstraint MatchEquivalentOf(string wildcardPattern, new StringWildcardMatchingStrategy { IgnoreCase = true, - IgnoreNewLineDifferences = true + IgnoreAllNewlines = true }, because, becauseArgs); @@ -470,7 +470,8 @@ public AndConstraint MatchEquivalentOf(string wildcardPattern, var stringWildcardMatchingValidator = new StringValidator( new StringWildcardMatchingStrategy { - IgnoreCase = options.IgnoreCase + IgnoreCase = options.IgnoreCase, + IgnoreNewlineStyle = options.IgnoreNewlineStyle, }, because, becauseArgs); @@ -529,7 +530,7 @@ public AndConstraint NotMatchEquivalentOf(string wildcardPattern, new StringWildcardMatchingStrategy { IgnoreCase = true, - IgnoreNewLineDifferences = true, + IgnoreAllNewlines = true, Negate = true }, because, becauseArgs); @@ -595,6 +596,7 @@ public AndConstraint NotMatchEquivalentOf(string wildcardPattern, new StringWildcardMatchingStrategy { IgnoreCase = options.IgnoreCase, + IgnoreNewlineStyle = options.IgnoreNewlineStyle, Negate = true }, because, becauseArgs); @@ -1994,6 +1996,7 @@ private static void ThrowIfValuesNullOrEmpty(IEnumerable values) /// /// When is set, whitespace is removed from the start of the .
/// When is set, whitespace is removed from the end of the .
+ /// When is set, all newlines (\r\n and \r) are replaced with \n in the .
///
private static string ApplyStringSettings(string value, IEquivalencyOptions options) { @@ -2007,6 +2010,11 @@ private static string ApplyStringSettings(string value, IEquivalencyOptions opti value = value.TrimEnd(); } + if (options.IgnoreNewlineStyle) + { + value = value.RemoveNewlineStyle(); + } + return value; } diff --git a/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs b/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs index 86b55566eb..82afb98462 100644 --- a/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs @@ -50,7 +50,17 @@ private static string ConvertWildcardToRegEx(string wildcardExpression) private string CleanNewLines(string input) { - return IgnoreNewLineDifferences ? input.RemoveNewLines() : input; + if (IgnoreAllNewlines) + { + return input.RemoveNewLines(); + } + + if (IgnoreNewlineStyle) + { + return input.RemoveNewlineStyle(); + } + + return input; } public string ExpectationDescription @@ -79,8 +89,13 @@ public string ExpectationDescription ///
public bool IgnoreCase { get; init; } + /// + /// Ignores all newline differences + /// + public bool IgnoreAllNewlines { get; init; } + /// /// Ignores the difference between environment newline differences /// - public bool IgnoreNewLineDifferences { get; init; } + public bool IgnoreNewlineStyle { get; init; } } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 67b570a31f..cb22440ad1 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -758,6 +758,7 @@ namespace FluentAssertions.Equivalency bool ExcludeNonBrowsableOnExpectation { get; } bool IgnoreCase { get; } bool IgnoreLeadingWhitespace { get; } + bool IgnoreNewlineStyle { get; } bool IgnoreNonBrowsableOnSubject { get; } bool IgnoreTrailingWhitespace { get; } FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } @@ -922,6 +923,7 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } public bool IgnoreCase { get; } public bool IgnoreLeadingWhitespace { get; } + public bool IgnoreNewlineStyle { get; } public bool IgnoreTrailingWhitespace { get; } [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } @@ -946,6 +948,7 @@ namespace FluentAssertions.Equivalency public TSelf IgnoringCase() { } public TSelf IgnoringCyclicReferences() { } public TSelf IgnoringLeadingWhitespace() { } + public TSelf IgnoringNewlineStyle() { } public TSelf IgnoringNonBrowsableMembersOnSubject() { } public TSelf IgnoringTrailingWhitespace() { } public TSelf Including(System.Linq.Expressions.Expression> predicate) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index d2525735ea..ac323e22bc 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -771,6 +771,7 @@ namespace FluentAssertions.Equivalency bool ExcludeNonBrowsableOnExpectation { get; } bool IgnoreCase { get; } bool IgnoreLeadingWhitespace { get; } + bool IgnoreNewlineStyle { get; } bool IgnoreNonBrowsableOnSubject { get; } bool IgnoreTrailingWhitespace { get; } FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } @@ -935,6 +936,7 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } public bool IgnoreCase { get; } public bool IgnoreLeadingWhitespace { get; } + public bool IgnoreNewlineStyle { get; } public bool IgnoreTrailingWhitespace { get; } [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } @@ -959,6 +961,7 @@ namespace FluentAssertions.Equivalency public TSelf IgnoringCase() { } public TSelf IgnoringCyclicReferences() { } public TSelf IgnoringLeadingWhitespace() { } + public TSelf IgnoringNewlineStyle() { } public TSelf IgnoringNonBrowsableMembersOnSubject() { } public TSelf IgnoringTrailingWhitespace() { } public TSelf Including(System.Linq.Expressions.Expression> predicate) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index cd69462dae..bac08b19ef 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -751,6 +751,7 @@ namespace FluentAssertions.Equivalency bool ExcludeNonBrowsableOnExpectation { get; } bool IgnoreCase { get; } bool IgnoreLeadingWhitespace { get; } + bool IgnoreNewlineStyle { get; } bool IgnoreNonBrowsableOnSubject { get; } bool IgnoreTrailingWhitespace { get; } FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } @@ -915,6 +916,7 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } public bool IgnoreCase { get; } public bool IgnoreLeadingWhitespace { get; } + public bool IgnoreNewlineStyle { get; } public bool IgnoreTrailingWhitespace { get; } [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } @@ -939,6 +941,7 @@ namespace FluentAssertions.Equivalency public TSelf IgnoringCase() { } public TSelf IgnoringCyclicReferences() { } public TSelf IgnoringLeadingWhitespace() { } + public TSelf IgnoringNewlineStyle() { } public TSelf IgnoringNonBrowsableMembersOnSubject() { } public TSelf IgnoringTrailingWhitespace() { } public TSelf Including(System.Linq.Expressions.Expression> predicate) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index d5001a9e2e..0d7512b8df 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -758,6 +758,7 @@ namespace FluentAssertions.Equivalency bool ExcludeNonBrowsableOnExpectation { get; } bool IgnoreCase { get; } bool IgnoreLeadingWhitespace { get; } + bool IgnoreNewlineStyle { get; } bool IgnoreNonBrowsableOnSubject { get; } bool IgnoreTrailingWhitespace { get; } FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } @@ -922,6 +923,7 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } public bool IgnoreCase { get; } public bool IgnoreLeadingWhitespace { get; } + public bool IgnoreNewlineStyle { get; } public bool IgnoreTrailingWhitespace { get; } [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } @@ -946,6 +948,7 @@ namespace FluentAssertions.Equivalency public TSelf IgnoringCase() { } public TSelf IgnoringCyclicReferences() { } public TSelf IgnoringLeadingWhitespace() { } + public TSelf IgnoringNewlineStyle() { } public TSelf IgnoringNonBrowsableMembersOnSubject() { } public TSelf IgnoringTrailingWhitespace() { } public TSelf Including(System.Linq.Expressions.Expression> predicate) { } diff --git a/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs b/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs index d2f62df92e..9261eb12ae 100644 --- a/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs +++ b/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs @@ -82,9 +82,9 @@ private class Config : IEquivalencyOptions public bool IgnoreTrailingWhitespace => throw new NotImplementedException(); - public bool IgnoreNewlines => throw new NotImplementedException(); - public bool IgnoreCase => throw new NotImplementedException(); + + public bool IgnoreNewlineStyle => throw new NotImplementedException(); } [Params(typeof(DBNull), typeof(bool), typeof(char), typeof(sbyte), typeof(byte), typeof(short), typeof(ushort), diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllBeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllBeEquivalentTo.cs index c3fb4692fc..0614e81c16 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllBeEquivalentTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.AllBeEquivalentTo.cs @@ -38,5 +38,16 @@ public void Can_ignore_trailing_whitespace_while_comparing_collections_of_string // Act / Assert actual.Should().AllBeEquivalentTo(expectation, o => o.IgnoringTrailingWhitespace()); } + + [Fact] + public void Can_ignore_newline_style_while_comparing_collections_of_strings() + { + // Arrange + var actual = new[] { "A\nB\nC", "A\r\nB\r\nC", "A\r\nB\nC", "A\nB\r\nC" }; + var expectation = "A\nB\nC"; + + // Act / Assert + actual.Should().AllBeEquivalentTo(expectation, o => o.IgnoringNewlineStyle()); + } } } diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs index fe55fdc977..6f4688bdce 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs @@ -191,6 +191,17 @@ public void Can_ignore_trailing_whitespace_while_comparing_collections_of_string // Act / Assert actual.Should().BeEquivalentTo(expectation, o => o.IgnoringTrailingWhitespace()); } + + [Fact] + public void Can_ignore_newline_style_while_comparing_collections_of_strings() + { + // Arrange + var actual = new[] { "first", "A\nB\r\nC", "last" }; + var expectation = new[] { "first", "A\r\nB\nC", "last" }; + + // Act / Assert + actual.Should().BeEquivalentTo(expectation, o => o.IgnoringNewlineStyle()); + } } public class NotBeEquivalentTo diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeEquivalentTo.cs index 5eb71291b7..7314247e55 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeEquivalentTo.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeEquivalentTo.cs @@ -38,5 +38,16 @@ public void Can_ignore_trailing_whitespace_while_comparing_objects_with_string_p // Act / Assert actual.Should().BeEquivalentTo(expectation, o => o.IgnoringTrailingWhitespace()); } + + [Fact] + public void Can_ignore_newline_style_while_comparing_objects_with_string_properties() + { + // Arrange + var actual = new { foo = "A\nB\r\nC" }; + var expectation = new { foo = "A\r\nB\nC" }; + + // Act / Assert + actual.Should().BeEquivalentTo(expectation, o => o.IgnoringNewlineStyle()); + } } } diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeEquivalentTo.cs index 39c00ceba5..224ba27749 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeEquivalentTo.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeEquivalentTo.cs @@ -72,6 +72,17 @@ public void Can_ignore_trailing_whitespace_while_comparing_strings_to_be_equival actual.Should().BeEquivalentTo(expect, o => o.IgnoringTrailingWhitespace()); } + [Fact] + public void Can_ignore_newline_style_while_comparing_strings_to_be_equivalent() + { + // Arrange + string actual = "A\nB\r\nC"; + string expect = "A\r\nB\nC"; + + // Act / Assert + actual.Should().BeEquivalentTo(expect, o => o.IgnoringNewlineStyle()); + } + [Fact] public void When_strings_are_the_same_while_ignoring_case_it_should_not_throw() { @@ -237,6 +248,20 @@ public void Can_ignore_trailing_whitespace_while_comparing_strings_to_not_be_equ act.Should().Throw(); } + [Fact] + public void Can_ignore_newline_style_while_comparing_strings_to_not_be_equivalent() + { + // Arrange + string actual = "\rA\nB\r\nC\n"; + string expect = "\nA\r\nB\nC\r"; + + // Act + Action act = () => actual.Should().NotBeEquivalentTo(expect, o => o.IgnoringNewlineStyle()); + + // Assert + act.Should().Throw(); + } + [Fact] public void When_strings_are_the_same_while_ignoring_case_it_should_throw() { diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.ContainEquivalentOf.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.ContainEquivalentOf.cs index 8ebda8e627..8bcf20ee55 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.ContainEquivalentOf.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.ContainEquivalentOf.cs @@ -71,6 +71,17 @@ public void Can_ignore_trailing_whitespace_while_checking_a_string_to_contain_an actual.Should().ContainEquivalentOf(expect, o => o.IgnoringTrailingWhitespace()); } + [Fact] + public void Can_ignore_newline_style_while_checking_a_string_to_contain_another() + { + // Arrange + string actual = "this is a string containing \rA\nB\r\nC.\n"; + string expect = "A\r\nB\nC"; + + // Act / Assert + actual.Should().ContainEquivalentOf(expect, o => o.IgnoringNewlineStyle()); + } + [InlineData("aa", "A")] [InlineData("aCCa", "acca")] [Theory] @@ -553,6 +564,20 @@ public void Can_ignore_trailing_whitespace_while_checking_a_string_to_not_contai act.Should().Throw(); } + [Fact] + public void Can_ignore_newline_style_while_checking_a_string_to_not_contain_another() + { + // Arrange + string actual = "this is a string containing \rA\nB\r\nC.\n"; + string expect = "\nA\r\nB\rC"; + + // Act + Action act = () => actual.Should().NotContainEquivalentOf(expect, o => o.IgnoringNewlineStyle()); + + // Assert + act.Should().Throw(); + } + [Fact] public void Should_fail_when_asserting_string_does_not_contain_equivalent_of_null() { diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.EndWithEquivalentOf.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.EndWithEquivalentOf.cs index 9fa4c6c089..d50012b9c6 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.EndWithEquivalentOf.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.EndWithEquivalentOf.cs @@ -72,6 +72,17 @@ public void Can_ignore_trailing_whitespace_while_checking_a_string_to_end_with_a actual.Should().EndWithEquivalentOf(expect, o => o.IgnoringTrailingWhitespace()); } + [Fact] + public void Can_ignore_newline_style_while_checking_a_string_to_end_with_another() + { + // Arrange + string actual = "prefix for \rA\nB\r\nC"; + string expect = "A\r\nB\nC"; + + // Act / Assert + actual.Should().EndWithEquivalentOf(expect, o => o.IgnoringNewlineStyle()); + } + [Fact] public void When_suffix_of_string_differs_by_case_only_it_should_not_throw() { @@ -229,6 +240,20 @@ public void Can_ignore_trailing_whitespace_while_checking_a_string_to_not_end_wi act.Should().Throw(); } + [Fact] + public void Can_ignore_newline_style_while_checking_a_string_to_not_end_with_another() + { + // Arrange + string actual = "prefix for \rA\nB\r\nC\n"; + string expect = "A\r\nB\nC\r"; + + // Act + Action act = () => actual.Should().NotEndWithEquivalentOf(expect, o => o.IgnoringNewlineStyle()); + + // Assert + act.Should().Throw(); + } + [Fact] public void When_asserting_string_does_not_end_with_equivalent_of_a_value_and_it_does_not_it_should_succeed() { diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.MatchEquivalentOf.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.MatchEquivalentOf.cs index 6dddc65b62..deb4105708 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.MatchEquivalentOf.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.MatchEquivalentOf.cs @@ -44,6 +44,17 @@ public void Can_ignore_trailing_whitespace_while_checking_a_string_to_match_anot actual.Should().MatchEquivalentOf(expect, o => o.IgnoringTrailingWhitespace()); } + [Fact] + public void Can_ignore_newline_style_while_checking_a_string_to_match_another() + { + // Arrange + string actual = "\rA\nB\r\nC\n"; + string expect = "\nA\r\n?\nC\r"; + + // Act / Assert + actual.Should().MatchEquivalentOf(expect, o => o.IgnoringNewlineStyle()); + } + [Fact] public void When_a_string_does_not_match_the_equivalent_of_a_wildcard_pattern_it_should_throw() { @@ -161,6 +172,20 @@ public void Can_ignore_trailing_whitespace_while_checking_a_string_to_not_match_ act.Should().Throw(); } + [Fact] + public void Can_ignore_newline_style_while_checking_a_string_to_not_match_another() + { + // Arrange + string actual = "\rA\nB\r\nC\n"; + string expect = "\nA\r\n?\nC\r"; + + // Act + Action act = () => actual.Should().NotMatchEquivalentOf(expect, o => o.IgnoringNewlineStyle()); + + // Assert + act.Should().Throw(); + } + [Fact] public void When_a_string_is_not_equivalent_to_a_pattern_and_that_is_expected_it_should_not_throw() { diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.StartWithEquivalentOf.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.StartWithEquivalentOf.cs index 7752da1c74..1caf965987 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.StartWithEquivalentOf.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.StartWithEquivalentOf.cs @@ -72,6 +72,17 @@ public void Can_ignore_trailing_whitespace_while_checking_a_string_to_start_with actual.Should().StartWithEquivalentOf(expect, o => o.IgnoringTrailingWhitespace()); } + [Fact] + public void Can_ignore_newline_style_while_checking_a_string_to_start_with_another() + { + // Arrange + string actual = "\rA\nB\r\nC\n with suffix"; + string expect = "\r\nA\rB\nC"; + + // Act / Assert + actual.Should().StartWithEquivalentOf(expect, o => o.IgnoringNewlineStyle()); + } + [Fact] public void When_start_of_string_differs_by_case_only_it_should_not_throw() { @@ -228,6 +239,20 @@ public void Can_ignore_trailing_whitespace_while_checking_a_string_to_not_start_ act.Should().Throw(); } + [Fact] + public void Can_ignore_newline_style_while_checking_a_string_to_not_start_with_another() + { + // Arrange + string actual = "\rA\nB\r\nC\n with suffix"; + string expect = "\nA\r\nB\rC"; + + // Act + Action act = () => actual.Should().NotStartWithEquivalentOf(expect, o => o.IgnoringNewlineStyle()); + + // Assert + act.Should().Throw(); + } + [Fact] public void When_asserting_string_does_not_start_with_equivalent_of_a_value_and_it_does_not_it_should_succeed() { diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 0d6f466d5c..d0865a2c50 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -21,6 +21,7 @@ sidebar: * Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) * Allow specifying `EquivalencyOptions` in string assertions - [#2413](https://github.com/fluentassertions/fluentassertions/pull/2413) * This also adds the capability to ignore casing, leading or trailing whitespace on strings when using `BeEquivalentTo` on object graphs or collections. + * Also adds the capability to ignore the newline style on strings - [#2565](https://github.com/fluentassertions/fluentassertions/pull/2565) * You can mark all assertions in an assembly as custom assertions using the `[CustomAssertionsAssembly]` attribute - [#2389](https://github.com/fluentassertions/fluentassertions/pull/2389) * Improve `BeEmpty()` and `BeNullOrEmpty()` performance for `IEnumerable`, by materializing only the first item - [#2530](https://github.com/fluentassertions/fluentassertions/pull/2530) * All `Should()` methods on reference types are now annotated with the `[NotNull]` attribute for a better Fluent Assertions experience when nullable reference types are enabled - [#2380](https://github.com/fluentassertions/fluentassertions/pull/2380) diff --git a/docs/_pages/strings.md b/docs/_pages/strings.md index 7ad2f91492..98b981e848 100644 --- a/docs/_pages/strings.md +++ b/docs/_pages/strings.md @@ -84,11 +84,12 @@ theString.Should().BeEquivalentTo("This is a string", o => o.IgnoringLeadingWhit The supported options are: -| Option | Behavior | -| ---------------------------- | --------------------------------------------------------------- | -| `IgnoringLeadingWhitespace` | Ignores leading whitespace in the subject and the expectation. | -| `IgnoringTrailingWhitespace` | Ignores trailing whitespace in the subject and the expectation. | -| `IgnoringCase` | Compares the strings case-insensitive. | +| Option | Behavior | +| ---------------------------- | ------------------------------------------------------------------------------------------------- | +| `IgnoringLeadingWhitespace` | Ignores leading whitespace in the subject and the expectation. | +| `IgnoringTrailingWhitespace` | Ignores trailing whitespace in the subject and the expectation. | +| `IgnoringCase` | Compares the strings case-insensitive. | +| `IgnoringNewlineStyle` | Replaces `"\r\n"` and `"\r"` with `"\n"` before comparing the subject and expectation. | You can also specify a custom string comparer via ```csharp From 060c4632f284ca97008ca40937153018131b4e3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:33:10 +0000 Subject: [PATCH 309/845] Bump cspell from 8.6.1 to 8.7.0 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.6.1 to 8.7.0. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.7.0/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 188 ++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 98 insertions(+), 92 deletions(-) diff --git a/package-lock.json b/package-lock.json index df6cb29770..8d5b7afe2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.6.1" + "cspell": "^8.7.0" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.6.1.tgz", - "integrity": "sha512-s6Av1xIgctYLuUiazKZjQ2WRUXc9dU38BOZXwM/lb7y8grQMEuTjST1c+8MOkZkppx48/sO7GHIF3k9rEzD3fg==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.7.0.tgz", + "integrity": "sha512-B5YQI7Dd9m0JHTmHgs7PiyP4BWXzl8ixpK+HGOwhxzh7GyfFt1Eo/gxMxBDX/9SaewEzeb2OjRpRKEFtEsto3A==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.1", @@ -48,6 +48,7 @@ "@cspell/dict-lorem-ipsum": "^4.0.0", "@cspell/dict-lua": "^4.0.3", "@cspell/dict-makefile": "^1.0.0", + "@cspell/dict-monkeyc": "^1.0.6", "@cspell/dict-node": "^4.0.3", "@cspell/dict-npm": "^5.0.15", "@cspell/dict-php": "^4.0.6", @@ -71,28 +72,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.6.1.tgz", - "integrity": "sha512-75cmJgU9iQgrDnLFIUyvgybySJJi29BPw71z+8ZO9WhNofufxoSjaWepZeYV2nK0nHXM+MbdQG5Mmj/Lv6J1FA==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.7.0.tgz", + "integrity": "sha512-LTQPEvXvCqnc+ok9WXpSISZyt4/nGse9fVEM430g0BpGzKpt3RMx49B8uasvvnanzCuikaW9+wFLmwgvraERhA==", "dependencies": { - "@cspell/cspell-types": "8.6.1" + "@cspell/cspell-types": "8.7.0" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.6.1.tgz", - "integrity": "sha512-guIlGhhOLQwfqevBSgp26b+SX4I1hCH+puAksWAk93bybKkcGtGpcavAQSN9qvamox4zcHnvGutEPF+UcXuceQ==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.7.0.tgz", + "integrity": "sha512-ePqddIQ4arqPQgOkC146SkZxvZb9/jL7xIM5Igy2n3tiWTC5ijrX/mbHpPZ1VGcFck+1M0cJUuyhuJk+vMj3rg==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.6.1.tgz", - "integrity": "sha512-ZUbYcvEhfokHG9qfUlIylUqEobG84PiDozCkE8U4h/rTSmYkf/nAD+M6yg+jQ0F2aTFGNbvpKKGFlfXFXveX7A==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.7.0.tgz", + "integrity": "sha512-grZwDFYqcBYQDaz4AkUtdyqc4UUH2J3/7yWVkBbYDPE+FQHa9ofFXzXxyjs56GJlPfi9ULpe5/Wz6uVLg8rQkQ==", "dependencies": { "global-directory": "^4.0.1" }, @@ -101,17 +102,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.6.1.tgz", - "integrity": "sha512-WpI3fSW8t00UMetfd6tS8f9+xE3+ElIUO/bQ1YKK95TMIRdEUcH+QDxcHM66pJXEm4WiaN3H/MfWk1fIhGlJ8g==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.7.0.tgz", + "integrity": "sha512-KW48iu0nTDzbedixc7iB7K7mlAZQ7QeMLuM/akxigOlvtOdVJrRa9Pfn44lwejts1ANb/IXil3GH8YylkVi76Q==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.6.1.tgz", - "integrity": "sha512-MXa9v6sXbbwyiNno7v7vczNph6AsMNWnpMRCcW3h/siXNQYRuMssdxqT5sQJ8Kurh3M/Wo7DlKX4n74elKL3iQ==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.7.0.tgz", + "integrity": "sha512-Rb+LCE5I9JEb/LE8nSViVSF8z1CWv/z4mPBIG37VMa7aUx2gAQa6gJekNfpY9YZiMzx4Tv3gDujN80ytks4pGA==", "engines": { "node": ">=18" } @@ -187,9 +188,9 @@ "integrity": "sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q==" }, "node_modules/@cspell/dict-en_us": { - "version": "4.3.17", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.17.tgz", - "integrity": "sha512-CS0Tb2f2YwQZ4VZ6+WLAO5uOzb0iO/iYSRl34kX4enq6quXxLYzwdfGAwv85wSYHPdga8tGiZFP+p8GPsi2JEg==" + "version": "4.3.18", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.18.tgz", + "integrity": "sha512-D8jGT7Zi3+e8zIpT0NqGKvvzehcvUETFlOA0NxcRStkw7H7mgouHxKFU+u7t3tvCoGNwh2gwjCqZQlK8ZXwQHw==" }, "node_modules/@cspell/dict-en-common-misspellings": { "version": "2.0.0", @@ -286,6 +287,11 @@ "resolved": "https://registry.npmjs.org/@cspell/dict-makefile/-/dict-makefile-1.0.0.tgz", "integrity": "sha512-3W9tHPcSbJa6s0bcqWo6VisEDTSN5zOtDbnPabF7rbyjRpNo0uHXHRJQF8gAbFzoTzBBhgkTmrfSiuyQm7vBUQ==" }, + "node_modules/@cspell/dict-monkeyc": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-monkeyc/-/dict-monkeyc-1.0.6.tgz", + "integrity": "sha512-oO8ZDu/FtZ55aq9Mb67HtaCnsLn59xvhO/t2mLLTHAp667hJFxpp7bCtr2zOrR1NELzFXmKln/2lw/PvxMSvrA==" + }, "node_modules/@cspell/dict-node": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-4.0.3.tgz", @@ -365,9 +371,9 @@ "integrity": "sha512-Ak+vy4HP/bOgzf06BAMC30+ZvL9mzv21xLM2XtfnBLTDJGdxlk/nK0U6QT8VfFLqJ0ZZSpyOxGsUebWDCTr/zQ==" }, "node_modules/@cspell/dict-typescript": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.2.tgz", - "integrity": "sha512-lcNOYWjLUvDZdLa0UMNd/LwfVdxhE9rKA+agZBGjL3lTA3uNvH7IUqSJM/IXhJoBpLLMVEOk8v1N9xi+vDuCdA==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.3.tgz", + "integrity": "sha512-TdD789OWwOImH/IMyz/QRA6LJz7ScI/qbn1YOkcAW3AROvgbc0oKAxzp08+Xu8tj4GROrJ9UqZdh0t9xQCPkPg==" }, "node_modules/@cspell/dict-vue": { "version": "3.0.0", @@ -375,9 +381,9 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.6.1.tgz", - "integrity": "sha512-Fjvkcb5umIAcHfw/iiciYWgO2mXVuRZzQAWPSub6UFCxxcJlRz39YPXa+3O/m3lnXCeo8ChoaEN8qnuV4ogk6g==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.7.0.tgz", + "integrity": "sha512-xlEPdiHVDu+4xYkvwjL9MgklxOi9XB+Pr1H9s3Ww9WEq+q6BA3xOHxLIU/k8mhqFTMZGFZRCsdy/EwMu6SyRhQ==", "dependencies": { "import-meta-resolve": "^4.0.0" }, @@ -386,9 +392,9 @@ } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.6.1.tgz", - "integrity": "sha512-X6/7cy+GGVJFXsfrZapxVKn5mtehNTr7hTlg0bVj3iFoNYEPW9zq9l6WIcI4psmaU8G4DSrNsBK7pp87W3u16A==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.7.0.tgz", + "integrity": "sha512-0bo0WwDr2lzGoCP7vbpWbDpPyuOrHKK+218txnUpx6Pn1EDBLfcDQsiZED5B6zlpwgbGi6y3vc0rWtJbjKvwzg==", "engines": { "node": ">=18" } @@ -654,21 +660,21 @@ } }, "node_modules/cspell": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.6.1.tgz", - "integrity": "sha512-/Qle15v4IQe7tViSWX0+RCZJ2HJ4HUCZV9Z4uOVasNUz+DWCrxysNR+pfCRYuLX/6lQdqCM9QCR9GZc7a2KIVA==", - "dependencies": { - "@cspell/cspell-json-reporter": "8.6.1", - "@cspell/cspell-pipe": "8.6.1", - "@cspell/cspell-types": "8.6.1", - "@cspell/dynamic-import": "8.6.1", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.7.0.tgz", + "integrity": "sha512-77nRPgLl240C6FK8RKVKo34lP15Lzp/6bk+SKYJFwUKKXlcgWXDis+Lw4JolA741/JgHtuxmhW1C8P7dCKjJ3w==", + "dependencies": { + "@cspell/cspell-json-reporter": "8.7.0", + "@cspell/cspell-pipe": "8.7.0", + "@cspell/cspell-types": "8.7.0", + "@cspell/dynamic-import": "8.7.0", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.0.0", - "cspell-gitignore": "8.6.1", - "cspell-glob": "8.6.1", - "cspell-io": "8.6.1", - "cspell-lib": "8.6.1", + "cspell-gitignore": "8.7.0", + "cspell-glob": "8.7.0", + "cspell-io": "8.7.0", + "cspell-lib": "8.7.0", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^8.0.0", @@ -689,11 +695,11 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.6.1.tgz", - "integrity": "sha512-I6LatgXJb8mxKFzIywO81TlUD/qWnUDrhB6yTUPdP90bwZcXMmGoCsZxhd2Rvl9fz5fWne0T839I1coShfm86g==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.7.0.tgz", + "integrity": "sha512-depsd01GbLBo71/tfRrL5iECWQLS4CjCxA9C01dVkFAJqVB0s+K9KLKjTlq5aHOhcvo9Z3dHV+bGQCf5/Q7bfw==", "dependencies": { - "@cspell/cspell-types": "8.6.1", + "@cspell/cspell-types": "8.7.0", "comment-json": "^4.2.3", "yaml": "^2.4.1" }, @@ -702,13 +708,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.6.1.tgz", - "integrity": "sha512-0SfKPi1QoWbGpZ/rWMR7Jn0+GaQT9PAMLWjVOu66PUNUXI5f4oCTHpnZE1Xts+5VX8shZC3TAMHEgtgKuQn4RQ==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.7.0.tgz", + "integrity": "sha512-S6IpZSzIMxlOO/33NgCOuP0TPH2mZbw8d5CP44z5jajflloq8l74MeJLkeDzYfCRcm0Rtk0A5drBeMg+Ai34OA==", "dependencies": { - "@cspell/cspell-pipe": "8.6.1", - "@cspell/cspell-types": "8.6.1", - "cspell-trie-lib": "8.6.1", + "@cspell/cspell-pipe": "8.7.0", + "@cspell/cspell-types": "8.7.0", + "cspell-trie-lib": "8.7.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0" }, @@ -717,11 +723,11 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.6.1.tgz", - "integrity": "sha512-3gtt351sSDfN826aMXTqGHVLz2lz9ZHr8uemImUc24Q+676sXkJM9lXzqP8PUqwGhLyt5qSf+9pt0ieNwQy/cA==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.7.0.tgz", + "integrity": "sha512-yvUZ86qyopUpDgn+YXP1qTpUe/lp65ZFvpMtw21lWHTFlg1OWKntr349EQU/5ben/K6koxk1FiElCBV7Lr4uFg==", "dependencies": { - "cspell-glob": "8.6.1", + "cspell-glob": "8.7.0", "find-up-simple": "^1.0.0" }, "bin": { @@ -732,9 +738,9 @@ } }, "node_modules/cspell-glob": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.6.1.tgz", - "integrity": "sha512-QjtngIR0XsUQLmHHDO86hps/JR5sRxSBwCvcsNCEmSdpdofLFc8cuxi3o33JWge7UAPBCQOLGfpA7/Wx31srmw==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.7.0.tgz", + "integrity": "sha512-AMdfx0gvROA/aIL8t8b5Y5NtMgscGZELFj6WhCSZiQSuWRxXUKiLGGLUFjx2y0hgXN9LUYOo6aBjvhnxI/v71g==", "dependencies": { "micromatch": "^4.0.5" }, @@ -743,12 +749,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.6.1.tgz", - "integrity": "sha512-MaG0e/F0b2FnIRULCZ61JxEiJgTP/6rsbUoR5nG9X+WmJYItYmxC1F/FPPrVeTu+jJr/8O4pdnslE20pimHaCw==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.7.0.tgz", + "integrity": "sha512-SGcXc7322wU2WNRi7vtpToWDXTqZHhxqvR+aIXHT2kkxlMSWp3Rvfpshd0ckgY54nZtgw7R/JtKND2jeACRpwQ==", "dependencies": { - "@cspell/cspell-pipe": "8.6.1", - "@cspell/cspell-types": "8.6.1" + "@cspell/cspell-pipe": "8.7.0", + "@cspell/cspell-types": "8.7.0" }, "bin": { "cspell-grammar": "bin.mjs" @@ -758,36 +764,36 @@ } }, "node_modules/cspell-io": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.6.1.tgz", - "integrity": "sha512-ofxBB8QtUPvh/bOwKLYsqU1hwQCet8E98jkn/5f4jtG+/x5Zd80I0Ez+tlbjiBmrrQfOKh+i8ipfzHD8JtoreQ==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.7.0.tgz", + "integrity": "sha512-o7OltyyvVkRG1gQrIqGpN5pUkHNnv6rvihb7Qu6cJ8jITinLGuWJuEQpgt0eF5yIr624jDbFwSzAxsFox8riQg==", "dependencies": { - "@cspell/cspell-service-bus": "8.6.1" + "@cspell/cspell-service-bus": "8.7.0" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.6.1.tgz", - "integrity": "sha512-kGeDUypRtThFT81IdUK7yU8eUwO5MYWj8pGQ0N8WFsqbCahJrUdcocceVSpnCX48W3CXu12DkqYG9kv5Umn7Xw==", - "dependencies": { - "@cspell/cspell-bundled-dicts": "8.6.1", - "@cspell/cspell-pipe": "8.6.1", - "@cspell/cspell-resolver": "8.6.1", - "@cspell/cspell-types": "8.6.1", - "@cspell/dynamic-import": "8.6.1", - "@cspell/strong-weak-map": "8.6.1", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.7.0.tgz", + "integrity": "sha512-qDSHZGekwiDmouYRECTQokE+hgAuPqREm+Hb+G3DoIo3ZK5H47TtEUo8fNCw22XsKefcF8X28LiyoZwiYHVpSg==", + "dependencies": { + "@cspell/cspell-bundled-dicts": "8.7.0", + "@cspell/cspell-pipe": "8.7.0", + "@cspell/cspell-resolver": "8.7.0", + "@cspell/cspell-types": "8.7.0", + "@cspell/dynamic-import": "8.7.0", + "@cspell/strong-weak-map": "8.7.0", "clear-module": "^4.1.2", "comment-json": "^4.2.3", "configstore": "^6.0.0", - "cspell-config-lib": "8.6.1", - "cspell-dictionary": "8.6.1", - "cspell-glob": "8.6.1", - "cspell-grammar": "8.6.1", - "cspell-io": "8.6.1", - "cspell-trie-lib": "8.6.1", + "cspell-config-lib": "8.7.0", + "cspell-dictionary": "8.7.0", + "cspell-glob": "8.7.0", + "cspell-grammar": "8.7.0", + "cspell-io": "8.7.0", + "cspell-trie-lib": "8.7.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", "import-fresh": "^3.3.0", @@ -800,12 +806,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.6.1.tgz", - "integrity": "sha512-iuJuAyWoqTH/TpFAR/ISJGQQoW3oiw54GyvXIucPoCJt/jgQONDuzqPW+skiLvcgcTbXCN9dutZTb2gImIkmpw==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.7.0.tgz", + "integrity": "sha512-W3Nh2cO7gMV91r+hLqyTMgKlvRl4W5diKs5YiyOxjZumRkMBy42IzcNYtgIIacOxghklv96F5Bd1Vx/zY6ylGA==", "dependencies": { - "@cspell/cspell-pipe": "8.6.1", - "@cspell/cspell-types": "8.6.1", + "@cspell/cspell-pipe": "8.7.0", + "@cspell/cspell-types": "8.7.0", "gensequence": "^7.0.0" }, "engines": { diff --git a/package.json b/package.json index f88c818041..7e05958266 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.6.1" + "cspell": "^8.7.0" } } From f0be20aa7421c473820fd49d50cce8c2587ae582 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 19:18:55 +0200 Subject: [PATCH 310/845] Bump JetBrains/qodana-action from 2023.3 to 2024.1 (#2631) Bumps [JetBrains/qodana-action](https://github.com/jetbrains/qodana-action) from 2023.3 to 2024.1. - [Release notes](https://github.com/jetbrains/qodana-action/releases) - [Commits](https://github.com/jetbrains/qodana-action/compare/v2023.3...v2024.1) --- updated-dependencies: - dependency-name: JetBrains/qodana-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index 8c8478eef9..b6cca66b76 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.merge_commit_sha }} fetch-depth: 0 - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2023.3 + uses: JetBrains/qodana-action@v2024.1 with: upload-result: ${{ github.ref_name == 'master' || github.ref_name == 'develop' }} args: --baseline,qodana.sarif.json,--ide,QDNET From 13d6c527f60ca3a2daf50f7e94ab198695b51b36 Mon Sep 17 00:00:00 2001 From: hybloid <48032702+hybloid@users.noreply.github.com> Date: Sat, 11 May 2024 10:00:51 +0200 Subject: [PATCH 311/845] Roll back qodana-action to v2023.3 (#2637) Need to temporally roll back GH action, to fix the experienced issue. --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index b6cca66b76..8c8478eef9 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.merge_commit_sha }} fetch-depth: 0 - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2024.1 + uses: JetBrains/qodana-action@v2023.3 with: upload-result: ${{ github.ref_name == 'master' || github.ref_name == 'develop' }} args: --baseline,qodana.sarif.json,--ide,QDNET From bad8eda0a8dedad24cb1730d278000763ddf33d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 17:39:23 +0200 Subject: [PATCH 312/845] Bump Bogus from 35.5.0 to 35.5.1 (#2642) Bumps [Bogus](https://github.com/bchavez/Bogus) from 35.5.0 to 35.5.1. - [Release notes](https://github.com/bchavez/Bogus/releases) - [Changelog](https://github.com/bchavez/Bogus/blob/master/HISTORY.md) - [Commits](https://github.com/bchavez/Bogus/compare/v35.5.0...v35.5.1) --- updated-dependencies: - dependency-name: Bogus dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Benchmarks/Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index ab229fee85..cf93404377 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -10,7 +10,7 @@ - + From ee301aeedcadc0cf8700940432873052ba039b51 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 17:40:54 +0200 Subject: [PATCH 313/845] Bump Meziantou.Analyzer from 2.0.146 to 2.0.150 (#2644) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.146 to 2.0.150. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.146...2.0.150) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 659076885a..f337cbcb5b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 3d1be5e9195221611222cc4376ff25b83ab17622 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 17:41:38 +0200 Subject: [PATCH 314/845] Bump SharpCompress and System.Threading.Tasks.Extensions (#2641) Bumps [SharpCompress](https://github.com/adamhathcock/sharpcompress) and [System.Threading.Tasks.Extensions](https://github.com/dotnet/corefx). These dependencies needed to be updated together. Updates `SharpCompress` from 0.36.0 to 0.37.2 - [Release notes](https://github.com/adamhathcock/sharpcompress/releases) - [Commits](https://github.com/adamhathcock/sharpcompress/compare/0.36.0...0.37.2) Updates `System.Threading.Tasks.Extensions` from 4.5.0 to 4.5.4 - [Release notes](https://github.com/dotnet/corefx/releases) - [Commits](https://github.com/dotnet/corefx/commits) --- updated-dependencies: - dependency-name: SharpCompress dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: System.Threading.Tasks.Extensions dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index d6fd4f71b6..b1c772ee34 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -23,6 +23,6 @@ - + From 0c88ae725c875962ea76c3328e51dd61000ef649 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 08:04:37 +0200 Subject: [PATCH 315/845] Bump nokogiri from 1.16.2 to 1.16.5 in /docs (#2645) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.16.2 to 1.16.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.16.2...v1.16.5) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 2530974e8e..c8f9931ab9 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -224,9 +224,9 @@ GEM mutex_m (0.2.0) net-http (0.4.1) uri - nokogiri (1.16.2-x64-mingw-ucrt) + nokogiri (1.16.5-x64-mingw-ucrt) racc (~> 1.4) - nokogiri (1.16.2-x86_64-linux) + nokogiri (1.16.5-x86_64-linux) racc (~> 1.4) octokit (4.25.1) faraday (>= 1, < 3) From 7aa57b340f3aba686d2917779b22a35d09e5d451 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 06:38:10 +0000 Subject: [PATCH 316/845] Bump cspell from 8.7.0 to 8.8.1 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.7.0 to 8.8.1. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.8.1/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 390 ++++++++++++++++------------------------------ package.json | 2 +- 2 files changed, 132 insertions(+), 260 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8d5b7afe2b..07bc2edadc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.7.0" + "cspell": "^8.8.1" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.7.0.tgz", - "integrity": "sha512-B5YQI7Dd9m0JHTmHgs7PiyP4BWXzl8ixpK+HGOwhxzh7GyfFt1Eo/gxMxBDX/9SaewEzeb2OjRpRKEFtEsto3A==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.8.1.tgz", + "integrity": "sha512-zP/cC7ABk9PM6X1/itEOYa9raWrdUtUXCcUtHLnEr83HhPUHZ8vzaBgMJ176No/7EgZ4BHGXVvA0v079ukXVxw==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.1", @@ -28,7 +28,7 @@ "@cspell/dict-docker": "^1.1.7", "@cspell/dict-dotnet": "^5.0.0", "@cspell/dict-elixir": "^4.0.3", - "@cspell/dict-en_us": "^4.3.17", + "@cspell/dict-en_us": "^4.3.19", "@cspell/dict-en-common-misspellings": "^2.0.0", "@cspell/dict-en-gb": "1.1.33", "@cspell/dict-filetypes": "^3.0.3", @@ -49,7 +49,7 @@ "@cspell/dict-lua": "^4.0.3", "@cspell/dict-makefile": "^1.0.0", "@cspell/dict-monkeyc": "^1.0.6", - "@cspell/dict-node": "^4.0.3", + "@cspell/dict-node": "^5.0.1", "@cspell/dict-npm": "^5.0.15", "@cspell/dict-php": "^4.0.6", "@cspell/dict-powershell": "^5.0.3", @@ -57,14 +57,14 @@ "@cspell/dict-python": "^4.1.11", "@cspell/dict-r": "^2.0.1", "@cspell/dict-ruby": "^5.0.2", - "@cspell/dict-rust": "^4.0.2", + "@cspell/dict-rust": "^4.0.3", "@cspell/dict-scala": "^5.0.0", - "@cspell/dict-software-terms": "^3.3.18", + "@cspell/dict-software-terms": "^3.3.20", "@cspell/dict-sql": "^2.1.3", "@cspell/dict-svelte": "^1.0.2", "@cspell/dict-swift": "^2.0.1", "@cspell/dict-terraform": "^1.0.0", - "@cspell/dict-typescript": "^3.1.2", + "@cspell/dict-typescript": "^3.1.4", "@cspell/dict-vue": "^3.0.0" }, "engines": { @@ -72,28 +72,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.7.0.tgz", - "integrity": "sha512-LTQPEvXvCqnc+ok9WXpSISZyt4/nGse9fVEM430g0BpGzKpt3RMx49B8uasvvnanzCuikaW9+wFLmwgvraERhA==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.8.1.tgz", + "integrity": "sha512-HtendGGO0w1gElhSYsD4D9iKT1nMBoUP31y0Ndw3AtQRzH6I31lx6DWnrXIef1bTL4wdq7ocxgG5HGQBQ8PWfA==", "dependencies": { - "@cspell/cspell-types": "8.7.0" + "@cspell/cspell-types": "8.8.1" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.7.0.tgz", - "integrity": "sha512-ePqddIQ4arqPQgOkC146SkZxvZb9/jL7xIM5Igy2n3tiWTC5ijrX/mbHpPZ1VGcFck+1M0cJUuyhuJk+vMj3rg==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.8.1.tgz", + "integrity": "sha512-AMQ0s7qH71tNnrpX8ILl+OZceDHt//h/T3Yk//qvn69x1Dzfg4Saqv/qhfG1VClQVyV5F4y7tIa4UNd5X6mW4g==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.7.0.tgz", - "integrity": "sha512-grZwDFYqcBYQDaz4AkUtdyqc4UUH2J3/7yWVkBbYDPE+FQHa9ofFXzXxyjs56GJlPfi9ULpe5/Wz6uVLg8rQkQ==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.8.1.tgz", + "integrity": "sha512-K5sPp05Pz3tYU9roFGILSB6OdSVYqyr4Y/NW1CxZsXgq+hmwxAJQag/RyhW6cUp/1Jhy5RKYGNy0H0u/jODx3A==", "dependencies": { "global-directory": "^4.0.1" }, @@ -102,17 +102,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.7.0.tgz", - "integrity": "sha512-KW48iu0nTDzbedixc7iB7K7mlAZQ7QeMLuM/akxigOlvtOdVJrRa9Pfn44lwejts1ANb/IXil3GH8YylkVi76Q==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.8.1.tgz", + "integrity": "sha512-dxZ/ymwP6XNMGkU5iIUVgFP2JEqEvpJZavpAerB/y5E560Agv1WuUpkZE/PMCmseoLjSiV5yQzcnLNoT5X/w7A==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.7.0.tgz", - "integrity": "sha512-Rb+LCE5I9JEb/LE8nSViVSF8z1CWv/z4mPBIG37VMa7aUx2gAQa6gJekNfpY9YZiMzx4Tv3gDujN80ytks4pGA==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.8.1.tgz", + "integrity": "sha512-JEbLN+b3XdHIpEaoZJnpPfL8iTKWraqE7x1VwG7FIQ9wjP6fCPwfNRVM0CUWEmT+85O/zvbYVOlTJn1uIOLnZw==", "engines": { "node": ">=18" } @@ -188,9 +188,9 @@ "integrity": "sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q==" }, "node_modules/@cspell/dict-en_us": { - "version": "4.3.18", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.18.tgz", - "integrity": "sha512-D8jGT7Zi3+e8zIpT0NqGKvvzehcvUETFlOA0NxcRStkw7H7mgouHxKFU+u7t3tvCoGNwh2gwjCqZQlK8ZXwQHw==" + "version": "4.3.19", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.19.tgz", + "integrity": "sha512-tHcXdkmm0t9LlRct1vgu3+h0KW/wlXCInkTiR4D/rl730q1zu2qVEgiy1saMiTUSNmdu7Hiy+Mhb+1braVqnZQ==" }, "node_modules/@cspell/dict-en-common-misspellings": { "version": "2.0.0", @@ -293,9 +293,9 @@ "integrity": "sha512-oO8ZDu/FtZ55aq9Mb67HtaCnsLn59xvhO/t2mLLTHAp667hJFxpp7bCtr2zOrR1NELzFXmKln/2lw/PvxMSvrA==" }, "node_modules/@cspell/dict-node": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-4.0.3.tgz", - "integrity": "sha512-sFlUNI5kOogy49KtPg8SMQYirDGIAoKBO3+cDLIwD4MLdsWy1q0upc7pzGht3mrjuyMiPRUV14Bb0rkVLrxOhg==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.1.tgz", + "integrity": "sha512-lax/jGz9h3Dv83v8LHa5G0bf6wm8YVRMzbjJPG/9rp7cAGPtdrga+XANFq+B7bY5+jiSA3zvj10LUFCFjnnCCg==" }, "node_modules/@cspell/dict-npm": { "version": "5.0.15", @@ -336,9 +336,9 @@ "integrity": "sha512-cIh8KTjpldzFzKGgrqUX4bFyav5lC52hXDKo4LbRuMVncs3zg4hcSf4HtURY+f2AfEZzN6ZKzXafQpThq3dl2g==" }, "node_modules/@cspell/dict-rust": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.2.tgz", - "integrity": "sha512-RhziKDrklzOntxAbY3AvNR58wnFGIo3YS8+dNeLY36GFuWOvXDHFStYw5Pod4f/VXbO/+1tXtywCC4zWfB2p1w==" + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.3.tgz", + "integrity": "sha512-8DFCzkFQ+2k3fDaezWc/D+0AyiBBiOGYfSDUfrTNU7wpvUvJ6cRcAUshMI/cn2QW/mmxTspRgVlXsE6GUMz00Q==" }, "node_modules/@cspell/dict-scala": { "version": "5.0.0", @@ -346,9 +346,9 @@ "integrity": "sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ==" }, "node_modules/@cspell/dict-software-terms": { - "version": "3.3.18", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.3.18.tgz", - "integrity": "sha512-LJZGGMGqS8KzgXJrSMs3T+6GoqHG9z8Bc+rqLzLzbtoR3FbsMasE9U8oP2PmS3q7jJLFjQkzmg508DrcuZuo2g==" + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.3.20.tgz", + "integrity": "sha512-KmPwCxYWEu7SGyT/0m/n6i6R4ZgxbmN3XcerzA6Z629Wm5iZTVfJaMWqDK2RKAyBawS7OMfxGz0W/wYU4FhJlA==" }, "node_modules/@cspell/dict-sql": { "version": "2.1.3", @@ -371,9 +371,9 @@ "integrity": "sha512-Ak+vy4HP/bOgzf06BAMC30+ZvL9mzv21xLM2XtfnBLTDJGdxlk/nK0U6QT8VfFLqJ0ZZSpyOxGsUebWDCTr/zQ==" }, "node_modules/@cspell/dict-typescript": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.3.tgz", - "integrity": "sha512-TdD789OWwOImH/IMyz/QRA6LJz7ScI/qbn1YOkcAW3AROvgbc0oKAxzp08+Xu8tj4GROrJ9UqZdh0t9xQCPkPg==" + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.4.tgz", + "integrity": "sha512-jUcPa0rsPca5ur1+G56DXnSc5hbbJkzvPHHvyQtkbPXBQd3CXPMNfrTVCgzex/7cY/7FONcpFCUwgwfni9Jqbw==" }, "node_modules/@cspell/dict-vue": { "version": "3.0.0", @@ -381,20 +381,20 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.7.0.tgz", - "integrity": "sha512-xlEPdiHVDu+4xYkvwjL9MgklxOi9XB+Pr1H9s3Ww9WEq+q6BA3xOHxLIU/k8mhqFTMZGFZRCsdy/EwMu6SyRhQ==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.8.1.tgz", + "integrity": "sha512-IyKEbSaHkw9V4Oc4JDasF96+BHKV8motBrepjLIMUjdJ152fBg8zqbvF769POdCJg0QouZVUV+h9V7zC6v45/g==", "dependencies": { - "import-meta-resolve": "^4.0.0" + "import-meta-resolve": "^4.1.0" }, "engines": { "node": ">=18.0" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.7.0.tgz", - "integrity": "sha512-0bo0WwDr2lzGoCP7vbpWbDpPyuOrHKK+218txnUpx6Pn1EDBLfcDQsiZED5B6zlpwgbGi6y3vc0rWtJbjKvwzg==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.8.1.tgz", + "integrity": "sha512-QNnMY5jKP/ItVYRGS4w3KF+1iXBUUjldZNVtEoQe2dFergxvbIYQ0S++TZb25G/o9nRF5GmOpecJaOvwUBZsiw==", "engines": { "node": ">=18" } @@ -608,24 +608,6 @@ "node": ">= 6" } }, - "node_modules/configstore": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz", - "integrity": "sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA==", - "dependencies": { - "dot-prop": "^6.0.1", - "graceful-fs": "^4.2.6", - "unique-string": "^3.0.0", - "write-file-atomic": "^3.0.3", - "xdg-basedir": "^5.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/yeoman/configstore?sponsor=1" - } - }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", @@ -645,41 +627,27 @@ "node": ">= 8" } }, - "node_modules/crypto-random-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", - "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", - "dependencies": { - "type-fest": "^1.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/cspell": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.7.0.tgz", - "integrity": "sha512-77nRPgLl240C6FK8RKVKo34lP15Lzp/6bk+SKYJFwUKKXlcgWXDis+Lw4JolA741/JgHtuxmhW1C8P7dCKjJ3w==", - "dependencies": { - "@cspell/cspell-json-reporter": "8.7.0", - "@cspell/cspell-pipe": "8.7.0", - "@cspell/cspell-types": "8.7.0", - "@cspell/dynamic-import": "8.7.0", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.8.1.tgz", + "integrity": "sha512-YDJ62Q400LqxKTQV5Nk+Ub2IZGm5L0p832KbFUMy7FXDwkPLaxp3mfcLFV677FRiTcnGUtGYD+SnPkFJ2hiqsg==", + "dependencies": { + "@cspell/cspell-json-reporter": "8.8.1", + "@cspell/cspell-pipe": "8.8.1", + "@cspell/cspell-types": "8.8.1", + "@cspell/dynamic-import": "8.8.1", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.0.0", - "cspell-gitignore": "8.7.0", - "cspell-glob": "8.7.0", - "cspell-io": "8.7.0", - "cspell-lib": "8.7.0", + "cspell-gitignore": "8.8.1", + "cspell-glob": "8.8.1", + "cspell-io": "8.8.1", + "cspell-lib": "8.8.1", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^8.0.0", "get-stdin": "^9.0.0", - "semver": "^7.6.0", + "semver": "^7.6.1", "strip-ansi": "^7.1.0", "vscode-uri": "^3.0.8" }, @@ -695,26 +663,26 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.7.0.tgz", - "integrity": "sha512-depsd01GbLBo71/tfRrL5iECWQLS4CjCxA9C01dVkFAJqVB0s+K9KLKjTlq5aHOhcvo9Z3dHV+bGQCf5/Q7bfw==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.8.1.tgz", + "integrity": "sha512-NTFfwL7Si1jp+0TINS9miXGdtPtDq95PhSbZKF9jnuBwnsnAURHCGALryLHlkRvj5JZk6dpkDfw4WxqQXdULNw==", "dependencies": { - "@cspell/cspell-types": "8.7.0", + "@cspell/cspell-types": "8.8.1", "comment-json": "^4.2.3", - "yaml": "^2.4.1" + "yaml": "^2.4.2" }, "engines": { "node": ">=18" } }, "node_modules/cspell-dictionary": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.7.0.tgz", - "integrity": "sha512-S6IpZSzIMxlOO/33NgCOuP0TPH2mZbw8d5CP44z5jajflloq8l74MeJLkeDzYfCRcm0Rtk0A5drBeMg+Ai34OA==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.8.1.tgz", + "integrity": "sha512-WJqCLR/icyZc0rphEO6dZZDlSIaWIXd95QjZu3agL7a1LRLjorqhVJty6WZrV4zkOLT6PPB+qcjMxcCCxIlWiw==", "dependencies": { - "@cspell/cspell-pipe": "8.7.0", - "@cspell/cspell-types": "8.7.0", - "cspell-trie-lib": "8.7.0", + "@cspell/cspell-pipe": "8.8.1", + "@cspell/cspell-types": "8.8.1", + "cspell-trie-lib": "8.8.1", "fast-equals": "^5.0.1", "gensequence": "^7.0.0" }, @@ -723,11 +691,11 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.7.0.tgz", - "integrity": "sha512-yvUZ86qyopUpDgn+YXP1qTpUe/lp65ZFvpMtw21lWHTFlg1OWKntr349EQU/5ben/K6koxk1FiElCBV7Lr4uFg==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.8.1.tgz", + "integrity": "sha512-j7wbz/VT/uZ+7oL8xwtxfA05FCv41ZrEKh1aNuMa4BI1xv/VRBmv6thOTz7aq7UcDYPNr8K5VVfBlXT/SvkEvA==", "dependencies": { - "cspell-glob": "8.7.0", + "cspell-glob": "8.8.1", "find-up-simple": "^1.0.0" }, "bin": { @@ -738,9 +706,9 @@ } }, "node_modules/cspell-glob": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.7.0.tgz", - "integrity": "sha512-AMdfx0gvROA/aIL8t8b5Y5NtMgscGZELFj6WhCSZiQSuWRxXUKiLGGLUFjx2y0hgXN9LUYOo6aBjvhnxI/v71g==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.8.1.tgz", + "integrity": "sha512-x2rS6gJzaF3KZB6FuNkuS3Kb3ynYns0zfC0uG/QJb9V/xc0DmAjQGQhiLIDx6XmvvDvowKmyQ/kBjY/K4VjCvQ==", "dependencies": { "micromatch": "^4.0.5" }, @@ -749,12 +717,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.7.0.tgz", - "integrity": "sha512-SGcXc7322wU2WNRi7vtpToWDXTqZHhxqvR+aIXHT2kkxlMSWp3Rvfpshd0ckgY54nZtgw7R/JtKND2jeACRpwQ==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.8.1.tgz", + "integrity": "sha512-YTyrutwIkiPH9t255l+BQtneGAkgE3uZXmnRHeIi6X+qdmnf61i8XYaSaO66VKQJX6VPZG18hBVMSUPZmYtoSw==", "dependencies": { - "@cspell/cspell-pipe": "8.7.0", - "@cspell/cspell-types": "8.7.0" + "@cspell/cspell-pipe": "8.8.1", + "@cspell/cspell-types": "8.8.1" }, "bin": { "cspell-grammar": "bin.mjs" @@ -764,74 +732,61 @@ } }, "node_modules/cspell-io": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.7.0.tgz", - "integrity": "sha512-o7OltyyvVkRG1gQrIqGpN5pUkHNnv6rvihb7Qu6cJ8jITinLGuWJuEQpgt0eF5yIr624jDbFwSzAxsFox8riQg==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.8.1.tgz", + "integrity": "sha512-qwKEV2kfwT9gbq6EpYt6gcEs0oe0sDPG1YJunt8niuX4YoBe7/9ZHBfUyqNOEA+sBmvI/tjY/Wy6g9mmSRaOYA==", "dependencies": { - "@cspell/cspell-service-bus": "8.7.0" + "@cspell/cspell-service-bus": "8.8.1" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.7.0.tgz", - "integrity": "sha512-qDSHZGekwiDmouYRECTQokE+hgAuPqREm+Hb+G3DoIo3ZK5H47TtEUo8fNCw22XsKefcF8X28LiyoZwiYHVpSg==", - "dependencies": { - "@cspell/cspell-bundled-dicts": "8.7.0", - "@cspell/cspell-pipe": "8.7.0", - "@cspell/cspell-resolver": "8.7.0", - "@cspell/cspell-types": "8.7.0", - "@cspell/dynamic-import": "8.7.0", - "@cspell/strong-weak-map": "8.7.0", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.8.1.tgz", + "integrity": "sha512-xntkgDGwDtUehM+fZudp4GbB87a2tY29G6ZqDF7WBcQsg3eyDVK/nc9KzbIfCvdWUCrsB9p+SGBoOmjYTwcocg==", + "dependencies": { + "@cspell/cspell-bundled-dicts": "8.8.1", + "@cspell/cspell-pipe": "8.8.1", + "@cspell/cspell-resolver": "8.8.1", + "@cspell/cspell-types": "8.8.1", + "@cspell/dynamic-import": "8.8.1", + "@cspell/strong-weak-map": "8.8.1", "clear-module": "^4.1.2", "comment-json": "^4.2.3", - "configstore": "^6.0.0", - "cspell-config-lib": "8.7.0", - "cspell-dictionary": "8.7.0", - "cspell-glob": "8.7.0", - "cspell-grammar": "8.7.0", - "cspell-io": "8.7.0", - "cspell-trie-lib": "8.7.0", + "cspell-config-lib": "8.8.1", + "cspell-dictionary": "8.8.1", + "cspell-glob": "8.8.1", + "cspell-grammar": "8.8.1", + "cspell-io": "8.8.1", + "cspell-trie-lib": "8.8.1", + "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", "import-fresh": "^3.3.0", "resolve-from": "^5.0.0", "vscode-languageserver-textdocument": "^1.0.11", - "vscode-uri": "^3.0.8" + "vscode-uri": "^3.0.8", + "xdg-basedir": "^5.1.0" }, "engines": { "node": ">=18" } }, "node_modules/cspell-trie-lib": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.7.0.tgz", - "integrity": "sha512-W3Nh2cO7gMV91r+hLqyTMgKlvRl4W5diKs5YiyOxjZumRkMBy42IzcNYtgIIacOxghklv96F5Bd1Vx/zY6ylGA==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.8.1.tgz", + "integrity": "sha512-S84XzQYGqKGApjVgamMp8tbHfKCeGZFxMwqedb4vxEJTYnUuCHaVPX2BK2SKaLSv/Vrd8mrJ/57sx5f8C44cFg==", "dependencies": { - "@cspell/cspell-pipe": "8.7.0", - "@cspell/cspell-types": "8.7.0", + "@cspell/cspell-pipe": "8.8.1", + "@cspell/cspell-types": "8.8.1", "gensequence": "^7.0.0" }, "engines": { "node": ">=18" } }, - "node_modules/dot-prop": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", - "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", - "dependencies": { - "is-obj": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -844,6 +799,17 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "license": "MIT" }, + "node_modules/env-paths": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", + "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -1046,11 +1012,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" - }, "node_modules/has-own-prop": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", @@ -1094,22 +1055,14 @@ } }, "node_modules/import-meta-resolve": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz", - "integrity": "sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", + "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "engines": { - "node": ">=0.8.19" - } - }, "node_modules/ini": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", @@ -1157,19 +1110,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -1209,17 +1149,6 @@ "json-buffer": "3.0.1" } }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -1411,12 +1340,9 @@ } }, "node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "bin": { "semver": "bin/semver.js" }, @@ -1445,11 +1371,6 @@ "node": ">=8" } }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" - }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -1552,39 +1473,6 @@ "node": ">=8.0" } }, - "node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, - "node_modules/unique-string": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", - "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", - "dependencies": { - "crypto-random-string": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/vscode-languageserver-textdocument": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz", @@ -1683,17 +1571,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "dependencies": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, "node_modules/xdg-basedir": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", @@ -1705,15 +1582,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/yaml": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.1.tgz", - "integrity": "sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.2.tgz", + "integrity": "sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==", "bin": { "yaml": "bin.mjs" }, diff --git a/package.json b/package.json index 7e05958266..e4d675d4e5 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.7.0" + "cspell": "^8.8.1" } } From 019389cc670f46641820a91460a2b7045259a7f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 14:30:18 +0200 Subject: [PATCH 317/845] Bump Roslynator.Analyzers from 4.12.0 to 4.12.3 (#2643) * Bump Roslynator.Analyzers from 4.12.0 to 4.12.3 Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.12.0 to 4.12.3. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.12.0...v4.12.3) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Use element access over LINQ --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jonas Nyrup --- Directory.Build.props | 2 +- .../CollectionAssertionSpecs.BeInAscendingOrder.cs | 9 ++++----- .../CollectionAssertionSpecs.BeInDescendingOrder.cs | 9 ++++----- .../Collections/CollectionAssertionSpecs.cs | 2 +- .../FluentAssertions.Specs/Events/EventAssertionSpecs.cs | 2 +- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index f337cbcb5b..bf889b0b70 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInAscendingOrder.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInAscendingOrder.cs index 4c5d296714..4c01511d9d 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInAscendingOrder.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInAscendingOrder.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Linq.Expressions; using FluentAssertions.Execution; using Xunit; @@ -351,7 +350,7 @@ public void When_strings_are_in_ascending_order_according_to_a_custom_lambda_it_ string[] strings = ["alpha", "beta", "theta"]; // Act - Action act = () => strings.Should().BeInAscendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last())); + Action act = () => strings.Should().BeInAscendingOrder((sut, exp) => sut[^1].CompareTo(exp[^1])); // Assert act.Should().NotThrow(); @@ -365,7 +364,7 @@ public void When_strings_are_not_in_ascending_order_according_to_a_custom_lambda // Act Action act = () => - strings.Should().BeInAscendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last()), "of {0}", "reasons"); + strings.Should().BeInAscendingOrder((sut, exp) => sut[^1].CompareTo(exp[^1]), "of {0}", "reasons"); // Assert act.Should() @@ -761,7 +760,7 @@ public void When_strings_are_not_in_ascending_order_according_to_a_custom_lambda string[] strings = ["roy", "dennis", "thomas"]; // Act - Action act = () => strings.Should().NotBeInAscendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last())); + Action act = () => strings.Should().NotBeInAscendingOrder((sut, exp) => sut[^1].CompareTo(exp[^1])); // Assert act.Should().NotThrow(); @@ -775,7 +774,7 @@ public void When_strings_are_unexpectedly_in_ascending_order_according_to_a_cust // Act Action act = () => - strings.Should().NotBeInAscendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last()), "of {0}", "reasons"); + strings.Should().NotBeInAscendingOrder((sut, exp) => sut[^1].CompareTo(exp[^1]), "of {0}", "reasons"); // Assert act.Should() diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInDescendingOrder.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInDescendingOrder.cs index ac27e75299..fa025d9b27 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInDescendingOrder.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeInDescendingOrder.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using Xunit; using Xunit.Sdk; @@ -263,7 +262,7 @@ public void When_strings_are_in_descending_order_based_on_a_custom_lambda_it_sho string[] strings = ["roy", "dennis", "barbara"]; // Act - Action act = () => strings.Should().BeInDescendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last())); + Action act = () => strings.Should().BeInDescendingOrder((sut, exp) => sut[^1].CompareTo(exp[^1])); // Assert act.Should().NotThrow(); @@ -277,7 +276,7 @@ public void When_strings_are_not_in_descending_order_based_on_a_custom_lambda_it // Act Action act = () => - strings.Should().BeInDescendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last()), "of {0}", "reasons"); + strings.Should().BeInDescendingOrder((sut, exp) => sut[^1].CompareTo(exp[^1]), "of {0}", "reasons"); // Assert act.Should() @@ -572,7 +571,7 @@ public void When_strings_are_not_in_descending_order_based_on_a_custom_lambda_it string[] strings = ["dennis", "roy", "barbara"]; // Act - Action act = () => strings.Should().NotBeInDescendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last())); + Action act = () => strings.Should().NotBeInDescendingOrder((sut, exp) => sut[^1].CompareTo(exp[^1])); // Assert act.Should().NotThrow(); @@ -586,7 +585,7 @@ public void When_strings_are_unexpectedly_in_descending_order_based_on_a_custom_ // Act Action act = () => - strings.Should().NotBeInDescendingOrder((sut, exp) => sut.Last().CompareTo(exp.Last()), "of {0}", "reasons"); + strings.Should().NotBeInDescendingOrder((sut, exp) => sut[^1].CompareTo(exp[^1]), "of {0}", "reasons"); // Assert act.Should() diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs index 03e2740b50..e539aacad0 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs @@ -218,7 +218,7 @@ private class ByLastCharacterComparer : IComparer { public int Compare(string x, string y) { - return x.Last().CompareTo(y.Last()); + return x[^1].CompareTo(y[^1]); } } } diff --git a/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs index 5705d70b04..20268bfb89 100644 --- a/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs @@ -409,7 +409,7 @@ public void When_constraints_are_specified_it_should_filter_the_events_based_on_ recording .Should().ContainSingle("because we were expecting a specific property change") - .Which.Parameters.Last().Should().BeOfType() + .Which.Parameters[^1].Should().BeOfType() .Which.PropertyName.Should().Be("Boo"); } From 838108cfb234348627db7bd8fe2d61a29c67e745 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 14:30:55 +0200 Subject: [PATCH 318/845] Bump the xunit group with 6 updates (#2640) * Bump the xunit group with 6 updates Bumps the xunit group with 6 updates: | Package | From | To | | --- | --- | --- | | [Verify.DiffPlex](https://github.com/VerifyTests/Verify.DiffPlex) | `2.3.0` | `3.0.0` | | [System.Collections.Immutable](https://github.com/dotnet/runtime) | `1.5.0` | `8.0.0` | | [System.Threading.Tasks.Extensions](https://github.com/dotnet/corefx) | `4.5.0` | `4.5.4` | | [Verify.Xunit](https://github.com/VerifyTests/Verify) | `23.7.1` | `24.2.0` | | [xunit](https://github.com/xunit/xunit) | `2.7.0` | `2.8.0` | | [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) | `2.5.7` | `2.8.0` | Updates `Verify.DiffPlex` from 2.3.0 to 3.0.0 - [Release notes](https://github.com/VerifyTests/Verify.DiffPlex/releases) - [Commits](https://github.com/VerifyTests/Verify.DiffPlex/compare/2.3.0...3.0.0) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) Updates `System.Threading.Tasks.Extensions` from 4.5.0 to 4.5.4 - [Release notes](https://github.com/dotnet/corefx/releases) - [Commits](https://github.com/dotnet/corefx/commits) Updates `Verify.Xunit` from 23.7.1 to 24.2.0 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/commits) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) Updates `System.Threading.Tasks.Extensions` from 4.5.0 to 4.5.4 - [Release notes](https://github.com/dotnet/corefx/releases) - [Commits](https://github.com/dotnet/corefx/commits) Updates `xunit` from 2.7.0 to 2.8.0 - [Commits](https://github.com/xunit/xunit/compare/2.7.0...2.8.0) Updates `xunit.runner.visualstudio` from 2.5.7 to 2.8.0 - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.5.7...2.8.0) --- updated-dependencies: - dependency-name: Verify.DiffPlex dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: System.Threading.Tasks.Extensions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: System.Threading.Tasks.Extensions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit ... Signed-off-by: dependabot[bot] * Update more xunit dependencies --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jonas Nyrup --- Build/_build.csproj | 2 +- Tests/Approval.Tests/Approval.Tests.csproj | 8 ++++---- Tests/FSharp.Specs/FSharp.Specs.fsproj | 4 ++-- .../FluentAssertions.Equivalency.Specs.csproj | 4 ++-- .../FluentAssertions.Extensibility.Specs.csproj | 4 ++-- .../FluentAssertions.Specs/FluentAssertions.Specs.csproj | 4 ++-- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 4 ++-- Tests/VB.Specs/VB.Specs.vbproj | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index b1c772ee34..fb8f111f4e 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -19,7 +19,7 @@ - + diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index fdd4b48b8d..bb7a47351c 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -6,14 +6,14 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index a730211fce..a1ab15ace2 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -11,8 +11,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index f8aa29f222..03df5de29e 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -28,8 +28,8 @@ - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index fce9b4b1e4..f24efa968b 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -18,8 +18,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 58b5159534..9917ea25af 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -27,8 +27,8 @@ - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index dd6233a747..a155747cad 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -12,8 +12,8 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 9fa4e0fdeb..09cb890a90 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -7,8 +7,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all From 35d9d2e6281c687f6347ac0f3e4f6704e1b9815d Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 14 May 2024 18:53:28 +0200 Subject: [PATCH 319/845] Handle null comparands (#2646) --- .../Collections/CollectionAssertionSpecs.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs index e539aacad0..b908e6669c 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs @@ -218,7 +218,7 @@ private class ByLastCharacterComparer : IComparer { public int Compare(string x, string y) { - return x[^1].CompareTo(y[^1]); + return Nullable.Compare(x?[^1], y?[^1]); } } } From e73f0718706df652259a3a115aff8b0c2d36c481 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Wed, 15 May 2024 18:34:57 +0200 Subject: [PATCH 320/845] Allow event monitoring to ignore failing event accessors (#2629) * Removed event monitor builder Moved methods config options to `EventMonitorOptions` * Removed unnecessary generic type from EventMonitorOptions * fixed build errors due to removing generic from options * Update api checks * Update Src/FluentAssertions/Events/EventMonitorOptions.cs Fixed wrong Timestamp * Include reviewer feedback * Added more reviewer suggestions. * Update Src/FluentAssertions/Events/EventMonitor.cs Co-authored-by: Jonas Nyrup * Update Src/FluentAssertions/Events/EventMonitorOptions.cs Co-authored-by: Jonas Nyrup * - removed the exception when event recorder could not be removed from the dictionary - Added option to still receive events even when add accessor threw an exception * cleanups * Fixed Qodana complaints * Removed boolean parameter and added method for recording events with broken accessor * Updated api tests for new RecordEventsWithBrokenAccessor method. Updated descriptions to match current the actual behavior * Update documentation Co-authored-by: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> * Update release notes * Add suggestions to 3 files --------- Co-authored-by: Andreas Pazureck Co-authored-by: Andreas Pazureck Co-authored-by: Jonas Nyrup Co-authored-by: Jonas Nyrup Co-authored-by: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> --- Src/FluentAssertions/AssertionExtensions.cs | 25 ++- Src/FluentAssertions/Events/EventMonitor.cs | 54 ++++-- .../Events/EventMonitorOptions.cs | 56 +++++++ .../FluentAssertions/net47.verified.txt | 9 +- .../FluentAssertions/net6.0.verified.txt | 9 +- .../netstandard2.1.verified.txt | 9 +- .../Events/EventAssertionSpecs.cs | 155 +++++++++++++++++- docs/_pages/eventmonitoring.md | 44 ++++- docs/_pages/releases.md | 2 + 9 files changed, 327 insertions(+), 36 deletions(-) create mode 100644 Src/FluentAssertions/Events/EventMonitorOptions.cs diff --git a/Src/FluentAssertions/AssertionExtensions.cs b/Src/FluentAssertions/AssertionExtensions.cs index d317092f78..0c69d58c41 100644 --- a/Src/FluentAssertions/AssertionExtensions.cs +++ b/Src/FluentAssertions/AssertionExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; @@ -873,14 +873,27 @@ public static TaskCompletionSourceAssertions Should(this TaskCompletionSou /// Starts monitoring for its events. ///
/// The object for which to monitor the events. - /// - /// An optional delegate that returns the current date and time in UTC format. - /// Will revert to if no delegate was provided. + /// is . + public static IMonitor Monitor(this T eventSource) + { + return new EventMonitor(eventSource, new EventMonitorOptions()); + } + + /// + /// Starts monitoring for its events using the given . + /// + /// The object for which to monitor the events. + /// + /// Options to configure the EventMonitor. /// /// is . - public static IMonitor Monitor(this T eventSource, Func utcNow = null) + public static IMonitor Monitor(this T eventSource, Action configureOptions) { - return new EventMonitor(eventSource, utcNow ?? (() => DateTime.UtcNow)); + Guard.ThrowIfArgumentIsNull(configureOptions, nameof(configureOptions)); + + var options = new EventMonitorOptions(); + configureOptions(options); + return new EventMonitor(eventSource, options); } #endif diff --git a/Src/FluentAssertions/Events/EventMonitor.cs b/Src/FluentAssertions/Events/EventMonitor.cs index a0bcf681ef..26ebe0ad29 100644 --- a/Src/FluentAssertions/Events/EventMonitor.cs +++ b/Src/FluentAssertions/Events/EventMonitor.cs @@ -18,29 +18,28 @@ internal sealed class EventMonitor : IMonitor private readonly ConcurrentDictionary recorderMap = new(); - public EventMonitor(object eventSource, Func utcNow) + public EventMonitor(object eventSource, EventMonitorOptions options) { Guard.ThrowIfArgumentIsNull(eventSource, nameof(eventSource), "Cannot monitor the events of a object."); + Guard.ThrowIfArgumentIsNull(options, nameof(options), "Event monitor needs configuration."); + + this.options = options; subject = new WeakReference(eventSource); - Attach(typeof(T), utcNow); + Attach(typeof(T), this.options.TimestampProvider); } public T Subject => (T)subject.Target; private readonly ThreadSafeSequenceGenerator threadSafeSequenceGenerator = new(); + private readonly EventMonitorOptions options; - public EventMetadata[] MonitoredEvents - { - get - { - return recorderMap - .Values - .Select(recorder => new EventMetadata(recorder.EventName, recorder.EventHandlerType)) - .ToArray(); - } - } + public EventMetadata[] MonitoredEvents => + recorderMap + .Values + .Select(recorder => new EventMetadata(recorder.EventName, recorder.EventHandlerType)) + .ToArray(); public OccurredEvent[] OccurredEvents { @@ -117,12 +116,24 @@ public void Dispose() { foreach (EventRecorder recorder in recorderMap.Values) { - recorder.Dispose(); + DisposeSafeIfRequested(recorder); } recorderMap.Clear(); } + private void DisposeSafeIfRequested(IDisposable recorder) + { + try + { + recorder.Dispose(); + } + catch when (options.ShouldIgnoreEventAccessorExceptions) + { + // ignore + } + } + private void AttachEventHandler(EventInfo eventInfo, Func utcNow) { if (!recorderMap.TryGetValue(eventInfo.Name, out _)) @@ -131,7 +142,22 @@ private void AttachEventHandler(EventInfo eventInfo, Func utcNow) if (recorderMap.TryAdd(eventInfo.Name, recorder)) { - recorder.Attach(subject, eventInfo); + AttachEventHandler(eventInfo, recorder); + } + } + } + + private void AttachEventHandler(EventInfo eventInfo, EventRecorder recorder) + { + try + { + recorder.Attach(subject, eventInfo); + } + catch when (options.ShouldIgnoreEventAccessorExceptions) + { + if (!options.ShouldRecordEventsWithBrokenAccessor) + { + recorderMap.TryRemove(eventInfo.Name, out _); } } } diff --git a/Src/FluentAssertions/Events/EventMonitorOptions.cs b/Src/FluentAssertions/Events/EventMonitorOptions.cs new file mode 100644 index 0000000000..c6cbf76d25 --- /dev/null +++ b/Src/FluentAssertions/Events/EventMonitorOptions.cs @@ -0,0 +1,56 @@ +using System; + +namespace FluentAssertions.Events; + +/// +/// Settings for the EventMonitor. +/// +public class EventMonitorOptions +{ + /// + /// Will ignore the events, if they throw an exception on any custom event accessor implementation. default: false. + /// + internal bool ShouldIgnoreEventAccessorExceptions { get; private set; } + + /// + /// This will record the event, even if the event accessor add event threw an exception. To ignore exceptions in the event add accessor, call property to set it to true. default: false. + /// + internal bool ShouldRecordEventsWithBrokenAccessor { get; private set; } + + /// + /// Func used to generate the timestamp. + /// + internal Func TimestampProvider { get; private set; } = () => DateTime.UtcNow; + + /// + /// When called it will ignore event accessor Exceptions. + /// + public EventMonitorOptions IgnoringEventAccessorExceptions() + { + ShouldIgnoreEventAccessorExceptions = true; + return this; + } + + /// + /// When called it will record the event even when the accessor threw an exception. + /// + public EventMonitorOptions RecordingEventsWithBrokenAccessor() + { + ShouldRecordEventsWithBrokenAccessor = true; + return this; + } + + /// + /// Sets the timestamp provider. By default it is . + /// + /// The timestamp provider. + internal EventMonitorOptions ConfigureTimestampProvider(Func timestampProvider) + { + if (timestampProvider != null) + { + TimestampProvider = timestampProvider; + } + + return this; + } +} diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index cb22440ad1..49557d858c 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -37,7 +37,8 @@ namespace FluentAssertions public static FluentAssertions.Specialized.MemberExecutionTime ExecutionTimeOf(this T subject, System.Linq.Expressions.Expression> action, FluentAssertions.Common.StartTimer createTimer = null) { } public static System.Action Invoking(this T subject, System.Action action) { } public static System.Func Invoking(this T subject, System.Func action) { } - public static FluentAssertions.Events.IMonitor Monitor(this T eventSource, System.Func utcNow = null) { } + public static FluentAssertions.Events.IMonitor Monitor(this T eventSource) { } + public static FluentAssertions.Events.IMonitor Monitor(this T eventSource, System.Action configureOptions) { } public static FluentAssertions.Specialized.ExecutionTimeAssertions Should(this FluentAssertions.Specialized.ExecutionTime executionTime) { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] @@ -1130,6 +1131,12 @@ namespace FluentAssertions.Events public string EventName { get; } public System.Type HandlerType { get; } } + public class EventMonitorOptions + { + public EventMonitorOptions() { } + public FluentAssertions.Events.EventMonitorOptions IgnoringEventAccessorExceptions() { } + public FluentAssertions.Events.EventMonitorOptions RecordingEventsWithBrokenAccessor() { } + } public interface IEventRecording : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { System.Type EventHandlerType { get; } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index ac323e22bc..4f98826d2b 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -37,7 +37,8 @@ namespace FluentAssertions public static FluentAssertions.Specialized.MemberExecutionTime ExecutionTimeOf(this T subject, System.Linq.Expressions.Expression> action, FluentAssertions.Common.StartTimer createTimer = null) { } public static System.Action Invoking(this T subject, System.Action action) { } public static System.Func Invoking(this T subject, System.Func action) { } - public static FluentAssertions.Events.IMonitor Monitor(this T eventSource, System.Func utcNow = null) { } + public static FluentAssertions.Events.IMonitor Monitor(this T eventSource) { } + public static FluentAssertions.Events.IMonitor Monitor(this T eventSource, System.Action configureOptions) { } public static FluentAssertions.Specialized.ExecutionTimeAssertions Should(this FluentAssertions.Specialized.ExecutionTime executionTime) { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] @@ -1143,6 +1144,12 @@ namespace FluentAssertions.Events public string EventName { get; } public System.Type HandlerType { get; } } + public class EventMonitorOptions + { + public EventMonitorOptions() { } + public FluentAssertions.Events.EventMonitorOptions IgnoringEventAccessorExceptions() { } + public FluentAssertions.Events.EventMonitorOptions RecordingEventsWithBrokenAccessor() { } + } public interface IEventRecording : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { System.Type EventHandlerType { get; } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 0d7512b8df..c2d650c74e 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -37,7 +37,8 @@ namespace FluentAssertions public static FluentAssertions.Specialized.MemberExecutionTime ExecutionTimeOf(this T subject, System.Linq.Expressions.Expression> action, FluentAssertions.Common.StartTimer createTimer = null) { } public static System.Action Invoking(this T subject, System.Action action) { } public static System.Func Invoking(this T subject, System.Func action) { } - public static FluentAssertions.Events.IMonitor Monitor(this T eventSource, System.Func utcNow = null) { } + public static FluentAssertions.Events.IMonitor Monitor(this T eventSource) { } + public static FluentAssertions.Events.IMonitor Monitor(this T eventSource, System.Action configureOptions) { } public static FluentAssertions.Specialized.ExecutionTimeAssertions Should(this FluentAssertions.Specialized.ExecutionTime executionTime) { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] @@ -1130,6 +1131,12 @@ namespace FluentAssertions.Events public string EventName { get; } public System.Type HandlerType { get; } } + public class EventMonitorOptions + { + public EventMonitorOptions() { } + public FluentAssertions.Events.EventMonitorOptions IgnoringEventAccessorExceptions() { } + public FluentAssertions.Events.EventMonitorOptions RecordingEventsWithBrokenAccessor() { } + } public interface IEventRecording : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { System.Type EventHandlerType { get; } diff --git a/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs index 20268bfb89..4926efcd69 100644 --- a/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs @@ -1,11 +1,11 @@ #if NET47 -using System.Reflection; using System.Reflection.Emit; #endif using System; using System.ComponentModel; using System.Linq; +using System.Reflection; using FluentAssertions.Events; using FluentAssertions.Execution; using FluentAssertions.Extensions; @@ -414,12 +414,13 @@ public void When_constraints_are_specified_it_should_filter_the_events_based_on_ } [Fact] - public void When_events_are_raised_regardless_of_time_tick_it_should_return_by_invokation_order() + public void When_events_are_raised_regardless_of_time_tick_it_should_return_by_invocation_order() { // Arrange var observable = new TestEventRaisingInOrder(); - var utcNow = 11.January(2022).At(12, 00).AsUtc(); - using var monitor = observable.Monitor(() => utcNow); + + using var monitor = observable.Monitor(conf => + conf.ConfigureTimestampProvider(() => 11.January(2022).At(12, 00).AsUtc())); // Act observable.RaiseAllEvents(); @@ -794,7 +795,7 @@ public void When_an_object_raises_two_events_it_should_provide_the_data_about_th DateTime utcNow = 17.September(2017).At(21, 00).AsUtc(); var eventSource = new EventRaisingClass(); - using var monitor = eventSource.Monitor(() => utcNow); + using var monitor = eventSource.Monitor(opt => opt.ConfigureTimestampProvider(() => utcNow)); // Act eventSource.RaiseEventWithSenderAndPropertyName("theProperty"); @@ -972,6 +973,150 @@ public void One_matching_argument_type_with_two_or_more_parameters_matching_a_mi } } + public class MonitorDefaultBehavior + { + [Fact] + public void Broken_event_add_accessors_fails() + { + // Arrange + var sut = new TestEventBrokenEventHandlerRaising(); + + // Act / Assert + sut.Invoking(c => + { + using var monitor = c.Monitor(); + }).Should().Throw(); + } + + [Fact] + public void Broken_event_remove_accessors_fails() + { + // Arrange + var sut = new TestEventBrokenEventHandlerRaising(); + + // Act / Assert + sut.Invoking(c => + { + using var monitor = c.Monitor(); + }).Should().Throw(); + } + } + + public class IgnoreMisbehavingEventAccessors + { + [Fact] + public void Monitoring_class_with_broken_event_add_accessor_succeeds() + { + // Arrange + var classToMonitor = new TestEventBrokenEventHandlerRaising(); + + // Act / Assert + classToMonitor.Invoking(c => + { + using var monitor = c.Monitor(opt => opt.IgnoringEventAccessorExceptions()); + }).Should().NotThrow(); + } + + [Fact] + public void Class_with_broken_event_remove_accessor_succeeds() + { + // Arrange + var classToMonitor = new TestEventBrokenEventHandlerRaising(); + + // Act / Assert + classToMonitor.Invoking(c => + { + using var monitor = c.Monitor(opt => opt.IgnoringEventAccessorExceptions()); + }).Should().NotThrow(); + } + + [Fact] + public void Recording_event_with_broken_add_accessor_succeeds() + { + // Arrange + var classToMonitor = new TestEventBrokenEventHandlerRaising(); + + using var monitor = + classToMonitor.Monitor(opt => + opt.IgnoringEventAccessorExceptions().RecordingEventsWithBrokenAccessor()); + + //Act + classToMonitor.RaiseOkEvent(); + + //Assert + monitor.MonitoredEvents.Should().HaveCount(1); + } + + [Fact] + public void Ignoring_broken_event_accessor_should_also_not_record_events() + { + // Arrange + var classToMonitor = new TestEventBrokenEventHandlerRaising(); + + using var monitor = classToMonitor.Monitor(opt => opt.IgnoringEventAccessorExceptions()); + + //Act + classToMonitor.RaiseOkEvent(); + + //Assert + monitor.MonitoredEvents.Should().BeEmpty(); + } + } + + private interface IAddOkEvent + { + event EventHandler OkEvent; + } + + private interface IAddFailingRecordableEvent + { + public event EventHandler AddFailingRecorableEvent; + } + + private interface IAddFailingEvent + { + public event EventHandler AddFailingEvent; + } + + private interface IRemoveFailingEvent + { + public event EventHandler RemoveFailingEvent; + } + + private class TestEventBrokenEventHandlerRaising + : IAddFailingEvent, IRemoveFailingEvent, IAddOkEvent, IAddFailingRecordableEvent + { + public event EventHandler AddFailingEvent + { + add => throw new InvalidOperationException("Add is failing"); + remove => OkEvent -= value; + } + + public event EventHandler AddFailingRecorableEvent + { + add + { + OkEvent += value; + throw new InvalidOperationException("Add is failing"); + } + + remove => OkEvent -= value; + } + + public event EventHandler OkEvent; + + public event EventHandler RemoveFailingEvent + { + add => OkEvent += value; + remove => throw new InvalidOperationException("Remove is failing"); + } + + public void RaiseOkEvent() + { + OkEvent?.Invoke(this, EventArgs.Empty); + } + } + public class A { #pragma warning disable MA0046 diff --git a/docs/_pages/eventmonitoring.md b/docs/_pages/eventmonitoring.md index 06c462633b..36ee9fbf53 100644 --- a/docs/_pages/eventmonitoring.md +++ b/docs/_pages/eventmonitoring.md @@ -16,10 +16,16 @@ using var monitoredSubject = subject.Monitor(); subject.Foo(); monitoredSubject.Should().Raise("NameChangedEvent"); + +// Or... + +monitoredSubject.Should().NotRaise("SomeOtherEvent"); ``` Notice that Fluent Assertions will keep monitoring the `subject` for as long as the `using` block lasts. +## Filtering asserted events + Assuming that we’re dealing with an MVVM implementation, you might want to verify that it raised its `PropertyChanged` event for a particular property: ```csharp @@ -34,23 +40,22 @@ monitoredSubject This means that event monitoring only works for events that comply with the standard two-argument `sender`/`args` .NET pattern. + +## Monitoring PropertyChanged event + Since verifying for `PropertyChanged` events is so common, we've included a specialized shortcut to the example above: ```csharp -subject.Should().RaisePropertyChangeFor(x => x.SomeProperty); +monitoredSubject.Should().RaisePropertyChangeFor(x => x.SomeProperty); ``` You can also do the opposite; asserting that a particular event was not raised. ```csharp -subject.Should().NotRaisePropertyChangeFor(x => x.SomeProperty); +monitoredSubject.Should().NotRaisePropertyChangeFor(x => x.SomeProperty); ``` -Or... - -```csharp -subject.Should().NotRaise("SomeOtherEvent"); -``` +## Monitoring subset of events `Monitor()` is a generic method, but you will usually have the compiler infer the type. You _can_ specify an explicit type to limit which events you want to listen to: @@ -59,6 +64,8 @@ var subject = new ClassWithManyEvents(); using var monitor = subject.Monitor(); ``` +## Dynamically generated classes + This generic version of `Monitor()` is also very useful if you wish to monitor events of a dynamically generated class using `System.Reflection.Emit`. Since events are dynamically generated and are not present in parent class non-generic version of `Monitor()` will not find the events. This way you can tell the event monitor which interface was implemented in the generated class. ```csharp @@ -68,7 +75,6 @@ using var monitor = subject.Monitor(); // POCO class doesn't have INotifyPropertyChanged implemented monitor.Should().Raise("SomeEvent"); - ``` The `IMonitor` interface returned by `Monitor()` exposes a method named `GetRecordingFor` as well as the properties `MonitoredEvents` and `OccurredEvents` that you can use to directly interact with the monitor, e.g. to create your own extensions. For example: @@ -90,6 +96,28 @@ metadata.Should().BeEquivalentTo(new[] }); ``` +## Configuring the event monitor + +It is also possible to configure the event monitor. To do so, use the overload: + +```csharp +var subject = new EditCustomerViewModel(); +using var monitoredSubject = subject.Monitor(options => ...); +``` + +### Ignore broken event Accessors + +If some event accessors, you are not interested in, should throw exceptions, you can simply ignore all exceptions thrown by those event accessors: + +```csharp +var subject = new EditCustomerViewModel(); +using var monitoredSubject = subject.Monitor(options => options.IgnoreEventAccessorExceptions()); +``` + +The event monitor will now ignore all events that throw exceptions when subscribing (`add`) or unsubscribing (`remove`) them. + +> Note, that if there is an exception in the `add` event accessor, the event cannot be asserted, as it cannot be subscribed successfully. + ## Limitations This feature is not available in .NET Standard 2.0, because [`System.Reflection.Emit.DynamicMethod`](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.dynamicmethod) is required to generate event handlers dynamically. diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index d0865a2c50..db03679dcd 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -16,6 +16,7 @@ sidebar: * Add support for NUnit 4 - [#2483](https://github.com/fluentassertions/fluentassertions/pull/2483) * Added `NotBeIn` to check if a `DateTime` is not in a given `DateTimeKind` - [#2536](https://github.com/fluentassertions/fluentassertions/pull/2536) * Added `BeNaN` and `NotBeNaN` for assertions on `float` and `double` - [#2606](https://github.com/fluentassertions/fluentassertions/pull/2606) +* Added option for event monitoring to ignore failing event accessors - [#2629](https://github.com/fluentassertions/fluentassertions/pull/2629) ### Improvements * Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) @@ -74,6 +75,7 @@ sidebar: * `IEquivalencyAssertionOptions` to `IEquivalencyOptions` * `SelfReferenceEquivalencyAssertionOptions` to `SelfReferenceEquivalencyOptions` * Allow fluently calling `WithoutMatchingRules` and `WithoutSelectionRules` while using `BeEquivalentTo` - [#2457](https://github.com/fluentassertions/fluentassertions/pull/2457) +* Removed `utcNow` overload for `.Monitor()` - [#2629](https://github.com/fluentassertions/fluentassertions/pull/2629) ### Breaking Changes (for extensions) * Add `ForConstraint` to `IAssertionsScope` to support chaining `.ForConstraint()` after `.Then` - [#2324](https://github.com/fluentassertions/fluentassertions/pull/2324) From 05c8ee2323950fd078508c3a14edac2c212442d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 May 2024 08:12:19 +0200 Subject: [PATCH 321/845] Bump rexml from 3.2.6 to 3.2.8 in /docs (#2649) Bumps [rexml](https://github.com/ruby/rexml) from 3.2.6 to 3.2.8. - [Release notes](https://github.com/ruby/rexml/releases) - [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md) - [Commits](https://github.com/ruby/rexml/compare/v3.2.6...v3.2.8) --- updated-dependencies: - dependency-name: rexml dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/Gemfile.lock | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index c8f9931ab9..0d1fa88233 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -238,7 +238,8 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - rexml (3.2.6) + rexml (3.2.8) + strscan (>= 3.0.9) rouge (3.30.0) ruby2_keywords (0.0.5) rubyzip (2.3.2) @@ -253,6 +254,7 @@ GEM faraday (>= 0.17.3, < 3) simpleidn (0.2.1) unf (~> 0.1.4) + strscan (3.1.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) typhoeus (1.4.1) From d90c89918b6407abe463ac0b0833170fdf9ed3a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 17:32:09 +0200 Subject: [PATCH 322/845] Bump CSharpGuidelinesAnalyzer from 3.8.4 to 3.8.5 (#2653) Bumps [CSharpGuidelinesAnalyzer](https://github.com/bkoelman/CSharpGuidelinesAnalyzer) from 3.8.4 to 3.8.5. - [Release notes](https://github.com/bkoelman/CSharpGuidelinesAnalyzer/releases) - [Commits](https://github.com/bkoelman/CSharpGuidelinesAnalyzer/compare/v3.8.4...v3.8.5) --- updated-dependencies: - dependency-name: CSharpGuidelinesAnalyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index bf889b0b70..21e11bb642 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -26,7 +26,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive
- + all runtime; build; native; contentfiles; analyzers; buildtransitive From dc441ec10ce07e3f752b285456f588c4765ca25b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 17:32:23 +0200 Subject: [PATCH 323/845] Bump Meziantou.Analyzer from 2.0.150 to 2.0.152 (#2652) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.150 to 2.0.152. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.150...2.0.152) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 21e11bb642..e293242865 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From edc0c1fc1f19aa27a6bdb95bfb0eb22132cd95d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 14:57:33 +0000 Subject: [PATCH 324/845] Bump Meziantou.Analyzer from 2.0.152 to 2.0.153 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.152 to 2.0.153. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.152...2.0.153) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index e293242865..7a22fe188d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From eaa86af5020ea110e2648e1435a5744d48049677 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 14:34:10 +0000 Subject: [PATCH 325/845] Bump cspell from 8.8.1 to 8.8.3 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.8.1 to 8.8.3. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.8.3/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 345 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 174 insertions(+), 173 deletions(-) diff --git a/package-lock.json b/package-lock.json index 07bc2edadc..02b0586c49 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,64 +7,65 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.8.1" + "cspell": "^8.8.3" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.8.1.tgz", - "integrity": "sha512-zP/cC7ABk9PM6X1/itEOYa9raWrdUtUXCcUtHLnEr83HhPUHZ8vzaBgMJ176No/7EgZ4BHGXVvA0v079ukXVxw==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.8.3.tgz", + "integrity": "sha512-nRa30TQwE4R5xcM6CBibM2l7D359ympexjm7OrykzYmStIiiudDIsuNOIXGBrDouxRFgKGAa/ETo1g+Pxz7kNA==", "dependencies": { "@cspell/dict-ada": "^4.0.2", - "@cspell/dict-aws": "^4.0.1", + "@cspell/dict-aws": "^4.0.2", "@cspell/dict-bash": "^4.1.3", - "@cspell/dict-companies": "^3.0.31", - "@cspell/dict-cpp": "^5.1.3", + "@cspell/dict-companies": "^3.1.0", + "@cspell/dict-cpp": "^5.1.6", "@cspell/dict-cryptocurrencies": "^5.0.0", "@cspell/dict-csharp": "^4.0.2", "@cspell/dict-css": "^4.0.12", "@cspell/dict-dart": "^2.0.3", "@cspell/dict-django": "^4.1.0", "@cspell/dict-docker": "^1.1.7", - "@cspell/dict-dotnet": "^5.0.0", + "@cspell/dict-dotnet": "^5.0.2", "@cspell/dict-elixir": "^4.0.3", - "@cspell/dict-en_us": "^4.3.19", - "@cspell/dict-en-common-misspellings": "^2.0.0", + "@cspell/dict-en_us": "^4.3.20", + "@cspell/dict-en-common-misspellings": "^2.0.1", "@cspell/dict-en-gb": "1.1.33", - "@cspell/dict-filetypes": "^3.0.3", + "@cspell/dict-filetypes": "^3.0.4", "@cspell/dict-fonts": "^4.0.0", "@cspell/dict-fsharp": "^1.0.1", - "@cspell/dict-fullstack": "^3.1.5", + "@cspell/dict-fullstack": "^3.1.8", "@cspell/dict-gaming-terms": "^1.0.5", "@cspell/dict-git": "^3.0.0", - "@cspell/dict-golang": "^6.0.5", + "@cspell/dict-golang": "^6.0.9", + "@cspell/dict-google": "^1.0.0", "@cspell/dict-haskell": "^4.0.1", "@cspell/dict-html": "^4.0.5", "@cspell/dict-html-symbol-entities": "^4.0.0", "@cspell/dict-java": "^5.0.6", "@cspell/dict-julia": "^1.0.1", - "@cspell/dict-k8s": "^1.0.2", + "@cspell/dict-k8s": "^1.0.3", "@cspell/dict-latex": "^4.0.0", "@cspell/dict-lorem-ipsum": "^4.0.0", "@cspell/dict-lua": "^4.0.3", "@cspell/dict-makefile": "^1.0.0", "@cspell/dict-monkeyc": "^1.0.6", "@cspell/dict-node": "^5.0.1", - "@cspell/dict-npm": "^5.0.15", - "@cspell/dict-php": "^4.0.6", - "@cspell/dict-powershell": "^5.0.3", + "@cspell/dict-npm": "^5.0.16", + "@cspell/dict-php": "^4.0.7", + "@cspell/dict-powershell": "^5.0.4", "@cspell/dict-public-licenses": "^2.0.6", "@cspell/dict-python": "^4.1.11", "@cspell/dict-r": "^2.0.1", "@cspell/dict-ruby": "^5.0.2", "@cspell/dict-rust": "^4.0.3", - "@cspell/dict-scala": "^5.0.0", - "@cspell/dict-software-terms": "^3.3.20", + "@cspell/dict-scala": "^5.0.2", + "@cspell/dict-software-terms": "^3.3.23", "@cspell/dict-sql": "^2.1.3", "@cspell/dict-svelte": "^1.0.2", "@cspell/dict-swift": "^2.0.1", "@cspell/dict-terraform": "^1.0.0", - "@cspell/dict-typescript": "^3.1.4", + "@cspell/dict-typescript": "^3.1.5", "@cspell/dict-vue": "^3.0.0" }, "engines": { @@ -72,28 +73,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.8.1.tgz", - "integrity": "sha512-HtendGGO0w1gElhSYsD4D9iKT1nMBoUP31y0Ndw3AtQRzH6I31lx6DWnrXIef1bTL4wdq7ocxgG5HGQBQ8PWfA==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.8.3.tgz", + "integrity": "sha512-XP8x446IO9iHKvEN1IrJwOC5wC2uwmbdgFiUiXfzPSAlPfRWBmzOR68UR0Z6LNpm1GB4sUxxQkx2CRqDyGaSng==", "dependencies": { - "@cspell/cspell-types": "8.8.1" + "@cspell/cspell-types": "8.8.3" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.8.1.tgz", - "integrity": "sha512-AMQ0s7qH71tNnrpX8ILl+OZceDHt//h/T3Yk//qvn69x1Dzfg4Saqv/qhfG1VClQVyV5F4y7tIa4UNd5X6mW4g==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.8.3.tgz", + "integrity": "sha512-tzngpFKXeUsdTZEErffTlwUnPIKYgyRKy0YTrD77EkhyDSbUnaS8JWqtGZbKV7iQ+R4CL7tiaubPjUzkbWj+kQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.8.1.tgz", - "integrity": "sha512-K5sPp05Pz3tYU9roFGILSB6OdSVYqyr4Y/NW1CxZsXgq+hmwxAJQag/RyhW6cUp/1Jhy5RKYGNy0H0u/jODx3A==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.8.3.tgz", + "integrity": "sha512-pMOB2MJYeria0DeW1dsehRPIHLzoOXCm1Cdjp1kRZ931PbqNCYaE/GM6laWpUTAbS9Ly2tv4g0jK3PUH8ZTtJA==", "dependencies": { "global-directory": "^4.0.1" }, @@ -102,17 +103,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.8.1.tgz", - "integrity": "sha512-dxZ/ymwP6XNMGkU5iIUVgFP2JEqEvpJZavpAerB/y5E560Agv1WuUpkZE/PMCmseoLjSiV5yQzcnLNoT5X/w7A==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.8.3.tgz", + "integrity": "sha512-QVKe/JZvoTaaBAMXG40HjZib1g6rGgxk03e070GmdfCiMRUCWFtK+9DKVYJfSqjQhzj/eDCrq8aWplHWy66umg==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.8.1.tgz", - "integrity": "sha512-JEbLN+b3XdHIpEaoZJnpPfL8iTKWraqE7x1VwG7FIQ9wjP6fCPwfNRVM0CUWEmT+85O/zvbYVOlTJn1uIOLnZw==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.8.3.tgz", + "integrity": "sha512-31wYSBPinhqKi9TSzPg50fWHJmMQwD1d5p26yM/NAfNQvjAfBQlrg4pqix8pxOJkAK5W/TnoaVXjzJ5XCg6arQ==", "engines": { "node": ">=18" } @@ -123,9 +124,9 @@ "integrity": "sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA==" }, "node_modules/@cspell/dict-aws": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.1.tgz", - "integrity": "sha512-NXO+kTPQGqaaJKa4kO92NAXoqS+i99dQzf3/L1BxxWVSBS3/k1f3uhmqIh7Crb/n22W793lOm0D9x952BFga3Q==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.2.tgz", + "integrity": "sha512-aNGHWSV7dRLTIn8WJemzLoMF62qOaiUQlgnsCwH5fRCD/00gsWCwg106pnbkmK4AyabyxzneOV4dfecDJWkSxw==" }, "node_modules/@cspell/dict-bash": { "version": "4.1.3", @@ -133,14 +134,14 @@ "integrity": "sha512-tOdI3QVJDbQSwPjUkOiQFhYcu2eedmX/PtEpVWg0aFps/r6AyjUQINtTgpqMYnYuq8O1QUIQqnpx21aovcgZCw==" }, "node_modules/@cspell/dict-companies": { - "version": "3.0.31", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.0.31.tgz", - "integrity": "sha512-hKVpV/lcGKP4/DpEPS8P4osPvFH/YVLJaDn9cBIOH6/HSmL5LbFgJNKpMGaYRbhm2FEX56MKE3yn/MNeNYuesQ==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.1.tgz", + "integrity": "sha512-hooOyJ1q3o5tGkUOXyTY04psiYdyrcJkoQHMA4gX0zJzj+pQJCL812V+z9aI4vl1Qhjxfp2YHKF60DM+EndqGQ==" }, "node_modules/@cspell/dict-cpp": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.3.tgz", - "integrity": "sha512-sqnriXRAInZH9W75C+APBh6dtben9filPqVbIsiRMUXGg+s02ekz0z6LbS7kXeJ5mD2qXoMLBrv13qH2eIwutQ==" + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.7.tgz", + "integrity": "sha512-qVuXo5rm9sySIrDwTfL62WF0BTiJXc4jAa53RvKV2f7wJL4LiJLNPpvY6oNU7G311VLf9QlTteRnlSulZLav/A==" }, "node_modules/@cspell/dict-cryptocurrencies": { "version": "5.0.0", @@ -178,9 +179,9 @@ "integrity": "sha512-XlXHAr822euV36GGsl2J1CkBIVg3fZ6879ZOg5dxTIssuhUOCiV2BuzKZmt6aIFmcdPmR14+9i9Xq+3zuxeX0A==" }, "node_modules/@cspell/dict-dotnet": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.0.tgz", - "integrity": "sha512-EOwGd533v47aP5QYV8GlSSKkmM9Eq8P3G/eBzSpH3Nl2+IneDOYOBLEUraHuiCtnOkNsz0xtZHArYhAB2bHWAw==" + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.2.tgz", + "integrity": "sha512-UD/pO2A2zia/YZJ8Kck/F6YyDSpCMq0YvItpd4YbtDVzPREfTZ48FjZsbYi4Jhzwfvc6o8R56JusAE58P+4sNQ==" }, "node_modules/@cspell/dict-elixir": { "version": "4.0.3", @@ -188,14 +189,14 @@ "integrity": "sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q==" }, "node_modules/@cspell/dict-en_us": { - "version": "4.3.19", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.19.tgz", - "integrity": "sha512-tHcXdkmm0t9LlRct1vgu3+h0KW/wlXCInkTiR4D/rl730q1zu2qVEgiy1saMiTUSNmdu7Hiy+Mhb+1braVqnZQ==" + "version": "4.3.21", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.21.tgz", + "integrity": "sha512-Bzoo2aS4Pej/MGIFlATpp0wMt9IzVHrhDjdV7FgkAIXbjrOn67ojbTxCgWs8AuCNVfK8lBYGEvs5+ElH1msF8w==" }, "node_modules/@cspell/dict-en-common-misspellings": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.0.tgz", - "integrity": "sha512-NOg8dlv37/YqLkCfBs5OXeJm/Wcfb/CzeOmOZJ2ZXRuxwsNuolb4TREUce0yAXRqMhawahY5TSDRJJBgKjBOdw==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.1.tgz", + "integrity": "sha512-uWaP8UG4uvcPyqaG0FzPKCm5kfmhsiiQ45Fs6b3/AEAqfq7Fj1JW0+S3qRt85FQA9SoU6gUJCz9wkK/Ylh7m5A==" }, "node_modules/@cspell/dict-en-gb": { "version": "1.1.33", @@ -203,9 +204,9 @@ "integrity": "sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==" }, "node_modules/@cspell/dict-filetypes": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.3.tgz", - "integrity": "sha512-J9UP+qwwBLfOQ8Qg9tAsKtSY/WWmjj21uj6zXTI9hRLD1eG1uUOLcfVovAmtmVqUWziPSKMr87F6SXI3xmJXgw==" + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.4.tgz", + "integrity": "sha512-IBi8eIVdykoGgIv5wQhOURi5lmCNJq0we6DvqKoPQJHthXbgsuO1qrHSiUVydMiQl/XvcnUWTMeAlVUlUClnVg==" }, "node_modules/@cspell/dict-fonts": { "version": "4.0.0", @@ -218,9 +219,9 @@ "integrity": "sha512-23xyPcD+j+NnqOjRHgW3IU7Li912SX9wmeefcY0QxukbAxJ/vAN4rBpjSwwYZeQPAn3fxdfdNZs03fg+UM+4yQ==" }, "node_modules/@cspell/dict-fullstack": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.1.5.tgz", - "integrity": "sha512-6ppvo1dkXUZ3fbYn/wwzERxCa76RtDDl5Afzv2lijLoijGGUw5yYdLBKJnx8PJBGNLh829X352ftE7BElG4leA==" + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.1.8.tgz", + "integrity": "sha512-YRlZupL7uqMCtEBK0bDP9BrcPnjDhz7m4GBqCc1EYqfXauHbLmDT8ELha7T/E7wsFKniHSjzwDZzhNXo2lusRQ==" }, "node_modules/@cspell/dict-gaming-terms": { "version": "1.0.5", @@ -233,9 +234,14 @@ "integrity": "sha512-simGS/lIiXbEaqJu9E2VPoYW1OTC2xrwPPXNXFMa2uo/50av56qOuaxDrZ5eH1LidFXwoc8HROCHYeKoNrDLSw==" }, "node_modules/@cspell/dict-golang": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.5.tgz", - "integrity": "sha512-w4mEqGz4/wV+BBljLxduFNkMrd3rstBNDXmoX5kD4UTzIb4Sy0QybWCtg2iVT+R0KWiRRA56QKOvBsgXiddksA==" + "version": "6.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.9.tgz", + "integrity": "sha512-etDt2WQauyEQDA+qPS5QtkYTb2I9l5IfQftAllVoB1aOrT6bxxpHvMEpJ0Hsn/vezxrCqa/BmtUbRxllIxIuSg==" + }, + "node_modules/@cspell/dict-google": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-google/-/dict-google-1.0.1.tgz", + "integrity": "sha512-dQr4M3n95uOhtloNSgB9tYYGXGGEGEykkFyRtfcp5pFuEecYUa0BSgtlGKx9RXVtJtKgR+yFT/a5uQSlt8WjqQ==" }, "node_modules/@cspell/dict-haskell": { "version": "4.0.1", @@ -263,9 +269,9 @@ "integrity": "sha512-4JsCLCRhhLMLiaHpmR7zHFjj1qOauzDI5ZzCNQS31TUMfsOo26jAKDfo0jljFAKgw5M2fEG7sKr8IlPpQAYrmQ==" }, "node_modules/@cspell/dict-k8s": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.2.tgz", - "integrity": "sha512-tLT7gZpNPnGa+IIFvK9SP1LrSpPpJ94a/DulzAPOb1Q2UBFwdpFd82UWhio0RNShduvKG/WiMZf/wGl98pn+VQ==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.4.tgz", + "integrity": "sha512-p3RjEkiwh5b1gLkYUMV9w5MHqWYTI1Sm2j4x8QZ+NZHB53PORrjPDyWSaG4giqKYAfs3UYB7QZUyBt0Sb68Vsw==" }, "node_modules/@cspell/dict-latex": { "version": "4.0.0", @@ -298,24 +304,24 @@ "integrity": "sha512-lax/jGz9h3Dv83v8LHa5G0bf6wm8YVRMzbjJPG/9rp7cAGPtdrga+XANFq+B7bY5+jiSA3zvj10LUFCFjnnCCg==" }, "node_modules/@cspell/dict-npm": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.15.tgz", - "integrity": "sha512-sX0X5YWNW54F4baW7b5JJB6705OCBIZtUqjOghlJNORS5No7QY1IX1zc5FxNNu4gsaCZITAmfMi4ityXEsEThA==" + "version": "5.0.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.16.tgz", + "integrity": "sha512-ZWPnLAziEcSCvV0c8k9Qj88pfMu+wZwM5Qks87ShsfBgI8uLZ9tGHravA7gmjH1Gd7Bgxy2ulvXtSqIWPh1lew==" }, "node_modules/@cspell/dict-php": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.6.tgz", - "integrity": "sha512-ySAXisf7twoVFZqBV2o/DKiCLIDTHNqfnj0EfH9OoOUR7HL3rb6zJkm0viLUFDO2G/8SyIi6YrN/6KX+Scjjjg==" + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.7.tgz", + "integrity": "sha512-SUCOBfRDDFz1E2jnAZIIuy8BNbCc8i+VkiL9g4HH9tTN6Nlww5Uz2pMqYS6rZQkXuubqsbkbPlsRiuseEnTmYA==" }, "node_modules/@cspell/dict-powershell": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.3.tgz", - "integrity": "sha512-lEdzrcyau6mgzu1ie98GjOEegwVHvoaWtzQnm1ie4DyZgMr+N6D0Iyj1lzvtmt0snvsDFa5F2bsYzf3IMKcpcA==" + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.4.tgz", + "integrity": "sha512-eosDShapDgBWN9ULF7+sRNdUtzRnUdsfEdBSchDm8FZA4HOqxUSZy3b/cX/Rdw0Fnw0AKgk0kzgXw7tS6vwJMQ==" }, "node_modules/@cspell/dict-public-licenses": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.6.tgz", - "integrity": "sha512-bHqpSpJvLCUcWxj1ov/Ki8WjmESpYwRpQlqfdchekOTc93Huhvjm/RXVN1R4fVf4Hspyem1QVkCGqAmjJMj6sw==" + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.7.tgz", + "integrity": "sha512-KlBXuGcN3LE7tQi/GEqKiDewWGGuopiAD0zRK1QilOx5Co8XAvs044gk4MNIQftc8r0nHeUI+irJKLGcR36DIQ==" }, "node_modules/@cspell/dict-python": { "version": "4.1.11", @@ -341,14 +347,14 @@ "integrity": "sha512-8DFCzkFQ+2k3fDaezWc/D+0AyiBBiOGYfSDUfrTNU7wpvUvJ6cRcAUshMI/cn2QW/mmxTspRgVlXsE6GUMz00Q==" }, "node_modules/@cspell/dict-scala": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.0.tgz", - "integrity": "sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ==" + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.2.tgz", + "integrity": "sha512-v97ClgidZt99JUm7OjhQugDHmhx4U8fcgunHvD/BsXWjXNj4cTr0m0YjofyZoL44WpICsNuFV9F/sv9OM5HUEw==" }, "node_modules/@cspell/dict-software-terms": { - "version": "3.3.20", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.3.20.tgz", - "integrity": "sha512-KmPwCxYWEu7SGyT/0m/n6i6R4ZgxbmN3XcerzA6Z629Wm5iZTVfJaMWqDK2RKAyBawS7OMfxGz0W/wYU4FhJlA==" + "version": "3.3.25", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.3.25.tgz", + "integrity": "sha512-IrNpxU9q4R42ZO9qXm1lqKXqIJwS83eRvo2eDXVau9qEw26+wJqDAOJsdhmrBJ+Dj9Y6r+k70pu02qJTYRwBPg==" }, "node_modules/@cspell/dict-sql": { "version": "2.1.3", @@ -371,9 +377,9 @@ "integrity": "sha512-Ak+vy4HP/bOgzf06BAMC30+ZvL9mzv21xLM2XtfnBLTDJGdxlk/nK0U6QT8VfFLqJ0ZZSpyOxGsUebWDCTr/zQ==" }, "node_modules/@cspell/dict-typescript": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.4.tgz", - "integrity": "sha512-jUcPa0rsPca5ur1+G56DXnSc5hbbJkzvPHHvyQtkbPXBQd3CXPMNfrTVCgzex/7cY/7FONcpFCUwgwfni9Jqbw==" + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.5.tgz", + "integrity": "sha512-EkIwwNV/xqEoBPJml2S16RXj65h1kvly8dfDLgXerrKw6puybZdvAHerAph6/uPTYdtLcsPyJYkPt5ISOJYrtw==" }, "node_modules/@cspell/dict-vue": { "version": "3.0.0", @@ -381,9 +387,9 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.8.1.tgz", - "integrity": "sha512-IyKEbSaHkw9V4Oc4JDasF96+BHKV8motBrepjLIMUjdJ152fBg8zqbvF769POdCJg0QouZVUV+h9V7zC6v45/g==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.8.3.tgz", + "integrity": "sha512-qpxGC2hGVfbSaLJkaEu//rqbgAOjYnMlbxD75Fk9ny96sr+ZI1YC0nmUErWlgXSbtjVY/DHCOu26Usweo5iRgA==", "dependencies": { "import-meta-resolve": "^4.1.0" }, @@ -392,9 +398,9 @@ } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.8.1.tgz", - "integrity": "sha512-QNnMY5jKP/ItVYRGS4w3KF+1iXBUUjldZNVtEoQe2dFergxvbIYQ0S++TZb25G/o9nRF5GmOpecJaOvwUBZsiw==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.8.3.tgz", + "integrity": "sha512-y/pL7Zex8iHQ54qDYvg9oCiCgfZ9DAUTOI/VtPFVC+42JqLx6YufYxJS2uAsFlfAXIPiRV8qnnG6BHImD1Ix6g==", "engines": { "node": ">=18" } @@ -506,12 +512,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "license": "MIT", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -586,9 +591,9 @@ "license": "MIT" }, "node_modules/commander": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz", - "integrity": "sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==", + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", "engines": { "node": ">=18" } @@ -628,26 +633,26 @@ } }, "node_modules/cspell": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.8.1.tgz", - "integrity": "sha512-YDJ62Q400LqxKTQV5Nk+Ub2IZGm5L0p832KbFUMy7FXDwkPLaxp3mfcLFV677FRiTcnGUtGYD+SnPkFJ2hiqsg==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.8.3.tgz", + "integrity": "sha512-JVWI4MNALOuZ+igyJ54C6Iwe8s1ecMCgyGFGId5a0P6wi/V+TFYFhl7QkzIi1Uw4KtXSYrUSlHGUjC2dE0OZ9g==", "dependencies": { - "@cspell/cspell-json-reporter": "8.8.1", - "@cspell/cspell-pipe": "8.8.1", - "@cspell/cspell-types": "8.8.1", - "@cspell/dynamic-import": "8.8.1", + "@cspell/cspell-json-reporter": "8.8.3", + "@cspell/cspell-pipe": "8.8.3", + "@cspell/cspell-types": "8.8.3", + "@cspell/dynamic-import": "8.8.3", "chalk": "^5.3.0", "chalk-template": "^1.1.0", - "commander": "^12.0.0", - "cspell-gitignore": "8.8.1", - "cspell-glob": "8.8.1", - "cspell-io": "8.8.1", - "cspell-lib": "8.8.1", + "commander": "^12.1.0", + "cspell-gitignore": "8.8.3", + "cspell-glob": "8.8.3", + "cspell-io": "8.8.3", + "cspell-lib": "8.8.3", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^8.0.0", "get-stdin": "^9.0.0", - "semver": "^7.6.1", + "semver": "^7.6.2", "strip-ansi": "^7.1.0", "vscode-uri": "^3.0.8" }, @@ -663,11 +668,11 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.8.1.tgz", - "integrity": "sha512-NTFfwL7Si1jp+0TINS9miXGdtPtDq95PhSbZKF9jnuBwnsnAURHCGALryLHlkRvj5JZk6dpkDfw4WxqQXdULNw==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.8.3.tgz", + "integrity": "sha512-61NKZrzTi9OLEEiZBggLQy9nswgR0gd6bKH06xXFQyRfNpAjaPOzOUFhSSfX1MQX+lQF3KtSYcHpppwbpPsL8w==", "dependencies": { - "@cspell/cspell-types": "8.8.1", + "@cspell/cspell-types": "8.8.3", "comment-json": "^4.2.3", "yaml": "^2.4.2" }, @@ -676,13 +681,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.8.1.tgz", - "integrity": "sha512-WJqCLR/icyZc0rphEO6dZZDlSIaWIXd95QjZu3agL7a1LRLjorqhVJty6WZrV4zkOLT6PPB+qcjMxcCCxIlWiw==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.8.3.tgz", + "integrity": "sha512-g2G3uh8JbuJKAYFdFQENcbTIrK9SJRXBiQ/t+ch+9I/t5HmuGOVe+wxKEM/0c9M2CRLpzJShBvttH9rnw4Yqfg==", "dependencies": { - "@cspell/cspell-pipe": "8.8.1", - "@cspell/cspell-types": "8.8.1", - "cspell-trie-lib": "8.8.1", + "@cspell/cspell-pipe": "8.8.3", + "@cspell/cspell-types": "8.8.3", + "cspell-trie-lib": "8.8.3", "fast-equals": "^5.0.1", "gensequence": "^7.0.0" }, @@ -691,11 +696,11 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.8.1.tgz", - "integrity": "sha512-j7wbz/VT/uZ+7oL8xwtxfA05FCv41ZrEKh1aNuMa4BI1xv/VRBmv6thOTz7aq7UcDYPNr8K5VVfBlXT/SvkEvA==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.8.3.tgz", + "integrity": "sha512-+IeVPNnUJOj+D9rc4elbK4DK3p9qxvF/2BMtFsE7a75egeJjAnlzVGzqH2FVMsDj6dxe5bjc8/S4Nhw6B14xTQ==", "dependencies": { - "cspell-glob": "8.8.1", + "cspell-glob": "8.8.3", "find-up-simple": "^1.0.0" }, "bin": { @@ -706,23 +711,23 @@ } }, "node_modules/cspell-glob": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.8.1.tgz", - "integrity": "sha512-x2rS6gJzaF3KZB6FuNkuS3Kb3ynYns0zfC0uG/QJb9V/xc0DmAjQGQhiLIDx6XmvvDvowKmyQ/kBjY/K4VjCvQ==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.8.3.tgz", + "integrity": "sha512-9c4Nw/bIsjKSuBuRrLa1sWtIzbXXvja+FVbUOE9c2IiZfh6K1I+UssiXTbRTMg6qgTdkfT4o3KOcFN0ZcbmCUQ==", "dependencies": { - "micromatch": "^4.0.5" + "micromatch": "^4.0.7" }, "engines": { "node": ">=18" } }, "node_modules/cspell-grammar": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.8.1.tgz", - "integrity": "sha512-YTyrutwIkiPH9t255l+BQtneGAkgE3uZXmnRHeIi6X+qdmnf61i8XYaSaO66VKQJX6VPZG18hBVMSUPZmYtoSw==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.8.3.tgz", + "integrity": "sha512-3RP7xQ/6IiIjbWQDuE+4b0ERKkSWGMY75bd0oEsh5HcFhhOYphmcpxLxRRM/yxYQaYgdvq0QIcwrpanx86KJ7A==", "dependencies": { - "@cspell/cspell-pipe": "8.8.1", - "@cspell/cspell-types": "8.8.1" + "@cspell/cspell-pipe": "8.8.3", + "@cspell/cspell-types": "8.8.3" }, "bin": { "cspell-grammar": "bin.mjs" @@ -732,35 +737,35 @@ } }, "node_modules/cspell-io": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.8.1.tgz", - "integrity": "sha512-qwKEV2kfwT9gbq6EpYt6gcEs0oe0sDPG1YJunt8niuX4YoBe7/9ZHBfUyqNOEA+sBmvI/tjY/Wy6g9mmSRaOYA==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.8.3.tgz", + "integrity": "sha512-vO7BUa6i7tjmQr+9dw/Ic7tm4ECnSUlbuMv0zJs/SIrO9AcID2pCWPeZNZEGAmeutrEOi2iThZ/uS33aCuv7Jw==", "dependencies": { - "@cspell/cspell-service-bus": "8.8.1" + "@cspell/cspell-service-bus": "8.8.3" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.8.1.tgz", - "integrity": "sha512-xntkgDGwDtUehM+fZudp4GbB87a2tY29G6ZqDF7WBcQsg3eyDVK/nc9KzbIfCvdWUCrsB9p+SGBoOmjYTwcocg==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.8.3.tgz", + "integrity": "sha512-IqtTKBPug5Jzt9T8f/b6qGAbARRR5tpQkLjzsrfLzxM68ery23wEPDtmWToEyc9EslulZGLe0T78XuEU9AMF+g==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.8.1", - "@cspell/cspell-pipe": "8.8.1", - "@cspell/cspell-resolver": "8.8.1", - "@cspell/cspell-types": "8.8.1", - "@cspell/dynamic-import": "8.8.1", - "@cspell/strong-weak-map": "8.8.1", + "@cspell/cspell-bundled-dicts": "8.8.3", + "@cspell/cspell-pipe": "8.8.3", + "@cspell/cspell-resolver": "8.8.3", + "@cspell/cspell-types": "8.8.3", + "@cspell/dynamic-import": "8.8.3", + "@cspell/strong-weak-map": "8.8.3", "clear-module": "^4.1.2", "comment-json": "^4.2.3", - "cspell-config-lib": "8.8.1", - "cspell-dictionary": "8.8.1", - "cspell-glob": "8.8.1", - "cspell-grammar": "8.8.1", - "cspell-io": "8.8.1", - "cspell-trie-lib": "8.8.1", + "cspell-config-lib": "8.8.3", + "cspell-dictionary": "8.8.3", + "cspell-glob": "8.8.3", + "cspell-grammar": "8.8.3", + "cspell-io": "8.8.3", + "cspell-trie-lib": "8.8.3", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -775,12 +780,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.8.1.tgz", - "integrity": "sha512-S84XzQYGqKGApjVgamMp8tbHfKCeGZFxMwqedb4vxEJTYnUuCHaVPX2BK2SKaLSv/Vrd8mrJ/57sx5f8C44cFg==", + "version": "8.8.3", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.8.3.tgz", + "integrity": "sha512-0zrkrhrFLVajwo6++XD9a+r0Olml7UjPgbztjPKbXIJrZCradBF5rvt3wq5mPpsjq2+Dz0z6K5muZpbO+gqapQ==", "dependencies": { - "@cspell/cspell-pipe": "8.8.1", - "@cspell/cspell-types": "8.8.1", + "@cspell/cspell-pipe": "8.8.3", + "@cspell/cspell-types": "8.8.3", "gensequence": "^7.0.0" }, "engines": { @@ -874,10 +879,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "license": "MIT", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1105,7 +1109,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -1159,12 +1162,11 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "license": "MIT", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -1465,7 +1467,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, diff --git a/package.json b/package.json index e4d675d4e5..7ec52f9a13 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.8.1" + "cspell": "^8.8.3" } } From a60fb2b164682a602937623c41995cecd4186bab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 14:54:47 +0000 Subject: [PATCH 326/845] Bump Microsoft.NET.Test.Sdk from 17.9.0 to 17.10.0 Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.9.0 to 17.10.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.9.0...v17.10.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 2 +- Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index bb7a47351c..7adc92d35d 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -5,7 +5,7 @@ - + all diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index a1ab15ace2..d38f50bad9 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -10,7 +10,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 03df5de29e..7efa5058c6 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -21,7 +21,7 @@ - + diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index f24efa968b..c9b897a4c5 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -10,7 +10,7 @@ - + diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 9917ea25af..178d629854 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -21,7 +21,7 @@ - + diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 77ffc88a76..79e10ce825 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj index 435348227f..1c5ade016e 100644 --- a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj +++ b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index dbc83d0bad..6a176eedb2 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index 81eb5f5fcd..06fd2242f4 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index a155747cad..7d9a517a5b 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 09cb890a90..e2fb96fdfa 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -6,7 +6,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive From fc0d0d905f5bbe6b227d60b07d7f8beff76eb067 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 18:29:11 +0200 Subject: [PATCH 327/845] Bump the xunit group with 2 updates (#2657) * Bump the xunit group with 2 updates Bumps the xunit group with 2 updates: [xunit](https://github.com/xunit/xunit) and [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit). Updates `xunit` from 2.8.0 to 2.8.1 - [Commits](https://github.com/xunit/xunit/compare/2.8.0...2.8.1) Updates `xunit.runner.visualstudio` from 2.8.0 to 2.8.1 - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] * xunit 2.8.0 -> 2.8.1 --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jonas Nyrup --- Build/_build.csproj | 4 ++-- Tests/Approval.Tests/Approval.Tests.csproj | 4 ++-- Tests/FSharp.Specs/FSharp.Specs.fsproj | 4 ++-- .../FluentAssertions.Equivalency.Specs.csproj | 4 ++-- .../FluentAssertions.Extensibility.Specs.csproj | 4 ++-- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 4 ++-- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 4 ++-- Tests/VB.Specs/VB.Specs.vbproj | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index fb8f111f4e..5a7ada431f 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -1,4 +1,4 @@ - + Exe net8.0 @@ -19,7 +19,7 @@ - + diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 7adc92d35d..d3ba37a389 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -6,8 +6,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index d38f50bad9..771977bc4a 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -11,8 +11,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 7efa5058c6..187bcec6b8 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -28,8 +28,8 @@ - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index c9b897a4c5..e639ca1dc9 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -18,8 +18,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 178d629854..2196556e95 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -27,8 +27,8 @@ - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index 7d9a517a5b..50ebf411e0 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -12,8 +12,8 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index e2fb96fdfa..d858b4520d 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -7,8 +7,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all From fa3b9cb66c48da6c1beed69ed2e919ec235a8202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Rocheleau?= <71142100+arocheleau@users.noreply.github.com> Date: Mon, 27 May 2024 13:57:21 -0400 Subject: [PATCH 328/845] Fixed `BeEquivalentTo` when using a custom comparer targeting nullable types (#2648) Handle custom comparer for nullable fields (#2595) --- .../Steps/EqualityComparerEquivalencyStep.cs | 4 +- .../AssertionRuleSpecs.cs | 76 +++++++++++++++++++ docs/_pages/releases.md | 1 + 3 files changed, 80 insertions(+), 1 deletion(-) diff --git a/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs index 94c070ba3f..42c9df3677 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs @@ -16,7 +16,9 @@ public EqualityComparerEquivalencyStep(IEqualityComparer comparer) public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, IEquivalencyValidator nestedValidator) { - if (comparands.GetExpectedType(context.Options) != typeof(T)) + var expectedType = context.Options.UseRuntimeTyping ? comparands.RuntimeType : comparands.CompileTimeType; + + if (expectedType != typeof(T)) { return EquivalencyResult.ContinueWithNext; } diff --git a/Tests/FluentAssertions.Equivalency.Specs/AssertionRuleSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/AssertionRuleSpecs.cs index b5c4b9132d..3a17770ceb 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/AssertionRuleSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/AssertionRuleSpecs.cs @@ -245,6 +245,72 @@ public void When_the_runtime_type_does_match_the_equality_comparer_type_it_shoul act.Should().Throw().WithMessage("*ConcreteClassEqualityComparer*"); } + public class BeEquivalentTo + { + [Fact] + public void An_equality_comparer_of_non_nullable_type_is_not_invoked_on_nullable_member() + { + // Arrange + var subject = new { Timestamp = (DateTime?)22.March(2020) }; + + var expectation = new { Timestamp = (DateTime?)1.January(2020) }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, + opt => opt.Using(new DateTimeByYearComparer())); + + // Assert + act.Should().Throw().WithMessage("Expected*Timestamp*2020*"); + } + + [Fact] + public void An_equality_comparer_of_nullable_type_is_not_invoked_on_non_nullable_member() + { + // Arrange + var subject = new { Timestamp = 22.March(2020) }; + + var expectation = new { Timestamp = 1.January(2020) }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, + opt => opt.Using(new NullableDateTimeByYearComparer())); + + // Assert + act.Should().Throw().WithMessage("Expected*Timestamp*2020*"); + } + + [Fact] + public void An_equality_comparer_of_non_nullable_type_is_invoked_on_non_nullable_data() + { + // Arrange + var subject = new { Timestamp = (DateTime?)22.March(2020) }; + + var expectation = new { Timestamp = (DateTime?)1.January(2020) }; + + // Act + subject.Should().BeEquivalentTo(expectation, opt => opt + .RespectingRuntimeTypes() + .Using(new DateTimeByYearComparer())); + } + + [Fact] + public void An_equality_comparer_of_nullable_type_is_not_invoked_on_non_nullable_data() + { + // Arrange + var subject = new { Timestamp = (DateTime?)22.March(2020) }; + + var expectation = new { Timestamp = (DateTime?)1.January(2020) }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, opt => opt + .RespectingRuntimeTypes() + .Using(new NullableDateTimeByYearComparer())); + + // Assert + act.Should().Throw().WithMessage("Expected*Timestamp*2020*"); + } + } + private interface IInterface; private class ConcreteClass : IInterface @@ -268,4 +334,14 @@ public bool Equals(ConcreteClass x, ConcreteClass y) public int GetHashCode(ConcreteClass obj) => obj.GetProperty().GetHashCode(); } + + private class NullableDateTimeByYearComparer : IEqualityComparer + { + public bool Equals(DateTime? x, DateTime? y) + { + return x?.Year == y?.Year; + } + + public int GetHashCode(DateTime? obj) => obj?.GetHashCode() ?? 0; + } } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index db03679dcd..9787a51183 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -47,6 +47,7 @@ sidebar: * Ensured that nested calls to `AssertionScope(context)` create a chained context - [#2607](https://github.com/fluentassertions/fluentassertions/pull/2607) * One overload of the `AssertionScope` constructor would not create an actual scope associated with the thread - [#2607](https://github.com/fluentassertions/fluentassertions/pull/2607) * Fixed `ThrowWithinAsync` not respecting `OperationCanceledException` - [#2614](https://github.com/fluentassertions/fluentassertions/pull/2614) +* Fixed using `BeEquivalentTo` with an `IEqualityComparer` targeting nullable types - [#2648](https://github.com/fluentassertions/fluentassertions/pull/2648) ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) From c0e4fc9f52503beec26dcaa81dcfd0882c8ad82f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 20:39:24 +0200 Subject: [PATCH 329/845] Bump Meziantou.Analyzer from 2.0.153 to 2.0.155 (#2663) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.153 to 2.0.155. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.153...2.0.155) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 7a22fe188d..d66c7dd741 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From ad796b14a2b9e5e386feaa0b09f4227cb832318d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 14:43:10 +0000 Subject: [PATCH 330/845] Bump the xunit group with 3 updates Bumps the xunit group with 3 updates: [Verify.Xunit](https://github.com/VerifyTests/Verify), [System.Collections.Immutable](https://github.com/dotnet/runtime) and [System.Threading.Tasks.Extensions](https://github.com/dotnet/corefx). Updates `Verify.Xunit` from 24.2.0 to 25.0.1 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/commits/25.0.1) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) Updates `System.Threading.Tasks.Extensions` from 4.5.0 to 4.5.4 - [Release notes](https://github.com/dotnet/corefx/releases) - [Commits](https://github.com/dotnet/corefx/commits) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: System.Threading.Tasks.Extensions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index d3ba37a389..485d80f5c6 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 6dd4b22d71a292a36abc9bedc1e13f2bdf6ac5ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 14:50:41 +0000 Subject: [PATCH 331/845] Bump Roslynator.Analyzers from 4.12.3 to 4.12.4 Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.12.3 to 4.12.4. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.12.3...v4.12.4) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index d66c7dd741..9b761e210c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 8656682fe60df5ebff2cd6cc7a0d3c140e96786b Mon Sep 17 00:00:00 2001 From: psychotoad <81531285+psychotoad@users.noreply.github.com> Date: Sat, 8 Jun 2024 13:38:47 +0200 Subject: [PATCH 332/845] Add `[StringSyntax("CompositeFormat")]` to all `because` parameters (#2635) * Add StringSyntax("CompositeFormat") to all "because" parameters * Add StringSyntax to missing "because" parameters * Remove redundant using directives * Disable Qodana checks in tests htat intentially cause format problems * Disable Qudona warnigns through configuration * Disable and restore ReSharper FormatStringProblem * Add empty line in front of ReShaprer disable comment line --------- Co-authored-by: psychotoad --- .../AsyncAssertionsExtensions.cs | 5 +- .../GenericCollectionAssertions.cs | 308 ++++++++++-------- .../GenericDictionaryAssertions.cs | 41 ++- .../Collections/StringCollectionAssertions.cs | 22 +- ...uentOrderingGenericCollectionAssertions.cs | 17 +- .../Equivalency/Steps/AssertionContext.cs | 6 +- .../Events/EventAssertions.cs | 9 +- .../ExceptionAssertionsExtensions.cs | 17 +- .../Execution/AssertionScope.cs | 5 +- .../Execution/ContinuedAssertionScope.cs | 7 +- Src/FluentAssertions/Execution/FailReason.cs | 6 +- .../Execution/IAssertionScope.cs | 3 +- .../Execution/MessageBuilder.cs | 5 +- Src/FluentAssertions/Execution/Reason.cs | 4 +- .../Numeric/ComparableTypeAssertions.cs | 37 ++- .../Numeric/NullableNumericAssertions.cs | 12 +- .../Numeric/NumericAssertions.cs | 46 +-- .../NumericAssertionsExtensions.cs | 161 ++++----- .../ObjectAssertionsExtensions.cs | 11 +- .../Primitives/BooleanAssertions.cs | 11 +- .../Primitives/DateOnlyAssertions.cs | 61 ++-- .../Primitives/DateTimeAssertions.cs | 106 +++--- .../Primitives/DateTimeOffsetAssertions.cs | 140 ++++---- .../DateTimeOffsetRangeAssertions.cs | 8 +- .../Primitives/DateTimeRangeAssertions.cs | 9 +- .../Primitives/EnumAssertions.cs | 51 +-- .../Primitives/GuidAssertions.cs | 17 +- .../HttpResponseMessageAssertions.cs | 18 +- .../Primitives/NullableBooleanAssertions.cs | 19 +- .../Primitives/NullableDateOnlyAssertions.cs | 9 +- .../Primitives/NullableDateTimeAssertions.cs | 9 +- .../NullableDateTimeOffsetAssertions.cs | 9 +- .../Primitives/NullableEnumAssertions.cs | 9 +- .../Primitives/NullableGuidAssertions.cs | 11 +- .../NullableSimpleTimeSpanAssertions.cs | 13 +- .../Primitives/NullableTimeOnlyAssertions.cs | 9 +- .../Primitives/ObjectAssertions.cs | 43 +-- .../Primitives/ReferenceTypeAssertions.cs | 37 ++- .../Primitives/SimpleTimeSpanAssertions.cs | 32 +- .../Primitives/StringAssertions.cs | 133 ++++---- .../Primitives/StringValidator.cs | 3 +- .../StringValidatorSupportingNull.cs | 3 +- .../Primitives/TimeOnlyAssertions.cs | 86 ++--- .../Specialized/ActionAssertions.cs | 7 +- .../Specialized/AsyncFunctionAssertions.cs | 22 +- .../Specialized/DelegateAssertions.cs | 7 +- .../Specialized/DelegateAssertionsBase.cs | 8 +- .../Specialized/ExceptionAssertions.cs | 31 +- .../Specialized/ExecutionTimeAssertions.cs | 21 +- .../Specialized/FunctionAssertionHelpers.cs | 5 +- .../Specialized/FunctionAssertions.cs | 5 +- .../GenericAsyncFunctionAssertions.cs | 7 +- .../NonGenericAsyncFunctionAssertions.cs | 10 +- .../TaskCompletionSourceAssertions.cs | 9 +- .../Streams/BufferedStreamAssertions.cs | 7 +- .../Streams/StreamAssertions.cs | 33 +- .../Types/AssemblyAssertions.cs | 15 +- .../Types/MemberInfoAssertions.cs | 9 +- .../Types/MethodBaseAssertions.cs | 8 +- .../Types/MethodInfoAssertions.cs | 33 +- .../Types/MethodInfoSelectorAssertions.cs | 31 +- .../Types/PropertyInfoAssertions.cs | 30 +- .../Types/PropertyInfoSelectorAssertions.cs | 17 +- Src/FluentAssertions/Types/TypeAssertions.cs | 156 +++++---- .../Types/TypeSelectorAssertions.cs | 45 +-- .../Xml/Equivalency/XmlReaderValidator.cs | 3 +- .../Xml/XAttributeAssertions.cs | 10 +- .../Xml/XDocumentAssertions.cs | 37 ++- .../Xml/XElementAssertions.cs | 41 ++- .../Xml/XmlElementAssertions.cs | 17 +- Src/FluentAssertions/Xml/XmlNodeAssertions.cs | 7 +- .../CollectionAssertionSpecs.EndWith.cs | 5 + .../AssertionScope.MessageFormatingSpecs.cs | 8 + qodana.yaml | 3 + 74 files changed, 1228 insertions(+), 987 deletions(-) diff --git a/Src/FluentAssertions/AsyncAssertionsExtensions.cs b/Src/FluentAssertions/AsyncAssertionsExtensions.cs index 53c6c349b9..4981a66dd0 100644 --- a/Src/FluentAssertions/AsyncAssertionsExtensions.cs +++ b/Src/FluentAssertions/AsyncAssertionsExtensions.cs @@ -1,3 +1,4 @@ +using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; using FluentAssertions.Specialized; @@ -26,7 +27,7 @@ public static class AsyncAssertionsExtensions /// public static async Task, T>> WithResult( this Task, T>> task, - T expected, string because = "", params object[] becauseArgs) + T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var andWhichConstraint = await task; var subject = andWhichConstraint.Subject; @@ -49,7 +50,7 @@ public static async Task, T /// public static async Task, T>> WithResult( this Task, T>> task, - T expected, string because = "", params object[] becauseArgs) + T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var andWhichConstraint = await task; var subject = andWhichConstraint.Subject; diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index 42cef42b33..3c33ae9a28 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -62,8 +62,8 @@ public GenericCollectionAssertions(TCollection actualValue) /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint> AllBeAssignableTo(string because = "", - params object[] becauseArgs) + public AndWhichConstraint> AllBeAssignableTo( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -104,7 +104,8 @@ public AndWhichConstraint> AllBeAssignabl /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint AllBeAssignableTo(Type expectedType, string because = "", params object[] becauseArgs) + public AndConstraint AllBeAssignableTo(Type expectedType, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expectedType); @@ -146,7 +147,7 @@ public AndConstraint AllBeAssignableTo(Type expectedType, string be /// Zero or more objects to format using the placeholders in . /// public AndConstraint AllBeEquivalentTo(TExpectation expectation, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return AllBeEquivalentTo(expectation, options => options, because, becauseArgs); } @@ -179,8 +180,7 @@ public AndConstraint AllBeEquivalentTo(TExpectation e /// is . public AndConstraint AllBeEquivalentTo(TExpectation expectation, Func, EquivalencyOptions> config, - string because = "", - params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -209,8 +209,8 @@ public AndConstraint AllBeEquivalentTo(TExpectation e /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint> AllBeOfType(string because = "", - params object[] becauseArgs) + public AndWhichConstraint> AllBeOfType( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -251,7 +251,8 @@ public AndWhichConstraint> AllBeOfType. /// /// is . - public AndConstraint AllBeOfType(Type expectedType, string because = "", params object[] becauseArgs) + public AndConstraint AllBeOfType(Type expectedType, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expectedType); @@ -283,7 +284,7 @@ public AndConstraint AllBeOfType(Type expectedType, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeEmpty(string because = "", params object[] becauseArgs) + public AndConstraint BeEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var singleItemArray = Subject?.Take(1).ToArray(); Execute.Assertion @@ -321,7 +322,7 @@ public AndConstraint BeEmpty(string because = "", params object[] b /// Zero or more objects to format using the placeholders in . /// public AndConstraint BeEquivalentTo(IEnumerable expectation, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeEquivalentTo(expectation, config => config, because, becauseArgs); } @@ -353,8 +354,8 @@ public AndConstraint BeEquivalentTo(IEnumerable /// is . public AndConstraint BeEquivalentTo(IEnumerable expectation, - Func, EquivalencyOptions> config, string because = "", - params object[] becauseArgs) + Func, EquivalencyOptions> config, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -399,7 +400,8 @@ public AndConstraint BeEquivalentTo(IEnumerable public AndConstraint> BeInAscendingOrder( - Expression> propertyExpression, string because = "", params object[] becauseArgs) + Expression> propertyExpression, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeInAscendingOrder(propertyExpression, GetComparer(), because, becauseArgs); } @@ -423,7 +425,8 @@ public AndConstraint> BeInAscendingOrder /// is . public AndConstraint> BeInAscendingOrder( - IComparer comparer, string because = "", params object[] becauseArgs) + IComparer comparer, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer."); @@ -453,8 +456,8 @@ public AndConstraint> BeInAscendingOrder( /// /// is . public AndConstraint> BeInAscendingOrder( - Expression> propertyExpression, IComparer comparer, string because = "", - params object[] becauseArgs) + Expression> propertyExpression, IComparer comparer, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer."); @@ -476,7 +479,8 @@ public AndConstraint> BeInAscendingOrder /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// - public AndConstraint> BeInAscendingOrder(string because = "", params object[] becauseArgs) + public AndConstraint> BeInAscendingOrder( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeInAscendingOrder(GetComparer(), because, becauseArgs); } @@ -498,8 +502,8 @@ public AndConstraint> BeInAscendingOrder(string /// /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// - public AndConstraint> BeInAscendingOrder(Func comparison, string because = "", - params object[] becauseArgs) + public AndConstraint> BeInAscendingOrder(Func comparison, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeInOrder(Comparer.Create((x, y) => comparison(x, y)), SortOrder.Ascending, because, becauseArgs); } @@ -522,7 +526,8 @@ public AndConstraint> BeInAscendingOrder(Func public AndConstraint> BeInDescendingOrder( - Expression> propertyExpression, string because = "", params object[] becauseArgs) + Expression> propertyExpression, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeInDescendingOrder(propertyExpression, GetComparer(), because, becauseArgs); } @@ -546,7 +551,8 @@ public AndConstraint> BeInDescendingOrder /// is . public AndConstraint> BeInDescendingOrder( - IComparer comparer, string because = "", params object[] becauseArgs) + IComparer comparer, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer."); @@ -576,8 +582,8 @@ public AndConstraint> BeInDescendingOrder( /// /// is . public AndConstraint> BeInDescendingOrder( - Expression> propertyExpression, IComparer comparer, string because = "", - params object[] becauseArgs) + Expression> propertyExpression, IComparer comparer, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer."); @@ -599,7 +605,8 @@ public AndConstraint> BeInDescendingOrder /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// - public AndConstraint> BeInDescendingOrder(string because = "", params object[] becauseArgs) + public AndConstraint> BeInDescendingOrder( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeInDescendingOrder(GetComparer(), because, becauseArgs); } @@ -621,8 +628,8 @@ public AndConstraint> BeInDescendingOrder(string /// /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// - public AndConstraint> BeInDescendingOrder(Func comparison, string because = "", - params object[] becauseArgs) + public AndConstraint> BeInDescendingOrder(Func comparison, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeInOrder(Comparer.Create((x, y) => comparison(x, y)), SortOrder.Descending, because, becauseArgs); } @@ -637,7 +644,7 @@ public AndConstraint> BeInDescendingOrder(Func /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeNullOrEmpty(string because = "", params object[] becauseArgs) + public AndConstraint BeNullOrEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var singleItemArray = Subject?.Take(1).ToArray(); var nullOrEmpty = singleItemArray is null || singleItemArray.Length == 0; @@ -663,8 +670,8 @@ public AndConstraint BeNullOrEmpty(string because = "", params obje /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint BeSubsetOf(IEnumerable expectedSuperset, string because = "", - params object[] becauseArgs) + public AndConstraint BeSubsetOf(IEnumerable expectedSuperset, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expectedSuperset, nameof(expectedSuperset), "Cannot verify a subset against a collection."); @@ -696,7 +703,8 @@ public AndConstraint BeSubsetOf(IEnumerable expectedSuperset, st /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint Contain(T expected, string because = "", params object[] becauseArgs) + public AndWhichConstraint Contain(T expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -732,7 +740,8 @@ public AndWhichConstraint Contain(T expected, string because = " /// Zero or more objects to format using the placeholders in . /// /// is . - public AndWhichConstraint Contain(Expression> predicate, string because = "", + public AndWhichConstraint Contain(Expression> predicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(predicate); @@ -773,7 +782,8 @@ public AndWhichConstraint Contain(Expression> pred /// /// is . /// is empty. - public AndConstraint Contain(IEnumerable expected, string because = "", params object[] becauseArgs) + public AndConstraint Contain(IEnumerable expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot verify containment against a collection"); @@ -833,8 +843,8 @@ public AndConstraint Contain(IEnumerable expected, string becaus /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint ContainEquivalentOf(TExpectation expectation, string because = "", - params object[] becauseArgs) + public AndWhichConstraint ContainEquivalentOf(TExpectation expectation, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return ContainEquivalentOf(expectation, config => config, because, becauseArgs); } @@ -869,8 +879,8 @@ public AndWhichConstraint ContainEquivalentOf(TExp /// /// is . public AndWhichConstraint ContainEquivalentOf(TExpectation expectation, - Func, - EquivalencyOptions> config, string because = "", params object[] becauseArgs) + Func, EquivalencyOptions> config, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -946,8 +956,8 @@ public AndConstraint ContainInOrder(params T[] expected) /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint ContainInOrder(IEnumerable expected, string because = "", - params object[] becauseArgs) + public AndConstraint ContainInOrder(IEnumerable expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot verify ordered containment against a collection."); @@ -1008,8 +1018,8 @@ public AndConstraint ContainInConsecutiveOrder(params T[] expected) /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint ContainInConsecutiveOrder(IEnumerable expected, string because = "", - params object[] becauseArgs) + public AndConstraint ContainInConsecutiveOrder(IEnumerable expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot verify ordered containment against a collection."); @@ -1071,7 +1081,8 @@ public AndConstraint ContainInConsecutiveOrder(IEnumerable expec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint ContainItemsAssignableTo(string because = "", params object[] becauseArgs) + public AndConstraint ContainItemsAssignableTo( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -1099,7 +1110,8 @@ public AndConstraint ContainItemsAssignableTo(string /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotContainItemsAssignableTo(string because = "", params object[] becauseArgs) => + public AndConstraint NotContainItemsAssignableTo( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) => NotContainItemsAssignableTo(typeof(TExpectation), because, becauseArgs); /// @@ -1115,7 +1127,8 @@ public AndConstraint NotContainItemsAssignableTo(stri /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotContainItemsAssignableTo(Type type, string because = "", params object[] becauseArgs) + public AndConstraint NotContainItemsAssignableTo(Type type, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(type); @@ -1145,7 +1158,7 @@ public AndConstraint NotContainItemsAssignableTo(Type type, string /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint ContainSingle(string because = "", params object[] becauseArgs) + public AndWhichConstraint ContainSingle([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -1194,7 +1207,7 @@ public AndWhichConstraint ContainSingle(string because = "", par /// /// is . public AndWhichConstraint ContainSingle(Expression> predicate, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(predicate); @@ -1257,7 +1270,8 @@ public AndWhichConstraint ContainSingle(Expression /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint EndWith(IEnumerable expectation, string because = "", params object[] becauseArgs) + public AndConstraint EndWith(IEnumerable expectation, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return EndWith(expectation, (a, b) => EqualityComparer.Default.Equals(a, b), because, becauseArgs); } @@ -1281,8 +1295,8 @@ public AndConstraint EndWith(IEnumerable expectation, string bec /// /// is . public AndConstraint EndWith( - IEnumerable expectation, Func equalityComparison, string because = "", - params object[] becauseArgs) + IEnumerable expectation, Func equalityComparison, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expectation, nameof(expectation), "Cannot compare collection with ."); @@ -1304,7 +1318,8 @@ public AndConstraint EndWith( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint EndWith(T element, string because = "", params object[] becauseArgs) + public AndConstraint EndWith(T element, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return EndWith([element], ObjectExtensions.GetComparer(), because, becauseArgs); } @@ -1339,8 +1354,8 @@ public AndConstraint Equal(params T[] elements) /// Zero or more objects to format using the placeholders in . /// public AndConstraint Equal( - IEnumerable expectation, Func equalityComparison, string because = "", - params object[] becauseArgs) + IEnumerable expectation, Func equalityComparison, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { AssertSubjectEquality(expectation, equalityComparison, because, becauseArgs); @@ -1359,7 +1374,8 @@ public AndConstraint Equal( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Equal(IEnumerable expected, string because = "", params object[] becauseArgs) + public AndConstraint Equal(IEnumerable expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { AssertSubjectEquality(expected, ObjectExtensions.GetComparer(), because, becauseArgs); @@ -1377,7 +1393,8 @@ public AndConstraint Equal(IEnumerable expected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveCount(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -1411,8 +1428,8 @@ public AndConstraint HaveCount(int expected, string because = "", p /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint HaveCount(Expression> countPredicate, string because = "", - params object[] becauseArgs) + public AndConstraint HaveCount(Expression> countPredicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(countPredicate, nameof(countPredicate), "Cannot compare collection count against a predicate."); @@ -1451,8 +1468,8 @@ public AndConstraint HaveCount(Expression> countPre /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveCountGreaterThanOrEqualTo(int expected, string because = "", - params object[] becauseArgs) + public AndConstraint HaveCountGreaterThanOrEqualTo(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -1481,7 +1498,8 @@ public AndConstraint HaveCountGreaterThanOrEqualTo(int expected, st /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveCountGreaterThan(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveCountGreaterThan(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -1510,7 +1528,8 @@ public AndConstraint HaveCountGreaterThan(int expected, string beca /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveCountLessThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveCountLessThanOrEqualTo(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -1539,7 +1558,8 @@ public AndConstraint HaveCountLessThanOrEqualTo(int expected, strin /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveCountLessThan(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveCountLessThan(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -1570,8 +1590,8 @@ public AndConstraint HaveCountLessThan(int expected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint HaveElementAt(int index, T element, string because = "", - params object[] becauseArgs) + public AndWhichConstraint HaveElementAt(int index, T element, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -1614,8 +1634,8 @@ public AndWhichConstraint HaveElementAt(int index, T element, st /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveElementPreceding(T successor, T expectation, string because = "", - params object[] becauseArgs) + public AndConstraint HaveElementPreceding(T successor, T expectation, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -1651,8 +1671,8 @@ public AndConstraint HaveElementPreceding(T successor, T expectatio /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveElementSucceeding(T predecessor, T expectation, string because = "", - params object[] becauseArgs) + public AndConstraint HaveElementSucceeding(T predecessor, T expectation, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -1688,8 +1708,8 @@ public AndConstraint HaveElementSucceeding(T predecessor, T expecta /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint HaveSameCount(IEnumerable otherCollection, string because = "", - params object[] becauseArgs) + public AndConstraint HaveSameCount(IEnumerable otherCollection, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(otherCollection, nameof(otherCollection), "Cannot verify count against a collection."); @@ -1721,8 +1741,8 @@ public AndConstraint HaveSameCount(IEnumerable. /// /// is . - public AndConstraint IntersectWith(IEnumerable otherCollection, string because = "", - params object[] becauseArgs) + public AndConstraint IntersectWith(IEnumerable otherCollection, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(otherCollection, nameof(otherCollection), "Cannot verify intersection against a collection."); @@ -1757,7 +1777,7 @@ public AndConstraint IntersectWith(IEnumerable otherCollection, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) + public AndConstraint NotBeEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -1787,8 +1807,8 @@ public AndConstraint NotBeEmpty(string because = "", params object[ /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotBeEquivalentTo(IEnumerable unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeEquivalentTo(IEnumerable unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot verify inequivalence against a collection."); @@ -1832,7 +1852,7 @@ public AndConstraint NotBeEquivalentTo(IEnumerable public AndConstraint NotBeEquivalentTo(IEnumerable unexpected, Func, EquivalencyOptions> config, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot verify inequivalence against a collection."); @@ -1879,7 +1899,8 @@ public AndConstraint NotBeEquivalentTo(IEnumerable public AndConstraint NotBeInAscendingOrder( - Expression> propertyExpression, string because = "", params object[] becauseArgs) + Expression> propertyExpression, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotBeInAscendingOrder(propertyExpression, GetComparer(), because, becauseArgs); } @@ -1903,7 +1924,8 @@ public AndConstraint NotBeInAscendingOrder( /// /// is . public AndConstraint NotBeInAscendingOrder( - IComparer comparer, string because = "", params object[] becauseArgs) + IComparer comparer, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer."); @@ -1933,8 +1955,8 @@ public AndConstraint NotBeInAscendingOrder( /// /// is . public AndConstraint NotBeInAscendingOrder( - Expression> propertyExpression, IComparer comparer, string because = "", - params object[] becauseArgs) + Expression> propertyExpression, IComparer comparer, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer."); @@ -1956,7 +1978,7 @@ public AndConstraint NotBeInAscendingOrder( /// /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// - public AndConstraint NotBeInAscendingOrder(string because = "", params object[] becauseArgs) + public AndConstraint NotBeInAscendingOrder([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotBeInAscendingOrder(GetComparer(), because, becauseArgs); } @@ -1977,8 +1999,8 @@ public AndConstraint NotBeInAscendingOrder(string because = "", par /// /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// - public AndConstraint NotBeInAscendingOrder(Func comparison, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeInAscendingOrder(Func comparison, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotBeInOrder(Comparer.Create((x, y) => comparison(x, y)), SortOrder.Ascending, because, becauseArgs); } @@ -2001,7 +2023,8 @@ public AndConstraint NotBeInAscendingOrder(Func comparis /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// public AndConstraint NotBeInDescendingOrder( - Expression> propertyExpression, string because = "", params object[] becauseArgs) + Expression> propertyExpression, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotBeInDescendingOrder(propertyExpression, GetComparer(), because, becauseArgs); } @@ -2025,7 +2048,7 @@ public AndConstraint NotBeInDescendingOrder( /// /// is . public AndConstraint NotBeInDescendingOrder( - IComparer comparer, string because = "", params object[] becauseArgs) + IComparer comparer, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer."); @@ -2055,8 +2078,8 @@ public AndConstraint NotBeInDescendingOrder( /// /// is . public AndConstraint NotBeInDescendingOrder( - Expression> propertyExpression, IComparer comparer, string because = "", - params object[] becauseArgs) + Expression> propertyExpression, IComparer comparer, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer."); @@ -2078,7 +2101,7 @@ public AndConstraint NotBeInDescendingOrder( /// /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// - public AndConstraint NotBeInDescendingOrder(string because = "", params object[] becauseArgs) + public AndConstraint NotBeInDescendingOrder([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotBeInDescendingOrder(GetComparer(), because, becauseArgs); } @@ -2099,8 +2122,8 @@ public AndConstraint NotBeInDescendingOrder(string because = "", pa /// /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// - public AndConstraint NotBeInDescendingOrder(Func comparison, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeInDescendingOrder(Func comparison, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotBeInOrder(Comparer.Create((x, y) => comparison(x, y)), SortOrder.Descending, because, becauseArgs); } @@ -2115,7 +2138,7 @@ public AndConstraint NotBeInDescendingOrder(Func compari /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeNullOrEmpty(string because = "", params object[] becauseArgs) + public AndConstraint NotBeNullOrEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotBeNull(because, becauseArgs) .And.NotBeEmpty(because, becauseArgs); @@ -2132,8 +2155,8 @@ public AndConstraint NotBeNullOrEmpty(string because = "", params o /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeSubsetOf(IEnumerable unexpectedSuperset, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeSubsetOf(IEnumerable unexpectedSuperset, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -2177,7 +2200,8 @@ public AndConstraint NotBeSubsetOf(IEnumerable unexpectedSuperse /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint NotContain(T unexpected, string because = "", params object[] becauseArgs) + public AndWhichConstraint NotContain(T unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -2215,8 +2239,8 @@ public AndWhichConstraint NotContain(T unexpected, string becaus /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotContain(Expression> predicate, string because = "", - params object[] becauseArgs) + public AndConstraint NotContain(Expression> predicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(predicate); @@ -2254,7 +2278,8 @@ public AndConstraint NotContain(Expression> predicate /// /// is . /// is empty. - public AndConstraint NotContain(IEnumerable unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotContain(IEnumerable unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot verify non-containment against a collection"); @@ -2316,8 +2341,8 @@ public AndConstraint NotContain(IEnumerable unexpected, string b /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotContainEquivalentOf(TExpectation unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotContainEquivalentOf(TExpectation unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotContainEquivalentOf(unexpected, config => config, because, becauseArgs); } @@ -2353,8 +2378,8 @@ public AndConstraint NotContainEquivalentOf(TExpectat /// is . [SuppressMessage("Design", "MA0051:Method is too long", Justification = "Needs refactoring")] public AndConstraint NotContainEquivalentOf(TExpectation unexpected, - Func, - EquivalencyOptions> config, string because = "", params object[] becauseArgs) + Func, EquivalencyOptions> config, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -2459,8 +2484,8 @@ public AndConstraint NotContainInOrder(params T[] unexpected) /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotContainInOrder(IEnumerable unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotContainInOrder(IEnumerable unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot verify absence of ordered containment against a collection."); @@ -2530,8 +2555,8 @@ public AndConstraint NotContainInConsecutiveOrder(params T[] unexpe /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotContainInConsecutiveOrder(IEnumerable unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotContainInConsecutiveOrder(IEnumerable unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot verify absence of ordered containment against a collection."); @@ -2596,8 +2621,8 @@ public AndConstraint NotContainInConsecutiveOrder(IEnumerable un /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotContainNulls(Expression> predicate, string because = "", - params object[] becauseArgs) + public AndConstraint NotContainNulls(Expression> predicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TKey : class { Guard.ThrowIfArgumentIsNull(predicate); @@ -2635,7 +2660,7 @@ public AndConstraint NotContainNulls(Expression /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotContainNulls(string because = "", params object[] becauseArgs) + public AndConstraint NotContainNulls([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -2686,7 +2711,8 @@ public AndConstraint NotContainNulls(string because = "", params ob /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotEqual(IEnumerable unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotEqual(IEnumerable unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare collection with ."); @@ -2720,7 +2746,8 @@ public AndConstraint NotEqual(IEnumerable unexpected, string bec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveCount(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveCount(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -2751,8 +2778,7 @@ public AndConstraint NotHaveCount(int unexpected, string because = /// /// is . public AndConstraint NotHaveSameCount(IEnumerable otherCollection, - string because = "", - params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(otherCollection, nameof(otherCollection), "Cannot verify count against a collection."); @@ -2790,8 +2816,8 @@ public AndConstraint NotHaveSameCount(IEnumerable. /// /// is . - public AndConstraint NotIntersectWith(IEnumerable otherCollection, string because = "", - params object[] becauseArgs) + public AndConstraint NotIntersectWith(IEnumerable otherCollection, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(otherCollection, nameof(otherCollection), "Cannot verify intersection against a collection."); @@ -2831,7 +2857,8 @@ public AndConstraint NotIntersectWith(IEnumerable otherCollectio /// /// is . public AndConstraint OnlyContain( - Expression> predicate, string because = "", params object[] becauseArgs) + Expression> predicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(predicate); @@ -2865,8 +2892,8 @@ public AndConstraint OnlyContain( /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint OnlyHaveUniqueItems(Expression> predicate, string because = "", - params object[] becauseArgs) + public AndConstraint OnlyHaveUniqueItems(Expression> predicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(predicate); @@ -2920,7 +2947,7 @@ public AndConstraint OnlyHaveUniqueItems(Expression /// Zero or more objects to format using the placeholders in . /// - public AndConstraint OnlyHaveUniqueItems(string because = "", params object[] becauseArgs) + public AndConstraint OnlyHaveUniqueItems([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -2972,7 +2999,8 @@ public AndConstraint OnlyHaveUniqueItems(string because = "", param /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint AllSatisfy(Action expected, string because = "", params object[] becauseArgs) + public AndConstraint AllSatisfy(Action expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot verify against a inspector"); @@ -3046,8 +3074,8 @@ public AndConstraint SatisfyRespectively(params Action[] element /// /// is . /// is empty. - public AndConstraint SatisfyRespectively(IEnumerable> expected, string because = "", - params object[] becauseArgs) + public AndConstraint SatisfyRespectively(IEnumerable> expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot verify against a collection of inspectors"); @@ -3136,8 +3164,8 @@ public AndConstraint Satisfy(params Expression>[] pre /// /// is . /// is empty. - public AndConstraint Satisfy(IEnumerable>> predicates, string because = "", - params object[] becauseArgs) + public AndConstraint Satisfy(IEnumerable>> predicates, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(predicates, nameof(predicates), "Cannot verify against a collection of predicates"); @@ -3212,7 +3240,8 @@ public AndConstraint Satisfy(IEnumerable>> /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint StartWith(IEnumerable expectation, string because = "", params object[] becauseArgs) + public AndConstraint StartWith(IEnumerable expectation, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return StartWith(expectation, (a, b) => EqualityComparer.Default.Equals(a, b), because, becauseArgs); } @@ -3236,8 +3265,8 @@ public AndConstraint StartWith(IEnumerable expectation, string b /// /// is . public AndConstraint StartWith( - IEnumerable expectation, Func equalityComparison, string because = "", - params object[] becauseArgs) + IEnumerable expectation, Func equalityComparison, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expectation, nameof(expectation), "Cannot compare collection with ."); @@ -3259,7 +3288,8 @@ public AndConstraint StartWith( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint StartWith(T element, string because = "", params object[] becauseArgs) + public AndConstraint StartWith(T element, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return StartWith([element], ObjectExtensions.GetComparer(), because, becauseArgs); } @@ -3268,7 +3298,7 @@ internal AndConstraint> BeOrderedBy( Expression> propertyExpression, IComparer comparer, SortOrder direction, - string because, + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { if (IsValidProperty(propertyExpression, because, becauseArgs)) @@ -3321,8 +3351,8 @@ protected static IEnumerable RepeatAsManyAs(TExpecta } protected void AssertCollectionEndsWith(IEnumerable actual, - ICollection expected, Func equalityComparison, string because = "", - params object[] becauseArgs) + ICollection expected, Func equalityComparison, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(equalityComparison); @@ -3345,8 +3375,8 @@ protected void AssertCollectionEndsWith(IEnumerable(IEnumerable actualItems, - ICollection expected, Func equalityComparison, string because = "", - params object[] becauseArgs) + ICollection expected, Func equalityComparison, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(equalityComparison); @@ -3364,7 +3394,8 @@ protected void AssertCollectionStartsWith(IEnumerable(IEnumerable expectation, - Func equalityComparison, string because = "", params object[] becauseArgs) + Func equalityComparison, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(equalityComparison); @@ -3480,8 +3511,8 @@ private string[] CollectFailuresFromInspectors(IEnumerable> elementIns return collectionFailures; } - private bool IsValidProperty(Expression> propertyExpression, string because, - object[] becauseArgs) + private bool IsValidProperty(Expression> propertyExpression, + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(propertyExpression, nameof(propertyExpression), "Cannot assert collection ordering without specifying a property."); @@ -3499,7 +3530,7 @@ private AndConstraint NotBeOrderedBy( Expression> propertyExpression, IComparer comparer, SortOrder direction, - string because, + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { if (IsValidProperty(propertyExpression, because, becauseArgs)) @@ -3527,7 +3558,8 @@ private AndConstraint NotBeOrderedBy( /// Elements are compared using their implementation. /// private AndConstraint> BeInOrder( - IComparer comparer, SortOrder expectedOrder, string because = "", params object[] becauseArgs) + IComparer comparer, SortOrder expectedOrder, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { string sortOrder = expectedOrder == SortOrder.Ascending ? "ascending" : "descending"; @@ -3572,8 +3604,8 @@ private AndConstraint> BeInOrder( /// Asserts the current collection does not have all elements in ascending order. Elements are compared /// using their implementation. ///
- private AndConstraint NotBeInOrder(IComparer comparer, SortOrder order, string because = "", - params object[] becauseArgs) + private AndConstraint NotBeInOrder(IComparer comparer, SortOrder order, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { string sortOrder = order == SortOrder.Ascending ? "ascending" : "descending"; diff --git a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs index f0b65a1b93..765a90f2ad 100644 --- a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs @@ -54,7 +54,7 @@ public GenericDictionaryAssertions(TCollection keyValuePairs) /// /// is . public AndConstraint Equal(T expected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where T : IEnumerable> { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare dictionary with ."); @@ -117,7 +117,7 @@ public AndConstraint Equal(T expected, /// /// is . public AndConstraint NotEqual(T unexpected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where T : IEnumerable> { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare dictionary with ."); @@ -180,7 +180,7 @@ public AndConstraint NotEqual(T unexpected, /// Zero or more objects to format using the placeholders in . /// public AndConstraint BeEquivalentTo(TExpectation expectation, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeEquivalentTo(expectation, options => options, because, becauseArgs); } @@ -212,8 +212,8 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// /// is . public AndConstraint BeEquivalentTo(TExpectation expectation, - Func, EquivalencyOptions> config, string because = "", - params object[] becauseArgs) + Func, EquivalencyOptions> config, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -253,7 +253,7 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// Zero or more objects to format using the placeholders in . /// public WhoseValueConstraint ContainKey(TKey expected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { AndConstraint andConstraint = ContainKeys([expected], because, becauseArgs); @@ -287,7 +287,7 @@ public AndConstraint ContainKeys(params TKey[] expected) /// is . /// is empty. public AndConstraint ContainKeys(IEnumerable expected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot verify key containment against a collection of keys"); @@ -343,7 +343,7 @@ public AndConstraint ContainKeys(IEnumerable expected, /// Zero or more objects to format using the placeholders in . /// public AndConstraint NotContainKey(TKey unexpected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(Subject is not null) @@ -386,7 +386,7 @@ public AndConstraint NotContainKeys(params TKey[] unexpected) /// is . /// is empty. public AndConstraint NotContainKeys(IEnumerable unexpected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot verify key containment against a collection of keys"); @@ -444,7 +444,7 @@ public AndConstraint NotContainKeys(IEnumerable unexpected, /// Zero or more objects to format using the placeholders in . /// public AndWhichConstraint ContainValue(TValue expected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { AndWhichConstraint> innerConstraint = ContainValuesAndWhich([expected], because, becauseArgs); @@ -479,7 +479,7 @@ public AndConstraint ContainValues(params TValue[] expected) /// is . /// is empty. public AndConstraint ContainValues(IEnumerable expected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot verify value containment against a collection of values"); @@ -488,8 +488,7 @@ public AndConstraint ContainValues(IEnumerable expected, } private AndWhichConstraint> ContainValuesAndWhich(IEnumerable expected, - string because = "", - params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { ICollection expectedValues = expected.ConvertOrCastToCollection(); @@ -560,7 +559,7 @@ private static IEnumerable RepetitionPreservingIntersect( /// Zero or more objects to format using the placeholders in . /// public AndConstraint NotContainValue(TValue unexpected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(Subject is not null) @@ -603,7 +602,7 @@ public AndConstraint NotContainValues(params TValue[] unexpected) /// is . /// is empty. public AndConstraint NotContainValues(IEnumerable unexpected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot verify value containment against a collection of values"); @@ -676,7 +675,7 @@ public AndConstraint Contain(params KeyValuePair[] ex /// is empty. [SuppressMessage("Design", "MA0051:Method is too long", Justification = "Needs refactoring")] public new AndConstraint Contain(IEnumerable> expected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare dictionary with ."); @@ -760,7 +759,7 @@ public AndConstraint Contain(params KeyValuePair[] ex /// Zero or more objects to format using the placeholders in . /// public new AndConstraint Contain(KeyValuePair expected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return Contain(expected.Key, expected.Value, because, becauseArgs); } @@ -781,7 +780,7 @@ public AndConstraint Contain(params KeyValuePair[] ex /// Zero or more objects to format using the placeholders in . /// public AndConstraint Contain(TKey key, TValue value, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(Subject is not null) @@ -845,7 +844,7 @@ public AndConstraint NotContain(params KeyValuePair[] /// is . /// is empty. public new AndConstraint NotContain(IEnumerable> items, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(items, nameof(items), "Cannot compare dictionary with ."); @@ -913,7 +912,7 @@ public AndConstraint NotContain(params KeyValuePair[] /// Zero or more objects to format using the placeholders in . /// public new AndConstraint NotContain(KeyValuePair item, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotContain(item.Key, item.Value, because, becauseArgs); } @@ -934,7 +933,7 @@ public AndConstraint NotContain(params KeyValuePair[] /// Zero or more objects to format using the placeholders in . /// public AndConstraint NotContain(TKey key, TValue value, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(Subject is not null) diff --git a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs index 0dcd616cf5..82e4498f3c 100644 --- a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using FluentAssertions.Common; using FluentAssertions.Equivalency; @@ -92,8 +93,8 @@ public AndConstraint BeEquivalentTo(params string[] expectation) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeEquivalentTo(IEnumerable expectation, string because = "", - params object[] becauseArgs) + public AndConstraint BeEquivalentTo(IEnumerable expectation, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeEquivalentTo(expectation, config => config, because, becauseArgs); } @@ -121,8 +122,8 @@ public AndConstraint BeEquivalentTo(IEnumerable expectation /// /// is . public AndConstraint BeEquivalentTo(IEnumerable expectation, - Func, EquivalencyOptions> config, string because = "", - params object[] becauseArgs) + Func, EquivalencyOptions> config, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -160,7 +161,7 @@ public AndConstraint BeEquivalentTo(IEnumerable expectation /// Zero or more objects to format using the placeholders in . /// public AndConstraint AllBe(string expectation, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return AllBe(expectation, options => options, because, becauseArgs); } @@ -185,8 +186,7 @@ public AndConstraint AllBe(string expectation, /// is . public AndConstraint AllBe(string expectation, Func, EquivalencyOptions> config, - string because = "", - params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -239,8 +239,8 @@ public AndConstraint AllBe(string expectation, /// /// is . /// is empty. - public AndWhichConstraint ContainMatch(string wildcardPattern, string because = "", - params object[] becauseArgs) + public AndWhichConstraint ContainMatch(string wildcardPattern, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(wildcardPattern, nameof(wildcardPattern), "Cannot match strings in collection against . Provide a wildcard pattern or use the Contain method."); @@ -324,8 +324,8 @@ private IEnumerable AllThatMatch(string wildcardPattern) /// /// is . /// is empty. - public AndConstraint NotContainMatch(string wildcardPattern, string because = "", - params object[] becauseArgs) + public AndConstraint NotContainMatch(string wildcardPattern, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(wildcardPattern, nameof(wildcardPattern), "Cannot match strings in collection against . Provide a wildcard pattern or use the NotContain method."); diff --git a/Src/FluentAssertions/Collections/SubsequentOrderingGenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/SubsequentOrderingGenericCollectionAssertions.cs index 9d8291c53f..104dedac65 100644 --- a/Src/FluentAssertions/Collections/SubsequentOrderingGenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/SubsequentOrderingGenericCollectionAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Linq.Expressions; using FluentAssertions.Common; @@ -40,7 +41,8 @@ public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, IO /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// public AndConstraint> ThenBeInAscendingOrder( - Expression> propertyExpression, string because = "", params object[] becauseArgs) + Expression> propertyExpression, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return ThenBeInAscendingOrder(propertyExpression, GetComparer(), because, becauseArgs); } @@ -67,8 +69,8 @@ public AndConstraint> ThenBeInAscendingOrder /// is . public AndConstraint> ThenBeInAscendingOrder( - Expression> propertyExpression, IComparer comparer, string because = "", - params object[] becauseArgs) + Expression> propertyExpression, IComparer comparer, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer."); @@ -94,7 +96,8 @@ public AndConstraint> ThenBeInAscendingOrder public AndConstraint> ThenBeInDescendingOrder( - Expression> propertyExpression, string because = "", params object[] becauseArgs) + Expression> propertyExpression, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return ThenBeInDescendingOrder(propertyExpression, GetComparer(), because, becauseArgs); } @@ -121,8 +124,8 @@ public AndConstraint> ThenBeInDescendingOrder /// is . public AndConstraint> ThenBeInDescendingOrder( - Expression> propertyExpression, IComparer comparer, string because = "", - params object[] becauseArgs) + Expression> propertyExpression, IComparer comparer, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer."); @@ -134,7 +137,7 @@ private AndConstraint> ThenBeOrderedBy> propertyExpression, IComparer comparer, SortOrder direction, - string because, + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { subsequentOrdering = true; diff --git a/Src/FluentAssertions/Equivalency/Steps/AssertionContext.cs b/Src/FluentAssertions/Equivalency/Steps/AssertionContext.cs index 0e87fea241..f8a9c02f33 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AssertionContext.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AssertionContext.cs @@ -1,9 +1,11 @@ +using System.Diagnostics.CodeAnalysis; + namespace FluentAssertions.Equivalency.Steps; internal sealed class AssertionContext : IAssertionContext { - private AssertionContext(INode currentNode, TSubject subject, TSubject expectation, string because, - object[] becauseArgs) + private AssertionContext(INode currentNode, TSubject subject, TSubject expectation, + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { SelectedNode = currentNode; Subject = subject; diff --git a/Src/FluentAssertions/Events/EventAssertions.cs b/Src/FluentAssertions/Events/EventAssertions.cs index 97fadab856..a550fb28fc 100644 --- a/Src/FluentAssertions/Events/EventAssertions.cs +++ b/Src/FluentAssertions/Events/EventAssertions.cs @@ -1,5 +1,6 @@ using System; using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Linq.Expressions; using FluentAssertions.Common; @@ -40,7 +41,7 @@ protected internal EventAssertions(IMonitor monitor) /// /// Zero or more objects to format using the placeholders in . /// - public IEventRecording Raise(string eventName, string because = "", params object[] becauseArgs) + public IEventRecording Raise(string eventName, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { IEventRecording recording = Monitor.GetRecordingFor(eventName); @@ -67,7 +68,7 @@ public IEventRecording Raise(string eventName, string because = "", params objec /// /// Zero or more objects to format using the placeholders in . /// - public void NotRaise(string eventName, string because = "", params object[] becauseArgs) + public void NotRaise(string eventName, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { IEventRecording events = Monitor.GetRecordingFor(eventName); @@ -94,7 +95,7 @@ public void NotRaise(string eventName, string because = "", params object[] beca /// Zero or more objects to format using the placeholders in . /// public IEventRecording RaisePropertyChangeFor(Expression> propertyExpression, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { string propertyName = propertyExpression?.GetPropertyInfo().Name; @@ -139,7 +140,7 @@ public IEventRecording RaisePropertyChangeFor(Expression> proper /// Zero or more objects to format using the placeholders in . /// public void NotRaisePropertyChangeFor(Expression> propertyExpression, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { IEventRecording recording = Monitor.GetRecordingFor(PropertyChangedEventName); diff --git a/Src/FluentAssertions/ExceptionAssertionsExtensions.cs b/Src/FluentAssertions/ExceptionAssertionsExtensions.cs index 728bf7ca51..900d1c9b4e 100644 --- a/Src/FluentAssertions/ExceptionAssertionsExtensions.cs +++ b/Src/FluentAssertions/ExceptionAssertionsExtensions.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Threading.Tasks; using FluentAssertions.Execution; @@ -27,7 +28,7 @@ public static class ExceptionAssertionsExtensions public static async Task> WithMessage( this Task> task, string expectedWildcardPattern, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception { @@ -51,7 +52,7 @@ public static async Task> WithMessage> Where( this Task> task, Expression> exceptionExpression, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception { return (await task).Where(exceptionExpression, because, becauseArgs); @@ -72,7 +73,7 @@ public static async Task> Where( /// public static async Task> WithInnerException( this Task> task, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception where TInnerException : Exception @@ -95,7 +96,7 @@ public static async Task> WithInnerExceptio public static async Task> WithInnerException( this Task> task, Type innerException, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception { @@ -117,7 +118,7 @@ public static async Task> WithInnerException public static async Task> WithInnerExceptionExactly( this Task> task, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception where TInnerException : Exception @@ -140,7 +141,7 @@ public static async Task> WithInnerExceptio public static async Task> WithInnerExceptionExactly( this Task> task, Type innerException, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception { @@ -162,7 +163,7 @@ public static async Task> WithInnerExceptionExact public static ExceptionAssertions WithParameterName( this ExceptionAssertions parent, string paramName, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : ArgumentException { @@ -189,7 +190,7 @@ public static ExceptionAssertions WithParameterName( public static async Task> WithParameterName( this Task> task, string paramName, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : ArgumentException { diff --git a/Src/FluentAssertions/Execution/AssertionScope.cs b/Src/FluentAssertions/Execution/AssertionScope.cs index d45c6eacb5..e2283d0202 100644 --- a/Src/FluentAssertions/Execution/AssertionScope.cs +++ b/Src/FluentAssertions/Execution/AssertionScope.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Text; @@ -177,7 +178,7 @@ public AssertionScope BecauseOf(Reason reason) } /// - public AssertionScope BecauseOf(string because, params object[] becauseArgs) + public AssertionScope BecauseOf([StringSyntax("CompositeFormat")] string because, params object[] becauseArgs) { reason = () => { @@ -466,7 +467,7 @@ private static void SetCurrentAssertionScope(AssertionScope scope) IAssertionScope IAssertionScope.ForConstraint(OccurrenceConstraint constraint, int actualOccurrences) => ForConstraint(constraint, actualOccurrences); - IAssertionScope IAssertionScope.BecauseOf(string because, params object[] becauseArgs) => BecauseOf(because, becauseArgs); + IAssertionScope IAssertionScope.BecauseOf([StringSyntax("CompositeFormat")] string because, params object[] becauseArgs) => BecauseOf(because, becauseArgs); IAssertionScope IAssertionScope.WithExpectation(string message, params object[] args) => WithExpectation(message, args); diff --git a/Src/FluentAssertions/Execution/ContinuedAssertionScope.cs b/Src/FluentAssertions/Execution/ContinuedAssertionScope.cs index 1db8e75912..e85596ebdb 100644 --- a/Src/FluentAssertions/Execution/ContinuedAssertionScope.cs +++ b/Src/FluentAssertions/Execution/ContinuedAssertionScope.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; namespace FluentAssertions.Execution; @@ -87,7 +88,7 @@ public Continuation FailWith(Func failReasonFunc) } /// - public Continuation FailWith(string message, params object[] args) + public Continuation FailWith([StringSyntax("CompositeFormat")] string message, params object[] args) { if (continueAsserting) { @@ -98,7 +99,7 @@ public Continuation FailWith(string message, params object[] args) } /// - public IAssertionScope BecauseOf(string because, params object[] becauseArgs) + public IAssertionScope BecauseOf([StringSyntax("CompositeFormat")] string because, params object[] becauseArgs) { if (continueAsserting) { @@ -117,7 +118,7 @@ public Continuation ClearExpectation() } /// - public IAssertionScope WithExpectation(string message, params object[] args) + public IAssertionScope WithExpectation([StringSyntax("CompositeFormat")] string message, params object[] args) { if (continueAsserting) { diff --git a/Src/FluentAssertions/Execution/FailReason.cs b/Src/FluentAssertions/Execution/FailReason.cs index a315164977..bfc650fd8d 100644 --- a/Src/FluentAssertions/Execution/FailReason.cs +++ b/Src/FluentAssertions/Execution/FailReason.cs @@ -1,4 +1,6 @@ -namespace FluentAssertions.Execution; +using System.Diagnostics.CodeAnalysis; + +namespace FluentAssertions.Execution; /// /// Represents assertion fail reason. Contains the message and arguments for message's numbered placeholders. @@ -27,7 +29,7 @@ public class FailReason /// /// /// - public FailReason(string message, params object[] args) + public FailReason([StringSyntax("CompositeFormat")] string message, params object[] args) { Message = message; Args = args; diff --git a/Src/FluentAssertions/Execution/IAssertionScope.cs b/Src/FluentAssertions/Execution/IAssertionScope.cs index 1324bed4b7..d114564ac5 100644 --- a/Src/FluentAssertions/Execution/IAssertionScope.cs +++ b/Src/FluentAssertions/Execution/IAssertionScope.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; namespace FluentAssertions.Execution; @@ -134,7 +135,7 @@ public interface IAssertionScope : IDisposable /// /// Zero or more values to use for filling in any compatible placeholders. /// - IAssertionScope BecauseOf(string because, params object[] becauseArgs); + IAssertionScope BecauseOf([StringSyntax("CompositeFormat")] string because, params object[] becauseArgs); /// /// Clears the expectation set by . diff --git a/Src/FluentAssertions/Execution/MessageBuilder.cs b/Src/FluentAssertions/Execution/MessageBuilder.cs index faecdcb59b..02f07c9e1d 100644 --- a/Src/FluentAssertions/Execution/MessageBuilder.cs +++ b/Src/FluentAssertions/Execution/MessageBuilder.cs @@ -1,6 +1,7 @@ #region using System; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Text.RegularExpressions; @@ -30,7 +31,7 @@ public MessageBuilder(FormattingOptions formattingOptions) } // SMELL: Too many parameters. - public string Build(string message, object[] messageArgs, string reason, ContextDataItems contextData, string identifier, + public string Build([StringSyntax("CompositeFormat")] string message, object[] messageArgs, string reason, ContextDataItems contextData, string identifier, string fallbackIdentifier) { message = message.Replace("{reason}", SanitizeReason(reason), StringComparison.Ordinal); @@ -89,7 +90,7 @@ private static string SubstituteContextualTags(string message, ContextDataItems }); } - private string FormatArgumentPlaceholders(string failureMessage, object[] failureArgs) + private string FormatArgumentPlaceholders([StringSyntax("CompositeFormat")] string failureMessage, object[] failureArgs) { string[] values = failureArgs.Select(a => Formatter.ToString(a, formattingOptions)).ToArray(); diff --git a/Src/FluentAssertions/Execution/Reason.cs b/Src/FluentAssertions/Execution/Reason.cs index 79585d1be4..ca6996b66f 100644 --- a/Src/FluentAssertions/Execution/Reason.cs +++ b/Src/FluentAssertions/Execution/Reason.cs @@ -1,3 +1,5 @@ +using System.Diagnostics.CodeAnalysis; + namespace FluentAssertions.Execution; /// @@ -5,7 +7,7 @@ namespace FluentAssertions.Execution; /// public class Reason { - public Reason(string formattedMessage, object[] arguments) + public Reason([StringSyntax("CompositeFormat")] string formattedMessage, object[] arguments) { FormattedMessage = formattedMessage; Arguments = arguments; diff --git a/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs b/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs index da9d3a37a0..805812df65 100644 --- a/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs +++ b/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using FluentAssertions.Common; using FluentAssertions.Equivalency; @@ -48,7 +49,7 @@ public ComparableTypeAssertions(IComparable value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(T expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Equals(Subject, expected)) @@ -74,8 +75,8 @@ public AndConstraint Be(T expected, string because = "", params obj /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeEquivalentTo(TExpectation expectation, string because = "", - params object[] becauseArgs) + public AndConstraint BeEquivalentTo(TExpectation expectation, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeEquivalentTo(expectation, config => config, because, becauseArgs); } @@ -103,8 +104,8 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// /// is . public AndConstraint BeEquivalentTo(TExpectation expectation, - Func, EquivalencyOptions> config, string because = "", - params object[] becauseArgs) + Func, EquivalencyOptions> config, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -142,7 +143,7 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(T unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBe(T unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!Equals(Subject, unexpected)) @@ -166,7 +167,7 @@ public AndConstraint NotBe(T unexpected, string because = "", param /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeRankedEquallyTo(T expected, string because = "", params object[] becauseArgs) + public AndConstraint BeRankedEquallyTo(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.CompareTo(expected) == Equal) @@ -190,7 +191,7 @@ public AndConstraint BeRankedEquallyTo(T expected, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeRankedEquallyTo(T unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBeRankedEquallyTo(T unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.CompareTo(unexpected) != Equal) @@ -213,7 +214,7 @@ public AndConstraint NotBeRankedEquallyTo(T unexpected, string beca /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeLessThan(T expected, string because = "", params object[] becauseArgs) + public AndConstraint BeLessThan(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.CompareTo(expected) < Equal) @@ -236,7 +237,7 @@ public AndConstraint BeLessThan(T expected, string because = "", pa /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeLessThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) + public AndConstraint BeLessThanOrEqualTo(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.CompareTo(expected) <= Equal) @@ -259,7 +260,7 @@ public AndConstraint BeLessThanOrEqualTo(T expected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) + public AndConstraint BeGreaterThan(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.CompareTo(expected) > Equal) @@ -282,7 +283,7 @@ public AndConstraint BeGreaterThan(T expected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", params object[] becauseArgs) + public AndConstraint BeGreaterThanOrEqualTo(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.CompareTo(expected) >= Equal) @@ -311,8 +312,8 @@ public AndConstraint BeGreaterThanOrEqualTo(T expected, string beca /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", - params object[] becauseArgs) + public AndConstraint BeInRange(T minimumValue, T maximumValue, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.CompareTo(minimumValue) >= Equal && Subject.CompareTo(maximumValue) <= Equal) @@ -342,8 +343,8 @@ public AndConstraint BeInRange(T minimumValue, T maximumValue, stri /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeInRange(T minimumValue, T maximumValue, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeInRange(T minimumValue, T maximumValue, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!(Subject.CompareTo(minimumValue) >= Equal && Subject.CompareTo(maximumValue) <= Equal)) @@ -378,8 +379,8 @@ public AndConstraint BeOneOf(params T[] validValues) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOneOf(IEnumerable validValues, string because = "", - params object[] becauseArgs) + public AndConstraint BeOneOf(IEnumerable validValues, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(validValues.Any(val => Equals(Subject, val))) diff --git a/Src/FluentAssertions/Numeric/NullableNumericAssertions.cs b/Src/FluentAssertions/Numeric/NullableNumericAssertions.cs index c39c703496..5443d7f0a3 100644 --- a/Src/FluentAssertions/Numeric/NullableNumericAssertions.cs +++ b/Src/FluentAssertions/Numeric/NullableNumericAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -36,7 +37,7 @@ public NullableNumericAssertions(T? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveValue(string because = "", params object[] becauseArgs) + public AndConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.HasValue) @@ -56,7 +57,7 @@ public AndConstraint HaveValue(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeNull(string because = "", params object[] becauseArgs) + public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return HaveValue(because, becauseArgs); } @@ -71,7 +72,7 @@ public AndConstraint NotBeNull(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) + public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!Subject.HasValue) @@ -91,7 +92,7 @@ public AndConstraint NotHaveValue(string because = "", params objec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeNull(string because = "", params object[] becauseArgs) + public AndConstraint BeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotHaveValue(because, becauseArgs); } @@ -111,8 +112,7 @@ public AndConstraint BeNull(string because = "", params object[] be /// /// is . public AndConstraint Match(Expression> predicate, - string because = "", - params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(predicate); diff --git a/Src/FluentAssertions/Numeric/NumericAssertions.cs b/Src/FluentAssertions/Numeric/NumericAssertions.cs index 6896f2760f..81cf130b6f 100644 --- a/Src/FluentAssertions/Numeric/NumericAssertions.cs +++ b/Src/FluentAssertions/Numeric/NumericAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Linq.Expressions; using FluentAssertions.Common; @@ -54,7 +55,7 @@ private protected NumericAssertions(T? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(T expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject?.CompareTo(expected) == 0) @@ -76,7 +77,7 @@ public AndConstraint Be(T expected, string because = "", params obj /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(T? expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(expected is { } value ? Subject?.CompareTo(value) == 0 : !Subject.HasValue) @@ -98,7 +99,7 @@ public AndConstraint Be(T? expected, string because = "", params ob /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(T unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBe(T unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject?.CompareTo(unexpected) != 0) @@ -119,7 +120,7 @@ public AndConstraint NotBe(T unexpected, string because = "", param /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(T? unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBe(T? unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(unexpected is { } value ? Subject?.CompareTo(value) != 0 : Subject.HasValue) @@ -139,7 +140,7 @@ public AndConstraint NotBe(T? unexpected, string because = "", para /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BePositive(string because = "", params object[] becauseArgs) + public AndConstraint BePositive([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject?.CompareTo(default) > 0) @@ -159,7 +160,7 @@ public AndConstraint BePositive(string because = "", params object[ /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeNegative(string because = "", params object[] becauseArgs) + public AndConstraint BeNegative([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject is { } value && !IsNaN(value) && value.CompareTo(default) < 0) @@ -180,7 +181,7 @@ public AndConstraint BeNegative(string because = "", params object[ /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeLessThan(T expected, string because = "", params object[] becauseArgs) + public AndConstraint BeLessThan(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { if (IsNaN(expected)) { @@ -207,8 +208,8 @@ public AndConstraint BeLessThan(T expected, string because = "", pa /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeLessThanOrEqualTo(T expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeLessThanOrEqualTo(T expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { if (IsNaN(expected)) { @@ -236,8 +237,8 @@ public AndConstraint BeLessThanOrEqualTo(T expected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeGreaterThan(T expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeGreaterThan(T expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { if (IsNaN(expected)) { @@ -265,8 +266,8 @@ public AndConstraint BeGreaterThan(T expected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeGreaterThanOrEqualTo(T expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeGreaterThanOrEqualTo(T expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { if (IsNaN(expected)) { @@ -302,8 +303,8 @@ public AndConstraint BeGreaterThanOrEqualTo(T expected, string beca /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeInRange(T minimumValue, T maximumValue, string because = "", - params object[] becauseArgs) + public AndConstraint BeInRange(T minimumValue, T maximumValue, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { if (IsNaN(minimumValue) || IsNaN(maximumValue)) { @@ -338,8 +339,8 @@ public AndConstraint BeInRange(T minimumValue, T maximumValue, stri /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeInRange(T minimumValue, T maximumValue, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeInRange(T minimumValue, T maximumValue, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { if (IsNaN(minimumValue) || IsNaN(maximumValue)) { @@ -379,8 +380,8 @@ public AndConstraint BeOneOf(params T[] validValues) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOneOf(IEnumerable validValues, string because = "", - params object[] becauseArgs) + public AndConstraint BeOneOf(IEnumerable validValues, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject is { } value && validValues.Contains(value)) @@ -404,7 +405,7 @@ public AndConstraint BeOneOf(IEnumerable validValues, string bec /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint BeOfType(Type expectedType, string because = "", params object[] becauseArgs) + public AndConstraint BeOfType(Type expectedType, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expectedType); @@ -436,7 +437,7 @@ public AndConstraint BeOfType(Type expectedType, string because = " /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotBeOfType(Type unexpectedType, string because = "", params object[] becauseArgs) + public AndConstraint NotBeOfType(Type unexpectedType, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpectedType); @@ -468,8 +469,7 @@ public AndConstraint NotBeOfType(Type unexpectedType, string becaus /// /// is . public AndConstraint Match(Expression> predicate, - string because = "", - params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(predicate); diff --git a/Src/FluentAssertions/NumericAssertionsExtensions.cs b/Src/FluentAssertions/NumericAssertionsExtensions.cs index 1a4e1cd63b..a2ab750506 100644 --- a/Src/FluentAssertions/NumericAssertionsExtensions.cs +++ b/Src/FluentAssertions/NumericAssertionsExtensions.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Common; using FluentAssertions.Execution; using FluentAssertions.Numeric; @@ -30,8 +31,8 @@ public static class NumericAssertionsExtensions /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> BeCloseTo(this NumericAssertions parent, - sbyte nearbyValue, byte delta, string because = "", - params object[] becauseArgs) + sbyte nearbyValue, byte delta, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { sbyte actualValue = parent.Subject.Value; sbyte minValue = (sbyte)(nearbyValue - delta); @@ -72,8 +73,8 @@ public static AndConstraint> BeCloseTo(this NumericAsse /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> BeCloseTo(this NumericAssertions parent, - byte nearbyValue, byte delta, string because = "", - params object[] becauseArgs) + byte nearbyValue, byte delta, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { byte actualValue = parent.Subject.Value; byte minValue = (byte)(nearbyValue - delta); @@ -114,8 +115,8 @@ public static AndConstraint> BeCloseTo(this NumericAsser /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> BeCloseTo(this NumericAssertions parent, - short nearbyValue, ushort delta, string because = "", - params object[] becauseArgs) + short nearbyValue, ushort delta, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { short actualValue = parent.Subject.Value; short minValue = (short)(nearbyValue - delta); @@ -156,8 +157,8 @@ public static AndConstraint> BeCloseTo(this NumericAsse /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> BeCloseTo(this NumericAssertions parent, - ushort nearbyValue, ushort delta, string because = "", - params object[] becauseArgs) + ushort nearbyValue, ushort delta, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { ushort actualValue = parent.Subject.Value; ushort minValue = (ushort)(nearbyValue - delta); @@ -198,8 +199,8 @@ public static AndConstraint> BeCloseTo(this NumericAss /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> BeCloseTo(this NumericAssertions parent, - int nearbyValue, uint delta, string because = "", - params object[] becauseArgs) + int nearbyValue, uint delta, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { int actualValue = parent.Subject.Value; int minValue = (int)(nearbyValue - delta); @@ -240,8 +241,8 @@ public static AndConstraint> BeCloseTo(this NumericAssert /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> BeCloseTo(this NumericAssertions parent, - uint nearbyValue, uint delta, string because = "", - params object[] becauseArgs) + uint nearbyValue, uint delta, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { uint actualValue = parent.Subject.Value; uint minValue = nearbyValue - delta; @@ -282,8 +283,8 @@ public static AndConstraint> BeCloseTo(this NumericAsser /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> BeCloseTo(this NumericAssertions parent, - long nearbyValue, ulong delta, string because = "", - params object[] becauseArgs) + long nearbyValue, ulong delta, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { long actualValue = parent.Subject.Value; long minValue = GetMinValue(nearbyValue, delta); @@ -313,8 +314,8 @@ public static AndConstraint> BeCloseTo(this NumericAsser /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> BeCloseTo(this NumericAssertions parent, - ulong nearbyValue, ulong delta, string because = "", - params object[] becauseArgs) + ulong nearbyValue, ulong delta, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { ulong actualValue = parent.Subject.Value; ulong minValue = nearbyValue - delta; @@ -339,7 +340,7 @@ public static AndConstraint> BeCloseTo(this NumericAsse private static void FailIfValueOutsideBounds(bool valueWithinBounds, TValue nearbyValue, TDelta delta, TValue actualValue, - string because, object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { Execute.Assertion .ForCondition(valueWithinBounds) @@ -370,8 +371,8 @@ private static void FailIfValueOutsideBounds(bool valueWithinBou /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> NotBeCloseTo(this NumericAssertions parent, - sbyte distantValue, byte delta, string because = "", - params object[] becauseArgs) + sbyte distantValue, byte delta, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { sbyte actualValue = parent.Subject.Value; sbyte minValue = (sbyte)(distantValue - delta); @@ -412,8 +413,8 @@ public static AndConstraint> NotBeCloseTo(this NumericA /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> NotBeCloseTo(this NumericAssertions parent, - byte distantValue, byte delta, string because = "", - params object[] becauseArgs) + byte distantValue, byte delta, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { byte actualValue = parent.Subject.Value; byte minValue = (byte)(distantValue - delta); @@ -454,8 +455,8 @@ public static AndConstraint> NotBeCloseTo(this NumericAs /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> NotBeCloseTo(this NumericAssertions parent, - short distantValue, ushort delta, string because = "", - params object[] becauseArgs) + short distantValue, ushort delta, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { short actualValue = parent.Subject.Value; short minValue = (short)(distantValue - delta); @@ -496,8 +497,8 @@ public static AndConstraint> NotBeCloseTo(this NumericA /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> NotBeCloseTo(this NumericAssertions parent, - ushort distantValue, ushort delta, string because = "", - params object[] becauseArgs) + ushort distantValue, ushort delta, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { ushort actualValue = parent.Subject.Value; ushort minValue = (ushort)(distantValue - delta); @@ -538,8 +539,8 @@ public static AndConstraint> NotBeCloseTo(this Numeric /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> NotBeCloseTo(this NumericAssertions parent, - int distantValue, uint delta, string because = "", - params object[] becauseArgs) + int distantValue, uint delta, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { int actualValue = parent.Subject.Value; int minValue = (int)(distantValue - delta); @@ -580,8 +581,8 @@ public static AndConstraint> NotBeCloseTo(this NumericAss /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> NotBeCloseTo(this NumericAssertions parent, - uint distantValue, uint delta, string because = "", - params object[] becauseArgs) + uint distantValue, uint delta, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { uint actualValue = parent.Subject.Value; uint minValue = distantValue - delta; @@ -622,8 +623,8 @@ public static AndConstraint> NotBeCloseTo(this NumericAs /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> NotBeCloseTo(this NumericAssertions parent, - long distantValue, ulong delta, string because = "", - params object[] becauseArgs) + long distantValue, ulong delta, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { long actualValue = parent.Subject.Value; long minValue = GetMinValue(distantValue, delta); @@ -653,8 +654,8 @@ public static AndConstraint> NotBeCloseTo(this NumericAs /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> NotBeCloseTo(this NumericAssertions parent, - ulong distantValue, ulong delta, string because = "", - params object[] becauseArgs) + ulong distantValue, ulong delta, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { ulong actualValue = parent.Subject.Value; ulong minValue = distantValue - delta; @@ -680,7 +681,7 @@ public static AndConstraint> NotBeCloseTo(this NumericA private static void FailIfValueInsideBounds( bool valueOutsideBounds, TValue distantValue, TDelta delta, TValue actualValue, - string because, object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { Execute.Assertion .ForCondition(valueOutsideBounds) @@ -712,8 +713,8 @@ private static void FailIfValueInsideBounds( /// /// is negative. public static AndConstraint> BeApproximately(this NullableNumericAssertions parent, - float expectedValue, float precision, string because = "", - params object[] becauseArgs) + float expectedValue, float precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -752,8 +753,8 @@ public static AndConstraint> BeApproximately(th /// /// is negative. public static AndConstraint> BeApproximately(this NullableNumericAssertions parent, - float? expectedValue, float precision, string because = "", - params object[] becauseArgs) + float? expectedValue, float precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -796,8 +797,8 @@ public static AndConstraint> BeApproximately(th /// /// is negative. public static AndConstraint> BeApproximately(this NumericAssertions parent, - float expectedValue, float precision, string because = "", - params object[] becauseArgs) + float expectedValue, float precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { if (float.IsNaN(expectedValue)) { @@ -846,8 +847,8 @@ public static AndConstraint> BeApproximately(this Numer /// /// is negative. public static AndConstraint> BeApproximately(this NullableNumericAssertions parent, - double expectedValue, double precision, string because = "", - params object[] becauseArgs) + double expectedValue, double precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -886,8 +887,8 @@ public static AndConstraint> BeApproximately(t /// /// is negative. public static AndConstraint> BeApproximately(this NullableNumericAssertions parent, - double? expectedValue, double precision, string because = "", - params object[] becauseArgs) + double? expectedValue, double precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -930,8 +931,8 @@ public static AndConstraint> BeApproximately(t /// /// is negative. public static AndConstraint> BeApproximately(this NumericAssertions parent, - double expectedValue, double precision, string because = "", - params object[] becauseArgs) + double expectedValue, double precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { if (double.IsNaN(expectedValue)) { @@ -981,8 +982,8 @@ public static AndConstraint> BeApproximately(this Nume /// is negative. public static AndConstraint> BeApproximately( this NullableNumericAssertions parent, - decimal expectedValue, decimal precision, string because = "", - params object[] becauseArgs) + decimal expectedValue, decimal precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -1022,8 +1023,8 @@ public static AndConstraint> BeApproximately( /// is negative. public static AndConstraint> BeApproximately( this NullableNumericAssertions parent, - decimal? expectedValue, decimal precision, string because = "", - params object[] becauseArgs) + decimal? expectedValue, decimal precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -1066,8 +1067,8 @@ public static AndConstraint> BeApproximately( /// /// is negative. public static AndConstraint> BeApproximately(this NumericAssertions parent, - decimal expectedValue, decimal precision, string because = "", - params object[] becauseArgs) + decimal expectedValue, decimal precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -1082,7 +1083,7 @@ public static AndConstraint> BeApproximately(this Num private static void FailIfDifferenceOutsidePrecision( bool differenceWithinPrecision, NumericAssertions parent, T expectedValue, T precision, T actualDifference, - string because, object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) where T : struct, IComparable { Execute.Assertion @@ -1115,8 +1116,8 @@ private static void FailIfDifferenceOutsidePrecision( /// /// is negative. public static AndConstraint> NotBeApproximately(this NullableNumericAssertions parent, - float unexpectedValue, float precision, string because = "", - params object[] becauseArgs) + float unexpectedValue, float precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -1149,8 +1150,8 @@ public static AndConstraint> NotBeApproximately /// /// is negative. public static AndConstraint> NotBeApproximately(this NullableNumericAssertions parent, - float? unexpectedValue, float precision, string because = "", - params object[] becauseArgs) + float? unexpectedValue, float precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -1193,8 +1194,8 @@ public static AndConstraint> NotBeApproximately /// /// is negative. public static AndConstraint> NotBeApproximately(this NumericAssertions parent, - float unexpectedValue, float precision, string because = "", - params object[] becauseArgs) + float unexpectedValue, float precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { if (float.IsNaN(unexpectedValue)) { @@ -1244,8 +1245,8 @@ public static AndConstraint> NotBeApproximately(this Nu /// is negative. public static AndConstraint> NotBeApproximately( this NullableNumericAssertions parent, - double unexpectedValue, double precision, string because = "", - params object[] becauseArgs) + double unexpectedValue, double precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -1279,8 +1280,8 @@ public static AndConstraint> NotBeApproximatel /// is negative. public static AndConstraint> NotBeApproximately( this NullableNumericAssertions parent, - double? unexpectedValue, double precision, string because = "", - params object[] becauseArgs) + double? unexpectedValue, double precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -1323,8 +1324,8 @@ public static AndConstraint> NotBeApproximatel /// /// is negative. public static AndConstraint> NotBeApproximately(this NumericAssertions parent, - double unexpectedValue, double precision, string because = "", - params object[] becauseArgs) + double unexpectedValue, double precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { if (double.IsNaN(unexpectedValue)) { @@ -1374,8 +1375,8 @@ public static AndConstraint> NotBeApproximately(this N /// is negative. public static AndConstraint> NotBeApproximately( this NullableNumericAssertions parent, - decimal unexpectedValue, decimal precision, string because = "", - params object[] becauseArgs) + decimal unexpectedValue, decimal precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -1409,8 +1410,8 @@ public static AndConstraint> NotBeApproximate /// is negative. public static AndConstraint> NotBeApproximately( this NullableNumericAssertions parent, - decimal? unexpectedValue, decimal precision, string because = "", - params object[] becauseArgs) + decimal? unexpectedValue, decimal precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -1453,8 +1454,8 @@ public static AndConstraint> NotBeApproximate /// /// is negative. public static AndConstraint> NotBeApproximately(this NumericAssertions parent, - decimal unexpectedValue, decimal precision, string because = "", - params object[] becauseArgs) + decimal unexpectedValue, decimal precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -1469,7 +1470,7 @@ public static AndConstraint> NotBeApproximately(this private static void FailIfDifferenceWithinPrecision( NumericAssertions parent, bool differenceOutsidePrecision, T unexpectedValue, T precision, T actualDifference, - string because, object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) where T : struct, IComparable { Execute.Assertion @@ -1494,7 +1495,7 @@ private static void FailIfDifferenceWithinPrecision( /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> BeNaN(this NumericAssertions parent, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { float actualValue = parent.Subject.Value; @@ -1518,7 +1519,7 @@ public static AndConstraint> BeNaN(this NumericAssertio /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> BeNaN(this NumericAssertions parent, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { double actualValue = parent.Subject.Value; @@ -1542,7 +1543,7 @@ public static AndConstraint> BeNaN(this NumericAsserti /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> BeNaN(this NullableNumericAssertions parent, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { float? actualValue = parent.Subject; @@ -1566,7 +1567,7 @@ public static AndConstraint> BeNaN(this Nullabl /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> BeNaN(this NullableNumericAssertions parent, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { double? actualValue = parent.Subject; @@ -1594,7 +1595,7 @@ public static AndConstraint> BeNaN(this Nullab /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> NotBeNaN(this NumericAssertions parent, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { float actualValue = parent.Subject.Value; @@ -1618,7 +1619,7 @@ public static AndConstraint> NotBeNaN(this NumericAsser /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> NotBeNaN(this NumericAssertions parent, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { double actualValue = parent.Subject.Value; @@ -1642,7 +1643,7 @@ public static AndConstraint> NotBeNaN(this NumericAsse /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> NotBeNaN(this NullableNumericAssertions parent, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { float? actualValue = parent.Subject; @@ -1667,7 +1668,7 @@ public static AndConstraint> NotBeNaN(this Null /// Zero or more objects to format using the placeholders in . /// public static AndConstraint> NotBeNaN(this NullableNumericAssertions parent, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { double? actualValue = parent.Subject; diff --git a/Src/FluentAssertions/ObjectAssertionsExtensions.cs b/Src/FluentAssertions/ObjectAssertionsExtensions.cs index a2c4e2bdd3..7819357665 100644 --- a/Src/FluentAssertions/ObjectAssertionsExtensions.cs +++ b/Src/FluentAssertions/ObjectAssertionsExtensions.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Runtime.Serialization; using System.Xml.Serialization; @@ -24,7 +25,7 @@ public static class ObjectAssertionsExtensions /// Zero or more objects to format using the placeholders in . /// public static AndConstraint BeDataContractSerializable(this ObjectAssertions assertions, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeDataContractSerializable(assertions, options => options, because, becauseArgs); } @@ -49,8 +50,8 @@ public static AndConstraint BeDataContractSerializable(this Ob /// /// is . public static AndConstraint BeDataContractSerializable(this ObjectAssertions assertions, - Func, EquivalencyOptions> options, string because = "", - params object[] becauseArgs) + Func, EquivalencyOptions> options, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(options); @@ -97,8 +98,8 @@ private static object CreateCloneUsingDataContractSerializer(object subject) /// /// Zero or more objects to format using the placeholders in . /// - public static AndConstraint BeXmlSerializable(this ObjectAssertions assertions, string because = "", - params object[] becauseArgs) + public static AndConstraint BeXmlSerializable(this ObjectAssertions assertions, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { try { diff --git a/Src/FluentAssertions/Primitives/BooleanAssertions.cs b/Src/FluentAssertions/Primitives/BooleanAssertions.cs index c44bc7f2ff..1adcba679f 100644 --- a/Src/FluentAssertions/Primitives/BooleanAssertions.cs +++ b/Src/FluentAssertions/Primitives/BooleanAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; namespace FluentAssertions.Primitives; @@ -46,7 +47,7 @@ public BooleanAssertions(bool? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeFalse(string because = "", params object[] becauseArgs) + public AndConstraint BeFalse([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject == false) @@ -66,7 +67,7 @@ public AndConstraint BeFalse(string because = "", params object[] b /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeTrue(string because = "", params object[] becauseArgs) + public AndConstraint BeTrue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject == true) @@ -87,7 +88,7 @@ public AndConstraint BeTrue(string because = "", params object[] be /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(bool expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(bool expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject == expected) @@ -108,7 +109,7 @@ public AndConstraint Be(bool expected, string because = "", params /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(bool unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBe(bool unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject != unexpected) @@ -130,7 +131,7 @@ public AndConstraint NotBe(bool unexpected, string because = "", pa /// Zero or more objects to format using the placeholders in . /// public AndConstraint Imply(bool consequent, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool? antecedent = Subject; diff --git a/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs b/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs index 749bdcdf17..5adc26841c 100644 --- a/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using FluentAssertions.Execution; @@ -50,7 +51,7 @@ public DateOnlyAssertions(DateOnly? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(DateOnly expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(DateOnly expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject == expected) @@ -72,7 +73,7 @@ public AndConstraint Be(DateOnly expected, string because = "", par /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(DateOnly? expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(DateOnly? expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject == expected) @@ -94,7 +95,7 @@ public AndConstraint Be(DateOnly? expected, string because = "", pa /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(DateOnly unexpected, string because = "", + public AndConstraint NotBe(DateOnly unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion @@ -116,8 +117,8 @@ public AndConstraint NotBe(DateOnly unexpected, string because = "" /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(DateOnly? unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBe(DateOnly? unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject != unexpected) @@ -138,8 +139,8 @@ public AndConstraint NotBe(DateOnly? unexpected, string because = " /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeBefore(DateOnly expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeBefore(DateOnly expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject < expected) @@ -161,8 +162,8 @@ public AndConstraint BeBefore(DateOnly expected, string because = " /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeBefore(DateOnly unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeBefore(DateOnly unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeOnOrAfter(unexpected, because, becauseArgs); } @@ -178,8 +179,8 @@ public AndConstraint NotBeBefore(DateOnly unexpected, string becaus /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOnOrBefore(DateOnly expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeOnOrBefore(DateOnly expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject <= expected) @@ -201,8 +202,8 @@ public AndConstraint BeOnOrBefore(DateOnly expected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeOnOrBefore(DateOnly unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeOnOrBefore(DateOnly unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeAfter(unexpected, because, becauseArgs); } @@ -218,8 +219,8 @@ public AndConstraint NotBeOnOrBefore(DateOnly unexpected, string be /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeAfter(DateOnly expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeAfter(DateOnly expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject > expected) @@ -241,8 +242,8 @@ public AndConstraint BeAfter(DateOnly expected, string because = "" /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeAfter(DateOnly unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeAfter(DateOnly unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeOnOrBefore(unexpected, because, becauseArgs); } @@ -258,8 +259,8 @@ public AndConstraint NotBeAfter(DateOnly unexpected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOnOrAfter(DateOnly expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeOnOrAfter(DateOnly expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject >= expected) @@ -281,8 +282,8 @@ public AndConstraint BeOnOrAfter(DateOnly expected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeOnOrAfter(DateOnly unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeOnOrAfter(DateOnly unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeBefore(unexpected, because, becauseArgs); } @@ -298,7 +299,7 @@ public AndConstraint NotBeOnOrAfter(DateOnly unexpected, string bec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveYear(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveYear(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -325,7 +326,7 @@ public AndConstraint HaveYear(int expected, string because = "", pa /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveYear(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveYear(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -351,7 +352,7 @@ public AndConstraint NotHaveYear(int unexpected, string because = " /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveMonth(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveMonth(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -378,7 +379,7 @@ public AndConstraint HaveMonth(int expected, string because = "", p /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveMonth(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveMonth(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -405,7 +406,7 @@ public AndConstraint NotHaveMonth(int unexpected, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveDay(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -432,7 +433,7 @@ public AndConstraint HaveDay(int expected, string because = "", par /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveDay(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveDay(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -483,7 +484,7 @@ public AndConstraint BeOneOf(params DateOnly[] validValues) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOneOf(IEnumerable validValues, string because = "", params object[] becauseArgs) + public AndConstraint BeOneOf(IEnumerable validValues, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeOneOf(validValues.Cast(), because, becauseArgs); } @@ -501,8 +502,8 @@ public AndConstraint BeOneOf(IEnumerable validValues, str /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOneOf(IEnumerable validValues, string because = "", - params object[] becauseArgs) + public AndConstraint BeOneOf(IEnumerable validValues, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(validValues.Contains(Subject)) diff --git a/Src/FluentAssertions/Primitives/DateTimeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeAssertions.cs index a70965cad0..63effadf47 100644 --- a/Src/FluentAssertions/Primitives/DateTimeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -57,7 +58,7 @@ public DateTimeAssertions(DateTime? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(DateTime expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(DateTime expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject == expected) @@ -79,7 +80,7 @@ public AndConstraint Be(DateTime expected, string because = "", par /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(DateTime? expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(DateTime? expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject == expected) @@ -101,8 +102,8 @@ public AndConstraint Be(DateTime? expected, string because = "", pa /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(DateTime unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBe(DateTime unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject != unexpected) @@ -123,8 +124,8 @@ public AndConstraint NotBe(DateTime unexpected, string because = "" /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(DateTime? unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBe(DateTime? unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject != unexpected) @@ -156,8 +157,8 @@ public AndConstraint NotBe(DateTime? unexpected, string because = " /// Zero or more objects to format using the placeholders in . /// /// is negative. - public AndConstraint BeCloseTo(DateTime nearbyTime, TimeSpan precision, string because = "", - params object[] becauseArgs) + public AndConstraint BeCloseTo(DateTime nearbyTime, TimeSpan precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -205,8 +206,8 @@ public AndConstraint BeCloseTo(DateTime nearbyTime, TimeSpan precis /// Zero or more objects to format using the placeholders in . /// /// is negative. - public AndConstraint NotBeCloseTo(DateTime distantTime, TimeSpan precision, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeCloseTo(DateTime distantTime, TimeSpan precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -238,8 +239,8 @@ public AndConstraint NotBeCloseTo(DateTime distantTime, TimeSpan pr /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeBefore(DateTime expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeBefore(DateTime expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject < expected) @@ -261,8 +262,8 @@ public AndConstraint BeBefore(DateTime expected, string because = " /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeBefore(DateTime unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeBefore(DateTime unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeOnOrAfter(unexpected, because, becauseArgs); } @@ -278,8 +279,8 @@ public AndConstraint NotBeBefore(DateTime unexpected, string becaus /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOnOrBefore(DateTime expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeOnOrBefore(DateTime expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject <= expected) @@ -301,8 +302,8 @@ public AndConstraint BeOnOrBefore(DateTime expected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeOnOrBefore(DateTime unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeOnOrBefore(DateTime unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeAfter(unexpected, because, becauseArgs); } @@ -318,8 +319,8 @@ public AndConstraint NotBeOnOrBefore(DateTime unexpected, string be /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeAfter(DateTime expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeAfter(DateTime expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject > expected) @@ -341,8 +342,8 @@ public AndConstraint BeAfter(DateTime expected, string because = "" /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeAfter(DateTime unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeAfter(DateTime unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeOnOrBefore(unexpected, because, becauseArgs); } @@ -358,8 +359,8 @@ public AndConstraint NotBeAfter(DateTime unexpected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOnOrAfter(DateTime expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeOnOrAfter(DateTime expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject >= expected) @@ -381,8 +382,8 @@ public AndConstraint BeOnOrAfter(DateTime expected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeOnOrAfter(DateTime unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeOnOrAfter(DateTime unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeBefore(unexpected, because, becauseArgs); } @@ -398,7 +399,7 @@ public AndConstraint NotBeOnOrAfter(DateTime unexpected, string bec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveYear(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveYear(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -425,7 +426,7 @@ public AndConstraint HaveYear(int expected, string because = "", pa /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveYear(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveYear(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -451,7 +452,7 @@ public AndConstraint NotHaveYear(int unexpected, string because = " /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveMonth(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveMonth(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -478,7 +479,7 @@ public AndConstraint HaveMonth(int expected, string because = "", p /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveMonth(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveMonth(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -505,7 +506,7 @@ public AndConstraint NotHaveMonth(int unexpected, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveDay(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -532,7 +533,7 @@ public AndConstraint HaveDay(int expected, string because = "", par /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveDay(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveDay(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -559,7 +560,7 @@ public AndConstraint NotHaveDay(int unexpected, string because = "" /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveHour(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -586,7 +587,7 @@ public AndConstraint HaveHour(int expected, string because = "", pa /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveHour(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveHour(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -613,8 +614,8 @@ public AndConstraint NotHaveHour(int unexpected, string because = " /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveMinute(int expected, string because = "", - params object[] becauseArgs) + public AndConstraint HaveMinute(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -641,8 +642,8 @@ public AndConstraint HaveMinute(int expected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveMinute(int unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotHaveMinute(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -669,8 +670,8 @@ public AndConstraint NotHaveMinute(int unexpected, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveSecond(int expected, string because = "", - params object[] becauseArgs) + public AndConstraint HaveSecond(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -697,8 +698,8 @@ public AndConstraint HaveSecond(int expected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveSecond(int unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotHaveSecond(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -786,8 +787,8 @@ public DateTimeRangeAssertions BeLessThan(TimeSpan timeSpan) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeSameDateAs(DateTime expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeSameDateAs(DateTime expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { DateTime expectedDate = expected.Date; @@ -816,8 +817,8 @@ public AndConstraint BeSameDateAs(DateTime expected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeSameDateAs(DateTime unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeSameDateAs(DateTime unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { DateTime unexpectedDate = unexpected.Date; @@ -870,7 +871,8 @@ public AndConstraint BeOneOf(params DateTime[] validValues) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOneOf(IEnumerable validValues, string because = "", params object[] becauseArgs) + public AndConstraint BeOneOf(IEnumerable validValues, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeOneOf(validValues.Cast(), because, becauseArgs); } @@ -888,8 +890,8 @@ public AndConstraint BeOneOf(IEnumerable validValues, str /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOneOf(IEnumerable validValues, string because = "", - params object[] becauseArgs) + public AndConstraint BeOneOf(IEnumerable validValues, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(validValues.Contains(Subject)) @@ -912,7 +914,8 @@ public AndConstraint BeOneOf(IEnumerable validValues, st /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeIn(DateTimeKind expectedKind, string because = "", params object[] becauseArgs) + public AndConstraint BeIn(DateTimeKind expectedKind, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -941,7 +944,8 @@ public AndConstraint BeIn(DateTimeKind expectedKind, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeIn(DateTimeKind unexpectedKind, string because = "", params object[] becauseArgs) + public AndConstraint NotBeIn(DateTimeKind unexpectedKind, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) diff --git a/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs index dafcdbbdba..35a03100c1 100644 --- a/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -58,8 +59,8 @@ public DateTimeOffsetAssertions(DateTimeOffset? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(DateTimeOffset expected, string because = "", - params object[] becauseArgs) + public AndConstraint Be(DateTimeOffset expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -87,8 +88,8 @@ public AndConstraint Be(DateTimeOffset expected, string because = " /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(DateTimeOffset? expected, string because = "", - params object[] becauseArgs) + public AndConstraint Be(DateTimeOffset? expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { if (!expected.HasValue) { @@ -126,8 +127,8 @@ public AndConstraint Be(DateTimeOffset? expected, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(DateTimeOffset unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBe(DateTimeOffset unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject != unexpected) @@ -150,8 +151,8 @@ public AndConstraint NotBe(DateTimeOffset unexpected, string becaus /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(DateTimeOffset? unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBe(DateTimeOffset? unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject != unexpected) @@ -174,8 +175,8 @@ public AndConstraint NotBe(DateTimeOffset? unexpected, string becau /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeExactly(DateTimeOffset expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeExactly(DateTimeOffset expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -203,8 +204,8 @@ public AndConstraint BeExactly(DateTimeOffset expected, string beca /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeExactly(DateTimeOffset? expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeExactly(DateTimeOffset? expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { if (!expected.HasValue) { @@ -242,8 +243,8 @@ public AndConstraint BeExactly(DateTimeOffset? expected, string bec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeExactly(DateTimeOffset unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeExactly(DateTimeOffset unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject?.EqualsExact(unexpected) != true) @@ -264,8 +265,8 @@ public AndConstraint NotBeExactly(DateTimeOffset unexpected, string /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeExactly(DateTimeOffset? unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeExactly(DateTimeOffset? unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!((Subject == null && unexpected == null) || @@ -299,8 +300,7 @@ public AndConstraint NotBeExactly(DateTimeOffset? unexpected, strin /// /// is negative. public AndConstraint BeCloseTo(DateTimeOffset nearbyTime, TimeSpan precision, - string because = "", - params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -348,8 +348,8 @@ public AndConstraint BeCloseTo(DateTimeOffset nearbyTime, TimeSpan /// Zero or more objects to format using the placeholders in . /// /// is negative. - public AndConstraint NotBeCloseTo(DateTimeOffset distantTime, TimeSpan precision, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeCloseTo(DateTimeOffset distantTime, TimeSpan precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -381,8 +381,8 @@ public AndConstraint NotBeCloseTo(DateTimeOffset distantTime, TimeS /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeBefore(DateTimeOffset expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeBefore(DateTimeOffset expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject < expected) @@ -404,8 +404,8 @@ public AndConstraint BeBefore(DateTimeOffset expected, string becau /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeBefore(DateTimeOffset unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeBefore(DateTimeOffset unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeOnOrAfter(unexpected, because, becauseArgs); } @@ -421,8 +421,8 @@ public AndConstraint NotBeBefore(DateTimeOffset unexpected, string /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOnOrBefore(DateTimeOffset expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeOnOrBefore(DateTimeOffset expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject <= expected) @@ -444,8 +444,8 @@ public AndConstraint BeOnOrBefore(DateTimeOffset expected, string b /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeOnOrBefore(DateTimeOffset unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeOnOrBefore(DateTimeOffset unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeAfter(unexpected, because, becauseArgs); } @@ -461,8 +461,8 @@ public AndConstraint NotBeOnOrBefore(DateTimeOffset unexpected, str /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeAfter(DateTimeOffset expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeAfter(DateTimeOffset expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject > expected) @@ -484,8 +484,8 @@ public AndConstraint BeAfter(DateTimeOffset expected, string becaus /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeAfter(DateTimeOffset unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeAfter(DateTimeOffset unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeOnOrBefore(unexpected, because, becauseArgs); } @@ -501,8 +501,8 @@ public AndConstraint NotBeAfter(DateTimeOffset unexpected, string b /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOnOrAfter(DateTimeOffset expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeOnOrAfter(DateTimeOffset expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject >= expected) @@ -524,8 +524,8 @@ public AndConstraint BeOnOrAfter(DateTimeOffset expected, string be /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeOnOrAfter(DateTimeOffset unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeOnOrAfter(DateTimeOffset unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeBefore(unexpected, because, becauseArgs); } @@ -541,8 +541,8 @@ public AndConstraint NotBeOnOrAfter(DateTimeOffset unexpected, stri /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveYear(int expected, string because = "", - params object[] becauseArgs) + public AndConstraint HaveYear(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -569,7 +569,8 @@ public AndConstraint HaveYear(int expected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveYear(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveYear(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -596,8 +597,8 @@ public AndConstraint NotHaveYear(int unexpected, string because = " /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveMonth(int expected, string because = "", - params object[] becauseArgs) + public AndConstraint HaveMonth(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -624,7 +625,8 @@ public AndConstraint HaveMonth(int expected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveMonth(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveMonth(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -651,8 +653,8 @@ public AndConstraint NotHaveMonth(int unexpected, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveDay(int expected, string because = "", - params object[] becauseArgs) + public AndConstraint HaveDay(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -679,7 +681,8 @@ public AndConstraint HaveDay(int expected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveDay(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveDay(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -706,8 +709,8 @@ public AndConstraint NotHaveDay(int unexpected, string because = "" /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveHour(int expected, string because = "", - params object[] becauseArgs) + public AndConstraint HaveHour(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -734,7 +737,8 @@ public AndConstraint HaveHour(int expected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveHour(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveHour(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -761,8 +765,8 @@ public AndConstraint NotHaveHour(int unexpected, string because = " /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveMinute(int expected, string because = "", - params object[] becauseArgs) + public AndConstraint HaveMinute(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -789,8 +793,8 @@ public AndConstraint HaveMinute(int expected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveMinute(int unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotHaveMinute(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -817,8 +821,8 @@ public AndConstraint NotHaveMinute(int unexpected, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveSecond(int expected, string because = "", - params object[] becauseArgs) + public AndConstraint HaveSecond(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -845,8 +849,8 @@ public AndConstraint HaveSecond(int expected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveSecond(int unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotHaveSecond(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -873,8 +877,8 @@ public AndConstraint NotHaveSecond(int unexpected, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveOffset(TimeSpan expected, string because = "", - params object[] becauseArgs) + public AndConstraint HaveOffset(TimeSpan expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -901,8 +905,8 @@ public AndConstraint HaveOffset(TimeSpan expected, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveOffset(TimeSpan unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotHaveOffset(TimeSpan unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -990,8 +994,8 @@ public DateTimeOffsetRangeAssertions BeLessThan(TimeSpan timeSpan) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeSameDateAs(DateTimeOffset expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeSameDateAs(DateTimeOffset expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { DateTime expectedDate = expected.Date; @@ -1020,8 +1024,8 @@ public AndConstraint BeSameDateAs(DateTimeOffset expected, string b /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeSameDateAs(DateTimeOffset unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeSameDateAs(DateTimeOffset unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { DateTime unexpectedDate = unexpected.Date; @@ -1074,8 +1078,8 @@ public AndConstraint BeOneOf(params DateTimeOffset[] validValues) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOneOf(IEnumerable validValues, string because = "", - params object[] becauseArgs) + public AndConstraint BeOneOf(IEnumerable validValues, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeOneOf(validValues.Cast(), because, becauseArgs); } @@ -1093,8 +1097,8 @@ public AndConstraint BeOneOf(IEnumerable validValue /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOneOf(IEnumerable validValues, string because = "", - params object[] becauseArgs) + public AndConstraint BeOneOf(IEnumerable validValues, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(validValues.Contains(Subject)) diff --git a/Src/FluentAssertions/Primitives/DateTimeOffsetRangeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeOffsetRangeAssertions.cs index d56cd78cb6..deea7a999e 100644 --- a/Src/FluentAssertions/Primitives/DateTimeOffsetRangeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeOffsetRangeAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; using FluentAssertions.Extensions; @@ -62,8 +63,8 @@ protected internal DateTimeOffsetRangeAssertions(TAssertions parentAssertions, D /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Before(DateTimeOffset target, string because = "", - params object[] becauseArgs) + public AndConstraint Before(DateTimeOffset target, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(subject.HasValue) @@ -100,7 +101,8 @@ public AndConstraint Before(DateTimeOffset target, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint After(DateTimeOffset target, string because = "", params object[] becauseArgs) + public AndConstraint After(DateTimeOffset target, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(subject.HasValue) diff --git a/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs index 4deabcf6af..c6976b51bc 100644 --- a/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; namespace FluentAssertions.Primitives; @@ -62,8 +63,8 @@ protected internal DateTimeRangeAssertions(TAssertions parentAssertions, DateTim /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Before(DateTime target, string because = "", - params object[] becauseArgs) + public AndConstraint Before(DateTime target, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(subject.HasValue) @@ -101,8 +102,8 @@ public AndConstraint Before(DateTime target, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint After(DateTime target, string because = "", - params object[] becauseArgs) + public AndConstraint After(DateTime target, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(subject.HasValue) diff --git a/Src/FluentAssertions/Primitives/EnumAssertions.cs b/Src/FluentAssertions/Primitives/EnumAssertions.cs index 69090e30d5..69d8b110ef 100644 --- a/Src/FluentAssertions/Primitives/EnumAssertions.cs +++ b/Src/FluentAssertions/Primitives/EnumAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Linq.Expressions; @@ -52,7 +53,8 @@ private protected EnumAssertions(TEnum? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(TEnum expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(TEnum expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject?.Equals(expected) == true) @@ -74,7 +76,8 @@ public AndConstraint Be(TEnum expected, string because = "", params /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(TEnum? expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(TEnum? expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Nullable.Equals(Subject, expected)) @@ -96,8 +99,8 @@ public AndConstraint Be(TEnum? expected, string because = "", param /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(TEnum unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBe(TEnum unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject?.Equals(unexpected) != true) @@ -118,8 +121,8 @@ public AndConstraint NotBe(TEnum unexpected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(TEnum? unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBe(TEnum? unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!Nullable.Equals(Subject, unexpected)) @@ -139,7 +142,7 @@ public AndConstraint NotBe(TEnum? unexpected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeDefined(string because = "", params object[] becauseArgs) + public AndConstraint BeDefined([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -165,7 +168,7 @@ public AndConstraint BeDefined(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeDefined(string because = "", params object[] becauseArgs) + public AndConstraint NotBeDefined([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -192,7 +195,8 @@ public AndConstraint NotBeDefined(string because = "", params objec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveValue(decimal expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveValue(decimal expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject is { } value && GetValue(value) == expected) @@ -214,7 +218,8 @@ public AndConstraint HaveValue(decimal expected, string because = " /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveValue(decimal unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveValue(decimal unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!(Subject is { } value && GetValue(value) == unexpected)) @@ -236,7 +241,8 @@ public AndConstraint NotHaveValue(decimal unexpected, string becaus /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveSameValueAs(T expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveSameValueAs(T expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where T : struct, Enum { Execute.Assertion @@ -259,7 +265,8 @@ public AndConstraint HaveSameValueAs(T expected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveSameValueAs(T unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveSameValueAs(T unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where T : struct, Enum { Execute.Assertion @@ -282,7 +289,8 @@ public AndConstraint NotHaveSameValueAs(T unexpected, string bec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveSameNameAs(T expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveSameNameAs(T expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where T : struct, Enum { Execute.Assertion @@ -305,7 +313,8 @@ public AndConstraint HaveSameNameAs(T expected, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveSameNameAs(T unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveSameNameAs(T unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where T : struct, Enum { Execute.Assertion @@ -328,8 +337,8 @@ public AndConstraint NotHaveSameNameAs(T unexpected, string beca /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveFlag(TEnum expectedFlag, string because = "", - params object[] becauseArgs) + public AndConstraint HaveFlag(TEnum expectedFlag, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -350,8 +359,8 @@ public AndConstraint HaveFlag(TEnum expectedFlag, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveFlag(TEnum unexpectedFlag, string because = "", - params object[] becauseArgs) + public AndConstraint NotHaveFlag(TEnum unexpectedFlag, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -376,8 +385,7 @@ public AndConstraint NotHaveFlag(TEnum unexpectedFlag, string becau /// An which can be used to chain assertions. /// is . public AndConstraint Match(Expression> predicate, - string because = "", - params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(predicate, nameof(predicate), "Cannot match an enum against a predicate."); @@ -415,7 +423,8 @@ public AndConstraint BeOneOf(params TEnum[] validValues) /// /// is . /// is empty. - public AndConstraint BeOneOf(IEnumerable validValues, string because = "", params object[] becauseArgs) + public AndConstraint BeOneOf(IEnumerable validValues, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(validValues, nameof(validValues), "Cannot assert that an enum is one of a null list of enums"); diff --git a/Src/FluentAssertions/Primitives/GuidAssertions.cs b/Src/FluentAssertions/Primitives/GuidAssertions.cs index eb9cb115a0..648faa7964 100644 --- a/Src/FluentAssertions/Primitives/GuidAssertions.cs +++ b/Src/FluentAssertions/Primitives/GuidAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; namespace FluentAssertions.Primitives; @@ -47,7 +48,7 @@ public GuidAssertions(Guid? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeEmpty(string because = "", params object[] becauseArgs) + public AndConstraint BeEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject == Guid.Empty) @@ -67,7 +68,7 @@ public AndConstraint BeEmpty(string because = "", params object[] b /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) + public AndConstraint NotBeEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject is { } value && value != Guid.Empty) @@ -93,7 +94,8 @@ public AndConstraint NotBeEmpty(string because = "", params object[ /// Zero or more objects to format using the placeholders in . /// /// The format of is invalid. - public AndConstraint Be(string expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(string expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { if (!Guid.TryParse(expected, out Guid expectedGuid)) { @@ -114,7 +116,8 @@ public AndConstraint Be(string expected, string because = "", param /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(Guid expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(Guid expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject == expected) @@ -136,7 +139,8 @@ public AndConstraint Be(Guid expected, string because = "", params /// Zero or more objects to format using the placeholders in . /// /// The format of is invalid. - public AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBe(string unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { if (!Guid.TryParse(unexpected, out Guid unexpectedGuid)) { @@ -157,7 +161,8 @@ public AndConstraint NotBe(string unexpected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(Guid unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBe(Guid unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject != unexpected) diff --git a/Src/FluentAssertions/Primitives/HttpResponseMessageAssertions.cs b/Src/FluentAssertions/Primitives/HttpResponseMessageAssertions.cs index 49df342a49..f688e7a32f 100644 --- a/Src/FluentAssertions/Primitives/HttpResponseMessageAssertions.cs +++ b/Src/FluentAssertions/Primitives/HttpResponseMessageAssertions.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Net; using System.Net.Http; using FluentAssertions.Execution; @@ -39,7 +40,7 @@ protected HttpResponseMessageAssertions(HttpResponseMessage value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeSuccessful(string because = "", params object[] becauseArgs) + public AndConstraint BeSuccessful([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var success = Execute.Assertion .ForCondition(Subject is not null) @@ -67,7 +68,7 @@ public AndConstraint BeSuccessful(string because = "", params objec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeRedirection(string because = "", params object[] becauseArgs) + public AndConstraint BeRedirection([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var success = Execute.Assertion .ForCondition(Subject is not null) @@ -95,7 +96,7 @@ public AndConstraint BeRedirection(string because = "", params obje /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveError(string because = "", params object[] becauseArgs) + public AndConstraint HaveError([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var success = Execute.Assertion .ForCondition(Subject is not null) @@ -123,7 +124,7 @@ public AndConstraint HaveError(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveClientError(string because = "", params object[] becauseArgs) + public AndConstraint HaveClientError([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var success = Execute.Assertion .ForCondition(Subject is not null) @@ -151,7 +152,7 @@ public AndConstraint HaveClientError(string because = "", params ob /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveServerError(string because = "", params object[] becauseArgs) + public AndConstraint HaveServerError([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var success = Execute.Assertion .ForCondition(Subject is not null) @@ -180,7 +181,8 @@ public AndConstraint HaveServerError(string because = "", params ob /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveStatusCode(HttpStatusCode expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveStatusCode(HttpStatusCode expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var success = Execute.Assertion .ForCondition(Subject is not null) @@ -209,8 +211,8 @@ public AndConstraint HaveStatusCode(HttpStatusCode expected, string /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveStatusCode(HttpStatusCode unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotHaveStatusCode(HttpStatusCode unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var success = Execute.Assertion .ForCondition(Subject is not null) diff --git a/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs b/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs index d4bab23992..6b5954d946 100644 --- a/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; namespace FluentAssertions.Primitives; @@ -37,7 +38,7 @@ public NullableBooleanAssertions(bool? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveValue(string because = "", params object[] becauseArgs) + public AndConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.HasValue) @@ -57,7 +58,7 @@ public AndConstraint HaveValue(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeNull(string because = "", params object[] becauseArgs) + public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return HaveValue(because, becauseArgs); } @@ -72,7 +73,7 @@ public AndConstraint NotBeNull(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) + public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!Subject.HasValue) @@ -92,7 +93,7 @@ public AndConstraint NotHaveValue(string because = "", params objec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeNull(string because = "", params object[] becauseArgs) + public AndConstraint BeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotHaveValue(because, becauseArgs); } @@ -108,7 +109,8 @@ public AndConstraint BeNull(string because = "", params object[] be /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(bool? expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(bool? expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject == expected) @@ -129,7 +131,8 @@ public AndConstraint Be(bool? expected, string because = "", params /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(bool? unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBe(bool? unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject != unexpected) @@ -149,7 +152,7 @@ public AndConstraint NotBe(bool? unexpected, string because = "", p /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeFalse(string because = "", params object[] becauseArgs) + public AndConstraint NotBeFalse([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject is not false) @@ -169,7 +172,7 @@ public AndConstraint NotBeFalse(string because = "", params object[ /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeTrue(string because = "", params object[] becauseArgs) + public AndConstraint NotBeTrue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject is not true) diff --git a/Src/FluentAssertions/Primitives/NullableDateOnlyAssertions.cs b/Src/FluentAssertions/Primitives/NullableDateOnlyAssertions.cs index d4924c217a..b4733fbf01 100644 --- a/Src/FluentAssertions/Primitives/NullableDateOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableDateOnlyAssertions.cs @@ -2,6 +2,7 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; namespace FluentAssertions.Primitives; @@ -40,7 +41,7 @@ public NullableDateOnlyAssertions(DateOnly? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveValue(string because = "", params object[] becauseArgs) + public AndConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.HasValue) @@ -60,7 +61,7 @@ public AndConstraint HaveValue(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeNull(string because = "", params object[] becauseArgs) + public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return HaveValue(because, becauseArgs); } @@ -75,7 +76,7 @@ public AndConstraint NotBeNull(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) + public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!Subject.HasValue) @@ -95,7 +96,7 @@ public AndConstraint NotHaveValue(string because = "", params objec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeNull(string because = "", params object[] becauseArgs) + public AndConstraint BeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotHaveValue(because, becauseArgs); } diff --git a/Src/FluentAssertions/Primitives/NullableDateTimeAssertions.cs b/Src/FluentAssertions/Primitives/NullableDateTimeAssertions.cs index a533d7a2de..2f897eeaa0 100644 --- a/Src/FluentAssertions/Primitives/NullableDateTimeAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableDateTimeAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; using FluentAssertions.Extensions; @@ -45,7 +46,7 @@ public NullableDateTimeAssertions(DateTime? expected) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveValue(string because = "", params object[] becauseArgs) + public AndConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.HasValue) @@ -65,7 +66,7 @@ public AndConstraint HaveValue(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeNull(string because = "", params object[] becauseArgs) + public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return HaveValue(because, becauseArgs); } @@ -80,7 +81,7 @@ public AndConstraint NotBeNull(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) + public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!Subject.HasValue) @@ -100,7 +101,7 @@ public AndConstraint NotHaveValue(string because = "", params objec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeNull(string because = "", params object[] becauseArgs) + public AndConstraint BeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotHaveValue(because, becauseArgs); } diff --git a/Src/FluentAssertions/Primitives/NullableDateTimeOffsetAssertions.cs b/Src/FluentAssertions/Primitives/NullableDateTimeOffsetAssertions.cs index 50f6056b9a..48553d4ada 100644 --- a/Src/FluentAssertions/Primitives/NullableDateTimeOffsetAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableDateTimeOffsetAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; namespace FluentAssertions.Primitives; @@ -46,7 +47,7 @@ public NullableDateTimeOffsetAssertions(DateTimeOffset? expected) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveValue(string because = "", params object[] becauseArgs) + public AndConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.HasValue) @@ -66,7 +67,7 @@ public AndConstraint HaveValue(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeNull(string because = "", params object[] becauseArgs) + public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return HaveValue(because, becauseArgs); } @@ -81,7 +82,7 @@ public AndConstraint NotBeNull(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveValue(string because = "", + public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion @@ -102,7 +103,7 @@ public AndConstraint NotHaveValue(string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeNull(string because = "", + public AndConstraint BeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotHaveValue(because, becauseArgs); diff --git a/Src/FluentAssertions/Primitives/NullableEnumAssertions.cs b/Src/FluentAssertions/Primitives/NullableEnumAssertions.cs index 3ca6207582..85f2ce95e6 100644 --- a/Src/FluentAssertions/Primitives/NullableEnumAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableEnumAssertions.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; namespace FluentAssertions.Primitives; @@ -37,7 +38,7 @@ public NullableEnumAssertions(TEnum? subject) /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint HaveValue(string because = "", params object[] becauseArgs) + public AndWhichConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.HasValue) @@ -57,7 +58,7 @@ public AndWhichConstraint HaveValue(string because = "", par /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint NotBeNull(string because = "", params object[] becauseArgs) + public AndWhichConstraint NotBeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return HaveValue(because, becauseArgs); } @@ -72,7 +73,7 @@ public AndWhichConstraint NotBeNull(string because = "", par /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) + public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!Subject.HasValue) @@ -92,7 +93,7 @@ public AndConstraint NotHaveValue(string because = "", params objec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeNull(string because = "", params object[] becauseArgs) + public AndConstraint BeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotHaveValue(because, becauseArgs); } diff --git a/Src/FluentAssertions/Primitives/NullableGuidAssertions.cs b/Src/FluentAssertions/Primitives/NullableGuidAssertions.cs index 2cf438c836..45c26f7915 100644 --- a/Src/FluentAssertions/Primitives/NullableGuidAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableGuidAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; namespace FluentAssertions.Primitives; @@ -38,7 +39,7 @@ public NullableGuidAssertions(Guid? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveValue(string because = "", params object[] becauseArgs) + public AndConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.HasValue) @@ -58,7 +59,7 @@ public AndConstraint HaveValue(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeNull(string because = "", params object[] becauseArgs) + public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return HaveValue(because, becauseArgs); } @@ -73,7 +74,7 @@ public AndConstraint NotBeNull(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) + public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!Subject.HasValue) @@ -93,7 +94,7 @@ public AndConstraint NotHaveValue(string because = "", params objec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeNull(string because = "", params object[] becauseArgs) + public AndConstraint BeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotHaveValue(because, becauseArgs); } @@ -109,7 +110,7 @@ public AndConstraint BeNull(string because = "", params object[] be /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(Guid? expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(Guid? expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject == expected) diff --git a/Src/FluentAssertions/Primitives/NullableSimpleTimeSpanAssertions.cs b/Src/FluentAssertions/Primitives/NullableSimpleTimeSpanAssertions.cs index b3da01e2af..da52304bd1 100644 --- a/Src/FluentAssertions/Primitives/NullableSimpleTimeSpanAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableSimpleTimeSpanAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; namespace FluentAssertions.Primitives; @@ -46,7 +47,7 @@ public NullableSimpleTimeSpanAssertions(TimeSpan? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveValue(string because = "", params object[] becauseArgs) + public AndConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.HasValue) @@ -66,7 +67,7 @@ public AndConstraint HaveValue(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeNull(string because = "", params object[] becauseArgs) + public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return HaveValue(because, becauseArgs); } @@ -81,7 +82,7 @@ public AndConstraint NotBeNull(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) + public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!Subject.HasValue) @@ -101,7 +102,7 @@ public AndConstraint NotHaveValue(string because = "", params objec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeNull(string because = "", params object[] becauseArgs) + public AndConstraint BeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotHaveValue(because, becauseArgs); } @@ -117,8 +118,8 @@ public AndConstraint BeNull(string because = "", params object[] be /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(TimeSpan? expected, string because = "", - params object[] becauseArgs) + public AndConstraint Be(TimeSpan? expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject == expected) diff --git a/Src/FluentAssertions/Primitives/NullableTimeOnlyAssertions.cs b/Src/FluentAssertions/Primitives/NullableTimeOnlyAssertions.cs index ad3b1f1cce..d0235efee0 100644 --- a/Src/FluentAssertions/Primitives/NullableTimeOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableTimeOnlyAssertions.cs @@ -2,6 +2,7 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; namespace FluentAssertions.Primitives; @@ -40,7 +41,7 @@ public NullableTimeOnlyAssertions(TimeOnly? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveValue(string because = "", params object[] becauseArgs) + public AndConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.HasValue) @@ -60,7 +61,7 @@ public AndConstraint HaveValue(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeNull(string because = "", params object[] becauseArgs) + public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return HaveValue(because, becauseArgs); } @@ -75,7 +76,7 @@ public AndConstraint NotBeNull(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) + public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!Subject.HasValue) @@ -95,7 +96,7 @@ public AndConstraint NotHaveValue(string because = "", params objec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeNull(string because = "", params object[] becauseArgs) + public AndConstraint BeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotHaveValue(because, becauseArgs); } diff --git a/Src/FluentAssertions/Primitives/ObjectAssertions.cs b/Src/FluentAssertions/Primitives/ObjectAssertions.cs index 1d0cd60bf8..d6bdccfab0 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.Diagnostics.CodeAnalysis; using System.Linq; using FluentAssertions.Common; using FluentAssertions.Equivalency; @@ -32,7 +33,8 @@ public ObjectAssertions(object value) /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint Be(TExpectation expected, IEqualityComparer comparer, string because = "", params object[] becauseArgs) + public AndConstraint Be(TExpectation expected, IEqualityComparer comparer, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer); @@ -61,7 +63,8 @@ public AndConstraint Be(TExpectation expected, I /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotBe(TExpectation unexpected, IEqualityComparer comparer, string because = "", params object[] becauseArgs) + public AndConstraint NotBe(TExpectation unexpected, IEqualityComparer comparer, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer); @@ -94,8 +97,7 @@ public AndConstraint NotBe(TExpectation unexpect /// is . public AndConstraint BeOneOf(IEnumerable validValues, IEqualityComparer comparer, - string because = "", - params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(validValues); Guard.ThrowIfArgumentIsNull(comparer); @@ -133,7 +135,8 @@ public ObjectAssertions(TSubject value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(TSubject expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -160,7 +163,8 @@ public AndConstraint Be(TSubject expected, string because = "", par /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint Be(TSubject expected, IEqualityComparer comparer, string because = "", params object[] becauseArgs) + public AndConstraint Be(TSubject expected, IEqualityComparer comparer, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer); @@ -185,7 +189,8 @@ public AndConstraint Be(TSubject expected, IEqualityComparer /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(TSubject unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBe(TSubject unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!ObjectExtensions.GetComparer()(Subject, unexpected)) @@ -211,7 +216,8 @@ public AndConstraint NotBe(TSubject unexpected, string because = "" /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotBe(TSubject unexpected, IEqualityComparer comparer, string because = "", params object[] becauseArgs) + public AndConstraint NotBe(TSubject unexpected, IEqualityComparer comparer, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer); @@ -242,8 +248,8 @@ public AndConstraint NotBe(TSubject unexpected, IEqualityComparer /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeEquivalentTo(TExpectation expectation, string because = "", - params object[] becauseArgs) + public AndConstraint BeEquivalentTo(TExpectation expectation, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeEquivalentTo(expectation, config => config, because, becauseArgs); } @@ -273,8 +279,8 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// /// is . public AndConstraint BeEquivalentTo(TExpectation expectation, - Func, EquivalencyOptions> config, string because = "", - params object[] becauseArgs) + Func, EquivalencyOptions> config, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -319,8 +325,7 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// public AndConstraint NotBeEquivalentTo( TExpectation unexpected, - string because = "", - params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotBeEquivalentTo(unexpected, config => config, because, becauseArgs); } @@ -352,8 +357,7 @@ public AndConstraint NotBeEquivalentTo( public AndConstraint NotBeEquivalentTo( TExpectation unexpected, Func, EquivalencyOptions> config, - string because = "", - params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -398,8 +402,8 @@ public AndConstraint BeOneOf(params TSubject[] validValues) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOneOf(IEnumerable validValues, string because = "", - params object[] becauseArgs) + public AndConstraint BeOneOf(IEnumerable validValues, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(validValues.Contains(Subject)) @@ -429,8 +433,7 @@ public AndConstraint BeOneOf(IEnumerable validValues, str /// is . public AndConstraint BeOneOf(IEnumerable validValues, IEqualityComparer comparer, - string because = "", - params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(validValues); Guard.ThrowIfArgumentIsNull(comparer); diff --git a/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs b/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs index 5cd0addfc5..b7b1013423 100644 --- a/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs +++ b/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -35,7 +36,7 @@ protected ReferenceTypeAssertions(TSubject subject) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeNull(string because = "", params object[] becauseArgs) + public AndConstraint BeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject is null) @@ -56,7 +57,7 @@ public AndConstraint BeNull(string because = "", params object[] be /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeNull(string because = "", params object[] becauseArgs) + public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject is not null) @@ -78,7 +79,8 @@ public AndConstraint NotBeNull(string because = "", params object[] /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeSameAs(TSubject expected, string because = "", params object[] becauseArgs) + public AndConstraint BeSameAs(TSubject expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .UsingLineBreaks @@ -101,7 +103,8 @@ public AndConstraint BeSameAs(TSubject expected, string because = " /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeSameAs(TSubject unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBeSameAs(TSubject unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .UsingLineBreaks @@ -124,7 +127,7 @@ public AndConstraint NotBeSameAs(TSubject unexpected, string becaus /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint BeOfType(string because = "", params object[] becauseArgs) + public AndWhichConstraint BeOfType([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { BeOfType(typeof(T), because, becauseArgs); @@ -149,7 +152,8 @@ public AndWhichConstraint BeOfType(string because = "", param /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint BeOfType(Type expectedType, string because = "", params object[] becauseArgs) + public AndConstraint BeOfType(Type expectedType, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expectedType); @@ -187,7 +191,7 @@ public AndConstraint BeOfType(Type expectedType, string because = " /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeOfType(string because = "", params object[] becauseArgs) + public AndConstraint NotBeOfType([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { NotBeOfType(typeof(T), because, becauseArgs); @@ -208,7 +212,8 @@ public AndConstraint NotBeOfType(string because = "", params obj /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotBeOfType(Type unexpectedType, string because = "", params object[] becauseArgs) + public AndConstraint NotBeOfType(Type unexpectedType, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpectedType); @@ -247,7 +252,7 @@ public AndConstraint NotBeOfType(Type unexpectedType, string becaus /// Zero or more objects to format using the placeholders in . /// /// An which can be used to chain assertions. - public AndWhichConstraint BeAssignableTo(string because = "", params object[] becauseArgs) + public AndWhichConstraint BeAssignableTo([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(Subject is not null) @@ -284,7 +289,8 @@ public AndWhichConstraint BeAssignableTo(string because = "", /// /// An which can be used to chain assertions. /// is . - public AndConstraint BeAssignableTo(Type type, string because = "", params object[] becauseArgs) + public AndConstraint BeAssignableTo(Type type, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(type); @@ -324,7 +330,7 @@ public AndConstraint BeAssignableTo(Type type, string because = "", /// Zero or more objects to format using the placeholders in . /// /// An which can be used to chain assertions. - public AndConstraint NotBeAssignableTo(string because = "", params object[] becauseArgs) + public AndConstraint NotBeAssignableTo([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotBeAssignableTo(typeof(T), because, becauseArgs); } @@ -342,7 +348,8 @@ public AndConstraint NotBeAssignableTo(string because = "", para /// /// An which can be used to chain assertions. /// is . - public AndConstraint NotBeAssignableTo(Type type, string because = "", params object[] becauseArgs) + public AndConstraint NotBeAssignableTo(Type type, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(type); @@ -381,8 +388,7 @@ public AndConstraint NotBeAssignableTo(Type type, string because = /// /// An which can be used to chain assertions. public AndConstraint Match(Expression> predicate, - string because = "", - params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return Match(predicate, because, becauseArgs); } @@ -401,8 +407,7 @@ public AndConstraint Match(Expression> predica /// An which can be used to chain assertions. /// is . public AndConstraint Match(Expression> predicate, - string because = "", - params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where T : TSubject { Guard.ThrowIfArgumentIsNull(predicate, nameof(predicate), "Cannot match an object against a predicate."); diff --git a/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs b/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs index 63b922b113..7387544b22 100644 --- a/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs +++ b/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -46,7 +47,7 @@ public SimpleTimeSpanAssertions(TimeSpan? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BePositive(string because = "", params object[] becauseArgs) + public AndConstraint BePositive([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -66,7 +67,7 @@ public AndConstraint BePositive(string because = "", params object[ /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeNegative(string because = "", params object[] becauseArgs) + public AndConstraint BeNegative([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -88,7 +89,8 @@ public AndConstraint BeNegative(string because = "", params object[ /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(TimeSpan expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(TimeSpan expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -110,7 +112,8 @@ public AndConstraint Be(TimeSpan expected, string because = "", par /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(TimeSpan unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBe(TimeSpan unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(unexpected != Subject) @@ -132,7 +135,8 @@ public AndConstraint NotBe(TimeSpan unexpected, string because = "" /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeLessThan(TimeSpan expected, string because = "", params object[] becauseArgs) + public AndConstraint BeLessThan(TimeSpan expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -154,7 +158,8 @@ public AndConstraint BeLessThan(TimeSpan expected, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeLessThanOrEqualTo(TimeSpan expected, string because = "", params object[] becauseArgs) + public AndConstraint BeLessThanOrEqualTo(TimeSpan expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -176,7 +181,8 @@ public AndConstraint BeLessThanOrEqualTo(TimeSpan expected, string /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeGreaterThan(TimeSpan expected, string because = "", params object[] becauseArgs) + public AndConstraint BeGreaterThan(TimeSpan expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -198,8 +204,8 @@ public AndConstraint BeGreaterThan(TimeSpan expected, string becaus /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeGreaterThanOrEqualTo(TimeSpan expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeGreaterThanOrEqualTo(TimeSpan expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -231,8 +237,8 @@ public AndConstraint BeGreaterThanOrEqualTo(TimeSpan expected, stri /// Zero or more objects to format using the placeholders in . /// /// is negative. - public AndConstraint BeCloseTo(TimeSpan nearbyTime, TimeSpan precision, string because = "", - params object[] becauseArgs) + public AndConstraint BeCloseTo(TimeSpan nearbyTime, TimeSpan precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -271,8 +277,8 @@ public AndConstraint BeCloseTo(TimeSpan nearbyTime, TimeSpan precis /// Zero or more objects to format using the placeholders in . /// /// is negative. - public AndConstraint NotBeCloseTo(TimeSpan distantTime, TimeSpan precision, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeCloseTo(TimeSpan distantTime, TimeSpan precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); diff --git a/Src/FluentAssertions/Primitives/StringAssertions.cs b/Src/FluentAssertions/Primitives/StringAssertions.cs index ff968ea59d..2a276dbbb1 100644 --- a/Src/FluentAssertions/Primitives/StringAssertions.cs +++ b/Src/FluentAssertions/Primitives/StringAssertions.cs @@ -52,7 +52,8 @@ public StringAssertions(string value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(string expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(string expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var stringEqualityValidator = new StringValidator( new StringEqualityStrategy(StringComparer.Ordinal, "be"), @@ -87,7 +88,8 @@ public AndConstraint BeOneOf(params string[] validValues) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOneOf(IEnumerable validValues, string because = "", params object[] becauseArgs) + public AndConstraint BeOneOf(IEnumerable validValues, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(validValues.Contains(Subject)) @@ -112,7 +114,7 @@ public AndConstraint BeOneOf(IEnumerable validValues, strin /// Zero or more objects to format using the placeholders in . /// public AndConstraint BeEquivalentTo(string expected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var expectation = new StringValidator( new StringEqualityStrategy(StringComparer.OrdinalIgnoreCase, "be equivalent to"), @@ -141,7 +143,7 @@ public AndConstraint BeEquivalentTo(string expected, /// public AndConstraint BeEquivalentTo(string expected, Func, EquivalencyOptions> config, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -173,7 +175,7 @@ public AndConstraint BeEquivalentTo(string expected, /// Zero or more objects to format using the placeholders in . /// public AndConstraint NotBeEquivalentTo(string unexpected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool notEquivalent; @@ -209,7 +211,7 @@ public AndConstraint NotBeEquivalentTo(string unexpected, /// public AndConstraint NotBeEquivalentTo(string unexpected, Func, EquivalencyOptions> config, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -241,7 +243,8 @@ public AndConstraint NotBeEquivalentTo(string unexpected, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBe(string unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject != unexpected) @@ -286,7 +289,8 @@ public AndConstraint NotBe(string unexpected, string because = "", /// /// is . /// is empty. - public AndConstraint Match(string wildcardPattern, string because = "", params object[] becauseArgs) + public AndConstraint Match(string wildcardPattern, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(wildcardPattern, nameof(wildcardPattern), "Cannot match string against . Provide a wildcard pattern or use the BeNull method."); @@ -338,7 +342,8 @@ public AndConstraint Match(string wildcardPattern, string because = /// /// is . /// is empty. - public AndConstraint NotMatch(string wildcardPattern, string because = "", params object[] becauseArgs) + public AndConstraint NotMatch(string wildcardPattern, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(wildcardPattern, nameof(wildcardPattern), "Cannot match string against . Provide a wildcard pattern or use the NotBeNull method."); @@ -394,7 +399,7 @@ public AndConstraint NotMatch(string wildcardPattern, string becaus /// is . /// is empty. public AndConstraint MatchEquivalentOf(string wildcardPattern, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(wildcardPattern, nameof(wildcardPattern), "Cannot match string against . Provide a wildcard pattern or use the BeNull method."); @@ -455,7 +460,7 @@ public AndConstraint MatchEquivalentOf(string wildcardPattern, /// is empty. public AndConstraint MatchEquivalentOf(string wildcardPattern, Func, EquivalencyOptions> config, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(wildcardPattern, nameof(wildcardPattern), "Cannot match string against . Provide a wildcard pattern or use the BeNull method."); @@ -518,7 +523,7 @@ public AndConstraint MatchEquivalentOf(string wildcardPattern, /// is . /// is empty. public AndConstraint NotMatchEquivalentOf(string wildcardPattern, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(wildcardPattern, nameof(wildcardPattern), "Cannot match string against . Provide a wildcard pattern or use the NotBeNull method."); @@ -580,7 +585,7 @@ public AndConstraint NotMatchEquivalentOf(string wildcardPattern, /// is empty. public AndConstraint NotMatchEquivalentOf(string wildcardPattern, Func, EquivalencyOptions> config, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(wildcardPattern, nameof(wildcardPattern), "Cannot match string against . Provide a wildcard pattern or use the NotBeNull method."); @@ -629,7 +634,8 @@ public AndConstraint NotMatchEquivalentOf(string wildcardPattern, /// /// is . public AndConstraint MatchRegex([RegexPattern][StringSyntax("Regex")] string regularExpression, - OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) + OccurrenceConstraint occurrenceConstraint, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(regularExpression, nameof(regularExpression), "Cannot match string against . Provide a regex pattern or use the BeNull method."); @@ -666,7 +672,7 @@ public AndConstraint MatchRegex([RegexPattern][StringSyntax("Regex" /// /// is . public AndConstraint MatchRegex([RegexPattern][StringSyntax("Regex")] string regularExpression, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(regularExpression, nameof(regularExpression), "Cannot match string against . Provide a regex pattern or use the BeNull method."); @@ -711,7 +717,7 @@ public AndConstraint MatchRegex([RegexPattern][StringSyntax("Regex" /// is empty. public AndConstraint MatchRegex(Regex regularExpression, OccurrenceConstraint occurrenceConstraint, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(regularExpression, nameof(regularExpression), "Cannot match string against . Provide a regex pattern or use the BeNull method."); @@ -759,7 +765,7 @@ public AndConstraint MatchRegex(Regex regularExpression, /// is . /// is empty. public AndConstraint MatchRegex(Regex regularExpression, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(regularExpression, nameof(regularExpression), "Cannot match string against . Provide a regex pattern or use the BeNull method."); @@ -802,7 +808,7 @@ public AndConstraint MatchRegex(Regex regularExpression, /// /// is . public AndConstraint NotMatchRegex([RegexPattern][StringSyntax("Regex")] string regularExpression, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(regularExpression, nameof(regularExpression), "Cannot match string against . Provide a regex pattern or use the NotBeNull method."); @@ -839,7 +845,8 @@ public AndConstraint NotMatchRegex([RegexPattern][StringSyntax("Reg /// /// is . /// is empty. - public AndConstraint NotMatchRegex(Regex regularExpression, string because = "", params object[] becauseArgs) + public AndConstraint NotMatchRegex(Regex regularExpression, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(regularExpression, nameof(regularExpression), "Cannot match string against . Provide a regex pattern or use the NotBeNull method."); @@ -880,7 +887,8 @@ public AndConstraint NotMatchRegex(Regex regularExpression, string /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint StartWith(string expected, string because = "", params object[] becauseArgs) + public AndConstraint StartWith(string expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare start of string with ."); @@ -906,7 +914,8 @@ public AndConstraint StartWith(string expected, string because = "" /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotStartWith(string unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotStartWith(string unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare start of string with ."); @@ -940,7 +949,7 @@ public AndConstraint NotStartWith(string unexpected, string because /// /// is . public AndConstraint StartWithEquivalentOf(string expected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare string start equivalence with ."); @@ -970,7 +979,7 @@ public AndConstraint StartWithEquivalentOf(string expected, /// is . public AndConstraint StartWithEquivalentOf(string expected, Func, EquivalencyOptions> config, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare string start equivalence with ."); Guard.ThrowIfArgumentIsNull(config); @@ -1002,7 +1011,7 @@ public AndConstraint StartWithEquivalentOf(string expected, /// /// is . public AndConstraint NotStartWithEquivalentOf(string unexpected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare start of string with ."); @@ -1039,7 +1048,7 @@ public AndConstraint NotStartWithEquivalentOf(string unexpected, /// is . public AndConstraint NotStartWithEquivalentOf(string unexpected, Func, EquivalencyOptions> config, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare start of string with ."); Guard.ThrowIfArgumentIsNull(config); @@ -1073,7 +1082,8 @@ public AndConstraint NotStartWithEquivalentOf(string unexpected, /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint EndWith(string expected, string because = "", params object[] becauseArgs) + public AndConstraint EndWith(string expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare string end with ."); @@ -1099,7 +1109,8 @@ public AndConstraint EndWith(string expected, string because = "", /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotEndWith(string unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotEndWith(string unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare end of string with ."); @@ -1133,7 +1144,7 @@ public AndConstraint NotEndWith(string unexpected, string because = /// /// is . public AndConstraint EndWithEquivalentOf(string expected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare string end equivalence with ."); @@ -1163,7 +1174,7 @@ public AndConstraint EndWithEquivalentOf(string expected, /// is . public AndConstraint EndWithEquivalentOf(string expected, Func, EquivalencyOptions> config, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare string end equivalence with ."); Guard.ThrowIfArgumentIsNull(config); @@ -1195,7 +1206,7 @@ public AndConstraint EndWithEquivalentOf(string expected, /// /// is . public AndConstraint NotEndWithEquivalentOf(string unexpected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare end of string with ."); @@ -1232,7 +1243,7 @@ public AndConstraint NotEndWithEquivalentOf(string unexpected, /// is . public AndConstraint NotEndWithEquivalentOf(string unexpected, Func, EquivalencyOptions> config, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare end of string with ."); Guard.ThrowIfArgumentIsNull(config); @@ -1268,7 +1279,8 @@ public AndConstraint NotEndWithEquivalentOf(string unexpected, /// /// is . /// is empty. - public AndConstraint Contain(string expected, string because = "", params object[] becauseArgs) + public AndConstraint Contain(string expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert string containment against ."); Guard.ThrowIfArgumentIsEmpty(expected, nameof(expected), "Cannot assert string containment against an empty string."); @@ -1302,8 +1314,8 @@ public AndConstraint Contain(string expected, string because = "", /// /// is . /// is empty. - public AndConstraint Contain(string expected, OccurrenceConstraint occurrenceConstraint, string because = "", - params object[] becauseArgs) + public AndConstraint Contain(string expected, OccurrenceConstraint occurrenceConstraint, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert string containment against ."); Guard.ThrowIfArgumentIsEmpty(expected, nameof(expected), "Cannot assert string containment against an empty string."); @@ -1335,7 +1347,7 @@ public AndConstraint Contain(string expected, OccurrenceConstraint /// is . /// is empty. public AndConstraint ContainEquivalentOf(string expected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert string containment against ."); Guard.ThrowIfArgumentIsEmpty(expected, nameof(expected), "Cannot assert string containment against an empty string."); @@ -1367,7 +1379,7 @@ public AndConstraint ContainEquivalentOf(string expected, /// is empty. public AndConstraint ContainEquivalentOf(string expected, Func, EquivalencyOptions> config, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return ContainEquivalentOf(expected, AtLeast.Once(), config, because, becauseArgs); } @@ -1397,7 +1409,7 @@ public AndConstraint ContainEquivalentOf(string expected, public AndConstraint ContainEquivalentOf(string expected, OccurrenceConstraint occurrenceConstraint, Func, EquivalencyOptions> config, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert string containment against ."); Guard.ThrowIfArgumentIsEmpty(expected, nameof(expected), "Cannot assert string containment against an empty string."); @@ -1441,7 +1453,7 @@ public AndConstraint ContainEquivalentOf(string expected, /// is empty. public AndConstraint ContainEquivalentOf(string expected, OccurrenceConstraint occurrenceConstraint, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert string containment against ."); Guard.ThrowIfArgumentIsEmpty(expected, nameof(expected), "Cannot assert string containment against an empty string."); @@ -1469,7 +1481,8 @@ public AndConstraint ContainEquivalentOf(string expected, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint ContainAll(IEnumerable values, string because = "", params object[] becauseArgs) + public AndConstraint ContainAll(IEnumerable values, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { ThrowIfValuesNullOrEmpty(values); @@ -1507,7 +1520,8 @@ public AndConstraint ContainAll(params string[] values) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint ContainAny(IEnumerable values, string because = "", params object[] becauseArgs) + public AndConstraint ContainAny(IEnumerable values, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { ThrowIfValuesNullOrEmpty(values); @@ -1546,7 +1560,7 @@ public AndConstraint ContainAny(params string[] values) /// is . /// is empty. public AndConstraint NotContain(string unexpected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot assert string containment against ."); Guard.ThrowIfArgumentIsEmpty(unexpected, nameof(unexpected), "Cannot assert string containment against an empty string."); @@ -1573,8 +1587,8 @@ public AndConstraint NotContain(string unexpected, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotContainAll(IEnumerable values, string because = "", - params object[] becauseArgs) + public AndConstraint NotContainAll(IEnumerable values, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { ThrowIfValuesNullOrEmpty(values); @@ -1613,8 +1627,8 @@ public AndConstraint NotContainAll(params string[] values) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotContainAny(IEnumerable values, string because = "", - params object[] becauseArgs) + public AndConstraint NotContainAny(IEnumerable values, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { ThrowIfValuesNullOrEmpty(values); @@ -1652,7 +1666,7 @@ public AndConstraint NotContainAny(params string[] values) /// Zero or more objects to format using the placeholders in . /// public AndConstraint NotContainEquivalentOf(string unexpected, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!string.IsNullOrEmpty(unexpected) && Subject != null) @@ -1691,7 +1705,7 @@ public AndConstraint NotContainEquivalentOf(string unexpected, /// public AndConstraint NotContainEquivalentOf(string unexpected, Func, EquivalencyOptions> config, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -1726,7 +1740,7 @@ public AndConstraint NotContainEquivalentOf(string unexpected, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeEmpty(string because = "", params object[] becauseArgs) + public AndConstraint BeEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject?.Length == 0) @@ -1746,7 +1760,7 @@ public AndConstraint BeEmpty(string because = "", params object[] b /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) + public AndConstraint NotBeEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject is null || Subject.Length > 0) @@ -1767,7 +1781,8 @@ public AndConstraint NotBeEmpty(string because = "", params object[ /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveLength(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveLength(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -1796,7 +1811,7 @@ public AndConstraint HaveLength(int expected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeNullOrEmpty(string because = "", params object[] becauseArgs) + public AndConstraint NotBeNullOrEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!string.IsNullOrEmpty(Subject)) @@ -1816,7 +1831,7 @@ public AndConstraint NotBeNullOrEmpty(string because = "", params o /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeNullOrEmpty(string because = "", params object[] becauseArgs) + public AndConstraint BeNullOrEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(string.IsNullOrEmpty(Subject)) @@ -1836,7 +1851,7 @@ public AndConstraint BeNullOrEmpty(string because = "", params obje /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeNullOrWhiteSpace(string because = "", params object[] becauseArgs) + public AndConstraint NotBeNullOrWhiteSpace([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!string.IsNullOrWhiteSpace(Subject)) @@ -1856,7 +1871,7 @@ public AndConstraint NotBeNullOrWhiteSpace(string because = "", par /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeNullOrWhiteSpace(string because = "", params object[] becauseArgs) + public AndConstraint BeNullOrWhiteSpace([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(string.IsNullOrWhiteSpace(Subject)) @@ -1881,7 +1896,7 @@ public AndConstraint BeNullOrWhiteSpace(string because = "", params /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeUpperCased(string because = "", params object[] becauseArgs) + public AndConstraint BeUpperCased([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject?.All(char.IsUpper) == true) @@ -1901,7 +1916,7 @@ public AndConstraint BeUpperCased(string because = "", params objec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeUpperCased(string because = "", params object[] becauseArgs) + public AndConstraint NotBeUpperCased([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject is null || Subject.Any(ch => !char.IsUpper(ch))) @@ -1926,7 +1941,7 @@ public AndConstraint NotBeUpperCased(string because = "", params ob /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeLowerCased(string because = "", params object[] becauseArgs) + public AndConstraint BeLowerCased([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject?.All(char.IsLower) == true) @@ -1946,7 +1961,7 @@ public AndConstraint BeLowerCased(string because = "", params objec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeLowerCased(string because = "", params object[] becauseArgs) + public AndConstraint NotBeLowerCased([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject is null || Subject.Any(ch => !char.IsLower(ch))) @@ -1958,7 +1973,7 @@ public AndConstraint NotBeLowerCased(string because = "", params ob internal AndConstraint Be(string expected, Func, EquivalencyOptions> config, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); diff --git a/Src/FluentAssertions/Primitives/StringValidator.cs b/Src/FluentAssertions/Primitives/StringValidator.cs index 9bdd8f6c4f..8e7e49d7a0 100644 --- a/Src/FluentAssertions/Primitives/StringValidator.cs +++ b/Src/FluentAssertions/Primitives/StringValidator.cs @@ -1,3 +1,4 @@ +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -8,7 +9,7 @@ internal class StringValidator private readonly IStringComparisonStrategy comparisonStrategy; private IAssertionScope assertion; - public StringValidator(IStringComparisonStrategy comparisonStrategy, string because, object[] becauseArgs) + public StringValidator(IStringComparisonStrategy comparisonStrategy, [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { this.comparisonStrategy = comparisonStrategy; assertion = Execute.Assertion.BecauseOf(because, becauseArgs); diff --git a/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs b/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs index 03a4699378..deaf451a21 100644 --- a/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs +++ b/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs @@ -1,3 +1,4 @@ +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -8,7 +9,7 @@ internal class StringValidatorSupportingNull private readonly IStringComparisonStrategy comparisonStrategy; private IAssertionScope assertion; - public StringValidatorSupportingNull(IStringComparisonStrategy comparisonStrategy, string because, object[] becauseArgs) + public StringValidatorSupportingNull(IStringComparisonStrategy comparisonStrategy, [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { this.comparisonStrategy = comparisonStrategy; assertion = Execute.Assertion.BecauseOf(because, becauseArgs); diff --git a/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs b/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs index 533d741b5f..ce959601fe 100644 --- a/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -51,7 +52,8 @@ public TimeOnlyAssertions(TimeOnly? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(TimeOnly expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(TimeOnly expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject == expected) @@ -73,7 +75,8 @@ public AndConstraint Be(TimeOnly expected, string because = "", par /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(TimeOnly? expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(TimeOnly? expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject == expected) @@ -95,8 +98,8 @@ public AndConstraint Be(TimeOnly? expected, string because = "", pa /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(TimeOnly unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBe(TimeOnly unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject != unexpected) @@ -117,8 +120,8 @@ public AndConstraint NotBe(TimeOnly unexpected, string because = "" /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(TimeOnly? unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBe(TimeOnly? unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject != unexpected) @@ -146,8 +149,8 @@ public AndConstraint NotBe(TimeOnly? unexpected, string because = " /// Zero or more objects to format using the placeholders in . /// /// is negative. - public AndConstraint BeCloseTo(TimeOnly nearbyTime, TimeSpan precision, string because = "", - params object[] becauseArgs) + public AndConstraint BeCloseTo(TimeOnly nearbyTime, TimeSpan precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -195,8 +198,8 @@ public AndConstraint BeCloseTo(TimeOnly nearbyTime, TimeSpan precis /// Zero or more objects to format using the placeholders in . /// /// is negative. - public AndConstraint NotBeCloseTo(TimeOnly distantTime, TimeSpan precision, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeCloseTo(TimeOnly distantTime, TimeSpan precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); @@ -225,8 +228,8 @@ public AndConstraint NotBeCloseTo(TimeOnly distantTime, TimeSpan pr /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeBefore(TimeOnly expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeBefore(TimeOnly expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject < expected) @@ -248,8 +251,8 @@ public AndConstraint BeBefore(TimeOnly expected, string because = " /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeBefore(TimeOnly unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeBefore(TimeOnly unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeOnOrAfter(unexpected, because, becauseArgs); } @@ -265,8 +268,8 @@ public AndConstraint NotBeBefore(TimeOnly unexpected, string becaus /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOnOrBefore(TimeOnly expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeOnOrBefore(TimeOnly expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject <= expected) @@ -288,8 +291,8 @@ public AndConstraint BeOnOrBefore(TimeOnly expected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeOnOrBefore(TimeOnly unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeOnOrBefore(TimeOnly unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeAfter(unexpected, because, becauseArgs); } @@ -305,8 +308,8 @@ public AndConstraint NotBeOnOrBefore(TimeOnly unexpected, string be /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeAfter(TimeOnly expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeAfter(TimeOnly expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject > expected) @@ -328,8 +331,8 @@ public AndConstraint BeAfter(TimeOnly expected, string because = "" /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeAfter(TimeOnly unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeAfter(TimeOnly unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeOnOrBefore(unexpected, because, becauseArgs); } @@ -345,8 +348,8 @@ public AndConstraint NotBeAfter(TimeOnly unexpected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOnOrAfter(TimeOnly expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeOnOrAfter(TimeOnly expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject >= expected) @@ -368,8 +371,8 @@ public AndConstraint BeOnOrAfter(TimeOnly expected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeOnOrAfter(TimeOnly unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeOnOrAfter(TimeOnly unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeBefore(unexpected, because, becauseArgs); } @@ -385,7 +388,8 @@ public AndConstraint NotBeOnOrAfter(TimeOnly unexpected, string bec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveHours(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveHours(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -412,7 +416,8 @@ public AndConstraint HaveHours(int expected, string because = "", p /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveHours(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveHours(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -438,7 +443,8 @@ public AndConstraint NotHaveHours(int unexpected, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveMinutes(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveMinutes(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -465,7 +471,8 @@ public AndConstraint HaveMinutes(int expected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveMinutes(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveMinutes(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -492,7 +499,8 @@ public AndConstraint NotHaveMinutes(int unexpected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveSeconds(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveSeconds(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -519,7 +527,8 @@ public AndConstraint HaveSeconds(int expected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveSeconds(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveSeconds(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -546,7 +555,8 @@ public AndConstraint NotHaveSeconds(int unexpected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveMilliseconds(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveMilliseconds(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -573,7 +583,8 @@ public AndConstraint HaveMilliseconds(int expected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveMilliseconds(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveMilliseconds(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -624,7 +635,8 @@ public AndConstraint BeOneOf(params TimeOnly[] validValues) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOneOf(IEnumerable validValues, string because = "", params object[] becauseArgs) + public AndConstraint BeOneOf(IEnumerable validValues, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeOneOf(validValues.Cast(), because, becauseArgs); } @@ -642,8 +654,8 @@ public AndConstraint BeOneOf(IEnumerable validValues, str /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOneOf(IEnumerable validValues, string because = "", - params object[] becauseArgs) + public AndConstraint BeOneOf(IEnumerable validValues, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(validValues.Contains(Subject)) diff --git a/Src/FluentAssertions/Specialized/ActionAssertions.cs b/Src/FluentAssertions/Specialized/ActionAssertions.cs index 0511ac5604..0051f0dee8 100644 --- a/Src/FluentAssertions/Specialized/ActionAssertions.cs +++ b/Src/FluentAssertions/Specialized/ActionAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -31,7 +32,7 @@ public ActionAssertions(Action subject, IExtractExceptions extractor, IClock clo /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotThrow(string because = "", params object[] becauseArgs) + public AndConstraint NotThrow([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(Subject is not null) @@ -71,8 +72,8 @@ public AndConstraint NotThrow(string because = "", params obje /// Zero or more objects to format using the placeholders in . /// /// or are negative. - public AndConstraint NotThrowAfter(TimeSpan waitTime, TimeSpan pollInterval, string because = "", - params object[] becauseArgs) + public AndConstraint NotThrowAfter(TimeSpan waitTime, TimeSpan pollInterval, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(waitTime); Guard.ThrowIfArgumentIsNegative(pollInterval); diff --git a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs index a47c773ab7..30791f52a2 100644 --- a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -36,8 +37,8 @@ protected AsyncFunctionAssertions(Func subject, IExtractExceptions extrac /// /// Zero or more objects to format using the placeholders in . /// - public async Task> NotCompleteWithinAsync( - TimeSpan timeSpan, string because = "", params object[] becauseArgs) + public async Task> NotCompleteWithinAsync(TimeSpan timeSpan, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(Subject is not null) @@ -76,8 +77,8 @@ public async Task> NotCompleteWithinAsync( /// /// Returns an object that allows asserting additional members of the thrown exception. /// - public async Task> ThrowExactlyAsync(string because = "", - params object[] becauseArgs) + public async Task> ThrowExactlyAsync( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception { Type expectedType = typeof(TException); @@ -118,8 +119,8 @@ public async Task> ThrowExactlyAsync /// /// Zero or more objects to format using the placeholders in . /// - public async Task> ThrowAsync(string because = "", - params object[] becauseArgs) + public async Task> ThrowAsync( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception { bool success = Execute.Assertion @@ -149,8 +150,8 @@ public async Task> ThrowAsync(string /// /// Zero or more objects to format using the placeholders in . /// - public async Task> ThrowWithinAsync( - TimeSpan timeSpan, string because = "", params object[] becauseArgs) + public async Task> ThrowWithinAsync(TimeSpan timeSpan, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception { bool success = Execute.Assertion @@ -169,7 +170,8 @@ public async Task> ThrowWithinAsync( } private ExceptionAssertions AssertThrows( - Exception exception, TimeSpan timeSpan, string because, object[] becauseArgs) + Exception exception, TimeSpan timeSpan, + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) where TException : Exception { TException[] expectedExceptions = Extractor.OfType(exception).ToArray(); @@ -246,7 +248,7 @@ private async Task InvokeWithInterceptionAsync(TimeSpan timeout) /// /// Zero or more objects to format using the placeholders in . /// - public async Task> NotThrowAsync(string because = "", params object[] becauseArgs) + public async Task> NotThrowAsync([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception { bool success = Execute.Assertion diff --git a/Src/FluentAssertions/Specialized/DelegateAssertions.cs b/Src/FluentAssertions/Specialized/DelegateAssertions.cs index 240983b9d9..a8084e3255 100644 --- a/Src/FluentAssertions/Specialized/DelegateAssertions.cs +++ b/Src/FluentAssertions/Specialized/DelegateAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Runtime.CompilerServices; using FluentAssertions.Common; @@ -35,7 +36,7 @@ private protected DelegateAssertions(TDelegate @delegate, IExtractExceptions ext /// /// Zero or more objects to format using the placeholders in . /// - public ExceptionAssertions Throw(string because = "", params object[] becauseArgs) + public ExceptionAssertions Throw([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception { bool success = Execute.Assertion @@ -63,7 +64,7 @@ public ExceptionAssertions Throw(string because = "", pa /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotThrow(string because = "", params object[] becauseArgs) + public AndConstraint NotThrow([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception { bool success = Execute.Assertion @@ -97,7 +98,7 @@ public AndConstraint NotThrow(string because = "", para /// /// Returns an object that allows asserting additional members of the thrown exception. /// - public ExceptionAssertions ThrowExactly(string because = "", + public ExceptionAssertions ThrowExactly([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception { diff --git a/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs b/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs index 878a82ed7b..77b687f54e 100644 --- a/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs +++ b/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -29,7 +30,8 @@ private protected DelegateAssertionsBase(TDelegate @delegate, IExtractExceptions private protected IClock Clock { get; } protected ExceptionAssertions ThrowInternal( - Exception exception, string because, object[] becauseArgs) + Exception exception, + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) where TException : Exception { TException[] expectedExceptions = Extractor.OfType(exception).ToArray(); @@ -50,7 +52,7 @@ protected ExceptionAssertions ThrowInternal( return new ExceptionAssertions(expectedExceptions); } - protected AndConstraint NotThrowInternal(Exception exception, string because, object[] becauseArgs) + protected AndConstraint NotThrowInternal(Exception exception, [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { Execute.Assertion .ForCondition(exception is null) @@ -60,7 +62,7 @@ protected AndConstraint NotThrowInternal(Exception exception, strin return new AndConstraint((TAssertions)this); } - protected AndConstraint NotThrowInternal(Exception exception, string because, object[] becauseArgs) + protected AndConstraint NotThrowInternal(Exception exception, [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) where TException : Exception { IEnumerable exceptions = Extractor.OfType(exception); diff --git a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs index 90c0957002..c929bc330a 100644 --- a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Linq.Expressions; using FluentAssertions.Common; @@ -71,8 +72,8 @@ public ExceptionAssertions(IEnumerable exceptions) /// /// /// - public virtual ExceptionAssertions WithMessage(string expectedWildcardPattern, string because = "", - params object[] becauseArgs) + public virtual ExceptionAssertions WithMessage(string expectedWildcardPattern, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { AssertionScope assertion = Execute.Assertion.BecauseOf(because, becauseArgs).UsingLineBreaks; @@ -97,8 +98,8 @@ public virtual ExceptionAssertions WithMessage(string expectedWildca /// /// Zero or more objects to format using the placeholders in . /// - public virtual ExceptionAssertions WithInnerException(string because = "", - params object[] becauseArgs) + public virtual ExceptionAssertions WithInnerException( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TInnerException : Exception { var expectedInnerExceptions = AssertInnerExceptions(typeof(TInnerException), because, becauseArgs); @@ -116,8 +117,8 @@ public virtual ExceptionAssertions WithInnerException /// Zero or more objects to format using the placeholders in . /// - public ExceptionAssertions WithInnerException(Type innerException, string because = "", - params object[] becauseArgs) + public ExceptionAssertions WithInnerException(Type innerException, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(innerException); @@ -135,7 +136,7 @@ public ExceptionAssertions WithInnerException(Type innerException, st /// /// Zero or more objects to format using the placeholders in . /// - public virtual ExceptionAssertions WithInnerExceptionExactly(string because = "", + public virtual ExceptionAssertions WithInnerExceptionExactly([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TInnerException : Exception { @@ -154,8 +155,8 @@ public virtual ExceptionAssertions WithInnerExceptionExactly /// Zero or more objects to format using the placeholders in . /// - public ExceptionAssertions WithInnerExceptionExactly(Type innerException, string because = "", - params object[] becauseArgs) + public ExceptionAssertions WithInnerExceptionExactly(Type innerException, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(innerException); @@ -177,7 +178,7 @@ public ExceptionAssertions WithInnerExceptionExactly(Type innerExcept /// /// is . public ExceptionAssertions Where(Expression> exceptionExpression, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(exceptionExpression); @@ -193,8 +194,8 @@ public ExceptionAssertions Where(Expression> return this; } - private IEnumerable AssertInnerExceptionExactly(Type innerException, string because = "", - params object[] becauseArgs) + private IEnumerable AssertInnerExceptionExactly(Type innerException, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -213,8 +214,8 @@ private IEnumerable AssertInnerExceptionExactly(Type innerException, return expectedExceptions; } - private IEnumerable AssertInnerExceptions(Type innerException, string because = "", - params object[] becauseArgs) + private IEnumerable AssertInnerExceptions(Type innerException, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -262,7 +263,7 @@ private static class ExceptionMessageAssertion { private const string Context = "exception message"; - public static void Execute(IEnumerable messages, string expectation, string because, params object[] becauseArgs) + public static void Execute(IEnumerable messages, string expectation, [StringSyntax("CompositeFormat")] string because, params object[] becauseArgs) { using var _ = new AssertionScope(); var results = new AssertionResultSet(); diff --git a/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs b/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs index 8d3a148195..1c63fcc35a 100644 --- a/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -68,8 +69,8 @@ public ExecutionTimeAssertions(ExecutionTime executionTime) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeLessThanOrEqualTo(TimeSpan maxDuration, string because = "", - params object[] becauseArgs) + public AndConstraint BeLessThanOrEqualTo(TimeSpan maxDuration, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { (bool isRunning, TimeSpan elapsed) = PollUntil(duration => duration <= maxDuration, expectedResult: false, rate: maxDuration); @@ -99,8 +100,8 @@ public AndConstraint BeLessThanOrEqualTo(TimeSpan maxDu /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeLessThan(TimeSpan maxDuration, string because = "", - params object[] becauseArgs) + public AndConstraint BeLessThan(TimeSpan maxDuration, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { (bool isRunning, TimeSpan elapsed) = PollUntil(duration => duration < maxDuration, expectedResult: false, rate: maxDuration); @@ -129,8 +130,8 @@ public AndConstraint BeLessThan(TimeSpan maxDuration, s /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeGreaterThanOrEqualTo(TimeSpan minDuration, string because = "", - params object[] becauseArgs) + public AndConstraint BeGreaterThanOrEqualTo(TimeSpan minDuration, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { (bool isRunning, TimeSpan elapsed) = PollUntil(duration => duration >= minDuration, expectedResult: true, rate: minDuration); @@ -160,8 +161,8 @@ public AndConstraint BeGreaterThanOrEqualTo(TimeSpan mi /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeGreaterThan(TimeSpan minDuration, string because = "", - params object[] becauseArgs) + public AndConstraint BeGreaterThan(TimeSpan minDuration, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { (bool isRunning, TimeSpan elapsed) = PollUntil(duration => duration > minDuration, expectedResult: true, rate: minDuration); @@ -195,8 +196,8 @@ public AndConstraint BeGreaterThan(TimeSpan minDuration /// Zero or more objects to format using the placeholders in . /// /// is negative. - public AndConstraint BeCloseTo(TimeSpan expectedDuration, TimeSpan precision, string because = "", - params object[] becauseArgs) + public AndConstraint BeCloseTo(TimeSpan expectedDuration, TimeSpan precision, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(precision); diff --git a/Src/FluentAssertions/Specialized/FunctionAssertionHelpers.cs b/Src/FluentAssertions/Specialized/FunctionAssertionHelpers.cs index 968e6c54a4..28c4e0983f 100644 --- a/Src/FluentAssertions/Specialized/FunctionAssertionHelpers.cs +++ b/Src/FluentAssertions/Specialized/FunctionAssertionHelpers.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -6,7 +7,7 @@ namespace FluentAssertions.Specialized; internal static class FunctionAssertionHelpers { - internal static T NotThrow(Func subject, string because, object[] becauseArgs) + internal static T NotThrow(Func subject, [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { try { @@ -23,7 +24,7 @@ internal static T NotThrow(Func subject, string because, object[] becauseA } internal static TResult NotThrowAfter(Func subject, IClock clock, TimeSpan waitTime, TimeSpan pollInterval, - string because, object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(waitTime); Guard.ThrowIfArgumentIsNegative(pollInterval); diff --git a/Src/FluentAssertions/Specialized/FunctionAssertions.cs b/Src/FluentAssertions/Specialized/FunctionAssertions.cs index b51e82ac74..011b961165 100644 --- a/Src/FluentAssertions/Specialized/FunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/FunctionAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -38,7 +39,7 @@ protected override void InvokeSubject() /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint, T> NotThrow(string because = "", params object[] becauseArgs) + public AndWhichConstraint, T> NotThrow([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(Subject is not null) @@ -79,7 +80,7 @@ public AndWhichConstraint, T> NotThrow(string because = "" /// /// or are negative. public AndWhichConstraint, T> NotThrowAfter(TimeSpan waitTime, TimeSpan pollInterval, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(Subject is not null) diff --git a/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs index 0e5eaad07d..109d1918b3 100644 --- a/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using FluentAssertions.Common; @@ -41,7 +42,7 @@ public GenericAsyncFunctionAssertions(Func> subject, IExtractExcep /// Zero or more objects to format using the placeholders in . /// public async Task, TResult>> CompleteWithinAsync( - TimeSpan timeSpan, string because = "", params object[] becauseArgs) + TimeSpan timeSpan, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(Subject is not null) @@ -87,7 +88,7 @@ public async Task, TR /// Zero or more objects to format using the placeholders in . /// public async Task, TResult>> NotThrowAsync( - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(Subject is not null) @@ -134,7 +135,7 @@ public async Task, TR /// /// or are negative. public Task, TResult>> NotThrowAfterAsync( - TimeSpan waitTime, TimeSpan pollInterval, string because = "", params object[] becauseArgs) + TimeSpan waitTime, TimeSpan pollInterval, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(waitTime); Guard.ThrowIfArgumentIsNegative(pollInterval); diff --git a/Src/FluentAssertions/Specialized/NonGenericAsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/NonGenericAsyncFunctionAssertions.cs index 619e287bfb..91f2b85022 100644 --- a/Src/FluentAssertions/Specialized/NonGenericAsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/NonGenericAsyncFunctionAssertions.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using FluentAssertions.Common; @@ -39,7 +40,7 @@ public NonGenericAsyncFunctionAssertions(Func subject, IExtractExceptions /// Zero or more objects to format using the placeholders in . /// public async Task> CompleteWithinAsync( - TimeSpan timeSpan, string because = "", params object[] becauseArgs) + TimeSpan timeSpan, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(Subject is not null) @@ -79,7 +80,8 @@ public async Task> CompleteWith /// /// Zero or more objects to format using the placeholders in . /// - public async Task> NotThrowAsync(string because = "", params object[] becauseArgs) + public async Task> NotThrowAsync( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(Subject is not null) @@ -124,8 +126,8 @@ public async Task> NotThrowAsyn /// Zero or more objects to format using the placeholders in . /// /// or are negative. - public Task> NotThrowAfterAsync(TimeSpan waitTime, TimeSpan pollInterval, string because = "", - params object[] becauseArgs) + public Task> NotThrowAfterAsync(TimeSpan waitTime, TimeSpan pollInterval, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(waitTime); Guard.ThrowIfArgumentIsNegative(pollInterval); diff --git a/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs b/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs index 7853d6aa1b..a79d9d5cf2 100644 --- a/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs +++ b/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -36,7 +37,7 @@ public TaskCompletionSourceAssertions(TaskCompletionSource tcs, IClock clock) /// Zero or more objects to format using the placeholders in . /// public async Task> CompleteWithinAsync( - TimeSpan timeSpan, string because = "", params object[] becauseArgs) + TimeSpan timeSpan, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var success = Execute.Assertion .ForCondition(subject is not null) @@ -67,7 +68,7 @@ public async Task> CompleteWithinA /// Zero or more objects to format using the placeholders in . /// public async Task> NotCompleteWithinAsync( - TimeSpan timeSpan, string because = "", params object[] becauseArgs) + TimeSpan timeSpan, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var success = Execute.Assertion .ForCondition(subject is not null) @@ -115,7 +116,7 @@ public TaskCompletionSourceAssertions(TaskCompletionSource tcs, IClock clock) /// Zero or more objects to format using the placeholders in . /// public async Task, T>> CompleteWithinAsync( - TimeSpan timeSpan, string because = "", params object[] becauseArgs) + TimeSpan timeSpan, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var success = Execute.Assertion .ForCondition(subject is not null) @@ -152,7 +153,7 @@ public async Task, T>> Comp /// Zero or more objects to format using the placeholders in . /// public async Task>> NotCompleteWithinAsync( - TimeSpan timeSpan, string because = "", params object[] becauseArgs) + TimeSpan timeSpan, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var success = Execute.Assertion .ForCondition(subject is not null) diff --git a/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs b/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs index 82d9b8bf67..70ce652d07 100644 --- a/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs +++ b/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs @@ -1,6 +1,7 @@ using System.Diagnostics; using System.IO; #if NET6_0_OR_GREATER || NETSTANDARD2_1 +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; #endif @@ -41,7 +42,8 @@ public BufferedStreamAssertions(BufferedStream stream) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveBufferSize(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveBufferSize(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -72,7 +74,8 @@ public AndConstraint HaveBufferSize(int expected, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveBufferSize(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveBufferSize(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) diff --git a/Src/FluentAssertions/Streams/StreamAssertions.cs b/Src/FluentAssertions/Streams/StreamAssertions.cs index a31355377e..7b61dd41f8 100644 --- a/Src/FluentAssertions/Streams/StreamAssertions.cs +++ b/Src/FluentAssertions/Streams/StreamAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.IO; using FluentAssertions.Execution; using FluentAssertions.Primitives; @@ -42,7 +43,7 @@ public StreamAssertions(TSubject stream) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeWritable(string because = "", params object[] becauseArgs) + public AndConstraint BeWritable([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -70,7 +71,7 @@ public AndConstraint BeWritable(string because = "", params object[ /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeWritable(string because = "", params object[] becauseArgs) + public AndConstraint NotBeWritable([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -98,7 +99,7 @@ public AndConstraint NotBeWritable(string because = "", params obje /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeSeekable(string because = "", params object[] becauseArgs) + public AndConstraint BeSeekable([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -126,7 +127,7 @@ public AndConstraint BeSeekable(string because = "", params object[ /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeSeekable(string because = "", params object[] becauseArgs) + public AndConstraint NotBeSeekable([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -154,7 +155,7 @@ public AndConstraint NotBeSeekable(string because = "", params obje /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeReadable(string because = "", params object[] becauseArgs) + public AndConstraint BeReadable([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -182,7 +183,7 @@ public AndConstraint BeReadable(string because = "", params object[ /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeReadable(string because = "", params object[] becauseArgs) + public AndConstraint NotBeReadable([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -211,7 +212,8 @@ public AndConstraint NotBeReadable(string because = "", params obje /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HavePosition(long expected, string because = "", params object[] becauseArgs) + public AndConstraint HavePosition(long expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -260,7 +262,8 @@ public AndConstraint HavePosition(long expected, string because = " /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHavePosition(long unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHavePosition(long unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -309,7 +312,8 @@ public AndConstraint NotHavePosition(long unexpected, string becaus /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveLength(long expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveLength(long expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -358,7 +362,8 @@ public AndConstraint HaveLength(long expected, string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveLength(long unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveLength(long unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -406,7 +411,7 @@ public AndConstraint NotHaveLength(long unexpected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeReadOnly(string because = "", params object[] becauseArgs) + public AndConstraint BeReadOnly([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -434,7 +439,7 @@ public AndConstraint BeReadOnly(string because = "", params object[ /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeReadOnly(string because = "", params object[] becauseArgs) + public AndConstraint NotBeReadOnly([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -462,7 +467,7 @@ public AndConstraint NotBeReadOnly(string because = "", params obje /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeWriteOnly(string because = "", params object[] becauseArgs) + public AndConstraint BeWriteOnly([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -490,7 +495,7 @@ public AndConstraint BeWriteOnly(string because = "", params object /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeWriteOnly(string because = "", params object[] becauseArgs) + public AndConstraint NotBeWriteOnly([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) diff --git a/Src/FluentAssertions/Types/AssemblyAssertions.cs b/Src/FluentAssertions/Types/AssemblyAssertions.cs index 2285e48f25..91e170fa67 100644 --- a/Src/FluentAssertions/Types/AssemblyAssertions.cs +++ b/Src/FluentAssertions/Types/AssemblyAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; using FluentAssertions.Common; @@ -33,7 +34,8 @@ public AssemblyAssertions(Assembly assembly) /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotReference(Assembly assembly, string because = "", params object[] becauseArgs) + public AndConstraint NotReference(Assembly assembly, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(assembly); @@ -72,7 +74,8 @@ public AndConstraint NotReference(Assembly assembly, string /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint Reference(Assembly assembly, string because = "", params object[] becauseArgs) + public AndConstraint Reference(Assembly assembly, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(assembly); @@ -112,8 +115,8 @@ public AndConstraint Reference(Assembly assembly, string bec /// /// is . /// is empty. - public AndWhichConstraint DefineType(string @namespace, string name, string because = "", - params object[] becauseArgs) + public AndWhichConstraint DefineType(string @namespace, string name, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNullOrEmpty(name); @@ -147,7 +150,7 @@ public AndWhichConstraint DefineType(string @namespace /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) + public AndConstraint BeUnsigned([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .ForCondition(Subject is not null) @@ -178,7 +181,7 @@ public AndConstraint BeUnsigned(string because = "", params /// /// is . /// is empty. - public AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) + public AndConstraint BeSignedWithPublicKey(string publicKey, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNullOrEmpty(publicKey); diff --git a/Src/FluentAssertions/Types/MemberInfoAssertions.cs b/Src/FluentAssertions/Types/MemberInfoAssertions.cs index c39940b663..082e9de153 100644 --- a/Src/FluentAssertions/Types/MemberInfoAssertions.cs +++ b/Src/FluentAssertions/Types/MemberInfoAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Linq.Expressions; using System.Reflection; @@ -34,7 +35,7 @@ protected MemberInfoAssertions(TSubject subject) /// Zero or more objects to format using the placeholders in . /// public AndWhichConstraint, TAttribute> BeDecoratedWith( - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { return BeDecoratedWith(_ => true, because, becauseArgs); @@ -51,7 +52,7 @@ public AndWhichConstraint, TAttribut /// Zero or more objects to format using the placeholders in . /// public AndConstraint NotBeDecoratedWith( - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { return NotBeDecoratedWith(_ => true, because, becauseArgs); @@ -74,7 +75,7 @@ public AndConstraint NotBeDecoratedWith( /// is . public AndWhichConstraint, TAttribute> BeDecoratedWith( Expression> isMatchingAttributePredicate, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Guard.ThrowIfArgumentIsNull(isMatchingAttributePredicate); @@ -120,7 +121,7 @@ public AndWhichConstraint, TAttribut /// is . public AndConstraint NotBeDecoratedWith( Expression> isMatchingAttributePredicate, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Guard.ThrowIfArgumentIsNull(isMatchingAttributePredicate); diff --git a/Src/FluentAssertions/Types/MethodBaseAssertions.cs b/Src/FluentAssertions/Types/MethodBaseAssertions.cs index fd92a50dc9..c45591c3c6 100644 --- a/Src/FluentAssertions/Types/MethodBaseAssertions.cs +++ b/Src/FluentAssertions/Types/MethodBaseAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; using FluentAssertions.Common; @@ -35,7 +36,8 @@ protected MethodBaseAssertions(TSubject subject) /// /// is not a value. public AndConstraint HaveAccessModifier( - CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) + CSharpAccessModifier accessModifier, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsOutOfRange(accessModifier); @@ -71,8 +73,8 @@ public AndConstraint HaveAccessModifier( /// /// /// is not a value. - public AndConstraint NotHaveAccessModifier(CSharpAccessModifier accessModifier, string because = "", - params object[] becauseArgs) + public AndConstraint NotHaveAccessModifier(CSharpAccessModifier accessModifier, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsOutOfRange(accessModifier); diff --git a/Src/FluentAssertions/Types/MethodInfoAssertions.cs b/Src/FluentAssertions/Types/MethodInfoAssertions.cs index 6d5cfde4f1..c4dff054eb 100644 --- a/Src/FluentAssertions/Types/MethodInfoAssertions.cs +++ b/Src/FluentAssertions/Types/MethodInfoAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Reflection; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -27,7 +28,7 @@ public MethodInfoAssertions(MethodInfo methodInfo) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeVirtual(string because = "", params object[] becauseArgs) + public AndConstraint BeVirtual([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -55,7 +56,7 @@ public AndConstraint BeVirtual(string because = "", params /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) + public AndConstraint NotBeVirtual([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -83,7 +84,7 @@ public AndConstraint NotBeVirtual(string because = "", par /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeAsync(string because = "", params object[] becauseArgs) + public AndConstraint BeAsync([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -111,7 +112,7 @@ public AndConstraint BeAsync(string because = "", params o /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeAsync(string because = "", params object[] becauseArgs) + public AndConstraint NotBeAsync([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -139,8 +140,8 @@ public AndConstraint NotBeAsync(string because = "", param /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint> ReturnVoid(string because = "", - params object[] becauseArgs) + public AndConstraint> ReturnVoid( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -171,8 +172,8 @@ public AndConstraint> Ret /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint> Return(Type returnType, string because = "", - params object[] becauseArgs) + public AndConstraint> Return(Type returnType, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(returnType); @@ -204,8 +205,8 @@ public AndConstraint> Ret /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint> Return(string because = "", - params object[] becauseArgs) + public AndConstraint> Return( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return Return(typeof(TReturn), because, becauseArgs); } @@ -220,8 +221,8 @@ public AndConstraint> Ret /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint> NotReturnVoid(string because = "", - params object[] becauseArgs) + public AndConstraint> NotReturnVoid( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -251,8 +252,8 @@ public AndConstraint> Not /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint> NotReturn(Type returnType, string because = "", - params object[] becauseArgs) + public AndConstraint> NotReturn(Type returnType, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(returnType); @@ -285,8 +286,8 @@ public AndConstraint> Not /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint> NotReturn(string because = "", - params object[] becauseArgs) + public AndConstraint> NotReturn( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotReturn(typeof(TReturn), because, becauseArgs); } diff --git a/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs b/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs index f7f0b2f37b..dfc2effa49 100644 --- a/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs +++ b/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Linq.Expressions; using System.Reflection; @@ -44,7 +45,7 @@ public MethodInfoSelectorAssertions(params MethodInfo[] methods) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeVirtual(string because = "", params object[] becauseArgs) + public AndConstraint BeVirtual([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { MethodInfo[] nonVirtualMethods = GetAllNonVirtualMethodsFromSelection(); @@ -71,7 +72,7 @@ public AndConstraint BeVirtual(string because = "" /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) + public AndConstraint NotBeVirtual([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { MethodInfo[] virtualMethods = GetAllVirtualMethodsFromSelection(); @@ -108,7 +109,7 @@ private MethodInfo[] GetAllVirtualMethodsFromSelection() /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeAsync(string because = "", params object[] becauseArgs) + public AndConstraint BeAsync([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { MethodInfo[] nonAsyncMethods = SubjectMethods.Where(method => !method.IsAsync()).ToArray(); @@ -135,7 +136,7 @@ public AndConstraint BeAsync(string because = "", /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeAsync(string because = "", params object[] becauseArgs) + public AndConstraint NotBeAsync([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { MethodInfo[] asyncMethods = SubjectMethods.Where(method => method.IsAsync()).ToArray(); @@ -162,8 +163,8 @@ public AndConstraint NotBeAsync(string because = " /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeDecoratedWith(string because = "", - params object[] becauseArgs) + public AndConstraint BeDecoratedWith( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { return BeDecoratedWith(_ => true, because, becauseArgs); @@ -185,7 +186,8 @@ public AndConstraint BeDecoratedWith(s /// /// is . public AndConstraint BeDecoratedWith( - Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) + Expression> isMatchingAttributePredicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Guard.ThrowIfArgumentIsNull(isMatchingAttributePredicate); @@ -215,8 +217,8 @@ public AndConstraint BeDecoratedWith( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeDecoratedWith(string because = "", - params object[] becauseArgs) + public AndConstraint NotBeDecoratedWith( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { return NotBeDecoratedWith(_ => true, because, becauseArgs); @@ -238,7 +240,8 @@ public AndConstraint NotBeDecoratedWith /// is . public AndConstraint NotBeDecoratedWith( - Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) + Expression> isMatchingAttributePredicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Guard.ThrowIfArgumentIsNull(isMatchingAttributePredicate); @@ -269,8 +272,8 @@ public AndConstraint NotBeDecoratedWith /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(CSharpAccessModifier accessModifier, string because = "", - params object[] becauseArgs) + public AndConstraint Be(CSharpAccessModifier accessModifier, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var methods = SubjectMethods.Where(pi => pi.GetCSharpAccessModifier() != accessModifier).ToArray(); @@ -296,8 +299,8 @@ public AndConstraint Be(CSharpAccessModifier acces /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(CSharpAccessModifier accessModifier, string because = "", - params object[] becauseArgs) + public AndConstraint NotBe(CSharpAccessModifier accessModifier, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var methods = SubjectMethods.Where(pi => pi.GetCSharpAccessModifier() == accessModifier).ToArray(); diff --git a/Src/FluentAssertions/Types/PropertyInfoAssertions.cs b/Src/FluentAssertions/Types/PropertyInfoAssertions.cs index c7900b536f..0201ccde6b 100644 --- a/Src/FluentAssertions/Types/PropertyInfoAssertions.cs +++ b/Src/FluentAssertions/Types/PropertyInfoAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Reflection; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -28,7 +29,7 @@ public PropertyInfoAssertions(PropertyInfo propertyInfo) /// Zero or more objects to format using the placeholders in . /// public AndConstraint BeVirtual( - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -56,7 +57,7 @@ public AndConstraint BeVirtual( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) + public AndConstraint NotBeVirtual([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -85,7 +86,7 @@ public AndConstraint NotBeVirtual(string because = "", p /// Zero or more objects to format using the placeholders in . /// public AndConstraint BeWritable( - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -118,8 +119,8 @@ public AndConstraint BeWritable( /// /// /// is not a value. - public AndConstraint BeWritable(CSharpAccessModifier accessModifier, string because = "", - params object[] becauseArgs) + public AndConstraint BeWritable(CSharpAccessModifier accessModifier, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsOutOfRange(accessModifier); @@ -157,7 +158,7 @@ public AndConstraint BeWritable(CSharpAccessModifier acc /// Zero or more objects to format using the placeholders in . /// public AndConstraint NotBeWritable( - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -187,7 +188,7 @@ public AndConstraint NotBeWritable( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeReadable(string because = "", params object[] becauseArgs) + public AndConstraint BeReadable([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -217,8 +218,8 @@ public AndConstraint BeReadable(string because = "", par /// /// /// is not a value. - public AndConstraint BeReadable(CSharpAccessModifier accessModifier, string because = "", - params object[] becauseArgs) + public AndConstraint BeReadable(CSharpAccessModifier accessModifier, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsOutOfRange(accessModifier); @@ -253,7 +254,7 @@ public AndConstraint BeReadable(CSharpAccessModifier acc /// Zero or more objects to format using the placeholders in . /// public AndConstraint NotBeReadable( - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -286,7 +287,7 @@ public AndConstraint NotBeReadable( /// /// is . public AndConstraint Return(Type propertyType, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(propertyType); @@ -317,7 +318,7 @@ public AndConstraint Return(Type propertyType, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Return(string because = "", params object[] becauseArgs) + public AndConstraint Return([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return Return(typeof(TReturn), because, becauseArgs); } @@ -334,7 +335,8 @@ public AndConstraint Return(string because = "" /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotReturn(Type propertyType, string because = "", params object[] becauseArgs) + public AndConstraint NotReturn(Type propertyType, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(propertyType); @@ -365,7 +367,7 @@ public AndConstraint NotReturn(Type propertyType, string /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotReturn(string because = "", params object[] becauseArgs) + public AndConstraint NotReturn([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotReturn(typeof(TReturn), because, becauseArgs); } diff --git a/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs b/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs index 644652b364..6605f823e9 100644 --- a/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs +++ b/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; using FluentAssertions.Common; @@ -43,7 +44,7 @@ public PropertyInfoSelectorAssertions(params PropertyInfo[] properties) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeVirtual(string because = "", params object[] becauseArgs) + public AndConstraint BeVirtual([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { PropertyInfo[] nonVirtualProperties = GetAllNonVirtualPropertiesFromSelection(); @@ -67,7 +68,7 @@ public AndConstraint BeVirtual(string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeVirtual(string because = "", params object[] becauseArgs) + public AndConstraint NotBeVirtual([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { PropertyInfo[] virtualProperties = GetAllVirtualPropertiesFromSelection(); @@ -91,7 +92,7 @@ public AndConstraint NotBeVirtual(string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeWritable(string because = "", params object[] becauseArgs) + public AndConstraint BeWritable([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { PropertyInfo[] readOnlyProperties = GetAllReadOnlyPropertiesFromSelection(); @@ -115,7 +116,7 @@ public AndConstraint BeWritable(string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeWritable(string because = "", params object[] becauseArgs) + public AndConstraint NotBeWritable([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { PropertyInfo[] writableProperties = GetAllWritablePropertiesFromSelection(); @@ -159,8 +160,8 @@ private PropertyInfo[] GetAllVirtualPropertiesFromSelection() /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeDecoratedWith(string because = "", - params object[] becauseArgs) + public AndConstraint BeDecoratedWith( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { PropertyInfo[] propertiesWithoutAttribute = GetPropertiesWithout(); @@ -186,8 +187,8 @@ public AndConstraint BeDecoratedWith /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeDecoratedWith(string because = "", - params object[] becauseArgs) + public AndConstraint NotBeDecoratedWith( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { PropertyInfo[] propertiesWithAttribute = GetPropertiesWith(); diff --git a/Src/FluentAssertions/Types/TypeAssertions.cs b/Src/FluentAssertions/Types/TypeAssertions.cs index 6a5bf16c4a..45cf1618cc 100644 --- a/Src/FluentAssertions/Types/TypeAssertions.cs +++ b/Src/FluentAssertions/Types/TypeAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Linq.Expressions; using System.Reflection; @@ -34,7 +35,7 @@ public TypeAssertions(Type type) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(string because = "", params object[] becauseArgs) + public AndConstraint Be([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return Be(typeof(TExpected), because, becauseArgs); } @@ -50,7 +51,8 @@ public AndConstraint Be(string because = "", params o /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(Type expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(Type expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -72,7 +74,7 @@ public AndConstraint Be(Type expected, string because = "", para /// Zero or more objects to format using the placeholders in . /// /// An which can be used to chain assertions. - public new AndConstraint BeAssignableTo(string because = "", params object[] becauseArgs) + public new AndConstraint BeAssignableTo([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeAssignableTo(typeof(T), because, becauseArgs); } @@ -90,7 +92,8 @@ public AndConstraint Be(Type expected, string because = "", para /// /// An which can be used to chain assertions. /// is . - public new AndConstraint BeAssignableTo(Type type, string because = "", params object[] becauseArgs) + public new AndConstraint BeAssignableTo(Type type, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(type); @@ -118,7 +121,7 @@ public AndConstraint Be(Type expected, string because = "", para /// Zero or more objects to format using the placeholders in . /// /// An which can be used to chain assertions. - public new AndConstraint NotBeAssignableTo(string because = "", params object[] becauseArgs) + public new AndConstraint NotBeAssignableTo([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotBeAssignableTo(typeof(T), because, becauseArgs); } @@ -136,7 +139,8 @@ public AndConstraint Be(Type expected, string because = "", para /// /// An which can be used to chain assertions. /// is . - public new AndConstraint NotBeAssignableTo(Type type, string because = "", params object[] becauseArgs) + public new AndConstraint NotBeAssignableTo(Type type, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(type); @@ -189,7 +193,7 @@ private static string GetFailureMessageIfTypesAreDifferent(Type actual, Type exp /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(string because = "", params object[] becauseArgs) + public AndConstraint NotBe([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotBe(typeof(TUnexpected), because, becauseArgs); } @@ -205,7 +209,8 @@ public AndConstraint NotBe(string because = "", par /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(Type unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBe(Type unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { string nameOfUnexpectedType = unexpected is not null ? $"[{unexpected.AssemblyQualifiedName}]" : ""; @@ -228,7 +233,7 @@ public AndConstraint NotBe(Type unexpected, string because = "", /// Zero or more objects to format using the placeholders in . /// public AndWhichConstraint BeDecoratedWith( - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { IEnumerable attributes = Subject.GetMatchingAttributes(); @@ -258,7 +263,8 @@ public AndWhichConstraint BeDecoratedWith /// is . public AndWhichConstraint BeDecoratedWith( - Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) + Expression> isMatchingAttributePredicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Guard.ThrowIfArgumentIsNull(isMatchingAttributePredicate); @@ -288,7 +294,7 @@ public AndWhichConstraint BeDecoratedWith. /// public AndWhichConstraint BeDecoratedWithOrInherit( - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { IEnumerable attributes = Subject.GetMatchingOrInheritedAttributes(); @@ -318,7 +324,8 @@ public AndWhichConstraint BeDecoratedWithOrInherit /// is . public AndWhichConstraint BeDecoratedWithOrInherit( - Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) + Expression> isMatchingAttributePredicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Guard.ThrowIfArgumentIsNull(isMatchingAttributePredicate); @@ -347,7 +354,7 @@ public AndWhichConstraint BeDecoratedWithOrInherit /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) + public AndConstraint NotBeDecoratedWith([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Execute.Assertion @@ -375,7 +382,8 @@ public AndConstraint NotBeDecoratedWith(string becau /// /// is . public AndConstraint NotBeDecoratedWith( - Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) + Expression> isMatchingAttributePredicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Guard.ThrowIfArgumentIsNull(isMatchingAttributePredicate); @@ -402,7 +410,7 @@ public AndConstraint NotBeDecoratedWith( /// Zero or more objects to format using the placeholders in . /// public AndConstraint NotBeDecoratedWithOrInherit( - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Execute.Assertion @@ -431,7 +439,8 @@ public AndConstraint NotBeDecoratedWithOrInherit( /// /// is . public AndConstraint NotBeDecoratedWithOrInherit( - Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) + Expression> isMatchingAttributePredicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Guard.ThrowIfArgumentIsNull(isMatchingAttributePredicate); @@ -458,7 +467,8 @@ public AndConstraint NotBeDecoratedWithOrInherit( /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint Implement(Type interfaceType, string because = "", params object[] becauseArgs) + public AndConstraint Implement(Type interfaceType, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(interfaceType); @@ -467,7 +477,8 @@ public AndConstraint Implement(Type interfaceType, string becaus return new AndConstraint(this); } - private bool AssertSubjectImplements(Type interfaceType, string because = "", params object[] becauseArgs) + private bool AssertSubjectImplements(Type interfaceType, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool containsInterface = interfaceType.IsAssignableFrom(Subject) && interfaceType != Subject; @@ -494,7 +505,7 @@ private bool AssertSubjectImplements(Type interfaceType, string because = "", pa /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Implement(string because = "", params object[] becauseArgs) + public AndConstraint Implement([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TInterface : class { return Implement(typeof(TInterface), because, becauseArgs); @@ -512,7 +523,8 @@ public AndConstraint Implement(string because = "", /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotImplement(Type interfaceType, string because = "", params object[] becauseArgs) + public AndConstraint NotImplement(Type interfaceType, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(interfaceType); @@ -543,7 +555,7 @@ public AndConstraint NotImplement(Type interfaceType, string bec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotImplement(string because = "", params object[] becauseArgs) + public AndConstraint NotImplement([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TInterface : class { return NotImplement(typeof(TInterface), because, becauseArgs); @@ -561,7 +573,8 @@ public AndConstraint NotImplement(string because = " /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint BeDerivedFrom(Type baseType, string because = "", params object[] becauseArgs) + public AndConstraint BeDerivedFrom(Type baseType, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(baseType); @@ -594,7 +607,7 @@ public AndConstraint BeDerivedFrom(Type baseType, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeDerivedFrom(string because = "", params object[] becauseArgs) + public AndConstraint BeDerivedFrom([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TBaseClass : class { return BeDerivedFrom(typeof(TBaseClass), because, becauseArgs); @@ -612,7 +625,8 @@ public AndConstraint BeDerivedFrom(string because = /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotBeDerivedFrom(Type baseType, string because = "", params object[] becauseArgs) + public AndConstraint NotBeDerivedFrom(Type baseType, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(baseType); @@ -645,7 +659,7 @@ public AndConstraint NotBeDerivedFrom(Type baseType, string beca /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeDerivedFrom(string because = "", params object[] becauseArgs) + public AndConstraint NotBeDerivedFrom([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TBaseClass : class { return NotBeDerivedFrom(typeof(TBaseClass), because, becauseArgs); @@ -663,7 +677,7 @@ public AndConstraint NotBeDerivedFrom(string because /// /// /// is not a class. - public AndConstraint BeSealed(string because = "", params object[] becauseArgs) + public AndConstraint BeSealed([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -695,7 +709,7 @@ public AndConstraint BeSealed(string because = "", params object /// /// /// is not a class. - public AndConstraint NotBeSealed(string because = "", params object[] becauseArgs) + public AndConstraint NotBeSealed([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -727,7 +741,7 @@ public AndConstraint NotBeSealed(string because = "", params obj /// /// /// is not a class. - public AndConstraint BeAbstract(string because = "", params object[] becauseArgs) + public AndConstraint BeAbstract([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -759,7 +773,7 @@ public AndConstraint BeAbstract(string because = "", params obje /// /// /// is not a class. - public AndConstraint NotBeAbstract(string because = "", params object[] becauseArgs) + public AndConstraint NotBeAbstract([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -791,7 +805,7 @@ public AndConstraint NotBeAbstract(string because = "", params o /// /// /// is not a class. - public AndConstraint BeStatic(string because = "", params object[] becauseArgs) + public AndConstraint BeStatic([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -823,7 +837,7 @@ public AndConstraint BeStatic(string because = "", params object /// /// /// is not a class. - public AndConstraint NotBeStatic(string because = "", params object[] becauseArgs) + public AndConstraint NotBeStatic([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -860,7 +874,8 @@ public AndConstraint NotBeStatic(string because = "", params obj /// is . /// is empty. public AndWhichConstraint HaveProperty( - Type propertyType, string name, string because = "", params object[] becauseArgs) + Type propertyType, string name, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(propertyType); Guard.ThrowIfArgumentIsNullOrEmpty(name); @@ -906,7 +921,7 @@ public AndWhichConstraint HaveProperty( /// is . /// is empty. public AndWhichConstraint HaveProperty( - string name, string because = "", params object[] becauseArgs) + string name, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return HaveProperty(typeof(TProperty), name, because, becauseArgs); } @@ -924,7 +939,8 @@ public AndWhichConstraint HaveProperty( /// /// is . /// is empty. - public AndConstraint NotHaveProperty(string name, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveProperty(string name, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNullOrEmpty(name); @@ -964,7 +980,8 @@ public AndConstraint NotHaveProperty(string name, string because /// is . /// is empty. public AndConstraint HaveExplicitProperty( - Type interfaceType, string name, string because = "", params object[] becauseArgs) + Type interfaceType, string name, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(interfaceType); Guard.ThrowIfArgumentIsNullOrEmpty(name); @@ -1011,7 +1028,8 @@ public AndConstraint HaveExplicitProperty( /// is . /// is empty. public AndConstraint HaveExplicitProperty( - string name, string because = "", params object[] becauseArgs) + string name, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TInterface : class { return HaveExplicitProperty(typeof(TInterface), name, because, becauseArgs); @@ -1034,7 +1052,8 @@ public AndConstraint HaveExplicitProperty( /// is . /// is empty. public AndConstraint NotHaveExplicitProperty( - Type interfaceType, string name, string because = "", params object[] becauseArgs) + Type interfaceType, string name, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(interfaceType); Guard.ThrowIfArgumentIsNullOrEmpty(name); @@ -1082,7 +1101,8 @@ public AndConstraint NotHaveExplicitProperty( /// is . /// is empty. public AndConstraint NotHaveExplicitProperty( - string name, string because = "", params object[] becauseArgs) + string name, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TInterface : class { return NotHaveExplicitProperty(typeof(TInterface), name, because, becauseArgs); @@ -1107,7 +1127,8 @@ public AndConstraint NotHaveExplicitProperty( /// is empty. /// is . public AndConstraint HaveExplicitMethod( - Type interfaceType, string name, IEnumerable parameterTypes, string because = "", params object[] becauseArgs) + Type interfaceType, string name, IEnumerable parameterTypes, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(interfaceType); Guard.ThrowIfArgumentIsNullOrEmpty(name); @@ -1158,7 +1179,8 @@ public AndConstraint HaveExplicitMethod( /// is empty. /// is . public AndConstraint HaveExplicitMethod( - string name, IEnumerable parameterTypes, string because = "", params object[] becauseArgs) + string name, IEnumerable parameterTypes, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TInterface : class { return HaveExplicitMethod(typeof(TInterface), name, parameterTypes, because, becauseArgs); @@ -1183,7 +1205,8 @@ public AndConstraint HaveExplicitMethod( /// is empty. /// is . public AndConstraint NotHaveExplicitMethod( - Type interfaceType, string name, IEnumerable parameterTypes, string because = "", params object[] becauseArgs) + Type interfaceType, string name, IEnumerable parameterTypes, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(interfaceType); Guard.ThrowIfArgumentIsNullOrEmpty(name); @@ -1234,7 +1257,8 @@ public AndConstraint NotHaveExplicitMethod( /// is empty. /// is . public AndConstraint NotHaveExplicitMethod( - string name, IEnumerable parameterTypes, string because = "", params object[] becauseArgs) + string name, IEnumerable parameterTypes, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TInterface : class { return NotHaveExplicitMethod(typeof(TInterface), name, parameterTypes, because, becauseArgs); @@ -1256,7 +1280,8 @@ public AndConstraint NotHaveExplicitMethod( /// is . /// is . public AndWhichConstraint HaveIndexer( - Type indexerType, IEnumerable parameterTypes, string because = "", params object[] becauseArgs) + Type indexerType, IEnumerable parameterTypes, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(indexerType); Guard.ThrowIfArgumentIsNull(parameterTypes); @@ -1303,7 +1328,8 @@ public AndWhichConstraint HaveIndexer( /// /// is . public AndConstraint NotHaveIndexer( - IEnumerable parameterTypes, string because = "", params object[] becauseArgs) + IEnumerable parameterTypes, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(parameterTypes); @@ -1346,7 +1372,8 @@ public AndConstraint NotHaveIndexer( /// is empty. /// is . public AndWhichConstraint HaveMethod( - string name, IEnumerable parameterTypes, string because = "", params object[] becauseArgs) + string name, IEnumerable parameterTypes, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNullOrEmpty(name); Guard.ThrowIfArgumentIsNull(parameterTypes); @@ -1392,7 +1419,8 @@ public AndWhichConstraint HaveMethod( /// is empty. /// is . public AndConstraint NotHaveMethod( - string name, IEnumerable parameterTypes, string because = "", params object[] becauseArgs) + string name, IEnumerable parameterTypes, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNullOrEmpty(name); Guard.ThrowIfArgumentIsNull(parameterTypes); @@ -1433,7 +1461,8 @@ public AndConstraint NotHaveMethod( /// /// is . public AndWhichConstraint HaveConstructor( - IEnumerable parameterTypes, string because = "", params object[] becauseArgs) + IEnumerable parameterTypes, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(parameterTypes); @@ -1472,7 +1501,7 @@ public AndWhichConstraint HaveConstructor( /// Zero or more objects to format using the placeholders in . /// public AndWhichConstraint HaveDefaultConstructor( - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return HaveConstructor([], because, becauseArgs); } @@ -1490,7 +1519,8 @@ public AndWhichConstraint HaveDefaultConstructo /// /// is . public AndWhichConstraint NotHaveConstructor( - IEnumerable parameterTypes, string because = "", params object[] becauseArgs) + IEnumerable parameterTypes, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(parameterTypes); @@ -1529,7 +1559,7 @@ public AndWhichConstraint NotHaveConstructor( /// Zero or more objects to format using the placeholders in . /// public AndWhichConstraint NotHaveDefaultConstructor( - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotHaveConstructor([], because, becauseArgs); } @@ -1553,7 +1583,8 @@ private static string GetParameterString(IEnumerable parameterTypes) /// /// is not a value. public AndConstraint HaveAccessModifier( - CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) + CSharpAccessModifier accessModifier, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsOutOfRange(accessModifier); @@ -1591,7 +1622,8 @@ public AndConstraint HaveAccessModifier( /// /// is not a value. public AndConstraint NotHaveAccessModifier( - CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) + CSharpAccessModifier accessModifier, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsOutOfRange(accessModifier); @@ -1628,7 +1660,7 @@ public AndConstraint NotHaveAccessModifier( /// Zero or more objects to format using the placeholders in . /// public AndWhichConstraint HaveImplicitConversionOperator( - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return HaveImplicitConversionOperator(typeof(TSource), typeof(TTarget), because, becauseArgs); } @@ -1649,7 +1681,8 @@ public AndWhichConstraint HaveImplicitConversionOper /// is . /// is . public AndWhichConstraint HaveImplicitConversionOperator( - Type sourceType, Type targetType, string because = "", params object[] becauseArgs) + Type sourceType, Type targetType, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(sourceType); Guard.ThrowIfArgumentIsNull(targetType); @@ -1690,7 +1723,7 @@ public AndWhichConstraint HaveImplicitConversionOper /// Zero or more objects to format using the placeholders in . /// public AndConstraint NotHaveImplicitConversionOperator( - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotHaveImplicitConversionOperator(typeof(TSource), typeof(TTarget), because, becauseArgs); } @@ -1711,7 +1744,8 @@ public AndConstraint NotHaveImplicitConversionOperator is . /// is . public AndConstraint NotHaveImplicitConversionOperator( - Type sourceType, Type targetType, string because = "", params object[] becauseArgs) + Type sourceType, Type targetType, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(sourceType); Guard.ThrowIfArgumentIsNull(targetType); @@ -1750,7 +1784,7 @@ public AndConstraint NotHaveImplicitConversionOperator( /// Zero or more objects to format using the placeholders in . /// public AndWhichConstraint HaveExplicitConversionOperator( - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return HaveExplicitConversionOperator(typeof(TSource), typeof(TTarget), because, becauseArgs); } @@ -1771,7 +1805,8 @@ public AndWhichConstraint HaveExplicitConversionOper /// is . /// is . public AndWhichConstraint HaveExplicitConversionOperator( - Type sourceType, Type targetType, string because = "", params object[] becauseArgs) + Type sourceType, Type targetType, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(sourceType); Guard.ThrowIfArgumentIsNull(targetType); @@ -1812,7 +1847,7 @@ public AndWhichConstraint HaveExplicitConversionOper /// Zero or more objects to format using the placeholders in . /// public AndConstraint NotHaveExplicitConversionOperator( - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotHaveExplicitConversionOperator(typeof(TSource), typeof(TTarget), because, becauseArgs); } @@ -1833,7 +1868,8 @@ public AndConstraint NotHaveExplicitConversionOperator is . /// is . public AndConstraint NotHaveExplicitConversionOperator( - Type sourceType, Type targetType, string because = "", params object[] becauseArgs) + Type sourceType, Type targetType, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(sourceType); Guard.ThrowIfArgumentIsNull(targetType); diff --git a/Src/FluentAssertions/Types/TypeSelectorAssertions.cs b/Src/FluentAssertions/Types/TypeSelectorAssertions.cs index 90ab465827..1fa57f2532 100644 --- a/Src/FluentAssertions/Types/TypeSelectorAssertions.cs +++ b/Src/FluentAssertions/Types/TypeSelectorAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Linq.Expressions; using FluentAssertions.Common; @@ -44,7 +45,7 @@ public TypeSelectorAssertions(params Type[] types) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) + public AndConstraint BeDecoratedWith([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Type[] typesWithoutAttribute = Subject @@ -78,7 +79,8 @@ public AndConstraint BeDecoratedWith(string /// /// is . public AndConstraint BeDecoratedWith( - Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) + Expression> isMatchingAttributePredicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Guard.ThrowIfArgumentIsNull(isMatchingAttributePredicate); @@ -109,8 +111,8 @@ public AndConstraint BeDecoratedWith( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeDecoratedWithOrInherit(string because = "", - params object[] becauseArgs) + public AndConstraint BeDecoratedWithOrInherit( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Type[] typesWithoutAttribute = Subject @@ -144,7 +146,8 @@ public AndConstraint BeDecoratedWithOrInherit /// is . public AndConstraint BeDecoratedWithOrInherit( - Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) + Expression> isMatchingAttributePredicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Guard.ThrowIfArgumentIsNull(isMatchingAttributePredicate); @@ -175,7 +178,7 @@ public AndConstraint BeDecoratedWithOrInherit /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeDecoratedWith(string because = "", params object[] becauseArgs) + public AndConstraint NotBeDecoratedWith([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Type[] typesWithAttribute = Subject @@ -209,7 +212,8 @@ public AndConstraint NotBeDecoratedWith(stri /// /// is . public AndConstraint NotBeDecoratedWith( - Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) + Expression> isMatchingAttributePredicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Guard.ThrowIfArgumentIsNull(isMatchingAttributePredicate); @@ -240,8 +244,8 @@ public AndConstraint NotBeDecoratedWith( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeDecoratedWithOrInherit(string because = "", - params object[] becauseArgs) + public AndConstraint NotBeDecoratedWithOrInherit( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Type[] typesWithAttribute = Subject @@ -275,7 +279,8 @@ public AndConstraint NotBeDecoratedWithOrInherit /// is . public AndConstraint NotBeDecoratedWithOrInherit( - Expression> isMatchingAttributePredicate, string because = "", params object[] becauseArgs) + Expression> isMatchingAttributePredicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { Guard.ThrowIfArgumentIsNull(isMatchingAttributePredicate); @@ -306,7 +311,7 @@ public AndConstraint NotBeDecoratedWithOrInherit /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeSealed(string because = "", params object[] becauseArgs) + public AndConstraint BeSealed([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var notSealedTypes = Subject.Where(type => !type.IsCSharpSealed()).ToArray(); @@ -328,7 +333,7 @@ public AndConstraint BeSealed(string because = "", param /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeSealed(string because = "", params object[] becauseArgs) + public AndConstraint NotBeSealed([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var sealedTypes = Subject.Where(type => type.IsCSharpSealed()).ToArray(); @@ -353,8 +358,8 @@ public AndConstraint NotBeSealed(string because = "", pa /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeInNamespace(string @namespace, string because = "", - params object[] becauseArgs) + public AndConstraint BeInNamespace(string @namespace, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Type[] typesNotInNamespace = Subject .Where(t => t.Namespace != @namespace) @@ -384,8 +389,8 @@ public AndConstraint BeInNamespace(string @namespace, st /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeInNamespace(string @namespace, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeInNamespace(string @namespace, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Type[] typesInNamespace = Subject .Where(t => t.Namespace == @namespace) @@ -415,8 +420,8 @@ public AndConstraint NotBeInNamespace(string @namespace, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeUnderNamespace(string @namespace, string because = "", - params object[] becauseArgs) + public AndConstraint BeUnderNamespace(string @namespace, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Type[] typesNotUnderNamespace = Subject .Where(t => !t.IsUnderNamespace(@namespace)) @@ -447,8 +452,8 @@ public AndConstraint BeUnderNamespace(string @namespace, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeUnderNamespace(string @namespace, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeUnderNamespace(string @namespace, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Type[] typesUnderNamespace = Subject .Where(t => t.IsUnderNamespace(@namespace)) diff --git a/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs b/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs index e906bcc42e..52a223417e 100644 --- a/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs +++ b/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Xml; using FluentAssertions.Execution; @@ -15,7 +16,7 @@ internal class XmlReaderValidator private XmlIterator expectationIterator; private Node currentNode = Node.CreateRoot(); - public XmlReaderValidator(XmlReader subjectReader, XmlReader expectationReader, string because, object[] becauseArgs) + public XmlReaderValidator(XmlReader subjectReader, XmlReader expectationReader, [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { assertion = Execute.Assertion.BecauseOf(because, becauseArgs); diff --git a/Src/FluentAssertions/Xml/XAttributeAssertions.cs b/Src/FluentAssertions/Xml/XAttributeAssertions.cs index 1ab5df665a..807ee8ee75 100644 --- a/Src/FluentAssertions/Xml/XAttributeAssertions.cs +++ b/Src/FluentAssertions/Xml/XAttributeAssertions.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Xml.Linq; using FluentAssertions.Execution; using FluentAssertions.Primitives; @@ -30,7 +31,8 @@ public XAttributeAssertions(XAttribute attribute) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(XAttribute expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(XAttribute expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject?.Name == expected?.Name && Subject?.Value == expected?.Value) @@ -52,7 +54,8 @@ public AndConstraint Be(XAttribute expected, string becaus /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(XAttribute unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBe(XAttribute unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(!(Subject?.Name == unexpected?.Name && Subject?.Value == unexpected?.Value)) @@ -73,7 +76,8 @@ public AndConstraint NotBe(XAttribute unexpected, string b /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveValue(string expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) diff --git a/Src/FluentAssertions/Xml/XDocumentAssertions.cs b/Src/FluentAssertions/Xml/XDocumentAssertions.cs index 912592271f..98b2662d7a 100644 --- a/Src/FluentAssertions/Xml/XDocumentAssertions.cs +++ b/Src/FluentAssertions/Xml/XDocumentAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Xml; using System.Xml.Linq; @@ -37,7 +38,8 @@ public XDocumentAssertions(XDocument document) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(XDocument expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(XDocument expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Equals(Subject, expected)) @@ -59,7 +61,8 @@ public AndConstraint Be(XDocument expected, string because /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(XDocument unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBe(XDocument unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .BecauseOf(because, becauseArgs) @@ -81,7 +84,8 @@ public AndConstraint NotBe(XDocument unexpected, string bec /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeEquivalentTo(XDocument expected, string because = "", params object[] becauseArgs) + public AndConstraint BeEquivalentTo(XDocument expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { using (XmlReader subjectReader = Subject?.CreateReader()) using (XmlReader otherReader = expected?.CreateReader()) @@ -105,8 +109,8 @@ public AndConstraint BeEquivalentTo(XDocument expected, str /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeEquivalentTo(XDocument unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeEquivalentTo(XDocument unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { using (XmlReader subjectReader = Subject?.CreateReader()) using (XmlReader otherReader = unexpected?.CreateReader()) @@ -131,8 +135,8 @@ public AndConstraint NotBeEquivalentTo(XDocument unexpected /// Zero or more objects to format using the placeholders in . /// /// is . - public AndWhichConstraint HaveRoot(string expected, string because = "", - params object[] becauseArgs) + public AndWhichConstraint HaveRoot(string expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert the document has a root element if the expected name is ."); @@ -153,8 +157,8 @@ public AndWhichConstraint HaveRoot(string expecte /// Zero or more objects to format using the placeholders in . /// /// is . - public AndWhichConstraint HaveRoot(XName expected, string because = "", - params object[] becauseArgs) + public AndWhichConstraint HaveRoot(XName expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { if (Subject is null) { @@ -192,8 +196,8 @@ public AndWhichConstraint HaveRoot(XName expected /// Zero or more objects to format using the placeholders in . /// /// is . - public AndWhichConstraint HaveElement(string expected, string because = "", - params object[] becauseArgs) + public AndWhichConstraint HaveElement(string expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert the document has an element if the expected name is ."); @@ -220,7 +224,8 @@ public AndWhichConstraint HaveElement(string expe /// /// is . public AndWhichConstraint> HaveElement(string expected, - OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) + OccurrenceConstraint occurrenceConstraint, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert the document has an element if the expected name is ."); @@ -243,8 +248,8 @@ public AndWhichConstraint> HaveElemen /// Zero or more objects to format using the placeholders in . /// /// is . - public AndWhichConstraint HaveElement(XName expected, string because = "", - params object[] becauseArgs) + public AndWhichConstraint HaveElement(XName expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { if (Subject is null) { @@ -297,8 +302,8 @@ public AndWhichConstraint HaveElement(XName expec /// /// is . public AndWhichConstraint> HaveElement(XName expected, - OccurrenceConstraint occurrenceConstraint, string because = "", - params object[] becauseArgs) + OccurrenceConstraint occurrenceConstraint, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert the document has an element count if the element name is ."); diff --git a/Src/FluentAssertions/Xml/XElementAssertions.cs b/Src/FluentAssertions/Xml/XElementAssertions.cs index b83160e5d7..3381c4703b 100644 --- a/Src/FluentAssertions/Xml/XElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XElementAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Xml; using System.Xml.Linq; @@ -38,7 +39,8 @@ public XElementAssertions(XElement xElement) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(XElement expected, string because = "", params object[] becauseArgs) + public AndConstraint Be(XElement expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(XNode.DeepEquals(Subject, expected)) @@ -61,7 +63,8 @@ public AndConstraint Be(XElement expected, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(XElement unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBe(XElement unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition((Subject is null && unexpected is not null) || !XNode.DeepEquals(Subject, unexpected)) @@ -84,8 +87,8 @@ public AndConstraint NotBe(XElement unexpected, string becau /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeEquivalentTo(XElement expected, string because = "", - params object[] becauseArgs) + public AndConstraint BeEquivalentTo(XElement expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { using (XmlReader subjectReader = Subject?.CreateReader()) using (XmlReader expectedReader = expected?.CreateReader()) @@ -110,8 +113,8 @@ public AndConstraint BeEquivalentTo(XElement expected, strin /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeEquivalentTo(XElement unexpected, string because = "", - params object[] becauseArgs) + public AndConstraint NotBeEquivalentTo(XElement unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { using (XmlReader subjectReader = Subject?.CreateReader()) using (XmlReader otherReader = unexpected?.CreateReader()) @@ -134,7 +137,8 @@ public AndConstraint NotBeEquivalentTo(XElement unexpected, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveValue(string expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { bool success = Execute.Assertion .BecauseOf(because, becauseArgs) @@ -169,8 +173,8 @@ public AndConstraint HaveValue(string expected, string becau /// /// is . /// is empty. - public AndConstraint HaveAttribute(string expectedName, string expectedValue, string because = "", - params object[] becauseArgs) + public AndConstraint HaveAttribute(string expectedName, string expectedValue, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNullOrEmpty(expectedName); @@ -191,8 +195,8 @@ public AndConstraint HaveAttribute(string expectedName, stri /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint HaveAttribute(XName expectedName, string expectedValue, string because = "", - params object[] becauseArgs) + public AndConstraint HaveAttribute(XName expectedName, string expectedValue, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expectedName); @@ -245,8 +249,8 @@ public AndConstraint HaveAttribute(XName expectedName, strin /// /// is . /// is empty. - public AndWhichConstraint HaveElement(string expected, string because = "", - params object[] becauseArgs) + public AndWhichConstraint HaveElement(string expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNullOrEmpty(expected); @@ -266,8 +270,8 @@ public AndWhichConstraint HaveElement(string expec /// Zero or more objects to format using the placeholders in . /// /// is . - public AndWhichConstraint HaveElement(XName expected, string because = "", - params object[] becauseArgs) + public AndWhichConstraint HaveElement(XName expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected); @@ -314,8 +318,8 @@ public AndWhichConstraint HaveElement(XName expect /// /// is . public AndWhichConstraint> HaveElement(XName expected, - OccurrenceConstraint occurrenceConstraint, string because = "", - params object[] becauseArgs) + OccurrenceConstraint occurrenceConstraint, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert the element has an element count if the element name is ."); @@ -365,7 +369,8 @@ public AndWhichConstraint> HaveElement /// /// is . public AndWhichConstraint> HaveElement(string expected, - OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) + OccurrenceConstraint occurrenceConstraint, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert the element has an element if the expected name is ."); diff --git a/Src/FluentAssertions/Xml/XmlElementAssertions.cs b/Src/FluentAssertions/Xml/XmlElementAssertions.cs index 0ebde2f5b8..60bfd53dff 100644 --- a/Src/FluentAssertions/Xml/XmlElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XmlElementAssertions.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Xml; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -33,8 +34,8 @@ public XmlElementAssertions(XmlElement xmlElement) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveInnerText(string expected, string because = "", - params object[] becauseArgs) + public AndConstraint HaveInnerText(string expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion .ForCondition(Subject.InnerText == expected) @@ -60,8 +61,8 @@ public AndConstraint HaveInnerText(string expected, string /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveAttribute(string expectedName, string expectedValue, string because = "", - params object[] becauseArgs) + public AndConstraint HaveAttribute(string expectedName, string expectedValue, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return HaveAttributeWithNamespace(expectedName, string.Empty, expectedValue, because, becauseArgs); } @@ -85,7 +86,7 @@ public AndConstraint HaveAttributeWithNamespace( string expectedName, string expectedNamespace, string expectedValue, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { XmlAttribute attribute = Subject.Attributes[expectedName, expectedNamespace]; @@ -128,8 +129,7 @@ public AndConstraint HaveAttributeWithNamespace( /// public AndWhichConstraint HaveElement( string expectedName, - string because = "", - params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return HaveElementWithNamespace(expectedName, null, because, becauseArgs); } @@ -150,8 +150,7 @@ public AndWhichConstraint HaveElement( public AndWhichConstraint HaveElementWithNamespace( string expectedName, string expectedNamespace, - string because = "", - params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { XmlElement element = expectedNamespace == null ? Subject[expectedName] : Subject[expectedName, expectedNamespace]; diff --git a/Src/FluentAssertions/Xml/XmlNodeAssertions.cs b/Src/FluentAssertions/Xml/XmlNodeAssertions.cs index 2ea98b0b18..779317b295 100644 --- a/Src/FluentAssertions/Xml/XmlNodeAssertions.cs +++ b/Src/FluentAssertions/Xml/XmlNodeAssertions.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Xml; using FluentAssertions.Primitives; using FluentAssertions.Xml.Equivalency; @@ -41,7 +42,8 @@ public XmlNodeAssertions(TSubject xmlNode) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeEquivalentTo(XmlNode expected, string because = "", params object[] becauseArgs) + public AndConstraint BeEquivalentTo(XmlNode expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { using (var subjectReader = new XmlNodeReader(Subject)) using (var expectedReader = new XmlNodeReader(expected)) @@ -65,7 +67,8 @@ public AndConstraint BeEquivalentTo(XmlNode expected, string becaus /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeEquivalentTo(XmlNode unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotBeEquivalentTo(XmlNode unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { using (var subjectReader = new XmlNodeReader(Subject)) using (var unexpectedReader = new XmlNodeReader(unexpected)) diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.EndWith.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.EndWith.cs index 90417e69a9..85407dbf6a 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.EndWith.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.EndWith.cs @@ -34,8 +34,13 @@ public void When_collection_does_end_with_a_specific_element_and_because_format_ string[] collection = ["john", "jane", "mike"]; // Act +#pragma warning disable CA2241 + // ReSharper disable FormatStringProblem Action act = () => collection.Should().EndWith("mike", "of some reason {0,abc}", 1, 2); + // ReSharper restore FormatStringProblem +#pragma warning restore CA2241 + // Assert act.Should().NotThrow(); } diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs index c7a7db682d..4dcd1d7af9 100644 --- a/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs @@ -152,6 +152,8 @@ public void Because_reason_should_ignore_undefined_arguments() { // Act object[] becauseArgs = null; + + // ReSharper disable once FormatStringProblem Action act = () => 1.Should().Be(2, "it should still work", becauseArgs); // Assert @@ -163,7 +165,10 @@ public void Because_reason_should_ignore_undefined_arguments() public void Because_reason_should_threat_parentheses_as_literals_if_no_arguments_are_defined() { // Act +#pragma warning disable CA2241 + // ReSharper disable once FormatStringProblem Action act = () => 1.Should().Be(2, "use of {} is okay if there are no because arguments"); +#pragma warning restore CA2241 // Assert act.Should().Throw() @@ -174,8 +179,11 @@ public void Because_reason_should_threat_parentheses_as_literals_if_no_arguments public void Because_reason_should_inform_about_invalid_parentheses_with_a_default_message() { // Act +#pragma warning disable CA2241 + // ReSharper disable once FormatStringProblem Action act = () => 1.Should().Be(2, "use of {} is considered invalid in because parameter with becauseArgs", "additional becauseArgs argument"); +#pragma warning restore CA2241 // Assert act.Should().Throw() diff --git a/qodana.yaml b/qodana.yaml index 3145633150..3f248f5a33 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -39,3 +39,6 @@ exclude: - name: PossibleMultipleEnumeration paths: - Tests + - name: FormatStringProblem + paths: + - Tests From 59703fe34402a7a8709ca31cdea8281867d661bb Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Mon, 10 Jun 2024 15:07:51 +1000 Subject: [PATCH 333/845] Improve BeUpperCased/BeLowerCased semantics (#2660) --- .../Primitives/StringAssertions.cs | 65 ++++++++++---- .../StringAssertionSpecs.BeLowerCased.cs | 87 ++++++++++++++---- .../StringAssertionSpecs.BeUpperCased.cs | 90 ++++++++++++++----- docs/_pages/releases.md | 1 + docs/_pages/strings.md | 17 +++- 5 files changed, 202 insertions(+), 58 deletions(-) diff --git a/Src/FluentAssertions/Primitives/StringAssertions.cs b/Src/FluentAssertions/Primitives/StringAssertions.cs index 2a276dbbb1..dbc6a5e7f2 100644 --- a/Src/FluentAssertions/Primitives/StringAssertions.cs +++ b/Src/FluentAssertions/Primitives/StringAssertions.cs @@ -1882,12 +1882,12 @@ public AndConstraint BeNullOrWhiteSpace([StringSyntax("CompositeFor } /// - /// Asserts that all characters in a string are in upper casing. + /// Asserts that all cased characters in a string are upper-case. That is, that the string could be the result of a call to + /// . /// /// - /// Be careful that numbers and special characters don't have casing, so - /// will always fail on a string that contains anything but alphabetic characters. - /// In those cases, we recommend using . + /// Numbers, special characters, and many Asian characters don't have casing, so + /// will ignore these and will fail only in the presence of lower-case characters. /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -1899,16 +1899,21 @@ public AndConstraint BeNullOrWhiteSpace([StringSyntax("CompositeFor public AndConstraint BeUpperCased([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion - .ForCondition(Subject?.All(char.IsUpper) == true) + .ForCondition(Subject is not null && !Subject.Any(char.IsLower)) .BecauseOf(because, becauseArgs) - .FailWith("Expected all characters in {context:string} to be upper cased{reason}, but found {0}.", Subject); + .FailWith("Expected all alphabetic characters in {context:string} to be upper-case{reason}, but found {0}.", Subject); return new AndConstraint((TAssertions)this); } /// - /// Asserts that all characters in a string are not in upper casing. + /// Asserts that of all the cased characters in a string, some are not upper-case. That is, the string could not be + /// the result of a call to . /// + /// + /// Numbers, special characters, and many Asian characters don't have casing, so + /// will ignore these and will fail only if the string contains cased characters and they are all upper-case. + /// /// /// 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. @@ -1919,20 +1924,20 @@ public AndConstraint BeUpperCased([StringSyntax("CompositeFormat")] public AndConstraint NotBeUpperCased([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion - .ForCondition(Subject is null || Subject.Any(ch => !char.IsUpper(ch))) + .ForCondition(Subject is null || HasMixedOrNoCase(Subject)) .BecauseOf(because, becauseArgs) - .FailWith("Did not expect any characters in {context:string} to be upper cased{reason}."); + .FailWith("Expected some characters in {context:string} to be lower-case{reason}."); return new AndConstraint((TAssertions)this); } /// - /// Asserts that all characters in a string are in lower casing. + /// Asserts that all cased characters in a string are lower-case. That is, that the string could be the result of a call to + /// , /// /// - /// Be careful that numbers and special characters don't have casing, so will always fail on - /// a string that contains anything but alphabetic characters. - /// In those cases, we recommend using . + /// Numbers, special characters, and many Asian characters don't have casing, so + /// will ignore these and will fail only in the presence of upper-case characters. /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -1944,16 +1949,21 @@ public AndConstraint NotBeUpperCased([StringSyntax("CompositeFormat public AndConstraint BeLowerCased([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion - .ForCondition(Subject?.All(char.IsLower) == true) + .ForCondition(Subject is not null && !Subject.Any(char.IsUpper)) .BecauseOf(because, becauseArgs) - .FailWith("Expected all characters in {context:string} to be lower cased{reason}, but found {0}.", Subject); + .FailWith("Expected all alphabetic characters in {context:string} to be lower cased{reason}, but found {0}.", Subject); return new AndConstraint((TAssertions)this); } /// - /// Asserts that all characters in a string are not in lower casing. + /// Asserts that of all the cased characters in a string, some are not lower-case. That is, the string could not be + /// the result of a call to . /// + /// + /// Numbers, special characters, and many Asian characters don't have casing, so + /// will ignore these and will fail only if the string contains cased characters and they are all lower-case. + /// /// /// 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. @@ -1964,13 +1974,32 @@ public AndConstraint BeLowerCased([StringSyntax("CompositeFormat")] public AndConstraint NotBeLowerCased([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion - .ForCondition(Subject is null || Subject.Any(ch => !char.IsLower(ch))) + .ForCondition(Subject is null || HasMixedOrNoCase(Subject)) .BecauseOf(because, becauseArgs) - .FailWith("Did not expect any characters in {context:string} to be lower cased{reason}."); + .FailWith("Expected some characters in {context:string} to be upper-case{reason}."); return new AndConstraint((TAssertions)this); } + private static bool HasMixedOrNoCase(string value) + { + var hasUpperCase = false; + var hasLowerCase = false; + + foreach (var ch in value) + { + hasUpperCase |= char.IsUpper(ch); + hasLowerCase |= char.IsLower(ch); + + if (hasUpperCase && hasLowerCase) + { + return true; + } + } + + return !hasUpperCase && !hasLowerCase; + } + internal AndConstraint Be(string expected, Func, EquivalencyOptions> config, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeLowerCased.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeLowerCased.cs index 016b67fc82..38c1ac56d6 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeLowerCased.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeLowerCased.cs @@ -12,7 +12,7 @@ public partial class StringAssertionSpecs public class BeLowerCased { [Fact] - public void When_a_lower_string_is_supposed_to_be_lower_it_should_succeed() + public void Lower_case_characters_are_okay() { // Arrange string actual = "abc"; @@ -22,7 +22,7 @@ public void When_a_lower_string_is_supposed_to_be_lower_it_should_succeed() } [Fact] - public void When_an_empty_string_is_supposed_to_be_lower_it_should_succeed() + public void The_empty_string_is_okay() { // Arrange string actual = ""; @@ -32,7 +32,7 @@ public void When_an_empty_string_is_supposed_to_be_lower_it_should_succeed() } [Fact] - public void When_a_non_lower_string_is_supposed_to_be_lower_it_should_fail() + public void Upper_case_characters_are_not_okay() { // Arrange string actual = "ABC"; @@ -45,10 +45,10 @@ public void When_a_non_lower_string_is_supposed_to_be_lower_it_should_fail() } [Fact] - public void When_a_lower_case_string_with_numbers_is_supposed_to_be_in_lower_case_only_it_should_throw() + public void A_mixed_case_string_is_not_okay() { // Arrange - string actual = "a1"; + string actual = "AbC"; // Act Action act = () => actual.Should().BeLowerCased(); @@ -58,7 +58,27 @@ public void When_a_lower_case_string_with_numbers_is_supposed_to_be_in_lower_cas } [Fact] - public void When_a_non_lower_string_is_supposed_to_be_lower_it_should_fail_with_descriptive_message() + public void Lower_case_and_caseless_characters_are_okay() + { + // Arrange + string actual = "a1!"; + + // Act / Assert + actual.Should().BeLowerCased(); + } + + [Fact] + public void Caseless_characters_are_okay() + { + // Arrange + string actual = "1!漢字"; + + // Act / Assert + actual.Should().BeLowerCased(); + } + + [Fact] + public void The_assertion_fails_with_a_descriptive_message() { // Arrange string actual = "ABC"; @@ -68,11 +88,11 @@ public void When_a_non_lower_string_is_supposed_to_be_lower_it_should_fail_with_ // Assert act.Should().Throw().WithMessage( - "Expected all characters in actual to be lower cased because we want to test the failure message, but found \"ABC\"."); + "Expected all alphabetic characters in actual to be lower cased because we want to test the failure message, but found \"ABC\"."); } [Fact] - public void When_checking_for_a_lower_string_and_it_is_null_it_should_throw() + public void The_null_string_is_not_okay() { // Arrange string nullString = null; @@ -82,24 +102,24 @@ public void When_checking_for_a_lower_string_and_it_is_null_it_should_throw() // Assert act.Should().Throw().WithMessage( - "Expected all characters in nullString to be lower cased because strings should never be null, but found ."); + "Expected all alphabetic characters in nullString to be lower cased because strings should never be null, but found ."); } } public class NotBeLowerCased { [Fact] - public void When_a_non_lower_string_is_supposed_to_be_upper_it_should_succeed() + public void A_mixed_case_string_is_okay() { // Arrange - string actual = "ABC"; + string actual = "AbC"; // Act / Assert actual.Should().NotBeLowerCased(); } [Fact] - public void When_a_null_string_is_not_supposed_to_be_lower_it_should_succeed() + public void The_null_string_is_okay() { // Arrange string actual = null; @@ -109,7 +129,17 @@ public void When_a_null_string_is_not_supposed_to_be_lower_it_should_succeed() } [Fact] - public void When_a_lower_string_is_supposed_to_be_upper_it_should_throw() + public void The_empty_string_is_okay() + { + // Arrange + string actual = ""; + + // Act / Assert + actual.Should().NotBeLowerCased(); + } + + [Fact] + public void A_lower_case_string_is_not_okay() { // Arrange string actual = "abc"; @@ -122,17 +152,40 @@ public void When_a_lower_string_is_supposed_to_be_upper_it_should_throw() } [Fact] - public void When_a_lower_case_string_with_numbers_is_not_supposed_to_be_in_lower_case_only_it_should_succeed() + public void Lower_case_characters_with_upper_case_characters_are_okay() + { + // Arrange + string actual = "Ab1!"; + + // Act / Assert + actual.Should().NotBeLowerCased(); + } + + [Fact] + public void All_cased_characters_being_lower_case_is_not_okay() + { + // Arrange + string actual = "a1b!"; + + // Act + Action act = () => actual.Should().NotBeLowerCased(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Caseless_characters_are_okay() { // Arrange - string actual = "A1"; + string actual = "1!漢字"; // Act / Assert actual.Should().NotBeLowerCased(); } [Fact] - public void When_a_lower_string_is_not_supposed_to_be_lower_it_should_fail_with_descriptive_message() + public void The_assertion_fails_with_a_descriptive_message() { // Arrange string actual = "abc"; @@ -142,7 +195,7 @@ public void When_a_lower_string_is_not_supposed_to_be_lower_it_should_fail_with_ // Assert act.Should().Throw().WithMessage( - "Did not expect any characters in actual to be lower cased because we want to test the failure message."); + "Expected some characters in actual to be upper-case because we want to test the failure message."); } } } diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeUpperCased.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeUpperCased.cs index 3502f1728f..7b16655243 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeUpperCased.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeUpperCased.cs @@ -12,7 +12,7 @@ public partial class StringAssertionSpecs public class BeUpperCased { [Fact] - public void When_an_upper_case_string_is_supposed_to_be_in_upper_case_only_it_should_not_throw() + public void Upper_case_characters_are_okay() { // Arrange string actual = "ABC"; @@ -22,7 +22,17 @@ public void When_an_upper_case_string_is_supposed_to_be_in_upper_case_only_it_sh } [Fact] - public void When_a_non_upper_string_is_supposed_to_be_upper_it_should_throw() + public void The_empty_string_is_okay() + { + // Arrange + string actual = ""; + + // Act / Assert + actual.Should().BeUpperCased(); + } + + [Fact] + public void A_lower_case_string_is_not_okay() { // Arrange string actual = "abc"; @@ -35,20 +45,27 @@ public void When_a_non_upper_string_is_supposed_to_be_upper_it_should_throw() } [Fact] - public void When_an_upper_case_string_with_numbers_is_supposed_to_be_in_upper_case_only_it_should_throw() + public void Upper_case_and_caseless_characters_are_ok() { // Arrange - string actual = "A1"; + string actual = "A1!"; - // Act - Action act = () => actual.Should().BeUpperCased(); + // Act / Assert + actual.Should().BeUpperCased(); + } - // Assert - act.Should().Throw(); + [Fact] + public void Caseless_characters_are_okay() + { + // Arrange + string actual = "1!漢字"; + + // Act / Assert + actual.Should().BeUpperCased(); } [Fact] - public void When_a_non_upper_string_is_supposed_to_be_upper_it_should_fail_with_descriptive_message() + public void The_assertion_fails_with_a_descriptive_message() { // Arrange string actual = "abc"; @@ -58,11 +75,11 @@ public void When_a_non_upper_string_is_supposed_to_be_upper_it_should_fail_with_ // Assert act.Should().Throw().WithMessage( - @"Expected all characters in actual to be upper cased because we want to test the failure message, but found ""abc""."); + "Expected all alphabetic characters in actual to be upper-case because we want to test the failure message, but found \"abc\"."); } [Fact] - public void When_checking_for_an_upper_string_and_it_is_null_it_should_throw() + public void The_null_string_is_not_okay() { // Arrange string nullString = null; @@ -72,24 +89,24 @@ public void When_checking_for_an_upper_string_and_it_is_null_it_should_throw() // Assert act.Should().Throw().WithMessage( - "Expected all characters in nullString to be upper cased because strings should never be null, but found ."); + "Expected all alphabetic characters in nullString to be upper-case because strings should never be null, but found ."); } } public class NotBeUpperCased { [Fact] - public void When_a_non_upper_string_is_supposed_to_be_non_upper_it_should_succeed() + public void A_mixed_case_string_is_okay() { // Arrange - string actual = "abc"; + string actual = "aBc"; // Act / Assert actual.Should().NotBeUpperCased(); } [Fact] - public void When_a_null_string_is_not_supposed_to_be_upper_it_should_succeed() + public void The_null_string_is_okay() { // Arrange string actual = null; @@ -99,7 +116,17 @@ public void When_a_null_string_is_not_supposed_to_be_upper_it_should_succeed() } [Fact] - public void When_an_upper_string_is_not_supposed_to_be_upper_it_should_throw() + public void The_empty_string_is_okay() + { + // Arrange + string actual = ""; + + // Act / Assert + actual.Should().NotBeUpperCased(); + } + + [Fact] + public void A_string_of_all_upper_case_characters_is_not_okay() { // Arrange string actual = "ABC"; @@ -112,17 +139,40 @@ public void When_an_upper_string_is_not_supposed_to_be_upper_it_should_throw() } [Fact] - public void When_an_upper_case_string_with_numbers_is_not_supposed_to_be_in_upper_case_only_it_should_succeed() + public void Upper_case_characters_with_lower_case_characters_are_okay() + { + // Arrange + string actual = "Ab1!"; + + // Act / Assert + actual.Should().NotBeUpperCased(); + } + + [Fact] + public void All_cased_characters_being_upper_case_is_not_okay() + { + // Arrange + string actual = "A1B!"; + + // Act + Action act = () => actual.Should().NotBeUpperCased(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Caseless_characters_are_okay() { // Arrange - string actual = "a1"; + string actual = "1!漢字"; // Act / Assert actual.Should().NotBeUpperCased(); } [Fact] - public void When_an_upper_string_is_not_supposed_to_be_upper_it_should_fail_with_descriptive_message() + public void The_assertion_fails_with_a_descriptive_message() { // Arrange string actual = "ABC"; @@ -132,7 +182,7 @@ public void When_an_upper_string_is_not_supposed_to_be_upper_it_should_fail_with // Assert act.Should().Throw().WithMessage( - "Did not expect any characters in actual to be upper cased because we want to test the failure message."); + "Expected some characters in actual to be lower-case because we want to test the failure message."); } } } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 9787a51183..3cbed469d0 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -77,6 +77,7 @@ sidebar: * `SelfReferenceEquivalencyAssertionOptions` to `SelfReferenceEquivalencyOptions` * Allow fluently calling `WithoutMatchingRules` and `WithoutSelectionRules` while using `BeEquivalentTo` - [#2457](https://github.com/fluentassertions/fluentassertions/pull/2457) * Removed `utcNow` overload for `.Monitor()` - [#2629](https://github.com/fluentassertions/fluentassertions/pull/2629) +* The semantics of `BeLowerCased`/`BeUpperCased` have been changed to align with the behavior of `ToLower`/`ToUpper` - [#2660](https://github.com/fluentassertions/fluentassertions/pull/2660) ### Breaking Changes (for extensions) * Add `ForConstraint` to `IAssertionsScope` to support chaining `.ForConstraint()` after `.Then` - [#2324](https://github.com/fluentassertions/fluentassertions/pull/2324) diff --git a/docs/_pages/strings.md b/docs/_pages/strings.md index 98b981e848..1c3a66f1f9 100644 --- a/docs/_pages/strings.md +++ b/docs/_pages/strings.md @@ -20,7 +20,7 @@ theString.Should().BeNullOrWhiteSpace(); // either null, empty or whitespace onl theString.Should().NotBeNullOrWhiteSpace(); ``` -To ensure the characters in a string are all (not) upper or lower cased, you can use the following assertions. +To ensure that the characters with case in a string are all upper or lower cased (or the opposite), you can use the following assertions. ```csharp theString.Should().BeUpperCased(); @@ -29,9 +29,20 @@ theString.Should().BeLowerCased(); theString.Should().NotBeLowerCased(); ``` -However, be careful that numbers and special characters don't have casing, so `BeUpperCased` and `BeLowerCased` will always fail on a string that contains anything but alphabetic characters. In those cases, we recommend using `NotBeUpperCased` or `NotBeLowerCased`. +Note that numbers, special characters, and some alphabets don't have casing, so `BeUpperCased` and `BeLowerCased` will +ignore these characters. In other words, `BeUpperCased` will succeed if the string is a possible output of +`ToUpperInvariant`, and likewise for `BeLowerCased`. `NotBeUpperCased` will fail only if the string contains characters +with case, and all those characters are upper-case, and likewise for `NotBeLowerCased`. -Obviously you’ll find all the methods you would expect for string assertions. +The semantics of these assertions changed in FluentAssertions v7.0. For the previous semantics, asserting that all +characters in the string are upper-case characters, for example, you can use a collection assertion on the characters of +the string: + +```csharp +theString.Should().OnlyContain(char.IsUpper); +``` + +Obviously you'll find all the methods you would expect for string assertions. ```csharp theString = "This is a String"; From 418a32754bf4f2d3cb16c4578baed62ad9c2420a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kenneth=20Siewers=20M=C3=B8ller?= Date: Mon, 10 Jun 2024 07:08:12 +0200 Subject: [PATCH 334/845] Add support for `Satisfy` on `ReferenceTypeAssertions` (#2597) --- .../Primitives/ReferenceTypeAssertions.cs | 49 +++ .../FluentAssertions/net47.verified.txt | 2 + .../FluentAssertions/net6.0.verified.txt | 2 + .../netstandard2.0.verified.txt | 2 + .../netstandard2.1.verified.txt | 2 + .../ReferenceTypeAssertionsSpecs.Satisfy.cs | 392 ++++++++++++++++++ .../ReferenceTypeAssertionsSpecs.cs | 2 +- docs/_pages/basicassertions.md | 28 ++ docs/_pages/releases.md | 1 + 9 files changed, 479 insertions(+), 1 deletion(-) create mode 100644 Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.Satisfy.cs diff --git a/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs b/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs index b7b1013423..55b38fd950 100644 --- a/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs +++ b/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Linq; using System.Linq.Expressions; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -421,6 +422,54 @@ public AndConstraint Match(Expression> predicate, return new AndConstraint((TAssertions)this); } + /// + /// Allows combining one or more assertions using the other assertion methods that this library offers on an instance of . + /// + /// + /// If multiple assertions executed by the fail, they will be raised as a single failure. + /// + /// The element inspector which must be satisfied by the . + /// An which can be used to chain assertions. + /// is . + public AndConstraint Satisfy(Action assertion) + where T : TSubject + { + Guard.ThrowIfArgumentIsNull(assertion, nameof(assertion), "Cannot verify an object against a inspector."); + + var success = Execute.Assertion + .ForCondition(Subject is not null) + .WithDefaultIdentifier(Identifier) + .FailWith("Expected {context:object} to be assignable to {0}{reason}, but found .", typeof(T)) + .Then + .ForCondition(Subject is T) + .WithDefaultIdentifier(Identifier) + .FailWith("Expected {context:object} to be assignable to {0}{reason}, but {1} is not.", typeof(T), Subject?.GetType()); + + if (success) + { + string[] failuresFromInspector; + + using (var assertionScope = new AssertionScope()) + { + assertion((T)Subject); + failuresFromInspector = assertionScope.Discard(); + } + + if (failuresFromInspector.Length > 0) + { + string failureMessage = Environment.NewLine + + string.Join(Environment.NewLine, failuresFromInspector.Select(x => x.IndentLines())); + + Execute.Assertion + .WithDefaultIdentifier(Identifier) + .WithExpectation("Expected {context:object} to match inspector, but the inspector was not satisfied:", Subject) + .FailWithPreFormatted(failureMessage); + } + } + + return new AndConstraint((TAssertions)this); + } + /// /// Returns the type of the subject the assertion applies on. /// It should be a user-friendly name as it is included in the failure message. diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 49557d858c..76c15ad354 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -2019,6 +2019,8 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBeOfType(System.Type unexpectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeOfType(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeSameAs(TSubject unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint Satisfy(System.Action assertion) + where T : TSubject { } } public class SimpleTimeSpanAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 4f98826d2b..7b38ddda09 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -2103,6 +2103,8 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBeOfType(System.Type unexpectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeOfType(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeSameAs(TSubject unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint Satisfy(System.Action assertion) + where T : TSubject { } } public class SimpleTimeSpanAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index bac08b19ef..25c59baec8 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -1963,6 +1963,8 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBeOfType(System.Type unexpectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeOfType(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeSameAs(TSubject unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint Satisfy(System.Action assertion) + where T : TSubject { } } public class SimpleTimeSpanAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index c2d650c74e..e25ac7c515 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -2019,6 +2019,8 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBeOfType(System.Type unexpectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeOfType(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeSameAs(TSubject unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint Satisfy(System.Action assertion) + where T : TSubject { } } public class SimpleTimeSpanAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { diff --git a/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.Satisfy.cs b/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.Satisfy.cs new file mode 100644 index 0000000000..620b879c0d --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.Satisfy.cs @@ -0,0 +1,392 @@ +using System; +using FluentAssertions.Execution; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class ReferenceTypeAssertionsSpecs +{ + public class Satisfy + { + [Fact] + public void Object_satisfying_inspector_does_not_throw() + { + // Arrange + var someObject = new object(); + + // Act / Assert + someObject.Should().Satisfy(x => x.Should().NotBeNull()); + } + + [Fact] + public void Object_not_satisfying_inspector_throws() + { + // Arrange + var someObject = new object(); + + // Act + Action act = () => someObject.Should().Satisfy(o => o.Should().BeNull("it is not initialized yet")); + + // Assert + act.Should().Throw().WithMessage( + $""" + Expected {nameof(someObject)} to match inspector, but the inspector was not satisfied: + *Expected o to be because it is not initialized yet, but found System.Object* + """); + } + + [Fact] + public void Object_satisfied_against_null_throws() + { + // Arrange + var someObject = new object(); + + // Act + Action act = () => someObject.Should().Satisfy(null); + + // Assert + act.Should().Throw() + .WithMessage("Cannot verify an object against a inspector.*"); + } + + [Fact] + public void Typed_object_satisfying_inspector_does_not_throw() + { + // Arrange + var personDto = new PersonDto + { + Name = "Name Nameson", + Birthdate = new DateTime(2000, 1, 1), + }; + + // Act / Assert + personDto.Should().Satisfy(o => o.Age.Should().BeGreaterThan(0)); + } + + [Fact] + public void Complex_typed_object_satisfying_inspector_does_not_throw() + { + // Arrange + var complexDto = new PersonAndAddressDto + { + Person = new PersonDto + { + Name = "Name Nameson", + Birthdate = new DateTime(2000, 1, 1), + }, + Address = new AddressDto + { + Street = "Named St.", + Number = "42", + City = "Nowhere", + Country = "Neverland", + PostalCode = "12345", + } + }; + + // Act / Assert + complexDto.Should().Satisfy(dto => + { + dto.Person.Should().Satisfy(person => + { + person.Name.Should().Be("Name Nameson"); + person.Age.Should().BeGreaterThan(0); + person.Birthdate.Should().Be(1.January(2000)); + }); + + dto.Address.Should().Satisfy(address => + { + address.Street.Should().Be("Named St."); + address.Number.Should().Be("42"); + address.City.Should().Be("Nowhere"); + address.Country.Should().Be("Neverland"); + address.PostalCode.Should().Be("12345"); + }); + }); + } + + [Fact] + public void Typed_object_not_satisfying_inspector_throws() + { + // Arrange + var personDto = new PersonDto + { + Name = "Name Nameson", + Birthdate = new DateTime(2000, 1, 1), + }; + + // Act + Action act = () => personDto.Should().Satisfy(d => + { + d.Name.Should().Be("Someone Else"); + d.Age.Should().BeLessThan(20); + d.Birthdate.Should().BeAfter(1.January(2001)); + }); + + // Assert + act.Should().Throw().WithMessage( + $""" + Expected {nameof(personDto)} to match inspector, but the inspector was not satisfied: + *Expected d.Name* + *Expected d.Age* + *Expected d.Birthdate* + """); + } + + [Fact] + public void Complex_typed_object_not_satisfying_inspector_throws() + { + // Arrange + var complexDto = new PersonAndAddressDto + { + Person = new PersonDto + { + Name = "Buford Howard Tannen", + Birthdate = new DateTime(1937, 3, 26), + }, + Address = new AddressDto + { + Street = "Mason Street", + Number = "1809", + City = "Hill Valley", + Country = "United States", + PostalCode = "CA 91905", + }, + }; + + // Act + Action act = () => complexDto.Should().Satisfy(dto => + { + dto.Person.Should().Satisfy(person => + { + person.Name.Should().Be("Biff Tannen"); + person.Age.Should().Be(48); + person.Birthdate.Should().Be(26.March(1937)); + }); + + dto.Address.Should().Satisfy(address => + { + address.Street.Should().Be("Mason Street"); + address.Number.Should().Be("1809"); + address.City.Should().Be("Hill Valley, San Diego County, California"); + address.Country.Should().Be("United States"); + address.PostalCode.Should().Be("CA 91905"); + }); + }); + + // Assert + act.Should().Throw().WithMessage( + $""" + Expected {nameof(complexDto)} to match inspector, but the inspector was not satisfied: + *Expected dto.Person to match inspector* + *Expected person.Name* + *Expected dto.Address to match inspector* + *Expected address.City* + """); + } + + [Fact] + public void Typed_object_satisfied_against_incorrect_type_throws() + { + // Arrange + var personDto = new PersonDto(); + + // Act + Action act = () => personDto.Should().Satisfy(dto => dto.Should().NotBeNull()); + + // Assert + act.Should().Throw() + .WithMessage( + $"Expected {nameof(personDto)} to be assignable to {typeof(AddressDto)}, but {typeof(PersonDto)} is not."); + } + + [Fact] + public void Sub_class_satisfied_against_base_class_does_not_throw() + { + // Arrange + var subClass = new SubClass + { + Number = 42, + Date = new DateTime(2021, 1, 1), + Text = "Some text" + }; + + // Act / Assert + subClass.Should().Satisfy(x => + { + x.Number.Should().Be(42); + x.Date.Should().Be(1.January(2021)); + }); + } + + [Fact] + public void Base_class_satisfied_against_sub_class_throws() + { + // Arrange + var baseClass = new BaseClass + { + Number = 42, + Date = new DateTime(2021, 1, 1), + }; + + // Act + Action act = () => baseClass.Should().Satisfy(x => + { + x.Number.Should().Be(42); + x.Date.Should().Be(1.January(2021)); + x.Text.Should().Be("Some text"); + }); + + // Assert + act.Should().Throw() + .WithMessage( + $"Expected {nameof(baseClass)} to be assignable to {typeof(SubClass)}, but {typeof(BaseClass)} is not."); + } + + [Fact] + public void Nested_assertion_on_null_throws() + { + // Arrange + var complexDto = new PersonAndAddressDto + { + Person = new PersonDto + { + Name = "Buford Howard Tannen", + }, + Address = null, + }; + + // Act + Action act = () => complexDto.Should().Satisfy(dto => + { + dto.Person.Name.Should().Be("Buford Howard Tannen"); + dto.Address.Should().Satisfy(address => address.City.Should().Be("Hill Valley")); + }); + + // Assert + act.Should().Throw() + .WithMessage( + $""" + Expected {nameof(complexDto)} to match inspector, but the inspector was not satisfied: + *Expected dto.Address to be assignable to {typeof(AddressDto)}, but found . + """); + } + + [Fact] + public void Using_nested_assertion_scope() + { + // Arrange + var complexDto = new PersonAndAddressDto + { + Person = new PersonDto + { + Name = "Buford Howard Tannen", + }, + Address = null, + }; + + // Act + Action act = () => complexDto.Should().Satisfy(dto => + { + dto.Person.Name.Should().Be("Buford Howard Tannen"); + + using (new AssertionScope()) + { + dto.Address.Should().Satisfy(address => address.City.Should().Be("Hill Valley")); + } + }); + + // Assert + act.Should().Throw() + .WithMessage( + $""" + Expected {nameof(complexDto)} to match inspector, but the inspector was not satisfied: + *Expected dto.Address to be assignable to {typeof(AddressDto)}, but found . + """); + } + + [Fact] + public void Using_assertion_scope_with_null_subject() + { + // Arrange + object subject = null; + + // Act + Action act = () => + { + using (new AssertionScope()) + { + subject.Should().Satisfy(x => x.Should().NotBeNull()); + } + }; + + // Assert + act.Should().Throw() + .WithMessage("Expected subject to be assignable to System.Object, but found ."); + } + + [Fact] + public void Using_assertion_scope_with_subject_satisfied_against_incorrect_type_throws() + { + // Arrange + var personDto = new PersonDto(); + + // Act + Action act = () => + { + using (new AssertionScope()) + { + personDto.Should().Satisfy(dto => dto.Should().NotBeNull()); + } + }; + + // Assert + act.Should().Throw() + .WithMessage( + $"Expected {nameof(personDto)} to be assignable to {typeof(AddressDto)}, but {typeof(PersonDto)} is not."); + } + } + + private class PersonDto + { + public string Name { get; init; } + + public DateTime Birthdate { get; init; } + + public int Age => DateTime.UtcNow.Subtract(Birthdate).Days / 365; + } + + private class PersonAndAddressDto + { + public PersonDto Person { get; init; } + + public AddressDto Address { get; init; } + } + + private class AddressDto + { + public string Street { get; init; } + + public string Number { get; init; } + + public string City { get; init; } + + public string PostalCode { get; init; } + + public string Country { get; init; } + } + + private class BaseClass + { + public int Number { get; init; } + + public DateTime Date { get; init; } + } + + private sealed class SubClass : BaseClass + { + public string Text { get; init; } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs index 1f2369981a..191ea2e41e 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs @@ -8,7 +8,7 @@ namespace FluentAssertions.Specs.Primitives; -public class ReferenceTypeAssertionsSpecs +public partial class ReferenceTypeAssertionsSpecs { [Fact] public void When_the_same_objects_are_expected_to_be_the_same_it_should_not_fail() diff --git a/docs/_pages/basicassertions.md b/docs/_pages/basicassertions.md index 4adf6b4608..0213ec2932 100644 --- a/docs/_pages/basicassertions.md +++ b/docs/_pages/basicassertions.md @@ -70,6 +70,34 @@ dummy.Should().Match(d => (d == "System.Object")); dummy.Should().Match((string d) => (d == "System.Object")); ``` +As an alternative to using predicate matching, it is also possible to use element inspectors to do nested assertions in a fluent way. + +```csharp +var productDto = new ProductDto +{ + Name = "Some product name", + Price = 19.95, + SKU = "ABC12345", + Store = new Store + { + Country = "Germany", + Quantity = 42 + } +}; + +productDto.Should().Satisfy(dto => +{ + dto.Name.Should().Be("Some product name"); + dto.Price.Should().Be(19.95); + dto.SKU.Should().EndWith("12345"); + dto.Store.Should().Satisfy(store => + { + store.Country.Should().Be("Germany"); + store.Quantity.Should().BeGreaterThan(40); + }); +}); +``` + Some users requested the ability to easily downcast an object to one of its derived classes in a fluent way. ```csharp diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 3cbed469d0..328b16772a 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -15,6 +15,7 @@ sidebar: * Ensure compatibility with .NET 8 - [#2466](https://github.com/fluentassertions/fluentassertions/pull/2466) * Add support for NUnit 4 - [#2483](https://github.com/fluentassertions/fluentassertions/pull/2483) * Added `NotBeIn` to check if a `DateTime` is not in a given `DateTimeKind` - [#2536](https://github.com/fluentassertions/fluentassertions/pull/2536) +* Introduced a new `Satisfy` method available to all reference types to allow for nested assertions - [#2597](https://github.com/fluentassertions/fluentassertions/pull/2597) * Added `BeNaN` and `NotBeNaN` for assertions on `float` and `double` - [#2606](https://github.com/fluentassertions/fluentassertions/pull/2606) * Added option for event monitoring to ignore failing event accessors - [#2629](https://github.com/fluentassertions/fluentassertions/pull/2629) From d2a7dc07f989c6c106d5620480e5dac9a7def40a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:54:50 +0000 Subject: [PATCH 335/845] Bump cspell from 8.8.3 to 8.8.4 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.8.3 to 8.8.4. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.8.4/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 238 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 120 insertions(+), 120 deletions(-) diff --git a/package-lock.json b/package-lock.json index 02b0586c49..8d96fd5f6d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,19 +7,19 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.8.3" + "cspell": "^8.8.4" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.8.3.tgz", - "integrity": "sha512-nRa30TQwE4R5xcM6CBibM2l7D359ympexjm7OrykzYmStIiiudDIsuNOIXGBrDouxRFgKGAa/ETo1g+Pxz7kNA==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.8.4.tgz", + "integrity": "sha512-k9ZMO2kayQFXB3B45b1xXze3MceAMNy9U+D7NTnWB1i3S0y8LhN53U9JWWgqHGPQaHaLHzizL7/w1aGHTA149Q==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.2", "@cspell/dict-bash": "^4.1.3", - "@cspell/dict-companies": "^3.1.0", - "@cspell/dict-cpp": "^5.1.6", + "@cspell/dict-companies": "^3.1.2", + "@cspell/dict-cpp": "^5.1.8", "@cspell/dict-cryptocurrencies": "^5.0.0", "@cspell/dict-csharp": "^4.0.2", "@cspell/dict-css": "^4.0.12", @@ -28,7 +28,7 @@ "@cspell/dict-docker": "^1.1.7", "@cspell/dict-dotnet": "^5.0.2", "@cspell/dict-elixir": "^4.0.3", - "@cspell/dict-en_us": "^4.3.20", + "@cspell/dict-en_us": "^4.3.21", "@cspell/dict-en-common-misspellings": "^2.0.1", "@cspell/dict-en-gb": "1.1.33", "@cspell/dict-filetypes": "^3.0.4", @@ -38,13 +38,13 @@ "@cspell/dict-gaming-terms": "^1.0.5", "@cspell/dict-git": "^3.0.0", "@cspell/dict-golang": "^6.0.9", - "@cspell/dict-google": "^1.0.0", + "@cspell/dict-google": "^1.0.1", "@cspell/dict-haskell": "^4.0.1", "@cspell/dict-html": "^4.0.5", "@cspell/dict-html-symbol-entities": "^4.0.0", "@cspell/dict-java": "^5.0.6", "@cspell/dict-julia": "^1.0.1", - "@cspell/dict-k8s": "^1.0.3", + "@cspell/dict-k8s": "^1.0.5", "@cspell/dict-latex": "^4.0.0", "@cspell/dict-lorem-ipsum": "^4.0.0", "@cspell/dict-lua": "^4.0.3", @@ -54,13 +54,13 @@ "@cspell/dict-npm": "^5.0.16", "@cspell/dict-php": "^4.0.7", "@cspell/dict-powershell": "^5.0.4", - "@cspell/dict-public-licenses": "^2.0.6", + "@cspell/dict-public-licenses": "^2.0.7", "@cspell/dict-python": "^4.1.11", "@cspell/dict-r": "^2.0.1", "@cspell/dict-ruby": "^5.0.2", "@cspell/dict-rust": "^4.0.3", "@cspell/dict-scala": "^5.0.2", - "@cspell/dict-software-terms": "^3.3.23", + "@cspell/dict-software-terms": "^3.4.1", "@cspell/dict-sql": "^2.1.3", "@cspell/dict-svelte": "^1.0.2", "@cspell/dict-swift": "^2.0.1", @@ -73,28 +73,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.8.3.tgz", - "integrity": "sha512-XP8x446IO9iHKvEN1IrJwOC5wC2uwmbdgFiUiXfzPSAlPfRWBmzOR68UR0Z6LNpm1GB4sUxxQkx2CRqDyGaSng==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.8.4.tgz", + "integrity": "sha512-ITpOeNyDHD+4B9QmLJx6YYtrB1saRsrCLluZ34YaICemNLuumVRP1vSjcdoBtefvGugCOn5nPK7igw0r/vdAvA==", "dependencies": { - "@cspell/cspell-types": "8.8.3" + "@cspell/cspell-types": "8.8.4" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.8.3.tgz", - "integrity": "sha512-tzngpFKXeUsdTZEErffTlwUnPIKYgyRKy0YTrD77EkhyDSbUnaS8JWqtGZbKV7iQ+R4CL7tiaubPjUzkbWj+kQ==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.8.4.tgz", + "integrity": "sha512-Uis9iIEcv1zOogXiDVSegm9nzo5NRmsRDsW8CteLRg6PhyZ0nnCY1PZIUy3SbGF0vIcb/M+XsdLSh2wOPqTXww==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.8.3.tgz", - "integrity": "sha512-pMOB2MJYeria0DeW1dsehRPIHLzoOXCm1Cdjp1kRZ931PbqNCYaE/GM6laWpUTAbS9Ly2tv4g0jK3PUH8ZTtJA==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.8.4.tgz", + "integrity": "sha512-eZVw31nSeh6xKl7TzzkZVMTX/mgwhUw40/q1Sqo7CTPurIBg66oelEqKRclX898jzd2/qSK+ZFwBDxvV7QH38A==", "dependencies": { "global-directory": "^4.0.1" }, @@ -103,17 +103,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.8.3.tgz", - "integrity": "sha512-QVKe/JZvoTaaBAMXG40HjZib1g6rGgxk03e070GmdfCiMRUCWFtK+9DKVYJfSqjQhzj/eDCrq8aWplHWy66umg==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.8.4.tgz", + "integrity": "sha512-KtwJ38uPLrm2Q8osmMIAl2NToA/CMyZCxck4msQJnskdo30IPSdA1Rh0w6zXinmh1eVe0zNEVCeJ2+x23HqW+g==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.8.3.tgz", - "integrity": "sha512-31wYSBPinhqKi9TSzPg50fWHJmMQwD1d5p26yM/NAfNQvjAfBQlrg4pqix8pxOJkAK5W/TnoaVXjzJ5XCg6arQ==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.8.4.tgz", + "integrity": "sha512-ya9Jl4+lghx2eUuZNY6pcbbrnResgEAomvglhdbEGqy+B5MPEqY5Jt45APEmGqHzTNks7oFFaiTIbXYJAFBR7A==", "engines": { "node": ">=18" } @@ -134,14 +134,14 @@ "integrity": "sha512-tOdI3QVJDbQSwPjUkOiQFhYcu2eedmX/PtEpVWg0aFps/r6AyjUQINtTgpqMYnYuq8O1QUIQqnpx21aovcgZCw==" }, "node_modules/@cspell/dict-companies": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.1.tgz", - "integrity": "sha512-hooOyJ1q3o5tGkUOXyTY04psiYdyrcJkoQHMA4gX0zJzj+pQJCL812V+z9aI4vl1Qhjxfp2YHKF60DM+EndqGQ==" + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.2.tgz", + "integrity": "sha512-OwR5i1xbYuJX7FtHQySmTy3iJtPV1rZQ3jFCxFGwrA1xRQ4rtRcDQ+sTXBCIAoJHkXa84f9J3zsngOKmMGyS/w==" }, "node_modules/@cspell/dict-cpp": { - "version": "5.1.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.7.tgz", - "integrity": "sha512-qVuXo5rm9sySIrDwTfL62WF0BTiJXc4jAa53RvKV2f7wJL4LiJLNPpvY6oNU7G311VLf9QlTteRnlSulZLav/A==" + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.9.tgz", + "integrity": "sha512-lZmPKn3qfkWQ7tr+yw6JhuhscsyRgRHEOpOd0fhtPt0N154FNsGebGGLW0SOZUuGgW7Nk3lCCwHP85GIemnlqQ==" }, "node_modules/@cspell/dict-cryptocurrencies": { "version": "5.0.0", @@ -164,9 +164,9 @@ "integrity": "sha512-cLkwo1KT5CJY5N5RJVHks2genFkNCl/WLfj+0fFjqNR+tk3tBI1LY7ldr9piCtSFSm4x9pO1x6IV3kRUY1lLiw==" }, "node_modules/@cspell/dict-data-science": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-1.0.11.tgz", - "integrity": "sha512-TaHAZRVe0Zlcc3C23StZqqbzC0NrodRwoSAc8dis+5qLeLLnOCtagYQeROQvDlcDg3X/VVEO9Whh4W/z4PAmYQ==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.1.tgz", + "integrity": "sha512-xeutkzK0eBe+LFXOFU2kJeAYO6IuFUc1g7iRLr7HeCmlC4rsdGclwGHh61KmttL3+YHQytYStxaRBdGAXWC8Lw==" }, "node_modules/@cspell/dict-django": { "version": "4.1.0", @@ -259,9 +259,9 @@ "integrity": "sha512-HGRu+48ErJjoweR5IbcixxETRewrBb0uxQBd6xFGcxbEYCX8CnQFTAmKI5xNaIt2PKaZiJH3ijodGSqbKdsxhw==" }, "node_modules/@cspell/dict-java": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.6.tgz", - "integrity": "sha512-kdE4AHHHrixyZ5p6zyms1SLoYpaJarPxrz8Tveo6gddszBVVwIUZ+JkQE1bWNLK740GWzIXdkznpUfw1hP9nXw==" + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.7.tgz", + "integrity": "sha512-ejQ9iJXYIq7R09BScU2y5OUGrSqwcD+J5mHFOKbduuQ5s/Eh/duz45KOzykeMLI6KHPVxhBKpUPBWIsfewECpQ==" }, "node_modules/@cspell/dict-julia": { "version": "1.0.1", @@ -269,9 +269,9 @@ "integrity": "sha512-4JsCLCRhhLMLiaHpmR7zHFjj1qOauzDI5ZzCNQS31TUMfsOo26jAKDfo0jljFAKgw5M2fEG7sKr8IlPpQAYrmQ==" }, "node_modules/@cspell/dict-k8s": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.4.tgz", - "integrity": "sha512-p3RjEkiwh5b1gLkYUMV9w5MHqWYTI1Sm2j4x8QZ+NZHB53PORrjPDyWSaG4giqKYAfs3UYB7QZUyBt0Sb68Vsw==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.5.tgz", + "integrity": "sha512-Cj+/ZV4S+MKlwfocSJZqe/2UAd/sY8YtlZjbK25VN1nCnrsKrBjfkX29vclwSj1U9aJg4Z9jw/uMjoaKu9ZrpQ==" }, "node_modules/@cspell/dict-latex": { "version": "4.0.0", @@ -309,9 +309,9 @@ "integrity": "sha512-ZWPnLAziEcSCvV0c8k9Qj88pfMu+wZwM5Qks87ShsfBgI8uLZ9tGHravA7gmjH1Gd7Bgxy2ulvXtSqIWPh1lew==" }, "node_modules/@cspell/dict-php": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.7.tgz", - "integrity": "sha512-SUCOBfRDDFz1E2jnAZIIuy8BNbCc8i+VkiL9g4HH9tTN6Nlww5Uz2pMqYS6rZQkXuubqsbkbPlsRiuseEnTmYA==" + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.8.tgz", + "integrity": "sha512-TBw3won4MCBQ2wdu7kvgOCR3dY2Tb+LJHgDUpuquy3WnzGiSDJ4AVelrZdE1xu7mjFJUr4q48aB21YT5uQqPZA==" }, "node_modules/@cspell/dict-powershell": { "version": "5.0.4", @@ -324,11 +324,11 @@ "integrity": "sha512-KlBXuGcN3LE7tQi/GEqKiDewWGGuopiAD0zRK1QilOx5Co8XAvs044gk4MNIQftc8r0nHeUI+irJKLGcR36DIQ==" }, "node_modules/@cspell/dict-python": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.1.11.tgz", - "integrity": "sha512-XG+v3PumfzUW38huSbfT15Vqt3ihNb462ulfXifpQllPok5OWynhszCLCRQjQReV+dgz784ST4ggRxW452/kVg==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.1.tgz", + "integrity": "sha512-9X2jRgyM0cxBoFQRo4Zc8oacyWnXi+0/bMI5FGibZNZV4y/o9UoFEr6agjU260/cXHTjIdkX233nN7eb7dtyRg==", "dependencies": { - "@cspell/dict-data-science": "^1.0.11" + "@cspell/dict-data-science": "^2.0.1" } }, "node_modules/@cspell/dict-r": { @@ -352,9 +352,9 @@ "integrity": "sha512-v97ClgidZt99JUm7OjhQugDHmhx4U8fcgunHvD/BsXWjXNj4cTr0m0YjofyZoL44WpICsNuFV9F/sv9OM5HUEw==" }, "node_modules/@cspell/dict-software-terms": { - "version": "3.3.25", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.3.25.tgz", - "integrity": "sha512-IrNpxU9q4R42ZO9qXm1lqKXqIJwS83eRvo2eDXVau9qEw26+wJqDAOJsdhmrBJ+Dj9Y6r+k70pu02qJTYRwBPg==" + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.4.3.tgz", + "integrity": "sha512-3E09j80zFbTkgDyoZc0hVhwVjWsG9iD8kqnHwO/5grsoqJMCdeeEWAL71Uf7+MgDqnKP4N2TwxSBzbTFKIufUQ==" }, "node_modules/@cspell/dict-sql": { "version": "2.1.3", @@ -387,9 +387,9 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.8.3.tgz", - "integrity": "sha512-qpxGC2hGVfbSaLJkaEu//rqbgAOjYnMlbxD75Fk9ny96sr+ZI1YC0nmUErWlgXSbtjVY/DHCOu26Usweo5iRgA==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.8.4.tgz", + "integrity": "sha512-tseSxrybznkmsmPaAB4aoHB9wr8Q2fOMIy3dm+yQv+U1xj+JHTN9OnUvy9sKiq0p3DQGWm/VylgSgsYaXrEHKQ==", "dependencies": { "import-meta-resolve": "^4.1.0" }, @@ -398,9 +398,9 @@ } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.8.3.tgz", - "integrity": "sha512-y/pL7Zex8iHQ54qDYvg9oCiCgfZ9DAUTOI/VtPFVC+42JqLx6YufYxJS2uAsFlfAXIPiRV8qnnG6BHImD1Ix6g==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.8.4.tgz", + "integrity": "sha512-gticEJGR6yyGeLjf+mJ0jZotWYRLVQ+J0v1VpsR1nKnXTRJY15BWXgEA/ifbU/+clpyCek79NiCIXCvmP1WT4A==", "engines": { "node": ">=18" } @@ -633,21 +633,21 @@ } }, "node_modules/cspell": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.8.3.tgz", - "integrity": "sha512-JVWI4MNALOuZ+igyJ54C6Iwe8s1ecMCgyGFGId5a0P6wi/V+TFYFhl7QkzIi1Uw4KtXSYrUSlHGUjC2dE0OZ9g==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.8.4.tgz", + "integrity": "sha512-eRUHiXvh4iRapw3lqE1nGOEAyYVfa/0lgK/e34SpcM/ECm4QuvbfY7Yl0ozCbiYywecog0RVbeJJUEYJTN5/Mg==", "dependencies": { - "@cspell/cspell-json-reporter": "8.8.3", - "@cspell/cspell-pipe": "8.8.3", - "@cspell/cspell-types": "8.8.3", - "@cspell/dynamic-import": "8.8.3", + "@cspell/cspell-json-reporter": "8.8.4", + "@cspell/cspell-pipe": "8.8.4", + "@cspell/cspell-types": "8.8.4", + "@cspell/dynamic-import": "8.8.4", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-gitignore": "8.8.3", - "cspell-glob": "8.8.3", - "cspell-io": "8.8.3", - "cspell-lib": "8.8.3", + "cspell-gitignore": "8.8.4", + "cspell-glob": "8.8.4", + "cspell-io": "8.8.4", + "cspell-lib": "8.8.4", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^8.0.0", @@ -668,26 +668,26 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.8.3.tgz", - "integrity": "sha512-61NKZrzTi9OLEEiZBggLQy9nswgR0gd6bKH06xXFQyRfNpAjaPOzOUFhSSfX1MQX+lQF3KtSYcHpppwbpPsL8w==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.8.4.tgz", + "integrity": "sha512-Xf+aL669Cm+MYZTZULVWRQXB7sRWx9qs0hPrgqxeaWabLUISK57/qwcI24TPVdYakUCoud9Nv+woGi5FcqV5ZQ==", "dependencies": { - "@cspell/cspell-types": "8.8.3", + "@cspell/cspell-types": "8.8.4", "comment-json": "^4.2.3", - "yaml": "^2.4.2" + "yaml": "^2.4.3" }, "engines": { "node": ">=18" } }, "node_modules/cspell-dictionary": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.8.3.tgz", - "integrity": "sha512-g2G3uh8JbuJKAYFdFQENcbTIrK9SJRXBiQ/t+ch+9I/t5HmuGOVe+wxKEM/0c9M2CRLpzJShBvttH9rnw4Yqfg==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.8.4.tgz", + "integrity": "sha512-eDi61MDDZycS5EASz5FiYKJykLEyBT0mCvkYEUCsGVoqw8T9gWuWybwwqde3CMq9TOwns5pxGcFs2v9RYgtN5A==", "dependencies": { - "@cspell/cspell-pipe": "8.8.3", - "@cspell/cspell-types": "8.8.3", - "cspell-trie-lib": "8.8.3", + "@cspell/cspell-pipe": "8.8.4", + "@cspell/cspell-types": "8.8.4", + "cspell-trie-lib": "8.8.4", "fast-equals": "^5.0.1", "gensequence": "^7.0.0" }, @@ -696,11 +696,11 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.8.3.tgz", - "integrity": "sha512-+IeVPNnUJOj+D9rc4elbK4DK3p9qxvF/2BMtFsE7a75egeJjAnlzVGzqH2FVMsDj6dxe5bjc8/S4Nhw6B14xTQ==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.8.4.tgz", + "integrity": "sha512-rLdxpBh0kp0scwqNBZaWVnxEVmSK3UWyVSZmyEL4jmmjusHYM9IggfedOhO4EfGCIdQ32j21TevE0tTslyc4iA==", "dependencies": { - "cspell-glob": "8.8.3", + "cspell-glob": "8.8.4", "find-up-simple": "^1.0.0" }, "bin": { @@ -711,9 +711,9 @@ } }, "node_modules/cspell-glob": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.8.3.tgz", - "integrity": "sha512-9c4Nw/bIsjKSuBuRrLa1sWtIzbXXvja+FVbUOE9c2IiZfh6K1I+UssiXTbRTMg6qgTdkfT4o3KOcFN0ZcbmCUQ==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.8.4.tgz", + "integrity": "sha512-+tRrOfTSbF/44uNl4idMZVPNfNM6WTmra4ZL44nx23iw1ikNhqZ+m0PC1oCVSlURNBEn8faFXjC/oT2BfgxoUQ==", "dependencies": { "micromatch": "^4.0.7" }, @@ -722,12 +722,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.8.3.tgz", - "integrity": "sha512-3RP7xQ/6IiIjbWQDuE+4b0ERKkSWGMY75bd0oEsh5HcFhhOYphmcpxLxRRM/yxYQaYgdvq0QIcwrpanx86KJ7A==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.8.4.tgz", + "integrity": "sha512-UxDO517iW6vs/8l4OhLpdMR7Bp+tkquvtld1gWz8WYQiDwORyf0v5a3nMh4ILYZGoolOSnDuI9UjWOLI6L/vvQ==", "dependencies": { - "@cspell/cspell-pipe": "8.8.3", - "@cspell/cspell-types": "8.8.3" + "@cspell/cspell-pipe": "8.8.4", + "@cspell/cspell-types": "8.8.4" }, "bin": { "cspell-grammar": "bin.mjs" @@ -737,35 +737,35 @@ } }, "node_modules/cspell-io": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.8.3.tgz", - "integrity": "sha512-vO7BUa6i7tjmQr+9dw/Ic7tm4ECnSUlbuMv0zJs/SIrO9AcID2pCWPeZNZEGAmeutrEOi2iThZ/uS33aCuv7Jw==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.8.4.tgz", + "integrity": "sha512-aqB/QMx+xns46QSyPEqi05uguCSxvqRnh2S/ZOhhjPlKma/7hK9niPRcwKwJXJEtNzdiZZkkC1uZt9aJe/7FTA==", "dependencies": { - "@cspell/cspell-service-bus": "8.8.3" + "@cspell/cspell-service-bus": "8.8.4" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.8.3.tgz", - "integrity": "sha512-IqtTKBPug5Jzt9T8f/b6qGAbARRR5tpQkLjzsrfLzxM68ery23wEPDtmWToEyc9EslulZGLe0T78XuEU9AMF+g==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.8.4.tgz", + "integrity": "sha512-hK8gYtdQ9Lh86c8cEHITt5SaoJbfvXoY/wtpR4k393YR+eAxKziyv8ihQyFE/Z/FwuqtNvDrSntP9NLwTivd3g==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.8.3", - "@cspell/cspell-pipe": "8.8.3", - "@cspell/cspell-resolver": "8.8.3", - "@cspell/cspell-types": "8.8.3", - "@cspell/dynamic-import": "8.8.3", - "@cspell/strong-weak-map": "8.8.3", + "@cspell/cspell-bundled-dicts": "8.8.4", + "@cspell/cspell-pipe": "8.8.4", + "@cspell/cspell-resolver": "8.8.4", + "@cspell/cspell-types": "8.8.4", + "@cspell/dynamic-import": "8.8.4", + "@cspell/strong-weak-map": "8.8.4", "clear-module": "^4.1.2", "comment-json": "^4.2.3", - "cspell-config-lib": "8.8.3", - "cspell-dictionary": "8.8.3", - "cspell-glob": "8.8.3", - "cspell-grammar": "8.8.3", - "cspell-io": "8.8.3", - "cspell-trie-lib": "8.8.3", + "cspell-config-lib": "8.8.4", + "cspell-dictionary": "8.8.4", + "cspell-glob": "8.8.4", + "cspell-grammar": "8.8.4", + "cspell-io": "8.8.4", + "cspell-trie-lib": "8.8.4", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -780,12 +780,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.8.3.tgz", - "integrity": "sha512-0zrkrhrFLVajwo6++XD9a+r0Olml7UjPgbztjPKbXIJrZCradBF5rvt3wq5mPpsjq2+Dz0z6K5muZpbO+gqapQ==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.8.4.tgz", + "integrity": "sha512-yCld4ZL+pFa5DL+Arfvmkv3cCQUOfdRlxElOzdkRZqWyO6h/UmO8xZb21ixVYHiqhJGZmwc3BG9Xuw4go+RLig==", "dependencies": { - "@cspell/cspell-pipe": "8.8.3", - "@cspell/cspell-types": "8.8.3", + "@cspell/cspell-pipe": "8.8.4", + "@cspell/cspell-types": "8.8.4", "gensequence": "^7.0.0" }, "engines": { @@ -1584,9 +1584,9 @@ } }, "node_modules/yaml": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.2.tgz", - "integrity": "sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", + "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", "bin": { "yaml": "bin.mjs" }, diff --git a/package.json b/package.json index 7ec52f9a13..cbd9d7e62b 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.8.3" + "cspell": "^8.8.4" } } From 9757ddf3c5b9b52f7a822f1e534473040145b1e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 17:46:44 +0200 Subject: [PATCH 336/845] Bump Meziantou.Analyzer from 2.0.155 to 2.0.158 (#2675) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.155 to 2.0.158. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.155...2.0.158) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 9b761e210c..d93b0958e4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From a66fe37e587e28bca590c46bbcd8c152e707e43a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 17:47:37 +0200 Subject: [PATCH 337/845] Bump the xunit group with 3 updates (#2674) Bumps the xunit group with 3 updates: [Verify.Xunit](https://github.com/VerifyTests/Verify), [System.Collections.Immutable](https://github.com/dotnet/runtime) and [System.Threading.Tasks.Extensions](https://github.com/dotnet/corefx). Updates `Verify.Xunit` from 25.0.1 to 25.0.3 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/25.0.1...25.0.3) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) Updates `System.Threading.Tasks.Extensions` from 4.5.0 to 4.5.4 - [Release notes](https://github.com/dotnet/corefx/releases) - [Commits](https://github.com/dotnet/corefx/commits) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: System.Threading.Tasks.Extensions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 485d80f5c6..f5cdf62794 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From e41cd9f8659093fff53a7e9facf9597fd34306d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:01:51 +0000 Subject: [PATCH 338/845] Bump the xunit group with 3 updates Bumps the xunit group with 3 updates: [Verify.Xunit](https://github.com/VerifyTests/Verify), [System.Collections.Immutable](https://github.com/dotnet/runtime) and [System.Threading.Tasks.Extensions](https://github.com/dotnet/corefx). Updates `Verify.Xunit` from 25.0.3 to 25.0.4 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/25.0.3...25.0.4) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) Updates `System.Threading.Tasks.Extensions` from 4.5.0 to 4.5.4 - [Release notes](https://github.com/dotnet/corefx/releases) - [Commits](https://github.com/dotnet/corefx/commits) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: System.Threading.Tasks.Extensions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index f5cdf62794..ff8e5ef732 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 8e9fdb796667d5cce1f946e60eaa2a4b7ffb3667 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:08:03 +0000 Subject: [PATCH 339/845] Bump cspell from 8.8.4 to 8.9.1 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.8.4 to 8.9.1. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.9.1/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 224 ++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 118 insertions(+), 108 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8d96fd5f6d..1cbe139579 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,19 +7,19 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.8.4" + "cspell": "^8.9.1" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.8.4.tgz", - "integrity": "sha512-k9ZMO2kayQFXB3B45b1xXze3MceAMNy9U+D7NTnWB1i3S0y8LhN53U9JWWgqHGPQaHaLHzizL7/w1aGHTA149Q==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.9.1.tgz", + "integrity": "sha512-etkor/qXSSqyh6lbudEGdTami0DooIi2AlQbJPUWRfowzYJRSYWPUbyQSUkFdRhCHni2oLOFbWaraRthNlLD/A==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.2", "@cspell/dict-bash": "^4.1.3", "@cspell/dict-companies": "^3.1.2", - "@cspell/dict-cpp": "^5.1.8", + "@cspell/dict-cpp": "^5.1.10", "@cspell/dict-cryptocurrencies": "^5.0.0", "@cspell/dict-csharp": "^4.0.2", "@cspell/dict-css": "^4.0.12", @@ -28,8 +28,8 @@ "@cspell/dict-docker": "^1.1.7", "@cspell/dict-dotnet": "^5.0.2", "@cspell/dict-elixir": "^4.0.3", - "@cspell/dict-en_us": "^4.3.21", - "@cspell/dict-en-common-misspellings": "^2.0.1", + "@cspell/dict-en_us": "^4.3.22", + "@cspell/dict-en-common-misspellings": "^2.0.2", "@cspell/dict-en-gb": "1.1.33", "@cspell/dict-filetypes": "^3.0.4", "@cspell/dict-fonts": "^4.0.0", @@ -42,7 +42,7 @@ "@cspell/dict-haskell": "^4.0.1", "@cspell/dict-html": "^4.0.5", "@cspell/dict-html-symbol-entities": "^4.0.0", - "@cspell/dict-java": "^5.0.6", + "@cspell/dict-java": "^5.0.7", "@cspell/dict-julia": "^1.0.1", "@cspell/dict-k8s": "^1.0.5", "@cspell/dict-latex": "^4.0.0", @@ -52,15 +52,15 @@ "@cspell/dict-monkeyc": "^1.0.6", "@cspell/dict-node": "^5.0.1", "@cspell/dict-npm": "^5.0.16", - "@cspell/dict-php": "^4.0.7", + "@cspell/dict-php": "^4.0.8", "@cspell/dict-powershell": "^5.0.4", "@cspell/dict-public-licenses": "^2.0.7", - "@cspell/dict-python": "^4.1.11", + "@cspell/dict-python": "^4.2.1", "@cspell/dict-r": "^2.0.1", "@cspell/dict-ruby": "^5.0.2", - "@cspell/dict-rust": "^4.0.3", + "@cspell/dict-rust": "^4.0.4", "@cspell/dict-scala": "^5.0.2", - "@cspell/dict-software-terms": "^3.4.1", + "@cspell/dict-software-terms": "^3.4.6", "@cspell/dict-sql": "^2.1.3", "@cspell/dict-svelte": "^1.0.2", "@cspell/dict-swift": "^2.0.1", @@ -73,28 +73,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.8.4.tgz", - "integrity": "sha512-ITpOeNyDHD+4B9QmLJx6YYtrB1saRsrCLluZ34YaICemNLuumVRP1vSjcdoBtefvGugCOn5nPK7igw0r/vdAvA==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.9.1.tgz", + "integrity": "sha512-sN4PZivGuH/HWScvoCeNuNc5VLSe4F+SeuoyKmsF4uRv447r9sW0/fpjASGqDTjLXpEfWaXDPoIb+0alY3gm+g==", "dependencies": { - "@cspell/cspell-types": "8.8.4" + "@cspell/cspell-types": "8.9.1" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.8.4.tgz", - "integrity": "sha512-Uis9iIEcv1zOogXiDVSegm9nzo5NRmsRDsW8CteLRg6PhyZ0nnCY1PZIUy3SbGF0vIcb/M+XsdLSh2wOPqTXww==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.9.1.tgz", + "integrity": "sha512-wH5Xu8W3aMEWFSpOczMtH/04clLMfDGdbYMYB7w6BeHI/LDW8DZaRhigOOhx9FRgVk/YIVbKKAKVgvFrfD5cEA==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.8.4.tgz", - "integrity": "sha512-eZVw31nSeh6xKl7TzzkZVMTX/mgwhUw40/q1Sqo7CTPurIBg66oelEqKRclX898jzd2/qSK+ZFwBDxvV7QH38A==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.9.1.tgz", + "integrity": "sha512-Q2SOnIi2dnQ2zqPd+tcEYfom9qlsapGyLK4Mdx2Vv29MU2RDZ9VHFDncV6yo6O58gmlYl8sXtJsVceiHgwwlkQ==", "dependencies": { "global-directory": "^4.0.1" }, @@ -103,17 +103,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.8.4.tgz", - "integrity": "sha512-KtwJ38uPLrm2Q8osmMIAl2NToA/CMyZCxck4msQJnskdo30IPSdA1Rh0w6zXinmh1eVe0zNEVCeJ2+x23HqW+g==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.9.1.tgz", + "integrity": "sha512-dPKpqkglGnwvrW9mgbHIdimDQZH3iy8uT8gm3dEO//UahxMBdMpvtdbC3R9kesQCSagvYRVE7hwJvOktSAK+Vg==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.8.4.tgz", - "integrity": "sha512-ya9Jl4+lghx2eUuZNY6pcbbrnResgEAomvglhdbEGqy+B5MPEqY5Jt45APEmGqHzTNks7oFFaiTIbXYJAFBR7A==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.9.1.tgz", + "integrity": "sha512-Z/pTX2i+U5KwyCYRSw8BleJtw81jFifv91DDka4nqi2oyHJ3eEUljVovNOuZ3lotn/ArHdu4rY98s1w6Z69mYw==", "engines": { "node": ">=18" } @@ -139,9 +139,9 @@ "integrity": "sha512-OwR5i1xbYuJX7FtHQySmTy3iJtPV1rZQ3jFCxFGwrA1xRQ4rtRcDQ+sTXBCIAoJHkXa84f9J3zsngOKmMGyS/w==" }, "node_modules/@cspell/dict-cpp": { - "version": "5.1.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.9.tgz", - "integrity": "sha512-lZmPKn3qfkWQ7tr+yw6JhuhscsyRgRHEOpOd0fhtPt0N154FNsGebGGLW0SOZUuGgW7Nk3lCCwHP85GIemnlqQ==" + "version": "5.1.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.10.tgz", + "integrity": "sha512-BmIF0sAz2BgGEOwzYIeEm9ALneDjd1tcTbFbo+A1Hcq3zOKP8yViSgxS9CEN30KOZIyph6Tldp531UPEpoEl0Q==" }, "node_modules/@cspell/dict-cryptocurrencies": { "version": "5.0.0", @@ -189,14 +189,14 @@ "integrity": "sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q==" }, "node_modules/@cspell/dict-en_us": { - "version": "4.3.21", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.21.tgz", - "integrity": "sha512-Bzoo2aS4Pej/MGIFlATpp0wMt9IzVHrhDjdV7FgkAIXbjrOn67ojbTxCgWs8AuCNVfK8lBYGEvs5+ElH1msF8w==" + "version": "4.3.23", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.23.tgz", + "integrity": "sha512-l0SoEQBsi3zDSl3OuL4/apBkxjuj4hLIg/oy6+gZ7LWh03rKdF6VNtSZNXWAmMY+pmb1cGA3ouleTiJIglbsIg==" }, "node_modules/@cspell/dict-en-common-misspellings": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.1.tgz", - "integrity": "sha512-uWaP8UG4uvcPyqaG0FzPKCm5kfmhsiiQ45Fs6b3/AEAqfq7Fj1JW0+S3qRt85FQA9SoU6gUJCz9wkK/Ylh7m5A==" + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.3.tgz", + "integrity": "sha512-8nF1z9nUiSgMyikL66HTbDO7jCGtB24TxKBasXIBwkBKMDZgA2M883iXdeByy6m1JJUcCGFkSftVYp2W0bUgjw==" }, "node_modules/@cspell/dict-en-gb": { "version": "1.1.33", @@ -342,9 +342,9 @@ "integrity": "sha512-cIh8KTjpldzFzKGgrqUX4bFyav5lC52hXDKo4LbRuMVncs3zg4hcSf4HtURY+f2AfEZzN6ZKzXafQpThq3dl2g==" }, "node_modules/@cspell/dict-rust": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.3.tgz", - "integrity": "sha512-8DFCzkFQ+2k3fDaezWc/D+0AyiBBiOGYfSDUfrTNU7wpvUvJ6cRcAUshMI/cn2QW/mmxTspRgVlXsE6GUMz00Q==" + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.4.tgz", + "integrity": "sha512-v9/LcZknt/Xq7m1jdTWiQEtmkVVKdE1etAfGL2sgcWpZYewEa459HeWndNA0gfzQrpWX9sYay18mt7pqClJEdA==" }, "node_modules/@cspell/dict-scala": { "version": "5.0.2", @@ -352,9 +352,9 @@ "integrity": "sha512-v97ClgidZt99JUm7OjhQugDHmhx4U8fcgunHvD/BsXWjXNj4cTr0m0YjofyZoL44WpICsNuFV9F/sv9OM5HUEw==" }, "node_modules/@cspell/dict-software-terms": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.4.3.tgz", - "integrity": "sha512-3E09j80zFbTkgDyoZc0hVhwVjWsG9iD8kqnHwO/5grsoqJMCdeeEWAL71Uf7+MgDqnKP4N2TwxSBzbTFKIufUQ==" + "version": "3.4.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.4.8.tgz", + "integrity": "sha512-r3gvmSGd8wZp4bbofTey/2Tu3gdBc5kxTRoFo1MaCh5vMLiBOSCLvyZgzr0DcMl8c5dxL7nFpNwbWZJxmKmtUA==" }, "node_modules/@cspell/dict-sql": { "version": "2.1.3", @@ -387,9 +387,9 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.8.4.tgz", - "integrity": "sha512-tseSxrybznkmsmPaAB4aoHB9wr8Q2fOMIy3dm+yQv+U1xj+JHTN9OnUvy9sKiq0p3DQGWm/VylgSgsYaXrEHKQ==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.9.1.tgz", + "integrity": "sha512-ao4IDqQ8MyRqiB3NHA8R7ThRsuDLXdSCFm7Pvz8EqDnWaX3NAuClzgT3EoxJlw9pyyPQX3tW5Vg7ft3GSsBFUw==", "dependencies": { "import-meta-resolve": "^4.1.0" }, @@ -398,13 +398,21 @@ } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.8.4.tgz", - "integrity": "sha512-gticEJGR6yyGeLjf+mJ0jZotWYRLVQ+J0v1VpsR1nKnXTRJY15BWXgEA/ifbU/+clpyCek79NiCIXCvmP1WT4A==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.9.1.tgz", + "integrity": "sha512-onD/UPJW7rBQrRDqYNvPUAoWoBp1G2g+mijAD7EkuseyAKTKlKz624rXpHUOTqI814owmhFMNSf2QyYy8gFM6Q==", "engines": { "node": ">=18" } }, + "node_modules/@cspell/url": { + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.9.1.tgz", + "integrity": "sha512-2AncPKGq9fnytwnL7V4KfoSjiEU0m8tVDFerGiDMNmTMWiQ4zj0kTATai118XT1eBVKiyrAotYRLSrsuUo9U3g==", + "engines": { + "node": ">=18.0" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -633,21 +641,21 @@ } }, "node_modules/cspell": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.8.4.tgz", - "integrity": "sha512-eRUHiXvh4iRapw3lqE1nGOEAyYVfa/0lgK/e34SpcM/ECm4QuvbfY7Yl0ozCbiYywecog0RVbeJJUEYJTN5/Mg==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.9.1.tgz", + "integrity": "sha512-tNUITJbyeX/JnhBtMtbZ5hDbkNIHB72iQx3Uw51sWvo8YmIhaP6ma1W8PPNteu8CSlI7r8Z412wpjyR0Mnsr6A==", "dependencies": { - "@cspell/cspell-json-reporter": "8.8.4", - "@cspell/cspell-pipe": "8.8.4", - "@cspell/cspell-types": "8.8.4", - "@cspell/dynamic-import": "8.8.4", + "@cspell/cspell-json-reporter": "8.9.1", + "@cspell/cspell-pipe": "8.9.1", + "@cspell/cspell-types": "8.9.1", + "@cspell/dynamic-import": "8.9.1", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-gitignore": "8.8.4", - "cspell-glob": "8.8.4", - "cspell-io": "8.8.4", - "cspell-lib": "8.8.4", + "cspell-gitignore": "8.9.1", + "cspell-glob": "8.9.1", + "cspell-io": "8.9.1", + "cspell-lib": "8.9.1", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^8.0.0", @@ -668,26 +676,26 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.8.4.tgz", - "integrity": "sha512-Xf+aL669Cm+MYZTZULVWRQXB7sRWx9qs0hPrgqxeaWabLUISK57/qwcI24TPVdYakUCoud9Nv+woGi5FcqV5ZQ==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.9.1.tgz", + "integrity": "sha512-gSXAazmeX+CCpFCsNQQqHRO/nn01kMnCoB0v+7AM0Bip2iDXRl+LmUEJGNcnFaiJG3liaZ8+S5/qCDbza010VQ==", "dependencies": { - "@cspell/cspell-types": "8.8.4", + "@cspell/cspell-types": "8.9.1", "comment-json": "^4.2.3", - "yaml": "^2.4.3" + "yaml": "^2.4.5" }, "engines": { "node": ">=18" } }, "node_modules/cspell-dictionary": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.8.4.tgz", - "integrity": "sha512-eDi61MDDZycS5EASz5FiYKJykLEyBT0mCvkYEUCsGVoqw8T9gWuWybwwqde3CMq9TOwns5pxGcFs2v9RYgtN5A==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.9.1.tgz", + "integrity": "sha512-sJy9gApLxJNE+YqWeulCTj3XC/ME4aacOHEl/SZ5bsaxkGx3KzBlzCMG7LfqUjOM8rwfBPsYO7zWPCiJQgxGPg==", "dependencies": { - "@cspell/cspell-pipe": "8.8.4", - "@cspell/cspell-types": "8.8.4", - "cspell-trie-lib": "8.8.4", + "@cspell/cspell-pipe": "8.9.1", + "@cspell/cspell-types": "8.9.1", + "cspell-trie-lib": "8.9.1", "fast-equals": "^5.0.1", "gensequence": "^7.0.0" }, @@ -696,11 +704,11 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.8.4.tgz", - "integrity": "sha512-rLdxpBh0kp0scwqNBZaWVnxEVmSK3UWyVSZmyEL4jmmjusHYM9IggfedOhO4EfGCIdQ32j21TevE0tTslyc4iA==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.9.1.tgz", + "integrity": "sha512-5RL0mnptiSlF0e+nnJBTlfyN3V/ECsig7jJ0Vw0AImaR7UdFmfxbeQmiZmealapcjhBJ7hnn9ILtemID4y4wxg==", "dependencies": { - "cspell-glob": "8.8.4", + "cspell-glob": "8.9.1", "find-up-simple": "^1.0.0" }, "bin": { @@ -711,9 +719,9 @@ } }, "node_modules/cspell-glob": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.8.4.tgz", - "integrity": "sha512-+tRrOfTSbF/44uNl4idMZVPNfNM6WTmra4ZL44nx23iw1ikNhqZ+m0PC1oCVSlURNBEn8faFXjC/oT2BfgxoUQ==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.9.1.tgz", + "integrity": "sha512-b60WfczgG3NgGp5pyS4NfwSu7FEF7AmkP1btJqj17UAWsm/idUdGdOgaZazZuPgQJbcQvOlpBQP0+SEi8Jo3QA==", "dependencies": { "micromatch": "^4.0.7" }, @@ -722,12 +730,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.8.4.tgz", - "integrity": "sha512-UxDO517iW6vs/8l4OhLpdMR7Bp+tkquvtld1gWz8WYQiDwORyf0v5a3nMh4ILYZGoolOSnDuI9UjWOLI6L/vvQ==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.9.1.tgz", + "integrity": "sha512-BqaDp3Z+baLZyb3A5h/zWESsO7e8vUaOlrDt1RRVEnpboIUnj7iNkcFmDp3s9PTpBCURlgHHs8SR/+c49aKDGg==", "dependencies": { - "@cspell/cspell-pipe": "8.8.4", - "@cspell/cspell-types": "8.8.4" + "@cspell/cspell-pipe": "8.9.1", + "@cspell/cspell-types": "8.9.1" }, "bin": { "cspell-grammar": "bin.mjs" @@ -737,35 +745,37 @@ } }, "node_modules/cspell-io": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.8.4.tgz", - "integrity": "sha512-aqB/QMx+xns46QSyPEqi05uguCSxvqRnh2S/ZOhhjPlKma/7hK9niPRcwKwJXJEtNzdiZZkkC1uZt9aJe/7FTA==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.9.1.tgz", + "integrity": "sha512-O2F79Rzj28Mvmj4AQLkDWOXWaLnvkJhxPm/Yb3viKlbhwmL5BWUi0APbWA3dtyF+ImX1W27YrNFyvT/PGNZ5Dw==", "dependencies": { - "@cspell/cspell-service-bus": "8.8.4" + "@cspell/cspell-service-bus": "8.9.1", + "@cspell/url": "8.9.1" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.8.4.tgz", - "integrity": "sha512-hK8gYtdQ9Lh86c8cEHITt5SaoJbfvXoY/wtpR4k393YR+eAxKziyv8ihQyFE/Z/FwuqtNvDrSntP9NLwTivd3g==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.9.1.tgz", + "integrity": "sha512-xrtoXvSjkMcwE1yUcyjiqLFPZiK0CNQjOKKS9PQaaK7ZBoERPQ7grz05uFCYdboSXt0FhlP8tC9E5oEt+xtGCA==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.8.4", - "@cspell/cspell-pipe": "8.8.4", - "@cspell/cspell-resolver": "8.8.4", - "@cspell/cspell-types": "8.8.4", - "@cspell/dynamic-import": "8.8.4", - "@cspell/strong-weak-map": "8.8.4", + "@cspell/cspell-bundled-dicts": "8.9.1", + "@cspell/cspell-pipe": "8.9.1", + "@cspell/cspell-resolver": "8.9.1", + "@cspell/cspell-types": "8.9.1", + "@cspell/dynamic-import": "8.9.1", + "@cspell/strong-weak-map": "8.9.1", + "@cspell/url": "8.9.1", "clear-module": "^4.1.2", "comment-json": "^4.2.3", - "cspell-config-lib": "8.8.4", - "cspell-dictionary": "8.8.4", - "cspell-glob": "8.8.4", - "cspell-grammar": "8.8.4", - "cspell-io": "8.8.4", - "cspell-trie-lib": "8.8.4", + "cspell-config-lib": "8.9.1", + "cspell-dictionary": "8.9.1", + "cspell-glob": "8.9.1", + "cspell-grammar": "8.9.1", + "cspell-io": "8.9.1", + "cspell-trie-lib": "8.9.1", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -780,12 +790,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.8.4.tgz", - "integrity": "sha512-yCld4ZL+pFa5DL+Arfvmkv3cCQUOfdRlxElOzdkRZqWyO6h/UmO8xZb21ixVYHiqhJGZmwc3BG9Xuw4go+RLig==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.9.1.tgz", + "integrity": "sha512-rUED/lNlFcsRfkMal6+zLz7JW3/cV79KGhwxnwu1fjNS0nlLSAUGTTiAQBQSR+pU/UW+BTkmULHVuNh+DUN93w==", "dependencies": { - "@cspell/cspell-pipe": "8.8.4", - "@cspell/cspell-types": "8.8.4", + "@cspell/cspell-pipe": "8.9.1", + "@cspell/cspell-types": "8.9.1", "gensequence": "^7.0.0" }, "engines": { diff --git a/package.json b/package.json index cbd9d7e62b..d321ae2046 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.8.4" + "cspell": "^8.9.1" } } From 180c1a33aa41538674fad623c37af4bb20c586ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:03:14 +0000 Subject: [PATCH 340/845] Bump Machine.Specifications from 1.1.1 to 1.1.2 Bumps [Machine.Specifications](https://github.com/machine/machine.specifications) from 1.1.1 to 1.1.2. - [Release notes](https://github.com/machine/machine.specifications/releases) - [Commits](https://github.com/machine/machine.specifications/compare/v1.1.1...v1.1.2) --- updated-dependencies: - dependency-name: Machine.Specifications dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj index 1c5ade016e..66b2e83657 100644 --- a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj +++ b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + \ No newline at end of file From 002b9623e84e24d818a223c45edbe3a015105e66 Mon Sep 17 00:00:00 2001 From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> Date: Thu, 27 Jun 2024 15:03:07 +0200 Subject: [PATCH 341/845] Remove non-compliant `StringSyntaxAttribute` (#2669) * Fix Qodana issue * Update ContinuedAssertionScope.cs Co-authored-by: ITaluone <44049228+ITaluone@users.noreply.github.com> * Update ContinuedAssertionScope.cs Co-authored-by: ITaluone <44049228+ITaluone@users.noreply.github.com> * Update ContinuedAssertionScope.cs Co-authored-by: ITaluone <44049228+ITaluone@users.noreply.github.com> --------- Co-authored-by: ITaluone <44049228+ITaluone@users.noreply.github.com> --- Src/FluentAssertions/Execution/ContinuedAssertionScope.cs | 4 ++-- Src/FluentAssertions/Execution/FailReason.cs | 4 +--- Src/FluentAssertions/Execution/MessageBuilder.cs | 5 ++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Src/FluentAssertions/Execution/ContinuedAssertionScope.cs b/Src/FluentAssertions/Execution/ContinuedAssertionScope.cs index e85596ebdb..1cc2d6dba9 100644 --- a/Src/FluentAssertions/Execution/ContinuedAssertionScope.cs +++ b/Src/FluentAssertions/Execution/ContinuedAssertionScope.cs @@ -88,7 +88,7 @@ public Continuation FailWith(Func failReasonFunc) } /// - public Continuation FailWith([StringSyntax("CompositeFormat")] string message, params object[] args) + public Continuation FailWith(string message, params object[] args) { if (continueAsserting) { @@ -118,7 +118,7 @@ public Continuation ClearExpectation() } /// - public IAssertionScope WithExpectation([StringSyntax("CompositeFormat")] string message, params object[] args) + public IAssertionScope WithExpectation(string message, params object[] args) { if (continueAsserting) { diff --git a/Src/FluentAssertions/Execution/FailReason.cs b/Src/FluentAssertions/Execution/FailReason.cs index bfc650fd8d..420f3a2e47 100644 --- a/Src/FluentAssertions/Execution/FailReason.cs +++ b/Src/FluentAssertions/Execution/FailReason.cs @@ -1,5 +1,3 @@ -using System.Diagnostics.CodeAnalysis; - namespace FluentAssertions.Execution; /// @@ -29,7 +27,7 @@ public class FailReason /// /// /// - public FailReason([StringSyntax("CompositeFormat")] string message, params object[] args) + public FailReason(string message, params object[] args) { Message = message; Args = args; diff --git a/Src/FluentAssertions/Execution/MessageBuilder.cs b/Src/FluentAssertions/Execution/MessageBuilder.cs index 02f07c9e1d..faecdcb59b 100644 --- a/Src/FluentAssertions/Execution/MessageBuilder.cs +++ b/Src/FluentAssertions/Execution/MessageBuilder.cs @@ -1,7 +1,6 @@ #region using System; -using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Text.RegularExpressions; @@ -31,7 +30,7 @@ public MessageBuilder(FormattingOptions formattingOptions) } // SMELL: Too many parameters. - public string Build([StringSyntax("CompositeFormat")] string message, object[] messageArgs, string reason, ContextDataItems contextData, string identifier, + public string Build(string message, object[] messageArgs, string reason, ContextDataItems contextData, string identifier, string fallbackIdentifier) { message = message.Replace("{reason}", SanitizeReason(reason), StringComparison.Ordinal); @@ -90,7 +89,7 @@ private static string SubstituteContextualTags(string message, ContextDataItems }); } - private string FormatArgumentPlaceholders([StringSyntax("CompositeFormat")] string failureMessage, object[] failureArgs) + private string FormatArgumentPlaceholders(string failureMessage, object[] failureArgs) { string[] values = failureArgs.Select(a => Formatter.ToString(a, formattingOptions)).ToArray(); From 5b131c1602d0dbe865b106b8081e84d9bf42f32f Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Thu, 20 Jun 2024 13:29:42 +0200 Subject: [PATCH 342/845] Improve code coverage in `TaskFormatter` --- Src/FluentAssertions/Formatting/TaskFormatter.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Src/FluentAssertions/Formatting/TaskFormatter.cs b/Src/FluentAssertions/Formatting/TaskFormatter.cs index 34547d9d0a..993597ad2c 100644 --- a/Src/FluentAssertions/Formatting/TaskFormatter.cs +++ b/Src/FluentAssertions/Formatting/TaskFormatter.cs @@ -3,7 +3,7 @@ namespace FluentAssertions.Formatting; /// -/// Provides a human readable version of a generic or non-generic +/// Provides a human-readable version of a generic or non-generic /// including its state. /// public class TaskFormatter : IValueFormatter @@ -15,14 +15,8 @@ public bool CanHandle(object value) public void Format(object value, FormattedObjectGraph formattedGraph, FormattingContext context, FormatChild formatChild) { - if (value is Task task) - { - formatChild("type", task.GetType(), formattedGraph); - formattedGraph.AddFragment($" {{Status={task.Status}}}"); - } - else - { - formattedGraph.AddFragment(""); - } + var task = (Task)value; + formatChild("type", task.GetType(), formattedGraph); + formattedGraph.AddFragment($" {{Status={task.Status}}}"); } } From 6710ad1286b7ce97e182b6c97db02d51574ae588 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Thu, 20 Jun 2024 14:31:44 +0200 Subject: [PATCH 343/845] Use interpolated string for `GuidValueFormatter` --- Src/FluentAssertions/Formatting/GuidValueFormatter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/FluentAssertions/Formatting/GuidValueFormatter.cs b/Src/FluentAssertions/Formatting/GuidValueFormatter.cs index 3d76933951..54063e89a5 100644 --- a/Src/FluentAssertions/Formatting/GuidValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/GuidValueFormatter.cs @@ -18,6 +18,6 @@ public bool CanHandle(object value) public void Format(object value, FormattedObjectGraph formattedGraph, FormattingContext context, FormatChild formatChild) { - formattedGraph.AddFragment("{" + value + "}"); + formattedGraph.AddFragment($"{{{value}}}"); } } From 2202c6543fd98f553e80391ce36208017d35493e Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Thu, 20 Jun 2024 14:32:14 +0200 Subject: [PATCH 344/845] Use interpolated string literal for `StringValueFormatter` --- Src/FluentAssertions/Formatting/StringValueFormatter.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Src/FluentAssertions/Formatting/StringValueFormatter.cs b/Src/FluentAssertions/Formatting/StringValueFormatter.cs index 6850d65db1..752619dbca 100644 --- a/Src/FluentAssertions/Formatting/StringValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/StringValueFormatter.cs @@ -16,7 +16,9 @@ public bool CanHandle(object value) public void Format(object value, FormattedObjectGraph formattedGraph, FormattingContext context, FormatChild formatChild) { - string result = "\"" + value + "\""; + string result = $""" + "{value}" + """; formattedGraph.AddFragment(result); } From 90f8f2609dafdd329bb9de7cb119dfd1bd3ec031 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Thu, 20 Jun 2024 15:53:10 +0200 Subject: [PATCH 345/845] Remove unused method in `FormatterObjectGraph` --- .../Formatting/FormattedObjectGraph.cs | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs b/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs index b551d31495..750646ce27 100644 --- a/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs +++ b/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs @@ -101,7 +101,7 @@ private void FlushCurrentLine() { if (lineBuilder.Length > 0) { - AppendSafely(lineBuilderWhitespace + lineBuilder); + AppendSafely($"{lineBuilderWhitespace}{lineBuilder}"); lineBuilder.Clear(); lineBuilderWhitespace = Whitespace; @@ -250,24 +250,6 @@ internal void AddLineOrFragment(string fragment) } } - /// - /// Write the fragment. If more lines have been added since this instance was - /// created then also flush the line and indent the next line. - /// - internal void AddEndingLineOrFragment(string fragment) - { - if (FormatOnSingleLine) - { - parentGraph.AddFragment(fragment); - } - else - { - parentGraph.AddFragment(fragment); - parentGraph.FlushCurrentLine(); - parentGraph.lineBuilderWhitespace += MakeWhitespace(1); - } - } - internal void AddFragment(string fragment) => parentGraph.AddFragment(fragment); } } From df63edf99295fb7af54585eb0f014b620f6a4de5 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Tue, 25 Jun 2024 12:16:06 +0200 Subject: [PATCH 346/845] Remove unreachable path in `DateTimeOffsetValueFormatter` --- .../Formatting/DateTimeOffsetValueFormatter.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Src/FluentAssertions/Formatting/DateTimeOffsetValueFormatter.cs b/Src/FluentAssertions/Formatting/DateTimeOffsetValueFormatter.cs index 9e916f4a92..1c9085dab7 100644 --- a/Src/FluentAssertions/Formatting/DateTimeOffsetValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/DateTimeOffsetValueFormatter.cs @@ -92,14 +92,7 @@ public void Format(object value, FormattedObjectGraph formattedGraph, Formatting if (!hasDate && !hasTime) { - if (HasMilliSeconds(dateTimeOffset)) - { - formattedGraph.AddFragment("0001-01-01 00:00:00." + dateTimeOffset.ToString("fff", CultureInfo.InvariantCulture)); - } - else - { - formattedGraph.AddFragment("0001-01-01 00:00:00.000"); - } + formattedGraph.AddFragment("0001-01-01 00:00:00.000"); } formattedGraph.AddFragment(">"); From f9296a345cee525783d21c4c93160c9d9e825801 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Sat, 29 Jun 2024 09:02:12 +0200 Subject: [PATCH 347/845] Add missing tests for several `NumericAssertions` (#2686) `ByteAssertions` `NullableByteAssertions` `NullableInt*Assertions` `NullableUInt*Assertions` --- ...ableNumericAssertionSpecs.BeGreaterThan.cs | 130 ++++++++++++++++++ ...ullableNumericAssertionSpecs.BeLessThan.cs | 32 +++++ .../NumericAssertionSpecs.BeGreaterThan.cs | 86 ++++++++++++ .../NumericAssertionSpecs.BeLessThan.cs | 32 +++++ 4 files changed, 280 insertions(+) diff --git a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeGreaterThan.cs b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeGreaterThan.cs index 8d1acc61cc..026c01aa92 100644 --- a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeGreaterThan.cs +++ b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeGreaterThan.cs @@ -67,5 +67,135 @@ public void NaN_is_never_greater_than_another_double() .Should().Throw() .WithMessage("*NaN*"); } + + [Theory] + [InlineData(5, 5)] + [InlineData(1, 10)] + [InlineData(0, 5)] + [InlineData(0, 0)] + [InlineData(-1, 5)] + [InlineData(-1, -1)] + [InlineData(10, 10)] + public void To_test_the_null_path_for_difference_on_nullable_int(int? subject, int expectation) + { + // Arrange + // Act + Action act = () => subject.Should().BeGreaterThan(expectation); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } + + [Fact] + public void To_test_the_null_path_for_difference_on_nullable_byte() + { + // Arrange + var value = (byte?)1; + + // Act + Action act = () => value.Should().BeGreaterThan(1); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } + + [Fact] + public void To_test_the_non_null_path_for_difference_on_nullable_byte() + { + // Arrange + var value = (byte?)1; + + // Act + Action act = () => value.Should().BeGreaterThan(2); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } + + [Fact] + public void To_test_the_null_path_for_difference_on_nullable_decimal() + { + // Arrange + var value = (decimal?)11.0; + + // Act + Action act = () => value.Should().BeGreaterThan(11M); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } + + [Fact] + public void To_test_the_null_path_for_difference_on_short() + { + // Arrange + var value = (short?)11; + + // Act + Action act = () => value.Should().BeGreaterThan(11); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } + + [Fact] + public void To_test_the_null_path_for_difference_on_nullable_short() + { + // Arrange + var value = (short?)11; + + // Act + Action act = () => value.Should().BeGreaterThan(11); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } + + [Fact] + public void To_test_the_null_path_for_difference_on_nullable_ushort() + { + // Arrange + var value = (ushort?)11; + + // Act + Action act = () => value.Should().BeGreaterThan(11); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } + + [Theory] + [InlineData(5L, 5L)] + [InlineData(1L, 10L)] + [InlineData(0L, 5L)] + [InlineData(0L, 0L)] + [InlineData(-1L, 5L)] + [InlineData(-1L, -1L)] + [InlineData(10L, 10L)] + public void To_test_the_null_path_for_difference_on_nullable_long(long? subject, long expectation) + { + // Arrange + // Act + Action act = () => subject.Should().BeGreaterThan(expectation); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } } } diff --git a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeLessThan.cs b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeLessThan.cs index 5d6dd6f7e1..5dcd7aedf9 100644 --- a/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeLessThan.cs +++ b/Tests/FluentAssertions.Specs/Numeric/NullableNumericAssertionSpecs.BeLessThan.cs @@ -67,5 +67,37 @@ public void NaN_is_never_less_than_another_double() .Should().Throw() .WithMessage("*NaN*"); } + + [Theory] + [InlineData(5, -1)] + [InlineData(10, 5)] + [InlineData(10, -1)] + public void To_test_the_remaining_paths_for_difference_on_nullable_int(int? subject, int expectation) + { + // Arrange + // Act + Action act = () => subject.Should().BeLessThan(expectation); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } + + [Theory] + [InlineData(5L, -1L)] + [InlineData(10L, 5L)] + [InlineData(10L, -1L)] + public void To_test_the_remaining_paths_for_difference_on_nullable_long(long? subject, long expectation) + { + // Arrange + // Act + Action act = () => subject.Should().BeLessThan(expectation); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } } } diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeGreaterThan.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeGreaterThan.cs index 85944f6ef1..0e0febda79 100644 --- a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeGreaterThan.cs +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeGreaterThan.cs @@ -129,5 +129,91 @@ public void When_a_nullable_numeric_null_value_is_not_greater_than_it_should_thr .Should().Throw() .WithMessage("*null*"); } + + [Fact] + public void To_test_the_null_path_for_difference_on_byte() + { + // Arrange + var value = (byte)1; + + // Act + Action act = () => value.Should().BeGreaterThan(1); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } + + [Fact] + public void To_test_the_non_null_path_for_difference_on_byte() + { + // Arrange + var value = (byte)1; + + // Act + Action act = () => value.Should().BeGreaterThan(2); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } + + [Theory] + [InlineData(5, 5)] + [InlineData(1, 10)] + [InlineData(0, 5)] + [InlineData(0, 0)] + [InlineData(-1, 5)] + [InlineData(-1, -1)] + [InlineData(10, 10)] + public void To_test_the_null_path_for_difference_on_int(int subject, int expectation) + { + // Arrange + // Act + Action act = () => subject.Should().BeGreaterThan(expectation); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } + + [Theory] + [InlineData(5L, 5L)] + [InlineData(1L, 10L)] + [InlineData(0L, 5L)] + [InlineData(0L, 0L)] + [InlineData(-1L, 5L)] + [InlineData(-1L, -1L)] + [InlineData(10L, 10L)] + public void To_test_the_null_path_for_difference_on_long(long subject, long expectation) + { + // Arrange + // Act + Action act = () => subject.Should().BeGreaterThan(expectation); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } + + [Theory] + [InlineData(1, 1)] + [InlineData(10, 10)] + [InlineData(10, 11)] + public void To_test_the_null_path_for_difference_on_ushort(ushort subject, ushort expectation) + { + // Arrange + // Act + Action act = () => subject.Should().BeGreaterThan(expectation); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } } } diff --git a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeLessThan.cs b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeLessThan.cs index 0a2c32cccf..2d64782c3b 100644 --- a/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeLessThan.cs +++ b/Tests/FluentAssertions.Specs/Numeric/NumericAssertionSpecs.BeLessThan.cs @@ -128,5 +128,37 @@ public void When_a_nullable_numeric_null_value_is_not_less_than_it_should_throw( .Should().Throw() .WithMessage("*null*"); } + + [Theory] + [InlineData(5, -1)] + [InlineData(10, 5)] + [InlineData(10, -1)] + public void To_test_the_remaining_paths_for_difference_on_int(int subject, int expectation) + { + // Arrange + // Act + Action act = () => subject.Should().BeLessThan(expectation); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } + + [Theory] + [InlineData(5L, -1L)] + [InlineData(10L, 5L)] + [InlineData(10L, -1L)] + public void To_test_the_remaining_paths_for_difference_on_long(long subject, long expectation) + { + // Arrange + // Act + Action act = () => subject.Should().BeLessThan(expectation); + + // Assert + act + .Should().Throw() + .Which.Message.Should().NotMatch("*(difference of 0)*"); + } } } From e569ec9f6254499c5242a52e483fa84e7d35652f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:47:25 +0000 Subject: [PATCH 348/845] Bump Meziantou.Analyzer from 2.0.158 to 2.0.159 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.158 to 2.0.159. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.158...2.0.159) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index d93b0958e4..d3449c95f5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From e2d09bf8914fd19ed4fe68d4f6ea90008b094c15 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Mon, 8 Jul 2024 15:13:42 +0200 Subject: [PATCH 349/845] Add scoped value formatters (#2676) --- .../Execution/AssertionScope.cs | 8 +- Src/FluentAssertions/Formatting/Formatter.cs | 10 +- .../Formatting/FormattingOptions.cs | 38 ++++- .../FluentAssertions/net47.verified.txt | 2 + .../FluentAssertions/net6.0.verified.txt | 2 + .../netstandard2.0.verified.txt | 2 + .../netstandard2.1.verified.txt | 2 + .../AssertionScope.ScopedFormatters.cs | 157 ++++++++++++++++++ docs/_pages/extensibility.md | 67 ++++++-- docs/_pages/introduction.md | 48 +++++- docs/_pages/releases.md | 1 + 11 files changed, 314 insertions(+), 23 deletions(-) create mode 100644 Tests/FluentAssertions.Specs/Execution/AssertionScope.ScopedFormatters.cs diff --git a/Src/FluentAssertions/Execution/AssertionScope.cs b/Src/FluentAssertions/Execution/AssertionScope.cs index e2283d0202..d18ed54d38 100644 --- a/Src/FluentAssertions/Execution/AssertionScope.cs +++ b/Src/FluentAssertions/Execution/AssertionScope.cs @@ -14,7 +14,7 @@ namespace FluentAssertions.Execution; /// Represents an implicit or explicit scope within which multiple assertions can be collected. /// /// -/// This class is supposed to have a very short life time and is not safe to be used in assertion that cross thread-boundaries +/// This class is supposed to have a very short lifetime and is not safe to be used in assertions that cross thread-boundaries /// such as when using or . /// public sealed class AssertionScope : IAssertionScope @@ -465,9 +465,11 @@ private static void SetCurrentAssertionScope(AssertionScope scope) IAssertionScope IAssertionScope.ForCondition(bool condition) => ForCondition(condition); - IAssertionScope IAssertionScope.ForConstraint(OccurrenceConstraint constraint, int actualOccurrences) => ForConstraint(constraint, actualOccurrences); + IAssertionScope IAssertionScope.ForConstraint(OccurrenceConstraint constraint, int actualOccurrences) => + ForConstraint(constraint, actualOccurrences); - IAssertionScope IAssertionScope.BecauseOf([StringSyntax("CompositeFormat")] string because, params object[] becauseArgs) => BecauseOf(because, becauseArgs); + IAssertionScope IAssertionScope.BecauseOf([StringSyntax("CompositeFormat")] string because, params object[] becauseArgs) => + BecauseOf(because, becauseArgs); IAssertionScope IAssertionScope.WithExpectation(string message, params object[] args) => WithExpectation(message, args); diff --git a/Src/FluentAssertions/Formatting/Formatter.cs b/Src/FluentAssertions/Formatting/Formatter.cs index c87add95ed..d61ea84f9f 100644 --- a/Src/FluentAssertions/Formatting/Formatter.cs +++ b/Src/FluentAssertions/Formatting/Formatter.cs @@ -10,12 +10,11 @@ namespace FluentAssertions.Formatting; /// -/// Provides services for formatting an object being used in an assertion in a human readable format. +/// Provides services for formatting an object being used in an assertion in a human-readable format. /// public static class Formatter { #region Private Definitions - private static readonly List CustomFormatters = []; private static readonly List DefaultFormatters = @@ -70,7 +69,10 @@ public static class Formatter /// /// A list of objects responsible for formatting the objects represented by placeholders. /// - public static IEnumerable Formatters => CustomFormatters.Concat(DefaultFormatters); + public static IEnumerable Formatters => + AssertionScope.Current.FormattingOptions.ScopedFormatters + .Concat(CustomFormatters) + .Concat(DefaultFormatters); /// /// Returns a human-readable representation of a particular object. @@ -161,7 +163,7 @@ private static void Format(object value, FormattedObjectGraph output, Formatting } /// - /// Removes a custom formatter that was previously added though . + /// Removes a custom formatter that was previously added through . /// /// /// This method is not thread-safe and should not be invoked from within a unit test. diff --git a/Src/FluentAssertions/Formatting/FormattingOptions.cs b/Src/FluentAssertions/Formatting/FormattingOptions.cs index 8b9f78db65..769baf610f 100644 --- a/Src/FluentAssertions/Formatting/FormattingOptions.cs +++ b/Src/FluentAssertions/Formatting/FormattingOptions.cs @@ -1,12 +1,17 @@ -namespace FluentAssertions.Formatting; +using System.Collections.Generic; +using FluentAssertions.Execution; + +namespace FluentAssertions.Formatting; public class FormattingOptions { + internal List ScopedFormatters { get; private set; } = []; + /// /// Indicates whether the formatter should use line breaks when the supports it. /// /// - /// This value should not changed on from within a unit test. + /// This value should not be changed on from within a unit test. /// See the docs on how to safely use it. /// public bool UseLineBreaks { get; set; } @@ -15,7 +20,7 @@ public class FormattingOptions /// Determines the depth until which the library should try to render an object graph. /// /// - /// This value should not changed on from within a unit test. + /// This value should not be changed on from within a unit test. /// See the docs on how to safely use it. /// /// @@ -31,19 +36,42 @@ public class FormattingOptions /// Because of technical reasons, the actual output may be one or two lines longer. /// /// - /// This value should not changed on from within a unit test. + /// This value should not be changed on from within a unit test. /// See the docs on how to safely use it. /// /// public int MaxLines { get; set; } = 100; + /// + /// Removes a scoped formatter that was previously added through . + /// + /// A custom implementation of + public void RemoveFormatter(IValueFormatter formatter) + { + ScopedFormatters.Remove(formatter); + } + + /// + /// Ensures a scoped formatter is included in the chain, which is executed before the static custom formatters and the default formatters. + /// This also lasts only for the current until disposal. + /// + /// A custom implementation of + public void AddFormatter(IValueFormatter formatter) + { + if (!ScopedFormatters.Contains(formatter)) + { + ScopedFormatters.Insert(0, formatter); + } + } + internal FormattingOptions Clone() { return new FormattingOptions { UseLineBreaks = UseLineBreaks, MaxDepth = MaxDepth, - MaxLines = MaxLines + MaxLines = MaxLines, + ScopedFormatters = [..ScopedFormatters] }; } } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 76c15ad354..191d0a02da 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -1469,6 +1469,8 @@ namespace FluentAssertions.Formatting public int MaxDepth { get; set; } public int MaxLines { get; set; } public bool UseLineBreaks { get; set; } + public void AddFormatter(FluentAssertions.Formatting.IValueFormatter formatter) { } + public void RemoveFormatter(FluentAssertions.Formatting.IValueFormatter formatter) { } } public class GuidValueFormatter : FluentAssertions.Formatting.IValueFormatter { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 7b38ddda09..6e36debe39 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -1488,6 +1488,8 @@ namespace FluentAssertions.Formatting public int MaxDepth { get; set; } public int MaxLines { get; set; } public bool UseLineBreaks { get; set; } + public void AddFormatter(FluentAssertions.Formatting.IValueFormatter formatter) { } + public void RemoveFormatter(FluentAssertions.Formatting.IValueFormatter formatter) { } } public class GuidValueFormatter : FluentAssertions.Formatting.IValueFormatter { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 25c59baec8..21f5f869f2 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -1413,6 +1413,8 @@ namespace FluentAssertions.Formatting public int MaxDepth { get; set; } public int MaxLines { get; set; } public bool UseLineBreaks { get; set; } + public void AddFormatter(FluentAssertions.Formatting.IValueFormatter formatter) { } + public void RemoveFormatter(FluentAssertions.Formatting.IValueFormatter formatter) { } } public class GuidValueFormatter : FluentAssertions.Formatting.IValueFormatter { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index e25ac7c515..5e7a1def91 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -1469,6 +1469,8 @@ namespace FluentAssertions.Formatting public int MaxDepth { get; set; } public int MaxLines { get; set; } public bool UseLineBreaks { get; set; } + public void AddFormatter(FluentAssertions.Formatting.IValueFormatter formatter) { } + public void RemoveFormatter(FluentAssertions.Formatting.IValueFormatter formatter) { } } public class GuidValueFormatter : FluentAssertions.Formatting.IValueFormatter { diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScope.ScopedFormatters.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScope.ScopedFormatters.cs new file mode 100644 index 0000000000..2c89bca59a --- /dev/null +++ b/Tests/FluentAssertions.Specs/Execution/AssertionScope.ScopedFormatters.cs @@ -0,0 +1,157 @@ +using System; +using FluentAssertions.Execution; +using FluentAssertions.Formatting; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Execution; + +public partial class AssertionScopeSpecs +{ + [Fact] + public void A_scoped_formatter_will_be_used() + { + // Arrange + Action act = () => + { + // Act + using var outerScope = new AssertionScope(); + + var outerFormatter = new OuterFormatter(); + outerScope.FormattingOptions.AddFormatter(outerFormatter); + 1.Should().Be(2); + }; + + // Assert + act.Should().Throw().WithMessage($"*{nameof(OuterFormatter)}*"); + } + + [Fact] + public void A_scoped_formatter_is_not_available_after_disposal() + { + // Arrange + Action act = () => + { + // Act + using var outerScope = new AssertionScope(); + + var outerFormatter = new OuterFormatter(); + outerScope.FormattingOptions.AddFormatter(outerFormatter); + + // ReSharper disable once DisposeOnUsingVariable + outerScope.Dispose(); + + 1.Should().Be(2); + }; + + // Assert + act.Should().Throw().Which.Message.Should().NotMatch($"*{nameof(OuterFormatter)}*"); + } + + [Fact] + public void Removing_a_formatter_from_scope_works() + { + // Arrange + using var outerScope = new AssertionScope(); + var outerFormatter = new OuterFormatter(); + + // Act 1 + outerScope.FormattingOptions.AddFormatter(outerFormatter); + 1.Should().Be(2); + + // Assert 1 + outerScope.Discard().Should().ContainSingle().Which.Should().Match($"*{nameof(OuterFormatter)}*"); + + // Act 2 + outerScope.FormattingOptions.RemoveFormatter(outerFormatter); + 1.Should().Be(2); + + // Assert2 + outerScope.Discard().Should().ContainSingle().Which.Should().NotMatch($"*{nameof(OuterFormatter)}*"); + outerScope.FormattingOptions.ScopedFormatters.Should().BeEmpty(); + } + + [Fact] + public void Add_a_formatter_to_nested_scope_adds_and_removes_correctly_on_dispose() + { + // Arrange + using var outerScope = new AssertionScope("outside"); + + var outerFormatter = new OuterFormatter(); + var innerFormatter = new InnerFormatter(); + + // Act 1 + outerScope.FormattingOptions.AddFormatter(outerFormatter); + 1.Should().Be(2); + + // Assert 1 / Test if outer scope contains OuterFormatter + outerScope.Discard().Should().ContainSingle().Which.Should().Match($"*{nameof(OuterFormatter)}*"); + + using (var innerScope = new AssertionScope("inside")) + { + // Act 2 + innerScope.FormattingOptions.AddFormatter(innerFormatter); + "1".Should().Be("2"); // InnerFormatter + 1.Should().Be(2); // OuterFormatter + + // Assert 2 + innerScope.Discard().Should() + .SatisfyRespectively( + failure1 => failure1.Should().Match($"*{nameof(InnerFormatter)}*"), + failure2 => failure2.Should().Match($"*{nameof(OuterFormatter)}*")); + } + + // Act 3 + 1.Should().Be(2); + + // Assert 3 + outerScope.Discard().Should().ContainSingle().Which.Should().Match($"*{nameof(OuterFormatter)}*"); + } + + [Fact] + public void Removing_a_formatter_from_outer_scope_inside_nested_scope_leaves_outer_scope_untouched() + { + // Arrange + using var outerScope = new AssertionScope(); + var outerFormatter = new OuterFormatter(); + var innerFormatter = new InnerFormatter(); + + // Act + outerScope.FormattingOptions.AddFormatter(outerFormatter); + + using var innerScope = new AssertionScope(); + innerScope.FormattingOptions.AddFormatter(innerFormatter); + innerScope.FormattingOptions.RemoveFormatter(outerFormatter); + 1.Should().Be(2); + "1".Should().Be("2"); + + // Assert + innerScope.Discard().Should().SatisfyRespectively( + failure1 => failure1.Should().Match("*2, but found 1*"), + failure2 => failure2.Should().NotMatch($"*{nameof(OuterFormatter)}*") + .And.Match($"*{nameof(InnerFormatter)}*")); + + outerScope.FormattingOptions.ScopedFormatters.Should().ContainSingle() + .Which.Should().Be(outerFormatter); + } + + private class OuterFormatter : IValueFormatter + { + public bool CanHandle(object value) => value is int; + + public void Format(object value, FormattedObjectGraph formattedGraph, FormattingContext context, FormatChild formatChild) + { + formattedGraph.AddFragment(nameof(OuterFormatter)); + } + } + + private class InnerFormatter : IValueFormatter + { + public bool CanHandle(object value) => value is string; + + public void Format(object value, FormattedObjectGraph formattedGraph, FormattingContext context, FormatChild formatChild) + { + formattedGraph.AddFragment(nameof(InnerFormatter)); + } + } +} diff --git a/docs/_pages/extensibility.md b/docs/_pages/extensibility.md index a6615ac8f1..dfa75032db 100644 --- a/docs/_pages/extensibility.md +++ b/docs/_pages/extensibility.md @@ -14,19 +14,19 @@ To facilitate the need for those developers which ideas don't end up in the libr As an example, let's create an extension method on `DirectoryInfo` like this ```csharp -public static class DirectoryInfoExtensions +public static class DirectoryInfoExtensions { public static DirectoryInfoAssertions Should(this DirectoryInfo instance) { - return new DirectoryInfoAssertions(instance); - } + return new DirectoryInfoAssertions(instance); + } } ``` It's the returned assertions class that provides the actual assertion methods. You don't need to, but if you sub-class the self-referencing generic class `ReferenceTypeAssertions`, you'll already get methods like `BeNull`, `BeSameAs` and `Match` for free. Assuming you did, and you provided an override of the `Identifier` property so that these methods know that we're dealing with a directory, it's time for the the next step. Let's add an extension that allows you to assert that the involved directory contains a particular file. ```csharp -public class DirectoryInfoAssertions : +public class DirectoryInfoAssertions : ReferenceTypeAssertions { public DirectoryInfoAssertions(DirectoryInfo instance) @@ -46,7 +46,7 @@ public class DirectoryInfoAssertions : .Then .Given(() => Subject.GetFiles()) .ForCondition(files => files.Any(fileInfo => fileInfo.Name.Equals(filename))) - .FailWith("Expected {context:directory} to contain {0}{reason}, but found {1}.", + .FailWith("Expected {context:directory} to contain {0}{reason}, but found {1}.", _ => filename, files => files.Select(file => file.Name)); return new AndConstraint(this); @@ -104,7 +104,7 @@ void Format(object value, FormattedObjectGraph formattedGraph, FormattingContext Next to the actual value that needs rendering, this method accepts a couple of parameters worth mentioning. -* `formattedGraph` is the object that collects the textual representation of the entire graph. It supports adding fragments of text, full lines and deals with automatic indentation using its `WithIndentation` method. It also protects the performance of the rendering by throwing a `MaxLinesExceededException` when the textual representation has exceeded the configured maximum. +* `formattedGraph` is the object that collects the textual representation of the entire graph. It supports adding fragments of text, full lines and deals with automatic indentation using its `WithIndentation` method. It also protects the performance of the rendering by throwing a `MaxLinesExceededException` when the textual representation has exceeded the configured maximum. * `context.UseLineBreaks` denotes that the value should be prefixed by a newline. It is used by some assertion code to force displaying the various elements of the failure message on a separate line. * `formatChild` is used when rendering a complex object that would involve multiple, potentially recursive, nested calls through `Formatter`. @@ -169,6 +169,53 @@ class EnumerableCustomClassFormatter : EnumerableValueFormatter } ``` +### Scoped `IValueFormatter`s + +You can add a custom value formatter inside a scope to selectively customize formatting of an object based on the context of the test. +To achieve that, you can do following: + +```csharp +using var scope = new AssertionScope(); + +var formatter = new CustomFormatter(); +scope.FormattingOptions.AddFormatter(formatter); +``` + +You can even add formatters to nested assertion scopes and the nested scope will pick up all previously defined formatters: + +```csharp +using var outerScope = new AssertionScope(); + +var outerFormatter = new OuterFormatter(); +var innerFormatter = new InnerFormatter(); +outerScope.FormattingOptions.AddFormatter(outerFormatter); + +using var innerScope = new AssertionScope(); +innerScope.FormattingOptions.AddFormatter(innerFormatter); + +// At this point outerFormatter and innerFormatter will be available +``` + +**Note:** If you modify the scoped formatters inside the nested scope, it won't touch the scoped formatters from the outer scope: + +```csharp +using var outerScope = new AssertionScope(); + +var outerFormatter = new OuterFormatter(); +var innerFormatter = new InnerFormatter(); +outerScope.FormattingOptions.AddFormatter(outerFormatter); + +using (var innerScope = new AssertionScope()) +{ + innerScope.FormattingOptions.AddFormatter(innerFormatter); + innerScope.FormattingOptions.RemoveFormatter(outerFormatter); + + // innerScope only contains innerFormatter +} + +// outerScope still contains outerFormatter +``` + ## To be or not to be a value type The structural equivalency API provided by `Should().BeEquivalentTo` and is arguably the most powerful, but also the most complicated part of Fluent Assertions. And to make things worse, you can extend and adapt the default behavior quite extensively. @@ -228,7 +275,7 @@ internal class AllPublicPropertiesSelectionRule : IMemberSelectionRule { public bool IncludesMembers => false; - public IEnumerable SelectMembers(INode currentNode + public IEnumerable SelectMembers(INode currentNode IEnumerable selectedMembers, MemberSelectionContext context) { IEnumerable selectedNonPrivateProperties = context.Type @@ -253,8 +300,8 @@ The final interface, the `IOrderingRule`, is used to determine whether FA should ## Thread Safety -The classes `AssertionOptions` and `Formatter` control the global configuration by having static state, so one must be careful when they are mutated. -They are both designed to be configured from a single setup point in your test project and not from within individual unit tests. +The classes `AssertionOptions` and `Formatter` control the global configuration by having static state, so one must be careful when they are mutated. +They are both designed to be configured from a single setup point in your test project and not from within individual unit tests. Not following this could change the outcome of tests depending on the order they are run in or throw unexpected exceptions when run parallel. In order to ensure they are configured exactly once, a test framework specific solution might be required depending on the version of .NET you are using. @@ -275,7 +322,7 @@ internal static class Initializer } ``` -Unfortunately, this only works for .NET 5 and higher. That's why Fluent Assertions supports its own "module initializer" through the `[AssertionEngineInitializer]` attribute. It can be used multiple times. +Unfortunately, this only works for .NET 5 and higher. That's why Fluent Assertions supports its own "module initializer" through the `[AssertionEngineInitializer]` attribute. It can be used multiple times. ```csharp [assembly: AssertionEngineInitializer(typeof(Initializer), nameof(Initializer.Initialize))] diff --git a/docs/_pages/introduction.md b/docs/_pages/introduction.md index 43d06b7fa3..178df091bd 100644 --- a/docs/_pages/introduction.md +++ b/docs/_pages/introduction.md @@ -65,7 +65,7 @@ This chaining can make your unit tests a lot easier to read. ## Global Configurations -Fluent Assertions `AssertionOptions` has several methods and properties that can be used to change the way it executes assertions or the defaults it will use for comparing object graphs. Changing those settings at the right time can be difficult, depending on the test framework. That's why Fluent Assertions offers a special assembly-level attribute that can be used to have some code executed _before_ the first assertion is executed. It will be called only once per test run, but you can use the attribute multiple times. +Fluent Assertions `AssertionOptions` has several methods and properties that can be used to change the way it executes assertions or the defaults it will use for comparing object graphs. Changing those settings at the right time can be difficult, depending on the test framework. That's why Fluent Assertions offers a special assembly-level attribute that can be used to have some code executed _before_ the first assertion is executed. It will be called only once per test run, but you can use the attribute multiple times. ```csharp [assembly: AssertionEngineInitializer(typeof(Initializer), nameof(Initializer.Initialize))] @@ -170,3 +170,49 @@ Expected string to be "Expected" with a length of 8, but "Actual" has a length o For more information take a look at the [AssertionScopeSpecs.cs](https://github.com/fluentassertions/fluentassertions/blob/master/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs) in Unit Tests. +### Scoped `IValueFormatter`s + +You can add a custom value formatter inside a scope to selectively customize formatting of an object based on the context of the test. +To achieve that, you can do following: + +```csharp +using var scope = new AssertionScope(); + +var formatter = new CustomFormatter(); +scope.FormattingOptions.AddFormatter(formatter); +``` + +You can even add formatters to nested assertion scopes and the nested scope will pick up all previously defined formatters: + +```csharp +using var outerScope = new AssertionScope(); + +var outerFormatter = new OuterFormatter(); +var innerFormatter = new InnerFormatter(); +outerScope.FormattingOptions.AddFormatter(outerFormatter); + +using var innerScope = new AssertionScope(); +innerScope.FormattingOptions.AddFormatter(innerFormatter); + +// At this point outerFormatter and innerFormatter will be available +``` + +**Note:** If you modify the scoped formatters inside the nested scope, it won't touch the scoped formatters from the outer scope: + +```csharp +using var outerScope = new AssertionScope(); + +var outerFormatter = new OuterFormatter(); +var innerFormatter = new InnerFormatter(); +outerScope.FormattingOptions.AddFormatter(outerFormatter); + +using (var innerScope = new AssertionScope()) +{ + innerScope.FormattingOptions.AddFormatter(innerFormatter); + innerScope.FormattingOptions.RemoveFormatter(outerFormatter); + + // innerScope only contains innerFormatter +} + +// outerScope still contains outerFormatter +``` diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 328b16772a..bec90e8c4d 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -18,6 +18,7 @@ sidebar: * Introduced a new `Satisfy` method available to all reference types to allow for nested assertions - [#2597](https://github.com/fluentassertions/fluentassertions/pull/2597) * Added `BeNaN` and `NotBeNaN` for assertions on `float` and `double` - [#2606](https://github.com/fluentassertions/fluentassertions/pull/2606) * Added option for event monitoring to ignore failing event accessors - [#2629](https://github.com/fluentassertions/fluentassertions/pull/2629) +* Added the capability of associating `IValueFormatter`s to a (nested) `AssertionScope` - [#2676](https://github.com/fluentassertions/fluentassertions/pull/2676) ### Improvements * Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) From 2ce3c5eac197eab93e5f41f46fc88f39aa5dc786 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Mon, 8 Jul 2024 17:01:55 +0200 Subject: [PATCH 350/845] Update FluentAssertions package dependencies (#2673) --- Src/FluentAssertions/FluentAssertions.csproj | 6 +++--- .../FluentAssertions.Extensibility.Specs.csproj | 5 +++++ Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 30c318120d..07c77c3503 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -57,7 +57,7 @@ - + @@ -74,7 +74,7 @@ - + @@ -82,7 +82,7 @@ - + $(TargetFramework) diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index e639ca1dc9..7f83a736f3 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -31,4 +31,9 @@ + + + + + diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index 50ebf411e0..faedbb4734 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -18,4 +18,7 @@ runtime; build; native; contentfiles; analyzers + + + \ No newline at end of file From 8a9535c2ce811b547d1bac9850c5c158a99ef595 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 14:33:41 +0000 Subject: [PATCH 351/845] Bump cspell from 8.9.1 to 8.10.4 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.9.1 to 8.10.4. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.10.4/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 207 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 106 insertions(+), 103 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1cbe139579..64726a244e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.9.1" + "cspell": "^8.10.4" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.9.1.tgz", - "integrity": "sha512-etkor/qXSSqyh6lbudEGdTami0DooIi2AlQbJPUWRfowzYJRSYWPUbyQSUkFdRhCHni2oLOFbWaraRthNlLD/A==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.10.4.tgz", + "integrity": "sha512-QmgvIp9/NM60Jj6ft5oaiCFidwPwKYS9FfpfABrDLw/Jx6wwcTdy9cVbuPxT8n4LwkHpswkmIzOf4zSlnrd4MQ==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.2", @@ -28,8 +28,8 @@ "@cspell/dict-docker": "^1.1.7", "@cspell/dict-dotnet": "^5.0.2", "@cspell/dict-elixir": "^4.0.3", - "@cspell/dict-en_us": "^4.3.22", - "@cspell/dict-en-common-misspellings": "^2.0.2", + "@cspell/dict-en_us": "^4.3.23", + "@cspell/dict-en-common-misspellings": "^2.0.3", "@cspell/dict-en-gb": "1.1.33", "@cspell/dict-filetypes": "^3.0.4", "@cspell/dict-fonts": "^4.0.0", @@ -60,7 +60,7 @@ "@cspell/dict-ruby": "^5.0.2", "@cspell/dict-rust": "^4.0.4", "@cspell/dict-scala": "^5.0.2", - "@cspell/dict-software-terms": "^3.4.6", + "@cspell/dict-software-terms": "^3.4.9", "@cspell/dict-sql": "^2.1.3", "@cspell/dict-svelte": "^1.0.2", "@cspell/dict-swift": "^2.0.1", @@ -73,28 +73,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.9.1.tgz", - "integrity": "sha512-sN4PZivGuH/HWScvoCeNuNc5VLSe4F+SeuoyKmsF4uRv447r9sW0/fpjASGqDTjLXpEfWaXDPoIb+0alY3gm+g==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.10.4.tgz", + "integrity": "sha512-W6aUZ2LkKkDEKgx1sjik2xQT7m6CrLxcuJiF7MkPPZMdsnXyg5jsRalkQTn7my7RZ+n5xxEO69r6jM4IImvWAg==", "dependencies": { - "@cspell/cspell-types": "8.9.1" + "@cspell/cspell-types": "8.10.4" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.9.1.tgz", - "integrity": "sha512-wH5Xu8W3aMEWFSpOczMtH/04clLMfDGdbYMYB7w6BeHI/LDW8DZaRhigOOhx9FRgVk/YIVbKKAKVgvFrfD5cEA==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.10.4.tgz", + "integrity": "sha512-yN+A9EIgdSkNiQnrFgsy5dzFl879ddMRHw/u38Zw4HdHIGr+xLpw5UVSKK6OacPMro853engM3dTJJDzRzh+rA==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.9.1.tgz", - "integrity": "sha512-Q2SOnIi2dnQ2zqPd+tcEYfom9qlsapGyLK4Mdx2Vv29MU2RDZ9VHFDncV6yo6O58gmlYl8sXtJsVceiHgwwlkQ==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.10.4.tgz", + "integrity": "sha512-f0Y+Tol1aqrj9LsDT1oQOoj0P9uJ0ZW5PbhVlKqFeIDhrA5rYLy0ffnFESLNBRxWXaB/cznzpgMUyNfpVCXJpg==", "dependencies": { "global-directory": "^4.0.1" }, @@ -103,17 +103,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.9.1.tgz", - "integrity": "sha512-dPKpqkglGnwvrW9mgbHIdimDQZH3iy8uT8gm3dEO//UahxMBdMpvtdbC3R9kesQCSagvYRVE7hwJvOktSAK+Vg==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.10.4.tgz", + "integrity": "sha512-bXIllG6C1rKjWGlKdrAfs0AKrs/iQ6ZL6kSXrzHh5NB8oyBzX8tf5v4BX3Bnh5yrjBzkT2qhL+teEcvWjjvu2w==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.9.1.tgz", - "integrity": "sha512-Z/pTX2i+U5KwyCYRSw8BleJtw81jFifv91DDka4nqi2oyHJ3eEUljVovNOuZ3lotn/ArHdu4rY98s1w6Z69mYw==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.10.4.tgz", + "integrity": "sha512-K/7JALR417KYHoovk18LTJCnKXF8ToNraWX4P3NFkYZNffc62fPn0y7nV9kphdK/biLM7np9gWtHq22MhX4qgw==", "engines": { "node": ">=18" } @@ -124,9 +124,9 @@ "integrity": "sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA==" }, "node_modules/@cspell/dict-aws": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.2.tgz", - "integrity": "sha512-aNGHWSV7dRLTIn8WJemzLoMF62qOaiUQlgnsCwH5fRCD/00gsWCwg106pnbkmK4AyabyxzneOV4dfecDJWkSxw==" + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.3.tgz", + "integrity": "sha512-0C0RQ4EM29fH0tIYv+EgDQEum0QI6OrmjENC9u98pB8UcnYxGG/SqinuPxo+TgcEuInj0Q73MsBpJ1l5xUnrsw==" }, "node_modules/@cspell/dict-bash": { "version": "4.1.3", @@ -352,9 +352,9 @@ "integrity": "sha512-v97ClgidZt99JUm7OjhQugDHmhx4U8fcgunHvD/BsXWjXNj4cTr0m0YjofyZoL44WpICsNuFV9F/sv9OM5HUEw==" }, "node_modules/@cspell/dict-software-terms": { - "version": "3.4.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.4.8.tgz", - "integrity": "sha512-r3gvmSGd8wZp4bbofTey/2Tu3gdBc5kxTRoFo1MaCh5vMLiBOSCLvyZgzr0DcMl8c5dxL7nFpNwbWZJxmKmtUA==" + "version": "3.4.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.4.10.tgz", + "integrity": "sha512-S5S2sz98v4GWJ9TMo62Vp4L5RM/329e5UQfFn7yJfieTcrfXRH4IweVdz34rZcK9o5coGptgBUIv/Jcrd4cMpg==" }, "node_modules/@cspell/dict-sql": { "version": "2.1.3", @@ -387,9 +387,9 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.9.1.tgz", - "integrity": "sha512-ao4IDqQ8MyRqiB3NHA8R7ThRsuDLXdSCFm7Pvz8EqDnWaX3NAuClzgT3EoxJlw9pyyPQX3tW5Vg7ft3GSsBFUw==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.10.4.tgz", + "integrity": "sha512-YxpzOgrP/u0nxEMR4hUfV+4z3b0rLWnKsKIv6pLpRez7ACvrMeb53FedSMZW/YaF3NjWTpUEdqFHaemPkmwnRA==", "dependencies": { "import-meta-resolve": "^4.1.0" }, @@ -398,17 +398,17 @@ } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.9.1.tgz", - "integrity": "sha512-onD/UPJW7rBQrRDqYNvPUAoWoBp1G2g+mijAD7EkuseyAKTKlKz624rXpHUOTqI814owmhFMNSf2QyYy8gFM6Q==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.10.4.tgz", + "integrity": "sha512-QyL8mvv8HDnIHU/wKqWf04yMHCHv3icakZF4UdAk181tl8gymzrtyXSSbMaVlySlK9p+7OQlEG/KUF8R0LR75Q==", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.9.1.tgz", - "integrity": "sha512-2AncPKGq9fnytwnL7V4KfoSjiEU0m8tVDFerGiDMNmTMWiQ4zj0kTATai118XT1eBVKiyrAotYRLSrsuUo9U3g==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.10.4.tgz", + "integrity": "sha512-4+Bxm43py50W872FjUvKoT9+EQoK9pqOblxu7GRfFx7CjEgYJB03Cb4rHiKYzLuJakUk6IyAlgPD2vNZO37Vzg==", "engines": { "node": ">=18.0" } @@ -607,9 +607,9 @@ } }, "node_modules/comment-json": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz", - "integrity": "sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.4.tgz", + "integrity": "sha512-E5AjpSW+O+N5T2GsOQMHLLsJvrYw6G/AFt9GvU6NguEAfzKShh7hRiLtVo6S9KbRpFMGqE5ojo0/hE+sdteWvQ==", "dependencies": { "array-timsort": "^1.0.3", "core-util-is": "^1.0.3", @@ -641,21 +641,21 @@ } }, "node_modules/cspell": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.9.1.tgz", - "integrity": "sha512-tNUITJbyeX/JnhBtMtbZ5hDbkNIHB72iQx3Uw51sWvo8YmIhaP6ma1W8PPNteu8CSlI7r8Z412wpjyR0Mnsr6A==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.10.4.tgz", + "integrity": "sha512-6eu42atG3ohf1r8vkRCKHBgUED+MOY7ErwPodeEtiHOqCXBtTCoPQXbqJozRy5Jfr2VMCMiryknxI4dH5yzjuQ==", "dependencies": { - "@cspell/cspell-json-reporter": "8.9.1", - "@cspell/cspell-pipe": "8.9.1", - "@cspell/cspell-types": "8.9.1", - "@cspell/dynamic-import": "8.9.1", + "@cspell/cspell-json-reporter": "8.10.4", + "@cspell/cspell-pipe": "8.10.4", + "@cspell/cspell-types": "8.10.4", + "@cspell/dynamic-import": "8.10.4", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-gitignore": "8.9.1", - "cspell-glob": "8.9.1", - "cspell-io": "8.9.1", - "cspell-lib": "8.9.1", + "cspell-gitignore": "8.10.4", + "cspell-glob": "8.10.4", + "cspell-io": "8.10.4", + "cspell-lib": "8.10.4", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^8.0.0", @@ -676,12 +676,12 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.9.1.tgz", - "integrity": "sha512-gSXAazmeX+CCpFCsNQQqHRO/nn01kMnCoB0v+7AM0Bip2iDXRl+LmUEJGNcnFaiJG3liaZ8+S5/qCDbza010VQ==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.10.4.tgz", + "integrity": "sha512-0VgnDEU4/+PWG+8x0FBN0QPun14sox9n7DBMvKGwAORhfiuYJ9w8kdrS/QqHdpHsRRQhXP1SWR8Nfg/5dUxsPg==", "dependencies": { - "@cspell/cspell-types": "8.9.1", - "comment-json": "^4.2.3", + "@cspell/cspell-types": "8.10.4", + "comment-json": "^4.2.4", "yaml": "^2.4.5" }, "engines": { @@ -689,13 +689,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.9.1.tgz", - "integrity": "sha512-sJy9gApLxJNE+YqWeulCTj3XC/ME4aacOHEl/SZ5bsaxkGx3KzBlzCMG7LfqUjOM8rwfBPsYO7zWPCiJQgxGPg==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.10.4.tgz", + "integrity": "sha512-9Hg2eTYbTKMoPy0r/IjGwcIII7PLGpeZlG1XzCDP4MW/bV4TGB6EfY8RAmhUt8cTwo7f6fxqu53WLaR3YPEozg==", "dependencies": { - "@cspell/cspell-pipe": "8.9.1", - "@cspell/cspell-types": "8.9.1", - "cspell-trie-lib": "8.9.1", + "@cspell/cspell-pipe": "8.10.4", + "@cspell/cspell-types": "8.10.4", + "cspell-trie-lib": "8.10.4", "fast-equals": "^5.0.1", "gensequence": "^7.0.0" }, @@ -704,11 +704,13 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.9.1.tgz", - "integrity": "sha512-5RL0mnptiSlF0e+nnJBTlfyN3V/ECsig7jJ0Vw0AImaR7UdFmfxbeQmiZmealapcjhBJ7hnn9ILtemID4y4wxg==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.10.4.tgz", + "integrity": "sha512-OtN/nZAxgFYGdV+hCK8tF3drlGJJ+42W278cIM67H67cHYupVICFgsDLiNBz/iR/J9S4pEU5WXu2yPtHFHvVUQ==", "dependencies": { - "cspell-glob": "8.9.1", + "@cspell/url": "8.10.4", + "cspell-glob": "8.10.4", + "cspell-io": "8.10.4", "find-up-simple": "^1.0.0" }, "bin": { @@ -719,10 +721,11 @@ } }, "node_modules/cspell-glob": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.9.1.tgz", - "integrity": "sha512-b60WfczgG3NgGp5pyS4NfwSu7FEF7AmkP1btJqj17UAWsm/idUdGdOgaZazZuPgQJbcQvOlpBQP0+SEi8Jo3QA==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.10.4.tgz", + "integrity": "sha512-HPRK6ZtHBzY/zGMhajzJ2MOgHMgY74/FijtaZkYc09QTEjONhIO4VWcrxrr1/qoM/qAp2Y/CKcBM/OOiHls7+A==", "dependencies": { + "@cspell/url": "8.10.4", "micromatch": "^4.0.7" }, "engines": { @@ -730,12 +733,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.9.1.tgz", - "integrity": "sha512-BqaDp3Z+baLZyb3A5h/zWESsO7e8vUaOlrDt1RRVEnpboIUnj7iNkcFmDp3s9PTpBCURlgHHs8SR/+c49aKDGg==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.10.4.tgz", + "integrity": "sha512-AW9JqEmMJLrbBwN/3BAwpHgOz5WFyb4syS+pjFRdZGx/w9e9ZSn4xyfnQ3mjNaFc/oZUcXy+q032bNZQppjGXA==", "dependencies": { - "@cspell/cspell-pipe": "8.9.1", - "@cspell/cspell-types": "8.9.1" + "@cspell/cspell-pipe": "8.10.4", + "@cspell/cspell-types": "8.10.4" }, "bin": { "cspell-grammar": "bin.mjs" @@ -745,37 +748,37 @@ } }, "node_modules/cspell-io": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.9.1.tgz", - "integrity": "sha512-O2F79Rzj28Mvmj4AQLkDWOXWaLnvkJhxPm/Yb3viKlbhwmL5BWUi0APbWA3dtyF+ImX1W27YrNFyvT/PGNZ5Dw==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.10.4.tgz", + "integrity": "sha512-IU+w0hNUQSR99ftC5Jr5D3Vtg70AOUSvdFXHO13qVf3GBnfYxbltQirbY5afLFUWDY6ayNO3GsZisCMdywmlwg==", "dependencies": { - "@cspell/cspell-service-bus": "8.9.1", - "@cspell/url": "8.9.1" + "@cspell/cspell-service-bus": "8.10.4", + "@cspell/url": "8.10.4" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.9.1.tgz", - "integrity": "sha512-xrtoXvSjkMcwE1yUcyjiqLFPZiK0CNQjOKKS9PQaaK7ZBoERPQ7grz05uFCYdboSXt0FhlP8tC9E5oEt+xtGCA==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.10.4.tgz", + "integrity": "sha512-u1Edp5p2zwnBuQ9pBFg+YfAWB1c1uERWSZkteD5uClVz21zY5Aiikl41gOLi6Qm5+oWCWW+nP1HcC6B6wlFLHQ==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.9.1", - "@cspell/cspell-pipe": "8.9.1", - "@cspell/cspell-resolver": "8.9.1", - "@cspell/cspell-types": "8.9.1", - "@cspell/dynamic-import": "8.9.1", - "@cspell/strong-weak-map": "8.9.1", - "@cspell/url": "8.9.1", + "@cspell/cspell-bundled-dicts": "8.10.4", + "@cspell/cspell-pipe": "8.10.4", + "@cspell/cspell-resolver": "8.10.4", + "@cspell/cspell-types": "8.10.4", + "@cspell/dynamic-import": "8.10.4", + "@cspell/strong-weak-map": "8.10.4", + "@cspell/url": "8.10.4", "clear-module": "^4.1.2", - "comment-json": "^4.2.3", - "cspell-config-lib": "8.9.1", - "cspell-dictionary": "8.9.1", - "cspell-glob": "8.9.1", - "cspell-grammar": "8.9.1", - "cspell-io": "8.9.1", - "cspell-trie-lib": "8.9.1", + "comment-json": "^4.2.4", + "cspell-config-lib": "8.10.4", + "cspell-dictionary": "8.10.4", + "cspell-glob": "8.10.4", + "cspell-grammar": "8.10.4", + "cspell-io": "8.10.4", + "cspell-trie-lib": "8.10.4", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -790,12 +793,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.9.1", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.9.1.tgz", - "integrity": "sha512-rUED/lNlFcsRfkMal6+zLz7JW3/cV79KGhwxnwu1fjNS0nlLSAUGTTiAQBQSR+pU/UW+BTkmULHVuNh+DUN93w==", + "version": "8.10.4", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.10.4.tgz", + "integrity": "sha512-PQDwEYI10sp9nwnUA8HFFZr1c5j1Zrk9p8oqk7KUy+QUF3XcJn3ayLenPNUG95U/ysg3RBHc7/Vmh7unvXNRlQ==", "dependencies": { - "@cspell/cspell-pipe": "8.9.1", - "@cspell/cspell-types": "8.9.1", + "@cspell/cspell-pipe": "8.10.4", + "@cspell/cspell-types": "8.10.4", "gensequence": "^7.0.0" }, "engines": { diff --git a/package.json b/package.json index d321ae2046..eaaf04fb30 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.9.1" + "cspell": "^8.10.4" } } From 21f4adb583e9c545ae08f005038be215eb78e071 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 14:47:31 +0000 Subject: [PATCH 352/845] Bump JetBrains.Annotations from 2023.3.0 to 2024.2.0 Bumps JetBrains.Annotations from 2023.3.0 to 2024.2.0. --- updated-dependencies: - dependency-name: JetBrains.Annotations dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- Src/FluentAssertions/FluentAssertions.csproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 07c77c3503..e56b7145ae 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -45,7 +45,7 @@ - + diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 187bcec6b8..33609cfde0 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -26,7 +26,7 @@ - + diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 2196556e95..14ce2a67a6 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -26,7 +26,7 @@ - + all From 1d430a66a85e93f86ab095dd261841835ba7e4c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 15:04:31 +0000 Subject: [PATCH 353/845] Bump the xunit group across 1 directory with 3 updates Bumps the xunit group with 3 updates in the / directory: Verify.DiffPlex, System.Collections.Immutable and Verify.Xunit. Updates `Verify.DiffPlex` from 3.0.0 to 3.1.0 Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 Updates `Verify.Xunit` from 25.0.4 to 25.3.0 Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 --- updated-dependencies: - dependency-name: Verify.DiffPlex dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index ff8e5ef732..259fde0d0f 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -12,8 +12,8 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + From 2648e49362894d80c4ebd1af2561e92799fe4124 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 14:36:19 +0000 Subject: [PATCH 354/845] Bump Meziantou.Analyzer from 2.0.159 to 2.0.160 Bumps Meziantou.Analyzer from 2.0.159 to 2.0.160. --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index d3449c95f5..bcac54c626 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From c70bd7b9a54efd5207b9cba6b29c398bb3a35369 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:05:54 +0200 Subject: [PATCH 355/845] Bump the xunit group with 4 updates (#2696) * Bump the xunit group with 4 updates Bumps the xunit group with 4 updates: Verify.Xunit, System.Collections.Immutable, xunit and xunit.runner.visualstudio. Updates `Verify.Xunit` from 25.3.0 to 25.3.1 Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 Updates `xunit` from 2.8.1 to 2.9.0 Updates `xunit.runner.visualstudio` from 2.8.1 to 2.8.2 --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] * bump xunit --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jonas Nyrup --- Build/_build.csproj | 2 +- Tests/Approval.Tests/Approval.Tests.csproj | 6 +++--- Tests/FSharp.Specs/FSharp.Specs.fsproj | 4 ++-- .../FluentAssertions.Equivalency.Specs.csproj | 4 ++-- .../FluentAssertions.Extensibility.Specs.csproj | 4 ++-- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 4 ++-- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 4 ++-- Tests/VB.Specs/VB.Specs.vbproj | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 5a7ada431f..db2ee3727c 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -19,7 +19,7 @@ - + diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 259fde0d0f..796bd2aad4 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -6,14 +6,14 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 771977bc4a..fe0d628325 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -11,8 +11,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 33609cfde0..3acc1577e9 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -28,8 +28,8 @@ - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 7f83a736f3..147de48039 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -18,8 +18,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 14ce2a67a6..bb797ab492 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -27,8 +27,8 @@ - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index faedbb4734..7c537083b3 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -12,8 +12,8 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index d858b4520d..9b76965f11 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -7,8 +7,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all From 437b263734104c48ab2fff41d55882f8180bdaca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 09:45:04 +0200 Subject: [PATCH 356/845] Bump Bogus from 35.5.1 to 35.6.0 (#2701) Bumps [Bogus](https://github.com/bchavez/Bogus) from 35.5.1 to 35.6.0. - [Release notes](https://github.com/bchavez/Bogus/releases) - [Changelog](https://github.com/bchavez/Bogus/blob/master/HISTORY.md) - [Commits](https://github.com/bchavez/Bogus/compare/v35.5.1...v35.6.0) --- updated-dependencies: - dependency-name: Bogus dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Benchmarks/Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index cf93404377..4fd9a3469a 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -10,7 +10,7 @@ - + From c2142a70b071d4994a7976b06f13d89162945e65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 09:45:39 +0200 Subject: [PATCH 357/845] Bump cspell from 8.10.4 to 8.11.0 (#2702) Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.10.4 to 8.11.0. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.11.0/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 210 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 106 insertions(+), 106 deletions(-) diff --git a/package-lock.json b/package-lock.json index 64726a244e..42cffefa61 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,16 +7,16 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.10.4" + "cspell": "^8.11.0" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.10.4.tgz", - "integrity": "sha512-QmgvIp9/NM60Jj6ft5oaiCFidwPwKYS9FfpfABrDLw/Jx6wwcTdy9cVbuPxT8n4LwkHpswkmIzOf4zSlnrd4MQ==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.11.0.tgz", + "integrity": "sha512-SYAW1oT9jjnbwju5P6luTnKogEe8DGUVmUO0O02LxYNmgE2eJt8pKZcy3RtR9V7Q5WW8PWsXXq0Xvoseji0olg==", "dependencies": { "@cspell/dict-ada": "^4.0.2", - "@cspell/dict-aws": "^4.0.2", + "@cspell/dict-aws": "^4.0.3", "@cspell/dict-bash": "^4.1.3", "@cspell/dict-companies": "^3.1.2", "@cspell/dict-cpp": "^5.1.10", @@ -60,7 +60,7 @@ "@cspell/dict-ruby": "^5.0.2", "@cspell/dict-rust": "^4.0.4", "@cspell/dict-scala": "^5.0.2", - "@cspell/dict-software-terms": "^3.4.9", + "@cspell/dict-software-terms": "^3.4.10", "@cspell/dict-sql": "^2.1.3", "@cspell/dict-svelte": "^1.0.2", "@cspell/dict-swift": "^2.0.1", @@ -73,28 +73,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.10.4.tgz", - "integrity": "sha512-W6aUZ2LkKkDEKgx1sjik2xQT7m6CrLxcuJiF7MkPPZMdsnXyg5jsRalkQTn7my7RZ+n5xxEO69r6jM4IImvWAg==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.11.0.tgz", + "integrity": "sha512-GSk2dKZHak4EuRXRKpyW3EsxmJmirkcZoM6sJQh6ZaFXSffMPgydNNIeL2xH/2hnwE7yWcP0ryq8hOxlrl9mVw==", "dependencies": { - "@cspell/cspell-types": "8.10.4" + "@cspell/cspell-types": "8.11.0" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.10.4.tgz", - "integrity": "sha512-yN+A9EIgdSkNiQnrFgsy5dzFl879ddMRHw/u38Zw4HdHIGr+xLpw5UVSKK6OacPMro853engM3dTJJDzRzh+rA==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.11.0.tgz", + "integrity": "sha512-VNWoAb2Y5VO87O8FipQZfk7H5aDhjE2HbGInVWC1x+qNMyQvnh3WYexa5r0Z4g3WqdTPhhpZdeBHnEfcdBwmOw==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.10.4.tgz", - "integrity": "sha512-f0Y+Tol1aqrj9LsDT1oQOoj0P9uJ0ZW5PbhVlKqFeIDhrA5rYLy0ffnFESLNBRxWXaB/cznzpgMUyNfpVCXJpg==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.11.0.tgz", + "integrity": "sha512-4qqYBct6wsdoDCnTvt7rfpBE3ARegLDTeYOxglZLE3xZj0vpI1LZiGc3jgroTql866Lqy+IeRCwnQd5GXrqtmg==", "dependencies": { "global-directory": "^4.0.1" }, @@ -103,17 +103,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.10.4.tgz", - "integrity": "sha512-bXIllG6C1rKjWGlKdrAfs0AKrs/iQ6ZL6kSXrzHh5NB8oyBzX8tf5v4BX3Bnh5yrjBzkT2qhL+teEcvWjjvu2w==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.11.0.tgz", + "integrity": "sha512-W7BBouT5prXvvh9javWTzZN3vvnSujS3agrOjRQ5BuimOgLonUwydimuSTDFIkyvT6ZwzyIVO4r984w3OcYyzg==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.10.4.tgz", - "integrity": "sha512-K/7JALR417KYHoovk18LTJCnKXF8ToNraWX4P3NFkYZNffc62fPn0y7nV9kphdK/biLM7np9gWtHq22MhX4qgw==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.11.0.tgz", + "integrity": "sha512-WNscRYt7MHhJhv2E8GbNoyUVZnRvWsz8O+OFrMjmGO6PxokQRnuKRp3rgHpZxL0NR4xw+2xyZKYC/9iOQ6yCnQ==", "engines": { "node": ">=18" } @@ -139,9 +139,9 @@ "integrity": "sha512-OwR5i1xbYuJX7FtHQySmTy3iJtPV1rZQ3jFCxFGwrA1xRQ4rtRcDQ+sTXBCIAoJHkXa84f9J3zsngOKmMGyS/w==" }, "node_modules/@cspell/dict-cpp": { - "version": "5.1.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.10.tgz", - "integrity": "sha512-BmIF0sAz2BgGEOwzYIeEm9ALneDjd1tcTbFbo+A1Hcq3zOKP8yViSgxS9CEN30KOZIyph6Tldp531UPEpoEl0Q==" + "version": "5.1.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.11.tgz", + "integrity": "sha512-skDl1ozBK99Cq/mSh8BTbvk5V4UJwm3+PT0RC94/DqQTUHHNCUutWRipoot2JZ296fjNsivFCyuelUDhj3r9eg==" }, "node_modules/@cspell/dict-cryptocurrencies": { "version": "5.0.0", @@ -304,9 +304,9 @@ "integrity": "sha512-lax/jGz9h3Dv83v8LHa5G0bf6wm8YVRMzbjJPG/9rp7cAGPtdrga+XANFq+B7bY5+jiSA3zvj10LUFCFjnnCCg==" }, "node_modules/@cspell/dict-npm": { - "version": "5.0.16", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.16.tgz", - "integrity": "sha512-ZWPnLAziEcSCvV0c8k9Qj88pfMu+wZwM5Qks87ShsfBgI8uLZ9tGHravA7gmjH1Gd7Bgxy2ulvXtSqIWPh1lew==" + "version": "5.0.17", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.17.tgz", + "integrity": "sha512-MEzlVq9CLWpBaA/Mtqjs8NAQtEJzRDjQr1N9y3dtETtIjddI0Q5QXa6+ZvVDOFaCLsSEDALsmGx0dve4bkuGIw==" }, "node_modules/@cspell/dict-php": { "version": "4.0.8", @@ -314,9 +314,9 @@ "integrity": "sha512-TBw3won4MCBQ2wdu7kvgOCR3dY2Tb+LJHgDUpuquy3WnzGiSDJ4AVelrZdE1xu7mjFJUr4q48aB21YT5uQqPZA==" }, "node_modules/@cspell/dict-powershell": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.4.tgz", - "integrity": "sha512-eosDShapDgBWN9ULF7+sRNdUtzRnUdsfEdBSchDm8FZA4HOqxUSZy3b/cX/Rdw0Fnw0AKgk0kzgXw7tS6vwJMQ==" + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.5.tgz", + "integrity": "sha512-3JVyvMoDJesAATYGOxcUWPbQPUvpZmkinV3m8HL1w1RrjeMVXXuK7U1jhopSneBtLhkU+9HKFwgh9l9xL9mY2Q==" }, "node_modules/@cspell/dict-public-licenses": { "version": "2.0.7", @@ -347,9 +347,9 @@ "integrity": "sha512-v9/LcZknt/Xq7m1jdTWiQEtmkVVKdE1etAfGL2sgcWpZYewEa459HeWndNA0gfzQrpWX9sYay18mt7pqClJEdA==" }, "node_modules/@cspell/dict-scala": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.2.tgz", - "integrity": "sha512-v97ClgidZt99JUm7OjhQugDHmhx4U8fcgunHvD/BsXWjXNj4cTr0m0YjofyZoL44WpICsNuFV9F/sv9OM5HUEw==" + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.3.tgz", + "integrity": "sha512-4yGb4AInT99rqprxVNT9TYb1YSpq58Owzq7zi3ZS5T0u899Y4VsxsBiOgHnQ/4W+ygi+sp+oqef8w8nABR2lkg==" }, "node_modules/@cspell/dict-software-terms": { "version": "3.4.10", @@ -387,9 +387,9 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.10.4.tgz", - "integrity": "sha512-YxpzOgrP/u0nxEMR4hUfV+4z3b0rLWnKsKIv6pLpRez7ACvrMeb53FedSMZW/YaF3NjWTpUEdqFHaemPkmwnRA==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.11.0.tgz", + "integrity": "sha512-Xk5iQQZ23Q9IR9N5YQb4J0mXOegIBw2/aJ7mYjMQZ24I5fL47Ir45cd5a8m5UEMheZppfrolVsDoTEgXnAfPDQ==", "dependencies": { "import-meta-resolve": "^4.1.0" }, @@ -398,17 +398,17 @@ } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.10.4.tgz", - "integrity": "sha512-QyL8mvv8HDnIHU/wKqWf04yMHCHv3icakZF4UdAk181tl8gymzrtyXSSbMaVlySlK9p+7OQlEG/KUF8R0LR75Q==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.11.0.tgz", + "integrity": "sha512-XumxAVA1Pi5U8d+qqo2//KPrsOINOHnHpal/yPu8FwfZhkRzpDnNPdgiMNKBVmZMFxmSCEJwc7AUUMnfyuGuLg==", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.10.4.tgz", - "integrity": "sha512-4+Bxm43py50W872FjUvKoT9+EQoK9pqOblxu7GRfFx7CjEgYJB03Cb4rHiKYzLuJakUk6IyAlgPD2vNZO37Vzg==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.11.0.tgz", + "integrity": "sha512-X0l/WJmavRqRKDgsgEjXHGizmvYt40omMTmNOLPHUa2jxL+a2ayuQD3GMFC8Omassjk3bSyFByftmgJDI+P2ZA==", "engines": { "node": ">=18.0" } @@ -641,21 +641,21 @@ } }, "node_modules/cspell": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.10.4.tgz", - "integrity": "sha512-6eu42atG3ohf1r8vkRCKHBgUED+MOY7ErwPodeEtiHOqCXBtTCoPQXbqJozRy5Jfr2VMCMiryknxI4dH5yzjuQ==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.11.0.tgz", + "integrity": "sha512-nyzeSk/Rj4dcuXIV9a3Ri9pJW5gAVDJtTUhyNW9a5rjNcQn+k8uxV8eBgx5s42ESSQrmUh3HhocYy2jLEolunw==", "dependencies": { - "@cspell/cspell-json-reporter": "8.10.4", - "@cspell/cspell-pipe": "8.10.4", - "@cspell/cspell-types": "8.10.4", - "@cspell/dynamic-import": "8.10.4", + "@cspell/cspell-json-reporter": "8.11.0", + "@cspell/cspell-pipe": "8.11.0", + "@cspell/cspell-types": "8.11.0", + "@cspell/dynamic-import": "8.11.0", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-gitignore": "8.10.4", - "cspell-glob": "8.10.4", - "cspell-io": "8.10.4", - "cspell-lib": "8.10.4", + "cspell-gitignore": "8.11.0", + "cspell-glob": "8.11.0", + "cspell-io": "8.11.0", + "cspell-lib": "8.11.0", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^8.0.0", @@ -676,11 +676,11 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.10.4.tgz", - "integrity": "sha512-0VgnDEU4/+PWG+8x0FBN0QPun14sox9n7DBMvKGwAORhfiuYJ9w8kdrS/QqHdpHsRRQhXP1SWR8Nfg/5dUxsPg==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.11.0.tgz", + "integrity": "sha512-8AE1qm/nuD+aiN+mZXQIGp0ESHyQ9uowbKaB5+qi261HEEhuFPceP/3u0yq0kc1YPtnKxEfYHrLukvQIMlDshA==", "dependencies": { - "@cspell/cspell-types": "8.10.4", + "@cspell/cspell-types": "8.11.0", "comment-json": "^4.2.4", "yaml": "^2.4.5" }, @@ -689,13 +689,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.10.4.tgz", - "integrity": "sha512-9Hg2eTYbTKMoPy0r/IjGwcIII7PLGpeZlG1XzCDP4MW/bV4TGB6EfY8RAmhUt8cTwo7f6fxqu53WLaR3YPEozg==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.11.0.tgz", + "integrity": "sha512-h5AVFuTeP+NLBRZbaX6sFGZ/wnvnyeeGtnNiYU0f4dVB3Yq0K9c7QXM8PllIpcbe+SBDoQ15ZlbECzUlGt/Ysg==", "dependencies": { - "@cspell/cspell-pipe": "8.10.4", - "@cspell/cspell-types": "8.10.4", - "cspell-trie-lib": "8.10.4", + "@cspell/cspell-pipe": "8.11.0", + "@cspell/cspell-types": "8.11.0", + "cspell-trie-lib": "8.11.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0" }, @@ -704,13 +704,13 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.10.4.tgz", - "integrity": "sha512-OtN/nZAxgFYGdV+hCK8tF3drlGJJ+42W278cIM67H67cHYupVICFgsDLiNBz/iR/J9S4pEU5WXu2yPtHFHvVUQ==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.11.0.tgz", + "integrity": "sha512-r+buXvm3NqU/5N1zmiXSgo7DQLZyKR5sr6McepWlGBmT4DDm7s22yojS8LSusIthJ2k3tvLFDI9O4Rs0DnzK2Q==", "dependencies": { - "@cspell/url": "8.10.4", - "cspell-glob": "8.10.4", - "cspell-io": "8.10.4", + "@cspell/url": "8.11.0", + "cspell-glob": "8.11.0", + "cspell-io": "8.11.0", "find-up-simple": "^1.0.0" }, "bin": { @@ -721,11 +721,11 @@ } }, "node_modules/cspell-glob": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.10.4.tgz", - "integrity": "sha512-HPRK6ZtHBzY/zGMhajzJ2MOgHMgY74/FijtaZkYc09QTEjONhIO4VWcrxrr1/qoM/qAp2Y/CKcBM/OOiHls7+A==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.11.0.tgz", + "integrity": "sha512-X0cEErrQdrVLXDMse84QH/iV2Q+f7AsXxIjlSt+6PPEoDz8yRO8xD71iaaeE/8+cMFrKMl0uDpIpBQ5OlvcIyQ==", "dependencies": { - "@cspell/url": "8.10.4", + "@cspell/url": "8.11.0", "micromatch": "^4.0.7" }, "engines": { @@ -733,12 +733,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.10.4.tgz", - "integrity": "sha512-AW9JqEmMJLrbBwN/3BAwpHgOz5WFyb4syS+pjFRdZGx/w9e9ZSn4xyfnQ3mjNaFc/oZUcXy+q032bNZQppjGXA==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.11.0.tgz", + "integrity": "sha512-fIq7/KDjNMfBBqKTnnp4dhjNmbvnl019bPwecddkQOpx5H9Vn4WVDTiAZbI6/5Li/VU+h1Ld2+pIOKYql/7DBg==", "dependencies": { - "@cspell/cspell-pipe": "8.10.4", - "@cspell/cspell-types": "8.10.4" + "@cspell/cspell-pipe": "8.11.0", + "@cspell/cspell-types": "8.11.0" }, "bin": { "cspell-grammar": "bin.mjs" @@ -748,37 +748,37 @@ } }, "node_modules/cspell-io": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.10.4.tgz", - "integrity": "sha512-IU+w0hNUQSR99ftC5Jr5D3Vtg70AOUSvdFXHO13qVf3GBnfYxbltQirbY5afLFUWDY6ayNO3GsZisCMdywmlwg==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.11.0.tgz", + "integrity": "sha512-R6ZCNh2RrOkP3/OIpFHmtg6vztxMMsl6/t5kY1nTcmWv/1Ltw56G3q357KN6e+8epFiqFm4gMFmvzImFeR34Yw==", "dependencies": { - "@cspell/cspell-service-bus": "8.10.4", - "@cspell/url": "8.10.4" + "@cspell/cspell-service-bus": "8.11.0", + "@cspell/url": "8.11.0" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.10.4.tgz", - "integrity": "sha512-u1Edp5p2zwnBuQ9pBFg+YfAWB1c1uERWSZkteD5uClVz21zY5Aiikl41gOLi6Qm5+oWCWW+nP1HcC6B6wlFLHQ==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.11.0.tgz", + "integrity": "sha512-msdfqJLIhJE1whfGXC2J669dKWrnWdFI18nR2OTXipWdiwZDDQEFT3q2Pq56+bhxwtoqAZKrez/zhRB/JbpUuA==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.10.4", - "@cspell/cspell-pipe": "8.10.4", - "@cspell/cspell-resolver": "8.10.4", - "@cspell/cspell-types": "8.10.4", - "@cspell/dynamic-import": "8.10.4", - "@cspell/strong-weak-map": "8.10.4", - "@cspell/url": "8.10.4", + "@cspell/cspell-bundled-dicts": "8.11.0", + "@cspell/cspell-pipe": "8.11.0", + "@cspell/cspell-resolver": "8.11.0", + "@cspell/cspell-types": "8.11.0", + "@cspell/dynamic-import": "8.11.0", + "@cspell/strong-weak-map": "8.11.0", + "@cspell/url": "8.11.0", "clear-module": "^4.1.2", "comment-json": "^4.2.4", - "cspell-config-lib": "8.10.4", - "cspell-dictionary": "8.10.4", - "cspell-glob": "8.10.4", - "cspell-grammar": "8.10.4", - "cspell-io": "8.10.4", - "cspell-trie-lib": "8.10.4", + "cspell-config-lib": "8.11.0", + "cspell-dictionary": "8.11.0", + "cspell-glob": "8.11.0", + "cspell-grammar": "8.11.0", + "cspell-io": "8.11.0", + "cspell-trie-lib": "8.11.0", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -793,12 +793,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.10.4", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.10.4.tgz", - "integrity": "sha512-PQDwEYI10sp9nwnUA8HFFZr1c5j1Zrk9p8oqk7KUy+QUF3XcJn3ayLenPNUG95U/ysg3RBHc7/Vmh7unvXNRlQ==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.11.0.tgz", + "integrity": "sha512-PRW2ve2F3LBN1a/AwuuxHJ+VHPh9mN01qDAnyQojfqoF7ckRBe7+8Jb+7V9GonBS/oFQJ7AwObXtM2j0FP/DnQ==", "dependencies": { - "@cspell/cspell-pipe": "8.10.4", - "@cspell/cspell-types": "8.10.4", + "@cspell/cspell-pipe": "8.11.0", + "@cspell/cspell-types": "8.11.0", "gensequence": "^7.0.0" }, "engines": { diff --git a/package.json b/package.json index eaaf04fb30..7b8b624fe4 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.10.4" + "cspell": "^8.11.0" } } From 8446578dc0e407999fa34ef4d10676ba79ec3e58 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 09:46:16 +0200 Subject: [PATCH 358/845] Bump Meziantou.Analyzer from 2.0.160 to 2.0.161 (#2700) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.160 to 2.0.161. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.160...2.0.161) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index bcac54c626..9533190436 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From e6935735ea180ab9289c37a4d29a693ff1a95485 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 10:23:15 +0200 Subject: [PATCH 359/845] Bump the xunit group with 2 updates (#2699) Bumps the xunit group with 2 updates: [Verify.Xunit](https://github.com/VerifyTests/Verify) and [System.Collections.Immutable](https://github.com/dotnet/runtime). Updates `Verify.Xunit` from 25.3.1 to 26.0.0 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/25.3.1...26.0.0) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 796bd2aad4..1bea377ce5 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 52cb54b340084a829bcf6b2a40c5e57c6044d953 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 09:31:37 +0300 Subject: [PATCH 360/845] Bump cspell from 8.11.0 to 8.12.1 (#2708) Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.11.0 to 8.12.1. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.12.1/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 755 ++++++++++------------------------------------ package.json | 2 +- 2 files changed, 154 insertions(+), 603 deletions(-) diff --git a/package-lock.json b/package-lock.json index 42cffefa61..865dcef53d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,19 +7,19 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.11.0" + "cspell": "^8.12.1" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.11.0.tgz", - "integrity": "sha512-SYAW1oT9jjnbwju5P6luTnKogEe8DGUVmUO0O02LxYNmgE2eJt8pKZcy3RtR9V7Q5WW8PWsXXq0Xvoseji0olg==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.12.1.tgz", + "integrity": "sha512-55wCxlKwRsYCt8uWB65C0xiJ4bP43UE3b/GK01ekyz2fZ11mudMWGMrX/pdKwGIOXFfFqDz3DCRxFs+fHS58oA==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.3", "@cspell/dict-bash": "^4.1.3", "@cspell/dict-companies": "^3.1.2", - "@cspell/dict-cpp": "^5.1.10", + "@cspell/dict-cpp": "^5.1.11", "@cspell/dict-cryptocurrencies": "^5.0.0", "@cspell/dict-csharp": "^4.0.2", "@cspell/dict-css": "^4.0.12", @@ -51,16 +51,16 @@ "@cspell/dict-makefile": "^1.0.0", "@cspell/dict-monkeyc": "^1.0.6", "@cspell/dict-node": "^5.0.1", - "@cspell/dict-npm": "^5.0.16", + "@cspell/dict-npm": "^5.0.17", "@cspell/dict-php": "^4.0.8", - "@cspell/dict-powershell": "^5.0.4", + "@cspell/dict-powershell": "^5.0.5", "@cspell/dict-public-licenses": "^2.0.7", "@cspell/dict-python": "^4.2.1", "@cspell/dict-r": "^2.0.1", "@cspell/dict-ruby": "^5.0.2", "@cspell/dict-rust": "^4.0.4", - "@cspell/dict-scala": "^5.0.2", - "@cspell/dict-software-terms": "^3.4.10", + "@cspell/dict-scala": "^5.0.3", + "@cspell/dict-software-terms": "^4.0.0", "@cspell/dict-sql": "^2.1.3", "@cspell/dict-svelte": "^1.0.2", "@cspell/dict-swift": "^2.0.1", @@ -73,28 +73,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.11.0.tgz", - "integrity": "sha512-GSk2dKZHak4EuRXRKpyW3EsxmJmirkcZoM6sJQh6ZaFXSffMPgydNNIeL2xH/2hnwE7yWcP0ryq8hOxlrl9mVw==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.12.1.tgz", + "integrity": "sha512-nO/3GTk3rBpLRBzkmcKFxbtEDd3FKXfQ5uTCpJ27XYVHYjlU+d4McOYYMClMhpFianVol2JCyberpGAj6bVgLg==", "dependencies": { - "@cspell/cspell-types": "8.11.0" + "@cspell/cspell-types": "8.12.1" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.11.0.tgz", - "integrity": "sha512-VNWoAb2Y5VO87O8FipQZfk7H5aDhjE2HbGInVWC1x+qNMyQvnh3WYexa5r0Z4g3WqdTPhhpZdeBHnEfcdBwmOw==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.12.1.tgz", + "integrity": "sha512-lh0zIm43r/Fj3sQWXc68msKnXNrfPOo8VvzL1hOP0v/j2eH61fvELH08/K+nQJ8cCutNZ4zhk9+KMDU4KmsMtw==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.11.0.tgz", - "integrity": "sha512-4qqYBct6wsdoDCnTvt7rfpBE3ARegLDTeYOxglZLE3xZj0vpI1LZiGc3jgroTql866Lqy+IeRCwnQd5GXrqtmg==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.12.1.tgz", + "integrity": "sha512-3HE04m7DS/6xYpWPN2QBGCHr26pvxHa78xYk+PjiPD2Q49ceqTNdFcZOYd+Wba8HbRXSukchSLhrTujmPEzqpw==", "dependencies": { "global-directory": "^4.0.1" }, @@ -103,17 +103,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.11.0.tgz", - "integrity": "sha512-W7BBouT5prXvvh9javWTzZN3vvnSujS3agrOjRQ5BuimOgLonUwydimuSTDFIkyvT6ZwzyIVO4r984w3OcYyzg==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.12.1.tgz", + "integrity": "sha512-UQPddS38dQ/FG00y2wginCzdS6yxryiGrWXSD/P59idCrYYDCYnI9pPsx4u10tmRkW1zJ+O7gGCsXw7xa5DAJQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.11.0.tgz", - "integrity": "sha512-WNscRYt7MHhJhv2E8GbNoyUVZnRvWsz8O+OFrMjmGO6PxokQRnuKRp3rgHpZxL0NR4xw+2xyZKYC/9iOQ6yCnQ==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.12.1.tgz", + "integrity": "sha512-17POyyRgl7m7mMuv1qk2xX6E5bdT0F3247vloBCdUMyaVtmtN4uEiQ/jqU5vtW02vxlKjKS0HcTvKz4EVfSlzQ==", "engines": { "node": ">=18" } @@ -134,14 +134,14 @@ "integrity": "sha512-tOdI3QVJDbQSwPjUkOiQFhYcu2eedmX/PtEpVWg0aFps/r6AyjUQINtTgpqMYnYuq8O1QUIQqnpx21aovcgZCw==" }, "node_modules/@cspell/dict-companies": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.2.tgz", - "integrity": "sha512-OwR5i1xbYuJX7FtHQySmTy3iJtPV1rZQ3jFCxFGwrA1xRQ4rtRcDQ+sTXBCIAoJHkXa84f9J3zsngOKmMGyS/w==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.3.tgz", + "integrity": "sha512-qaAmfKtQLA7Sbe9zfFVpcwyG92cx6+EiWIpPURv11Ng2QMv2PKhYcterUJBooAvgqD0/qq+AsLN8MREloY5Mdw==" }, "node_modules/@cspell/dict-cpp": { - "version": "5.1.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.11.tgz", - "integrity": "sha512-skDl1ozBK99Cq/mSh8BTbvk5V4UJwm3+PT0RC94/DqQTUHHNCUutWRipoot2JZ296fjNsivFCyuelUDhj3r9eg==" + "version": "5.1.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.12.tgz", + "integrity": "sha512-6lXLOFIa+k/qBcu0bjaE/Kc6v3sh9VhsDOXD1Dalm3zgd0QIMjp5XBmkpSdCAK3pWCPV0Se7ysVLDfCea1BuXg==" }, "node_modules/@cspell/dict-cryptocurrencies": { "version": "5.0.0", @@ -219,9 +219,9 @@ "integrity": "sha512-23xyPcD+j+NnqOjRHgW3IU7Li912SX9wmeefcY0QxukbAxJ/vAN4rBpjSwwYZeQPAn3fxdfdNZs03fg+UM+4yQ==" }, "node_modules/@cspell/dict-fullstack": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.1.8.tgz", - "integrity": "sha512-YRlZupL7uqMCtEBK0bDP9BrcPnjDhz7m4GBqCc1EYqfXauHbLmDT8ELha7T/E7wsFKniHSjzwDZzhNXo2lusRQ==" + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.0.tgz", + "integrity": "sha512-sIGQwU6G3rLTo+nx0GKyirR5dQSFeTIzFTOrURw51ISf+jKG9a3OmvsVtc2OANfvEAOLOC9Wfd8WYhmsO8KRDQ==" }, "node_modules/@cspell/dict-gaming-terms": { "version": "1.0.5", @@ -269,9 +269,9 @@ "integrity": "sha512-4JsCLCRhhLMLiaHpmR7zHFjj1qOauzDI5ZzCNQS31TUMfsOo26jAKDfo0jljFAKgw5M2fEG7sKr8IlPpQAYrmQ==" }, "node_modules/@cspell/dict-k8s": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.5.tgz", - "integrity": "sha512-Cj+/ZV4S+MKlwfocSJZqe/2UAd/sY8YtlZjbK25VN1nCnrsKrBjfkX29vclwSj1U9aJg4Z9jw/uMjoaKu9ZrpQ==" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.6.tgz", + "integrity": "sha512-srhVDtwrd799uxMpsPOQqeDJY+gEocgZpoK06EFrb4GRYGhv7lXo9Fb+xQMyQytzOW9dw4DNOEck++nacDuymg==" }, "node_modules/@cspell/dict-latex": { "version": "4.0.0", @@ -304,9 +304,9 @@ "integrity": "sha512-lax/jGz9h3Dv83v8LHa5G0bf6wm8YVRMzbjJPG/9rp7cAGPtdrga+XANFq+B7bY5+jiSA3zvj10LUFCFjnnCCg==" }, "node_modules/@cspell/dict-npm": { - "version": "5.0.17", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.17.tgz", - "integrity": "sha512-MEzlVq9CLWpBaA/Mtqjs8NAQtEJzRDjQr1N9y3dtETtIjddI0Q5QXa6+ZvVDOFaCLsSEDALsmGx0dve4bkuGIw==" + "version": "5.0.18", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.18.tgz", + "integrity": "sha512-weMTyxWpzz19q4wv9n183BtFvdD5fCjtze+bFKpl+4rO/YlPhHL2cXLAeexJz/VDSBecwX4ybTZYoknd1h2J4w==" }, "node_modules/@cspell/dict-php": { "version": "4.0.8", @@ -324,9 +324,9 @@ "integrity": "sha512-KlBXuGcN3LE7tQi/GEqKiDewWGGuopiAD0zRK1QilOx5Co8XAvs044gk4MNIQftc8r0nHeUI+irJKLGcR36DIQ==" }, "node_modules/@cspell/dict-python": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.1.tgz", - "integrity": "sha512-9X2jRgyM0cxBoFQRo4Zc8oacyWnXi+0/bMI5FGibZNZV4y/o9UoFEr6agjU260/cXHTjIdkX233nN7eb7dtyRg==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.3.tgz", + "integrity": "sha512-C1CPX9wwEGgcHv/p7KfjuIOp1G6KNyx5gWYweAd6/KPv+ZpeM1v572zFUTmpO8WDuAfKFf00nqYL8/GmCENWBw==", "dependencies": { "@cspell/dict-data-science": "^2.0.1" } @@ -342,9 +342,9 @@ "integrity": "sha512-cIh8KTjpldzFzKGgrqUX4bFyav5lC52hXDKo4LbRuMVncs3zg4hcSf4HtURY+f2AfEZzN6ZKzXafQpThq3dl2g==" }, "node_modules/@cspell/dict-rust": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.4.tgz", - "integrity": "sha512-v9/LcZknt/Xq7m1jdTWiQEtmkVVKdE1etAfGL2sgcWpZYewEa459HeWndNA0gfzQrpWX9sYay18mt7pqClJEdA==" + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.5.tgz", + "integrity": "sha512-DIvlPRDemjKQy8rCqftAgGNZxY5Bg+Ps7qAIJjxkSjmMETyDgl0KTVuaJPt7EK4jJt6uCZ4ILy96npsHDPwoXA==" }, "node_modules/@cspell/dict-scala": { "version": "5.0.3", @@ -352,9 +352,9 @@ "integrity": "sha512-4yGb4AInT99rqprxVNT9TYb1YSpq58Owzq7zi3ZS5T0u899Y4VsxsBiOgHnQ/4W+ygi+sp+oqef8w8nABR2lkg==" }, "node_modules/@cspell/dict-software-terms": { - "version": "3.4.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.4.10.tgz", - "integrity": "sha512-S5S2sz98v4GWJ9TMo62Vp4L5RM/329e5UQfFn7yJfieTcrfXRH4IweVdz34rZcK9o5coGptgBUIv/Jcrd4cMpg==" + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.0.3.tgz", + "integrity": "sha512-65QAVMc3YlcI7PcqWRY5ox53tTWC8aktUZdJYCVs4VDBPUCTSDnTSmSreeg4F5Z468clv9KF/S0PkxbLjgW72A==" }, "node_modules/@cspell/dict-sql": { "version": "2.1.3", @@ -377,9 +377,9 @@ "integrity": "sha512-Ak+vy4HP/bOgzf06BAMC30+ZvL9mzv21xLM2XtfnBLTDJGdxlk/nK0U6QT8VfFLqJ0ZZSpyOxGsUebWDCTr/zQ==" }, "node_modules/@cspell/dict-typescript": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.5.tgz", - "integrity": "sha512-EkIwwNV/xqEoBPJml2S16RXj65h1kvly8dfDLgXerrKw6puybZdvAHerAph6/uPTYdtLcsPyJYkPt5ISOJYrtw==" + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.6.tgz", + "integrity": "sha512-1beC6O4P/j23VuxX+i0+F7XqPVc3hhiAzGJHEKqnWf5cWAXQtg0xz3xQJ5MvYx2a7iLaSa+lu7+05vG9UHyu9Q==" }, "node_modules/@cspell/dict-vue": { "version": "3.0.0", @@ -387,9 +387,9 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.11.0.tgz", - "integrity": "sha512-Xk5iQQZ23Q9IR9N5YQb4J0mXOegIBw2/aJ7mYjMQZ24I5fL47Ir45cd5a8m5UEMheZppfrolVsDoTEgXnAfPDQ==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.12.1.tgz", + "integrity": "sha512-18faXHALiMsXtG3v67qeyDhNRZVtkhX5Je2qw8iZQB/i61y0Mfm22iiZeXsKImrXbwP0acyhRkRA1sp1NaQmOw==", "dependencies": { "import-meta-resolve": "^4.1.0" }, @@ -398,38 +398,21 @@ } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.11.0.tgz", - "integrity": "sha512-XumxAVA1Pi5U8d+qqo2//KPrsOINOHnHpal/yPu8FwfZhkRzpDnNPdgiMNKBVmZMFxmSCEJwc7AUUMnfyuGuLg==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.12.1.tgz", + "integrity": "sha512-0O5qGHRXoKl0+hXGdelox2awrCMr8LXObUcWwYbSih7HIm4DwhxMO4qjDFye1NdjW0P88yhpQ23J2ceSto9C5Q==", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.11.0.tgz", - "integrity": "sha512-X0l/WJmavRqRKDgsgEjXHGizmvYt40omMTmNOLPHUa2jxL+a2ayuQD3GMFC8Omassjk3bSyFByftmgJDI+P2ZA==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.12.1.tgz", + "integrity": "sha512-mUYaDniHVLw0YXn2egT2e21MYubMAf+1LDeC0kkbg4VWNxSlC1Ksyv6pqhos495esaa8OCjizdIdnGSF6al9Rw==", "engines": { "node": ">=18.0" } }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "license": "ISC", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -465,38 +448,15 @@ "node": ">= 8" } }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=14" - } - }, "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/array-timsort": { @@ -504,21 +464,6 @@ "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==" }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "license": "MIT" - }, - "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/braces": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", @@ -580,24 +525,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "license": "MIT" - }, "node_modules/commander": { "version": "12.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", @@ -626,43 +553,29 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/cspell": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.11.0.tgz", - "integrity": "sha512-nyzeSk/Rj4dcuXIV9a3Ri9pJW5gAVDJtTUhyNW9a5rjNcQn+k8uxV8eBgx5s42ESSQrmUh3HhocYy2jLEolunw==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.12.1.tgz", + "integrity": "sha512-mdnUUPydxxdj/uyF84U/DvPiY/l58Z2IpNwTx3H9Uve9dfT0vRv/7jiFNAvK4hAfZQaMaE7DPC00ckywTI/XgA==", "dependencies": { - "@cspell/cspell-json-reporter": "8.11.0", - "@cspell/cspell-pipe": "8.11.0", - "@cspell/cspell-types": "8.11.0", - "@cspell/dynamic-import": "8.11.0", + "@cspell/cspell-json-reporter": "8.12.1", + "@cspell/cspell-pipe": "8.12.1", + "@cspell/cspell-types": "8.12.1", + "@cspell/dynamic-import": "8.12.1", + "@cspell/url": "8.12.1", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-gitignore": "8.11.0", - "cspell-glob": "8.11.0", - "cspell-io": "8.11.0", - "cspell-lib": "8.11.0", + "cspell-gitignore": "8.12.1", + "cspell-glob": "8.12.1", + "cspell-io": "8.12.1", + "cspell-lib": "8.12.1", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", - "file-entry-cache": "^8.0.0", + "file-entry-cache": "^9.0.0", "get-stdin": "^9.0.0", - "semver": "^7.6.2", - "strip-ansi": "^7.1.0", - "vscode-uri": "^3.0.8" + "semver": "^7.6.3", + "strip-ansi": "^7.1.0" }, "bin": { "cspell": "bin.mjs", @@ -676,11 +589,11 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.11.0.tgz", - "integrity": "sha512-8AE1qm/nuD+aiN+mZXQIGp0ESHyQ9uowbKaB5+qi261HEEhuFPceP/3u0yq0kc1YPtnKxEfYHrLukvQIMlDshA==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.12.1.tgz", + "integrity": "sha512-xEoKdb8hyturyiUXFdRgQotYegYe3OZS+Yc7JHnB75Ykt+Co2gtnu2M/Yb0yoqaHCXflVO6MITrKNaxricgqVw==", "dependencies": { - "@cspell/cspell-types": "8.11.0", + "@cspell/cspell-types": "8.12.1", "comment-json": "^4.2.4", "yaml": "^2.4.5" }, @@ -689,13 +602,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.11.0.tgz", - "integrity": "sha512-h5AVFuTeP+NLBRZbaX6sFGZ/wnvnyeeGtnNiYU0f4dVB3Yq0K9c7QXM8PllIpcbe+SBDoQ15ZlbECzUlGt/Ysg==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.12.1.tgz", + "integrity": "sha512-jYHEA48on6pBQYVUEzXV63wy5Ulx/QNUZcoiG3C0OmYIKjACTaEg02AMDOr+Eaj34E5v4pGEShzot4Qtt/aiNQ==", "dependencies": { - "@cspell/cspell-pipe": "8.11.0", - "@cspell/cspell-types": "8.11.0", - "cspell-trie-lib": "8.11.0", + "@cspell/cspell-pipe": "8.12.1", + "@cspell/cspell-types": "8.12.1", + "cspell-trie-lib": "8.12.1", "fast-equals": "^5.0.1", "gensequence": "^7.0.0" }, @@ -704,13 +617,13 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.11.0.tgz", - "integrity": "sha512-r+buXvm3NqU/5N1zmiXSgo7DQLZyKR5sr6McepWlGBmT4DDm7s22yojS8LSusIthJ2k3tvLFDI9O4Rs0DnzK2Q==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.12.1.tgz", + "integrity": "sha512-XlO87rdrab3VKU8e7+RGEfqEtYqo7ObgfZeYEAdJlwUXvqYxBzA11jDZAovDz/5jv0YfRMx6ch5t6+1zfSeBbQ==", "dependencies": { - "@cspell/url": "8.11.0", - "cspell-glob": "8.11.0", - "cspell-io": "8.11.0", + "@cspell/url": "8.12.1", + "cspell-glob": "8.12.1", + "cspell-io": "8.12.1", "find-up-simple": "^1.0.0" }, "bin": { @@ -721,11 +634,11 @@ } }, "node_modules/cspell-glob": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.11.0.tgz", - "integrity": "sha512-X0cEErrQdrVLXDMse84QH/iV2Q+f7AsXxIjlSt+6PPEoDz8yRO8xD71iaaeE/8+cMFrKMl0uDpIpBQ5OlvcIyQ==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.12.1.tgz", + "integrity": "sha512-ZplEPLlNwj7luEKu/VudIaV+cGTQHExihGvAUxlIVMFURiAFMT5eH0UsQoCEpSevIEueO+slLUDy7rxwTwAGdQ==", "dependencies": { - "@cspell/url": "8.11.0", + "@cspell/url": "8.12.1", "micromatch": "^4.0.7" }, "engines": { @@ -733,12 +646,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.11.0.tgz", - "integrity": "sha512-fIq7/KDjNMfBBqKTnnp4dhjNmbvnl019bPwecddkQOpx5H9Vn4WVDTiAZbI6/5Li/VU+h1Ld2+pIOKYql/7DBg==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.12.1.tgz", + "integrity": "sha512-IAES553M5nuB/wtiWYayDX2/5OmDu2VmEcnV6SXNze8oop0oodSqr3h46rLy+m1EOOD8nenMa295N/dRPqTB/g==", "dependencies": { - "@cspell/cspell-pipe": "8.11.0", - "@cspell/cspell-types": "8.11.0" + "@cspell/cspell-pipe": "8.12.1", + "@cspell/cspell-types": "8.12.1" }, "bin": { "cspell-grammar": "bin.mjs" @@ -748,37 +661,37 @@ } }, "node_modules/cspell-io": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.11.0.tgz", - "integrity": "sha512-R6ZCNh2RrOkP3/OIpFHmtg6vztxMMsl6/t5kY1nTcmWv/1Ltw56G3q357KN6e+8epFiqFm4gMFmvzImFeR34Yw==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.12.1.tgz", + "integrity": "sha512-uPjYQP/OKmA8B1XbJunUTBingtrb6IKkp7enyljsZEbtPRKSudP16QPacgyZLLb5rCVQXyexebGfQ182jmq7dg==", "dependencies": { - "@cspell/cspell-service-bus": "8.11.0", - "@cspell/url": "8.11.0" + "@cspell/cspell-service-bus": "8.12.1", + "@cspell/url": "8.12.1" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.11.0.tgz", - "integrity": "sha512-msdfqJLIhJE1whfGXC2J669dKWrnWdFI18nR2OTXipWdiwZDDQEFT3q2Pq56+bhxwtoqAZKrez/zhRB/JbpUuA==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.12.1.tgz", + "integrity": "sha512-z2aZXnrip76zbH0j0ibTGux3mA71TMHtoEAd+n66so7Tx3QydUDAI0u7tzfbP3JyqL9ZWPlclQAfbutMUuzMBQ==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.11.0", - "@cspell/cspell-pipe": "8.11.0", - "@cspell/cspell-resolver": "8.11.0", - "@cspell/cspell-types": "8.11.0", - "@cspell/dynamic-import": "8.11.0", - "@cspell/strong-weak-map": "8.11.0", - "@cspell/url": "8.11.0", + "@cspell/cspell-bundled-dicts": "8.12.1", + "@cspell/cspell-pipe": "8.12.1", + "@cspell/cspell-resolver": "8.12.1", + "@cspell/cspell-types": "8.12.1", + "@cspell/dynamic-import": "8.12.1", + "@cspell/strong-weak-map": "8.12.1", + "@cspell/url": "8.12.1", "clear-module": "^4.1.2", "comment-json": "^4.2.4", - "cspell-config-lib": "8.11.0", - "cspell-dictionary": "8.11.0", - "cspell-glob": "8.11.0", - "cspell-grammar": "8.11.0", - "cspell-io": "8.11.0", - "cspell-trie-lib": "8.11.0", + "cspell-config-lib": "8.12.1", + "cspell-dictionary": "8.12.1", + "cspell-glob": "8.12.1", + "cspell-grammar": "8.12.1", + "cspell-io": "8.12.1", + "cspell-trie-lib": "8.12.1", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -793,30 +706,18 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.11.0.tgz", - "integrity": "sha512-PRW2ve2F3LBN1a/AwuuxHJ+VHPh9mN01qDAnyQojfqoF7ckRBe7+8Jb+7V9GonBS/oFQJ7AwObXtM2j0FP/DnQ==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.12.1.tgz", + "integrity": "sha512-a9QmGGUhparM9v184YsB+D0lSdzVgWDlLFEBjVLQJyvp43HErZjvcTPUojUypNQUEjxvksX0/C4pO5Wq8YUD8w==", "dependencies": { - "@cspell/cspell-pipe": "8.11.0", - "@cspell/cspell-types": "8.11.0", + "@cspell/cspell-pipe": "8.12.1", + "@cspell/cspell-types": "8.12.1", "gensequence": "^7.0.0" }, "engines": { "node": ">=18" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "license": "MIT" - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" - }, "node_modules/env-paths": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", @@ -880,15 +781,14 @@ } }, "node_modules/file-entry-cache": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", - "license": "MIT", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-9.0.0.tgz", + "integrity": "sha512-6MgEugi8p2tiUhqO7GnPsmbCCzj0YRCwwaTbpGRyKZesjRSzkqkAE9fPp7V2yMs5hwfgbQLgdvSSkGNg1s5Uvw==", "dependencies": { - "flat-cache": "^4.0.0" + "flat-cache": "^5.0.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=18" } }, "node_modules/fill-range": { @@ -914,52 +814,21 @@ } }, "node_modules/flat-cache": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.0.tgz", - "integrity": "sha512-EryKbCE/wxpxKniQlyas6PY1I9vwtF3uCBweX+N8KYTCn3Y12RTGtQAJ/bd5pl7kxUAc8v/R3Ake/N17OZiFqA==", - "license": "MIT", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-5.0.0.tgz", + "integrity": "sha512-JrqFmyUl2PnPi1OvLyTVHnQvwQ0S+e6lGSwu8OkAZlSaNIZciTY2H/cOOROxsBA1m/LZNHDsqAgDZt6akWcjsQ==", "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.4", - "rimraf": "^5.0.5" + "flatted": "^3.3.1", + "keyv": "^4.5.4" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/flatted": { - "version": "3.2.9", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", - "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", - "license": "ISC" - }, - "node_modules/foreground-child": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", - "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/foreground-child/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==" }, "node_modules/gensequence": { "version": "7.0.0", @@ -981,28 +850,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/glob": { - "version": "10.3.10", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", - "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^2.3.5", - "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -1097,15 +944,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -1126,41 +964,15 @@ "node": ">=0.12.0" } }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "license": "ISC" - }, - "node_modules/jackspeak": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", - "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "license": "MIT" + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "license": "MIT", "dependencies": { "json-buffer": "3.0.1" } @@ -1186,30 +998,6 @@ "node": ">=8.6" } }, - "node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/minipass": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", - "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/parent-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz", @@ -1221,40 +1009,6 @@ "node": ">=8" } }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-scurry": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", - "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^9.1.1 || ^10.0.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.1.0.tgz", - "integrity": "sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==", - "license": "ISC", - "engines": { - "node": "14 || >=16.14" - } - }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -1313,24 +1067,6 @@ "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.5.tgz", - "integrity": "sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A==", - "license": "ISC", - "dependencies": { - "glob": "^10.3.7" - }, - "bin": { - "rimraf": "dist/esm/bin.mjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -1355,9 +1091,9 @@ } }, "node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "bin": { "semver": "bin/semver.js" }, @@ -1365,82 +1101,10 @@ "node": ">=10" } }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "license": "MIT" - }, "node_modules/strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "license": "MIT", "dependencies": { "ansi-regex": "^6.0.1" }, @@ -1451,31 +1115,6 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -1497,94 +1136,6 @@ "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/xdg-basedir": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", @@ -1597,9 +1148,9 @@ } }, "node_modules/yaml": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", - "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz", + "integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==", "bin": { "yaml": "bin.mjs" }, diff --git a/package.json b/package.json index 7b8b624fe4..5a90ffcd31 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.11.0" + "cspell": "^8.12.1" } } From be76d77b953e06e6bed7c3d9817bb6165e901125 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 09:31:59 +0300 Subject: [PATCH 361/845] Bump Meziantou.Analyzer from 2.0.161 to 2.0.162 (#2707) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.161 to 2.0.162. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.161...2.0.162) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 9533190436..c6cbb17e07 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 859d1a8d38eb7c33845e3429e831e33d475ec4ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 09:32:31 +0300 Subject: [PATCH 362/845] Bump NUnit3TestAdapter from 4.5.0 to 4.6.0 in the nunit group (#2706) Bumps the nunit group with 1 update: [NUnit3TestAdapter](https://github.com/nunit/nunit3-vs-adapter). Updates `NUnit3TestAdapter` from 4.5.0 to 4.6.0 - [Release notes](https://github.com/nunit/nunit3-vs-adapter/releases) - [Commits](https://github.com/nunit/nunit3-vs-adapter/compare/V4.5.0...V4.6.0) --- updated-dependencies: - dependency-name: NUnit3TestAdapter dependency-type: direct:production update-type: version-update:semver-minor dependency-group: nunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index 6a176eedb2..9042e869d3 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -13,7 +13,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index 06fd2242f4..09bf0779f5 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -13,7 +13,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 1c41b74ac740f6a809a72f759c692b2c6b703f99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 09:42:02 +0300 Subject: [PATCH 363/845] Bump the xunit group with 2 updates (#2705) Bumps the xunit group with 2 updates: [Verify.Xunit](https://github.com/VerifyTests/Verify) and [System.Collections.Immutable](https://github.com/dotnet/runtime). Updates `Verify.Xunit` from 26.0.0 to 26.1.5 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/26.0.0...26.1.5) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 1bea377ce5..820624d553 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 691f6a3da8b8557b0aa9b164d8154cd35304040d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 08:01:39 +0300 Subject: [PATCH 364/845] Bump rexml from 3.2.8 to 3.3.3 in /docs (#2710) Bumps [rexml](https://github.com/ruby/rexml) from 3.2.8 to 3.3.3. - [Release notes](https://github.com/ruby/rexml/releases) - [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md) - [Commits](https://github.com/ruby/rexml/compare/v3.2.8...v3.3.3) --- updated-dependencies: - dependency-name: rexml dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 0d1fa88233..adba9fa1e9 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -238,8 +238,8 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - rexml (3.2.8) - strscan (>= 3.0.9) + rexml (3.3.3) + strscan rouge (3.30.0) ruby2_keywords (0.0.5) rubyzip (2.3.2) From feb3147b407e450cc99ca77a151cc685699b48f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Luthi?= Date: Sat, 3 Aug 2024 19:16:57 +0200 Subject: [PATCH 365/845] Simplify FrameworkSpecs (#2712) While it makes sense not to take hard dependencies on test frameworks in the FluentAssertions library, the TestFrameworks specs all have a dependency on the their respective test frameworks. Use them to simplify the assertion on the exceptions which should be thrown. Note that the support for NUnit4 was introduced exactly like this in 2f56211b769b7a9a10b619d8f3a2d868dd473735. --- Tests/TestFrameworks/MSTestV2.Specs/FrameworkSpecs.cs | 5 +---- Tests/TestFrameworks/MSpec.Specs/FrameworkSpecs.cs | 3 +-- Tests/TestFrameworks/NUnit3.Specs/FrameworkSpecs.cs | 5 +---- Tests/TestFrameworks/XUnit2.Specs/FrameworkSpecs.cs | 4 ++-- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/Tests/TestFrameworks/MSTestV2.Specs/FrameworkSpecs.cs b/Tests/TestFrameworks/MSTestV2.Specs/FrameworkSpecs.cs index a6ce6387b6..b527e6bff2 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/FrameworkSpecs.cs +++ b/Tests/TestFrameworks/MSTestV2.Specs/FrameworkSpecs.cs @@ -14,9 +14,6 @@ public void When_mstestv2_is_used_it_should_throw_mstest_exceptions_for_assertio Action act = () => 0.Should().Be(1); // Assert - Exception exception = act.Should().Throw().Which; - exception.GetType() - .FullName.Should() - .ContainEquivalentOf("Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException"); + act.Should().Throw(); } } diff --git a/Tests/TestFrameworks/MSpec.Specs/FrameworkSpecs.cs b/Tests/TestFrameworks/MSpec.Specs/FrameworkSpecs.cs index 4572dd850c..0322e46865 100644 --- a/Tests/TestFrameworks/MSpec.Specs/FrameworkSpecs.cs +++ b/Tests/TestFrameworks/MSpec.Specs/FrameworkSpecs.cs @@ -9,8 +9,7 @@ public class When_mspec_is_used { Because of = () => Exception = Catch.Exception(() => 0.Should().Be(1)); - It should_fail = () => Exception.Should().NotBeNull().And.BeAssignableTo(); - It should_have_a_specific_reason = () => Exception.GetType().FullName.Should().ContainEquivalentOf("Machine.Specifications.SpecificationException"); + It should_fail_with_a_specification_exception = () => Exception.Should().BeOfType(); private static Exception Exception; } diff --git a/Tests/TestFrameworks/NUnit3.Specs/FrameworkSpecs.cs b/Tests/TestFrameworks/NUnit3.Specs/FrameworkSpecs.cs index 95576d269f..fd90bc41ff 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/FrameworkSpecs.cs +++ b/Tests/TestFrameworks/NUnit3.Specs/FrameworkSpecs.cs @@ -14,9 +14,6 @@ public void When_nunit3_is_used_it_should_throw_nunit_exceptions_for_assertion_f Action act = () => 0.Should().Be(1); // Assert - Exception exception = act.Should().Throw().Which; - exception.GetType() - .FullName.Should() - .ContainEquivalentOf("NUnit.Framework.AssertionException"); + act.Should().Throw(); } } diff --git a/Tests/TestFrameworks/XUnit2.Specs/FrameworkSpecs.cs b/Tests/TestFrameworks/XUnit2.Specs/FrameworkSpecs.cs index af307cbc30..2a7b0f1755 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/FrameworkSpecs.cs +++ b/Tests/TestFrameworks/XUnit2.Specs/FrameworkSpecs.cs @@ -1,6 +1,7 @@ using System; using FluentAssertions; using Xunit; +using Xunit.Sdk; namespace XUnit2.Specs; @@ -13,7 +14,6 @@ public void When_xunit2_is_used_it_should_throw_xunit_exceptions_for_assertion_f Action act = () => 0.Should().Be(1); // Assert - Exception exception = act.Should().Throw().Which; - exception.GetType().FullName.Should().ContainEquivalentOf("xunit"); + act.Should().Throw(); } } From d6786904a27e5bc69b7d14013ae0c045c9aef2f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 21:21:16 +0300 Subject: [PATCH 366/845] Bump Meziantou.Analyzer from 2.0.162 to 2.0.163 (#2717) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.162 to 2.0.163. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.162...2.0.163) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index c6cbb17e07..73c77aa239 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From e6663be054b0b1a4ac9159a364c0f6fdd509193f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 21:21:37 +0300 Subject: [PATCH 367/845] Bump cspell from 8.12.1 to 8.13.1 (#2715) Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.12.1 to 8.13.1. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.13.1/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 240 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 121 insertions(+), 121 deletions(-) diff --git a/package-lock.json b/package-lock.json index 865dcef53d..7dfa24440d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,19 +7,19 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.12.1" + "cspell": "^8.13.1" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.12.1.tgz", - "integrity": "sha512-55wCxlKwRsYCt8uWB65C0xiJ4bP43UE3b/GK01ekyz2fZ11mudMWGMrX/pdKwGIOXFfFqDz3DCRxFs+fHS58oA==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.13.1.tgz", + "integrity": "sha512-ylAwnIdxBMJ9v6BHpFAQFZM+5zbybLtqVQJG7zQePts4e0/Qr2xjYFbC3F+fovZqyXPIx24BR+S6gFJNO1OdAw==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.3", "@cspell/dict-bash": "^4.1.3", - "@cspell/dict-companies": "^3.1.2", - "@cspell/dict-cpp": "^5.1.11", + "@cspell/dict-companies": "^3.1.3", + "@cspell/dict-cpp": "^5.1.12", "@cspell/dict-cryptocurrencies": "^5.0.0", "@cspell/dict-csharp": "^4.0.2", "@cspell/dict-css": "^4.0.12", @@ -34,7 +34,7 @@ "@cspell/dict-filetypes": "^3.0.4", "@cspell/dict-fonts": "^4.0.0", "@cspell/dict-fsharp": "^1.0.1", - "@cspell/dict-fullstack": "^3.1.8", + "@cspell/dict-fullstack": "^3.2.0", "@cspell/dict-gaming-terms": "^1.0.5", "@cspell/dict-git": "^3.0.0", "@cspell/dict-golang": "^6.0.9", @@ -44,28 +44,28 @@ "@cspell/dict-html-symbol-entities": "^4.0.0", "@cspell/dict-java": "^5.0.7", "@cspell/dict-julia": "^1.0.1", - "@cspell/dict-k8s": "^1.0.5", + "@cspell/dict-k8s": "^1.0.6", "@cspell/dict-latex": "^4.0.0", "@cspell/dict-lorem-ipsum": "^4.0.0", "@cspell/dict-lua": "^4.0.3", "@cspell/dict-makefile": "^1.0.0", "@cspell/dict-monkeyc": "^1.0.6", "@cspell/dict-node": "^5.0.1", - "@cspell/dict-npm": "^5.0.17", + "@cspell/dict-npm": "^5.0.18", "@cspell/dict-php": "^4.0.8", "@cspell/dict-powershell": "^5.0.5", "@cspell/dict-public-licenses": "^2.0.7", - "@cspell/dict-python": "^4.2.1", + "@cspell/dict-python": "^4.2.3", "@cspell/dict-r": "^2.0.1", "@cspell/dict-ruby": "^5.0.2", - "@cspell/dict-rust": "^4.0.4", + "@cspell/dict-rust": "^4.0.5", "@cspell/dict-scala": "^5.0.3", - "@cspell/dict-software-terms": "^4.0.0", + "@cspell/dict-software-terms": "^4.0.3", "@cspell/dict-sql": "^2.1.3", "@cspell/dict-svelte": "^1.0.2", "@cspell/dict-swift": "^2.0.1", "@cspell/dict-terraform": "^1.0.0", - "@cspell/dict-typescript": "^3.1.5", + "@cspell/dict-typescript": "^3.1.6", "@cspell/dict-vue": "^3.0.0" }, "engines": { @@ -73,28 +73,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.12.1.tgz", - "integrity": "sha512-nO/3GTk3rBpLRBzkmcKFxbtEDd3FKXfQ5uTCpJ27XYVHYjlU+d4McOYYMClMhpFianVol2JCyberpGAj6bVgLg==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.13.1.tgz", + "integrity": "sha512-vYZTBRkYjpNBifGNbYQsgIXesDEdUa9QAwllDcLZGKbhh5mY/C1ygPnAVpYDYiJNt1WCeIqW286DUyjRjkmHeA==", "dependencies": { - "@cspell/cspell-types": "8.12.1" + "@cspell/cspell-types": "8.13.1" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.12.1.tgz", - "integrity": "sha512-lh0zIm43r/Fj3sQWXc68msKnXNrfPOo8VvzL1hOP0v/j2eH61fvELH08/K+nQJ8cCutNZ4zhk9+KMDU4KmsMtw==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.13.1.tgz", + "integrity": "sha512-acLWTQv3yWfeWXMds/cfQKZapslOrLHVL4VDp4rFyL/EnfgaCr7Ew9hQ7zAIARY3r/n0dByqWbOt2HKthdhx/g==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.12.1.tgz", - "integrity": "sha512-3HE04m7DS/6xYpWPN2QBGCHr26pvxHa78xYk+PjiPD2Q49ceqTNdFcZOYd+Wba8HbRXSukchSLhrTujmPEzqpw==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.13.1.tgz", + "integrity": "sha512-EGdb7KLYCklV3sLxf/895b7s6sExh8DCHZFpDos2hjKwMt+F4ynsu1+ceybQtqoUF/MsyLoJXrrmPvV2uGVmUQ==", "dependencies": { "global-directory": "^4.0.1" }, @@ -103,17 +103,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.12.1.tgz", - "integrity": "sha512-UQPddS38dQ/FG00y2wginCzdS6yxryiGrWXSD/P59idCrYYDCYnI9pPsx4u10tmRkW1zJ+O7gGCsXw7xa5DAJQ==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.13.1.tgz", + "integrity": "sha512-oLFJfxuB1rwGXn3eD5qSF9nf0lHu6YjO0JcrjWhAZQ0r3AsO97gsX50wwCFCw6szVU3rd1cTUktW0KYEZUY6dA==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.12.1.tgz", - "integrity": "sha512-17POyyRgl7m7mMuv1qk2xX6E5bdT0F3247vloBCdUMyaVtmtN4uEiQ/jqU5vtW02vxlKjKS0HcTvKz4EVfSlzQ==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.13.1.tgz", + "integrity": "sha512-9dJdmyXLXJVesCJa/DWgwKsEC9p2RRFc6KORcLhNvtm1tE9TvCXiu5jV47sOmYXd6Hwan8IurBXXTz82CLVjPQ==", "engines": { "node": ">=18" } @@ -134,9 +134,9 @@ "integrity": "sha512-tOdI3QVJDbQSwPjUkOiQFhYcu2eedmX/PtEpVWg0aFps/r6AyjUQINtTgpqMYnYuq8O1QUIQqnpx21aovcgZCw==" }, "node_modules/@cspell/dict-companies": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.3.tgz", - "integrity": "sha512-qaAmfKtQLA7Sbe9zfFVpcwyG92cx6+EiWIpPURv11Ng2QMv2PKhYcterUJBooAvgqD0/qq+AsLN8MREloY5Mdw==" + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.4.tgz", + "integrity": "sha512-y9e0amzEK36EiiKx3VAA+SHQJPpf2Qv5cCt5eTUSggpTkiFkCh6gRKQ97rVlrKh5GJrqinDwYIJtTsxuh2vy2Q==" }, "node_modules/@cspell/dict-cpp": { "version": "5.1.12", @@ -194,9 +194,9 @@ "integrity": "sha512-l0SoEQBsi3zDSl3OuL4/apBkxjuj4hLIg/oy6+gZ7LWh03rKdF6VNtSZNXWAmMY+pmb1cGA3ouleTiJIglbsIg==" }, "node_modules/@cspell/dict-en-common-misspellings": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.3.tgz", - "integrity": "sha512-8nF1z9nUiSgMyikL66HTbDO7jCGtB24TxKBasXIBwkBKMDZgA2M883iXdeByy6m1JJUcCGFkSftVYp2W0bUgjw==" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.4.tgz", + "integrity": "sha512-lvOiRjV/FG4pAGZL3PN2GCVHSTCE92cwhfLGGkOsQtxSmef6WCHfHwp9auafkBlX0yFQSKDfq6/TlpQbjbJBtQ==" }, "node_modules/@cspell/dict-en-gb": { "version": "1.1.33", @@ -352,14 +352,14 @@ "integrity": "sha512-4yGb4AInT99rqprxVNT9TYb1YSpq58Owzq7zi3ZS5T0u899Y4VsxsBiOgHnQ/4W+ygi+sp+oqef8w8nABR2lkg==" }, "node_modules/@cspell/dict-software-terms": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.0.3.tgz", - "integrity": "sha512-65QAVMc3YlcI7PcqWRY5ox53tTWC8aktUZdJYCVs4VDBPUCTSDnTSmSreeg4F5Z468clv9KF/S0PkxbLjgW72A==" + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.0.4.tgz", + "integrity": "sha512-AHr3Wxa4pxbpKgxhyQseBmoJhdyeraeRGdQn0e8YD5pz4J6Mu47MLzKysasDKWK/yzmHQfwAsb2zm2k+ItMEUw==" }, "node_modules/@cspell/dict-sql": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.1.3.tgz", - "integrity": "sha512-SEyTNKJrjqD6PAzZ9WpdSu6P7wgdNtGV2RV8Kpuw1x6bV+YsSptuClYG+JSdRExBTE6LwIe1bTklejUp3ZP8TQ==" + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.1.4.tgz", + "integrity": "sha512-wsrNK6UBQ92IzQ4SqQqgM04BEYzqVsk3qZH3ZgascaqDtUgK6GI+z3Czi0rQ+9Qe2zKiklGnGMC8sJwYdlIw7g==" }, "node_modules/@cspell/dict-svelte": { "version": "1.0.2", @@ -387,9 +387,9 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.12.1.tgz", - "integrity": "sha512-18faXHALiMsXtG3v67qeyDhNRZVtkhX5Je2qw8iZQB/i61y0Mfm22iiZeXsKImrXbwP0acyhRkRA1sp1NaQmOw==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.13.1.tgz", + "integrity": "sha512-jMqJHWmQy+in99JMSFlaGV9P033gCx7DCZvGO/ZSeZ2EatrUTanJk3oTG1TZknZydb0nnxr1mgTWXN7PCAAXDg==", "dependencies": { "import-meta-resolve": "^4.1.0" }, @@ -398,17 +398,17 @@ } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.12.1.tgz", - "integrity": "sha512-0O5qGHRXoKl0+hXGdelox2awrCMr8LXObUcWwYbSih7HIm4DwhxMO4qjDFye1NdjW0P88yhpQ23J2ceSto9C5Q==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.13.1.tgz", + "integrity": "sha512-ga1ibI9ZLJWNszfP7e6qQ8gnoQOP9rE/clALMAim9ssO6cmMhEEm+i1ROH4nsDfThd6sVlUJ0IOtx5dEqPmWxw==", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.12.1.tgz", - "integrity": "sha512-mUYaDniHVLw0YXn2egT2e21MYubMAf+1LDeC0kkbg4VWNxSlC1Ksyv6pqhos495esaa8OCjizdIdnGSF6al9Rw==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.13.1.tgz", + "integrity": "sha512-cCyojz5ovgGCexhez2urle4Q1UOEsp96lvl4pDmWNDHa/6n8dqiIn60SVzQIsAHzJ4yEV077RSaIrTlq/T+oSQ==", "engines": { "node": ">=18.0" } @@ -554,22 +554,23 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cspell": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.12.1.tgz", - "integrity": "sha512-mdnUUPydxxdj/uyF84U/DvPiY/l58Z2IpNwTx3H9Uve9dfT0vRv/7jiFNAvK4hAfZQaMaE7DPC00ckywTI/XgA==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.13.1.tgz", + "integrity": "sha512-Bqppilpwx9xt3jZPaYcqe1JPteNmfKhx9pw9YglZEePDUzdiJQNVIfs31589GAnXjgdqqctR8N87ffLcaBNPXw==", "dependencies": { - "@cspell/cspell-json-reporter": "8.12.1", - "@cspell/cspell-pipe": "8.12.1", - "@cspell/cspell-types": "8.12.1", - "@cspell/dynamic-import": "8.12.1", - "@cspell/url": "8.12.1", + "@cspell/cspell-json-reporter": "8.13.1", + "@cspell/cspell-pipe": "8.13.1", + "@cspell/cspell-types": "8.13.1", + "@cspell/dynamic-import": "8.13.1", + "@cspell/url": "8.13.1", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-gitignore": "8.12.1", - "cspell-glob": "8.12.1", - "cspell-io": "8.12.1", - "cspell-lib": "8.12.1", + "cspell-dictionary": "8.13.1", + "cspell-gitignore": "8.13.1", + "cspell-glob": "8.13.1", + "cspell-io": "8.13.1", + "cspell-lib": "8.13.1", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.0.0", @@ -589,41 +590,40 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.12.1.tgz", - "integrity": "sha512-xEoKdb8hyturyiUXFdRgQotYegYe3OZS+Yc7JHnB75Ykt+Co2gtnu2M/Yb0yoqaHCXflVO6MITrKNaxricgqVw==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.13.1.tgz", + "integrity": "sha512-sXUFOyxvk+qDkoQdFkVEqj1hfQWzMi+tbi6ksiotQaqpm7r+YitZLSgwJjN4xgDO/rTLyP70k9fagdZ67MVZbw==", "dependencies": { - "@cspell/cspell-types": "8.12.1", + "@cspell/cspell-types": "8.13.1", "comment-json": "^4.2.4", - "yaml": "^2.4.5" + "yaml": "^2.5.0" }, "engines": { "node": ">=18" } }, "node_modules/cspell-dictionary": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.12.1.tgz", - "integrity": "sha512-jYHEA48on6pBQYVUEzXV63wy5Ulx/QNUZcoiG3C0OmYIKjACTaEg02AMDOr+Eaj34E5v4pGEShzot4Qtt/aiNQ==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.13.1.tgz", + "integrity": "sha512-Z0T4J4ahOJaHmWq83w24KXGik1zeauO5WvDRyzDyaSgpbA5MN2hN98LvxaIx72g3I+trtRK77XFcKginuME9EA==", "dependencies": { - "@cspell/cspell-pipe": "8.12.1", - "@cspell/cspell-types": "8.12.1", - "cspell-trie-lib": "8.12.1", - "fast-equals": "^5.0.1", - "gensequence": "^7.0.0" + "@cspell/cspell-pipe": "8.13.1", + "@cspell/cspell-types": "8.13.1", + "cspell-trie-lib": "8.13.1", + "fast-equals": "^5.0.1" }, "engines": { "node": ">=18" } }, "node_modules/cspell-gitignore": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.12.1.tgz", - "integrity": "sha512-XlO87rdrab3VKU8e7+RGEfqEtYqo7ObgfZeYEAdJlwUXvqYxBzA11jDZAovDz/5jv0YfRMx6ch5t6+1zfSeBbQ==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.13.1.tgz", + "integrity": "sha512-XyZ3X5d6x0gkWtNXSAQRcPMG41bEdLx9cTgZCYCJhEZCesU1VpNm60F3oc11dMLkO+BqPH3An+AO/YEIiaje3A==", "dependencies": { - "@cspell/url": "8.12.1", - "cspell-glob": "8.12.1", - "cspell-io": "8.12.1", + "@cspell/url": "8.13.1", + "cspell-glob": "8.13.1", + "cspell-io": "8.13.1", "find-up-simple": "^1.0.0" }, "bin": { @@ -634,11 +634,11 @@ } }, "node_modules/cspell-glob": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.12.1.tgz", - "integrity": "sha512-ZplEPLlNwj7luEKu/VudIaV+cGTQHExihGvAUxlIVMFURiAFMT5eH0UsQoCEpSevIEueO+slLUDy7rxwTwAGdQ==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.13.1.tgz", + "integrity": "sha512-rW1A3t7YvPXxcC4z1pp1m9coeWzUVUmRjUw3vMNGlEDC2zecB39KKbEqesziBqnBceNAY7O5itllIGFKr03vqA==", "dependencies": { - "@cspell/url": "8.12.1", + "@cspell/url": "8.13.1", "micromatch": "^4.0.7" }, "engines": { @@ -646,12 +646,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.12.1.tgz", - "integrity": "sha512-IAES553M5nuB/wtiWYayDX2/5OmDu2VmEcnV6SXNze8oop0oodSqr3h46rLy+m1EOOD8nenMa295N/dRPqTB/g==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.13.1.tgz", + "integrity": "sha512-HUkd24bulvBwee1UNBurxGlPUOiywb9pB34iXXoxFWuloHohZ/DuFlE8B/31ZtjW48ffEYIu3QZfWhcnD8e81w==", "dependencies": { - "@cspell/cspell-pipe": "8.12.1", - "@cspell/cspell-types": "8.12.1" + "@cspell/cspell-pipe": "8.13.1", + "@cspell/cspell-types": "8.13.1" }, "bin": { "cspell-grammar": "bin.mjs" @@ -661,43 +661,43 @@ } }, "node_modules/cspell-io": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.12.1.tgz", - "integrity": "sha512-uPjYQP/OKmA8B1XbJunUTBingtrb6IKkp7enyljsZEbtPRKSudP16QPacgyZLLb5rCVQXyexebGfQ182jmq7dg==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.13.1.tgz", + "integrity": "sha512-t2sgZuWGBzPSOAStfvz/U3KoFEfDxEt1cXZj0Kd0Vs36v2uoLktm6ihMe7XNFu7zIdOFSajsYQ8Bi4RSLPGPxQ==", "dependencies": { - "@cspell/cspell-service-bus": "8.12.1", - "@cspell/url": "8.12.1" + "@cspell/cspell-service-bus": "8.13.1", + "@cspell/url": "8.13.1" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.12.1.tgz", - "integrity": "sha512-z2aZXnrip76zbH0j0ibTGux3mA71TMHtoEAd+n66so7Tx3QydUDAI0u7tzfbP3JyqL9ZWPlclQAfbutMUuzMBQ==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.13.1.tgz", + "integrity": "sha512-H1HHG1pmATSeAaY0KmQ0xnkbSqJLvh9QpXWARDLWKUBvtE+/l44H4yVhIp/No3rM7PKMmb82GuSJzMaoIhHFLQ==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.12.1", - "@cspell/cspell-pipe": "8.12.1", - "@cspell/cspell-resolver": "8.12.1", - "@cspell/cspell-types": "8.12.1", - "@cspell/dynamic-import": "8.12.1", - "@cspell/strong-weak-map": "8.12.1", - "@cspell/url": "8.12.1", + "@cspell/cspell-bundled-dicts": "8.13.1", + "@cspell/cspell-pipe": "8.13.1", + "@cspell/cspell-resolver": "8.13.1", + "@cspell/cspell-types": "8.13.1", + "@cspell/dynamic-import": "8.13.1", + "@cspell/strong-weak-map": "8.13.1", + "@cspell/url": "8.13.1", "clear-module": "^4.1.2", "comment-json": "^4.2.4", - "cspell-config-lib": "8.12.1", - "cspell-dictionary": "8.12.1", - "cspell-glob": "8.12.1", - "cspell-grammar": "8.12.1", - "cspell-io": "8.12.1", - "cspell-trie-lib": "8.12.1", + "cspell-config-lib": "8.13.1", + "cspell-dictionary": "8.13.1", + "cspell-glob": "8.13.1", + "cspell-grammar": "8.13.1", + "cspell-io": "8.13.1", + "cspell-trie-lib": "8.13.1", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", "import-fresh": "^3.3.0", "resolve-from": "^5.0.0", - "vscode-languageserver-textdocument": "^1.0.11", + "vscode-languageserver-textdocument": "^1.0.12", "vscode-uri": "^3.0.8", "xdg-basedir": "^5.1.0" }, @@ -706,12 +706,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.12.1.tgz", - "integrity": "sha512-a9QmGGUhparM9v184YsB+D0lSdzVgWDlLFEBjVLQJyvp43HErZjvcTPUojUypNQUEjxvksX0/C4pO5Wq8YUD8w==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.13.1.tgz", + "integrity": "sha512-2moCsIYDmMT7hp5Non3CvWatfXptFWCuxjbXQGDNvWJ2Cj3oso/oBe4802GJv5GEenv9QBWmEtum/E7rFcx4JA==", "dependencies": { - "@cspell/cspell-pipe": "8.12.1", - "@cspell/cspell-types": "8.12.1", + "@cspell/cspell-pipe": "8.13.1", + "@cspell/cspell-types": "8.13.1", "gensequence": "^7.0.0" }, "engines": { @@ -1127,9 +1127,9 @@ } }, "node_modules/vscode-languageserver-textdocument": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz", - "integrity": "sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==" + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", + "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==" }, "node_modules/vscode-uri": { "version": "3.0.8", diff --git a/package.json b/package.json index 5a90ffcd31..a8dc78f808 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.12.1" + "cspell": "^8.13.1" } } From a5e5a3eb917eb6ec227d0a1bdd12e90206fc5e03 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 21:23:16 +0300 Subject: [PATCH 368/845] Bump the xunit group with 2 updates (#2716) Bumps the xunit group with 2 updates: [Verify.Xunit](https://github.com/VerifyTests/Verify) and [System.Collections.Immutable](https://github.com/dotnet/runtime). Updates `Verify.Xunit` from 26.1.5 to 26.1.6 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/26.1.5...26.1.6) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 820624d553..f487afafed 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From a8ecacb2f2d3382d027dd7342bdc8e39b56d98e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:14:20 +0000 Subject: [PATCH 369/845] Bump cspell from 8.13.1 to 8.13.3 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.13.1 to 8.13.3. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.13.3/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 230 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 116 insertions(+), 116 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7dfa24440d..fa4f12e6db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,18 +7,18 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.13.1" + "cspell": "^8.13.3" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.13.1.tgz", - "integrity": "sha512-ylAwnIdxBMJ9v6BHpFAQFZM+5zbybLtqVQJG7zQePts4e0/Qr2xjYFbC3F+fovZqyXPIx24BR+S6gFJNO1OdAw==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.13.3.tgz", + "integrity": "sha512-OfCxUBMyayxKyeDaUZG3LQpiyH8MFUbg9nbIZCGh2x8U6N0fHaP9uR6R+gPzdi/bJp32Kr+RC/Yebojd+AQCGA==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.3", "@cspell/dict-bash": "^4.1.3", - "@cspell/dict-companies": "^3.1.3", + "@cspell/dict-companies": "^3.1.4", "@cspell/dict-cpp": "^5.1.12", "@cspell/dict-cryptocurrencies": "^5.0.0", "@cspell/dict-csharp": "^4.0.2", @@ -29,7 +29,7 @@ "@cspell/dict-dotnet": "^5.0.2", "@cspell/dict-elixir": "^4.0.3", "@cspell/dict-en_us": "^4.3.23", - "@cspell/dict-en-common-misspellings": "^2.0.3", + "@cspell/dict-en-common-misspellings": "^2.0.4", "@cspell/dict-en-gb": "1.1.33", "@cspell/dict-filetypes": "^3.0.4", "@cspell/dict-fonts": "^4.0.0", @@ -55,13 +55,13 @@ "@cspell/dict-php": "^4.0.8", "@cspell/dict-powershell": "^5.0.5", "@cspell/dict-public-licenses": "^2.0.7", - "@cspell/dict-python": "^4.2.3", + "@cspell/dict-python": "^4.2.4", "@cspell/dict-r": "^2.0.1", "@cspell/dict-ruby": "^5.0.2", "@cspell/dict-rust": "^4.0.5", "@cspell/dict-scala": "^5.0.3", - "@cspell/dict-software-terms": "^4.0.3", - "@cspell/dict-sql": "^2.1.3", + "@cspell/dict-software-terms": "^4.0.6", + "@cspell/dict-sql": "^2.1.5", "@cspell/dict-svelte": "^1.0.2", "@cspell/dict-swift": "^2.0.1", "@cspell/dict-terraform": "^1.0.0", @@ -73,28 +73,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.13.1.tgz", - "integrity": "sha512-vYZTBRkYjpNBifGNbYQsgIXesDEdUa9QAwllDcLZGKbhh5mY/C1ygPnAVpYDYiJNt1WCeIqW286DUyjRjkmHeA==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.13.3.tgz", + "integrity": "sha512-QrHxWkm0cfD+rTjFOxm5lpE4+wBANDzMIM8NOeQC6v8Dc1L8PUkm6hF6CsEv2tKmuwvdVr+jy6GilDMkPXalCg==", "dependencies": { - "@cspell/cspell-types": "8.13.1" + "@cspell/cspell-types": "8.13.3" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.13.1.tgz", - "integrity": "sha512-acLWTQv3yWfeWXMds/cfQKZapslOrLHVL4VDp4rFyL/EnfgaCr7Ew9hQ7zAIARY3r/n0dByqWbOt2HKthdhx/g==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.13.3.tgz", + "integrity": "sha512-6a9Zd+fDltgXoJ0fosWqEMx0UdXBXZ7iakhslMNPRmv7GhVAoHBoIXzMVilOE4kYT2Mh/9NM/QW/NbNEpneZIQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.13.1.tgz", - "integrity": "sha512-EGdb7KLYCklV3sLxf/895b7s6sExh8DCHZFpDos2hjKwMt+F4ynsu1+ceybQtqoUF/MsyLoJXrrmPvV2uGVmUQ==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.13.3.tgz", + "integrity": "sha512-vlwtMTEWsPPtWfktzT75eGQ0n+0M+9kN+89eSvUUYdCfvY9XAS6z+bTmhS2ULJgntgWtX6gUjABQK0PYYVedOg==", "dependencies": { "global-directory": "^4.0.1" }, @@ -103,17 +103,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.13.1.tgz", - "integrity": "sha512-oLFJfxuB1rwGXn3eD5qSF9nf0lHu6YjO0JcrjWhAZQ0r3AsO97gsX50wwCFCw6szVU3rd1cTUktW0KYEZUY6dA==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.13.3.tgz", + "integrity": "sha512-mFkeWXwGQSDxRiN6Kez77GaMNGNgG7T6o9UE42jyXEgf/bLJTpefbUy4fY5pU3p2mA0eoMzmnJX8l+TC5YJpbA==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.13.1.tgz", - "integrity": "sha512-9dJdmyXLXJVesCJa/DWgwKsEC9p2RRFc6KORcLhNvtm1tE9TvCXiu5jV47sOmYXd6Hwan8IurBXXTz82CLVjPQ==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.13.3.tgz", + "integrity": "sha512-lA5GbhLOL6FlKCWNMbooRFgNGfTsM6NJnHz60+EEN7XD9OgpFc7w+MBcK4aHsVCxcrIvnejIc8xQDqPnrdmN3w==", "engines": { "node": ">=18" } @@ -154,9 +154,9 @@ "integrity": "sha512-1JMofhLK+4p4KairF75D3A924m5ERMgd1GvzhwK2geuYgd2ZKuGW72gvXpIV7aGf52E3Uu1kDXxxGAiZ5uVG7g==" }, "node_modules/@cspell/dict-css": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.12.tgz", - "integrity": "sha512-vGBgPM92MkHQF5/2jsWcnaahOZ+C6OE/fPvd5ScBP72oFY9tn5GLuomcyO0z8vWCr2e0nUSX1OGimPtcQAlvSw==" + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.13.tgz", + "integrity": "sha512-WfOQkqlAJTo8eIQeztaH0N0P+iF5hsJVKFuhy4jmARPISy8Efcv8QXk2/IVbmjJH0/ZV7dKRdnY5JFVXuVz37g==" }, "node_modules/@cspell/dict-dart": { "version": "2.0.3", @@ -324,9 +324,9 @@ "integrity": "sha512-KlBXuGcN3LE7tQi/GEqKiDewWGGuopiAD0zRK1QilOx5Co8XAvs044gk4MNIQftc8r0nHeUI+irJKLGcR36DIQ==" }, "node_modules/@cspell/dict-python": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.3.tgz", - "integrity": "sha512-C1CPX9wwEGgcHv/p7KfjuIOp1G6KNyx5gWYweAd6/KPv+ZpeM1v572zFUTmpO8WDuAfKFf00nqYL8/GmCENWBw==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.4.tgz", + "integrity": "sha512-sCtLBqMreb+8zRW2bXvFsfSnRUVU6IFm4mT6Dc4xbz0YajprbaPPh/kOUTw5IJRP8Uh+FFb7Xp2iH03CNWRq/A==", "dependencies": { "@cspell/dict-data-science": "^2.0.1" } @@ -352,14 +352,14 @@ "integrity": "sha512-4yGb4AInT99rqprxVNT9TYb1YSpq58Owzq7zi3ZS5T0u899Y4VsxsBiOgHnQ/4W+ygi+sp+oqef8w8nABR2lkg==" }, "node_modules/@cspell/dict-software-terms": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.0.4.tgz", - "integrity": "sha512-AHr3Wxa4pxbpKgxhyQseBmoJhdyeraeRGdQn0e8YD5pz4J6Mu47MLzKysasDKWK/yzmHQfwAsb2zm2k+ItMEUw==" + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.0.6.tgz", + "integrity": "sha512-UDhUzNSf7GN529a0Ip9hlSoGbpscz0YlUYBEJmZBXi8otpkrbCJqs50T74Ppd+SWqNil04De8urv4af2c6SY5Q==" }, "node_modules/@cspell/dict-sql": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.1.4.tgz", - "integrity": "sha512-wsrNK6UBQ92IzQ4SqQqgM04BEYzqVsk3qZH3ZgascaqDtUgK6GI+z3Czi0rQ+9Qe2zKiklGnGMC8sJwYdlIw7g==" + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.1.5.tgz", + "integrity": "sha512-FmxanytHXss7GAWAXmgaxl3icTCW7YxlimyOSPNfm+njqeUDjw3kEv4mFNDDObBJv8Ec5AWCbUDkWIpkE3IpKg==" }, "node_modules/@cspell/dict-svelte": { "version": "1.0.2", @@ -387,9 +387,9 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.13.1.tgz", - "integrity": "sha512-jMqJHWmQy+in99JMSFlaGV9P033gCx7DCZvGO/ZSeZ2EatrUTanJk3oTG1TZknZydb0nnxr1mgTWXN7PCAAXDg==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.13.3.tgz", + "integrity": "sha512-YN83CFWnMkt9B0q0RBadfEoptUaDRqBikh8b91MOQ0haEnUo6t57j4jAaLnbIEP4ynzMhgruWFKpIC/QaEtCuA==", "dependencies": { "import-meta-resolve": "^4.1.0" }, @@ -398,17 +398,17 @@ } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.13.1.tgz", - "integrity": "sha512-ga1ibI9ZLJWNszfP7e6qQ8gnoQOP9rE/clALMAim9ssO6cmMhEEm+i1ROH4nsDfThd6sVlUJ0IOtx5dEqPmWxw==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.13.3.tgz", + "integrity": "sha512-/QYUEthesPuDarOHa6kcWKJmVq0HIotjPrmAWQ5QpH+dDik1Qin4G/9QdnWX75ueR4DC4WFjBNBU14C4TVSwHQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.13.1.tgz", - "integrity": "sha512-cCyojz5ovgGCexhez2urle4Q1UOEsp96lvl4pDmWNDHa/6n8dqiIn60SVzQIsAHzJ4yEV077RSaIrTlq/T+oSQ==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.13.3.tgz", + "integrity": "sha512-hsxoTnZHwtdR2x9QEE6yfDBB1LUwAj67o1GyKTvI8A2OE/AfzAttirZs+9sxgOGWoBdTOxM9sMLtqB3SxtDB3A==", "engines": { "node": ">=18.0" } @@ -534,9 +534,9 @@ } }, "node_modules/comment-json": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.4.tgz", - "integrity": "sha512-E5AjpSW+O+N5T2GsOQMHLLsJvrYw6G/AFt9GvU6NguEAfzKShh7hRiLtVo6S9KbRpFMGqE5ojo0/hE+sdteWvQ==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.5.tgz", + "integrity": "sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw==", "dependencies": { "array-timsort": "^1.0.3", "core-util-is": "^1.0.3", @@ -554,23 +554,23 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cspell": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.13.1.tgz", - "integrity": "sha512-Bqppilpwx9xt3jZPaYcqe1JPteNmfKhx9pw9YglZEePDUzdiJQNVIfs31589GAnXjgdqqctR8N87ffLcaBNPXw==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.13.3.tgz", + "integrity": "sha512-2wv4Eby7g8wDB553fI8IoZjyitoKrD2kmtdeoYUN2EjVs3RMpIOver3fL+0VaFAaN0uLfAoeAAIB5xJEakvZYQ==", "dependencies": { - "@cspell/cspell-json-reporter": "8.13.1", - "@cspell/cspell-pipe": "8.13.1", - "@cspell/cspell-types": "8.13.1", - "@cspell/dynamic-import": "8.13.1", - "@cspell/url": "8.13.1", + "@cspell/cspell-json-reporter": "8.13.3", + "@cspell/cspell-pipe": "8.13.3", + "@cspell/cspell-types": "8.13.3", + "@cspell/dynamic-import": "8.13.3", + "@cspell/url": "8.13.3", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-dictionary": "8.13.1", - "cspell-gitignore": "8.13.1", - "cspell-glob": "8.13.1", - "cspell-io": "8.13.1", - "cspell-lib": "8.13.1", + "cspell-dictionary": "8.13.3", + "cspell-gitignore": "8.13.3", + "cspell-glob": "8.13.3", + "cspell-io": "8.13.3", + "cspell-lib": "8.13.3", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.0.0", @@ -590,12 +590,12 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.13.1.tgz", - "integrity": "sha512-sXUFOyxvk+qDkoQdFkVEqj1hfQWzMi+tbi6ksiotQaqpm7r+YitZLSgwJjN4xgDO/rTLyP70k9fagdZ67MVZbw==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.13.3.tgz", + "integrity": "sha512-dzVdar8Kenwxho0PnUxOxwjUvyFYn6Q9mQAMHcQNXQrvo32bdpoF+oNtWC/5FfrQgUgyl19CVQ607bRigYWoOQ==", "dependencies": { - "@cspell/cspell-types": "8.13.1", - "comment-json": "^4.2.4", + "@cspell/cspell-types": "8.13.3", + "comment-json": "^4.2.5", "yaml": "^2.5.0" }, "engines": { @@ -603,13 +603,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.13.1.tgz", - "integrity": "sha512-Z0T4J4ahOJaHmWq83w24KXGik1zeauO5WvDRyzDyaSgpbA5MN2hN98LvxaIx72g3I+trtRK77XFcKginuME9EA==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.13.3.tgz", + "integrity": "sha512-DQ3Tee7LIoy+9Mu52ht32O/MNBZ6i4iUeSTY2sMDDwogno3361BLRyfEjyiYNo3Fqf0Pcnt5MqY2DqIhrF/H/Q==", "dependencies": { - "@cspell/cspell-pipe": "8.13.1", - "@cspell/cspell-types": "8.13.1", - "cspell-trie-lib": "8.13.1", + "@cspell/cspell-pipe": "8.13.3", + "@cspell/cspell-types": "8.13.3", + "cspell-trie-lib": "8.13.3", "fast-equals": "^5.0.1" }, "engines": { @@ -617,13 +617,13 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.13.1.tgz", - "integrity": "sha512-XyZ3X5d6x0gkWtNXSAQRcPMG41bEdLx9cTgZCYCJhEZCesU1VpNm60F3oc11dMLkO+BqPH3An+AO/YEIiaje3A==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.13.3.tgz", + "integrity": "sha512-0OZXuP33CXV4P95ySHGNqhq3VR5RaLwpyo0nGvLHOjPm3mCsQSjURLBKHvyQ3r2M7LWsGV1Xc81FfTx30FBZLg==", "dependencies": { - "@cspell/url": "8.13.1", - "cspell-glob": "8.13.1", - "cspell-io": "8.13.1", + "@cspell/url": "8.13.3", + "cspell-glob": "8.13.3", + "cspell-io": "8.13.3", "find-up-simple": "^1.0.0" }, "bin": { @@ -634,11 +634,11 @@ } }, "node_modules/cspell-glob": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.13.1.tgz", - "integrity": "sha512-rW1A3t7YvPXxcC4z1pp1m9coeWzUVUmRjUw3vMNGlEDC2zecB39KKbEqesziBqnBceNAY7O5itllIGFKr03vqA==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.13.3.tgz", + "integrity": "sha512-+jGIMYyKDLmoOJIxNPXRdI7utcvw+9FMSmj1ApIdEff5dCkehi0gtzK4H7orXGYEvRdKQvfaXiyduVi79rXsZQ==", "dependencies": { - "@cspell/url": "8.13.1", + "@cspell/url": "8.13.3", "micromatch": "^4.0.7" }, "engines": { @@ -646,12 +646,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.13.1.tgz", - "integrity": "sha512-HUkd24bulvBwee1UNBurxGlPUOiywb9pB34iXXoxFWuloHohZ/DuFlE8B/31ZtjW48ffEYIu3QZfWhcnD8e81w==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.13.3.tgz", + "integrity": "sha512-xPSgKk9HY5EsI8lkMPC9hiZCeAUs+RY/IVliUBW1xEicAJhP4RZIGRdIwtDNNJGwKfNXazjqYhcS4LS0q7xPAQ==", "dependencies": { - "@cspell/cspell-pipe": "8.13.1", - "@cspell/cspell-types": "8.13.1" + "@cspell/cspell-pipe": "8.13.3", + "@cspell/cspell-types": "8.13.3" }, "bin": { "cspell-grammar": "bin.mjs" @@ -661,37 +661,37 @@ } }, "node_modules/cspell-io": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.13.1.tgz", - "integrity": "sha512-t2sgZuWGBzPSOAStfvz/U3KoFEfDxEt1cXZj0Kd0Vs36v2uoLktm6ihMe7XNFu7zIdOFSajsYQ8Bi4RSLPGPxQ==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.13.3.tgz", + "integrity": "sha512-AeMIkz7+4VuJaPKO/v1pUpyUSOOTyLOAfzeTRRAXEt+KRKOUe36MyUmBMza6gzNcX2yD04VgJukRL408TY9ntw==", "dependencies": { - "@cspell/cspell-service-bus": "8.13.1", - "@cspell/url": "8.13.1" + "@cspell/cspell-service-bus": "8.13.3", + "@cspell/url": "8.13.3" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.13.1.tgz", - "integrity": "sha512-H1HHG1pmATSeAaY0KmQ0xnkbSqJLvh9QpXWARDLWKUBvtE+/l44H4yVhIp/No3rM7PKMmb82GuSJzMaoIhHFLQ==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.13.3.tgz", + "integrity": "sha512-aEqxIILeqDtNoCa47/oSl5c926b50ue3PobYs4usn0Ymf0434RopCP+DCGsF7BPtog4j4XWnEmvkcJs57DYWDg==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.13.1", - "@cspell/cspell-pipe": "8.13.1", - "@cspell/cspell-resolver": "8.13.1", - "@cspell/cspell-types": "8.13.1", - "@cspell/dynamic-import": "8.13.1", - "@cspell/strong-weak-map": "8.13.1", - "@cspell/url": "8.13.1", + "@cspell/cspell-bundled-dicts": "8.13.3", + "@cspell/cspell-pipe": "8.13.3", + "@cspell/cspell-resolver": "8.13.3", + "@cspell/cspell-types": "8.13.3", + "@cspell/dynamic-import": "8.13.3", + "@cspell/strong-weak-map": "8.13.3", + "@cspell/url": "8.13.3", "clear-module": "^4.1.2", - "comment-json": "^4.2.4", - "cspell-config-lib": "8.13.1", - "cspell-dictionary": "8.13.1", - "cspell-glob": "8.13.1", - "cspell-grammar": "8.13.1", - "cspell-io": "8.13.1", - "cspell-trie-lib": "8.13.1", + "comment-json": "^4.2.5", + "cspell-config-lib": "8.13.3", + "cspell-dictionary": "8.13.3", + "cspell-glob": "8.13.3", + "cspell-grammar": "8.13.3", + "cspell-io": "8.13.3", + "cspell-trie-lib": "8.13.3", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -706,12 +706,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.13.1.tgz", - "integrity": "sha512-2moCsIYDmMT7hp5Non3CvWatfXptFWCuxjbXQGDNvWJ2Cj3oso/oBe4802GJv5GEenv9QBWmEtum/E7rFcx4JA==", + "version": "8.13.3", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.13.3.tgz", + "integrity": "sha512-Z0iLGi9HI+Vf+WhVVeru6dYgQdtaYCKWRlc1SayLfAZhw9BcjrXL8KTXDfAfv/lUgnRu6xwP1isLlDNZECsKVQ==", "dependencies": { - "@cspell/cspell-pipe": "8.13.1", - "@cspell/cspell-types": "8.13.1", + "@cspell/cspell-pipe": "8.13.3", + "@cspell/cspell-types": "8.13.3", "gensequence": "^7.0.0" }, "engines": { diff --git a/package.json b/package.json index a8dc78f808..992f65f809 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.13.1" + "cspell": "^8.13.3" } } From 0024c34b0e913aa003f4195ed48c79d800efa13d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:41:30 +0000 Subject: [PATCH 370/845] Bump the xunit group with 2 updates Bumps the xunit group with 2 updates: [Verify.Xunit](https://github.com/VerifyTests/Verify) and [System.Collections.Immutable](https://github.com/dotnet/runtime). Updates `Verify.Xunit` from 26.1.6 to 26.2.0 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/26.1.6...26.2.0) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index f487afafed..1f8b0f257a 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 8ab81f74f7abf2bad2560db35a3c0cd33aafcb06 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:42:17 +0000 Subject: [PATCH 371/845] Bump BenchmarkDotNet and System.Collections.Immutable Bumps [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet) and [System.Collections.Immutable](https://github.com/dotnet/runtime). These dependencies needed to be updated together. Updates `BenchmarkDotNet` from 0.13.12 to 0.14.0 - [Release notes](https://github.com/dotnet/BenchmarkDotNet/releases) - [Commits](https://github.com/dotnet/BenchmarkDotNet/compare/v0.13.12...v0.14.0) Updates `System.Collections.Immutable` from 1.5.0 to 5.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v5.0.0) --- updated-dependencies: - dependency-name: BenchmarkDotNet dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- Tests/Benchmarks/Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index 4fd9a3469a..438fed09d4 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -9,7 +9,7 @@ - + From c6fc2ada0629a11e7b083307c994223916c3de78 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:01:58 +0000 Subject: [PATCH 372/845] Bump github-pages from 231 to 232 in /docs Bumps [github-pages](https://github.com/github/pages-gem) from 231 to 232. - [Release notes](https://github.com/github/pages-gem/releases) - [Commits](https://github.com/github/pages-gem/compare/v231...v232) --- updated-dependencies: - dependency-name: github-pages dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- docs/Gemfile.lock | 78 +++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index adba9fa1e9..c6334287fc 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,32 +1,33 @@ GEM remote: https://rubygems.org/ specs: - activesupport (7.1.3.2) + activesupport (7.2.0) base64 bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) base64 (0.2.0) - bigdecimal (3.1.6) + bigdecimal (3.1.8) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.12.2) colorator (1.1.0) commonmarker (0.23.10) - concurrent-ruby (1.2.3) + concurrent-ruby (1.3.4) connection_pool (2.4.1) - dnsruby (1.70.0) + csv (3.3.0) + dnsruby (1.72.2) simpleidn (~> 0.2.1) - drb (2.2.0) - ruby2_keywords + drb (2.2.1) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) @@ -34,20 +35,21 @@ GEM ffi (>= 1.15.0) eventmachine (1.2.7) execjs (2.9.1) - faraday (2.9.0) + faraday (2.10.1) faraday-net_http (>= 2.0, < 3.2) - faraday-net_http (3.1.0) + logger + faraday-net_http (3.1.1) net-http - ffi (1.16.3) - ffi (1.16.3-x64-mingw-ucrt) + ffi (1.17.0-x64-mingw-ucrt) + ffi (1.17.0-x86_64-linux-gnu) forwardable-extended (2.6.0) gemoji (4.1.0) - github-pages (231) + github-pages (232) github-pages-health-check (= 1.18.2) - jekyll (= 3.9.5) + jekyll (= 3.10.0) jekyll-avatar (= 0.8.0) jekyll-coffeescript (= 1.2.2) - jekyll-commonmark-ghpages (= 0.4.0) + jekyll-commonmark-ghpages (= 0.5.1) jekyll-default-layout (= 0.1.5) jekyll-feed (= 0.17.0) jekyll-gist (= 1.5.0) @@ -84,9 +86,10 @@ GEM liquid (= 4.0.4) mercenary (~> 0.3) minima (= 2.5.1) - nokogiri (>= 1.13.6, < 2.0) + nokogiri (>= 1.16.2, < 2.0) rouge (= 3.30.0) terminal-table (~> 1.4) + webrick (~> 1.8) github-pages-health-check (1.18.2) addressable (~> 2.3) dnsruby (~> 1.60) @@ -97,11 +100,12 @@ GEM activesupport (>= 2) nokogiri (>= 1.4) http_parser.rb (0.8.0) - i18n (1.14.1) + i18n (1.14.5) concurrent-ruby (~> 1.0) - jekyll (3.9.5) + jekyll (3.10.0) addressable (~> 2.4) colorator (~> 1.0) + csv (~> 3.0) em-websocket (~> 0.5) i18n (>= 0.7, < 2) jekyll-sass-converter (~> 1.0) @@ -112,6 +116,7 @@ GEM pathutil (~> 0.9) rouge (>= 1.7, < 4) safe_yaml (~> 1.0) + webrick (>= 1.0) jekyll-avatar (0.8.0) jekyll (>= 3.0, < 5.0) jekyll-coffeescript (1.2.2) @@ -119,9 +124,9 @@ GEM coffee-script-source (~> 1.12) jekyll-commonmark (1.4.0) commonmarker (~> 0.22) - jekyll-commonmark-ghpages (0.4.0) - commonmarker (~> 0.23.7) - jekyll (~> 3.9.0) + jekyll-commonmark-ghpages (0.5.1) + commonmarker (>= 0.23.7, < 1.1.0) + jekyll (>= 3.9, < 4.0) jekyll-commonmark (~> 1.4.0) rouge (>= 2.0, < 5.0) jekyll-default-layout (0.1.5) @@ -215,33 +220,32 @@ GEM listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) + logger (1.6.0) mercenary (0.3.6) minima (2.5.1) jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - minitest (5.22.2) - mutex_m (0.2.0) + minitest (5.24.1) net-http (0.4.1) uri - nokogiri (1.16.5-x64-mingw-ucrt) + nokogiri (1.16.7-x64-mingw-ucrt) racc (~> 1.4) - nokogiri (1.16.5-x86_64-linux) + nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) octokit (4.25.1) faraday (>= 1, < 3) sawyer (~> 0.9) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (5.0.4) - racc (1.7.3) + public_suffix (5.1.1) + racc (1.8.1) rb-fsevent (0.11.2) - rb-inotify (0.10.1) + rb-inotify (0.11.1) ffi (~> 1.0) - rexml (3.3.3) + rexml (3.3.5) strscan rouge (3.30.0) - ruby2_keywords (0.0.5) rubyzip (2.3.2) safe_yaml (1.0.5) sass (3.7.4) @@ -252,8 +256,8 @@ GEM sawyer (0.9.2) addressable (>= 2.3.5) faraday (>= 0.17.3, < 3) - simpleidn (0.2.1) - unf (~> 0.1.4) + securerandom (0.3.1) + simpleidn (0.2.3) strscan (3.1.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) @@ -261,10 +265,6 @@ GEM ethon (>= 0.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.9.1) - unf_ext (0.0.9.1-x64-mingw-ucrt) unicode-display_width (1.8.0) uri (0.13.0) webrick (1.8.1) From f68808bb7d364799c7426db6ec2ecb6e44640725 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 12 Aug 2024 17:05:27 +0200 Subject: [PATCH 373/845] webrick is now included in github-pages --- docs/Gemfile | 3 +-- docs/Gemfile.lock | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/Gemfile b/docs/Gemfile index 136ccdaf66..9b2ec3c67e 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -1,3 +1,2 @@ source 'https://rubygems.org' -gem "github-pages", group: :jekyll_plugins -gem "webrick", "~> 1.8.1" \ No newline at end of file +gem "github-pages", group: :jekyll_plugins \ No newline at end of file diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index c6334287fc..29661cd857 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -275,7 +275,6 @@ PLATFORMS DEPENDENCIES github-pages - webrick (~> 1.8.1) BUNDLED WITH 2.4.10 From 08178fc2a24ac11fe99f4037ab758db4be3e5cc8 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 12 Aug 2024 17:50:38 +0200 Subject: [PATCH 374/845] Fix building Benchmark project --- Tests/Benchmarks/Benchmarks.csproj | 2 ++ Tests/Benchmarks/Program.cs | 1 + 2 files changed, 3 insertions(+) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index 438fed09d4..38ad4ca7a6 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -11,6 +11,8 @@ + + diff --git a/Tests/Benchmarks/Program.cs b/Tests/Benchmarks/Program.cs index 0850181194..2dc62955e7 100644 --- a/Tests/Benchmarks/Program.cs +++ b/Tests/Benchmarks/Program.cs @@ -5,6 +5,7 @@ using BenchmarkDotNet.Reports; using BenchmarkDotNet.Running; using Perfolizer.Horology; +using Perfolizer.Metrology; namespace Benchmarks; From 69c15b8265d80d9508d23f1f52d3b6cf38ab9dc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Rocheleau?= <71142100+arocheleau@users.noreply.github.com> Date: Wed, 14 Aug 2024 01:30:53 -0400 Subject: [PATCH 375/845] Filter the list of events returned by RaisePropertyChangeFor (#2677) * Add unit tests to show the issue * Filter the events after a call to RaisePropertyChangeFor * Fix the call to NotRaisePropertyChangeFor for agnostic property * Update the release notes * Apply code review recommendations --- .../EventRaisingExtensions.cs | 28 +++++++ .../Events/EventAssertions.cs | 29 ++++--- Src/FluentAssertions/Events/OccurredEvent.cs | 17 ++++ .../Events/EventAssertionSpecs.cs | 81 +++++++++++++++++++ docs/_pages/releases.md | 1 + 5 files changed, 146 insertions(+), 10 deletions(-) diff --git a/Src/FluentAssertions/EventRaisingExtensions.cs b/Src/FluentAssertions/EventRaisingExtensions.cs index e88c28ad66..95545d234b 100644 --- a/Src/FluentAssertions/EventRaisingExtensions.cs +++ b/Src/FluentAssertions/EventRaisingExtensions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Linq.Expressions; using FluentAssertions.Common; @@ -145,4 +146,31 @@ public static IEventRecording WithArgs(this IEventRecording eventRecording, p return new FilteredEventRecording(eventRecording, eventsWithMatchingPredicate); } + + /// + /// Asserts that all occurrences of the events has arguments of type + /// and are for property . + /// + /// + /// The property name for which the property changed events should have been raised. + /// + /// + /// Returns only the property changed events affecting the particular property name. + /// + /// + /// If a or string.Empty is provided as property name, the events are return as-is. + /// + internal static IEventRecording WithPropertyChangeFor(this IEventRecording eventRecording, string propertyName) + { + if (string.IsNullOrEmpty(propertyName)) + { + return eventRecording; + } + + IEnumerable eventsForPropertyName = + eventRecording.Where(@event => @event.IsAffectingPropertyName(propertyName)) + .ToList(); + + return new FilteredEventRecording(eventRecording, eventsForPropertyName); + } } diff --git a/Src/FluentAssertions/Events/EventAssertions.cs b/Src/FluentAssertions/Events/EventAssertions.cs index a550fb28fc..f7e861deca 100644 --- a/Src/FluentAssertions/Events/EventAssertions.cs +++ b/Src/FluentAssertions/Events/EventAssertions.cs @@ -15,7 +15,7 @@ namespace FluentAssertions.Events; /// public class EventAssertions : ReferenceTypeAssertions> { - private const string PropertyChangedEventName = "PropertyChanged"; + private const string PropertyChangedEventName = nameof(INotifyPropertyChanged.PropertyChanged); protected internal EventAssertions(IMonitor monitor) : base(monitor.Subject) @@ -94,6 +94,9 @@ public void NotRaise(string eventName, [StringSyntax("CompositeFormat")] string /// /// Zero or more objects to format using the placeholders in . /// + /// + /// Returns only the events having arguments of type targeting the property. + /// public IEventRecording RaisePropertyChangeFor(Expression> propertyExpression, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { @@ -123,7 +126,7 @@ public IEventRecording RaisePropertyChangeFor(Expression> proper Monitor.Subject, PropertyChangedEventName, propertyName, actualPropertyNames); } - return recording; + return recording.WithPropertyChangeFor(propertyName); } /// @@ -144,21 +147,27 @@ public void NotRaisePropertyChangeFor(Expression> propertyExpres { IEventRecording recording = Monitor.GetRecordingFor(PropertyChangedEventName); - string propertyName = propertyExpression.GetPropertyInfo().Name; + string propertyName = propertyExpression?.GetPropertyInfo().Name; - if (recording.Any(@event => GetAffectedPropertyName(@event) == propertyName)) + if (propertyName is null) { Execute.Assertion .BecauseOf(because, becauseArgs) - .FailWith("Did not expect object {0} to raise the {1} event for property {2}{reason}, but it did.", + .ForCondition(!recording.Any()) + .FailWith( + "Did not expect object {0} to raise the {1} event{reason}, but it did.", + Monitor.Subject, PropertyChangedEventName); + } + else + { + Execute.Assertion + .BecauseOf(because, becauseArgs) + .ForCondition(!recording.Any(@event => @event.IsAffectingPropertyName(propertyName))) + .FailWith( + "Did not expect object {0} to raise the {1} event for property {2}{reason}, but it did.", Monitor.Subject, PropertyChangedEventName, propertyName); } } - private static string GetAffectedPropertyName(OccurredEvent @event) - { - return @event.Parameters.OfType().Single().PropertyName; - } - protected override string Identifier => "subject"; } diff --git a/Src/FluentAssertions/Events/OccurredEvent.cs b/Src/FluentAssertions/Events/OccurredEvent.cs index a6b92e1a71..6f062b7050 100644 --- a/Src/FluentAssertions/Events/OccurredEvent.cs +++ b/Src/FluentAssertions/Events/OccurredEvent.cs @@ -1,4 +1,6 @@ using System; +using System.ComponentModel; +using System.Linq; namespace FluentAssertions.Events; @@ -26,4 +28,19 @@ public class OccurredEvent /// The order in which this event was raised on the monitored object. /// public int Sequence { get; set; } + + /// + /// Verifies if a property changed event is affecting a particular property. + /// + /// + /// The property name for which the property changed event should have been raised. + /// + /// + /// Returns if the event is affecting the property specified, otherwise. + /// + internal bool IsAffectingPropertyName(string propertyName) + { + return Parameters.OfType() + .Any(e => string.IsNullOrEmpty(e.PropertyName) || e.PropertyName == propertyName); + } } diff --git a/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs index 4926efcd69..69d4746e03 100644 --- a/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs @@ -540,6 +540,53 @@ public void act.Should().Throw() .WithMessage("Expected*property*SomeProperty*but*OtherProperty1*OtherProperty2*"); } + + [Fact] + public void + The_number_of_property_changed_recorded_for_a_specific_property_matches_the_number_of_times_it_was_raised_specifically() + { + // Arrange + var subject = new EventRaisingClass(); + using var monitor = subject.Monitor(); + subject.RaiseEventWithSenderAndPropertyName(nameof(EventRaisingClass.SomeProperty)); + subject.RaiseEventWithSenderAndPropertyName(nameof(EventRaisingClass.SomeProperty)); + subject.RaiseEventWithSenderAndPropertyName(nameof(EventRaisingClass.SomeOtherProperty)); + + // Act + monitor.Should().RaisePropertyChangeFor(x => x.SomeProperty).Should().HaveCount(2); + } + + [Fact] + public void + The_number_of_property_changed_recorded_for_a_specific_property_matches_the_number_of_times_it_was_raised_including_agnostic_property() + { + // Arrange + var subject = new EventRaisingClass(); + using var monitor = subject.Monitor(); + subject.RaiseEventWithSenderAndPropertyName(nameof(EventRaisingClass.SomeProperty)); + subject.RaiseEventWithSenderAndPropertyName(nameof(EventRaisingClass.SomeOtherProperty)); + subject.RaiseEventWithSenderAndPropertyName(null); + subject.RaiseEventWithSenderAndPropertyName(string.Empty); + + // Act + monitor.Should().RaisePropertyChangeFor(x => x.SomeProperty).Should().HaveCount(3); + } + + [Fact] + public void + The_number_of_property_changed_recorded_matches_the_number_of_times_it_was_raised() + { + // Arrange + var subject = new EventRaisingClass(); + using var monitor = subject.Monitor(); + subject.RaiseEventWithSenderAndPropertyName(nameof(EventRaisingClass.SomeProperty)); + subject.RaiseEventWithSenderAndPropertyName(nameof(EventRaisingClass.SomeOtherProperty)); + subject.RaiseEventWithSenderAndPropertyName(null); + subject.RaiseEventWithSenderAndPropertyName(string.Empty); + + // Act + monitor.Should().RaisePropertyChangeFor(null).Should().HaveCount(4); + } } public class ShouldNotRaisePropertyChanged @@ -590,6 +637,40 @@ public void When_a_property_changed_event_for_another_than_the_unexpected_proper // Assert act.Should().NotThrow(); } + + [Fact] + public void Throw_for_an_agnostic_property_when_any_property_changed_is_recorded() + { + // Arrange + var subject = new EventRaisingClass(); + using var monitor = subject.Monitor(); + subject.RaiseEventWithSenderAndPropertyName(nameof(EventRaisingClass.SomeOtherProperty)); + + // Act + Action act = () => monitor.Should().NotRaisePropertyChangeFor(null); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect object " + Formatter.ToString(subject) + + " to raise the \"PropertyChanged\" event, but it did."); + } + + [Fact] + public void Throw_for_a_specific_property_when_an_agnostic_property_changed_is_recorded() + { + // Arrange + var subject = new EventRaisingClass(); + using var monitor = subject.Monitor(); + subject.RaiseEventWithSenderAndPropertyName(null); + + // Act + Action act = () => monitor.Should().NotRaisePropertyChangeFor(x => x.SomeProperty); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect object " + Formatter.ToString(subject) + + " to raise the \"PropertyChanged\" event for property \"SomeProperty\", but it did."); + } } public class PreconditionChecks diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index bec90e8c4d..2a35650e76 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -50,6 +50,7 @@ sidebar: * One overload of the `AssertionScope` constructor would not create an actual scope associated with the thread - [#2607](https://github.com/fluentassertions/fluentassertions/pull/2607) * Fixed `ThrowWithinAsync` not respecting `OperationCanceledException` - [#2614](https://github.com/fluentassertions/fluentassertions/pull/2614) * Fixed using `BeEquivalentTo` with an `IEqualityComparer` targeting nullable types - [#2648](https://github.com/fluentassertions/fluentassertions/pull/2648) +* Fixed `RaisePropertyChangeFor` to return a filtered list of events - [#2677](https://github.com/fluentassertions/fluentassertions/pull/2677) ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) From fb2be9d1dfa610a6c8cd071ac5178eb8aa6c355b Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 12 Aug 2024 16:39:15 +0200 Subject: [PATCH 376/845] Do not use `UsingLineBreaks` for `[Not]BeSameAs` See issue #2695 --- Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs b/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs index 55b38fd950..8817613104 100644 --- a/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs +++ b/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs @@ -84,7 +84,6 @@ public AndConstraint BeSameAs(TSubject expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion - .UsingLineBreaks .ForCondition(ReferenceEquals(Subject, expected)) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier(Identifier) @@ -108,7 +107,6 @@ public AndConstraint NotBeSameAs(TSubject unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Execute.Assertion - .UsingLineBreaks .ForCondition(!ReferenceEquals(Subject, unexpected)) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier(Identifier) From 35da36bdf9623b15c2216114e01931cbe94704e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 15:03:54 +0000 Subject: [PATCH 377/845] Bump cspell from 8.13.3 to 8.14.1 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.13.3 to 8.14.1. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.14.1/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 197 ++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 104 insertions(+), 95 deletions(-) diff --git a/package-lock.json b/package-lock.json index fa4f12e6db..c15c87f226 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.13.3" + "cspell": "^8.14.1" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.13.3.tgz", - "integrity": "sha512-OfCxUBMyayxKyeDaUZG3LQpiyH8MFUbg9nbIZCGh2x8U6N0fHaP9uR6R+gPzdi/bJp32Kr+RC/Yebojd+AQCGA==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.14.1.tgz", + "integrity": "sha512-yM5cDCbkGttCWBQuSseECHGFF2h1RpX/ZI1I+evuFBW+eYMJm2JeNLDFyuAu7TzCsNtA+PZMs3ctqIP9xg9hHg==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.3", @@ -22,7 +22,7 @@ "@cspell/dict-cpp": "^5.1.12", "@cspell/dict-cryptocurrencies": "^5.0.0", "@cspell/dict-csharp": "^4.0.2", - "@cspell/dict-css": "^4.0.12", + "@cspell/dict-css": "^4.0.13", "@cspell/dict-dart": "^2.0.3", "@cspell/dict-django": "^4.1.0", "@cspell/dict-docker": "^1.1.7", @@ -73,28 +73,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.13.3.tgz", - "integrity": "sha512-QrHxWkm0cfD+rTjFOxm5lpE4+wBANDzMIM8NOeQC6v8Dc1L8PUkm6hF6CsEv2tKmuwvdVr+jy6GilDMkPXalCg==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.14.1.tgz", + "integrity": "sha512-eJpgmocT+DY+uy9+sHCz6Ir8YVg7b/hnf5N7dITHlI8dnzgoScTZG2nZhVhJozrgb44B1dZuJzVR1DBLKgZY8A==", "dependencies": { - "@cspell/cspell-types": "8.13.3" + "@cspell/cspell-types": "8.14.1" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.13.3.tgz", - "integrity": "sha512-6a9Zd+fDltgXoJ0fosWqEMx0UdXBXZ7iakhslMNPRmv7GhVAoHBoIXzMVilOE4kYT2Mh/9NM/QW/NbNEpneZIQ==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.14.1.tgz", + "integrity": "sha512-KSFu/yyoJekezT9Ex5vgyI0a9tpRVXV4KEfOfL1gH/xbWBTiYx+RyEWEefebMxlMp7tdJiNI7HI0vvJ6YdUdsA==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.13.3.tgz", - "integrity": "sha512-vlwtMTEWsPPtWfktzT75eGQ0n+0M+9kN+89eSvUUYdCfvY9XAS6z+bTmhS2ULJgntgWtX6gUjABQK0PYYVedOg==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.14.1.tgz", + "integrity": "sha512-MMr3L1yrhITH8eG0fvXNEMo94g4MGSIeHzKKvq40fr39Oox/1MBxYAbWiI2NQ/Bxnbq854SY8pfwTSKjyNEGig==", "dependencies": { "global-directory": "^4.0.1" }, @@ -103,17 +103,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.13.3.tgz", - "integrity": "sha512-mFkeWXwGQSDxRiN6Kez77GaMNGNgG7T6o9UE42jyXEgf/bLJTpefbUy4fY5pU3p2mA0eoMzmnJX8l+TC5YJpbA==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.14.1.tgz", + "integrity": "sha512-uKrrCLvEkmAPB4vjUw9GM+B3TV2VsWpV6L3wkcQ9+zn9iPYgYk2WkvSHlOunnZ4u1TzcTdd88ZQtMjati3DLCg==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.13.3.tgz", - "integrity": "sha512-lA5GbhLOL6FlKCWNMbooRFgNGfTsM6NJnHz60+EEN7XD9OgpFc7w+MBcK4aHsVCxcrIvnejIc8xQDqPnrdmN3w==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.14.1.tgz", + "integrity": "sha512-E7tgF6867gsjttITAXF+8nS4BjZ4JQW4Gbrse1RP7jdW7y1biXipBfZxngsEbnR209MrZAnSobS40m9ih7gWfQ==", "engines": { "node": ">=18" } @@ -387,9 +387,9 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.13.3.tgz", - "integrity": "sha512-YN83CFWnMkt9B0q0RBadfEoptUaDRqBikh8b91MOQ0haEnUo6t57j4jAaLnbIEP4ynzMhgruWFKpIC/QaEtCuA==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.14.1.tgz", + "integrity": "sha512-zGnymwieuFigqz839cKCF9JB90nUm50SMqopWClMl4LFOpqpuCucn/Slh4CLGu2vri4iqCvRweDxZCsi/5qYiw==", "dependencies": { "import-meta-resolve": "^4.1.0" }, @@ -397,18 +397,26 @@ "node": ">=18.0" } }, + "node_modules/@cspell/filetypes": { + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.14.1.tgz", + "integrity": "sha512-jOcTFzHJ3c1uTZLm3BvLrZ8TakXLIimsFGwvk/qTA1EYgUPC2a0TypGCxR0NCHmpMlZvfAT5iAksDIiCHq1yjg==", + "engines": { + "node": ">=18" + } + }, "node_modules/@cspell/strong-weak-map": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.13.3.tgz", - "integrity": "sha512-/QYUEthesPuDarOHa6kcWKJmVq0HIotjPrmAWQ5QpH+dDik1Qin4G/9QdnWX75ueR4DC4WFjBNBU14C4TVSwHQ==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.14.1.tgz", + "integrity": "sha512-idQVm12vzQHLMpV4ETDFBPpSP7TTf0hRrdsY5i/La6uzZE05b5QxadfInNtbKV/Tf2OpjV3dygALOo2932xChw==", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.13.3.tgz", - "integrity": "sha512-hsxoTnZHwtdR2x9QEE6yfDBB1LUwAj67o1GyKTvI8A2OE/AfzAttirZs+9sxgOGWoBdTOxM9sMLtqB3SxtDB3A==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.14.1.tgz", + "integrity": "sha512-K8TSiDti+mhuITezwr0fpmD756Y52cbJdxAgoXioL3Ri6ZoyQyhyhsJFeE6kNZLq24KwddZa8WJaY7hHKylygg==", "engines": { "node": ">=18.0" } @@ -554,23 +562,23 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cspell": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.13.3.tgz", - "integrity": "sha512-2wv4Eby7g8wDB553fI8IoZjyitoKrD2kmtdeoYUN2EjVs3RMpIOver3fL+0VaFAaN0uLfAoeAAIB5xJEakvZYQ==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.14.1.tgz", + "integrity": "sha512-UwjSLwt3RR8sP1dtjVbLimc8CpziOlVXH0yXb7/nWyMi3wEPWaV3o0VSTtRHRoaYHAjVzNlXDT6kiSr6RqyPog==", "dependencies": { - "@cspell/cspell-json-reporter": "8.13.3", - "@cspell/cspell-pipe": "8.13.3", - "@cspell/cspell-types": "8.13.3", - "@cspell/dynamic-import": "8.13.3", - "@cspell/url": "8.13.3", + "@cspell/cspell-json-reporter": "8.14.1", + "@cspell/cspell-pipe": "8.14.1", + "@cspell/cspell-types": "8.14.1", + "@cspell/dynamic-import": "8.14.1", + "@cspell/url": "8.14.1", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-dictionary": "8.13.3", - "cspell-gitignore": "8.13.3", - "cspell-glob": "8.13.3", - "cspell-io": "8.13.3", - "cspell-lib": "8.13.3", + "cspell-dictionary": "8.14.1", + "cspell-gitignore": "8.14.1", + "cspell-glob": "8.14.1", + "cspell-io": "8.14.1", + "cspell-lib": "8.14.1", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.0.0", @@ -590,11 +598,11 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.13.3.tgz", - "integrity": "sha512-dzVdar8Kenwxho0PnUxOxwjUvyFYn6Q9mQAMHcQNXQrvo32bdpoF+oNtWC/5FfrQgUgyl19CVQ607bRigYWoOQ==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.14.1.tgz", + "integrity": "sha512-660v4G+3AikdGfSri09YGx7enR4RWPIPLiFKA+3F+CY2lj16l4bh7B/aNfU9oYRDvCcWBCik53AyOne/bSuPVg==", "dependencies": { - "@cspell/cspell-types": "8.13.3", + "@cspell/cspell-types": "8.14.1", "comment-json": "^4.2.5", "yaml": "^2.5.0" }, @@ -603,13 +611,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.13.3.tgz", - "integrity": "sha512-DQ3Tee7LIoy+9Mu52ht32O/MNBZ6i4iUeSTY2sMDDwogno3361BLRyfEjyiYNo3Fqf0Pcnt5MqY2DqIhrF/H/Q==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.14.1.tgz", + "integrity": "sha512-+QI3RLzfA4bkKEa5H9OQx2cPN+f5mXx8zbmccoJXxgjUi3fWmNGz4LPHnNQQ7pWXxQ2V81UXDwd7qRN9qkzISQ==", "dependencies": { - "@cspell/cspell-pipe": "8.13.3", - "@cspell/cspell-types": "8.13.3", - "cspell-trie-lib": "8.13.3", + "@cspell/cspell-pipe": "8.14.1", + "@cspell/cspell-types": "8.14.1", + "cspell-trie-lib": "8.14.1", "fast-equals": "^5.0.1" }, "engines": { @@ -617,13 +625,13 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.13.3.tgz", - "integrity": "sha512-0OZXuP33CXV4P95ySHGNqhq3VR5RaLwpyo0nGvLHOjPm3mCsQSjURLBKHvyQ3r2M7LWsGV1Xc81FfTx30FBZLg==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.14.1.tgz", + "integrity": "sha512-f/3rZqHKTFOB37Ey8b7eIQwom4w+wKKzr1sEsoEdLsWyRAd7HdSXkDG6O0S3RYvUYoiXZM9HQsQY695CVhq2wQ==", "dependencies": { - "@cspell/url": "8.13.3", - "cspell-glob": "8.13.3", - "cspell-io": "8.13.3", + "@cspell/url": "8.14.1", + "cspell-glob": "8.14.1", + "cspell-io": "8.14.1", "find-up-simple": "^1.0.0" }, "bin": { @@ -634,11 +642,11 @@ } }, "node_modules/cspell-glob": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.13.3.tgz", - "integrity": "sha512-+jGIMYyKDLmoOJIxNPXRdI7utcvw+9FMSmj1ApIdEff5dCkehi0gtzK4H7orXGYEvRdKQvfaXiyduVi79rXsZQ==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.14.1.tgz", + "integrity": "sha512-562ZbkBikXlB3JEGlGsi+3Xa4aghc2nqW1DLhcyXId/eunuJuUIqDGeexHkRwb0yBkq1we8O67hJtC3W0ih5GQ==", "dependencies": { - "@cspell/url": "8.13.3", + "@cspell/url": "8.14.1", "micromatch": "^4.0.7" }, "engines": { @@ -646,12 +654,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.13.3.tgz", - "integrity": "sha512-xPSgKk9HY5EsI8lkMPC9hiZCeAUs+RY/IVliUBW1xEicAJhP4RZIGRdIwtDNNJGwKfNXazjqYhcS4LS0q7xPAQ==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.14.1.tgz", + "integrity": "sha512-q4soR+FDU7Z3Z2gxl9dYP8qtrunH32aozhIGx6kkLWKWSy/jk2HaWdDp2MkpsQUURXLKMJ6PBZfpzR9Mxz3KqA==", "dependencies": { - "@cspell/cspell-pipe": "8.13.3", - "@cspell/cspell-types": "8.13.3" + "@cspell/cspell-pipe": "8.14.1", + "@cspell/cspell-types": "8.14.1" }, "bin": { "cspell-grammar": "bin.mjs" @@ -661,37 +669,38 @@ } }, "node_modules/cspell-io": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.13.3.tgz", - "integrity": "sha512-AeMIkz7+4VuJaPKO/v1pUpyUSOOTyLOAfzeTRRAXEt+KRKOUe36MyUmBMza6gzNcX2yD04VgJukRL408TY9ntw==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.14.1.tgz", + "integrity": "sha512-BQvFFzlPXu0RrBecjryZI6EwegpCeph7CnNoWlBUlO/T6kJiB6uG674n/LyenOImnLRrLUbRt1yZcPxziFHNlA==", "dependencies": { - "@cspell/cspell-service-bus": "8.13.3", - "@cspell/url": "8.13.3" + "@cspell/cspell-service-bus": "8.14.1", + "@cspell/url": "8.14.1" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.13.3.tgz", - "integrity": "sha512-aEqxIILeqDtNoCa47/oSl5c926b50ue3PobYs4usn0Ymf0434RopCP+DCGsF7BPtog4j4XWnEmvkcJs57DYWDg==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.14.1.tgz", + "integrity": "sha512-wVZVVezge8ubq+zOED1V6EEtrJQZPNJcpNPDnc7ZXwnWiQxREWvQkuBa60EvAezPImxYdVDr8Y0dIS8yLd9WJg==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.13.3", - "@cspell/cspell-pipe": "8.13.3", - "@cspell/cspell-resolver": "8.13.3", - "@cspell/cspell-types": "8.13.3", - "@cspell/dynamic-import": "8.13.3", - "@cspell/strong-weak-map": "8.13.3", - "@cspell/url": "8.13.3", + "@cspell/cspell-bundled-dicts": "8.14.1", + "@cspell/cspell-pipe": "8.14.1", + "@cspell/cspell-resolver": "8.14.1", + "@cspell/cspell-types": "8.14.1", + "@cspell/dynamic-import": "8.14.1", + "@cspell/filetypes": "8.14.1", + "@cspell/strong-weak-map": "8.14.1", + "@cspell/url": "8.14.1", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.13.3", - "cspell-dictionary": "8.13.3", - "cspell-glob": "8.13.3", - "cspell-grammar": "8.13.3", - "cspell-io": "8.13.3", - "cspell-trie-lib": "8.13.3", + "cspell-config-lib": "8.14.1", + "cspell-dictionary": "8.14.1", + "cspell-glob": "8.14.1", + "cspell-grammar": "8.14.1", + "cspell-io": "8.14.1", + "cspell-trie-lib": "8.14.1", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -706,12 +715,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.13.3", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.13.3.tgz", - "integrity": "sha512-Z0iLGi9HI+Vf+WhVVeru6dYgQdtaYCKWRlc1SayLfAZhw9BcjrXL8KTXDfAfv/lUgnRu6xwP1isLlDNZECsKVQ==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.14.1.tgz", + "integrity": "sha512-2B5pnRHgYHFtdE4N1a0oWCYI1pZVeD1kvcst77ySe520Rg/U18aIET3UzsvN97EDwQ6Y23tHoVsXha0PxD1xfw==", "dependencies": { - "@cspell/cspell-pipe": "8.13.3", - "@cspell/cspell-types": "8.13.3", + "@cspell/cspell-pipe": "8.14.1", + "@cspell/cspell-types": "8.14.1", "gensequence": "^7.0.0" }, "engines": { diff --git a/package.json b/package.json index 992f65f809..bb5508c820 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.13.3" + "cspell": "^8.14.1" } } From 89b6617d0f0ed01fc41a9189dd17ea878c9a200e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 25 Aug 2024 08:40:57 +0200 Subject: [PATCH 378/845] Bump rexml from 3.3.5 to 3.3.6 in /docs (#2737) Bumps [rexml](https://github.com/ruby/rexml) from 3.3.5 to 3.3.6. - [Release notes](https://github.com/ruby/rexml/releases) - [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md) - [Commits](https://github.com/ruby/rexml/compare/v3.3.5...v3.3.6) --- updated-dependencies: - dependency-name: rexml dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 29661cd857..675581769b 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -243,7 +243,7 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rexml (3.3.5) + rexml (3.3.6) strscan rouge (3.30.0) rubyzip (2.3.2) From c91cc963d954dc519d11bf1704a9a30fcd67db92 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 25 Aug 2024 08:58:46 +0200 Subject: [PATCH 379/845] Bump micromatch from 4.0.7 to 4.0.8 (#2739) Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.7 to 4.0.8. - [Release notes](https://github.com/micromatch/micromatch/releases) - [Changelog](https://github.com/micromatch/micromatch/blob/4.0.8/CHANGELOG.md) - [Commits](https://github.com/micromatch/micromatch/compare/4.0.7...4.0.8) --- updated-dependencies: - dependency-name: micromatch dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c15c87f226..2b662a6f88 100644 --- a/package-lock.json +++ b/package-lock.json @@ -996,9 +996,9 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" From 81fb0922f0a3dc9d974d0437228a3bc7b3012c49 Mon Sep 17 00:00:00 2001 From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:57:42 +0200 Subject: [PATCH 380/845] Update to `GitVersion` 6.0.2 and fix PR version generation (#2741) * Update to `GitVersion` 6.0.2 and fix PR version generation * Keep the .dll version in sync with the nuget package version --- Build/Build.cs | 7 ++++--- Build/_build.csproj | 2 +- GitVersion.yml | 19 +++++++++++++------ 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Build/Build.cs b/Build/Build.cs index 72fb909072..1859443ae5 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -113,12 +113,13 @@ class Build : NukeBuild Target Compile => _ => _ .DependsOn(Restore) + .DependsOn(CalculateNugetVersion) .OnlyWhenDynamic(() => RunAllTargets || HasSourceChanges) .Executes(() => { ReportSummary(s => s - .WhenNotNull(GitVersion, (v, o) => v - .AddPair("Version", o.SemVer))); + .WhenNotNull(SemVer, (summary, semVer) => summary + .AddPair("Version", semVer))); DotNetBuild(s => s .SetProjectFile(Solution) @@ -128,6 +129,7 @@ class Build : NukeBuild ) .EnableNoLogo() .EnableNoRestore() + .SetVersion(SemVer) .SetAssemblyVersion(GitVersion.AssemblySemVer) .SetFileVersion(GitVersion.AssemblySemFileVer) .SetInformationalVersion(GitVersion.InformationalVersion)); @@ -305,7 +307,6 @@ from framework in supportedFrameworks .DependsOn(TestFrameworks) .DependsOn(UnitTests) .DependsOn(CodeCoverage) - .DependsOn(CalculateNugetVersion) .OnlyWhenDynamic(() => RunAllTargets || HasSourceChanges) .Executes(() => { diff --git a/Build/_build.csproj b/Build/_build.csproj index db2ee3727c..3d16cea21c 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -17,7 +17,7 @@ OS_MAC - + diff --git a/GitVersion.yml b/GitVersion.yml index eb2338d698..34b4dff528 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,13 +1,20 @@ -next-version: 7.0 +next-version: 7.0.0 +workflow: GitHubFlow/v1 branches: + develop: + regex: ^dev(elop)?(ment)?$ + label: alpha + increment: Minor release: regex: releases?[/-] - tag: rc + label: rc + increment: Patch pull-request: - mode: ContinuousDeployment + mode: ContinuousDelivery regex: ((pull|pull\-requests|pr)[/-]|[/-](merge)) - tag: pr - tag-number-pattern: '[/-]?(?\d+)' - prevent-increment-of-merged-branch-version: false + label: pr + label-number-pattern: '[/-]?(?\d+)' + prevent-increment: + of-merged-branch: false ignore: sha: [] From ddc3d6a22767084a1c8c59a405aa61210a69b64a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:59:15 +0200 Subject: [PATCH 381/845] Bump Microsoft.NET.Test.Sdk from 17.10.0 to 17.11.0 (#2743) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.10.0 to 17.11.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.10.0...v17.11.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 2 +- Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 1f8b0f257a..47241203c7 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -5,7 +5,7 @@ - + all diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index fe0d628325..e0178b4c9c 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -10,7 +10,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 3acc1577e9..8048448d2e 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -21,7 +21,7 @@ - + diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 147de48039..a61b2c7486 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -10,7 +10,7 @@ - + diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index bb797ab492..0fd33732fd 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -21,7 +21,7 @@ - + diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 79e10ce825..52bbe886d9 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj index 66b2e83657..3c316f5613 100644 --- a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj +++ b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index 9042e869d3..5fd79c8377 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index 09bf0779f5..b3cab1a349 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index 7c537083b3..c1c3b34e17 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 9b76965f11..5fb8e387f6 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -6,7 +6,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive From b0ed12c126e062e2fc647a266fdedce2c1c5d674 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 15:01:49 +0000 Subject: [PATCH 382/845] Bump NUnit from 4.1.0 to 4.2.1 in the nunit group Bumps the nunit group with 1 update: [NUnit](https://github.com/nunit/nunit). Updates `NUnit` from 4.1.0 to 4.2.1 - [Release notes](https://github.com/nunit/nunit/releases) - [Changelog](https://github.com/nunit/nunit/blob/main/CHANGES.md) - [Commits](https://github.com/nunit/nunit/compare/4.1.0...4.2.1) --- updated-dependencies: - dependency-name: NUnit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: nunit ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index b3cab1a349..d9a238ec41 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From d89d22e535de3de8ea212d3c2b63b4be32cac7ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 14:39:24 +0000 Subject: [PATCH 383/845] Bump cspell from 8.14.1 to 8.14.2 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.14.1 to 8.14.2. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.14.2/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 248 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 125 insertions(+), 125 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2b662a6f88..4342e40c5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.14.1" + "cspell": "^8.14.2" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.14.1.tgz", - "integrity": "sha512-yM5cDCbkGttCWBQuSseECHGFF2h1RpX/ZI1I+evuFBW+eYMJm2JeNLDFyuAu7TzCsNtA+PZMs3ctqIP9xg9hHg==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.14.2.tgz", + "integrity": "sha512-Kv2Utj/RTSxfufGXkkoTZ/3ErCsYWpCijtDFr/FwSsM7mC0PzLpdlcD9xjtgrJO5Kwp7T47iTG21U4Mwddyi8Q==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.3", @@ -73,28 +73,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.14.1.tgz", - "integrity": "sha512-eJpgmocT+DY+uy9+sHCz6Ir8YVg7b/hnf5N7dITHlI8dnzgoScTZG2nZhVhJozrgb44B1dZuJzVR1DBLKgZY8A==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.14.2.tgz", + "integrity": "sha512-TZavcnNIZKX1xC/GNj80RgFVKHCT4pHT0qm9jCsQFH2QJfyCrUlkEvotKGSQ04lAyCwWg6Enq95qhouF8YbKUQ==", "dependencies": { - "@cspell/cspell-types": "8.14.1" + "@cspell/cspell-types": "8.14.2" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.14.1.tgz", - "integrity": "sha512-KSFu/yyoJekezT9Ex5vgyI0a9tpRVXV4KEfOfL1gH/xbWBTiYx+RyEWEefebMxlMp7tdJiNI7HI0vvJ6YdUdsA==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.14.2.tgz", + "integrity": "sha512-aWMoXZAXEre0/M9AYWOW33YyOJZ06i4vvsEpWBDWpHpWQEmsR/7cMMgld8Pp3wlEjIUclUAKTYmrZ61PFWU/og==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.14.1.tgz", - "integrity": "sha512-MMr3L1yrhITH8eG0fvXNEMo94g4MGSIeHzKKvq40fr39Oox/1MBxYAbWiI2NQ/Bxnbq854SY8pfwTSKjyNEGig==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.14.2.tgz", + "integrity": "sha512-pSyBsAvslaN0dx0pHdvECJEuFDDBJGAD6G8U4BVbIyj2OPk0Ox0HrZIj6csYxxoJERAgNO/q7yCPwa4j9NNFXg==", "dependencies": { "global-directory": "^4.0.1" }, @@ -103,17 +103,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.14.1.tgz", - "integrity": "sha512-uKrrCLvEkmAPB4vjUw9GM+B3TV2VsWpV6L3wkcQ9+zn9iPYgYk2WkvSHlOunnZ4u1TzcTdd88ZQtMjati3DLCg==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.14.2.tgz", + "integrity": "sha512-WUF7xf3YgXYIqjmBwLcVugYIrYL4WfXchgSo9rmbbnOcAArzsK+HKfzb4AniZAJ1unxcIQ0JnVlRmnCAKPjjLg==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.14.1.tgz", - "integrity": "sha512-E7tgF6867gsjttITAXF+8nS4BjZ4JQW4Gbrse1RP7jdW7y1biXipBfZxngsEbnR209MrZAnSobS40m9ih7gWfQ==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.14.2.tgz", + "integrity": "sha512-MRY8MjBNOKGMDSkxAKueYAgVL43miO+lDcLCBBP+7cNXqHiUFMIZteONcGp3kJT0dWS04dN6lKAXvaNF0aWcng==", "engines": { "node": ">=18" } @@ -139,9 +139,9 @@ "integrity": "sha512-y9e0amzEK36EiiKx3VAA+SHQJPpf2Qv5cCt5eTUSggpTkiFkCh6gRKQ97rVlrKh5GJrqinDwYIJtTsxuh2vy2Q==" }, "node_modules/@cspell/dict-cpp": { - "version": "5.1.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.12.tgz", - "integrity": "sha512-6lXLOFIa+k/qBcu0bjaE/Kc6v3sh9VhsDOXD1Dalm3zgd0QIMjp5XBmkpSdCAK3pWCPV0Se7ysVLDfCea1BuXg==" + "version": "5.1.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.16.tgz", + "integrity": "sha512-32fU5RkuOM55IRcxjByiSoKbjr+C4danDfYjHaQNRWdvjzJzci3fLDGA2wTXiclkgDODxGiV8LCTUwCz+3TNWA==" }, "node_modules/@cspell/dict-cryptocurrencies": { "version": "5.0.0", @@ -179,9 +179,9 @@ "integrity": "sha512-XlXHAr822euV36GGsl2J1CkBIVg3fZ6879ZOg5dxTIssuhUOCiV2BuzKZmt6aIFmcdPmR14+9i9Xq+3zuxeX0A==" }, "node_modules/@cspell/dict-dotnet": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.2.tgz", - "integrity": "sha512-UD/pO2A2zia/YZJ8Kck/F6YyDSpCMq0YvItpd4YbtDVzPREfTZ48FjZsbYi4Jhzwfvc6o8R56JusAE58P+4sNQ==" + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.5.tgz", + "integrity": "sha512-gjg0L97ee146wX47dnA698cHm85e7EOpf9mVrJD8DmEaqoo/k1oPy2g7c7LgKxK9XnqwoXxhLNnngPrwXOoEtQ==" }, "node_modules/@cspell/dict-elixir": { "version": "4.0.3", @@ -234,9 +234,9 @@ "integrity": "sha512-simGS/lIiXbEaqJu9E2VPoYW1OTC2xrwPPXNXFMa2uo/50av56qOuaxDrZ5eH1LidFXwoc8HROCHYeKoNrDLSw==" }, "node_modules/@cspell/dict-golang": { - "version": "6.0.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.9.tgz", - "integrity": "sha512-etDt2WQauyEQDA+qPS5QtkYTb2I9l5IfQftAllVoB1aOrT6bxxpHvMEpJ0Hsn/vezxrCqa/BmtUbRxllIxIuSg==" + "version": "6.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.12.tgz", + "integrity": "sha512-LEPeoqd+4O+vceHF73S7D7+LYfrAjOvp4Dqzh4MT30ruzlQ77yHRSuYOJtrFN1GK5ntAt/ILSVOKg9sgsz1Llg==" }, "node_modules/@cspell/dict-google": { "version": "1.0.1", @@ -309,24 +309,24 @@ "integrity": "sha512-weMTyxWpzz19q4wv9n183BtFvdD5fCjtze+bFKpl+4rO/YlPhHL2cXLAeexJz/VDSBecwX4ybTZYoknd1h2J4w==" }, "node_modules/@cspell/dict-php": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.8.tgz", - "integrity": "sha512-TBw3won4MCBQ2wdu7kvgOCR3dY2Tb+LJHgDUpuquy3WnzGiSDJ4AVelrZdE1xu7mjFJUr4q48aB21YT5uQqPZA==" + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.10.tgz", + "integrity": "sha512-NfTZdp6kcZDF1PvgQ6cY0zE4FUO5rSwNmBH/iwCBuaLfJAFQ97rgjxo+D2bic4CFwNjyHutnHPtjJBRANO5XQw==" }, "node_modules/@cspell/dict-powershell": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.5.tgz", - "integrity": "sha512-3JVyvMoDJesAATYGOxcUWPbQPUvpZmkinV3m8HL1w1RrjeMVXXuK7U1jhopSneBtLhkU+9HKFwgh9l9xL9mY2Q==" + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.6.tgz", + "integrity": "sha512-BSi9tmnT7jgNsH5SaHSg70aw+4YwTjkkZBfhHtin0r6AMV2RaiLzsBPvzZGXOcm0yTvl975HYoKMqflXIlk2RA==" }, "node_modules/@cspell/dict-public-licenses": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.7.tgz", - "integrity": "sha512-KlBXuGcN3LE7tQi/GEqKiDewWGGuopiAD0zRK1QilOx5Co8XAvs044gk4MNIQftc8r0nHeUI+irJKLGcR36DIQ==" + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.8.tgz", + "integrity": "sha512-Sup+tFS7cDV0fgpoKtUqEZ6+fA/H+XUgBiqQ/Fbs6vUE3WCjJHOIVsP+udHuyMH7iBfJ4UFYOYeORcY4EaKdMg==" }, "node_modules/@cspell/dict-python": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.4.tgz", - "integrity": "sha512-sCtLBqMreb+8zRW2bXvFsfSnRUVU6IFm4mT6Dc4xbz0YajprbaPPh/kOUTw5IJRP8Uh+FFb7Xp2iH03CNWRq/A==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.5.tgz", + "integrity": "sha512-HJ7xY2kg1Lg1lB4zFnniqvICFx8mj5f0Ij42HcRrUt980loFFml/MXnYR8Zn9sPzNyH4AYe1ZyLI/oPHH6TYqA==", "dependencies": { "@cspell/dict-data-science": "^2.0.1" } @@ -337,9 +337,9 @@ "integrity": "sha512-KCmKaeYMLm2Ip79mlYPc8p+B2uzwBp4KMkzeLd5E6jUlCL93Y5Nvq68wV5fRLDRTf7N1LvofkVFWfDcednFOgA==" }, "node_modules/@cspell/dict-ruby": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.2.tgz", - "integrity": "sha512-cIh8KTjpldzFzKGgrqUX4bFyav5lC52hXDKo4LbRuMVncs3zg4hcSf4HtURY+f2AfEZzN6ZKzXafQpThq3dl2g==" + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.3.tgz", + "integrity": "sha512-V1xzv9hN6u8r6SM4CkYdsxs4ov8gjXXo0Twfx5kWhLXbEVxTXDMt7ohLTqpy2XlF5mutixZdbHMeFiAww8v+Ug==" }, "node_modules/@cspell/dict-rust": { "version": "4.0.5", @@ -352,9 +352,9 @@ "integrity": "sha512-4yGb4AInT99rqprxVNT9TYb1YSpq58Owzq7zi3ZS5T0u899Y4VsxsBiOgHnQ/4W+ygi+sp+oqef8w8nABR2lkg==" }, "node_modules/@cspell/dict-software-terms": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.0.6.tgz", - "integrity": "sha512-UDhUzNSf7GN529a0Ip9hlSoGbpscz0YlUYBEJmZBXi8otpkrbCJqs50T74Ppd+SWqNil04De8urv4af2c6SY5Q==" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.0.tgz", + "integrity": "sha512-PSnC2kNyg7HBG+neIuFDCH4PETWPkZaFEOvqjfKueoO4Fa3M8nQrYN9jNxAAbdPoL9rxSPdncSvvEnJs1ng/uw==" }, "node_modules/@cspell/dict-sql": { "version": "2.1.5", @@ -387,9 +387,9 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.14.1.tgz", - "integrity": "sha512-zGnymwieuFigqz839cKCF9JB90nUm50SMqopWClMl4LFOpqpuCucn/Slh4CLGu2vri4iqCvRweDxZCsi/5qYiw==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.14.2.tgz", + "integrity": "sha512-5MbqtIligU7yPwHWU/5yFCgMvur4i1bRAF1Cy8y2dDtHsa204S/w/SaXs+51EFLp2eNbCiBisCBrwJFT7R1RxA==", "dependencies": { "import-meta-resolve": "^4.1.0" }, @@ -398,25 +398,25 @@ } }, "node_modules/@cspell/filetypes": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.14.1.tgz", - "integrity": "sha512-jOcTFzHJ3c1uTZLm3BvLrZ8TakXLIimsFGwvk/qTA1EYgUPC2a0TypGCxR0NCHmpMlZvfAT5iAksDIiCHq1yjg==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.14.2.tgz", + "integrity": "sha512-ZevArA0mWeVTTqHicxCPZIAeCibpY3NwWK/x6d1Lgu7RPk/daoGAM546Q2SLChFu+r10tIH7pRG212A6Q9ihPA==", "engines": { "node": ">=18" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.14.1.tgz", - "integrity": "sha512-idQVm12vzQHLMpV4ETDFBPpSP7TTf0hRrdsY5i/La6uzZE05b5QxadfInNtbKV/Tf2OpjV3dygALOo2932xChw==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.14.2.tgz", + "integrity": "sha512-7sRzJc392CQYNNrtdPEfOHJdRqsqf6nASCtbS5A9hL2UrdWQ4uN7r/D+Y1HpuizwY9eOkZvarcFfsYt5wE0Pug==", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.14.1.tgz", - "integrity": "sha512-K8TSiDti+mhuITezwr0fpmD756Y52cbJdxAgoXioL3Ri6ZoyQyhyhsJFeE6kNZLq24KwddZa8WJaY7hHKylygg==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.14.2.tgz", + "integrity": "sha512-YmWW+B/2XQcCynLpiAQF77Bitm5Cynw3/BICZkbdveKjJkUzEmXB+U2qWuwXOyU8xUYuwkP63YM8McnI567rUA==", "engines": { "node": ">=18.0" } @@ -562,23 +562,23 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cspell": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.14.1.tgz", - "integrity": "sha512-UwjSLwt3RR8sP1dtjVbLimc8CpziOlVXH0yXb7/nWyMi3wEPWaV3o0VSTtRHRoaYHAjVzNlXDT6kiSr6RqyPog==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.14.2.tgz", + "integrity": "sha512-ii/W7fwO4chNQVYl1C/8k7RW8EXzLb69rvg08p8mSJx8B2UasVJ9tuJpTH2Spo1jX6N3H0dKPWUbd1fAmdAhPg==", "dependencies": { - "@cspell/cspell-json-reporter": "8.14.1", - "@cspell/cspell-pipe": "8.14.1", - "@cspell/cspell-types": "8.14.1", - "@cspell/dynamic-import": "8.14.1", - "@cspell/url": "8.14.1", + "@cspell/cspell-json-reporter": "8.14.2", + "@cspell/cspell-pipe": "8.14.2", + "@cspell/cspell-types": "8.14.2", + "@cspell/dynamic-import": "8.14.2", + "@cspell/url": "8.14.2", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-dictionary": "8.14.1", - "cspell-gitignore": "8.14.1", - "cspell-glob": "8.14.1", - "cspell-io": "8.14.1", - "cspell-lib": "8.14.1", + "cspell-dictionary": "8.14.2", + "cspell-gitignore": "8.14.2", + "cspell-glob": "8.14.2", + "cspell-io": "8.14.2", + "cspell-lib": "8.14.2", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.0.0", @@ -598,11 +598,11 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.14.1.tgz", - "integrity": "sha512-660v4G+3AikdGfSri09YGx7enR4RWPIPLiFKA+3F+CY2lj16l4bh7B/aNfU9oYRDvCcWBCik53AyOne/bSuPVg==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.14.2.tgz", + "integrity": "sha512-yHP1BdcH5dbjb8qiZr6+bxEnJ+rxTULQ00wBz3eBPWCghJywEAYYvMWoYuxVtPpndlkKYC1wJAHsyNkweQyepA==", "dependencies": { - "@cspell/cspell-types": "8.14.1", + "@cspell/cspell-types": "8.14.2", "comment-json": "^4.2.5", "yaml": "^2.5.0" }, @@ -611,13 +611,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.14.1.tgz", - "integrity": "sha512-+QI3RLzfA4bkKEa5H9OQx2cPN+f5mXx8zbmccoJXxgjUi3fWmNGz4LPHnNQQ7pWXxQ2V81UXDwd7qRN9qkzISQ==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.14.2.tgz", + "integrity": "sha512-gWuAvf6queGGUvGbfAxxUq55cZ0OevWPbjnCrSB0PpJ4tqdFd8dLcvVrIKzoE2sBXKPw2NDkmoEngs6iGavC0w==", "dependencies": { - "@cspell/cspell-pipe": "8.14.1", - "@cspell/cspell-types": "8.14.1", - "cspell-trie-lib": "8.14.1", + "@cspell/cspell-pipe": "8.14.2", + "@cspell/cspell-types": "8.14.2", + "cspell-trie-lib": "8.14.2", "fast-equals": "^5.0.1" }, "engines": { @@ -625,13 +625,13 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.14.1.tgz", - "integrity": "sha512-f/3rZqHKTFOB37Ey8b7eIQwom4w+wKKzr1sEsoEdLsWyRAd7HdSXkDG6O0S3RYvUYoiXZM9HQsQY695CVhq2wQ==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.14.2.tgz", + "integrity": "sha512-lrO/49NaKBpkR7vFxv4OOY+oHmsG5+gNQejrBBWD9Nv9vvjJtz/G36X/rcN6M6tFcQQMWwa01kf04nxz8Ejuhg==", "dependencies": { - "@cspell/url": "8.14.1", - "cspell-glob": "8.14.1", - "cspell-io": "8.14.1", + "@cspell/url": "8.14.2", + "cspell-glob": "8.14.2", + "cspell-io": "8.14.2", "find-up-simple": "^1.0.0" }, "bin": { @@ -642,11 +642,11 @@ } }, "node_modules/cspell-glob": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.14.1.tgz", - "integrity": "sha512-562ZbkBikXlB3JEGlGsi+3Xa4aghc2nqW1DLhcyXId/eunuJuUIqDGeexHkRwb0yBkq1we8O67hJtC3W0ih5GQ==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.14.2.tgz", + "integrity": "sha512-9Q1Kgoo1ev3fKTpp9y5n8M4RLxd8B0f5o4y5FQe4dBU0j/bt+/YDrLZNWDm77JViV606XQ6fimG1FTTq6pT9/g==", "dependencies": { - "@cspell/url": "8.14.1", + "@cspell/url": "8.14.2", "micromatch": "^4.0.7" }, "engines": { @@ -654,12 +654,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.14.1.tgz", - "integrity": "sha512-q4soR+FDU7Z3Z2gxl9dYP8qtrunH32aozhIGx6kkLWKWSy/jk2HaWdDp2MkpsQUURXLKMJ6PBZfpzR9Mxz3KqA==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.14.2.tgz", + "integrity": "sha512-eYwceVP80FGYVJenE42ALnvEKOXaXjq4yVbb1Ni1umO/9qamLWNCQ1RP6rRACy5e/cXviAbhrQ5Mtw6n+pyPEQ==", "dependencies": { - "@cspell/cspell-pipe": "8.14.1", - "@cspell/cspell-types": "8.14.1" + "@cspell/cspell-pipe": "8.14.2", + "@cspell/cspell-types": "8.14.2" }, "bin": { "cspell-grammar": "bin.mjs" @@ -669,38 +669,38 @@ } }, "node_modules/cspell-io": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.14.1.tgz", - "integrity": "sha512-BQvFFzlPXu0RrBecjryZI6EwegpCeph7CnNoWlBUlO/T6kJiB6uG674n/LyenOImnLRrLUbRt1yZcPxziFHNlA==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.14.2.tgz", + "integrity": "sha512-uaKpHiY3DAgfdzgKMQml6U8F8o9udMuYxGqYa5FVfN7D5Ap7B2edQzSLTUYwxrFEn4skSfp6XY73+nzJvxzH4Q==", "dependencies": { - "@cspell/cspell-service-bus": "8.14.1", - "@cspell/url": "8.14.1" + "@cspell/cspell-service-bus": "8.14.2", + "@cspell/url": "8.14.2" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.14.1.tgz", - "integrity": "sha512-wVZVVezge8ubq+zOED1V6EEtrJQZPNJcpNPDnc7ZXwnWiQxREWvQkuBa60EvAezPImxYdVDr8Y0dIS8yLd9WJg==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.14.2.tgz", + "integrity": "sha512-d2oiIXHXnADmnhIuFLOdNE63L7OUfzgpLbYaqAWbkImCUDkevfGrOgnX8TJ03fUgZID4nvQ+3kgu/n2j4eLZjQ==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.14.1", - "@cspell/cspell-pipe": "8.14.1", - "@cspell/cspell-resolver": "8.14.1", - "@cspell/cspell-types": "8.14.1", - "@cspell/dynamic-import": "8.14.1", - "@cspell/filetypes": "8.14.1", - "@cspell/strong-weak-map": "8.14.1", - "@cspell/url": "8.14.1", + "@cspell/cspell-bundled-dicts": "8.14.2", + "@cspell/cspell-pipe": "8.14.2", + "@cspell/cspell-resolver": "8.14.2", + "@cspell/cspell-types": "8.14.2", + "@cspell/dynamic-import": "8.14.2", + "@cspell/filetypes": "8.14.2", + "@cspell/strong-weak-map": "8.14.2", + "@cspell/url": "8.14.2", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.14.1", - "cspell-dictionary": "8.14.1", - "cspell-glob": "8.14.1", - "cspell-grammar": "8.14.1", - "cspell-io": "8.14.1", - "cspell-trie-lib": "8.14.1", + "cspell-config-lib": "8.14.2", + "cspell-dictionary": "8.14.2", + "cspell-glob": "8.14.2", + "cspell-grammar": "8.14.2", + "cspell-io": "8.14.2", + "cspell-trie-lib": "8.14.2", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -715,12 +715,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.14.1.tgz", - "integrity": "sha512-2B5pnRHgYHFtdE4N1a0oWCYI1pZVeD1kvcst77ySe520Rg/U18aIET3UzsvN97EDwQ6Y23tHoVsXha0PxD1xfw==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.14.2.tgz", + "integrity": "sha512-rZMbaEBGoyy4/zxKECaMyVyGLbuUxYmZ5jlEgiA3xPtEdWwJ4iWRTo5G6dWbQsXoxPYdAXXZ0/q0GQ2y6Jt0kw==", "dependencies": { - "@cspell/cspell-pipe": "8.14.1", - "@cspell/cspell-types": "8.14.1", + "@cspell/cspell-pipe": "8.14.2", + "@cspell/cspell-types": "8.14.2", "gensequence": "^7.0.0" }, "engines": { diff --git a/package.json b/package.json index bb5508c820..646f03bee8 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.14.1" + "cspell": "^8.14.2" } } From 85e6ef3492905ad5aaa87322eacd01df78b68944 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Mon, 26 Aug 2024 20:30:41 +0200 Subject: [PATCH 384/845] Make the naming of the IEquivalencyStep signature clearer The name of EquivalencyResult.AssertionCompleted wasn't clear what it tried to accomplish. This has been improved. Also improved the interface that equivalency steps can use for recursive assertions. --- Build/_build.csproj.DotSettings | 5 ++++- FluentAssertions.sln.DotSettings | 3 +++ .../GenericCollectionAssertions.cs | 2 +- .../GenericDictionaryAssertions.cs | 2 +- .../Collections/StringCollectionAssertions.cs | 2 +- .../Equivalency/EquivalencyResult.cs | 2 +- .../Equivalency/EquivalencyStep.cs | 8 +++---- .../Equivalency/EquivalencyValidator.cs | 13 +++++++---- .../Equivalency/IEquivalencyStep.cs | 4 ++-- ...or.cs => IValidateChildNodeEquivalency.cs} | 4 ++-- .../MultiDimensionalArrayEquivalencyStep.cs | 8 +++---- .../Steps/AssertionRuleEquivalencyStep.cs | 6 ++--- .../Equivalency/Steps/AutoConversionStep.cs | 2 +- .../Steps/DictionaryEquivalencyStep.cs | 6 ++--- .../Equivalency/Steps/EnumEqualityStep.cs | 4 ++-- .../Steps/EnumerableEquivalencyStep.cs | 6 ++--- .../Steps/EnumerableEquivalencyValidator.cs | 8 +++---- .../Steps/EqualityComparerEquivalencyStep.cs | 4 ++-- .../Steps/GenericDictionaryEquivalencyStep.cs | 14 ++++++------ .../Steps/GenericEnumerableEquivalencyStep.cs | 6 ++--- .../Steps/ReferenceEqualityEquivalencyStep.cs | 4 ++-- .../Steps/RunAllUserStepsEquivalencyStep.cs | 6 ++--- .../Steps/SimpleEqualityEquivalencyStep.cs | 4 ++-- .../Steps/StringEqualityEquivalencyStep.cs | 6 ++--- .../StructuralEqualityEquivalencyStep.cs | 10 ++++----- .../Steps/ValueTypeEquivalencyStep.cs | 4 ++-- .../Steps/XAttributeEquivalencyStep.cs | 4 ++-- .../Steps/XDocumentEquivalencyStep.cs | 4 ++-- .../Steps/XElementEquivalencyStep.cs | 4 ++-- .../ExtensibilitySpecs.cs | 22 +++++++++---------- .../AssertionOptionsSpecs.cs | 4 ++-- docs/_pages/extensibility.md | 6 ++--- docs/_pages/releases.md | 2 ++ 33 files changed, 101 insertions(+), 88 deletions(-) rename Src/FluentAssertions/Equivalency/{IEquivalencyValidator.cs => IValidateChildNodeEquivalency.cs} (56%) diff --git a/Build/_build.csproj.DotSettings b/Build/_build.csproj.DotSettings index 9aac7d8e8d..7348ae5acb 100644 --- a/Build/_build.csproj.DotSettings +++ b/Build/_build.csproj.DotSettings @@ -13,6 +13,8 @@ False <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy><Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> + <Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"><ElementKinds><Kind Name="FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> True True True @@ -21,4 +23,5 @@ True True True - True + True + True diff --git a/FluentAssertions.sln.DotSettings b/FluentAssertions.sln.DotSettings index 692c8c68da..4d77a67599 100644 --- a/FluentAssertions.sln.DotSettings +++ b/FluentAssertions.sln.DotSettings @@ -104,6 +104,8 @@ UseExplicitType <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy><Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy> + <Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"><ElementKinds><Kind Name="FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> @@ -154,6 +156,7 @@ True True True + True D:\Workspaces\FluentAssertions\Default.testsettings 4 False diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index 3c33ae9a28..fe91b27c0f 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs index 765a90f2ad..c31e6f4af8 100644 --- a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs index 82e4498f3c..2779fdf042 100644 --- a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; diff --git a/Src/FluentAssertions/Equivalency/EquivalencyResult.cs b/Src/FluentAssertions/Equivalency/EquivalencyResult.cs index 5fb0786888..b8f537e7e1 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyResult.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyResult.cs @@ -3,5 +3,5 @@ namespace FluentAssertions.Equivalency; public enum EquivalencyResult { ContinueWithNext, - AssertionCompleted + EquivalencyProven } diff --git a/Src/FluentAssertions/Equivalency/EquivalencyStep.cs b/Src/FluentAssertions/Equivalency/EquivalencyStep.cs index ddbbc2f68e..52d5666eea 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyStep.cs @@ -1,4 +1,4 @@ -namespace FluentAssertions.Equivalency; +namespace FluentAssertions.Equivalency; /// /// Convenient implementation of that will only invoke @@ -6,19 +6,19 @@ public abstract class EquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { if (!typeof(T).IsAssignableFrom(comparands.GetExpectedType(context.Options))) { return EquivalencyResult.ContinueWithNext; } - return OnHandle(comparands, context, nestedValidator); + return OnHandle(comparands, context, valueChildNodes); } /// /// Implements , but only gets called when the expected type matches . /// protected abstract EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator); + IValidateChildNodeEquivalency nested); } diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs index 928236ed78..6d7de0a3fd 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs @@ -7,7 +7,7 @@ namespace FluentAssertions.Equivalency; /// /// Is responsible for validating the equivalency of a subject with another object. /// -public class EquivalencyValidator : IEquivalencyValidator +public class EquivalencyValidator : IValidateChildNodeEquivalency { private const int MaxDepth = 10; @@ -19,7 +19,7 @@ public void AssertEquality(Comparands comparands, EquivalencyValidationContext c scope.AddReportable("configuration", () => context.Options.ToString()); scope.BecauseOf(context.Reason); - RecursivelyAssertEquality(comparands, context); + RecursivelyAssertEquivalencyOf(comparands, context); if (context.TraceWriter is not null) { @@ -27,7 +27,12 @@ public void AssertEquality(Comparands comparands, EquivalencyValidationContext c } } - public void RecursivelyAssertEquality(Comparands comparands, IEquivalencyValidationContext context) + private void RecursivelyAssertEquivalencyOf(Comparands comparands, IEquivalencyValidationContext context) + { + AssertEquivalencyOf(comparands, context); + } + + public void AssertEquivalencyOf(Comparands comparands, IEquivalencyValidationContext context) { var scope = AssertionScope.Current; @@ -69,7 +74,7 @@ private void TryToProveNodesAreEquivalent(Comparands comparands, IEquivalencyVal foreach (IEquivalencyStep step in AssertionOptions.EquivalencyPlan) { var result = step.Handle(comparands, context, this); - if (result == EquivalencyResult.AssertionCompleted) + if (result == EquivalencyResult.EquivalencyProven) { context.Tracer.WriteLine(GetMessage(step)); diff --git a/Src/FluentAssertions/Equivalency/IEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/IEquivalencyStep.cs index bd55ae1774..d4f744b5ea 100644 --- a/Src/FluentAssertions/Equivalency/IEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/IEquivalencyStep.cs @@ -9,11 +9,11 @@ public interface IEquivalencyStep /// Executes an operation such as an equivalency assertion on the provided . /// /// - /// Should return if the subject matches the expectation or if no additional assertions + /// Should return if the subject matches the expectation or if no additional assertions /// have to be executed. Should return otherwise. /// /// /// May throw when preconditions are not met or if it detects mismatching data. /// - EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, IEquivalencyValidator nestedValidator); + EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, IValidateChildNodeEquivalency valueChildNodes); } diff --git a/Src/FluentAssertions/Equivalency/IEquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/IValidateChildNodeEquivalency.cs similarity index 56% rename from Src/FluentAssertions/Equivalency/IEquivalencyValidator.cs rename to Src/FluentAssertions/Equivalency/IValidateChildNodeEquivalency.cs index 1d7aacb28e..dfc38ad990 100644 --- a/Src/FluentAssertions/Equivalency/IEquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/IValidateChildNodeEquivalency.cs @@ -1,9 +1,9 @@ namespace FluentAssertions.Equivalency; -public interface IEquivalencyValidator +public interface IValidateChildNodeEquivalency { /// /// Runs a deep recursive equivalency assertion on the provided . /// - void RecursivelyAssertEquality(Comparands comparands, IEquivalencyValidationContext context); + void AssertEquivalencyOf(Comparands comparands, IEquivalencyValidationContext context); } diff --git a/Src/FluentAssertions/Equivalency/MultiDimensionalArrayEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/MultiDimensionalArrayEquivalencyStep.cs index 27bb4af3fd..016a566003 100644 --- a/Src/FluentAssertions/Equivalency/MultiDimensionalArrayEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/MultiDimensionalArrayEquivalencyStep.cs @@ -11,7 +11,7 @@ namespace FluentAssertions.Equivalency; internal class MultiDimensionalArrayEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { if (comparands.Expectation is not Array expectationAsArray || expectationAsArray.Rank == 1) { @@ -22,7 +22,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon { if (expectationAsArray.Length == 0) { - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } Digit digit = BuildDigitsRepresentingAllIndices(expectationAsArray); @@ -36,12 +36,12 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon IEquivalencyValidationContext itemContext = context.AsCollectionItem(listOfIndices); - nestedValidator.RecursivelyAssertEquality(new Comparands(subject, expectation, typeof(object)), itemContext); + valueChildNodes.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(object)), itemContext); } while (digit.Increment()); } - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } private static Digit BuildDigitsRepresentingAllIndices(Array subjectAsArray) diff --git a/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs index 4c3609bccd..ce2116a0fe 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs @@ -23,7 +23,7 @@ public AssertionRuleEquivalencyStep( } public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { bool success = false; @@ -41,7 +41,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon { // Convert into a child context context = context.Clone(); - converter.Handle(comparands, context, nestedValidator); + converter.Handle(comparands, context, valueChildNodes); converted = true; } @@ -59,7 +59,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon } } - return success ? EquivalencyResult.AssertionCompleted : EquivalencyResult.ContinueWithNext; + return success ? EquivalencyResult.EquivalencyProven : EquivalencyResult.ContinueWithNext; } private bool AppliesTo(Comparands comparands, INode currentNode) => predicate(new ObjectInfo(comparands, currentNode)); diff --git a/Src/FluentAssertions/Equivalency/Steps/AutoConversionStep.cs b/Src/FluentAssertions/Equivalency/Steps/AutoConversionStep.cs index 55f9f4db5d..e91c7daf5b 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AutoConversionStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AutoConversionStep.cs @@ -14,7 +14,7 @@ namespace FluentAssertions.Equivalency.Steps; public class AutoConversionStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { if (!context.Options.ConversionSelector.RequiresConversion(comparands, context.CurrentNode)) { diff --git a/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs index e0acf0f406..67dff5dbf2 100644 --- a/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs @@ -9,7 +9,7 @@ public class DictionaryEquivalencyStep : EquivalencyStep { [SuppressMessage("ReSharper", "PossibleNullReferenceException")] protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency nested) { var subject = comparands.Subject as IDictionary; var expectation = comparands.Expectation as IDictionary; @@ -23,7 +23,7 @@ protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalenc context.Tracer.WriteLine(member => Invariant($"Recursing into dictionary item {key} at {member.Description}")); - nestedValidator.RecursivelyAssertEquality(new Comparands(subject[key], expectation[key], typeof(object)), + nested.AssertEquivalencyOf(new Comparands(subject[key], expectation[key], typeof(object)), context.AsDictionaryItem(key)); } else @@ -37,7 +37,7 @@ protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalenc } } - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } private static bool PreconditionsAreMet(IDictionary expectation, IDictionary subject) diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs b/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs index 274f6a7c3e..a0251192ca 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs @@ -11,7 +11,7 @@ namespace FluentAssertions.Equivalency.Steps; public class EnumEqualityStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { if (!comparands.GetExpectedType(context.Options).IsEnum) { @@ -48,7 +48,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon } } - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } private static void HandleByValue(Comparands comparands, Reason reason) diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs index 996224f5aa..45fc7d57e1 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs @@ -8,7 +8,7 @@ namespace FluentAssertions.Equivalency.Steps; public class EnumerableEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { if (!IsCollection(comparands.GetExpectedType(context.Options))) { @@ -17,7 +17,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon if (AssertSubjectIsCollection(comparands.Subject)) { - var validator = new EnumerableEquivalencyValidator(nestedValidator, context) + var validator = new EnumerableEquivalencyValidator(valueChildNodes, context) { Recursive = context.CurrentNode.IsRoot || context.Options.IsRecursive, OrderingRules = context.Options.OrderingRules @@ -26,7 +26,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon validator.Execute(ToArray(comparands.Subject), ToArray(comparands.Expectation)); } - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } private static bool AssertSubjectIsCollection(object subject) diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs index f9005628be..71de9e6657 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs @@ -16,12 +16,12 @@ internal class EnumerableEquivalencyValidator #region Private Definitions - private readonly IEquivalencyValidator parent; + private readonly IValidateChildNodeEquivalency parent; private readonly IEquivalencyValidationContext context; #endregion - public EnumerableEquivalencyValidator(IEquivalencyValidator parent, IEquivalencyValidationContext context) + public EnumerableEquivalencyValidator(IValidateChildNodeEquivalency parent, IEquivalencyValidationContext context) { this.parent = parent; this.context = context; @@ -195,7 +195,7 @@ private string[] TryToMatch(object subject, T expectation, int expectationInd { using var scope = new AssertionScope(); - parent.RecursivelyAssertEquality(new Comparands(subject, expectation, typeof(T)), + parent.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(T)), context.AsCollectionItem(expectationIndex)); return scope.Discard(); @@ -207,7 +207,7 @@ private bool StrictlyMatchAgainst(object[] subjects, T expectation, int expec object subject = subjects[expectationIndex]; IEquivalencyValidationContext equivalencyValidationContext = context.AsCollectionItem(expectationIndex); - parent.RecursivelyAssertEquality(new Comparands(subject, expectation, typeof(T)), equivalencyValidationContext); + parent.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(T)), equivalencyValidationContext); bool failed = scope.HasFailures(); return !failed; diff --git a/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs index 42c9df3677..2ba66b8c9e 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs @@ -14,7 +14,7 @@ public EqualityComparerEquivalencyStep(IEqualityComparer comparer) } public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { var expectedType = context.Options.UseRuntimeTyping ? comparands.RuntimeType : comparands.CompileTimeType; @@ -39,7 +39,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon .FailWith("Expected {context:object} to be equal to {1} according to {0}{because}, but {2} was not.", comparer.ToString(), comparands.Expectation, comparands.Subject); - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } public override string ToString() diff --git a/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs index e642b4b40a..f10a166a19 100644 --- a/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs @@ -11,13 +11,13 @@ public class GenericDictionaryEquivalencyStep : IEquivalencyStep { #pragma warning disable SA1110 // Allow opening parenthesis on new line to reduce line length private static readonly MethodInfo AssertDictionaryEquivalenceMethod = - new Action, IDictionary> (AssertDictionaryEquivalence).GetMethodInfo().GetGenericMethodDefinition(); #pragma warning restore SA1110 public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { if (comparands.Expectation is null) { @@ -40,10 +40,10 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon if (IsNotNull(comparands.Subject) && EnsureSubjectIsOfTheExpectedDictionaryType(comparands, expectedDictionary) is { } actualDictionary) { - AssertDictionaryEquivalence(comparands, context, nestedValidator, actualDictionary, expectedDictionary); + AssertDictionaryEquivalence(comparands, context, valueChildNodes, actualDictionary, expectedDictionary); } - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } private static bool IsNonGenericDictionary(object subject) @@ -148,7 +148,7 @@ private static void FailWithLengthDifference( EquivalencyValidationContext context, - IEquivalencyValidator parent, + IValidateChildNodeEquivalency parent, IEquivalencyOptions options, IDictionary subject, IDictionary expectation) @@ -180,7 +180,7 @@ private static void AssertDictionaryEquivalence(key)); } } diff --git a/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs index a8853b1380..1ff5fb4148 100644 --- a/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs @@ -16,7 +16,7 @@ public class GenericEnumerableEquivalencyStep : IEquivalencyStep #pragma warning restore SA1110 public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { Type expectedType = comparands.GetExpectedType(context.Options); @@ -35,7 +35,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon if (AssertSubjectIsCollection(comparands.Subject)) { - var validator = new EnumerableEquivalencyValidator(nestedValidator, context) + var validator = new EnumerableEquivalencyValidator(valueChildNodes, context) { Recursive = context.CurrentNode.IsRoot || context.Options.IsRecursive, OrderingRules = context.Options.OrderingRules @@ -56,7 +56,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon } } - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } private static void HandleImpl(EnumerableEquivalencyValidator validator, object[] subject, IEnumerable expectation) => diff --git a/Src/FluentAssertions/Equivalency/Steps/ReferenceEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/ReferenceEqualityEquivalencyStep.cs index dc1e6b6018..c41e899078 100644 --- a/Src/FluentAssertions/Equivalency/Steps/ReferenceEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/ReferenceEqualityEquivalencyStep.cs @@ -3,10 +3,10 @@ public class ReferenceEqualityEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { return ReferenceEquals(comparands.Subject, comparands.Expectation) - ? EquivalencyResult.AssertionCompleted + ? EquivalencyResult.EquivalencyProven : EquivalencyResult.ContinueWithNext; } } diff --git a/Src/FluentAssertions/Equivalency/Steps/RunAllUserStepsEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/RunAllUserStepsEquivalencyStep.cs index 6bfc9d801c..114a0aa726 100644 --- a/Src/FluentAssertions/Equivalency/Steps/RunAllUserStepsEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/RunAllUserStepsEquivalencyStep.cs @@ -7,13 +7,13 @@ public class RunAllUserStepsEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { foreach (IEquivalencyStep step in context.Options.UserEquivalencySteps) { - if (step.Handle(comparands, context, nestedValidator) == EquivalencyResult.AssertionCompleted) + if (step.Handle(comparands, context, valueChildNodes) == EquivalencyResult.EquivalencyProven) { - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } } diff --git a/Src/FluentAssertions/Equivalency/Steps/SimpleEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/SimpleEqualityEquivalencyStep.cs index 0d15f6c0ea..0e2b955cf4 100644 --- a/Src/FluentAssertions/Equivalency/Steps/SimpleEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/SimpleEqualityEquivalencyStep.cs @@ -3,13 +3,13 @@ namespace FluentAssertions.Equivalency.Steps; public class SimpleEqualityEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { if (!context.Options.IsRecursive && !context.CurrentNode.IsRoot) { comparands.Subject.Should().Be(comparands.Expectation, context.Reason.FormattedMessage, context.Reason.Arguments); - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } return EquivalencyResult.ContinueWithNext; diff --git a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs index 502e42b43e..00a736626c 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs @@ -6,7 +6,7 @@ namespace FluentAssertions.Equivalency.Steps; public class StringEqualityEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { Type expectationType = comparands.GetExpectedType(context.Options); @@ -17,7 +17,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon if (!ValidateAgainstNulls(comparands, context.CurrentNode)) { - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } bool subjectIsString = ValidateSubjectIsString(comparands, context.CurrentNode); @@ -32,7 +32,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon context.Reason.FormattedMessage, context.Reason.Arguments); } - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } private static Func, EquivalencyOptions> diff --git a/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs index 2f3eb9abcf..23d022e952 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs @@ -8,7 +8,7 @@ namespace FluentAssertions.Equivalency.Steps; public class StructuralEqualityEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { if (!context.CurrentNode.IsRoot && !context.Options.IsRecursive) { @@ -45,15 +45,15 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon foreach (IMember selectedMember in selectedMembers) { - AssertMemberEquality(comparands, context, nestedValidator, selectedMember, context.Options); + AssertMemberEquality(comparands, context, valueChildNodes, selectedMember, context.Options); } } - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } private static void AssertMemberEquality(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator parent, IMember selectedMember, IEquivalencyOptions options) + IValidateChildNodeEquivalency parent, IMember selectedMember, IEquivalencyOptions options) { IMember matchingMember = FindMatchFor(selectedMember, context.CurrentNode, comparands.Subject, options); @@ -73,7 +73,7 @@ private static void AssertMemberEquality(Comparands comparands, IEquivalencyVali selectedMember.Name = matchingMember.Name; } - parent.RecursivelyAssertEquality(nestedComparands, context.AsNestedMember(selectedMember)); + parent.AssertEquivalencyOf(nestedComparands, context.AsNestedMember(selectedMember)); } } diff --git a/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs index 71a131c275..c9270e421b 100644 --- a/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs @@ -8,7 +8,7 @@ namespace FluentAssertions.Equivalency.Steps; public class ValueTypeEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { Type expectationType = comparands.GetExpectedType(context.Options); EqualityStrategy strategy = context.Options.GetEqualityStrategy(expectationType); @@ -28,7 +28,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon comparands.Subject.Should().Be(comparands.Expectation, context.Reason.FormattedMessage, context.Reason.Arguments); - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } return EquivalencyResult.ContinueWithNext; diff --git a/Src/FluentAssertions/Equivalency/Steps/XAttributeEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/XAttributeEquivalencyStep.cs index b9ed03a5b7..1f960da7b9 100644 --- a/Src/FluentAssertions/Equivalency/Steps/XAttributeEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/XAttributeEquivalencyStep.cs @@ -5,13 +5,13 @@ namespace FluentAssertions.Equivalency.Steps; public class XAttributeEquivalencyStep : EquivalencyStep { protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency nested) { var subject = (XAttribute)comparands.Subject; var expectation = (XAttribute)comparands.Expectation; subject.Should().Be(expectation, context.Reason.FormattedMessage, context.Reason.Arguments); - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } } diff --git a/Src/FluentAssertions/Equivalency/Steps/XDocumentEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/XDocumentEquivalencyStep.cs index 76f569bee3..b7556b4788 100644 --- a/Src/FluentAssertions/Equivalency/Steps/XDocumentEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/XDocumentEquivalencyStep.cs @@ -5,13 +5,13 @@ namespace FluentAssertions.Equivalency.Steps; public class XDocumentEquivalencyStep : EquivalencyStep { protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency nested) { var subject = (XDocument)comparands.Subject; var expectation = (XDocument)comparands.Expectation; subject.Should().BeEquivalentTo(expectation, context.Reason.FormattedMessage, context.Reason.Arguments); - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } } diff --git a/Src/FluentAssertions/Equivalency/Steps/XElementEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/XElementEquivalencyStep.cs index 022038ca6c..8e01b45938 100644 --- a/Src/FluentAssertions/Equivalency/Steps/XElementEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/XElementEquivalencyStep.cs @@ -5,13 +5,13 @@ namespace FluentAssertions.Equivalency.Steps; public class XElementEquivalencyStep : EquivalencyStep { protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency nested) { var subject = (XElement)comparands.Subject; var expectation = (XElement)comparands.Expectation; subject.Should().BeEquivalentTo(expectation, context.Reason.FormattedMessage, context.Reason.Arguments); - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs index 5bd36b35f2..a4c7478d4a 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs @@ -627,7 +627,7 @@ public void When_multiple_steps_are_added_they_should_be_evaluated_first_to_last private class AlwaysFailOnDateTimesEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { if (comparands.Expectation is DateTime) { @@ -641,13 +641,13 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon private class RelaxingDateTimeEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { if (comparands.Expectation is DateTime time) { ((DateTime)comparands.Subject).Should().BeCloseTo(time, 1.Minutes()); - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } return EquivalencyResult.ContinueWithNext; @@ -812,7 +812,7 @@ private class ThrowExceptionEquivalencyStep : IEquivalencyStep where TException : Exception, new() { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { throw new TException(); } @@ -821,16 +821,16 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon private class AlwaysHandleEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } } private class NeverHandleEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { return EquivalencyResult.ContinueWithNext; } @@ -839,10 +839,10 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon private class EqualityEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { comparands.Subject.Should().Be(comparands.Expectation, context.Reason.FormattedMessage, context.Reason.Arguments); - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } } @@ -856,10 +856,10 @@ public DoEquivalencyStep(Action doAction) } public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { doAction(); - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } } diff --git a/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs b/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs index 0a2ed6569d..0ffac09bcd 100644 --- a/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs @@ -419,11 +419,11 @@ protected override void Dispose(bool disposing) internal class MyEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IEquivalencyValidator nestedValidator) + IValidateChildNodeEquivalency valueChildNodes) { Execute.Assertion.FailWith(GetType().FullName); - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } } } diff --git a/docs/_pages/extensibility.md b/docs/_pages/extensibility.md index 0e2a984d91..52f8692230 100644 --- a/docs/_pages/extensibility.md +++ b/docs/_pages/extensibility.md @@ -242,7 +242,7 @@ Primitive types are never compared by their members and trying to call e.g. `Com The entire structural equivalency API is built around the concept of a plan containing equivalency steps that are run in a predefined order. Each step is an implementation of the `IEquivalencyStep` which exposes a single method `Handle`. You can pass your own implementation to a particular assertion call by passing it into the `Using` method (which puts it behind the final default step) or directly tweak the global `AssertionOptions.EquivalencyPlan`. Checkout the underlying `EquivalencyPlan` to see how it relates your custom step to the other steps. That said, the `Handle` method has the following signature: ```csharp -EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, IEquivalencyValidator nestedValidator); +EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, IValidateChildNodeEquivalency nestedValidator); ``` It provides you with a couple of parameters. The `comparands` gives you access to the subject-under-test and the expectation. The `context` provides some additional information such as where you are in a deeply nested structure (the `CurrentNode`), or the effective configuration that should apply to the current assertion call (the `Options`). The `nestedValidator` allows you to perform nested assertions like the `StructuralEqualityEquivalencyStep` is doing. Using this knowledge, the simplest built-in step looks like this: @@ -250,13 +250,13 @@ It provides you with a couple of parameters. The `comparands` gives you access t ```csharp public class SimpleEqualityEquivalencyStep : IEquivalencyStep { - public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, IEquivalencyValidator nestedValidator) + public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, IValidateChildNodeEquivalency nestedValidator) { if (!context.Options.IsRecursive && !context.CurrentNode.IsRoot) { comparands.Subject.Should().Be(comparands.Expectation, context.Reason.FormattedMessage, context.Reason.Arguments); - return EquivalencyResult.AssertionCompleted; + return EquivalencyResult.EquivalencyProven; } return EquivalencyResult.ContinueWithNext; diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 2a35650e76..10e5855837 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -89,6 +89,8 @@ sidebar: * Unused constructors have been removed. * Methods overwritten in `GenericAsyncFunctionAssertions` has been moved to `NonGenericAsyncFunctionAssertions`. * Moved the non-generic `NotThrow` and `NotThrowAfter` from `DelegateAssertions` to `ActionAssertions` - [#2371](https://github.com/fluentassertions/fluentassertions/pull/2371) +* Renamed `EquivalencyResult.AssertionCompleted` to `EquivalencyProven` - [#2745](https://github.com/fluentassertions/fluentassertions/pull/2745) +* Renamed `IEquivalencyValidator` to `IValidateChildNodeEquivalency`, and its method `RecursivelyAssertEquality` to `AssertEquivalencyOf` - [#2745](https://github.com/fluentassertions/fluentassertions/pull/2745) ## 6.12.0 From ee85113ed8a0c3578465be07234562064a9e6a9e Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Mon, 26 Aug 2024 20:38:23 +0200 Subject: [PATCH 385/845] Made the node, field and property internal --- Src/FluentAssertions/Equivalency/Field.cs | 2 +- Src/FluentAssertions/Equivalency/Node.cs | 2 +- Src/FluentAssertions/Equivalency/Property.cs | 2 +- docs/_pages/releases.md | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Field.cs b/Src/FluentAssertions/Equivalency/Field.cs index e44a523d20..175a78d677 100644 --- a/Src/FluentAssertions/Equivalency/Field.cs +++ b/Src/FluentAssertions/Equivalency/Field.cs @@ -8,7 +8,7 @@ namespace FluentAssertions.Equivalency; /// /// A specialized type of that represents a field of an object in a structural equivalency assertion. /// -public class Field : Node, IMember +internal class Field : Node, IMember { private readonly FieldInfo fieldInfo; private bool? isBrowsable; diff --git a/Src/FluentAssertions/Equivalency/Node.cs b/Src/FluentAssertions/Equivalency/Node.cs index 145d8291f7..4f264a3d38 100644 --- a/Src/FluentAssertions/Equivalency/Node.cs +++ b/Src/FluentAssertions/Equivalency/Node.cs @@ -6,7 +6,7 @@ namespace FluentAssertions.Equivalency; -public class Node : INode +internal class Node : INode { private static readonly Regex MatchFirstIndex = new(@"^\[[0-9]+\]$"); diff --git a/Src/FluentAssertions/Equivalency/Property.cs b/Src/FluentAssertions/Equivalency/Property.cs index fe43d16e1a..b198221339 100644 --- a/Src/FluentAssertions/Equivalency/Property.cs +++ b/Src/FluentAssertions/Equivalency/Property.cs @@ -9,7 +9,7 @@ namespace FluentAssertions.Equivalency; /// A specialized type of that represents a property of an object in a structural equivalency assertion. /// #pragma warning disable CA1716 -public class Property : Node, IMember +internal class Property : Node, IMember { private readonly PropertyInfo propertyInfo; private bool? isBrowsable; diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 10e5855837..26bc190692 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -91,6 +91,7 @@ sidebar: * Moved the non-generic `NotThrow` and `NotThrowAfter` from `DelegateAssertions` to `ActionAssertions` - [#2371](https://github.com/fluentassertions/fluentassertions/pull/2371) * Renamed `EquivalencyResult.AssertionCompleted` to `EquivalencyProven` - [#2745](https://github.com/fluentassertions/fluentassertions/pull/2745) * Renamed `IEquivalencyValidator` to `IValidateChildNodeEquivalency`, and its method `RecursivelyAssertEquality` to `AssertEquivalencyOf` - [#2745](https://github.com/fluentassertions/fluentassertions/pull/2745) +* Made `Node`, `Property` and `Field` internal - [#2745](https://github.com/fluentassertions/fluentassertions/pull/2745) ## 6.12.0 From fad452650ea83fe26ce50ac96559722f2a32e9d6 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Mon, 26 Aug 2024 20:40:10 +0200 Subject: [PATCH 386/845] Fix the unit testing template to work with xUnit --- FluentAssertions.sln.DotSettings | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/FluentAssertions.sln.DotSettings b/FluentAssertions.sln.DotSettings index 4d77a67599..e58cf3d554 100644 --- a/FluentAssertions.sln.DotSettings +++ b/FluentAssertions.sln.DotSettings @@ -1,4 +1,4 @@ - + True True False @@ -143,7 +143,7 @@ <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - + OUTLINE SOLUTION_FOLDER True @@ -167,16 +167,16 @@ 0 aaa Arrange-Act-Assert - [TestMethod] -public void When_$scenario$_it_should_$behavior$() -{ - // Arrange - $END$ - - // Act - - - // Assert + [Fact] +public void $END$() +{ + // Arrange + + + // Act + + + // Assert } True True From 958364cef235b8e0585a586bf13b722e08481201 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Mon, 26 Aug 2024 20:40:55 +0200 Subject: [PATCH 387/845] Suppress unnecessary Roslyn complaints about spacing --- .editorconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.editorconfig b/.editorconfig index 5432624a17..f4874fecc7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -331,6 +331,10 @@ resharper_parentheses_redundancy_style = remove_if_not_clarifies_precedence dotnet_analyzer_diagnostic.category-roslynator.severity = error +# Purpose: Remove trailing white-space +# Reason: It also complains about this when pressing enter to start a new empty line. +dotnet_diagnostic.RCS1037.severity = none + # Remove suffix 'Async' from non-asynchronous method name. Disabled because we like that suffix for now. dotnet_diagnostic.RCS1047.severity = none From 9352c269e039d588e9e59f7d8a00315d255ae73e Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Mon, 26 Aug 2024 20:41:36 +0200 Subject: [PATCH 388/845] Various internal naming improvements. --- Src/FluentAssertions/AndConstraint.cs | 8 +++--- .../GenericCollectionAssertions.cs | 2 +- .../GenericDictionaryAssertions.cs | 2 +- .../Collections/StringCollectionAssertions.cs | 2 +- .../Equivalency/EquivalencyStep.cs | 2 +- .../Equivalency/Steps/AssertionResultSet.cs | 2 +- .../Steps/EnumerableEquivalencyValidator.cs | 2 +- .../Execution/AssertionScope.cs | 12 ++++---- ...tDataItems.cs => ContextDataDictionary.cs} | 28 +++++++------------ .../Execution/MessageBuilder.cs | 4 +-- .../Formatting/FormattedObjectGraph.cs | 14 +++------- .../Specialized/ExceptionAssertions.cs | 2 +- 12 files changed, 33 insertions(+), 47 deletions(-) rename Src/FluentAssertions/Execution/{ContextDataItems.cs => ContextDataDictionary.cs} (67%) diff --git a/Src/FluentAssertions/AndConstraint.cs b/Src/FluentAssertions/AndConstraint.cs index 00d94c8410..796336bd30 100644 --- a/Src/FluentAssertions/AndConstraint.cs +++ b/Src/FluentAssertions/AndConstraint.cs @@ -3,15 +3,15 @@ namespace FluentAssertions; [DebuggerNonUserCode] -public class AndConstraint +public class AndConstraint { - public T And { get; } + public TParent And { get; } /// /// Initializes a new instance of the class. /// - public AndConstraint(T parentConstraint) + public AndConstraint(TParent parent) { - And = parentConstraint; + And = parent; } } diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index fe91b27c0f..3c33ae9a28 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs index c31e6f4af8..765a90f2ad 100644 --- a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs index 2779fdf042..82e4498f3c 100644 --- a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; diff --git a/Src/FluentAssertions/Equivalency/EquivalencyStep.cs b/Src/FluentAssertions/Equivalency/EquivalencyStep.cs index 52d5666eea..d50c77023a 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyStep.cs @@ -1,4 +1,4 @@ -namespace FluentAssertions.Equivalency; +namespace FluentAssertions.Equivalency; /// /// Convenient implementation of that will only invoke diff --git a/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs b/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs index c6ea007df9..b1b9b7cfe2 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs @@ -29,7 +29,7 @@ public void AddSet(object key, string[] failures) /// The closest match is the set that contains the least amount of failures, or no failures at all, and preferably /// the set that is identified by the . /// - public string[] SelectClosestMatchFor(object key = null) + public string[] GetTheFailuresForTheSetWithTheFewestFailures(object key = null) { if (ContainsSuccessfulSet()) { diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs index 71de9e6657..3a58151a4c 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs @@ -183,7 +183,7 @@ private bool LooselyMatchAgainst(IList subjects, T expectation, int e unmatchedSubjectIndexes.RemoveAt(indexToBeRemoved); } - foreach (string failure in results.SelectClosestMatchFor(expectationIndex)) + foreach (string failure in results.GetTheFailuresForTheSetWithTheFewestFailures(expectationIndex)) { AssertionScope.Current.AddPreFormattedFailure(failure); } diff --git a/Src/FluentAssertions/Execution/AssertionScope.cs b/Src/FluentAssertions/Execution/AssertionScope.cs index d18ed54d38..2b70d559c7 100644 --- a/Src/FluentAssertions/Execution/AssertionScope.cs +++ b/Src/FluentAssertions/Execution/AssertionScope.cs @@ -22,7 +22,7 @@ public sealed class AssertionScope : IAssertionScope #region Private Definitions private readonly IAssertionStrategy assertionStrategy; - private readonly ContextDataItems contextData = new(); + private readonly ContextDataDictionary contextData = new(); private readonly StringBuilder tracing = new(); private Func reason; @@ -219,8 +219,8 @@ public AssertionScope WithExpectation(string message, params object[] args) internal void TrackComparands(object subject, object expectation) { - contextData.Add(new ContextDataItems.DataItem("subject", subject, reportable: false, requiresFormatting: true)); - contextData.Add(new ContextDataItems.DataItem("expectation", expectation, reportable: false, requiresFormatting: true)); + contextData.Add(new ContextDataDictionary.DataItem("subject", subject, reportable: false, requiresFormatting: true)); + contextData.Add(new ContextDataDictionary.DataItem("expectation", expectation, reportable: false, requiresFormatting: true)); } /// @@ -359,7 +359,7 @@ public void AppendTracing(string tracingBlock) /// public void AddNonReportable(string key, object value) { - contextData.Add(new ContextDataItems.DataItem(key, value, reportable: false, requiresFormatting: false)); + contextData.Add(new ContextDataDictionary.DataItem(key, value, reportable: false, requiresFormatting: false)); } /// @@ -368,7 +368,7 @@ public void AddNonReportable(string key, object value) /// public void AddReportable(string key, string value) { - contextData.Add(new ContextDataItems.DataItem(key, value, reportable: true, requiresFormatting: false)); + contextData.Add(new ContextDataDictionary.DataItem(key, value, reportable: true, requiresFormatting: false)); } /// @@ -377,7 +377,7 @@ public void AddReportable(string key, string value) /// public void AddReportable(string key, Func valueFunc) { - contextData.Add(new ContextDataItems.DataItem(key, new DeferredReportable(valueFunc), reportable: true, + contextData.Add(new ContextDataDictionary.DataItem(key, new DeferredReportable(valueFunc), reportable: true, requiresFormatting: false)); } diff --git a/Src/FluentAssertions/Execution/ContextDataItems.cs b/Src/FluentAssertions/Execution/ContextDataDictionary.cs similarity index 67% rename from Src/FluentAssertions/Execution/ContextDataItems.cs rename to Src/FluentAssertions/Execution/ContextDataDictionary.cs index 6ddf42eba4..8a079f6240 100644 --- a/Src/FluentAssertions/Execution/ContextDataItems.cs +++ b/Src/FluentAssertions/Execution/ContextDataDictionary.cs @@ -7,7 +7,7 @@ namespace FluentAssertions.Execution; /// /// Represents a collection of data items that are associated with an . /// -internal class ContextDataItems +internal class ContextDataDictionary { private readonly List items = []; @@ -33,9 +33,9 @@ public string AsStringOrDefault(string key) return null; } - public void Add(ContextDataItems contextDataItems) + public void Add(ContextDataDictionary contextDataDictionary) { - foreach (DataItem item in contextDataItems.items) + foreach (DataItem item in contextDataDictionary.items) { Add(item.Clone()); } @@ -61,28 +61,20 @@ public T Get(string key) return (T)(item?.Value ?? default(T)); } - internal class DataItem + internal class DataItem(string key, object value, bool reportable, bool requiresFormatting) { - public DataItem(string key, object value, bool reportable, bool requiresFormatting) - { - Key = key; - Value = value; - Reportable = reportable; - RequiresFormatting = requiresFormatting; - } - - public string Key { get; } + public string Key { get; } = key; - public object Value { get; } + public object Value { get; } = value; - public bool Reportable { get; } + public bool Reportable { get; } = reportable; - public bool RequiresFormatting { get; } + public bool RequiresFormatting { get; } = requiresFormatting; public DataItem Clone() { - object value = Value is ICloneable2 cloneable ? cloneable.Clone() : Value; - return new DataItem(Key, value, Reportable, RequiresFormatting); + object clone = Value is ICloneable2 cloneable ? cloneable.Clone() : Value; + return new DataItem(Key, clone, Reportable, RequiresFormatting); } } } diff --git a/Src/FluentAssertions/Execution/MessageBuilder.cs b/Src/FluentAssertions/Execution/MessageBuilder.cs index faecdcb59b..65460111f5 100644 --- a/Src/FluentAssertions/Execution/MessageBuilder.cs +++ b/Src/FluentAssertions/Execution/MessageBuilder.cs @@ -30,7 +30,7 @@ public MessageBuilder(FormattingOptions formattingOptions) } // SMELL: Too many parameters. - public string Build(string message, object[] messageArgs, string reason, ContextDataItems contextData, string identifier, + public string Build(string message, object[] messageArgs, string reason, ContextDataDictionary contextData, string identifier, string fallbackIdentifier) { message = message.Replace("{reason}", SanitizeReason(reason), StringComparison.Ordinal); @@ -75,7 +75,7 @@ private static string SubstituteIdentifier(string message, string identifier, st return message.TrimStart(); } - private static string SubstituteContextualTags(string message, ContextDataItems contextData) + private static string SubstituteContextualTags(string message, ContextDataDictionary contextData) { const string pattern = @"(?[a-z|A-Z]+)(?:\:(?[a-z|A-Z|\s]+))?\}(?!\})"; diff --git a/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs b/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs index 750646ce27..3f5ba3550e 100644 --- a/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs +++ b/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs @@ -15,19 +15,13 @@ namespace FluentAssertions.Formatting; /// to the maximum number of lines provided through its constructor. It will throw /// a if the number of lines exceeds the maximum. /// -public class FormattedObjectGraph +public class FormattedObjectGraph(int maxLines) { - private readonly int maxLines; private readonly List lines = []; private readonly StringBuilder lineBuilder = new(); private int indentation; private string lineBuilderWhitespace = string.Empty; - public FormattedObjectGraph(int maxLines) - { - this.maxLines = maxLines; - } - /// /// The number of spaces that should be used by every indentation level. /// @@ -57,7 +51,7 @@ public void AddLine(string line) { FlushCurrentLine(); - AppendSafely(Whitespace + line); + AppendWithoutExceedingMaximumLines(Whitespace + line); } /// @@ -101,14 +95,14 @@ private void FlushCurrentLine() { if (lineBuilder.Length > 0) { - AppendSafely($"{lineBuilderWhitespace}{lineBuilder}"); + AppendWithoutExceedingMaximumLines($"{lineBuilderWhitespace}{lineBuilder}"); lineBuilder.Clear(); lineBuilderWhitespace = Whitespace; } } - private void AppendSafely(string line) + private void AppendWithoutExceedingMaximumLines(string line) { if (lines.Count == maxLines) { diff --git a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs index c929bc330a..3cec526e9a 100644 --- a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs @@ -285,7 +285,7 @@ public static void Execute(IEnumerable messages, string expectation, [St } } - foreach (string failure in results.SelectClosestMatchFor()) + foreach (string failure in results.GetTheFailuresForTheSetWithTheFewestFailures()) { string replacedCurlyBraces = failure.EscapePlaceholders(); From 33f3f71746c9a1523609911a64b0eff962fbd82b Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Mon, 26 Aug 2024 20:42:04 +0200 Subject: [PATCH 389/845] Accept API changes --- .../FluentAssertions/net47.verified.txt | 104 +++++------------- .../FluentAssertions/net6.0.verified.txt | 104 +++++------------- .../netstandard2.0.verified.txt | 104 +++++------------- .../netstandard2.1.verified.txt | 104 +++++------------- 4 files changed, 120 insertions(+), 296 deletions(-) diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 191d0a02da..ce88279d5e 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -10,10 +10,10 @@ namespace FluentAssertions public System.Collections.Generic.IEnumerable OfType(System.Exception actualException) where T : System.Exception { } } - public class AndConstraint + public class AndConstraint { - public AndConstraint(T parentConstraint) { } - public T And { get; } + public AndConstraint(TParent parent) { } + public TParent And { get; } } public class AndWhichConstraint : FluentAssertions.AndConstraint { @@ -699,13 +699,13 @@ namespace FluentAssertions.Equivalency public enum EquivalencyResult { ContinueWithNext = 0, - AssertionCompleted = 1, + EquivalencyProven = 1, } public abstract class EquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { protected EquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator); + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested); } public class EquivalencyValidationContext : FluentAssertions.Equivalency.IEquivalencyValidationContext { @@ -722,23 +722,11 @@ namespace FluentAssertions.Equivalency public bool IsCyclicReference(object expectation) { } public override string ToString() { } } - public class EquivalencyValidator : FluentAssertions.Equivalency.IEquivalencyValidator + public class EquivalencyValidator : FluentAssertions.Equivalency.IValidateChildNodeEquivalency { public EquivalencyValidator() { } public void AssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.EquivalencyValidationContext context) { } - public void RecursivelyAssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context) { } - } - public class Field : FluentAssertions.Equivalency.Node, FluentAssertions.Equivalency.IMember, FluentAssertions.Equivalency.INode - { - public Field(System.Reflection.FieldInfo fieldInfo, FluentAssertions.Equivalency.INode parent) { } - public Field(System.Type reflectedType, System.Reflection.FieldInfo fieldInfo, FluentAssertions.Equivalency.INode parent) { } - public System.Type DeclaringType { get; set; } - public override string Description { get; } - public FluentAssertions.Common.CSharpAccessModifier GetterAccessibility { get; } - public bool IsBrowsable { get; } - public System.Type ReflectedType { get; } - public FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } - public object GetValue(object obj) { } + public void AssertEquivalencyOf(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context) { } } public delegate string GetSubjectId(); public interface IAssertionContext @@ -775,7 +763,7 @@ namespace FluentAssertions.Equivalency } public interface IEquivalencyStep { - FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator); + FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes); } public interface IEquivalencyValidationContext { @@ -789,10 +777,6 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.IEquivalencyValidationContext Clone(); bool IsCyclicReference(object expectation); } - public interface IEquivalencyValidator - { - void RecursivelyAssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context); - } public interface IMember : FluentAssertions.Equivalency.INode { System.Type DeclaringType { get; } @@ -846,6 +830,10 @@ namespace FluentAssertions.Equivalency { FluentAssertions.Equivalency.OrderStrictness Evaluate(FluentAssertions.Equivalency.IObjectInfo objectInfo); } + public interface IValidateChildNodeEquivalency + { + void AssertEquivalencyOf(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context); + } public static class MemberFactory { public static FluentAssertions.Equivalency.IMember Create(System.Reflection.MemberInfo memberInfo, FluentAssertions.Equivalency.INode parent) { } @@ -870,26 +858,6 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Equivalency.EquivalencyOptions Exclude(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.NestedExclusionOptionBuilder For(System.Linq.Expressions.Expression>> expression) { } } - public class Node : FluentAssertions.Equivalency.INode - { - public Node() { } - public int Depth { get; } - public virtual string Description { get; } - public FluentAssertions.Equivalency.GetSubjectId GetSubjectId { get; set; } - public bool IsRoot { get; } - public string Name { get; set; } - public System.Type ParentType { get; set; } - public string Path { get; set; } - public string PathAndName { get; } - public bool RootIsCollection { get; set; } - public System.Type Type { get; set; } - public override bool Equals(object obj) { } - public override int GetHashCode() { } - public override string ToString() { } - public static FluentAssertions.Equivalency.INode From(FluentAssertions.Equivalency.GetSubjectId getSubjectId) { } - public static FluentAssertions.Equivalency.INode FromCollectionItem(string index, FluentAssertions.Equivalency.INode parent) { } - public static FluentAssertions.Equivalency.INode FromDictionaryItem(object key, FluentAssertions.Equivalency.INode parent) { } - } public enum OrderStrictness { Strict = 0, @@ -904,18 +872,6 @@ namespace FluentAssertions.Equivalency public System.Collections.Generic.IEnumerator GetEnumerator() { } public bool IsOrderingStrictFor(FluentAssertions.Equivalency.IObjectInfo objectInfo) { } } - public class Property : FluentAssertions.Equivalency.Node, FluentAssertions.Equivalency.IMember, FluentAssertions.Equivalency.INode - { - public Property(System.Reflection.PropertyInfo propertyInfo, FluentAssertions.Equivalency.INode parent) { } - public Property(System.Type reflectedType, System.Reflection.PropertyInfo propertyInfo, FluentAssertions.Equivalency.INode parent) { } - public System.Type DeclaringType { get; } - public override string Description { get; } - public FluentAssertions.Common.CSharpAccessModifier GetterAccessibility { get; } - public bool IsBrowsable { get; } - public System.Type ReflectedType { get; } - public FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } - public object GetValue(object obj) { } - } public abstract class SelfReferenceEquivalencyOptions : FluentAssertions.Equivalency.IEquivalencyOptions where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { @@ -1004,90 +960,90 @@ namespace FluentAssertions.Equivalency.Steps public class AssertionRuleEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public AssertionRuleEquivalencyStep(System.Linq.Expressions.Expression> predicate, System.Action> assertion) { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } public class AutoConversionStep : FluentAssertions.Equivalency.IEquivalencyStep { public AutoConversionStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } } public class EnumEqualityStep : FluentAssertions.Equivalency.IEquivalencyStep { public EnumEqualityStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class EnumerableEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public EnumerableEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class EqualityComparerEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public EqualityComparerEquivalencyStep(System.Collections.Generic.IEqualityComparer comparer) { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } public class GenericDictionaryEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public GenericDictionaryEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class GenericEnumerableEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public GenericEnumerableEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class ReferenceEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public ReferenceEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class RunAllUserStepsEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public RunAllUserStepsEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class SimpleEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public SimpleEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class StringEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public StringEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class StructuralEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public StructuralEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class ValueTypeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public ValueTypeEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class XAttributeEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XAttributeEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } } public class XDocumentEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XDocumentEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } } public class XElementEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XElementEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } } } namespace FluentAssertions.Equivalency.Tracing diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 6e36debe39..c9ad572ad9 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -10,10 +10,10 @@ namespace FluentAssertions public System.Collections.Generic.IEnumerable OfType(System.Exception actualException) where T : System.Exception { } } - public class AndConstraint + public class AndConstraint { - public AndConstraint(T parentConstraint) { } - public T And { get; } + public AndConstraint(TParent parent) { } + public TParent And { get; } } public class AndWhichConstraint : FluentAssertions.AndConstraint { @@ -712,13 +712,13 @@ namespace FluentAssertions.Equivalency public enum EquivalencyResult { ContinueWithNext = 0, - AssertionCompleted = 1, + EquivalencyProven = 1, } public abstract class EquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { protected EquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator); + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested); } public class EquivalencyValidationContext : FluentAssertions.Equivalency.IEquivalencyValidationContext { @@ -735,23 +735,11 @@ namespace FluentAssertions.Equivalency public bool IsCyclicReference(object expectation) { } public override string ToString() { } } - public class EquivalencyValidator : FluentAssertions.Equivalency.IEquivalencyValidator + public class EquivalencyValidator : FluentAssertions.Equivalency.IValidateChildNodeEquivalency { public EquivalencyValidator() { } public void AssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.EquivalencyValidationContext context) { } - public void RecursivelyAssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context) { } - } - public class Field : FluentAssertions.Equivalency.Node, FluentAssertions.Equivalency.IMember, FluentAssertions.Equivalency.INode - { - public Field(System.Reflection.FieldInfo fieldInfo, FluentAssertions.Equivalency.INode parent) { } - public Field(System.Type reflectedType, System.Reflection.FieldInfo fieldInfo, FluentAssertions.Equivalency.INode parent) { } - public System.Type DeclaringType { get; set; } - public override string Description { get; } - public FluentAssertions.Common.CSharpAccessModifier GetterAccessibility { get; } - public bool IsBrowsable { get; } - public System.Type ReflectedType { get; } - public FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } - public object GetValue(object obj) { } + public void AssertEquivalencyOf(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context) { } } public delegate string GetSubjectId(); public interface IAssertionContext @@ -788,7 +776,7 @@ namespace FluentAssertions.Equivalency } public interface IEquivalencyStep { - FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator); + FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes); } public interface IEquivalencyValidationContext { @@ -802,10 +790,6 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.IEquivalencyValidationContext Clone(); bool IsCyclicReference(object expectation); } - public interface IEquivalencyValidator - { - void RecursivelyAssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context); - } public interface IMember : FluentAssertions.Equivalency.INode { System.Type DeclaringType { get; } @@ -859,6 +843,10 @@ namespace FluentAssertions.Equivalency { FluentAssertions.Equivalency.OrderStrictness Evaluate(FluentAssertions.Equivalency.IObjectInfo objectInfo); } + public interface IValidateChildNodeEquivalency + { + void AssertEquivalencyOf(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context); + } public static class MemberFactory { public static FluentAssertions.Equivalency.IMember Create(System.Reflection.MemberInfo memberInfo, FluentAssertions.Equivalency.INode parent) { } @@ -883,26 +871,6 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Equivalency.EquivalencyOptions Exclude(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.NestedExclusionOptionBuilder For(System.Linq.Expressions.Expression>> expression) { } } - public class Node : FluentAssertions.Equivalency.INode - { - public Node() { } - public int Depth { get; } - public virtual string Description { get; } - public FluentAssertions.Equivalency.GetSubjectId GetSubjectId { get; set; } - public bool IsRoot { get; } - public string Name { get; set; } - public System.Type ParentType { get; set; } - public string Path { get; set; } - public string PathAndName { get; } - public bool RootIsCollection { get; set; } - public System.Type Type { get; set; } - public override bool Equals(object obj) { } - public override int GetHashCode() { } - public override string ToString() { } - public static FluentAssertions.Equivalency.INode From(FluentAssertions.Equivalency.GetSubjectId getSubjectId) { } - public static FluentAssertions.Equivalency.INode FromCollectionItem(string index, FluentAssertions.Equivalency.INode parent) { } - public static FluentAssertions.Equivalency.INode FromDictionaryItem(object key, FluentAssertions.Equivalency.INode parent) { } - } public enum OrderStrictness { Strict = 0, @@ -917,18 +885,6 @@ namespace FluentAssertions.Equivalency public System.Collections.Generic.IEnumerator GetEnumerator() { } public bool IsOrderingStrictFor(FluentAssertions.Equivalency.IObjectInfo objectInfo) { } } - public class Property : FluentAssertions.Equivalency.Node, FluentAssertions.Equivalency.IMember, FluentAssertions.Equivalency.INode - { - public Property(System.Reflection.PropertyInfo propertyInfo, FluentAssertions.Equivalency.INode parent) { } - public Property(System.Type reflectedType, System.Reflection.PropertyInfo propertyInfo, FluentAssertions.Equivalency.INode parent) { } - public System.Type DeclaringType { get; } - public override string Description { get; } - public FluentAssertions.Common.CSharpAccessModifier GetterAccessibility { get; } - public bool IsBrowsable { get; } - public System.Type ReflectedType { get; } - public FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } - public object GetValue(object obj) { } - } public abstract class SelfReferenceEquivalencyOptions : FluentAssertions.Equivalency.IEquivalencyOptions where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { @@ -1017,90 +973,90 @@ namespace FluentAssertions.Equivalency.Steps public class AssertionRuleEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public AssertionRuleEquivalencyStep(System.Linq.Expressions.Expression> predicate, System.Action> assertion) { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } public class AutoConversionStep : FluentAssertions.Equivalency.IEquivalencyStep { public AutoConversionStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } } public class EnumEqualityStep : FluentAssertions.Equivalency.IEquivalencyStep { public EnumEqualityStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class EnumerableEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public EnumerableEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class EqualityComparerEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public EqualityComparerEquivalencyStep(System.Collections.Generic.IEqualityComparer comparer) { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } public class GenericDictionaryEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public GenericDictionaryEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class GenericEnumerableEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public GenericEnumerableEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class ReferenceEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public ReferenceEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class RunAllUserStepsEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public RunAllUserStepsEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class SimpleEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public SimpleEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class StringEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public StringEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class StructuralEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public StructuralEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class ValueTypeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public ValueTypeEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class XAttributeEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XAttributeEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } } public class XDocumentEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XDocumentEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } } public class XElementEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XElementEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } } } namespace FluentAssertions.Equivalency.Tracing diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 21f5f869f2..1de3630d79 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -10,10 +10,10 @@ namespace FluentAssertions public System.Collections.Generic.IEnumerable OfType(System.Exception actualException) where T : System.Exception { } } - public class AndConstraint + public class AndConstraint { - public AndConstraint(T parentConstraint) { } - public T And { get; } + public AndConstraint(TParent parent) { } + public TParent And { get; } } public class AndWhichConstraint : FluentAssertions.AndConstraint { @@ -691,13 +691,13 @@ namespace FluentAssertions.Equivalency public enum EquivalencyResult { ContinueWithNext = 0, - AssertionCompleted = 1, + EquivalencyProven = 1, } public abstract class EquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { protected EquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator); + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested); } public class EquivalencyValidationContext : FluentAssertions.Equivalency.IEquivalencyValidationContext { @@ -714,23 +714,11 @@ namespace FluentAssertions.Equivalency public bool IsCyclicReference(object expectation) { } public override string ToString() { } } - public class EquivalencyValidator : FluentAssertions.Equivalency.IEquivalencyValidator + public class EquivalencyValidator : FluentAssertions.Equivalency.IValidateChildNodeEquivalency { public EquivalencyValidator() { } public void AssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.EquivalencyValidationContext context) { } - public void RecursivelyAssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context) { } - } - public class Field : FluentAssertions.Equivalency.Node, FluentAssertions.Equivalency.IMember, FluentAssertions.Equivalency.INode - { - public Field(System.Reflection.FieldInfo fieldInfo, FluentAssertions.Equivalency.INode parent) { } - public Field(System.Type reflectedType, System.Reflection.FieldInfo fieldInfo, FluentAssertions.Equivalency.INode parent) { } - public System.Type DeclaringType { get; set; } - public override string Description { get; } - public FluentAssertions.Common.CSharpAccessModifier GetterAccessibility { get; } - public bool IsBrowsable { get; } - public System.Type ReflectedType { get; } - public FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } - public object GetValue(object obj) { } + public void AssertEquivalencyOf(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context) { } } public delegate string GetSubjectId(); public interface IAssertionContext @@ -767,7 +755,7 @@ namespace FluentAssertions.Equivalency } public interface IEquivalencyStep { - FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator); + FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes); } public interface IEquivalencyValidationContext { @@ -781,10 +769,6 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.IEquivalencyValidationContext Clone(); bool IsCyclicReference(object expectation); } - public interface IEquivalencyValidator - { - void RecursivelyAssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context); - } public interface IMember : FluentAssertions.Equivalency.INode { System.Type DeclaringType { get; } @@ -838,6 +822,10 @@ namespace FluentAssertions.Equivalency { FluentAssertions.Equivalency.OrderStrictness Evaluate(FluentAssertions.Equivalency.IObjectInfo objectInfo); } + public interface IValidateChildNodeEquivalency + { + void AssertEquivalencyOf(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context); + } public static class MemberFactory { public static FluentAssertions.Equivalency.IMember Create(System.Reflection.MemberInfo memberInfo, FluentAssertions.Equivalency.INode parent) { } @@ -862,26 +850,6 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Equivalency.EquivalencyOptions Exclude(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.NestedExclusionOptionBuilder For(System.Linq.Expressions.Expression>> expression) { } } - public class Node : FluentAssertions.Equivalency.INode - { - public Node() { } - public int Depth { get; } - public virtual string Description { get; } - public FluentAssertions.Equivalency.GetSubjectId GetSubjectId { get; set; } - public bool IsRoot { get; } - public string Name { get; set; } - public System.Type ParentType { get; set; } - public string Path { get; set; } - public string PathAndName { get; } - public bool RootIsCollection { get; set; } - public System.Type Type { get; set; } - public override bool Equals(object obj) { } - public override int GetHashCode() { } - public override string ToString() { } - public static FluentAssertions.Equivalency.INode From(FluentAssertions.Equivalency.GetSubjectId getSubjectId) { } - public static FluentAssertions.Equivalency.INode FromCollectionItem(string index, FluentAssertions.Equivalency.INode parent) { } - public static FluentAssertions.Equivalency.INode FromDictionaryItem(object key, FluentAssertions.Equivalency.INode parent) { } - } public enum OrderStrictness { Strict = 0, @@ -896,18 +864,6 @@ namespace FluentAssertions.Equivalency public System.Collections.Generic.IEnumerator GetEnumerator() { } public bool IsOrderingStrictFor(FluentAssertions.Equivalency.IObjectInfo objectInfo) { } } - public class Property : FluentAssertions.Equivalency.Node, FluentAssertions.Equivalency.IMember, FluentAssertions.Equivalency.INode - { - public Property(System.Reflection.PropertyInfo propertyInfo, FluentAssertions.Equivalency.INode parent) { } - public Property(System.Type reflectedType, System.Reflection.PropertyInfo propertyInfo, FluentAssertions.Equivalency.INode parent) { } - public System.Type DeclaringType { get; } - public override string Description { get; } - public FluentAssertions.Common.CSharpAccessModifier GetterAccessibility { get; } - public bool IsBrowsable { get; } - public System.Type ReflectedType { get; } - public FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } - public object GetValue(object obj) { } - } public abstract class SelfReferenceEquivalencyOptions : FluentAssertions.Equivalency.IEquivalencyOptions where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { @@ -996,90 +952,90 @@ namespace FluentAssertions.Equivalency.Steps public class AssertionRuleEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public AssertionRuleEquivalencyStep(System.Linq.Expressions.Expression> predicate, System.Action> assertion) { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } public class AutoConversionStep : FluentAssertions.Equivalency.IEquivalencyStep { public AutoConversionStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } } public class EnumEqualityStep : FluentAssertions.Equivalency.IEquivalencyStep { public EnumEqualityStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class EnumerableEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public EnumerableEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class EqualityComparerEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public EqualityComparerEquivalencyStep(System.Collections.Generic.IEqualityComparer comparer) { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } public class GenericDictionaryEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public GenericDictionaryEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class GenericEnumerableEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public GenericEnumerableEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class ReferenceEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public ReferenceEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class RunAllUserStepsEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public RunAllUserStepsEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class SimpleEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public SimpleEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class StringEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public StringEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class StructuralEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public StructuralEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class ValueTypeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public ValueTypeEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class XAttributeEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XAttributeEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } } public class XDocumentEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XDocumentEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } } public class XElementEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XElementEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } } } namespace FluentAssertions.Equivalency.Tracing diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 5e7a1def91..24ab2600ca 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -10,10 +10,10 @@ namespace FluentAssertions public System.Collections.Generic.IEnumerable OfType(System.Exception actualException) where T : System.Exception { } } - public class AndConstraint + public class AndConstraint { - public AndConstraint(T parentConstraint) { } - public T And { get; } + public AndConstraint(TParent parent) { } + public TParent And { get; } } public class AndWhichConstraint : FluentAssertions.AndConstraint { @@ -699,13 +699,13 @@ namespace FluentAssertions.Equivalency public enum EquivalencyResult { ContinueWithNext = 0, - AssertionCompleted = 1, + EquivalencyProven = 1, } public abstract class EquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { protected EquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } - protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator); + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested); } public class EquivalencyValidationContext : FluentAssertions.Equivalency.IEquivalencyValidationContext { @@ -722,23 +722,11 @@ namespace FluentAssertions.Equivalency public bool IsCyclicReference(object expectation) { } public override string ToString() { } } - public class EquivalencyValidator : FluentAssertions.Equivalency.IEquivalencyValidator + public class EquivalencyValidator : FluentAssertions.Equivalency.IValidateChildNodeEquivalency { public EquivalencyValidator() { } public void AssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.EquivalencyValidationContext context) { } - public void RecursivelyAssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context) { } - } - public class Field : FluentAssertions.Equivalency.Node, FluentAssertions.Equivalency.IMember, FluentAssertions.Equivalency.INode - { - public Field(System.Reflection.FieldInfo fieldInfo, FluentAssertions.Equivalency.INode parent) { } - public Field(System.Type reflectedType, System.Reflection.FieldInfo fieldInfo, FluentAssertions.Equivalency.INode parent) { } - public System.Type DeclaringType { get; set; } - public override string Description { get; } - public FluentAssertions.Common.CSharpAccessModifier GetterAccessibility { get; } - public bool IsBrowsable { get; } - public System.Type ReflectedType { get; } - public FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } - public object GetValue(object obj) { } + public void AssertEquivalencyOf(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context) { } } public delegate string GetSubjectId(); public interface IAssertionContext @@ -775,7 +763,7 @@ namespace FluentAssertions.Equivalency } public interface IEquivalencyStep { - FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator); + FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes); } public interface IEquivalencyValidationContext { @@ -789,10 +777,6 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.IEquivalencyValidationContext Clone(); bool IsCyclicReference(object expectation); } - public interface IEquivalencyValidator - { - void RecursivelyAssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context); - } public interface IMember : FluentAssertions.Equivalency.INode { System.Type DeclaringType { get; } @@ -846,6 +830,10 @@ namespace FluentAssertions.Equivalency { FluentAssertions.Equivalency.OrderStrictness Evaluate(FluentAssertions.Equivalency.IObjectInfo objectInfo); } + public interface IValidateChildNodeEquivalency + { + void AssertEquivalencyOf(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context); + } public static class MemberFactory { public static FluentAssertions.Equivalency.IMember Create(System.Reflection.MemberInfo memberInfo, FluentAssertions.Equivalency.INode parent) { } @@ -870,26 +858,6 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Equivalency.EquivalencyOptions Exclude(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.NestedExclusionOptionBuilder For(System.Linq.Expressions.Expression>> expression) { } } - public class Node : FluentAssertions.Equivalency.INode - { - public Node() { } - public int Depth { get; } - public virtual string Description { get; } - public FluentAssertions.Equivalency.GetSubjectId GetSubjectId { get; set; } - public bool IsRoot { get; } - public string Name { get; set; } - public System.Type ParentType { get; set; } - public string Path { get; set; } - public string PathAndName { get; } - public bool RootIsCollection { get; set; } - public System.Type Type { get; set; } - public override bool Equals(object obj) { } - public override int GetHashCode() { } - public override string ToString() { } - public static FluentAssertions.Equivalency.INode From(FluentAssertions.Equivalency.GetSubjectId getSubjectId) { } - public static FluentAssertions.Equivalency.INode FromCollectionItem(string index, FluentAssertions.Equivalency.INode parent) { } - public static FluentAssertions.Equivalency.INode FromDictionaryItem(object key, FluentAssertions.Equivalency.INode parent) { } - } public enum OrderStrictness { Strict = 0, @@ -904,18 +872,6 @@ namespace FluentAssertions.Equivalency public System.Collections.Generic.IEnumerator GetEnumerator() { } public bool IsOrderingStrictFor(FluentAssertions.Equivalency.IObjectInfo objectInfo) { } } - public class Property : FluentAssertions.Equivalency.Node, FluentAssertions.Equivalency.IMember, FluentAssertions.Equivalency.INode - { - public Property(System.Reflection.PropertyInfo propertyInfo, FluentAssertions.Equivalency.INode parent) { } - public Property(System.Type reflectedType, System.Reflection.PropertyInfo propertyInfo, FluentAssertions.Equivalency.INode parent) { } - public System.Type DeclaringType { get; } - public override string Description { get; } - public FluentAssertions.Common.CSharpAccessModifier GetterAccessibility { get; } - public bool IsBrowsable { get; } - public System.Type ReflectedType { get; } - public FluentAssertions.Common.CSharpAccessModifier SetterAccessibility { get; } - public object GetValue(object obj) { } - } public abstract class SelfReferenceEquivalencyOptions : FluentAssertions.Equivalency.IEquivalencyOptions where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { @@ -1004,90 +960,90 @@ namespace FluentAssertions.Equivalency.Steps public class AssertionRuleEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public AssertionRuleEquivalencyStep(System.Linq.Expressions.Expression> predicate, System.Action> assertion) { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } public class AutoConversionStep : FluentAssertions.Equivalency.IEquivalencyStep { public AutoConversionStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } } public class EnumEqualityStep : FluentAssertions.Equivalency.IEquivalencyStep { public EnumEqualityStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class EnumerableEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public EnumerableEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class EqualityComparerEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public EqualityComparerEquivalencyStep(System.Collections.Generic.IEqualityComparer comparer) { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } public class GenericDictionaryEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public GenericDictionaryEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class GenericEnumerableEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public GenericEnumerableEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class ReferenceEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public ReferenceEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class RunAllUserStepsEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public RunAllUserStepsEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class SimpleEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public SimpleEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class StringEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public StringEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class StructuralEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public StructuralEqualityEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class ValueTypeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public ValueTypeEquivalencyStep() { } - public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } public class XAttributeEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XAttributeEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } } public class XDocumentEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XDocumentEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } } public class XElementEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XElementEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IEquivalencyValidator nestedValidator) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } } } namespace FluentAssertions.Equivalency.Tracing From f4fe0c564fd7f8e01fc380bed5109df28b00f9fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:21:48 +0000 Subject: [PATCH 390/845] Bump SharpCompress from 0.37.2 to 0.38.0 Bumps [SharpCompress](https://github.com/adamhathcock/sharpcompress) from 0.37.2 to 0.38.0. - [Release notes](https://github.com/adamhathcock/sharpcompress/releases) - [Commits](https://github.com/adamhathcock/sharpcompress/compare/0.37.2...0.38.0) --- updated-dependencies: - dependency-name: SharpCompress dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 3d16cea21c..03ccbac7f8 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -23,6 +23,6 @@ - + From b936cf8b2871b0d2dc08af4c75c1f7b862b74c0f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:21:29 +0000 Subject: [PATCH 391/845] Bump NUnit from 4.2.1 to 4.2.2 in the nunit group Bumps the nunit group with 1 update: [NUnit](https://github.com/nunit/nunit). Updates `NUnit` from 4.2.1 to 4.2.2 - [Release notes](https://github.com/nunit/nunit/releases) - [Changelog](https://github.com/nunit/nunit/blob/main/CHANGES.md) - [Commits](https://github.com/nunit/nunit/compare/4.2.1...4.2.2) --- updated-dependencies: - dependency-name: NUnit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: nunit ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index d9a238ec41..ca378f7b2a 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 405161fe3f5a54b82be46f755e62b30591e633ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:21:02 +0000 Subject: [PATCH 392/845] Bump the xunit group with 2 updates Bumps the xunit group with 2 updates: [Verify.Xunit](https://github.com/VerifyTests/Verify) and [System.Collections.Immutable](https://github.com/dotnet/runtime). Updates `Verify.Xunit` from 26.2.0 to 26.3.1 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/26.2.0...26.3.1) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 47241203c7..cd20918832 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 0ff6c6ed4b58bf3cc370796ed1d3b4f9f8d3d9ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:59:51 +0000 Subject: [PATCH 393/845] Bump Bogus from 35.6.0 to 35.6.1 Bumps [Bogus](https://github.com/bchavez/Bogus) from 35.6.0 to 35.6.1. - [Release notes](https://github.com/bchavez/Bogus/releases) - [Changelog](https://github.com/bchavez/Bogus/blob/master/HISTORY.md) - [Commits](https://github.com/bchavez/Bogus/compare/v35.6.0...v35.6.1) --- updated-dependencies: - dependency-name: Bogus dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Tests/Benchmarks/Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index 38ad4ca7a6..302951fc31 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -10,7 +10,7 @@ - + From 658dc1adb16556c957fcfea4682ccee6c0fbac8f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:54:48 +0000 Subject: [PATCH 394/845] Bump the xunit group with 2 updates Bumps the xunit group with 2 updates: [Verify.Xunit](https://github.com/VerifyTests/Verify) and [System.Collections.Immutable](https://github.com/dotnet/runtime). Updates `Verify.Xunit` from 26.3.1 to 26.4.2 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/26.3.1...26.4.2) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index cd20918832..79ecee9029 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 19ae497e2dc436669701d659574baf80672e83cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:59:18 +0000 Subject: [PATCH 395/845] Bump Microsoft.NET.Test.Sdk from 17.11.0 to 17.11.1 Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.11.0 to 17.11.1. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.11.0...v17.11.1) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 2 +- Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 79ecee9029..e62f9ef22f 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -5,7 +5,7 @@ - + all diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index e0178b4c9c..20450165b1 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -10,7 +10,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 8048448d2e..401fde2514 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -21,7 +21,7 @@ - + diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index a61b2c7486..c7a6d559af 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -10,7 +10,7 @@ - + diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 0fd33732fd..1f8161eaee 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -21,7 +21,7 @@ - + diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 52bbe886d9..035b4f93fd 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj index 3c316f5613..2751c1d6c9 100644 --- a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj +++ b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index 5fd79c8377..e0618ca84b 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index ca378f7b2a..16a52da02b 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index c1c3b34e17..62662b2799 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 5fb8e387f6..09bbee2b02 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -6,7 +6,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive From 70c9a3941951e8e22e73ac67a30243947c5d96c2 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Wed, 11 Sep 2024 15:37:31 +0200 Subject: [PATCH 396/845] Update NUKE to 8.1.0 --- Build/_build.csproj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 03ccbac7f8..e3711ab625 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -6,6 +6,7 @@ CS0649;CS0169 ..\ ..\ + 8.1.0 OS_WINDOWS @@ -21,8 +22,8 @@ - - + + From 3c831fdda61412a1f69d6dc6a952ad1e01568e2c Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Wed, 11 Sep 2024 15:37:50 +0200 Subject: [PATCH 397/845] Bump nodejs version to 2.17.0 --- NodeVersion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NodeVersion b/NodeVersion index 8b0beab16a..3516580bbb 100644 --- a/NodeVersion +++ b/NodeVersion @@ -1 +1 @@ -20.11.0 +20.17.0 From fd5d918385a7f5302dd66842aca8050af87af566 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Wed, 11 Sep 2024 15:38:44 +0200 Subject: [PATCH 398/845] Use new `.AddUnixSymlink` extension method --- .nuke/build.schema.json | 167 ++++++++++++++++++++-------------------- Build/CustomNpmTasks.cs | 5 +- 2 files changed, 84 insertions(+), 88 deletions(-) diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 8984315e77..09b8a34c49 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -1,61 +1,99 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/build", - "title": "Build Schema", + "properties": { + "Configuration": { + "type": "string", + "description": "The solution configuration to build. Default is 'Debug' (local) or 'CI' (server)", + "enum": [ + "CI", + "Debug" + ] + }, + "GenerateBinLog": { + "type": [ + "boolean", + "null" + ], + "description": "Use this parameter if you encounter build problems in any way, to generate a .binlog file which holds some useful information" + }, + "NuGetApiKey": { + "type": "string", + "description": "The key to push to Nuget", + "default": "Secrets must be entered via 'nuke :secrets [profile]'" + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" + } + }, "definitions": { - "build": { - "type": "object", + "Host": { + "type": "string", + "enum": [ + "AppVeyor", + "AzurePipelines", + "Bamboo", + "Bitbucket", + "Bitrise", + "GitHubActions", + "GitLab", + "Jenkins", + "Rider", + "SpaceAutomation", + "TeamCity", + "Terminal", + "TravisCI", + "VisualStudio", + "VSCode" + ] + }, + "ExecutableTarget": { + "type": "string", + "enum": [ + "ApiChecks", + "CalculateNugetVersion", + "Clean", + "CodeCoverage", + "Compile", + "InstallNode", + "Pack", + "Push", + "Restore", + "SpellCheck", + "TestFrameworks", + "UnitTests", + "UnitTestsNet47", + "UnitTestsNet6OrGreater" + ] + }, + "Verbosity": { + "type": "string", + "description": "", + "enum": [ + "Verbose", + "Normal", + "Minimal", + "Quiet" + ] + }, + "NukeBuild": { "properties": { - "Configuration": { - "type": "string", - "description": "The solution configuration to build. Default is 'Debug' (local) or 'CI' (server)", - "enum": [ - "CI", - "Debug" - ] - }, "Continue": { "type": "boolean", "description": "Indicates to continue a previously failed build attempt" }, - "GenerateBinLog": { - "type": "boolean", - "description": "Use this parameter if you encounter build problems in any way, to generate a .binlog file which holds some useful information" - }, "Help": { "type": "boolean", "description": "Shows the help text for this build assembly" }, "Host": { - "type": "string", "description": "Host for execution. Default is 'automatic'", - "enum": [ - "AppVeyor", - "AzurePipelines", - "Bamboo", - "Bitbucket", - "Bitrise", - "GitHubActions", - "GitLab", - "Jenkins", - "Rider", - "SpaceAutomation", - "TeamCity", - "Terminal", - "TravisCI", - "VisualStudio", - "VSCode" - ] + "$ref": "#/definitions/Host" }, "NoLogo": { "type": "boolean", "description": "Disables displaying the NUKE logo" }, - "NuGetApiKey": { - "type": "string", - "description": "The key to push to Nuget", - "default": "Secrets must be entered via 'nuke :secrets [profile]'" - }, "Partition": { "type": "string", "description": "Partition to use on CI" @@ -79,63 +117,22 @@ "type": "array", "description": "List of targets to be skipped. Empty list skips all dependencies", "items": { - "type": "string", - "enum": [ - "ApiChecks", - "CalculateNugetVersion", - "Clean", - "CodeCoverage", - "Compile", - "InstallNode", - "Pack", - "Push", - "Restore", - "SpellCheck", - "TestFrameworks", - "UnitTests", - "UnitTestsNet47", - "UnitTestsNet6OrGreater" - ] + "$ref": "#/definitions/ExecutableTarget" } }, - "Solution": { - "type": "string", - "description": "Path to a solution file that is automatically loaded" - }, "Target": { "type": "array", "description": "List of targets to be invoked. Default is '{default_target}'", "items": { - "type": "string", - "enum": [ - "ApiChecks", - "CalculateNugetVersion", - "Clean", - "CodeCoverage", - "Compile", - "InstallNode", - "Pack", - "Push", - "Restore", - "SpellCheck", - "TestFrameworks", - "UnitTests", - "UnitTestsNet47", - "UnitTestsNet6OrGreater" - ] + "$ref": "#/definitions/ExecutableTarget" } }, "Verbosity": { - "type": "string", "description": "Logging verbosity during build execution. Default is 'Normal'", - "enum": [ - "Minimal", - "Normal", - "Quiet", - "Verbose" - ] + "$ref": "#/definitions/Verbosity" } } } - } + }, + "$ref": "#/definitions/NukeBuild" } diff --git a/Build/CustomNpmTasks.cs b/Build/CustomNpmTasks.cs index 3f3742a790..61245fc00a 100644 --- a/Build/CustomNpmTasks.cs +++ b/Build/CustomNpmTasks.cs @@ -145,9 +145,8 @@ static void LinkTools() npmExecutable.SetExecutable(); Information("Linking binaries..."); - Tool ln = ToolResolver.GetPathTool("ln"); - ln($"-sf {npmExecutable} npm", workingDirectory: WorkingDirectory); - ln($"-sf {npmNodeModules} node_modules", workingDirectory: WorkingDirectory); + npmExecutable.AddUnixSymlink(WorkingDirectory / "npm", force: true); + npmNodeModules.AddUnixSymlink(WorkingDirectory / "node_modules", force: true); npmExecutable = WorkingDirectory / "npm"; } From cb12b7c7d14c71d9c6647b866f8d600aba2a874e Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Wed, 11 Sep 2024 15:39:25 +0200 Subject: [PATCH 399/845] Also take the current os type into account when looking for cache --- Build/CustomNpmTasks.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Build/CustomNpmTasks.cs b/Build/CustomNpmTasks.cs index 61245fc00a..9b71d312d3 100644 --- a/Build/CustomNpmTasks.cs +++ b/Build/CustomNpmTasks.cs @@ -23,6 +23,8 @@ public static class CustomNpmTasks static string Version; + static Func GetCachedNodeModules; + public static bool HasCachedNodeModules; public static void Initialize(AbsolutePath root) @@ -31,7 +33,7 @@ public static void Initialize(AbsolutePath root) NodeDir = RootDirectory / ".nuke" / "temp"; Version = (RootDirectory / "NodeVersion").ReadAllText().Trim(); - HasCachedNodeModules = NodeDir.GlobFiles($"node*{Version}*/**/node*", $"node*{Version}*/**/npm*").Count != 0; + GetCachedNodeModules = os => NodeDir.GlobFiles($"node*{Version}-{os}*/**/node*", $"node*{Version}-{os}*/**/npm*").Count != 0; } public static void NpmFetchRuntime() @@ -72,6 +74,8 @@ static AbsolutePath DownloadNodeArchive() os = $"{os}-{architecture}"; + HasCachedNodeModules = GetCachedNodeModules(os); + if (!HasCachedNodeModules) { Information($"Fetching node.js ({Version}) for {os}"); From 7d5877459aa8a358faf238050aeaad13d98c31e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 20:40:47 +0200 Subject: [PATCH 400/845] Bump the xunit group with 2 updates (#2760) Bumps the xunit group with 2 updates: [Verify.Xunit](https://github.com/VerifyTests/Verify) and [System.Collections.Immutable](https://github.com/dotnet/runtime). Updates `Verify.Xunit` from 26.4.2 to 26.4.5 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/26.4.2...26.4.5) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index e62f9ef22f..e014f497dd 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 79d0c12f368c936730056c3ec91abb0ca39493bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 14:39:27 +0000 Subject: [PATCH 401/845] Bump Roslynator.Analyzers from 4.12.4 to 4.12.5 Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.12.4 to 4.12.5. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.12.4...v4.12.5) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 73c77aa239..93cb47f296 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 8c0a4ba2edc457e749df300c1678764b3981573c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:18:29 +0000 Subject: [PATCH 402/845] Bump cspell from 8.14.2 to 8.14.4 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.14.2 to 8.14.4. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.14.4/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 300 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 154 insertions(+), 148 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4342e40c5b..658ad648f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,37 +7,38 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.14.2" + "cspell": "^8.14.4" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.14.2.tgz", - "integrity": "sha512-Kv2Utj/RTSxfufGXkkoTZ/3ErCsYWpCijtDFr/FwSsM7mC0PzLpdlcD9xjtgrJO5Kwp7T47iTG21U4Mwddyi8Q==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.14.4.tgz", + "integrity": "sha512-JHZOpCJzN6fPBapBOvoeMxZbr0ZA11ZAkwcqM4w0lKoacbi6TwK8GIYf66hHvwLmMeav75TNXWE6aPTvBLMMqA==", "dependencies": { "@cspell/dict-ada": "^4.0.2", - "@cspell/dict-aws": "^4.0.3", - "@cspell/dict-bash": "^4.1.3", + "@cspell/dict-aws": "^4.0.4", + "@cspell/dict-bash": "^4.1.4", "@cspell/dict-companies": "^3.1.4", - "@cspell/dict-cpp": "^5.1.12", + "@cspell/dict-cpp": "^5.1.16", "@cspell/dict-cryptocurrencies": "^5.0.0", "@cspell/dict-csharp": "^4.0.2", "@cspell/dict-css": "^4.0.13", - "@cspell/dict-dart": "^2.0.3", + "@cspell/dict-dart": "^2.2.1", "@cspell/dict-django": "^4.1.0", "@cspell/dict-docker": "^1.1.7", - "@cspell/dict-dotnet": "^5.0.2", + "@cspell/dict-dotnet": "^5.0.5", "@cspell/dict-elixir": "^4.0.3", "@cspell/dict-en_us": "^4.3.23", "@cspell/dict-en-common-misspellings": "^2.0.4", "@cspell/dict-en-gb": "1.1.33", "@cspell/dict-filetypes": "^3.0.4", + "@cspell/dict-flutter": "^1.0.0", "@cspell/dict-fonts": "^4.0.0", "@cspell/dict-fsharp": "^1.0.1", "@cspell/dict-fullstack": "^3.2.0", "@cspell/dict-gaming-terms": "^1.0.5", "@cspell/dict-git": "^3.0.0", - "@cspell/dict-golang": "^6.0.9", + "@cspell/dict-golang": "^6.0.12", "@cspell/dict-google": "^1.0.1", "@cspell/dict-haskell": "^4.0.1", "@cspell/dict-html": "^4.0.5", @@ -51,20 +52,20 @@ "@cspell/dict-makefile": "^1.0.0", "@cspell/dict-monkeyc": "^1.0.6", "@cspell/dict-node": "^5.0.1", - "@cspell/dict-npm": "^5.0.18", - "@cspell/dict-php": "^4.0.8", - "@cspell/dict-powershell": "^5.0.5", - "@cspell/dict-public-licenses": "^2.0.7", - "@cspell/dict-python": "^4.2.4", + "@cspell/dict-npm": "^5.1.4", + "@cspell/dict-php": "^4.0.10", + "@cspell/dict-powershell": "^5.0.8", + "@cspell/dict-public-licenses": "^2.0.8", + "@cspell/dict-python": "^4.2.6", "@cspell/dict-r": "^2.0.1", - "@cspell/dict-ruby": "^5.0.2", + "@cspell/dict-ruby": "^5.0.3", "@cspell/dict-rust": "^4.0.5", "@cspell/dict-scala": "^5.0.3", - "@cspell/dict-software-terms": "^4.0.6", + "@cspell/dict-software-terms": "^4.1.3", "@cspell/dict-sql": "^2.1.5", "@cspell/dict-svelte": "^1.0.2", "@cspell/dict-swift": "^2.0.1", - "@cspell/dict-terraform": "^1.0.0", + "@cspell/dict-terraform": "^1.0.1", "@cspell/dict-typescript": "^3.1.6", "@cspell/dict-vue": "^3.0.0" }, @@ -73,28 +74,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.14.2.tgz", - "integrity": "sha512-TZavcnNIZKX1xC/GNj80RgFVKHCT4pHT0qm9jCsQFH2QJfyCrUlkEvotKGSQ04lAyCwWg6Enq95qhouF8YbKUQ==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.14.4.tgz", + "integrity": "sha512-gJ6tQbGCNLyHS2iIimMg77as5MMAFv3sxU7W6tjLlZp8htiNZS7fS976g24WbT/hscsTT9Dd0sNHkpo8K3nvVw==", "dependencies": { - "@cspell/cspell-types": "8.14.2" + "@cspell/cspell-types": "8.14.4" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.14.2.tgz", - "integrity": "sha512-aWMoXZAXEre0/M9AYWOW33YyOJZ06i4vvsEpWBDWpHpWQEmsR/7cMMgld8Pp3wlEjIUclUAKTYmrZ61PFWU/og==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.14.4.tgz", + "integrity": "sha512-CLLdouqfrQ4rqdQdPu0Oo+HHCU/oLYoEsK1nNPb28cZTFxnn0cuSPKB6AMPBJmMwdfJ6fMD0BCKNbEe1UNLHcw==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.14.2.tgz", - "integrity": "sha512-pSyBsAvslaN0dx0pHdvECJEuFDDBJGAD6G8U4BVbIyj2OPk0Ox0HrZIj6csYxxoJERAgNO/q7yCPwa4j9NNFXg==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.14.4.tgz", + "integrity": "sha512-s3uZyymJ04yn8+zlTp7Pt1WRSlAel6XVo+iZRxls3LSvIP819KK64DoyjCD2Uon0Vg9P/K7aAPt8GcxDcnJtgA==", "dependencies": { "global-directory": "^4.0.1" }, @@ -103,17 +104,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.14.2.tgz", - "integrity": "sha512-WUF7xf3YgXYIqjmBwLcVugYIrYL4WfXchgSo9rmbbnOcAArzsK+HKfzb4AniZAJ1unxcIQ0JnVlRmnCAKPjjLg==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.14.4.tgz", + "integrity": "sha512-i3UG+ep63akNsDXZrtGgICNF3MLBHtvKe/VOIH6+L+NYaAaVHqqQvOY9MdUwt1HXh8ElzfwfoRp36wc5aAvt6g==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.14.2.tgz", - "integrity": "sha512-MRY8MjBNOKGMDSkxAKueYAgVL43miO+lDcLCBBP+7cNXqHiUFMIZteONcGp3kJT0dWS04dN6lKAXvaNF0aWcng==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.14.4.tgz", + "integrity": "sha512-VXwikqdHgjOVperVVCn2DOe8W3rPIswwZtMHfRYnagpzZo/TOntIjkXPJSfTtl/cFyx5DnCBsDH8ytKGlMeHkw==", "engines": { "node": ">=18" } @@ -124,14 +125,14 @@ "integrity": "sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA==" }, "node_modules/@cspell/dict-aws": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.3.tgz", - "integrity": "sha512-0C0RQ4EM29fH0tIYv+EgDQEum0QI6OrmjENC9u98pB8UcnYxGG/SqinuPxo+TgcEuInj0Q73MsBpJ1l5xUnrsw==" + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.4.tgz", + "integrity": "sha512-6AWI/Kkf+RcX/J81VX8+GKLeTgHWEr/OMhGk3dHQzWK66RaqDJCGDqi7494ghZKcBB7dGa3U5jcKw2FZHL/u3w==" }, "node_modules/@cspell/dict-bash": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.1.3.tgz", - "integrity": "sha512-tOdI3QVJDbQSwPjUkOiQFhYcu2eedmX/PtEpVWg0aFps/r6AyjUQINtTgpqMYnYuq8O1QUIQqnpx21aovcgZCw==" + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.1.4.tgz", + "integrity": "sha512-W/AHoQcJYn3Vn/tUiXX2+6D/bhfzdDshwcbQWv9TdiNlXP9P6UJjDKWbxyA5ogJCsR2D0X9Kx11oV8E58siGKQ==" }, "node_modules/@cspell/dict-companies": { "version": "3.1.4", @@ -159,9 +160,9 @@ "integrity": "sha512-WfOQkqlAJTo8eIQeztaH0N0P+iF5hsJVKFuhy4jmARPISy8Efcv8QXk2/IVbmjJH0/ZV7dKRdnY5JFVXuVz37g==" }, "node_modules/@cspell/dict-dart": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.0.3.tgz", - "integrity": "sha512-cLkwo1KT5CJY5N5RJVHks2genFkNCl/WLfj+0fFjqNR+tk3tBI1LY7ldr9piCtSFSm4x9pO1x6IV3kRUY1lLiw==" + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.2.1.tgz", + "integrity": "sha512-yriKm7QkoPx3JPSSOcw6iX9gOb2N50bOo/wqWviqPYbhpMRh9Xiv6dkUy3+ot+21GuShZazO8X6U5+Vw67XEwg==" }, "node_modules/@cspell/dict-data-science": { "version": "2.0.1", @@ -208,6 +209,11 @@ "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.4.tgz", "integrity": "sha512-IBi8eIVdykoGgIv5wQhOURi5lmCNJq0we6DvqKoPQJHthXbgsuO1qrHSiUVydMiQl/XvcnUWTMeAlVUlUClnVg==" }, + "node_modules/@cspell/dict-flutter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-flutter/-/dict-flutter-1.0.0.tgz", + "integrity": "sha512-W7k1VIc4KeV8BjEBxpA3cqpzbDWjfb7oXkEb0LecBCBp5Z7kcfnjT1YVotTx/U9PGyAOBhDaEdgZACVGNQhayw==" + }, "node_modules/@cspell/dict-fonts": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.0.tgz", @@ -249,9 +255,9 @@ "integrity": "sha512-uRrl65mGrOmwT7NxspB4xKXFUenNC7IikmpRZW8Uzqbqcu7ZRCUfstuVH7T1rmjRgRkjcIjE4PC11luDou4wEQ==" }, "node_modules/@cspell/dict-html": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.5.tgz", - "integrity": "sha512-p0brEnRybzSSWi8sGbuVEf7jSTDmXPx7XhQUb5bgG6b54uj+Z0Qf0V2n8b/LWwIPJNd1GygaO9l8k3HTCy1h4w==" + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.6.tgz", + "integrity": "sha512-cLWHfuOhE4wqwC12up6Doxo2u1xxVhX1A8zriR4CUD+osFQzUIcBK1ykNXppga+rt1WyypaJdTU2eV6OpzYrgQ==" }, "node_modules/@cspell/dict-html-symbol-entities": { "version": "4.0.0", @@ -304,9 +310,9 @@ "integrity": "sha512-lax/jGz9h3Dv83v8LHa5G0bf6wm8YVRMzbjJPG/9rp7cAGPtdrga+XANFq+B7bY5+jiSA3zvj10LUFCFjnnCCg==" }, "node_modules/@cspell/dict-npm": { - "version": "5.0.18", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.18.tgz", - "integrity": "sha512-weMTyxWpzz19q4wv9n183BtFvdD5fCjtze+bFKpl+4rO/YlPhHL2cXLAeexJz/VDSBecwX4ybTZYoknd1h2J4w==" + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.5.tgz", + "integrity": "sha512-oAOGWuJYU3DlO+cAsStKMWN8YEkBue25cRC9EwdiL5Z84nchU20UIoYrLfIQejMlZca+1GyrNeyxRAgn4KiivA==" }, "node_modules/@cspell/dict-php": { "version": "4.0.10", @@ -314,9 +320,9 @@ "integrity": "sha512-NfTZdp6kcZDF1PvgQ6cY0zE4FUO5rSwNmBH/iwCBuaLfJAFQ97rgjxo+D2bic4CFwNjyHutnHPtjJBRANO5XQw==" }, "node_modules/@cspell/dict-powershell": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.6.tgz", - "integrity": "sha512-BSi9tmnT7jgNsH5SaHSg70aw+4YwTjkkZBfhHtin0r6AMV2RaiLzsBPvzZGXOcm0yTvl975HYoKMqflXIlk2RA==" + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.9.tgz", + "integrity": "sha512-Vi0h0rlxS39tgTyUtxI6L3BPHH7MLPkLWCYkNfb/buQuNJYNFdHiF4bqoqVdJ/7ZrfIfNg4i6rzocnwGRn2ruw==" }, "node_modules/@cspell/dict-public-licenses": { "version": "2.0.8", @@ -324,9 +330,9 @@ "integrity": "sha512-Sup+tFS7cDV0fgpoKtUqEZ6+fA/H+XUgBiqQ/Fbs6vUE3WCjJHOIVsP+udHuyMH7iBfJ4UFYOYeORcY4EaKdMg==" }, "node_modules/@cspell/dict-python": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.5.tgz", - "integrity": "sha512-HJ7xY2kg1Lg1lB4zFnniqvICFx8mj5f0Ij42HcRrUt980loFFml/MXnYR8Zn9sPzNyH4AYe1ZyLI/oPHH6TYqA==", + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.6.tgz", + "integrity": "sha512-Hkz399qDGEbfXi9GYa2hDl7GahglI86JmS2F1KP8sfjLXofUgtnknyC5NWc86nzHcP38pZiPqPbTigyDYw5y8A==", "dependencies": { "@cspell/dict-data-science": "^2.0.1" } @@ -352,9 +358,9 @@ "integrity": "sha512-4yGb4AInT99rqprxVNT9TYb1YSpq58Owzq7zi3ZS5T0u899Y4VsxsBiOgHnQ/4W+ygi+sp+oqef8w8nABR2lkg==" }, "node_modules/@cspell/dict-software-terms": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.0.tgz", - "integrity": "sha512-PSnC2kNyg7HBG+neIuFDCH4PETWPkZaFEOvqjfKueoO4Fa3M8nQrYN9jNxAAbdPoL9rxSPdncSvvEnJs1ng/uw==" + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.4.tgz", + "integrity": "sha512-AHS25sYEzWze/aFglp9ODKSu+phjkuGx+OLwIcmOnvyn8axtSq5GCn9UqS4XG1/Qn0UG2Lgb4i5PJbZ0QNPNXQ==" }, "node_modules/@cspell/dict-sql": { "version": "2.1.5", @@ -372,9 +378,9 @@ "integrity": "sha512-gxrCMUOndOk7xZFmXNtkCEeroZRnS2VbeaIPiymGRHj5H+qfTAzAKxtv7jJbVA3YYvEzWcVE2oKDP4wcbhIERw==" }, "node_modules/@cspell/dict-terraform": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.0.0.tgz", - "integrity": "sha512-Ak+vy4HP/bOgzf06BAMC30+ZvL9mzv21xLM2XtfnBLTDJGdxlk/nK0U6QT8VfFLqJ0ZZSpyOxGsUebWDCTr/zQ==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.0.1.tgz", + "integrity": "sha512-29lmUUnZgPh+ieZ5hunick8hzNIpNRtiJh9vAusNskPCrig3RTW6u7F+GG1a8uyslbzSw+Irjf40PTOan1OJJA==" }, "node_modules/@cspell/dict-typescript": { "version": "3.1.6", @@ -387,9 +393,9 @@ "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.14.2.tgz", - "integrity": "sha512-5MbqtIligU7yPwHWU/5yFCgMvur4i1bRAF1Cy8y2dDtHsa204S/w/SaXs+51EFLp2eNbCiBisCBrwJFT7R1RxA==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.14.4.tgz", + "integrity": "sha512-GjKsBJvPXp4dYRqsMn7n1zpnKbnpfJnlKLOVeoFBh8fi4n06G50xYr+G25CWX1WT3WFaALAavvVICEUPrVsuqg==", "dependencies": { "import-meta-resolve": "^4.1.0" }, @@ -398,25 +404,25 @@ } }, "node_modules/@cspell/filetypes": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.14.2.tgz", - "integrity": "sha512-ZevArA0mWeVTTqHicxCPZIAeCibpY3NwWK/x6d1Lgu7RPk/daoGAM546Q2SLChFu+r10tIH7pRG212A6Q9ihPA==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.14.4.tgz", + "integrity": "sha512-qd68dD7xTA4Mnf/wjIKYz2SkiTBshIM+yszOUtLa06YJm0aocoNQ25FHXyYEQYm9NQXCYnRWWA02sFMGs8Sv/w==", "engines": { "node": ">=18" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.14.2.tgz", - "integrity": "sha512-7sRzJc392CQYNNrtdPEfOHJdRqsqf6nASCtbS5A9hL2UrdWQ4uN7r/D+Y1HpuizwY9eOkZvarcFfsYt5wE0Pug==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.14.4.tgz", + "integrity": "sha512-Uyfck64TfVU24wAP3BLGQ5EsAfzIZiLfN90NhttpEM7GlOBmbGrEJd4hNOwfpYsE/TT80eGWQVPRTLr5SDbXFA==", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.14.2.tgz", - "integrity": "sha512-YmWW+B/2XQcCynLpiAQF77Bitm5Cynw3/BICZkbdveKjJkUzEmXB+U2qWuwXOyU8xUYuwkP63YM8McnI567rUA==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.14.4.tgz", + "integrity": "sha512-htHhNF8WrM/NfaLSWuTYw0NqVgFRVHYSyHlRT3i/Yv5xvErld8Gw7C6ldm+0TLjoGlUe6X1VV72JSir7+yLp/Q==", "engines": { "node": ">=18.0" } @@ -562,26 +568,26 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cspell": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.14.2.tgz", - "integrity": "sha512-ii/W7fwO4chNQVYl1C/8k7RW8EXzLb69rvg08p8mSJx8B2UasVJ9tuJpTH2Spo1jX6N3H0dKPWUbd1fAmdAhPg==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.14.4.tgz", + "integrity": "sha512-R5Awb3i/RKaVVcZzFt8dkN3M6VnifIEDYBcbzbmYjZ/Eq+ASF+QTmI0E9WPhMEcFM1nd7YOyXnETo560yRdoKw==", "dependencies": { - "@cspell/cspell-json-reporter": "8.14.2", - "@cspell/cspell-pipe": "8.14.2", - "@cspell/cspell-types": "8.14.2", - "@cspell/dynamic-import": "8.14.2", - "@cspell/url": "8.14.2", + "@cspell/cspell-json-reporter": "8.14.4", + "@cspell/cspell-pipe": "8.14.4", + "@cspell/cspell-types": "8.14.4", + "@cspell/dynamic-import": "8.14.4", + "@cspell/url": "8.14.4", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-dictionary": "8.14.2", - "cspell-gitignore": "8.14.2", - "cspell-glob": "8.14.2", - "cspell-io": "8.14.2", - "cspell-lib": "8.14.2", + "cspell-dictionary": "8.14.4", + "cspell-gitignore": "8.14.4", + "cspell-glob": "8.14.4", + "cspell-io": "8.14.4", + "cspell-lib": "8.14.4", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", - "file-entry-cache": "^9.0.0", + "file-entry-cache": "^9.1.0", "get-stdin": "^9.0.0", "semver": "^7.6.3", "strip-ansi": "^7.1.0" @@ -598,26 +604,26 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.14.2.tgz", - "integrity": "sha512-yHP1BdcH5dbjb8qiZr6+bxEnJ+rxTULQ00wBz3eBPWCghJywEAYYvMWoYuxVtPpndlkKYC1wJAHsyNkweQyepA==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.14.4.tgz", + "integrity": "sha512-cnUeJfniTiebqCaQmIUnbSrPrTH7xzKRQjJDHAEV0WYnOG2MhRXI13OzytdFdhkVBdStmgTzTCJKE7x+kmU2NA==", "dependencies": { - "@cspell/cspell-types": "8.14.2", + "@cspell/cspell-types": "8.14.4", "comment-json": "^4.2.5", - "yaml": "^2.5.0" + "yaml": "^2.5.1" }, "engines": { "node": ">=18" } }, "node_modules/cspell-dictionary": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.14.2.tgz", - "integrity": "sha512-gWuAvf6queGGUvGbfAxxUq55cZ0OevWPbjnCrSB0PpJ4tqdFd8dLcvVrIKzoE2sBXKPw2NDkmoEngs6iGavC0w==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.14.4.tgz", + "integrity": "sha512-pZvQHxpAW5fZAnt3ZKKy3s7M+3CX2t8tCS3uJrpEHIynlCawpG0fPF78rVE5o+g0dON36Lguc/BUuSN4IWKLmQ==", "dependencies": { - "@cspell/cspell-pipe": "8.14.2", - "@cspell/cspell-types": "8.14.2", - "cspell-trie-lib": "8.14.2", + "@cspell/cspell-pipe": "8.14.4", + "@cspell/cspell-types": "8.14.4", + "cspell-trie-lib": "8.14.4", "fast-equals": "^5.0.1" }, "engines": { @@ -625,13 +631,13 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.14.2.tgz", - "integrity": "sha512-lrO/49NaKBpkR7vFxv4OOY+oHmsG5+gNQejrBBWD9Nv9vvjJtz/G36X/rcN6M6tFcQQMWwa01kf04nxz8Ejuhg==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.14.4.tgz", + "integrity": "sha512-RwfQEW5hD7CpYwS7m3b0ONG0nTLKP6bL2tvMdl7qtaYkL7ztGdsBTtLD1pmwqUsCbiN5RuaOxhYOYeRcpFRIkQ==", "dependencies": { - "@cspell/url": "8.14.2", - "cspell-glob": "8.14.2", - "cspell-io": "8.14.2", + "@cspell/url": "8.14.4", + "cspell-glob": "8.14.4", + "cspell-io": "8.14.4", "find-up-simple": "^1.0.0" }, "bin": { @@ -642,24 +648,24 @@ } }, "node_modules/cspell-glob": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.14.2.tgz", - "integrity": "sha512-9Q1Kgoo1ev3fKTpp9y5n8M4RLxd8B0f5o4y5FQe4dBU0j/bt+/YDrLZNWDm77JViV606XQ6fimG1FTTq6pT9/g==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.14.4.tgz", + "integrity": "sha512-C/xTS5nujMRMuguibq92qMVP767mtxrur7DcVolCvpzcivm1RB5NtIN0OctQxTyMbnmKeQv1t4epRKQ9A8vWRg==", "dependencies": { - "@cspell/url": "8.14.2", - "micromatch": "^4.0.7" + "@cspell/url": "8.14.4", + "micromatch": "^4.0.8" }, "engines": { "node": ">=18" } }, "node_modules/cspell-grammar": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.14.2.tgz", - "integrity": "sha512-eYwceVP80FGYVJenE42ALnvEKOXaXjq4yVbb1Ni1umO/9qamLWNCQ1RP6rRACy5e/cXviAbhrQ5Mtw6n+pyPEQ==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.14.4.tgz", + "integrity": "sha512-yaSKAAJDiamsw3FChbw4HXb2RvTQrDsLelh1+T4MavarOIcAxXrqAJ8ysqm++g+S/ooJz2YO8YWIyzJKxcMf8g==", "dependencies": { - "@cspell/cspell-pipe": "8.14.2", - "@cspell/cspell-types": "8.14.2" + "@cspell/cspell-pipe": "8.14.4", + "@cspell/cspell-types": "8.14.4" }, "bin": { "cspell-grammar": "bin.mjs" @@ -669,38 +675,38 @@ } }, "node_modules/cspell-io": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.14.2.tgz", - "integrity": "sha512-uaKpHiY3DAgfdzgKMQml6U8F8o9udMuYxGqYa5FVfN7D5Ap7B2edQzSLTUYwxrFEn4skSfp6XY73+nzJvxzH4Q==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.14.4.tgz", + "integrity": "sha512-o6OTWRyx/Az+PFhr1B0wMAwqG070hFC9g73Fkxd8+rHX0rfRS69QZH7LgSmZytqbZIMxCTDGdsLl33MFGWCbZQ==", "dependencies": { - "@cspell/cspell-service-bus": "8.14.2", - "@cspell/url": "8.14.2" + "@cspell/cspell-service-bus": "8.14.4", + "@cspell/url": "8.14.4" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.14.2.tgz", - "integrity": "sha512-d2oiIXHXnADmnhIuFLOdNE63L7OUfzgpLbYaqAWbkImCUDkevfGrOgnX8TJ03fUgZID4nvQ+3kgu/n2j4eLZjQ==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.14.4.tgz", + "integrity": "sha512-qdkUkKtm+nmgpA4jQbmQTuepDfjHBDWvs3zDuEwVIVFq/h8gnXrRr75gJ3RYdTy+vOOqHPoLLqgxyqkUUrUGXA==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.14.2", - "@cspell/cspell-pipe": "8.14.2", - "@cspell/cspell-resolver": "8.14.2", - "@cspell/cspell-types": "8.14.2", - "@cspell/dynamic-import": "8.14.2", - "@cspell/filetypes": "8.14.2", - "@cspell/strong-weak-map": "8.14.2", - "@cspell/url": "8.14.2", + "@cspell/cspell-bundled-dicts": "8.14.4", + "@cspell/cspell-pipe": "8.14.4", + "@cspell/cspell-resolver": "8.14.4", + "@cspell/cspell-types": "8.14.4", + "@cspell/dynamic-import": "8.14.4", + "@cspell/filetypes": "8.14.4", + "@cspell/strong-weak-map": "8.14.4", + "@cspell/url": "8.14.4", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.14.2", - "cspell-dictionary": "8.14.2", - "cspell-glob": "8.14.2", - "cspell-grammar": "8.14.2", - "cspell-io": "8.14.2", - "cspell-trie-lib": "8.14.2", + "cspell-config-lib": "8.14.4", + "cspell-dictionary": "8.14.4", + "cspell-glob": "8.14.4", + "cspell-grammar": "8.14.4", + "cspell-io": "8.14.4", + "cspell-trie-lib": "8.14.4", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -715,12 +721,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.14.2.tgz", - "integrity": "sha512-rZMbaEBGoyy4/zxKECaMyVyGLbuUxYmZ5jlEgiA3xPtEdWwJ4iWRTo5G6dWbQsXoxPYdAXXZ0/q0GQ2y6Jt0kw==", + "version": "8.14.4", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.14.4.tgz", + "integrity": "sha512-zu8EJ33CH+FA5lwTRGqS//Q6phO0qtgEmODMR1KPlD7WlrfTFMb3bWFsLo/tiv5hjpsn7CM6dYDAAgBOSkoyhQ==", "dependencies": { - "@cspell/cspell-pipe": "8.14.2", - "@cspell/cspell-types": "8.14.2", + "@cspell/cspell-pipe": "8.14.4", + "@cspell/cspell-types": "8.14.4", "gensequence": "^7.0.0" }, "engines": { @@ -790,9 +796,9 @@ } }, "node_modules/file-entry-cache": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-9.0.0.tgz", - "integrity": "sha512-6MgEugi8p2tiUhqO7GnPsmbCCzj0YRCwwaTbpGRyKZesjRSzkqkAE9fPp7V2yMs5hwfgbQLgdvSSkGNg1s5Uvw==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-9.1.0.tgz", + "integrity": "sha512-/pqPFG+FdxWQj+/WSuzXSDaNzxgTLr/OrR1QuqfEZzDakpdYE70PwUxL7BPUa8hpjbvY1+qvCl8k+8Tq34xJgg==", "dependencies": { "flat-cache": "^5.0.0" }, @@ -1157,9 +1163,9 @@ } }, "node_modules/yaml": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz", - "integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", + "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", "bin": { "yaml": "bin.mjs" }, diff --git a/package.json b/package.json index 646f03bee8..443aa36c19 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.14.2" + "cspell": "^8.14.4" } } From 69b58c531b5b62ed6e6beaedbe0c9acb27635146 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:13:58 +0000 Subject: [PATCH 403/845] Bump Meziantou.Analyzer from 2.0.163 to 2.0.168 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.163 to 2.0.168. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.163...2.0.168) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 93cb47f296..4c440e7e7e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 09686577561bcb20ebfbfdd243e6bf5be712c5cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:46:20 +0000 Subject: [PATCH 404/845] Bump JetBrains/qodana-action from 2023.3 to 2024.2 Bumps [JetBrains/qodana-action](https://github.com/jetbrains/qodana-action) from 2023.3 to 2024.2. - [Release notes](https://github.com/jetbrains/qodana-action/releases) - [Commits](https://github.com/jetbrains/qodana-action/compare/v2023.3...v2024.2) --- updated-dependencies: - dependency-name: JetBrains/qodana-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index 8c8478eef9..405f6dddbc 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.merge_commit_sha }} fetch-depth: 0 - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2023.3 + uses: JetBrains/qodana-action@v2024.2 with: upload-result: ${{ github.ref_name == 'master' || github.ref_name == 'develop' }} args: --baseline,qodana.sarif.json,--ide,QDNET From ad2ac4db067d5321470b25b30156fe9d1c1e80c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:10:54 +0000 Subject: [PATCH 405/845] Bump the xunit group with 3 updates Bumps the xunit group with 3 updates: [Verify.Xunit](https://github.com/VerifyTests/Verify), [System.Collections.Immutable](https://github.com/dotnet/runtime) and [xunit](https://github.com/xunit/xunit). Updates `Verify.Xunit` from 26.4.5 to 26.6.0 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/26.4.5...26.6.0) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) Updates `xunit` from 2.9.0 to 2.9.1 - [Commits](https://github.com/xunit/xunit/compare/2.9.0...2.9.1) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 4 ++-- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index e014f497dd..6d52630f11 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -6,14 +6,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 20450165b1..b6d94a2859 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -11,7 +11,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 401fde2514..f09c401df4 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -28,7 +28,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index c7a6d559af..9382f3cc4e 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -18,7 +18,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 1f8161eaee..706c9f993e 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -27,7 +27,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index 62662b2799..7ba386db73 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 09bbee2b02..e901093b73 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -7,7 +7,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From b21e71ef1c3fc686770c59a08714b9efdca7f0c7 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 23 Sep 2024 21:31:43 +0200 Subject: [PATCH 406/845] more xunit updates --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index e3711ab625..43668e90a3 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -20,7 +20,7 @@ - + From e6df4c00d78f783bdc7e80a208d127dce0a0e31c Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 23 Sep 2024 21:31:50 +0200 Subject: [PATCH 407/845] More use of TheoryData --- .../CollectionSpecs.cs | 17 +++++- .../AssertionExtensionsSpecs.cs | 13 ++-- .../GenericDictionaryAssertionSpecs.cs | 19 ++++-- .../Extensions/ObjectExtensionsSpecs.cs | 60 +++++++++++++++---- .../Formatting/EnumerableExtensionsSpecs.cs | 17 +++--- 5 files changed, 90 insertions(+), 36 deletions(-) diff --git a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs index 64e036548d..6bff2fe4fb 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs @@ -2698,7 +2698,9 @@ public void When_two_unordered_lists_contain_null_in_expectation_it_should_throw [Theory] [MemberData(nameof(ArrayTestData))] public void When_two_unordered_lists_contain_empty_objects_they_should_still_be_structurally_equivalent(TActual[] actual, TExpected[] expected) +#pragma warning restore xUnit1039 { // Act Action act = () => actual.Should().BeEquivalentTo(expected); @@ -2725,17 +2727,26 @@ public void When_an_exception_is_thrown_during_data_access_the_stack_trace_conta act.Should().Throw().And.TargetSite.Should().Be(expectedTargetSite); } - public static IEnumerable ArrayTestData() + public static TheoryData ArrayTestData() { var arrays = new object[] { new int?[] { null, 1 }, new int?[] { 1, null }, new object[] { null, 1 }, new object[] { 1, null } }; - return + var pairs = from x in arrays from y in arrays - select new[] { x, y }; + select (x, y); + + var data = new TheoryData(); + + foreach (var (x, y) in pairs) + { + data.Add(x, y); + } + + return data; } [Fact] diff --git a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs index 9ee81a9033..742f82cd18 100644 --- a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs @@ -38,8 +38,8 @@ private static bool OverridesEquals(Type t) return equals is not null; } - public static TheoryData ClassesWithGuardEquals => new() - { + public static TheoryData ClassesWithGuardEquals => + [ new ObjectAssertions(default), new BooleanAssertions(default), new DateTimeAssertions(default), @@ -59,7 +59,7 @@ private static bool OverridesEquals(Type t) new DateOnlyAssertions(default), new TimeOnlyAssertions(default), #endif - }; + ]; [Theory] [MemberData(nameof(ClassesWithGuardEquals))] @@ -174,9 +174,9 @@ public void Should_methods_not_returning_reference_type_assertions_are_not_annot notNullAttribute.Should().BeNull(); } - public static IEnumerable GetShouldMethods(bool referenceTypes) + public static TheoryData GetShouldMethods(bool referenceTypes) { - return AllTypes.From(typeof(FluentAssertions.AssertionExtensions).Assembly) + return new(AllTypes.From(typeof(FluentAssertions.AssertionExtensions).Assembly) .ThatAreClasses() .ThatAreStatic() .Where(t => t.IsPublic) @@ -184,8 +184,7 @@ public static IEnumerable GetShouldMethods(bool referenceTypes) .Where(m => m.Name == "Should" && !IsGuardOverload(m) && m.GetParameters().Length == 1 - && (referenceTypes ? ReturnsReferenceTypeAssertions(m) : !ReturnsReferenceTypeAssertions(m))) - .Select(m => new object[] { m }); + && (referenceTypes ? ReturnsReferenceTypeAssertions(m) : !ReturnsReferenceTypeAssertions(m)))); } private static bool ReturnsReferenceTypeAssertions(MethodInfo m) => diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.cs index 51b013d7fb..66a931ac13 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.cs @@ -130,8 +130,8 @@ public void When_comparing_dictionary_like_collections_for_inequality_it_should_ act.Should().Throw(); } - public static IEnumerable SingleDictionaryData() => - Dictionaries().Select(x => new[] { x }); + public static TheoryData SingleDictionaryData() => + new(Dictionaries()); public static object[] Dictionaries() { @@ -143,12 +143,21 @@ public static object[] Dictionaries() ]; } - public static IEnumerable DictionariesData() + public static TheoryData DictionariesData() { - return + var pairs = from x in Dictionaries() from y in Dictionaries() - select new[] { x, y }; + select (x, y); + + var data = new TheoryData(); + + foreach (var (x, y) in pairs) + { + data.Add(x, y); + } + + return data; } } diff --git a/Tests/FluentAssertions.Specs/Extensions/ObjectExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/Extensions/ObjectExtensionsSpecs.cs index 7c9bd2b1a7..ccd0da5592 100644 --- a/Tests/FluentAssertions.Specs/Extensions/ObjectExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Extensions/ObjectExtensionsSpecs.cs @@ -56,12 +56,21 @@ public void When_comparing_a_numeric_to_a_numeric_it_should_succeed(object actua success.Should().BeTrue(); } - public static IEnumerable GetNumericAndNumericData() + public static TheoryData GetNumericAndNumericData() { - return + var pairs = from x in GetNumericIConvertibles() from y in GetNumericIConvertibles() - select new[] { x, y }; + select (x, y); + + var data = new TheoryData(); + + foreach (var (x, y) in pairs) + { + data.Add(x, y); + } + + return data; } [Theory] @@ -78,12 +87,21 @@ public void When_comparing_a_non_numeric_to_a_numeric_it_should_fail(object actu success.Should().BeFalse(); } - public static IEnumerable GetNonNumericAndNumericData() + public static TheoryData GetNonNumericAndNumericData() { - return + var pairs = from x in GetNonNumericIConvertibles() from y in GetNumericIConvertibles() - select new[] { x, y }; + select (x, y); + + var data = new TheoryData(); + + foreach (var (x, y) in pairs) + { + data.Add(x, y); + } + + return data; } [Theory] @@ -100,12 +118,21 @@ public void When_comparing_a_numeric_to_a_non_numeric_it_should_fail(object actu success.Should().BeFalse(); } - public static IEnumerable GetNumericAndNonNumericData() + public static TheoryData GetNumericAndNonNumericData() { - return + var pairs = from x in GetNumericIConvertibles() from y in GetNonNumericIConvertibles() - select new[] { x, y }; + select (x, y); + + var data = new TheoryData(); + + foreach (var (x, y) in pairs) + { + data.Add(x, y); + } + + return data; } [Theory] @@ -122,15 +149,24 @@ public void When_comparing_a_non_numeric_to_a_non_numeric_it_should_fail(object success.Should().BeFalse(); } - public static IEnumerable GetNonNumericAndNonNumericData() + public static TheoryData GetNonNumericAndNonNumericData() { object[] nonNumerics = GetNonNumericIConvertibles(); - return + var pairs = from x in nonNumerics from y in nonNumerics where x != y - select new[] { x, y }; + select (x, y); + + var data = new TheoryData(); + + foreach (var (x, y) in pairs) + { + data.Add(x, y); + } + + return data; } private static object[] GetNumericIConvertibles() diff --git a/Tests/FluentAssertions.Specs/Formatting/EnumerableExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/Formatting/EnumerableExtensionsSpecs.cs index cc73be4f0b..dcbd90d295 100644 --- a/Tests/FluentAssertions.Specs/Formatting/EnumerableExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Formatting/EnumerableExtensionsSpecs.cs @@ -1,23 +1,22 @@ -using System.Collections.Generic; -using FluentAssertions.Formatting; +using FluentAssertions.Formatting; using Xunit; namespace FluentAssertions.Specs.Formatting; public class EnumerableExtensionsSpecs { - public static TheoryData, string> JoinUsingWritingStyleTestCases => new() + public static TheoryData JoinUsingWritingStyleTestCases => new() { - { new object[0], "" }, - { new object[] { "test" }, "test" }, - { new object[] { "test", "test2" }, "test and test2" }, - { new object[] { "test", "test2", "test3" }, "test, test2 and test3" }, - { new object[] { "test", "test2", "test3", "test4" }, "test, test2, test3 and test4" } + { [], "" }, + { ["test"], "test" }, + { ["test", "test2"], "test and test2" }, + { ["test", "test2", "test3"], "test, test2 and test3" }, + { ["test", "test2", "test3", "test4"], "test, test2, test3 and test4" } }; [Theory] [MemberData(nameof(JoinUsingWritingStyleTestCases))] - public void JoinUsingWritingStyle_should_format_correctly(IEnumerable input, string expectation) + public void JoinUsingWritingStyle_should_format_correctly(string[] input, string expectation) { // Act var result = input.JoinUsingWritingStyle(); From 557d605ebc2f2167d328ea03dfa38345f4ef3307 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 24 Sep 2024 09:38:29 +0200 Subject: [PATCH 408/845] Remove unused using --- Tests/FluentAssertions.Specs/Extensions/ObjectExtensionsSpecs.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Tests/FluentAssertions.Specs/Extensions/ObjectExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/Extensions/ObjectExtensionsSpecs.cs index ccd0da5592..5d4a636544 100644 --- a/Tests/FluentAssertions.Specs/Extensions/ObjectExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Extensions/ObjectExtensionsSpecs.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; using FluentAssertions.Common; using Xunit; From 6cadca14ce3b34f5a84a6ac2456946935b1d8193 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 24 Sep 2024 10:34:05 +0200 Subject: [PATCH 409/845] update ruby dependencies --- docs/Gemfile.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 675581769b..b4f9cddf03 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - activesupport (7.2.0) + activesupport (7.2.1) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) @@ -35,10 +35,11 @@ GEM ffi (>= 1.15.0) eventmachine (1.2.7) execjs (2.9.1) - faraday (2.10.1) - faraday-net_http (>= 2.0, < 3.2) + faraday (2.12.0) + faraday-net_http (>= 2.0, < 3.4) + json logger - faraday-net_http (3.1.1) + faraday-net_http (3.3.0) net-http ffi (1.17.0-x64-mingw-ucrt) ffi (1.17.0-x86_64-linux-gnu) @@ -100,7 +101,7 @@ GEM activesupport (>= 2) nokogiri (>= 1.4) http_parser.rb (0.8.0) - i18n (1.14.5) + i18n (1.14.6) concurrent-ruby (~> 1.0) jekyll (3.10.0) addressable (~> 2.4) @@ -212,6 +213,7 @@ GEM gemoji (>= 3, < 5) html-pipeline (~> 2.2) jekyll (>= 3.0, < 5.0) + json (2.7.2) kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) @@ -220,13 +222,13 @@ GEM listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.0) + logger (1.6.1) mercenary (0.3.6) minima (2.5.1) jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - minitest (5.24.1) + minitest (5.25.1) net-http (0.4.1) uri nokogiri (1.16.7-x64-mingw-ucrt) @@ -243,8 +245,7 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rexml (3.3.6) - strscan + rexml (3.3.7) rouge (3.30.0) rubyzip (2.3.2) safe_yaml (1.0.5) @@ -258,7 +259,6 @@ GEM faraday (>= 0.17.3, < 3) securerandom (0.3.1) simpleidn (0.2.3) - strscan (3.1.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) typhoeus (1.4.1) @@ -266,8 +266,8 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (1.8.0) - uri (0.13.0) - webrick (1.8.1) + uri (0.13.1) + webrick (1.8.2) PLATFORMS x64-mingw-ucrt From 4cc6366b1b3003160a2d805f9607e89e15e9dcd4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 19:32:25 +0200 Subject: [PATCH 410/845] Bump Roslynator.Analyzers from 4.12.5 to 4.12.6 (#2770) Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.12.5 to 4.12.6. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.12.5...v4.12.6) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 4c440e7e7e..4bc3f2b589 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 7a153476d14706b74c3963ec0dbb7fffe06ad12d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:08:54 +0200 Subject: [PATCH 411/845] Bump Meziantou.Analyzer from 2.0.168 to 2.0.169 (#2769) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.168 to 2.0.169. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.168...2.0.169) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 4bc3f2b589..12eb5bfb6a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 8a6e48ec007829ad35543879d1f1183b579ee04e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 16:30:11 +0200 Subject: [PATCH 412/845] Bump xunit from 2.9.1 to 2.9.2 in the xunit group (#2768) * Bump xunit from 2.9.1 to 2.9.2 in the xunit group Bumps the xunit group with 1 update: [xunit](https://github.com/xunit/xunit). Updates `xunit` from 2.9.1 to 2.9.2 - [Commits](https://github.com/xunit/xunit/compare/v2-2.9.1...v2-2.9.2) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] * update xunit.runner.console --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jonas Nyrup --- Build/_build.csproj | 2 +- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 43668e90a3..aedc13d163 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -20,7 +20,7 @@ - + diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 6d52630f11..050c096b82 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -6,7 +6,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index b6d94a2859..2b469fd312 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -11,7 +11,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index f09c401df4..d2571b63bd 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -28,7 +28,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 9382f3cc4e..443e147046 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -18,7 +18,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 706c9f993e..e79bf1df40 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -27,7 +27,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index 7ba386db73..f552e129ee 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index e901093b73..0743b131b4 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -7,7 +7,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From c6df7e6902a92d47357798e24e77ebc6d5ce1cf1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:05:22 +0200 Subject: [PATCH 413/845] Bump Roslynator.Analyzers from 4.12.6 to 4.12.7 (#2774) Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.12.6 to 4.12.7. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.12.6...v4.12.7) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 12eb5bfb6a..1427c9b6e3 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From fa516776718e41a82d59e15972c42e8f4910b222 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:05:46 +0200 Subject: [PATCH 414/845] Bump the nuke group with 2 updates (#2773) Bumps the nuke group with 2 updates: [Nuke.Common](https://github.com/nuke-build/nuke) and [Nuke.Components](https://github.com/nuke-build/nuke). Updates `Nuke.Common` from 8.1.0 to 8.1.1 - [Release notes](https://github.com/nuke-build/nuke/releases) - [Changelog](https://github.com/nuke-build/nuke/blob/develop/CHANGELOG.md) - [Commits](https://github.com/nuke-build/nuke/compare/8.1.0...8.1.1) Updates `Nuke.Components` from 8.1.0 to 8.1.1 - [Release notes](https://github.com/nuke-build/nuke/releases) - [Changelog](https://github.com/nuke-build/nuke/blob/develop/CHANGELOG.md) - [Commits](https://github.com/nuke-build/nuke/compare/8.1.0...8.1.1) --- updated-dependencies: - dependency-name: Nuke.Common dependency-type: direct:production update-type: version-update:semver-patch dependency-group: nuke - dependency-name: Nuke.Components dependency-type: direct:production update-type: version-update:semver-patch dependency-group: nuke ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index aedc13d163..b344ee6cb9 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -6,7 +6,7 @@ CS0649;CS0169 ..\ ..\ - 8.1.0 + 8.1.1 OS_WINDOWS From ed22799ae665a43c306bbf846f7c95288cfd2569 Mon Sep 17 00:00:00 2001 From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> Date: Sun, 13 Oct 2024 15:54:03 +0200 Subject: [PATCH 415/845] Bump macOS/ubuntu version for tests (#2777) * Bump macOS version for tests * Bump ubuntu version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae376dc3a9..0dd41d5f29 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,7 +56,7 @@ jobs: strategy: matrix: - os: [ubuntu-22.04, macos-12] + os: [ubuntu-24.04, macos-15] runs-on: ${{ matrix.os }} From 268199d94182318c37fd7a598fe91f3b5febf7cd Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Mon, 14 Oct 2024 08:31:11 +0200 Subject: [PATCH 416/845] Switched the unit test reporting to a dedicated marketplace action. (#2776) --- .github/workflows/build.yml | 42 +++++++++++++++++++++++++++++++++---- Build/Build.cs | 28 ------------------------- 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0dd41d5f29..232e4136b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,10 @@ -name: build +name: Build on: [push, pull_request] jobs: build: - + name: "Build, Test, Analyze and Publish" runs-on: windows-latest env: @@ -49,11 +49,16 @@ jobs: file: TestResults/reports/lcov.info - name: Upload artifacts + if: always() uses: actions/upload-artifact@v4 with: - path: ./Artifacts/* - only-unit-tests: + name: windows-artifacts + path: | + ./Artifacts/* + ./TestResults/*.trx + only-unit-tests: + name: "Run Unit Tests Only" strategy: matrix: os: [ubuntu-24.04, macos-15] @@ -75,3 +80,32 @@ jobs: - name: Run NUKE run: ./build.sh UnitTests + + - name: Upload artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: ${{ runner.os }}-artifacts + path: | + ./TestResults/*.trx + + publish-test-results: + name: "Publish Tests Results" + needs: [ build, only-unit-tests ] + runs-on: ubuntu-latest + permissions: + checks: write + pull-requests: write + if: always() + + steps: + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + comment_mode: always + files: "artifacts/**/**/*.trx" diff --git a/Build/Build.cs b/Build/Build.cs index 1859443ae5..4cb1ba5123 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -150,8 +150,6 @@ class Build : NukeBuild .CombineWith(cc => cc .SetProjectFile(project) .AddLoggers($"trx;LogFileName={project.Name}.trx")), completeOnFailure: true); - - ReportTestOutcome(globFilters: $"*{project.Name}.trx"); }); Project[] Projects => @@ -211,36 +209,12 @@ class Build : NukeBuild ) ), completeOnFailure: true ); - - ReportTestOutcome(globFilters: $"*[!*{net47}].trx"); }); Target UnitTests => _ => _ .DependsOn(UnitTestsNet47) .DependsOn(UnitTestsNet6OrGreater); - static string[] Outcomes(AbsolutePath path) - => XmlTasks.XmlPeek( - path, - "/xn:TestRun/xn:Results/xn:UnitTestResult/@outcome", - ("xn", "http://microsoft.com/schemas/VisualStudio/TeamTest/2010")).ToArray(); - - void ReportTestOutcome(params string[] globFilters) - { - var resultFiles = TestResultsDirectory.GlobFiles(globFilters); - var outcomes = resultFiles.SelectMany(Outcomes).ToList(); - var passedTests = outcomes.Count(outcome => outcome is "Passed"); - var failedTests = outcomes.Count(outcome => outcome is "Failed"); - var skippedTests = outcomes.Count(outcome => outcome is "NotExecuted"); - - ReportSummary(_ => _ - .When(failedTests > 0, c => c - .AddPair("Failed", failedTests.ToString())) - .AddPair("Passed", passedTests.ToString()) - .When(skippedTests > 0, c => c - .AddPair("Skipped", skippedTests.ToString()))); - } - Target CodeCoverage => _ => _ .DependsOn(TestFrameworks) .DependsOn(UnitTests) @@ -298,8 +272,6 @@ from framework in supportedFrameworks .SetProjectFile(v.project) .SetFramework(v.framework) .AddLoggers($"trx;LogFileName={v.project.Name}_{v.framework}.trx")), completeOnFailure: true); - - ReportTestOutcome(projects.Select(p => $"*{p.Name}*.trx").ToArray()); }); Target Pack => _ => _ From c7218a07e1b4a7a0de1e1544bf450d80e211fec8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:51:20 +0200 Subject: [PATCH 417/845] Bump cspell from 8.14.4 to 8.15.2 (#2778) Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.14.4 to 8.15.2. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.15.2/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 830 +++++++++++++++++++--------------------------- package.json | 2 +- 2 files changed, 343 insertions(+), 489 deletions(-) diff --git a/package-lock.json b/package-lock.json index 658ad648f0..0c4b138ae7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,95 +7,95 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.14.4" + "cspell": "^8.15.2" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.14.4.tgz", - "integrity": "sha512-JHZOpCJzN6fPBapBOvoeMxZbr0ZA11ZAkwcqM4w0lKoacbi6TwK8GIYf66hHvwLmMeav75TNXWE6aPTvBLMMqA==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.15.2.tgz", + "integrity": "sha512-e+hxoD/GW7iyK1zMeRFd10yBr9tcClnnqFLxJM+tH1cSzLQ66ouXMIMuJpcd8LOCm7zMRdjTm4R72LehMgL79g==", "dependencies": { - "@cspell/dict-ada": "^4.0.2", - "@cspell/dict-aws": "^4.0.4", - "@cspell/dict-bash": "^4.1.4", - "@cspell/dict-companies": "^3.1.4", - "@cspell/dict-cpp": "^5.1.16", - "@cspell/dict-cryptocurrencies": "^5.0.0", - "@cspell/dict-csharp": "^4.0.2", - "@cspell/dict-css": "^4.0.13", - "@cspell/dict-dart": "^2.2.1", - "@cspell/dict-django": "^4.1.0", - "@cspell/dict-docker": "^1.1.7", - "@cspell/dict-dotnet": "^5.0.5", - "@cspell/dict-elixir": "^4.0.3", - "@cspell/dict-en_us": "^4.3.23", - "@cspell/dict-en-common-misspellings": "^2.0.4", + "@cspell/dict-ada": "^4.0.5", + "@cspell/dict-aws": "^4.0.7", + "@cspell/dict-bash": "^4.1.8", + "@cspell/dict-companies": "^3.1.7", + "@cspell/dict-cpp": "^5.1.22", + "@cspell/dict-cryptocurrencies": "^5.0.3", + "@cspell/dict-csharp": "^4.0.5", + "@cspell/dict-css": "^4.0.16", + "@cspell/dict-dart": "^2.2.4", + "@cspell/dict-django": "^4.1.3", + "@cspell/dict-docker": "^1.1.10", + "@cspell/dict-dotnet": "^5.0.8", + "@cspell/dict-elixir": "^4.0.6", + "@cspell/dict-en_us": "^4.3.26", + "@cspell/dict-en-common-misspellings": "^2.0.7", "@cspell/dict-en-gb": "1.1.33", - "@cspell/dict-filetypes": "^3.0.4", - "@cspell/dict-flutter": "^1.0.0", - "@cspell/dict-fonts": "^4.0.0", - "@cspell/dict-fsharp": "^1.0.1", - "@cspell/dict-fullstack": "^3.2.0", - "@cspell/dict-gaming-terms": "^1.0.5", - "@cspell/dict-git": "^3.0.0", - "@cspell/dict-golang": "^6.0.12", - "@cspell/dict-google": "^1.0.1", - "@cspell/dict-haskell": "^4.0.1", - "@cspell/dict-html": "^4.0.5", - "@cspell/dict-html-symbol-entities": "^4.0.0", - "@cspell/dict-java": "^5.0.7", - "@cspell/dict-julia": "^1.0.1", - "@cspell/dict-k8s": "^1.0.6", - "@cspell/dict-latex": "^4.0.0", - "@cspell/dict-lorem-ipsum": "^4.0.0", - "@cspell/dict-lua": "^4.0.3", - "@cspell/dict-makefile": "^1.0.0", - "@cspell/dict-monkeyc": "^1.0.6", - "@cspell/dict-node": "^5.0.1", - "@cspell/dict-npm": "^5.1.4", - "@cspell/dict-php": "^4.0.10", - "@cspell/dict-powershell": "^5.0.8", - "@cspell/dict-public-licenses": "^2.0.8", - "@cspell/dict-python": "^4.2.6", - "@cspell/dict-r": "^2.0.1", - "@cspell/dict-ruby": "^5.0.3", - "@cspell/dict-rust": "^4.0.5", - "@cspell/dict-scala": "^5.0.3", - "@cspell/dict-software-terms": "^4.1.3", - "@cspell/dict-sql": "^2.1.5", - "@cspell/dict-svelte": "^1.0.2", - "@cspell/dict-swift": "^2.0.1", - "@cspell/dict-terraform": "^1.0.1", - "@cspell/dict-typescript": "^3.1.6", - "@cspell/dict-vue": "^3.0.0" + "@cspell/dict-filetypes": "^3.0.7", + "@cspell/dict-flutter": "^1.0.3", + "@cspell/dict-fonts": "^4.0.3", + "@cspell/dict-fsharp": "^1.0.4", + "@cspell/dict-fullstack": "^3.2.3", + "@cspell/dict-gaming-terms": "^1.0.8", + "@cspell/dict-git": "^3.0.3", + "@cspell/dict-golang": "^6.0.16", + "@cspell/dict-google": "^1.0.4", + "@cspell/dict-haskell": "^4.0.4", + "@cspell/dict-html": "^4.0.9", + "@cspell/dict-html-symbol-entities": "^4.0.3", + "@cspell/dict-java": "^5.0.10", + "@cspell/dict-julia": "^1.0.4", + "@cspell/dict-k8s": "^1.0.9", + "@cspell/dict-latex": "^4.0.3", + "@cspell/dict-lorem-ipsum": "^4.0.3", + "@cspell/dict-lua": "^4.0.6", + "@cspell/dict-makefile": "^1.0.3", + "@cspell/dict-monkeyc": "^1.0.9", + "@cspell/dict-node": "^5.0.4", + "@cspell/dict-npm": "^5.1.8", + "@cspell/dict-php": "^4.0.13", + "@cspell/dict-powershell": "^5.0.13", + "@cspell/dict-public-licenses": "^2.0.11", + "@cspell/dict-python": "^4.2.11", + "@cspell/dict-r": "^2.0.4", + "@cspell/dict-ruby": "^5.0.7", + "@cspell/dict-rust": "^4.0.9", + "@cspell/dict-scala": "^5.0.6", + "@cspell/dict-software-terms": "^4.1.10", + "@cspell/dict-sql": "^2.1.8", + "@cspell/dict-svelte": "^1.0.5", + "@cspell/dict-swift": "^2.0.4", + "@cspell/dict-terraform": "^1.0.5", + "@cspell/dict-typescript": "^3.1.9", + "@cspell/dict-vue": "^3.0.3" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.14.4.tgz", - "integrity": "sha512-gJ6tQbGCNLyHS2iIimMg77as5MMAFv3sxU7W6tjLlZp8htiNZS7fS976g24WbT/hscsTT9Dd0sNHkpo8K3nvVw==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.15.2.tgz", + "integrity": "sha512-6p9eLdO5RLb1HNf+Rto4RG3tG02y05DutrWdpnK1Agn21EbUKAUIdIcsjQ2N52UeVT5cDvNhkAabKN57sFygag==", "dependencies": { - "@cspell/cspell-types": "8.14.4" + "@cspell/cspell-types": "8.15.2" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.14.4.tgz", - "integrity": "sha512-CLLdouqfrQ4rqdQdPu0Oo+HHCU/oLYoEsK1nNPb28cZTFxnn0cuSPKB6AMPBJmMwdfJ6fMD0BCKNbEe1UNLHcw==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.15.2.tgz", + "integrity": "sha512-TOcLiRiUSh75y+DQrAW59Ix0/D9WPrd4/KPtUShUepS3vLfoxMQ+TwpXfdc8FrzU73Hg5glXXnQjvdx7vAazVQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.14.4.tgz", - "integrity": "sha512-s3uZyymJ04yn8+zlTp7Pt1WRSlAel6XVo+iZRxls3LSvIP819KK64DoyjCD2Uon0Vg9P/K7aAPt8GcxDcnJtgA==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.15.2.tgz", + "integrity": "sha512-XOcHfkKCN+a3zZMexK/BLmDxsqku8Q5ASqYu7JBFsu/axS4K11bkcQMxYoOvHVGBv20vb/gM2D+9MePuxAfssg==", "dependencies": { "global-directory": "^4.0.1" }, @@ -104,100 +104,100 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.14.4.tgz", - "integrity": "sha512-i3UG+ep63akNsDXZrtGgICNF3MLBHtvKe/VOIH6+L+NYaAaVHqqQvOY9MdUwt1HXh8ElzfwfoRp36wc5aAvt6g==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.15.2.tgz", + "integrity": "sha512-g9rhMIU0DX+avIQHFu0Mx3LAFi4lG6zX8iFa2zu+u3ll0IX0WtxTqrzft27jYSwebmm/ysWJUcOY+SWhZfPA0Q==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.14.4.tgz", - "integrity": "sha512-VXwikqdHgjOVperVVCn2DOe8W3rPIswwZtMHfRYnagpzZo/TOntIjkXPJSfTtl/cFyx5DnCBsDH8ytKGlMeHkw==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.15.2.tgz", + "integrity": "sha512-bHAkXsrfOhKyZZ+TA5eGH3fqh9DPcP3a2v+ozTnhhZa3zcfuzX7rZnYWEFA8LELMUStWXLECzFoGd9QUEHMstg==", "engines": { "node": ">=18" } }, "node_modules/@cspell/dict-ada": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.0.2.tgz", - "integrity": "sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA==" + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.0.5.tgz", + "integrity": "sha512-6/RtZ/a+lhFVmrx/B7bfP7rzC4yjEYe8o74EybXcvu4Oue6J4Ey2WSYj96iuodloj1LWrkNCQyX5h4Pmcj0Iag==" }, "node_modules/@cspell/dict-aws": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.4.tgz", - "integrity": "sha512-6AWI/Kkf+RcX/J81VX8+GKLeTgHWEr/OMhGk3dHQzWK66RaqDJCGDqi7494ghZKcBB7dGa3U5jcKw2FZHL/u3w==" + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.7.tgz", + "integrity": "sha512-PoaPpa2NXtSkhGIMIKhsJUXB6UbtTt6Ao3x9JdU9kn7fRZkwD4RjHDGqulucIOz7KeEX/dNRafap6oK9xHe4RA==" }, "node_modules/@cspell/dict-bash": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.1.4.tgz", - "integrity": "sha512-W/AHoQcJYn3Vn/tUiXX2+6D/bhfzdDshwcbQWv9TdiNlXP9P6UJjDKWbxyA5ogJCsR2D0X9Kx11oV8E58siGKQ==" + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.1.8.tgz", + "integrity": "sha512-I2CM2pTNthQwW069lKcrVxchJGMVQBzru2ygsHCwgidXRnJL/NTjAPOFTxN58Jc1bf7THWghfEDyKX/oyfc0yg==" }, "node_modules/@cspell/dict-companies": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.4.tgz", - "integrity": "sha512-y9e0amzEK36EiiKx3VAA+SHQJPpf2Qv5cCt5eTUSggpTkiFkCh6gRKQ97rVlrKh5GJrqinDwYIJtTsxuh2vy2Q==" + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.7.tgz", + "integrity": "sha512-ncVs/efuAkP1/tLDhWbXukBjgZ5xOUfe03neHMWsE8zvXXc5+Lw6TX5jaJXZLOoES/f4j4AhRE20jsPCF5pm+A==" }, "node_modules/@cspell/dict-cpp": { - "version": "5.1.16", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.16.tgz", - "integrity": "sha512-32fU5RkuOM55IRcxjByiSoKbjr+C4danDfYjHaQNRWdvjzJzci3fLDGA2wTXiclkgDODxGiV8LCTUwCz+3TNWA==" + "version": "5.1.22", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.22.tgz", + "integrity": "sha512-g1/8P5/Q+xnIc8Js4UtBg3XOhcFrFlFbG3UWVtyEx49YTf0r9eyDtDt1qMMDBZT91pyCwLcAEbwS+4i5PIfNZw==" }, "node_modules/@cspell/dict-cryptocurrencies": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-5.0.0.tgz", - "integrity": "sha512-Z4ARIw5+bvmShL+4ZrhDzGhnc9znaAGHOEMaB/GURdS/jdoreEDY34wdN0NtdLHDO5KO7GduZnZyqGdRoiSmYA==" + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-5.0.3.tgz", + "integrity": "sha512-bl5q+Mk+T3xOZ12+FG37dB30GDxStza49Rmoax95n37MTLksk9wBo1ICOlPJ6PnDUSyeuv4SIVKgRKMKkJJglA==" }, "node_modules/@cspell/dict-csharp": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.2.tgz", - "integrity": "sha512-1JMofhLK+4p4KairF75D3A924m5ERMgd1GvzhwK2geuYgd2ZKuGW72gvXpIV7aGf52E3Uu1kDXxxGAiZ5uVG7g==" + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.5.tgz", + "integrity": "sha512-c/sFnNgtRwRJxtC3JHKkyOm+U3/sUrltFeNwml9VsxKBHVmvlg4tk4ar58PdpW9/zTlGUkWi2i85//DN1EsUCA==" }, "node_modules/@cspell/dict-css": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.13.tgz", - "integrity": "sha512-WfOQkqlAJTo8eIQeztaH0N0P+iF5hsJVKFuhy4jmARPISy8Efcv8QXk2/IVbmjJH0/ZV7dKRdnY5JFVXuVz37g==" + "version": "4.0.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.16.tgz", + "integrity": "sha512-70qu7L9z/JR6QLyJPk38fNTKitlIHnfunx0wjpWQUQ8/jGADIhMCrz6hInBjqPNdtGpYm8d1dNFyF8taEkOgrQ==" }, "node_modules/@cspell/dict-dart": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.2.1.tgz", - "integrity": "sha512-yriKm7QkoPx3JPSSOcw6iX9gOb2N50bOo/wqWviqPYbhpMRh9Xiv6dkUy3+ot+21GuShZazO8X6U5+Vw67XEwg==" + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.2.4.tgz", + "integrity": "sha512-of/cVuUIZZK/+iqefGln8G3bVpfyN6ZtH+LyLkHMoR5tEj+2vtilGNk9ngwyR8L4lEqbKuzSkOxgfVjsXf5PsQ==" }, "node_modules/@cspell/dict-data-science": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.1.tgz", - "integrity": "sha512-xeutkzK0eBe+LFXOFU2kJeAYO6IuFUc1g7iRLr7HeCmlC4rsdGclwGHh61KmttL3+YHQytYStxaRBdGAXWC8Lw==" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.5.tgz", + "integrity": "sha512-nNSILXmhSJox9/QoXICPQgm8q5PbiSQP4afpbkBqPi/u/b3K9MbNH5HvOOa6230gxcGdbZ9Argl2hY/U8siBlg==" }, "node_modules/@cspell/dict-django": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.0.tgz", - "integrity": "sha512-bKJ4gPyrf+1c78Z0Oc4trEB9MuhcB+Yg+uTTWsvhY6O2ncFYbB/LbEZfqhfmmuK/XJJixXfI1laF2zicyf+l0w==" + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.3.tgz", + "integrity": "sha512-yBspeL3roJlO0a1vKKNaWABURuHdHZ9b1L8d3AukX0AsBy9snSggc8xCavPmSzNfeMDXbH+1lgQiYBd3IW03fg==" }, "node_modules/@cspell/dict-docker": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.7.tgz", - "integrity": "sha512-XlXHAr822euV36GGsl2J1CkBIVg3fZ6879ZOg5dxTIssuhUOCiV2BuzKZmt6aIFmcdPmR14+9i9Xq+3zuxeX0A==" + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.10.tgz", + "integrity": "sha512-vWybMfsG/8jhN6kmPoilMon36GB3+Ef+m/mgYUfY8tJN23K/x4KD1rU1OOiNWzDqePhu3MMWVKO5W5x6VI6Gbw==" }, "node_modules/@cspell/dict-dotnet": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.5.tgz", - "integrity": "sha512-gjg0L97ee146wX47dnA698cHm85e7EOpf9mVrJD8DmEaqoo/k1oPy2g7c7LgKxK9XnqwoXxhLNnngPrwXOoEtQ==" + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.8.tgz", + "integrity": "sha512-MD8CmMgMEdJAIPl2Py3iqrx3B708MbCIXAuOeZ0Mzzb8YmLmiisY7QEYSZPg08D7xuwARycP0Ki+bb0GAkFSqg==" }, "node_modules/@cspell/dict-elixir": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-4.0.3.tgz", - "integrity": "sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q==" + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-4.0.6.tgz", + "integrity": "sha512-TfqSTxMHZ2jhiqnXlVKM0bUADtCvwKQv2XZL/DI0rx3doG8mEMS8SGPOmiyyGkHpR/pGOq18AFH3BEm4lViHIw==" }, "node_modules/@cspell/dict-en_us": { - "version": "4.3.23", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.23.tgz", - "integrity": "sha512-l0SoEQBsi3zDSl3OuL4/apBkxjuj4hLIg/oy6+gZ7LWh03rKdF6VNtSZNXWAmMY+pmb1cGA3ouleTiJIglbsIg==" + "version": "4.3.26", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.26.tgz", + "integrity": "sha512-hDbHYJsi3UgU1J++B0WLiYhWQdsmve3CH53FIaMRAdhrWOHcuw7h1dYkQXHFEP5lOjaq53KUHp/oh5su6VkIZg==" }, "node_modules/@cspell/dict-en-common-misspellings": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.4.tgz", - "integrity": "sha512-lvOiRjV/FG4pAGZL3PN2GCVHSTCE92cwhfLGGkOsQtxSmef6WCHfHwp9auafkBlX0yFQSKDfq6/TlpQbjbJBtQ==" + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.7.tgz", + "integrity": "sha512-qNFo3G4wyabcwnM+hDrMYKN9vNVg/k9QkhqSlSst6pULjdvPyPs1mqz1689xO/v9t8e6sR4IKc3CgUXDMTYOpA==" }, "node_modules/@cspell/dict-en-gb": { "version": "1.1.33", @@ -205,197 +205,197 @@ "integrity": "sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==" }, "node_modules/@cspell/dict-filetypes": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.4.tgz", - "integrity": "sha512-IBi8eIVdykoGgIv5wQhOURi5lmCNJq0we6DvqKoPQJHthXbgsuO1qrHSiUVydMiQl/XvcnUWTMeAlVUlUClnVg==" + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.7.tgz", + "integrity": "sha512-/DN0Ujp9/EXvpTcgih9JmBaE8n+G0wtsspyNdvHT5luRfpfol1xm/CIQb6xloCXCiLkWX+EMPeLSiVIZq+24dA==" }, "node_modules/@cspell/dict-flutter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-flutter/-/dict-flutter-1.0.0.tgz", - "integrity": "sha512-W7k1VIc4KeV8BjEBxpA3cqpzbDWjfb7oXkEb0LecBCBp5Z7kcfnjT1YVotTx/U9PGyAOBhDaEdgZACVGNQhayw==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-flutter/-/dict-flutter-1.0.3.tgz", + "integrity": "sha512-52C9aUEU22ptpgYh6gQyIdA4MP6NPwzbEqndfgPh3Sra191/kgs7CVqXiO1qbtZa9gnYHUoVApkoxRE7mrXHfg==" }, "node_modules/@cspell/dict-fonts": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.0.tgz", - "integrity": "sha512-t9V4GeN/m517UZn63kZPUYP3OQg5f0OBLSd3Md5CU3eH1IFogSvTzHHnz4Wqqbv8NNRiBZ3HfdY/pqREZ6br3Q==" + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.3.tgz", + "integrity": "sha512-sPd17kV5qgYXLteuHFPn5mbp/oCHKgitNfsZLFC3W2fWEgZlhg4hK+UGig3KzrYhhvQ8wBnmZrAQm0TFKCKzsA==" }, "node_modules/@cspell/dict-fsharp": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-fsharp/-/dict-fsharp-1.0.1.tgz", - "integrity": "sha512-23xyPcD+j+NnqOjRHgW3IU7Li912SX9wmeefcY0QxukbAxJ/vAN4rBpjSwwYZeQPAn3fxdfdNZs03fg+UM+4yQ==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-fsharp/-/dict-fsharp-1.0.4.tgz", + "integrity": "sha512-G5wk0o1qyHUNi9nVgdE1h5wl5ylq7pcBjX8vhjHcO4XBq20D5eMoXjwqMo/+szKAqzJ+WV3BgAL50akLKrT9Rw==" }, "node_modules/@cspell/dict-fullstack": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.0.tgz", - "integrity": "sha512-sIGQwU6G3rLTo+nx0GKyirR5dQSFeTIzFTOrURw51ISf+jKG9a3OmvsVtc2OANfvEAOLOC9Wfd8WYhmsO8KRDQ==" + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.3.tgz", + "integrity": "sha512-62PbndIyQPH11mAv0PyiyT0vbwD0AXEocPpHlCHzfb5v9SspzCCbzQ/LIBiFmyRa+q5LMW35CnSVu6OXdT+LKg==" }, "node_modules/@cspell/dict-gaming-terms": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.0.5.tgz", - "integrity": "sha512-C3riccZDD3d9caJQQs1+MPfrUrQ+0KHdlj9iUR1QD92FgTOF6UxoBpvHUUZ9YSezslcmpFQK4xQQ5FUGS7uWfw==" + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.0.8.tgz", + "integrity": "sha512-7OL0zTl93WFWhhtpXFrtm9uZXItC3ncAs8d0iQDMMFVNU1rBr6raBNxJskxE5wx2Ant12fgI66ZGVagXfN+yfA==" }, "node_modules/@cspell/dict-git": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.0.tgz", - "integrity": "sha512-simGS/lIiXbEaqJu9E2VPoYW1OTC2xrwPPXNXFMa2uo/50av56qOuaxDrZ5eH1LidFXwoc8HROCHYeKoNrDLSw==" + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.3.tgz", + "integrity": "sha512-LSxB+psZ0qoj83GkyjeEH/ZViyVsGEF/A6BAo8Nqc0w0HjD2qX/QR4sfA6JHUgQ3Yi/ccxdK7xNIo67L2ScW5A==" }, "node_modules/@cspell/dict-golang": { - "version": "6.0.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.12.tgz", - "integrity": "sha512-LEPeoqd+4O+vceHF73S7D7+LYfrAjOvp4Dqzh4MT30ruzlQ77yHRSuYOJtrFN1GK5ntAt/ILSVOKg9sgsz1Llg==" + "version": "6.0.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.16.tgz", + "integrity": "sha512-hZOBlgcguv2Hdc93n2zjdAQm1j3grsN9T9WhPnQ1wh2vUDoCLEujg+6gWhjcLb8ECOcwZTWgNyQLWeOxEsAj/w==" }, "node_modules/@cspell/dict-google": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-google/-/dict-google-1.0.1.tgz", - "integrity": "sha512-dQr4M3n95uOhtloNSgB9tYYGXGGEGEykkFyRtfcp5pFuEecYUa0BSgtlGKx9RXVtJtKgR+yFT/a5uQSlt8WjqQ==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-google/-/dict-google-1.0.4.tgz", + "integrity": "sha512-JThUT9eiguCja1mHHLwYESgxkhk17Gv7P3b1S7ZJzXw86QyVHPrbpVoMpozHk0C9o+Ym764B7gZGKmw9uMGduQ==" }, "node_modules/@cspell/dict-haskell": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-haskell/-/dict-haskell-4.0.1.tgz", - "integrity": "sha512-uRrl65mGrOmwT7NxspB4xKXFUenNC7IikmpRZW8Uzqbqcu7ZRCUfstuVH7T1rmjRgRkjcIjE4PC11luDou4wEQ==" + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-haskell/-/dict-haskell-4.0.4.tgz", + "integrity": "sha512-EwQsedEEnND/vY6tqRfg9y7tsnZdxNqOxLXSXTsFA6JRhUlr8Qs88iUUAfsUzWc4nNmmzQH2UbtT25ooG9x4nA==" }, "node_modules/@cspell/dict-html": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.6.tgz", - "integrity": "sha512-cLWHfuOhE4wqwC12up6Doxo2u1xxVhX1A8zriR4CUD+osFQzUIcBK1ykNXppga+rt1WyypaJdTU2eV6OpzYrgQ==" + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.9.tgz", + "integrity": "sha512-BNp7w3m910K4qIVyOBOZxHuFNbVojUY6ES8Y8r7YjYgJkm2lCuQoVwwhPjurnomJ7BPmZTb+3LLJ58XIkgF7JQ==" }, "node_modules/@cspell/dict-html-symbol-entities": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.0.tgz", - "integrity": "sha512-HGRu+48ErJjoweR5IbcixxETRewrBb0uxQBd6xFGcxbEYCX8CnQFTAmKI5xNaIt2PKaZiJH3ijodGSqbKdsxhw==" + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.3.tgz", + "integrity": "sha512-aABXX7dMLNFdSE8aY844X4+hvfK7977sOWgZXo4MTGAmOzR8524fjbJPswIBK7GaD3+SgFZ2yP2o0CFvXDGF+A==" }, "node_modules/@cspell/dict-java": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.7.tgz", - "integrity": "sha512-ejQ9iJXYIq7R09BScU2y5OUGrSqwcD+J5mHFOKbduuQ5s/Eh/duz45KOzykeMLI6KHPVxhBKpUPBWIsfewECpQ==" + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.10.tgz", + "integrity": "sha512-pVNcOnmoGiNL8GSVq4WbX/Vs2FGS0Nej+1aEeGuUY9CU14X8yAVCG+oih5ZoLt1jaR8YfR8byUF8wdp4qG4XIw==" }, "node_modules/@cspell/dict-julia": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-julia/-/dict-julia-1.0.1.tgz", - "integrity": "sha512-4JsCLCRhhLMLiaHpmR7zHFjj1qOauzDI5ZzCNQS31TUMfsOo26jAKDfo0jljFAKgw5M2fEG7sKr8IlPpQAYrmQ==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-julia/-/dict-julia-1.0.4.tgz", + "integrity": "sha512-bFVgNX35MD3kZRbXbJVzdnN7OuEqmQXGpdOi9jzB40TSgBTlJWA4nxeAKV4CPCZxNRUGnLH0p05T/AD7Aom9/w==" }, "node_modules/@cspell/dict-k8s": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.6.tgz", - "integrity": "sha512-srhVDtwrd799uxMpsPOQqeDJY+gEocgZpoK06EFrb4GRYGhv7lXo9Fb+xQMyQytzOW9dw4DNOEck++nacDuymg==" + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.9.tgz", + "integrity": "sha512-Q7GELSQIzo+BERl2ya/nBEnZeQC+zJP19SN1pI6gqDYraM51uYJacbbcWLYYO2Y+5joDjNt/sd/lJtLaQwoSlA==" }, "node_modules/@cspell/dict-latex": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-4.0.0.tgz", - "integrity": "sha512-LPY4y6D5oI7D3d+5JMJHK/wxYTQa2lJMSNxps2JtuF8hbAnBQb3igoWEjEbIbRRH1XBM0X8dQqemnjQNCiAtxQ==" + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-4.0.3.tgz", + "integrity": "sha512-2KXBt9fSpymYHxHfvhUpjUFyzrmN4c4P8mwIzweLyvqntBT3k0YGZJSriOdjfUjwSygrfEwiuPI1EMrvgrOMJw==" }, "node_modules/@cspell/dict-lorem-ipsum": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.0.tgz", - "integrity": "sha512-1l3yjfNvMzZPibW8A7mQU4kTozwVZVw0AvFEdy+NcqtbxH+TvbSkNMqROOFWrkD2PjnKG0+Ea0tHI2Pi6Gchnw==" + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.3.tgz", + "integrity": "sha512-WFpDi/PDYHXft6p0eCXuYnn7mzMEQLVeqpO+wHSUd+kz5ADusZ4cpslAA4wUZJstF1/1kMCQCZM6HLZic9bT8A==" }, "node_modules/@cspell/dict-lua": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-4.0.3.tgz", - "integrity": "sha512-lDHKjsrrbqPaea13+G9s0rtXjMO06gPXPYRjRYawbNmo4E/e3XFfVzeci3OQDQNDmf2cPOwt9Ef5lu2lDmwfJg==" + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-4.0.6.tgz", + "integrity": "sha512-Jwvh1jmAd9b+SP9e1GkS2ACbqKKRo9E1f9GdjF/ijmooZuHU0hPyqvnhZzUAxO1egbnNjxS/J2T6iUtjAUK2KQ==" }, "node_modules/@cspell/dict-makefile": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-makefile/-/dict-makefile-1.0.0.tgz", - "integrity": "sha512-3W9tHPcSbJa6s0bcqWo6VisEDTSN5zOtDbnPabF7rbyjRpNo0uHXHRJQF8gAbFzoTzBBhgkTmrfSiuyQm7vBUQ==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-makefile/-/dict-makefile-1.0.3.tgz", + "integrity": "sha512-R3U0DSpvTs6qdqfyBATnePj9Q/pypkje0Nj26mQJ8TOBQutCRAJbr2ZFAeDjgRx5EAJU/+8txiyVF97fbVRViw==" }, "node_modules/@cspell/dict-monkeyc": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-monkeyc/-/dict-monkeyc-1.0.6.tgz", - "integrity": "sha512-oO8ZDu/FtZ55aq9Mb67HtaCnsLn59xvhO/t2mLLTHAp667hJFxpp7bCtr2zOrR1NELzFXmKln/2lw/PvxMSvrA==" + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-monkeyc/-/dict-monkeyc-1.0.9.tgz", + "integrity": "sha512-Jvf6g5xlB4+za3ThvenYKREXTEgzx5gMUSzrAxIiPleVG4hmRb/GBSoSjtkGaibN3XxGx5x809gSTYCA/IHCpA==" }, "node_modules/@cspell/dict-node": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.1.tgz", - "integrity": "sha512-lax/jGz9h3Dv83v8LHa5G0bf6wm8YVRMzbjJPG/9rp7cAGPtdrga+XANFq+B7bY5+jiSA3zvj10LUFCFjnnCCg==" + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.4.tgz", + "integrity": "sha512-Hz5hiuOvZTd7Cp1IBqUZ7/ChwJeQpD5BJuwCaDn4mPNq4iMcQ1iWBYMThvNVqCEDgKv63X52nT8RAWacss98qg==" }, "node_modules/@cspell/dict-npm": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.5.tgz", - "integrity": "sha512-oAOGWuJYU3DlO+cAsStKMWN8YEkBue25cRC9EwdiL5Z84nchU20UIoYrLfIQejMlZca+1GyrNeyxRAgn4KiivA==" + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.8.tgz", + "integrity": "sha512-AJELYXeB4fQdIoNfmuaQxB1Hli3cX6XPsQCjfBxlu0QYXhrjB/IrCLLQAjWIywDqJiWyGUFTz4DqaANm8C/r9Q==" }, "node_modules/@cspell/dict-php": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.10.tgz", - "integrity": "sha512-NfTZdp6kcZDF1PvgQ6cY0zE4FUO5rSwNmBH/iwCBuaLfJAFQ97rgjxo+D2bic4CFwNjyHutnHPtjJBRANO5XQw==" + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.13.tgz", + "integrity": "sha512-P6sREMZkhElzz/HhXAjahnICYIqB/HSGp1EhZh+Y6IhvC15AzgtDP8B8VYCIsQof6rPF1SQrFwunxOv8H1e2eg==" }, "node_modules/@cspell/dict-powershell": { - "version": "5.0.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.9.tgz", - "integrity": "sha512-Vi0h0rlxS39tgTyUtxI6L3BPHH7MLPkLWCYkNfb/buQuNJYNFdHiF4bqoqVdJ/7ZrfIfNg4i6rzocnwGRn2ruw==" + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.13.tgz", + "integrity": "sha512-0qdj0XZIPmb77nRTynKidRJKTU0Fl+10jyLbAhFTuBWKMypVY06EaYFnwhsgsws/7nNX8MTEQuewbl9bWFAbsg==" }, "node_modules/@cspell/dict-public-licenses": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.8.tgz", - "integrity": "sha512-Sup+tFS7cDV0fgpoKtUqEZ6+fA/H+XUgBiqQ/Fbs6vUE3WCjJHOIVsP+udHuyMH7iBfJ4UFYOYeORcY4EaKdMg==" + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.11.tgz", + "integrity": "sha512-rR5KjRUSnVKdfs5G+gJ4oIvQvm8+NJ6cHWY2N+GE69/FSGWDOPHxulCzeGnQU/c6WWZMSimG9o49i9r//lUQyA==" }, "node_modules/@cspell/dict-python": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.6.tgz", - "integrity": "sha512-Hkz399qDGEbfXi9GYa2hDl7GahglI86JmS2F1KP8sfjLXofUgtnknyC5NWc86nzHcP38pZiPqPbTigyDYw5y8A==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.11.tgz", + "integrity": "sha512-bshNZqP5FYRO0CtZ9GgtVjHidrSuRRF537MU/sPew8oaqWPg066F9KQfPllbRi9AzFqqeS2l7/ACYUrFMe21gw==", "dependencies": { - "@cspell/dict-data-science": "^2.0.1" + "@cspell/dict-data-science": "^2.0.5" } }, "node_modules/@cspell/dict-r": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-r/-/dict-r-2.0.1.tgz", - "integrity": "sha512-KCmKaeYMLm2Ip79mlYPc8p+B2uzwBp4KMkzeLd5E6jUlCL93Y5Nvq68wV5fRLDRTf7N1LvofkVFWfDcednFOgA==" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-r/-/dict-r-2.0.4.tgz", + "integrity": "sha512-cBpRsE/U0d9BRhiNRMLMH1PpWgw+N+1A2jumgt1if9nBGmQw4MUpg2u9I0xlFVhstTIdzXiLXMxP45cABuiUeQ==" }, "node_modules/@cspell/dict-ruby": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.3.tgz", - "integrity": "sha512-V1xzv9hN6u8r6SM4CkYdsxs4ov8gjXXo0Twfx5kWhLXbEVxTXDMt7ohLTqpy2XlF5mutixZdbHMeFiAww8v+Ug==" + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.7.tgz", + "integrity": "sha512-4/d0hcoPzi5Alk0FmcyqlzFW9lQnZh9j07MJzPcyVO62nYJJAGKaPZL2o4qHeCS/od/ctJC5AHRdoUm0ktsw6Q==" }, "node_modules/@cspell/dict-rust": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.5.tgz", - "integrity": "sha512-DIvlPRDemjKQy8rCqftAgGNZxY5Bg+Ps7qAIJjxkSjmMETyDgl0KTVuaJPt7EK4jJt6uCZ4ILy96npsHDPwoXA==" + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.9.tgz", + "integrity": "sha512-Dhr6TIZsMV92xcikKIWei6p/qswS4M+gTkivpWwz4/1oaVk2nRrxJmCdRoVkJlZkkAc17rjxrS12mpnJZI0iWw==" }, "node_modules/@cspell/dict-scala": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.3.tgz", - "integrity": "sha512-4yGb4AInT99rqprxVNT9TYb1YSpq58Owzq7zi3ZS5T0u899Y4VsxsBiOgHnQ/4W+ygi+sp+oqef8w8nABR2lkg==" + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.6.tgz", + "integrity": "sha512-tl0YWAfjUVb4LyyE4JIMVE8DlLzb1ecHRmIWc4eT6nkyDqQgHKzdHsnusxFEFMVLIQomgSg0Zz6hJ5S1E4W4ww==" }, "node_modules/@cspell/dict-software-terms": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.4.tgz", - "integrity": "sha512-AHS25sYEzWze/aFglp9ODKSu+phjkuGx+OLwIcmOnvyn8axtSq5GCn9UqS4XG1/Qn0UG2Lgb4i5PJbZ0QNPNXQ==" + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.10.tgz", + "integrity": "sha512-+9PuQ9MHQhlET6Hv1mGcWDh6Rb+StzjBMrjfksDeBHBIVdT66u9uCkaZapIzfgktflY4m9oK7+dEynr+BAxvtQ==" }, "node_modules/@cspell/dict-sql": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.1.5.tgz", - "integrity": "sha512-FmxanytHXss7GAWAXmgaxl3icTCW7YxlimyOSPNfm+njqeUDjw3kEv4mFNDDObBJv8Ec5AWCbUDkWIpkE3IpKg==" + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.1.8.tgz", + "integrity": "sha512-dJRE4JV1qmXTbbGm6WIcg1knmR6K5RXnQxF4XHs5HA3LAjc/zf77F95i5LC+guOGppVF6Hdl66S2UyxT+SAF3A==" }, "node_modules/@cspell/dict-svelte": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-svelte/-/dict-svelte-1.0.2.tgz", - "integrity": "sha512-rPJmnn/GsDs0btNvrRBciOhngKV98yZ9SHmg8qI6HLS8hZKvcXc0LMsf9LLuMK1TmS2+WQFAan6qeqg6bBxL2Q==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-svelte/-/dict-svelte-1.0.5.tgz", + "integrity": "sha512-sseHlcXOqWE4Ner9sg8KsjxwSJ2yssoJNqFHR9liWVbDV+m7kBiUtn2EB690TihzVsEmDr/0Yxrbb5Bniz70mA==" }, "node_modules/@cspell/dict-swift": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-2.0.1.tgz", - "integrity": "sha512-gxrCMUOndOk7xZFmXNtkCEeroZRnS2VbeaIPiymGRHj5H+qfTAzAKxtv7jJbVA3YYvEzWcVE2oKDP4wcbhIERw==" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-2.0.4.tgz", + "integrity": "sha512-CsFF0IFAbRtYNg0yZcdaYbADF5F3DsM8C4wHnZefQy8YcHP/qjAF/GdGfBFBLx+XSthYuBlo2b2XQVdz3cJZBw==" }, "node_modules/@cspell/dict-terraform": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.0.1.tgz", - "integrity": "sha512-29lmUUnZgPh+ieZ5hunick8hzNIpNRtiJh9vAusNskPCrig3RTW6u7F+GG1a8uyslbzSw+Irjf40PTOan1OJJA==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.0.5.tgz", + "integrity": "sha512-qH3epPB2d6d5w1l4hR2OsnN8qDQ4P0z6oDB7+YiNH+BoECXv4Z38MIV1H8cxIzD2wkzkt2JTcFYaVW72MDZAlg==" }, "node_modules/@cspell/dict-typescript": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.6.tgz", - "integrity": "sha512-1beC6O4P/j23VuxX+i0+F7XqPVc3hhiAzGJHEKqnWf5cWAXQtg0xz3xQJ5MvYx2a7iLaSa+lu7+05vG9UHyu9Q==" + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.9.tgz", + "integrity": "sha512-ZtO1/cVWvvR477ftTl2TFR09+IIzXG1rcin8CGYA0FO5WhyDAbn8v3A85QikS158BhTVUoq09lPYuSF9HBzqvw==" }, "node_modules/@cspell/dict-vue": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.0.tgz", - "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.3.tgz", + "integrity": "sha512-akmYbrgAGumqk1xXALtDJcEcOMYBYMnkjpmGzH13Ozhq1mkPF4VgllFQlm1xYde+BUKNnzMgPEzxrL2qZllgYA==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.14.4.tgz", - "integrity": "sha512-GjKsBJvPXp4dYRqsMn7n1zpnKbnpfJnlKLOVeoFBh8fi4n06G50xYr+G25CWX1WT3WFaALAavvVICEUPrVsuqg==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.15.2.tgz", + "integrity": "sha512-37eYzVLqMv3KnY7UMmv/wC9OlUjPC7EJ3xMDourgDTNp6BtiPlMkHRTN5/yvRjukQedi41R1hewgCcZbwSpNXg==", "dependencies": { "import-meta-resolve": "^4.1.0" }, @@ -404,75 +404,29 @@ } }, "node_modules/@cspell/filetypes": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.14.4.tgz", - "integrity": "sha512-qd68dD7xTA4Mnf/wjIKYz2SkiTBshIM+yszOUtLa06YJm0aocoNQ25FHXyYEQYm9NQXCYnRWWA02sFMGs8Sv/w==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.15.2.tgz", + "integrity": "sha512-x2ciWqi6y2RoTcXRTG3BuxAly1TIr4puLzKHkMWtnYp1A++gohCBczMt33FwrwFav0Dfx9M0mCpT1h1ORVwzhA==", "engines": { "node": ">=18" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.14.4.tgz", - "integrity": "sha512-Uyfck64TfVU24wAP3BLGQ5EsAfzIZiLfN90NhttpEM7GlOBmbGrEJd4hNOwfpYsE/TT80eGWQVPRTLr5SDbXFA==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.15.2.tgz", + "integrity": "sha512-FMz3vgyPJjJsg0f78ToprOxR0lPhZOWwidxD+gOMLLfUzJ0mBC4VwoggrgIF6YEdXy/2UoIUtjh5B/Qfge9IDw==", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.14.4.tgz", - "integrity": "sha512-htHhNF8WrM/NfaLSWuTYw0NqVgFRVHYSyHlRT3i/Yv5xvErld8Gw7C6ldm+0TLjoGlUe6X1VV72JSir7+yLp/Q==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.15.2.tgz", + "integrity": "sha512-AxS6nqh65V8BJf+ke7XNsDlieXfq/73XjZ4OxQAHvmML9kgXAbTviDcN6ddj6d2fTgU3EOSU1fBfDOqpS4n6Sg==", "engines": { "node": ">=18.0" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "license": "MIT", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, "node_modules/array-timsort": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", @@ -568,29 +522,28 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cspell": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.14.4.tgz", - "integrity": "sha512-R5Awb3i/RKaVVcZzFt8dkN3M6VnifIEDYBcbzbmYjZ/Eq+ASF+QTmI0E9WPhMEcFM1nd7YOyXnETo560yRdoKw==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.15.2.tgz", + "integrity": "sha512-2XN6LeBAWyRLPUAcKrJTBftNc50VVVeU/j1GVU07hEun4Q4KZG9CbUT+YaZEnZo8xexVUBfZLtB5YxSImCnBtQ==", "dependencies": { - "@cspell/cspell-json-reporter": "8.14.4", - "@cspell/cspell-pipe": "8.14.4", - "@cspell/cspell-types": "8.14.4", - "@cspell/dynamic-import": "8.14.4", - "@cspell/url": "8.14.4", + "@cspell/cspell-json-reporter": "8.15.2", + "@cspell/cspell-pipe": "8.15.2", + "@cspell/cspell-types": "8.15.2", + "@cspell/dynamic-import": "8.15.2", + "@cspell/url": "8.15.2", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-dictionary": "8.14.4", - "cspell-gitignore": "8.14.4", - "cspell-glob": "8.14.4", - "cspell-io": "8.14.4", - "cspell-lib": "8.14.4", - "fast-glob": "^3.3.2", + "cspell-dictionary": "8.15.2", + "cspell-gitignore": "8.15.2", + "cspell-glob": "8.15.2", + "cspell-io": "8.15.2", + "cspell-lib": "8.15.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "get-stdin": "^9.0.0", "semver": "^7.6.3", - "strip-ansi": "^7.1.0" + "tinyglobby": "^0.2.9" }, "bin": { "cspell": "bin.mjs", @@ -604,26 +557,26 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.14.4.tgz", - "integrity": "sha512-cnUeJfniTiebqCaQmIUnbSrPrTH7xzKRQjJDHAEV0WYnOG2MhRXI13OzytdFdhkVBdStmgTzTCJKE7x+kmU2NA==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.15.2.tgz", + "integrity": "sha512-0vaZdp1gz5mt7RWTWStHHJBXfELtbtJNCl8RNz9E51906bhAyZ/yBvkOyjCW2Ofsdp2cKS11AuzTrq6N2lmK3g==", "dependencies": { - "@cspell/cspell-types": "8.14.4", + "@cspell/cspell-types": "8.15.2", "comment-json": "^4.2.5", - "yaml": "^2.5.1" + "yaml": "^2.6.0" }, "engines": { "node": ">=18" } }, "node_modules/cspell-dictionary": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.14.4.tgz", - "integrity": "sha512-pZvQHxpAW5fZAnt3ZKKy3s7M+3CX2t8tCS3uJrpEHIynlCawpG0fPF78rVE5o+g0dON36Lguc/BUuSN4IWKLmQ==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.15.2.tgz", + "integrity": "sha512-Kvn8ZD+oQs2KKgGoC601NBju3xQcrP4bz1MVZ23ZN9fm6pukb0J8x9hP3d+AuQd/Cl2XG/y/hWZi6MT92uChIg==", "dependencies": { - "@cspell/cspell-pipe": "8.14.4", - "@cspell/cspell-types": "8.14.4", - "cspell-trie-lib": "8.14.4", + "@cspell/cspell-pipe": "8.15.2", + "@cspell/cspell-types": "8.15.2", + "cspell-trie-lib": "8.15.2", "fast-equals": "^5.0.1" }, "engines": { @@ -631,13 +584,13 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.14.4.tgz", - "integrity": "sha512-RwfQEW5hD7CpYwS7m3b0ONG0nTLKP6bL2tvMdl7qtaYkL7ztGdsBTtLD1pmwqUsCbiN5RuaOxhYOYeRcpFRIkQ==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.15.2.tgz", + "integrity": "sha512-XrQ3iouv2VvvpkL1ygEnOuqY/BGNt0tBZngFrb/Y12LWgcZ6unLZk4IaMYXlmjRZPtq7QuBe4dvG1D2SFcNEng==", "dependencies": { - "@cspell/url": "8.14.4", - "cspell-glob": "8.14.4", - "cspell-io": "8.14.4", + "@cspell/url": "8.15.2", + "cspell-glob": "8.15.2", + "cspell-io": "8.15.2", "find-up-simple": "^1.0.0" }, "bin": { @@ -648,11 +601,11 @@ } }, "node_modules/cspell-glob": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.14.4.tgz", - "integrity": "sha512-C/xTS5nujMRMuguibq92qMVP767mtxrur7DcVolCvpzcivm1RB5NtIN0OctQxTyMbnmKeQv1t4epRKQ9A8vWRg==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.15.2.tgz", + "integrity": "sha512-AQNskPt3FOF1Z6mc+cvCZ33Xnb+a4cMVZwcLlApc/4uup6OvyEoXNN9IyeHVmloAUPlXadaA79balp3cMj2rWg==", "dependencies": { - "@cspell/url": "8.14.4", + "@cspell/url": "8.15.2", "micromatch": "^4.0.8" }, "engines": { @@ -660,12 +613,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.14.4.tgz", - "integrity": "sha512-yaSKAAJDiamsw3FChbw4HXb2RvTQrDsLelh1+T4MavarOIcAxXrqAJ8ysqm++g+S/ooJz2YO8YWIyzJKxcMf8g==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.15.2.tgz", + "integrity": "sha512-yvCiOlg6G2l+lMWBSmWwnVqIVfDK/uUBzY4WIJQaXWtXRuJ9MdsSEQ3TFd9NgJUhY1gSF8O1zSqeCmfPNuS44g==", "dependencies": { - "@cspell/cspell-pipe": "8.14.4", - "@cspell/cspell-types": "8.14.4" + "@cspell/cspell-pipe": "8.15.2", + "@cspell/cspell-types": "8.15.2" }, "bin": { "cspell-grammar": "bin.mjs" @@ -675,38 +628,38 @@ } }, "node_modules/cspell-io": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.14.4.tgz", - "integrity": "sha512-o6OTWRyx/Az+PFhr1B0wMAwqG070hFC9g73Fkxd8+rHX0rfRS69QZH7LgSmZytqbZIMxCTDGdsLl33MFGWCbZQ==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.15.2.tgz", + "integrity": "sha512-Y4bEsKVXC48VawU+gU1lcsO7B55pNAjc8/C8Qg8UByobSOxtZKd7jaRRqqvd60Rh8lbgG4Nc05zKCb1CxY1+2Q==", "dependencies": { - "@cspell/cspell-service-bus": "8.14.4", - "@cspell/url": "8.14.4" + "@cspell/cspell-service-bus": "8.15.2", + "@cspell/url": "8.15.2" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.14.4.tgz", - "integrity": "sha512-qdkUkKtm+nmgpA4jQbmQTuepDfjHBDWvs3zDuEwVIVFq/h8gnXrRr75gJ3RYdTy+vOOqHPoLLqgxyqkUUrUGXA==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.15.2.tgz", + "integrity": "sha512-u4tO8NoLq/LuOdCBqJdKBLE51uCcE2Ni/DvaEFNfuhk2fCF3rE/2nCzLx6ZEAiFPHZVMs44MJxpH7VF8Rn/T8g==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.14.4", - "@cspell/cspell-pipe": "8.14.4", - "@cspell/cspell-resolver": "8.14.4", - "@cspell/cspell-types": "8.14.4", - "@cspell/dynamic-import": "8.14.4", - "@cspell/filetypes": "8.14.4", - "@cspell/strong-weak-map": "8.14.4", - "@cspell/url": "8.14.4", + "@cspell/cspell-bundled-dicts": "8.15.2", + "@cspell/cspell-pipe": "8.15.2", + "@cspell/cspell-resolver": "8.15.2", + "@cspell/cspell-types": "8.15.2", + "@cspell/dynamic-import": "8.15.2", + "@cspell/filetypes": "8.15.2", + "@cspell/strong-weak-map": "8.15.2", + "@cspell/url": "8.15.2", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.14.4", - "cspell-dictionary": "8.14.4", - "cspell-glob": "8.14.4", - "cspell-grammar": "8.14.4", - "cspell-io": "8.14.4", - "cspell-trie-lib": "8.14.4", + "cspell-config-lib": "8.15.2", + "cspell-dictionary": "8.15.2", + "cspell-glob": "8.15.2", + "cspell-grammar": "8.15.2", + "cspell-io": "8.15.2", + "cspell-trie-lib": "8.15.2", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -721,12 +674,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.14.4", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.14.4.tgz", - "integrity": "sha512-zu8EJ33CH+FA5lwTRGqS//Q6phO0qtgEmODMR1KPlD7WlrfTFMb3bWFsLo/tiv5hjpsn7CM6dYDAAgBOSkoyhQ==", + "version": "8.15.2", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.15.2.tgz", + "integrity": "sha512-dqEc4832iareVCA+pXuvdNwtUF+F8S+w15Tlv0fRdPTz8X4wcUtK0R5npYnL5dyuPhKBdO/PmKXGb7/5I0vBMg==", "dependencies": { - "@cspell/cspell-pipe": "8.14.4", - "@cspell/cspell-types": "8.14.4", + "@cspell/cspell-pipe": "8.15.2", + "@cspell/cspell-types": "8.15.2", "gensequence": "^7.0.0" }, "engines": { @@ -764,37 +717,12 @@ "node": ">=6.0.0" } }, - "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "license": "MIT" }, - "node_modules/fastq": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz", - "integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==", - "license": "ISC", - "dependencies": { - "reusify": "^1.0.4" - } - }, "node_modules/file-entry-cache": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-9.1.0.tgz", @@ -865,18 +793,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/global-directory": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", @@ -950,27 +866,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "license": "MIT", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -992,15 +887,6 @@ "json-buffer": "3.0.1" } }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -1028,7 +914,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "license": "MIT", "engines": { "node": ">=8.6" }, @@ -1036,26 +921,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, "node_modules/repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", @@ -1072,39 +937,6 @@ "node": ">=8" } }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "license": "MIT", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", @@ -1116,18 +948,40 @@ "node": ">=10" } }, - "node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "node_modules/tinyglobby": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.9.tgz", + "integrity": "sha512-8or1+BGEdk1Zkkw2ii16qSS7uVrQJPre5A9o/XkWPATkk23FZh/15BKFxPnlTy6vkljZxLqYCzzBMj30ZrSvjw==", "dependencies": { - "ansi-regex": "^6.0.1" + "fdir": "^6.4.0", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.0.tgz", + "integrity": "sha512-3oB133prH1o4j/L5lLW7uOCF1PlD+/It2L0eL/iAqWMB91RBbqTewABqxhj0ibBd90EEmWZq7ntIWzVaWcXTGQ==", + "peerDependencies": { + "picomatch": "^3 || ^4" }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/to-regex-range": { @@ -1163,9 +1017,9 @@ } }, "node_modules/yaml": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", - "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.0.tgz", + "integrity": "sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==", "bin": { "yaml": "bin.mjs" }, diff --git a/package.json b/package.json index 443aa36c19..b9434bb6c8 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.14.4" + "cspell": "^8.15.2" } } From 9d4047bc88e93bf3c5ee2540b1bd316acba94c94 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:51:37 +0200 Subject: [PATCH 418/845] Bump Roslynator.Analyzers from 4.12.7 to 4.12.8 (#2781) Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.12.7 to 4.12.8. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.12.7...v4.12.8) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 1427c9b6e3..6480dd2144 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 0c621ce09d4b6cb8cd8ee908df904f6f6e6a21b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:56:18 +0200 Subject: [PATCH 419/845] Bump the nuke group with 2 updates (#2780) Bumps the nuke group with 2 updates: [Nuke.Common](https://github.com/nuke-build/nuke) and [Nuke.Components](https://github.com/nuke-build/nuke). Updates `Nuke.Common` from 8.1.1 to 8.1.2 - [Release notes](https://github.com/nuke-build/nuke/releases) - [Changelog](https://github.com/nuke-build/nuke/blob/develop/CHANGELOG.md) - [Commits](https://github.com/nuke-build/nuke/compare/8.1.1...8.1.2) Updates `Nuke.Components` from 8.1.1 to 8.1.2 - [Release notes](https://github.com/nuke-build/nuke/releases) - [Changelog](https://github.com/nuke-build/nuke/blob/develop/CHANGELOG.md) - [Commits](https://github.com/nuke-build/nuke/compare/8.1.1...8.1.2) --- updated-dependencies: - dependency-name: Nuke.Common dependency-type: direct:production update-type: version-update:semver-patch dependency-group: nuke - dependency-name: Nuke.Components dependency-type: direct:production update-type: version-update:semver-patch dependency-group: nuke ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index b344ee6cb9..65d6f2de45 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -6,7 +6,7 @@ CS0649;CS0169 ..\ ..\ - 8.1.1 + 8.1.2 OS_WINDOWS From 50961b72884f0289800b90b1d58f33034bd57d13 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:57:45 +0200 Subject: [PATCH 420/845] Bump the xunit group with 3 updates (#2779) Bumps the xunit group with 3 updates: [Verify.DiffPlex](https://github.com/VerifyTests/Verify.DiffPlex), [System.Collections.Immutable](https://github.com/dotnet/runtime) and [Verify.Xunit](https://github.com/VerifyTests/Verify). Updates `Verify.DiffPlex` from 3.1.0 to 3.1.2 - [Release notes](https://github.com/VerifyTests/Verify.DiffPlex/releases) - [Commits](https://github.com/VerifyTests/Verify.DiffPlex/compare/3.1.0...3.1.2) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) Updates `Verify.Xunit` from 26.6.0 to 27.0.1 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/26.6.0...27.0.1) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) --- updated-dependencies: - dependency-name: Verify.DiffPlex dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 050c096b82..205354d423 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -12,8 +12,8 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + From f7ab35b3ae32e918711af04add8698b238cd93f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:30:35 +0200 Subject: [PATCH 421/845] Bump cspell from 8.15.2 to 8.15.4 (#2784) Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.15.2 to 8.15.4. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.15.4/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 226 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 114 insertions(+), 114 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0c4b138ae7..cb5788aaa6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.15.2" + "cspell": "^8.15.4" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.15.2.tgz", - "integrity": "sha512-e+hxoD/GW7iyK1zMeRFd10yBr9tcClnnqFLxJM+tH1cSzLQ66ouXMIMuJpcd8LOCm7zMRdjTm4R72LehMgL79g==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.15.4.tgz", + "integrity": "sha512-t5b2JwGeUmzmjl319mCuaeKGxTvmzLLRmrpdHr+ZZGRO4nf7L48Lbe9A6uwNUvsZe0cXohiNXsrrsuzRVXswVA==", "dependencies": { "@cspell/dict-ada": "^4.0.5", "@cspell/dict-aws": "^4.0.7", @@ -25,7 +25,7 @@ "@cspell/dict-css": "^4.0.16", "@cspell/dict-dart": "^2.2.4", "@cspell/dict-django": "^4.1.3", - "@cspell/dict-docker": "^1.1.10", + "@cspell/dict-docker": "^1.1.11", "@cspell/dict-dotnet": "^5.0.8", "@cspell/dict-elixir": "^4.0.6", "@cspell/dict-en_us": "^4.3.26", @@ -56,17 +56,17 @@ "@cspell/dict-php": "^4.0.13", "@cspell/dict-powershell": "^5.0.13", "@cspell/dict-public-licenses": "^2.0.11", - "@cspell/dict-python": "^4.2.11", + "@cspell/dict-python": "^4.2.12", "@cspell/dict-r": "^2.0.4", "@cspell/dict-ruby": "^5.0.7", "@cspell/dict-rust": "^4.0.9", "@cspell/dict-scala": "^5.0.6", - "@cspell/dict-software-terms": "^4.1.10", + "@cspell/dict-software-terms": "^4.1.11", "@cspell/dict-sql": "^2.1.8", "@cspell/dict-svelte": "^1.0.5", "@cspell/dict-swift": "^2.0.4", "@cspell/dict-terraform": "^1.0.5", - "@cspell/dict-typescript": "^3.1.9", + "@cspell/dict-typescript": "^3.1.10", "@cspell/dict-vue": "^3.0.3" }, "engines": { @@ -74,28 +74,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.15.2.tgz", - "integrity": "sha512-6p9eLdO5RLb1HNf+Rto4RG3tG02y05DutrWdpnK1Agn21EbUKAUIdIcsjQ2N52UeVT5cDvNhkAabKN57sFygag==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.15.4.tgz", + "integrity": "sha512-solraYhZG4l++NeVCOtpc8DMvwHc46TmJt8DQbgvKtk6wOjTEcFrwKfA6Ei9YKbvyebJlpWMenO3goOll0loYg==", "dependencies": { - "@cspell/cspell-types": "8.15.2" + "@cspell/cspell-types": "8.15.4" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.15.2.tgz", - "integrity": "sha512-TOcLiRiUSh75y+DQrAW59Ix0/D9WPrd4/KPtUShUepS3vLfoxMQ+TwpXfdc8FrzU73Hg5glXXnQjvdx7vAazVQ==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.15.4.tgz", + "integrity": "sha512-WfCmZVFC6mX6vYlf02hWwelcSBTbDQgc5YqY+1miuMk+OHSUAHSACjZId6/a4IAID94xScvFfj7jgrdejUVvIQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.15.2.tgz", - "integrity": "sha512-XOcHfkKCN+a3zZMexK/BLmDxsqku8Q5ASqYu7JBFsu/axS4K11bkcQMxYoOvHVGBv20vb/gM2D+9MePuxAfssg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.15.4.tgz", + "integrity": "sha512-Zr428o+uUTqywrdKyjluJVnDPVAJEqZ1chQLKIrHggUah1cgs5aQ7rZ+0Rv5euYMlC2idZnP7IL6TDaIib80oA==", "dependencies": { "global-directory": "^4.0.1" }, @@ -104,17 +104,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.15.2.tgz", - "integrity": "sha512-g9rhMIU0DX+avIQHFu0Mx3LAFi4lG6zX8iFa2zu+u3ll0IX0WtxTqrzft27jYSwebmm/ysWJUcOY+SWhZfPA0Q==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.15.4.tgz", + "integrity": "sha512-pXYofnV/V9Y3LZdfFGbmhdxPX/ABjiD3wFjGHt5YhIU9hjVVuvjFlgY7pH2AvRjs4F8xKXv1ReWl44BJOL9gLA==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.15.2.tgz", - "integrity": "sha512-bHAkXsrfOhKyZZ+TA5eGH3fqh9DPcP3a2v+ozTnhhZa3zcfuzX7rZnYWEFA8LELMUStWXLECzFoGd9QUEHMstg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.15.4.tgz", + "integrity": "sha512-1hDtgYDQVW11zgtrr12EmGW45Deoi7IjZOhzPFLb+3WkhZ46ggWdbrRalWwBolQPDDo6+B2Q6WXz5hdND+Tpwg==", "engines": { "node": ">=18" } @@ -175,9 +175,9 @@ "integrity": "sha512-yBspeL3roJlO0a1vKKNaWABURuHdHZ9b1L8d3AukX0AsBy9snSggc8xCavPmSzNfeMDXbH+1lgQiYBd3IW03fg==" }, "node_modules/@cspell/dict-docker": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.10.tgz", - "integrity": "sha512-vWybMfsG/8jhN6kmPoilMon36GB3+Ef+m/mgYUfY8tJN23K/x4KD1rU1OOiNWzDqePhu3MMWVKO5W5x6VI6Gbw==" + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.11.tgz", + "integrity": "sha512-s0Yhb16/R+UT1y727ekbR/itWQF3Qz275DR1ahOa66wYtPjHUXmhM3B/LT3aPaX+hD6AWmK23v57SuyfYHUjsw==" }, "node_modules/@cspell/dict-dotnet": { "version": "5.0.8", @@ -330,9 +330,9 @@ "integrity": "sha512-rR5KjRUSnVKdfs5G+gJ4oIvQvm8+NJ6cHWY2N+GE69/FSGWDOPHxulCzeGnQU/c6WWZMSimG9o49i9r//lUQyA==" }, "node_modules/@cspell/dict-python": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.11.tgz", - "integrity": "sha512-bshNZqP5FYRO0CtZ9GgtVjHidrSuRRF537MU/sPew8oaqWPg066F9KQfPllbRi9AzFqqeS2l7/ACYUrFMe21gw==", + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.12.tgz", + "integrity": "sha512-U25eOFu+RE0aEcF2AsxZmq3Lic7y9zspJ9SzjrC0mfJz+yr3YmSCw4E0blMD3mZoNcf7H/vMshuKIY5AY36U+Q==", "dependencies": { "@cspell/dict-data-science": "^2.0.5" } @@ -358,9 +358,9 @@ "integrity": "sha512-tl0YWAfjUVb4LyyE4JIMVE8DlLzb1ecHRmIWc4eT6nkyDqQgHKzdHsnusxFEFMVLIQomgSg0Zz6hJ5S1E4W4ww==" }, "node_modules/@cspell/dict-software-terms": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.10.tgz", - "integrity": "sha512-+9PuQ9MHQhlET6Hv1mGcWDh6Rb+StzjBMrjfksDeBHBIVdT66u9uCkaZapIzfgktflY4m9oK7+dEynr+BAxvtQ==" + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.11.tgz", + "integrity": "sha512-77CTHxWFTVw6tVoMN8WBMrlNW2F2FbgATwD/6vcOuiyrJUmh8klN5ZK3m+yyK3ZzsnaW2Bduoc0fw2Ckcm/riQ==" }, "node_modules/@cspell/dict-sql": { "version": "2.1.8", @@ -383,9 +383,9 @@ "integrity": "sha512-qH3epPB2d6d5w1l4hR2OsnN8qDQ4P0z6oDB7+YiNH+BoECXv4Z38MIV1H8cxIzD2wkzkt2JTcFYaVW72MDZAlg==" }, "node_modules/@cspell/dict-typescript": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.9.tgz", - "integrity": "sha512-ZtO1/cVWvvR477ftTl2TFR09+IIzXG1rcin8CGYA0FO5WhyDAbn8v3A85QikS158BhTVUoq09lPYuSF9HBzqvw==" + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.10.tgz", + "integrity": "sha512-7Zek3w4Rh3ZYyhihJ34FdnUBwP3OmRldnEq3hZ+FgQ0PyYZjXv5ztEViRBBxXjiFx1nHozr6pLi74TxToD8xsg==" }, "node_modules/@cspell/dict-vue": { "version": "3.0.3", @@ -393,9 +393,9 @@ "integrity": "sha512-akmYbrgAGumqk1xXALtDJcEcOMYBYMnkjpmGzH13Ozhq1mkPF4VgllFQlm1xYde+BUKNnzMgPEzxrL2qZllgYA==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.15.2.tgz", - "integrity": "sha512-37eYzVLqMv3KnY7UMmv/wC9OlUjPC7EJ3xMDourgDTNp6BtiPlMkHRTN5/yvRjukQedi41R1hewgCcZbwSpNXg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.15.4.tgz", + "integrity": "sha512-tr0F6EYN6qtniNvt1Uib+PgYQHeo4dQHXE2Optap+hYTOoQ2VoQ+SwBVjZ+Q2bmSAB0fmOyf0AvgsUtnWIpavw==", "dependencies": { "import-meta-resolve": "^4.1.0" }, @@ -404,25 +404,25 @@ } }, "node_modules/@cspell/filetypes": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.15.2.tgz", - "integrity": "sha512-x2ciWqi6y2RoTcXRTG3BuxAly1TIr4puLzKHkMWtnYp1A++gohCBczMt33FwrwFav0Dfx9M0mCpT1h1ORVwzhA==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.15.4.tgz", + "integrity": "sha512-sNl6jr3ym/4151EY76qlI/00HHsiLZBqW7Vb1tqCzsgSg3EpL30ddjr74So6Sg2PN26Yf09hvxGTJzXn1R4aYw==", "engines": { "node": ">=18" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.15.2.tgz", - "integrity": "sha512-FMz3vgyPJjJsg0f78ToprOxR0lPhZOWwidxD+gOMLLfUzJ0mBC4VwoggrgIF6YEdXy/2UoIUtjh5B/Qfge9IDw==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.15.4.tgz", + "integrity": "sha512-m5DeQksbhJFqcSYF8Q0Af/WXmXCMAJocCUShkzOXK+uZNXnvhBZN7VyQ9hL+GRzX8JTPEPdVcz2lFyVE5p+LzQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.15.2.tgz", - "integrity": "sha512-AxS6nqh65V8BJf+ke7XNsDlieXfq/73XjZ4OxQAHvmML9kgXAbTviDcN6ddj6d2fTgU3EOSU1fBfDOqpS4n6Sg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.15.4.tgz", + "integrity": "sha512-K2oZu/oLQPs5suRpLS8uu04O3YMUioSlEU1D66fRoOxzI5NzLt7i7yMg3HQHjChGa09N5bzqmrVdhmQrRZXwGg==", "engines": { "node": ">=18.0" } @@ -522,23 +522,23 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cspell": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.15.2.tgz", - "integrity": "sha512-2XN6LeBAWyRLPUAcKrJTBftNc50VVVeU/j1GVU07hEun4Q4KZG9CbUT+YaZEnZo8xexVUBfZLtB5YxSImCnBtQ==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.15.4.tgz", + "integrity": "sha512-hUOxcwmNWuHzVeGHyN5v/T9MkyCE5gi0mvatxsM794B2wOuR1ZORgjZH62P2HY1uBkXe/x5C6ITWrSyh0WgAcg==", "dependencies": { - "@cspell/cspell-json-reporter": "8.15.2", - "@cspell/cspell-pipe": "8.15.2", - "@cspell/cspell-types": "8.15.2", - "@cspell/dynamic-import": "8.15.2", - "@cspell/url": "8.15.2", + "@cspell/cspell-json-reporter": "8.15.4", + "@cspell/cspell-pipe": "8.15.4", + "@cspell/cspell-types": "8.15.4", + "@cspell/dynamic-import": "8.15.4", + "@cspell/url": "8.15.4", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-dictionary": "8.15.2", - "cspell-gitignore": "8.15.2", - "cspell-glob": "8.15.2", - "cspell-io": "8.15.2", - "cspell-lib": "8.15.2", + "cspell-dictionary": "8.15.4", + "cspell-gitignore": "8.15.4", + "cspell-glob": "8.15.4", + "cspell-io": "8.15.4", + "cspell-lib": "8.15.4", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "get-stdin": "^9.0.0", @@ -557,11 +557,11 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.15.2.tgz", - "integrity": "sha512-0vaZdp1gz5mt7RWTWStHHJBXfELtbtJNCl8RNz9E51906bhAyZ/yBvkOyjCW2Ofsdp2cKS11AuzTrq6N2lmK3g==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.15.4.tgz", + "integrity": "sha512-vUgikQTRkRMTdkZqSs7F2cTdPpX61cTjr/9L/VCkXkbW38ObCr4650ioiF1Wq3zDF3Gy2bc4ECTpD2PZUXX5SA==", "dependencies": { - "@cspell/cspell-types": "8.15.2", + "@cspell/cspell-types": "8.15.4", "comment-json": "^4.2.5", "yaml": "^2.6.0" }, @@ -570,13 +570,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.15.2.tgz", - "integrity": "sha512-Kvn8ZD+oQs2KKgGoC601NBju3xQcrP4bz1MVZ23ZN9fm6pukb0J8x9hP3d+AuQd/Cl2XG/y/hWZi6MT92uChIg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.15.4.tgz", + "integrity": "sha512-8+p/l9Saac7qyCbqtELneDoT7CwHu9gYmnI8uXMu34/lPGjhVhy10ZeI0+t1djaO2YyASK400YFKq5uP/5KulA==", "dependencies": { - "@cspell/cspell-pipe": "8.15.2", - "@cspell/cspell-types": "8.15.2", - "cspell-trie-lib": "8.15.2", + "@cspell/cspell-pipe": "8.15.4", + "@cspell/cspell-types": "8.15.4", + "cspell-trie-lib": "8.15.4", "fast-equals": "^5.0.1" }, "engines": { @@ -584,13 +584,13 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.15.2.tgz", - "integrity": "sha512-XrQ3iouv2VvvpkL1ygEnOuqY/BGNt0tBZngFrb/Y12LWgcZ6unLZk4IaMYXlmjRZPtq7QuBe4dvG1D2SFcNEng==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.15.4.tgz", + "integrity": "sha512-9n5PpQ8gEf8YcvEtoZGZ2Ma6wnqSFkD2GrmyjISy39DfIX/jNLN7GX2wJm6OD2P4FjXer95ypmIb/JWTlfmbTw==", "dependencies": { - "@cspell/url": "8.15.2", - "cspell-glob": "8.15.2", - "cspell-io": "8.15.2", + "@cspell/url": "8.15.4", + "cspell-glob": "8.15.4", + "cspell-io": "8.15.4", "find-up-simple": "^1.0.0" }, "bin": { @@ -601,11 +601,11 @@ } }, "node_modules/cspell-glob": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.15.2.tgz", - "integrity": "sha512-AQNskPt3FOF1Z6mc+cvCZ33Xnb+a4cMVZwcLlApc/4uup6OvyEoXNN9IyeHVmloAUPlXadaA79balp3cMj2rWg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.15.4.tgz", + "integrity": "sha512-TTfRRHRAN+PN9drIz4MAEgKKYnPThBOlPMdFddyuisvU33Do1sPAnqkkOjTEFdi3jAA5KwnSva68SVH6IzzMBQ==", "dependencies": { - "@cspell/url": "8.15.2", + "@cspell/url": "8.15.4", "micromatch": "^4.0.8" }, "engines": { @@ -613,12 +613,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.15.2.tgz", - "integrity": "sha512-yvCiOlg6G2l+lMWBSmWwnVqIVfDK/uUBzY4WIJQaXWtXRuJ9MdsSEQ3TFd9NgJUhY1gSF8O1zSqeCmfPNuS44g==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.15.4.tgz", + "integrity": "sha512-MKiKyYi05mRtXOxPoTv3Ksi0GwYLiK84Uq0C+5PaMrnIjXeed0bsddSFXCT+7ywFJc7PdjhTtz0M/9WWK3UgbA==", "dependencies": { - "@cspell/cspell-pipe": "8.15.2", - "@cspell/cspell-types": "8.15.2" + "@cspell/cspell-pipe": "8.15.4", + "@cspell/cspell-types": "8.15.4" }, "bin": { "cspell-grammar": "bin.mjs" @@ -628,38 +628,38 @@ } }, "node_modules/cspell-io": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.15.2.tgz", - "integrity": "sha512-Y4bEsKVXC48VawU+gU1lcsO7B55pNAjc8/C8Qg8UByobSOxtZKd7jaRRqqvd60Rh8lbgG4Nc05zKCb1CxY1+2Q==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.15.4.tgz", + "integrity": "sha512-rXIEREPTFV9dwwg4EKfvzqlCNOvT6910AYED5YrSt8Y68usRJ9lbqdx0BrDndVCd33bp1o+9JBfHuRiFIQC81g==", "dependencies": { - "@cspell/cspell-service-bus": "8.15.2", - "@cspell/url": "8.15.2" + "@cspell/cspell-service-bus": "8.15.4", + "@cspell/url": "8.15.4" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.15.2.tgz", - "integrity": "sha512-u4tO8NoLq/LuOdCBqJdKBLE51uCcE2Ni/DvaEFNfuhk2fCF3rE/2nCzLx6ZEAiFPHZVMs44MJxpH7VF8Rn/T8g==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.15.4.tgz", + "integrity": "sha512-iLp/625fvCyFFxSyZYLMgqHIKcrhN4hT7Hw5+ySa38Bp/OfA81ANqWHpsDQ0bGsALTRn/DHBpQYj4xCW/aN9tw==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.15.2", - "@cspell/cspell-pipe": "8.15.2", - "@cspell/cspell-resolver": "8.15.2", - "@cspell/cspell-types": "8.15.2", - "@cspell/dynamic-import": "8.15.2", - "@cspell/filetypes": "8.15.2", - "@cspell/strong-weak-map": "8.15.2", - "@cspell/url": "8.15.2", + "@cspell/cspell-bundled-dicts": "8.15.4", + "@cspell/cspell-pipe": "8.15.4", + "@cspell/cspell-resolver": "8.15.4", + "@cspell/cspell-types": "8.15.4", + "@cspell/dynamic-import": "8.15.4", + "@cspell/filetypes": "8.15.4", + "@cspell/strong-weak-map": "8.15.4", + "@cspell/url": "8.15.4", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.15.2", - "cspell-dictionary": "8.15.2", - "cspell-glob": "8.15.2", - "cspell-grammar": "8.15.2", - "cspell-io": "8.15.2", - "cspell-trie-lib": "8.15.2", + "cspell-config-lib": "8.15.4", + "cspell-dictionary": "8.15.4", + "cspell-glob": "8.15.4", + "cspell-grammar": "8.15.4", + "cspell-io": "8.15.4", + "cspell-trie-lib": "8.15.4", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -674,12 +674,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.15.2.tgz", - "integrity": "sha512-dqEc4832iareVCA+pXuvdNwtUF+F8S+w15Tlv0fRdPTz8X4wcUtK0R5npYnL5dyuPhKBdO/PmKXGb7/5I0vBMg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.15.4.tgz", + "integrity": "sha512-sg9klsNHyrfos0Boiio+qy5d6fI9cCNjBqFYrNxvpKpwZ4gEzDzjgEKdZY1C76RD2KoBQ8I1NF5YcGc0+hhhCw==", "dependencies": { - "@cspell/cspell-pipe": "8.15.2", - "@cspell/cspell-types": "8.15.2", + "@cspell/cspell-pipe": "8.15.4", + "@cspell/cspell-types": "8.15.4", "gensequence": "^7.0.0" }, "engines": { diff --git a/package.json b/package.json index b9434bb6c8..9a329ea4a1 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.15.2" + "cspell": "^8.15.4" } } From 0fbf583bf5794acceec3a1b3adf2425175e4b06f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:30:51 +0200 Subject: [PATCH 422/845] Bump Meziantou.Analyzer from 2.0.169 to 2.0.173 (#2785) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.169 to 2.0.173. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.169...2.0.173) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 6480dd2144..a3a4bfca87 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From a56ce06c6f78f8c0c856ac3b9336aca7720f06ef Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 27 Aug 2023 20:04:52 +0200 Subject: [PATCH 423/845] Refactored parts of AssertionScope into AssertionChain and used that to improve the identifier in .Which constructs. --- .editorconfig | 5 + Build/Build.cs | 4 - FluentAssertions.sln | 1 - FluentAssertions.sln.DotSettings | 14 +- Src/FluentAssertions/AndWhichConstraint.cs | 100 +- Src/FluentAssertions/AssertionExtensions.cs | 133 +- .../GenericCollectionAssertions.cs | 1089 +++++++++-------- .../GenericDictionaryAssertions.cs | 186 ++- .../Collections/StringCollectionAssertions.cs | 68 +- .../SubsequentOrderingAssertions.cs | 5 +- ...uentOrderingGenericCollectionAssertions.cs | 9 +- .../Common/MethodInfoExtensions.cs | 1 - .../Common/ObjectExtensions.cs | 9 + .../Common/StringExtensions.cs | 12 + .../CustomAssertionAttribute.cs | 2 +- .../CustomAssertionsAssemblyAttribute.cs | 2 +- .../EnumAssertionsExtensions.cs | 5 +- .../Equivalency/AssertionChainExtensions.cs | 19 + .../Equivalency/EquivalencyStep.cs | 2 +- .../EquivalencyValidationContext.cs | 2 +- .../Equivalency/EquivalencyValidator.cs | 31 +- .../Execution/CyclicReferenceDetector.cs | 13 +- .../Equivalency/IEquivalencyStep.cs | 3 +- .../Equivalency/IMemberMatchingRule.cs | 11 +- .../Matching/MappedMemberMatchingRule.cs | 3 +- .../Matching/MappedPathMatchingRule.cs | 3 +- .../Matching/MustMatchByNameRule.cs | 6 +- .../Matching/TryMatchByNameRule.cs | 3 +- .../MultiDimensionalArrayEquivalencyStep.cs | 31 +- Src/FluentAssertions/Equivalency/Node.cs | 11 +- .../Equivalency/Steps/AssertionResultSet.cs | 2 +- .../Steps/AssertionRuleEquivalencyStep.cs | 30 +- .../Steps/DictionaryEquivalencyStep.cs | 40 +- .../Steps/DictionaryInterfaceInfo.cs | 6 +- .../Equivalency/Steps/EnumEqualityStep.cs | 18 +- .../Steps/EnumerableEquivalencyStep.cs | 16 +- .../Steps/EnumerableEquivalencyValidator.cs | 31 +- ...numerableEquivalencyValidatorExtensions.cs | 54 +- .../Steps/EqualityComparerEquivalencyStep.cs | 3 +- .../Steps/GenericDictionaryEquivalencyStep.cs | 68 +- .../Steps/GenericEnumerableEquivalencyStep.cs | 18 +- .../Steps/SimpleEqualityEquivalencyStep.cs | 6 + .../Steps/StringEqualityEquivalencyStep.cs | 25 +- .../StructuralEqualityEquivalencyStep.cs | 14 +- .../Steps/ValueTypeEquivalencyStep.cs | 5 + .../Steps/XAttributeEquivalencyStep.cs | 8 +- .../Steps/XDocumentEquivalencyStep.cs | 8 +- .../Steps/XElementEquivalencyStep.cs | 8 +- .../EventRaisingExtensions.cs | 13 +- .../Events/EventAssertions.cs | 20 +- Src/FluentAssertions/Events/EventMonitor.cs | 3 +- .../ExceptionAssertionsExtensions.cs | 3 +- .../Execution/AssertionChain.cs | 362 ++++++ .../Execution/AssertionScope.cs | 385 +----- .../Execution/ContextDataDictionary.cs | 9 +- .../Execution/Continuation.cs | 26 +- .../Execution/ContinuationOfGiven.cs | 17 +- .../Execution/ContinuedAssertionScope.cs | 156 --- Src/FluentAssertions/Execution/Execute.cs | 21 - Src/FluentAssertions/Execution/FailReason.cs | 6 +- ...eBuilder.cs => FailureMessageFormatter.cs} | 119 +- .../Execution/GivenSelector.cs | 68 +- .../Execution/IAssertionScope.cs | 186 --- .../Formatting/FormattedObjectGraph.cs | 19 +- Src/FluentAssertions/Formatting/Formatter.cs | 4 +- .../Formatting/MethodInfoFormatter.cs | 36 + .../Formatting/PropertyInfoFormatter.cs | 9 +- .../Numeric/ByteAssertions.cs | 5 +- .../Numeric/ComparableTypeAssertions.cs | 34 +- .../Numeric/DecimalAssertions.cs | 5 +- .../Numeric/DoubleAssertions.cs | 5 +- .../Numeric/Int16Assertions.cs | 5 +- .../Numeric/Int32Assertions.cs | 5 +- .../Numeric/Int64Assertions.cs | 5 +- .../Numeric/NullableByteAssertions.cs | 5 +- .../Numeric/NullableDecimalAssertions.cs | 5 +- .../Numeric/NullableDoubleAssertions.cs | 5 +- .../Numeric/NullableInt16Assertions.cs | 5 +- .../Numeric/NullableInt32Assertions.cs | 5 +- .../Numeric/NullableInt64Assertions.cs | 5 +- .../Numeric/NullableNumericAssertions.cs | 17 +- .../Numeric/NullableSByteAssertions.cs | 5 +- .../Numeric/NullableSingleAssertions.cs | 5 +- .../Numeric/NullableUInt16Assertions.cs | 5 +- .../Numeric/NullableUInt32Assertions.cs | 5 +- .../Numeric/NullableUInt64Assertions.cs | 5 +- .../Numeric/NumericAssertions.cs | 48 +- .../Numeric/SByteAssertions.cs | 5 +- .../Numeric/SingleAssertions.cs | 5 +- .../Numeric/UInt16Assertions.cs | 5 +- .../Numeric/UInt32Assertions.cs | 5 +- .../Numeric/UInt64Assertions.cs | 5 +- .../NumericAssertionsExtensions.cs | 194 ++- .../ObjectAssertionsExtensions.cs | 5 +- Src/FluentAssertions/OccurrenceConstraint.cs | 5 +- .../Primitives/BooleanAssertions.cs | 38 +- .../Primitives/DateOnlyAssertions.cs | 136 +- .../Primitives/DateTimeAssertions.cs | 337 +++-- .../Primitives/DateTimeOffsetAssertions.cs | 388 +++--- .../DateTimeOffsetRangeAssertions.cs | 17 +- .../Primitives/DateTimeRangeAssertions.cs | 17 +- .../Primitives/EnumAssertions.cs | 79 +- .../Primitives/GuidAssertions.cs | 17 +- .../HttpResponseMessageAssertions.cs | 53 +- .../Primitives/IStringComparisonStrategy.cs | 2 +- .../Primitives/NullableBooleanAssertions.cs | 23 +- .../Primitives/NullableDateOnlyAssertions.cs | 15 +- .../Primitives/NullableDateTimeAssertions.cs | 15 +- .../NullableDateTimeOffsetAssertions.cs | 15 +- .../Primitives/NullableEnumAssertions.cs | 17 +- .../Primitives/NullableGuidAssertions.cs | 17 +- .../NullableSimpleTimeSpanAssertions.cs | 17 +- .../Primitives/NullableTimeOnlyAssertions.cs | 15 +- .../Primitives/ObjectAssertions.cs | 39 +- .../Primitives/ReferenceTypeAssertions.cs | 75 +- .../Primitives/SimpleTimeSpanAssertions.cs | 29 +- .../Primitives/StringAssertions.cs | 141 +-- .../Primitives/StringContainsStrategy.cs | 4 +- .../Primitives/StringEndStrategy.cs | 12 +- .../Primitives/StringEqualityStrategy.cs | 20 +- .../Primitives/StringStartStrategy.cs | 12 +- .../Primitives/StringValidator.cs | 14 +- .../StringValidatorSupportingNull.cs | 11 +- .../StringWildcardMatchingStrategy.cs | 6 +- .../Primitives/TimeOnlyAssertions.cs | 176 ++- .../Specialized/ActionAssertions.cs | 22 +- .../Specialized/AsyncFunctionAssertions.cs | 71 +- .../Specialized/DelegateAssertions.cs | 34 +- .../Specialized/DelegateAssertionsBase.cs | 40 +- .../Specialized/ExceptionAssertions.cs | 99 +- .../Specialized/ExecutionTimeAssertions.cs | 14 +- .../Specialized/FunctionAssertionHelpers.cs | 57 - .../Specialized/FunctionAssertions.cs | 71 +- .../GenericAsyncFunctionAssertions.cs | 41 +- .../NonGenericAsyncFunctionAssertions.cs | 32 +- .../TaskCompletionSourceAssertions.cs | 44 +- .../Streams/BufferedStreamAssertions.cs | 44 +- .../Streams/StreamAssertions.cs | 103 +- .../Types/AssemblyAssertions.cs | 57 +- .../Types/ConstructorInfoAssertions.cs | 16 +- .../Types/MemberInfoAssertions.cs | 21 +- .../Types/MethodBaseAssertions.cs | 41 +- .../Types/MethodInfoAssertions.cs | 57 +- .../Types/MethodInfoSelectorAssertions.cs | 21 +- .../Types/PropertyInfoAssertions.cs | 250 ++-- .../Types/PropertyInfoSelectorAssertions.cs | 20 +- Src/FluentAssertions/Types/TypeAssertions.cs | 396 +++--- .../Types/TypeSelectorAssertions.cs | 33 +- .../Xml/Equivalency/XmlReaderValidator.cs | 12 +- .../Xml/XAttributeAssertions.cs | 17 +- .../Xml/XDocumentAssertions.cs | 39 +- .../Xml/XElementAssertions.cs | 47 +- .../Xml/XmlElementAssertions.cs | 19 +- Src/FluentAssertions/Xml/XmlNodeAssertions.cs | 16 +- .../XmlAssertionExtensions.cs | 5 +- .../FluentAssertions/net47.verified.txt | 308 +++-- .../FluentAssertions/net6.0.verified.txt | 328 +++-- .../netstandard2.0.verified.txt | 306 +++-- .../netstandard2.1.verified.txt | 308 +++-- Tests/Benchmarks/Program.cs | 1 - .../BasicSpecs.cs | 3 +- .../CollectionSpecs.cs | 3 +- .../DictionarySpecs.cs | 23 + .../ExtensibilitySpecs.cs | 10 +- .../AssertionExtensions.cs | 13 +- .../AssertionExtensionsSpecs.cs | 35 +- .../AssertionFailureSpecs.cs | 17 +- .../AssertionOptionsSpecs.cs | 2 +- ...CollectionAssertionSpecs.BeEquivalentTo.cs | 6 +- .../CollectionAssertionSpecs.Contain.cs | 21 +- ...ctionAssertionSpecs.ContainEquivalentOf.cs | 31 +- ...CollectionAssertionSpecs.ContainInOrder.cs | 5 +- .../CollectionAssertionSpecs.ContainSingle.cs | 34 +- .../CollectionAssertionSpecs.HaveCount.cs | 5 +- .../CollectionAssertionSpecs.HaveElementAt.cs | 14 + ...ctionAssertionSpecs.OnlyHaveUniqueItems.cs | 4 +- .../Collections/CollectionAssertionSpecs.cs | 20 +- ...tionAssertionOfStringSpecs.ContainMatch.cs | 16 +- ...icDictionaryAssertionSpecs.ContainValue.cs | 41 +- ...cDictionaryAssertionSpecs.ContainValues.cs | 19 +- .../FunctionExceptionAssertionSpecs.cs | 32 +- .../Execution/AssertionChainSpecs.Chaining.cs | 599 +++++++++ .../AssertionChainSpecs.MessageFormating.cs | 390 ++++++ .../AssertionScope.ChainingApiSpecs.cs | 588 --------- .../AssertionScope.ContextDataSpecs.cs | 68 - .../AssertionScope.MessageFormatingSpecs.cs | 522 -------- ...> AssertionScopeSpecs.ScopedFormatters.cs} | 0 .../Execution/AssertionScopeSpecs.cs | 64 +- ...rSpecs.cs => CallerIdentificationSpecs.cs} | 41 +- .../Execution/GivenSelectorSpecs.cs | 82 +- .../Formatting/FormatterSpecs.cs | 86 +- .../OccurrenceConstraintSpecs.cs | 4 +- .../Primitives/ObjectAssertionSpecs.cs | 3 +- .../ReferenceTypeAssertionsSpecs.cs | 8 +- .../SimpleTimeSpanAssertionSpecs.cs | 3 +- .../Primitives/StringComparisonSpecs.cs | 8 +- .../Specialized/AssemblyAssertionSpecs.cs | 18 +- .../ExecutionTimeAssertionsSpecs.cs | 3 +- .../TaskCompletionSourceAssertionSpecs.cs | 2 +- .../Specialized/TaskOfTAssertionSpecs.cs | 50 +- .../Types/MethodBaseAssertionSpecs.cs | 20 +- .../Types/PropertyInfoAssertionSpecs.cs | 68 +- .../PropertyInfoSelectorAssertionSpecs.cs | 23 +- ...ionSpecs.HaveExplicitConversionOperator.cs | 28 +- ...ionSpecs.HaveImplicitConversionOperator.cs | 19 + .../Types/TypeAssertionSpecs.HaveProperty.cs | 33 +- .../Xml/XDocumentAssertionSpecs.cs | 37 + docs/_pages/exceptions.md | 18 +- docs/_pages/executiontime.md | 4 +- docs/_pages/extensibility.md | 58 +- docs/_pages/introduction.md | 62 +- docs/_pages/releases.md | 7 + docs/_pages/upgradingtov7.md | 139 +++ qodana.yaml | 1 + 214 files changed, 6242 insertions(+), 5933 deletions(-) create mode 100644 Src/FluentAssertions/Equivalency/AssertionChainExtensions.cs create mode 100644 Src/FluentAssertions/Execution/AssertionChain.cs delete mode 100644 Src/FluentAssertions/Execution/ContinuedAssertionScope.cs delete mode 100644 Src/FluentAssertions/Execution/Execute.cs rename Src/FluentAssertions/Execution/{MessageBuilder.cs => FailureMessageFormatter.cs} (68%) delete mode 100644 Src/FluentAssertions/Execution/IAssertionScope.cs create mode 100644 Src/FluentAssertions/Formatting/MethodInfoFormatter.cs delete mode 100644 Src/FluentAssertions/Specialized/FunctionAssertionHelpers.cs create mode 100644 Tests/FluentAssertions.Specs/Execution/AssertionChainSpecs.Chaining.cs create mode 100644 Tests/FluentAssertions.Specs/Execution/AssertionChainSpecs.MessageFormating.cs delete mode 100644 Tests/FluentAssertions.Specs/Execution/AssertionScope.ChainingApiSpecs.cs delete mode 100644 Tests/FluentAssertions.Specs/Execution/AssertionScope.ContextDataSpecs.cs delete mode 100644 Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs rename Tests/FluentAssertions.Specs/Execution/{AssertionScope.ScopedFormatters.cs => AssertionScopeSpecs.ScopedFormatters.cs} (100%) rename Tests/FluentAssertions.Specs/Execution/{CallerIdentifierSpecs.cs => CallerIdentificationSpecs.cs} (93%) diff --git a/.editorconfig b/.editorconfig index f4874fecc7..0ea4ede3a9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -199,6 +199,11 @@ dotnet_diagnostic.SA1116.severity = none dotnet_diagnostic.SA1117.severity = none # SA1200: Using directive should appear within a namespace declaration dotnet_diagnostic.SA1200.severity = none + +# Purpose: Use string. Empty for empty strings +# Reason: There's no performance difference. See https://medium.com/@dk.kravtsov/string-empty-vs-in-c-70c64971161f +dotnet_diagnostic.SA1122.severity = none + # SA1124: Do not use regions dotnet_diagnostic.SA1124.severity = none # SA1201: A property should not follow a method diff --git a/Build/Build.cs b/Build/Build.cs index 4cb1ba5123..5469ae287b 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -1,10 +1,6 @@ using System; -using System.Collections.Generic; using System.Linq; -using System.Net.Http; -using System.Runtime.InteropServices; using LibGit2Sharp; -using Microsoft.Build.Tasks; using Nuke.Common; using Nuke.Common.CI.GitHubActions; using Nuke.Common.Execution; diff --git a/FluentAssertions.sln b/FluentAssertions.sln index 2e6167875b..43bf07b29f 100644 --- a/FluentAssertions.sln +++ b/FluentAssertions.sln @@ -7,7 +7,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig Tests\Default.testsettings = Tests\Default.testsettings Directory.Build.props = Directory.Build.props - Src\JetBrainsAnnotations.cs = Src\JetBrainsAnnotations.cs nuget.config = nuget.config README.md = README.md docs\_pages\releases.md = docs\_pages\releases.md diff --git a/FluentAssertions.sln.DotSettings b/FluentAssertions.sln.DotSettings index e58cf3d554..785299fbe3 100644 --- a/FluentAssertions.sln.DotSettings +++ b/FluentAssertions.sln.DotSettings @@ -1,4 +1,4 @@ - + True True False @@ -143,7 +143,7 @@ <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - + OUTLINE SOLUTION_FOLDER True @@ -161,17 +161,17 @@ 4 False True - True - 1 - True - 0 + False + + False + aaa Arrange-Act-Assert [Fact] public void $END$() { // Arrange - + // Act diff --git a/Src/FluentAssertions/AndWhichConstraint.cs b/Src/FluentAssertions/AndWhichConstraint.cs index a30126ba2f..858423955f 100644 --- a/Src/FluentAssertions/AndWhichConstraint.cs +++ b/Src/FluentAssertions/AndWhichConstraint.cs @@ -2,45 +2,84 @@ using System.Collections.Generic; using System.Linq; using FluentAssertions.Common; +using FluentAssertions.Execution; using FluentAssertions.Formatting; namespace FluentAssertions; /// -/// Constraint which can be returned from an assertion which matches a condition and which will allow -/// further matches to be performed on the matched condition as well as the parent constraint. +/// Provides a property that can be used in chained assertions where the prior assertions returns a +/// single object that the assertion continues on. /// -/// The type of the original constraint that was matched -/// The type of the matched object which the parent constraint matched -public class AndWhichConstraint : AndConstraint +public class AndWhichConstraint : AndConstraint { - private readonly Lazy matchedConstraint; + private readonly AssertionChain assertionChain; + private readonly string pathPostfix; + private readonly Lazy getSubject; - public AndWhichConstraint(TParentConstraint parentConstraint, TMatchedElement matchedConstraint) - : base(parentConstraint) + /// + /// Creates an object that allows continuing an assertion executed through and + /// which resulted in a single . + /// + public AndWhichConstraint(TParent parent, TSubject subject) + : base(parent) + { + getSubject = new Lazy(() => subject); + } + + /// + /// Creates an object that allows continuing an assertion executed through and + /// which resulted in a single on an existing , but where + /// the previous caller identifier is post-fixed with . + /// + public AndWhichConstraint(TParent parent, TSubject subject, AssertionChain assertionChain, string pathPostfix = "") + : base(parent) { - this.matchedConstraint = - new Lazy(() => matchedConstraint); + getSubject = new Lazy(() => subject); + + this.assertionChain = assertionChain; + this.pathPostfix = pathPostfix; } - public AndWhichConstraint(TParentConstraint parentConstraint, IEnumerable matchedConstraint) - : base(parentConstraint) + /// + /// Creates an object that allows continuing an assertion executed through and + /// which resulted in a potential collection of objects through . + /// + /// + /// If contains more than one object, a clear exception is thrown. + /// + public AndWhichConstraint(TParent parent, IEnumerable subjects) + : base(parent) { - this.matchedConstraint = - new Lazy( - () => SingleOrDefault(matchedConstraint)); + getSubject = new Lazy(() => Single(subjects)); } - private static TMatchedElement SingleOrDefault( - IEnumerable matchedConstraint) + /// + /// Creates an object that allows continuing an assertion executed through and + /// which resulted in a potential collection of objects through on an + /// existing , but where + /// the previous caller identifier is post-fixed with . + /// + /// + /// If contains more than one object, a clear exception is thrown. + /// + public AndWhichConstraint(TParent parent, IEnumerable subjects, AssertionChain assertionChain, string pathPostfix) + : base(parent) { - TMatchedElement[] matchedElements = matchedConstraint.ToArray(); + getSubject = new Lazy(() => Single(subjects)); + + this.assertionChain = assertionChain; + this.pathPostfix = pathPostfix; + } + + private static TSubject Single(IEnumerable subjects) + { + TSubject[] matchedElements = subjects.ToArray(); if (matchedElements.Length > 1) { string foundObjects = string.Join(Environment.NewLine, - matchedElements.Select( - ele => "\t" + Formatter.ToString(ele))); + matchedElements.Select(ele => "\t" + Formatter.ToString(ele))); string message = "More than one object found. FluentAssertions cannot determine which object is meant." + $" Found objects:{Environment.NewLine}{foundObjects}"; @@ -54,13 +93,24 @@ private static TMatchedElement SingleOrDefault( /// /// Returns the single result of a prior assertion that is used to select a nested or collection item. /// - public TMatchedElement Which => matchedConstraint.Value; + /// + /// Just a convenience property that returns the same value as . + /// + public TSubject Subject => Which; /// /// Returns the single result of a prior assertion that is used to select a nested or collection item. /// - /// - /// Just a convenience property that returns the same value as . - /// - public TMatchedElement Subject => Which; + public TSubject Which + { + get + { + if (pathPostfix is not null and not "") + { + assertionChain.WithCallerPostfix(pathPostfix).ReuseOnce(); + } + + return getSubject.Value; + } + } } diff --git a/Src/FluentAssertions/AssertionExtensions.cs b/Src/FluentAssertions/AssertionExtensions.cs index 0c69d58c41..a37a1c54e9 100644 --- a/Src/FluentAssertions/AssertionExtensions.cs +++ b/Src/FluentAssertions/AssertionExtensions.cs @@ -11,6 +11,7 @@ using System.Xml.Linq; using FluentAssertions.Collections; using FluentAssertions.Common; +using FluentAssertions.Execution; using FluentAssertions.Numeric; using FluentAssertions.Primitives; using FluentAssertions.Specialized; @@ -149,7 +150,6 @@ public static ExecutionTime ExecutionTime(this Action action, StartTimer createT /// /// Provides methods for asserting the execution time of an async action. /// - /// An async action to measure the execution time of. /// /// Returns an object for asserting that the execution time matches certain conditions. /// @@ -167,7 +167,7 @@ public static ExecutionTime ExecutionTime(this Func action) [Pure] public static ExecutionTimeAssertions Should(this ExecutionTime executionTime) { - return new ExecutionTimeAssertions(executionTime); + return new ExecutionTimeAssertions(executionTime, AssertionChain.GetOrCreate()); } /// @@ -177,7 +177,7 @@ public static ExecutionTimeAssertions Should(this ExecutionTime executionTime) [Pure] public static AssemblyAssertions Should([NotNull] this Assembly assembly) { - return new AssemblyAssertions(assembly); + return new AssemblyAssertions(assembly, AssertionChain.GetOrCreate()); } /// @@ -187,7 +187,7 @@ public static AssemblyAssertions Should([NotNull] this Assembly assembly) [Pure] public static XDocumentAssertions Should([NotNull] this XDocument actualValue) { - return new XDocumentAssertions(actualValue); + return new XDocumentAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -197,7 +197,7 @@ public static XDocumentAssertions Should([NotNull] this XDocument actualValue) [Pure] public static XElementAssertions Should([NotNull] this XElement actualValue) { - return new XElementAssertions(actualValue); + return new XElementAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -207,7 +207,7 @@ public static XElementAssertions Should([NotNull] this XElement actualValue) [Pure] public static XAttributeAssertions Should([NotNull] this XAttribute actualValue) { - return new XAttributeAssertions(actualValue); + return new XAttributeAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -217,7 +217,7 @@ public static XAttributeAssertions Should([NotNull] this XAttribute actualValue) [Pure] public static StreamAssertions Should([NotNull] this Stream actualValue) { - return new StreamAssertions(actualValue); + return new StreamAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -227,7 +227,7 @@ public static StreamAssertions Should([NotNull] this Stream actualValue) [Pure] public static BufferedStreamAssertions Should([NotNull] this BufferedStream actualValue) { - return new BufferedStreamAssertions(actualValue); + return new BufferedStreamAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -284,7 +284,7 @@ private static void ForceEnumeration(T subject, Func enumerab [Pure] public static ObjectAssertions Should([NotNull] this object actualValue) { - return new ObjectAssertions(actualValue); + return new ObjectAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -294,7 +294,7 @@ public static ObjectAssertions Should([NotNull] this object actualValue) [Pure] public static BooleanAssertions Should(this bool actualValue) { - return new BooleanAssertions(actualValue); + return new BooleanAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -304,7 +304,7 @@ public static BooleanAssertions Should(this bool actualValue) [Pure] public static NullableBooleanAssertions Should(this bool? actualValue) { - return new NullableBooleanAssertions(actualValue); + return new NullableBooleanAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -314,7 +314,7 @@ public static NullableBooleanAssertions Should(this bool? actualValue) [Pure] public static HttpResponseMessageAssertions Should([NotNull] this HttpResponseMessage actualValue) { - return new HttpResponseMessageAssertions(actualValue); + return new HttpResponseMessageAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -324,7 +324,7 @@ public static HttpResponseMessageAssertions Should([NotNull] this HttpResponseMe [Pure] public static GuidAssertions Should(this Guid actualValue) { - return new GuidAssertions(actualValue); + return new GuidAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -334,7 +334,7 @@ public static GuidAssertions Should(this Guid actualValue) [Pure] public static NullableGuidAssertions Should(this Guid? actualValue) { - return new NullableGuidAssertions(actualValue); + return new NullableGuidAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -344,7 +344,7 @@ public static NullableGuidAssertions Should(this Guid? actualValue) [Pure] public static GenericCollectionAssertions Should([NotNull] this IEnumerable actualValue) { - return new GenericCollectionAssertions(actualValue); + return new GenericCollectionAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -354,7 +354,7 @@ public static GenericCollectionAssertions Should([NotNull] this IEnumerabl [Pure] public static StringCollectionAssertions Should([NotNull] this IEnumerable @this) { - return new StringCollectionAssertions(@this); + return new StringCollectionAssertions(@this, AssertionChain.GetOrCreate()); } /// @@ -365,7 +365,7 @@ public static StringCollectionAssertions Should([NotNull] this IEnumerable, TKey, TValue> Should( [NotNull] this IDictionary actualValue) { - return new GenericDictionaryAssertions, TKey, TValue>(actualValue); + return new GenericDictionaryAssertions, TKey, TValue>(actualValue, AssertionChain.GetOrCreate()); } /// @@ -376,7 +376,8 @@ public static GenericDictionaryAssertions, TKey, TValu public static GenericDictionaryAssertions>, TKey, TValue> Should( [NotNull] this IEnumerable> actualValue) { - return new GenericDictionaryAssertions>, TKey, TValue>(actualValue); + return new GenericDictionaryAssertions>, TKey, TValue>(actualValue, + AssertionChain.GetOrCreate()); } /// @@ -388,7 +389,7 @@ public static GenericDictionaryAssertions Should> { - return new GenericDictionaryAssertions(actualValue); + return new GenericDictionaryAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -398,7 +399,7 @@ public static GenericDictionaryAssertions Should @@ -408,7 +409,7 @@ public static DateTimeAssertions Should(this DateTime actualValue) [Pure] public static DateTimeOffsetAssertions Should(this DateTimeOffset actualValue) { - return new DateTimeOffsetAssertions(actualValue); + return new DateTimeOffsetAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -418,7 +419,7 @@ public static DateTimeOffsetAssertions Should(this DateTimeOffset actualValue) [Pure] public static NullableDateTimeAssertions Should(this DateTime? actualValue) { - return new NullableDateTimeAssertions(actualValue); + return new NullableDateTimeAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -428,7 +429,7 @@ public static NullableDateTimeAssertions Should(this DateTime? actualValue) [Pure] public static NullableDateTimeOffsetAssertions Should(this DateTimeOffset? actualValue) { - return new NullableDateTimeOffsetAssertions(actualValue); + return new NullableDateTimeOffsetAssertions(actualValue, AssertionChain.GetOrCreate()); } #if NET6_0_OR_GREATER @@ -439,7 +440,7 @@ public static NullableDateTimeOffsetAssertions Should(this DateTimeOffset? actua [Pure] public static DateOnlyAssertions Should(this DateOnly actualValue) { - return new DateOnlyAssertions(actualValue); + return new DateOnlyAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -449,7 +450,7 @@ public static DateOnlyAssertions Should(this DateOnly actualValue) [Pure] public static NullableDateOnlyAssertions Should(this DateOnly? actualValue) { - return new NullableDateOnlyAssertions(actualValue); + return new NullableDateOnlyAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -459,7 +460,7 @@ public static NullableDateOnlyAssertions Should(this DateOnly? actualValue) [Pure] public static TimeOnlyAssertions Should(this TimeOnly actualValue) { - return new TimeOnlyAssertions(actualValue); + return new TimeOnlyAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -469,7 +470,7 @@ public static TimeOnlyAssertions Should(this TimeOnly actualValue) [Pure] public static NullableTimeOnlyAssertions Should(this TimeOnly? actualValue) { - return new NullableTimeOnlyAssertions(actualValue); + return new NullableTimeOnlyAssertions(actualValue, AssertionChain.GetOrCreate()); } #endif @@ -481,7 +482,7 @@ public static NullableTimeOnlyAssertions Should(this TimeOnly? actualValue) [Pure] public static ComparableTypeAssertions Should([NotNull] this IComparable comparableValue) { - return new ComparableTypeAssertions(comparableValue); + return new ComparableTypeAssertions(comparableValue, AssertionChain.GetOrCreate()); } /// @@ -491,7 +492,7 @@ public static ComparableTypeAssertions Should([NotNull] this IComparable Should(this int actualValue) { - return new Int32Assertions(actualValue); + return new Int32Assertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -501,7 +502,7 @@ public static NumericAssertions Should(this int actualValue) [Pure] public static NullableNumericAssertions Should(this int? actualValue) { - return new NullableInt32Assertions(actualValue); + return new NullableInt32Assertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -511,7 +512,7 @@ public static NullableNumericAssertions Should(this int? actualValue) [Pure] public static NumericAssertions Should(this uint actualValue) { - return new UInt32Assertions(actualValue); + return new UInt32Assertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -521,7 +522,7 @@ public static NumericAssertions Should(this uint actualValue) [Pure] public static NullableNumericAssertions Should(this uint? actualValue) { - return new NullableUInt32Assertions(actualValue); + return new NullableUInt32Assertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -531,7 +532,7 @@ public static NullableNumericAssertions Should(this uint? actualValue) [Pure] public static NumericAssertions Should(this decimal actualValue) { - return new DecimalAssertions(actualValue); + return new DecimalAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -541,7 +542,7 @@ public static NumericAssertions Should(this decimal actualValue) [Pure] public static NullableNumericAssertions Should(this decimal? actualValue) { - return new NullableDecimalAssertions(actualValue); + return new NullableDecimalAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -551,7 +552,7 @@ public static NullableNumericAssertions Should(this decimal? actualValu [Pure] public static NumericAssertions Should(this byte actualValue) { - return new ByteAssertions(actualValue); + return new ByteAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -561,7 +562,7 @@ public static NumericAssertions Should(this byte actualValue) [Pure] public static NullableNumericAssertions Should(this byte? actualValue) { - return new NullableByteAssertions(actualValue); + return new NullableByteAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -571,7 +572,7 @@ public static NullableNumericAssertions Should(this byte? actualValue) [Pure] public static NumericAssertions Should(this sbyte actualValue) { - return new SByteAssertions(actualValue); + return new SByteAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -581,7 +582,7 @@ public static NumericAssertions Should(this sbyte actualValue) [Pure] public static NullableNumericAssertions Should(this sbyte? actualValue) { - return new NullableSByteAssertions(actualValue); + return new NullableSByteAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -591,7 +592,7 @@ public static NullableNumericAssertions Should(this sbyte? actualValue) [Pure] public static NumericAssertions Should(this short actualValue) { - return new Int16Assertions(actualValue); + return new Int16Assertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -601,7 +602,7 @@ public static NumericAssertions Should(this short actualValue) [Pure] public static NullableNumericAssertions Should(this short? actualValue) { - return new NullableInt16Assertions(actualValue); + return new NullableInt16Assertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -611,7 +612,7 @@ public static NullableNumericAssertions Should(this short? actualValue) [Pure] public static NumericAssertions Should(this ushort actualValue) { - return new UInt16Assertions(actualValue); + return new UInt16Assertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -621,7 +622,7 @@ public static NumericAssertions Should(this ushort actualValue) [Pure] public static NullableNumericAssertions Should(this ushort? actualValue) { - return new NullableUInt16Assertions(actualValue); + return new NullableUInt16Assertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -631,7 +632,7 @@ public static NullableNumericAssertions Should(this ushort? actualValue) [Pure] public static NumericAssertions Should(this long actualValue) { - return new Int64Assertions(actualValue); + return new Int64Assertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -641,7 +642,7 @@ public static NumericAssertions Should(this long actualValue) [Pure] public static NullableNumericAssertions Should(this long? actualValue) { - return new NullableInt64Assertions(actualValue); + return new NullableInt64Assertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -651,7 +652,7 @@ public static NullableNumericAssertions Should(this long? actualValue) [Pure] public static NumericAssertions Should(this ulong actualValue) { - return new UInt64Assertions(actualValue); + return new UInt64Assertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -661,7 +662,7 @@ public static NumericAssertions Should(this ulong actualValue) [Pure] public static NullableNumericAssertions Should(this ulong? actualValue) { - return new NullableUInt64Assertions(actualValue); + return new NullableUInt64Assertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -671,7 +672,7 @@ public static NullableNumericAssertions Should(this ulong? actualValue) [Pure] public static NumericAssertions Should(this float actualValue) { - return new SingleAssertions(actualValue); + return new SingleAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -681,7 +682,7 @@ public static NumericAssertions Should(this float actualValue) [Pure] public static NullableNumericAssertions Should(this float? actualValue) { - return new NullableSingleAssertions(actualValue); + return new NullableSingleAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -691,7 +692,7 @@ public static NullableNumericAssertions Should(this float? actualValue) [Pure] public static NumericAssertions Should(this double actualValue) { - return new DoubleAssertions(actualValue); + return new DoubleAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -701,7 +702,7 @@ public static NumericAssertions Should(this double actualValue) [Pure] public static NullableNumericAssertions Should(this double? actualValue) { - return new NullableDoubleAssertions(actualValue); + return new NullableDoubleAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -711,7 +712,7 @@ public static NullableNumericAssertions Should(this double? actualValue) [Pure] public static StringAssertions Should([NotNull] this string actualValue) { - return new StringAssertions(actualValue); + return new StringAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -721,7 +722,7 @@ public static StringAssertions Should([NotNull] this string actualValue) [Pure] public static SimpleTimeSpanAssertions Should(this TimeSpan actualValue) { - return new SimpleTimeSpanAssertions(actualValue); + return new SimpleTimeSpanAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -731,7 +732,7 @@ public static SimpleTimeSpanAssertions Should(this TimeSpan actualValue) [Pure] public static NullableSimpleTimeSpanAssertions Should(this TimeSpan? actualValue) { - return new NullableSimpleTimeSpanAssertions(actualValue); + return new NullableSimpleTimeSpanAssertions(actualValue, AssertionChain.GetOrCreate()); } /// @@ -741,7 +742,7 @@ public static NullableSimpleTimeSpanAssertions Should(this TimeSpan? actualValue [Pure] public static TypeAssertions Should([NotNull] this Type subject) { - return new TypeAssertions(subject); + return new TypeAssertions(subject, AssertionChain.GetOrCreate()); } /// @@ -754,7 +755,7 @@ public static TypeSelectorAssertions Should(this TypeSelector typeSelector) { Guard.ThrowIfArgumentIsNull(typeSelector); - return new TypeSelectorAssertions(typeSelector.ToArray()); + return new TypeSelectorAssertions(AssertionChain.GetOrCreate(), typeSelector.ToArray()); } /// @@ -765,7 +766,7 @@ public static TypeSelectorAssertions Should(this TypeSelector typeSelector) [Pure] public static ConstructorInfoAssertions Should([NotNull] this ConstructorInfo constructorInfo) { - return new ConstructorInfoAssertions(constructorInfo); + return new ConstructorInfoAssertions(constructorInfo, AssertionChain.GetOrCreate()); } /// @@ -775,7 +776,7 @@ public static ConstructorInfoAssertions Should([NotNull] this ConstructorInfo co [Pure] public static MethodInfoAssertions Should([NotNull] this MethodInfo methodInfo) { - return new MethodInfoAssertions(methodInfo); + return new MethodInfoAssertions(methodInfo, AssertionChain.GetOrCreate()); } /// @@ -789,7 +790,7 @@ public static MethodInfoSelectorAssertions Should(this MethodInfoSelector method { Guard.ThrowIfArgumentIsNull(methodSelector); - return new MethodInfoSelectorAssertions(methodSelector.ToArray()); + return new MethodInfoSelectorAssertions(AssertionChain.GetOrCreate(), methodSelector.ToArray()); } /// @@ -800,7 +801,7 @@ public static MethodInfoSelectorAssertions Should(this MethodInfoSelector method [Pure] public static PropertyInfoAssertions Should([NotNull] this PropertyInfo propertyInfo) { - return new PropertyInfoAssertions(propertyInfo); + return new PropertyInfoAssertions(propertyInfo, AssertionChain.GetOrCreate()); } /// @@ -814,7 +815,7 @@ public static PropertyInfoSelectorAssertions Should(this PropertyInfoSelector pr { Guard.ThrowIfArgumentIsNull(propertyInfoSelector); - return new PropertyInfoSelectorAssertions(propertyInfoSelector.ToArray()); + return new PropertyInfoSelectorAssertions(AssertionChain.GetOrCreate(), propertyInfoSelector.ToArray()); } /// @@ -824,7 +825,7 @@ public static PropertyInfoSelectorAssertions Should(this PropertyInfoSelector pr [Pure] public static ActionAssertions Should([NotNull] this Action action) { - return new ActionAssertions(action, Extractor); + return new ActionAssertions(action, Extractor, AssertionChain.GetOrCreate()); } /// @@ -834,7 +835,7 @@ public static ActionAssertions Should([NotNull] this Action action) [Pure] public static NonGenericAsyncFunctionAssertions Should([NotNull] this Func action) { - return new NonGenericAsyncFunctionAssertions(action, Extractor); + return new NonGenericAsyncFunctionAssertions(action, Extractor, AssertionChain.GetOrCreate()); } /// @@ -844,7 +845,7 @@ public static NonGenericAsyncFunctionAssertions Should([NotNull] this Func [Pure] public static GenericAsyncFunctionAssertions Should([NotNull] this Func> action) { - return new GenericAsyncFunctionAssertions(action, Extractor); + return new GenericAsyncFunctionAssertions(action, Extractor, AssertionChain.GetOrCreate()); } /// @@ -854,7 +855,7 @@ public static GenericAsyncFunctionAssertions Should([NotNull] this Func Should([NotNull] this Func func) { - return new FunctionAssertions(func, Extractor); + return new FunctionAssertions(func, Extractor, AssertionChain.GetOrCreate()); } /// @@ -864,7 +865,7 @@ public static FunctionAssertions Should([NotNull] this Func func) [Pure] public static TaskCompletionSourceAssertions Should(this TaskCompletionSource tcs) { - return new TaskCompletionSourceAssertions(tcs); + return new TaskCompletionSourceAssertions(tcs, AssertionChain.GetOrCreate()); } #if !NETSTANDARD2_0 @@ -906,7 +907,7 @@ public static IMonitor Monitor(this T eventSource, Action : GenericCollectionAssertions, T, GenericCollectionAssertions> { - public GenericCollectionAssertions(IEnumerable actualValue) - : base(actualValue) + public GenericCollectionAssertions(IEnumerable actualValue, AssertionChain assertionChain) + : base(actualValue, assertionChain) { } } @@ -28,22 +28,26 @@ public class GenericCollectionAssertions : GenericCollectionAssertions> where TCollection : IEnumerable { - public GenericCollectionAssertions(TCollection actualValue) - : base(actualValue) + public GenericCollectionAssertions(TCollection actualValue, AssertionChain assertionChain) + : base(actualValue, assertionChain) { } } #pragma warning disable CS0659, S1206 // Ignore not overriding Object.GetHashCode() #pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals + [DebuggerNonUserCode] public class GenericCollectionAssertions : ReferenceTypeAssertions where TCollection : IEnumerable where TAssertions : GenericCollectionAssertions { - public GenericCollectionAssertions(TCollection actualValue) - : base(actualValue) + private readonly AssertionChain assertionChain; + + public GenericCollectionAssertions(TCollection actualValue, AssertionChain assertionChain) + : base(actualValue, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -63,9 +67,10 @@ public GenericCollectionAssertions(TCollection actualValue) /// Zero or more objects to format using the placeholders in . /// public AndWhichConstraint> AllBeAssignableTo( - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected type to be {0}{reason}, but found {context:the collection} is .", @@ -73,20 +78,18 @@ public AndWhichConstraint> AllBeAssignabl IEnumerable matches = []; - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected type to be {0}{reason}, ", typeof(TExpectation).FullName) - .ForCondition(Subject!.All(x => x is not null)) - .FailWith("but found a null element.") - .Then - .ForCondition(Subject.All(x => typeof(TExpectation).IsAssignableFrom(GetType(x)))) - .FailWith("but found {0}.", () => $"[{string.Join(", ", Subject.Select(x => GetType(x).FullName))}]") - .Then - .ClearExpectation(); + .WithExpectation("Expected type to be {0}{reason}, ", typeof(TExpectation).FullName, chain => chain + .ForCondition(Subject!.All(x => x is not null)) + .FailWith("but found a null element.") + .Then + .ForCondition(Subject.All(x => typeof(TExpectation).IsAssignableFrom(GetType(x)))) + .FailWith("but found {0}.", () => $"[{string.Join(", ", Subject.Select(x => GetType(x).FullName))}]")); - matches = Subject.OfType(); + matches = Subject!.OfType(); } return new AndWhichConstraint>((TAssertions)this, matches); @@ -109,20 +112,18 @@ public AndConstraint AllBeAssignableTo(Type expectedType, { Guard.ThrowIfArgumentIsNull(expectedType); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected type to be {0}{reason}, ", expectedType.FullName) - .Given(() => Subject) - .ForCondition(subject => subject is not null) - .FailWith("but found {context:collection} is .") - .Then - .ForCondition(subject => subject.All(x => x is not null)) - .FailWith("but found a null element.") - .Then - .ForCondition(subject => subject.All(x => expectedType.IsAssignableFrom(GetType(x)))) - .FailWith("but found {0}.", subject => $"[{string.Join(", ", subject.Select(x => GetType(x).FullName))}]") - .Then - .ClearExpectation(); + .WithExpectation("Expected type to be {0}{reason}, ", expectedType.FullName, chain => chain + .Given(() => Subject) + .ForCondition(subject => subject is not null) + .FailWith("but found {context:collection} is .") + .Then + .ForCondition(subject => subject.All(x => x is not null)) + .FailWith("but found a null element.") + .Then + .ForCondition(subject => subject.All(x => expectedType.IsAssignableFrom(GetType(x)))) + .FailWith("but found {0}.", subject => $"[{string.Join(", ", subject.Select(x => GetType(x).FullName))}]")); return new AndConstraint((TAssertions)this); } @@ -180,7 +181,8 @@ public AndConstraint AllBeEquivalentTo(TExpectation e /// is . public AndConstraint AllBeEquivalentTo(TExpectation expectation, Func, EquivalencyOptions> config, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -210,9 +212,10 @@ public AndConstraint AllBeEquivalentTo(TExpectation e /// Zero or more objects to format using the placeholders in . /// public AndWhichConstraint> AllBeOfType( - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected type to be {0}{reason}, but found {context:collection} is .", @@ -220,20 +223,18 @@ public AndWhichConstraint> AllBeOfType matches = []; - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected type to be {0}{reason}, ", typeof(TExpectation).FullName) - .ForCondition(Subject!.All(x => x is not null)) - .FailWith("but found a null element.") - .Then - .ForCondition(Subject.All(x => typeof(TExpectation) == GetType(x))) - .FailWith("but found {0}.", () => $"[{string.Join(", ", Subject.Select(x => GetType(x).FullName))}]") - .Then - .ClearExpectation(); + .WithExpectation("Expected type to be {0}{reason}, ", typeof(TExpectation).FullName, chain => chain + .ForCondition(Subject!.All(x => x is not null)) + .FailWith("but found a null element.") + .Then + .ForCondition(Subject.All(x => typeof(TExpectation) == GetType(x))) + .FailWith("but found {0}.", () => $"[{string.Join(", ", Subject.Select(x => GetType(x).FullName))}]")); - matches = Subject.OfType(); + matches = Subject!.OfType(); } return new AndWhichConstraint>((TAssertions)this, matches); @@ -251,25 +252,23 @@ public AndWhichConstraint> AllBeOfType. /// /// is . - public AndConstraint AllBeOfType(Type expectedType, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint AllBeOfType(Type expectedType, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expectedType); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected type to be {0}{reason}, ", expectedType.FullName) - .Given(() => Subject) - .ForCondition(subject => subject is not null) - .FailWith("but found {context:collection} is .") - .Then - .ForCondition(subject => subject.All(x => x is not null)) - .FailWith("but found a null element.") - .Then - .ForCondition(subject => subject.All(x => expectedType == GetType(x))) - .FailWith("but found {0}.", subject => $"[{string.Join(", ", subject.Select(x => GetType(x).FullName))}]") - .Then - .ClearExpectation(); + .WithExpectation("Expected type to be {0}{reason}, ", expectedType.FullName, chain => chain + .Given(() => Subject) + .ForCondition(subject => subject is not null) + .FailWith("but found {context:collection} is .") + .Then + .ForCondition(subject => subject.All(x => x is not null)) + .FailWith("but found a null element.") + .Then + .ForCondition(subject => subject.All(x => expectedType == GetType(x))) + .FailWith("but found {0}.", subject => $"[{string.Join(", ", subject.Select(x => GetType(x).FullName))}]")); return new AndConstraint((TAssertions)this); } @@ -287,17 +286,16 @@ public AndConstraint AllBeOfType(Type expectedType, public AndConstraint BeEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var singleItemArray = Subject?.Take(1).ToArray(); - Execute.Assertion + + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to be empty{reason}, ") - .Given(() => singleItemArray) - .ForCondition(subject => subject is not null) - .FailWith("but found .") - .Then - .ForCondition(subject => subject.Length == 0) - .FailWith("but found at least one item {0}.", singleItemArray) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} to be empty{reason}, ", chain => chain + .Given(() => singleItemArray) + .ForCondition(subject => subject is not null) + .FailWith("but found .") + .Then + .ForCondition(subject => subject.Length == 0) + .FailWith("but found at least one item {0}.", singleItemArray)); return new AndConstraint((TAssertions)this); } @@ -355,7 +353,8 @@ public AndConstraint BeEquivalentTo(IEnumerable is . public AndConstraint BeEquivalentTo(IEnumerable expectation, Func, EquivalencyOptions> config, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); @@ -363,7 +362,8 @@ public AndConstraint BeEquivalentTo(IEnumerable()).AsCollection(); var context = - new EquivalencyValidationContext(Node.From>(() => AssertionScope.Current.CallerIdentity), + new EquivalencyValidationContext( + Node.From>(() => CallerIdentifier.DetermineCallerIdentity()), options) { Reason = new Reason(because, becauseArgs), @@ -425,8 +425,7 @@ public AndConstraint> BeInAscendingOrder /// is . public AndConstraint> BeInAscendingOrder( - IComparer comparer, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + IComparer comparer, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer."); @@ -457,7 +456,8 @@ public AndConstraint> BeInAscendingOrder( /// is . public AndConstraint> BeInAscendingOrder( Expression> propertyExpression, IComparer comparer, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer."); @@ -503,7 +503,8 @@ public AndConstraint> BeInAscendingOrder( /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// public AndConstraint> BeInAscendingOrder(Func comparison, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return BeInOrder(Comparer.Create((x, y) => comparison(x, y)), SortOrder.Ascending, because, becauseArgs); } @@ -526,8 +527,8 @@ public AndConstraint> BeInAscendingOrder(Func public AndConstraint> BeInDescendingOrder( - Expression> propertyExpression, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + Expression> propertyExpression, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return BeInDescendingOrder(propertyExpression, GetComparer(), because, becauseArgs); } @@ -551,8 +552,7 @@ public AndConstraint> BeInDescendingOrder /// is . public AndConstraint> BeInDescendingOrder( - IComparer comparer, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + IComparer comparer, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer."); @@ -644,12 +644,13 @@ public AndConstraint> BeInDescendingOrder(Func /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeNullOrEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint BeNullOrEmpty( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { var singleItemArray = Subject?.Take(1).ToArray(); var nullOrEmpty = singleItemArray is null || singleItemArray.Length == 0; - Execute.Assertion.ForCondition(nullOrEmpty) + assertionChain.ForCondition(nullOrEmpty) .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:collection} to be null or empty{reason}, but found at least one item {0}.", @@ -671,23 +672,22 @@ public AndConstraint BeNullOrEmpty([StringSyntax("CompositeFormat") /// /// is . public AndConstraint BeSubsetOf(IEnumerable expectedSuperset, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expectedSuperset, nameof(expectedSuperset), "Cannot verify a subset against a collection."); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to be a subset of {0}{reason}, ", expectedSuperset) - .Given(() => Subject) - .ForCondition(subject => subject is not null) - .FailWith("but found .") - .Then - .Given(subject => subject.Except(expectedSuperset)) - .ForCondition(excessItems => !excessItems.Any()) - .FailWith("but items {0} are not part of the superset.", excessItems => excessItems) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} to be a subset of {0}{reason}, ", expectedSuperset, chain => chain + .Given(() => Subject) + .ForCondition(subject => subject is not null) + .FailWith("but found .") + .Then + .Given(subject => subject.Except(expectedSuperset)) + .ForCondition(excessItems => !excessItems.Any()) + .FailWith("but items {0} are not part of the superset.", excessItems => excessItems)); return new AndConstraint((TAssertions)this); } @@ -706,18 +706,18 @@ public AndConstraint BeSubsetOf(IEnumerable expectedSuperset, public AndWhichConstraint Contain(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to contain {0}{reason}, but found .", expected); IEnumerable matches = []; - if (success) + if (assertionChain.Succeeded) { ICollection collection = Subject.ConvertOrCastToCollection(); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(collection.Contains(expected)) .FailWith("Expected {context:collection} {0} to contain {1}{reason}.", collection, expected); @@ -746,25 +746,37 @@ public AndWhichConstraint Contain(Expression> pred { Guard.ThrowIfArgumentIsNull(predicate); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to contain {0}{reason}, but found .", predicate.Body); IEnumerable matches = []; - if (success) + int? firstMatchingIndex = null; + if (assertionChain.Succeeded) { Func func = predicate.Compile(); - Execute.Assertion - .ForCondition(Subject!.Any(func)) + foreach (var (item, index) in Subject!.Select((item, index) => (item, index))) + { + if (func(item)) + { + firstMatchingIndex = index; + break; + } + } + + assertionChain + .ForCondition(firstMatchingIndex.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} {0} to have an item matching {1}{reason}.", Subject, predicate.Body); matches = Subject.Where(func); } + assertionChain.WithCallerPostfix($"[{firstMatchingIndex}]").ReuseOnce(); + return new AndWhichConstraint((TAssertions)this, matches); } @@ -782,20 +794,20 @@ public AndWhichConstraint Contain(Expression> pred /// /// is . /// is empty. - public AndConstraint Contain(IEnumerable expected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint Contain(IEnumerable expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot verify containment against a collection"); ICollection expectedObjects = expected.ConvertOrCastToCollection(); Guard.ThrowIfArgumentIsEmpty(expectedObjects, nameof(expected), "Cannot verify containment against an empty collection"); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to contain {0}{reason}, but found .", expectedObjects); - if (success) + if (assertionChain.Succeeded) { IEnumerable missingItems = expectedObjects.Except(Subject!); @@ -803,14 +815,14 @@ public AndConstraint Contain(IEnumerable expected, { if (expectedObjects.Count > 1) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} {0} to contain {1}{reason}, but could not find {2}.", Subject, expectedObjects, missingItems); } else { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} {0} to contain {1}{reason}.", Subject, expectedObjects.Single()); @@ -844,7 +856,8 @@ public AndConstraint Contain(IEnumerable expected, /// Zero or more objects to format using the placeholders in . /// public AndWhichConstraint ContainEquivalentOf(TExpectation expectation, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return ContainEquivalentOf(expectation, config => config, because, becauseArgs); } @@ -879,27 +892,28 @@ public AndWhichConstraint ContainEquivalentOf(TExp /// /// is . public AndWhichConstraint ContainEquivalentOf(TExpectation expectation, - Func, EquivalencyOptions> config, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + Func, + EquivalencyOptions> config, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to contain equivalent of {0}{reason}, but found .", expectation); - if (success) + if (assertionChain.Succeeded) { EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); using var scope = new AssertionScope(); - scope.AddReportable("configuration", () => options.ToString()); + assertionChain.AddReportable("configuration", () => options.ToString()); - foreach (T actualItem in Subject!) + foreach ((T actualItem, int index) in Subject!.Select((item, index) => (item, index))) { var context = - new EquivalencyValidationContext(Node.From(() => AssertionScope.Current.CallerIdentity), + new EquivalencyValidationContext(Node.From(() => CurrentAssertionChain.CallerIdentifier), options) { Reason = new Reason(because, becauseArgs), @@ -919,11 +933,11 @@ public AndWhichConstraint ContainEquivalentOf(TExp if (failures.Length == 0) { - return new AndWhichConstraint((TAssertions)this, actualItem); + return new AndWhichConstraint((TAssertions)this, actualItem, assertionChain, $"[{index}]"); } } - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} {0} to contain equivalent of {1}{reason}.", Subject, expectation); } @@ -957,16 +971,17 @@ public AndConstraint ContainInOrder(params T[] expected) /// /// is . public AndConstraint ContainInOrder(IEnumerable expected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot verify ordered containment against a collection."); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to contain {0} in order{reason}, but found .", expected); - if (success) + if (assertionChain.Succeeded) { IList expectedItems = expected.ConvertOrCastToList(); IList actualItems = Subject.ConvertOrCastToList(); @@ -980,7 +995,7 @@ public AndConstraint ContainInOrder(IEnumerable expected, if (subjectIndex == -1) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:collection} {0} to contain items {1} in order{reason}" + @@ -1019,16 +1034,17 @@ public AndConstraint ContainInConsecutiveOrder(params T[] expected) /// /// is . public AndConstraint ContainInConsecutiveOrder(IEnumerable expected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot verify ordered containment against a collection."); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to contain {0} in order{reason}, but found .", expected); - if (success) + if (assertionChain.Succeeded) { IList expectedItems = expected.ConvertOrCastToList(); @@ -1060,7 +1076,7 @@ public AndConstraint ContainInConsecutiveOrder(IEnumerable expec } } - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:collection} {0} to contain items {1} in order{reason}" + @@ -1084,18 +1100,16 @@ public AndConstraint ContainInConsecutiveOrder(IEnumerable expec public AndConstraint ContainItemsAssignableTo( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .WithExpectation("Expected {context:collection} to contain at least one element assignable to type {0}{reason}, ", - typeof(TExpectation).FullName) - .ForCondition(Subject is not null) - .FailWith("but found .") - .Then - .Given(() => Subject.ConvertOrCastToCollection()) - .ForCondition(subject => subject.Any(x => typeof(TExpectation).IsAssignableFrom(GetType(x)))) - .FailWith("but found {0}.", subject => subject.Select(x => GetType(x))) - .Then - .ClearExpectation(); + typeof(TExpectation).FullName, chain => chain + .ForCondition(Subject is not null) + .FailWith("but found .") + .Then + .Given(() => Subject.ConvertOrCastToCollection()) + .ForCondition(subject => subject.Any(x => typeof(TExpectation).IsAssignableFrom(GetType(x)))) + .FailWith("but found {0}.", subject => subject.Select(x => GetType(x)))); return new AndConstraint((TAssertions)this); } @@ -1110,8 +1124,8 @@ public AndConstraint ContainItemsAssignableTo( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotContainItemsAssignableTo( - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) => + public AndConstraint + NotContainItemsAssignableTo(string because = "", params object[] becauseArgs) => NotContainItemsAssignableTo(typeof(TExpectation), because, becauseArgs); /// @@ -1132,18 +1146,16 @@ public AndConstraint NotContainItemsAssignableTo(Type type, { Guard.ThrowIfArgumentIsNull(type); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .WithExpectation("Expected {context:collection} to not contain any elements assignable to type {0}{reason}, ", - type.FullName) - .ForCondition(Subject is not null) - .FailWith("but found .") - .Then - .Given(() => Subject.ConvertOrCastToCollection()) - .ForCondition(subject => subject.All(x => !type.IsAssignableFrom(GetType(x)))) - .FailWith("but found {0}.", subject => subject.Select(x => GetType(x))) - .Then - .ClearExpectation(); + type.FullName, chain => chain + .ForCondition(Subject is not null) + .FailWith("but found .") + .Then + .Given(() => Subject.ConvertOrCastToCollection()) + .ForCondition(subject => subject.All(x => !type.IsAssignableFrom(GetType(x)))) + .FailWith("but found {0}.", subject => subject.Select(x => GetType(x)))); return new AndConstraint((TAssertions)this); } @@ -1158,23 +1170,23 @@ public AndConstraint NotContainItemsAssignableTo(Type type, /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint ContainSingle([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndWhichConstraint ContainSingle(string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to contain a single item{reason}, but found ."); T match = default; - if (success) + if (assertionChain.Succeeded) { ICollection actualItems = Subject.ConvertOrCastToCollection(); switch (actualItems.Count) { case 0: // Fail, Collection is empty - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} to contain a single item{reason}, but the collection is empty."); @@ -1183,7 +1195,7 @@ public AndWhichConstraint ContainSingle([StringSyntax("Composite match = actualItems.Single(); break; default: // Fail, Collection contains more than a single item - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} to contain a single item{reason}, but found {0}.", Subject); @@ -1191,7 +1203,7 @@ public AndWhichConstraint ContainSingle([StringSyntax("Composite } } - return new AndWhichConstraint((TAssertions)this, match); + return new AndWhichConstraint((TAssertions)this, match, assertionChain, "[0]"); } /// @@ -1207,25 +1219,25 @@ public AndWhichConstraint ContainSingle([StringSyntax("Composite /// /// is . public AndWhichConstraint ContainSingle(Expression> predicate, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(predicate); const string expectationPrefix = "Expected {context:collection} to contain a single item matching {0}{reason}, "; - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith(expectationPrefix + "but found .", predicate); T[] matches = []; - if (success) + if (assertionChain.Succeeded) { ICollection actualItems = Subject.ConvertOrCastToCollection(); - Execute.Assertion + assertionChain .ForCondition(actualItems.Count > 0) .BecauseOf(because, becauseArgs) .FailWith(expectationPrefix + "but the collection is empty.", predicate); @@ -1235,13 +1247,13 @@ public AndWhichConstraint ContainSingle(Expression if (count == 0) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith(expectationPrefix + "but no such item was found.", predicate); } else if (count > 1) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith( expectationPrefix + "but " + count.ToString(CultureInfo.InvariantCulture) + " such items were found.", @@ -1253,7 +1265,7 @@ public AndWhichConstraint ContainSingle(Expression } } - return new AndWhichConstraint((TAssertions)this, matches); + return new AndWhichConstraint((TAssertions)this, matches, assertionChain, "[0]"); } /// @@ -1270,8 +1282,8 @@ public AndWhichConstraint ContainSingle(Expression /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint EndWith(IEnumerable expectation, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint EndWith(IEnumerable expectation, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return EndWith(expectation, (a, b) => EqualityComparer.Default.Equals(a, b), because, becauseArgs); } @@ -1296,7 +1308,8 @@ public AndConstraint EndWith(IEnumerable expectation, /// is . public AndConstraint EndWith( IEnumerable expectation, Func equalityComparison, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expectation, nameof(expectation), "Cannot compare collection with ."); @@ -1318,8 +1331,8 @@ public AndConstraint EndWith( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint EndWith(T element, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint EndWith(T element, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return EndWith([element], ObjectExtensions.GetComparer(), because, becauseArgs); } @@ -1355,7 +1368,8 @@ public AndConstraint Equal(params T[] elements) /// public AndConstraint Equal( IEnumerable expectation, Func equalityComparison, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { AssertSubjectEquality(expectation, equalityComparison, because, becauseArgs); @@ -1374,8 +1388,8 @@ public AndConstraint Equal( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Equal(IEnumerable expected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint Equal(IEnumerable expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { AssertSubjectEquality(expected, ObjectExtensions.GetComparer(), because, becauseArgs); @@ -1393,19 +1407,19 @@ public AndConstraint Equal(IEnumerable expected, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveCount(int expected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint HaveCount(int expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to contain {0} item(s){reason}, but found .", expected); - if (success) + if (assertionChain.Succeeded) { int actualCount = Subject!.Count(); - Execute.Assertion + assertionChain .ForCondition(actualCount == expected) .BecauseOf(because, becauseArgs) .FailWith( @@ -1429,17 +1443,18 @@ public AndConstraint HaveCount(int expected, /// /// is . public AndConstraint HaveCount(Expression> countPredicate, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(countPredicate, nameof(countPredicate), "Cannot compare collection count against a predicate."); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to contain {0} items{reason}, but found .", countPredicate.Body); - if (success) + if (assertionChain.Succeeded) { Func compiledPredicate = countPredicate.Compile(); @@ -1447,7 +1462,7 @@ public AndConstraint HaveCount(Expression> countPre if (!compiledPredicate(actualCount)) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} to have a count {0}{reason}, but count is {1}: {2}.", countPredicate.Body, actualCount, Subject); @@ -1469,20 +1484,19 @@ public AndConstraint HaveCount(Expression> countPre /// Zero or more objects to format using the placeholders in . /// public AndConstraint HaveCountGreaterThanOrEqualTo(int expected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to contain at least {0} item(s){reason}, ", expected) - .Given(() => Subject) - .ForCondition(subject => subject is not null) - .FailWith("but found .") - .Then - .Given(subject => subject.Count()) - .ForCondition(actualCount => actualCount >= expected) - .FailWith("but found {0}: {1}.", actualCount => actualCount, _ => Subject) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} to contain at least {0} item(s){reason}, ", expected, chain => chain + .Given(() => Subject) + .ForCondition(subject => subject is not null) + .FailWith("but found .") + .Then + .Given(subject => subject.Count()) + .ForCondition(actualCount => actualCount >= expected) + .FailWith("but found {0}: {1}.", actualCount => actualCount, _ => Subject)); return new AndConstraint((TAssertions)this); } @@ -1498,21 +1512,19 @@ public AndConstraint HaveCountGreaterThanOrEqualTo(int expected, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveCountGreaterThan(int expected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint HaveCountGreaterThan(int expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to contain more than {0} item(s){reason}, ", expected) - .Given(() => Subject) - .ForCondition(subject => subject is not null) - .FailWith("but found .") - .Then - .Given(subject => subject.Count()) - .ForCondition(actualCount => actualCount > expected) - .FailWith("but found {0}: {1}.", actualCount => actualCount, _ => Subject) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} to contain more than {0} item(s){reason}, ", expected, chain => chain + .Given(() => Subject) + .ForCondition(subject => subject is not null) + .FailWith("but found .") + .Then + .Given(subject => subject.Count()) + .ForCondition(actualCount => actualCount > expected) + .FailWith("but found {0}: {1}.", actualCount => actualCount, _ => Subject)); return new AndConstraint((TAssertions)this); } @@ -1531,18 +1543,16 @@ public AndConstraint HaveCountGreaterThan(int expected, public AndConstraint HaveCountLessThanOrEqualTo(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to contain at most {0} item(s){reason}, ", expected) - .Given(() => Subject) - .ForCondition(subject => subject is not null) - .FailWith("but found .") - .Then - .Given(subject => subject.Count()) - .ForCondition(actualCount => actualCount <= expected) - .FailWith("but found {0}: {1}.", actualCount => actualCount, _ => Subject) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} to contain at most {0} item(s){reason}, ", expected, chain => chain + .Given(() => Subject) + .ForCondition(subject => subject is not null) + .FailWith("but found .") + .Then + .Given(subject => subject.Count()) + .ForCondition(actualCount => actualCount <= expected) + .FailWith("but found {0}: {1}.", actualCount => actualCount, _ => Subject)); return new AndConstraint((TAssertions)this); } @@ -1558,21 +1568,19 @@ public AndConstraint HaveCountLessThanOrEqualTo(int expected, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveCountLessThan(int expected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint HaveCountLessThan(int expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to contain fewer than {0} item(s){reason}, ", expected) - .Given(() => Subject) - .ForCondition(subject => subject is not null) - .FailWith("but found .") - .Then - .Given(subject => subject.Count()) - .ForCondition(actualCount => actualCount < expected) - .FailWith("but found {0}: {1}.", actualCount => actualCount, _ => Subject) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} to contain fewer than {0} item(s){reason}, ", expected, chain => chain + .Given(() => Subject) + .ForCondition(subject => subject is not null) + .FailWith("but found .") + .Then + .Given(subject => subject.Count()) + .ForCondition(actualCount => actualCount < expected) + .FailWith("but found {0}: {1}.", actualCount => actualCount, _ => Subject)); return new AndConstraint((TAssertions)this); } @@ -1591,35 +1599,36 @@ public AndConstraint HaveCountLessThan(int expected, /// Zero or more objects to format using the placeholders in . /// public AndWhichConstraint HaveElementAt(int index, T element, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to have element at index {0}{reason}, but found .", index); T actual = default; - if (success) + if (assertionChain.Succeeded) { if (index < Subject!.Count()) { actual = Subject.ElementAt(index); - Execute.Assertion + assertionChain .ForCondition(ObjectExtensions.GetComparer()(actual, element)) .BecauseOf(because, becauseArgs) .FailWith("Expected {0} at index {1}{reason}, but found {2}.", element, index, actual); } else { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {0} at index {1}{reason}, but found no element.", element, index); } } - return new AndWhichConstraint((TAssertions)this, actual); + return new AndWhichConstraint((TAssertions)this, actual, assertionChain, $"[{index}]"); } /// @@ -1635,26 +1644,26 @@ public AndWhichConstraint HaveElementAt(int index, T element, /// Zero or more objects to format using the placeholders in . /// public AndConstraint HaveElementPreceding(T successor, T expectation, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to have {0} precede {1}{reason}, ", expectation, successor) - .Given(() => Subject) - .ForCondition(subject => subject is not null) - .FailWith("but the collection is .") - .Then - .ForCondition(subject => subject.Any()) - .FailWith("but the collection is empty.") - .Then - .ForCondition(subject => HasPredecessor(successor, subject)) - .FailWith("but found nothing.") - .Then - .Given(subject => PredecessorOf(successor, subject)) - .ForCondition(predecessor => ObjectExtensions.GetComparer()(predecessor, expectation)) - .FailWith("but found {0}.", predecessor => predecessor) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} to have {0} precede {1}{reason}, ", expectation, successor, chain => + chain + .Given(() => Subject) + .ForCondition(subject => subject is not null) + .FailWith("but the collection is .") + .Then + .ForCondition(subject => subject.Any()) + .FailWith("but the collection is empty.") + .Then + .ForCondition(subject => HasPredecessor(successor, subject)) + .FailWith("but found nothing.") + .Then + .Given(subject => PredecessorOf(successor, subject)) + .ForCondition(predecessor => ObjectExtensions.GetComparer()(predecessor, expectation)) + .FailWith("but found {0}.", predecessor => predecessor)); return new AndConstraint((TAssertions)this); } @@ -1672,26 +1681,26 @@ public AndConstraint HaveElementPreceding(T successor, T expectatio /// Zero or more objects to format using the placeholders in . /// public AndConstraint HaveElementSucceeding(T predecessor, T expectation, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to have {0} succeed {1}{reason}, ", expectation, predecessor) - .Given(() => Subject) - .ForCondition(subject => subject is not null) - .FailWith("but the collection is .") - .Then - .ForCondition(subject => subject.Any()) - .FailWith("but the collection is empty.") - .Then - .ForCondition(subject => HasSuccessor(predecessor, subject)) - .FailWith("but found nothing.") - .Then - .Given(subject => SuccessorOf(predecessor, subject)) - .ForCondition(successor => ObjectExtensions.GetComparer()(successor, expectation)) - .FailWith("but found {0}.", successor => successor) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} to have {0} succeed {1}{reason}, ", expectation, predecessor, + chain => chain + .Given(() => Subject) + .ForCondition(subject => subject is not null) + .FailWith("but the collection is .") + .Then + .ForCondition(subject => subject.Any()) + .FailWith("but the collection is empty.") + .Then + .ForCondition(subject => HasSuccessor(predecessor, subject)) + .FailWith("but found nothing.") + .Then + .Given(subject => SuccessorOf(predecessor, subject)) + .ForCondition(successor => ObjectExtensions.GetComparer()(successor, expectation)) + .FailWith("but found {0}.", successor => successor)); return new AndConstraint((TAssertions)this); } @@ -1709,22 +1718,21 @@ public AndConstraint HaveElementSucceeding(T predecessor, T expecta /// /// is . public AndConstraint HaveSameCount(IEnumerable otherCollection, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(otherCollection, nameof(otherCollection), "Cannot verify count against a collection."); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to have ") - .Given(() => Subject) - .ForCondition(subject => subject is not null) - .FailWith("the same count as {0}{reason}, but found .", otherCollection) - .Then - .Given(subject => (actual: subject.Count(), expected: otherCollection.Count())) - .ForCondition(count => count.actual == count.expected) - .FailWith("{0} item(s){reason}, but found {1}.", count => count.expected, count => count.actual) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} to have ", chain => chain + .Given(() => Subject) + .ForCondition(subject => subject is not null) + .FailWith("the same count as {0}{reason}, but found .", otherCollection) + .Then + .Given(subject => (actual: subject.Count(), expected: otherCollection.Count())) + .ForCondition(count => count.actual == count.expected) + .FailWith("{0} item(s){reason}, but found {1}.", count => count.expected, count => count.actual)); return new AndConstraint((TAssertions)this); } @@ -1742,21 +1750,22 @@ public AndConstraint HaveSameCount(IEnumerable /// is . public AndConstraint IntersectWith(IEnumerable otherCollection, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(otherCollection, nameof(otherCollection), "Cannot verify intersection against a collection."); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to intersect with {0}{reason}, but found .", otherCollection); - if (success) + if (assertionChain.Succeeded) { IEnumerable sharedItems = Subject!.Intersect(otherCollection); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(sharedItems.Any()) .FailWith( @@ -1777,19 +1786,17 @@ public AndConstraint IntersectWith(IEnumerable otherCollection, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} not to be empty{reason}") - .Given(() => Subject) - .ForCondition(subject => subject is not null) - .FailWith(", but found .") - .Then - .ForCondition(subject => subject.Any()) - .FailWith(".") - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} not to be empty{reason}", chain => chain + .Given(() => Subject) + .ForCondition(subject => subject is not null) + .FailWith(", but found .") + .Then + .ForCondition(subject => subject.Any()) + .FailWith(".")); return new AndConstraint((TAssertions)this); } @@ -1808,20 +1815,21 @@ public AndConstraint NotBeEmpty([StringSyntax("CompositeFormat")] s /// /// is . public AndConstraint NotBeEquivalentTo(IEnumerable unexpected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot verify inequivalence against a collection."); if (Subject is null) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} not to be equivalent{reason}, but found ."); } if (ReferenceEquals(Subject, unexpected)) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:collection} {0} not to be equivalent with collection {1}{reason}, but they both reference the same object.", @@ -1852,13 +1860,13 @@ public AndConstraint NotBeEquivalentTo(IEnumerable public AndConstraint NotBeEquivalentTo(IEnumerable unexpected, Func, EquivalencyOptions> config, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot verify inequivalence against a collection."); if (Subject is null) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} not to be equivalent{reason}, but found ."); } @@ -1872,7 +1880,7 @@ public AndConstraint NotBeEquivalentTo(IEnumerable 0) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} {0} not to be equivalent to collection {1}{reason}.", Subject, @@ -1899,8 +1907,8 @@ public AndConstraint NotBeEquivalentTo(IEnumerable public AndConstraint NotBeInAscendingOrder( - Expression> propertyExpression, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + Expression> propertyExpression, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return NotBeInAscendingOrder(propertyExpression, GetComparer(), because, becauseArgs); } @@ -1924,8 +1932,7 @@ public AndConstraint NotBeInAscendingOrder( /// /// is . public AndConstraint NotBeInAscendingOrder( - IComparer comparer, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + IComparer comparer, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer."); @@ -1956,7 +1963,8 @@ public AndConstraint NotBeInAscendingOrder( /// is . public AndConstraint NotBeInAscendingOrder( Expression> propertyExpression, IComparer comparer, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer."); @@ -1978,7 +1986,7 @@ public AndConstraint NotBeInAscendingOrder( /// /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// - public AndConstraint NotBeInAscendingOrder([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotBeInAscendingOrder(string because = "", params object[] becauseArgs) { return NotBeInAscendingOrder(GetComparer(), because, becauseArgs); } @@ -2000,7 +2008,8 @@ public AndConstraint NotBeInAscendingOrder([StringSyntax("Composite /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// public AndConstraint NotBeInAscendingOrder(Func comparison, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return NotBeInOrder(Comparer.Create((x, y) => comparison(x, y)), SortOrder.Ascending, because, becauseArgs); } @@ -2023,8 +2032,8 @@ public AndConstraint NotBeInAscendingOrder(Func comparis /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// public AndConstraint NotBeInDescendingOrder( - Expression> propertyExpression, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + Expression> propertyExpression, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return NotBeInDescendingOrder(propertyExpression, GetComparer(), because, becauseArgs); } @@ -2079,7 +2088,8 @@ public AndConstraint NotBeInDescendingOrder( /// is . public AndConstraint NotBeInDescendingOrder( Expression> propertyExpression, IComparer comparer, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer."); @@ -2101,7 +2111,7 @@ public AndConstraint NotBeInDescendingOrder( /// /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// - public AndConstraint NotBeInDescendingOrder([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotBeInDescendingOrder(string because = "", params object[] becauseArgs) { return NotBeInDescendingOrder(GetComparer(), because, becauseArgs); } @@ -2123,7 +2133,8 @@ public AndConstraint NotBeInDescendingOrder([StringSyntax("Composit /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// public AndConstraint NotBeInDescendingOrder(Func comparison, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return NotBeInOrder(Comparer.Create((x, y) => comparison(x, y)), SortOrder.Descending, because, becauseArgs); } @@ -2138,7 +2149,7 @@ public AndConstraint NotBeInDescendingOrder(Func compari /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeNullOrEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotBeNullOrEmpty(string because = "", params object[] becauseArgs) { return NotBeNull(because, becauseArgs) .And.NotBeEmpty(because, becauseArgs); @@ -2156,18 +2167,19 @@ public AndConstraint NotBeNullOrEmpty([StringSyntax("CompositeForma /// Zero or more objects to format using the placeholders in . /// public AndConstraint NotBeSubsetOf(IEnumerable unexpectedSuperset, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Cannot assert a collection against a subset."); - if (success) + if (assertionChain.Succeeded) { if (ReferenceEquals(Subject, unexpectedSuperset)) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith( "Did not expect {context:collection} {0} to be a subset of {1}{reason}, but they both reference the same object.", @@ -2179,7 +2191,7 @@ public AndConstraint NotBeSubsetOf(IEnumerable unexpectedSuperse if (actualItems.Intersect(unexpectedSuperset).Count() == actualItems.Count) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:collection} {0} to be a subset of {1}{reason}.", actualItems, unexpectedSuperset); @@ -2200,31 +2212,27 @@ public AndConstraint NotBeSubsetOf(IEnumerable unexpectedSuperse /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint NotContain(T unexpected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotContain(T unexpected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to not contain {0}{reason}, but found .", unexpected); - IEnumerable matched = []; - - if (success) + if (assertionChain.Succeeded) { ICollection collection = Subject.ConvertOrCastToCollection(); if (collection.Contains(unexpected)) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} {0} to not contain {1}{reason}.", collection, unexpected); } - - matched = collection.Where(item => !EqualityComparer.Default.Equals(item, unexpected)); } - return new AndWhichConstraint((TAssertions)this, matched); + return new AndConstraint((TAssertions)this); } /// @@ -2240,21 +2248,22 @@ public AndWhichConstraint NotContain(T unexpected, /// /// is . public AndConstraint NotContain(Expression> predicate, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(predicate); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} not to contain {0}{reason}, but found .", predicate.Body); - if (success) + if (assertionChain.Succeeded) { Func compiledPredicate = predicate.Compile(); IEnumerable unexpectedItems = Subject!.Where(item => compiledPredicate(item)); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!unexpectedItems.Any()) .FailWith("Expected {context:collection} {0} to not have any items matching {1}{reason}, but found {2}.", @@ -2278,8 +2287,8 @@ public AndConstraint NotContain(Expression> predicate /// /// is . /// is empty. - public AndConstraint NotContain(IEnumerable unexpected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotContain(IEnumerable unexpected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot verify non-containment against a collection"); @@ -2288,12 +2297,12 @@ public AndConstraint NotContain(IEnumerable unexpected, Guard.ThrowIfArgumentIsEmpty(unexpectedObjects, nameof(unexpected), "Cannot verify non-containment against an empty collection"); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to not contain {0}{reason}, but found .", unexpected); - if (success) + if (assertionChain.Succeeded) { IEnumerable foundItems = unexpectedObjects.Intersect(Subject!); @@ -2301,14 +2310,14 @@ public AndConstraint NotContain(IEnumerable unexpected, { if (unexpectedObjects.Count > 1) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} {0} to not contain {1}{reason}, but found {2}.", Subject, unexpected, foundItems); } else { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} {0} to not contain {1}{reason}.", Subject, unexpectedObjects.First()); @@ -2342,7 +2351,8 @@ public AndConstraint NotContain(IEnumerable unexpected, /// Zero or more objects to format using the placeholders in . /// public AndConstraint NotContainEquivalentOf(TExpectation unexpected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return NotContainEquivalentOf(unexpected, config => config, because, becauseArgs); } @@ -2378,18 +2388,19 @@ public AndConstraint NotContainEquivalentOf(TExpectat /// is . [SuppressMessage("Design", "MA0051:Method is too long", Justification = "Needs refactoring")] public AndConstraint NotContainEquivalentOf(TExpectation unexpected, - Func, EquivalencyOptions> config, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + Func, + EquivalencyOptions> config, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} not to contain equivalent of {0}{reason}, but collection is .", unexpected); - if (success) + if (assertionChain.Succeeded) { EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); @@ -2402,7 +2413,7 @@ public AndConstraint NotContainEquivalentOf(TExpectat foreach (T actualItem in Subject!) { var context = - new EquivalencyValidationContext(Node.From(() => AssertionScope.Current.CallerIdentity), + new EquivalencyValidationContext(Node.From(() => CurrentAssertionChain.CallerIdentifier), options) { Reason = new Reason(because, becauseArgs), @@ -2433,22 +2444,21 @@ public AndConstraint NotContainEquivalentOf(TExpectat { using (new AssertionScope()) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) + .WithReportable("configuration", () => options.ToString()) .WithExpectation("Expected {context:collection} {0} not to contain equivalent of {1}{reason}, ", Subject, - unexpected) - .AddReportable("configuration", () => options.ToString()); - - if (foundIndices.Count == 1) - { - Execute.Assertion - .FailWith("but found one at index {0}.", foundIndices[0]); - } - else - { - Execute.Assertion - .FailWith("but found several at indices {0}.", foundIndices); - } + unexpected, chain => + { + if (foundIndices.Count == 1) + { + chain.FailWith("but found one at index {0}.", foundIndices[0]); + } + else + { + chain.FailWith("but found several at indices {0}.", foundIndices); + } + }); } } } @@ -2485,14 +2495,15 @@ public AndConstraint NotContainInOrder(params T[] unexpected) /// /// is . public AndConstraint NotContainInOrder(IEnumerable unexpected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot verify absence of ordered containment against a collection."); if (Subject is null) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Cannot verify absence of ordered containment in a collection."); @@ -2516,7 +2527,7 @@ public AndConstraint NotContainInOrder(IEnumerable unexpected, } } - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:collection} {0} to not contain items {1} in order{reason}, " + @@ -2556,14 +2567,15 @@ public AndConstraint NotContainInConsecutiveOrder(params T[] unexpe /// /// is . public AndConstraint NotContainInConsecutiveOrder(IEnumerable unexpected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot verify absence of ordered containment against a collection."); if (Subject is null) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Cannot verify absence of ordered containment in a collection."); @@ -2593,7 +2605,7 @@ public AndConstraint NotContainInConsecutiveOrder(IEnumerable un if (consecutiveItems == unexpectedItems.Count) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:collection} {0} to not contain items {1} in consecutive order{reason}, " + @@ -2622,17 +2634,18 @@ public AndConstraint NotContainInConsecutiveOrder(IEnumerable un /// /// is . public AndConstraint NotContainNulls(Expression> predicate, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) where TKey : class { Guard.ThrowIfArgumentIsNull(predicate); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} not to contain s{reason}, but collection is ."); - if (success) + if (assertionChain.Succeeded) { Func compiledPredicate = predicate.Compile(); @@ -2640,7 +2653,7 @@ public AndConstraint NotContainNulls(Expression .Where(e => compiledPredicate(e) is null) .ToArray(); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(values.Length == 0) .FailWith("Expected {context:collection} not to contain s on {0}{reason}, but found {1}.", @@ -2660,14 +2673,14 @@ public AndConstraint NotContainNulls(Expression /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotContainNulls([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotContainNulls(string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} not to contain s{reason}, but collection is ."); - if (success) + if (assertionChain.Succeeded) { int[] indices = Subject! .Select((item, index) => (Item: item, Index: index)) @@ -2679,7 +2692,7 @@ public AndConstraint NotContainNulls([StringSyntax("CompositeFormat { if (indices.Length > 1) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:collection} not to contain s{reason}, but found several at indices {0}.", @@ -2687,7 +2700,7 @@ public AndConstraint NotContainNulls([StringSyntax("CompositeFormat } else { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} not to contain s{reason}, but found one at index {0}.", indices[0]); @@ -2711,26 +2724,25 @@ public AndConstraint NotContainNulls([StringSyntax("CompositeFormat /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint NotEqual(IEnumerable unexpected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotEqual(IEnumerable unexpected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare collection with ."); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected collections not to be equal{reason}, ") - .Given(() => Subject) - .ForCondition(subject => subject is not null) - .FailWith("but found .") - .Then - .ForCondition(subject => !ReferenceEquals(subject, unexpected)) - .FailWith("but they both reference the same object.") - .Then - .ClearExpectation() + .WithExpectation("Expected collections not to be equal{reason}, ", chain => chain + .Given(() => Subject) + .ForCondition(subject => subject is not null) + .FailWith("but found .") + .Then + .ForCondition(subject => !ReferenceEquals(subject, unexpected)) + .FailWith("but they both reference the same object.")) .Then - .Given(subject => subject.ConvertOrCastToCollection()) + .Given(() => Subject.ConvertOrCastToCollection()) .ForCondition(actualItems => !actualItems.SequenceEqual(unexpected)) - .FailWith("Did not expect collections {0} and {1} to be equal{reason}.", _ => unexpected, actualItems => actualItems); + .FailWith("Did not expect collections {0} and {1} to be equal{reason}.", _ => unexpected, + actualItems => actualItems); return new AndConstraint((TAssertions)this); } @@ -2746,21 +2758,19 @@ public AndConstraint NotEqual(IEnumerable unexpected, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveCount(int unexpected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotHaveCount(int unexpected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to not contain {0} item(s){reason}, ", unexpected) - .Given(() => Subject) - .ForCondition(subject => subject is not null) - .FailWith("but found .") - .Then - .Given(subject => subject.Count()) - .ForCondition(actualCount => actualCount != unexpected) - .FailWith("but found {0}.", actualCount => actualCount) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} to not contain {0} item(s){reason}, ", unexpected, chain => chain + .Given(() => Subject) + .ForCondition(subject => subject is not null) + .FailWith("but found .") + .Then + .Given(subject => subject.Count()) + .ForCondition(actualCount => actualCount != unexpected) + .FailWith("but found {0}.", actualCount => actualCount)); return new AndConstraint((TAssertions)this); } @@ -2778,11 +2788,12 @@ public AndConstraint NotHaveCount(int unexpected, /// /// is . public AndConstraint NotHaveSameCount(IEnumerable otherCollection, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(otherCollection, nameof(otherCollection), "Cannot verify count against a collection."); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .Given(() => Subject) .ForCondition(subject => subject is not null) @@ -2817,12 +2828,13 @@ public AndConstraint NotHaveSameCount(IEnumerable /// is . public AndConstraint NotIntersectWith(IEnumerable otherCollection, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(otherCollection, nameof(otherCollection), "Cannot verify intersection against a collection."); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .Given(() => Subject) .ForCondition(subject => subject is not null) @@ -2857,25 +2869,23 @@ public AndConstraint NotIntersectWith(IEnumerable otherCollectio /// /// is . public AndConstraint OnlyContain( - Expression> predicate, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + Expression> predicate, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(predicate); Func compiledPredicate = predicate.Compile(); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to contain only items matching {0}{reason}, ", predicate.Body) - .Given(() => Subject) - .ForCondition(subject => subject is not null) - .FailWith("but the collection is .") - .Then - .Given(subject => subject.ConvertOrCastToCollection().Where(item => !compiledPredicate(item))) - .ForCondition(mismatchingItems => !mismatchingItems.Any()) - .FailWith("but {0} do(es) not match.", mismatchingItems => mismatchingItems) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} to contain only items matching {0}{reason}, ", predicate.Body, + chain => chain + .Given(() => Subject) + .ForCondition(subject => subject is not null) + .FailWith("but the collection is .") + .Then + .Given(subject => subject.ConvertOrCastToCollection().Where(item => !compiledPredicate(item))) + .ForCondition(mismatchingItems => !mismatchingItems.Any()) + .FailWith("but {0} do(es) not match.", mismatchingItems => mismatchingItems)); return new AndConstraint((TAssertions)this); } @@ -2893,16 +2903,17 @@ public AndConstraint OnlyContain( /// /// is . public AndConstraint OnlyHaveUniqueItems(Expression> predicate, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(predicate); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to only have unique items{reason}, but found ."); - if (success) + if (assertionChain.Succeeded) { Func compiledPredicate = predicate.Compile(); @@ -2915,7 +2926,7 @@ public AndConstraint OnlyHaveUniqueItems(Expression 1) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:collection} to only have unique items on {0}{reason}, but items {1} are not unique.", @@ -2924,7 +2935,7 @@ public AndConstraint OnlyHaveUniqueItems(Expression OnlyHaveUniqueItems(Expression /// Zero or more objects to format using the placeholders in . /// - public AndConstraint OnlyHaveUniqueItems([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint OnlyHaveUniqueItems(string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to only have unique items{reason}, but found ."); - if (success) + if (assertionChain.Succeeded) { - IEnumerable groupWithMultipleItems = Subject! + T[] groupWithMultipleItems = Subject! .GroupBy(o => o) .Where(g => g.Count() > 1) - .Select(g => g.Key); + .Select(g => g.Key) + .ToArray(); - if (groupWithMultipleItems.Any()) + if (groupWithMultipleItems.Length > 0) { - if (groupWithMultipleItems.Count() > 1) + if (groupWithMultipleItems.Length > 1) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:collection} to only have unique items{reason}, but items {0} are not unique.", @@ -2973,10 +2985,10 @@ public AndConstraint OnlyHaveUniqueItems([StringSyntax("CompositeFo } else { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} to only have unique items{reason}, but item {0} is not unique.", - groupWithMultipleItems.First()); + groupWithMultipleItems[0]); } } } @@ -2999,21 +3011,20 @@ public AndConstraint OnlyHaveUniqueItems([StringSyntax("CompositeFo /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint AllSatisfy(Action expected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint AllSatisfy(Action expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot verify against a inspector"); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to contain only items satisfying the inspector{reason}, ") - .Given(() => Subject) - .ForCondition(subject => subject is not null) - .FailWith("but collection is .") - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} to contain only items satisfying the inspector{reason}, ", + chain => chain + .Given(() => Subject) + .ForCondition(subject => subject is not null) + .FailWith("but collection is .")); - if (success) + if (assertionChain.Succeeded) { string[] failuresFromInspectors; @@ -3028,12 +3039,11 @@ public AndConstraint AllSatisfy(Action expected, string failureMessage = Environment.NewLine + string.Join(Environment.NewLine, failuresFromInspectors.Select(x => x.IndentLines())); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to contain only items satisfying the inspector{reason}:") - .FailWithPreFormatted(failureMessage) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} to contain only items satisfying the inspector{reason}:", + chain => chain + .FailWithPreFormatted(failureMessage)); } return new AndConstraint((TAssertions)this); @@ -3075,7 +3085,8 @@ public AndConstraint SatisfyRespectively(params Action[] element /// is . /// is empty. public AndConstraint SatisfyRespectively(IEnumerable> expected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot verify against a collection of inspectors"); @@ -3084,25 +3095,23 @@ public AndConstraint SatisfyRespectively(IEnumerable> exp Guard.ThrowIfArgumentIsEmpty(elementInspectors, nameof(expected), "Cannot verify against an empty collection of inspectors"); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to satisfy all inspectors{reason}, ") - .Given(() => Subject) - .ForCondition(subject => subject is not null) - .FailWith("but collection is .") - .Then - .ForCondition(subject => subject.Any()) - .FailWith("but collection is empty.") - .Then - .ClearExpectation() + .WithExpectation("Expected {context:collection} to satisfy all inspectors{reason}, ", chain => chain + .Given(() => Subject) + .ForCondition(subject => subject is not null) + .FailWith("but collection is .") + .Then + .ForCondition(subject => subject.Any()) + .FailWith("but collection is empty.")) .Then - .Given(subject => (elements: subject.Count(), inspectors: elementInspectors.Count)) + .Given(() => (elements: Subject.Count(), inspectors: elementInspectors.Count)) .ForCondition(count => count.elements == count.inspectors) .FailWith( "Expected {context:collection} to contain exactly {0} items{reason}, but it contains {1} items", count => count.inspectors, count => count.elements); - if (success) + if (assertionChain.Succeeded) { string[] failuresFromInspectors; @@ -3116,13 +3125,12 @@ public AndConstraint SatisfyRespectively(IEnumerable> exp string failureMessage = Environment.NewLine + string.Join(Environment.NewLine, failuresFromInspectors.Select(x => x.IndentLines())); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .WithExpectation( - "Expected {context:collection} to satisfy all inspectors{reason}, but some inspectors are not satisfied:") - .FailWithPreFormatted(failureMessage) - .Then - .ClearExpectation(); + "Expected {context:collection} to satisfy all inspectors{reason}, but some inspectors are not satisfied:", + chain => chain + .FailWithPreFormatted(failureMessage)); } } @@ -3165,7 +3173,8 @@ public AndConstraint Satisfy(params Expression>[] pre /// is . /// is empty. public AndConstraint Satisfy(IEnumerable>> predicates, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(predicates, nameof(predicates), "Cannot verify against a collection of predicates"); @@ -3174,7 +3183,7 @@ public AndConstraint Satisfy(IEnumerable>> Guard.ThrowIfArgumentIsEmpty(predicatesList, nameof(predicates), "Cannot verify against an empty collection of predicates"); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .Given(() => Subject) .ForCondition(subject => subject is not null) @@ -3183,7 +3192,7 @@ public AndConstraint Satisfy(IEnumerable>> .ForCondition(subject => subject.Any()) .FailWith("Expected {context:collection} to satisfy all predicates{reason}, but collection is empty."); - if (success) + if (assertionChain.Succeeded) { MaximumMatchingSolution maximumMatchingSolution = new MaximumMatchingProblem(predicatesList, Subject).Solve(); @@ -3215,10 +3224,10 @@ public AndConstraint Satisfy(IEnumerable>> message += doubleNewLine + string.Join(doubleNewLine, elementDescriptions); } - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to satisfy all predicates{reason}, but:") - .FailWithPreFormatted(message); + .WithExpectation("Expected {context:collection} to satisfy all predicates{reason}, but:", chain => chain + .FailWithPreFormatted(message)); } } @@ -3240,8 +3249,8 @@ public AndConstraint Satisfy(IEnumerable>> /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint StartWith(IEnumerable expectation, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint StartWith(IEnumerable expectation, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return StartWith(expectation, (a, b) => EqualityComparer.Default.Equals(a, b), because, becauseArgs); } @@ -3266,7 +3275,8 @@ public AndConstraint StartWith(IEnumerable expectation, /// is . public AndConstraint StartWith( IEnumerable expectation, Func equalityComparison, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expectation, nameof(expectation), "Cannot compare collection with ."); @@ -3288,8 +3298,8 @@ public AndConstraint StartWith( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint StartWith(T element, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint StartWith(T element, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return StartWith([element], ObjectExtensions.GetComparer(), because, becauseArgs); } @@ -3298,7 +3308,7 @@ internal AndConstraint> BeOrderedBy( Expression> propertyExpression, IComparer comparer, SortOrder direction, - [StringSyntax("CompositeFormat")] string because, + string because, object[] becauseArgs) { if (IsValidProperty(propertyExpression, because, becauseArgs)) @@ -3311,18 +3321,18 @@ internal AndConstraint> BeOrderedBy( direction, unordered); - Execute.Assertion + assertionChain .ForCondition(unordered.SequenceEqual(expectation)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} {0} to be ordered {1}{reason} and result in {2}.", () => Subject, () => GetExpressionOrderString(propertyExpression), () => expectation); return new AndConstraint>( - new SubsequentOrderingAssertions(Subject, expectation)); + new SubsequentOrderingAssertions(Subject, expectation, assertionChain)); } return new AndConstraint>( - new SubsequentOrderingAssertions(Subject, Enumerable.Empty().OrderBy(x => x))); + new SubsequentOrderingAssertions(Subject, Enumerable.Empty().OrderBy(x => x), assertionChain)); } internal virtual IOrderedEnumerable GetOrderedEnumerable( @@ -3352,50 +3362,49 @@ protected static IEnumerable RepeatAsManyAs(TExpecta protected void AssertCollectionEndsWith(IEnumerable actual, ICollection expected, Func equalityComparison, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(equalityComparison); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to end with {0}{reason}, ", expected) - .Given(() => actual) - .AssertCollectionIsNotNull() - .Then - .AssertCollectionHasEnoughItems(expected.Count) - .Then - .AssertCollectionsHaveSameItems(expected, (a, e) => - { - int firstIndexToCompare = a.Count - e.Count; - int index = a.Skip(firstIndexToCompare).IndexOfFirstDifferenceWith(e, equalityComparison); - return index >= 0 ? index + firstIndexToCompare : index; - }) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} to end with {0}{reason}, ", expected, chain => chain + .Given(() => actual) + .AssertCollectionIsNotNull() + .Then + .AssertCollectionHasEnoughItems(expected.Count) + .Then + .AssertCollectionsHaveSameItems(expected, (a, e) => + { + int firstIndexToCompare = a.Count - e.Count; + int index = a.Skip(firstIndexToCompare).IndexOfFirstDifferenceWith(e, equalityComparison); + return index >= 0 ? index + firstIndexToCompare : index; + })); } protected void AssertCollectionStartsWith(IEnumerable actualItems, ICollection expected, Func equalityComparison, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(equalityComparison); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:collection} to start with {0}{reason}, ", expected) - .Given(() => actualItems) - .AssertCollectionIsNotNull() - .Then - .AssertCollectionHasEnoughItems(expected.Count) - .Then - .AssertCollectionsHaveSameItems(expected, (a, e) => a.Take(e.Count).IndexOfFirstDifferenceWith(e, equalityComparison)) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} to start with {0}{reason}, ", expected, chain => chain + .Given(() => actualItems) + .AssertCollectionIsNotNull() + .Then + .AssertCollectionHasEnoughItems(expected.Count) + .Then + .AssertCollectionsHaveSameItems(expected, + (a, e) => a.Take(e.Count).IndexOfFirstDifferenceWith(e, equalityComparison))); } protected void AssertSubjectEquality(IEnumerable expectation, - Func equalityComparison, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + Func equalityComparison, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(equalityComparison); @@ -3411,21 +3420,16 @@ protected void AssertSubjectEquality(IEnumerable exp ICollection expectedItems = expectation.ConvertOrCastToCollection(); - AssertionScope assertion = Execute.Assertion.BecauseOf(because, becauseArgs); - - if (subjectIsNull) - { - assertion.FailWith("Expected {context:collection} to be equal to {0}{reason}, but found .", expectedItems); - } - - assertion - .WithExpectation("Expected {context:collection} to be equal to {0}{reason}, ", expectedItems) - .Given(() => Subject.ConvertOrCastToCollection()) - .AssertCollectionsHaveSameCount(expectedItems.Count) - .Then - .AssertCollectionsHaveSameItems(expectedItems, (a, e) => a.IndexOfFirstDifferenceWith(e, equalityComparison)) + assertionChain + .BecauseOf(because, becauseArgs) + .ForCondition(!subjectIsNull) + .FailWith("Expected {context:collection} to be equal to {0}{reason}, but found .", expectedItems) .Then - .ClearExpectation(); + .WithExpectation("Expected {context:collection} to be equal to {0}{reason}, ", expectedItems, chain => chain + .Given(() => Subject.ConvertOrCastToCollection()) + .AssertCollectionsHaveSameCount(expectedItems.Count) + .Then + .AssertCollectionsHaveSameItems(expectedItems, (a, e) => a.IndexOfFirstDifferenceWith(e, equalityComparison))); } private static string GetExpressionOrderString(Expression> propertyExpression) @@ -3512,25 +3516,28 @@ private string[] CollectFailuresFromInspectors(IEnumerable> elementIns } private bool IsValidProperty(Expression> propertyExpression, - [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because, + object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(propertyExpression, nameof(propertyExpression), "Cannot assert collection ordering without specifying a property."); propertyExpression.ValidateMemberPath(); - return Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to be ordered by {0}{reason} but found .", () => propertyExpression.GetMemberPath()); + + return assertionChain.Succeeded; } private AndConstraint NotBeOrderedBy( Expression> propertyExpression, IComparer comparer, SortOrder direction, - [StringSyntax("CompositeFormat")] string because, + string because, object[] becauseArgs) { if (IsValidProperty(propertyExpression, because, becauseArgs)) @@ -3543,7 +3550,7 @@ private AndConstraint NotBeOrderedBy( direction, unordered); - Execute.Assertion + assertionChain .ForCondition(!unordered.SequenceEqual(expectation)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} {0} to not be ordered {1}{reason} and not result in {2}.", @@ -3558,19 +3565,19 @@ private AndConstraint NotBeOrderedBy( /// Elements are compared using their implementation. /// private AndConstraint> BeInOrder( - IComparer comparer, SortOrder expectedOrder, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + IComparer comparer, SortOrder expectedOrder, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { string sortOrder = expectedOrder == SortOrder.Ascending ? "ascending" : "descending"; - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith($"Expected {{context:collection}} to be in {sortOrder} order{{reason}}, but found ."); IOrderedEnumerable ordering = Array.Empty().OrderBy(x => x); - if (success) + if (assertionChain.Succeeded) { IList actualItems = Subject.ConvertOrCastToList(); @@ -3585,19 +3592,20 @@ private AndConstraint> BeInOrder( { if (!areSameOrEqual(actualItems[index], orderedItems[index])) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} to be in " + sortOrder + " order{reason}, but found {0} where item at index {1} is in wrong order.", actualItems, index); return new AndConstraint>( - new SubsequentOrderingAssertions(Subject, Enumerable.Empty().OrderBy(x => x))); + new SubsequentOrderingAssertions(Subject, Enumerable.Empty().OrderBy(x => x), assertionChain)); } } } - return new AndConstraint>(new SubsequentOrderingAssertions(Subject, ordering)); + return new AndConstraint>( + new SubsequentOrderingAssertions(Subject, ordering, assertionChain)); } /// @@ -3605,16 +3613,17 @@ private AndConstraint> BeInOrder( /// using their implementation. /// private AndConstraint NotBeInOrder(IComparer comparer, SortOrder order, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { string sortOrder = order == SortOrder.Ascending ? "ascending" : "descending"; - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith($"Did not expect {{context:collection}} to be in {sortOrder} order{{reason}}, but found ."); - if (success) + if (assertionChain.Succeeded) { IList actualItems = Subject.ConvertOrCastToList(); @@ -3628,7 +3637,7 @@ private AndConstraint NotBeInOrder(IComparer comparer, SortOrder .Where((actualItem, index) => !areSameOrEqual(actualItem, orderedItems[index])) .Any(); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(itemsAreUnordered) .FailWith( diff --git a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs index 765a90f2ad..381e082a1b 100644 --- a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs @@ -17,8 +17,8 @@ public class GenericDictionaryAssertions : GenericDictionaryAssertions> where TCollection : IEnumerable> { - public GenericDictionaryAssertions(TCollection keyValuePairs) - : base(keyValuePairs) + public GenericDictionaryAssertions(TCollection keyValuePairs, AssertionChain assertionChain) + : base(keyValuePairs, assertionChain) { } } @@ -26,15 +26,17 @@ public GenericDictionaryAssertions(TCollection keyValuePairs) /// /// Contains a number of methods to assert that a is in the expected state. /// -[DebuggerNonUserCode] public class GenericDictionaryAssertions : GenericCollectionAssertions, TAssertions> where TCollection : IEnumerable> where TAssertions : GenericDictionaryAssertions { - public GenericDictionaryAssertions(TCollection keyValuePairs) - : base(keyValuePairs) + private readonly AssertionChain assertionChain; + + public GenericDictionaryAssertions(TCollection keyValuePairs, AssertionChain assertionChain) + : base(keyValuePairs, assertionChain) { + this.assertionChain = assertionChain; } #region Equal @@ -59,12 +61,12 @@ public AndConstraint Equal(T expected, { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare dictionary with ."); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} to be equal to {0}{reason}, but found {1}.", expected, Subject); - if (success) + if (assertionChain.Succeeded) { IEnumerable subjectKeys = GetKeys(Subject); IEnumerable expectedKeys = GetKeys(expected); @@ -73,7 +75,7 @@ public AndConstraint Equal(T expected, if (missingKeys.Any()) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} to be equal to {0}{reason}, but could not find keys {1}.", expected, missingKeys); @@ -81,9 +83,10 @@ public AndConstraint Equal(T expected, if (additionalKeys.Any()) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:dictionary} to be equal to {0}{reason}, but found additional keys {1}.", expected, + .FailWith("Expected {context:dictionary} to be equal to {0}{reason}, but found additional keys {1}.", + expected, additionalKeys); } @@ -91,7 +94,7 @@ public AndConstraint Equal(T expected, foreach (var key in expectedKeys) { - Execute.Assertion + assertionChain .ForCondition(areSameOrEqual(GetValue(Subject, key), GetValue(expected, key))) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} to be equal to {0}{reason}, but {1} differs at key {2}.", @@ -122,16 +125,16 @@ public AndConstraint NotEqual(T unexpected, { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot compare dictionary with ."); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected dictionaries not to be equal{reason}, but found {0}.", Subject); - if (success) + if (assertionChain.Succeeded) { if (ReferenceEquals(Subject, unexpected)) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected dictionaries not to be equal{reason}, but they both reference the same object."); } @@ -149,7 +152,7 @@ public AndConstraint NotEqual(T unexpected, if (!foundDifference) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Did not expect dictionaries {0} and {1} to be equal{reason}.", unexpected, Subject); } @@ -220,7 +223,7 @@ public AndConstraint BeEquivalentTo(TExpectation expe EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); var context = - new EquivalencyValidationContext(Node.From(() => AssertionScope.Current.CallerIdentity), options) + new EquivalencyValidationContext(Node.From(() => CurrentAssertionChain.CallerIdentifier), options) { Reason = new Reason(because, becauseArgs), TraceWriter = options.TraceWriter @@ -295,12 +298,12 @@ public AndConstraint ContainKeys(IEnumerable expected, ICollection expectedKeys = expected.ConvertOrCastToCollection(); Guard.ThrowIfArgumentIsEmpty(expectedKeys, nameof(expected), "Cannot verify key containment against an empty sequence"); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} to contain keys {0}{reason}, but found .", expected); - if (success) + if (assertionChain.Succeeded) { IEnumerable missingKeys = expectedKeys.Where(key => !ContainsKey(Subject, key)); @@ -308,14 +311,15 @@ public AndConstraint ContainKeys(IEnumerable expected, { if (expectedKeys.Count > 1) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:dictionary} {0} to contain keys {1}{reason}, but could not find {2}.", Subject, + .FailWith("Expected {context:dictionary} {0} to contain keys {1}{reason}, but could not find {2}.", + Subject, expected, missingKeys); } else { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} {0} to contain key {1}{reason}.", Subject, expected.First()); @@ -345,14 +349,14 @@ public AndConstraint ContainKeys(IEnumerable expected, public AndConstraint NotContainKey(TKey unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} not to contain key {0}{reason}, but found .", unexpected); - if (success && ContainsKey(Subject, unexpected)) + if (assertionChain.Succeeded && ContainsKey(Subject, unexpected)) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} {0} not to contain key {1}{reason}, but found it anyhow.", Subject, unexpected); @@ -396,12 +400,12 @@ public AndConstraint NotContainKeys(IEnumerable unexpected, Guard.ThrowIfArgumentIsEmpty(unexpectedKeys, nameof(unexpected), "Cannot verify key containment against an empty sequence"); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} to not contain keys {0}{reason}, but found .", unexpectedKeys); - if (success) + if (assertionChain.Succeeded) { IEnumerable foundKeys = unexpectedKeys.Where(key => ContainsKey(Subject, key)); @@ -409,14 +413,14 @@ public AndConstraint NotContainKeys(IEnumerable unexpected, { if (unexpectedKeys.Count > 1) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} {0} to not contain keys {1}{reason}, but found {2}.", Subject, unexpectedKeys, foundKeys); } else { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} {0} to not contain key {1}{reason}.", Subject, unexpectedKeys.First()); @@ -446,12 +450,10 @@ public AndConstraint NotContainKeys(IEnumerable unexpected, public AndWhichConstraint ContainValue(TValue expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - AndWhichConstraint> innerConstraint = - ContainValuesAndWhich([expected], because, becauseArgs); + AndWhichConstraint> result = + ContainValues([expected], because, becauseArgs); - return - new AndWhichConstraint( - innerConstraint.And, innerConstraint.Which); + return new AndWhichConstraint(result.And, result.Subject); } /// @@ -459,13 +461,13 @@ public AndWhichConstraint ContainValue(TValue expected, /// their implementation. /// /// The expected values - public AndConstraint ContainValues(params TValue[] expected) + public AndWhichConstraint> ContainValues(params TValue[] expected) { return ContainValues(expected, string.Empty); } /// - /// Asserts that the dictionary contains all of the specified values. Values are compared using + /// Asserts that the dictionary contains all the specified values. Values are compared using /// their implementation. /// /// The expected values @@ -478,68 +480,57 @@ public AndConstraint ContainValues(params TValue[] expected) /// /// is . /// is empty. - public AndConstraint ContainValues(IEnumerable expected, + public AndWhichConstraint> ContainValues(IEnumerable expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot verify value containment against a collection of values"); - return ContainValuesAndWhich(expected, because, becauseArgs); - } - - private AndWhichConstraint> ContainValuesAndWhich(IEnumerable expected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { ICollection expectedValues = expected.ConvertOrCastToCollection(); Guard.ThrowIfArgumentIsEmpty(expectedValues, nameof(expected), "Cannot verify value containment against an empty sequence"); - bool success = Execute.Assertion + var missingValues = new List(expectedValues); + + Dictionary matches = new(); + + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:dictionary} to contain values {0}{reason}, but found {1}.", expected, Subject); - - IEnumerable matchedConstraint = null; + .FailWith("Expected {context:dictionary} to contain values {0}{reason}, but found .", expected); - if (success) + if (assertionChain.Succeeded) { - IEnumerable subjectValues = GetValues(Subject); - IEnumerable missingValues = expectedValues.Except(subjectValues); + foreach (var pair in Subject!) + { + if (missingValues.Contains(pair.Value)) + { + matches.Add(pair.Key, pair.Value); + missingValues.Remove(pair.Value); + } + } - if (missingValues.Any()) + if (missingValues.Count > 0) { - if (expectedValues.Count > 1) + if (expectedValues.Count == 1) { - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:dictionary} {0} to contain value {1}{reason}, but could not find {2}.", Subject, - expected, missingValues); + assertionChain.FailWith( + "Expected {context:dictionary} {0} to contain value {1}{reason}.", + Subject, expectedValues.Single()); } else { - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:dictionary} {0} to contain value {1}{reason}.", Subject, - expected.First()); + assertionChain.FailWith( + "Expected {context:dictionary} {0} to contain values {1}{reason}, but could not find {2}.", + Subject, expectedValues, missingValues.Count == 1 ? missingValues.Single() : missingValues); } } - - matchedConstraint = RepetitionPreservingIntersect(subjectValues, expectedValues); } - return new AndWhichConstraint>((TAssertions)this, matchedConstraint); - } + string postfix = matches.Count > 0 ? "[" + string.Join(" and ", matches.Keys) + "]" : ""; - /// - /// Returns an enumerable consisting of all items in the first collection also appearing in the second. - /// - /// Enumerable.Intersect is not suitable because it drops any repeated elements. - private static IEnumerable RepetitionPreservingIntersect( - IEnumerable first, IEnumerable second) - { - var secondSet = new HashSet(second); - return first.Where(e => secondSet.Contains(e)); + return new AndWhichConstraint>((TAssertions)this, matches.Values, assertionChain, postfix); } #endregion @@ -561,14 +552,14 @@ private static IEnumerable RepetitionPreservingIntersect( public AndConstraint NotContainValue(TValue unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} not to contain value {0}{reason}, but found .", unexpected); - if (success && GetValues(Subject).Contains(unexpected)) + if (assertionChain.Succeeded && GetValues(Subject).Contains(unexpected)) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} {0} not to contain value {1}{reason}, but found it anyhow.", Subject, unexpected); @@ -612,12 +603,12 @@ public AndConstraint NotContainValues(IEnumerable unexpecte Guard.ThrowIfArgumentIsEmpty(unexpectedValues, nameof(unexpected), "Cannot verify value containment with an empty sequence"); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} to not contain values {0}{reason}, but found .", unexpected); - if (success) + if (assertionChain.Succeeded) { IEnumerable foundValues = unexpectedValues.Intersect(GetValues(Subject)); @@ -625,14 +616,15 @@ public AndConstraint NotContainValues(IEnumerable unexpecte { if (unexpectedValues.Count > 1) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:dictionary} {0} to not contain value {1}{reason}, but found {2}.", Subject, + .FailWith("Expected {context:dictionary} {0} to not contain value {1}{reason}, but found {2}.", + Subject, unexpected, foundValues); } else { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} {0} to not contain value {1}{reason}.", Subject, unexpected.First()); @@ -684,13 +676,13 @@ public AndConstraint Contain(params KeyValuePair[] ex Guard.ThrowIfArgumentIsEmpty(expectedKeyValuePairs, nameof(expected), "Cannot verify key containment against an empty collection of key/value pairs"); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} to contain key/value pairs {0}{reason}, but dictionary is .", expected); - if (success) + if (assertionChain.Succeeded) { TKey[] expectedKeys = expectedKeyValuePairs.Select(keyValuePair => keyValuePair.Key).ToArray(); IEnumerable missingKeys = expectedKeys.Where(key => !ContainsKey(Subject, key)); @@ -699,7 +691,7 @@ public AndConstraint Contain(params KeyValuePair[] ex { if (expectedKeyValuePairs.Count > 1) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} {0} to contain key(s) {1}{reason}, but could not find keys {2}.", Subject, @@ -707,7 +699,7 @@ public AndConstraint Contain(params KeyValuePair[] ex } else { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} {0} to contain key {1}{reason}.", Subject, expectedKeys[0]); @@ -723,7 +715,7 @@ public AndConstraint Contain(params KeyValuePair[] ex { if (keyValuePairsNotSameOrEqualInSubject.Length > 1) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:dictionary} to contain {0}{reason}, but {context:dictionary} differs at keys {1}.", @@ -734,7 +726,7 @@ public AndConstraint Contain(params KeyValuePair[] ex KeyValuePair expectedKeyValuePair = keyValuePairsNotSameOrEqualInSubject[0]; TValue actual = GetValue(Subject, expectedKeyValuePair.Key); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} to contain value {0} at key {1}{reason}, but found {2}.", expectedKeyValuePair.Value, expectedKeyValuePair.Key, actual); @@ -782,19 +774,19 @@ public AndConstraint Contain(params KeyValuePair[] ex public AndConstraint Contain(TKey key, TValue value, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} to contain value {0} at key {1}{reason}, but dictionary is .", value, key); - if (success) + if (assertionChain.Succeeded) { if (TryGetValue(Subject, key, out TValue actual)) { Func areSameOrEqual = ObjectExtensions.GetComparer(); - Execute.Assertion + assertionChain .ForCondition(areSameOrEqual(actual, value)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} to contain value {0} at key {1}{reason}, but found {2}.", value, key, @@ -802,7 +794,7 @@ public AndConstraint Contain(TKey key, TValue value, } else { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} to contain value {0} at key {1}{reason}, but the key was not found.", value, @@ -853,13 +845,13 @@ public AndConstraint NotContain(params KeyValuePair[] Guard.ThrowIfArgumentIsEmpty(keyValuePairs, nameof(items), "Cannot verify key containment against an empty collection of key/value pairs"); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} to not contain key/value pairs {0}{reason}, but dictionary is .", items); - if (success) + if (assertionChain.Succeeded) { KeyValuePair[] keyValuePairsFound = keyValuePairs.Where(keyValuePair => ContainsKey(Subject, keyValuePair.Key)).ToArray(); @@ -875,7 +867,7 @@ public AndConstraint NotContain(params KeyValuePair[] { if (keyValuePairsSameOrEqualInSubject.Length > 1) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:dictionary} to not contain key/value pairs {0}{reason}, but found them anyhow.", @@ -885,7 +877,7 @@ public AndConstraint NotContain(params KeyValuePair[] { KeyValuePair keyValuePair = keyValuePairsSameOrEqualInSubject[0]; - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:dictionary} to not contain value {0} at key {1}{reason}, but found it anyhow.", @@ -935,15 +927,15 @@ public AndConstraint NotContain(params KeyValuePair[] public AndConstraint NotContain(TKey key, TValue value, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} not to contain value {0} at key {1}{reason}, but dictionary is .", value, key); - if (success && TryGetValue(Subject, key, out TValue actual)) + if (assertionChain.Succeeded && TryGetValue(Subject, key, out TValue actual)) { - Execute.Assertion + assertionChain .ForCondition(!ObjectExtensions.GetComparer()(actual, value)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:dictionary} not to contain value {0} at key {1}{reason}, but found it anyhow.", diff --git a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs index 82e4498f3c..6d2fce15ca 100644 --- a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs @@ -13,8 +13,8 @@ public class StringCollectionAssertions : StringCollectionAssertions /// Initializes a new instance of the class. /// - public StringCollectionAssertions(IEnumerable actualValue) - : base(actualValue) + public StringCollectionAssertions(IEnumerable actualValue, AssertionChain assertionChain) + : base(actualValue, assertionChain) { } } @@ -26,8 +26,8 @@ public class StringCollectionAssertions /// /// Initializes a new instance of the class. /// - public StringCollectionAssertions(TCollection actualValue) - : base(actualValue) + public StringCollectionAssertions(TCollection actualValue, AssertionChain assertionChain) + : base(actualValue, assertionChain) { } } @@ -36,12 +36,15 @@ public class StringCollectionAssertions : GenericColle where TCollection : IEnumerable where TAssertions : StringCollectionAssertions { + private readonly AssertionChain assertionChain; + /// /// Initializes a new instance of the class. /// - public StringCollectionAssertions(TCollection actualValue) - : base(actualValue) + public StringCollectionAssertions(TCollection actualValue, AssertionChain assertionChain) + : base(actualValue, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -131,7 +134,7 @@ public AndConstraint BeEquivalentTo(IEnumerable expectation options = config(AssertionOptions.CloneDefaults()).AsCollection(); var context = - new EquivalencyValidationContext(Node.From>(() => AssertionScope.Current.CallerIdentity), options) + new EquivalencyValidationContext(Node.From>(() => CurrentAssertionChain.CallerIdentifier), options) { Reason = new Reason(because, becauseArgs), TraceWriter = options.TraceWriter @@ -248,45 +251,48 @@ public AndWhichConstraint ContainMatch(string wildcardPatte Guard.ThrowIfArgumentIsEmpty(wildcardPattern, nameof(wildcardPattern), "Cannot match strings in collection against an empty string. Provide a wildcard pattern or use the Contain method."); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:collection} to contain a match of {0}{reason}, but found .", wildcardPattern); - IEnumerable matched = []; + string[] matches = []; + + int? firstMatch = null; - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + (matches, firstMatch) = AllThatMatch(wildcardPattern); + + assertionChain .BecauseOf(because, becauseArgs) - .ForCondition(ContainsMatch(wildcardPattern)) + .ForCondition(matches.Length > 0) .FailWith("Expected {context:collection} {0} to contain a match of {1}{reason}.", Subject, wildcardPattern); - - matched = AllThatMatch(wildcardPattern); } - return new AndWhichConstraint((TAssertions)this, matched); + return new AndWhichConstraint((TAssertions)this, matches, assertionChain, "[" + firstMatch + "]"); } - private bool ContainsMatch(string wildcardPattern) + private (string[] MatchingItems, int? FirstMatchingIndex) AllThatMatch(string wildcardPattern) { - using var scope = new AssertionScope(); - - return Subject.Any(item => - { - item.Should().Match(wildcardPattern); - return scope.Discard().Length == 0; - }); - } + int? firstMatchingIndex = null; - private IEnumerable AllThatMatch(string wildcardPattern) - { - return Subject.Where(item => + var matches = Subject.Where((item, index) => { using var scope = new AssertionScope(); + item.Should().Match(wildcardPattern); - return scope.Discard().Length == 0; + + if (scope.Discard().Length == 0) + { + firstMatchingIndex ??= index; + return true; + } + + return false; }); + + return (matches.ToArray(), firstMatchingIndex); } /// @@ -333,15 +339,15 @@ public AndConstraint NotContainMatch(string wildcardPattern, Guard.ThrowIfArgumentIsEmpty(wildcardPattern, nameof(wildcardPattern), "Cannot match strings in collection against an empty string. Provide a wildcard pattern or use the NotContain method."); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Did not expect {context:collection} to contain a match of {0}{reason}, but found .", wildcardPattern); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(NotContainsMatch(wildcardPattern)) .FailWith("Did not expect {context:collection} {0} to contain a match of {1}{reason}.", Subject, wildcardPattern); diff --git a/Src/FluentAssertions/Collections/SubsequentOrderingAssertions.cs b/Src/FluentAssertions/Collections/SubsequentOrderingAssertions.cs index 8d1faebf3b..82634696b1 100644 --- a/Src/FluentAssertions/Collections/SubsequentOrderingAssertions.cs +++ b/Src/FluentAssertions/Collections/SubsequentOrderingAssertions.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using FluentAssertions.Execution; namespace FluentAssertions.Collections; @@ -8,8 +9,8 @@ namespace FluentAssertions.Collections; public class SubsequentOrderingAssertions : SubsequentOrderingGenericCollectionAssertions, T, SubsequentOrderingAssertions> { - public SubsequentOrderingAssertions(IEnumerable actualValue, IOrderedEnumerable previousOrderedEnumerable) - : base(actualValue, previousOrderedEnumerable) + public SubsequentOrderingAssertions(IEnumerable actualValue, IOrderedEnumerable previousOrderedEnumerable, AssertionChain assertionChain) + : base(actualValue, previousOrderedEnumerable, assertionChain) { } } diff --git a/Src/FluentAssertions/Collections/SubsequentOrderingGenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/SubsequentOrderingGenericCollectionAssertions.cs index 104dedac65..789176f263 100644 --- a/Src/FluentAssertions/Collections/SubsequentOrderingGenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/SubsequentOrderingGenericCollectionAssertions.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Linq.Expressions; using FluentAssertions.Common; +using FluentAssertions.Execution; namespace FluentAssertions.Collections; @@ -17,8 +18,8 @@ public class SubsequentOrderingGenericCollectionAssertions previousOrderedEnumerable; private bool subsequentOrdering; - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, IOrderedEnumerable previousOrderedEnumerable) - : base(actualValue) + public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, IOrderedEnumerable previousOrderedEnumerable, AssertionChain assertionChain) + : base(actualValue, assertionChain) { this.previousOrderedEnumerable = previousOrderedEnumerable; } @@ -170,8 +171,8 @@ public class SubsequentOrderingGenericCollectionAssertions : SubsequentOrderingGenericCollectionAssertions> where TCollection : IEnumerable { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, IOrderedEnumerable previousOrderedEnumerable) - : base(actualValue, previousOrderedEnumerable) + public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, IOrderedEnumerable previousOrderedEnumerable, AssertionChain assertionChain) + : base(actualValue, previousOrderedEnumerable, assertionChain) { } } diff --git a/Src/FluentAssertions/Common/MethodInfoExtensions.cs b/Src/FluentAssertions/Common/MethodInfoExtensions.cs index 7fcef498a5..5219f0570b 100644 --- a/Src/FluentAssertions/Common/MethodInfoExtensions.cs +++ b/Src/FluentAssertions/Common/MethodInfoExtensions.cs @@ -30,7 +30,6 @@ internal static IEnumerable GetMatchingAttributes(this M if (typeof(TAttribute) == typeof(MethodImplAttribute) && memberInfo is MethodBase methodBase) { (bool success, MethodImplAttribute methodImplAttribute) = RecreateMethodImplAttribute(methodBase); - if (success) { customAttributes.Add(methodImplAttribute as TAttribute); diff --git a/Src/FluentAssertions/Common/ObjectExtensions.cs b/Src/FluentAssertions/Common/ObjectExtensions.cs index 7ba5e3bdcc..e1bf0f0032 100644 --- a/Src/FluentAssertions/Common/ObjectExtensions.cs +++ b/Src/FluentAssertions/Common/ObjectExtensions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Globalization; +using FluentAssertions.Formatting; namespace FluentAssertions.Common; @@ -77,4 +78,12 @@ ushort or uint or ulong); } + + /// + /// Convenience method to format an object to a string using the class. + /// + public static string ToFormattedString(this object source) + { + return Formatter.ToString(source); + } } diff --git a/Src/FluentAssertions/Common/StringExtensions.cs b/Src/FluentAssertions/Common/StringExtensions.cs index e83ab55b24..a5177c4e0e 100644 --- a/Src/FluentAssertions/Common/StringExtensions.cs +++ b/Src/FluentAssertions/Common/StringExtensions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text.RegularExpressions; using FluentAssertions.Formatting; @@ -127,6 +128,12 @@ public static string RemoveNewlineStyle(this string @this) .Replace("\r", "\n", StringComparison.Ordinal); } + public static string RemoveTrailingWhitespaceFromLines(this string input) + { + // This regex matches whitespace characters (\s) that are followed by a line ending (\r?\n) + return Regex.Replace(input, @"[ \t]+(?=\r?\n)", string.Empty); + } + /// /// Counts the number of times the appears within a string by using the specified . /// @@ -156,4 +163,9 @@ public static bool IsLongOrMultiline(this string value) const int humanReadableLength = 8; return value.Length > humanReadableLength || value.Contains(Environment.NewLine, StringComparison.Ordinal); } + + public static bool IsNullOrEmpty([NotNullWhen(false)] this string value) + { + return string.IsNullOrEmpty(value); + } } diff --git a/Src/FluentAssertions/CustomAssertionAttribute.cs b/Src/FluentAssertions/CustomAssertionAttribute.cs index 6078c1457f..87dfa929b1 100644 --- a/Src/FluentAssertions/CustomAssertionAttribute.cs +++ b/Src/FluentAssertions/CustomAssertionAttribute.cs @@ -4,7 +4,7 @@ namespace FluentAssertions; /// /// Marks a method as an extension to Fluent Assertions that either uses the built-in assertions -/// internally, or directly uses the Execute.Assertion. +/// internally, or directly uses AssertionChain. /// [AttributeUsage(AttributeTargets.Method)] #pragma warning disable CA1813 // Avoid unsealed attributes. This type has shipped. diff --git a/Src/FluentAssertions/CustomAssertionsAssemblyAttribute.cs b/Src/FluentAssertions/CustomAssertionsAssemblyAttribute.cs index faaff8e2b3..9e0cc90410 100644 --- a/Src/FluentAssertions/CustomAssertionsAssemblyAttribute.cs +++ b/Src/FluentAssertions/CustomAssertionsAssemblyAttribute.cs @@ -4,7 +4,7 @@ namespace FluentAssertions; /// /// Marks an assembly as containing extensions to Fluent Assertions that either uses the built-in assertions -/// internally, or directly uses the Execute.Assertion. +/// internally, or directly uses AssertionChain. /// [AttributeUsage(AttributeTargets.Assembly)] public sealed class CustomAssertionsAssemblyAttribute : Attribute; diff --git a/Src/FluentAssertions/EnumAssertionsExtensions.cs b/Src/FluentAssertions/EnumAssertionsExtensions.cs index 31688fb9cc..da15e34440 100644 --- a/Src/FluentAssertions/EnumAssertionsExtensions.cs +++ b/Src/FluentAssertions/EnumAssertionsExtensions.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using System.Diagnostics.Contracts; +using FluentAssertions.Execution; using FluentAssertions.Primitives; namespace FluentAssertions; @@ -19,7 +20,7 @@ public static class EnumAssertionsExtensions public static EnumAssertions Should(this TEnum @enum) where TEnum : struct, Enum { - return new EnumAssertions(@enum); + return new EnumAssertions(@enum, AssertionChain.GetOrCreate()); } /// @@ -30,6 +31,6 @@ public static EnumAssertions Should(this TEnum @enum) public static NullableEnumAssertions Should(this TEnum? @enum) where TEnum : struct, Enum { - return new NullableEnumAssertions(@enum); + return new NullableEnumAssertions(@enum, AssertionChain.GetOrCreate()); } } diff --git a/Src/FluentAssertions/Equivalency/AssertionChainExtensions.cs b/Src/FluentAssertions/Equivalency/AssertionChainExtensions.cs new file mode 100644 index 0000000000..95227db2cb --- /dev/null +++ b/Src/FluentAssertions/Equivalency/AssertionChainExtensions.cs @@ -0,0 +1,19 @@ +using FluentAssertions.Execution; + +namespace FluentAssertions.Equivalency; + +internal static class AssertionChainExtensions +{ + /// + /// Updates the with the relevant information from the current , including the correct + /// caller identification path. + /// + public static AssertionChain For(this AssertionChain chain, IEquivalencyValidationContext context) + { + chain.OverrideCallerIdentifier(() => context.CurrentNode.Description); + + return chain + .WithReportable("configuration", () => context.Options.ToString()) + .BecauseOf(context.Reason); + } +} diff --git a/Src/FluentAssertions/Equivalency/EquivalencyStep.cs b/Src/FluentAssertions/Equivalency/EquivalencyStep.cs index d50c77023a..58f689f771 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyStep.cs @@ -20,5 +20,5 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon /// Implements , but only gets called when the expected type matches . /// protected abstract EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IValidateChildNodeEquivalency nested); + IValidateChildNodeEquivalency nestedValidator); } diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs index 9d7215a971..2fbced998e 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs @@ -75,7 +75,7 @@ public bool IsCyclicReference(object expectation) is EqualityStrategy.Members or EqualityStrategy.ForceMembers; var reference = new ObjectReference(expectation, CurrentNode.PathAndName, compareByMembers); - return CyclicReferenceDetector.IsCyclicReference(reference, Options.CyclicReferenceHandling, Reason); + return CyclicReferenceDetector.IsCyclicReference(reference); } public ITraceWriter TraceWriter { get; set; } diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs index 6d7de0a3fd..b856f6d22a 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs @@ -15,10 +15,6 @@ public void AssertEquality(Comparands comparands, EquivalencyValidationContext c { using var scope = new AssertionScope(); - scope.AssumeSingleCaller(); - scope.AddReportable("configuration", () => context.Options.ToString()); - scope.BecauseOf(context.Reason); - RecursivelyAssertEquivalencyOf(comparands, context); if (context.TraceWriter is not null) @@ -34,39 +30,40 @@ private void RecursivelyAssertEquivalencyOf(Comparands comparands, IEquivalencyV public void AssertEquivalencyOf(Comparands comparands, IEquivalencyValidationContext context) { - var scope = AssertionScope.Current; + var assertionChain = AssertionChain.GetOrCreate() + .For(context) + .BecauseOf(context.Reason); - if (ShouldContinueThisDeep(context.CurrentNode, context.Options, scope)) + if (ShouldContinueThisDeep(context.CurrentNode, context.Options, assertionChain)) { - TrackWhatIsNeededToProvideContextToFailures(scope, comparands, context.CurrentNode); - if (!context.IsCyclicReference(comparands.Expectation)) { TryToProveNodesAreEquivalent(comparands, context); } + else if (context.Options.CyclicReferenceHandling == CyclicReferenceHandling.ThrowException) + { + assertionChain.FailWith("Expected {context:subject} to be {expectation}{reason}, but it contains a cyclic reference."); + } + else + { + // If cyclic references are allowed, we consider the objects to be equivalent + } } } private static bool ShouldContinueThisDeep(INode currentNode, IEquivalencyOptions options, - AssertionScope assertionScope) + AssertionChain assertionChain) { bool shouldRecurse = options.AllowInfiniteRecursion || currentNode.Depth <= MaxDepth; if (!shouldRecurse) { // This will throw, unless we're inside an AssertionScope - assertionScope.FailWith($"The maximum recursion depth of {MaxDepth} was reached. "); + assertionChain.FailWith($"The maximum recursion depth of {MaxDepth} was reached. "); } return shouldRecurse; } - private static void TrackWhatIsNeededToProvideContextToFailures(AssertionScope scope, Comparands comparands, INode currentNode) - { - scope.Context = new Lazy(() => currentNode.Description); - - scope.TrackComparands(comparands.Subject, comparands.Expectation); - } - private void TryToProveNodesAreEquivalent(Comparands comparands, IEquivalencyValidationContext context) { using var _ = context.Tracer.WriteBlock(node => node.Description); diff --git a/Src/FluentAssertions/Equivalency/Execution/CyclicReferenceDetector.cs b/Src/FluentAssertions/Equivalency/Execution/CyclicReferenceDetector.cs index 600823aee9..4ca13ce49d 100644 --- a/Src/FluentAssertions/Equivalency/Execution/CyclicReferenceDetector.cs +++ b/Src/FluentAssertions/Equivalency/Execution/CyclicReferenceDetector.cs @@ -19,24 +19,13 @@ internal class CyclicReferenceDetector : ICloneable2 /// Determines whether the specified object reference is a cyclic reference to the same object earlier in the /// equivalency validation. /// - /// - /// The behavior of a cyclic reference is determined by the parameter. - /// - public bool IsCyclicReference(ObjectReference reference, CyclicReferenceHandling handling, Reason reason = null) + public bool IsCyclicReference(ObjectReference reference) { bool isCyclic = false; if (reference.CompareByMembers) { isCyclic = !observedReferences.Add(reference); - - if (isCyclic && handling == CyclicReferenceHandling.ThrowException) - { - AssertionScope.Current - .BecauseOf(reason) - .FailWith( - "Expected {context:subject} to be {expectation}{reason}, but it contains a cyclic reference."); - } } return isCyclic; diff --git a/Src/FluentAssertions/Equivalency/IEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/IEquivalencyStep.cs index d4f744b5ea..d0279009ae 100644 --- a/Src/FluentAssertions/Equivalency/IEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/IEquivalencyStep.cs @@ -15,5 +15,6 @@ public interface IEquivalencyStep /// /// May throw when preconditions are not met or if it detects mismatching data. /// - EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, IValidateChildNodeEquivalency valueChildNodes); + EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, + IValidateChildNodeEquivalency valueChildNodes); } diff --git a/Src/FluentAssertions/Equivalency/IMemberMatchingRule.cs b/Src/FluentAssertions/Equivalency/IMemberMatchingRule.cs index 00f1dbcdad..0a59d796eb 100644 --- a/Src/FluentAssertions/Equivalency/IMemberMatchingRule.cs +++ b/Src/FluentAssertions/Equivalency/IMemberMatchingRule.cs @@ -1,3 +1,5 @@ +using FluentAssertions.Execution; + namespace FluentAssertions.Equivalency; /// @@ -15,17 +17,18 @@ public interface IMemberMatchingRule /// simply return . /// /// - /// The of the subject's member for which a match must be found. Can never - /// be . + /// The of the subject's member for which a match must be found. Can never + /// be . /// /// - /// The subject object for which a matching member must be returned. Can never be . + /// The subject object for which a matching member must be returned. Can never be . /// /// /// + /// /// /// Returns the of the property with which to compare the subject with, or /// if no match was found. /// - IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options); + IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options, AssertionChain assertionChain); } diff --git a/Src/FluentAssertions/Equivalency/Matching/MappedMemberMatchingRule.cs b/Src/FluentAssertions/Equivalency/Matching/MappedMemberMatchingRule.cs index 51b6c43a2b..faa1aaaea2 100644 --- a/Src/FluentAssertions/Equivalency/Matching/MappedMemberMatchingRule.cs +++ b/Src/FluentAssertions/Equivalency/Matching/MappedMemberMatchingRule.cs @@ -1,6 +1,7 @@ using System; using System.Text.RegularExpressions; using FluentAssertions.Common; +using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Matching; @@ -29,7 +30,7 @@ public MappedMemberMatchingRule(string expectationMemberName, string subjectMemb this.subjectMemberName = subjectMemberName; } - public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options) + public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options, AssertionChain assertionChain) { if (parent.Type.IsSameOrInherits(typeof(TExpectation)) && subject is TSubject && expectedMember.Name == expectationMemberName) diff --git a/Src/FluentAssertions/Equivalency/Matching/MappedPathMatchingRule.cs b/Src/FluentAssertions/Equivalency/Matching/MappedPathMatchingRule.cs index ded3bcaa9f..88c44a8f4c 100644 --- a/Src/FluentAssertions/Equivalency/Matching/MappedPathMatchingRule.cs +++ b/Src/FluentAssertions/Equivalency/Matching/MappedPathMatchingRule.cs @@ -1,5 +1,6 @@ using System; using FluentAssertions.Common; +using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Matching; @@ -42,7 +43,7 @@ public MappedPathMatchingRule(string expectationMemberPath, string subjectMember } } - public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options) + public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options, AssertionChain assertionChain) { MemberPath path = expectationPath; diff --git a/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs b/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs index 36d220c195..dc5ac17c6e 100644 --- a/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs +++ b/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs @@ -9,7 +9,7 @@ namespace FluentAssertions.Equivalency.Matching; /// internal class MustMatchByNameRule : IMemberMatchingRule { - public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options) + public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options, AssertionChain assertionChain) { IMember subjectMember = null; @@ -33,12 +33,12 @@ public IMember Match(IMember expectedMember, object subject, INode parent, IEqui if (subjectMember is null) { - Execute.Assertion.FailWith( + assertionChain.FailWith( $"Expectation has {expectedMember.Description} that the other object does not have."); } else if (options.IgnoreNonBrowsableOnSubject && !subjectMember.IsBrowsable) { - Execute.Assertion.FailWith( + assertionChain.FailWith( $"Expectation has {expectedMember.Description} that is non-browsable in the other object, and non-browsable " + "members on the subject are ignored with the current configuration"); } diff --git a/Src/FluentAssertions/Equivalency/Matching/TryMatchByNameRule.cs b/Src/FluentAssertions/Equivalency/Matching/TryMatchByNameRule.cs index 06cabfdf60..9d6d7dc95c 100644 --- a/Src/FluentAssertions/Equivalency/Matching/TryMatchByNameRule.cs +++ b/Src/FluentAssertions/Equivalency/Matching/TryMatchByNameRule.cs @@ -1,5 +1,6 @@ using System.Reflection; using FluentAssertions.Common; +using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Matching; @@ -8,7 +9,7 @@ namespace FluentAssertions.Equivalency.Matching; /// internal class TryMatchByNameRule : IMemberMatchingRule { - public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options) + public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options, AssertionChain assertionChain) { if (options.IncludedProperties != MemberVisibility.None) { diff --git a/Src/FluentAssertions/Equivalency/MultiDimensionalArrayEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/MultiDimensionalArrayEquivalencyStep.cs index 016a566003..4962f36860 100644 --- a/Src/FluentAssertions/Equivalency/MultiDimensionalArrayEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/MultiDimensionalArrayEquivalencyStep.cs @@ -18,7 +18,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon return EquivalencyResult.ContinueWithNext; } - if (AreComparable(comparands, expectationAsArray)) + if (AreComparable(comparands, expectationAsArray, AssertionChain.GetOrCreate().For(context))) { if (expectationAsArray.Length == 0) { @@ -36,7 +36,8 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon IEquivalencyValidationContext itemContext = context.AsCollectionItem(listOfIndices); - valueChildNodes.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(object)), itemContext); + valueChildNodes.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(object)), + itemContext); } while (digit.Increment()); } @@ -52,25 +53,27 @@ private static Digit BuildDigitsRepresentingAllIndices(Array subjectAsArray) .Aggregate((Digit)null, (next, rank) => new Digit(subjectAsArray.GetLength(rank), next)); } - private static bool AreComparable(Comparands comparands, Array expectationAsArray) + private static bool AreComparable(Comparands comparands, Array expectationAsArray, AssertionChain assertionChain) { return - IsArray(comparands.Subject) && - HaveSameRank(comparands.Subject, expectationAsArray) && - HaveSameDimensions(comparands.Subject, expectationAsArray); + IsArray(comparands.Subject, assertionChain) && + HaveSameRank(comparands.Subject, expectationAsArray, assertionChain) && + HaveSameDimensions(comparands.Subject, expectationAsArray, assertionChain); } - private static bool IsArray(object type) + private static bool IsArray(object type, AssertionChain assertionChain) { - return AssertionScope.Current + assertionChain .ForCondition(type is not null) .FailWith("Cannot compare a multi-dimensional array to .") .Then .ForCondition(type is Array) .FailWith("Cannot compare a multi-dimensional array to something else."); + + return assertionChain.Succeeded; } - private static bool HaveSameDimensions(object subject, Array expectation) + private static bool HaveSameDimensions(object subject, Array expectation, AssertionChain assertionChain) { bool sameDimensions = true; @@ -79,22 +82,26 @@ private static bool HaveSameDimensions(object subject, Array expectation) int actualLength = ((Array)subject).GetLength(dimension); int expectedLength = expectation.GetLength(dimension); - sameDimensions &= AssertionScope.Current + assertionChain .ForCondition(expectedLength == actualLength) .FailWith("Expected dimension {0} to contain {1} item(s), but found {2}.", dimension, expectedLength, actualLength); + + sameDimensions &= assertionChain.Succeeded; } return sameDimensions; } - private static bool HaveSameRank(object subject, Array expectation) + private static bool HaveSameRank(object subject, Array expectation, AssertionChain assertionChain) { var subjectAsArray = (Array)subject; - return AssertionScope.Current + assertionChain .ForCondition(subjectAsArray.Rank == expectation.Rank) .FailWith("Expected {context:array} to have {0} dimension(s), but it has {1}.", expectation.Rank, subjectAsArray.Rank); + + return assertionChain.Succeeded; } } diff --git a/Src/FluentAssertions/Equivalency/Node.cs b/Src/FluentAssertions/Equivalency/Node.cs index 4f264a3d38..96ee51e87f 100644 --- a/Src/FluentAssertions/Equivalency/Node.cs +++ b/Src/FluentAssertions/Equivalency/Node.cs @@ -10,11 +10,18 @@ internal class Node : INode { private static readonly Regex MatchFirstIndex = new(@"^\[[0-9]+\]$"); + private GetSubjectId subjectIdProvider; + private string path; private string name; private string pathAndName; + private string cachedSubjectId; - public GetSubjectId GetSubjectId { get; protected set; } = () => string.Empty; + public GetSubjectId GetSubjectId + { + get => () => cachedSubjectId ??= subjectIdProvider(); + protected init => subjectIdProvider = value; + } public Type Type { get; protected set; } @@ -76,7 +83,7 @@ public static INode From(GetSubjectId getSubjectId) { return new Node { - GetSubjectId = () => getSubjectId() ?? "root", + subjectIdProvider = () => getSubjectId() ?? "root", Name = string.Empty, Path = string.Empty, Type = typeof(T), diff --git a/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs b/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs index b1b9b7cfe2..8bde0c02aa 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs @@ -22,7 +22,7 @@ public void AddSet(object key, string[] failures) } /// - /// Returns the closest match compared to the set identified by the provided or + /// Returns the closest match compared to the set identified by the provided or /// an empty array if one of the results represents a successful assertion. /// /// diff --git a/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs index ce2116a0fe..2a1990786b 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs @@ -10,15 +10,15 @@ public class AssertionRuleEquivalencyStep : IEquivalencyStep { private readonly Func predicate; private readonly string description; - private readonly Action> assertion; + private readonly Action> assertionAction; private readonly AutoConversionStep converter = new(); public AssertionRuleEquivalencyStep( Expression> predicate, - Action> assertion) + Action> assertionAction) { this.predicate = predicate.Compile(); - this.assertion = assertion; + this.assertionAction = assertionAction; description = predicate.ToString(); } @@ -49,7 +49,6 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon { // Try again after conversion success = ExecuteAssertion(comparands, context); - if (success) { // If the assertion succeeded after conversion, discard the failures from @@ -67,30 +66,33 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon private bool ExecuteAssertion(Comparands comparands, IEquivalencyValidationContext context) { bool subjectIsNull = comparands.Subject is null; + bool expectationIsNull = comparands.Expectation is null; - bool subjectIsValidType = - AssertionScope.Current + var assertionChain = AssertionChain.GetOrCreate().For(context); + + assertionChain .ForCondition(subjectIsNull || comparands.Subject.GetType().IsSameOrInherits(typeof(TSubject))) .FailWith("Expected " + context.CurrentNode.Description + " from subject to be a {0}{reason}, but found a {1}.", - typeof(TSubject), comparands.Subject?.GetType()); - - bool expectationIsNull = comparands.Expectation is null; - - bool expectationIsValidType = - AssertionScope.Current + typeof(TSubject), comparands.Subject?.GetType()) + .Then .ForCondition(expectationIsNull || comparands.Expectation.GetType().IsSameOrInherits(typeof(TSubject))) .FailWith( "Expected " + context.CurrentNode.Description + " from expectation to be a {0}{reason}, but found a {1}.", typeof(TSubject), comparands.Expectation?.GetType()); - if (subjectIsValidType && expectationIsValidType) + if (assertionChain.Succeeded) { if ((subjectIsNull || expectationIsNull) && !CanBeNull()) { return false; } - assertion(AssertionContext.CreateFrom(comparands, context)); + // Caller identitification should not get confused about invoking a Should within the assertion action + string callerIdentifier = context.CurrentNode.Description; + assertionChain.OverrideCallerIdentifier(() => callerIdentifier); + assertionChain.ReuseOnce(); + + assertionAction(AssertionContext.CreateFrom(comparands, context)); return true; } diff --git a/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs index 67dff5dbf2..2b9f777887 100644 --- a/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Diagnostics.CodeAnalysis; +using FluentAssertions.Common; using FluentAssertions.Execution; using static System.FormattableString; @@ -8,13 +9,16 @@ namespace FluentAssertions.Equivalency.Steps; public class DictionaryEquivalencyStep : EquivalencyStep { [SuppressMessage("ReSharper", "PossibleNullReferenceException")] - protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IValidateChildNodeEquivalency nested) + protected override EquivalencyResult OnHandle(Comparands comparands, + IEquivalencyValidationContext context, + IValidateChildNodeEquivalency nestedValidator) { var subject = comparands.Subject as IDictionary; var expectation = comparands.Expectation as IDictionary; - if (PreconditionsAreMet(expectation, subject) && expectation is not null) + var assertionChain = AssertionChain.GetOrCreate().For(context); + + if (PreconditionsAreMet(expectation, subject, assertionChain) && expectation is not null) { foreach (object key in expectation.Keys) { @@ -23,8 +27,7 @@ protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalenc context.Tracer.WriteLine(member => Invariant($"Recursing into dictionary item {key} at {member.Description}")); - nested.AssertEquivalencyOf(new Comparands(subject[key], expectation[key], typeof(object)), - context.AsDictionaryItem(key)); + nestedValidator.AssertEquivalencyOf(new Comparands(subject[key], expectation[key], typeof(object)), context.AsDictionaryItem(key)); } else { @@ -32,6 +35,7 @@ protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalenc Invariant( $"Comparing dictionary item {key} at {member.Description} between subject and expectation")); + assertionChain.WithCallerPostfix($"[{key.ToFormattedString()}]").ReuseOnce(); subject[key].Should().Be(expectation[key], context.Reason.FormattedMessage, context.Reason.Arguments); } } @@ -40,32 +44,38 @@ protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalenc return EquivalencyResult.EquivalencyProven; } - private static bool PreconditionsAreMet(IDictionary expectation, IDictionary subject) + private static bool PreconditionsAreMet(IDictionary expectation, IDictionary subject, AssertionChain assertionChain) { - return AssertIsDictionary(subject) - && AssertEitherIsNotNull(expectation, subject) - && AssertSameLength(expectation, subject); + return AssertIsDictionary(subject, assertionChain) + && AssertEitherIsNotNull(expectation, subject, assertionChain) + && AssertSameLength(expectation, subject, assertionChain); } - private static bool AssertEitherIsNotNull(IDictionary expectation, IDictionary subject) + private static bool AssertEitherIsNotNull(IDictionary expectation, IDictionary subject, AssertionChain assertionChain) { - return AssertionScope.Current + assertionChain .ForCondition((expectation is null && subject is null) || expectation is not null) .FailWith("Expected {context:subject} to be {0}{reason}, but found {1}.", null, subject); + + return assertionChain.Succeeded; } - private static bool AssertIsDictionary(IDictionary subject) + private static bool AssertIsDictionary(IDictionary subject, AssertionChain assertionChain) { - return AssertionScope.Current + assertionChain .ForCondition(subject is not null) .FailWith("Expected {context:subject} to be a dictionary, but it is not."); + + return assertionChain.Succeeded; } - private static bool AssertSameLength(IDictionary expectation, IDictionary subject) + private static bool AssertSameLength(IDictionary expectation, IDictionary subject, AssertionChain assertionChain) { - return AssertionScope.Current + assertionChain .ForCondition(expectation is null || subject.Keys.Count == expectation.Keys.Count) .FailWith("Expected {context:subject} to be a dictionary with {0} item(s), but it only contains {1} item(s).", expectation?.Keys.Count, subject?.Keys.Count); + + return assertionChain.Succeeded; } } diff --git a/Src/FluentAssertions/Equivalency/Steps/DictionaryInterfaceInfo.cs b/Src/FluentAssertions/Equivalency/Steps/DictionaryInterfaceInfo.cs index f24ac8a726..e0ca76da14 100644 --- a/Src/FluentAssertions/Equivalency/Steps/DictionaryInterfaceInfo.cs +++ b/Src/FluentAssertions/Equivalency/Steps/DictionaryInterfaceInfo.cs @@ -4,7 +4,6 @@ using System.Linq; using System.Reflection; using FluentAssertions.Common; -using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Steps; @@ -73,11 +72,8 @@ public static DictionaryInterfaceInfo FindFromWithKey(Type target, string role, if (suitableDictionaryInterfaces.Length > 1) { - // SMELL: Code could be written to handle this better, but is it really worth the effort? - AssertionScope.Current.FailWith( + throw new InvalidOperationException( $"The {role} implements multiple IDictionary interfaces taking a key of {key}. "); - - return null; } if (suitableDictionaryInterfaces.Length == 0) diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs b/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs index a0251192ca..a089bdc445 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs @@ -18,7 +18,9 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon return EquivalencyResult.ContinueWithNext; } - bool succeeded = Execute.Assertion + var assertionChain = AssertionChain.GetOrCreate().For(context); + + assertionChain .ForCondition(comparands.Subject?.GetType().IsEnum == true) .BecauseOf(context.Reason) .FailWith(() => @@ -31,16 +33,16 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon comparands.Subject); }); - if (succeeded) + if (assertionChain.Succeeded) { switch (context.Options.EnumEquivalencyHandling) { case EnumEquivalencyHandling.ByValue: - HandleByValue(comparands, context.Reason); + HandleByValue(assertionChain, comparands, context.Reason); break; case EnumEquivalencyHandling.ByName: - HandleByName(comparands, context.Reason); + HandleByName(assertionChain, comparands, context.Reason); break; default: @@ -51,12 +53,12 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon return EquivalencyResult.EquivalencyProven; } - private static void HandleByValue(Comparands comparands, Reason reason) + private static void HandleByValue(AssertionChain assertionChain, Comparands comparands, Reason reason) { decimal? subjectsUnderlyingValue = ExtractDecimal(comparands.Subject); decimal? expectationsUnderlyingValue = ExtractDecimal(comparands.Expectation); - Execute.Assertion + assertionChain .ForCondition(subjectsUnderlyingValue == expectationsUnderlyingValue) .BecauseOf(reason) .FailWith(() => @@ -69,12 +71,12 @@ private static void HandleByValue(Comparands comparands, Reason reason) }); } - private static void HandleByName(Comparands comparands, Reason reason) + private static void HandleByName(AssertionChain assertionChain, Comparands comparands, Reason reason) { string subject = comparands.Subject.ToString(); string expected = comparands.Expectation.ToString(); - Execute.Assertion + assertionChain .ForCondition(subject == expected) .BecauseOf(reason) .FailWith(() => diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs index 45fc7d57e1..1b6906ba58 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs @@ -15,9 +15,11 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon return EquivalencyResult.ContinueWithNext; } - if (AssertSubjectIsCollection(comparands.Subject)) + var assertionChain = AssertionChain.GetOrCreate().For(context); + + if (AssertSubjectIsCollection(assertionChain, comparands.Subject)) { - var validator = new EnumerableEquivalencyValidator(valueChildNodes, context) + var validator = new EnumerableEquivalencyValidator(assertionChain, valueChildNodes, context) { Recursive = context.CurrentNode.IsRoot || context.Options.IsRecursive, OrderingRules = context.Options.OrderingRules @@ -29,20 +31,20 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon return EquivalencyResult.EquivalencyProven; } - private static bool AssertSubjectIsCollection(object subject) + private static bool AssertSubjectIsCollection(AssertionChain assertionChain, object subject) { - bool conditionMet = AssertionScope.Current + assertionChain .ForCondition(subject is not null) .FailWith("Expected a collection, but {context:Subject} is ."); - if (conditionMet) + if (assertionChain.Succeeded) { - conditionMet = AssertionScope.Current + assertionChain .ForCondition(IsCollection(subject.GetType())) .FailWith("Expected a collection, but {context:Subject} is of a non-collection type."); } - return conditionMet; + return assertionChain.Succeeded; } private static bool IsCollection(Type type) diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs index 3a58151a4c..c2e7d5640f 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs @@ -16,13 +16,16 @@ internal class EnumerableEquivalencyValidator #region Private Definitions + private readonly AssertionChain assertionChain; private readonly IValidateChildNodeEquivalency parent; private readonly IEquivalencyValidationContext context; #endregion - public EnumerableEquivalencyValidator(IValidateChildNodeEquivalency parent, IEquivalencyValidationContext context) + public EnumerableEquivalencyValidator(AssertionChain assertionChain, IValidateChildNodeEquivalency parent, + IEquivalencyValidationContext context) { + this.assertionChain = assertionChain; this.parent = parent; this.context = context; Recursive = false; @@ -54,24 +57,25 @@ public void Execute(object[] subject, T[] expectation) } } - private static bool AssertIsNotNull(object expectation, object[] subject) + private bool AssertIsNotNull(object expectation, object[] subject) { - return AssertionScope.Current + assertionChain .ForCondition(expectation is not null) - .FailWith("Expected {context:subject} to be , but found {0}.", new object[] { subject }); + .FailWith("Expected {context:subject} to be , but found {0}.", [subject]); + + return assertionChain.Succeeded; } - private static Continuation AssertCollectionsHaveSameCount(ICollection subject, ICollection expectation) + private bool AssertCollectionsHaveSameCount(ICollection subject, ICollection expectation) { - return AssertionScope.Current - .WithExpectation("Expected {context:subject} to be a collection with {0} item(s){reason}", expectation.Count) + assertionChain .AssertEitherCollectionIsNotEmpty(subject, expectation) .Then .AssertCollectionHasEnoughItems(subject, expectation) .Then - .AssertCollectionHasNotTooManyItems(subject, expectation) - .Then - .ClearExpectation(); + .AssertCollectionHasNotTooManyItems(subject, expectation); + + return assertionChain.Succeeded; } private void AssertElementGraphEquivalency(object[] subjects, T[] expectations, INode currentNode) @@ -101,11 +105,9 @@ private void AssertElementGraphEquivalencyWithStrictOrdering(object[] subject $"Strictly comparing expectation {expectation} at {member.Description} to item with index {index} in {subjects}")); bool succeeded = StrictlyMatchAgainst(subjects, expectation, index); - if (!succeeded) { failedCount++; - if (failedCount >= FailedItemsFastFailThreshold) { context.Tracer.WriteLine(member => @@ -185,7 +187,7 @@ private bool LooselyMatchAgainst(IList subjects, T expectation, int e foreach (string failure in results.GetTheFailuresForTheSetWithTheFewestFailures(expectationIndex)) { - AssertionScope.Current.AddPreFormattedFailure(failure); + assertionChain.AddPreFormattedFailure(failure); } return indexToBeRemoved != -1; @@ -195,8 +197,7 @@ private string[] TryToMatch(object subject, T expectation, int expectationInd { using var scope = new AssertionScope(); - parent.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(T)), - context.AsCollectionItem(expectationIndex)); + parent.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(T)), context.AsCollectionItem(expectationIndex)); return scope.Discard(); } diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidatorExtensions.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidatorExtensions.cs index 473811c746..f3f3d00e21 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidatorExtensions.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidatorExtensions.cs @@ -6,38 +6,46 @@ namespace FluentAssertions.Equivalency.Steps; internal static class EnumerableEquivalencyValidatorExtensions { - public static Continuation AssertEitherCollectionIsNotEmpty(this IAssertionScope scope, ICollection subject, + public static Continuation AssertEitherCollectionIsNotEmpty(this AssertionChain assertionChain, + ICollection subject, ICollection expectation) { - return scope - .ForCondition(subject.Count > 0 || expectation.Count == 0) - .FailWith(", but found an empty collection.") - .Then - .ForCondition(subject.Count == 0 || expectation.Count > 0) - .FailWith($", but {{0}}{Environment.NewLine}contains {{1}} item(s).", - subject, - subject.Count); + return assertionChain + .WithExpectation("Expected {context:subject} to be a collection with {0} item(s){reason}", expectation.Count, + chain => chain + .ForCondition(subject.Count > 0 || expectation.Count == 0) + .FailWith(", but found an empty collection.") + .Then + .ForCondition(subject.Count == 0 || expectation.Count > 0) + .FailWith($", but {{0}}{Environment.NewLine}contains {{1}} item(s).", + subject, + subject.Count)); } - public static Continuation AssertCollectionHasEnoughItems(this IAssertionScope scope, ICollection subject, + public static Continuation AssertCollectionHasEnoughItems(this AssertionChain assertionChain, ICollection subject, ICollection expectation) { - return scope - .ForCondition(subject.Count >= expectation.Count) - .FailWith($", but {{0}}{Environment.NewLine}contains {{1}} item(s) less than{Environment.NewLine}{{2}}.", - subject, - expectation.Count - subject.Count, - expectation); + return assertionChain + .WithExpectation("Expected {context:subject} to be a collection with {0} item(s){reason}", expectation.Count, + chain => chain + .ForCondition(subject.Count >= expectation.Count) + .FailWith($", but {{0}}{Environment.NewLine}contains {{1}} item(s) less than{Environment.NewLine}{{2}}.", + subject, + expectation.Count - subject.Count, + expectation)); } - public static Continuation AssertCollectionHasNotTooManyItems(this IAssertionScope scope, ICollection subject, + public static Continuation AssertCollectionHasNotTooManyItems(this AssertionChain assertionChain, + ICollection subject, ICollection expectation) { - return scope - .ForCondition(subject.Count <= expectation.Count) - .FailWith($", but {{0}}{Environment.NewLine}contains {{1}} item(s) more than{Environment.NewLine}{{2}}.", - subject, - subject.Count - expectation.Count, - expectation); + return assertionChain + .WithExpectation("Expected {context:subject} to be a collection with {0} item(s){reason}", expectation.Count, + chain => chain + .ForCondition(subject.Count <= expectation.Count) + .FailWith($", but {{0}}{Environment.NewLine}contains {{1}} item(s) more than{Environment.NewLine}{{2}}.", + subject, + subject.Count - expectation.Count, + expectation)); } } diff --git a/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs index 2ba66b8c9e..6bd954d16b 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs @@ -29,7 +29,8 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon return EquivalencyResult.ContinueWithNext; } - Execute.Assertion + AssertionChain.GetOrCreate() + .For(context) .BecauseOf(context.Reason.FormattedMessage, context.Reason.Arguments) .ForCondition(comparands.Subject is T) .FailWith("Expected {context:object} to be of type {0}{because}, but found {1}", typeof(T), comparands.Subject) diff --git a/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs index f10a166a19..01b58bb808 100644 --- a/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs @@ -11,7 +11,7 @@ public class GenericDictionaryEquivalencyStep : IEquivalencyStep { #pragma warning disable SA1110 // Allow opening parenthesis on new line to reduce line length private static readonly MethodInfo AssertDictionaryEquivalenceMethod = - new Action, IDictionary> (AssertDictionaryEquivalence).GetMethodInfo().GetGenericMethodDefinition(); #pragma warning restore SA1110 @@ -37,10 +37,13 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon return EquivalencyResult.ContinueWithNext; } - if (IsNotNull(comparands.Subject) - && EnsureSubjectIsOfTheExpectedDictionaryType(comparands, expectedDictionary) is { } actualDictionary) + var assertionChain = AssertionChain.GetOrCreate().For(context); + + if (IsNotNull(assertionChain, comparands.Subject) + && EnsureSubjectIsOfTheExpectedDictionaryType(assertionChain, comparands, expectedDictionary) is { } actualDictionary) { - AssertDictionaryEquivalence(comparands, context, valueChildNodes, actualDictionary, expectedDictionary); + AssertDictionaryEquivalence(comparands, assertionChain, context, valueChildNodes, actualDictionary, + expectedDictionary); } return EquivalencyResult.EquivalencyProven; @@ -57,14 +60,17 @@ private static bool IsNonGenericDictionary(object subject) @interface.IsGenericType && @interface.GetGenericTypeDefinition() == typeof(IDictionary<,>)); } - private static bool IsNotNull(object subject) + private static bool IsNotNull(AssertionChain assertionChain, object subject) { - return AssertionScope.Current + assertionChain .ForCondition(subject is not null) .FailWith("Expected {context:Subject} not to be {0}{reason}.", new object[] { null }); + + return assertionChain.Succeeded; } - private static DictionaryInterfaceInfo EnsureSubjectIsOfTheExpectedDictionaryType(Comparands comparands, + private static DictionaryInterfaceInfo EnsureSubjectIsOfTheExpectedDictionaryType(AssertionChain assertionChain, + Comparands comparands, DictionaryInterfaceInfo expectedDictionary) { var actualDictionary = DictionaryInterfaceInfo.FindFromWithKey(comparands.Subject.GetType(), "subject", @@ -78,7 +84,7 @@ private static DictionaryInterfaceInfo EnsureSubjectIsOfTheExpectedDictionaryTyp if (actualDictionary is null) { - AssertionScope.Current.FailWith( + assertionChain.FailWith( "Expected {context:subject} to be a dictionary or collection of key-value pairs that is keyed to " + $"type {expectedDictionary.Key}."); } @@ -87,7 +93,9 @@ private static DictionaryInterfaceInfo EnsureSubjectIsOfTheExpectedDictionaryTyp } private static void FailWithLengthDifference( - IDictionary subject, IDictionary expectation) + IDictionary subject, + IDictionary expectation, + AssertionChain assertionChain) // Type constraint of TExpectedKey is asymmetric in regards to TSubjectKey // but it is valid. This constraint is implicitly enforced by the dictionary interface info which is called before @@ -99,19 +107,18 @@ private static void FailWithLengthDifference 0; bool hasAdditionalKeys = keyDifference.AdditionalKeys.Count > 0; - Execute.Assertion - .WithExpectation("Expected {context:subject} to be a dictionary with {0} item(s){reason}, ", expectation.Count) - .ForCondition(!hasMissingKeys || hasAdditionalKeys) - .FailWith("but it misses key(s) {0}", keyDifference.MissingKeys) - .Then - .ForCondition(hasMissingKeys || !hasAdditionalKeys) - .FailWith("but has additional key(s) {0}", keyDifference.AdditionalKeys) - .Then - .ForCondition(!hasMissingKeys || !hasAdditionalKeys) - .FailWith("but it misses key(s) {0} and has additional key(s) {1}", keyDifference.MissingKeys, - keyDifference.AdditionalKeys) - .Then - .ClearExpectation(); + assertionChain + .WithExpectation("Expected {context:subject} to be a dictionary with {0} item(s){reason}, ", expectation.Count, + chain => chain + .ForCondition(!hasMissingKeys || hasAdditionalKeys) + .FailWith("but it misses key(s) {0}", keyDifference.MissingKeys) + .Then + .ForCondition(hasMissingKeys || !hasAdditionalKeys) + .FailWith("but has additional key(s) {0}", keyDifference.AdditionalKeys) + .Then + .ForCondition(!hasMissingKeys || !hasAdditionalKeys) + .FailWith("but it misses key(s) {0} and has additional key(s) {1}", keyDifference.MissingKeys, + keyDifference.AdditionalKeys)); } private static KeyDifference CalculateKeyDifference(missingKeys, additionalKeys); } - private static void AssertDictionaryEquivalence(Comparands comparands, IEquivalencyValidationContext context, - IValidateChildNodeEquivalency parent, DictionaryInterfaceInfo actualDictionary, DictionaryInterfaceInfo expectedDictionary) + private static void AssertDictionaryEquivalence(Comparands comparands, AssertionChain assertionChain, + IEquivalencyValidationContext context, + IValidateChildNodeEquivalency parent, DictionaryInterfaceInfo actualDictionary, + DictionaryInterfaceInfo expectedDictionary) { AssertDictionaryEquivalenceMethod .MakeGenericMethod(actualDictionary.Key, actualDictionary.Value, expectedDictionary.Key, expectedDictionary.Value) - .Invoke(null, [context, parent, context.Options, comparands.Subject, comparands.Expectation]); + .Invoke(null, [assertionChain, context, parent, context.Options, comparands.Subject, comparands.Expectation]); } private static void AssertDictionaryEquivalence( + AssertionChain assertionChain, EquivalencyValidationContext context, IValidateChildNodeEquivalency parent, IEquivalencyOptions options, @@ -165,7 +175,7 @@ private static void AssertDictionaryEquivalence(key)); + parent.AssertEquivalencyOf(nestedComparands, context.AsDictionaryItem(key)); } } else { + assertionChain.ReuseOnce(); subjectValue.Should().Be(expectation[key], context.Reason.FormattedMessage, context.Reason.Arguments); } } else { - AssertionScope.Current + assertionChain .BecauseOf(context.Reason) .FailWith("Expected {context:subject} to contain key {0}{reason}.", key); } diff --git a/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs index 1ff5fb4148..f7e4e7297f 100644 --- a/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs @@ -27,15 +27,17 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon Type[] interfaceTypes = GetIEnumerableInterfaces(expectedType); - AssertionScope.Current + var assertionChain = AssertionChain.GetOrCreate().For(context); + + assertionChain .ForCondition(interfaceTypes.Length == 1) .FailWith(() => new FailReason("{context:Expectation} implements {0}, so cannot determine which one " + "to use for asserting the equivalency of the collection. ", interfaceTypes.Select(type => "IEnumerable<" + type.GetGenericArguments().Single() + ">"))); - if (AssertSubjectIsCollection(comparands.Subject)) + if (AssertSubjectIsCollection(assertionChain, comparands.Subject)) { - var validator = new EnumerableEquivalencyValidator(valueChildNodes, context) + var validator = new EnumerableEquivalencyValidator(assertionChain, valueChildNodes, context) { Recursive = context.CurrentNode.IsRoot || context.Options.IsRecursive, OrderingRules = context.Options.OrderingRules @@ -62,20 +64,20 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon private static void HandleImpl(EnumerableEquivalencyValidator validator, object[] subject, IEnumerable expectation) => validator.Execute(subject, ToArray(expectation)); - private static bool AssertSubjectIsCollection(object subject) + private static bool AssertSubjectIsCollection(AssertionChain assertionChain, object subject) { - bool conditionMet = AssertionScope.Current + assertionChain .ForCondition(subject is not null) .FailWith("Expected {context:subject} not to be {0}.", new object[] { null }); - if (conditionMet) + if (assertionChain.Succeeded) { - conditionMet = AssertionScope.Current + assertionChain .ForCondition(IsCollection(subject.GetType())) .FailWith("Expected {context:subject} to be a collection, but it was a {0}", subject.GetType()); } - return conditionMet; + return assertionChain.Succeeded; } private static bool IsCollection(Type type) diff --git a/Src/FluentAssertions/Equivalency/Steps/SimpleEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/SimpleEqualityEquivalencyStep.cs index 0e2b955cf4..af3598ec1d 100644 --- a/Src/FluentAssertions/Equivalency/Steps/SimpleEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/SimpleEqualityEquivalencyStep.cs @@ -1,3 +1,5 @@ +using FluentAssertions.Execution; + namespace FluentAssertions.Equivalency.Steps; public class SimpleEqualityEquivalencyStep : IEquivalencyStep @@ -7,6 +9,10 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon { if (!context.Options.IsRecursive && !context.CurrentNode.IsRoot) { + AssertionChain.GetOrCreate() + .For(context) + .ReuseOnce(); + comparands.Subject.Should().Be(comparands.Expectation, context.Reason.FormattedMessage, context.Reason.Arguments); return EquivalencyResult.EquivalencyProven; diff --git a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs index 00a736626c..ec0e70fd24 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs @@ -15,21 +15,23 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon return EquivalencyResult.ContinueWithNext; } - if (!ValidateAgainstNulls(comparands, context.CurrentNode)) + var assertionChain = AssertionChain.GetOrCreate().For(context); + + if (!ValidateAgainstNulls(assertionChain, comparands, context.CurrentNode)) { return EquivalencyResult.EquivalencyProven; } - bool subjectIsString = ValidateSubjectIsString(comparands, context.CurrentNode); + bool subjectIsString = ValidateSubjectIsString(assertionChain, comparands, context.CurrentNode); if (subjectIsString) { string subject = (string)comparands.Subject; string expectation = (string)comparands.Expectation; + assertionChain.ReuseOnce(); subject.Should() - .Be(expectation, CreateOptions(context.Options), - context.Reason.FormattedMessage, context.Reason.Arguments); + .Be(expectation, CreateOptions(context.Options), context.Reason.FormattedMessage, context.Reason.Arguments); } return EquivalencyResult.EquivalencyProven; @@ -67,7 +69,7 @@ private static Func, EquivalencyOptions> return o; }; - private static bool ValidateAgainstNulls(Comparands comparands, INode currentNode) + private static bool ValidateAgainstNulls(AssertionChain assertionChain, Comparands comparands, INode currentNode) { object expected = comparands.Expectation; object subject = comparands.Subject; @@ -76,7 +78,7 @@ private static bool ValidateAgainstNulls(Comparands comparands, INode currentNod if (onlyOneNull) { - AssertionScope.Current.FailWith( + assertionChain.FailWith( $"Expected {currentNode.Description} to be {{0}}{{reason}}, but found {{1}}.", expected, subject); return false; @@ -85,16 +87,17 @@ private static bool ValidateAgainstNulls(Comparands comparands, INode currentNod return true; } - private static bool ValidateSubjectIsString(Comparands comparands, INode currentNode) + private static bool ValidateSubjectIsString(AssertionChain assertionChain, Comparands comparands, INode currentNode) { if (comparands.Subject is string) { return true; } - return - AssertionScope.Current - .FailWith($"Expected {currentNode} to be {{0}}, but found {{1}}.", - comparands.RuntimeType, comparands.Subject.GetType()); + assertionChain.FailWith( + $"Expected {currentNode} to be {{0}}, but found {{1}}.", + comparands.RuntimeType, comparands.Subject.GetType()); + + return assertionChain.Succeeded; } } diff --git a/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs index 23d022e952..0c43280b73 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs @@ -15,9 +15,11 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon return EquivalencyResult.ContinueWithNext; } + var assertionChain = AssertionChain.GetOrCreate().For(context); + if (comparands.Expectation is null) { - AssertionScope.Current + assertionChain .BecauseOf(context.Reason) .FailWith( "Expected {context:subject} to be {reason}, but found {0}.", @@ -25,7 +27,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon } else if (comparands.Subject is null) { - AssertionScope.Current + assertionChain .BecauseOf(context.Reason) .FailWith( "Expected {context:object} to be {0}{reason}, but found {1}.", @@ -55,7 +57,9 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon private static void AssertMemberEquality(Comparands comparands, IEquivalencyValidationContext context, IValidateChildNodeEquivalency parent, IMember selectedMember, IEquivalencyOptions options) { - IMember matchingMember = FindMatchFor(selectedMember, context.CurrentNode, comparands.Subject, options); + var assertionChain = AssertionChain.GetOrCreate().For(context); + + IMember matchingMember = FindMatchFor(selectedMember, context.CurrentNode, comparands.Subject, options, assertionChain); if (matchingMember is not null) { @@ -78,11 +82,11 @@ private static void AssertMemberEquality(Comparands comparands, IEquivalencyVali } private static IMember FindMatchFor(IMember selectedMember, INode currentNode, object subject, - IEquivalencyOptions config) + IEquivalencyOptions config, AssertionChain assertionChain) { IEnumerable query = from rule in config.MatchingRules - let match = rule.Match(selectedMember, subject, currentNode, config) + let match = rule.Match(selectedMember, subject, currentNode, config, assertionChain) where match is not null select match; diff --git a/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs index c9270e421b..ee7d1b400d 100644 --- a/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs @@ -1,4 +1,5 @@ using System; +using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Steps; @@ -26,6 +27,10 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon return $"Treating {member.Description} as a value type because {strategyName}."; }); + AssertionChain.GetOrCreate() + .For(context) + .ReuseOnce(); + comparands.Subject.Should().Be(comparands.Expectation, context.Reason.FormattedMessage, context.Reason.Arguments); return EquivalencyResult.EquivalencyProven; diff --git a/Src/FluentAssertions/Equivalency/Steps/XAttributeEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/XAttributeEquivalencyStep.cs index 1f960da7b9..c403ed74d9 100644 --- a/Src/FluentAssertions/Equivalency/Steps/XAttributeEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/XAttributeEquivalencyStep.cs @@ -1,15 +1,19 @@ using System.Xml.Linq; +using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Steps; public class XAttributeEquivalencyStep : EquivalencyStep { - protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IValidateChildNodeEquivalency nested) + protected override EquivalencyResult OnHandle(Comparands comparands, + IEquivalencyValidationContext context, + IValidateChildNodeEquivalency nestedValidator) { var subject = (XAttribute)comparands.Subject; var expectation = (XAttribute)comparands.Expectation; + AssertionChain.GetOrCreate().For(context).ReuseOnce(); + subject.Should().Be(expectation, context.Reason.FormattedMessage, context.Reason.Arguments); return EquivalencyResult.EquivalencyProven; diff --git a/Src/FluentAssertions/Equivalency/Steps/XDocumentEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/XDocumentEquivalencyStep.cs index b7556b4788..b88921f45b 100644 --- a/Src/FluentAssertions/Equivalency/Steps/XDocumentEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/XDocumentEquivalencyStep.cs @@ -1,15 +1,19 @@ using System.Xml.Linq; +using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Steps; public class XDocumentEquivalencyStep : EquivalencyStep { - protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IValidateChildNodeEquivalency nested) + protected override EquivalencyResult OnHandle(Comparands comparands, + IEquivalencyValidationContext context, + IValidateChildNodeEquivalency nestedValidator) { var subject = (XDocument)comparands.Subject; var expectation = (XDocument)comparands.Expectation; + AssertionChain.GetOrCreate().For(context).ReuseOnce(); + subject.Should().BeEquivalentTo(expectation, context.Reason.FormattedMessage, context.Reason.Arguments); return EquivalencyResult.EquivalencyProven; diff --git a/Src/FluentAssertions/Equivalency/Steps/XElementEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/XElementEquivalencyStep.cs index 8e01b45938..9ed4e2d503 100644 --- a/Src/FluentAssertions/Equivalency/Steps/XElementEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/XElementEquivalencyStep.cs @@ -1,15 +1,19 @@ using System.Xml.Linq; +using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Steps; public class XElementEquivalencyStep : EquivalencyStep { - protected override EquivalencyResult OnHandle(Comparands comparands, IEquivalencyValidationContext context, - IValidateChildNodeEquivalency nested) + protected override EquivalencyResult OnHandle(Comparands comparands, + IEquivalencyValidationContext context, + IValidateChildNodeEquivalency nestedValidator) { var subject = (XElement)comparands.Subject; var expectation = (XElement)comparands.Expectation; + AssertionChain.GetOrCreate().For(context).ReuseOnce(); + subject.Should().BeEquivalentTo(expectation, context.Reason.FormattedMessage, context.Reason.Arguments); return EquivalencyResult.EquivalencyProven; diff --git a/Src/FluentAssertions/EventRaisingExtensions.cs b/Src/FluentAssertions/EventRaisingExtensions.cs index 95545d234b..15798cba20 100644 --- a/Src/FluentAssertions/EventRaisingExtensions.cs +++ b/Src/FluentAssertions/EventRaisingExtensions.cs @@ -24,15 +24,16 @@ public static IEventRecording WithSender(this IEventRecording eventRecording, ob { var eventsForSender = new List(); var otherSenders = new List(); + var assertion = AssertionChain.GetOrCreate(); foreach (OccurredEvent @event in eventRecording) { - bool hasSender = Execute.Assertion + assertion .ForCondition(@event.Parameters.Length > 0) .FailWith("Expected event from sender {0}, " + $"but event {eventRecording.EventName} does not have any parameters", expectedSender); - if (hasSender) + if (assertion.Succeeded) { object sender = @event.Parameters[0]; @@ -47,7 +48,7 @@ public static IEventRecording WithSender(this IEventRecording eventRecording, ob } } - Execute.Assertion + assertion .ForCondition(eventsForSender.Count > 0) .FailWith("Expected sender {0}, but found {1}.", () => expectedSender, @@ -84,7 +85,8 @@ public static IEventRecording WithArgs(this IEventRecording eventRecording, E bool foundMatchingEvent = eventsWithMatchingPredicate.Count > 0; - Execute.Assertion + AssertionChain + .GetOrCreate() .ForCondition(foundMatchingEvent) .FailWith("Expected at least one event with some argument of type <{0}> that matches {1}, but found none.", typeof(T), @@ -137,7 +139,8 @@ public static IEventRecording WithArgs(this IEventRecording eventRecording, p if (!foundMatchingEvent) { - Execute.Assertion + AssertionChain + .GetOrCreate() .FailWith( "Expected at least one event with some arguments of type <{0}> that pairwise match {1}, but found none.", typeof(T), diff --git a/Src/FluentAssertions/Events/EventAssertions.cs b/Src/FluentAssertions/Events/EventAssertions.cs index f7e861deca..6d624bda02 100644 --- a/Src/FluentAssertions/Events/EventAssertions.cs +++ b/Src/FluentAssertions/Events/EventAssertions.cs @@ -16,10 +16,12 @@ namespace FluentAssertions.Events; public class EventAssertions : ReferenceTypeAssertions> { private const string PropertyChangedEventName = nameof(INotifyPropertyChanged.PropertyChanged); + private readonly AssertionChain assertionChain; - protected internal EventAssertions(IMonitor monitor) - : base(monitor.Subject) + protected internal EventAssertions(IMonitor monitor, AssertionChain assertionChain) + : base(monitor.Subject, assertionChain) { + this.assertionChain = assertionChain; Monitor = monitor; } @@ -47,7 +49,7 @@ public IEventRecording Raise(string eventName, [StringSyntax("CompositeFormat")] if (!recording.Any()) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected object {0} to raise event {1}{reason}, but it did not.", Monitor.Subject, eventName); } @@ -74,7 +76,7 @@ public void NotRaise(string eventName, [StringSyntax("CompositeFormat")] string if (events.Any()) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected object {0} to not raise event {1}{reason}, but it did.", Monitor.Subject, eventName); } @@ -104,14 +106,14 @@ public IEventRecording RaisePropertyChangeFor(Expression> proper IEventRecording recording = Monitor.GetRecordingFor(PropertyChangedEventName); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(recording.Any()) .FailWith( "Expected object {0} to raise event {1} for property {2}{reason}, but it did not raise that event at all.", Monitor.Subject, PropertyChangedEventName, propertyName); - if (success) + if (assertionChain.Succeeded) { var actualPropertyNames = recording .SelectMany(@event => @event.Parameters.OfType()) @@ -119,7 +121,7 @@ public IEventRecording RaisePropertyChangeFor(Expression> proper .Distinct() .ToArray(); - Execute.Assertion + assertionChain .ForCondition(actualPropertyNames.Contains(propertyName)) .BecauseOf(because, becauseArgs) .FailWith("Expected object {0} to raise event {1} for property {2}{reason}, but it was only raised for {3}.", @@ -151,7 +153,7 @@ public void NotRaisePropertyChangeFor(Expression> propertyExpres if (propertyName is null) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!recording.Any()) .FailWith( @@ -160,7 +162,7 @@ public void NotRaisePropertyChangeFor(Expression> propertyExpres } else { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!recording.Any(@event => @event.IsAffectingPropertyName(propertyName))) .FailWith( diff --git a/Src/FluentAssertions/Events/EventMonitor.cs b/Src/FluentAssertions/Events/EventMonitor.cs index 26ebe0ad29..bcb2efbec6 100644 --- a/Src/FluentAssertions/Events/EventMonitor.cs +++ b/Src/FluentAssertions/Events/EventMonitor.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Reflection; using FluentAssertions.Common; +using FluentAssertions.Execution; namespace FluentAssertions.Events; @@ -66,7 +67,7 @@ public void Clear() public EventAssertions Should() { - return new EventAssertions(this); + return new EventAssertions(this, AssertionChain.GetOrCreate()); } public IEventRecording GetRecordingFor(string eventName) diff --git a/Src/FluentAssertions/ExceptionAssertionsExtensions.cs b/Src/FluentAssertions/ExceptionAssertionsExtensions.cs index 900d1c9b4e..45de65a1a6 100644 --- a/Src/FluentAssertions/ExceptionAssertionsExtensions.cs +++ b/Src/FluentAssertions/ExceptionAssertionsExtensions.cs @@ -167,7 +167,8 @@ public static ExceptionAssertions WithParameterName( params object[] becauseArgs) where TException : ArgumentException { - Execute.Assertion + AssertionChain + .GetOrCreate() .ForCondition(parent.Which.ParamName == paramName) .BecauseOf(because, becauseArgs) .FailWith("Expected exception with parameter name {0}{reason}, but found {1}.", paramName, parent.Which.ParamName); diff --git a/Src/FluentAssertions/Execution/AssertionChain.cs b/Src/FluentAssertions/Execution/AssertionChain.cs new file mode 100644 index 0000000000..a565ca8d79 --- /dev/null +++ b/Src/FluentAssertions/Execution/AssertionChain.cs @@ -0,0 +1,362 @@ +using System; +using System.Globalization; +using System.Linq; +using System.Threading; +using FluentAssertions.Common; + +namespace FluentAssertions.Execution; + +/// +/// Provides a fluent API to build simple or composite assertions, and which can flow from one assertion to another. +/// +/// +/// This is the core engine of many of the assertion APIs in this library. When combined with , +/// you can run multiple assertions which failure messages will be collected until the scope is disposed. +/// +public sealed class AssertionChain +{ + private readonly Func getCurrentScope; + private readonly ContextDataDictionary contextData = new(); + private string fallbackIdentifier = "object"; + private Func getCallerIdentifier; + private Func reason; + private bool? succeeded; + + // We need to keep track of this because we don't want the second successful assertion hide the first unsuccessful assertion + private Func expectation; + private string callerPostfix = string.Empty; + + private static readonly AsyncLocal Instance = new(); + + /// + /// Ensures that the next call to will reuse the current instance. + /// + public void ReuseOnce() + { + Instance.Value = this; + } + + /// + /// Indicates whether the previous assertion in the chain was successful. + /// + /// + /// This property is used internally to determine if subsequent assertions + /// should be evaluated based on the result of the previous assertion. + /// + internal bool PreviousAssertionSucceeded { get; private set; } = true; + + /// + /// Indicates whether the caller identifier has been manually overridden. + /// + /// + /// This property is used to track if the caller identifier has been customized using the + /// method or similar methods that modify the identifier. + /// + public bool HasOverriddenCallerIdentifier { get; private set; } + + /// + /// Either starts a new assertion chain, or, when was called, for once, will return + /// an existing instance. + /// + public static AssertionChain GetOrCreate() + { + if (Instance.Value != null) + { + AssertionChain assertionChain = Instance.Value; + Instance.Value = null; + return assertionChain; + } + + return new AssertionChain(() => AssertionScope.Current, + () => FluentAssertions.CallerIdentifier.DetermineCallerIdentity()); + } + + private AssertionChain(Func getCurrentScope, Func getCallerIdentifier) + { + this.getCurrentScope = getCurrentScope; + + this.getCallerIdentifier = () => + { + var scopeName = getCurrentScope().Name(); + var callerIdentifier = getCallerIdentifier(); + + if (scopeName is null) + { + return callerIdentifier; + } + else if (callerIdentifier is null) + { + return scopeName; + } + else + { + return $"{scopeName}/{callerIdentifier}"; + } + }; + } + + /// + /// The effective caller identifier including any prefixes and postfixes configured through + /// . + /// + /// + /// Can be overridden with . + /// + public string CallerIdentifier => getCallerIdentifier() + callerPostfix; + + /// + /// Adds an explanation of why the assertion is supposed to succeed to the scope. + /// + /// + /// An object containing a formatted phrase as is supported by explaining why the assertion + /// is needed, as well as zero or more objects to format the placeholders. + /// If the phrase does not start with the word because, it is prepended automatically.explaining why the assertion is needed. + /// + public AssertionChain BecauseOf(Reason reason) + { + return BecauseOf(reason.FormattedMessage, reason.Arguments); + } + + /// + /// Adds an explanation of why the assertion is supposed to succeed to the scope. + /// + /// + /// 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 AssertionChain BecauseOf(string because, params object[] becauseArgs) + { + reason = () => + { + try + { + string becauseOrEmpty = because ?? string.Empty; + + return becauseArgs?.Length > 0 + ? string.Format(CultureInfo.InvariantCulture, becauseOrEmpty, becauseArgs) + : becauseOrEmpty; + } + catch (FormatException formatException) + { + return + $"**WARNING** because message '{because}' could not be formatted with string.Format{Environment.NewLine}{formatException.StackTrace}"; + } + }; + + return this; + } + + public AssertionChain ForCondition(bool condition) + { + if (PreviousAssertionSucceeded) + { + succeeded = condition; + } + + return this; + } + + public AssertionChain ForConstraint(OccurrenceConstraint constraint, int actualOccurrences) + { + if (PreviousAssertionSucceeded) + { + constraint.RegisterContextData((key, value) => contextData.Add( + new ContextDataDictionary.DataItem(key, value, reportable: false, requiresFormatting: false))); + + succeeded = constraint.Assert(actualOccurrences); + } + + return this; + } + + public Continuation WithExpectation(string message, object arg1, Action chain) + { + return WithExpectation(message, chain, arg1); + } + + public Continuation WithExpectation(string message, object arg1, object arg2, Action chain) + { + return WithExpectation(message, chain, arg1, arg2); + } + + public Continuation WithExpectation(string message, Action chain) + { + return WithExpectation(message, chain, []); + } + + private Continuation WithExpectation(string message, Action chain, params object[] args) + { + if (PreviousAssertionSucceeded) + { + expectation = () => + { + var formatter = new FailureMessageFormatter(getCurrentScope().FormattingOptions) + .WithReason(reason?.Invoke() ?? string.Empty) + .WithContext(contextData) + .WithIdentifier(CallerIdentifier) + .WithFallbackIdentifier(fallbackIdentifier); + + return formatter.Format(message, args); + }; + + chain(this); + + expectation = null; + } + + return new Continuation(this); + } + + public AssertionChain WithDefaultIdentifier(string identifier) + { + fallbackIdentifier = identifier; + return this; + } + + public GivenSelector Given(Func selector) + { + return new GivenSelector(selector, this); + } + + internal Continuation FailWithPreFormatted(string formattedFailReason) + { + return FailWith(() => formattedFailReason); + } + + public Continuation FailWith(string message) + { + return FailWith(() => new FailReason(message)); + } + + public Continuation FailWith(string message, params object[] args) + { + return FailWith(() => new FailReason(message, args)); + } + + public Continuation FailWith(string message, params Func[] argProviders) + { + return FailWith( + () => new FailReason( + message, + argProviders.Select(a => a()).ToArray())); + } + + public Continuation FailWith(Func getFailureReason) + { + return FailWith(() => + { + var formatter = new FailureMessageFormatter(getCurrentScope().FormattingOptions) + .WithReason(reason?.Invoke() ?? string.Empty) + .WithContext(contextData) + .WithIdentifier(CallerIdentifier) + .WithFallbackIdentifier(fallbackIdentifier); + + FailReason failReason = getFailureReason(); + + return formatter.Format(failReason.Message, failReason.Args); + }); + } + + private Continuation FailWith(Func getFailureReason) + { + if (PreviousAssertionSucceeded) + { + PreviousAssertionSucceeded = succeeded is true; + + if (succeeded is not true) + { + string failure = getFailureReason(); + + if (expectation is not null) + { + failure = expectation() + failure; + } + + getCurrentScope().AddPreFormattedFailure(failure.Capitalize().RemoveTrailingWhitespaceFromLines()); + } + } + + // Reset the state for successive assertions on this object + succeeded = null; + + return new Continuation(this); + } + + /// + /// Allows overriding the caller identifier for the next call to one of the `FailWith` overloads instead + /// of relying on the automatic behavior that extracts the variable names from the C# code. + /// + public void OverrideCallerIdentifier(Func getCallerIdentifier) + { + this.getCallerIdentifier = getCallerIdentifier; + HasOverriddenCallerIdentifier = true; + } + + /// + /// Adds a postfix such as [0] to the caller identifier detected by the library. + /// + /// + /// Can be used by an assertion that uses to return an object or + /// collection on which another assertion is executed, and which wants to amend the automatically detected caller + /// identifier with a postfix. + /// + public AssertionChain WithCallerPostfix(string postfix) + { + callerPostfix = postfix; + HasOverriddenCallerIdentifier = true; + + return this; + } + + /// + /// Adds some information to the assertion that will be included in the message + /// that is emitted if an assertion fails. + /// + public void AddReportable(string key, string value) + { + getCurrentScope().AddReportable(key, value); + } + + /// + /// Adds some information to the assertion that will be included in the message + /// that is emitted if an assertion fails. The value is only calculated on failure. + /// + public void AddReportable(string key, Func getValue) + { + getCurrentScope().AddReportable(key, getValue); + } + + /// + /// Fluent alternative for + /// + public AssertionChain WithReportable(string name, Func content) + { + getCurrentScope().AddReportable(name, content); + return this; + } + + /// + /// Registers a failure in the chain that doesn't need any parsing or formatting anymore. + /// + internal void AddPreFormattedFailure(string failure) + { + getCurrentScope().AddPreFormattedFailure(failure); + } + + /// + /// Gets a value indicating whether all assertions in the have succeeded. + /// + public bool Succeeded => PreviousAssertionSucceeded && succeeded is null or true; + + public AssertionChain UsingLineBreaks + { + get + { + getCurrentScope().FormattingOptions.UseLineBreaks = true; + return this; + } + } +} diff --git a/Src/FluentAssertions/Execution/AssertionScope.cs b/Src/FluentAssertions/Execution/AssertionScope.cs index 2b70d559c7..a5d6783eb6 100644 --- a/Src/FluentAssertions/Execution/AssertionScope.cs +++ b/Src/FluentAssertions/Execution/AssertionScope.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; using System.Linq; using System.Text; using System.Threading; @@ -14,60 +11,36 @@ namespace FluentAssertions.Execution; /// Represents an implicit or explicit scope within which multiple assertions can be collected. /// /// -/// This class is supposed to have a very short lifetime and is not safe to be used in assertions that cross thread-boundaries +/// This class is supposed to have a very short lifetime and is not safe to be used in assertion that cross thread-boundaries /// such as when using or . /// -public sealed class AssertionScope : IAssertionScope +// Remove all assertion logic from this class since it is superseded by the Assertion class +public sealed class AssertionScope : IDisposable { - #region Private Definitions - private readonly IAssertionStrategy assertionStrategy; - private readonly ContextDataDictionary contextData = new(); + private static readonly AsyncLocal CurrentScope = new(); + private readonly Func callerIdentityProvider = () => CallerIdentifier.DetermineCallerIdentity(); + private readonly ContextDataDictionary reportableData = new(); private readonly StringBuilder tracing = new(); - private Func reason; - - private static readonly AsyncLocal CurrentScope = new(); - private Func callerIdentityProvider = () => CallerIdentifier.DetermineCallerIdentity(); -#pragma warning disable CA2213 private AssertionScope parent; -#pragma warning restore CA2213 - private Func expectation; - private string fallbackIdentifier = "object"; - private bool? succeeded; - - private sealed class DeferredReportable - { - private readonly Lazy lazyValue; - - public DeferredReportable(Func valueFunc) - { - lazyValue = new Lazy(valueFunc); - } - - public override string ToString() => lazyValue.Value; - } - - #endregion /// /// Starts an unnamed scope within which multiple assertions can be executed /// and which will not throw until the scope is disposed. /// public AssertionScope() - : this(new CollectingAssertionStrategy(), context: null) + : this(() => null, new CollectingAssertionStrategy()) { - SetCurrentAssertionScope(this); } /// /// Starts a named scope within which multiple assertions can be executed /// and which will not throw until the scope is disposed. /// - public AssertionScope(string context) - : this(new CollectingAssertionStrategy(), new Lazy(() => context)) + public AssertionScope(string name) + : this(() => name, new CollectingAssertionStrategy()) { - SetCurrentAssertionScope(this); } /// @@ -76,19 +49,17 @@ public AssertionScope(string context) /// The assertion strategy for this scope. /// is . public AssertionScope(IAssertionStrategy assertionStrategy) - : this(assertionStrategy, context: null) + : this(() => null, assertionStrategy) { - SetCurrentAssertionScope(this); } /// /// Starts a named scope within which multiple assertions can be executed /// and which will not throw until the scope is disposed. /// - public AssertionScope(Lazy context) - : this(new CollectingAssertionStrategy(), context) + public AssertionScope(Func name) + : this(name, new CollectingAssertionStrategy()) { - SetCurrentAssertionScope(this); } /// @@ -96,47 +67,51 @@ public AssertionScope(Lazy context) /// /// The assertion strategy for this scope. /// is . - private AssertionScope(IAssertionStrategy assertionStrategy, Lazy context) + private AssertionScope(Func name, IAssertionStrategy assertionStrategy) { + parent = CurrentScope.Value; + CurrentScope.Value = this; + this.assertionStrategy = assertionStrategy ?? throw new ArgumentNullException(nameof(assertionStrategy)); - parent = GetCurrentAssertionScope(); - if (parent is not null) { - contextData.Add(parent.contextData); - reason = parent.reason; + // Combine the existing Name with the parent.Name if it exists. + Name = () => + { + var parentName = parent.Name(); + if (parentName.IsNullOrEmpty()) + { + return name(); + } + + if (name().IsNullOrEmpty()) + { + return parentName; + } + + return parentName + "/" + name(); + }; + callerIdentityProvider = parent.callerIdentityProvider; FormattingOptions = parent.FormattingOptions.Clone(); - Context = JoinContexts(parent.Context, context); } else { - Context = context; + Name = name; } } - private static Lazy JoinContexts(Lazy outer, Lazy inner) - { - return (outer, inner) switch - { - (null, null) => null, - ({ } a, null) => a, - (null, { } b) => b, - ({ } a, { } b) => Join(a, b) - }; - - static Lazy Join(Lazy outer, Lazy inner) => - new(() => outer.Value + "/" + inner.Value); - } - /// - /// Gets or sets the context of the current assertion scope, e.g. the path of the object graph - /// that is being asserted on. The context is provided by a which - /// only gets evaluated when its value is actually needed (in most cases during a failure). + /// Gets or sets the name of the current assertion scope, e.g. the path of the object graph + /// that is being asserted on. /// - public Lazy Context { get; set; } + /// + /// The context is provided by a which + /// only gets evaluated when its value is actually needed (in most cases during a failure). + /// + public Func Name { get; } /// /// Gets the current thread-specific assertion scope. @@ -146,20 +121,10 @@ public static AssertionScope Current #pragma warning disable CA2000 // AssertionScope should not be disposed here get { - return GetCurrentAssertionScope() ?? new AssertionScope(new DefaultAssertionStrategy(), context: null); + return CurrentScope.Value ?? new AssertionScope(() => null, new DefaultAssertionStrategy()); } #pragma warning restore CA2000 - private set => SetCurrentAssertionScope(value); - } - - /// - public AssertionScope UsingLineBreaks - { - get - { - FormattingOptions.UseLineBreaks = true; - return this; - } + private set => CurrentScope.Value = value; } /// @@ -167,177 +132,6 @@ public AssertionScope UsingLineBreaks /// public FormattingOptions FormattingOptions { get; } = AssertionOptions.FormattingOptions.Clone(); - internal bool Succeeded => succeeded == true; - - /// - /// Adds an explanation of why the assertion is supposed to succeed to the scope. - /// - public AssertionScope BecauseOf(Reason reason) - { - return BecauseOf(reason.FormattedMessage, reason.Arguments); - } - - /// - public AssertionScope BecauseOf([StringSyntax("CompositeFormat")] string because, params object[] becauseArgs) - { - reason = () => - { - try - { - string becauseOrEmpty = because ?? string.Empty; - - return becauseArgs?.Length > 0 - ? string.Format(CultureInfo.InvariantCulture, becauseOrEmpty, becauseArgs) - : becauseOrEmpty; - } - catch (FormatException formatException) - { - return - $"**WARNING** because message '{because}' could not be formatted with string.Format{Environment.NewLine}{formatException.StackTrace}"; - } - }; - - return this; - } - - /// - public AssertionScope WithExpectation(string message, params object[] args) - { - Func localReason = reason; - - expectation = () => - { - var messageBuilder = new MessageBuilder(FormattingOptions); - string actualReason = localReason?.Invoke() ?? string.Empty; - string identifier = GetIdentifier(); - - return messageBuilder.Build(message, args, actualReason, contextData, identifier, fallbackIdentifier); - }; - - return this; - } - - internal void TrackComparands(object subject, object expectation) - { - contextData.Add(new ContextDataDictionary.DataItem("subject", subject, reportable: false, requiresFormatting: true)); - contextData.Add(new ContextDataDictionary.DataItem("expectation", expectation, reportable: false, requiresFormatting: true)); - } - - /// - public Continuation ClearExpectation() - { - expectation = null; - - // SMELL: Isn't this always going to return null? Or this method also called without FailWith (which sets the success state to null) - return new Continuation(this, Succeeded); - } - - public GivenSelector Given(Func selector) - { - return new GivenSelector(selector, this, continueAsserting: succeeded != false); - } - - /// - public AssertionScope ForCondition(bool condition) - { - succeeded = condition; - - return this; - } - - /// - public AssertionScope ForConstraint(OccurrenceConstraint constraint, int actualOccurrences) - { - constraint.RegisterReportables(this); - succeeded = constraint.Assert(actualOccurrences); - - return this; - } - - /// - public Continuation FailWith(Func failReasonFunc) - { - return FailWith(() => - { - string localReason = reason?.Invoke() ?? string.Empty; - var messageBuilder = new MessageBuilder(FormattingOptions); - string identifier = GetIdentifier(); - FailReason failReason = failReasonFunc(); - - string result = messageBuilder.Build(failReason.Message, failReason.Args, localReason, contextData, identifier, - fallbackIdentifier); - - return result; - }); - } - - internal Continuation FailWithPreFormatted(string formattedFailReason) => - FailWith(() => formattedFailReason); - - private Continuation FailWith(Func failReasonFunc) - { - try - { - bool failed = succeeded != true; - - if (failed) - { - string result = failReasonFunc(); - - if (expectation is not null) - { - result = expectation() + result; - } - - assertionStrategy.HandleFailure(result.Capitalize()); - - succeeded = false; - } - - return new Continuation(this, continueAsserting: !failed); - } - finally - { - succeeded = null; - } - } - - /// - public Continuation FailWith(string message) - { - return FailWith(() => new FailReason(message)); - } - - /// - public Continuation FailWith(string message, params object[] args) - { - return FailWith(() => new FailReason(message, args)); - } - - /// - public Continuation FailWith(string message, params Func[] argProviders) - { - return FailWith(() => new FailReason(message, - argProviders.Select(a => a()).ToArray())); - } - - private string GetIdentifier() - { - var identifier = Context?.Value; - - if (string.IsNullOrEmpty(identifier)) - { - identifier = CallerIdentity; - } - - return identifier; - } - - /// - /// Gets the identity of the caller associated with the current scope. - /// - public string CallerIdentity => callerIdentityProvider(); - /// /// Adds a pre-formatted failure message to the current scope. /// @@ -347,38 +141,30 @@ public void AddPreFormattedFailure(string formattedFailureMessage) } /// - /// Adds a block of tracing to the scope for reporting when an assertion fails. - /// - public void AppendTracing(string tracingBlock) - { - tracing.Append(tracingBlock); - } - - /// - /// Tracks a keyed object in the current scope that is excluded from the failure message in case an assertion fails. + /// Adds some information to the assertion scope that will be included in the message + /// that is emitted if an assertion fails. /// - public void AddNonReportable(string key, object value) + internal void AddReportable(string key, string value) { - contextData.Add(new ContextDataDictionary.DataItem(key, value, reportable: false, requiresFormatting: false)); + reportableData.Add(new ContextDataDictionary.DataItem(key, value, reportable: true, requiresFormatting: false)); } /// /// Adds some information to the assertion scope that will be included in the message - /// that is emitted if an assertion fails. + /// that is emitted if an assertion fails. The value is only calculated on failure. /// - public void AddReportable(string key, string value) + internal void AddReportable(string key, Func valueFunc) { - contextData.Add(new ContextDataDictionary.DataItem(key, value, reportable: true, requiresFormatting: false)); + reportableData.Add(new ContextDataDictionary.DataItem(key, new DeferredReportable(valueFunc), reportable: true, + requiresFormatting: false)); } /// - /// Adds some information to the assertion scope that will be included in the message - /// that is emitted if an assertion fails. The value is only calculated on failure. + /// Adds a block of tracing to the scope for reporting when an assertion fails. /// - public void AddReportable(string key, Func valueFunc) + public void AppendTracing(string tracingBlock) { - contextData.Add(new ContextDataDictionary.DataItem(key, new DeferredReportable(valueFunc), reportable: true, - requiresFormatting: false)); + tracing.Append(tracingBlock); } /// @@ -395,18 +181,10 @@ public bool HasFailures() return assertionStrategy.FailureMessages.Any(); } - /// - /// Gets data associated with the current scope and identified by . - /// - public T Get(string key) - { - return contextData.Get(key); - } - /// public void Dispose() { - SetCurrentAssertionScope(parent); + CurrentScope.Value = parent; if (parent is not null) { @@ -415,67 +193,26 @@ public void Dispose() parent.assertionStrategy.HandleFailure(failureMessage); } - parent.contextData.Add(contextData); + parent.reportableData.Add(reportableData); parent.AppendTracing(tracing.ToString()); parent = null; } else { - IDictionary reportable = contextData.GetReportable(); - if (tracing.Length > 0) { - reportable.Add("trace", tracing.ToString()); + reportableData.Add(new ContextDataDictionary.DataItem("trace", tracing.ToString(), reportable: true, requiresFormatting: false)); } - assertionStrategy.ThrowIfAny(reportable); + assertionStrategy.ThrowIfAny(reportableData.GetReportable()); } } - /// - public AssertionScope WithDefaultIdentifier(string identifier) + private sealed class DeferredReportable(Func valueFunc) { - fallbackIdentifier = identifier; - return this; - } - - /// - /// Allows the scope to assume that all assertions that happen within this scope are going to - /// be initiated by the same caller. - /// - public void AssumeSingleCaller() - { - // Since we know there's only one caller, we don't have to have every assertion determine the caller identity again - var provider = new Lazy(() => CallerIdentifier.DetermineCallerIdentity()); - callerIdentityProvider = () => provider.Value; - } - - private static AssertionScope GetCurrentAssertionScope() - { - return CurrentScope.Value; - } + private readonly Lazy lazyValue = new(valueFunc); - private static void SetCurrentAssertionScope(AssertionScope scope) - { - CurrentScope.Value = scope; + public override string ToString() => lazyValue.Value; } - - #region Explicit Implementation to support the interface - - IAssertionScope IAssertionScope.ForCondition(bool condition) => ForCondition(condition); - - IAssertionScope IAssertionScope.ForConstraint(OccurrenceConstraint constraint, int actualOccurrences) => - ForConstraint(constraint, actualOccurrences); - - IAssertionScope IAssertionScope.BecauseOf([StringSyntax("CompositeFormat")] string because, params object[] becauseArgs) => - BecauseOf(because, becauseArgs); - - IAssertionScope IAssertionScope.WithExpectation(string message, params object[] args) => WithExpectation(message, args); - - IAssertionScope IAssertionScope.WithDefaultIdentifier(string identifier) => WithDefaultIdentifier(identifier); - - IAssertionScope IAssertionScope.UsingLineBreaks => UsingLineBreaks; - - #endregion } diff --git a/Src/FluentAssertions/Execution/ContextDataDictionary.cs b/Src/FluentAssertions/Execution/ContextDataDictionary.cs index 8a079f6240..23ebd90548 100644 --- a/Src/FluentAssertions/Execution/ContextDataDictionary.cs +++ b/Src/FluentAssertions/Execution/ContextDataDictionary.cs @@ -44,7 +44,6 @@ public void Add(ContextDataDictionary contextDataDictionary) public void Add(DataItem item) { int existingItemIndex = items.FindIndex(i => i.Key == item.Key); - if (existingItemIndex >= 0) { items[existingItemIndex] = item; @@ -55,13 +54,7 @@ public void Add(DataItem item) } } - public T Get(string key) - { - DataItem item = items.SingleOrDefault(i => i.Key == key); - return (T)(item?.Value ?? default(T)); - } - - internal class DataItem(string key, object value, bool reportable, bool requiresFormatting) + public class DataItem(string key, object value, bool reportable, bool requiresFormatting) { public string Key { get; } = key; diff --git a/Src/FluentAssertions/Execution/Continuation.cs b/Src/FluentAssertions/Execution/Continuation.cs index b59ad7f4e7..b2f65e62a3 100644 --- a/Src/FluentAssertions/Execution/Continuation.cs +++ b/Src/FluentAssertions/Execution/Continuation.cs @@ -1,35 +1,17 @@ -namespace FluentAssertions.Execution; +namespace FluentAssertions.Execution; /// /// Enables chaining multiple assertions on an . /// public class Continuation { - private readonly AssertionScope sourceScope; - private readonly bool continueAsserting; - - internal Continuation(AssertionScope sourceScope, bool continueAsserting) + internal Continuation(AssertionChain parent) { - this.sourceScope = sourceScope; - this.continueAsserting = continueAsserting; + Then = parent; } /// /// Continues the assertion chain if the previous assertion was successful. /// - public IAssertionScope Then - { - get - { - return new ContinuedAssertionScope(sourceScope, continueAsserting); - } - } - - /// - /// Provides back-wards compatibility for code that expects to return a boolean. - /// - public static implicit operator bool(Continuation continuation) - { - return continuation.continueAsserting; - } + public AssertionChain Then { get; } } diff --git a/Src/FluentAssertions/Execution/ContinuationOfGiven.cs b/Src/FluentAssertions/Execution/ContinuationOfGiven.cs index 47ca54a889..ef42263f3f 100644 --- a/Src/FluentAssertions/Execution/ContinuationOfGiven.cs +++ b/Src/FluentAssertions/Execution/ContinuationOfGiven.cs @@ -1,15 +1,12 @@ -namespace FluentAssertions.Execution; +namespace FluentAssertions.Execution; /// -/// Enables chaining multiple assertions from a call. +/// Enables chaining multiple assertions from a call. /// public class ContinuationOfGiven { - private readonly bool succeeded; - - internal ContinuationOfGiven(GivenSelector parent, bool succeeded) + internal ContinuationOfGiven(GivenSelector parent) { - this.succeeded = succeeded; Then = parent; } @@ -18,11 +15,5 @@ internal ContinuationOfGiven(GivenSelector parent, bool succeeded) /// public GivenSelector Then { get; } - /// - /// Provides back-wards compatibility for code that expects to return a boolean. - /// - public static implicit operator bool(ContinuationOfGiven continuationOfGiven) - { - return continuationOfGiven.succeeded; - } + public bool Succeeded => Then.Succeeded; } diff --git a/Src/FluentAssertions/Execution/ContinuedAssertionScope.cs b/Src/FluentAssertions/Execution/ContinuedAssertionScope.cs deleted file mode 100644 index 1cc2d6dba9..0000000000 --- a/Src/FluentAssertions/Execution/ContinuedAssertionScope.cs +++ /dev/null @@ -1,156 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; - -namespace FluentAssertions.Execution; - -/// -/// Allows chaining multiple assertion scopes together using . -/// -/// -/// If the parent scope has captured a failed assertion, -/// this class ensures that successive assertions are no longer evaluated. -/// -public sealed class ContinuedAssertionScope : IAssertionScope -{ - private readonly AssertionScope predecessor; - private readonly bool continueAsserting; - - internal ContinuedAssertionScope(AssertionScope predecessor, bool continueAsserting) - { - this.predecessor = predecessor; - this.continueAsserting = continueAsserting; - } - - /// - public GivenSelector Given(Func selector) - { - if (continueAsserting) - { - return predecessor.Given(selector); - } - - return new GivenSelector(() => default, predecessor, continueAsserting: false); - } - - /// - public IAssertionScope ForCondition(bool condition) - { - if (continueAsserting) - { - return predecessor.ForCondition(condition); - } - - return this; - } - - /// - public IAssertionScope ForConstraint(OccurrenceConstraint constraint, int actualOccurrences) - { - if (continueAsserting) - { - return predecessor.ForConstraint(constraint, actualOccurrences); - } - - return this; - } - - /// - public Continuation FailWith(string message) - { - if (continueAsserting) - { - return predecessor.FailWith(message); - } - - return new Continuation(predecessor, continueAsserting: false); - } - - /// - public Continuation FailWith(string message, params Func[] argProviders) - { - if (continueAsserting) - { - return predecessor.FailWith(message, argProviders); - } - - return new Continuation(predecessor, continueAsserting: false); - } - - /// - public Continuation FailWith(Func failReasonFunc) - { - if (continueAsserting) - { - return predecessor.FailWith(failReasonFunc); - } - - return new Continuation(predecessor, continueAsserting: false); - } - - /// - public Continuation FailWith(string message, params object[] args) - { - if (continueAsserting) - { - return predecessor.FailWith(message, args); - } - - return new Continuation(predecessor, continueAsserting: false); - } - - /// - public IAssertionScope BecauseOf([StringSyntax("CompositeFormat")] string because, params object[] becauseArgs) - { - if (continueAsserting) - { - return predecessor.BecauseOf(because, becauseArgs); - } - - return this; - } - - /// - public Continuation ClearExpectation() - { - predecessor.ClearExpectation(); - - return new Continuation(predecessor, continueAsserting); - } - - /// - public IAssertionScope WithExpectation(string message, params object[] args) - { - if (continueAsserting) - { - return predecessor.WithExpectation(message, args); - } - - return this; - } - - /// - public IAssertionScope WithDefaultIdentifier(string identifier) - { - if (continueAsserting) - { - return predecessor.WithDefaultIdentifier(identifier); - } - - return this; - } - - /// - public IAssertionScope UsingLineBreaks => predecessor.UsingLineBreaks; - - /// - public string[] Discard() - { - return predecessor.Discard(); - } - - /// - public void Dispose() - { - predecessor.Dispose(); - } -} diff --git a/Src/FluentAssertions/Execution/Execute.cs b/Src/FluentAssertions/Execution/Execute.cs deleted file mode 100644 index 9533780cb4..0000000000 --- a/Src/FluentAssertions/Execution/Execute.cs +++ /dev/null @@ -1,21 +0,0 @@ -using FluentAssertions.Common; - -namespace FluentAssertions.Execution; - -/// -/// Helper class for verifying a condition and/or throwing a test harness specific exception representing an assertion failure. -/// -public static class Execute -{ - /// - /// Gets an object that wraps and executes a conditional or unconditional assertion. - /// - public static AssertionScope Assertion - { - get - { - Services.EnsureInitialized(); - return AssertionScope.Current; - } - } -} diff --git a/Src/FluentAssertions/Execution/FailReason.cs b/Src/FluentAssertions/Execution/FailReason.cs index 420f3a2e47..27bab552db 100644 --- a/Src/FluentAssertions/Execution/FailReason.cs +++ b/Src/FluentAssertions/Execution/FailReason.cs @@ -1,15 +1,15 @@ namespace FluentAssertions.Execution; /// -/// Represents assertion fail reason. Contains the message and arguments for message's numbered placeholders. +/// Represents the assertion fail reason. Contains the message and arguments for message's numbered placeholders. /// /// /// In addition to the numbered -style placeholders, messages may contain a /// few specialized placeholders as well. For instance, {reason} will be replaced with the reason of the -/// assertion as passed to . +/// assertion as passed to . /// /// Other named placeholders will be replaced with the scope data passed through -/// and . +/// . /// /// /// Finally, a description of the current subject can be passed through the {context:description} placeholder. diff --git a/Src/FluentAssertions/Execution/MessageBuilder.cs b/Src/FluentAssertions/Execution/FailureMessageFormatter.cs similarity index 68% rename from Src/FluentAssertions/Execution/MessageBuilder.cs rename to Src/FluentAssertions/Execution/FailureMessageFormatter.cs index 65460111f5..3559ea97b6 100644 --- a/Src/FluentAssertions/Execution/MessageBuilder.cs +++ b/Src/FluentAssertions/Execution/FailureMessageFormatter.cs @@ -1,39 +1,87 @@ -#region - -using System; +using System; using System.Globalization; using System.Linq; using System.Text.RegularExpressions; using FluentAssertions.Common; using FluentAssertions.Formatting; -#endregion - namespace FluentAssertions.Execution; /// /// Encapsulates expanding the various placeholders supported in a failure message. /// -internal class MessageBuilder +internal class FailureMessageFormatter(FormattingOptions formattingOptions) { - private readonly FormattingOptions formattingOptions; + private static readonly char[] Blanks = ['\r', '\n', ' ', '\t']; + private string reason; + private ContextDataDictionary contextData; + private string identifier; + private string fallbackIdentifier; + + public FailureMessageFormatter WithReason(string reason) + { + this.reason = SanitizeReason(reason ?? string.Empty); + return this; + } + + private static string SanitizeReason(string reason) + { + if (!string.IsNullOrEmpty(reason)) + { + reason = EnsurePrefix("because", reason); + reason = reason.EscapePlaceholders(); + + return StartsWithBlank(reason) ? reason : " " + reason; + } - #region Private Definitions + return string.Empty; + } + + // SMELL: looks way too complex just to retain the leading whitespace + private static string EnsurePrefix(string prefix, string text) + { + string leadingBlanks = ExtractLeadingBlanksFrom(text); + string textWithoutLeadingBlanks = text.Substring(leadingBlanks.Length); + + return !textWithoutLeadingBlanks.StartsWith(prefix, StringComparison.OrdinalIgnoreCase) + ? leadingBlanks + prefix + " " + textWithoutLeadingBlanks + : text; + } + + private static string ExtractLeadingBlanksFrom(string text) + { + string trimmedText = text.TrimStart(Blanks); + int leadingBlanksCount = text.Length - trimmedText.Length; + + return text.Substring(0, leadingBlanksCount); + } + + private static bool StartsWithBlank(string text) + { + return text.Length > 0 && Blanks.Contains(text[0]); + } - private readonly char[] blanks = ['\r', '\n', ' ', '\t']; + public FailureMessageFormatter WithContext(ContextDataDictionary contextData) + { + this.contextData = contextData; + return this; + } - #endregion + public FailureMessageFormatter WithIdentifier(string identifier) + { + this.identifier = identifier; + return this; + } - public MessageBuilder(FormattingOptions formattingOptions) + public FailureMessageFormatter WithFallbackIdentifier(string fallbackIdentifier) { - this.formattingOptions = formattingOptions; + this.fallbackIdentifier = fallbackIdentifier; + return this; } - // SMELL: Too many parameters. - public string Build(string message, object[] messageArgs, string reason, ContextDataDictionary contextData, string identifier, - string fallbackIdentifier) + public string Format(string message, object[] messageArgs) { - message = message.Replace("{reason}", SanitizeReason(reason), StringComparison.Ordinal); + message = message.Replace("{reason}", reason, StringComparison.Ordinal); message = SubstituteIdentifier(message, identifier?.EscapePlaceholders(), fallbackIdentifier); @@ -91,7 +139,7 @@ private static string SubstituteContextualTags(string message, ContextDataDictio private string FormatArgumentPlaceholders(string failureMessage, object[] failureArgs) { - string[] values = failureArgs.Select(a => Formatter.ToString(a, formattingOptions)).ToArray(); + object[] values = failureArgs.Select(object (a) => Formatter.ToString(a, formattingOptions)).ToArray(); try { @@ -103,41 +151,4 @@ private string FormatArgumentPlaceholders(string failureMessage, object[] failur $"**WARNING** failure message '{failureMessage}' could not be formatted with string.Format{Environment.NewLine}{formatException.StackTrace}"; } } - - private string SanitizeReason(string reason) - { - if (!string.IsNullOrEmpty(reason)) - { - reason = EnsurePrefix("because", reason); - reason = reason.EscapePlaceholders(); - - return StartsWithBlank(reason) ? reason : " " + reason; - } - - return string.Empty; - } - - // SMELL: looks way too complex just to retain the leading whitespace - private string EnsurePrefix(string prefix, string text) - { - string leadingBlanks = ExtractLeadingBlanksFrom(text); - string textWithoutLeadingBlanks = text.Substring(leadingBlanks.Length); - - return !textWithoutLeadingBlanks.StartsWith(prefix, StringComparison.OrdinalIgnoreCase) - ? leadingBlanks + prefix + " " + textWithoutLeadingBlanks - : text; - } - - private string ExtractLeadingBlanksFrom(string text) - { - string trimmedText = text.TrimStart(blanks); - int leadingBlanksCount = text.Length - trimmedText.Length; - - return text.Substring(0, leadingBlanksCount); - } - - private bool StartsWithBlank(string text) - { - return text.Length > 0 && blanks.Contains(text[0]); - } } diff --git a/Src/FluentAssertions/Execution/GivenSelector.cs b/Src/FluentAssertions/Execution/GivenSelector.cs index b2d776fb26..0c2e42798f 100644 --- a/Src/FluentAssertions/Execution/GivenSelector.cs +++ b/Src/FluentAssertions/Execution/GivenSelector.cs @@ -1,28 +1,27 @@ -using System; +using System; using System.Linq; using FluentAssertions.Common; namespace FluentAssertions.Execution; /// -/// Represents a chaining object returned from to continue the assertion using +/// Represents a chaining object returned from to continue the assertion using /// an object returned by a selector. /// public class GivenSelector { - private readonly AssertionScope predecessor; - private readonly T subject; + private readonly AssertionChain assertionChain; + private readonly T selector; - private bool continueAsserting; - - internal GivenSelector(Func selector, AssertionScope predecessor, bool continueAsserting) + internal GivenSelector(Func selector, AssertionChain assertionChain) { - this.predecessor = predecessor; - this.continueAsserting = continueAsserting; + this.assertionChain = assertionChain; - subject = continueAsserting ? selector() : default; + this.selector = assertionChain.Succeeded ? selector() : default; } + public bool Succeeded => assertionChain.Succeeded; + /// /// Specify the condition that must be satisfied upon the subject selected through a prior selector. /// @@ -31,78 +30,47 @@ internal GivenSelector(Func selector, AssertionScope predecessor, bool contin /// /// /// The condition will not be evaluated if the prior assertion failed, - /// nor will throw any exceptions. + /// nor will throw any exceptions. /// /// is . public GivenSelector ForCondition(Func predicate) { Guard.ThrowIfArgumentIsNull(predicate); - if (continueAsserting) + if (assertionChain.Succeeded) { - predecessor.ForCondition(predicate(subject)); + assertionChain.ForCondition(predicate(selector)); } return this; } - /// - /// The will not be invoked if the prior assertion failed, - /// nor will throw any exceptions. - /// - /// - /// is . public GivenSelector Given(Func selector) { Guard.ThrowIfArgumentIsNull(selector); - return new GivenSelector(() => selector(subject), predecessor, continueAsserting); + return new GivenSelector(() => selector(this.selector), assertionChain); } - /// public ContinuationOfGiven FailWith(string message) { return FailWith(message, Array.Empty()); } - /// - /// - /// The will not be invoked if the prior assertion failed, - /// nor will throw any exceptions. - /// - /// public ContinuationOfGiven FailWith(string message, params Func[] args) { - if (continueAsserting) + if (assertionChain.PreviousAssertionSucceeded) { - object[] mappedArguments = args.Select(a => a(subject)).ToArray(); + object[] mappedArguments = args.Select(a => a(selector)).ToArray(); return FailWith(message, mappedArguments); } - return new ContinuationOfGiven(this, succeeded: false); + return new ContinuationOfGiven(this); } - /// - /// - /// The will not be invoked if the prior assertion failed, - /// nor will throw any exceptions. - /// - /// public ContinuationOfGiven FailWith(string message, params object[] args) { - if (continueAsserting) - { - continueAsserting = predecessor.FailWith(message, args); - return new ContinuationOfGiven(this, continueAsserting); - } - - return new ContinuationOfGiven(this, succeeded: false); - } - - /// - public ContinuationOfGiven ClearExpectation() - { - predecessor.ClearExpectation(); - return new ContinuationOfGiven(this, continueAsserting); + assertionChain.FailWith(message, args); + return new ContinuationOfGiven(this); } } diff --git a/Src/FluentAssertions/Execution/IAssertionScope.cs b/Src/FluentAssertions/Execution/IAssertionScope.cs deleted file mode 100644 index d114564ac5..0000000000 --- a/Src/FluentAssertions/Execution/IAssertionScope.cs +++ /dev/null @@ -1,186 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; - -namespace FluentAssertions.Execution; - -public interface IAssertionScope : IDisposable -{ - /// - /// Allows to safely select the subject for successive assertions. - /// - /// - /// Selector which result is passed to successive calls to . - /// - GivenSelector Given(Func selector); - - /// - /// Specify the condition that must be satisfied. - /// - /// - /// If the assertion will be treated as successful and no exceptions will be thrown. - /// - IAssertionScope ForCondition(bool condition); - - /// - /// Makes assertion fail when does not match . - /// - /// The occurrence description in natural language could then be inserted in failure message by using - /// {expectedOccurrence} placeholder in message parameters of and its - /// overloaded versions. - /// - /// - /// defining the number of expected occurrences. - /// The number of actual occurrences. - IAssertionScope ForConstraint(OccurrenceConstraint constraint, int actualOccurrences); - - /// - /// Sets the failure message when the assertion is not met, or completes the failure message set to a prior call to - /// . - /// - /// - /// Messages may contain a few specialized placeholders. For instance, {reason} will be replaced with the reason - /// of the assertion as passed to . - /// - /// Other named placeholders will be replaced with the scope data passed through - /// and . - /// - /// - /// Finally, a description of the current subject can be passed through the {context:description} placeholder. - /// This is used in the message if no explicit context is specified through the constructor. - /// - /// - /// If an expectation was set through a prior call to , then the failure - /// message is appended to that expectation. - /// - /// - /// The format string that represents the failure message. - Continuation FailWith(string message); - - /// - /// Sets the failure message when the assertion is not met, or completes the failure message set to a prior call to - /// . - /// will not be called unless the assertion is not met. - /// - /// Function returning object on demand. Called only when the assertion is not met. - Continuation FailWith(Func failReasonFunc); - - /// - /// Sets the failure message when the assertion is not met, or completes the failure message set to a prior call to - /// . - /// - /// - /// In addition to the numbered -style placeholders, messages may contain a - /// few specialized placeholders as well. For instance, {reason} will be replaced with the reason of the - /// assertion as passed to . - /// - /// Other named placeholders will be replaced with the scope data passed through - /// and . - /// - /// - /// Finally, a description of the current subject can be passed through the {context:description} placeholder. - /// This is used in the message if no explicit context is specified through the constructor. - /// - /// - /// Note that only 10 are supported in combination with a {reason}. - /// - /// - /// If an expectation was set through a prior call to , then the failure - /// message is appended to that expectation. - /// - /// - /// The format string that represents the failure message. - /// Optional arguments to any numbered placeholders. - Continuation FailWith(string message, params object[] args); - - /// - /// Sets the failure message when the assertion is not met, or completes the failure message set to a prior call to - /// , - /// but postpones evaluation of the formatting arguments until the assertion really fails. - /// - /// - /// In addition to the numbered -style placeholders, messages may contain a - /// few specialized placeholders as well. For instance, {reason} will be replaced with the reason of the - /// assertion as passed to . - /// - /// Other named placeholders will be replaced with the scope data passed through - /// and . - /// - /// - /// Finally, a description of the current subject can be passed through the {context:description} placeholder. - /// This is used in the message if no explicit context is specified through the constructor. - /// - /// - /// Note that only 10 are supported in combination with a {reason}. - /// - /// - /// If an expectation was set through a prior call to , then the failure - /// message is appended to that expectation. - /// - /// - /// The format string that represents the failure message. - /// Optional lazily evaluated arguments to any numbered placeholders - public Continuation FailWith(string message, params Func[] argProviders); - - /// - /// Specify the reason why you expect the condition to be . - /// - /// - /// A formatted phrase compatible with explaining why the condition should - /// be satisfied. If the phrase does not start with the word because, it is prepended to the message. - /// - /// If the format of or is not compatible with - /// , then a warning message is returned instead. - /// - /// - /// - /// Zero or more values to use for filling in any compatible placeholders. - /// - IAssertionScope BecauseOf([StringSyntax("CompositeFormat")] string because, params object[] becauseArgs); - - /// - /// Clears the expectation set by . - /// - // SMELL: It would be better to give the expectation an explicit scope, but that would be a breaking change. - Continuation ClearExpectation(); - - /// - /// Sets the expectation part of the failure message when the assertion is not met. - /// - /// - /// In addition to the numbered -style placeholders, messages may contain a - /// few specialized placeholders as well. For instance, {reason} will be replaced with the reason of the - /// assertion as passed to . - /// - /// Other named placeholders will be replaced with the scope data passed through - /// and . - /// - /// - /// Finally, a description of the current subject can be passed through the {context:description} placeholder. - /// This is used in the message if no explicit context is specified through the constructor. - /// - /// - /// Note that only 10 are supported in combination with a {reason}. - /// - /// - /// The format string that represents the failure message. - /// Optional arguments to any numbered placeholders. - IAssertionScope WithExpectation(string message, params object[] args); - - /// - /// Defines the name of the subject in case this cannot be extracted from the source code. - /// - IAssertionScope WithDefaultIdentifier(string identifier); - - /// - /// Forces the formatters, that support it, to add the necessary line breaks. - /// - /// - /// This is just shorthand for modifying the property. - /// - IAssertionScope UsingLineBreaks { get; } - - /// - /// Discards and returns the failures that happened up to now. - /// - string[] Discard(); -} diff --git a/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs b/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs index 3f5ba3550e..e86f2185b4 100644 --- a/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs +++ b/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs @@ -15,13 +15,19 @@ namespace FluentAssertions.Formatting; /// to the maximum number of lines provided through its constructor. It will throw /// a if the number of lines exceeds the maximum. /// -public class FormattedObjectGraph(int maxLines) +public class FormattedObjectGraph { + private readonly int maxLines; private readonly List lines = []; private readonly StringBuilder lineBuilder = new(); private int indentation; private string lineBuilderWhitespace = string.Empty; + public FormattedObjectGraph(int maxLines) + { + this.maxLines = maxLines; + } + /// /// The number of spaces that should be used by every indentation level. /// @@ -93,13 +99,14 @@ private void InsertInitialNewLine() private void FlushCurrentLine() { - if (lineBuilder.Length > 0) + string line = lineBuilder.ToString().TrimEnd(); + if (line.Length > 0) { - AppendWithoutExceedingMaximumLines($"{lineBuilderWhitespace}{lineBuilder}"); - - lineBuilder.Clear(); - lineBuilderWhitespace = Whitespace; + AppendWithoutExceedingMaximumLines(lineBuilderWhitespace + line); } + + lineBuilder.Clear(); + lineBuilderWhitespace = Whitespace; } private void AppendWithoutExceedingMaximumLines(string line) diff --git a/Src/FluentAssertions/Formatting/Formatter.cs b/Src/FluentAssertions/Formatting/Formatter.cs index d61ea84f9f..4ac3f13bfd 100644 --- a/Src/FluentAssertions/Formatting/Formatter.cs +++ b/Src/FluentAssertions/Formatting/Formatter.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using FluentAssertions.Common; -using FluentAssertions.Equivalency; using FluentAssertions.Equivalency.Execution; using FluentAssertions.Execution; using FluentAssertions.Xml; @@ -27,6 +26,7 @@ public static class Formatter new XElementValueFormatter(), new XAttributeValueFormatter(), new PropertyInfoFormatter(), + new MethodInfoFormatter(), new NullValueFormatter(), new GuidValueFormatter(), new DateTimeOffsetValueFormatter(), @@ -214,7 +214,7 @@ public bool TryPush(string path, object value) string fullPath = GetFullPath(); var reference = new ObjectReference(value, fullPath); - return !tracker.IsCyclicReference(reference, CyclicReferenceHandling.Ignore); + return !tracker.IsCyclicReference(reference); } private string GetFullPath() => string.Join(".", pathStack.Reverse()); diff --git a/Src/FluentAssertions/Formatting/MethodInfoFormatter.cs b/Src/FluentAssertions/Formatting/MethodInfoFormatter.cs new file mode 100644 index 0000000000..6cbc6eafd1 --- /dev/null +++ b/Src/FluentAssertions/Formatting/MethodInfoFormatter.cs @@ -0,0 +1,36 @@ +using System.Reflection; + +namespace FluentAssertions.Formatting; + +public class MethodInfoFormatter : IValueFormatter +{ + /// + /// Indicates whether the current can handle the specified . + /// + /// The value for which to create a . + /// + /// if the current can handle the specified value; otherwise, . + /// + public bool CanHandle(object value) + { + return value is MethodInfo; + } + + public void Format(object value, FormattedObjectGraph formattedGraph, FormattingContext context, FormatChild formatChild) + { + var method = (MethodInfo)value; + if (method.IsSpecialName && method.Name == "op_Implicit") + { + formattedGraph.AddFragment($"implicit operator {method.ReturnType.Name}({method.GetParameters()[0].ParameterType.Name})"); + } + else if (method.IsSpecialName && method.Name == "op_Explicit") + { + formattedGraph.AddFragment( + $"explicit operator {method.ReturnType.Name}({method.GetParameters()[0].ParameterType.Name})"); + } + else + { + formattedGraph.AddFragment($"{method!.DeclaringType!.Name + "." + method.Name}"); + } + } +} diff --git a/Src/FluentAssertions/Formatting/PropertyInfoFormatter.cs b/Src/FluentAssertions/Formatting/PropertyInfoFormatter.cs index c9746c2901..4ec7de86e0 100644 --- a/Src/FluentAssertions/Formatting/PropertyInfoFormatter.cs +++ b/Src/FluentAssertions/Formatting/PropertyInfoFormatter.cs @@ -18,6 +18,13 @@ public bool CanHandle(object value) public void Format(object value, FormattedObjectGraph formattedGraph, FormattingContext context, FormatChild formatChild) { - formattedGraph.AddFragment(((PropertyInfo)value).Name); + if (value is not PropertyInfo property) + { + formattedGraph.AddFragment(""); + } + else + { + formattedGraph.AddFragment($"{property.DeclaringType?.Name ?? string.Empty}.{property.Name}"); + } } } diff --git a/Src/FluentAssertions/Numeric/ByteAssertions.cs b/Src/FluentAssertions/Numeric/ByteAssertions.cs index 6467e86f5d..ccd7399bcf 100644 --- a/Src/FluentAssertions/Numeric/ByteAssertions.cs +++ b/Src/FluentAssertions/Numeric/ByteAssertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class ByteAssertions : NumericAssertions { - internal ByteAssertions(byte value) - : base(value) + internal ByteAssertions(byte value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs b/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs index 805812df65..3a40a75be1 100644 --- a/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs +++ b/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs @@ -16,8 +16,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] public class ComparableTypeAssertions : ComparableTypeAssertions> { - public ComparableTypeAssertions(IComparable value) - : base(value) + public ComparableTypeAssertions(IComparable value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -30,10 +30,12 @@ public class ComparableTypeAssertions : ReferenceTypeAssertions< where TAssertions : ComparableTypeAssertions { private const int Equal = 0; + private readonly AssertionChain assertionChain; - public ComparableTypeAssertions(IComparable value) - : base(value) + public ComparableTypeAssertions(IComparable value, AssertionChain assertionChain) + : base(value, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -51,7 +53,7 @@ public ComparableTypeAssertions(IComparable value) /// public AndConstraint Be(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Equals(Subject, expected)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:object} to be equal to {0}{reason}, but found {1}.", expected, Subject); @@ -112,7 +114,7 @@ public AndConstraint BeEquivalentTo(TExpectation expe EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); var context = new EquivalencyValidationContext( - Node.From(() => AssertionScope.Current.CallerIdentity), options) + Node.From(() => CurrentAssertionChain.CallerIdentifier), options) { Reason = new Reason(because, becauseArgs), TraceWriter = options.TraceWriter @@ -145,7 +147,7 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// public AndConstraint NotBe(T unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!Equals(Subject, unexpected)) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:object} to be equal to {0}{reason}.", unexpected); @@ -169,7 +171,7 @@ public AndConstraint NotBe(T unexpected, [StringSyntax("CompositeFo /// public AndConstraint BeRankedEquallyTo(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.CompareTo(expected) == Equal) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:object} {0} to be ranked as equal to {1}{reason}.", Subject, expected); @@ -193,7 +195,7 @@ public AndConstraint BeRankedEquallyTo(T expected, [StringSyntax("C /// public AndConstraint NotBeRankedEquallyTo(T unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.CompareTo(unexpected) != Equal) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:object} {0} not to be ranked as equal to {1}{reason}.", Subject, unexpected); @@ -216,7 +218,7 @@ public AndConstraint NotBeRankedEquallyTo(T unexpected, [StringSynt /// public AndConstraint BeLessThan(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.CompareTo(expected) < Equal) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:object} {0} to be less than {1}{reason}.", Subject, expected); @@ -239,7 +241,7 @@ public AndConstraint BeLessThan(T expected, [StringSyntax("Composit /// public AndConstraint BeLessThanOrEqualTo(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.CompareTo(expected) <= Equal) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:object} {0} to be less than or equal to {1}{reason}.", Subject, expected); @@ -262,7 +264,7 @@ public AndConstraint BeLessThanOrEqualTo(T expected, [StringSyntax( /// public AndConstraint BeGreaterThan(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.CompareTo(expected) > Equal) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:object} {0} to be greater than {1}{reason}.", Subject, expected); @@ -285,7 +287,7 @@ public AndConstraint BeGreaterThan(T expected, [StringSyntax("Compo /// public AndConstraint BeGreaterThanOrEqualTo(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.CompareTo(expected) >= Equal) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:object} {0} to be greater than or equal to {1}{reason}.", Subject, expected); @@ -315,7 +317,7 @@ public AndConstraint BeGreaterThanOrEqualTo(T expected, [StringSynt public AndConstraint BeInRange(T minimumValue, T maximumValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.CompareTo(minimumValue) >= Equal && Subject.CompareTo(maximumValue) <= Equal) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:object} to be between {0} and {1}{reason}, but found {2}.", @@ -346,7 +348,7 @@ public AndConstraint BeInRange(T minimumValue, T maximumValue, public AndConstraint NotBeInRange(T minimumValue, T maximumValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!(Subject.CompareTo(minimumValue) >= Equal && Subject.CompareTo(maximumValue) <= Equal)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:object} to not be between {0} and {1}{reason}, but found {2}.", @@ -382,7 +384,7 @@ public AndConstraint BeOneOf(params T[] validValues) public AndConstraint BeOneOf(IEnumerable validValues, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .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); diff --git a/Src/FluentAssertions/Numeric/DecimalAssertions.cs b/Src/FluentAssertions/Numeric/DecimalAssertions.cs index 0b0d91bf00..aa31679f46 100644 --- a/Src/FluentAssertions/Numeric/DecimalAssertions.cs +++ b/Src/FluentAssertions/Numeric/DecimalAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -10,8 +11,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class DecimalAssertions : NumericAssertions { - internal DecimalAssertions(decimal value) - : base(value) + internal DecimalAssertions(decimal value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/DoubleAssertions.cs b/Src/FluentAssertions/Numeric/DoubleAssertions.cs index d8395924b5..0596191408 100644 --- a/Src/FluentAssertions/Numeric/DoubleAssertions.cs +++ b/Src/FluentAssertions/Numeric/DoubleAssertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class DoubleAssertions : NumericAssertions { - internal DoubleAssertions(double value) - : base(value) + internal DoubleAssertions(double value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/Int16Assertions.cs b/Src/FluentAssertions/Numeric/Int16Assertions.cs index d4391d4115..7d7b9c2102 100644 --- a/Src/FluentAssertions/Numeric/Int16Assertions.cs +++ b/Src/FluentAssertions/Numeric/Int16Assertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class Int16Assertions : NumericAssertions { - internal Int16Assertions(short value) - : base(value) + internal Int16Assertions(short value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/Int32Assertions.cs b/Src/FluentAssertions/Numeric/Int32Assertions.cs index 44baf64bd6..cfcb25f472 100644 --- a/Src/FluentAssertions/Numeric/Int32Assertions.cs +++ b/Src/FluentAssertions/Numeric/Int32Assertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class Int32Assertions : NumericAssertions { - internal Int32Assertions(int value) - : base(value) + internal Int32Assertions(int value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/Int64Assertions.cs b/Src/FluentAssertions/Numeric/Int64Assertions.cs index b3f4cd8650..c733dd294e 100644 --- a/Src/FluentAssertions/Numeric/Int64Assertions.cs +++ b/Src/FluentAssertions/Numeric/Int64Assertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class Int64Assertions : NumericAssertions { - internal Int64Assertions(long value) - : base(value) + internal Int64Assertions(long value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/NullableByteAssertions.cs b/Src/FluentAssertions/Numeric/NullableByteAssertions.cs index 42001910fc..9fa6a4c4f0 100644 --- a/Src/FluentAssertions/Numeric/NullableByteAssertions.cs +++ b/Src/FluentAssertions/Numeric/NullableByteAssertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class NullableByteAssertions : NullableNumericAssertions { - internal NullableByteAssertions(byte? value) - : base(value) + internal NullableByteAssertions(byte? value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/NullableDecimalAssertions.cs b/Src/FluentAssertions/Numeric/NullableDecimalAssertions.cs index 3a2897eb16..d5b27880c6 100644 --- a/Src/FluentAssertions/Numeric/NullableDecimalAssertions.cs +++ b/Src/FluentAssertions/Numeric/NullableDecimalAssertions.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -10,8 +11,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class NullableDecimalAssertions : NullableNumericAssertions { - internal NullableDecimalAssertions(decimal? value) - : base(value) + internal NullableDecimalAssertions(decimal? value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/NullableDoubleAssertions.cs b/Src/FluentAssertions/Numeric/NullableDoubleAssertions.cs index 62c2c34a42..97af5f97bc 100644 --- a/Src/FluentAssertions/Numeric/NullableDoubleAssertions.cs +++ b/Src/FluentAssertions/Numeric/NullableDoubleAssertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class NullableDoubleAssertions : NullableNumericAssertions { - internal NullableDoubleAssertions(double? value) - : base(value) + internal NullableDoubleAssertions(double? value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/NullableInt16Assertions.cs b/Src/FluentAssertions/Numeric/NullableInt16Assertions.cs index 89c5cc65d2..802d0c864d 100644 --- a/Src/FluentAssertions/Numeric/NullableInt16Assertions.cs +++ b/Src/FluentAssertions/Numeric/NullableInt16Assertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class NullableInt16Assertions : NullableNumericAssertions { - internal NullableInt16Assertions(short? value) - : base(value) + internal NullableInt16Assertions(short? value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/NullableInt32Assertions.cs b/Src/FluentAssertions/Numeric/NullableInt32Assertions.cs index 67636c9ddf..7b2400568f 100644 --- a/Src/FluentAssertions/Numeric/NullableInt32Assertions.cs +++ b/Src/FluentAssertions/Numeric/NullableInt32Assertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class NullableInt32Assertions : NullableNumericAssertions { - internal NullableInt32Assertions(int? value) - : base(value) + internal NullableInt32Assertions(int? value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/NullableInt64Assertions.cs b/Src/FluentAssertions/Numeric/NullableInt64Assertions.cs index 4630361178..1e5e04d386 100644 --- a/Src/FluentAssertions/Numeric/NullableInt64Assertions.cs +++ b/Src/FluentAssertions/Numeric/NullableInt64Assertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class NullableInt64Assertions : NullableNumericAssertions { - internal NullableInt64Assertions(long? value) - : base(value) + internal NullableInt64Assertions(long? value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/NullableNumericAssertions.cs b/Src/FluentAssertions/Numeric/NullableNumericAssertions.cs index 5443d7f0a3..88af8fc2b3 100644 --- a/Src/FluentAssertions/Numeric/NullableNumericAssertions.cs +++ b/Src/FluentAssertions/Numeric/NullableNumericAssertions.cs @@ -11,8 +11,8 @@ namespace FluentAssertions.Numeric; public class NullableNumericAssertions : NullableNumericAssertions> where T : struct, IComparable { - public NullableNumericAssertions(T? value) - : base(value) + public NullableNumericAssertions(T? value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -22,9 +22,12 @@ public class NullableNumericAssertions : NumericAssertions where TAssertions : NullableNumericAssertions { - public NullableNumericAssertions(T? value) - : base(value) + private readonly AssertionChain assertionChain; + + public NullableNumericAssertions(T? value, AssertionChain assertionChain) + : base(value, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -39,7 +42,7 @@ public NullableNumericAssertions(T? value) /// public AndConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected a value{reason}."); @@ -74,7 +77,7 @@ public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] st /// public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Did not expect a value{reason}, but found {0}.", Subject); @@ -116,7 +119,7 @@ public AndConstraint Match(Expression> predicate, { Guard.ThrowIfArgumentIsNull(predicate); - Execute.Assertion + assertionChain .ForCondition(predicate.Compile()(Subject)) .BecauseOf(because, becauseArgs) .FailWith("Expected value to match {0}{reason}, but found {1}.", predicate, Subject); diff --git a/Src/FluentAssertions/Numeric/NullableSByteAssertions.cs b/Src/FluentAssertions/Numeric/NullableSByteAssertions.cs index 76967bc17e..e83e756404 100644 --- a/Src/FluentAssertions/Numeric/NullableSByteAssertions.cs +++ b/Src/FluentAssertions/Numeric/NullableSByteAssertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class NullableSByteAssertions : NullableNumericAssertions { - internal NullableSByteAssertions(sbyte? value) - : base(value) + internal NullableSByteAssertions(sbyte? value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/NullableSingleAssertions.cs b/Src/FluentAssertions/Numeric/NullableSingleAssertions.cs index fbcdaa919d..3a82df8969 100644 --- a/Src/FluentAssertions/Numeric/NullableSingleAssertions.cs +++ b/Src/FluentAssertions/Numeric/NullableSingleAssertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class NullableSingleAssertions : NullableNumericAssertions { - internal NullableSingleAssertions(float? value) - : base(value) + internal NullableSingleAssertions(float? value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/NullableUInt16Assertions.cs b/Src/FluentAssertions/Numeric/NullableUInt16Assertions.cs index 97aad47a07..0df417d5e2 100644 --- a/Src/FluentAssertions/Numeric/NullableUInt16Assertions.cs +++ b/Src/FluentAssertions/Numeric/NullableUInt16Assertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class NullableUInt16Assertions : NullableNumericAssertions { - internal NullableUInt16Assertions(ushort? value) - : base(value) + internal NullableUInt16Assertions(ushort? value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/NullableUInt32Assertions.cs b/Src/FluentAssertions/Numeric/NullableUInt32Assertions.cs index abf8f69801..69b94a8086 100644 --- a/Src/FluentAssertions/Numeric/NullableUInt32Assertions.cs +++ b/Src/FluentAssertions/Numeric/NullableUInt32Assertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class NullableUInt32Assertions : NullableNumericAssertions { - internal NullableUInt32Assertions(uint? value) - : base(value) + internal NullableUInt32Assertions(uint? value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/NullableUInt64Assertions.cs b/Src/FluentAssertions/Numeric/NullableUInt64Assertions.cs index 1a2e44c3a7..6c36e3b703 100644 --- a/Src/FluentAssertions/Numeric/NullableUInt64Assertions.cs +++ b/Src/FluentAssertions/Numeric/NullableUInt64Assertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class NullableUInt64Assertions : NullableNumericAssertions { - internal NullableUInt64Assertions(ulong? value) - : base(value) + internal NullableUInt64Assertions(ulong? value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/NumericAssertions.cs b/Src/FluentAssertions/Numeric/NumericAssertions.cs index 81cf130b6f..87b645a9fd 100644 --- a/Src/FluentAssertions/Numeric/NumericAssertions.cs +++ b/Src/FluentAssertions/Numeric/NumericAssertions.cs @@ -16,8 +16,8 @@ namespace FluentAssertions.Numeric; public class NumericAssertions : NumericAssertions> where T : struct, IComparable { - public NumericAssertions(T value) - : base(value) + public NumericAssertions(T value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -32,14 +32,15 @@ public class NumericAssertions where T : struct, IComparable where TAssertions : NumericAssertions { - public NumericAssertions(T value) - : this((T?)value) + public NumericAssertions(T value, AssertionChain assertionChain) + : this((T?)value, assertionChain) { } - private protected NumericAssertions(T? value) + private protected NumericAssertions(T? value, AssertionChain assertionChain) { Subject = value; + CurrentAssertionChain = assertionChain; } public T? Subject { get; } @@ -57,7 +58,7 @@ private protected NumericAssertions(T? value) /// public AndConstraint Be(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + CurrentAssertionChain .ForCondition(Subject?.CompareTo(expected) == 0) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to be {0}{reason}, but found {1}" + GenerateDifferenceMessage(expected), expected, @@ -79,7 +80,7 @@ public AndConstraint Be(T expected, [StringSyntax("CompositeFormat" /// public AndConstraint Be(T? expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + CurrentAssertionChain .ForCondition(expected is { } value ? Subject?.CompareTo(value) == 0 : !Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to be {0}{reason}, but found {1}" + GenerateDifferenceMessage(expected), expected, @@ -101,7 +102,7 @@ public AndConstraint Be(T? expected, [StringSyntax("CompositeFormat /// public AndConstraint NotBe(T unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + CurrentAssertionChain .ForCondition(Subject?.CompareTo(unexpected) != 0) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:value} to be {0}{reason}.", unexpected); @@ -122,7 +123,7 @@ public AndConstraint NotBe(T unexpected, [StringSyntax("CompositeFo /// public AndConstraint NotBe(T? unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + CurrentAssertionChain .ForCondition(unexpected is { } value ? Subject?.CompareTo(value) != 0 : Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:value} to be {0}{reason}.", unexpected); @@ -142,7 +143,7 @@ public AndConstraint NotBe(T? unexpected, [StringSyntax("CompositeF /// public AndConstraint BePositive([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + CurrentAssertionChain .ForCondition(Subject?.CompareTo(default) > 0) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to be positive{reason}, but found {0}.", Subject); @@ -162,7 +163,7 @@ public AndConstraint BePositive([StringSyntax("CompositeFormat")] s /// public AndConstraint BeNegative([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + CurrentAssertionChain .ForCondition(Subject is { } value && !IsNaN(value) && value.CompareTo(default) < 0) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to be negative{reason}, but found {0}.", Subject); @@ -188,7 +189,7 @@ public AndConstraint BeLessThan(T expected, [StringSyntax("Composit throw new ArgumentException("A value can never be less than NaN", nameof(expected)); } - Execute.Assertion + CurrentAssertionChain .ForCondition(Subject is { } value && !IsNaN(value) && value.CompareTo(expected) < 0) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to be less than {0}{reason}, but found {1}" + GenerateDifferenceMessage(expected), @@ -216,7 +217,7 @@ public AndConstraint BeLessThanOrEqualTo(T expected, throw new ArgumentException("A value can never be less than or equal to NaN", nameof(expected)); } - Execute.Assertion + CurrentAssertionChain .ForCondition(Subject is { } value && !IsNaN(value) && value.CompareTo(expected) <= 0) .BecauseOf(because, becauseArgs) .FailWith( @@ -245,7 +246,7 @@ public AndConstraint BeGreaterThan(T expected, throw new ArgumentException("A value can never be greater than NaN", nameof(expected)); } - Execute.Assertion + CurrentAssertionChain .ForCondition(Subject?.CompareTo(expected) > 0) .BecauseOf(because, becauseArgs) .FailWith( @@ -274,7 +275,7 @@ public AndConstraint BeGreaterThanOrEqualTo(T expected, throw new ArgumentException("A value can never be greater than or equal to a NaN", nameof(expected)); } - Execute.Assertion + CurrentAssertionChain .ForCondition(Subject?.CompareTo(expected) >= 0) .BecauseOf(because, becauseArgs) .FailWith( @@ -311,7 +312,7 @@ public AndConstraint BeInRange(T minimumValue, T maximumValue, throw new ArgumentException("A range cannot begin or end with NaN"); } - Execute.Assertion + CurrentAssertionChain .ForCondition(Subject is { } value && value.CompareTo(minimumValue) >= 0 && value.CompareTo(maximumValue) <= 0) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to be between {0} and {1}{reason}, but found {2}.", @@ -347,7 +348,7 @@ public AndConstraint NotBeInRange(T minimumValue, T maximumValue, throw new ArgumentException("A range cannot begin or end with NaN"); } - Execute.Assertion + CurrentAssertionChain .ForCondition(Subject is { } value && !(value.CompareTo(minimumValue) >= 0 && value.CompareTo(maximumValue) <= 0)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to not be between {0} and {1}{reason}, but found {2}.", @@ -383,7 +384,7 @@ public AndConstraint BeOneOf(params T[] validValues) public AndConstraint BeOneOf(IEnumerable validValues, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + CurrentAssertionChain .ForCondition(Subject is { } value && validValues.Contains(value)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to be one of {0}{reason}, but found {1}.", validValues, Subject); @@ -441,12 +442,12 @@ public AndConstraint NotBeOfType(Type unexpectedType, [StringSyntax { Guard.ThrowIfArgumentIsNull(unexpectedType); - bool success = Execute.Assertion + CurrentAssertionChain .ForCondition(Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected type not to be " + unexpectedType + "{reason}, but found ."); - if (success) + if (CurrentAssertionChain.Succeeded) { Subject.GetType().Should().NotBe(unexpectedType, because, becauseArgs); } @@ -473,7 +474,7 @@ public AndConstraint Match(Expression> predicate, { Guard.ThrowIfArgumentIsNull(predicate); - Execute.Assertion + CurrentAssertionChain .ForCondition(predicate.Compile()((T)Subject)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to match {0}{reason}, but found {1}.", predicate.Body, Subject); @@ -510,4 +511,9 @@ private string GenerateDifferenceMessage(T? expected) var difference = CalculateDifferenceForFailureMessage(subject, expectedValue); return difference is null ? noDifferenceMessage : $" (difference of {difference})."; } + + /// + /// Provides access to the that this assertion class was initialized with. + /// + public AssertionChain CurrentAssertionChain { get; } } diff --git a/Src/FluentAssertions/Numeric/SByteAssertions.cs b/Src/FluentAssertions/Numeric/SByteAssertions.cs index f0f19c4cda..7ac217e8a3 100644 --- a/Src/FluentAssertions/Numeric/SByteAssertions.cs +++ b/Src/FluentAssertions/Numeric/SByteAssertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class SByteAssertions : NumericAssertions { - internal SByteAssertions(sbyte value) - : base(value) + internal SByteAssertions(sbyte value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/SingleAssertions.cs b/Src/FluentAssertions/Numeric/SingleAssertions.cs index 6a11220314..2276b01334 100644 --- a/Src/FluentAssertions/Numeric/SingleAssertions.cs +++ b/Src/FluentAssertions/Numeric/SingleAssertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class SingleAssertions : NumericAssertions { - internal SingleAssertions(float value) - : base(value) + internal SingleAssertions(float value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/UInt16Assertions.cs b/Src/FluentAssertions/Numeric/UInt16Assertions.cs index b067a2a085..c1672f1482 100644 --- a/Src/FluentAssertions/Numeric/UInt16Assertions.cs +++ b/Src/FluentAssertions/Numeric/UInt16Assertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class UInt16Assertions : NumericAssertions { - internal UInt16Assertions(ushort value) - : base(value) + internal UInt16Assertions(ushort value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/UInt32Assertions.cs b/Src/FluentAssertions/Numeric/UInt32Assertions.cs index ecd089901d..49bcaad48f 100644 --- a/Src/FluentAssertions/Numeric/UInt32Assertions.cs +++ b/Src/FluentAssertions/Numeric/UInt32Assertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class UInt32Assertions : NumericAssertions { - internal UInt32Assertions(uint value) - : base(value) + internal UInt32Assertions(uint value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/Numeric/UInt64Assertions.cs b/Src/FluentAssertions/Numeric/UInt64Assertions.cs index f45d9f35d4..3060a1c012 100644 --- a/Src/FluentAssertions/Numeric/UInt64Assertions.cs +++ b/Src/FluentAssertions/Numeric/UInt64Assertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Globalization; +using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -9,8 +10,8 @@ namespace FluentAssertions.Numeric; [DebuggerNonUserCode] internal class UInt64Assertions : NumericAssertions { - internal UInt64Assertions(ulong value) - : base(value) + internal UInt64Assertions(ulong value, AssertionChain assertionChain) + : base(value, assertionChain) { } diff --git a/Src/FluentAssertions/NumericAssertionsExtensions.cs b/Src/FluentAssertions/NumericAssertionsExtensions.cs index a2ab750506..20d3b9e6fe 100644 --- a/Src/FluentAssertions/NumericAssertionsExtensions.cs +++ b/Src/FluentAssertions/NumericAssertionsExtensions.cs @@ -49,8 +49,9 @@ public static AndConstraint> BeCloseTo(this NumericAsse maxValue = sbyte.MaxValue; } - FailIfValueOutsideBounds(minValue <= actualValue && actualValue <= maxValue, nearbyValue, delta, actualValue, because, - becauseArgs); + FailIfValueOutsideBounds(parent.CurrentAssertionChain, + minValue <= actualValue && actualValue <= maxValue, + nearbyValue, delta, actualValue, because, becauseArgs); return new AndConstraint>(parent); } @@ -91,8 +92,9 @@ public static AndConstraint> BeCloseTo(this NumericAsser maxValue = byte.MaxValue; } - FailIfValueOutsideBounds(minValue <= actualValue && actualValue <= maxValue, nearbyValue, delta, actualValue, because, - becauseArgs); + FailIfValueOutsideBounds(parent.CurrentAssertionChain, + minValue <= actualValue && actualValue <= maxValue, nearbyValue, delta, actualValue, + because, becauseArgs); return new AndConstraint>(parent); } @@ -133,8 +135,10 @@ public static AndConstraint> BeCloseTo(this NumericAsse maxValue = short.MaxValue; } - FailIfValueOutsideBounds(minValue <= actualValue && actualValue <= maxValue, nearbyValue, delta, actualValue, because, - becauseArgs); + FailIfValueOutsideBounds(parent.CurrentAssertionChain, + minValue <= actualValue && actualValue <= maxValue, + nearbyValue, delta, actualValue, + because, becauseArgs); return new AndConstraint>(parent); } @@ -175,8 +179,10 @@ public static AndConstraint> BeCloseTo(this NumericAss maxValue = ushort.MaxValue; } - FailIfValueOutsideBounds(minValue <= actualValue && actualValue <= maxValue, nearbyValue, delta, actualValue, because, - becauseArgs); + FailIfValueOutsideBounds(parent.CurrentAssertionChain, + minValue <= actualValue && actualValue <= maxValue, + nearbyValue, delta, actualValue, + because, becauseArgs); return new AndConstraint>(parent); } @@ -217,7 +223,10 @@ public static AndConstraint> BeCloseTo(this NumericAssert maxValue = int.MaxValue; } - FailIfValueOutsideBounds(minValue <= actualValue && actualValue <= maxValue, nearbyValue, delta, actualValue, because, + FailIfValueOutsideBounds(parent.CurrentAssertionChain, + minValue <= actualValue && actualValue <= maxValue, + nearbyValue, delta, actualValue, + because, becauseArgs); return new AndConstraint>(parent); @@ -259,8 +268,11 @@ public static AndConstraint> BeCloseTo(this NumericAsser maxValue = uint.MaxValue; } - FailIfValueOutsideBounds(minValue <= actualValue && actualValue <= maxValue, nearbyValue, delta, actualValue, because, - becauseArgs); + FailIfValueOutsideBounds( + parent.CurrentAssertionChain, + minValue <= actualValue && actualValue <= maxValue, + nearbyValue, delta, actualValue, + because, becauseArgs); return new AndConstraint>(parent); } @@ -290,8 +302,10 @@ public static AndConstraint> BeCloseTo(this NumericAsser long minValue = GetMinValue(nearbyValue, delta); long maxValue = GetMaxValue(nearbyValue, delta); - FailIfValueOutsideBounds(minValue <= actualValue && actualValue <= maxValue, nearbyValue, delta, actualValue, because, - becauseArgs); + FailIfValueOutsideBounds(parent.CurrentAssertionChain, + minValue <= actualValue && actualValue <= maxValue, + nearbyValue, delta, actualValue, + because, becauseArgs); return new AndConstraint>(parent); } @@ -332,17 +346,19 @@ public static AndConstraint> BeCloseTo(this NumericAsse maxValue = ulong.MaxValue; } - FailIfValueOutsideBounds(minValue <= actualValue && actualValue <= maxValue, nearbyValue, delta, actualValue, because, - becauseArgs); + FailIfValueOutsideBounds(parent.CurrentAssertionChain, + minValue <= actualValue && actualValue <= maxValue, + nearbyValue, delta, actualValue, + because, becauseArgs); return new AndConstraint>(parent); } - private static void FailIfValueOutsideBounds(bool valueWithinBounds, + private static void FailIfValueOutsideBounds(AssertionChain assertionChain, bool valueWithinBounds, TValue nearbyValue, TDelta delta, TValue actualValue, [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(valueWithinBounds) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to be within {0} from {1}{reason}, but found {2}.", @@ -389,8 +405,10 @@ public static AndConstraint> NotBeCloseTo(this NumericA maxValue = sbyte.MaxValue; } - FailIfValueInsideBounds(!(minValue <= actualValue && actualValue <= maxValue), distantValue, delta, actualValue, because, - becauseArgs); + FailIfValueInsideBounds(parent.CurrentAssertionChain, + !(minValue <= actualValue && actualValue <= maxValue), + distantValue, delta, actualValue, + because, becauseArgs); return new AndConstraint>(parent); } @@ -431,8 +449,11 @@ public static AndConstraint> NotBeCloseTo(this NumericAs maxValue = byte.MaxValue; } - FailIfValueInsideBounds(!(minValue <= actualValue && actualValue <= maxValue), distantValue, delta, actualValue, because, - becauseArgs); + FailIfValueInsideBounds( + parent.CurrentAssertionChain, + !(minValue <= actualValue && actualValue <= maxValue), + distantValue, delta, actualValue, + because, becauseArgs); return new AndConstraint>(parent); } @@ -473,8 +494,11 @@ public static AndConstraint> NotBeCloseTo(this NumericA maxValue = short.MaxValue; } - FailIfValueInsideBounds(!(minValue <= actualValue && actualValue <= maxValue), distantValue, delta, actualValue, because, - becauseArgs); + FailIfValueInsideBounds( + parent.CurrentAssertionChain, + !(minValue <= actualValue && actualValue <= maxValue), + distantValue, delta, actualValue, + because, becauseArgs); return new AndConstraint>(parent); } @@ -515,8 +539,10 @@ public static AndConstraint> NotBeCloseTo(this Numeric maxValue = ushort.MaxValue; } - FailIfValueInsideBounds(!(minValue <= actualValue && actualValue <= maxValue), distantValue, delta, actualValue, because, - becauseArgs); + FailIfValueInsideBounds(parent.CurrentAssertionChain, + !(minValue <= actualValue && actualValue <= maxValue), + distantValue, delta, actualValue, + because, becauseArgs); return new AndConstraint>(parent); } @@ -557,8 +583,11 @@ public static AndConstraint> NotBeCloseTo(this NumericAss maxValue = int.MaxValue; } - FailIfValueInsideBounds(!(minValue <= actualValue && actualValue <= maxValue), distantValue, delta, actualValue, because, - becauseArgs); + FailIfValueInsideBounds( + parent.CurrentAssertionChain, + !(minValue <= actualValue && actualValue <= maxValue), + distantValue, delta, actualValue, + because, becauseArgs); return new AndConstraint>(parent); } @@ -599,8 +628,10 @@ public static AndConstraint> NotBeCloseTo(this NumericAs maxValue = uint.MaxValue; } - FailIfValueInsideBounds(!(minValue <= actualValue && actualValue <= maxValue), distantValue, delta, actualValue, because, - becauseArgs); + FailIfValueInsideBounds(parent.CurrentAssertionChain, + !(minValue <= actualValue && actualValue <= maxValue), + distantValue, delta, actualValue, + because, becauseArgs); return new AndConstraint>(parent); } @@ -630,8 +661,10 @@ public static AndConstraint> NotBeCloseTo(this NumericAs long minValue = GetMinValue(distantValue, delta); long maxValue = GetMaxValue(distantValue, delta); - FailIfValueInsideBounds(!(minValue <= actualValue && actualValue <= maxValue), distantValue, delta, actualValue, because, - becauseArgs); + FailIfValueInsideBounds(parent.CurrentAssertionChain, + !(minValue <= actualValue && actualValue <= maxValue), + distantValue, delta, actualValue, + because, becauseArgs); return new AndConstraint>(parent); } @@ -672,18 +705,23 @@ public static AndConstraint> NotBeCloseTo(this NumericA maxValue = ulong.MaxValue; } - FailIfValueInsideBounds(!(minValue <= actualValue && actualValue <= maxValue), distantValue, delta, actualValue, because, + FailIfValueInsideBounds(parent.CurrentAssertionChain, + !(minValue <= actualValue && actualValue <= maxValue), distantValue, + delta, + actualValue, + because, becauseArgs); return new AndConstraint>(parent); } private static void FailIfValueInsideBounds( + AssertionChain assertionChain, bool valueOutsideBounds, TValue distantValue, TDelta delta, TValue actualValue, [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(valueOutsideBounds) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:value} to be within {0} from {1}{reason}, but found {2}.", @@ -718,15 +756,17 @@ public static AndConstraint> BeApproximately(th { Guard.ThrowIfArgumentIsNegative(precision); - bool success = Execute.Assertion + var assertion = parent.CurrentAssertionChain; + + assertion .ForCondition(parent.Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to approximate {0} +/- {1}{reason}, but it was .", expectedValue, precision); - if (success) + if (assertion.Succeeded) { - var nonNullableAssertions = new SingleAssertions(parent.Subject.Value); + var nonNullableAssertions = new SingleAssertions(parent.Subject.Value, assertion); nonNullableAssertions.BeApproximately(expectedValue, precision, because, becauseArgs); } @@ -763,13 +803,15 @@ public static AndConstraint> BeApproximately(th return new AndConstraint>(parent); } - bool succeeded = Execute.Assertion + var assertion = parent.CurrentAssertionChain; + + assertion .ForCondition(expectedValue is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to approximate {0} +/- {1}{reason}, but it was {2}.", expectedValue, precision, parent.Subject); - if (succeeded) + if (assertion.Succeeded) { // ReSharper disable once PossibleInvalidOperationException parent.BeApproximately(expectedValue.Value, precision, because, becauseArgs); @@ -852,15 +894,17 @@ public static AndConstraint> BeApproximately(t { Guard.ThrowIfArgumentIsNegative(precision); - bool success = Execute.Assertion + var assertion = parent.CurrentAssertionChain; + + assertion .ForCondition(parent.Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to approximate {0} +/- {1}{reason}, but it was .", expectedValue, precision); - if (success) + if (assertion.Succeeded) { - var nonNullableAssertions = new DoubleAssertions(parent.Subject.Value); + var nonNullableAssertions = new DoubleAssertions(parent.Subject.Value, assertion); BeApproximately(nonNullableAssertions, expectedValue, precision, because, becauseArgs); } @@ -897,13 +941,15 @@ public static AndConstraint> BeApproximately(t return new AndConstraint>(parent); } - bool succeeded = Execute.Assertion + var assertion = parent.CurrentAssertionChain; + + assertion .ForCondition(expectedValue is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to approximate {0} +/- {1}{reason}, but it was {2}.", expectedValue, precision, parent.Subject); - if (succeeded) + if (assertion.Succeeded) { // ReSharper disable once PossibleInvalidOperationException parent.BeApproximately(expectedValue.Value, precision, because, becauseArgs); @@ -987,15 +1033,17 @@ public static AndConstraint> BeApproximately( { Guard.ThrowIfArgumentIsNegative(precision); - bool success = Execute.Assertion + var assertion = parent.CurrentAssertionChain; + + assertion .ForCondition(parent.Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to approximate {0} +/- {1}{reason}, but it was .", expectedValue, precision); - if (success) + if (assertion.Succeeded) { - var nonNullableAssertions = new DecimalAssertions(parent.Subject.Value); + var nonNullableAssertions = new DecimalAssertions(parent.Subject.Value, assertion); BeApproximately(nonNullableAssertions, expectedValue, precision, because, becauseArgs); } @@ -1033,13 +1081,15 @@ public static AndConstraint> BeApproximately( return new AndConstraint>(parent); } - bool succeeded = Execute.Assertion + var assertion = parent.CurrentAssertionChain; + + assertion .ForCondition(expectedValue is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to approximate {0} +/- {1}{reason}, but it was {2}.", expectedValue, precision, parent.Subject); - if (succeeded) + if (assertion.Succeeded) { // ReSharper disable once PossibleInvalidOperationException parent.BeApproximately(expectedValue.Value, precision, because, becauseArgs); @@ -1086,7 +1136,9 @@ private static void FailIfDifferenceOutsidePrecision( [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) where T : struct, IComparable { - Execute.Assertion + var assertion = parent.CurrentAssertionChain; + + assertion .ForCondition(differenceWithinPrecision) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to approximate {1} +/- {2}{reason}, but {0} differed by {3}.", @@ -1123,7 +1175,7 @@ public static AndConstraint> NotBeApproximately if (parent.Subject is not null) { - var nonNullableAssertions = new SingleAssertions(parent.Subject.Value); + var nonNullableAssertions = new SingleAssertions(parent.Subject.Value, parent.CurrentAssertionChain); nonNullableAssertions.NotBeApproximately(unexpectedValue, precision, because, becauseArgs); } @@ -1160,13 +1212,15 @@ public static AndConstraint> NotBeApproximately return new AndConstraint>(parent); } - bool succeeded = Execute.Assertion + var assertion = parent.CurrentAssertionChain; + + assertion .ForCondition(parent.Subject is not null && unexpectedValue is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to not approximate {0} +/- {1}{reason}, but it was {2}.", unexpectedValue, precision, parent.Subject); - if (succeeded) + if (assertion.Succeeded) { // ReSharper disable once PossibleInvalidOperationException parent.NotBeApproximately(unexpectedValue.Value, precision, because, becauseArgs); @@ -1252,7 +1306,7 @@ public static AndConstraint> NotBeApproximatel if (parent.Subject is not null) { - var nonNullableAssertions = new DoubleAssertions(parent.Subject.Value); + var nonNullableAssertions = new DoubleAssertions(parent.Subject.Value, parent.CurrentAssertionChain); nonNullableAssertions.NotBeApproximately(unexpectedValue, precision, because, becauseArgs); } @@ -1290,13 +1344,15 @@ public static AndConstraint> NotBeApproximatel return new AndConstraint>(parent); } - bool succeeded = Execute.Assertion + AssertionChain assertionChain = parent.CurrentAssertionChain; + + assertionChain .ForCondition(parent.Subject is not null && unexpectedValue is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to not approximate {0} +/- {1}{reason}, but it was {2}.", unexpectedValue, precision, parent.Subject); - if (succeeded) + if (assertionChain.Succeeded) { // ReSharper disable once PossibleInvalidOperationException parent.NotBeApproximately(unexpectedValue.Value, precision, because, becauseArgs); @@ -1382,7 +1438,7 @@ public static AndConstraint> NotBeApproximate if (parent.Subject is not null) { - var nonNullableAssertions = new DecimalAssertions(parent.Subject.Value); + var nonNullableAssertions = new DecimalAssertions(parent.Subject.Value, parent.CurrentAssertionChain); NotBeApproximately(nonNullableAssertions, unexpectedValue, precision, because, becauseArgs); } @@ -1420,13 +1476,15 @@ public static AndConstraint> NotBeApproximate return new AndConstraint>(parent); } - bool succeeded = Execute.Assertion + var assertion = parent.CurrentAssertionChain; + + assertion .ForCondition(parent.Subject is not null && unexpectedValue is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to not approximate {0} +/- {1}{reason}, but it was {2}.", unexpectedValue, precision, parent.Subject); - if (succeeded) + if (assertion.Succeeded) { // ReSharper disable once PossibleInvalidOperationException parent.NotBeApproximately(unexpectedValue.Value, precision, because, becauseArgs); @@ -1473,7 +1531,7 @@ private static void FailIfDifferenceWithinPrecision( [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) where T : struct, IComparable { - Execute.Assertion + parent.CurrentAssertionChain .ForCondition(differenceOutsidePrecision) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to not approximate {1} +/- {2}{reason}, but {0} only differed by {3}.", @@ -1500,7 +1558,7 @@ public static AndConstraint> BeNaN(this NumericAssertio { float actualValue = parent.Subject.Value; - Execute.Assertion + parent.CurrentAssertionChain .ForCondition(float.IsNaN(actualValue)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to be NaN{reason}, but found {0}.", actualValue); @@ -1524,7 +1582,7 @@ public static AndConstraint> BeNaN(this NumericAsserti { double actualValue = parent.Subject.Value; - Execute.Assertion + parent.CurrentAssertionChain .ForCondition(double.IsNaN(actualValue)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to be NaN{reason}, but found {0}.", actualValue); @@ -1548,7 +1606,7 @@ public static AndConstraint> BeNaN(this Nullabl { float? actualValue = parent.Subject; - Execute.Assertion + parent.CurrentAssertionChain .ForCondition(actualValue is { } value && float.IsNaN(value)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to be NaN{reason}, but found {0}.", actualValue); @@ -1572,7 +1630,7 @@ public static AndConstraint> BeNaN(this Nullab { double? actualValue = parent.Subject; - Execute.Assertion + parent.CurrentAssertionChain .ForCondition(actualValue is { } value && double.IsNaN(value)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:value} to be NaN{reason}, but found {0}.", actualValue); @@ -1600,7 +1658,7 @@ public static AndConstraint> NotBeNaN(this NumericAsser { float actualValue = parent.Subject.Value; - Execute.Assertion + parent.CurrentAssertionChain .ForCondition(!float.IsNaN(actualValue)) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:value} to be NaN{reason}."); @@ -1624,7 +1682,7 @@ public static AndConstraint> NotBeNaN(this NumericAsse { double actualValue = parent.Subject.Value; - Execute.Assertion + parent.CurrentAssertionChain .ForCondition(!double.IsNaN(actualValue)) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:value} to be NaN{reason}."); @@ -1649,7 +1707,7 @@ public static AndConstraint> NotBeNaN(this Null float? actualValue = parent.Subject; bool actualValueIsNaN = actualValue is { } value && float.IsNaN(value); - Execute.Assertion + parent.CurrentAssertionChain .ForCondition(!actualValueIsNaN) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:value} to be NaN{reason}."); @@ -1674,7 +1732,7 @@ public static AndConstraint> NotBeNaN(this Nul double? actualValue = parent.Subject; bool actualValueIsNaN = actualValue is { } value && double.IsNaN(value); - Execute.Assertion + parent.CurrentAssertionChain .ForCondition(!actualValueIsNaN) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:value} to be NaN{reason}."); @@ -1687,6 +1745,7 @@ public static AndConstraint> NotBeNaN(this Nul private static long GetMinValue(long value, ulong delta) { long minValue; + if (delta <= (ulong.MaxValue / 2)) { minValue = value - (long)delta; @@ -1711,6 +1770,7 @@ private static long GetMinValue(long value, ulong delta) private static long GetMaxValue(long value, ulong delta) { long maxValue; + if (delta <= (ulong.MaxValue / 2)) { maxValue = value + (long)delta; diff --git a/Src/FluentAssertions/ObjectAssertionsExtensions.cs b/Src/FluentAssertions/ObjectAssertionsExtensions.cs index 7819357665..5f93f280fa 100644 --- a/Src/FluentAssertions/ObjectAssertionsExtensions.cs +++ b/Src/FluentAssertions/ObjectAssertionsExtensions.cs @@ -5,7 +5,6 @@ using System.Xml.Serialization; using FluentAssertions.Common; using FluentAssertions.Equivalency; -using FluentAssertions.Execution; using FluentAssertions.Primitives; namespace FluentAssertions; @@ -66,7 +65,7 @@ public static AndConstraint BeDataContractSerializable(this } catch (Exception exc) { - Execute.Assertion + assertions.CurrentAssertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {0} to be serializable{reason}, but serialization failed with:" + Environment.NewLine + Environment.NewLine + "{1}.", @@ -110,7 +109,7 @@ public static AndConstraint BeXmlSerializable(this ObjectAsser } catch (Exception exc) { - Execute.Assertion + assertions.CurrentAssertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {0} to be serializable{reason}, but serialization failed with:" + Environment.NewLine + Environment.NewLine + "{1}.", diff --git a/Src/FluentAssertions/OccurrenceConstraint.cs b/Src/FluentAssertions/OccurrenceConstraint.cs index 1f93dd0f13..347df0b750 100644 --- a/Src/FluentAssertions/OccurrenceConstraint.cs +++ b/Src/FluentAssertions/OccurrenceConstraint.cs @@ -1,6 +1,5 @@ using System; using FluentAssertions.Common; -using FluentAssertions.Execution; namespace FluentAssertions; @@ -22,8 +21,8 @@ protected OccurrenceConstraint(int expectedCount) internal abstract bool Assert(int actual); - internal void RegisterReportables(AssertionScope scope) + internal void RegisterContextData(Action register) { - scope.AddReportable("expectedOccurrence", $"{Mode} {ExpectedCount.Times()}"); + register("expectedOccurrence", $"{Mode} {ExpectedCount.Times()}"); } } diff --git a/Src/FluentAssertions/Primitives/BooleanAssertions.cs b/Src/FluentAssertions/Primitives/BooleanAssertions.cs index 1adcba679f..4932df3e13 100644 --- a/Src/FluentAssertions/Primitives/BooleanAssertions.cs +++ b/Src/FluentAssertions/Primitives/BooleanAssertions.cs @@ -12,8 +12,8 @@ namespace FluentAssertions.Primitives; public class BooleanAssertions : BooleanAssertions { - public BooleanAssertions(bool? value) - : base(value) + public BooleanAssertions(bool? value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -27,8 +27,11 @@ public BooleanAssertions(bool? value) public class BooleanAssertions where TAssertions : BooleanAssertions { - public BooleanAssertions(bool? value) + private readonly AssertionChain assertionChain; + + public BooleanAssertions(bool? value, AssertionChain assertionChain) { + this.assertionChain = assertionChain; Subject = value; } @@ -49,7 +52,7 @@ public BooleanAssertions(bool? value) /// public AndConstraint BeFalse([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject == false) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:boolean} to be {0}{reason}, but found {1}.", false, Subject); @@ -69,7 +72,7 @@ public AndConstraint BeFalse([StringSyntax("CompositeFormat")] stri /// public AndConstraint BeTrue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject == true) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:boolean} to be {0}{reason}, but found {1}.", true, Subject); @@ -88,9 +91,10 @@ public AndConstraint BeTrue([StringSyntax("CompositeFormat")] strin /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(bool expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint Be(bool expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject == expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:boolean} to be {0}{reason}, but found {1}.", expected, Subject); @@ -109,9 +113,10 @@ public AndConstraint Be(bool expected, [StringSyntax("CompositeForm /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe(bool unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotBe(bool unexpected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject != unexpected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:boolean} not to be {0}{reason}, but found {1}.", unexpected, Subject); @@ -136,16 +141,15 @@ public AndConstraint Imply(bool consequent, { bool? antecedent = Subject; - Execute.Assertion + assertionChain .ForCondition(antecedent is not null) .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:antecedent} ({0}) to imply consequent ({1}){reason}, ", antecedent, consequent) - .FailWith("but found null.") - .Then - .ForCondition(!antecedent.Value || consequent) - .FailWith("but it did not.") - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:antecedent} ({0}) to imply consequent ({1}){reason}, ", antecedent, consequent, + chain => chain + .FailWith("but found null.") + .Then + .ForCondition(!antecedent.Value || consequent) + .FailWith("but it did not.")); return new AndConstraint((TAssertions)this); } diff --git a/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs b/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs index 5adc26841c..c5e57b5d73 100644 --- a/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs @@ -15,8 +15,8 @@ namespace FluentAssertions.Primitives; [DebuggerNonUserCode] public class DateOnlyAssertions : DateOnlyAssertions { - public DateOnlyAssertions(DateOnly? value) - : base(value) + public DateOnlyAssertions(DateOnly? value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -30,8 +30,11 @@ public DateOnlyAssertions(DateOnly? value) public class DateOnlyAssertions where TAssertions : DateOnlyAssertions { - public DateOnlyAssertions(DateOnly? value) + private readonly AssertionChain assertionChain; + + public DateOnlyAssertions(DateOnly? value, AssertionChain assertionChain) { + this.assertionChain = assertionChain; Subject = value; } @@ -51,9 +54,10 @@ public DateOnlyAssertions(DateOnly? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(DateOnly expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint Be(DateOnly expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject == expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:date} to be {0}{reason}, but found {1}.", @@ -73,9 +77,10 @@ public AndConstraint Be(DateOnly expected, [StringSyntax("Composite /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(DateOnly? expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint Be(DateOnly? expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject == expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:date} to be {0}{reason}, but found {1}.", @@ -98,7 +103,7 @@ public AndConstraint Be(DateOnly? expected, [StringSyntax("Composit public AndConstraint NotBe(DateOnly unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject != unexpected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:date} not to be {0}{reason}, but it is.", unexpected); @@ -120,7 +125,7 @@ public AndConstraint NotBe(DateOnly unexpected, [StringSyntax("Comp public AndConstraint NotBe(DateOnly? unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject != unexpected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:date} not to be {0}{reason}, but it is.", unexpected); @@ -142,7 +147,7 @@ public AndConstraint NotBe(DateOnly? unexpected, public AndConstraint BeBefore(DateOnly expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject < expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:date} to be before {0}{reason}, but found {1}.", expected, @@ -182,7 +187,7 @@ public AndConstraint NotBeBefore(DateOnly unexpected, public AndConstraint BeOnOrBefore(DateOnly expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject <= expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:date} to be on or before {0}{reason}, but found {1}.", expected, @@ -222,7 +227,7 @@ public AndConstraint NotBeOnOrBefore(DateOnly unexpected, public AndConstraint BeAfter(DateOnly expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject > expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:date} to be after {0}{reason}, but found {1}.", expected, @@ -262,7 +267,7 @@ public AndConstraint NotBeAfter(DateOnly unexpected, public AndConstraint BeOnOrAfter(DateOnly expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject >= expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:date} to be on or after {0}{reason}, but found {1}.", expected, @@ -299,18 +304,17 @@ public AndConstraint NotBeOnOrAfter(DateOnly unexpected, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveYear(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint HaveYear(int expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the year part of {context:the date} to be {0}{reason}", expected) - .ForCondition(Subject.HasValue) - .FailWith(", but found .") - .Then - .ForCondition(Subject.Value.Year == expected) - .FailWith(", but found {0}.", Subject.Value.Year) - .Then - .ClearExpectation(); + .WithExpectation("Expected the year part of {context:the date} to be {0}{reason}", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found .") + .Then + .ForCondition(Subject.Value.Year == expected) + .FailWith(", but found {0}.", Subject.Value.Year)); return new AndConstraint((TAssertions)this); } @@ -326,9 +330,10 @@ public AndConstraint HaveYear(int expected, [StringSyntax("Composit /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveYear(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotHaveYear(int unexpected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject.HasValue) .FailWith("Did not expect the year part of {context:the date} to be {0}{reason}, but found a DateOnly.", @@ -352,18 +357,17 @@ public AndConstraint NotHaveYear(int unexpected, [StringSyntax("Com /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveMonth(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint HaveMonth(int expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the month part of {context:the date} to be {0}{reason}", expected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateOnly.") - .Then - .ForCondition(Subject.Value.Month == expected) - .FailWith(", but found {0}.", Subject.Value.Month) - .Then - .ClearExpectation(); + .WithExpectation("Expected the month part of {context:the date} to be {0}{reason}", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateOnly.") + .Then + .ForCondition(Subject.Value.Month == expected) + .FailWith(", but found {0}.", Subject.Value.Month)); return new AndConstraint((TAssertions)this); } @@ -379,18 +383,17 @@ public AndConstraint HaveMonth(int expected, [StringSyntax("Composi /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveMonth(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotHaveMonth(int unexpected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the month part of {context:the date} to be {0}{reason}", unexpected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateOnly.") - .Then - .ForCondition(Subject.Value.Month != unexpected) - .FailWith(", but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the month part of {context:the date} to be {0}{reason}", unexpected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateOnly.") + .Then + .ForCondition(Subject.Value.Month != unexpected) + .FailWith(", but it was.")); return new AndConstraint((TAssertions)this); } @@ -406,18 +409,17 @@ public AndConstraint NotHaveMonth(int unexpected, [StringSyntax("Co /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveDay(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint HaveDay(int expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the day part of {context:the date} to be {0}{reason}", expected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateOnly.") - .Then - .ForCondition(Subject.Value.Day == expected) - .FailWith(", but found {0}.", Subject.Value.Day) - .Then - .ClearExpectation(); + .WithExpectation("Expected the day part of {context:the date} to be {0}{reason}", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateOnly.") + .Then + .ForCondition(Subject.Value.Day == expected) + .FailWith(", but found {0}.", Subject.Value.Day)); return new AndConstraint((TAssertions)this); } @@ -433,18 +435,17 @@ public AndConstraint HaveDay(int expected, [StringSyntax("Composite /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveDay(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotHaveDay(int unexpected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the day part of {context:the date} to be {0}{reason}", unexpected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateOnly.") - .Then - .ForCondition(Subject.Value.Day != unexpected) - .FailWith(", but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the day part of {context:the date} to be {0}{reason}", unexpected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateOnly.") + .Then + .ForCondition(Subject.Value.Day != unexpected) + .FailWith(", but it was.")); return new AndConstraint((TAssertions)this); } @@ -484,7 +485,8 @@ public AndConstraint BeOneOf(params DateOnly[] validValues) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeOneOf(IEnumerable validValues, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint BeOneOf(IEnumerable validValues, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeOneOf(validValues.Cast(), because, becauseArgs); } @@ -505,7 +507,7 @@ public AndConstraint BeOneOf(IEnumerable validValues, [St public AndConstraint BeOneOf(IEnumerable validValues, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(validValues.Contains(Subject)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:date} to be one of {0}{reason}, but found {1}.", validValues, Subject); diff --git a/Src/FluentAssertions/Primitives/DateTimeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeAssertions.cs index 63effadf47..b1f7ffa01a 100644 --- a/Src/FluentAssertions/Primitives/DateTimeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeAssertions.cs @@ -18,8 +18,8 @@ namespace FluentAssertions.Primitives; [DebuggerNonUserCode] public class DateTimeAssertions : DateTimeAssertions { - public DateTimeAssertions(DateTime? value) - : base(value) + public DateTimeAssertions(DateTime? value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -37,8 +37,11 @@ public DateTimeAssertions(DateTime? value) public class DateTimeAssertions where TAssertions : DateTimeAssertions { - public DateTimeAssertions(DateTime? value) + private readonly AssertionChain assertionChain; + + public DateTimeAssertions(DateTime? value, AssertionChain assertionChain) { + this.assertionChain = assertionChain; Subject = value; } @@ -58,9 +61,10 @@ public DateTimeAssertions(DateTime? value) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(DateTime expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint Be(DateTime expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject == expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:date and time} to be {0}{reason}, but found {1}.", @@ -80,9 +84,10 @@ public AndConstraint Be(DateTime expected, [StringSyntax("Composite /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be(DateTime? expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint Be(DateTime? expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject == expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:date and time} to be {0}{reason}, but found {1}.", @@ -105,7 +110,7 @@ public AndConstraint Be(DateTime? expected, [StringSyntax("Composit public AndConstraint NotBe(DateTime unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject != unexpected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:date and time} not to be {0}{reason}, but it is.", unexpected); @@ -127,7 +132,7 @@ public AndConstraint NotBe(DateTime unexpected, public AndConstraint NotBe(DateTime? unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject != unexpected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:date and time} not to be {0}{reason}, but it is.", unexpected); @@ -170,16 +175,15 @@ public AndConstraint BeCloseTo(DateTime nearbyTime, TimeSpan precis TimeSpan? difference = (Subject - nearbyTime)?.Duration(); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:the date and time} to be within {0} from {1}{reason}", precision, nearbyTime) - .ForCondition(Subject is not null) - .FailWith(", but found .") - .Then - .ForCondition(Subject >= minimumValue && Subject <= maximumValue) - .FailWith(", but {0} was off by {1}.", Subject, difference) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:the date and time} to be within {0} from {1}{reason}", precision, nearbyTime, + chain => chain + .ForCondition(Subject is not null) + .FailWith(", but found .") + .Then + .ForCondition(Subject >= minimumValue && Subject <= maximumValue) + .FailWith(", but {0} was off by {1}.", Subject, difference)); return new AndConstraint((TAssertions)this); } @@ -217,7 +221,7 @@ public AndConstraint NotBeCloseTo(DateTime distantTime, TimeSpan pr long distanceToMaxInTicks = (DateTime.MaxValue - distantTime).Ticks; DateTime maximumValue = distantTime.AddTicks(Math.Min(precision.Ticks, distanceToMaxInTicks)); - Execute.Assertion + assertionChain .ForCondition(Subject < minimumValue || Subject > maximumValue) .BecauseOf(because, becauseArgs) .FailWith( @@ -242,7 +246,7 @@ public AndConstraint NotBeCloseTo(DateTime distantTime, TimeSpan pr public AndConstraint BeBefore(DateTime expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject < expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the date and time} to be before {0}{reason}, but found {1}.", expected, @@ -282,7 +286,7 @@ public AndConstraint NotBeBefore(DateTime unexpected, public AndConstraint BeOnOrBefore(DateTime expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject <= expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the date and time} to be on or before {0}{reason}, but found {1}.", expected, @@ -322,7 +326,7 @@ public AndConstraint NotBeOnOrBefore(DateTime unexpected, public AndConstraint BeAfter(DateTime expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject > expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the date and time} to be after {0}{reason}, but found {1}.", expected, @@ -362,7 +366,7 @@ public AndConstraint NotBeAfter(DateTime unexpected, public AndConstraint BeOnOrAfter(DateTime expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject >= expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the date and time} to be on or after {0}{reason}, but found {1}.", expected, @@ -399,18 +403,17 @@ public AndConstraint NotBeOnOrAfter(DateTime unexpected, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveYear(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint HaveYear(int expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the year part of {context:the date} to be {0}{reason}", expected) - .ForCondition(Subject.HasValue) - .FailWith(", but found .") - .Then - .ForCondition(Subject.Value.Year == expected) - .FailWith(", but found {0}.", Subject.Value.Year) - .Then - .ClearExpectation(); + .WithExpectation("Expected the year part of {context:the date} to be {0}{reason}", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found .") + .Then + .ForCondition(Subject.Value.Year == expected) + .FailWith(", but found {0}.", Subject.Value.Year)); return new AndConstraint((TAssertions)this); } @@ -426,9 +429,10 @@ public AndConstraint HaveYear(int expected, [StringSyntax("Composit /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveYear(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotHaveYear(int unexpected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject.HasValue) .FailWith("Did not expect the year part of {context:the date} to be {0}{reason}, but found a DateTime.", @@ -452,18 +456,17 @@ public AndConstraint NotHaveYear(int unexpected, [StringSyntax("Com /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveMonth(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint HaveMonth(int expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the month part of {context:the date} to be {0}{reason}", expected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateTime.") - .Then - .ForCondition(Subject.Value.Month == expected) - .FailWith(", but found {0}.", Subject.Value.Month) - .Then - .ClearExpectation(); + .WithExpectation("Expected the month part of {context:the date} to be {0}{reason}", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateTime.") + .Then + .ForCondition(Subject.Value.Month == expected) + .FailWith(", but found {0}.", Subject.Value.Month)); return new AndConstraint((TAssertions)this); } @@ -479,18 +482,17 @@ public AndConstraint HaveMonth(int expected, [StringSyntax("Composi /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveMonth(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotHaveMonth(int unexpected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the month part of {context:the date} to be {0}{reason}", unexpected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateTime.") - .Then - .ForCondition(Subject.Value.Month != unexpected) - .FailWith(", but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the month part of {context:the date} to be {0}{reason}", unexpected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateTime.") + .Then + .ForCondition(Subject.Value.Month != unexpected) + .FailWith(", but it was.")); return new AndConstraint((TAssertions)this); } @@ -506,18 +508,17 @@ public AndConstraint NotHaveMonth(int unexpected, [StringSyntax("Co /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveDay(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint HaveDay(int expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the day part of {context:the date} to be {0}{reason}", expected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateTime.") - .Then - .ForCondition(Subject.Value.Day == expected) - .FailWith(", but found {0}.", Subject.Value.Day) - .Then - .ClearExpectation(); + .WithExpectation("Expected the day part of {context:the date} to be {0}{reason}", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateTime.") + .Then + .ForCondition(Subject.Value.Day == expected) + .FailWith(", but found {0}.", Subject.Value.Day)); return new AndConstraint((TAssertions)this); } @@ -533,18 +534,17 @@ public AndConstraint HaveDay(int expected, [StringSyntax("Composite /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveDay(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotHaveDay(int unexpected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the day part of {context:the date} to be {0}{reason}", unexpected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateTime.") - .Then - .ForCondition(Subject.Value.Day != unexpected) - .FailWith(", but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the day part of {context:the date} to be {0}{reason}", unexpected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateTime.") + .Then + .ForCondition(Subject.Value.Day != unexpected) + .FailWith(", but it was.")); return new AndConstraint((TAssertions)this); } @@ -560,18 +560,17 @@ public AndConstraint NotHaveDay(int unexpected, [StringSyntax("Comp /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveHour(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint HaveHour(int expected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the hour part of {context:the time} to be {0}{reason}", expected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateTime.") - .Then - .ForCondition(Subject.Value.Hour == expected) - .FailWith(", but found {0}.", Subject.Value.Hour) - .Then - .ClearExpectation(); + .WithExpectation("Expected the hour part of {context:the time} to be {0}{reason}", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateTime.") + .Then + .ForCondition(Subject.Value.Hour == expected) + .FailWith(", but found {0}.", Subject.Value.Hour)); return new AndConstraint((TAssertions)this); } @@ -587,18 +586,17 @@ public AndConstraint HaveHour(int expected, [StringSyntax("Composit /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveHour(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotHaveHour(int unexpected, [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the hour part of {context:the time} to be {0}{reason}", unexpected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateTime.", unexpected) - .Then - .ForCondition(Subject.Value.Hour != unexpected) - .FailWith(", but it was.", unexpected, Subject.Value.Hour) - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the hour part of {context:the time} to be {0}{reason}", unexpected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateTime.", unexpected) + .Then + .ForCondition(Subject.Value.Hour != unexpected) + .FailWith(", but it was.", unexpected, Subject.Value.Hour)); return new AndConstraint((TAssertions)this); } @@ -617,16 +615,14 @@ public AndConstraint NotHaveHour(int unexpected, [StringSyntax("Com public AndConstraint HaveMinute(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the minute part of {context:the time} to be {0}{reason}", expected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateTime.") - .Then - .ForCondition(Subject.Value.Minute == expected) - .FailWith(", but found {0}.", Subject.Value.Minute) - .Then - .ClearExpectation(); + .WithExpectation("Expected the minute part of {context:the time} to be {0}{reason}", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateTime.") + .Then + .ForCondition(Subject.Value.Minute == expected) + .FailWith(", but found {0}.", Subject.Value.Minute)); return new AndConstraint((TAssertions)this); } @@ -645,16 +641,14 @@ public AndConstraint HaveMinute(int expected, public AndConstraint NotHaveMinute(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the minute part of {context:the time} to be {0}{reason}", unexpected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateTime.", unexpected) - .Then - .ForCondition(Subject.Value.Minute != unexpected) - .FailWith(", but it was.", unexpected, Subject.Value.Minute) - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the minute part of {context:the time} to be {0}{reason}", unexpected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateTime.", unexpected) + .Then + .ForCondition(Subject.Value.Minute != unexpected) + .FailWith(", but it was.", unexpected, Subject.Value.Minute)); return new AndConstraint((TAssertions)this); } @@ -673,16 +667,14 @@ public AndConstraint NotHaveMinute(int unexpected, public AndConstraint HaveSecond(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the seconds part of {context:the time} to be {0}{reason}", expected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateTime.") - .Then - .ForCondition(Subject.Value.Second == expected) - .FailWith(", but found {0}.", Subject.Value.Second) - .Then - .ClearExpectation(); + .WithExpectation("Expected the seconds part of {context:the time} to be {0}{reason}", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateTime.") + .Then + .ForCondition(Subject.Value.Second == expected) + .FailWith(", but found {0}.", Subject.Value.Second)); return new AndConstraint((TAssertions)this); } @@ -701,16 +693,14 @@ public AndConstraint HaveSecond(int expected, public AndConstraint NotHaveSecond(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the seconds part of {context:the time} to be {0}{reason}", unexpected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateTime.") - .Then - .ForCondition(Subject.Value.Second != unexpected) - .FailWith(", but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the seconds part of {context:the time} to be {0}{reason}", unexpected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateTime.") + .Then + .ForCondition(Subject.Value.Second != unexpected) + .FailWith(", but it was.")); return new AndConstraint((TAssertions)this); } @@ -724,7 +714,8 @@ public AndConstraint NotHaveSecond(int unexpected, /// public DateTimeRangeAssertions BeMoreThan(TimeSpan timeSpan) { - return new DateTimeRangeAssertions((TAssertions)this, Subject, TimeSpanCondition.MoreThan, timeSpan); + return new DateTimeRangeAssertions((TAssertions)this, assertionChain, Subject, TimeSpanCondition.MoreThan, + timeSpan); } /// @@ -737,7 +728,8 @@ public DateTimeRangeAssertions BeMoreThan(TimeSpan timeSpan) /// public DateTimeRangeAssertions BeAtLeast(TimeSpan timeSpan) { - return new DateTimeRangeAssertions((TAssertions)this, Subject, TimeSpanCondition.AtLeast, timeSpan); + return new DateTimeRangeAssertions((TAssertions)this, assertionChain, Subject, TimeSpanCondition.AtLeast, + timeSpan); } /// @@ -749,7 +741,8 @@ public DateTimeRangeAssertions BeAtLeast(TimeSpan timeSpan) /// public DateTimeRangeAssertions BeExactly(TimeSpan timeSpan) { - return new DateTimeRangeAssertions((TAssertions)this, Subject, TimeSpanCondition.Exactly, timeSpan); + return new DateTimeRangeAssertions((TAssertions)this, assertionChain, Subject, TimeSpanCondition.Exactly, + timeSpan); } /// @@ -761,7 +754,8 @@ public DateTimeRangeAssertions BeExactly(TimeSpan timeSpan) /// public DateTimeRangeAssertions BeWithin(TimeSpan timeSpan) { - return new DateTimeRangeAssertions((TAssertions)this, Subject, TimeSpanCondition.Within, timeSpan); + return new DateTimeRangeAssertions((TAssertions)this, assertionChain, Subject, TimeSpanCondition.Within, + timeSpan); } /// @@ -773,7 +767,8 @@ public DateTimeRangeAssertions BeWithin(TimeSpan timeSpan) /// public DateTimeRangeAssertions BeLessThan(TimeSpan timeSpan) { - return new DateTimeRangeAssertions((TAssertions)this, Subject, TimeSpanCondition.LessThan, timeSpan); + return new DateTimeRangeAssertions((TAssertions)this, assertionChain, Subject, TimeSpanCondition.LessThan, + timeSpan); } /// @@ -792,16 +787,15 @@ public AndConstraint BeSameDateAs(DateTime expected, { DateTime expectedDate = expected.Date; - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the date part of {context:the date and time} to be {0}{reason}", expectedDate) - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateTime.", expectedDate) - .Then - .ForCondition(Subject.Value.Date == expectedDate) - .FailWith(", but found {1}.", expectedDate, Subject.Value) - .Then - .ClearExpectation(); + .WithExpectation("Expected the date part of {context:the date and time} to be {0}{reason}", expectedDate, + chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateTime.", expectedDate) + .Then + .ForCondition(Subject.Value.Date == expectedDate) + .FailWith(", but found {1}.", expectedDate, Subject.Value)); return new AndConstraint((TAssertions)this); } @@ -822,16 +816,15 @@ public AndConstraint NotBeSameDateAs(DateTime unexpected, { DateTime unexpectedDate = unexpected.Date; - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the date part of {context:the date and time} to be {0}{reason}", unexpectedDate) - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateTime.") - .Then - .ForCondition(Subject.Value.Date != unexpectedDate) - .FailWith(", but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the date part of {context:the date and time} to be {0}{reason}", unexpectedDate, + chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateTime.") + .Then + .ForCondition(Subject.Value.Date != unexpectedDate) + .FailWith(", but it was.")); return new AndConstraint((TAssertions)this); } @@ -893,7 +886,7 @@ public AndConstraint BeOneOf(IEnumerable validValues, public AndConstraint BeOneOf(IEnumerable validValues, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(validValues.Contains(Subject)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:date and time} to be one of {0}{reason}, but found {1}.", validValues, Subject); @@ -917,16 +910,14 @@ public AndConstraint BeOneOf(IEnumerable validValues, public AndConstraint BeIn(DateTimeKind expectedKind, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:the date and time} to be in " + expectedKind + "{reason}") - .ForCondition(Subject.HasValue) - .FailWith(", but found a DateTime.") - .Then - .ForCondition(Subject.Value.Kind == expectedKind) - .FailWith(", but found " + Subject.Value.Kind + ".") - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:the date and time} to be in " + expectedKind + "{reason}", chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateTime.") + .Then + .ForCondition(Subject.Value.Kind == expectedKind) + .FailWith(", but found " + Subject.Value.Kind + ".")); return new AndConstraint((TAssertions)this); } @@ -947,17 +938,15 @@ public AndConstraint BeIn(DateTimeKind expectedKind, public AndConstraint NotBeIn(DateTimeKind unexpectedKind, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect {context:the date and time} to be in " + unexpectedKind + "{reason}") - .Given(() => Subject) - .ForCondition(subject => subject.HasValue) - .FailWith(", but found a DateTime.") - .Then - .ForCondition(subject => subject.GetValueOrDefault().Kind != unexpectedKind) - .FailWith(", but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect {context:the date and time} to be in " + unexpectedKind + "{reason}", chain => chain + .Given(() => Subject) + .ForCondition(subject => subject.HasValue) + .FailWith(", but found a DateTime.") + .Then + .ForCondition(subject => subject.GetValueOrDefault().Kind != unexpectedKind) + .FailWith(", but it was.")); return new AndConstraint((TAssertions)this); } diff --git a/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs index 35a03100c1..83d27c8ad0 100644 --- a/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs @@ -19,8 +19,8 @@ namespace FluentAssertions.Primitives; public class DateTimeOffsetAssertions : DateTimeOffsetAssertions { - public DateTimeOffsetAssertions(DateTimeOffset? value) - : base(value) + public DateTimeOffsetAssertions(DateTimeOffset? value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -38,8 +38,11 @@ public DateTimeOffsetAssertions(DateTimeOffset? value) public class DateTimeOffsetAssertions where TAssertions : DateTimeOffsetAssertions { - public DateTimeOffsetAssertions(DateTimeOffset? value) + private readonly AssertionChain assertionChain; + + public DateTimeOffsetAssertions(DateTimeOffset? value, AssertionChain assertionChain) { + this.assertionChain = assertionChain; Subject = value; } @@ -62,17 +65,15 @@ public DateTimeOffsetAssertions(DateTimeOffset? value) public AndConstraint Be(DateTimeOffset expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .WithExpectation("Expected {context:the date and time} to represent the same point in time as {0}{reason}, ", - expected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject == expected) - .FailWith("but {0} does not.", Subject) - .Then - .ClearExpectation(); + expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject == expected) + .FailWith("but {0} does not.", Subject)); return new AndConstraint((TAssertions)this); } @@ -93,24 +94,21 @@ public AndConstraint Be(DateTimeOffset? expected, { if (!expected.HasValue) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!Subject.HasValue) .FailWith("Expected {context:the date and time} to be {reason}, but it was {0}.", Subject); } else { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .WithExpectation("Expected {context:the date and time} to represent the same point in time as {0}{reason}, ", - expected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject == expected) - .FailWith("but {0} does not.", Subject) - .Then - .ClearExpectation(); + expected, chain => chain.ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject == expected) + .FailWith("but {0} does not.", Subject)); } return new AndConstraint((TAssertions)this); @@ -130,7 +128,7 @@ public AndConstraint Be(DateTimeOffset? expected, public AndConstraint NotBe(DateTimeOffset unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject != unexpected) .BecauseOf(because, becauseArgs) .FailWith( @@ -154,7 +152,7 @@ public AndConstraint NotBe(DateTimeOffset unexpected, public AndConstraint NotBe(DateTimeOffset? unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject != unexpected) .BecauseOf(because, becauseArgs) .FailWith( @@ -178,16 +176,14 @@ public AndConstraint NotBe(DateTimeOffset? unexpected, public AndConstraint BeExactly(DateTimeOffset expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:the date and time} to be exactly {0}{reason}, ", expected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.EqualsExact(expected)) - .FailWith("but it was {0}.", Subject) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:the date and time} to be exactly {0}{reason}, ", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.EqualsExact(expected)) + .FailWith("but it was {0}.", Subject)); return new AndConstraint((TAssertions)this); } @@ -209,23 +205,21 @@ public AndConstraint BeExactly(DateTimeOffset? expected, { if (!expected.HasValue) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!Subject.HasValue) .FailWith("Expected {context:the date and time} to be {reason}, but it was {0}.", Subject); } else { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:the date and time} to be exactly {0}{reason}, ", expected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.EqualsExact(expected.Value)) - .FailWith("but it was {0}.", Subject) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:the date and time} to be exactly {0}{reason}, ", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.EqualsExact(expected.Value)) + .FailWith("but it was {0}.", Subject)); } return new AndConstraint((TAssertions)this); @@ -246,7 +240,7 @@ public AndConstraint BeExactly(DateTimeOffset? expected, public AndConstraint NotBeExactly(DateTimeOffset unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject?.EqualsExact(unexpected) != true) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:the date and time} to be exactly {0}{reason}, but it was.", unexpected); @@ -268,7 +262,7 @@ public AndConstraint NotBeExactly(DateTimeOffset unexpected, public AndConstraint NotBeExactly(DateTimeOffset? unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!((Subject == null && unexpected == null) || (Subject != null && unexpected != null && Subject.Value.EqualsExact(unexpected.Value)))) .BecauseOf(because, becauseArgs) @@ -312,16 +306,15 @@ public AndConstraint BeCloseTo(DateTimeOffset nearbyTime, TimeSpan TimeSpan? difference = (Subject - nearbyTime)?.Duration(); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:the date and time} to be within {0} from {1}{reason}", precision, nearbyTime) - .ForCondition(Subject is not null) - .FailWith(", but found .") - .Then - .ForCondition(Subject >= minimumValue && Subject <= maximumValue) - .FailWith(", but {0} was off by {1}.", Subject, difference) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:the date and time} to be within {0} from {1}{reason}", precision, nearbyTime, + chain => chain + .ForCondition(Subject is not null) + .FailWith(", but found .") + .Then + .ForCondition(Subject >= minimumValue && Subject <= maximumValue) + .FailWith(", but {0} was off by {1}.", Subject, difference)); return new AndConstraint((TAssertions)this); } @@ -359,7 +352,7 @@ public AndConstraint NotBeCloseTo(DateTimeOffset distantTime, TimeS long distanceToMaxInTicks = (DateTimeOffset.MaxValue - distantTime).Ticks; DateTimeOffset maximumValue = distantTime.AddTicks(Math.Min(precision.Ticks, distanceToMaxInTicks)); - Execute.Assertion + assertionChain .ForCondition(Subject < minimumValue || Subject > maximumValue) .BecauseOf(because, becauseArgs) .FailWith( @@ -384,7 +377,7 @@ public AndConstraint NotBeCloseTo(DateTimeOffset distantTime, TimeS public AndConstraint BeBefore(DateTimeOffset expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject < expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the date and time} to be before {0}{reason}, but it was {1}.", expected, @@ -424,7 +417,7 @@ public AndConstraint NotBeBefore(DateTimeOffset unexpected, public AndConstraint BeOnOrBefore(DateTimeOffset expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject <= expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the date and time} to be on or before {0}{reason}, but it was {1}.", expected, @@ -464,7 +457,7 @@ public AndConstraint NotBeOnOrBefore(DateTimeOffset unexpected, public AndConstraint BeAfter(DateTimeOffset expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject > expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the date and time} to be after {0}{reason}, but it was {1}.", expected, @@ -504,7 +497,7 @@ public AndConstraint NotBeAfter(DateTimeOffset unexpected, public AndConstraint BeOnOrAfter(DateTimeOffset expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject >= expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the date and time} to be on or after {0}{reason}, but it was {1}.", expected, @@ -544,16 +537,14 @@ public AndConstraint NotBeOnOrAfter(DateTimeOffset unexpected, public AndConstraint HaveYear(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the year part of {context:the date} to be {0}{reason}, ", expected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.Year == expected) - .FailWith("but it was {0}.", Subject.Value.Year) - .Then - .ClearExpectation(); + .WithExpectation("Expected the year part of {context:the date} to be {0}{reason}, ", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Year == expected) + .FailWith("but it was {0}.", Subject.Value.Year)); return new AndConstraint((TAssertions)this); } @@ -572,16 +563,14 @@ public AndConstraint HaveYear(int expected, public AndConstraint NotHaveYear(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the year part of {context:the date} to be {0}{reason}, ", unexpected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.Year != unexpected) - .FailWith("but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the year part of {context:the date} to be {0}{reason}, ", unexpected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Year != unexpected) + .FailWith("but it was.")); return new AndConstraint((TAssertions)this); } @@ -600,16 +589,14 @@ public AndConstraint NotHaveYear(int unexpected, public AndConstraint HaveMonth(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the month part of {context:the date} to be {0}{reason}, ", expected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.Month == expected) - .FailWith("but it was {0}.", Subject.Value.Month) - .Then - .ClearExpectation(); + .WithExpectation("Expected the month part of {context:the date} to be {0}{reason}, ", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Month == expected) + .FailWith("but it was {0}.", Subject.Value.Month)); return new AndConstraint((TAssertions)this); } @@ -628,16 +615,14 @@ public AndConstraint HaveMonth(int expected, public AndConstraint NotHaveMonth(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the month part of {context:the date} to be {0}{reason}, ", unexpected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.Month != unexpected) - .FailWith("but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the month part of {context:the date} to be {0}{reason}, ", unexpected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Month != unexpected) + .FailWith("but it was.")); return new AndConstraint((TAssertions)this); } @@ -656,16 +641,14 @@ public AndConstraint NotHaveMonth(int unexpected, public AndConstraint HaveDay(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the day part of {context:the date} to be {0}{reason}, ", expected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.Day == expected) - .FailWith("but it was {0}.", Subject.Value.Day) - .Then - .ClearExpectation(); + .WithExpectation("Expected the day part of {context:the date} to be {0}{reason}, ", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Day == expected) + .FailWith("but it was {0}.", Subject.Value.Day)); return new AndConstraint((TAssertions)this); } @@ -684,16 +667,14 @@ public AndConstraint HaveDay(int expected, public AndConstraint NotHaveDay(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the day part of {context:the date} to be {0}{reason}, ", unexpected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.Day != unexpected) - .FailWith("but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the day part of {context:the date} to be {0}{reason}, ", unexpected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Day != unexpected) + .FailWith("but it was.")); return new AndConstraint((TAssertions)this); } @@ -712,16 +693,14 @@ public AndConstraint NotHaveDay(int unexpected, public AndConstraint HaveHour(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the hour part of {context:the time} to be {0}{reason}, ", expected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.Hour == expected) - .FailWith("but it was {0}.", Subject.Value.Hour) - .Then - .ClearExpectation(); + .WithExpectation("Expected the hour part of {context:the time} to be {0}{reason}, ", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Hour == expected) + .FailWith("but it was {0}.", Subject.Value.Hour)); return new AndConstraint((TAssertions)this); } @@ -740,16 +719,14 @@ public AndConstraint HaveHour(int expected, public AndConstraint NotHaveHour(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the hour part of {context:the time} to be {0}{reason}, ", unexpected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.Hour != unexpected) - .FailWith("but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the hour part of {context:the time} to be {0}{reason}, ", unexpected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Hour != unexpected) + .FailWith("but it was.")); return new AndConstraint((TAssertions)this); } @@ -768,16 +745,14 @@ public AndConstraint NotHaveHour(int unexpected, public AndConstraint HaveMinute(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the minute part of {context:the time} to be {0}{reason}, ", expected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.Minute == expected) - .FailWith("but it was {0}.", Subject.Value.Minute) - .Then - .ClearExpectation(); + .WithExpectation("Expected the minute part of {context:the time} to be {0}{reason}, ", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Minute == expected) + .FailWith("but it was {0}.", Subject.Value.Minute)); return new AndConstraint((TAssertions)this); } @@ -796,16 +771,15 @@ public AndConstraint HaveMinute(int expected, public AndConstraint NotHaveMinute(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the minute part of {context:the time} to be {0}{reason}, ", unexpected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.Minute != unexpected) - .FailWith("but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the minute part of {context:the time} to be {0}{reason}, ", unexpected, + chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Minute != unexpected) + .FailWith("but it was.")); return new AndConstraint((TAssertions)this); } @@ -824,16 +798,14 @@ public AndConstraint NotHaveMinute(int unexpected, public AndConstraint HaveSecond(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the seconds part of {context:the time} to be {0}{reason}, ", expected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.Second == expected) - .FailWith("but it was {0}.", Subject.Value.Second) - .Then - .ClearExpectation(); + .WithExpectation("Expected the seconds part of {context:the time} to be {0}{reason}, ", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Second == expected) + .FailWith("but it was {0}.", Subject.Value.Second)); return new AndConstraint((TAssertions)this); } @@ -852,16 +824,15 @@ public AndConstraint HaveSecond(int expected, public AndConstraint NotHaveSecond(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the seconds part of {context:the time} to be {0}{reason}, ", unexpected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.Second != unexpected) - .FailWith("but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the seconds part of {context:the time} to be {0}{reason}, ", unexpected, + chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Second != unexpected) + .FailWith("but it was.")); return new AndConstraint((TAssertions)this); } @@ -880,16 +851,14 @@ public AndConstraint NotHaveSecond(int unexpected, public AndConstraint HaveOffset(TimeSpan expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the offset of {context:the date} to be {0}{reason}, ", expected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.Offset == expected) - .FailWith("but it was {0}.", Subject.Value.Offset) - .Then - .ClearExpectation(); + .WithExpectation("Expected the offset of {context:the date} to be {0}{reason}, ", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Offset == expected) + .FailWith("but it was {0}.", Subject.Value.Offset)); return new AndConstraint((TAssertions)this); } @@ -908,16 +877,14 @@ public AndConstraint HaveOffset(TimeSpan expected, public AndConstraint NotHaveOffset(TimeSpan unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the offset of {context:the date} to be {0}{reason}, ", unexpected) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.Offset != unexpected) - .FailWith("but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the offset of {context:the date} to be {0}{reason}, ", unexpected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Offset != unexpected) + .FailWith("but it was.")); return new AndConstraint((TAssertions)this); } @@ -931,7 +898,8 @@ public AndConstraint NotHaveOffset(TimeSpan unexpected, /// public DateTimeOffsetRangeAssertions BeMoreThan(TimeSpan timeSpan) { - return new DateTimeOffsetRangeAssertions((TAssertions)this, Subject, TimeSpanCondition.MoreThan, timeSpan); + return new DateTimeOffsetRangeAssertions((TAssertions)this, assertionChain, Subject, + TimeSpanCondition.MoreThan, timeSpan); } /// @@ -944,7 +912,8 @@ public DateTimeOffsetRangeAssertions BeMoreThan(TimeSpan timeSpan) /// public DateTimeOffsetRangeAssertions BeAtLeast(TimeSpan timeSpan) { - return new DateTimeOffsetRangeAssertions((TAssertions)this, Subject, TimeSpanCondition.AtLeast, timeSpan); + return new DateTimeOffsetRangeAssertions((TAssertions)this, assertionChain, Subject, + TimeSpanCondition.AtLeast, timeSpan); } /// @@ -956,7 +925,8 @@ public DateTimeOffsetRangeAssertions BeAtLeast(TimeSpan timeSpan) /// public DateTimeOffsetRangeAssertions BeExactly(TimeSpan timeSpan) { - return new DateTimeOffsetRangeAssertions((TAssertions)this, Subject, TimeSpanCondition.Exactly, timeSpan); + return new DateTimeOffsetRangeAssertions((TAssertions)this, assertionChain, Subject, + TimeSpanCondition.Exactly, timeSpan); } /// @@ -968,7 +938,8 @@ public DateTimeOffsetRangeAssertions BeExactly(TimeSpan timeSpan) /// public DateTimeOffsetRangeAssertions BeWithin(TimeSpan timeSpan) { - return new DateTimeOffsetRangeAssertions((TAssertions)this, Subject, TimeSpanCondition.Within, timeSpan); + return new DateTimeOffsetRangeAssertions((TAssertions)this, assertionChain, Subject, + TimeSpanCondition.Within, timeSpan); } /// @@ -980,7 +951,8 @@ public DateTimeOffsetRangeAssertions BeWithin(TimeSpan timeSpan) /// public DateTimeOffsetRangeAssertions BeLessThan(TimeSpan timeSpan) { - return new DateTimeOffsetRangeAssertions((TAssertions)this, Subject, TimeSpanCondition.LessThan, timeSpan); + return new DateTimeOffsetRangeAssertions((TAssertions)this, assertionChain, Subject, + TimeSpanCondition.LessThan, timeSpan); } /// @@ -999,16 +971,15 @@ public AndConstraint BeSameDateAs(DateTimeOffset expected, { DateTime expectedDate = expected.Date; - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the date part of {context:the date and time} to be {0}{reason}, ", expectedDate) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.", expectedDate) - .Then - .ForCondition(Subject.Value.Date == expectedDate) - .FailWith("but it was {0}.", Subject.Value.Date) - .Then - .ClearExpectation(); + .WithExpectation("Expected the date part of {context:the date and time} to be {0}{reason}, ", expectedDate, + chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.", expectedDate) + .Then + .ForCondition(Subject.Value.Date == expectedDate) + .FailWith("but it was {0}.", Subject.Value.Date)); return new AndConstraint((TAssertions)this); } @@ -1029,16 +1000,15 @@ public AndConstraint NotBeSameDateAs(DateTimeOffset unexpected, { DateTime unexpectedDate = unexpected.Date; - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the date part of {context:the date and time} to be {0}{reason}, ", unexpectedDate) - .ForCondition(Subject.HasValue) - .FailWith("but found a DateTimeOffset.") - .Then - .ForCondition(Subject.Value.Date != unexpectedDate) - .FailWith("but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the date part of {context:the date and time} to be {0}{reason}, ", unexpectedDate, + chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Date != unexpectedDate) + .FailWith("but it was.")); return new AndConstraint((TAssertions)this); } @@ -1100,7 +1070,7 @@ public AndConstraint BeOneOf(IEnumerable validValue public AndConstraint BeOneOf(IEnumerable validValues, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(validValues.Contains(Subject)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the date and time} to be one of {0}{reason}, but it was {1}.", validValues, Subject); diff --git a/Src/FluentAssertions/Primitives/DateTimeOffsetRangeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeOffsetRangeAssertions.cs index deea7a999e..964b73c9db 100644 --- a/Src/FluentAssertions/Primitives/DateTimeOffsetRangeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeOffsetRangeAssertions.cs @@ -23,6 +23,7 @@ public class DateTimeOffsetRangeAssertions #region Private Definitions private readonly TAssertions parentAssertions; + private readonly AssertionChain assertionChain; private readonly TimeSpanPredicate predicate; private readonly Dictionary predicates = new() @@ -39,11 +40,13 @@ public class DateTimeOffsetRangeAssertions #endregion - protected internal DateTimeOffsetRangeAssertions(TAssertions parentAssertions, DateTimeOffset? subject, + protected internal DateTimeOffsetRangeAssertions(TAssertions parentAssertions, AssertionChain assertionChain, + DateTimeOffset? subject, TimeSpanCondition condition, TimeSpan timeSpan) { this.parentAssertions = parentAssertions; + this.assertionChain = assertionChain; this.subject = subject; this.timeSpan = timeSpan; @@ -66,17 +69,17 @@ protected internal DateTimeOffsetRangeAssertions(TAssertions parentAssertions, D public AndConstraint Before(DateTimeOffset target, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the date and time} to be " + predicate.DisplayText + " {0} before {1}{reason}, but found a DateTime.", timeSpan, target); - if (success) + if (assertionChain.Succeeded) { TimeSpan actual = target - subject.Value; - Execute.Assertion + assertionChain .ForCondition(predicate.IsMatchedBy(actual, timeSpan)) .BecauseOf(because, becauseArgs) .FailWith( @@ -104,17 +107,17 @@ public AndConstraint Before(DateTimeOffset target, public AndConstraint After(DateTimeOffset target, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the date and time} to be " + predicate.DisplayText + " {0} after {1}{reason}, but found a DateTime.", timeSpan, target); - if (success) + if (assertionChain.Succeeded) { TimeSpan actual = subject.Value - target; - Execute.Assertion + assertionChain .ForCondition(predicate.IsMatchedBy(actual, timeSpan)) .BecauseOf(because, becauseArgs) .FailWith( diff --git a/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs index c6976b51bc..6192cfa16b 100644 --- a/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs @@ -23,6 +23,7 @@ public class DateTimeRangeAssertions #region Private Definitions private readonly TAssertions parentAssertions; + private readonly AssertionChain assertionChain; private readonly TimeSpanPredicate predicate; private readonly Dictionary predicates = new() @@ -39,11 +40,13 @@ public class DateTimeRangeAssertions #endregion - protected internal DateTimeRangeAssertions(TAssertions parentAssertions, DateTime? subject, + protected internal DateTimeRangeAssertions(TAssertions parentAssertions, AssertionChain assertionChain, + DateTime? subject, TimeSpanCondition condition, TimeSpan timeSpan) { this.parentAssertions = parentAssertions; + this.assertionChain = assertionChain; this.subject = subject; this.timeSpan = timeSpan; @@ -66,18 +69,18 @@ protected internal DateTimeRangeAssertions(TAssertions parentAssertions, DateTim public AndConstraint Before(DateTime target, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected date and/or time {0} to be " + predicate.DisplayText + " {1} before {2}{reason}, but found a DateTime.", subject, timeSpan, target); - if (success) + if (assertionChain.Succeeded) { TimeSpan actual = target - subject.Value; - Execute.Assertion + assertionChain .ForCondition(predicate.IsMatchedBy(actual, timeSpan)) .BecauseOf(because, becauseArgs) .FailWith( @@ -105,18 +108,18 @@ public AndConstraint Before(DateTime target, public AndConstraint After(DateTime target, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected date and/or time {0} to be " + predicate.DisplayText + " {1} after {2}{reason}, but found a DateTime.", subject, timeSpan, target); - if (success) + if (assertionChain.Succeeded) { TimeSpan actual = subject.Value - target; - Execute.Assertion + assertionChain .ForCondition(predicate.IsMatchedBy(actual, timeSpan)) .BecauseOf(because, becauseArgs) .FailWith( diff --git a/Src/FluentAssertions/Primitives/EnumAssertions.cs b/Src/FluentAssertions/Primitives/EnumAssertions.cs index 69d8b110ef..b740b3c7d3 100644 --- a/Src/FluentAssertions/Primitives/EnumAssertions.cs +++ b/Src/FluentAssertions/Primitives/EnumAssertions.cs @@ -15,8 +15,8 @@ namespace FluentAssertions.Primitives; public class EnumAssertions : EnumAssertions> where TEnum : struct, Enum { - public EnumAssertions(TEnum subject) - : base(subject) + public EnumAssertions(TEnum subject, AssertionChain assertionChain) + : base(subject, assertionChain) { } } @@ -30,13 +30,16 @@ public class EnumAssertions where TEnum : struct, Enum where TAssertions : EnumAssertions { - public EnumAssertions(TEnum subject) - : this((TEnum?)subject) + private readonly AssertionChain assertionChain; + + public EnumAssertions(TEnum subject, AssertionChain assertionChain) + : this((TEnum?)subject, assertionChain) { } - private protected EnumAssertions(TEnum? value) + private protected EnumAssertions(TEnum? value, AssertionChain assertionChain) { + this.assertionChain = assertionChain; Subject = value; } @@ -56,7 +59,7 @@ private protected EnumAssertions(TEnum? value) public AndConstraint Be(TEnum expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject?.Equals(expected) == true) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the enum} to be {0}{reason}, but found {1}.", @@ -79,7 +82,7 @@ public AndConstraint Be(TEnum expected, public AndConstraint Be(TEnum? expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Nullable.Equals(Subject, expected)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the enum} to be {0}{reason}, but found {1}.", @@ -102,7 +105,7 @@ public AndConstraint Be(TEnum? expected, public AndConstraint NotBe(TEnum unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject?.Equals(unexpected) != true) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the enum} not to be {0}{reason}, but it is.", unexpected); @@ -124,7 +127,7 @@ public AndConstraint NotBe(TEnum unexpected, public AndConstraint NotBe(TEnum? unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!Nullable.Equals(Subject, unexpected)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the enum} not to be {0}{reason}, but it is.", unexpected); @@ -142,18 +145,17 @@ public AndConstraint NotBe(TEnum? unexpected, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeDefined([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint BeDefined([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:the enum} to be defined in {0}{reason}, ", typeof(TEnum)) - .ForCondition(Subject is not null) - .FailWith("but found .") - .Then - .ForCondition(Enum.IsDefined(typeof(TEnum), Subject)) - .FailWith("but it is not.") - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:the enum} to be defined in {0}{reason}, ", typeof(TEnum), chain => chain + .ForCondition(Subject is not null) + .FailWith("but found .") + .Then + .ForCondition(Enum.IsDefined(typeof(TEnum), Subject)) + .FailWith("but it is not.")); return new AndConstraint((TAssertions)this); } @@ -168,18 +170,17 @@ public AndConstraint BeDefined([StringSyntax("CompositeFormat")] st /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeDefined([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotBeDefined([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect {context:the enum} to be defined in {0}{reason}, ", typeof(TEnum)) - .ForCondition(Subject is not null) - .FailWith("but found .") - .Then - .ForCondition(!Enum.IsDefined(typeof(TEnum), Subject)) - .FailWith("but it is.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect {context:the enum} to be defined in {0}{reason}, ", typeof(TEnum), chain => chain + .ForCondition(Subject is not null) + .FailWith("but found .") + .Then + .ForCondition(!Enum.IsDefined(typeof(TEnum), Subject)) + .FailWith("but it is.")); return new AndConstraint((TAssertions)this); } @@ -198,7 +199,7 @@ public AndConstraint NotBeDefined([StringSyntax("CompositeFormat")] public AndConstraint HaveValue(decimal expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject is { } value && GetValue(value) == expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the enum} to have value {0}{reason}, but found {1}.", @@ -221,7 +222,7 @@ public AndConstraint HaveValue(decimal expected, public AndConstraint NotHaveValue(decimal unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!(Subject is { } value && GetValue(value) == unexpected)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the enum} to not have value {0}{reason}, but found {1}.", @@ -245,7 +246,7 @@ public AndConstraint HaveSameValueAs(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where T : struct, Enum { - Execute.Assertion + assertionChain .ForCondition(Subject is { } value && GetValue(value) == GetValue(expected)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the enum} to have same value as {0}{reason}, but found {1}.", @@ -269,7 +270,7 @@ public AndConstraint NotHaveSameValueAs(T unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where T : struct, Enum { - Execute.Assertion + assertionChain .ForCondition(!(Subject is { } value && GetValue(value) == GetValue(unexpected))) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the enum} to not have same value as {0}{reason}, but found {1}.", @@ -293,7 +294,7 @@ public AndConstraint HaveSameNameAs(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where T : struct, Enum { - Execute.Assertion + assertionChain .ForCondition(Subject is { } value && GetName(value) == GetName(expected)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the enum} to have same name as {0}{reason}, but found {1}.", @@ -317,7 +318,7 @@ public AndConstraint NotHaveSameNameAs(T unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where T : struct, Enum { - Execute.Assertion + assertionChain .ForCondition(!(Subject is { } value && GetName(value) == GetName(unexpected))) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the enum} to not have same name as {0}{reason}, but found {1}.", @@ -340,7 +341,7 @@ public AndConstraint NotHaveSameNameAs(T unexpected, public AndConstraint HaveFlag(TEnum expectedFlag, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject?.HasFlag(expectedFlag) == true) .FailWith("Expected {context:the enum} to have flag {0}{reason}, but found {1}.", expectedFlag, Subject); @@ -362,7 +363,7 @@ public AndConstraint HaveFlag(TEnum expectedFlag, public AndConstraint NotHaveFlag(TEnum unexpectedFlag, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject?.HasFlag(unexpectedFlag) != true) .FailWith("Expected {context:the enum} to not have flag {0}{reason}.", unexpectedFlag); @@ -389,7 +390,7 @@ public AndConstraint Match(Expression> predicate { Guard.ThrowIfArgumentIsNull(predicate, nameof(predicate), "Cannot match an enum against a predicate."); - Execute.Assertion + assertionChain .ForCondition(predicate.Compile()(Subject)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:the enum} to match {1}{reason}, but found {0}.", Subject, predicate.Body); @@ -432,7 +433,7 @@ public AndConstraint BeOneOf(IEnumerable validValues, Guard.ThrowIfArgumentIsEmpty(validValues, nameof(validValues), "Cannot assert that an enum is one of an empty list of enums"); - Execute.Assertion + assertionChain .ForCondition(Subject is not null) .FailWith("Expected {context:the enum} to be one of {0}{reason}, but found ", validValues) .Then diff --git a/Src/FluentAssertions/Primitives/GuidAssertions.cs b/Src/FluentAssertions/Primitives/GuidAssertions.cs index 648faa7964..d30fe808df 100644 --- a/Src/FluentAssertions/Primitives/GuidAssertions.cs +++ b/Src/FluentAssertions/Primitives/GuidAssertions.cs @@ -11,8 +11,8 @@ namespace FluentAssertions.Primitives; [DebuggerNonUserCode] public class GuidAssertions : GuidAssertions { - public GuidAssertions(Guid? value) - : base(value) + public GuidAssertions(Guid? value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -26,8 +26,11 @@ public GuidAssertions(Guid? value) public class GuidAssertions where TAssertions : GuidAssertions { - public GuidAssertions(Guid? value) + private readonly AssertionChain assertionChain; + + public GuidAssertions(Guid? value, AssertionChain assertionChain) { + this.assertionChain = assertionChain; Subject = value; } @@ -50,7 +53,7 @@ public GuidAssertions(Guid? value) /// public AndConstraint BeEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject == Guid.Empty) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:Guid} to be empty{reason}, but found {0}.", Subject); @@ -70,7 +73,7 @@ public AndConstraint BeEmpty([StringSyntax("CompositeFormat")] stri /// public AndConstraint NotBeEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject is { } value && value != Guid.Empty) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:Guid} to be empty{reason}."); @@ -119,7 +122,7 @@ public AndConstraint Be(string expected, public AndConstraint Be(Guid expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject == expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:Guid} to be {0}{reason}, but found {1}.", expected, Subject); @@ -164,7 +167,7 @@ public AndConstraint NotBe(string unexpected, public AndConstraint NotBe(Guid unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject != unexpected) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:Guid} to be {0}{reason}.", Subject); diff --git a/Src/FluentAssertions/Primitives/HttpResponseMessageAssertions.cs b/Src/FluentAssertions/Primitives/HttpResponseMessageAssertions.cs index f688e7a32f..e483ac43b7 100644 --- a/Src/FluentAssertions/Primitives/HttpResponseMessageAssertions.cs +++ b/Src/FluentAssertions/Primitives/HttpResponseMessageAssertions.cs @@ -12,8 +12,8 @@ namespace FluentAssertions.Primitives; [DebuggerNonUserCode] public class HttpResponseMessageAssertions : HttpResponseMessageAssertions { - public HttpResponseMessageAssertions(HttpResponseMessage value) - : base(value) + public HttpResponseMessageAssertions(HttpResponseMessage value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -25,9 +25,12 @@ public HttpResponseMessageAssertions(HttpResponseMessage value) public class HttpResponseMessageAssertions : ObjectAssertions where TAssertions : HttpResponseMessageAssertions { - protected HttpResponseMessageAssertions(HttpResponseMessage value) - : base(value) + private readonly AssertionChain assertionChain; + + protected HttpResponseMessageAssertions(HttpResponseMessage value, AssertionChain assertionChain) + : base(value, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -42,14 +45,14 @@ protected HttpResponseMessageAssertions(HttpResponseMessage value) /// public AndConstraint BeSuccessful([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - var success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected HttpStatusCode to be successful (2xx){reason}, but HttpResponseMessage was ."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(Subject!.IsSuccessStatusCode) .BecauseOf(because, becauseArgs) .FailWith("Expected HttpStatusCode to be successful (2xx){reason}, but found {0}.", Subject.StatusCode); @@ -70,14 +73,14 @@ public AndConstraint BeSuccessful([StringSyntax("CompositeFormat")] /// public AndConstraint BeRedirection([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - var success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected HttpStatusCode to be redirection (3xx){reason}, but HttpResponseMessage was ."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition((int)Subject!.StatusCode is >= 300 and <= 399) .BecauseOf(because, becauseArgs) .FailWith("Expected HttpStatusCode to be redirection (3xx){reason}, but found {0}.", Subject.StatusCode); @@ -98,14 +101,14 @@ public AndConstraint BeRedirection([StringSyntax("CompositeFormat") /// public AndConstraint HaveError([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - var success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected HttpStatusCode to be an error{reason}, but HttpResponseMessage was ."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(IsClientError() || IsServerError()) .BecauseOf(because, becauseArgs) .FailWith("Expected HttpStatusCode to be an error{reason}, but found {0}.", Subject.StatusCode); @@ -126,14 +129,14 @@ public AndConstraint HaveError([StringSyntax("CompositeFormat")] st /// public AndConstraint HaveClientError([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - var success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected HttpStatusCode to be client error (4xx){reason}, but HttpResponseMessage was ."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(IsClientError()) .BecauseOf(because, becauseArgs) .FailWith("Expected HttpStatusCode to be client error (4xx){reason}, but found {0}.", Subject.StatusCode); @@ -154,14 +157,14 @@ public AndConstraint HaveClientError([StringSyntax("CompositeFormat /// public AndConstraint HaveServerError([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - var success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected HttpStatusCode to be server error (5xx){reason}, but HttpResponseMessage was ."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(IsServerError()) .BecauseOf(because, becauseArgs) .FailWith("Expected HttpStatusCode to be server error (5xx){reason}, but found {0}.", Subject.StatusCode); @@ -184,14 +187,14 @@ public AndConstraint HaveServerError([StringSyntax("CompositeFormat public AndConstraint HaveStatusCode(HttpStatusCode expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - var success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected HttpStatusCode to be {0}{reason}, but HttpResponseMessage was .", expected); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(Subject!.StatusCode == expected) .BecauseOf(because, becauseArgs) .FailWith("Expected HttpStatusCode to be {0}{reason}, but found {1}.", expected, Subject.StatusCode); @@ -214,14 +217,14 @@ public AndConstraint HaveStatusCode(HttpStatusCode expected, public AndConstraint NotHaveStatusCode(HttpStatusCode unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - var success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected HttpStatusCode not to be {0}{reason}, but HttpResponseMessage was .", unexpected); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(Subject!.StatusCode != unexpected) .BecauseOf(because, becauseArgs) .FailWith("Expected HttpStatusCode not to be {0}{reason}, but found {1}.", unexpected, Subject.StatusCode); diff --git a/Src/FluentAssertions/Primitives/IStringComparisonStrategy.cs b/Src/FluentAssertions/Primitives/IStringComparisonStrategy.cs index da95c7ccbb..6dffb8b1f4 100644 --- a/Src/FluentAssertions/Primitives/IStringComparisonStrategy.cs +++ b/Src/FluentAssertions/Primitives/IStringComparisonStrategy.cs @@ -15,5 +15,5 @@ internal interface IStringComparisonStrategy /// /// Asserts that the matches the value. /// - void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected); + void ValidateAgainstMismatch(AssertionChain assertionChain, string subject, string expected); } diff --git a/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs b/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs index 6b5954d946..0a856363fa 100644 --- a/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs @@ -10,8 +10,8 @@ namespace FluentAssertions.Primitives; [DebuggerNonUserCode] public class NullableBooleanAssertions : NullableBooleanAssertions { - public NullableBooleanAssertions(bool? value) - : base(value) + public NullableBooleanAssertions(bool? value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -23,9 +23,12 @@ public NullableBooleanAssertions(bool? value) public class NullableBooleanAssertions : BooleanAssertions where TAssertions : NullableBooleanAssertions { - public NullableBooleanAssertions(bool? value) - : base(value) + private readonly AssertionChain assertionChain; + + public NullableBooleanAssertions(bool? value, AssertionChain assertionChain) + : base(value, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -40,7 +43,7 @@ public NullableBooleanAssertions(bool? value) /// public AndConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected a value{reason}."); @@ -75,7 +78,7 @@ public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] st /// public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Did not expect a value{reason}, but found {0}.", Subject); @@ -112,7 +115,7 @@ public AndConstraint BeNull([StringSyntax("CompositeFormat")] strin public AndConstraint Be(bool? expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject == expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {0}{reason}, but found {1}.", expected, Subject); @@ -134,7 +137,7 @@ public AndConstraint Be(bool? expected, public AndConstraint NotBe(bool? unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject != unexpected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:nullable boolean} not to be {0}{reason}, but found {1}.", unexpected, Subject); @@ -154,7 +157,7 @@ public AndConstraint NotBe(bool? unexpected, /// public AndConstraint NotBeFalse([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject is not false) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:nullable boolean} not to be {0}{reason}, but found {1}.", false, Subject); @@ -174,7 +177,7 @@ public AndConstraint NotBeFalse([StringSyntax("CompositeFormat")] s /// public AndConstraint NotBeTrue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject is not true) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:nullable boolean} not to be {0}{reason}, but found {1}.", true, Subject); diff --git a/Src/FluentAssertions/Primitives/NullableDateOnlyAssertions.cs b/Src/FluentAssertions/Primitives/NullableDateOnlyAssertions.cs index b4733fbf01..ecdde62a34 100644 --- a/Src/FluentAssertions/Primitives/NullableDateOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableDateOnlyAssertions.cs @@ -13,8 +13,8 @@ namespace FluentAssertions.Primitives; [DebuggerNonUserCode] public class NullableDateOnlyAssertions : NullableDateOnlyAssertions { - public NullableDateOnlyAssertions(DateOnly? value) - : base(value) + public NullableDateOnlyAssertions(DateOnly? value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -26,9 +26,12 @@ public NullableDateOnlyAssertions(DateOnly? value) public class NullableDateOnlyAssertions : DateOnlyAssertions where TAssertions : NullableDateOnlyAssertions { - public NullableDateOnlyAssertions(DateOnly? value) - : base(value) + private readonly AssertionChain assertionChain; + + public NullableDateOnlyAssertions(DateOnly? value, AssertionChain assertionChain) + : base(value, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -43,7 +46,7 @@ public NullableDateOnlyAssertions(DateOnly? value) /// public AndConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:nullable date} to have a value{reason}, but found {0}.", Subject); @@ -78,7 +81,7 @@ public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] st /// public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:nullable date} to have a value{reason}, but found {0}.", Subject); diff --git a/Src/FluentAssertions/Primitives/NullableDateTimeAssertions.cs b/Src/FluentAssertions/Primitives/NullableDateTimeAssertions.cs index 2f897eeaa0..d7b8f1bc13 100644 --- a/Src/FluentAssertions/Primitives/NullableDateTimeAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableDateTimeAssertions.cs @@ -15,8 +15,8 @@ namespace FluentAssertions.Primitives; [DebuggerNonUserCode] public class NullableDateTimeAssertions : NullableDateTimeAssertions { - public NullableDateTimeAssertions(DateTime? expected) - : base(expected) + public NullableDateTimeAssertions(DateTime? expected, AssertionChain assertionChain) + : base(expected, assertionChain) { } } @@ -31,9 +31,12 @@ public NullableDateTimeAssertions(DateTime? expected) public class NullableDateTimeAssertions : DateTimeAssertions where TAssertions : NullableDateTimeAssertions { - public NullableDateTimeAssertions(DateTime? expected) - : base(expected) + private readonly AssertionChain assertionChain; + + public NullableDateTimeAssertions(DateTime? expected, AssertionChain assertionChain) + : base(expected, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -48,7 +51,7 @@ public NullableDateTimeAssertions(DateTime? expected) /// public AndConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:nullable date and time} to have a value{reason}, but found {0}.", Subject); @@ -83,7 +86,7 @@ public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] st /// public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:nullable date and time} to have a value{reason}, but found {0}.", Subject); diff --git a/Src/FluentAssertions/Primitives/NullableDateTimeOffsetAssertions.cs b/Src/FluentAssertions/Primitives/NullableDateTimeOffsetAssertions.cs index 48553d4ada..3508fb2f36 100644 --- a/Src/FluentAssertions/Primitives/NullableDateTimeOffsetAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableDateTimeOffsetAssertions.cs @@ -15,8 +15,8 @@ namespace FluentAssertions.Primitives; [DebuggerNonUserCode] public class NullableDateTimeOffsetAssertions : NullableDateTimeOffsetAssertions { - public NullableDateTimeOffsetAssertions(DateTimeOffset? expected) - : base(expected) + public NullableDateTimeOffsetAssertions(DateTimeOffset? expected, AssertionChain assertionChain) + : base(expected, assertionChain) { } } @@ -32,9 +32,12 @@ public NullableDateTimeOffsetAssertions(DateTimeOffset? expected) public class NullableDateTimeOffsetAssertions : DateTimeOffsetAssertions where TAssertions : NullableDateTimeOffsetAssertions { - public NullableDateTimeOffsetAssertions(DateTimeOffset? expected) - : base(expected) + private readonly AssertionChain assertionChain; + + public NullableDateTimeOffsetAssertions(DateTimeOffset? expected, AssertionChain assertionChain) + : base(expected, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -49,7 +52,7 @@ public NullableDateTimeOffsetAssertions(DateTimeOffset? expected) /// public AndConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:variable} to have a value{reason}, but found {0}", Subject); @@ -85,7 +88,7 @@ public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] st public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:variable} to have a value{reason}, but found {0}", Subject); diff --git a/Src/FluentAssertions/Primitives/NullableEnumAssertions.cs b/Src/FluentAssertions/Primitives/NullableEnumAssertions.cs index 85f2ce95e6..7096c1ab53 100644 --- a/Src/FluentAssertions/Primitives/NullableEnumAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableEnumAssertions.cs @@ -10,8 +10,8 @@ namespace FluentAssertions.Primitives; public class NullableEnumAssertions : NullableEnumAssertions> where TEnum : struct, Enum { - public NullableEnumAssertions(TEnum? subject) - : base(subject) + public NullableEnumAssertions(TEnum? subject, AssertionChain assertionChain) + : base(subject, assertionChain) { } } @@ -23,9 +23,12 @@ public class NullableEnumAssertions : EnumAssertions { - public NullableEnumAssertions(TEnum? subject) - : base(subject) + private readonly AssertionChain assertionChain; + + public NullableEnumAssertions(TEnum? subject, AssertionChain assertionChain) + : base(subject, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -40,12 +43,12 @@ public NullableEnumAssertions(TEnum? subject) /// public AndWhichConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:nullable enum} to have a value{reason}, but found {0}.", Subject); - return new AndWhichConstraint((TAssertions)this, Subject.GetValueOrDefault()); + return new AndWhichConstraint((TAssertions)this, Subject.GetValueOrDefault(), assertionChain, ".Value"); } /// @@ -75,7 +78,7 @@ public AndWhichConstraint NotBeNull([StringSyntax("Composite /// public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:nullable enum} to have a value{reason}, but found {0}.", Subject); diff --git a/Src/FluentAssertions/Primitives/NullableGuidAssertions.cs b/Src/FluentAssertions/Primitives/NullableGuidAssertions.cs index 45c26f7915..1eea1e758b 100644 --- a/Src/FluentAssertions/Primitives/NullableGuidAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableGuidAssertions.cs @@ -11,8 +11,8 @@ namespace FluentAssertions.Primitives; [DebuggerNonUserCode] public class NullableGuidAssertions : NullableGuidAssertions { - public NullableGuidAssertions(Guid? value) - : base(value) + public NullableGuidAssertions(Guid? value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -24,9 +24,12 @@ public NullableGuidAssertions(Guid? value) public class NullableGuidAssertions : GuidAssertions where TAssertions : NullableGuidAssertions { - public NullableGuidAssertions(Guid? value) - : base(value) + private readonly AssertionChain assertionChain; + + public NullableGuidAssertions(Guid? value, AssertionChain assertionChain) + : base(value, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -41,7 +44,7 @@ public NullableGuidAssertions(Guid? value) /// public AndConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected a value{reason}."); @@ -76,7 +79,7 @@ public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] st /// public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Did not expect a value{reason}, but found {0}.", Subject); @@ -112,7 +115,7 @@ public AndConstraint BeNull([StringSyntax("CompositeFormat")] strin /// public AndConstraint Be(Guid? expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject == expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:Guid} to be {0}{reason}, but found {1}.", expected, Subject); diff --git a/Src/FluentAssertions/Primitives/NullableSimpleTimeSpanAssertions.cs b/Src/FluentAssertions/Primitives/NullableSimpleTimeSpanAssertions.cs index da52304bd1..03ffb3d9bd 100644 --- a/Src/FluentAssertions/Primitives/NullableSimpleTimeSpanAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableSimpleTimeSpanAssertions.cs @@ -15,8 +15,8 @@ namespace FluentAssertions.Primitives; [DebuggerNonUserCode] public class NullableSimpleTimeSpanAssertions : NullableSimpleTimeSpanAssertions { - public NullableSimpleTimeSpanAssertions(TimeSpan? value) - : base(value) + public NullableSimpleTimeSpanAssertions(TimeSpan? value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -32,9 +32,12 @@ public NullableSimpleTimeSpanAssertions(TimeSpan? value) public class NullableSimpleTimeSpanAssertions : SimpleTimeSpanAssertions where TAssertions : NullableSimpleTimeSpanAssertions { - public NullableSimpleTimeSpanAssertions(TimeSpan? value) - : base(value) + private readonly AssertionChain assertionChain; + + public NullableSimpleTimeSpanAssertions(TimeSpan? value, AssertionChain assertionChain) + : base(value, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -49,7 +52,7 @@ public NullableSimpleTimeSpanAssertions(TimeSpan? value) /// public AndConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected a value{reason}."); @@ -84,7 +87,7 @@ public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] st /// public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Did not expect a value{reason}, but found {0}.", Subject); @@ -121,7 +124,7 @@ public AndConstraint BeNull([StringSyntax("CompositeFormat")] strin public AndConstraint Be(TimeSpan? expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject == expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {0}{reason}, but found {1}.", expected, Subject); diff --git a/Src/FluentAssertions/Primitives/NullableTimeOnlyAssertions.cs b/Src/FluentAssertions/Primitives/NullableTimeOnlyAssertions.cs index d0235efee0..8e6ede5140 100644 --- a/Src/FluentAssertions/Primitives/NullableTimeOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableTimeOnlyAssertions.cs @@ -13,8 +13,8 @@ namespace FluentAssertions.Primitives; [DebuggerNonUserCode] public class NullableTimeOnlyAssertions : NullableTimeOnlyAssertions { - public NullableTimeOnlyAssertions(TimeOnly? value) - : base(value) + public NullableTimeOnlyAssertions(TimeOnly? value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -26,9 +26,12 @@ public NullableTimeOnlyAssertions(TimeOnly? value) public class NullableTimeOnlyAssertions : TimeOnlyAssertions where TAssertions : NullableTimeOnlyAssertions { - public NullableTimeOnlyAssertions(TimeOnly? value) - : base(value) + private readonly AssertionChain assertionChain; + + public NullableTimeOnlyAssertions(TimeOnly? value, AssertionChain assertionChain) + : base(value, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -43,7 +46,7 @@ public NullableTimeOnlyAssertions(TimeOnly? value) /// public AndConstraint HaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:nullable time} to have a value{reason}, but found {0}.", Subject); @@ -78,7 +81,7 @@ public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] st /// public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!Subject.HasValue) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:nullable time} to have a value{reason}, but found {0}.", Subject); diff --git a/Src/FluentAssertions/Primitives/ObjectAssertions.cs b/Src/FluentAssertions/Primitives/ObjectAssertions.cs index d6bdccfab0..9c536c3d66 100644 --- a/Src/FluentAssertions/Primitives/ObjectAssertions.cs +++ b/Src/FluentAssertions/Primitives/ObjectAssertions.cs @@ -13,9 +13,12 @@ namespace FluentAssertions.Primitives; /// public class ObjectAssertions : ObjectAssertions { - public ObjectAssertions(object value) - : base(value) + private readonly AssertionChain assertionChain; + + public ObjectAssertions(object value, AssertionChain assertionChain) + : base(value, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -38,7 +41,7 @@ public AndConstraint Be(TExpectation expected, I { Guard.ThrowIfArgumentIsNull(comparer); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is TExpectation subject && comparer.Equals(subject, expected)) .WithDefaultIdentifier(Identifier) @@ -68,7 +71,7 @@ public AndConstraint NotBe(TExpectation unexpect { Guard.ThrowIfArgumentIsNull(comparer); - Execute.Assertion + assertionChain .ForCondition(Subject is not TExpectation subject || !comparer.Equals(subject, unexpected)) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier(Identifier) @@ -102,7 +105,7 @@ public AndConstraint BeOneOf(IEnumerable BeOneOf(IEnumerable : ReferenceTypeAssertions where TAssertions : ObjectAssertions { - public ObjectAssertions(TSubject value) - : base(value) + private readonly AssertionChain assertionChain; + + public ObjectAssertions(TSubject value, AssertionChain assertionChain) + : base(value, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -138,12 +144,11 @@ public ObjectAssertions(TSubject value) public AndConstraint Be(TSubject expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(ObjectExtensions.GetComparer()(Subject, expected)) .WithDefaultIdentifier(Identifier) - .FailWith("Expected {context} to be {0}{reason}, but found {1}.", expected, - Subject); + .FailWith("Expected {context} to be {0}{reason}, but found {1}.", expected, Subject); return new AndConstraint((TAssertions)this); } @@ -168,7 +173,7 @@ public AndConstraint Be(TSubject expected, IEqualityComparer Be(TSubject expected, IEqualityComparer NotBe(TSubject unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!ObjectExtensions.GetComparer()(Subject, unexpected)) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier(Identifier) @@ -221,7 +226,7 @@ public AndConstraint NotBe(TSubject unexpected, IEqualityComparer BeEquivalentTo(TExpectation expe EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); var context = new EquivalencyValidationContext(Node.From(() => - AssertionScope.Current.CallerIdentity), options) + CurrentAssertionChain.CallerIdentifier), options) { Reason = new Reason(because, becauseArgs), TraceWriter = options.TraceWriter @@ -369,7 +374,7 @@ public AndConstraint NotBeEquivalentTo( hasMismatches = scope.Discard().Length > 0; } - Execute.Assertion + assertionChain .ForCondition(hasMismatches) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier(Identifier) @@ -405,7 +410,7 @@ public AndConstraint BeOneOf(params TSubject[] validValues) public AndConstraint BeOneOf(IEnumerable validValues, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(validValues.Contains(Subject)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:object} to be one of {0}{reason}, but found {1}.", validValues, Subject); @@ -438,7 +443,7 @@ public AndConstraint BeOneOf(IEnumerable validValues, Guard.ThrowIfArgumentIsNull(validValues); Guard.ThrowIfArgumentIsNull(comparer); - Execute.Assertion + assertionChain .ForCondition(validValues.Contains(Subject, comparer)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:object} to be one of {0}{reason}, but found {1}.", validValues, Subject); diff --git a/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs b/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs index 8817613104..cbfe65d6c1 100644 --- a/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs +++ b/Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs @@ -17,8 +17,9 @@ namespace FluentAssertions.Primitives; public abstract class ReferenceTypeAssertions where TAssertions : ReferenceTypeAssertions { - protected ReferenceTypeAssertions(TSubject subject) + protected ReferenceTypeAssertions(TSubject subject, AssertionChain assertionChain) { + CurrentAssertionChain = assertionChain; Subject = subject; } @@ -39,7 +40,7 @@ protected ReferenceTypeAssertions(TSubject subject) /// public AndConstraint BeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + CurrentAssertionChain .ForCondition(Subject is null) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier(Identifier) @@ -58,9 +59,10 @@ public AndConstraint BeNull([StringSyntax("CompositeFormat")] strin /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - Execute.Assertion + CurrentAssertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier(Identifier) @@ -83,7 +85,7 @@ public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] st public AndConstraint BeSameAs(TSubject expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + CurrentAssertionChain .ForCondition(ReferenceEquals(Subject, expected)) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier(Identifier) @@ -106,7 +108,7 @@ public AndConstraint BeSameAs(TSubject expected, public AndConstraint NotBeSameAs(TSubject unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + CurrentAssertionChain .ForCondition(!ReferenceEquals(Subject, unexpected)) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier(Identifier) @@ -126,7 +128,8 @@ public AndConstraint NotBeSameAs(TSubject unexpected, /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint BeOfType([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndWhichConstraint BeOfType([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { BeOfType(typeof(T), because, becauseArgs); @@ -156,13 +159,13 @@ public AndConstraint BeOfType(Type expectedType, { Guard.ThrowIfArgumentIsNull(expectedType); - bool success = Execute.Assertion + CurrentAssertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier("type") .FailWith("Expected {context} to be {0}{reason}, but found .", expectedType); - if (success) + if (CurrentAssertionChain.Succeeded) { Type subjectType = Subject.GetType(); @@ -190,7 +193,8 @@ public AndConstraint BeOfType(Type expectedType, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeOfType([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotBeOfType([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { NotBeOfType(typeof(T), because, becauseArgs); @@ -216,13 +220,13 @@ public AndConstraint NotBeOfType(Type unexpectedType, { Guard.ThrowIfArgumentIsNull(unexpectedType); - bool success = Execute.Assertion + CurrentAssertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier("type") .FailWith("Expected {context} not to be {0}{reason}, but found .", unexpectedType); - if (success) + if (CurrentAssertionChain.Succeeded) { Type subjectType = Subject.GetType(); @@ -250,18 +254,19 @@ public AndConstraint NotBeOfType(Type unexpectedType, /// /// Zero or more objects to format using the placeholders in . /// - /// An which can be used to chain assertions. - public AndWhichConstraint BeAssignableTo([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + /// An which can be used to chain assertions. + public AndWhichConstraint BeAssignableTo([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - bool success = Execute.Assertion + CurrentAssertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier("type") .FailWith("Expected {context} to be assignable to {0}{reason}, but found .", typeof(T)); - if (success) + if (CurrentAssertionChain.Succeeded) { - Execute.Assertion + CurrentAssertionChain .ForCondition(Subject is T) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier(Identifier) @@ -293,19 +298,19 @@ public AndConstraint BeAssignableTo(Type type, { Guard.ThrowIfArgumentIsNull(type); - bool success = Execute.Assertion + CurrentAssertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier("type") .FailWith("Expected {context} to be assignable to {0}{reason}, but found .", type); - if (success) + if (CurrentAssertionChain.Succeeded) { bool isAssignable = type.IsGenericTypeDefinition ? Subject.GetType().IsAssignableToOpenGeneric(type) : type.IsAssignableFrom(Subject.GetType()); - Execute.Assertion + CurrentAssertionChain .ForCondition(isAssignable) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier(Identifier) @@ -329,7 +334,8 @@ public AndConstraint BeAssignableTo(Type type, /// Zero or more objects to format using the placeholders in . /// /// An which can be used to chain assertions. - public AndConstraint NotBeAssignableTo([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotBeAssignableTo([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return NotBeAssignableTo(typeof(T), because, becauseArgs); } @@ -352,19 +358,19 @@ public AndConstraint NotBeAssignableTo(Type type, { Guard.ThrowIfArgumentIsNull(type); - bool success = Execute.Assertion + CurrentAssertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier("type") .FailWith("Expected {context} to not be assignable to {0}{reason}, but found .", type); - if (success) + if (CurrentAssertionChain.Succeeded) { bool isAssignable = type.IsGenericTypeDefinition ? Subject.GetType().IsAssignableToOpenGeneric(type) : type.IsAssignableFrom(Subject.GetType()); - Execute.Assertion + CurrentAssertionChain .ForCondition(!isAssignable) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier(Identifier) @@ -411,7 +417,7 @@ public AndConstraint Match(Expression> predicate, { Guard.ThrowIfArgumentIsNull(predicate, nameof(predicate), "Cannot match an object against a predicate."); - Execute.Assertion + CurrentAssertionChain .ForCondition(predicate.Compile()((T)Subject)) .BecauseOf(because, becauseArgs) .WithDefaultIdentifier(Identifier) @@ -434,16 +440,17 @@ public AndConstraint Satisfy(Action assertion) { Guard.ThrowIfArgumentIsNull(assertion, nameof(assertion), "Cannot verify an object against a inspector."); - var success = Execute.Assertion + CurrentAssertionChain .ForCondition(Subject is not null) .WithDefaultIdentifier(Identifier) .FailWith("Expected {context:object} to be assignable to {0}{reason}, but found .", typeof(T)) .Then .ForCondition(Subject is T) .WithDefaultIdentifier(Identifier) - .FailWith("Expected {context:object} to be assignable to {0}{reason}, but {1} is not.", typeof(T), Subject?.GetType()); + .FailWith("Expected {context:object} to be assignable to {0}{reason}, but {1} is not.", typeof(T), + Subject?.GetType()); - if (success) + if (CurrentAssertionChain.Succeeded) { string[] failuresFromInspector; @@ -458,10 +465,11 @@ public AndConstraint Satisfy(Action assertion) string failureMessage = Environment.NewLine + string.Join(Environment.NewLine, failuresFromInspector.Select(x => x.IndentLines())); - Execute.Assertion + CurrentAssertionChain .WithDefaultIdentifier(Identifier) - .WithExpectation("Expected {context:object} to match inspector, but the inspector was not satisfied:", Subject) - .FailWithPreFormatted(failureMessage); + .WithExpectation("Expected {context:object} to match inspector, but the inspector was not satisfied:", + Subject, + chain => chain.FailWithPreFormatted(failureMessage)); } } @@ -477,4 +485,9 @@ public AndConstraint Satisfy(Action assertion) /// public override bool Equals(object obj) => throw new NotSupportedException("Equals is not part of Fluent Assertions. Did you mean BeSameAs() instead?"); + + /// + /// Provides access to the that this assertion class was initialized with. + /// + public AssertionChain CurrentAssertionChain { get; } } diff --git a/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs b/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs index 7387544b22..634feee5a7 100644 --- a/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs +++ b/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs @@ -12,8 +12,8 @@ namespace FluentAssertions.Primitives; [DebuggerNonUserCode] public class SimpleTimeSpanAssertions : SimpleTimeSpanAssertions { - public SimpleTimeSpanAssertions(TimeSpan? value) - : base(value) + public SimpleTimeSpanAssertions(TimeSpan? value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -27,8 +27,11 @@ public SimpleTimeSpanAssertions(TimeSpan? value) public class SimpleTimeSpanAssertions where TAssertions : SimpleTimeSpanAssertions { - public SimpleTimeSpanAssertions(TimeSpan? value) + private readonly AssertionChain assertionChain; + + public SimpleTimeSpanAssertions(TimeSpan? value, AssertionChain assertionChain) { + this.assertionChain = assertionChain; Subject = value; } @@ -49,7 +52,7 @@ public SimpleTimeSpanAssertions(TimeSpan? value) /// public AndConstraint BePositive([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject > TimeSpan.Zero) .FailWith("Expected {context:time} to be positive{reason}, but found {0}.", Subject); @@ -69,7 +72,7 @@ public AndConstraint BePositive([StringSyntax("CompositeFormat")] s /// public AndConstraint BeNegative([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject < TimeSpan.Zero) .FailWith("Expected {context:time} to be negative{reason}, but found {0}.", Subject); @@ -92,7 +95,7 @@ public AndConstraint BeNegative([StringSyntax("CompositeFormat")] s public AndConstraint Be(TimeSpan expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(expected == Subject) .FailWith("Expected {0}{reason}, but found {1}.", expected, Subject); @@ -115,7 +118,7 @@ public AndConstraint Be(TimeSpan expected, public AndConstraint NotBe(TimeSpan unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(unexpected != Subject) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {0}{reason}.", unexpected); @@ -138,7 +141,7 @@ public AndConstraint NotBe(TimeSpan unexpected, public AndConstraint BeLessThan(TimeSpan expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject < expected) .FailWith("Expected {context:time} to be less than {0}{reason}, but found {1}.", expected, Subject); @@ -161,7 +164,7 @@ public AndConstraint BeLessThan(TimeSpan expected, public AndConstraint BeLessThanOrEqualTo(TimeSpan expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject <= expected) .FailWith("Expected {context:time} to be less than or equal to {0}{reason}, but found {1}.", expected, Subject); @@ -184,7 +187,7 @@ public AndConstraint BeLessThanOrEqualTo(TimeSpan expected, public AndConstraint BeGreaterThan(TimeSpan expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject > expected) .FailWith("Expected {context:time} to be greater than {0}{reason}, but found {1}.", expected, Subject); @@ -207,7 +210,7 @@ public AndConstraint BeGreaterThan(TimeSpan expected, public AndConstraint BeGreaterThanOrEqualTo(TimeSpan expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject >= expected) .FailWith("Expected {context:time} to be greater than or equal to {0}{reason}, but found {1}.", expected, Subject); @@ -245,7 +248,7 @@ public AndConstraint BeCloseTo(TimeSpan nearbyTime, TimeSpan precis TimeSpan minimumValue = nearbyTime - precision; TimeSpan maximumValue = nearbyTime + precision; - Execute.Assertion + assertionChain .ForCondition(Subject >= minimumValue && Subject.Value <= maximumValue) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:time} to be within {0} from {1}{reason}, but found {2}.", @@ -285,7 +288,7 @@ public AndConstraint NotBeCloseTo(TimeSpan distantTime, TimeSpan pr TimeSpan minimumValue = distantTime - precision; TimeSpan maximumValue = distantTime + precision; - Execute.Assertion + assertionChain .ForCondition(Subject < minimumValue || Subject > maximumValue) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:time} to not be within {0} from {1}{reason}, but found {2}.", diff --git a/Src/FluentAssertions/Primitives/StringAssertions.cs b/Src/FluentAssertions/Primitives/StringAssertions.cs index dbc6a5e7f2..7e1fac4730 100644 --- a/Src/FluentAssertions/Primitives/StringAssertions.cs +++ b/Src/FluentAssertions/Primitives/StringAssertions.cs @@ -20,8 +20,8 @@ public class StringAssertions : StringAssertions /// /// Initializes a new instance of the class. /// - public StringAssertions(string value) - : base(value) + public StringAssertions(string value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -33,12 +33,15 @@ public StringAssertions(string value) public class StringAssertions : ReferenceTypeAssertions where TAssertions : StringAssertions { + private readonly AssertionChain assertionChain; + /// /// Initializes a new instance of the class. /// - public StringAssertions(string value) - : base(value) + public StringAssertions(string value, AssertionChain assertionChain) + : base(value, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -55,7 +58,7 @@ public StringAssertions(string value) public AndConstraint Be(string expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - var stringEqualityValidator = new StringValidator( + var stringEqualityValidator = new StringValidator(assertionChain, new StringEqualityStrategy(StringComparer.Ordinal, "be"), because, becauseArgs); @@ -91,7 +94,7 @@ public AndConstraint BeOneOf(params string[] validValues) public AndConstraint BeOneOf(IEnumerable validValues, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(validValues.Contains(Subject)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} to be one of {0}{reason}, but found {1}.", validValues, Subject); @@ -116,7 +119,7 @@ public AndConstraint BeOneOf(IEnumerable validValues, public AndConstraint BeEquivalentTo(string expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - var expectation = new StringValidator( + var expectation = new StringValidator(assertionChain, new StringEqualityStrategy(StringComparer.OrdinalIgnoreCase, "be equivalent to"), because, becauseArgs); @@ -149,7 +152,7 @@ public AndConstraint BeEquivalentTo(string expected, EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); - var expectation = new StringValidator( + var expectation = new StringValidator(assertionChain, new StringEqualityStrategy(options.GetStringComparerOrDefault(), "be equivalent to"), because, becauseArgs); @@ -185,7 +188,7 @@ public AndConstraint NotBeEquivalentTo(string unexpected, notEquivalent = scope.Discard().Length > 0; } - Execute.Assertion + assertionChain .ForCondition(notEquivalent) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} not to be equivalent to {0}{reason}, but they are.", unexpected); @@ -223,7 +226,7 @@ public AndConstraint NotBeEquivalentTo(string unexpected, notEquivalent = scope.Discard().Length > 0; } - Execute.Assertion + assertionChain .ForCondition(notEquivalent) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} not to be equivalent to {0}{reason}, but they are.", unexpected); @@ -246,7 +249,7 @@ public AndConstraint NotBeEquivalentTo(string unexpected, public AndConstraint NotBe(string unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject != unexpected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} not to be {0}{reason}.", unexpected); @@ -298,7 +301,7 @@ public AndConstraint Match(string wildcardPattern, Guard.ThrowIfArgumentIsEmpty(wildcardPattern, nameof(wildcardPattern), "Cannot match string against an empty string. Provide a wildcard pattern or use the BeEmpty method."); - var stringWildcardMatchingValidator = new StringValidator( + var stringWildcardMatchingValidator = new StringValidator(assertionChain, new StringWildcardMatchingStrategy(), because, becauseArgs); @@ -351,7 +354,7 @@ public AndConstraint NotMatch(string wildcardPattern, Guard.ThrowIfArgumentIsEmpty(wildcardPattern, nameof(wildcardPattern), "Cannot match string against an empty string. Provide a wildcard pattern or use the NotBeEmpty method."); - var stringWildcardMatchingValidator = new StringValidator( + var stringWildcardMatchingValidator = new StringValidator(assertionChain, new StringWildcardMatchingStrategy { Negate = true @@ -407,7 +410,7 @@ public AndConstraint MatchEquivalentOf(string wildcardPattern, Guard.ThrowIfArgumentIsEmpty(wildcardPattern, nameof(wildcardPattern), "Cannot match string against an empty string. Provide a wildcard pattern or use the BeEmpty method."); - var stringWildcardMatchingValidator = new StringValidator( + var stringWildcardMatchingValidator = new StringValidator(assertionChain, new StringWildcardMatchingStrategy { IgnoreCase = true, @@ -472,7 +475,7 @@ public AndConstraint MatchEquivalentOf(string wildcardPattern, EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); - var stringWildcardMatchingValidator = new StringValidator( + var stringWildcardMatchingValidator = new StringValidator(assertionChain, new StringWildcardMatchingStrategy { IgnoreCase = options.IgnoreCase, @@ -531,7 +534,7 @@ public AndConstraint NotMatchEquivalentOf(string wildcardPattern, Guard.ThrowIfArgumentIsEmpty(wildcardPattern, nameof(wildcardPattern), "Cannot match string against an empty string. Provide a wildcard pattern or use the NotBeEmpty method."); - var stringWildcardMatchingValidator = new StringValidator( + var stringWildcardMatchingValidator = new StringValidator(assertionChain, new StringWildcardMatchingStrategy { IgnoreCase = true, @@ -597,7 +600,7 @@ public AndConstraint NotMatchEquivalentOf(string wildcardPattern, EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); - var stringWildcardMatchingValidator = new StringValidator( + var stringWildcardMatchingValidator = new StringValidator(assertionChain, new StringWildcardMatchingStrategy { IgnoreCase = options.IgnoreCase, @@ -648,7 +651,7 @@ public AndConstraint MatchRegex([RegexPattern][StringSyntax("Regex" } catch (ArgumentException) { - Execute.Assertion.FailWith("Cannot match {context:string} against {0} because it is not a valid regular expression.", + assertionChain.FailWith("Cannot match {context:string} against {0} because it is not a valid regular expression.", regularExpression); return new AndConstraint((TAssertions)this); @@ -685,7 +688,7 @@ public AndConstraint MatchRegex([RegexPattern][StringSyntax("Regex" } catch (ArgumentException) { - Execute.Assertion.FailWith("Cannot match {context:string} against {0} because it is not a valid regular expression.", + assertionChain.FailWith("Cannot match {context:string} against {0} because it is not a valid regular expression.", regularExpression); return new AndConstraint((TAssertions)this); @@ -727,17 +730,17 @@ public AndConstraint MatchRegex(Regex regularExpression, Guard.ThrowIfArgumentIsEmpty(regexStr, nameof(regularExpression), "Cannot match string against an empty string. Provide a regex pattern or use the BeEmpty method."); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .UsingLineBreaks .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} to match regex {0}{reason}, but it was .", regexStr); - if (success) + if (assertionChain.Succeeded) { int actual = regularExpression.Matches(Subject!).Count; - Execute.Assertion + assertionChain .ForConstraint(occurrenceConstraint, actual) .UsingLineBreaks .BecauseOf(because, becauseArgs) @@ -775,15 +778,15 @@ public AndConstraint MatchRegex(Regex regularExpression, Guard.ThrowIfArgumentIsEmpty(regexStr, nameof(regularExpression), "Cannot match string against an empty string. Provide a regex pattern or use the BeEmpty method."); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .UsingLineBreaks .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} to match regex {0}{reason}, but it was .", regexStr); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(regularExpression.IsMatch(Subject!)) .BecauseOf(because, becauseArgs) .UsingLineBreaks @@ -821,7 +824,7 @@ public AndConstraint NotMatchRegex([RegexPattern][StringSyntax("Reg } catch (ArgumentException) { - Execute.Assertion.FailWith("Cannot match {context:string} against {0} because it is not a valid regular expression.", + assertionChain.FailWith("Cannot match {context:string} against {0} because it is not a valid regular expression.", regularExpression); return new AndConstraint((TAssertions)this); @@ -856,15 +859,15 @@ public AndConstraint NotMatchRegex(Regex regularExpression, Guard.ThrowIfArgumentIsEmpty(regexStr, nameof(regularExpression), "Cannot match string against an empty regex pattern. Provide a regex pattern or use the NotBeEmpty method."); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .UsingLineBreaks .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} to not match regex {0}{reason}, but it was .", regexStr); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(!regularExpression.IsMatch(Subject!)) .BecauseOf(because, becauseArgs) .UsingLineBreaks @@ -892,7 +895,7 @@ public AndConstraint StartWith(string expected, { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare start of string with ."); - var stringStartValidator = new StringValidator( + var stringStartValidator = new StringValidator(assertionChain, new StringStartStrategy(StringComparer.Ordinal, "start with"), because, becauseArgs); @@ -927,7 +930,7 @@ public AndConstraint NotStartWith(string unexpected, notEquivalent = scope.Discard().Length > 0; } - Execute.Assertion + assertionChain .ForCondition(Subject != null && notEquivalent) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} not to start with {0}{reason}, but found {1}.", unexpected, Subject); @@ -953,7 +956,7 @@ public AndConstraint StartWithEquivalentOf(string expected, { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare string start equivalence with ."); - var stringStartValidator = new StringValidator( + var stringStartValidator = new StringValidator(assertionChain, new StringStartStrategy(StringComparer.OrdinalIgnoreCase, "start with equivalent of"), because, becauseArgs); @@ -986,7 +989,7 @@ public AndConstraint StartWithEquivalentOf(string expected, EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); - var stringStartValidator = new StringValidator( + var stringStartValidator = new StringValidator(assertionChain, new StringStartStrategy(options.GetStringComparerOrDefault(), "start with equivalent of"), because, becauseArgs); @@ -1023,7 +1026,7 @@ public AndConstraint NotStartWithEquivalentOf(string unexpected, notEquivalent = scope.Discard().Length > 0; } - Execute.Assertion + assertionChain .ForCondition(Subject != null && notEquivalent) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} not to start with equivalent of {0}{reason}, but found {1}.", unexpected, Subject); @@ -1061,7 +1064,7 @@ public AndConstraint NotStartWithEquivalentOf(string unexpected, notEquivalent = scope.Discard().Length > 0; } - Execute.Assertion + assertionChain .ForCondition(Subject != null && notEquivalent) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} not to start with equivalent of {0}{reason}, but found {1}.", unexpected, Subject); @@ -1087,7 +1090,7 @@ public AndConstraint EndWith(string expected, { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare string end with ."); - var stringEndValidator = new StringValidator( + var stringEndValidator = new StringValidator(assertionChain, new StringEndStrategy(StringComparer.Ordinal, "end with"), because, becauseArgs); @@ -1122,7 +1125,7 @@ public AndConstraint NotEndWith(string unexpected, notEquivalent = scope.Discard().Length > 0; } - Execute.Assertion + assertionChain .ForCondition(Subject != null && notEquivalent) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} not to end with {0}{reason}, but found {1}.", unexpected, Subject); @@ -1148,7 +1151,7 @@ public AndConstraint EndWithEquivalentOf(string expected, { Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare string end equivalence with ."); - var stringEndValidator = new StringValidator( + var stringEndValidator = new StringValidator(assertionChain, new StringEndStrategy(StringComparer.OrdinalIgnoreCase, "end with equivalent of"), because, becauseArgs); @@ -1181,7 +1184,7 @@ public AndConstraint EndWithEquivalentOf(string expected, EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); - var stringEndValidator = new StringValidator( + var stringEndValidator = new StringValidator(assertionChain, new StringEndStrategy(options.GetStringComparerOrDefault(), "end with equivalent of"), because, becauseArgs); @@ -1218,7 +1221,7 @@ public AndConstraint NotEndWithEquivalentOf(string unexpected, notEquivalent = scope.Discard().Length > 0; } - Execute.Assertion + assertionChain .ForCondition(Subject != null && notEquivalent) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} not to end with equivalent of {0}{reason}, but found {1}.", unexpected, Subject); @@ -1256,7 +1259,7 @@ public AndConstraint NotEndWithEquivalentOf(string unexpected, notEquivalent = scope.Discard().Length > 0; } - Execute.Assertion + assertionChain .ForCondition(Subject != null && notEquivalent) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} not to end with equivalent of {0}{reason}, but found {1}.", unexpected, Subject); @@ -1285,7 +1288,7 @@ public AndConstraint Contain(string expected, Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert string containment against ."); Guard.ThrowIfArgumentIsEmpty(expected, nameof(expected), "Cannot assert string containment against an empty string."); - Execute.Assertion + assertionChain .ForCondition(Contains(Subject, expected, StringComparison.Ordinal)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} {0} to contain {1}{reason}.", Subject, expected); @@ -1322,7 +1325,7 @@ public AndConstraint Contain(string expected, OccurrenceConstraint int actual = Subject.CountSubstring(expected, StringComparer.Ordinal); - Execute.Assertion + assertionChain .ForConstraint(occurrenceConstraint, actual) .BecauseOf(because, becauseArgs) .FailWith( @@ -1352,7 +1355,7 @@ public AndConstraint ContainEquivalentOf(string expected, Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert string containment against ."); Guard.ThrowIfArgumentIsEmpty(expected, nameof(expected), "Cannot assert string containment against an empty string."); - var stringContainValidator = new StringValidatorSupportingNull( + var stringContainValidator = new StringValidatorSupportingNull(assertionChain, new StringContainsStrategy(StringComparer.OrdinalIgnoreCase, AtLeast.Once()), because, becauseArgs); @@ -1418,7 +1421,7 @@ public AndConstraint ContainEquivalentOf(string expected, EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); - var stringContainValidator = new StringValidatorSupportingNull( + var stringContainValidator = new StringValidatorSupportingNull(assertionChain, new StringContainsStrategy(options.GetStringComparerOrDefault(), occurrenceConstraint), because, becauseArgs); @@ -1459,7 +1462,7 @@ public AndConstraint ContainEquivalentOf(string expected, Guard.ThrowIfArgumentIsEmpty(expected, nameof(expected), "Cannot assert string containment against an empty string."); Guard.ThrowIfArgumentIsNull(occurrenceConstraint); - var stringContainValidator = new StringValidatorSupportingNull( + var stringContainValidator = new StringValidatorSupportingNull(assertionChain, new StringContainsStrategy(StringComparer.OrdinalIgnoreCase, occurrenceConstraint), because, becauseArgs); @@ -1488,7 +1491,7 @@ public AndConstraint ContainAll(IEnumerable values, IEnumerable missing = values.Where(v => !Contains(Subject, v, StringComparison.Ordinal)); - Execute.Assertion + assertionChain .ForCondition(values.All(v => Contains(Subject, v, StringComparison.Ordinal))) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} {0} to contain the strings: {1}{reason}.", Subject, missing); @@ -1525,7 +1528,7 @@ public AndConstraint ContainAny(IEnumerable values, { ThrowIfValuesNullOrEmpty(values); - Execute.Assertion + assertionChain .ForCondition(values.Any(v => Contains(Subject, v, StringComparison.Ordinal))) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} {0} to contain at least one of the strings: {1}{reason}.", Subject, values); @@ -1565,7 +1568,7 @@ public AndConstraint NotContain(string unexpected, Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot assert string containment against ."); Guard.ThrowIfArgumentIsEmpty(unexpected, nameof(unexpected), "Cannot assert string containment against an empty string."); - Execute.Assertion + assertionChain .ForCondition(!Contains(Subject, unexpected, StringComparison.Ordinal)) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:string} {0} to contain {1}{reason}.", Subject, unexpected); @@ -1594,7 +1597,7 @@ public AndConstraint NotContainAll(IEnumerable values, var matches = values.Count(v => Contains(Subject, v, StringComparison.Ordinal)); - Execute.Assertion + assertionChain .ForCondition(matches != values.Count()) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:string} {0} to contain all of the strings: {1}{reason}.", Subject, values); @@ -1634,7 +1637,7 @@ public AndConstraint NotContainAny(IEnumerable values, IEnumerable matches = values.Where(v => Contains(Subject, v, StringComparison.Ordinal)); - Execute.Assertion + assertionChain .ForCondition(!matches.Any()) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:string} {0} to contain any of the strings: {1}{reason}.", Subject, matches); @@ -1668,7 +1671,7 @@ public AndConstraint NotContainAny(params string[] values) public AndConstraint NotContainEquivalentOf(string unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!string.IsNullOrEmpty(unexpected) && Subject != null) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:string} to contain the equivalent of {0}{reason}, but found {1}.", unexpected, Subject); @@ -1681,7 +1684,7 @@ public AndConstraint NotContainEquivalentOf(string unexpected, notEquivalent = scope.Discard().Length > 0; } - Execute.Assertion + assertionChain .ForCondition(notEquivalent) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:string} to contain the equivalent of {0}{reason} but found {1}.", unexpected, Subject); @@ -1709,7 +1712,7 @@ public AndConstraint NotContainEquivalentOf(string unexpected, { Guard.ThrowIfArgumentIsNull(config); - Execute.Assertion + assertionChain .ForCondition(!string.IsNullOrEmpty(unexpected) && Subject != null) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:string} to contain the equivalent of {0}{reason}, but found {1}.", unexpected, Subject); @@ -1722,7 +1725,7 @@ public AndConstraint NotContainEquivalentOf(string unexpected, notEquivalent = scope.Discard().Length > 0; } - Execute.Assertion + assertionChain .ForCondition(notEquivalent) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:string} to contain the equivalent of {0}{reason}, but found {1}.", unexpected, Subject); @@ -1742,7 +1745,7 @@ public AndConstraint NotContainEquivalentOf(string unexpected, /// public AndConstraint BeEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject?.Length == 0) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} to be empty{reason}, but found {0}.", Subject); @@ -1762,7 +1765,7 @@ public AndConstraint BeEmpty([StringSyntax("CompositeFormat")] stri /// public AndConstraint NotBeEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject is null || Subject.Length > 0) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:string} to be empty{reason}."); @@ -1784,14 +1787,14 @@ public AndConstraint NotBeEmpty([StringSyntax("CompositeFormat")] s public AndConstraint HaveLength(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:string} with length {0}{reason}, but found .", expected); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject!.Length == expected) .FailWith("Expected {context:string} with length {0}{reason}, but found string {1} with length {2}.", @@ -1813,7 +1816,7 @@ public AndConstraint HaveLength(int expected, /// public AndConstraint NotBeNullOrEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!string.IsNullOrEmpty(Subject)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} not to be or empty{reason}, but found {0}.", Subject); @@ -1833,7 +1836,7 @@ public AndConstraint NotBeNullOrEmpty([StringSyntax("CompositeForma /// public AndConstraint BeNullOrEmpty([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(string.IsNullOrEmpty(Subject)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} to be or empty{reason}, but found {0}.", Subject); @@ -1853,7 +1856,7 @@ public AndConstraint BeNullOrEmpty([StringSyntax("CompositeFormat") /// public AndConstraint NotBeNullOrWhiteSpace([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!string.IsNullOrWhiteSpace(Subject)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} not to be or whitespace{reason}, but found {0}.", Subject); @@ -1873,7 +1876,7 @@ public AndConstraint NotBeNullOrWhiteSpace([StringSyntax("Composite /// public AndConstraint BeNullOrWhiteSpace([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(string.IsNullOrWhiteSpace(Subject)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} to be or whitespace{reason}, but found {0}.", Subject); @@ -1898,7 +1901,7 @@ public AndConstraint BeNullOrWhiteSpace([StringSyntax("CompositeFor /// public AndConstraint BeUpperCased([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject is not null && !Subject.Any(char.IsLower)) .BecauseOf(because, becauseArgs) .FailWith("Expected all alphabetic characters in {context:string} to be upper-case{reason}, but found {0}.", Subject); @@ -1923,7 +1926,7 @@ public AndConstraint BeUpperCased([StringSyntax("CompositeFormat")] /// public AndConstraint NotBeUpperCased([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject is null || HasMixedOrNoCase(Subject)) .BecauseOf(because, becauseArgs) .FailWith("Expected some characters in {context:string} to be lower-case{reason}."); @@ -1948,7 +1951,7 @@ public AndConstraint NotBeUpperCased([StringSyntax("CompositeFormat /// public AndConstraint BeLowerCased([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject is not null && !Subject.Any(char.IsUpper)) .BecauseOf(because, becauseArgs) .FailWith("Expected all alphabetic characters in {context:string} to be lower cased{reason}, but found {0}.", Subject); @@ -1973,7 +1976,7 @@ public AndConstraint BeLowerCased([StringSyntax("CompositeFormat")] /// public AndConstraint NotBeLowerCased([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject is null || HasMixedOrNoCase(Subject)) .BecauseOf(because, becauseArgs) .FailWith("Expected some characters in {context:string} to be upper-case{reason}."); @@ -2008,7 +2011,7 @@ internal AndConstraint Be(string expected, EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); - var expectation = new StringValidator( + var expectation = new StringValidator(assertionChain, new StringEqualityStrategy(options.GetStringComparerOrDefault(), "be"), because, becauseArgs); diff --git a/Src/FluentAssertions/Primitives/StringContainsStrategy.cs b/Src/FluentAssertions/Primitives/StringContainsStrategy.cs index 46c8b5b2e1..c82a053b73 100644 --- a/Src/FluentAssertions/Primitives/StringContainsStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringContainsStrategy.cs @@ -17,11 +17,11 @@ public StringContainsStrategy(IEqualityComparer comparer, OccurrenceCons public string ExpectationDescription => "Expected {context:string} to contain the equivalent of "; - public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected) + public void ValidateAgainstMismatch(AssertionChain assertionChain, string subject, string expected) { int actual = subject.CountSubstring(expected, comparer); - assertion + assertionChain .ForConstraint(occurrenceConstraint, actual) .FailWith( $"Expected {{context:string}} {{0}} to contain the equivalent of {{1}} {{expectedOccurrence}}{{reason}}, but found it {actual.Times()}.", diff --git a/Src/FluentAssertions/Primitives/StringEndStrategy.cs b/Src/FluentAssertions/Primitives/StringEndStrategy.cs index bdb59f9cbf..a2a332491f 100644 --- a/Src/FluentAssertions/Primitives/StringEndStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringEndStrategy.cs @@ -17,11 +17,13 @@ public StringEndStrategy(IEqualityComparer comparer, string predicateDes public string ExpectationDescription => "Expected {context:string} to " + predicateDescription + " "; - public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected) + public void ValidateAgainstMismatch(AssertionChain assertionChain, string subject, string expected) { - if (!assertion - .ForCondition(subject!.Length >= expected.Length) - .FailWith(ExpectationDescription + "{0}{reason}, but {1} is too short.", expected, subject)) + assertionChain + .ForCondition(subject!.Length >= expected.Length) + .FailWith(ExpectationDescription + "{0}{reason}, but {1} is too short.", expected, subject); + + if (!assertionChain.Succeeded) { return; } @@ -33,7 +35,7 @@ public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, s return; } - assertion.FailWith( + assertionChain.FailWith( ExpectationDescription + "{0}{reason}, but {1} differs near " + subject.IndexedSegmentAt(indexOfMismatch) + ".", expected, subject); diff --git a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs index 37ad2a72e5..d2c00a4ac0 100644 --- a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs @@ -18,9 +18,9 @@ public StringEqualityStrategy(IEqualityComparer comparer, string predica this.predicateDescription = predicateDescription; } - public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected) + public void ValidateAgainstMismatch(AssertionChain assertionChain, string subject, string expected) { - ValidateAgainstSuperfluousWhitespace(assertion, subject, expected); + ValidateAgainstSuperfluousWhitespace(assertionChain, subject, expected); if (expected.IsLongOrMultiline() || subject.IsLongOrMultiline()) { @@ -28,7 +28,7 @@ public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, s if (indexOfMismatch == -1) { - ValidateAgainstLengthDifferences(assertion, subject, expected); + ValidateAgainstLengthDifferences(assertionChain, subject, expected); return; } @@ -43,18 +43,18 @@ public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, s locationDescription = $"on line {lineNumber + 1} and column {column} (index {indexOfMismatch})"; } - assertion.FailWith( + assertionChain.FailWith( ExpectationDescription + "the same string{reason}, but they differ " + locationDescription + ":" + Environment.NewLine + GetMismatchSegmentForLongStrings(subject, expected, indexOfMismatch) + "."); } - else if (ValidateAgainstLengthDifferences(assertion, subject, expected)) + else if (ValidateAgainstLengthDifferences(assertionChain, subject, expected)) { int indexOfMismatch = subject.IndexOfFirstMismatch(expected, comparer); if (indexOfMismatch != -1) { - assertion.FailWith( + assertionChain.FailWith( ExpectationDescription + "{0}{reason}, but {1} differs near " + subject.IndexedSegmentAt(indexOfMismatch) + ".", expected, subject); @@ -64,7 +64,7 @@ public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, s public string ExpectationDescription => "Expected {context:string} to " + predicateDescription + " "; - private void ValidateAgainstSuperfluousWhitespace(IAssertionScope assertion, string subject, string expected) + private void ValidateAgainstSuperfluousWhitespace(AssertionChain assertion, string subject, string expected) { assertion .ForCondition(!(expected.Length > subject.Length && comparer.Equals(expected.TrimEnd(), subject))) @@ -74,9 +74,9 @@ private void ValidateAgainstSuperfluousWhitespace(IAssertionScope assertion, str .FailWith(ExpectationDescription + "{0}{reason}, but it has unexpected whitespace at the end.", expected); } - private bool ValidateAgainstLengthDifferences(IAssertionScope assertion, string subject, string expected) + private bool ValidateAgainstLengthDifferences(AssertionChain assertion, string subject, string expected) { - return assertion + assertion .ForCondition(subject.Length == expected.Length) .FailWith(() => { @@ -87,6 +87,8 @@ private bool ValidateAgainstLengthDifferences(IAssertionScope assertion, string return new FailReason(message, expected, expected.Length, subject, subject.Length); }); + + return assertion.Succeeded; } private string GetMismatchSegmentForStringsOfDifferentLengths(string subject, string expected) diff --git a/Src/FluentAssertions/Primitives/StringStartStrategy.cs b/Src/FluentAssertions/Primitives/StringStartStrategy.cs index e8bd42c53d..40b6b7e834 100644 --- a/Src/FluentAssertions/Primitives/StringStartStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringStartStrategy.cs @@ -17,11 +17,13 @@ public StringStartStrategy(IEqualityComparer comparer, string predicateD public string ExpectationDescription => "Expected {context:string} to " + predicateDescription + " "; - public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected) + public void ValidateAgainstMismatch(AssertionChain assertionChain, string subject, string expected) { - if (!assertion - .ForCondition(subject.Length >= expected.Length) - .FailWith(ExpectationDescription + "{0}{reason}, but {1} is too short.", expected, subject)) + assertionChain + .ForCondition(subject.Length >= expected.Length) + .FailWith(ExpectationDescription + "{0}{reason}, but {1} is too short.", expected, subject); + + if (!assertionChain.Succeeded) { return; } @@ -33,7 +35,7 @@ public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, s return; } - assertion.FailWith( + assertionChain.FailWith( ExpectationDescription + "{0}{reason}, but {1} differs near " + subject.IndexedSegmentAt(indexOfMismatch) + ".", expected, subject); diff --git a/Src/FluentAssertions/Primitives/StringValidator.cs b/Src/FluentAssertions/Primitives/StringValidator.cs index 8e7e49d7a0..e3402dde81 100644 --- a/Src/FluentAssertions/Primitives/StringValidator.cs +++ b/Src/FluentAssertions/Primitives/StringValidator.cs @@ -1,4 +1,3 @@ -using System.Diagnostics.CodeAnalysis; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -7,12 +6,13 @@ namespace FluentAssertions.Primitives; internal class StringValidator { private readonly IStringComparisonStrategy comparisonStrategy; - private IAssertionScope assertion; + private AssertionChain assertionChain; - public StringValidator(IStringComparisonStrategy comparisonStrategy, [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) + public StringValidator(AssertionChain assertionChain, IStringComparisonStrategy comparisonStrategy, string because, + object[] becauseArgs) { this.comparisonStrategy = comparisonStrategy; - assertion = Execute.Assertion.BecauseOf(because, becauseArgs); + this.assertionChain = assertionChain.BecauseOf(because, becauseArgs); } public void Validate(string subject, string expected) @@ -29,10 +29,10 @@ public void Validate(string subject, string expected) if (expected.IsLongOrMultiline() || subject.IsLongOrMultiline()) { - assertion = assertion.UsingLineBreaks; + assertionChain = assertionChain.UsingLineBreaks; } - comparisonStrategy.ValidateAgainstMismatch(assertion, subject, expected); + comparisonStrategy.ValidateAgainstMismatch(assertionChain, subject, expected); } private bool ValidateAgainstNulls(string subject, string expected) @@ -42,7 +42,7 @@ private bool ValidateAgainstNulls(string subject, string expected) return true; } - assertion.FailWith(comparisonStrategy.ExpectationDescription + "{0}{reason}, but found {1}.", expected, subject); + assertionChain.FailWith(comparisonStrategy.ExpectationDescription + "{0}{reason}, but found {1}.", expected, subject); return false; } } diff --git a/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs b/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs index deaf451a21..f0a20b55e7 100644 --- a/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs +++ b/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs @@ -7,12 +7,13 @@ namespace FluentAssertions.Primitives; internal class StringValidatorSupportingNull { private readonly IStringComparisonStrategy comparisonStrategy; - private IAssertionScope assertion; + private AssertionChain assertionChain; - public StringValidatorSupportingNull(IStringComparisonStrategy comparisonStrategy, [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) + public StringValidatorSupportingNull(AssertionChain assertionChain, IStringComparisonStrategy comparisonStrategy, + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { this.comparisonStrategy = comparisonStrategy; - assertion = Execute.Assertion.BecauseOf(because, becauseArgs); + this.assertionChain = assertionChain.BecauseOf(because, becauseArgs); } public void Validate(string subject, string expected) @@ -25,9 +26,9 @@ public void Validate(string subject, string expected) if (expected?.IsLongOrMultiline() == true || subject?.IsLongOrMultiline() == true) { - assertion = assertion.UsingLineBreaks; + assertionChain = assertionChain.UsingLineBreaks; } - comparisonStrategy.ValidateAgainstMismatch(assertion, subject, expected); + comparisonStrategy.ValidateAgainstMismatch(assertionChain, subject, expected); } } diff --git a/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs b/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs index 82afb98462..eca22d9815 100644 --- a/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs @@ -8,7 +8,7 @@ namespace FluentAssertions.Primitives; internal class StringWildcardMatchingStrategy : IStringComparisonStrategy { - public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, string expected) + public void ValidateAgainstMismatch(AssertionChain assertionChain, string subject, string expected) { bool isMatch = IsMatch(subject, expected); @@ -19,11 +19,11 @@ public void ValidateAgainstMismatch(IAssertionScope assertion, string subject, s if (Negate) { - assertion.FailWith(ExpectationDescription + "but {1} matches.", expected, subject); + assertionChain.FailWith(ExpectationDescription + "but {1} matches.", expected, subject); } else { - assertion.FailWith(ExpectationDescription + "but {1} does not.", expected, subject); + assertionChain.FailWith(ExpectationDescription + "but {1} does not.", expected, subject); } } diff --git a/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs b/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs index ce959601fe..ed92a9c0cb 100644 --- a/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs @@ -16,8 +16,8 @@ namespace FluentAssertions.Primitives; [DebuggerNonUserCode] public class TimeOnlyAssertions : TimeOnlyAssertions { - public TimeOnlyAssertions(TimeOnly? value) - : base(value) + public TimeOnlyAssertions(TimeOnly? value, AssertionChain assertionChain) + : base(value, assertionChain) { } } @@ -31,8 +31,11 @@ public TimeOnlyAssertions(TimeOnly? value) public class TimeOnlyAssertions where TAssertions : TimeOnlyAssertions { - public TimeOnlyAssertions(TimeOnly? value) + private readonly AssertionChain assertionChain; + + public TimeOnlyAssertions(TimeOnly? value, AssertionChain assertionChain) { + this.assertionChain = assertionChain; Subject = value; } @@ -55,7 +58,7 @@ public TimeOnlyAssertions(TimeOnly? value) public AndConstraint Be(TimeOnly expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject == expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:time} to be {0}{reason}, but found {1}.", @@ -78,7 +81,7 @@ public AndConstraint Be(TimeOnly expected, public AndConstraint Be(TimeOnly? expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject == expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:time} to be {0}{reason}, but found {1}.", @@ -101,7 +104,7 @@ public AndConstraint Be(TimeOnly? expected, public AndConstraint NotBe(TimeOnly unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject != unexpected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:time} not to be {0}{reason}, but it is.", unexpected); @@ -123,7 +126,7 @@ public AndConstraint NotBe(TimeOnly unexpected, public AndConstraint NotBe(TimeOnly? unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject != unexpected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:time} not to be {0}{reason}, but it is.", unexpected); @@ -158,16 +161,15 @@ public AndConstraint BeCloseTo(TimeOnly nearbyTime, TimeSpan precis ? MinimumDifference(Subject.Value, nearbyTime) : null; - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected {context:the time} to be within {0} from {1}{reason}, ", precision, nearbyTime) - .ForCondition(Subject is not null) - .FailWith("but found .") - .Then - .ForCondition(Subject?.IsCloseTo(nearbyTime, precision) == true) - .FailWith("but {0} was off by {1}.", Subject, difference) - .Then - .ClearExpectation(); + .WithExpectation("Expected {context:the time} to be within {0} from {1}{reason}, ", precision, nearbyTime, + chain => chain + .ForCondition(Subject is not null) + .FailWith("but found .") + .Then + .ForCondition(Subject?.IsCloseTo(nearbyTime, precision) == true) + .FailWith("but {0} was off by {1}.", Subject, difference)); return new AndConstraint((TAssertions)this); } @@ -203,16 +205,15 @@ public AndConstraint NotBeCloseTo(TimeOnly distantTime, TimeSpan pr { Guard.ThrowIfArgumentIsNegative(precision); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect {context:the time} to be within {0} from {1}{reason}, ", precision, distantTime) - .ForCondition(Subject is not null) - .FailWith("but found .") - .Then - .ForCondition(Subject?.IsCloseTo(distantTime, precision) == false) - .FailWith("but it was {0}.", Subject) - .Then - .ClearExpectation(); + .WithExpectation("Did not expect {context:the time} to be within {0} from {1}{reason}, ", precision, distantTime, + chain => chain + .ForCondition(Subject is not null) + .FailWith("but found .") + .Then + .ForCondition(Subject?.IsCloseTo(distantTime, precision) == false) + .FailWith("but it was {0}.", Subject)); return new AndConstraint((TAssertions)this); } @@ -231,7 +232,7 @@ public AndConstraint NotBeCloseTo(TimeOnly distantTime, TimeSpan pr public AndConstraint BeBefore(TimeOnly expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject < expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:time} to be before {0}{reason}, but found {1}.", expected, @@ -271,7 +272,7 @@ public AndConstraint NotBeBefore(TimeOnly unexpected, public AndConstraint BeOnOrBefore(TimeOnly expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject <= expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:time} to be on or before {0}{reason}, but found {1}.", expected, @@ -311,7 +312,7 @@ public AndConstraint NotBeOnOrBefore(TimeOnly unexpected, public AndConstraint BeAfter(TimeOnly expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject > expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:time} to be after {0}{reason}, but found {1}.", expected, @@ -351,7 +352,7 @@ public AndConstraint NotBeAfter(TimeOnly unexpected, public AndConstraint BeOnOrAfter(TimeOnly expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject >= expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:time} to be on or after {0}{reason}, but found {1}.", expected, @@ -391,16 +392,14 @@ public AndConstraint NotBeOnOrAfter(TimeOnly unexpected, public AndConstraint HaveHours(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the hours part of {context:the time} to be {0}{reason}", expected) - .ForCondition(Subject.HasValue) - .FailWith(", but found .") - .Then - .ForCondition(Subject.Value.Hour == expected) - .FailWith(", but found {0}.", Subject.Value.Hour) - .Then - .ClearExpectation(); + .WithExpectation("Expected the hours part of {context:the time} to be {0}{reason}", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found .") + .Then + .ForCondition(Subject.Value.Hour == expected) + .FailWith(", but found {0}.", Subject.Value.Hour)); return new AndConstraint((TAssertions)this); } @@ -419,7 +418,7 @@ public AndConstraint HaveHours(int expected, public AndConstraint NotHaveHours(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject.HasValue) .FailWith("Did not expect the hours part of {context:the time} to be {0}{reason}, but found a TimeOnly.", @@ -446,16 +445,14 @@ public AndConstraint NotHaveHours(int unexpected, public AndConstraint HaveMinutes(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the minutes part of {context:the time} to be {0}{reason}", expected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a TimeOnly.") - .Then - .ForCondition(Subject.Value.Minute == expected) - .FailWith(", but found {0}.", Subject.Value.Minute) - .Then - .ClearExpectation(); + .WithExpectation("Expected the minutes part of {context:the time} to be {0}{reason}", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a TimeOnly.") + .Then + .ForCondition(Subject.Value.Minute == expected) + .FailWith(", but found {0}.", Subject.Value.Minute)); return new AndConstraint((TAssertions)this); } @@ -474,16 +471,14 @@ public AndConstraint HaveMinutes(int expected, public AndConstraint NotHaveMinutes(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the minutes part of {context:the time} to be {0}{reason}", unexpected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a TimeOnly.") - .Then - .ForCondition(Subject.Value.Minute != unexpected) - .FailWith(", but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the minutes part of {context:the time} to be {0}{reason}", unexpected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a TimeOnly.") + .Then + .ForCondition(Subject.Value.Minute != unexpected) + .FailWith(", but it was.")); return new AndConstraint((TAssertions)this); } @@ -502,16 +497,14 @@ public AndConstraint NotHaveMinutes(int unexpected, public AndConstraint HaveSeconds(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the seconds part of {context:the time} to be {0}{reason}", expected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a TimeOnly.") - .Then - .ForCondition(Subject.Value.Second == expected) - .FailWith(", but found {0}.", Subject.Value.Second) - .Then - .ClearExpectation(); + .WithExpectation("Expected the seconds part of {context:the time} to be {0}{reason}", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a TimeOnly.") + .Then + .ForCondition(Subject.Value.Second == expected) + .FailWith(", but found {0}.", Subject.Value.Second)); return new AndConstraint((TAssertions)this); } @@ -530,16 +523,14 @@ public AndConstraint HaveSeconds(int expected, public AndConstraint NotHaveSeconds(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the seconds part of {context:the time} to be {0}{reason}", unexpected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a TimeOnly.") - .Then - .ForCondition(Subject.Value.Second != unexpected) - .FailWith(", but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the seconds part of {context:the time} to be {0}{reason}", unexpected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a TimeOnly.") + .Then + .ForCondition(Subject.Value.Second != unexpected) + .FailWith(", but it was.")); return new AndConstraint((TAssertions)this); } @@ -558,16 +549,14 @@ public AndConstraint NotHaveSeconds(int unexpected, public AndConstraint HaveMilliseconds(int expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected the milliseconds part of {context:the time} to be {0}{reason}", expected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a TimeOnly.") - .Then - .ForCondition(Subject.Value.Millisecond == expected) - .FailWith(", but found {0}.", Subject.Value.Millisecond) - .Then - .ClearExpectation(); + .WithExpectation("Expected the milliseconds part of {context:the time} to be {0}{reason}", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a TimeOnly.") + .Then + .ForCondition(Subject.Value.Millisecond == expected) + .FailWith(", but found {0}.", Subject.Value.Millisecond)); return new AndConstraint((TAssertions)this); } @@ -586,16 +575,15 @@ public AndConstraint HaveMilliseconds(int expected, public AndConstraint NotHaveMilliseconds(int unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Did not expect the milliseconds part of {context:the time} to be {0}{reason}", unexpected) - .ForCondition(Subject.HasValue) - .FailWith(", but found a TimeOnly.") - .Then - .ForCondition(Subject.Value.Millisecond != unexpected) - .FailWith(", but it was.") - .Then - .ClearExpectation(); + .WithExpectation("Did not expect the milliseconds part of {context:the time} to be {0}{reason}", unexpected, + chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a TimeOnly.") + .Then + .ForCondition(Subject.Value.Millisecond != unexpected) + .FailWith(", but it was.")); return new AndConstraint((TAssertions)this); } @@ -657,7 +645,7 @@ public AndConstraint BeOneOf(IEnumerable validValues, public AndConstraint BeOneOf(IEnumerable validValues, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(validValues.Contains(Subject)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:time} to be one of {0}{reason}, but found {1}.", validValues, Subject); diff --git a/Src/FluentAssertions/Specialized/ActionAssertions.cs b/Src/FluentAssertions/Specialized/ActionAssertions.cs index 0051f0dee8..94be29f8c4 100644 --- a/Src/FluentAssertions/Specialized/ActionAssertions.cs +++ b/Src/FluentAssertions/Specialized/ActionAssertions.cs @@ -12,14 +12,18 @@ namespace FluentAssertions.Specialized; [DebuggerNonUserCode] public class ActionAssertions : DelegateAssertions { - public ActionAssertions(Action subject, IExtractExceptions extractor) - : base(subject, extractor) + private readonly AssertionChain assertionChain; + + public ActionAssertions(Action subject, IExtractExceptions extractor, AssertionChain assertionChain) + : base(subject, extractor, assertionChain) { + this.assertionChain = assertionChain; } - public ActionAssertions(Action subject, IExtractExceptions extractor, IClock clock) - : base(subject, extractor, clock) + public ActionAssertions(Action subject, IExtractExceptions extractor, AssertionChain assertionChain, IClock clock) + : base(subject, extractor, assertionChain, clock) { + this.assertionChain = assertionChain; } /// @@ -34,12 +38,12 @@ public ActionAssertions(Action subject, IExtractExceptions extractor, IClock clo /// public AndConstraint NotThrow([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} not to throw{reason}, but found ."); - if (success) + if (assertionChain.Succeeded) { FailIfSubjectIsAsyncVoid(); Exception exception = InvokeSubjectWithInterception(); @@ -78,12 +82,12 @@ public AndConstraint NotThrowAfter(TimeSpan waitTime, TimeSpan Guard.ThrowIfArgumentIsNegative(waitTime); Guard.ThrowIfArgumentIsNegative(pollInterval); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} not to throw after {0}{reason}, but found .", waitTime); - if (success) + if (assertionChain.Succeeded) { FailIfSubjectIsAsyncVoid(); @@ -104,7 +108,7 @@ public AndConstraint NotThrowAfter(TimeSpan waitTime, TimeSpan invocationEndTime = timer.Elapsed; } - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(exception is null) .FailWith("Did not expect any exceptions after {0}{reason}, but found {1}.", waitTime, exception); diff --git a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs index 30791f52a2..7a120af2a0 100644 --- a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs @@ -19,9 +19,13 @@ public class AsyncFunctionAssertions : DelegateAssertionsBas where TTask : Task where TAssertions : AsyncFunctionAssertions { - protected AsyncFunctionAssertions(Func subject, IExtractExceptions extractor, IClock clock) - : base(subject, extractor, clock) + private readonly AssertionChain assertionChain; + + protected AsyncFunctionAssertions(Func subject, IExtractExceptions extractor, AssertionChain assertionChain, + IClock clock) + : base(subject, extractor, assertionChain, clock) { + this.assertionChain = assertionChain; } protected override string Identifier => "async function"; @@ -40,12 +44,12 @@ protected AsyncFunctionAssertions(Func subject, IExtractExceptions extrac public async Task> NotCompleteWithinAsync(TimeSpan timeSpan, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:task} to complete within {0}{reason}, but found .", timeSpan); - if (success) + if (assertionChain.Succeeded) { (Task task, TimeSpan remainingTime) = InvokeWithTimer(timeSpan); @@ -53,7 +57,7 @@ public async Task> NotCompleteWithinAsync(TimeSpan ti { bool completesWithinTimeout = await CompletesWithinTimeoutAsync(task, remainingTime); - Execute.Assertion + assertionChain .ForCondition(!completesWithinTimeout) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:task} to complete within {0}{reason}.", timeSpan); @@ -83,29 +87,29 @@ public async Task> ThrowExactlyAsync { Type expectedType = typeof(TException); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} to throw exactly {0}{reason}, but found .", expectedType); - if (success) + if (assertionChain.Succeeded) { Exception exception = await InvokeWithInterceptionAsync(Subject); - success = Execute.Assertion + assertionChain .ForCondition(exception is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {0}{reason}, but no exception was thrown.", expectedType); - if (success) + if (assertionChain.Succeeded) { exception.Should().BeOfType(expectedType, because, becauseArgs); } - return new ExceptionAssertions([exception as TException]); + return new ExceptionAssertions([exception as TException], assertionChain); } - return new ExceptionAssertions([]); + return new ExceptionAssertions([], assertionChain); } /// @@ -123,18 +127,18 @@ public async Task> ThrowAsync( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} to throw {0}{reason}, but found .", typeof(TException)); - if (success) + if (assertionChain.Succeeded) { Exception exception = await InvokeWithInterceptionAsync(Subject); return ThrowInternal(exception, because, becauseArgs); } - return new ExceptionAssertions([]); + return new ExceptionAssertions([], assertionChain); } /// @@ -154,19 +158,19 @@ public async Task> ThrowWithinAsync( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} to throw {0} within {1}{reason}, but found .", typeof(TException), timeSpan); - if (success) + if (assertionChain.Succeeded) { Exception caughtException = await InvokeWithInterceptionAsync(timeSpan); return AssertThrows(caughtException, timeSpan, because, becauseArgs); } - return new ExceptionAssertions([]); + return new ExceptionAssertions([], assertionChain); } private ExceptionAssertions AssertThrows( @@ -176,21 +180,18 @@ private ExceptionAssertions AssertThrows( { TException[] expectedExceptions = Extractor.OfType(exception).ToArray(); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected a <{0}> to be thrown within {1}{reason}, ", - typeof(TException), timeSpan) - .ForCondition(exception is not null) - .FailWith("but no exception was thrown.") - .Then - .ForCondition(expectedExceptions.Length > 0) - .FailWith("but found <{0}>:" + Environment.NewLine + "{1}.", - exception?.GetType(), - exception) - .Then - .ClearExpectation(); - - return new ExceptionAssertions(expectedExceptions); + .WithExpectation("Expected a <{0}> to be thrown within {1}{reason}, ", typeof(TException), timeSpan, chain => chain + .ForCondition(exception is not null) + .FailWith("but no exception was thrown.") + .Then + .ForCondition(expectedExceptions.Length > 0) + .FailWith("but found <{0}>:" + Environment.NewLine + "{1}.", + exception?.GetType(), + exception)); + + return new ExceptionAssertions(expectedExceptions, assertionChain); } private async Task InvokeWithInterceptionAsync(TimeSpan timeout) @@ -210,6 +211,7 @@ private async Task InvokeWithInterceptionAsync(TimeSpan timeout) : default) { (TTask task, TimeSpan remainingTime) = InvokeWithTimer(timeout); + if (remainingTime < TimeSpan.Zero) { // timeout reached without exception @@ -248,15 +250,16 @@ private async Task InvokeWithInterceptionAsync(TimeSpan timeout) /// /// Zero or more objects to format using the placeholders in . /// - public async Task> NotThrowAsync([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public async Task> NotThrowAsync([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) where TException : Exception { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} not to throw{reason}, but found ."); - if (success) + if (assertionChain.Succeeded) { try { diff --git a/Src/FluentAssertions/Specialized/DelegateAssertions.cs b/Src/FluentAssertions/Specialized/DelegateAssertions.cs index a8084e3255..f10a4b5885 100644 --- a/Src/FluentAssertions/Specialized/DelegateAssertions.cs +++ b/Src/FluentAssertions/Specialized/DelegateAssertions.cs @@ -16,14 +16,18 @@ public abstract class DelegateAssertions : DelegateAsser where TDelegate : Delegate where TAssertions : DelegateAssertions { - protected DelegateAssertions(TDelegate @delegate, IExtractExceptions extractor) - : base(@delegate, extractor, new Clock()) + private readonly AssertionChain assertionChain; + + protected DelegateAssertions(TDelegate @delegate, IExtractExceptions extractor, AssertionChain assertionChain) + : base(@delegate, extractor, assertionChain, new Clock()) { + this.assertionChain = assertionChain; } - private protected DelegateAssertions(TDelegate @delegate, IExtractExceptions extractor, IClock clock) - : base(@delegate, extractor, clock) + private protected DelegateAssertions(TDelegate @delegate, IExtractExceptions extractor, AssertionChain assertionChain, IClock clock) + : base(@delegate, extractor, assertionChain, clock) { + this.assertionChain = assertionChain; } /// @@ -39,19 +43,19 @@ private protected DelegateAssertions(TDelegate @delegate, IExtractExceptions ext public ExceptionAssertions Throw([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} to throw {0}{reason}, but found .", typeof(TException)); - if (success) + if (assertionChain.Succeeded) { FailIfSubjectIsAsyncVoid(); Exception exception = InvokeSubjectWithInterception(); return ThrowInternal(exception, because, becauseArgs); } - return new ExceptionAssertions([]); + return new ExceptionAssertions([], assertionChain); } /// @@ -67,12 +71,12 @@ public ExceptionAssertions Throw([StringSyntax("Composit public AndConstraint NotThrow([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TException : Exception { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} not to throw {0}{reason}, but found .", typeof(TException)); - if (success) + if (assertionChain.Succeeded) { FailIfSubjectIsAsyncVoid(); Exception exception = InvokeSubjectWithInterception(); @@ -102,32 +106,32 @@ public ExceptionAssertions ThrowExactly([StringSyntax("C params object[] becauseArgs) where TException : Exception { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} to throw exactly {0}{reason}, but found .", typeof(TException)); - if (success) + if (assertionChain.Succeeded) { FailIfSubjectIsAsyncVoid(); Exception exception = InvokeSubjectWithInterception(); Type expectedType = typeof(TException); - success = Execute.Assertion + assertionChain .ForCondition(exception is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {0}{reason}, but no exception was thrown.", expectedType); - if (success) + if (assertionChain.Succeeded) { exception.Should().BeOfType(expectedType, because, becauseArgs); } - return new ExceptionAssertions([exception as TException]); + return new ExceptionAssertions([exception as TException], assertionChain); } - return new ExceptionAssertions([]); + return new ExceptionAssertions([], assertionChain); } protected abstract void InvokeSubject(); diff --git a/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs b/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs index 77b687f54e..fe662c0424 100644 --- a/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs +++ b/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs @@ -18,11 +18,15 @@ public abstract class DelegateAssertionsBase where TDelegate : Delegate where TAssertions : DelegateAssertionsBase { + private readonly AssertionChain assertionChain; + private protected IExtractExceptions Extractor { get; } - private protected DelegateAssertionsBase(TDelegate @delegate, IExtractExceptions extractor, IClock clock) - : base(@delegate) + private protected DelegateAssertionsBase(TDelegate @delegate, IExtractExceptions extractor, AssertionChain assertionChain, + IClock clock) + : base(@delegate, assertionChain) { + this.assertionChain = assertionChain; Extractor = extractor ?? throw new ArgumentNullException(nameof(extractor)); Clock = clock ?? throw new ArgumentNullException(nameof(clock)); } @@ -36,25 +40,24 @@ protected ExceptionAssertions ThrowInternal( { TException[] expectedExceptions = Extractor.OfType(exception).ToArray(); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected a <{0}> to be thrown{reason}, ", typeof(TException)) - .ForCondition(exception is not null) - .FailWith("but no exception was thrown.") - .Then - .ForCondition(expectedExceptions.Length > 0) - .FailWith("but found <{0}>:" + Environment.NewLine + "{1}.", - exception?.GetType(), - exception) - .Then - .ClearExpectation(); + .WithExpectation("Expected a <{0}> to be thrown{reason}, ", typeof(TException), chain => chain + .ForCondition(exception is not null) + .FailWith("but no exception was thrown.") + .Then + .ForCondition(expectedExceptions.Length > 0) + .FailWith("but found <{0}>:" + Environment.NewLine + "{1}.", + exception?.GetType(), + exception)); - return new ExceptionAssertions(expectedExceptions); + return new ExceptionAssertions(expectedExceptions, assertionChain); } - protected AndConstraint NotThrowInternal(Exception exception, [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) + protected AndConstraint NotThrowInternal(Exception exception, [StringSyntax("CompositeFormat")] string because, + object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(exception is null) .BecauseOf(because, becauseArgs) .FailWith("Did not expect any exception{reason}, but found {0}.", exception); @@ -62,12 +65,13 @@ protected AndConstraint NotThrowInternal(Exception exception, [Stri return new AndConstraint((TAssertions)this); } - protected AndConstraint NotThrowInternal(Exception exception, [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) + protected AndConstraint NotThrowInternal(Exception exception, + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) where TException : Exception { IEnumerable exceptions = Extractor.OfType(exception); - Execute.Assertion + assertionChain .ForCondition(!exceptions.Any()) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {0}{reason}, but found {1}.", typeof(TException), exception); diff --git a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs index 3cec526e9a..ceaa98ec85 100644 --- a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs @@ -19,9 +19,12 @@ namespace FluentAssertions.Specialized; public class ExceptionAssertions : ReferenceTypeAssertions, ExceptionAssertions> where TException : Exception { - public ExceptionAssertions(IEnumerable exceptions) - : base(exceptions) + private readonly AssertionChain assertionChain; + + public ExceptionAssertions(IEnumerable exceptions, AssertionChain assertionChain) + : base(exceptions, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -75,13 +78,13 @@ public ExceptionAssertions(IEnumerable exceptions) public virtual ExceptionAssertions WithMessage(string expectedWildcardPattern, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - AssertionScope assertion = Execute.Assertion.BecauseOf(because, becauseArgs).UsingLineBreaks; - - assertion + assertionChain + .BecauseOf(because, becauseArgs) + .UsingLineBreaks .ForCondition(Subject.Any()) .FailWith("Expected exception with message {0}{reason}, but no exception was thrown.", expectedWildcardPattern); - ExceptionMessageAssertion.Execute(Subject.Select(exc => exc.Message), expectedWildcardPattern, because, + AssertExceptionMessage(Subject.Select(exc => exc.Message), expectedWildcardPattern, because, becauseArgs); return this; @@ -98,12 +101,12 @@ public virtual ExceptionAssertions WithMessage(string expectedWildca /// /// Zero or more objects to format using the placeholders in . /// - public virtual ExceptionAssertions WithInnerException( - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public virtual ExceptionAssertions WithInnerException(string because = "", + params object[] becauseArgs) where TInnerException : Exception { var expectedInnerExceptions = AssertInnerExceptions(typeof(TInnerException), because, becauseArgs); - return new ExceptionAssertions(expectedInnerExceptions.Cast()); + return new ExceptionAssertions(expectedInnerExceptions.Cast(), assertionChain); } /// @@ -117,12 +120,12 @@ public virtual ExceptionAssertions WithInnerException /// Zero or more objects to format using the placeholders in . /// - public ExceptionAssertions WithInnerException(Type innerException, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public ExceptionAssertions WithInnerException(Type innerException, string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(innerException); - return new ExceptionAssertions(AssertInnerExceptions(innerException, because, becauseArgs)); + return new ExceptionAssertions(AssertInnerExceptions(innerException, because, becauseArgs), assertionChain); } /// @@ -136,12 +139,12 @@ public ExceptionAssertions WithInnerException(Type innerException, /// /// Zero or more objects to format using the placeholders in . /// - public virtual ExceptionAssertions WithInnerExceptionExactly([StringSyntax("CompositeFormat")] string because = "", + public virtual ExceptionAssertions WithInnerExceptionExactly(string because = "", params object[] becauseArgs) where TInnerException : Exception { var exceptionExpression = AssertInnerExceptionExactly(typeof(TInnerException), because, becauseArgs); - return new ExceptionAssertions(exceptionExpression.Cast()); + return new ExceptionAssertions(exceptionExpression.Cast(), assertionChain); } /// @@ -155,12 +158,12 @@ public virtual ExceptionAssertions WithInnerExceptionExactly /// Zero or more objects to format using the placeholders in . /// - public ExceptionAssertions WithInnerExceptionExactly(Type innerException, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public ExceptionAssertions WithInnerExceptionExactly(Type innerException, string because = "", + params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(innerException); - return new ExceptionAssertions(AssertInnerExceptionExactly(innerException, because, becauseArgs)); + return new ExceptionAssertions(AssertInnerExceptionExactly(innerException, because, becauseArgs), assertionChain); } /// @@ -178,13 +181,13 @@ public ExceptionAssertions WithInnerExceptionExactly(Type innerExcept /// /// is . public ExceptionAssertions Where(Expression> exceptionExpression, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(exceptionExpression); Func condition = exceptionExpression.Compile(); - Execute.Assertion + assertionChain .ForCondition(condition(SingleSubject)) .BecauseOf(because, becauseArgs) .FailWith("Expected exception where {0}{reason}, but the condition was not met by:" @@ -194,10 +197,10 @@ public ExceptionAssertions Where(Expression> return this; } - private IEnumerable AssertInnerExceptionExactly(Type innerException, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + private IEnumerable AssertInnerExceptionExactly(Type innerException, string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject.Any(e => e.InnerException is not null)) .FailWith("Expected inner {0}{reason}, but the thrown exception has no inner exception.", innerException); @@ -206,7 +209,7 @@ private IEnumerable AssertInnerExceptionExactly(Type innerException, .Select(e => e.InnerException) .Where(e => e?.GetType() == innerException).ToArray(); - Execute.Assertion + assertionChain .ForCondition(expectedExceptions.Length > 0) .BecauseOf(because, becauseArgs) .FailWith("Expected inner {0}{reason}, but found {1}.", innerException, SingleSubject.InnerException); @@ -214,10 +217,10 @@ private IEnumerable AssertInnerExceptionExactly(Type innerException, return expectedExceptions; } - private IEnumerable AssertInnerExceptions(Type innerException, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + private IEnumerable AssertInnerExceptions(Type innerException, string because = "", + params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject.Any(e => e.InnerException is not null)) .FailWith("Expected inner {0}{reason}, but the thrown exception has no inner exception.", innerException); @@ -227,7 +230,7 @@ private IEnumerable AssertInnerExceptions(Type innerException, .Where(e => e != null && e.GetType().IsSameOrInherits(innerException)) .ToArray(); - Execute.Assertion + assertionChain .ForCondition(expectedInnerExceptions.Length > 0) .BecauseOf(because, becauseArgs) .FailWith("Expected inner {0}{reason}, but found {1}.", innerException, SingleSubject.InnerException); @@ -259,39 +262,35 @@ private static string BuildExceptionsString(IEnumerable exceptions) "\t" + Formatter.ToString(exception))); } - private static class ExceptionMessageAssertion + private void AssertExceptionMessage(IEnumerable messages, string expectation, string because, params object[] becauseArgs) { - private const string Context = "exception message"; + var results = new AssertionResultSet(); - public static void Execute(IEnumerable messages, string expectation, [StringSyntax("CompositeFormat")] string because, params object[] becauseArgs) + foreach (string message in messages) { - using var _ = new AssertionScope(); - var results = new AssertionResultSet(); - - foreach (string message in messages) + using (var scope = new AssertionScope()) { - using (var scope = new AssertionScope()) - { - scope.Context = new Lazy(() => Context); - - message.Should().MatchEquivalentOf(expectation, because, becauseArgs); + var chain = AssertionChain.GetOrCreate(); + chain.OverrideCallerIdentifier(() => "exception message"); + chain.ReuseOnce(); - results.AddSet(message, scope.Discard()); - } + message.Should().MatchEquivalentOf(expectation, because, becauseArgs); - if (results.ContainsSuccessfulSet()) - { - break; - } + results.AddSet(message, scope.Discard()); } - foreach (string failure in results.GetTheFailuresForTheSetWithTheFewestFailures()) + if (results.ContainsSuccessfulSet()) { - string replacedCurlyBraces = - failure.EscapePlaceholders(); - - AssertionScope.Current.FailWith(replacedCurlyBraces); + break; } } + + foreach (string failure in results.GetTheFailuresForTheSetWithTheFewestFailures()) + { + string replacedCurlyBraces = + failure.EscapePlaceholders(); + + assertionChain.FailWith(replacedCurlyBraces); + } } } diff --git a/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs b/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs index 1c63fcc35a..0dfaf1446d 100644 --- a/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs @@ -13,14 +13,16 @@ namespace FluentAssertions.Specialized; public class ExecutionTimeAssertions { private readonly ExecutionTime execution; + private readonly AssertionChain assertionChain; /// /// Initializes a new instance of the class. /// /// The execution on which time must be asserted. - public ExecutionTimeAssertions(ExecutionTime executionTime) + public ExecutionTimeAssertions(ExecutionTime executionTime, AssertionChain assertionChain) { execution = executionTime ?? throw new ArgumentNullException(nameof(executionTime)); + this.assertionChain = assertionChain; } /// @@ -74,7 +76,7 @@ public AndConstraint BeLessThanOrEqualTo(TimeSpan maxDu { (bool isRunning, TimeSpan elapsed) = PollUntil(duration => duration <= maxDuration, expectedResult: false, rate: maxDuration); - Execute.Assertion + assertionChain .ForCondition(elapsed <= maxDuration) .BecauseOf(because, becauseArgs) .FailWith("Execution of " + @@ -105,7 +107,7 @@ public AndConstraint BeLessThan(TimeSpan maxDuration, { (bool isRunning, TimeSpan elapsed) = PollUntil(duration => duration < maxDuration, expectedResult: false, rate: maxDuration); - Execute.Assertion + assertionChain .ForCondition(elapsed < maxDuration) .BecauseOf(because, becauseArgs) .FailWith("Execution of " + @@ -135,7 +137,7 @@ public AndConstraint BeGreaterThanOrEqualTo(TimeSpan mi { (bool isRunning, TimeSpan elapsed) = PollUntil(duration => duration >= minDuration, expectedResult: true, rate: minDuration); - Execute.Assertion + assertionChain .ForCondition(elapsed >= minDuration) .BecauseOf(because, becauseArgs) .FailWith("Execution of " + @@ -166,7 +168,7 @@ public AndConstraint BeGreaterThan(TimeSpan minDuration { (bool isRunning, TimeSpan elapsed) = PollUntil(duration => duration > minDuration, expectedResult: true, rate: minDuration); - Execute.Assertion + assertionChain .ForCondition(elapsed > minDuration) .BecauseOf(because, becauseArgs) .FailWith("Execution of " + @@ -208,7 +210,7 @@ public AndConstraint BeCloseTo(TimeSpan expectedDuratio // elapsed time didn't even get to the acceptable range (bool isRunning, TimeSpan elapsed) = PollUntil(duration => duration <= maximumValue, expectedResult: false, rate: maximumValue); - Execute.Assertion + assertionChain .ForCondition(elapsed >= minimumValue && elapsed <= maximumValue) .BecauseOf(because, becauseArgs) .FailWith("Execution of " + execution.ActionDescription.EscapePlaceholders() + diff --git a/Src/FluentAssertions/Specialized/FunctionAssertionHelpers.cs b/Src/FluentAssertions/Specialized/FunctionAssertionHelpers.cs deleted file mode 100644 index 28c4e0983f..0000000000 --- a/Src/FluentAssertions/Specialized/FunctionAssertionHelpers.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using FluentAssertions.Common; -using FluentAssertions.Execution; - -namespace FluentAssertions.Specialized; - -internal static class FunctionAssertionHelpers -{ - internal static T NotThrow(Func subject, [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) - { - try - { - return subject(); - } - catch (Exception exception) - { - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith("Did not expect any exception{reason}, but found {0}.", exception); - - return default; - } - } - - internal static TResult NotThrowAfter(Func subject, IClock clock, TimeSpan waitTime, TimeSpan pollInterval, - [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNegative(waitTime); - Guard.ThrowIfArgumentIsNegative(pollInterval); - - TimeSpan? invocationEndTime = null; - Exception exception = null; - ITimer timer = clock.StartTimer(); - - while (invocationEndTime is null || invocationEndTime < waitTime) - { - try - { - return subject(); - } - catch (Exception ex) - { - exception = ex; - } - - clock.Delay(pollInterval); - invocationEndTime = timer.Elapsed; - } - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .FailWith("Did not expect any exceptions after {0}{reason}, but found {1}.", waitTime, exception); - - return default; - } -} diff --git a/Src/FluentAssertions/Specialized/FunctionAssertions.cs b/Src/FluentAssertions/Specialized/FunctionAssertions.cs index 011b961165..0219cab38f 100644 --- a/Src/FluentAssertions/Specialized/FunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/FunctionAssertions.cs @@ -12,14 +12,18 @@ namespace FluentAssertions.Specialized; [DebuggerNonUserCode] public class FunctionAssertions : DelegateAssertions, FunctionAssertions> { - public FunctionAssertions(Func subject, IExtractExceptions extractor) - : base(subject, extractor) + private readonly AssertionChain assertionChain; + + public FunctionAssertions(Func subject, IExtractExceptions extractor, AssertionChain assertionChain) + : base(subject, extractor, assertionChain) { + this.assertionChain = assertionChain; } - public FunctionAssertions(Func subject, IExtractExceptions extractor, IClock clock) - : base(subject, extractor, clock) + public FunctionAssertions(Func subject, IExtractExceptions extractor, AssertionChain assertionChain, IClock clock) + : base(subject, extractor, assertionChain, clock) { + this.assertionChain = assertionChain; } protected override void InvokeSubject() @@ -41,19 +45,30 @@ protected override void InvokeSubject() /// public AndWhichConstraint, T> NotThrow([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} not to throw{reason}, but found ."); T result = default; - if (success) + if (assertionChain.Succeeded) { - result = FunctionAssertionHelpers.NotThrow(Subject, because, becauseArgs); + try + { + result = Subject!(); + } + catch (Exception exception) + { + assertionChain + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect any exception{reason}, but found {0}.", exception); + + result = default; + } } - return new AndWhichConstraint, T>(this, result); + return new AndWhichConstraint, T>(this, result, assertionChain, ".Result"); } /// @@ -82,18 +97,50 @@ public AndWhichConstraint, T> NotThrow([StringSyntax("Comp public AndWhichConstraint, T> NotThrowAfter(TimeSpan waitTime, TimeSpan pollInterval, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} not to throw any exceptions after {0}{reason}, but found .", waitTime); T result = default; - if (success) + if (assertionChain.Succeeded) { - result = FunctionAssertionHelpers.NotThrowAfter(Subject, Clock, waitTime, pollInterval, because, becauseArgs); + result = NotThrowAfter(Subject, Clock, waitTime, pollInterval, because, becauseArgs); } - return new AndWhichConstraint, T>(this, result); + return new AndWhichConstraint, T>(this, result, assertionChain, ".Result"); + } + + internal TResult NotThrowAfter(Func subject, IClock clock, TimeSpan waitTime, TimeSpan pollInterval, + string because, object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNegative(waitTime); + Guard.ThrowIfArgumentIsNegative(pollInterval); + + TimeSpan? invocationEndTime = null; + Exception exception = null; + ITimer timer = clock.StartTimer(); + + while (invocationEndTime is null || invocationEndTime < waitTime) + { + try + { + return subject(); + } + catch (Exception ex) + { + exception = ex; + } + + clock.Delay(pollInterval); + invocationEndTime = timer.Elapsed; + } + + assertionChain + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect any exceptions after {0}{reason}, but found {1}.", waitTime, exception); + + return default; } } diff --git a/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs index 109d1918b3..ea78c3b77b 100644 --- a/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs @@ -14,20 +14,25 @@ namespace FluentAssertions.Specialized; public class GenericAsyncFunctionAssertions : AsyncFunctionAssertions, GenericAsyncFunctionAssertions> { + private readonly AssertionChain assertionChain; + /// /// Initializes a new instance of the class. /// - public GenericAsyncFunctionAssertions(Func> subject, IExtractExceptions extractor) - : this(subject, extractor, new Clock()) + public GenericAsyncFunctionAssertions(Func> subject, IExtractExceptions extractor, AssertionChain assertionChain) + : this(subject, extractor, assertionChain, new Clock()) { + this.assertionChain = assertionChain; } /// /// Initializes a new instance of the class with custom . /// - public GenericAsyncFunctionAssertions(Func> subject, IExtractExceptions extractor, IClock clock) - : base(subject, extractor, clock) + public GenericAsyncFunctionAssertions(Func> subject, IExtractExceptions extractor, AssertionChain assertionChain, + IClock clock) + : base(subject, extractor, assertionChain, clock) { + this.assertionChain = assertionChain; } /// @@ -44,34 +49,34 @@ public GenericAsyncFunctionAssertions(Func> subject, IExtractExcep public async Task, TResult>> CompleteWithinAsync( TimeSpan timeSpan, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} to complete within {0}{reason}, but found .", timeSpan); - if (success) + if (assertionChain.Succeeded) { (Task task, TimeSpan remainingTime) = InvokeWithTimer(timeSpan); - success = Execute.Assertion + assertionChain .ForCondition(remainingTime >= TimeSpan.Zero) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:task} to complete within {0}{reason}.", timeSpan); - if (success) + if (assertionChain.Succeeded) { bool completesWithinTimeout = await CompletesWithinTimeoutAsync(task, remainingTime); - success = Execute.Assertion + assertionChain .ForCondition(completesWithinTimeout) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:task} to complete within {0}{reason}.", timeSpan); } #pragma warning disable CA1849 // Call async methods when in an async method - TResult result = success ? task.Result : default; + TResult result = assertionChain.Succeeded ? task.Result : default; #pragma warning restore CA1849 // Call async methods when in an async method - return new AndWhichConstraint, TResult>(this, result); + return new AndWhichConstraint, TResult>(this, result, assertionChain, ".Result"); } return new AndWhichConstraint, TResult>(this, default(TResult)); @@ -90,17 +95,17 @@ public async Task, TR public async Task, TResult>> NotThrowAsync( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} not to throw{reason}, but found ."); - if (success) + if (assertionChain.Succeeded) { try { TResult result = await Subject!.Invoke(); - return new AndWhichConstraint, TResult>(this, result); + return new AndWhichConstraint, TResult>(this, result, assertionChain, ".Result"); } catch (Exception exception) { @@ -140,12 +145,12 @@ public Task, TResult> Guard.ThrowIfArgumentIsNegative(waitTime); Guard.ThrowIfArgumentIsNegative(pollInterval); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} not to throw any exceptions after {0}{reason}, but found .", waitTime); - if (success) + if (assertionChain.Succeeded) { return AssertionTaskAsync(); @@ -160,7 +165,7 @@ async Task, TResult>> try { TResult result = await Subject.Invoke(); - return new AndWhichConstraint, TResult>(this, result); + return new AndWhichConstraint, TResult>(this, result, assertionChain, ".Result"); } catch (Exception ex) { @@ -170,7 +175,7 @@ async Task, TResult>> } } - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Did not expect any exceptions after {0}{reason}, but found {1}.", waitTime, exception); diff --git a/Src/FluentAssertions/Specialized/NonGenericAsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/NonGenericAsyncFunctionAssertions.cs index 91f2b85022..8c672ff0d2 100644 --- a/Src/FluentAssertions/Specialized/NonGenericAsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/NonGenericAsyncFunctionAssertions.cs @@ -12,20 +12,24 @@ namespace FluentAssertions.Specialized; /// public class NonGenericAsyncFunctionAssertions : AsyncFunctionAssertions { + private readonly AssertionChain assertionChain; + /// /// Initializes a new instance of the class. /// - public NonGenericAsyncFunctionAssertions(Func subject, IExtractExceptions extractor) - : this(subject, extractor, new Clock()) + public NonGenericAsyncFunctionAssertions(Func subject, IExtractExceptions extractor, AssertionChain assertionChain) + : this(subject, extractor, assertionChain, new Clock()) { + this.assertionChain = assertionChain; } /// /// Initializes a new instance of the class with custom . /// - public NonGenericAsyncFunctionAssertions(Func subject, IExtractExceptions extractor, IClock clock) - : base(subject, extractor, clock) + public NonGenericAsyncFunctionAssertions(Func subject, IExtractExceptions extractor, AssertionChain assertionChain, IClock clock) + : base(subject, extractor, assertionChain, clock) { + this.assertionChain = assertionChain; } /// @@ -42,25 +46,25 @@ public NonGenericAsyncFunctionAssertions(Func subject, IExtractExceptions public async Task> CompleteWithinAsync( TimeSpan timeSpan, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:task} to complete within {0}{reason}, but found .", timeSpan); - if (success) + if (assertionChain.Succeeded) { (Task task, TimeSpan remainingTime) = InvokeWithTimer(timeSpan); - success = Execute.Assertion + assertionChain .ForCondition(remainingTime >= TimeSpan.Zero) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:task} to complete within {0}{reason}.", timeSpan); - if (success) + if (assertionChain.Succeeded) { bool completesWithinTimeout = await CompletesWithinTimeoutAsync(task, remainingTime); - Execute.Assertion + assertionChain .ForCondition(completesWithinTimeout) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:task} to complete within {0}{reason}.", timeSpan); @@ -83,12 +87,12 @@ public async Task> CompleteWith public async Task> NotThrowAsync( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} not to throw{reason}, but found ."); - if (success) + if (assertionChain.Succeeded) { try { @@ -132,12 +136,12 @@ public Task> NotThrowAfterAsync Guard.ThrowIfArgumentIsNegative(waitTime); Guard.ThrowIfArgumentIsNegative(pollInterval); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} not to throw any exceptions after {0}{reason}, but found .", waitTime); - if (success) + if (assertionChain.Succeeded) { return AssertionTaskAsync(); @@ -160,7 +164,7 @@ async Task> AssertionTaskAsync( invocationEndTime = timer.Elapsed; } - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Did not expect any exceptions after {0}{reason}, but found {1}.", waitTime, exception); diff --git a/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs b/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs index a79d9d5cf2..0081053767 100644 --- a/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs +++ b/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs @@ -12,17 +12,20 @@ namespace FluentAssertions.Specialized; #if NET6_0_OR_GREATER public class TaskCompletionSourceAssertions : TaskCompletionSourceAssertionsBase { + private readonly AssertionChain assertionChain; private readonly TaskCompletionSource subject; - public TaskCompletionSourceAssertions(TaskCompletionSource tcs) - : this(tcs, new Clock()) + public TaskCompletionSourceAssertions(TaskCompletionSource tcs, AssertionChain assertionChain) + : this(tcs, assertionChain, new Clock()) { + this.assertionChain = assertionChain; } - public TaskCompletionSourceAssertions(TaskCompletionSource tcs, IClock clock) + public TaskCompletionSourceAssertions(TaskCompletionSource tcs, AssertionChain assertionChain, IClock clock) : base(clock) { subject = tcs; + this.assertionChain = assertionChain; } /// @@ -39,15 +42,15 @@ public TaskCompletionSourceAssertions(TaskCompletionSource tcs, IClock clock) public async Task> CompleteWithinAsync( TimeSpan timeSpan, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - var success = Execute.Assertion + assertionChain .ForCondition(subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} to complete within {0}{reason}, but found .", timeSpan); - if (success) + if (assertionChain.Succeeded) { bool completesWithinTimeout = await CompletesWithinTimeoutAsync(subject!.Task, timeSpan); - Execute.Assertion + assertionChain .ForCondition(completesWithinTimeout) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:task} to complete within {0}{reason}.", timeSpan); @@ -70,15 +73,15 @@ public async Task> CompleteWithinA public async Task> NotCompleteWithinAsync( TimeSpan timeSpan, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - var success = Execute.Assertion + assertionChain .ForCondition(subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} to not complete within {0}{reason}, but found .", timeSpan); - if (success) + if (assertionChain.Succeeded) { bool completesWithinTimeout = await CompletesWithinTimeoutAsync(subject!.Task, timeSpan); - Execute.Assertion + assertionChain .ForCondition(!completesWithinTimeout) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:task} to not complete within {0}{reason}.", timeSpan); @@ -91,17 +94,20 @@ public async Task> NotCompleteWith public class TaskCompletionSourceAssertions : TaskCompletionSourceAssertionsBase { + private readonly AssertionChain assertionChain; private readonly TaskCompletionSource subject; - public TaskCompletionSourceAssertions(TaskCompletionSource tcs) - : this(tcs, new Clock()) + public TaskCompletionSourceAssertions(TaskCompletionSource tcs, AssertionChain assertionChain) + : this(tcs, assertionChain, new Clock()) { + this.assertionChain = assertionChain; } - public TaskCompletionSourceAssertions(TaskCompletionSource tcs, IClock clock) + public TaskCompletionSourceAssertions(TaskCompletionSource tcs, AssertionChain assertionChain, IClock clock) : base(clock) { subject = tcs; + this.assertionChain = assertionChain; } /// @@ -118,16 +124,16 @@ public TaskCompletionSourceAssertions(TaskCompletionSource tcs, IClock clock) public async Task, T>> CompleteWithinAsync( TimeSpan timeSpan, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - var success = Execute.Assertion + assertionChain .ForCondition(subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} to complete within {0}{reason}, but found .", timeSpan); - if (success) + if (assertionChain.Succeeded) { bool completesWithinTimeout = await CompletesWithinTimeoutAsync(subject!.Task, timeSpan); - Execute.Assertion + assertionChain .ForCondition(completesWithinTimeout) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:task} to complete within {0}{reason}.", timeSpan); @@ -135,7 +141,7 @@ public async Task, T>> Comp #pragma warning disable CA1849 // Call async methods when in an async method T result = subject.Task.IsCompleted ? subject.Task.Result : default; #pragma warning restore CA1849 // Call async methods when in an async method - return new AndWhichConstraint, T>(this, result); + return new AndWhichConstraint, T>(this, result, assertionChain, ".Result"); } return new AndWhichConstraint, T>(this, default(T)); @@ -155,16 +161,16 @@ public async Task, T>> Comp public async Task>> NotCompleteWithinAsync( TimeSpan timeSpan, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - var success = Execute.Assertion + assertionChain .ForCondition(subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context} to complete within {0}{reason}, but found .", timeSpan); - if (success) + if (assertionChain.Succeeded) { bool completesWithinTimeout = await CompletesWithinTimeoutAsync(subject!.Task, timeSpan); - Execute.Assertion + assertionChain .ForCondition(!completesWithinTimeout) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:task} to complete within {0}{reason}.", timeSpan); diff --git a/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs b/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs index 70ce652d07..0233d67c38 100644 --- a/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs +++ b/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs @@ -1,9 +1,6 @@ using System.Diagnostics; using System.IO; -#if NET6_0_OR_GREATER || NETSTANDARD2_1 -using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; -#endif namespace FluentAssertions.Streams; @@ -14,8 +11,8 @@ namespace FluentAssertions.Streams; [DebuggerNonUserCode] public class BufferedStreamAssertions : BufferedStreamAssertions { - public BufferedStreamAssertions(BufferedStream stream) - : base(stream) + public BufferedStreamAssertions(BufferedStream stream, AssertionChain assertionChain) + : base(stream, assertionChain) { } } @@ -23,14 +20,16 @@ public BufferedStreamAssertions(BufferedStream stream) public class BufferedStreamAssertions : StreamAssertions where TAssertions : BufferedStreamAssertions { - public BufferedStreamAssertions(BufferedStream stream) - : base(stream) +#if NET6_0_OR_GREATER || NETSTANDARD2_1 + + private readonly AssertionChain assertionChain; + + public BufferedStreamAssertions(BufferedStream stream, AssertionChain assertionChain) + : base(stream, assertionChain) { + this.assertionChain = assertionChain; } - protected override string Identifier => "buffered stream"; - -#if NET6_0_OR_GREATER || NETSTANDARD2_1 /// /// Asserts that the current has the buffer size. /// @@ -42,18 +41,17 @@ public BufferedStreamAssertions(BufferedStream stream) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveBufferSize(int expected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint HaveBufferSize(int expected, string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected the buffer size of {context:stream} to be {0}{reason}, but found a reference.", expected); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject!.BufferSize == expected) .FailWith("Expected the buffer size of {context:stream} to be {0}{reason}, but it was {1}.", @@ -74,18 +72,17 @@ public AndConstraint HaveBufferSize(int expected, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveBufferSize(int unexpected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotHaveBufferSize(int unexpected, string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected the buffer size of {context:stream} not to be {0}{reason}, but found a reference.", unexpected); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject!.BufferSize != unexpected) .FailWith("Expected the buffer size of {context:stream} not to be {0}{reason}, but it was.", @@ -94,5 +91,12 @@ public AndConstraint NotHaveBufferSize(int unexpected, return new AndConstraint((TAssertions)this); } +#else + public BufferedStreamAssertions(BufferedStream stream, AssertionChain assertionChain) + : base(stream, assertionChain) + { + } #endif + + protected override string Identifier => "buffered stream"; } diff --git a/Src/FluentAssertions/Streams/StreamAssertions.cs b/Src/FluentAssertions/Streams/StreamAssertions.cs index 7b61dd41f8..3116721541 100644 --- a/Src/FluentAssertions/Streams/StreamAssertions.cs +++ b/Src/FluentAssertions/Streams/StreamAssertions.cs @@ -13,8 +13,8 @@ namespace FluentAssertions.Streams; [DebuggerNonUserCode] public class StreamAssertions : StreamAssertions { - public StreamAssertions(Stream stream) - : base(stream) + public StreamAssertions(Stream stream, AssertionChain assertionChain) + : base(stream, assertionChain) { } } @@ -26,9 +26,12 @@ public class StreamAssertions : ReferenceTypeAssertions { - public StreamAssertions(TSubject stream) - : base(stream) + private readonly AssertionChain assertionChain; + + public StreamAssertions(TSubject stream, AssertionChain assertionChain) + : base(stream, assertionChain) { + this.assertionChain = assertionChain; } protected override string Identifier => "stream"; @@ -45,14 +48,14 @@ public StreamAssertions(TSubject stream) /// public AndConstraint BeWritable([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:stream} to be writable{reason}, but found a reference."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject!.CanWrite) .FailWith("Expected {context:stream} to be writable{reason}, but it was not."); @@ -73,14 +76,14 @@ public AndConstraint BeWritable([StringSyntax("CompositeFormat")] s /// public AndConstraint NotBeWritable([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:stream} not to be writable{reason}, but found a reference."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!Subject!.CanWrite) .FailWith("Expected {context:stream} not to be writable{reason}, but it was."); @@ -101,14 +104,14 @@ public AndConstraint NotBeWritable([StringSyntax("CompositeFormat") /// public AndConstraint BeSeekable([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:stream} to be seekable{reason}, but found a reference."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject!.CanSeek) .FailWith("Expected {context:stream} to be seekable{reason}, but it was not."); @@ -129,14 +132,14 @@ public AndConstraint BeSeekable([StringSyntax("CompositeFormat")] s /// public AndConstraint NotBeSeekable([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:stream} not to be seekable{reason}, but found a reference."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!Subject!.CanSeek) .FailWith("Expected {context:stream} not to be seekable{reason}, but it was."); @@ -157,14 +160,14 @@ public AndConstraint NotBeSeekable([StringSyntax("CompositeFormat") /// public AndConstraint BeReadable([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:stream} to be readable{reason}, but found a reference."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject!.CanRead) .FailWith("Expected {context:stream} to be readable{reason}, but it was not."); @@ -185,14 +188,14 @@ public AndConstraint BeReadable([StringSyntax("CompositeFormat")] s /// public AndConstraint NotBeReadable([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:stream} not to be readable{reason}, but found a reference."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!Subject!.CanRead) .FailWith("Expected {context:stream} not to be readable{reason}, but it was."); @@ -215,13 +218,13 @@ public AndConstraint NotBeReadable([StringSyntax("CompositeFormat") public AndConstraint HavePosition(long expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected the position of {context:stream} to be {0}{reason}, but found a reference.", expected); - if (success) + if (assertionChain.Succeeded) { long position; @@ -232,7 +235,7 @@ public AndConstraint HavePosition(long expected, catch (Exception exception) when (exception is IOException or NotSupportedException or ObjectDisposedException) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected the position of {context:stream} to be {0}{reason}, but it failed with:" + Environment.NewLine + "{1}", @@ -241,7 +244,7 @@ public AndConstraint HavePosition(long expected, return new AndConstraint((TAssertions)this); } - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(position == expected) .FailWith("Expected the position of {context:stream} to be {0}{reason}, but it was {1}.", @@ -265,13 +268,13 @@ public AndConstraint HavePosition(long expected, public AndConstraint NotHavePosition(long unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected the position of {context:stream} not to be {0}{reason}, but found a reference.", unexpected); - if (success) + if (assertionChain.Succeeded) { long position; @@ -282,7 +285,7 @@ public AndConstraint NotHavePosition(long unexpected, catch (Exception exception) when (exception is IOException or NotSupportedException or ObjectDisposedException) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected the position of {context:stream} not to be {0}{reason}, but it failed with:" + Environment.NewLine + "{1}", @@ -291,7 +294,7 @@ public AndConstraint NotHavePosition(long unexpected, return new AndConstraint((TAssertions)this); } - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(position != unexpected) .FailWith("Expected the position of {context:stream} not to be {0}{reason}, but it was.", @@ -315,13 +318,13 @@ public AndConstraint NotHavePosition(long unexpected, public AndConstraint HaveLength(long expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected the length of {context:stream} to be {0}{reason}, but found a reference.", expected); - if (success) + if (assertionChain.Succeeded) { long length; @@ -332,7 +335,7 @@ public AndConstraint HaveLength(long expected, catch (Exception exception) when (exception is IOException or NotSupportedException or ObjectDisposedException) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected the length of {context:stream} to be {0}{reason}, but it failed with:" + Environment.NewLine + "{1}", @@ -341,7 +344,7 @@ public AndConstraint HaveLength(long expected, return new AndConstraint((TAssertions)this); } - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(length == expected) .FailWith("Expected the length of {context:stream} to be {0}{reason}, but it was {1}.", @@ -365,13 +368,13 @@ public AndConstraint HaveLength(long expected, public AndConstraint NotHaveLength(long unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected the length of {context:stream} not to be {0}{reason}, but found a reference.", unexpected); - if (success) + if (assertionChain.Succeeded) { long length; @@ -382,7 +385,7 @@ public AndConstraint NotHaveLength(long unexpected, catch (Exception exception) when (exception is IOException or NotSupportedException or ObjectDisposedException) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected the length of {context:stream} not to be {0}{reason}, but it failed with:" + Environment.NewLine + "{1}", @@ -391,7 +394,7 @@ public AndConstraint NotHaveLength(long unexpected, return new AndConstraint((TAssertions)this); } - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(length != unexpected) .FailWith("Expected the length of {context:stream} not to be {0}{reason}, but it was.", @@ -413,14 +416,14 @@ public AndConstraint NotHaveLength(long unexpected, /// public AndConstraint BeReadOnly([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:stream} to be read-only{reason}, but found a reference."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!Subject!.CanWrite && Subject.CanRead) .FailWith("Expected {context:stream} to be read-only{reason}, but it was writable or not readable."); @@ -441,14 +444,14 @@ public AndConstraint BeReadOnly([StringSyntax("CompositeFormat")] s /// public AndConstraint NotBeReadOnly([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:stream} not to be read-only{reason}, but found a reference."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject!.CanWrite || !Subject.CanRead) .FailWith("Expected {context:stream} not to be read-only{reason}, but it was."); @@ -469,14 +472,14 @@ public AndConstraint NotBeReadOnly([StringSyntax("CompositeFormat") /// public AndConstraint BeWriteOnly([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:stream} to be write-only{reason}, but found a reference."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject!.CanWrite && !Subject.CanRead) .FailWith("Expected {context:stream} to be write-only{reason}, but it was readable or not writable."); @@ -497,14 +500,14 @@ public AndConstraint BeWriteOnly([StringSyntax("CompositeFormat")] /// public AndConstraint NotBeWriteOnly([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected {context:stream} not to be write-only{reason}, but found a reference."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!Subject!.CanWrite || Subject.CanRead) .FailWith("Expected {context:stream} not to be write-only{reason}, but it was."); diff --git a/Src/FluentAssertions/Types/AssemblyAssertions.cs b/Src/FluentAssertions/Types/AssemblyAssertions.cs index 91e170fa67..5ceac78772 100644 --- a/Src/FluentAssertions/Types/AssemblyAssertions.cs +++ b/Src/FluentAssertions/Types/AssemblyAssertions.cs @@ -14,12 +14,15 @@ namespace FluentAssertions.Types; /// public class AssemblyAssertions : ReferenceTypeAssertions { + private readonly AssertionChain assertionChain; + /// /// Initializes a new instance of the class. /// - public AssemblyAssertions(Assembly assembly) - : base(assembly) + public AssemblyAssertions(Assembly assembly, AssertionChain assertionChain) + : base(assembly, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -41,19 +44,19 @@ public AndConstraint NotReference(Assembly assembly, var assemblyName = assembly.GetName().Name; - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected assembly not to reference assembly {0}{reason}, but {context:assembly} is .", assemblyName); - if (success) + if (assertionChain.Succeeded) { var subjectName = Subject!.GetName().Name; IEnumerable references = Subject.GetReferencedAssemblies().Select(x => x.Name); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!references.Contains(assemblyName)) .FailWith("Expected assembly {0} not to reference assembly {1}{reason}.", subjectName, assemblyName); @@ -81,18 +84,18 @@ public AndConstraint Reference(Assembly assembly, var assemblyName = assembly.GetName().Name; - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected assembly to reference assembly {0}{reason}, but {context:assembly} is .", assemblyName); - if (success) + if (assertionChain.Succeeded) { var subjectName = Subject!.GetName().Name; IEnumerable references = Subject.GetReferencedAssemblies().Select(x => x.Name); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(references.Contains(assemblyName)) .FailWith("Expected assembly {0} to reference assembly {1}{reason}, but it does not.", subjectName, assemblyName); @@ -120,7 +123,7 @@ public AndWhichConstraint DefineType(string @namespace { Guard.ThrowIfArgumentIsNullOrEmpty(name); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected assembly to define type {0}.{1}{reason}, but {context:assembly} is .", @@ -128,11 +131,11 @@ public AndWhichConstraint DefineType(string @namespace Type foundType = null; - if (success) + if (assertionChain.Succeeded) { foundType = Subject!.GetTypes().SingleOrDefault(t => t.Namespace == @namespace && t.Name == name); - Execute.Assertion + assertionChain .ForCondition(foundType is not null) .BecauseOf(because, becauseArgs) .FailWith("Expected assembly {0} to define type {1}.{2}{reason}, but it does not.", @@ -150,15 +153,16 @@ public AndWhichConstraint DefineType(string @namespace /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeUnsigned([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint BeUnsigned([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .FailWith("Can't check for assembly signing if {context:assembly} reference is ."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject!.GetName().GetPublicKey() is not { Length: > 0 }) .FailWith( @@ -181,29 +185,28 @@ public AndConstraint BeUnsigned([StringSyntax("CompositeForm /// /// is . /// is empty. - public AndConstraint BeSignedWithPublicKey(string publicKey, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint BeSignedWithPublicKey(string publicKey, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNullOrEmpty(publicKey); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .FailWith("Can't check for assembly signing if {context:assembly} reference is ."); - if (success) + if (assertionChain.Succeeded) { var bytes = Subject!.GetName().GetPublicKey() ?? []; string assemblyKey = ToHexString(bytes); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected assembly {0} to have public key {1} ", Subject.FullName, publicKey) - .ForCondition(bytes.Length != 0) - .FailWith("{reason}, but it is unsigned.") - .Then - .ForCondition(string.Equals(assemblyKey, publicKey, StringComparison.OrdinalIgnoreCase)) - .FailWith("{reason}, but it has {0} instead.", assemblyKey) - .Then - .ClearExpectation(); + .WithExpectation("Expected assembly {0} to have public key {1} ", Subject.FullName, publicKey, chain => chain + .ForCondition(bytes.Length != 0) + .FailWith("{reason}, but it is unsigned.") + .Then + .ForCondition(string.Equals(assemblyKey, publicKey, StringComparison.OrdinalIgnoreCase)) + .FailWith("{reason}, but it has {0} instead.", assemblyKey)); } return new AndConstraint(this); diff --git a/Src/FluentAssertions/Types/ConstructorInfoAssertions.cs b/Src/FluentAssertions/Types/ConstructorInfoAssertions.cs index cb66005a01..8c1d105952 100644 --- a/Src/FluentAssertions/Types/ConstructorInfoAssertions.cs +++ b/Src/FluentAssertions/Types/ConstructorInfoAssertions.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.Reflection; +using FluentAssertions.Execution; namespace FluentAssertions.Types; @@ -13,17 +14,18 @@ public class ConstructorInfoAssertions : MethodBaseAssertions class. /// /// The constructorInfo from which to select properties. - public ConstructorInfoAssertions(ConstructorInfo constructorInfo) - : base(constructorInfo) + /// + public ConstructorInfoAssertions(ConstructorInfo constructorInfo, AssertionChain assertionChain) + : base(constructorInfo, assertionChain) { } - internal static string GetDescriptionFor(ConstructorInfo constructorInfo) + private protected override string SubjectDescription => GetDescriptionFor(Subject); + + protected override string Identifier => "constructor"; + + private static string GetDescriptionFor(ConstructorInfo constructorInfo) { return $"{constructorInfo.DeclaringType}({GetParameterString(constructorInfo)})"; } - - internal override string SubjectDescription => GetDescriptionFor(Subject); - - protected override string Identifier => "constructor"; } diff --git a/Src/FluentAssertions/Types/MemberInfoAssertions.cs b/Src/FluentAssertions/Types/MemberInfoAssertions.cs index 082e9de153..348d8f484f 100644 --- a/Src/FluentAssertions/Types/MemberInfoAssertions.cs +++ b/Src/FluentAssertions/Types/MemberInfoAssertions.cs @@ -19,9 +19,12 @@ public abstract class MemberInfoAssertions : ReferenceTyp where TSubject : MemberInfo where TAssertions : MemberInfoAssertions { - protected MemberInfoAssertions(TSubject subject) - : base(subject) + private readonly AssertionChain assertionChain; + + protected MemberInfoAssertions(TSubject subject, AssertionChain assertionChain) + : base(subject, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -80,7 +83,7 @@ public AndWhichConstraint, TAttribut { Guard.ThrowIfArgumentIsNull(isMatchingAttributePredicate); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith( @@ -89,11 +92,11 @@ public AndWhichConstraint, TAttribut IEnumerable attributes = []; - if (success) + if (assertionChain.Succeeded) { attributes = Subject.GetMatchingAttributes(isMatchingAttributePredicate); - Execute.Assertion + assertionChain .ForCondition(attributes.Any()) .BecauseOf(because, becauseArgs) .FailWith( @@ -126,18 +129,18 @@ public AndConstraint NotBeDecoratedWith( { Guard.ThrowIfArgumentIsNull(isMatchingAttributePredicate); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith( $"Expected {Identifier} to not be decorated with {typeof(TAttribute)}{{reason}}" + ", but {context:member} is ."); - if (success) + if (assertionChain.Succeeded) { IEnumerable attributes = Subject.GetMatchingAttributes(isMatchingAttributePredicate); - Execute.Assertion + assertionChain .ForCondition(!attributes.Any()) .BecauseOf(because, becauseArgs) .FailWith( @@ -150,5 +153,5 @@ public AndConstraint NotBeDecoratedWith( protected override string Identifier => "member"; - internal virtual string SubjectDescription => $"{Subject.DeclaringType}.{Subject.Name}"; + private protected virtual string SubjectDescription => $"{Subject.DeclaringType}.{Subject.Name}"; } diff --git a/Src/FluentAssertions/Types/MethodBaseAssertions.cs b/Src/FluentAssertions/Types/MethodBaseAssertions.cs index c45591c3c6..042c34b27e 100644 --- a/Src/FluentAssertions/Types/MethodBaseAssertions.cs +++ b/Src/FluentAssertions/Types/MethodBaseAssertions.cs @@ -17,9 +17,12 @@ public abstract class MethodBaseAssertions : MemberInfoAs where TSubject : MethodBase where TAssertions : MethodBaseAssertions { - protected MethodBaseAssertions(TSubject subject) - : base(subject) + private readonly AssertionChain assertionChain; + + protected MethodBaseAssertions(TSubject subject, AssertionChain assertionChain) + : base(subject, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -41,20 +44,27 @@ public AndConstraint HaveAccessModifier( { Guard.ThrowIfArgumentIsOutOfRange(accessModifier); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) - .FailWith($"Expected method to be {accessModifier}{{reason}}, but {{context:member}} is ."); + .FailWith($"Expected method to be {accessModifier}{{reason}}, but {{context:method}} is ."); - if (success) + if (assertionChain.Succeeded) { CSharpAccessModifier subjectAccessModifier = Subject.GetCSharpAccessModifier(); - Execute.Assertion + assertionChain .ForCondition(accessModifier == subjectAccessModifier) .BecauseOf(because, becauseArgs) - .FailWith( - $"Expected method {Subject!.Name} to be {accessModifier}{{reason}}, but it is {subjectAccessModifier}."); + .FailWith(() => + { + var subject = assertionChain.HasOverriddenCallerIdentifier + ? assertionChain.CallerIdentifier + : "method " + Subject.ToFormattedString(); + + return new FailReason( + $"Expected {subject} to be {accessModifier}{{reason}}, but it is {subjectAccessModifier}."); + }); } return new AndConstraint((TAssertions)this); @@ -78,19 +88,26 @@ public AndConstraint NotHaveAccessModifier(CSharpAccessModifier acc { Guard.ThrowIfArgumentIsOutOfRange(accessModifier); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith($"Expected method not to be {accessModifier}{{reason}}, but {{context:member}} is ."); - if (success) + if (assertionChain.Succeeded) { CSharpAccessModifier subjectAccessModifier = Subject.GetCSharpAccessModifier(); - Execute.Assertion + assertionChain .ForCondition(accessModifier != subjectAccessModifier) .BecauseOf(because, becauseArgs) - .FailWith($"Expected method {Subject!.Name} not to be {accessModifier}{{reason}}, but it is."); + .FailWith(() => + { + var subject = assertionChain.HasOverriddenCallerIdentifier + ? assertionChain.CallerIdentifier + : "method " + Subject.ToFormattedString(); + + return new FailReason($"Expected {subject} not to be {accessModifier}{{reason}}, but it is."); + }); } return new AndConstraint((TAssertions)this); diff --git a/Src/FluentAssertions/Types/MethodInfoAssertions.cs b/Src/FluentAssertions/Types/MethodInfoAssertions.cs index c4dff054eb..cfd799d9d5 100644 --- a/Src/FluentAssertions/Types/MethodInfoAssertions.cs +++ b/Src/FluentAssertions/Types/MethodInfoAssertions.cs @@ -13,9 +13,12 @@ namespace FluentAssertions.Types; [DebuggerNonUserCode] public class MethodInfoAssertions : MethodBaseAssertions { - public MethodInfoAssertions(MethodInfo methodInfo) - : base(methodInfo) + private readonly AssertionChain assertionChain; + + public MethodInfoAssertions(MethodInfo methodInfo, AssertionChain assertionChain) + : base(methodInfo, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -30,14 +33,14 @@ public MethodInfoAssertions(MethodInfo methodInfo) /// public AndConstraint BeVirtual([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected method to be virtual{reason}, but {context:member} is ."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(!Subject.IsNonVirtual()) .BecauseOf(because, becauseArgs) .FailWith("Expected method " + SubjectDescription + " to be virtual{reason}, but it is not virtual."); @@ -58,14 +61,14 @@ public AndConstraint BeVirtual([StringSyntax("CompositeFor /// public AndConstraint NotBeVirtual([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected method not to be virtual{reason}, but {context:member} is ."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(Subject.IsNonVirtual()) .BecauseOf(because, becauseArgs) .FailWith("Expected method " + SubjectDescription + " not to be virtual{reason}, but it is."); @@ -86,14 +89,14 @@ public AndConstraint NotBeVirtual([StringSyntax("Composite /// public AndConstraint BeAsync([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected method to be async{reason}, but {context:member} is ."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(Subject.IsAsync()) .BecauseOf(because, becauseArgs) .FailWith("Expected method " + SubjectDescription + " to be async{reason}, but it is not."); @@ -114,14 +117,14 @@ public AndConstraint BeAsync([StringSyntax("CompositeForma /// public AndConstraint NotBeAsync([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected method not to be async{reason}, but {context:member} is ."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(!Subject.IsAsync()) .BecauseOf(because, becauseArgs) .FailWith("Expected method " + SubjectDescription + " not to be async{reason}, but it is."); @@ -143,14 +146,14 @@ public AndConstraint NotBeAsync([StringSyntax("CompositeFo public AndConstraint> ReturnVoid( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected the return type of method to be void{reason}, but {context:member} is ."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(typeof(void) == Subject!.ReturnType) .BecauseOf(because, becauseArgs) .FailWith("Expected the return type of method " + Subject.Name + " to be void{reason}, but it is {0}.", @@ -177,14 +180,14 @@ public AndConstraint> Ret { Guard.ThrowIfArgumentIsNull(returnType); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected the return type of method to be {0}{reason}, but {context:member} is .", returnType); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(returnType == Subject!.ReturnType) .BecauseOf(because, becauseArgs) .FailWith("Expected the return type of method " + Subject.Name + " to be {0}{reason}, but it is {1}.", @@ -224,14 +227,14 @@ public AndConstraint> Ret public AndConstraint> NotReturnVoid( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected the return type of method not to be void{reason}, but {context:member} is ."); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(typeof(void) != Subject!.ReturnType) .BecauseOf(because, becauseArgs) .FailWith("Expected the return type of method " + Subject.Name + " not to be void{reason}, but it is."); @@ -257,15 +260,15 @@ public AndConstraint> Not { Guard.ThrowIfArgumentIsNull(returnType); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith( "Expected the return type of method not to be {0}{reason}, but {context:member} is .", returnType); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(returnType != Subject!.ReturnType) .BecauseOf(because, becauseArgs) .FailWith( @@ -304,7 +307,7 @@ internal static string GetDescriptionFor(MethodInfo method) return $"{returnTypeName} {method.DeclaringType}.{method.Name}"; } - internal override string SubjectDescription => GetDescriptionFor(Subject); + private protected override string SubjectDescription => GetDescriptionFor(Subject); protected override string Identifier => "method"; } diff --git a/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs b/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs index dfc2effa49..71b3c51213 100644 --- a/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs +++ b/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs @@ -18,13 +18,16 @@ namespace FluentAssertions.Types; [DebuggerNonUserCode] public class MethodInfoSelectorAssertions { + private readonly AssertionChain assertionChain; + /// /// Initializes a new instance of the class. /// /// The methods to assert. /// is . - public MethodInfoSelectorAssertions(params MethodInfo[] methods) + public MethodInfoSelectorAssertions(AssertionChain assertionChain, params MethodInfo[] methods) { + this.assertionChain = assertionChain; Guard.ThrowIfArgumentIsNull(methods); SubjectMethods = methods; @@ -54,7 +57,7 @@ public AndConstraint BeVirtual([StringSyntax("Comp Environment.NewLine + GetDescriptionsFor(nonVirtualMethods); - Execute.Assertion + assertionChain .ForCondition(nonVirtualMethods.Length == 0) .BecauseOf(because, becauseArgs) .FailWith(failureMessage); @@ -81,7 +84,7 @@ public AndConstraint NotBeVirtual([StringSyntax("C Environment.NewLine + GetDescriptionsFor(virtualMethods); - Execute.Assertion + assertionChain .ForCondition(virtualMethods.Length == 0) .BecauseOf(because, becauseArgs) .FailWith(failureMessage); @@ -118,7 +121,7 @@ public AndConstraint BeAsync([StringSyntax("Compos Environment.NewLine + GetDescriptionsFor(nonAsyncMethods); - Execute.Assertion + assertionChain .ForCondition(nonAsyncMethods.Length == 0) .BecauseOf(because, becauseArgs) .FailWith(failureMessage); @@ -145,7 +148,7 @@ public AndConstraint NotBeAsync([StringSyntax("Com Environment.NewLine + GetDescriptionsFor(asyncMethods); - Execute.Assertion + assertionChain .ForCondition(asyncMethods.Length == 0) .BecauseOf(because, becauseArgs) .FailWith(failureMessage); @@ -199,7 +202,7 @@ public AndConstraint BeDecoratedWith( Environment.NewLine + GetDescriptionsFor(methodsWithoutAttribute); - Execute.Assertion + assertionChain .ForCondition(methodsWithoutAttribute.Length == 0) .BecauseOf(because, becauseArgs) .FailWith(failureMessage, typeof(TAttribute)); @@ -253,7 +256,7 @@ public AndConstraint NotBeDecoratedWith Be(CSharpAccessModifier acces var message = $"Expected all selected methods to be {accessModifier}{{reason}}, but the following methods are not:" + Environment.NewLine + GetDescriptionsFor(methods); - Execute.Assertion + assertionChain .ForCondition(methods.Length == 0) .BecauseOf(because, becauseArgs) .FailWith(message); @@ -307,7 +310,7 @@ public AndConstraint NotBe(CSharpAccessModifier ac var message = $"Expected all selected methods to not be {accessModifier}{{reason}}, but the following methods are:" + Environment.NewLine + GetDescriptionsFor(methods); - Execute.Assertion + assertionChain .ForCondition(methods.Length == 0) .BecauseOf(because, becauseArgs) .FailWith(message); diff --git a/Src/FluentAssertions/Types/PropertyInfoAssertions.cs b/Src/FluentAssertions/Types/PropertyInfoAssertions.cs index 0201ccde6b..85ada02e77 100644 --- a/Src/FluentAssertions/Types/PropertyInfoAssertions.cs +++ b/Src/FluentAssertions/Types/PropertyInfoAssertions.cs @@ -4,6 +4,7 @@ using System.Reflection; using FluentAssertions.Common; using FluentAssertions.Execution; +using FluentAssertions.Formatting; namespace FluentAssertions.Types; @@ -13,9 +14,12 @@ namespace FluentAssertions.Types; [DebuggerNonUserCode] public class PropertyInfoAssertions : MemberInfoAssertions { - public PropertyInfoAssertions(PropertyInfo propertyInfo) - : base(propertyInfo) + private readonly AssertionChain assertionChain; + + public PropertyInfoAssertions(PropertyInfo propertyInfo, AssertionChain assertionChain) + : base(propertyInfo, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -31,18 +35,21 @@ public PropertyInfoAssertions(PropertyInfo propertyInfo) public AndConstraint BeVirtual( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) - .FailWith("Expected property to be virtual{reason}, but {context:property} is ."); + .FailWith("Expected property to be virtual{reason}, but {context:property} is .") + .Then + .ForCondition(Subject.IsVirtual()) + .BecauseOf(because, becauseArgs) + .FailWith(() => + { + var subjectDescription = assertionChain.HasOverriddenCallerIdentifier + ? assertionChain.CallerIdentifier + : "property " + Subject.ToFormattedString(); - if (success) - { - Execute.Assertion - .ForCondition(Subject.IsVirtual()) - .BecauseOf(because, becauseArgs) - .FailWith($"Expected property {GetDescriptionFor(Subject)} to be virtual{{reason}}, but it is not."); - } + return new FailReason($"Expected {subjectDescription} to be virtual{{reason}}, but it is not."); + }); return new AndConstraint(this); } @@ -57,20 +64,24 @@ public AndConstraint BeVirtual( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeVirtual([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotBeVirtual([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) - .FailWith("Expected property not to be virtual{reason}, but {context:property} is ."); + .FailWith("Expected property not to be virtual{reason}, but {context:property} is .") + .Then + .ForCondition(!Subject.IsVirtual()) + .BecauseOf(because, becauseArgs) + .FailWith(() => + { + var subjectDescription = assertionChain.HasOverriddenCallerIdentifier + ? assertionChain.CallerIdentifier + : "property " + Subject.ToFormattedString(); - if (success) - { - Execute.Assertion - .ForCondition(!Subject.IsVirtual()) - .BecauseOf(because, becauseArgs) - .FailWith($"Expected property {GetDescriptionFor(Subject)} not to be virtual{{reason}}, but it is."); - } + return new FailReason($"Expected property {subjectDescription} not to be virtual{{reason}}, but it is."); + }); return new AndConstraint(this); } @@ -88,20 +99,21 @@ public AndConstraint NotBeVirtual([StringSyntax("Composi public AndConstraint BeWritable( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) - .FailWith("Expected property to have a setter{reason}, but {context:property} is ."); + .FailWith("Expected property to have a setter{reason}, but {context:property} is .") + .Then + .ForCondition(Subject!.CanWrite) + .BecauseOf(because, becauseArgs) + .FailWith(() => + { + var subjectDescription = assertionChain.HasOverriddenCallerIdentifier + ? assertionChain.CallerIdentifier + : "property " + Subject.ToFormattedString(); - if (success) - { - Execute.Assertion - .ForCondition(Subject!.CanWrite) - .BecauseOf(because, becauseArgs) - .FailWith( - "Expected {context:property} {0} to have a setter{reason}.", - Subject); - } + return new FailReason($"Expected {subjectDescription} to have a setter{{reason}}."); + }); return new AndConstraint(this); } @@ -124,24 +136,25 @@ public AndConstraint BeWritable(CSharpAccessModifier acc { Guard.ThrowIfArgumentIsOutOfRange(accessModifier); - bool success = Execute.Assertion + var subjectDescription = assertionChain.HasOverriddenCallerIdentifier + ? assertionChain.CallerIdentifier + : "property " + Subject.ToFormattedString(); + + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) - .FailWith($"Expected {Identifier} to be {accessModifier}{{reason}}, but {{context:property}} is ."); + .FailWith($"Expected {{context:project}} to be {accessModifier}{{reason}}, but it is .") + .Then + .ForCondition(Subject!.CanWrite) + .BecauseOf(because, becauseArgs) + .FailWith($"Expected {subjectDescription} to have a setter{{reason}}."); - if (success) + if (assertionChain.Succeeded) { - success = Execute.Assertion - .ForCondition(Subject!.CanWrite) - .BecauseOf(because, becauseArgs) - .FailWith( - "Expected {context:property} {0} to have a setter{reason}.", - Subject); - - if (success) - { - Subject!.GetSetMethod(nonPublic: true).Should().HaveAccessModifier(accessModifier, because, becauseArgs); - } + assertionChain.OverrideCallerIdentifier(() => "setter of " + subjectDescription); + assertionChain.ReuseOnce(); + + Subject!.GetSetMethod(nonPublic: true).Should().HaveAccessModifier(accessModifier, because, becauseArgs); } return new AndConstraint(this); @@ -160,20 +173,21 @@ public AndConstraint BeWritable(CSharpAccessModifier acc public AndConstraint NotBeWritable( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) - .FailWith("Expected property not to have a setter{reason}, but {context:property} is ."); + .FailWith("Expected {context:property} not to have a setter{reason}, but it is .") + .Then + .ForCondition(!Subject!.CanWrite) + .BecauseOf(because, becauseArgs) + .FailWith(() => + { + var subjectDescription = assertionChain.HasOverriddenCallerIdentifier + ? assertionChain.CallerIdentifier + : "property " + Subject.ToFormattedString(); - if (success) - { - Execute.Assertion - .ForCondition(!Subject!.CanWrite) - .BecauseOf(because, becauseArgs) - .FailWith( - "Expected {context:property} {0} not to have a setter{reason}.", - Subject); - } + return new FailReason($"Did not expect {subjectDescription} to have a setter{{reason}}."); + }); return new AndConstraint(this); } @@ -188,19 +202,24 @@ public AndConstraint NotBeWritable( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeReadable([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint BeReadable([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) - .FailWith("Expected property to have a getter{reason}, but {context:property} is ."); + .FailWith("Expected property to have a getter{reason}, but {context:property} is .") + .Then + .ForCondition(Subject!.CanRead) + .BecauseOf(because, becauseArgs) + .FailWith(() => + { + var subjectDescription = assertionChain.HasOverriddenCallerIdentifier + ? assertionChain.CallerIdentifier + : "property " + Subject.ToFormattedString(); - if (success) - { - Execute.Assertion.ForCondition(Subject!.CanRead) - .BecauseOf(because, becauseArgs) - .FailWith("Expected property " + Subject.Name + " to have a getter{reason}, but it does not."); - } + return new FailReason($"Expected property {subjectDescription} to have a getter{{reason}}, but it does not."); + }); return new AndConstraint(this); } @@ -223,21 +242,25 @@ public AndConstraint BeReadable(CSharpAccessModifier acc { Guard.ThrowIfArgumentIsOutOfRange(accessModifier); - bool success = Execute.Assertion + var subjectDescription = assertionChain.HasOverriddenCallerIdentifier + ? assertionChain.CallerIdentifier + : "property " + Subject.ToFormattedString(); + + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) - .FailWith($"Expected {Identifier} to be {accessModifier}{{reason}}, but {{context:property}} is ."); + .FailWith($"Expected {{context:property}} to be {accessModifier}{{reason}}, but it is .") + .Then + .ForCondition(Subject!.CanRead) + .BecauseOf(because, becauseArgs) + .FailWith($"Expected {subjectDescription} to have a getter{{reason}}, but it does not."); - if (success) + if (assertionChain.Succeeded) { - success = Execute.Assertion.ForCondition(Subject!.CanRead) - .BecauseOf(because, becauseArgs) - .FailWith("Expected property " + Subject.Name + " to have a getter{reason}, but it does not."); + assertionChain.OverrideCallerIdentifier(() => "getter of " + subjectDescription); + assertionChain.ReuseOnce(); - if (success) - { - Subject!.GetGetMethod(nonPublic: true).Should().HaveAccessModifier(accessModifier, because, becauseArgs); - } + Subject!.GetGetMethod(nonPublic: true).Should().HaveAccessModifier(accessModifier, because, becauseArgs); } return new AndConstraint(this); @@ -256,20 +279,21 @@ public AndConstraint BeReadable(CSharpAccessModifier acc public AndConstraint NotBeReadable( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) - .FailWith("Expected property not to have a getter{reason}, but {context:property} is ."); + .FailWith("Expected property not to have a getter{reason}, but {context:property} is .") + .Then + .ForCondition(!Subject!.CanRead) + .BecauseOf(because, becauseArgs) + .FailWith(() => + { + var subjectDescription = assertionChain.HasOverriddenCallerIdentifier + ? assertionChain.CallerIdentifier + : "property " + Subject.ToFormattedString(); - if (success) - { - Execute.Assertion - .ForCondition(!Subject!.CanRead) - .BecauseOf(because, becauseArgs) - .FailWith( - "Expected {context:property} {0} not to have a getter{reason}.", - Subject); - } + return new FailReason($"Did not expect {subjectDescription} to have a getter{{reason}}."); + }); return new AndConstraint(this); } @@ -291,18 +315,14 @@ public AndConstraint Return(Type propertyType, { Guard.ThrowIfArgumentIsNull(propertyType); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) - .FailWith("Expected type of property to be {0}{reason}, but {context:property} is .", propertyType); - - if (success) - { - Execute.Assertion.ForCondition(Subject!.PropertyType == propertyType) - .BecauseOf(because, becauseArgs) - .FailWith("Expected Type of property " + Subject.Name + " to be {0}{reason}, but it is {1}.", - propertyType, Subject.PropertyType); - } + .FailWith("Expected type of property to be {0}{reason}, but {context:property} is .", propertyType) + .Then.ForCondition(Subject!.PropertyType == propertyType) + .BecauseOf(because, becauseArgs) + .FailWith("Expected type of property {2} to be {0}{reason}, but it is {1}.", + propertyType, Subject.PropertyType, Subject); return new AndConstraint(this); } @@ -318,7 +338,8 @@ public AndConstraint Return(Type propertyType, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Return([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint Return([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return Return(typeof(TReturn), because, becauseArgs); } @@ -340,18 +361,14 @@ public AndConstraint NotReturn(Type propertyType, { Guard.ThrowIfArgumentIsNull(propertyType); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) - .FailWith("Expected type of property not to be {0}{reason}, but {context:property} is .", propertyType); - - if (success) - { - Execute.Assertion - .ForCondition(Subject!.PropertyType != propertyType) - .BecauseOf(because, becauseArgs) - .FailWith("Expected Type of property " + Subject.Name + " not to be {0}{reason}, but it is.", propertyType); - } + .FailWith("Expected type of property not to be {0}{reason}, but {context:property} is .", propertyType) + .Then + .ForCondition(Subject!.PropertyType != propertyType) + .BecauseOf(because, becauseArgs) + .FailWith("Expected type of property {1} not to be {0}{reason}, but it is.", propertyType, Subject); return new AndConstraint(this); } @@ -367,24 +384,13 @@ public AndConstraint NotReturn(Type propertyType, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotReturn([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotReturn([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return NotReturn(typeof(TReturn), because, becauseArgs); } - internal static string GetDescriptionFor(PropertyInfo property) - { - if (property is null) - { - return string.Empty; - } - - var propTypeName = property.PropertyType.Name; - - return $"{propTypeName} {property.DeclaringType}.{property.Name}"; - } - - internal override string SubjectDescription => GetDescriptionFor(Subject); + private protected override string SubjectDescription => Formatter.ToString(Subject); /// /// Returns the type of the subject the assertion applies on. diff --git a/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs b/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs index 6605f823e9..4aca174681 100644 --- a/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs +++ b/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs @@ -6,6 +6,7 @@ using System.Reflection; using FluentAssertions.Common; using FluentAssertions.Execution; +using FluentAssertions.Formatting; namespace FluentAssertions.Types; @@ -17,6 +18,8 @@ namespace FluentAssertions.Types; [DebuggerNonUserCode] public class PropertyInfoSelectorAssertions { + private readonly AssertionChain assertionChain; + /// /// Gets the object whose value is being asserted. /// @@ -27,8 +30,9 @@ public class PropertyInfoSelectorAssertions /// /// The properties to assert. /// is . - public PropertyInfoSelectorAssertions(params PropertyInfo[] properties) + public PropertyInfoSelectorAssertions(AssertionChain assertionChain, params PropertyInfo[] properties) { + this.assertionChain = assertionChain; Guard.ThrowIfArgumentIsNull(properties); SubjectProperties = properties; @@ -48,7 +52,7 @@ public AndConstraint BeVirtual([StringSyntax("Co { PropertyInfo[] nonVirtualProperties = GetAllNonVirtualPropertiesFromSelection(); - Execute.Assertion + assertionChain .ForCondition(nonVirtualProperties.Length == 0) .BecauseOf(because, becauseArgs) .FailWith( @@ -72,7 +76,7 @@ public AndConstraint NotBeVirtual([StringSyntax( { PropertyInfo[] virtualProperties = GetAllVirtualPropertiesFromSelection(); - Execute.Assertion + assertionChain .ForCondition(virtualProperties.Length == 0) .BecauseOf(because, becauseArgs) .FailWith( @@ -96,7 +100,7 @@ public AndConstraint BeWritable([StringSyntax("C { PropertyInfo[] readOnlyProperties = GetAllReadOnlyPropertiesFromSelection(); - Execute.Assertion + assertionChain .ForCondition(readOnlyProperties.Length == 0) .BecauseOf(because, becauseArgs) .FailWith( @@ -120,7 +124,7 @@ public AndConstraint NotBeWritable([StringSyntax { PropertyInfo[] writableProperties = GetAllWritablePropertiesFromSelection(); - Execute.Assertion + assertionChain .ForCondition(writableProperties.Length == 0) .BecauseOf(because, becauseArgs) .FailWith( @@ -166,7 +170,7 @@ public AndConstraint BeDecoratedWith { PropertyInfo[] propertiesWithoutAttribute = GetPropertiesWithout(); - Execute.Assertion + assertionChain .ForCondition(propertiesWithoutAttribute.Length == 0) .BecauseOf(because, becauseArgs) .FailWith( @@ -193,7 +197,7 @@ public AndConstraint NotBeDecoratedWith(); - Execute.Assertion + assertionChain .ForCondition(propertiesWithAttribute.Length == 0) .BecauseOf(because, becauseArgs) .FailWith( @@ -218,7 +222,7 @@ private PropertyInfo[] GetPropertiesWith() private static string GetDescriptionsFor(IEnumerable properties) { - IEnumerable descriptions = properties.Select(property => PropertyInfoAssertions.GetDescriptionFor(property)); + IEnumerable descriptions = properties.Select(property => Formatter.ToString(property)); return string.Join(Environment.NewLine, descriptions); } diff --git a/Src/FluentAssertions/Types/TypeAssertions.cs b/Src/FluentAssertions/Types/TypeAssertions.cs index 45cf1618cc..1efa74d961 100644 --- a/Src/FluentAssertions/Types/TypeAssertions.cs +++ b/Src/FluentAssertions/Types/TypeAssertions.cs @@ -17,12 +17,15 @@ namespace FluentAssertions.Types; [DebuggerNonUserCode] public class TypeAssertions : ReferenceTypeAssertions { + private readonly AssertionChain assertionChain; + /// /// Initializes a new instance of the class. /// - public TypeAssertions(Type type) - : base(type) + public TypeAssertions(Type type, AssertionChain assertionChain) + : base(type, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -35,7 +38,8 @@ public TypeAssertions(Type type) /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Be([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint Be([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return Be(typeof(TExpected), because, becauseArgs); } @@ -54,7 +58,7 @@ public AndConstraint Be([StringSyntax("CompositeForma public AndConstraint Be(Type expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject == expected) .FailWith(GetFailureMessageIfTypesAreDifferent(Subject, expected)); @@ -74,7 +78,8 @@ public AndConstraint Be(Type expected, /// Zero or more objects to format using the placeholders in . /// /// An which can be used to chain assertions. - public new AndConstraint BeAssignableTo([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public new AndConstraint BeAssignableTo([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return BeAssignableTo(typeof(T), because, becauseArgs); } @@ -101,7 +106,7 @@ public AndConstraint Be(Type expected, ? Subject.IsAssignableToOpenGeneric(type) : type.IsAssignableFrom(Subject); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(isAssignable) .FailWith("Expected {context:type} {0} to be assignable to {1}{reason}, but it is not.", Subject, type); @@ -121,7 +126,8 @@ public AndConstraint Be(Type expected, /// Zero or more objects to format using the placeholders in . /// /// An which can be used to chain assertions. - public new AndConstraint NotBeAssignableTo([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public new AndConstraint NotBeAssignableTo([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return NotBeAssignableTo(typeof(T), because, becauseArgs); } @@ -148,7 +154,7 @@ public AndConstraint Be(Type expected, ? Subject.IsAssignableToOpenGeneric(type) : type.IsAssignableFrom(Subject); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!isAssignable) .FailWith("Expected {context:type} {0} to not be assignable to {1}{reason}, but it is.", Subject, type); @@ -193,7 +199,8 @@ private static string GetFailureMessageIfTypesAreDifferent(Type actual, Type exp /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBe([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotBe([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { return NotBe(typeof(TUnexpected), because, becauseArgs); } @@ -214,7 +221,7 @@ public AndConstraint NotBe(Type unexpected, { string nameOfUnexpectedType = unexpected is not null ? $"[{unexpected.AssemblyQualifiedName}]" : ""; - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject != unexpected) .FailWith("Expected type not to be " + nameOfUnexpectedType + "{reason}, but it is."); @@ -238,7 +245,7 @@ public AndWhichConstraint BeDecoratedWith attributes = Subject.GetMatchingAttributes(); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(attributes.Any()) .FailWith("Expected type {0} to be decorated with {1}{reason}, but the attribute was not found.", @@ -273,7 +280,7 @@ public AndWhichConstraint BeDecoratedWith attributes = Subject.GetMatchingAttributes(isMatchingAttributePredicate); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(attributes.Any()) .FailWith( @@ -299,7 +306,7 @@ public AndWhichConstraint BeDecoratedWithOrInherit attributes = Subject.GetMatchingOrInheritedAttributes(); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(attributes.Any()) .FailWith("Expected type {0} to be decorated with or inherit {1}{reason}, but the attribute was not found.", @@ -334,7 +341,7 @@ public AndWhichConstraint BeDecoratedWithOrInherit attributes = Subject.GetMatchingOrInheritedAttributes(isMatchingAttributePredicate); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(attributes.Any()) .FailWith( @@ -354,10 +361,11 @@ public AndWhichConstraint BeDecoratedWithOrInherit /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeDecoratedWith([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotBeDecoratedWith([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) where TAttribute : Attribute { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!Subject.IsDecoratedWith()) .FailWith("Expected type {0} to not be decorated with {1}{reason}, but the attribute was found.", @@ -388,7 +396,7 @@ public AndConstraint NotBeDecoratedWith( { Guard.ThrowIfArgumentIsNull(isMatchingAttributePredicate); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!Subject.IsDecoratedWith(isMatchingAttributePredicate)) .FailWith( @@ -413,7 +421,7 @@ public AndConstraint NotBeDecoratedWithOrInherit( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TAttribute : Attribute { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!Subject.IsDecoratedWithOrInherit()) .FailWith("Expected type {0} to not be decorated with or inherit {1}{reason}, but the attribute was found.", @@ -445,7 +453,7 @@ public AndConstraint NotBeDecoratedWithOrInherit( { Guard.ThrowIfArgumentIsNull(isMatchingAttributePredicate); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!Subject.IsDecoratedWithOrInherit(isMatchingAttributePredicate)) .FailWith( @@ -482,16 +490,16 @@ private bool AssertSubjectImplements(Type interfaceType, { bool containsInterface = interfaceType.IsAssignableFrom(Subject) && interfaceType != Subject; - return Execute.Assertion - .BecauseOf(because, becauseArgs) - .WithExpectation("Expected type {0} to implement interface {1}{reason}", Subject, interfaceType) + assertionChain + .BecauseOf(because, becauseArgs) + .WithExpectation("Expected type {0} to implement interface {1}{reason}", Subject, interfaceType, chain => chain .ForCondition(interfaceType.IsInterface) .FailWith(", but {0} is not an interface.", interfaceType) .Then .ForCondition(containsInterface) - .FailWith(", but it does not.") - .Then - .ClearExpectation(); + .FailWith(", but it does not.")); + + return assertionChain.Succeeded; } /// @@ -505,7 +513,8 @@ private bool AssertSubjectImplements(Type interfaceType, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint Implement([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint Implement([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) where TInterface : class { return Implement(typeof(TInterface), because, becauseArgs); @@ -530,16 +539,14 @@ public AndConstraint NotImplement(Type interfaceType, bool containsInterface = interfaceType.IsAssignableFrom(Subject) && interfaceType != Subject; - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected type {0} to not implement interface {1}{reason}", Subject, interfaceType) - .ForCondition(interfaceType.IsInterface) - .FailWith(", but {0} is not an interface.", interfaceType) - .Then - .ForCondition(!containsInterface) - .FailWith(", but it does.", interfaceType) - .Then - .ClearExpectation(); + .WithExpectation("Expected type {0} to not implement interface {1}{reason}", Subject, interfaceType, chain => chain + .ForCondition(interfaceType.IsInterface) + .FailWith(", but {0} is not an interface.", interfaceType) + .Then + .ForCondition(!containsInterface) + .FailWith(", but it does.", interfaceType)); return new AndConstraint(this); } @@ -555,7 +562,8 @@ public AndConstraint NotImplement(Type interfaceType, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotImplement([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotImplement([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) where TInterface : class { return NotImplement(typeof(TInterface), because, becauseArgs); @@ -582,16 +590,14 @@ public AndConstraint BeDerivedFrom(Type baseType, ? Subject.IsDerivedFromOpenGeneric(baseType) : Subject.IsSubclassOf(baseType); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected type {0} to be derived from {1}{reason}", Subject, baseType) - .ForCondition(!baseType.IsInterface) - .FailWith(", but {0} is an interface.", baseType) - .Then - .ForCondition(isDerivedFrom) - .FailWith(", but it is not.") - .Then - .ClearExpectation(); + .WithExpectation("Expected type {0} to be derived from {1}{reason}", Subject, baseType, chain => chain + .ForCondition(!baseType.IsInterface) + .FailWith(", but {0} is an interface.", baseType) + .Then + .ForCondition(isDerivedFrom) + .FailWith(", but it is not.")); return new AndConstraint(this); } @@ -607,7 +613,8 @@ public AndConstraint BeDerivedFrom(Type baseType, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeDerivedFrom([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint BeDerivedFrom([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) where TBaseClass : class { return BeDerivedFrom(typeof(TBaseClass), because, becauseArgs); @@ -634,16 +641,14 @@ public AndConstraint NotBeDerivedFrom(Type baseType, ? Subject.IsDerivedFromOpenGeneric(baseType) : Subject.IsSubclassOf(baseType); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) - .WithExpectation("Expected type {0} not to be derived from {1}{reason}", Subject, baseType) - .ForCondition(!baseType.IsInterface) - .FailWith(", but {0} is an interface.", baseType) - .Then - .ForCondition(!isDerivedFrom) - .FailWith(", but it is.") - .Then - .ClearExpectation(); + .WithExpectation("Expected type {0} not to be derived from {1}{reason}", Subject, baseType, chain => chain + .ForCondition(!baseType.IsInterface) + .FailWith(", but {0} is an interface.", baseType) + .Then + .ForCondition(!isDerivedFrom) + .FailWith(", but it is.")); return new AndConstraint(this); } @@ -659,7 +664,8 @@ public AndConstraint NotBeDerivedFrom(Type baseType, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeDerivedFrom([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotBeDerivedFrom([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) where TBaseClass : class { return NotBeDerivedFrom(typeof(TBaseClass), because, becauseArgs); @@ -677,18 +683,19 @@ public AndConstraint NotBeDerivedFrom([StringSyntax( /// /// /// is not a class. - public AndConstraint BeSealed([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint BeSealed([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected type to be sealed{reason}, but {context:type} is ."); - if (success) + if (assertionChain.Succeeded) { AssertThatSubjectIsClass(); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject.IsCSharpSealed()) .FailWith("Expected type {0} to be sealed{reason}.", Subject); @@ -709,18 +716,19 @@ public AndConstraint BeSealed([StringSyntax("CompositeFormat")] /// /// /// is not a class. - public AndConstraint NotBeSealed([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotBeSealed([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected type not to be sealed{reason}, but {context:type} is ."); - if (success) + if (assertionChain.Succeeded) { AssertThatSubjectIsClass(); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!Subject.IsCSharpSealed()) .FailWith("Expected type {0} not to be sealed{reason}.", Subject); @@ -741,18 +749,19 @@ public AndConstraint NotBeSealed([StringSyntax("CompositeFormat" /// /// /// is not a class. - public AndConstraint BeAbstract([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint BeAbstract([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected type to be abstract{reason}, but {context:type} is ."); - if (success) + if (assertionChain.Succeeded) { AssertThatSubjectIsClass(); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject.IsCSharpAbstract()) .FailWith("Expected {context:type} {0} to be abstract{reason}.", Subject); @@ -773,18 +782,19 @@ public AndConstraint BeAbstract([StringSyntax("CompositeFormat") /// /// /// is not a class. - public AndConstraint NotBeAbstract([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotBeAbstract([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected type not to be abstract{reason}, but {context:type} is ."); - if (success) + if (assertionChain.Succeeded) { AssertThatSubjectIsClass(); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!Subject.IsCSharpAbstract()) .FailWith("Expected type {0} not to be abstract{reason}.", Subject); @@ -805,18 +815,19 @@ public AndConstraint NotBeAbstract([StringSyntax("CompositeForma /// /// /// is not a class. - public AndConstraint BeStatic([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint BeStatic([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected type to be static{reason}, but {context:type} is ."); - if (success) + if (assertionChain.Succeeded) { AssertThatSubjectIsClass(); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject.IsCSharpStatic()) .FailWith("Expected type {0} to be static{reason}.", Subject); @@ -837,18 +848,19 @@ public AndConstraint BeStatic([StringSyntax("CompositeFormat")] /// /// /// is not a class. - public AndConstraint NotBeStatic([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + public AndConstraint NotBeStatic([StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected type not to be static{reason}, but {context:type} is ."); - if (success) + if (assertionChain.Succeeded) { AssertThatSubjectIsClass(); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!Subject.IsCSharpStatic()) .FailWith("Expected type {0} not to be static{reason}.", Subject); @@ -880,26 +892,34 @@ public AndWhichConstraint HaveProperty( Guard.ThrowIfArgumentIsNull(propertyType); Guard.ThrowIfArgumentIsNullOrEmpty(name); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith( - $"Expected {propertyType.Name} {{context:type}}.{name} to exist{{reason}}, but {{context:type}} is ."); + $"Cannot determine if a type has a property named {name} if the type is ."); PropertyInfo propertyInfo = null; - if (success) + if (assertionChain.Succeeded) { propertyInfo = Subject.FindPropertyByName(name); - var propertyInfoDescription = PropertyInfoAssertions.GetDescriptionFor(propertyInfo); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(propertyInfo is not null) - .FailWith($"Expected {propertyType.Name} {Subject}.{name} to exist{{reason}}, but it does not.") + .FailWith(() => + { + var subjectDescription = assertionChain.HasOverriddenCallerIdentifier + ? assertionChain.CallerIdentifier + : Subject!.Name; + + return new FailReason( + $"Expected {subjectDescription} to have a property {name} of type {propertyType.Name}{{reason}}, but it does not."); + }) .Then .ForCondition(propertyInfo.PropertyType == propertyType) - .FailWith($"Expected {propertyInfoDescription} to be of type {propertyType}{{reason}}, but it is not."); + .FailWith($"Expected property {propertyInfo.Name} to be of type {propertyType}{{reason}}, but it is not.", + propertyInfo); } return new AndWhichConstraint(this, propertyInfo); @@ -944,20 +964,26 @@ public AndConstraint NotHaveProperty(string name, { Guard.ThrowIfArgumentIsNullOrEmpty(name); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) - .FailWith($"Expected {{context:type}}.{name} to not exist{{reason}}, but {{context:type}} is ."); + .FailWith($"Cannot determine if a type has an unexpected property named {name} if the type is ."); - if (success) + if (assertionChain.Succeeded) { PropertyInfo propertyInfo = Subject.FindPropertyByName(name); - var propertyInfoDescription = PropertyInfoAssertions.GetDescriptionFor(propertyInfo); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(propertyInfo is null) - .FailWith($"Expected {propertyInfoDescription} to not exist{{reason}}, but it does."); + .FailWith(() => + { + var subjectDescription = + assertionChain.HasOverriddenCallerIdentifier ? assertionChain.CallerIdentifier : Subject!.Name; + + return new FailReason( + $"Did not expect {subjectDescription} to have a property {propertyInfo?.Name}{{reason}}, but it does."); + }); } return new AndConstraint(this); @@ -986,27 +1012,22 @@ public AndConstraint HaveExplicitProperty( Guard.ThrowIfArgumentIsNull(interfaceType); Guard.ThrowIfArgumentIsNullOrEmpty(name); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith( $"Expected {{context:type}} to explicitly implement {interfaceType}.{name}{{reason}}" + ", but {context:type} is ."); - if (success) + if (assertionChain.Succeeded && AssertSubjectImplements(interfaceType, because, becauseArgs)) { - success = AssertSubjectImplements(interfaceType, because, becauseArgs); - - if (success) - { - var explicitlyImplementsProperty = Subject.HasExplicitlyImplementedProperty(interfaceType, name); - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .ForCondition(explicitlyImplementsProperty) - .FailWith( - $"Expected {Subject} to explicitly implement {interfaceType}.{name}{{reason}}, but it does not."); - } + var explicitlyImplementsProperty = Subject.HasExplicitlyImplementedProperty(interfaceType, name); + + assertionChain + .BecauseOf(because, becauseArgs) + .ForCondition(explicitlyImplementsProperty) + .FailWith( + $"Expected {Subject} to explicitly implement {interfaceType}.{name}{{reason}}, but it does not."); } return new AndConstraint(this); @@ -1058,28 +1079,23 @@ public AndConstraint NotHaveExplicitProperty( Guard.ThrowIfArgumentIsNull(interfaceType); Guard.ThrowIfArgumentIsNullOrEmpty(name); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith( $"Expected {{context:type}} to not explicitly implement {interfaceType}.{name}{{reason}}" + ", but {context:type} is ."); - if (success) + if (assertionChain.Succeeded && AssertSubjectImplements(interfaceType, because, becauseArgs)) { - success = AssertSubjectImplements(interfaceType, because, becauseArgs); - - if (success) - { - var explicitlyImplementsProperty = Subject.HasExplicitlyImplementedProperty(interfaceType, name); - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .ForCondition(!explicitlyImplementsProperty) - .FailWith( - $"Expected {Subject} to not explicitly implement {interfaceType}.{name}{{reason}}" + - ", but it does."); - } + var explicitlyImplementsProperty = Subject.HasExplicitlyImplementedProperty(interfaceType, name); + + assertionChain + .BecauseOf(because, becauseArgs) + .ForCondition(!explicitlyImplementsProperty) + .FailWith( + $"Expected {Subject} to not explicitly implement {interfaceType}.{name}{{reason}}" + + ", but it does."); } return new AndConstraint(this); @@ -1134,28 +1150,23 @@ public AndConstraint HaveExplicitMethod( Guard.ThrowIfArgumentIsNullOrEmpty(name); Guard.ThrowIfArgumentIsNull(parameterTypes); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith( $"Expected {{context:type}} to explicitly implement {interfaceType}.{name}" + $"({GetParameterString(parameterTypes)}){{reason}}, but {{context:type}} is ."); - if (success) + if (assertionChain.Succeeded && AssertSubjectImplements(interfaceType, because, becauseArgs)) { - success = AssertSubjectImplements(interfaceType, because, becauseArgs); - - if (success) - { - var explicitlyImplementsMethod = Subject.HasMethod($"{interfaceType}.{name}", parameterTypes); - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .ForCondition(explicitlyImplementsMethod) - .FailWith( - $"Expected {Subject} to explicitly implement {interfaceType}.{name}" + - $"({GetParameterString(parameterTypes)}){{reason}}, but it does not."); - } + var explicitlyImplementsMethod = Subject.HasMethod($"{interfaceType}.{name}", parameterTypes); + + assertionChain + .BecauseOf(because, becauseArgs) + .ForCondition(explicitlyImplementsMethod) + .FailWith( + $"Expected {Subject} to explicitly implement {interfaceType}.{name}" + + $"({GetParameterString(parameterTypes)}){{reason}}, but it does not."); } return new AndConstraint(this); @@ -1212,28 +1223,23 @@ public AndConstraint NotHaveExplicitMethod( Guard.ThrowIfArgumentIsNullOrEmpty(name); Guard.ThrowIfArgumentIsNull(parameterTypes); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith( $"Expected {{context:type}} to not explicitly implement {interfaceType}.{name}" + $"({GetParameterString(parameterTypes)}){{reason}}, but {{context:type}} is ."); - if (success) + if (assertionChain.Succeeded && AssertSubjectImplements(interfaceType, because, becauseArgs)) { - success = AssertSubjectImplements(interfaceType, because, becauseArgs); - - if (success) - { - var explicitlyImplementsMethod = Subject.HasMethod($"{interfaceType}.{name}", parameterTypes); - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .ForCondition(!explicitlyImplementsMethod) - .FailWith( - $"Expected {Subject} to not explicitly implement {interfaceType}.{name}" + - $"({GetParameterString(parameterTypes)}){{reason}}, but it does."); - } + var explicitlyImplementsMethod = Subject.HasMethod($"{interfaceType}.{name}", parameterTypes); + + assertionChain + .BecauseOf(because, becauseArgs) + .ForCondition(!explicitlyImplementsMethod) + .FailWith( + $"Expected {Subject} to not explicitly implement {interfaceType}.{name}" + + $"({GetParameterString(parameterTypes)}){{reason}}, but it does."); } return new AndConstraint(this); @@ -1286,32 +1292,34 @@ public AndWhichConstraint HaveIndexer( Guard.ThrowIfArgumentIsNull(indexerType); Guard.ThrowIfArgumentIsNull(parameterTypes); - bool success = Execute.Assertion + string parameterString = GetParameterString(parameterTypes); + + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith( - $"Expected {indexerType.Name} {{context:type}}[{GetParameterString(parameterTypes)}] to exist{{reason}}" + + $"Expected {indexerType.Name} {{context:type}}[{parameterString}] to exist{{reason}}" + ", but {context:type} is ."); PropertyInfo propertyInfo = null; - if (success) + if (assertionChain.Succeeded) { propertyInfo = Subject.GetIndexerByParameterTypes(parameterTypes); - var propertyInfoDescription = PropertyInfoAssertions.GetDescriptionFor(propertyInfo); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(propertyInfo is not null) .FailWith( - $"Expected {indexerType.Name} {Subject}[{GetParameterString(parameterTypes)}] to exist{{reason}}" + + $"Expected {indexerType.Name} {Subject}[{parameterString}] to exist{{reason}}" + ", but it does not.") .Then .ForCondition(propertyInfo.PropertyType == indexerType) - .FailWith($"Expected {propertyInfoDescription} to be of type {indexerType}{{reason}}, but it is not."); + .FailWith("Expected {0} to be of type {1}{reason}, but it is not.", propertyInfo, indexerType); } - return new AndWhichConstraint(this, propertyInfo); + return new AndWhichConstraint(this, propertyInfo, assertionChain, + $"[{parameterString}]"); } /// @@ -1333,18 +1341,18 @@ public AndConstraint NotHaveIndexer( { Guard.ThrowIfArgumentIsNull(parameterTypes); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith( $"Expected indexer {{context:type}}[{GetParameterString(parameterTypes)}] to not exist{{reason}}" + ", but {context:type} is ."); - if (success) + if (assertionChain.Succeeded) { PropertyInfo propertyInfo = Subject.GetIndexerByParameterTypes(parameterTypes); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(propertyInfo is null) .FailWith( @@ -1378,7 +1386,7 @@ public AndWhichConstraint HaveMethod( Guard.ThrowIfArgumentIsNullOrEmpty(name); Guard.ThrowIfArgumentIsNull(parameterTypes); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith( @@ -1387,11 +1395,11 @@ public AndWhichConstraint HaveMethod( MethodInfo methodInfo = null; - if (success) + if (assertionChain.Succeeded) { methodInfo = Subject.GetMethod(name, parameterTypes); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(methodInfo is not null) .FailWith( @@ -1425,19 +1433,19 @@ public AndConstraint NotHaveMethod( Guard.ThrowIfArgumentIsNullOrEmpty(name); Guard.ThrowIfArgumentIsNull(parameterTypes); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith( $"Expected method {{context:type}}.{name}({GetParameterString(parameterTypes)}) to not exist{{reason}}" + ", but {context:type} is ."); - if (success) + if (assertionChain.Succeeded) { MethodInfo methodInfo = Subject.GetMethod(name, parameterTypes); var methodInfoDescription = MethodInfoAssertions.GetDescriptionFor(methodInfo); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(methodInfo is null) .FailWith( @@ -1466,7 +1474,7 @@ public AndWhichConstraint HaveConstructor( { Guard.ThrowIfArgumentIsNull(parameterTypes); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith( @@ -1475,11 +1483,11 @@ public AndWhichConstraint HaveConstructor( ConstructorInfo constructorInfo = null; - if (success) + if (assertionChain.Succeeded) { constructorInfo = Subject.GetConstructor(parameterTypes); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(constructorInfo is not null) .FailWith( @@ -1524,7 +1532,7 @@ public AndWhichConstraint NotHaveConstructor( { Guard.ThrowIfArgumentIsNull(parameterTypes); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith( @@ -1533,11 +1541,11 @@ public AndWhichConstraint NotHaveConstructor( ConstructorInfo constructorInfo = null; - if (success) + if (assertionChain.Succeeded) { constructorInfo = Subject.GetConstructor(parameterTypes); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(constructorInfo is null) .FailWith( @@ -1588,16 +1596,16 @@ public AndConstraint HaveAccessModifier( { Guard.ThrowIfArgumentIsOutOfRange(accessModifier); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith($"Expected {{context:type}} to be {accessModifier}{{reason}}, but {{context:type}} is ."); - if (success) + if (assertionChain.Succeeded) { CSharpAccessModifier subjectAccessModifier = Subject.GetCSharpAccessModifier(); - Execute.Assertion.ForCondition(accessModifier == subjectAccessModifier) + assertionChain.ForCondition(accessModifier == subjectAccessModifier) .BecauseOf(because, becauseArgs) .ForCondition(accessModifier == subjectAccessModifier) .FailWith( @@ -1627,16 +1635,16 @@ public AndConstraint NotHaveAccessModifier( { Guard.ThrowIfArgumentIsOutOfRange(accessModifier); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith($"Expected {{context:type}} not to be {accessModifier}{{reason}}, but {{context:type}} is ."); - if (success) + if (assertionChain.Succeeded) { CSharpAccessModifier subjectAccessModifier = Subject.GetCSharpAccessModifier(); - Execute.Assertion + assertionChain .ForCondition(accessModifier != subjectAccessModifier) .BecauseOf(because, becauseArgs) .ForCondition(accessModifier != subjectAccessModifier) @@ -1687,7 +1695,7 @@ public AndWhichConstraint HaveImplicitConversionOper Guard.ThrowIfArgumentIsNull(sourceType); Guard.ThrowIfArgumentIsNull(targetType); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected public static implicit {0}({1}) to exist{reason}, but {context:type} is .", @@ -1695,18 +1703,18 @@ public AndWhichConstraint HaveImplicitConversionOper MethodInfo methodInfo = null; - if (success) + if (assertionChain.Succeeded) { methodInfo = Subject.GetImplicitConversionOperator(sourceType, targetType); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(methodInfo is not null) .FailWith("Expected public static implicit {0}({1}) to exist{reason}, but it does not.", targetType, sourceType); } - return new AndWhichConstraint(this, methodInfo); + return new AndWhichConstraint(this, methodInfo, assertionChain); } /// @@ -1750,17 +1758,17 @@ public AndConstraint NotHaveImplicitConversionOperator( Guard.ThrowIfArgumentIsNull(sourceType); Guard.ThrowIfArgumentIsNull(targetType); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected public static implicit {0}({1}) to not exist{reason}, but {context:type} is .", targetType, sourceType); - if (success) + if (assertionChain.Succeeded) { MethodInfo methodInfo = Subject.GetImplicitConversionOperator(sourceType, targetType); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(methodInfo is null) .FailWith("Expected public static implicit {0}({1}) to not exist{reason}, but it does.", @@ -1811,7 +1819,7 @@ public AndWhichConstraint HaveExplicitConversionOper Guard.ThrowIfArgumentIsNull(sourceType); Guard.ThrowIfArgumentIsNull(targetType); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected public static explicit {0}({1}) to exist{reason}, but {context:type} is .", @@ -1819,11 +1827,11 @@ public AndWhichConstraint HaveExplicitConversionOper MethodInfo methodInfo = null; - if (success) + if (assertionChain.Succeeded) { methodInfo = Subject.GetExplicitConversionOperator(sourceType, targetType); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(methodInfo is not null) .FailWith("Expected public static explicit {0}({1}) to exist{reason}, but it does not.", @@ -1874,17 +1882,17 @@ public AndConstraint NotHaveExplicitConversionOperator( Guard.ThrowIfArgumentIsNull(sourceType); Guard.ThrowIfArgumentIsNull(targetType); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected public static explicit {0}({1}) to not exist{reason}, but {context:type} is .", targetType, sourceType); - if (success) + if (assertionChain.Succeeded) { MethodInfo methodInfo = Subject.GetExplicitConversionOperator(sourceType, targetType); - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(methodInfo is null) .FailWith("Expected public static explicit {0}({1}) to not exist{reason}, but it does.", diff --git a/Src/FluentAssertions/Types/TypeSelectorAssertions.cs b/Src/FluentAssertions/Types/TypeSelectorAssertions.cs index 1fa57f2532..41711ae15f 100644 --- a/Src/FluentAssertions/Types/TypeSelectorAssertions.cs +++ b/Src/FluentAssertions/Types/TypeSelectorAssertions.cs @@ -18,12 +18,15 @@ namespace FluentAssertions.Types; [DebuggerNonUserCode] public class TypeSelectorAssertions { + private readonly AssertionChain assertionChain; + /// /// Initializes a new instance of the class. /// /// is or contains . - public TypeSelectorAssertions(params Type[] types) + public TypeSelectorAssertions(AssertionChain assertionChain, params Type[] types) { + this.assertionChain = assertionChain; Guard.ThrowIfArgumentIsNull(types); Guard.ThrowIfArgumentContainsNull(types); @@ -52,7 +55,7 @@ public AndConstraint BeDecoratedWith([String .Where(type => !type.IsDecoratedWith()) .ToArray(); - Execute.Assertion + assertionChain .ForCondition(typesWithoutAttribute.Length == 0) .BecauseOf(because, becauseArgs) .FailWith("Expected all types to be decorated with {0}{reason}," + @@ -89,7 +92,7 @@ public AndConstraint BeDecoratedWith( .Where(type => !type.IsDecoratedWith(isMatchingAttributePredicate)) .ToArray(); - Execute.Assertion + assertionChain .ForCondition(typesWithoutMatchingAttribute.Length == 0) .BecauseOf(because, becauseArgs) .FailWith("Expected all types to be decorated with {0} that matches {1}{reason}," + @@ -119,7 +122,7 @@ public AndConstraint BeDecoratedWithOrInherit !type.IsDecoratedWithOrInherit()) .ToArray(); - Execute.Assertion + assertionChain .ForCondition(typesWithoutAttribute.Length == 0) .BecauseOf(because, becauseArgs) .FailWith("Expected all types to be decorated with or inherit {0}{reason}," + @@ -156,7 +159,7 @@ public AndConstraint BeDecoratedWithOrInherit !type.IsDecoratedWithOrInherit(isMatchingAttributePredicate)) .ToArray(); - Execute.Assertion + assertionChain .ForCondition(typesWithoutMatchingAttribute.Length == 0) .BecauseOf(because, becauseArgs) .FailWith("Expected all types to be decorated with or inherit {0} that matches {1}{reason}," + @@ -185,7 +188,7 @@ public AndConstraint NotBeDecoratedWith([Str .Where(type => type.IsDecoratedWith()) .ToArray(); - Execute.Assertion + assertionChain .ForCondition(typesWithAttribute.Length == 0) .BecauseOf(because, becauseArgs) .FailWith("Expected all types to not be decorated with {0}{reason}," + @@ -222,7 +225,7 @@ public AndConstraint NotBeDecoratedWith( .Where(type => type.IsDecoratedWith(isMatchingAttributePredicate)) .ToArray(); - Execute.Assertion + assertionChain .ForCondition(typesWithMatchingAttribute.Length == 0) .BecauseOf(because, becauseArgs) .FailWith("Expected all types to not be decorated with {0} that matches {1}{reason}," + @@ -252,7 +255,7 @@ public AndConstraint NotBeDecoratedWithOrInherit type.IsDecoratedWithOrInherit()) .ToArray(); - Execute.Assertion + assertionChain .ForCondition(typesWithAttribute.Length == 0) .BecauseOf(because, becauseArgs) .FailWith("Expected all types to not be decorated with or inherit {0}{reason}," + @@ -289,7 +292,7 @@ public AndConstraint NotBeDecoratedWithOrInherit type.IsDecoratedWithOrInherit(isMatchingAttributePredicate)) .ToArray(); - Execute.Assertion + assertionChain .ForCondition(typesWithMatchingAttribute.Length == 0) .BecauseOf(because, becauseArgs) .FailWith("Expected all types to not be decorated with or inherit {0} that matches {1}{reason}," + @@ -315,7 +318,7 @@ public AndConstraint BeSealed([StringSyntax("CompositeFo { var notSealedTypes = Subject.Where(type => !type.IsCSharpSealed()).ToArray(); - Execute.Assertion.ForCondition(notSealedTypes.Length == 0) + assertionChain.ForCondition(notSealedTypes.Length == 0) .BecauseOf(because, becauseArgs) .FailWith("Expected all types to be sealed{reason}, but the following types are not:" + Environment.NewLine + "{0}.", GetDescriptionsFor(notSealedTypes)); @@ -337,7 +340,7 @@ public AndConstraint NotBeSealed([StringSyntax("Composit { var sealedTypes = Subject.Where(type => type.IsCSharpSealed()).ToArray(); - Execute.Assertion.ForCondition(sealedTypes.Length == 0) + assertionChain.ForCondition(sealedTypes.Length == 0) .BecauseOf(because, becauseArgs) .FailWith("Expected all types not to be sealed{reason}, but the following types are:" + Environment.NewLine + "{0}.", GetDescriptionsFor(sealedTypes)); @@ -365,7 +368,7 @@ public AndConstraint BeInNamespace(string @namespace, .Where(t => t.Namespace != @namespace) .ToArray(); - Execute.Assertion + assertionChain .ForCondition(typesNotInNamespace.Length == 0) .BecauseOf(because, becauseArgs) .FailWith("Expected all types to be in namespace {0}{reason}," + @@ -396,7 +399,7 @@ public AndConstraint NotBeInNamespace(string @namespace, .Where(t => t.Namespace == @namespace) .ToArray(); - Execute.Assertion + assertionChain .ForCondition(typesInNamespace.Length == 0) .BecauseOf(because, becauseArgs) .FailWith("Expected no types to be in namespace {0}{reason}," + @@ -427,7 +430,7 @@ public AndConstraint BeUnderNamespace(string @namespace, .Where(t => !t.IsUnderNamespace(@namespace)) .ToArray(); - Execute.Assertion + assertionChain .ForCondition(typesNotUnderNamespace.Length == 0) .BecauseOf(because, becauseArgs) .FailWith("Expected the namespaces of all types to start with {0}{reason}," + @@ -459,7 +462,7 @@ public AndConstraint NotBeUnderNamespace(string @namespa .Where(t => t.IsUnderNamespace(@namespace)) .ToArray(); - Execute.Assertion + assertionChain .ForCondition(typesUnderNamespace.Length == 0) .BecauseOf(because, becauseArgs) .FailWith("Expected the namespaces of all types to not start with {0}{reason}," + diff --git a/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs b/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs index 52a223417e..b82b4bba6f 100644 --- a/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs +++ b/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Xml; using FluentAssertions.Execution; @@ -9,16 +8,17 @@ namespace FluentAssertions.Xml.Equivalency; internal class XmlReaderValidator { - private readonly AssertionScope assertion; + private readonly AssertionChain assertionChain; private readonly XmlReader subjectReader; private readonly XmlReader expectationReader; private XmlIterator subjectIterator; private XmlIterator expectationIterator; private Node currentNode = Node.CreateRoot(); - public XmlReaderValidator(XmlReader subjectReader, XmlReader expectationReader, [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) + public XmlReaderValidator(AssertionChain assertionChain, XmlReader subjectReader, XmlReader expectationReader, string because, object[] becauseArgs) { - assertion = Execute.Assertion.BecauseOf(because, becauseArgs); + this.assertionChain = assertionChain; + assertionChain.BecauseOf(because, becauseArgs); this.subjectReader = subjectReader; this.expectationReader = expectationReader; @@ -30,12 +30,12 @@ public void Validate(bool shouldBeEquivalent) if (shouldBeEquivalent && failure is not null) { - assertion.FailWith(failure.FormatString, failure.FormatParams); + assertionChain.FailWith(failure.FormatString, failure.FormatParams); } if (!shouldBeEquivalent && failure is null) { - assertion.FailWith("Did not expect {context:subject} to be equivalent{reason}, but it is."); + assertionChain.FailWith("Did not expect {context:subject} to be equivalent{reason}, but it is."); } } diff --git a/Src/FluentAssertions/Xml/XAttributeAssertions.cs b/Src/FluentAssertions/Xml/XAttributeAssertions.cs index 807ee8ee75..5c63862d5c 100644 --- a/Src/FluentAssertions/Xml/XAttributeAssertions.cs +++ b/Src/FluentAssertions/Xml/XAttributeAssertions.cs @@ -12,12 +12,15 @@ namespace FluentAssertions.Xml; [DebuggerNonUserCode] public class XAttributeAssertions : ReferenceTypeAssertions { + private readonly AssertionChain assertionChain; + /// /// Initializes a new instance of the class. /// - public XAttributeAssertions(XAttribute attribute) - : base(attribute) + public XAttributeAssertions(XAttribute attribute, AssertionChain assertionChain) + : base(attribute, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -34,7 +37,7 @@ public XAttributeAssertions(XAttribute attribute) public AndConstraint Be(XAttribute expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject?.Name == expected?.Name && Subject?.Value == expected?.Value) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} to be {0}{reason}, but found {1}.", expected, Subject); @@ -57,7 +60,7 @@ public AndConstraint Be(XAttribute expected, public AndConstraint NotBe(XAttribute unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(!(Subject?.Name == unexpected?.Name && Subject?.Value == unexpected?.Value)) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context} to be {0}{reason}.", unexpected); @@ -79,14 +82,14 @@ public AndConstraint NotBe(XAttribute unexpected, public AndConstraint HaveValue(string expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected the attribute to have value {0}{reason}, but {context:member} is .", expected); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(Subject!.Value == expected) .BecauseOf(because, becauseArgs) .FailWith("Expected {context} \"{0}\" to have value {1}{reason}, but found {2}.", diff --git a/Src/FluentAssertions/Xml/XDocumentAssertions.cs b/Src/FluentAssertions/Xml/XDocumentAssertions.cs index 98b2662d7a..f4c39fb40d 100644 --- a/Src/FluentAssertions/Xml/XDocumentAssertions.cs +++ b/Src/FluentAssertions/Xml/XDocumentAssertions.cs @@ -18,12 +18,15 @@ namespace FluentAssertions.Xml; [DebuggerNonUserCode] public class XDocumentAssertions : ReferenceTypeAssertions { + private readonly AssertionChain assertionChain; + /// /// Initializes a new instance of the class. /// - public XDocumentAssertions(XDocument document) - : base(document) + public XDocumentAssertions(XDocument document, AssertionChain assertionChain) + : base(document, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -41,7 +44,7 @@ public XDocumentAssertions(XDocument document) public AndConstraint Be(XDocument expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Equals(Subject, expected)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:subject} to be {0}{reason}, but found {1}.", expected, Subject); @@ -64,7 +67,7 @@ public AndConstraint Be(XDocument expected, public AndConstraint NotBe(XDocument unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(!Equals(Subject, unexpected)) .FailWith("Did not expect {context:subject} to be {0}{reason}.", unexpected); @@ -90,7 +93,7 @@ public AndConstraint BeEquivalentTo(XDocument expected, using (XmlReader subjectReader = Subject?.CreateReader()) using (XmlReader otherReader = expected?.CreateReader()) { - var xmlReaderValidator = new XmlReaderValidator(subjectReader, otherReader, because, becauseArgs); + var xmlReaderValidator = new XmlReaderValidator(assertionChain, subjectReader, otherReader, because, becauseArgs); xmlReaderValidator.Validate(shouldBeEquivalent: true); } @@ -115,7 +118,7 @@ public AndConstraint NotBeEquivalentTo(XDocument unexpected using (XmlReader subjectReader = Subject?.CreateReader()) using (XmlReader otherReader = unexpected?.CreateReader()) { - var xmlReaderValidator = new XmlReaderValidator(subjectReader, otherReader, because, becauseArgs); + var xmlReaderValidator = new XmlReaderValidator(assertionChain, subjectReader, otherReader, because, becauseArgs); xmlReaderValidator.Validate(shouldBeEquivalent: false); } @@ -171,14 +174,14 @@ public AndWhichConstraint HaveRoot(XName expected XElement root = Subject.Root; - Execute.Assertion + assertionChain .ForCondition(root is not null && root.Name == expected) .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:subject} to have root element {0}{reason}, but found {1}.", expected.ToString(), Subject); - return new AndWhichConstraint(this, root); + return new AndWhichConstraint(this, root, assertionChain, $"/{expected}"); } /// @@ -259,7 +262,7 @@ public AndWhichConstraint HaveElement(XName expec Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert the document has an element if the expected name is ."); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject.Root is not null) .BecauseOf(because, becauseArgs) .FailWith( @@ -268,11 +271,11 @@ public AndWhichConstraint HaveElement(XName expec XElement xElement = null; - if (success) + if (assertionChain.Succeeded) { xElement = Subject.Root!.Element(expected); - Execute.Assertion + assertionChain .ForCondition(xElement is not null) .BecauseOf(because, becauseArgs) .FailWith( @@ -280,7 +283,7 @@ public AndWhichConstraint HaveElement(XName expec expected.ToString()); } - return new AndWhichConstraint(this, xElement); + return new AndWhichConstraint(this, xElement, assertionChain, "/" + expected); } /// @@ -308,30 +311,30 @@ public AndWhichConstraint> HaveElemen Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert the document has an element count if the element name is ."); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith("Cannot assert the count if the document itself is ."); IEnumerable xElements = []; - if (success) + if (assertionChain.Succeeded) { var root = Subject!.Root; - success = Execute.Assertion + assertionChain .ForCondition(root is not null) .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:subject} to have root element containing a child {0}{reason}, but it has no root element.", expected.ToString()); - if (success) + if (assertionChain.Succeeded) { xElements = root!.Elements(expected); int actual = xElements.Count(); - Execute.Assertion + assertionChain .ForConstraint(occurrenceConstraint, actual) .BecauseOf(because, becauseArgs) .FailWith( @@ -341,7 +344,7 @@ public AndWhichConstraint> HaveElemen } } - return new AndWhichConstraint>(this, xElements); + return new AndWhichConstraint>(this, xElements, assertionChain, "/" + expected); } /// diff --git a/Src/FluentAssertions/Xml/XElementAssertions.cs b/Src/FluentAssertions/Xml/XElementAssertions.cs index 3381c4703b..c01c43748d 100644 --- a/Src/FluentAssertions/Xml/XElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XElementAssertions.cs @@ -18,12 +18,15 @@ namespace FluentAssertions.Xml; [DebuggerNonUserCode] public class XElementAssertions : ReferenceTypeAssertions { + private readonly AssertionChain assertionChain; + /// /// Initializes a new instance of the class. /// - public XElementAssertions(XElement xElement) - : base(xElement) + public XElementAssertions(XElement xElement, AssertionChain assertionChain) + : base(xElement, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -42,7 +45,7 @@ public XElementAssertions(XElement xElement) public AndConstraint Be(XElement expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(XNode.DeepEquals(Subject, expected)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:subject} to be {0}{reason}, but found {1}.", expected, Subject); @@ -66,7 +69,7 @@ public AndConstraint Be(XElement expected, public AndConstraint NotBe(XElement unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition((Subject is null && unexpected is not null) || !XNode.DeepEquals(Subject, unexpected)) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:subject} to be {0}{reason}.", unexpected); @@ -93,7 +96,7 @@ public AndConstraint BeEquivalentTo(XElement expected, using (XmlReader subjectReader = Subject?.CreateReader()) using (XmlReader expectedReader = expected?.CreateReader()) { - var xmlReaderValidator = new XmlReaderValidator(subjectReader, expectedReader, because, becauseArgs); + var xmlReaderValidator = new XmlReaderValidator(assertionChain, subjectReader, expectedReader, because, becauseArgs); xmlReaderValidator.Validate(shouldBeEquivalent: true); } @@ -119,7 +122,7 @@ public AndConstraint NotBeEquivalentTo(XElement unexpected, using (XmlReader subjectReader = Subject?.CreateReader()) using (XmlReader otherReader = unexpected?.CreateReader()) { - var xmlReaderValidator = new XmlReaderValidator(subjectReader, otherReader, because, becauseArgs); + var xmlReaderValidator = new XmlReaderValidator(assertionChain, subjectReader, otherReader, because, becauseArgs); xmlReaderValidator.Validate(shouldBeEquivalent: false); } @@ -140,14 +143,14 @@ public AndConstraint NotBeEquivalentTo(XElement unexpected, public AndConstraint HaveValue(string expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith("Expected the element to have value {0}{reason}, but {context:member} is .", expected); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(Subject!.Value == expected) .BecauseOf(because, becauseArgs) .FailWith( @@ -202,18 +205,18 @@ public AndConstraint HaveAttribute(XName expectedName, strin string expectedText = expectedName.ToString(); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith( "Expected attribute {0} in element to have value {1}{reason}, but {context:member} is .", expectedText, expectedValue); - if (success) + if (assertionChain.Succeeded) { XAttribute attribute = Subject!.Attribute(expectedName); - success = Execute.Assertion + assertionChain .ForCondition(attribute is not null) .BecauseOf(because, becauseArgs) .FailWith( @@ -221,9 +224,9 @@ public AndConstraint HaveAttribute(XName expectedName, strin + " but found no such attribute in {2}", expectedText, expectedValue, Subject); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(attribute!.Value == expectedValue) .BecauseOf(because, becauseArgs) .FailWith( @@ -275,7 +278,7 @@ public AndWhichConstraint HaveElement(XName expect { Guard.ThrowIfArgumentIsNull(expected); - bool success = Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .ForCondition(Subject is not null) .FailWith( @@ -284,11 +287,11 @@ public AndWhichConstraint HaveElement(XName expect XElement xElement = null; - if (success) + if (assertionChain.Succeeded) { xElement = Subject!.Element(expected); - Execute.Assertion + assertionChain .ForCondition(xElement is not null) .BecauseOf(because, becauseArgs) .FailWith( @@ -296,7 +299,7 @@ public AndWhichConstraint HaveElement(XName expect expected.ToString().EscapePlaceholders()); } - return new AndWhichConstraint(this, xElement); + return new AndWhichConstraint(this, xElement, assertionChain, "/" + expected); } /// @@ -324,7 +327,7 @@ public AndWhichConstraint> HaveElement Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot assert the element has an element count if the element name is ."); - bool success = Execute.Assertion + assertionChain .ForCondition(Subject is not null) .BecauseOf(because, becauseArgs) .FailWith( @@ -333,12 +336,12 @@ public AndWhichConstraint> HaveElement IEnumerable xElements = []; - if (success) + if (assertionChain.Succeeded) { xElements = Subject!.Elements(expected); int actual = xElements.Count(); - Execute.Assertion + assertionChain .ForConstraint(occurrenceConstraint, actual) .BecauseOf(because, becauseArgs) .FailWith( @@ -347,7 +350,7 @@ public AndWhichConstraint> HaveElement expected.ToString()); } - return new AndWhichConstraint>(this, xElements); + return new AndWhichConstraint>(this, xElements, assertionChain, "/" + expected); } /// diff --git a/Src/FluentAssertions/Xml/XmlElementAssertions.cs b/Src/FluentAssertions/Xml/XmlElementAssertions.cs index 60bfd53dff..651eda0fd0 100644 --- a/Src/FluentAssertions/Xml/XmlElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XmlElementAssertions.cs @@ -13,13 +13,16 @@ namespace FluentAssertions.Xml; [DebuggerNonUserCode] public class XmlElementAssertions : XmlNodeAssertions { + private readonly AssertionChain assertionChain; + /// /// Initializes a new instance of the class. /// /// - public XmlElementAssertions(XmlElement xmlElement) - : base(xmlElement) + public XmlElementAssertions(XmlElement xmlElement, AssertionChain assertionChain) + : base(xmlElement, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -37,7 +40,7 @@ public XmlElementAssertions(XmlElement xmlElement) public AndConstraint HaveInnerText(string expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Execute.Assertion + assertionChain .ForCondition(Subject.InnerText == expected) .BecauseOf(because, becauseArgs) .FailWith( @@ -94,7 +97,7 @@ public AndConstraint HaveAttributeWithNamespace( (string.IsNullOrEmpty(expectedNamespace) ? string.Empty : $"{{{expectedNamespace}}}") + expectedName; - bool success = Execute.Assertion + assertionChain .ForCondition(attribute is not null) .BecauseOf(because, becauseArgs) .FailWith( @@ -102,9 +105,9 @@ public AndConstraint HaveAttributeWithNamespace( + " with value {1}{reason}, but found no such attribute in {2}", expectedFormattedName, expectedValue, Subject); - if (success) + if (assertionChain.Succeeded) { - Execute.Assertion + assertionChain .ForCondition(attribute!.Value == expectedValue) .BecauseOf(because, becauseArgs) .FailWith( @@ -158,14 +161,14 @@ public AndWhichConstraint HaveElementWithNames (string.IsNullOrEmpty(expectedNamespace) ? string.Empty : $"{{{expectedNamespace}}}") + expectedName; - Execute.Assertion + assertionChain .ForCondition(element is not null) .BecauseOf(because, becauseArgs) .FailWith( "Expected {context:subject} to have child element {0}{reason}, but no such child element was found.", expectedFormattedName.EscapePlaceholders()); - return new AndWhichConstraint(this, element); + return new AndWhichConstraint(this, element, assertionChain, "/" + expectedName); } protected override string Identifier => "XML element"; diff --git a/Src/FluentAssertions/Xml/XmlNodeAssertions.cs b/Src/FluentAssertions/Xml/XmlNodeAssertions.cs index 779317b295..1a3356ee65 100644 --- a/Src/FluentAssertions/Xml/XmlNodeAssertions.cs +++ b/Src/FluentAssertions/Xml/XmlNodeAssertions.cs @@ -1,6 +1,7 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Xml; +using FluentAssertions.Execution; using FluentAssertions.Primitives; using FluentAssertions.Xml.Equivalency; @@ -12,8 +13,8 @@ namespace FluentAssertions.Xml; [DebuggerNonUserCode] public class XmlNodeAssertions : XmlNodeAssertions { - public XmlNodeAssertions(XmlNode xmlNode) - : base(xmlNode) + public XmlNodeAssertions(XmlNode xmlNode, AssertionChain assertionChain) + : base(xmlNode, assertionChain) { } } @@ -26,9 +27,12 @@ public class XmlNodeAssertions : ReferenceTypeAssertions< where TSubject : XmlNode where TAssertions : XmlNodeAssertions { - public XmlNodeAssertions(TSubject xmlNode) - : base(xmlNode) + private readonly AssertionChain assertionChain; + + public XmlNodeAssertions(TSubject xmlNode, AssertionChain assertionChain) + : base(xmlNode, assertionChain) { + this.assertionChain = assertionChain; } /// @@ -48,7 +52,7 @@ public AndConstraint BeEquivalentTo(XmlNode expected, using (var subjectReader = new XmlNodeReader(Subject)) using (var expectedReader = new XmlNodeReader(expected)) { - var xmlReaderValidator = new XmlReaderValidator(subjectReader, expectedReader, because, becauseArgs); + var xmlReaderValidator = new XmlReaderValidator(assertionChain, subjectReader, expectedReader, because, becauseArgs); xmlReaderValidator.Validate(shouldBeEquivalent: true); } @@ -73,7 +77,7 @@ public AndConstraint NotBeEquivalentTo(XmlNode unexpected, using (var subjectReader = new XmlNodeReader(Subject)) using (var unexpectedReader = new XmlNodeReader(unexpected)) { - var xmlReaderValidator = new XmlReaderValidator(subjectReader, unexpectedReader, because, becauseArgs); + var xmlReaderValidator = new XmlReaderValidator(assertionChain, subjectReader, unexpectedReader, because, becauseArgs); xmlReaderValidator.Validate(shouldBeEquivalent: false); } diff --git a/Src/FluentAssertions/XmlAssertionExtensions.cs b/Src/FluentAssertions/XmlAssertionExtensions.cs index 2db9562915..79da764778 100644 --- a/Src/FluentAssertions/XmlAssertionExtensions.cs +++ b/Src/FluentAssertions/XmlAssertionExtensions.cs @@ -1,6 +1,7 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Xml; +using FluentAssertions.Execution; using FluentAssertions.Xml; namespace FluentAssertions; @@ -10,11 +11,11 @@ public static class XmlAssertionExtensions { public static XmlNodeAssertions Should([NotNull] this XmlNode actualValue) { - return new XmlNodeAssertions(actualValue); + return new XmlNodeAssertions(actualValue, AssertionChain.GetOrCreate()); } public static XmlElementAssertions Should([NotNull] this XmlElement actualValue) { - return new XmlElementAssertions(actualValue); + return new XmlElementAssertions(actualValue, AssertionChain.GetOrCreate()); } } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index ce88279d5e..5ec01ef85b 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -15,12 +15,14 @@ namespace FluentAssertions public AndConstraint(TParent parent) { } public TParent And { get; } } - public class AndWhichConstraint : FluentAssertions.AndConstraint + public class AndWhichConstraint : FluentAssertions.AndConstraint { - public AndWhichConstraint(TParentConstraint parentConstraint, System.Collections.Generic.IEnumerable matchedConstraint) { } - public AndWhichConstraint(TParentConstraint parentConstraint, TMatchedElement matchedConstraint) { } - public TMatchedElement Subject { get; } - public TMatchedElement Which { get; } + public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects) { } + public AndWhichConstraint(TParent parent, TSubject subject) { } + public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects, FluentAssertions.Execution.AssertionChain assertionChain, string pathPostfix) { } + public AndWhichConstraint(TParent parent, TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain, string pathPostfix = "") { } + public TSubject Subject { get; } + public TSubject Which { get; } } public static class AssertionExtensions { @@ -376,18 +378,18 @@ namespace FluentAssertions.Collections { public class GenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions, T, FluentAssertions.Collections.GenericCollectionAssertions> { - public GenericCollectionAssertions(System.Collections.Generic.IEnumerable actualValue) { } + public GenericCollectionAssertions(System.Collections.Generic.IEnumerable actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class GenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions> where TCollection : System.Collections.Generic.IEnumerable { - public GenericCollectionAssertions(TCollection actualValue) { } + public GenericCollectionAssertions(TCollection actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class GenericCollectionAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TCollection : System.Collections.Generic.IEnumerable where TAssertions : FluentAssertions.Collections.GenericCollectionAssertions { - public GenericCollectionAssertions(TCollection actualValue) { } + public GenericCollectionAssertions(TCollection actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint AllBeAssignableTo(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> AllBeAssignableTo(string because = "", params object[] becauseArgs) { } @@ -461,7 +463,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint NotBeSubsetOf(System.Collections.Generic.IEnumerable unexpectedSuperset, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContain(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint NotContain(T unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotContain(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainInConsecutiveOrder(params T[] unexpected) { } @@ -492,13 +494,13 @@ namespace FluentAssertions.Collections public class GenericDictionaryAssertions : FluentAssertions.Collections.GenericDictionaryAssertions> where TCollection : System.Collections.Generic.IEnumerable> { - public GenericDictionaryAssertions(TCollection keyValuePairs) { } + public GenericDictionaryAssertions(TCollection keyValuePairs, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class GenericDictionaryAssertions : FluentAssertions.Collections.GenericCollectionAssertions, TAssertions> where TCollection : System.Collections.Generic.IEnumerable> where TAssertions : FluentAssertions.Collections.GenericDictionaryAssertions { - public GenericDictionaryAssertions(TCollection keyValuePairs) { } + public GenericDictionaryAssertions(TCollection keyValuePairs, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } @@ -510,8 +512,8 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint ContainKeys(params TKey[] expected) { } public FluentAssertions.AndConstraint ContainKeys(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint ContainValue(TValue expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainValues(params TValue[] expected) { } - public FluentAssertions.AndConstraint ContainValues(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint> ContainValues(params TValue[] expected) { } + public FluentAssertions.AndWhichConstraint> ContainValues(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Equal(T expected, string because = "", params object[] becauseArgs) where T : System.Collections.Generic.IEnumerable> { } public FluentAssertions.AndConstraint NotContain(params System.Collections.Generic.KeyValuePair[] items) { } @@ -529,18 +531,18 @@ namespace FluentAssertions.Collections } public class StringCollectionAssertions : FluentAssertions.Collections.StringCollectionAssertions> { - public StringCollectionAssertions(System.Collections.Generic.IEnumerable actualValue) { } + public StringCollectionAssertions(System.Collections.Generic.IEnumerable actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class StringCollectionAssertions : FluentAssertions.Collections.StringCollectionAssertions> where TCollection : System.Collections.Generic.IEnumerable { - public StringCollectionAssertions(TCollection actualValue) { } + public StringCollectionAssertions(TCollection actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class StringCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions where TCollection : System.Collections.Generic.IEnumerable where TAssertions : FluentAssertions.Collections.StringCollectionAssertions { - public StringCollectionAssertions(TCollection actualValue) { } + public StringCollectionAssertions(TCollection actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint AllBe(string expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint AllBe(string expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(params string[] expectation) { } @@ -553,18 +555,18 @@ namespace FluentAssertions.Collections } public class SubsequentOrderingAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions, T, FluentAssertions.Collections.SubsequentOrderingAssertions> { - public SubsequentOrderingAssertions(System.Collections.Generic.IEnumerable actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } + public SubsequentOrderingAssertions(System.Collections.Generic.IEnumerable actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions> where TCollection : System.Collections.Generic.IEnumerable { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } + public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions where TCollection : System.Collections.Generic.IEnumerable where TAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } + public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } @@ -705,7 +707,7 @@ namespace FluentAssertions.Equivalency { protected EquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } - protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested); + protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator); } public class EquivalencyValidationContext : FluentAssertions.Equivalency.IEquivalencyValidationContext { @@ -797,7 +799,7 @@ namespace FluentAssertions.Equivalency } public interface IMemberMatchingRule { - FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyOptions options); + FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyOptions options, FluentAssertions.Execution.AssertionChain assertionChain); } public interface IMemberSelectionRule { @@ -959,7 +961,7 @@ namespace FluentAssertions.Equivalency.Steps { public class AssertionRuleEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { - public AssertionRuleEquivalencyStep(System.Linq.Expressions.Expression> predicate, System.Action> assertion) { } + public AssertionRuleEquivalencyStep(System.Linq.Expressions.Expression> predicate, System.Action> assertionAction) { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } @@ -972,7 +974,7 @@ namespace FluentAssertions.Equivalency.Steps public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } public class EnumEqualityStep : FluentAssertions.Equivalency.IEquivalencyStep { @@ -1033,17 +1035,17 @@ namespace FluentAssertions.Equivalency.Steps public class XAttributeEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XAttributeEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } public class XDocumentEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XDocumentEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } public class XElementEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XElementEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } } namespace FluentAssertions.Equivalency.Tracing @@ -1073,7 +1075,7 @@ namespace FluentAssertions.Events { public class EventAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> { - protected EventAssertions(FluentAssertions.Events.IMonitor monitor) { } + protected EventAssertions(FluentAssertions.Events.IMonitor monitor, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.Events.IMonitor Monitor { get; } public void NotRaise(string eventName, string because = "", params object[] becauseArgs) { } @@ -1119,76 +1121,62 @@ namespace FluentAssertions.Events } namespace FluentAssertions.Execution { + public sealed class AssertionChain + { + public string CallerIdentifier { get; } + public bool HasOverriddenCallerIdentifier { get; } + public bool Succeeded { get; } + public FluentAssertions.Execution.AssertionChain UsingLineBreaks { get; } + public void AddReportable(string key, System.Func getValue) { } + public void AddReportable(string key, string value) { } + public FluentAssertions.Execution.AssertionChain BecauseOf(FluentAssertions.Execution.Reason reason) { } + public FluentAssertions.Execution.AssertionChain BecauseOf(string because, params object[] becauseArgs) { } + public FluentAssertions.Execution.Continuation FailWith(System.Func getFailureReason) { } + public FluentAssertions.Execution.Continuation FailWith(string message) { } + public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } + public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } + public FluentAssertions.Execution.AssertionChain ForCondition(bool condition) { } + public FluentAssertions.Execution.AssertionChain ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } + public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } + public void OverrideCallerIdentifier(System.Func getCallerIdentifier) { } + public void ReuseOnce() { } + public FluentAssertions.Execution.AssertionChain WithCallerPostfix(string postfix) { } + public FluentAssertions.Execution.AssertionChain WithDefaultIdentifier(string identifier) { } + public FluentAssertions.Execution.Continuation WithExpectation(string message, System.Action chain) { } + public FluentAssertions.Execution.Continuation WithExpectation(string message, object arg1, System.Action chain) { } + public FluentAssertions.Execution.Continuation WithExpectation(string message, object arg1, object arg2, System.Action chain) { } + public FluentAssertions.Execution.AssertionChain WithReportable(string name, System.Func content) { } + public static FluentAssertions.Execution.AssertionChain GetOrCreate() { } + } [System.Serializable] public class AssertionFailedException : System.Exception { public AssertionFailedException(string message) { } protected AssertionFailedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } - public sealed class AssertionScope : FluentAssertions.Execution.IAssertionScope, System.IDisposable + public sealed class AssertionScope : System.IDisposable { public AssertionScope() { } public AssertionScope(FluentAssertions.Execution.IAssertionStrategy assertionStrategy) { } - public AssertionScope(System.Lazy context) { } - public AssertionScope(string context) { } - public string CallerIdentity { get; } - public System.Lazy Context { get; set; } + public AssertionScope(System.Func name) { } + public AssertionScope(string name) { } public FluentAssertions.Formatting.FormattingOptions FormattingOptions { get; } - public FluentAssertions.Execution.AssertionScope UsingLineBreaks { get; } + public System.Func Name { get; } public static FluentAssertions.Execution.AssertionScope Current { get; } - public void AddNonReportable(string key, object value) { } public void AddPreFormattedFailure(string formattedFailureMessage) { } - public void AddReportable(string key, System.Func valueFunc) { } - public void AddReportable(string key, string value) { } public void AppendTracing(string tracingBlock) { } - public void AssumeSingleCaller() { } - public FluentAssertions.Execution.AssertionScope BecauseOf(FluentAssertions.Execution.Reason reason) { } - public FluentAssertions.Execution.AssertionScope BecauseOf(string because, params object[] becauseArgs) { } - public FluentAssertions.Execution.Continuation ClearExpectation() { } public string[] Discard() { } public void Dispose() { } - public FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc) { } - public FluentAssertions.Execution.Continuation FailWith(string message) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } - public FluentAssertions.Execution.AssertionScope ForCondition(bool condition) { } - public FluentAssertions.Execution.AssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } - public T Get(string key) { } - public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } public bool HasFailures() { } - public FluentAssertions.Execution.AssertionScope WithDefaultIdentifier(string identifier) { } - public FluentAssertions.Execution.AssertionScope WithExpectation(string message, params object[] args) { } } public class Continuation { - public FluentAssertions.Execution.IAssertionScope Then { get; } - public static bool op_Implicit(FluentAssertions.Execution.Continuation continuation) { } + public FluentAssertions.Execution.AssertionChain Then { get; } } public class ContinuationOfGiven { + public bool Succeeded { get; } public FluentAssertions.Execution.GivenSelector Then { get; } - public static bool op_Implicit(FluentAssertions.Execution.ContinuationOfGiven continuationOfGiven) { } - } - public sealed class ContinuedAssertionScope : FluentAssertions.Execution.IAssertionScope, System.IDisposable - { - public FluentAssertions.Execution.IAssertionScope UsingLineBreaks { get; } - public FluentAssertions.Execution.IAssertionScope BecauseOf(string because, params object[] becauseArgs) { } - public FluentAssertions.Execution.Continuation ClearExpectation() { } - public string[] Discard() { } - public void Dispose() { } - public FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc) { } - public FluentAssertions.Execution.Continuation FailWith(string message) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } - public FluentAssertions.Execution.IAssertionScope ForCondition(bool condition) { } - public FluentAssertions.Execution.IAssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } - public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } - public FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier) { } - public FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args) { } - } - public static class Execute - { - public static FluentAssertions.Execution.AssertionScope Assertion { get; } } public class FailReason { @@ -1198,29 +1186,13 @@ namespace FluentAssertions.Execution } public class GivenSelector { - public FluentAssertions.Execution.ContinuationOfGiven ClearExpectation() { } + public bool Succeeded { get; } public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message) { } public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message, params System.Func[] args) { } public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message, params object[] args) { } public FluentAssertions.Execution.GivenSelector ForCondition(System.Func predicate) { } public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } } - public interface IAssertionScope : System.IDisposable - { - FluentAssertions.Execution.IAssertionScope UsingLineBreaks { get; } - FluentAssertions.Execution.IAssertionScope BecauseOf(string because, params object[] becauseArgs); - FluentAssertions.Execution.Continuation ClearExpectation(); - string[] Discard(); - FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc); - FluentAssertions.Execution.Continuation FailWith(string message); - FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders); - FluentAssertions.Execution.Continuation FailWith(string message, params object[] args); - FluentAssertions.Execution.IAssertionScope ForCondition(bool condition); - FluentAssertions.Execution.IAssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences); - FluentAssertions.Execution.GivenSelector Given(System.Func selector); - FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier); - FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args); - } public interface IAssertionStrategy { System.Collections.Generic.IEnumerable FailureMessages { get; } @@ -1463,6 +1435,12 @@ namespace FluentAssertions.Formatting public MaxLinesExceededException(string message) { } public MaxLinesExceededException(string message, System.Exception innerException) { } } + public class MethodInfoFormatter : FluentAssertions.Formatting.IValueFormatter + { + public MethodInfoFormatter() { } + public bool CanHandle(object value) { } + public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } + } public class MultidimensionalArrayFormatter : FluentAssertions.Formatting.IValueFormatter { public MultidimensionalArrayFormatter() { } @@ -1569,12 +1547,12 @@ namespace FluentAssertions.Numeric { public class ComparableTypeAssertions : FluentAssertions.Numeric.ComparableTypeAssertions> { - public ComparableTypeAssertions(System.IComparable value) { } + public ComparableTypeAssertions(System.IComparable value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class ComparableTypeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions, TAssertions> where TAssertions : FluentAssertions.Numeric.ComparableTypeAssertions { - public ComparableTypeAssertions(System.IComparable value) { } + public ComparableTypeAssertions(System.IComparable value, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } @@ -1594,13 +1572,13 @@ namespace FluentAssertions.Numeric public class NullableNumericAssertions : FluentAssertions.Numeric.NullableNumericAssertions> where T : struct, System.IComparable { - public NullableNumericAssertions(T? value) { } + public NullableNumericAssertions(T? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableNumericAssertions : FluentAssertions.Numeric.NumericAssertions where T : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NullableNumericAssertions { - public NullableNumericAssertions(T? value) { } + public NullableNumericAssertions(T? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } @@ -1610,13 +1588,14 @@ namespace FluentAssertions.Numeric public class NumericAssertions : FluentAssertions.Numeric.NumericAssertions> where T : struct, System.IComparable { - public NumericAssertions(T value) { } + public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NumericAssertions where T : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NumericAssertions { - public NumericAssertions(T value) { } + public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } + public FluentAssertions.Execution.AssertionChain CurrentAssertionChain { get; } public T? Subject { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) { } @@ -1642,12 +1621,12 @@ namespace FluentAssertions.Primitives { public class BooleanAssertions : FluentAssertions.Primitives.BooleanAssertions { - public BooleanAssertions(bool? value) { } + public BooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class BooleanAssertions where TAssertions : FluentAssertions.Primitives.BooleanAssertions { - public BooleanAssertions(bool? value) { } + public BooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public bool? Subject { get; } public FluentAssertions.AndConstraint Be(bool expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeFalse(string because = "", params object[] becauseArgs) { } @@ -1658,12 +1637,12 @@ namespace FluentAssertions.Primitives } public class DateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions { - public DateTimeAssertions(System.DateTime? value) { } + public DateTimeAssertions(System.DateTime? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class DateTimeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { - public DateTimeAssertions(System.DateTime? value) { } + public DateTimeAssertions(System.DateTime? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.DateTime? Subject { get; } public FluentAssertions.AndConstraint Be(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(System.DateTime? expected, string because = "", params object[] becauseArgs) { } @@ -1708,12 +1687,12 @@ namespace FluentAssertions.Primitives } public class DateTimeOffsetAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { - public DateTimeOffsetAssertions(System.DateTimeOffset? value) { } + public DateTimeOffsetAssertions(System.DateTimeOffset? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class DateTimeOffsetAssertions where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { - public DateTimeOffsetAssertions(System.DateTimeOffset? value) { } + public DateTimeOffsetAssertions(System.DateTimeOffset? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.DateTimeOffset? Subject { get; } public FluentAssertions.AndConstraint Be(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(System.DateTimeOffset? expected, string because = "", params object[] becauseArgs) { } @@ -1763,7 +1742,7 @@ namespace FluentAssertions.Primitives public class DateTimeOffsetRangeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { - protected DateTimeOffsetRangeAssertions(TAssertions parentAssertions, System.DateTimeOffset? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } + protected DateTimeOffsetRangeAssertions(TAssertions parentAssertions, FluentAssertions.Execution.AssertionChain assertionChain, System.DateTimeOffset? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } @@ -1771,7 +1750,7 @@ namespace FluentAssertions.Primitives public class DateTimeRangeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { - protected DateTimeRangeAssertions(TAssertions parentAssertions, System.DateTime? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } + protected DateTimeRangeAssertions(TAssertions parentAssertions, FluentAssertions.Execution.AssertionChain assertionChain, System.DateTime? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTime target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTime target, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } @@ -1779,13 +1758,13 @@ namespace FluentAssertions.Primitives public class EnumAssertions : FluentAssertions.Primitives.EnumAssertions> where TEnum : struct, System.Enum { - public EnumAssertions(TEnum subject) { } + public EnumAssertions(TEnum subject, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class EnumAssertions where TEnum : struct, System.Enum where TAssertions : FluentAssertions.Primitives.EnumAssertions { - public EnumAssertions(TEnum subject) { } + public EnumAssertions(TEnum subject, FluentAssertions.Execution.AssertionChain assertionChain) { } public TEnum? Subject { get; } public FluentAssertions.AndConstraint Be(TEnum expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(TEnum? expected, string because = "", params object[] becauseArgs) { } @@ -1812,12 +1791,12 @@ namespace FluentAssertions.Primitives } public class GuidAssertions : FluentAssertions.Primitives.GuidAssertions { - public GuidAssertions(System.Guid? value) { } + public GuidAssertions(System.Guid? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class GuidAssertions where TAssertions : FluentAssertions.Primitives.GuidAssertions { - public GuidAssertions(System.Guid? value) { } + public GuidAssertions(System.Guid? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.Guid? Subject { get; } public FluentAssertions.AndConstraint Be(System.Guid expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } @@ -1829,12 +1808,12 @@ namespace FluentAssertions.Primitives } public class HttpResponseMessageAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions { - public HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value) { } + public HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class HttpResponseMessageAssertions : FluentAssertions.Primitives.ObjectAssertions where TAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions { - protected HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value) { } + protected HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeRedirection(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSuccessful(string because = "", params object[] becauseArgs) { } @@ -1846,12 +1825,12 @@ namespace FluentAssertions.Primitives } public class NullableBooleanAssertions : FluentAssertions.Primitives.NullableBooleanAssertions { - public NullableBooleanAssertions(bool? value) { } + public NullableBooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableBooleanAssertions : FluentAssertions.Primitives.BooleanAssertions where TAssertions : FluentAssertions.Primitives.NullableBooleanAssertions { - public NullableBooleanAssertions(bool? value) { } + public NullableBooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint Be(bool? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } @@ -1863,12 +1842,12 @@ namespace FluentAssertions.Primitives } public class NullableDateTimeAssertions : FluentAssertions.Primitives.NullableDateTimeAssertions { - public NullableDateTimeAssertions(System.DateTime? expected) { } + public NullableDateTimeAssertions(System.DateTime? expected, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableDateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions where TAssertions : FluentAssertions.Primitives.NullableDateTimeAssertions { - public NullableDateTimeAssertions(System.DateTime? expected) { } + public NullableDateTimeAssertions(System.DateTime? expected, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } @@ -1876,12 +1855,12 @@ namespace FluentAssertions.Primitives } public class NullableDateTimeOffsetAssertions : FluentAssertions.Primitives.NullableDateTimeOffsetAssertions { - public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected) { } + public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableDateTimeOffsetAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions where TAssertions : FluentAssertions.Primitives.NullableDateTimeOffsetAssertions { - public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected) { } + public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } @@ -1890,13 +1869,13 @@ namespace FluentAssertions.Primitives public class NullableEnumAssertions : FluentAssertions.Primitives.NullableEnumAssertions> where TEnum : struct, System.Enum { - public NullableEnumAssertions(TEnum? subject) { } + public NullableEnumAssertions(TEnum? subject, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableEnumAssertions : FluentAssertions.Primitives.EnumAssertions where TEnum : struct, System.Enum where TAssertions : FluentAssertions.Primitives.NullableEnumAssertions { - public NullableEnumAssertions(TEnum? subject) { } + public NullableEnumAssertions(TEnum? subject, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint NotBeNull(string because = "", params object[] becauseArgs) { } @@ -1904,12 +1883,12 @@ namespace FluentAssertions.Primitives } public class NullableGuidAssertions : FluentAssertions.Primitives.NullableGuidAssertions { - public NullableGuidAssertions(System.Guid? value) { } + public NullableGuidAssertions(System.Guid? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableGuidAssertions : FluentAssertions.Primitives.GuidAssertions where TAssertions : FluentAssertions.Primitives.NullableGuidAssertions { - public NullableGuidAssertions(System.Guid? value) { } + public NullableGuidAssertions(System.Guid? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint Be(System.Guid? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } @@ -1918,12 +1897,12 @@ namespace FluentAssertions.Primitives } public class NullableSimpleTimeSpanAssertions : FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions { - public NullableSimpleTimeSpanAssertions(System.TimeSpan? value) { } + public NullableSimpleTimeSpanAssertions(System.TimeSpan? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableSimpleTimeSpanAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions where TAssertions : FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions { - public NullableSimpleTimeSpanAssertions(System.TimeSpan? value) { } + public NullableSimpleTimeSpanAssertions(System.TimeSpan? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint Be(System.TimeSpan? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } @@ -1932,7 +1911,7 @@ namespace FluentAssertions.Primitives } public class ObjectAssertions : FluentAssertions.Primitives.ObjectAssertions { - public ObjectAssertions(object value) { } + public ObjectAssertions(object value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint Be(TExpectation expected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(TExpectation unexpected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } @@ -1940,7 +1919,7 @@ namespace FluentAssertions.Primitives public class ObjectAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TAssertions : FluentAssertions.Primitives.ObjectAssertions { - public ObjectAssertions(TSubject value) { } + public ObjectAssertions(TSubject value, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(TSubject expected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } @@ -1958,7 +1937,8 @@ namespace FluentAssertions.Primitives public abstract class ReferenceTypeAssertions where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - protected ReferenceTypeAssertions(TSubject subject) { } + protected ReferenceTypeAssertions(TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain) { } + public FluentAssertions.Execution.AssertionChain CurrentAssertionChain { get; } protected abstract string Identifier { get; } public TSubject Subject { get; } public FluentAssertions.AndConstraint BeAssignableTo(System.Type type, string because = "", params object[] becauseArgs) { } @@ -1982,12 +1962,12 @@ namespace FluentAssertions.Primitives } public class SimpleTimeSpanAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { - public SimpleTimeSpanAssertions(System.TimeSpan? value) { } + public SimpleTimeSpanAssertions(System.TimeSpan? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class SimpleTimeSpanAssertions where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { - public SimpleTimeSpanAssertions(System.TimeSpan? value) { } + public SimpleTimeSpanAssertions(System.TimeSpan? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.TimeSpan? Subject { get; } public FluentAssertions.AndConstraint Be(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } @@ -2003,12 +1983,12 @@ namespace FluentAssertions.Primitives } public class StringAssertions : FluentAssertions.Primitives.StringAssertions { - public StringAssertions(string value) { } + public StringAssertions(string value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class StringAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TAssertions : FluentAssertions.Primitives.StringAssertions { - public StringAssertions(string value) { } + public StringAssertions(string value, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } @@ -2084,8 +2064,8 @@ namespace FluentAssertions.Specialized { public class ActionAssertions : FluentAssertions.Specialized.DelegateAssertions { - public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } + public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } protected override void InvokeSubject() { } public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } @@ -2095,7 +2075,7 @@ namespace FluentAssertions.Specialized where TTask : System.Threading.Tasks.Task where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions { - protected AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + protected AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } public System.Threading.Tasks.Task> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) @@ -2121,7 +2101,7 @@ namespace FluentAssertions.Specialized where TDelegate : System.Delegate where TAssertions : FluentAssertions.Specialized.DelegateAssertions { - protected DelegateAssertions(TDelegate @delegate, FluentAssertions.Specialized.IExtractExceptions extractor) { } + protected DelegateAssertions(TDelegate @delegate, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } protected abstract void InvokeSubject(); public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) where TException : System.Exception { } @@ -2133,7 +2113,7 @@ namespace FluentAssertions.Specialized public class ExceptionAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions, FluentAssertions.Specialized.ExceptionAssertions> where TException : System.Exception { - public ExceptionAssertions(System.Collections.Generic.IEnumerable exceptions) { } + public ExceptionAssertions(System.Collections.Generic.IEnumerable exceptions, FluentAssertions.Execution.AssertionChain assertionChain) { } public TException And { get; } protected override string Identifier { get; } public TException Which { get; } @@ -2155,7 +2135,7 @@ namespace FluentAssertions.Specialized } public class ExecutionTimeAssertions { - public ExecutionTimeAssertions(FluentAssertions.Specialized.ExecutionTime executionTime) { } + public ExecutionTimeAssertions(FluentAssertions.Specialized.ExecutionTime executionTime, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan expectedDuration, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } @@ -2165,8 +2145,8 @@ namespace FluentAssertions.Specialized } public class FunctionAssertions : FluentAssertions.Specialized.DelegateAssertions, FluentAssertions.Specialized.FunctionAssertions> { - public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } + public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } protected override void InvokeSubject() { } public FluentAssertions.AndWhichConstraint, T> NotThrow(string because = "", params object[] becauseArgs) { } @@ -2174,8 +2154,8 @@ namespace FluentAssertions.Specialized } public class GenericAsyncFunctionAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions, FluentAssertions.Specialized.GenericAsyncFunctionAssertions> { - public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } + public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task, TResult>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task, TResult>> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task, TResult>> NotThrowAsync(string because = "", params object[] becauseArgs) { } @@ -2191,8 +2171,8 @@ namespace FluentAssertions.Specialized } public class NonGenericAsyncFunctionAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions { - public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } + public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) { } @@ -2204,8 +2184,8 @@ namespace FluentAssertions.Specialized } public class TaskCompletionSourceAssertions : FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase { - public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs) { } - public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Common.IClock clock) { } + public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Execution.AssertionChain assertionChain) { } + public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task, T>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task>> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } } @@ -2214,23 +2194,23 @@ namespace FluentAssertions.Streams { public class BufferedStreamAssertions : FluentAssertions.Streams.BufferedStreamAssertions { - public BufferedStreamAssertions(System.IO.BufferedStream stream) { } + public BufferedStreamAssertions(System.IO.BufferedStream stream, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class BufferedStreamAssertions : FluentAssertions.Streams.StreamAssertions where TAssertions : FluentAssertions.Streams.BufferedStreamAssertions { - public BufferedStreamAssertions(System.IO.BufferedStream stream) { } + public BufferedStreamAssertions(System.IO.BufferedStream stream, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } } public class StreamAssertions : FluentAssertions.Streams.StreamAssertions { - public StreamAssertions(System.IO.Stream stream) { } + public StreamAssertions(System.IO.Stream stream, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class StreamAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TSubject : System.IO.Stream where TAssertions : FluentAssertions.Streams.StreamAssertions { - public StreamAssertions(TSubject stream) { } + public StreamAssertions(TSubject stream, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeReadOnly(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeReadable(string because = "", params object[] becauseArgs) { } @@ -2256,7 +2236,7 @@ namespace FluentAssertions.Types } public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public AssemblyAssertions(System.Reflection.Assembly assembly) { } + public AssemblyAssertions(System.Reflection.Assembly assembly, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } @@ -2266,14 +2246,14 @@ namespace FluentAssertions.Types } public class ConstructorInfoAssertions : FluentAssertions.Types.MethodBaseAssertions { - public ConstructorInfoAssertions(System.Reflection.ConstructorInfo constructorInfo) { } + public ConstructorInfoAssertions(System.Reflection.ConstructorInfo constructorInfo, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } } public abstract class MemberInfoAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TSubject : System.Reflection.MemberInfo where TAssertions : FluentAssertions.Types.MemberInfoAssertions { - protected MemberInfoAssertions(TSubject subject) { } + protected MemberInfoAssertions(TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndWhichConstraint, TAttribute> BeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } @@ -2288,13 +2268,13 @@ namespace FluentAssertions.Types where TSubject : System.Reflection.MethodBase where TAssertions : FluentAssertions.Types.MethodBaseAssertions { - protected MethodBaseAssertions(TSubject subject) { } + protected MethodBaseAssertions(TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint HaveAccessModifier(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveAccessModifier(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } } public class MethodInfoAssertions : FluentAssertions.Types.MethodBaseAssertions { - public MethodInfoAssertions(System.Reflection.MethodInfo methodInfo) { } + public MethodInfoAssertions(System.Reflection.MethodInfo methodInfo, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeAsync(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } @@ -2338,7 +2318,7 @@ namespace FluentAssertions.Types } public class MethodInfoSelectorAssertions { - public MethodInfoSelectorAssertions(params System.Reflection.MethodInfo[] methods) { } + public MethodInfoSelectorAssertions(FluentAssertions.Execution.AssertionChain assertionChain, params System.Reflection.MethodInfo[] methods) { } protected string Context { get; } public System.Collections.Generic.IEnumerable SubjectMethods { get; } public FluentAssertions.AndConstraint Be(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } @@ -2359,7 +2339,7 @@ namespace FluentAssertions.Types } public class PropertyInfoAssertions : FluentAssertions.Types.MemberInfoAssertions { - public PropertyInfoAssertions(System.Reflection.PropertyInfo propertyInfo) { } + public PropertyInfoAssertions(System.Reflection.PropertyInfo propertyInfo, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeReadable(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeReadable(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } @@ -2401,7 +2381,7 @@ namespace FluentAssertions.Types } public class PropertyInfoSelectorAssertions { - public PropertyInfoSelectorAssertions(params System.Reflection.PropertyInfo[] properties) { } + public PropertyInfoSelectorAssertions(FluentAssertions.Execution.AssertionChain assertionChain, params System.Reflection.PropertyInfo[] properties) { } protected string Context { get; } public System.Collections.Generic.IEnumerable SubjectProperties { get; } public FluentAssertions.AndConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) @@ -2416,7 +2396,7 @@ namespace FluentAssertions.Types } public class TypeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public TypeAssertions(System.Type type) { } + public TypeAssertions(System.Type type, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Type expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(string because = "", params object[] becauseArgs) { } @@ -2534,7 +2514,7 @@ namespace FluentAssertions.Types } public class TypeSelectorAssertions { - public TypeSelectorAssertions(params System.Type[] types) { } + public TypeSelectorAssertions(FluentAssertions.Execution.AssertionChain assertionChain, params System.Type[] types) { } public System.Collections.Generic.IEnumerable Subject { get; } public FluentAssertions.AndConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } @@ -2565,7 +2545,7 @@ namespace FluentAssertions.Xml { public class XAttributeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public XAttributeAssertions(System.Xml.Linq.XAttribute attribute) { } + public XAttributeAssertions(System.Xml.Linq.XAttribute attribute, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XAttribute expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) { } @@ -2573,7 +2553,7 @@ namespace FluentAssertions.Xml } public class XDocumentAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public XDocumentAssertions(System.Xml.Linq.XDocument document) { } + public XDocumentAssertions(System.Xml.Linq.XDocument document, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } @@ -2588,7 +2568,7 @@ namespace FluentAssertions.Xml } public class XElementAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public XElementAssertions(System.Xml.Linq.XElement xElement) { } + public XElementAssertions(System.Xml.Linq.XElement xElement, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } @@ -2604,7 +2584,7 @@ namespace FluentAssertions.Xml } public class XmlElementAssertions : FluentAssertions.Xml.XmlNodeAssertions { - public XmlElementAssertions(System.Xml.XmlElement xmlElement) { } + public XmlElementAssertions(System.Xml.XmlElement xmlElement, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveAttributeWithNamespace(string expectedName, string expectedNamespace, string expectedValue, string because = "", params object[] becauseArgs) { } @@ -2614,13 +2594,13 @@ namespace FluentAssertions.Xml } public class XmlNodeAssertions : FluentAssertions.Xml.XmlNodeAssertions { - public XmlNodeAssertions(System.Xml.XmlNode xmlNode) { } + public XmlNodeAssertions(System.Xml.XmlNode xmlNode, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class XmlNodeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TSubject : System.Xml.XmlNode where TAssertions : FluentAssertions.Xml.XmlNodeAssertions { - public XmlNodeAssertions(TSubject xmlNode) { } + public XmlNodeAssertions(TSubject xmlNode, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.XmlNode expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.XmlNode unexpected, string because = "", params object[] becauseArgs) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index c9ad572ad9..81ee39274e 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -15,12 +15,14 @@ namespace FluentAssertions public AndConstraint(TParent parent) { } public TParent And { get; } } - public class AndWhichConstraint : FluentAssertions.AndConstraint + public class AndWhichConstraint : FluentAssertions.AndConstraint { - public AndWhichConstraint(TParentConstraint parentConstraint, System.Collections.Generic.IEnumerable matchedConstraint) { } - public AndWhichConstraint(TParentConstraint parentConstraint, TMatchedElement matchedConstraint) { } - public TMatchedElement Subject { get; } - public TMatchedElement Which { get; } + public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects) { } + public AndWhichConstraint(TParent parent, TSubject subject) { } + public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects, FluentAssertions.Execution.AssertionChain assertionChain, string pathPostfix) { } + public AndWhichConstraint(TParent parent, TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain, string pathPostfix = "") { } + public TSubject Subject { get; } + public TSubject Which { get; } } public static class AssertionExtensions { @@ -389,18 +391,18 @@ namespace FluentAssertions.Collections { public class GenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions, T, FluentAssertions.Collections.GenericCollectionAssertions> { - public GenericCollectionAssertions(System.Collections.Generic.IEnumerable actualValue) { } + public GenericCollectionAssertions(System.Collections.Generic.IEnumerable actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class GenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions> where TCollection : System.Collections.Generic.IEnumerable { - public GenericCollectionAssertions(TCollection actualValue) { } + public GenericCollectionAssertions(TCollection actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class GenericCollectionAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TCollection : System.Collections.Generic.IEnumerable where TAssertions : FluentAssertions.Collections.GenericCollectionAssertions { - public GenericCollectionAssertions(TCollection actualValue) { } + public GenericCollectionAssertions(TCollection actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint AllBeAssignableTo(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> AllBeAssignableTo(string because = "", params object[] becauseArgs) { } @@ -474,7 +476,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint NotBeSubsetOf(System.Collections.Generic.IEnumerable unexpectedSuperset, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContain(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint NotContain(T unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotContain(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainInConsecutiveOrder(params T[] unexpected) { } @@ -505,13 +507,13 @@ namespace FluentAssertions.Collections public class GenericDictionaryAssertions : FluentAssertions.Collections.GenericDictionaryAssertions> where TCollection : System.Collections.Generic.IEnumerable> { - public GenericDictionaryAssertions(TCollection keyValuePairs) { } + public GenericDictionaryAssertions(TCollection keyValuePairs, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class GenericDictionaryAssertions : FluentAssertions.Collections.GenericCollectionAssertions, TAssertions> where TCollection : System.Collections.Generic.IEnumerable> where TAssertions : FluentAssertions.Collections.GenericDictionaryAssertions { - public GenericDictionaryAssertions(TCollection keyValuePairs) { } + public GenericDictionaryAssertions(TCollection keyValuePairs, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } @@ -523,8 +525,8 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint ContainKeys(params TKey[] expected) { } public FluentAssertions.AndConstraint ContainKeys(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint ContainValue(TValue expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainValues(params TValue[] expected) { } - public FluentAssertions.AndConstraint ContainValues(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint> ContainValues(params TValue[] expected) { } + public FluentAssertions.AndWhichConstraint> ContainValues(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Equal(T expected, string because = "", params object[] becauseArgs) where T : System.Collections.Generic.IEnumerable> { } public FluentAssertions.AndConstraint NotContain(params System.Collections.Generic.KeyValuePair[] items) { } @@ -542,18 +544,18 @@ namespace FluentAssertions.Collections } public class StringCollectionAssertions : FluentAssertions.Collections.StringCollectionAssertions> { - public StringCollectionAssertions(System.Collections.Generic.IEnumerable actualValue) { } + public StringCollectionAssertions(System.Collections.Generic.IEnumerable actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class StringCollectionAssertions : FluentAssertions.Collections.StringCollectionAssertions> where TCollection : System.Collections.Generic.IEnumerable { - public StringCollectionAssertions(TCollection actualValue) { } + public StringCollectionAssertions(TCollection actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class StringCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions where TCollection : System.Collections.Generic.IEnumerable where TAssertions : FluentAssertions.Collections.StringCollectionAssertions { - public StringCollectionAssertions(TCollection actualValue) { } + public StringCollectionAssertions(TCollection actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint AllBe(string expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint AllBe(string expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(params string[] expectation) { } @@ -566,18 +568,18 @@ namespace FluentAssertions.Collections } public class SubsequentOrderingAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions, T, FluentAssertions.Collections.SubsequentOrderingAssertions> { - public SubsequentOrderingAssertions(System.Collections.Generic.IEnumerable actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } + public SubsequentOrderingAssertions(System.Collections.Generic.IEnumerable actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions> where TCollection : System.Collections.Generic.IEnumerable { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } + public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions where TCollection : System.Collections.Generic.IEnumerable where TAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } + public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } @@ -718,7 +720,7 @@ namespace FluentAssertions.Equivalency { protected EquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } - protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested); + protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator); } public class EquivalencyValidationContext : FluentAssertions.Equivalency.IEquivalencyValidationContext { @@ -810,7 +812,7 @@ namespace FluentAssertions.Equivalency } public interface IMemberMatchingRule { - FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyOptions options); + FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyOptions options, FluentAssertions.Execution.AssertionChain assertionChain); } public interface IMemberSelectionRule { @@ -972,7 +974,7 @@ namespace FluentAssertions.Equivalency.Steps { public class AssertionRuleEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { - public AssertionRuleEquivalencyStep(System.Linq.Expressions.Expression> predicate, System.Action> assertion) { } + public AssertionRuleEquivalencyStep(System.Linq.Expressions.Expression> predicate, System.Action> assertionAction) { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } @@ -985,7 +987,7 @@ namespace FluentAssertions.Equivalency.Steps public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } public class EnumEqualityStep : FluentAssertions.Equivalency.IEquivalencyStep { @@ -1046,17 +1048,17 @@ namespace FluentAssertions.Equivalency.Steps public class XAttributeEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XAttributeEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } public class XDocumentEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XDocumentEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } public class XElementEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XElementEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } } namespace FluentAssertions.Equivalency.Tracing @@ -1086,7 +1088,7 @@ namespace FluentAssertions.Events { public class EventAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> { - protected EventAssertions(FluentAssertions.Events.IMonitor monitor) { } + protected EventAssertions(FluentAssertions.Events.IMonitor monitor, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.Events.IMonitor Monitor { get; } public void NotRaise(string eventName, string because = "", params object[] becauseArgs) { } @@ -1132,76 +1134,62 @@ namespace FluentAssertions.Events } namespace FluentAssertions.Execution { + public sealed class AssertionChain + { + public string CallerIdentifier { get; } + public bool HasOverriddenCallerIdentifier { get; } + public bool Succeeded { get; } + public FluentAssertions.Execution.AssertionChain UsingLineBreaks { get; } + public void AddReportable(string key, System.Func getValue) { } + public void AddReportable(string key, string value) { } + public FluentAssertions.Execution.AssertionChain BecauseOf(FluentAssertions.Execution.Reason reason) { } + public FluentAssertions.Execution.AssertionChain BecauseOf(string because, params object[] becauseArgs) { } + public FluentAssertions.Execution.Continuation FailWith(System.Func getFailureReason) { } + public FluentAssertions.Execution.Continuation FailWith(string message) { } + public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } + public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } + public FluentAssertions.Execution.AssertionChain ForCondition(bool condition) { } + public FluentAssertions.Execution.AssertionChain ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } + public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } + public void OverrideCallerIdentifier(System.Func getCallerIdentifier) { } + public void ReuseOnce() { } + public FluentAssertions.Execution.AssertionChain WithCallerPostfix(string postfix) { } + public FluentAssertions.Execution.AssertionChain WithDefaultIdentifier(string identifier) { } + public FluentAssertions.Execution.Continuation WithExpectation(string message, System.Action chain) { } + public FluentAssertions.Execution.Continuation WithExpectation(string message, object arg1, System.Action chain) { } + public FluentAssertions.Execution.Continuation WithExpectation(string message, object arg1, object arg2, System.Action chain) { } + public FluentAssertions.Execution.AssertionChain WithReportable(string name, System.Func content) { } + public static FluentAssertions.Execution.AssertionChain GetOrCreate() { } + } [System.Serializable] public class AssertionFailedException : System.Exception { public AssertionFailedException(string message) { } protected AssertionFailedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } - public sealed class AssertionScope : FluentAssertions.Execution.IAssertionScope, System.IDisposable + public sealed class AssertionScope : System.IDisposable { public AssertionScope() { } public AssertionScope(FluentAssertions.Execution.IAssertionStrategy assertionStrategy) { } - public AssertionScope(System.Lazy context) { } - public AssertionScope(string context) { } - public string CallerIdentity { get; } - public System.Lazy Context { get; set; } + public AssertionScope(System.Func name) { } + public AssertionScope(string name) { } public FluentAssertions.Formatting.FormattingOptions FormattingOptions { get; } - public FluentAssertions.Execution.AssertionScope UsingLineBreaks { get; } + public System.Func Name { get; } public static FluentAssertions.Execution.AssertionScope Current { get; } - public void AddNonReportable(string key, object value) { } public void AddPreFormattedFailure(string formattedFailureMessage) { } - public void AddReportable(string key, System.Func valueFunc) { } - public void AddReportable(string key, string value) { } public void AppendTracing(string tracingBlock) { } - public void AssumeSingleCaller() { } - public FluentAssertions.Execution.AssertionScope BecauseOf(FluentAssertions.Execution.Reason reason) { } - public FluentAssertions.Execution.AssertionScope BecauseOf(string because, params object[] becauseArgs) { } - public FluentAssertions.Execution.Continuation ClearExpectation() { } public string[] Discard() { } public void Dispose() { } - public FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc) { } - public FluentAssertions.Execution.Continuation FailWith(string message) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } - public FluentAssertions.Execution.AssertionScope ForCondition(bool condition) { } - public FluentAssertions.Execution.AssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } - public T Get(string key) { } - public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } public bool HasFailures() { } - public FluentAssertions.Execution.AssertionScope WithDefaultIdentifier(string identifier) { } - public FluentAssertions.Execution.AssertionScope WithExpectation(string message, params object[] args) { } } public class Continuation { - public FluentAssertions.Execution.IAssertionScope Then { get; } - public static bool op_Implicit(FluentAssertions.Execution.Continuation continuation) { } + public FluentAssertions.Execution.AssertionChain Then { get; } } public class ContinuationOfGiven { + public bool Succeeded { get; } public FluentAssertions.Execution.GivenSelector Then { get; } - public static bool op_Implicit(FluentAssertions.Execution.ContinuationOfGiven continuationOfGiven) { } - } - public sealed class ContinuedAssertionScope : FluentAssertions.Execution.IAssertionScope, System.IDisposable - { - public FluentAssertions.Execution.IAssertionScope UsingLineBreaks { get; } - public FluentAssertions.Execution.IAssertionScope BecauseOf(string because, params object[] becauseArgs) { } - public FluentAssertions.Execution.Continuation ClearExpectation() { } - public string[] Discard() { } - public void Dispose() { } - public FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc) { } - public FluentAssertions.Execution.Continuation FailWith(string message) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } - public FluentAssertions.Execution.IAssertionScope ForCondition(bool condition) { } - public FluentAssertions.Execution.IAssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } - public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } - public FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier) { } - public FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args) { } - } - public static class Execute - { - public static FluentAssertions.Execution.AssertionScope Assertion { get; } } public class FailReason { @@ -1211,29 +1199,13 @@ namespace FluentAssertions.Execution } public class GivenSelector { - public FluentAssertions.Execution.ContinuationOfGiven ClearExpectation() { } + public bool Succeeded { get; } public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message) { } public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message, params System.Func[] args) { } public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message, params object[] args) { } public FluentAssertions.Execution.GivenSelector ForCondition(System.Func predicate) { } public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } } - public interface IAssertionScope : System.IDisposable - { - FluentAssertions.Execution.IAssertionScope UsingLineBreaks { get; } - FluentAssertions.Execution.IAssertionScope BecauseOf(string because, params object[] becauseArgs); - FluentAssertions.Execution.Continuation ClearExpectation(); - string[] Discard(); - FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc); - FluentAssertions.Execution.Continuation FailWith(string message); - FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders); - FluentAssertions.Execution.Continuation FailWith(string message, params object[] args); - FluentAssertions.Execution.IAssertionScope ForCondition(bool condition); - FluentAssertions.Execution.IAssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences); - FluentAssertions.Execution.GivenSelector Given(System.Func selector); - FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier); - FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args); - } public interface IAssertionStrategy { System.Collections.Generic.IEnumerable FailureMessages { get; } @@ -1482,6 +1454,12 @@ namespace FluentAssertions.Formatting public MaxLinesExceededException(string message) { } public MaxLinesExceededException(string message, System.Exception innerException) { } } + public class MethodInfoFormatter : FluentAssertions.Formatting.IValueFormatter + { + public MethodInfoFormatter() { } + public bool CanHandle(object value) { } + public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } + } public class MultidimensionalArrayFormatter : FluentAssertions.Formatting.IValueFormatter { public MultidimensionalArrayFormatter() { } @@ -1594,12 +1572,12 @@ namespace FluentAssertions.Numeric { public class ComparableTypeAssertions : FluentAssertions.Numeric.ComparableTypeAssertions> { - public ComparableTypeAssertions(System.IComparable value) { } + public ComparableTypeAssertions(System.IComparable value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class ComparableTypeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions, TAssertions> where TAssertions : FluentAssertions.Numeric.ComparableTypeAssertions { - public ComparableTypeAssertions(System.IComparable value) { } + public ComparableTypeAssertions(System.IComparable value, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } @@ -1619,13 +1597,13 @@ namespace FluentAssertions.Numeric public class NullableNumericAssertions : FluentAssertions.Numeric.NullableNumericAssertions> where T : struct, System.IComparable { - public NullableNumericAssertions(T? value) { } + public NullableNumericAssertions(T? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableNumericAssertions : FluentAssertions.Numeric.NumericAssertions where T : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NullableNumericAssertions { - public NullableNumericAssertions(T? value) { } + public NullableNumericAssertions(T? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } @@ -1635,13 +1613,14 @@ namespace FluentAssertions.Numeric public class NumericAssertions : FluentAssertions.Numeric.NumericAssertions> where T : struct, System.IComparable { - public NumericAssertions(T value) { } + public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NumericAssertions where T : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NumericAssertions { - public NumericAssertions(T value) { } + public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } + public FluentAssertions.Execution.AssertionChain CurrentAssertionChain { get; } public T? Subject { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) { } @@ -1667,12 +1646,12 @@ namespace FluentAssertions.Primitives { public class BooleanAssertions : FluentAssertions.Primitives.BooleanAssertions { - public BooleanAssertions(bool? value) { } + public BooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class BooleanAssertions where TAssertions : FluentAssertions.Primitives.BooleanAssertions { - public BooleanAssertions(bool? value) { } + public BooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public bool? Subject { get; } public FluentAssertions.AndConstraint Be(bool expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeFalse(string because = "", params object[] becauseArgs) { } @@ -1683,12 +1662,12 @@ namespace FluentAssertions.Primitives } public class DateOnlyAssertions : FluentAssertions.Primitives.DateOnlyAssertions { - public DateOnlyAssertions(System.DateOnly? value) { } + public DateOnlyAssertions(System.DateOnly? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class DateOnlyAssertions where TAssertions : FluentAssertions.Primitives.DateOnlyAssertions { - public DateOnlyAssertions(System.DateOnly? value) { } + public DateOnlyAssertions(System.DateOnly? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.DateOnly? Subject { get; } public FluentAssertions.AndConstraint Be(System.DateOnly expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(System.DateOnly? expected, string because = "", params object[] becauseArgs) { } @@ -1716,12 +1695,12 @@ namespace FluentAssertions.Primitives } public class DateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions { - public DateTimeAssertions(System.DateTime? value) { } + public DateTimeAssertions(System.DateTime? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class DateTimeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { - public DateTimeAssertions(System.DateTime? value) { } + public DateTimeAssertions(System.DateTime? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.DateTime? Subject { get; } public FluentAssertions.AndConstraint Be(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(System.DateTime? expected, string because = "", params object[] becauseArgs) { } @@ -1766,12 +1745,12 @@ namespace FluentAssertions.Primitives } public class DateTimeOffsetAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { - public DateTimeOffsetAssertions(System.DateTimeOffset? value) { } + public DateTimeOffsetAssertions(System.DateTimeOffset? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class DateTimeOffsetAssertions where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { - public DateTimeOffsetAssertions(System.DateTimeOffset? value) { } + public DateTimeOffsetAssertions(System.DateTimeOffset? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.DateTimeOffset? Subject { get; } public FluentAssertions.AndConstraint Be(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(System.DateTimeOffset? expected, string because = "", params object[] becauseArgs) { } @@ -1821,7 +1800,7 @@ namespace FluentAssertions.Primitives public class DateTimeOffsetRangeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { - protected DateTimeOffsetRangeAssertions(TAssertions parentAssertions, System.DateTimeOffset? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } + protected DateTimeOffsetRangeAssertions(TAssertions parentAssertions, FluentAssertions.Execution.AssertionChain assertionChain, System.DateTimeOffset? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } @@ -1829,7 +1808,7 @@ namespace FluentAssertions.Primitives public class DateTimeRangeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { - protected DateTimeRangeAssertions(TAssertions parentAssertions, System.DateTime? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } + protected DateTimeRangeAssertions(TAssertions parentAssertions, FluentAssertions.Execution.AssertionChain assertionChain, System.DateTime? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTime target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTime target, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } @@ -1837,13 +1816,13 @@ namespace FluentAssertions.Primitives public class EnumAssertions : FluentAssertions.Primitives.EnumAssertions> where TEnum : struct, System.Enum { - public EnumAssertions(TEnum subject) { } + public EnumAssertions(TEnum subject, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class EnumAssertions where TEnum : struct, System.Enum where TAssertions : FluentAssertions.Primitives.EnumAssertions { - public EnumAssertions(TEnum subject) { } + public EnumAssertions(TEnum subject, FluentAssertions.Execution.AssertionChain assertionChain) { } public TEnum? Subject { get; } public FluentAssertions.AndConstraint Be(TEnum expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(TEnum? expected, string because = "", params object[] becauseArgs) { } @@ -1870,12 +1849,12 @@ namespace FluentAssertions.Primitives } public class GuidAssertions : FluentAssertions.Primitives.GuidAssertions { - public GuidAssertions(System.Guid? value) { } + public GuidAssertions(System.Guid? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class GuidAssertions where TAssertions : FluentAssertions.Primitives.GuidAssertions { - public GuidAssertions(System.Guid? value) { } + public GuidAssertions(System.Guid? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.Guid? Subject { get; } public FluentAssertions.AndConstraint Be(System.Guid expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } @@ -1887,12 +1866,12 @@ namespace FluentAssertions.Primitives } public class HttpResponseMessageAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions { - public HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value) { } + public HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class HttpResponseMessageAssertions : FluentAssertions.Primitives.ObjectAssertions where TAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions { - protected HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value) { } + protected HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeRedirection(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSuccessful(string because = "", params object[] becauseArgs) { } @@ -1904,12 +1883,12 @@ namespace FluentAssertions.Primitives } public class NullableBooleanAssertions : FluentAssertions.Primitives.NullableBooleanAssertions { - public NullableBooleanAssertions(bool? value) { } + public NullableBooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableBooleanAssertions : FluentAssertions.Primitives.BooleanAssertions where TAssertions : FluentAssertions.Primitives.NullableBooleanAssertions { - public NullableBooleanAssertions(bool? value) { } + public NullableBooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint Be(bool? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } @@ -1921,12 +1900,12 @@ namespace FluentAssertions.Primitives } public class NullableDateOnlyAssertions : FluentAssertions.Primitives.NullableDateOnlyAssertions { - public NullableDateOnlyAssertions(System.DateOnly? value) { } + public NullableDateOnlyAssertions(System.DateOnly? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableDateOnlyAssertions : FluentAssertions.Primitives.DateOnlyAssertions where TAssertions : FluentAssertions.Primitives.NullableDateOnlyAssertions { - public NullableDateOnlyAssertions(System.DateOnly? value) { } + public NullableDateOnlyAssertions(System.DateOnly? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } @@ -1934,12 +1913,12 @@ namespace FluentAssertions.Primitives } public class NullableDateTimeAssertions : FluentAssertions.Primitives.NullableDateTimeAssertions { - public NullableDateTimeAssertions(System.DateTime? expected) { } + public NullableDateTimeAssertions(System.DateTime? expected, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableDateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions where TAssertions : FluentAssertions.Primitives.NullableDateTimeAssertions { - public NullableDateTimeAssertions(System.DateTime? expected) { } + public NullableDateTimeAssertions(System.DateTime? expected, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } @@ -1947,12 +1926,12 @@ namespace FluentAssertions.Primitives } public class NullableDateTimeOffsetAssertions : FluentAssertions.Primitives.NullableDateTimeOffsetAssertions { - public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected) { } + public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableDateTimeOffsetAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions where TAssertions : FluentAssertions.Primitives.NullableDateTimeOffsetAssertions { - public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected) { } + public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } @@ -1961,13 +1940,13 @@ namespace FluentAssertions.Primitives public class NullableEnumAssertions : FluentAssertions.Primitives.NullableEnumAssertions> where TEnum : struct, System.Enum { - public NullableEnumAssertions(TEnum? subject) { } + public NullableEnumAssertions(TEnum? subject, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableEnumAssertions : FluentAssertions.Primitives.EnumAssertions where TEnum : struct, System.Enum where TAssertions : FluentAssertions.Primitives.NullableEnumAssertions { - public NullableEnumAssertions(TEnum? subject) { } + public NullableEnumAssertions(TEnum? subject, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint NotBeNull(string because = "", params object[] becauseArgs) { } @@ -1975,12 +1954,12 @@ namespace FluentAssertions.Primitives } public class NullableGuidAssertions : FluentAssertions.Primitives.NullableGuidAssertions { - public NullableGuidAssertions(System.Guid? value) { } + public NullableGuidAssertions(System.Guid? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableGuidAssertions : FluentAssertions.Primitives.GuidAssertions where TAssertions : FluentAssertions.Primitives.NullableGuidAssertions { - public NullableGuidAssertions(System.Guid? value) { } + public NullableGuidAssertions(System.Guid? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint Be(System.Guid? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } @@ -1989,12 +1968,12 @@ namespace FluentAssertions.Primitives } public class NullableSimpleTimeSpanAssertions : FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions { - public NullableSimpleTimeSpanAssertions(System.TimeSpan? value) { } + public NullableSimpleTimeSpanAssertions(System.TimeSpan? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableSimpleTimeSpanAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions where TAssertions : FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions { - public NullableSimpleTimeSpanAssertions(System.TimeSpan? value) { } + public NullableSimpleTimeSpanAssertions(System.TimeSpan? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint Be(System.TimeSpan? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } @@ -2003,12 +1982,12 @@ namespace FluentAssertions.Primitives } public class NullableTimeOnlyAssertions : FluentAssertions.Primitives.NullableTimeOnlyAssertions { - public NullableTimeOnlyAssertions(System.TimeOnly? value) { } + public NullableTimeOnlyAssertions(System.TimeOnly? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableTimeOnlyAssertions : FluentAssertions.Primitives.TimeOnlyAssertions where TAssertions : FluentAssertions.Primitives.NullableTimeOnlyAssertions { - public NullableTimeOnlyAssertions(System.TimeOnly? value) { } + public NullableTimeOnlyAssertions(System.TimeOnly? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } @@ -2016,7 +1995,7 @@ namespace FluentAssertions.Primitives } public class ObjectAssertions : FluentAssertions.Primitives.ObjectAssertions { - public ObjectAssertions(object value) { } + public ObjectAssertions(object value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint Be(TExpectation expected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(TExpectation unexpected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } @@ -2024,7 +2003,7 @@ namespace FluentAssertions.Primitives public class ObjectAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TAssertions : FluentAssertions.Primitives.ObjectAssertions { - public ObjectAssertions(TSubject value) { } + public ObjectAssertions(TSubject value, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(TSubject expected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } @@ -2042,7 +2021,8 @@ namespace FluentAssertions.Primitives public abstract class ReferenceTypeAssertions where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - protected ReferenceTypeAssertions(TSubject subject) { } + protected ReferenceTypeAssertions(TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain) { } + public FluentAssertions.Execution.AssertionChain CurrentAssertionChain { get; } protected abstract string Identifier { get; } public TSubject Subject { get; } public FluentAssertions.AndConstraint BeAssignableTo(System.Type type, string because = "", params object[] becauseArgs) { } @@ -2066,12 +2046,12 @@ namespace FluentAssertions.Primitives } public class SimpleTimeSpanAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { - public SimpleTimeSpanAssertions(System.TimeSpan? value) { } + public SimpleTimeSpanAssertions(System.TimeSpan? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class SimpleTimeSpanAssertions where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { - public SimpleTimeSpanAssertions(System.TimeSpan? value) { } + public SimpleTimeSpanAssertions(System.TimeSpan? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.TimeSpan? Subject { get; } public FluentAssertions.AndConstraint Be(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } @@ -2087,12 +2067,12 @@ namespace FluentAssertions.Primitives } public class StringAssertions : FluentAssertions.Primitives.StringAssertions { - public StringAssertions(string value) { } + public StringAssertions(string value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class StringAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TAssertions : FluentAssertions.Primitives.StringAssertions { - public StringAssertions(string value) { } + public StringAssertions(string value, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } @@ -2157,12 +2137,12 @@ namespace FluentAssertions.Primitives } public class TimeOnlyAssertions : FluentAssertions.Primitives.TimeOnlyAssertions { - public TimeOnlyAssertions(System.TimeOnly? value) { } + public TimeOnlyAssertions(System.TimeOnly? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class TimeOnlyAssertions where TAssertions : FluentAssertions.Primitives.TimeOnlyAssertions { - public TimeOnlyAssertions(System.TimeOnly? value) { } + public TimeOnlyAssertions(System.TimeOnly? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.TimeOnly? Subject { get; } public FluentAssertions.AndConstraint Be(System.TimeOnly expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(System.TimeOnly? expected, string because = "", params object[] becauseArgs) { } @@ -2205,8 +2185,8 @@ namespace FluentAssertions.Specialized { public class ActionAssertions : FluentAssertions.Specialized.DelegateAssertions { - public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } + public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } protected override void InvokeSubject() { } public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } @@ -2216,7 +2196,7 @@ namespace FluentAssertions.Specialized where TTask : System.Threading.Tasks.Task where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions { - protected AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + protected AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } public System.Threading.Tasks.Task> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) @@ -2242,7 +2222,7 @@ namespace FluentAssertions.Specialized where TDelegate : System.Delegate where TAssertions : FluentAssertions.Specialized.DelegateAssertions { - protected DelegateAssertions(TDelegate @delegate, FluentAssertions.Specialized.IExtractExceptions extractor) { } + protected DelegateAssertions(TDelegate @delegate, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } protected abstract void InvokeSubject(); public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) where TException : System.Exception { } @@ -2254,7 +2234,7 @@ namespace FluentAssertions.Specialized public class ExceptionAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions, FluentAssertions.Specialized.ExceptionAssertions> where TException : System.Exception { - public ExceptionAssertions(System.Collections.Generic.IEnumerable exceptions) { } + public ExceptionAssertions(System.Collections.Generic.IEnumerable exceptions, FluentAssertions.Execution.AssertionChain assertionChain) { } public TException And { get; } protected override string Identifier { get; } public TException Which { get; } @@ -2276,7 +2256,7 @@ namespace FluentAssertions.Specialized } public class ExecutionTimeAssertions { - public ExecutionTimeAssertions(FluentAssertions.Specialized.ExecutionTime executionTime) { } + public ExecutionTimeAssertions(FluentAssertions.Specialized.ExecutionTime executionTime, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan expectedDuration, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } @@ -2286,8 +2266,8 @@ namespace FluentAssertions.Specialized } public class FunctionAssertions : FluentAssertions.Specialized.DelegateAssertions, FluentAssertions.Specialized.FunctionAssertions> { - public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } + public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } protected override void InvokeSubject() { } public FluentAssertions.AndWhichConstraint, T> NotThrow(string because = "", params object[] becauseArgs) { } @@ -2295,8 +2275,8 @@ namespace FluentAssertions.Specialized } public class GenericAsyncFunctionAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions, FluentAssertions.Specialized.GenericAsyncFunctionAssertions> { - public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } + public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task, TResult>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task, TResult>> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task, TResult>> NotThrowAsync(string because = "", params object[] becauseArgs) { } @@ -2312,16 +2292,16 @@ namespace FluentAssertions.Specialized } public class NonGenericAsyncFunctionAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions { - public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } + public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) { } } public class TaskCompletionSourceAssertions : FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase { - public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs) { } - public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Common.IClock clock) { } + public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Execution.AssertionChain assertionChain) { } + public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } } @@ -2332,8 +2312,8 @@ namespace FluentAssertions.Specialized } public class TaskCompletionSourceAssertions : FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase { - public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs) { } - public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Common.IClock clock) { } + public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Execution.AssertionChain assertionChain) { } + public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task, T>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task>> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } } @@ -2342,25 +2322,25 @@ namespace FluentAssertions.Streams { public class BufferedStreamAssertions : FluentAssertions.Streams.BufferedStreamAssertions { - public BufferedStreamAssertions(System.IO.BufferedStream stream) { } + public BufferedStreamAssertions(System.IO.BufferedStream stream, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class BufferedStreamAssertions : FluentAssertions.Streams.StreamAssertions where TAssertions : FluentAssertions.Streams.BufferedStreamAssertions { - public BufferedStreamAssertions(System.IO.BufferedStream stream) { } + public BufferedStreamAssertions(System.IO.BufferedStream stream, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint HaveBufferSize(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveBufferSize(int unexpected, string because = "", params object[] becauseArgs) { } } public class StreamAssertions : FluentAssertions.Streams.StreamAssertions { - public StreamAssertions(System.IO.Stream stream) { } + public StreamAssertions(System.IO.Stream stream, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class StreamAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TSubject : System.IO.Stream where TAssertions : FluentAssertions.Streams.StreamAssertions { - public StreamAssertions(TSubject stream) { } + public StreamAssertions(TSubject stream, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeReadOnly(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeReadable(string because = "", params object[] becauseArgs) { } @@ -2386,7 +2366,7 @@ namespace FluentAssertions.Types } public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public AssemblyAssertions(System.Reflection.Assembly assembly) { } + public AssemblyAssertions(System.Reflection.Assembly assembly, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } @@ -2396,14 +2376,14 @@ namespace FluentAssertions.Types } public class ConstructorInfoAssertions : FluentAssertions.Types.MethodBaseAssertions { - public ConstructorInfoAssertions(System.Reflection.ConstructorInfo constructorInfo) { } + public ConstructorInfoAssertions(System.Reflection.ConstructorInfo constructorInfo, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } } public abstract class MemberInfoAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TSubject : System.Reflection.MemberInfo where TAssertions : FluentAssertions.Types.MemberInfoAssertions { - protected MemberInfoAssertions(TSubject subject) { } + protected MemberInfoAssertions(TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndWhichConstraint, TAttribute> BeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } @@ -2418,13 +2398,13 @@ namespace FluentAssertions.Types where TSubject : System.Reflection.MethodBase where TAssertions : FluentAssertions.Types.MethodBaseAssertions { - protected MethodBaseAssertions(TSubject subject) { } + protected MethodBaseAssertions(TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint HaveAccessModifier(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveAccessModifier(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } } public class MethodInfoAssertions : FluentAssertions.Types.MethodBaseAssertions { - public MethodInfoAssertions(System.Reflection.MethodInfo methodInfo) { } + public MethodInfoAssertions(System.Reflection.MethodInfo methodInfo, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeAsync(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } @@ -2468,7 +2448,7 @@ namespace FluentAssertions.Types } public class MethodInfoSelectorAssertions { - public MethodInfoSelectorAssertions(params System.Reflection.MethodInfo[] methods) { } + public MethodInfoSelectorAssertions(FluentAssertions.Execution.AssertionChain assertionChain, params System.Reflection.MethodInfo[] methods) { } protected string Context { get; } public System.Collections.Generic.IEnumerable SubjectMethods { get; } public FluentAssertions.AndConstraint Be(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } @@ -2489,7 +2469,7 @@ namespace FluentAssertions.Types } public class PropertyInfoAssertions : FluentAssertions.Types.MemberInfoAssertions { - public PropertyInfoAssertions(System.Reflection.PropertyInfo propertyInfo) { } + public PropertyInfoAssertions(System.Reflection.PropertyInfo propertyInfo, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeReadable(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeReadable(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } @@ -2531,7 +2511,7 @@ namespace FluentAssertions.Types } public class PropertyInfoSelectorAssertions { - public PropertyInfoSelectorAssertions(params System.Reflection.PropertyInfo[] properties) { } + public PropertyInfoSelectorAssertions(FluentAssertions.Execution.AssertionChain assertionChain, params System.Reflection.PropertyInfo[] properties) { } protected string Context { get; } public System.Collections.Generic.IEnumerable SubjectProperties { get; } public FluentAssertions.AndConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) @@ -2546,7 +2526,7 @@ namespace FluentAssertions.Types } public class TypeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public TypeAssertions(System.Type type) { } + public TypeAssertions(System.Type type, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Type expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(string because = "", params object[] becauseArgs) { } @@ -2664,7 +2644,7 @@ namespace FluentAssertions.Types } public class TypeSelectorAssertions { - public TypeSelectorAssertions(params System.Type[] types) { } + public TypeSelectorAssertions(FluentAssertions.Execution.AssertionChain assertionChain, params System.Type[] types) { } public System.Collections.Generic.IEnumerable Subject { get; } public FluentAssertions.AndConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } @@ -2695,7 +2675,7 @@ namespace FluentAssertions.Xml { public class XAttributeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public XAttributeAssertions(System.Xml.Linq.XAttribute attribute) { } + public XAttributeAssertions(System.Xml.Linq.XAttribute attribute, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XAttribute expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) { } @@ -2703,7 +2683,7 @@ namespace FluentAssertions.Xml } public class XDocumentAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public XDocumentAssertions(System.Xml.Linq.XDocument document) { } + public XDocumentAssertions(System.Xml.Linq.XDocument document, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } @@ -2718,7 +2698,7 @@ namespace FluentAssertions.Xml } public class XElementAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public XElementAssertions(System.Xml.Linq.XElement xElement) { } + public XElementAssertions(System.Xml.Linq.XElement xElement, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } @@ -2734,7 +2714,7 @@ namespace FluentAssertions.Xml } public class XmlElementAssertions : FluentAssertions.Xml.XmlNodeAssertions { - public XmlElementAssertions(System.Xml.XmlElement xmlElement) { } + public XmlElementAssertions(System.Xml.XmlElement xmlElement, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveAttributeWithNamespace(string expectedName, string expectedNamespace, string expectedValue, string because = "", params object[] becauseArgs) { } @@ -2744,13 +2724,13 @@ namespace FluentAssertions.Xml } public class XmlNodeAssertions : FluentAssertions.Xml.XmlNodeAssertions { - public XmlNodeAssertions(System.Xml.XmlNode xmlNode) { } + public XmlNodeAssertions(System.Xml.XmlNode xmlNode, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class XmlNodeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TSubject : System.Xml.XmlNode where TAssertions : FluentAssertions.Xml.XmlNodeAssertions { - public XmlNodeAssertions(TSubject xmlNode) { } + public XmlNodeAssertions(TSubject xmlNode, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.XmlNode expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.XmlNode 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 1de3630d79..a487a84ce0 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -15,12 +15,14 @@ namespace FluentAssertions public AndConstraint(TParent parent) { } public TParent And { get; } } - public class AndWhichConstraint : FluentAssertions.AndConstraint + public class AndWhichConstraint : FluentAssertions.AndConstraint { - public AndWhichConstraint(TParentConstraint parentConstraint, System.Collections.Generic.IEnumerable matchedConstraint) { } - public AndWhichConstraint(TParentConstraint parentConstraint, TMatchedElement matchedConstraint) { } - public TMatchedElement Subject { get; } - public TMatchedElement Which { get; } + public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects) { } + public AndWhichConstraint(TParent parent, TSubject subject) { } + public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects, FluentAssertions.Execution.AssertionChain assertionChain, string pathPostfix) { } + public AndWhichConstraint(TParent parent, TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain, string pathPostfix = "") { } + public TSubject Subject { get; } + public TSubject Which { get; } } public static class AssertionExtensions { @@ -368,18 +370,18 @@ namespace FluentAssertions.Collections { public class GenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions, T, FluentAssertions.Collections.GenericCollectionAssertions> { - public GenericCollectionAssertions(System.Collections.Generic.IEnumerable actualValue) { } + public GenericCollectionAssertions(System.Collections.Generic.IEnumerable actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class GenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions> where TCollection : System.Collections.Generic.IEnumerable { - public GenericCollectionAssertions(TCollection actualValue) { } + public GenericCollectionAssertions(TCollection actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class GenericCollectionAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TCollection : System.Collections.Generic.IEnumerable where TAssertions : FluentAssertions.Collections.GenericCollectionAssertions { - public GenericCollectionAssertions(TCollection actualValue) { } + public GenericCollectionAssertions(TCollection actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint AllBeAssignableTo(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> AllBeAssignableTo(string because = "", params object[] becauseArgs) { } @@ -453,7 +455,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint NotBeSubsetOf(System.Collections.Generic.IEnumerable unexpectedSuperset, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContain(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint NotContain(T unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotContain(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainInConsecutiveOrder(params T[] unexpected) { } @@ -484,13 +486,13 @@ namespace FluentAssertions.Collections public class GenericDictionaryAssertions : FluentAssertions.Collections.GenericDictionaryAssertions> where TCollection : System.Collections.Generic.IEnumerable> { - public GenericDictionaryAssertions(TCollection keyValuePairs) { } + public GenericDictionaryAssertions(TCollection keyValuePairs, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class GenericDictionaryAssertions : FluentAssertions.Collections.GenericCollectionAssertions, TAssertions> where TCollection : System.Collections.Generic.IEnumerable> where TAssertions : FluentAssertions.Collections.GenericDictionaryAssertions { - public GenericDictionaryAssertions(TCollection keyValuePairs) { } + public GenericDictionaryAssertions(TCollection keyValuePairs, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } @@ -502,8 +504,8 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint ContainKeys(params TKey[] expected) { } public FluentAssertions.AndConstraint ContainKeys(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint ContainValue(TValue expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainValues(params TValue[] expected) { } - public FluentAssertions.AndConstraint ContainValues(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint> ContainValues(params TValue[] expected) { } + public FluentAssertions.AndWhichConstraint> ContainValues(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Equal(T expected, string because = "", params object[] becauseArgs) where T : System.Collections.Generic.IEnumerable> { } public FluentAssertions.AndConstraint NotContain(params System.Collections.Generic.KeyValuePair[] items) { } @@ -521,18 +523,18 @@ namespace FluentAssertions.Collections } public class StringCollectionAssertions : FluentAssertions.Collections.StringCollectionAssertions> { - public StringCollectionAssertions(System.Collections.Generic.IEnumerable actualValue) { } + public StringCollectionAssertions(System.Collections.Generic.IEnumerable actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class StringCollectionAssertions : FluentAssertions.Collections.StringCollectionAssertions> where TCollection : System.Collections.Generic.IEnumerable { - public StringCollectionAssertions(TCollection actualValue) { } + public StringCollectionAssertions(TCollection actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class StringCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions where TCollection : System.Collections.Generic.IEnumerable where TAssertions : FluentAssertions.Collections.StringCollectionAssertions { - public StringCollectionAssertions(TCollection actualValue) { } + public StringCollectionAssertions(TCollection actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint AllBe(string expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint AllBe(string expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(params string[] expectation) { } @@ -545,18 +547,18 @@ namespace FluentAssertions.Collections } public class SubsequentOrderingAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions, T, FluentAssertions.Collections.SubsequentOrderingAssertions> { - public SubsequentOrderingAssertions(System.Collections.Generic.IEnumerable actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } + public SubsequentOrderingAssertions(System.Collections.Generic.IEnumerable actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions> where TCollection : System.Collections.Generic.IEnumerable { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } + public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions where TCollection : System.Collections.Generic.IEnumerable where TAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } + public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } @@ -697,7 +699,7 @@ namespace FluentAssertions.Equivalency { protected EquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } - protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested); + protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator); } public class EquivalencyValidationContext : FluentAssertions.Equivalency.IEquivalencyValidationContext { @@ -789,7 +791,7 @@ namespace FluentAssertions.Equivalency } public interface IMemberMatchingRule { - FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyOptions options); + FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyOptions options, FluentAssertions.Execution.AssertionChain assertionChain); } public interface IMemberSelectionRule { @@ -951,7 +953,7 @@ namespace FluentAssertions.Equivalency.Steps { public class AssertionRuleEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { - public AssertionRuleEquivalencyStep(System.Linq.Expressions.Expression> predicate, System.Action> assertion) { } + public AssertionRuleEquivalencyStep(System.Linq.Expressions.Expression> predicate, System.Action> assertionAction) { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } @@ -964,7 +966,7 @@ namespace FluentAssertions.Equivalency.Steps public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } public class EnumEqualityStep : FluentAssertions.Equivalency.IEquivalencyStep { @@ -1025,17 +1027,17 @@ namespace FluentAssertions.Equivalency.Steps public class XAttributeEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XAttributeEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } public class XDocumentEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XDocumentEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } public class XElementEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XElementEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } } namespace FluentAssertions.Equivalency.Tracing @@ -1063,76 +1065,62 @@ namespace FluentAssertions.Equivalency.Tracing } namespace FluentAssertions.Execution { + public sealed class AssertionChain + { + public string CallerIdentifier { get; } + public bool HasOverriddenCallerIdentifier { get; } + public bool Succeeded { get; } + public FluentAssertions.Execution.AssertionChain UsingLineBreaks { get; } + public void AddReportable(string key, System.Func getValue) { } + public void AddReportable(string key, string value) { } + public FluentAssertions.Execution.AssertionChain BecauseOf(FluentAssertions.Execution.Reason reason) { } + public FluentAssertions.Execution.AssertionChain BecauseOf(string because, params object[] becauseArgs) { } + public FluentAssertions.Execution.Continuation FailWith(System.Func getFailureReason) { } + public FluentAssertions.Execution.Continuation FailWith(string message) { } + public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } + public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } + public FluentAssertions.Execution.AssertionChain ForCondition(bool condition) { } + public FluentAssertions.Execution.AssertionChain ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } + public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } + public void OverrideCallerIdentifier(System.Func getCallerIdentifier) { } + public void ReuseOnce() { } + public FluentAssertions.Execution.AssertionChain WithCallerPostfix(string postfix) { } + public FluentAssertions.Execution.AssertionChain WithDefaultIdentifier(string identifier) { } + public FluentAssertions.Execution.Continuation WithExpectation(string message, System.Action chain) { } + public FluentAssertions.Execution.Continuation WithExpectation(string message, object arg1, System.Action chain) { } + public FluentAssertions.Execution.Continuation WithExpectation(string message, object arg1, object arg2, System.Action chain) { } + public FluentAssertions.Execution.AssertionChain WithReportable(string name, System.Func content) { } + public static FluentAssertions.Execution.AssertionChain GetOrCreate() { } + } [System.Serializable] public class AssertionFailedException : System.Exception { public AssertionFailedException(string message) { } protected AssertionFailedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } - public sealed class AssertionScope : FluentAssertions.Execution.IAssertionScope, System.IDisposable + public sealed class AssertionScope : System.IDisposable { public AssertionScope() { } public AssertionScope(FluentAssertions.Execution.IAssertionStrategy assertionStrategy) { } - public AssertionScope(System.Lazy context) { } - public AssertionScope(string context) { } - public string CallerIdentity { get; } - public System.Lazy Context { get; set; } + public AssertionScope(System.Func name) { } + public AssertionScope(string name) { } public FluentAssertions.Formatting.FormattingOptions FormattingOptions { get; } - public FluentAssertions.Execution.AssertionScope UsingLineBreaks { get; } + public System.Func Name { get; } public static FluentAssertions.Execution.AssertionScope Current { get; } - public void AddNonReportable(string key, object value) { } public void AddPreFormattedFailure(string formattedFailureMessage) { } - public void AddReportable(string key, System.Func valueFunc) { } - public void AddReportable(string key, string value) { } public void AppendTracing(string tracingBlock) { } - public void AssumeSingleCaller() { } - public FluentAssertions.Execution.AssertionScope BecauseOf(FluentAssertions.Execution.Reason reason) { } - public FluentAssertions.Execution.AssertionScope BecauseOf(string because, params object[] becauseArgs) { } - public FluentAssertions.Execution.Continuation ClearExpectation() { } public string[] Discard() { } public void Dispose() { } - public FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc) { } - public FluentAssertions.Execution.Continuation FailWith(string message) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } - public FluentAssertions.Execution.AssertionScope ForCondition(bool condition) { } - public FluentAssertions.Execution.AssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } - public T Get(string key) { } - public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } public bool HasFailures() { } - public FluentAssertions.Execution.AssertionScope WithDefaultIdentifier(string identifier) { } - public FluentAssertions.Execution.AssertionScope WithExpectation(string message, params object[] args) { } } public class Continuation { - public FluentAssertions.Execution.IAssertionScope Then { get; } - public static bool op_Implicit(FluentAssertions.Execution.Continuation continuation) { } + public FluentAssertions.Execution.AssertionChain Then { get; } } public class ContinuationOfGiven { + public bool Succeeded { get; } public FluentAssertions.Execution.GivenSelector Then { get; } - public static bool op_Implicit(FluentAssertions.Execution.ContinuationOfGiven continuationOfGiven) { } - } - public sealed class ContinuedAssertionScope : FluentAssertions.Execution.IAssertionScope, System.IDisposable - { - public FluentAssertions.Execution.IAssertionScope UsingLineBreaks { get; } - public FluentAssertions.Execution.IAssertionScope BecauseOf(string because, params object[] becauseArgs) { } - public FluentAssertions.Execution.Continuation ClearExpectation() { } - public string[] Discard() { } - public void Dispose() { } - public FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc) { } - public FluentAssertions.Execution.Continuation FailWith(string message) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } - public FluentAssertions.Execution.IAssertionScope ForCondition(bool condition) { } - public FluentAssertions.Execution.IAssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } - public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } - public FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier) { } - public FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args) { } - } - public static class Execute - { - public static FluentAssertions.Execution.AssertionScope Assertion { get; } } public class FailReason { @@ -1142,29 +1130,13 @@ namespace FluentAssertions.Execution } public class GivenSelector { - public FluentAssertions.Execution.ContinuationOfGiven ClearExpectation() { } + public bool Succeeded { get; } public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message) { } public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message, params System.Func[] args) { } public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message, params object[] args) { } public FluentAssertions.Execution.GivenSelector ForCondition(System.Func predicate) { } public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } } - public interface IAssertionScope : System.IDisposable - { - FluentAssertions.Execution.IAssertionScope UsingLineBreaks { get; } - FluentAssertions.Execution.IAssertionScope BecauseOf(string because, params object[] becauseArgs); - FluentAssertions.Execution.Continuation ClearExpectation(); - string[] Discard(); - FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc); - FluentAssertions.Execution.Continuation FailWith(string message); - FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders); - FluentAssertions.Execution.Continuation FailWith(string message, params object[] args); - FluentAssertions.Execution.IAssertionScope ForCondition(bool condition); - FluentAssertions.Execution.IAssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences); - FluentAssertions.Execution.GivenSelector Given(System.Func selector); - FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier); - FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args); - } public interface IAssertionStrategy { System.Collections.Generic.IEnumerable FailureMessages { get; } @@ -1407,6 +1379,12 @@ namespace FluentAssertions.Formatting public MaxLinesExceededException(string message) { } public MaxLinesExceededException(string message, System.Exception innerException) { } } + public class MethodInfoFormatter : FluentAssertions.Formatting.IValueFormatter + { + public MethodInfoFormatter() { } + public bool CanHandle(object value) { } + public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } + } public class MultidimensionalArrayFormatter : FluentAssertions.Formatting.IValueFormatter { public MultidimensionalArrayFormatter() { } @@ -1513,12 +1491,12 @@ namespace FluentAssertions.Numeric { public class ComparableTypeAssertions : FluentAssertions.Numeric.ComparableTypeAssertions> { - public ComparableTypeAssertions(System.IComparable value) { } + public ComparableTypeAssertions(System.IComparable value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class ComparableTypeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions, TAssertions> where TAssertions : FluentAssertions.Numeric.ComparableTypeAssertions { - public ComparableTypeAssertions(System.IComparable value) { } + public ComparableTypeAssertions(System.IComparable value, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } @@ -1538,13 +1516,13 @@ namespace FluentAssertions.Numeric public class NullableNumericAssertions : FluentAssertions.Numeric.NullableNumericAssertions> where T : struct, System.IComparable { - public NullableNumericAssertions(T? value) { } + public NullableNumericAssertions(T? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableNumericAssertions : FluentAssertions.Numeric.NumericAssertions where T : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NullableNumericAssertions { - public NullableNumericAssertions(T? value) { } + public NullableNumericAssertions(T? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } @@ -1554,13 +1532,14 @@ namespace FluentAssertions.Numeric public class NumericAssertions : FluentAssertions.Numeric.NumericAssertions> where T : struct, System.IComparable { - public NumericAssertions(T value) { } + public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NumericAssertions where T : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NumericAssertions { - public NumericAssertions(T value) { } + public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } + public FluentAssertions.Execution.AssertionChain CurrentAssertionChain { get; } public T? Subject { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) { } @@ -1586,12 +1565,12 @@ namespace FluentAssertions.Primitives { public class BooleanAssertions : FluentAssertions.Primitives.BooleanAssertions { - public BooleanAssertions(bool? value) { } + public BooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class BooleanAssertions where TAssertions : FluentAssertions.Primitives.BooleanAssertions { - public BooleanAssertions(bool? value) { } + public BooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public bool? Subject { get; } public FluentAssertions.AndConstraint Be(bool expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeFalse(string because = "", params object[] becauseArgs) { } @@ -1602,12 +1581,12 @@ namespace FluentAssertions.Primitives } public class DateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions { - public DateTimeAssertions(System.DateTime? value) { } + public DateTimeAssertions(System.DateTime? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class DateTimeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { - public DateTimeAssertions(System.DateTime? value) { } + public DateTimeAssertions(System.DateTime? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.DateTime? Subject { get; } public FluentAssertions.AndConstraint Be(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(System.DateTime? expected, string because = "", params object[] becauseArgs) { } @@ -1652,12 +1631,12 @@ namespace FluentAssertions.Primitives } public class DateTimeOffsetAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { - public DateTimeOffsetAssertions(System.DateTimeOffset? value) { } + public DateTimeOffsetAssertions(System.DateTimeOffset? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class DateTimeOffsetAssertions where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { - public DateTimeOffsetAssertions(System.DateTimeOffset? value) { } + public DateTimeOffsetAssertions(System.DateTimeOffset? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.DateTimeOffset? Subject { get; } public FluentAssertions.AndConstraint Be(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(System.DateTimeOffset? expected, string because = "", params object[] becauseArgs) { } @@ -1707,7 +1686,7 @@ namespace FluentAssertions.Primitives public class DateTimeOffsetRangeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { - protected DateTimeOffsetRangeAssertions(TAssertions parentAssertions, System.DateTimeOffset? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } + protected DateTimeOffsetRangeAssertions(TAssertions parentAssertions, FluentAssertions.Execution.AssertionChain assertionChain, System.DateTimeOffset? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } @@ -1715,7 +1694,7 @@ namespace FluentAssertions.Primitives public class DateTimeRangeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { - protected DateTimeRangeAssertions(TAssertions parentAssertions, System.DateTime? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } + protected DateTimeRangeAssertions(TAssertions parentAssertions, FluentAssertions.Execution.AssertionChain assertionChain, System.DateTime? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTime target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTime target, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } @@ -1723,13 +1702,13 @@ namespace FluentAssertions.Primitives public class EnumAssertions : FluentAssertions.Primitives.EnumAssertions> where TEnum : struct, System.Enum { - public EnumAssertions(TEnum subject) { } + public EnumAssertions(TEnum subject, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class EnumAssertions where TEnum : struct, System.Enum where TAssertions : FluentAssertions.Primitives.EnumAssertions { - public EnumAssertions(TEnum subject) { } + public EnumAssertions(TEnum subject, FluentAssertions.Execution.AssertionChain assertionChain) { } public TEnum? Subject { get; } public FluentAssertions.AndConstraint Be(TEnum expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(TEnum? expected, string because = "", params object[] becauseArgs) { } @@ -1756,12 +1735,12 @@ namespace FluentAssertions.Primitives } public class GuidAssertions : FluentAssertions.Primitives.GuidAssertions { - public GuidAssertions(System.Guid? value) { } + public GuidAssertions(System.Guid? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class GuidAssertions where TAssertions : FluentAssertions.Primitives.GuidAssertions { - public GuidAssertions(System.Guid? value) { } + public GuidAssertions(System.Guid? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.Guid? Subject { get; } public FluentAssertions.AndConstraint Be(System.Guid expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } @@ -1773,12 +1752,12 @@ namespace FluentAssertions.Primitives } public class HttpResponseMessageAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions { - public HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value) { } + public HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class HttpResponseMessageAssertions : FluentAssertions.Primitives.ObjectAssertions where TAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions { - protected HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value) { } + protected HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeRedirection(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSuccessful(string because = "", params object[] becauseArgs) { } @@ -1790,12 +1769,12 @@ namespace FluentAssertions.Primitives } public class NullableBooleanAssertions : FluentAssertions.Primitives.NullableBooleanAssertions { - public NullableBooleanAssertions(bool? value) { } + public NullableBooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableBooleanAssertions : FluentAssertions.Primitives.BooleanAssertions where TAssertions : FluentAssertions.Primitives.NullableBooleanAssertions { - public NullableBooleanAssertions(bool? value) { } + public NullableBooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint Be(bool? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } @@ -1807,12 +1786,12 @@ namespace FluentAssertions.Primitives } public class NullableDateTimeAssertions : FluentAssertions.Primitives.NullableDateTimeAssertions { - public NullableDateTimeAssertions(System.DateTime? expected) { } + public NullableDateTimeAssertions(System.DateTime? expected, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableDateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions where TAssertions : FluentAssertions.Primitives.NullableDateTimeAssertions { - public NullableDateTimeAssertions(System.DateTime? expected) { } + public NullableDateTimeAssertions(System.DateTime? expected, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } @@ -1820,12 +1799,12 @@ namespace FluentAssertions.Primitives } public class NullableDateTimeOffsetAssertions : FluentAssertions.Primitives.NullableDateTimeOffsetAssertions { - public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected) { } + public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableDateTimeOffsetAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions where TAssertions : FluentAssertions.Primitives.NullableDateTimeOffsetAssertions { - public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected) { } + public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } @@ -1834,13 +1813,13 @@ namespace FluentAssertions.Primitives public class NullableEnumAssertions : FluentAssertions.Primitives.NullableEnumAssertions> where TEnum : struct, System.Enum { - public NullableEnumAssertions(TEnum? subject) { } + public NullableEnumAssertions(TEnum? subject, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableEnumAssertions : FluentAssertions.Primitives.EnumAssertions where TEnum : struct, System.Enum where TAssertions : FluentAssertions.Primitives.NullableEnumAssertions { - public NullableEnumAssertions(TEnum? subject) { } + public NullableEnumAssertions(TEnum? subject, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint NotBeNull(string because = "", params object[] becauseArgs) { } @@ -1848,12 +1827,12 @@ namespace FluentAssertions.Primitives } public class NullableGuidAssertions : FluentAssertions.Primitives.NullableGuidAssertions { - public NullableGuidAssertions(System.Guid? value) { } + public NullableGuidAssertions(System.Guid? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableGuidAssertions : FluentAssertions.Primitives.GuidAssertions where TAssertions : FluentAssertions.Primitives.NullableGuidAssertions { - public NullableGuidAssertions(System.Guid? value) { } + public NullableGuidAssertions(System.Guid? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint Be(System.Guid? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } @@ -1862,12 +1841,12 @@ namespace FluentAssertions.Primitives } public class NullableSimpleTimeSpanAssertions : FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions { - public NullableSimpleTimeSpanAssertions(System.TimeSpan? value) { } + public NullableSimpleTimeSpanAssertions(System.TimeSpan? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableSimpleTimeSpanAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions where TAssertions : FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions { - public NullableSimpleTimeSpanAssertions(System.TimeSpan? value) { } + public NullableSimpleTimeSpanAssertions(System.TimeSpan? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint Be(System.TimeSpan? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } @@ -1876,7 +1855,7 @@ namespace FluentAssertions.Primitives } public class ObjectAssertions : FluentAssertions.Primitives.ObjectAssertions { - public ObjectAssertions(object value) { } + public ObjectAssertions(object value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint Be(TExpectation expected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(TExpectation unexpected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } @@ -1884,7 +1863,7 @@ namespace FluentAssertions.Primitives public class ObjectAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TAssertions : FluentAssertions.Primitives.ObjectAssertions { - public ObjectAssertions(TSubject value) { } + public ObjectAssertions(TSubject value, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(TSubject expected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } @@ -1902,7 +1881,8 @@ namespace FluentAssertions.Primitives public abstract class ReferenceTypeAssertions where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - protected ReferenceTypeAssertions(TSubject subject) { } + protected ReferenceTypeAssertions(TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain) { } + public FluentAssertions.Execution.AssertionChain CurrentAssertionChain { get; } protected abstract string Identifier { get; } public TSubject Subject { get; } public FluentAssertions.AndConstraint BeAssignableTo(System.Type type, string because = "", params object[] becauseArgs) { } @@ -1926,12 +1906,12 @@ namespace FluentAssertions.Primitives } public class SimpleTimeSpanAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { - public SimpleTimeSpanAssertions(System.TimeSpan? value) { } + public SimpleTimeSpanAssertions(System.TimeSpan? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class SimpleTimeSpanAssertions where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { - public SimpleTimeSpanAssertions(System.TimeSpan? value) { } + public SimpleTimeSpanAssertions(System.TimeSpan? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.TimeSpan? Subject { get; } public FluentAssertions.AndConstraint Be(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } @@ -1947,12 +1927,12 @@ namespace FluentAssertions.Primitives } public class StringAssertions : FluentAssertions.Primitives.StringAssertions { - public StringAssertions(string value) { } + public StringAssertions(string value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class StringAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TAssertions : FluentAssertions.Primitives.StringAssertions { - public StringAssertions(string value) { } + public StringAssertions(string value, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } @@ -2028,8 +2008,8 @@ namespace FluentAssertions.Specialized { public class ActionAssertions : FluentAssertions.Specialized.DelegateAssertions { - public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } + public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } protected override void InvokeSubject() { } public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } @@ -2039,7 +2019,7 @@ namespace FluentAssertions.Specialized where TTask : System.Threading.Tasks.Task where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions { - protected AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + protected AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } public System.Threading.Tasks.Task> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) @@ -2065,7 +2045,7 @@ namespace FluentAssertions.Specialized where TDelegate : System.Delegate where TAssertions : FluentAssertions.Specialized.DelegateAssertions { - protected DelegateAssertions(TDelegate @delegate, FluentAssertions.Specialized.IExtractExceptions extractor) { } + protected DelegateAssertions(TDelegate @delegate, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } protected abstract void InvokeSubject(); public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) where TException : System.Exception { } @@ -2077,7 +2057,7 @@ namespace FluentAssertions.Specialized public class ExceptionAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions, FluentAssertions.Specialized.ExceptionAssertions> where TException : System.Exception { - public ExceptionAssertions(System.Collections.Generic.IEnumerable exceptions) { } + public ExceptionAssertions(System.Collections.Generic.IEnumerable exceptions, FluentAssertions.Execution.AssertionChain assertionChain) { } public TException And { get; } protected override string Identifier { get; } public TException Which { get; } @@ -2099,7 +2079,7 @@ namespace FluentAssertions.Specialized } public class ExecutionTimeAssertions { - public ExecutionTimeAssertions(FluentAssertions.Specialized.ExecutionTime executionTime) { } + public ExecutionTimeAssertions(FluentAssertions.Specialized.ExecutionTime executionTime, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan expectedDuration, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } @@ -2109,8 +2089,8 @@ namespace FluentAssertions.Specialized } public class FunctionAssertions : FluentAssertions.Specialized.DelegateAssertions, FluentAssertions.Specialized.FunctionAssertions> { - public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } + public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } protected override void InvokeSubject() { } public FluentAssertions.AndWhichConstraint, T> NotThrow(string because = "", params object[] becauseArgs) { } @@ -2118,8 +2098,8 @@ namespace FluentAssertions.Specialized } public class GenericAsyncFunctionAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions, FluentAssertions.Specialized.GenericAsyncFunctionAssertions> { - public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } + public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task, TResult>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task, TResult>> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task, TResult>> NotThrowAsync(string because = "", params object[] becauseArgs) { } @@ -2135,8 +2115,8 @@ namespace FluentAssertions.Specialized } public class NonGenericAsyncFunctionAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions { - public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } + public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) { } @@ -2148,8 +2128,8 @@ namespace FluentAssertions.Specialized } public class TaskCompletionSourceAssertions : FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase { - public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs) { } - public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Common.IClock clock) { } + public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Execution.AssertionChain assertionChain) { } + public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task, T>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task>> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } } @@ -2158,23 +2138,23 @@ namespace FluentAssertions.Streams { public class BufferedStreamAssertions : FluentAssertions.Streams.BufferedStreamAssertions { - public BufferedStreamAssertions(System.IO.BufferedStream stream) { } + public BufferedStreamAssertions(System.IO.BufferedStream stream, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class BufferedStreamAssertions : FluentAssertions.Streams.StreamAssertions where TAssertions : FluentAssertions.Streams.BufferedStreamAssertions { - public BufferedStreamAssertions(System.IO.BufferedStream stream) { } + public BufferedStreamAssertions(System.IO.BufferedStream stream, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } } public class StreamAssertions : FluentAssertions.Streams.StreamAssertions { - public StreamAssertions(System.IO.Stream stream) { } + public StreamAssertions(System.IO.Stream stream, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class StreamAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TSubject : System.IO.Stream where TAssertions : FluentAssertions.Streams.StreamAssertions { - public StreamAssertions(TSubject stream) { } + public StreamAssertions(TSubject stream, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeReadOnly(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeReadable(string because = "", params object[] becauseArgs) { } @@ -2200,7 +2180,7 @@ namespace FluentAssertions.Types } public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public AssemblyAssertions(System.Reflection.Assembly assembly) { } + public AssemblyAssertions(System.Reflection.Assembly assembly, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } @@ -2210,14 +2190,14 @@ namespace FluentAssertions.Types } public class ConstructorInfoAssertions : FluentAssertions.Types.MethodBaseAssertions { - public ConstructorInfoAssertions(System.Reflection.ConstructorInfo constructorInfo) { } + public ConstructorInfoAssertions(System.Reflection.ConstructorInfo constructorInfo, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } } public abstract class MemberInfoAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TSubject : System.Reflection.MemberInfo where TAssertions : FluentAssertions.Types.MemberInfoAssertions { - protected MemberInfoAssertions(TSubject subject) { } + protected MemberInfoAssertions(TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndWhichConstraint, TAttribute> BeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } @@ -2232,13 +2212,13 @@ namespace FluentAssertions.Types where TSubject : System.Reflection.MethodBase where TAssertions : FluentAssertions.Types.MethodBaseAssertions { - protected MethodBaseAssertions(TSubject subject) { } + protected MethodBaseAssertions(TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint HaveAccessModifier(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveAccessModifier(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } } public class MethodInfoAssertions : FluentAssertions.Types.MethodBaseAssertions { - public MethodInfoAssertions(System.Reflection.MethodInfo methodInfo) { } + public MethodInfoAssertions(System.Reflection.MethodInfo methodInfo, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeAsync(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } @@ -2282,7 +2262,7 @@ namespace FluentAssertions.Types } public class MethodInfoSelectorAssertions { - public MethodInfoSelectorAssertions(params System.Reflection.MethodInfo[] methods) { } + public MethodInfoSelectorAssertions(FluentAssertions.Execution.AssertionChain assertionChain, params System.Reflection.MethodInfo[] methods) { } protected string Context { get; } public System.Collections.Generic.IEnumerable SubjectMethods { get; } public FluentAssertions.AndConstraint Be(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } @@ -2303,7 +2283,7 @@ namespace FluentAssertions.Types } public class PropertyInfoAssertions : FluentAssertions.Types.MemberInfoAssertions { - public PropertyInfoAssertions(System.Reflection.PropertyInfo propertyInfo) { } + public PropertyInfoAssertions(System.Reflection.PropertyInfo propertyInfo, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeReadable(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeReadable(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } @@ -2345,7 +2325,7 @@ namespace FluentAssertions.Types } public class PropertyInfoSelectorAssertions { - public PropertyInfoSelectorAssertions(params System.Reflection.PropertyInfo[] properties) { } + public PropertyInfoSelectorAssertions(FluentAssertions.Execution.AssertionChain assertionChain, params System.Reflection.PropertyInfo[] properties) { } protected string Context { get; } public System.Collections.Generic.IEnumerable SubjectProperties { get; } public FluentAssertions.AndConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) @@ -2360,7 +2340,7 @@ namespace FluentAssertions.Types } public class TypeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public TypeAssertions(System.Type type) { } + public TypeAssertions(System.Type type, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Type expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(string because = "", params object[] becauseArgs) { } @@ -2478,7 +2458,7 @@ namespace FluentAssertions.Types } public class TypeSelectorAssertions { - public TypeSelectorAssertions(params System.Type[] types) { } + public TypeSelectorAssertions(FluentAssertions.Execution.AssertionChain assertionChain, params System.Type[] types) { } public System.Collections.Generic.IEnumerable Subject { get; } public FluentAssertions.AndConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } @@ -2509,7 +2489,7 @@ namespace FluentAssertions.Xml { public class XAttributeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public XAttributeAssertions(System.Xml.Linq.XAttribute attribute) { } + public XAttributeAssertions(System.Xml.Linq.XAttribute attribute, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XAttribute expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) { } @@ -2517,7 +2497,7 @@ namespace FluentAssertions.Xml } public class XDocumentAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public XDocumentAssertions(System.Xml.Linq.XDocument document) { } + public XDocumentAssertions(System.Xml.Linq.XDocument document, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } @@ -2532,7 +2512,7 @@ namespace FluentAssertions.Xml } public class XElementAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public XElementAssertions(System.Xml.Linq.XElement xElement) { } + public XElementAssertions(System.Xml.Linq.XElement xElement, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } @@ -2548,7 +2528,7 @@ namespace FluentAssertions.Xml } public class XmlElementAssertions : FluentAssertions.Xml.XmlNodeAssertions { - public XmlElementAssertions(System.Xml.XmlElement xmlElement) { } + public XmlElementAssertions(System.Xml.XmlElement xmlElement, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveAttributeWithNamespace(string expectedName, string expectedNamespace, string expectedValue, string because = "", params object[] becauseArgs) { } @@ -2558,13 +2538,13 @@ namespace FluentAssertions.Xml } public class XmlNodeAssertions : FluentAssertions.Xml.XmlNodeAssertions { - public XmlNodeAssertions(System.Xml.XmlNode xmlNode) { } + public XmlNodeAssertions(System.Xml.XmlNode xmlNode, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class XmlNodeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TSubject : System.Xml.XmlNode where TAssertions : FluentAssertions.Xml.XmlNodeAssertions { - public XmlNodeAssertions(TSubject xmlNode) { } + public XmlNodeAssertions(TSubject xmlNode, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.XmlNode expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.XmlNode 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 24ab2600ca..dcbbff6216 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -15,12 +15,14 @@ namespace FluentAssertions public AndConstraint(TParent parent) { } public TParent And { get; } } - public class AndWhichConstraint : FluentAssertions.AndConstraint + public class AndWhichConstraint : FluentAssertions.AndConstraint { - public AndWhichConstraint(TParentConstraint parentConstraint, System.Collections.Generic.IEnumerable matchedConstraint) { } - public AndWhichConstraint(TParentConstraint parentConstraint, TMatchedElement matchedConstraint) { } - public TMatchedElement Subject { get; } - public TMatchedElement Which { get; } + public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects) { } + public AndWhichConstraint(TParent parent, TSubject subject) { } + public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects, FluentAssertions.Execution.AssertionChain assertionChain, string pathPostfix) { } + public AndWhichConstraint(TParent parent, TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain, string pathPostfix = "") { } + public TSubject Subject { get; } + public TSubject Which { get; } } public static class AssertionExtensions { @@ -376,18 +378,18 @@ namespace FluentAssertions.Collections { public class GenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions, T, FluentAssertions.Collections.GenericCollectionAssertions> { - public GenericCollectionAssertions(System.Collections.Generic.IEnumerable actualValue) { } + public GenericCollectionAssertions(System.Collections.Generic.IEnumerable actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class GenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions> where TCollection : System.Collections.Generic.IEnumerable { - public GenericCollectionAssertions(TCollection actualValue) { } + public GenericCollectionAssertions(TCollection actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class GenericCollectionAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TCollection : System.Collections.Generic.IEnumerable where TAssertions : FluentAssertions.Collections.GenericCollectionAssertions { - public GenericCollectionAssertions(TCollection actualValue) { } + public GenericCollectionAssertions(TCollection actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint AllBeAssignableTo(System.Type expectedType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> AllBeAssignableTo(string because = "", params object[] becauseArgs) { } @@ -461,7 +463,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint NotBeSubsetOf(System.Collections.Generic.IEnumerable unexpectedSuperset, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContain(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContain(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint NotContain(T unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotContain(T unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainEquivalentOf(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotContainInConsecutiveOrder(params T[] unexpected) { } @@ -492,13 +494,13 @@ namespace FluentAssertions.Collections public class GenericDictionaryAssertions : FluentAssertions.Collections.GenericDictionaryAssertions> where TCollection : System.Collections.Generic.IEnumerable> { - public GenericDictionaryAssertions(TCollection keyValuePairs) { } + public GenericDictionaryAssertions(TCollection keyValuePairs, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class GenericDictionaryAssertions : FluentAssertions.Collections.GenericCollectionAssertions, TAssertions> where TCollection : System.Collections.Generic.IEnumerable> where TAssertions : FluentAssertions.Collections.GenericDictionaryAssertions { - public GenericDictionaryAssertions(TCollection keyValuePairs) { } + public GenericDictionaryAssertions(TCollection keyValuePairs, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } @@ -510,8 +512,8 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint ContainKeys(params TKey[] expected) { } public FluentAssertions.AndConstraint ContainKeys(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint ContainValue(TValue expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint ContainValues(params TValue[] expected) { } - public FluentAssertions.AndConstraint ContainValues(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint> ContainValues(params TValue[] expected) { } + public FluentAssertions.AndWhichConstraint> ContainValues(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Equal(T expected, string because = "", params object[] becauseArgs) where T : System.Collections.Generic.IEnumerable> { } public FluentAssertions.AndConstraint NotContain(params System.Collections.Generic.KeyValuePair[] items) { } @@ -529,18 +531,18 @@ namespace FluentAssertions.Collections } public class StringCollectionAssertions : FluentAssertions.Collections.StringCollectionAssertions> { - public StringCollectionAssertions(System.Collections.Generic.IEnumerable actualValue) { } + public StringCollectionAssertions(System.Collections.Generic.IEnumerable actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class StringCollectionAssertions : FluentAssertions.Collections.StringCollectionAssertions> where TCollection : System.Collections.Generic.IEnumerable { - public StringCollectionAssertions(TCollection actualValue) { } + public StringCollectionAssertions(TCollection actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class StringCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions where TCollection : System.Collections.Generic.IEnumerable where TAssertions : FluentAssertions.Collections.StringCollectionAssertions { - public StringCollectionAssertions(TCollection actualValue) { } + public StringCollectionAssertions(TCollection actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint AllBe(string expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint AllBe(string expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(params string[] expectation) { } @@ -553,18 +555,18 @@ namespace FluentAssertions.Collections } public class SubsequentOrderingAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions, T, FluentAssertions.Collections.SubsequentOrderingAssertions> { - public SubsequentOrderingAssertions(System.Collections.Generic.IEnumerable actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } + public SubsequentOrderingAssertions(System.Collections.Generic.IEnumerable actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions> where TCollection : System.Collections.Generic.IEnumerable { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } + public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions where TCollection : System.Collections.Generic.IEnumerable where TAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable) { } + public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } @@ -705,7 +707,7 @@ namespace FluentAssertions.Equivalency { protected EquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } - protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested); + protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator); } public class EquivalencyValidationContext : FluentAssertions.Equivalency.IEquivalencyValidationContext { @@ -797,7 +799,7 @@ namespace FluentAssertions.Equivalency } public interface IMemberMatchingRule { - FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyOptions options); + FluentAssertions.Equivalency.IMember Match(FluentAssertions.Equivalency.IMember expectedMember, object subject, FluentAssertions.Equivalency.INode parent, FluentAssertions.Equivalency.IEquivalencyOptions options, FluentAssertions.Execution.AssertionChain assertionChain); } public interface IMemberSelectionRule { @@ -959,7 +961,7 @@ namespace FluentAssertions.Equivalency.Steps { public class AssertionRuleEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { - public AssertionRuleEquivalencyStep(System.Linq.Expressions.Expression> predicate, System.Action> assertion) { } + public AssertionRuleEquivalencyStep(System.Linq.Expressions.Expression> predicate, System.Action> assertionAction) { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } @@ -972,7 +974,7 @@ namespace FluentAssertions.Equivalency.Steps public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } public class EnumEqualityStep : FluentAssertions.Equivalency.IEquivalencyStep { @@ -1033,17 +1035,17 @@ namespace FluentAssertions.Equivalency.Steps public class XAttributeEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XAttributeEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } public class XDocumentEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XDocumentEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } public class XElementEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XElementEquivalencyStep() { } - protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nested) { } + protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } } namespace FluentAssertions.Equivalency.Tracing @@ -1073,7 +1075,7 @@ namespace FluentAssertions.Events { public class EventAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> { - protected EventAssertions(FluentAssertions.Events.IMonitor monitor) { } + protected EventAssertions(FluentAssertions.Events.IMonitor monitor, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.Events.IMonitor Monitor { get; } public void NotRaise(string eventName, string because = "", params object[] becauseArgs) { } @@ -1119,76 +1121,62 @@ namespace FluentAssertions.Events } namespace FluentAssertions.Execution { + public sealed class AssertionChain + { + public string CallerIdentifier { get; } + public bool HasOverriddenCallerIdentifier { get; } + public bool Succeeded { get; } + public FluentAssertions.Execution.AssertionChain UsingLineBreaks { get; } + public void AddReportable(string key, System.Func getValue) { } + public void AddReportable(string key, string value) { } + public FluentAssertions.Execution.AssertionChain BecauseOf(FluentAssertions.Execution.Reason reason) { } + public FluentAssertions.Execution.AssertionChain BecauseOf(string because, params object[] becauseArgs) { } + public FluentAssertions.Execution.Continuation FailWith(System.Func getFailureReason) { } + public FluentAssertions.Execution.Continuation FailWith(string message) { } + public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } + public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } + public FluentAssertions.Execution.AssertionChain ForCondition(bool condition) { } + public FluentAssertions.Execution.AssertionChain ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } + public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } + public void OverrideCallerIdentifier(System.Func getCallerIdentifier) { } + public void ReuseOnce() { } + public FluentAssertions.Execution.AssertionChain WithCallerPostfix(string postfix) { } + public FluentAssertions.Execution.AssertionChain WithDefaultIdentifier(string identifier) { } + public FluentAssertions.Execution.Continuation WithExpectation(string message, System.Action chain) { } + public FluentAssertions.Execution.Continuation WithExpectation(string message, object arg1, System.Action chain) { } + public FluentAssertions.Execution.Continuation WithExpectation(string message, object arg1, object arg2, System.Action chain) { } + public FluentAssertions.Execution.AssertionChain WithReportable(string name, System.Func content) { } + public static FluentAssertions.Execution.AssertionChain GetOrCreate() { } + } [System.Serializable] public class AssertionFailedException : System.Exception { public AssertionFailedException(string message) { } protected AssertionFailedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } - public sealed class AssertionScope : FluentAssertions.Execution.IAssertionScope, System.IDisposable + public sealed class AssertionScope : System.IDisposable { public AssertionScope() { } public AssertionScope(FluentAssertions.Execution.IAssertionStrategy assertionStrategy) { } - public AssertionScope(System.Lazy context) { } - public AssertionScope(string context) { } - public string CallerIdentity { get; } - public System.Lazy Context { get; set; } + public AssertionScope(System.Func name) { } + public AssertionScope(string name) { } public FluentAssertions.Formatting.FormattingOptions FormattingOptions { get; } - public FluentAssertions.Execution.AssertionScope UsingLineBreaks { get; } + public System.Func Name { get; } public static FluentAssertions.Execution.AssertionScope Current { get; } - public void AddNonReportable(string key, object value) { } public void AddPreFormattedFailure(string formattedFailureMessage) { } - public void AddReportable(string key, System.Func valueFunc) { } - public void AddReportable(string key, string value) { } public void AppendTracing(string tracingBlock) { } - public void AssumeSingleCaller() { } - public FluentAssertions.Execution.AssertionScope BecauseOf(FluentAssertions.Execution.Reason reason) { } - public FluentAssertions.Execution.AssertionScope BecauseOf(string because, params object[] becauseArgs) { } - public FluentAssertions.Execution.Continuation ClearExpectation() { } public string[] Discard() { } public void Dispose() { } - public FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc) { } - public FluentAssertions.Execution.Continuation FailWith(string message) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } - public FluentAssertions.Execution.AssertionScope ForCondition(bool condition) { } - public FluentAssertions.Execution.AssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } - public T Get(string key) { } - public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } public bool HasFailures() { } - public FluentAssertions.Execution.AssertionScope WithDefaultIdentifier(string identifier) { } - public FluentAssertions.Execution.AssertionScope WithExpectation(string message, params object[] args) { } } public class Continuation { - public FluentAssertions.Execution.IAssertionScope Then { get; } - public static bool op_Implicit(FluentAssertions.Execution.Continuation continuation) { } + public FluentAssertions.Execution.AssertionChain Then { get; } } public class ContinuationOfGiven { + public bool Succeeded { get; } public FluentAssertions.Execution.GivenSelector Then { get; } - public static bool op_Implicit(FluentAssertions.Execution.ContinuationOfGiven continuationOfGiven) { } - } - public sealed class ContinuedAssertionScope : FluentAssertions.Execution.IAssertionScope, System.IDisposable - { - public FluentAssertions.Execution.IAssertionScope UsingLineBreaks { get; } - public FluentAssertions.Execution.IAssertionScope BecauseOf(string because, params object[] becauseArgs) { } - public FluentAssertions.Execution.Continuation ClearExpectation() { } - public string[] Discard() { } - public void Dispose() { } - public FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc) { } - public FluentAssertions.Execution.Continuation FailWith(string message) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders) { } - public FluentAssertions.Execution.Continuation FailWith(string message, params object[] args) { } - public FluentAssertions.Execution.IAssertionScope ForCondition(bool condition) { } - public FluentAssertions.Execution.IAssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } - public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } - public FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier) { } - public FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args) { } - } - public static class Execute - { - public static FluentAssertions.Execution.AssertionScope Assertion { get; } } public class FailReason { @@ -1198,29 +1186,13 @@ namespace FluentAssertions.Execution } public class GivenSelector { - public FluentAssertions.Execution.ContinuationOfGiven ClearExpectation() { } + public bool Succeeded { get; } public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message) { } public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message, params System.Func[] args) { } public FluentAssertions.Execution.ContinuationOfGiven FailWith(string message, params object[] args) { } public FluentAssertions.Execution.GivenSelector ForCondition(System.Func predicate) { } public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } } - public interface IAssertionScope : System.IDisposable - { - FluentAssertions.Execution.IAssertionScope UsingLineBreaks { get; } - FluentAssertions.Execution.IAssertionScope BecauseOf(string because, params object[] becauseArgs); - FluentAssertions.Execution.Continuation ClearExpectation(); - string[] Discard(); - FluentAssertions.Execution.Continuation FailWith(System.Func failReasonFunc); - FluentAssertions.Execution.Continuation FailWith(string message); - FluentAssertions.Execution.Continuation FailWith(string message, params System.Func[] argProviders); - FluentAssertions.Execution.Continuation FailWith(string message, params object[] args); - FluentAssertions.Execution.IAssertionScope ForCondition(bool condition); - FluentAssertions.Execution.IAssertionScope ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences); - FluentAssertions.Execution.GivenSelector Given(System.Func selector); - FluentAssertions.Execution.IAssertionScope WithDefaultIdentifier(string identifier); - FluentAssertions.Execution.IAssertionScope WithExpectation(string message, params object[] args); - } public interface IAssertionStrategy { System.Collections.Generic.IEnumerable FailureMessages { get; } @@ -1463,6 +1435,12 @@ namespace FluentAssertions.Formatting public MaxLinesExceededException(string message) { } public MaxLinesExceededException(string message, System.Exception innerException) { } } + public class MethodInfoFormatter : FluentAssertions.Formatting.IValueFormatter + { + public MethodInfoFormatter() { } + public bool CanHandle(object value) { } + public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } + } public class MultidimensionalArrayFormatter : FluentAssertions.Formatting.IValueFormatter { public MultidimensionalArrayFormatter() { } @@ -1569,12 +1547,12 @@ namespace FluentAssertions.Numeric { public class ComparableTypeAssertions : FluentAssertions.Numeric.ComparableTypeAssertions> { - public ComparableTypeAssertions(System.IComparable value) { } + public ComparableTypeAssertions(System.IComparable value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class ComparableTypeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions, TAssertions> where TAssertions : FluentAssertions.Numeric.ComparableTypeAssertions { - public ComparableTypeAssertions(System.IComparable value) { } + public ComparableTypeAssertions(System.IComparable value, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } @@ -1594,13 +1572,13 @@ namespace FluentAssertions.Numeric public class NullableNumericAssertions : FluentAssertions.Numeric.NullableNumericAssertions> where T : struct, System.IComparable { - public NullableNumericAssertions(T? value) { } + public NullableNumericAssertions(T? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableNumericAssertions : FluentAssertions.Numeric.NumericAssertions where T : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NullableNumericAssertions { - public NullableNumericAssertions(T? value) { } + public NullableNumericAssertions(T? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } @@ -1610,13 +1588,14 @@ namespace FluentAssertions.Numeric public class NumericAssertions : FluentAssertions.Numeric.NumericAssertions> where T : struct, System.IComparable { - public NumericAssertions(T value) { } + public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NumericAssertions where T : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NumericAssertions { - public NumericAssertions(T value) { } + public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } + public FluentAssertions.Execution.AssertionChain CurrentAssertionChain { get; } public T? Subject { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) { } @@ -1642,12 +1621,12 @@ namespace FluentAssertions.Primitives { public class BooleanAssertions : FluentAssertions.Primitives.BooleanAssertions { - public BooleanAssertions(bool? value) { } + public BooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class BooleanAssertions where TAssertions : FluentAssertions.Primitives.BooleanAssertions { - public BooleanAssertions(bool? value) { } + public BooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public bool? Subject { get; } public FluentAssertions.AndConstraint Be(bool expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeFalse(string because = "", params object[] becauseArgs) { } @@ -1658,12 +1637,12 @@ namespace FluentAssertions.Primitives } public class DateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions { - public DateTimeAssertions(System.DateTime? value) { } + public DateTimeAssertions(System.DateTime? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class DateTimeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { - public DateTimeAssertions(System.DateTime? value) { } + public DateTimeAssertions(System.DateTime? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.DateTime? Subject { get; } public FluentAssertions.AndConstraint Be(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(System.DateTime? expected, string because = "", params object[] becauseArgs) { } @@ -1708,12 +1687,12 @@ namespace FluentAssertions.Primitives } public class DateTimeOffsetAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { - public DateTimeOffsetAssertions(System.DateTimeOffset? value) { } + public DateTimeOffsetAssertions(System.DateTimeOffset? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class DateTimeOffsetAssertions where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { - public DateTimeOffsetAssertions(System.DateTimeOffset? value) { } + public DateTimeOffsetAssertions(System.DateTimeOffset? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.DateTimeOffset? Subject { get; } public FluentAssertions.AndConstraint Be(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(System.DateTimeOffset? expected, string because = "", params object[] becauseArgs) { } @@ -1763,7 +1742,7 @@ namespace FluentAssertions.Primitives public class DateTimeOffsetRangeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { - protected DateTimeOffsetRangeAssertions(TAssertions parentAssertions, System.DateTimeOffset? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } + protected DateTimeOffsetRangeAssertions(TAssertions parentAssertions, FluentAssertions.Execution.AssertionChain assertionChain, System.DateTimeOffset? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTimeOffset target, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } @@ -1771,7 +1750,7 @@ namespace FluentAssertions.Primitives public class DateTimeRangeAssertions where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { - protected DateTimeRangeAssertions(TAssertions parentAssertions, System.DateTime? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } + protected DateTimeRangeAssertions(TAssertions parentAssertions, FluentAssertions.Execution.AssertionChain assertionChain, System.DateTime? subject, FluentAssertions.Primitives.TimeSpanCondition condition, System.TimeSpan timeSpan) { } public FluentAssertions.AndConstraint After(System.DateTime target, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Before(System.DateTime target, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } @@ -1779,13 +1758,13 @@ namespace FluentAssertions.Primitives public class EnumAssertions : FluentAssertions.Primitives.EnumAssertions> where TEnum : struct, System.Enum { - public EnumAssertions(TEnum subject) { } + public EnumAssertions(TEnum subject, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class EnumAssertions where TEnum : struct, System.Enum where TAssertions : FluentAssertions.Primitives.EnumAssertions { - public EnumAssertions(TEnum subject) { } + public EnumAssertions(TEnum subject, FluentAssertions.Execution.AssertionChain assertionChain) { } public TEnum? Subject { get; } public FluentAssertions.AndConstraint Be(TEnum expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(TEnum? expected, string because = "", params object[] becauseArgs) { } @@ -1812,12 +1791,12 @@ namespace FluentAssertions.Primitives } public class GuidAssertions : FluentAssertions.Primitives.GuidAssertions { - public GuidAssertions(System.Guid? value) { } + public GuidAssertions(System.Guid? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class GuidAssertions where TAssertions : FluentAssertions.Primitives.GuidAssertions { - public GuidAssertions(System.Guid? value) { } + public GuidAssertions(System.Guid? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.Guid? Subject { get; } public FluentAssertions.AndConstraint Be(System.Guid expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } @@ -1829,12 +1808,12 @@ namespace FluentAssertions.Primitives } public class HttpResponseMessageAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions { - public HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value) { } + public HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class HttpResponseMessageAssertions : FluentAssertions.Primitives.ObjectAssertions where TAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions { - protected HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value) { } + protected HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeRedirection(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSuccessful(string because = "", params object[] becauseArgs) { } @@ -1846,12 +1825,12 @@ namespace FluentAssertions.Primitives } public class NullableBooleanAssertions : FluentAssertions.Primitives.NullableBooleanAssertions { - public NullableBooleanAssertions(bool? value) { } + public NullableBooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableBooleanAssertions : FluentAssertions.Primitives.BooleanAssertions where TAssertions : FluentAssertions.Primitives.NullableBooleanAssertions { - public NullableBooleanAssertions(bool? value) { } + public NullableBooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint Be(bool? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } @@ -1863,12 +1842,12 @@ namespace FluentAssertions.Primitives } public class NullableDateTimeAssertions : FluentAssertions.Primitives.NullableDateTimeAssertions { - public NullableDateTimeAssertions(System.DateTime? expected) { } + public NullableDateTimeAssertions(System.DateTime? expected, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableDateTimeAssertions : FluentAssertions.Primitives.DateTimeAssertions where TAssertions : FluentAssertions.Primitives.NullableDateTimeAssertions { - public NullableDateTimeAssertions(System.DateTime? expected) { } + public NullableDateTimeAssertions(System.DateTime? expected, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } @@ -1876,12 +1855,12 @@ namespace FluentAssertions.Primitives } public class NullableDateTimeOffsetAssertions : FluentAssertions.Primitives.NullableDateTimeOffsetAssertions { - public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected) { } + public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableDateTimeOffsetAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions where TAssertions : FluentAssertions.Primitives.NullableDateTimeOffsetAssertions { - public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected) { } + public NullableDateTimeOffsetAssertions(System.DateTimeOffset? expected, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } @@ -1890,13 +1869,13 @@ namespace FluentAssertions.Primitives public class NullableEnumAssertions : FluentAssertions.Primitives.NullableEnumAssertions> where TEnum : struct, System.Enum { - public NullableEnumAssertions(TEnum? subject) { } + public NullableEnumAssertions(TEnum? subject, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableEnumAssertions : FluentAssertions.Primitives.EnumAssertions where TEnum : struct, System.Enum where TAssertions : FluentAssertions.Primitives.NullableEnumAssertions { - public NullableEnumAssertions(TEnum? subject) { } + public NullableEnumAssertions(TEnum? subject, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint NotBeNull(string because = "", params object[] becauseArgs) { } @@ -1904,12 +1883,12 @@ namespace FluentAssertions.Primitives } public class NullableGuidAssertions : FluentAssertions.Primitives.NullableGuidAssertions { - public NullableGuidAssertions(System.Guid? value) { } + public NullableGuidAssertions(System.Guid? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableGuidAssertions : FluentAssertions.Primitives.GuidAssertions where TAssertions : FluentAssertions.Primitives.NullableGuidAssertions { - public NullableGuidAssertions(System.Guid? value) { } + public NullableGuidAssertions(System.Guid? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint Be(System.Guid? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } @@ -1918,12 +1897,12 @@ namespace FluentAssertions.Primitives } public class NullableSimpleTimeSpanAssertions : FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions { - public NullableSimpleTimeSpanAssertions(System.TimeSpan? value) { } + public NullableSimpleTimeSpanAssertions(System.TimeSpan? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class NullableSimpleTimeSpanAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions where TAssertions : FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions { - public NullableSimpleTimeSpanAssertions(System.TimeSpan? value) { } + public NullableSimpleTimeSpanAssertions(System.TimeSpan? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint Be(System.TimeSpan? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } @@ -1932,7 +1911,7 @@ namespace FluentAssertions.Primitives } public class ObjectAssertions : FluentAssertions.Primitives.ObjectAssertions { - public ObjectAssertions(object value) { } + public ObjectAssertions(object value, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint Be(TExpectation expected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(TExpectation unexpected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } @@ -1940,7 +1919,7 @@ namespace FluentAssertions.Primitives public class ObjectAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TAssertions : FluentAssertions.Primitives.ObjectAssertions { - public ObjectAssertions(TSubject value) { } + public ObjectAssertions(TSubject value, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(TSubject expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(TSubject expected, System.Collections.Generic.IEqualityComparer comparer, string because = "", params object[] becauseArgs) { } @@ -1958,7 +1937,8 @@ namespace FluentAssertions.Primitives public abstract class ReferenceTypeAssertions where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - protected ReferenceTypeAssertions(TSubject subject) { } + protected ReferenceTypeAssertions(TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain) { } + public FluentAssertions.Execution.AssertionChain CurrentAssertionChain { get; } protected abstract string Identifier { get; } public TSubject Subject { get; } public FluentAssertions.AndConstraint BeAssignableTo(System.Type type, string because = "", params object[] becauseArgs) { } @@ -1982,12 +1962,12 @@ namespace FluentAssertions.Primitives } public class SimpleTimeSpanAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { - public SimpleTimeSpanAssertions(System.TimeSpan? value) { } + public SimpleTimeSpanAssertions(System.TimeSpan? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class SimpleTimeSpanAssertions where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { - public SimpleTimeSpanAssertions(System.TimeSpan? value) { } + public SimpleTimeSpanAssertions(System.TimeSpan? value, FluentAssertions.Execution.AssertionChain assertionChain) { } public System.TimeSpan? Subject { get; } public FluentAssertions.AndConstraint Be(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } @@ -2003,12 +1983,12 @@ namespace FluentAssertions.Primitives } public class StringAssertions : FluentAssertions.Primitives.StringAssertions { - public StringAssertions(string value) { } + public StringAssertions(string value, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class StringAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TAssertions : FluentAssertions.Primitives.StringAssertions { - public StringAssertions(string value) { } + public StringAssertions(string value, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } @@ -2084,8 +2064,8 @@ namespace FluentAssertions.Specialized { public class ActionAssertions : FluentAssertions.Specialized.DelegateAssertions { - public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } + public ActionAssertions(System.Action subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } protected override void InvokeSubject() { } public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) { } @@ -2095,7 +2075,7 @@ namespace FluentAssertions.Specialized where TTask : System.Threading.Tasks.Task where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions { - protected AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + protected AsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } public System.Threading.Tasks.Task> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) @@ -2121,7 +2101,7 @@ namespace FluentAssertions.Specialized where TDelegate : System.Delegate where TAssertions : FluentAssertions.Specialized.DelegateAssertions { - protected DelegateAssertions(TDelegate @delegate, FluentAssertions.Specialized.IExtractExceptions extractor) { } + protected DelegateAssertions(TDelegate @delegate, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } protected abstract void InvokeSubject(); public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) where TException : System.Exception { } @@ -2133,7 +2113,7 @@ namespace FluentAssertions.Specialized public class ExceptionAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions, FluentAssertions.Specialized.ExceptionAssertions> where TException : System.Exception { - public ExceptionAssertions(System.Collections.Generic.IEnumerable exceptions) { } + public ExceptionAssertions(System.Collections.Generic.IEnumerable exceptions, FluentAssertions.Execution.AssertionChain assertionChain) { } public TException And { get; } protected override string Identifier { get; } public TException Which { get; } @@ -2155,7 +2135,7 @@ namespace FluentAssertions.Specialized } public class ExecutionTimeAssertions { - public ExecutionTimeAssertions(FluentAssertions.Specialized.ExecutionTime executionTime) { } + public ExecutionTimeAssertions(FluentAssertions.Specialized.ExecutionTime executionTime, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint BeCloseTo(System.TimeSpan expectedDuration, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThanOrEqualTo(System.TimeSpan minDuration, string because = "", params object[] becauseArgs) { } @@ -2165,8 +2145,8 @@ namespace FluentAssertions.Specialized } public class FunctionAssertions : FluentAssertions.Specialized.DelegateAssertions, FluentAssertions.Specialized.FunctionAssertions> { - public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } + public FunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } protected override string Identifier { get; } protected override void InvokeSubject() { } public FluentAssertions.AndWhichConstraint, T> NotThrow(string because = "", params object[] becauseArgs) { } @@ -2174,8 +2154,8 @@ namespace FluentAssertions.Specialized } public class GenericAsyncFunctionAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions, FluentAssertions.Specialized.GenericAsyncFunctionAssertions> { - public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } + public GenericAsyncFunctionAssertions(System.Func> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task, TResult>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task, TResult>> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task, TResult>> NotThrowAsync(string because = "", params object[] becauseArgs) { } @@ -2191,8 +2171,8 @@ namespace FluentAssertions.Specialized } public class NonGenericAsyncFunctionAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions { - public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor) { } - public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { } + public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain) { } + public NonGenericAsyncFunctionAssertions(System.Func subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAfterAsync(System.TimeSpan waitTime, System.TimeSpan pollInterval, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) { } @@ -2204,8 +2184,8 @@ namespace FluentAssertions.Specialized } public class TaskCompletionSourceAssertions : FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase { - public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs) { } - public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Common.IClock clock) { } + public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Execution.AssertionChain assertionChain) { } + public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Common.IClock clock) { } public System.Threading.Tasks.Task, T>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task>> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } } @@ -2214,25 +2194,25 @@ namespace FluentAssertions.Streams { public class BufferedStreamAssertions : FluentAssertions.Streams.BufferedStreamAssertions { - public BufferedStreamAssertions(System.IO.BufferedStream stream) { } + public BufferedStreamAssertions(System.IO.BufferedStream stream, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class BufferedStreamAssertions : FluentAssertions.Streams.StreamAssertions where TAssertions : FluentAssertions.Streams.BufferedStreamAssertions { - public BufferedStreamAssertions(System.IO.BufferedStream stream) { } + public BufferedStreamAssertions(System.IO.BufferedStream stream, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint HaveBufferSize(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveBufferSize(int unexpected, string because = "", params object[] becauseArgs) { } } public class StreamAssertions : FluentAssertions.Streams.StreamAssertions { - public StreamAssertions(System.IO.Stream stream) { } + public StreamAssertions(System.IO.Stream stream, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class StreamAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TSubject : System.IO.Stream where TAssertions : FluentAssertions.Streams.StreamAssertions { - public StreamAssertions(TSubject stream) { } + public StreamAssertions(TSubject stream, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeReadOnly(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeReadable(string because = "", params object[] becauseArgs) { } @@ -2258,7 +2238,7 @@ namespace FluentAssertions.Types } public class AssemblyAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public AssemblyAssertions(System.Reflection.Assembly assembly) { } + public AssemblyAssertions(System.Reflection.Assembly assembly, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeSignedWithPublicKey(string publicKey, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeUnsigned(string because = "", params object[] becauseArgs) { } @@ -2268,14 +2248,14 @@ namespace FluentAssertions.Types } public class ConstructorInfoAssertions : FluentAssertions.Types.MethodBaseAssertions { - public ConstructorInfoAssertions(System.Reflection.ConstructorInfo constructorInfo) { } + public ConstructorInfoAssertions(System.Reflection.ConstructorInfo constructorInfo, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } } public abstract class MemberInfoAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TSubject : System.Reflection.MemberInfo where TAssertions : FluentAssertions.Types.MemberInfoAssertions { - protected MemberInfoAssertions(TSubject subject) { } + protected MemberInfoAssertions(TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndWhichConstraint, TAttribute> BeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } @@ -2290,13 +2270,13 @@ namespace FluentAssertions.Types where TSubject : System.Reflection.MethodBase where TAssertions : FluentAssertions.Types.MethodBaseAssertions { - protected MethodBaseAssertions(TSubject subject) { } + protected MethodBaseAssertions(TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint HaveAccessModifier(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveAccessModifier(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } } public class MethodInfoAssertions : FluentAssertions.Types.MethodBaseAssertions { - public MethodInfoAssertions(System.Reflection.MethodInfo methodInfo) { } + public MethodInfoAssertions(System.Reflection.MethodInfo methodInfo, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeAsync(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeVirtual(string because = "", params object[] becauseArgs) { } @@ -2340,7 +2320,7 @@ namespace FluentAssertions.Types } public class MethodInfoSelectorAssertions { - public MethodInfoSelectorAssertions(params System.Reflection.MethodInfo[] methods) { } + public MethodInfoSelectorAssertions(FluentAssertions.Execution.AssertionChain assertionChain, params System.Reflection.MethodInfo[] methods) { } protected string Context { get; } public System.Collections.Generic.IEnumerable SubjectMethods { get; } public FluentAssertions.AndConstraint Be(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } @@ -2361,7 +2341,7 @@ namespace FluentAssertions.Types } public class PropertyInfoAssertions : FluentAssertions.Types.MemberInfoAssertions { - public PropertyInfoAssertions(System.Reflection.PropertyInfo propertyInfo) { } + public PropertyInfoAssertions(System.Reflection.PropertyInfo propertyInfo, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeReadable(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeReadable(FluentAssertions.Common.CSharpAccessModifier accessModifier, string because = "", params object[] becauseArgs) { } @@ -2403,7 +2383,7 @@ namespace FluentAssertions.Types } public class PropertyInfoSelectorAssertions { - public PropertyInfoSelectorAssertions(params System.Reflection.PropertyInfo[] properties) { } + public PropertyInfoSelectorAssertions(FluentAssertions.Execution.AssertionChain assertionChain, params System.Reflection.PropertyInfo[] properties) { } protected string Context { get; } public System.Collections.Generic.IEnumerable SubjectProperties { get; } public FluentAssertions.AndConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) @@ -2418,7 +2398,7 @@ namespace FluentAssertions.Types } public class TypeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public TypeAssertions(System.Type type) { } + public TypeAssertions(System.Type type, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Type expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(string because = "", params object[] becauseArgs) { } @@ -2536,7 +2516,7 @@ namespace FluentAssertions.Types } public class TypeSelectorAssertions { - public TypeSelectorAssertions(params System.Type[] types) { } + public TypeSelectorAssertions(FluentAssertions.Execution.AssertionChain assertionChain, params System.Type[] types) { } public System.Collections.Generic.IEnumerable Subject { get; } public FluentAssertions.AndConstraint BeDecoratedWith(string because = "", params object[] becauseArgs) where TAttribute : System.Attribute { } @@ -2567,7 +2547,7 @@ namespace FluentAssertions.Xml { public class XAttributeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public XAttributeAssertions(System.Xml.Linq.XAttribute attribute) { } + public XAttributeAssertions(System.Xml.Linq.XAttribute attribute, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XAttribute expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) { } @@ -2575,7 +2555,7 @@ namespace FluentAssertions.Xml } public class XDocumentAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public XDocumentAssertions(System.Xml.Linq.XDocument document) { } + public XDocumentAssertions(System.Xml.Linq.XDocument document, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } @@ -2590,7 +2570,7 @@ namespace FluentAssertions.Xml } public class XElementAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { - public XElementAssertions(System.Xml.Linq.XElement xElement) { } + public XElementAssertions(System.Xml.Linq.XElement xElement, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } @@ -2606,7 +2586,7 @@ namespace FluentAssertions.Xml } public class XmlElementAssertions : FluentAssertions.Xml.XmlNodeAssertions { - public XmlElementAssertions(System.Xml.XmlElement xmlElement) { } + public XmlElementAssertions(System.Xml.XmlElement xmlElement, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveAttributeWithNamespace(string expectedName, string expectedNamespace, string expectedValue, string because = "", params object[] becauseArgs) { } @@ -2616,13 +2596,13 @@ namespace FluentAssertions.Xml } public class XmlNodeAssertions : FluentAssertions.Xml.XmlNodeAssertions { - public XmlNodeAssertions(System.Xml.XmlNode xmlNode) { } + public XmlNodeAssertions(System.Xml.XmlNode xmlNode, FluentAssertions.Execution.AssertionChain assertionChain) { } } public class XmlNodeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions where TSubject : System.Xml.XmlNode where TAssertions : FluentAssertions.Xml.XmlNodeAssertions { - public XmlNodeAssertions(TSubject xmlNode) { } + public XmlNodeAssertions(TSubject xmlNode, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.XmlNode expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.XmlNode unexpected, string because = "", params object[] becauseArgs) { } diff --git a/Tests/Benchmarks/Program.cs b/Tests/Benchmarks/Program.cs index 2dc62955e7..ff2fb9ab18 100644 --- a/Tests/Benchmarks/Program.cs +++ b/Tests/Benchmarks/Program.cs @@ -1,5 +1,4 @@ using System.Globalization; -using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Exporters.Csv; using BenchmarkDotNet.Reports; diff --git a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs index 1936a02b89..b1c54dd353 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs @@ -599,8 +599,7 @@ public void When_asserting_equivalence_including_only_properties_it_should_not_m } [Fact] - public void - When_asserting_equivalence_of_objects_including_enumerables_it_should_print_the_failure_message_only_once() + public void When_asserting_equivalence_of_objects_including_enumerables_it_should_print_the_failure_message_only_once() { // Arrange var record = new { Member1 = "", Member2 = new[] { "", "" } }; diff --git a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs index 6bff2fe4fb..2daadc159f 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs @@ -1467,8 +1467,7 @@ public void Can_force_strict_ordering_based_on_the_parent_type_of_an_unordered_c // Assert action.Should().Throw() - .WithMessage( - "*Expected*[0].UnorderedCollection*5 item(s)*empty collection*"); + .WithMessage("*Expected*[0].UnorderedCollection*5 item(s)*empty collection*"); } [Fact] diff --git a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs index ea5f509b56..8153e5090c 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs @@ -570,6 +570,29 @@ public void act.Should().Throw("the types have different properties"); } + [Fact] + public void Can_compare_non_generic_dictionaries_without_recursing() + { + // Arrange + var expected = new NonGenericDictionary + { + ["Key2"] = "Value2", + ["Key1"] = "Value1" + }; + + var subject = new NonGenericDictionary + { + ["Key1"] = "Value1", + ["Key3"] = "Value2" + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expected, options => options.ExcludingNestedObjects()); + + // Assert + act.Should().Throw().WithMessage("Expected subject[\"Key2\"] to be \"Value2\", but found *"); + } + [Fact] public void When_asserting_equivalence_of_dictionaries_it_should_respect_the_declared_type() { diff --git a/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs index a4c7478d4a..af8beba7ce 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs @@ -3,6 +3,7 @@ using System.Globalization; using System.Linq; using System.Reflection; +using FluentAssertions.Execution; using FluentAssertions.Extensions; using JetBrains.Annotations; using Xunit; @@ -141,7 +142,8 @@ public void When_a_matching_rule_is_added_it_should_appear_in_the_exception_mess internal class ForeignKeyMatchingRule : IMemberMatchingRule { - public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options) + public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options, + AssertionChain assertionChain) { string name = expectedMember.Name; @@ -296,7 +298,7 @@ public void When_equally_named_properties_are_both_incompatible_with_generic_typ // Assert act.Should().Throw() - .WithMessage("*Id*from subject*System.String*System.Double*Id*from expectation*System.String*System.Double*"); + .WithMessage("*Id*from subject*System.String*System.Double*"); } [Fact] @@ -335,13 +337,13 @@ public void When_property_of_subject_is_null_the_failure_message_should_not_comp Id = null as double?, }; - var other = new + var expectation = new { Id = "bar", }; // Act - Action act = () => subject.Should().BeEquivalentTo(other, + Action act = () => subject.Should().BeEquivalentTo(expectation, o => o .Using(c => c.Subject.Should().Be(c.Expectation)) .When(si => si.Path == "Id")); diff --git a/Tests/FluentAssertions.Specs/AssertionExtensions.cs b/Tests/FluentAssertions.Specs/AssertionExtensions.cs index 1e8936c211..add27b751a 100644 --- a/Tests/FluentAssertions.Specs/AssertionExtensions.cs +++ b/Tests/FluentAssertions.Specs/AssertionExtensions.cs @@ -1,6 +1,7 @@ using System; using System.Threading.Tasks; using FluentAssertions.Common; +using FluentAssertions.Execution; using FluentAssertions.Specialized; namespace FluentAssertions.Specs; @@ -11,33 +12,33 @@ internal static class AssertionExtensions public static NonGenericAsyncFunctionAssertions Should(this Func action, IClock clock) { - return new NonGenericAsyncFunctionAssertions(action, Extractor, clock); + return new NonGenericAsyncFunctionAssertions(action, Extractor, AssertionChain.GetOrCreate(), clock); } public static GenericAsyncFunctionAssertions Should(this Func> action, IClock clock) { - return new GenericAsyncFunctionAssertions(action, Extractor, clock); + return new GenericAsyncFunctionAssertions(action, Extractor, AssertionChain.GetOrCreate(), clock); } public static ActionAssertions Should(this Action action, IClock clock) { - return new ActionAssertions(action, Extractor, clock); + return new ActionAssertions(action, Extractor, AssertionChain.GetOrCreate(), clock); } public static FunctionAssertions Should(this Func func, IClock clock) { - return new FunctionAssertions(func, Extractor, clock); + return new FunctionAssertions(func, Extractor, AssertionChain.GetOrCreate(), clock); } public static TaskCompletionSourceAssertions Should(this TaskCompletionSource tcs, IClock clock) { - return new TaskCompletionSourceAssertions(tcs, clock); + return new TaskCompletionSourceAssertions(tcs, AssertionChain.GetOrCreate(), clock); } #if NET6_0_OR_GREATER public static TaskCompletionSourceAssertions Should(this TaskCompletionSource tcs, IClock clock) { - return new TaskCompletionSourceAssertions(tcs, clock); + return new TaskCompletionSourceAssertions(tcs, AssertionChain.GetOrCreate(), clock); } #endif diff --git a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs index 742f82cd18..a49e9516ee 100644 --- a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Reflection; using FluentAssertions.Common; +using FluentAssertions.Execution; using FluentAssertions.Numeric; using FluentAssertions.Primitives; using FluentAssertions.Specialized; @@ -40,24 +41,24 @@ private static bool OverridesEquals(Type t) public static TheoryData ClassesWithGuardEquals => [ - new ObjectAssertions(default), - new BooleanAssertions(default), - new DateTimeAssertions(default), - new DateTimeRangeAssertions(default, default, default, default), - new DateTimeOffsetAssertions(default), - new DateTimeOffsetRangeAssertions(default, default, default, default), - new ExecutionTimeAssertions(new ExecutionTime(() => { }, () => new StopwatchTimer())), - new GuidAssertions(default), - new MethodInfoSelectorAssertions(), - new NumericAssertions>(default), - new PropertyInfoSelectorAssertions(), - new SimpleTimeSpanAssertions(default), - new TaskCompletionSourceAssertions(default), - new TypeSelectorAssertions(), - new EnumAssertions>(default), + new ObjectAssertions(default, AssertionChain.GetOrCreate()), + new BooleanAssertions(default, AssertionChain.GetOrCreate()), + new DateTimeAssertions(default, AssertionChain.GetOrCreate()), + new DateTimeRangeAssertions(default, AssertionChain.GetOrCreate(), default, default, default), + new DateTimeOffsetAssertions(default, AssertionChain.GetOrCreate()), + new DateTimeOffsetRangeAssertions(default, AssertionChain.GetOrCreate(), default, default, default), + new ExecutionTimeAssertions(new ExecutionTime(() => { }, () => new StopwatchTimer()), AssertionChain.GetOrCreate()), + new GuidAssertions(default, AssertionChain.GetOrCreate()), + new MethodInfoSelectorAssertions(AssertionChain.GetOrCreate()), + new NumericAssertions>(default, AssertionChain.GetOrCreate()), + new PropertyInfoSelectorAssertions(AssertionChain.GetOrCreate()), + new SimpleTimeSpanAssertions(default, AssertionChain.GetOrCreate()), + new TaskCompletionSourceAssertions(default, AssertionChain.GetOrCreate()), + new TypeSelectorAssertions(AssertionChain.GetOrCreate()), + new EnumAssertions>(default, AssertionChain.GetOrCreate()), #if NET6_0_OR_GREATER - new DateOnlyAssertions(default), - new TimeOnlyAssertions(default), + new DateOnlyAssertions(default, AssertionChain.GetOrCreate()), + new TimeOnlyAssertions(default, AssertionChain.GetOrCreate()), #endif ]; diff --git a/Tests/FluentAssertions.Specs/AssertionFailureSpecs.cs b/Tests/FluentAssertions.Specs/AssertionFailureSpecs.cs index ea81a04d7a..857253db82 100644 --- a/Tests/FluentAssertions.Specs/AssertionFailureSpecs.cs +++ b/Tests/FluentAssertions.Specs/AssertionFailureSpecs.cs @@ -1,6 +1,5 @@ using System; using FluentAssertions.Execution; -using FluentAssertions.Primitives; using Xunit; using Xunit.Sdk; @@ -70,23 +69,15 @@ public void When_reason_does_not_start_with_because_but_is_prefixed_with_blanks_ .WithMessage("Expected it to fail\r\nbecause AssertionsTestSubClass should always fail."); } - internal class AssertionsTestSubClass : ReferenceTypeAssertions + internal class AssertionsTestSubClass { + private readonly AssertionChain assertionChain = AssertionChain.GetOrCreate(); + public void AssertFail(string because, params object[] becauseArgs) { - Execute.Assertion + assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected it to fail{reason}"); } - - protected override string Identifier - { - get { return "test"; } - } - - public AssertionsTestSubClass() - : base(null) - { - } } } diff --git a/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs b/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs index 0ffac09bcd..a931266d0b 100644 --- a/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs @@ -421,7 +421,7 @@ internal class MyEquivalencyStep : IEquivalencyStep public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, IValidateChildNodeEquivalency valueChildNodes) { - Execute.Assertion.FailWith(GetType().FullName); + AssertionChain.GetOrCreate().For(context).FailWith(GetType().FullName); return EquivalencyResult.EquivalencyProven; } diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs index 6f4688bdce..60a28858db 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs @@ -363,11 +363,11 @@ public void When_asserting_collections_not_to_be_equivalent_with_options_but_sub public void Default_immutable_array_should_not_be_equivalent_to_initialized_immutable_array() { // Arrange - ImmutableArray collection = default; - ImmutableArray collection1 = ImmutableArray.Create("a", "b", "c"); + ImmutableArray subject = default; + ImmutableArray expectation = ImmutableArray.Create("a", "b", "c"); // Act / Assert - collection.Should().NotBeEquivalentTo(collection1); + subject.Should().NotBeEquivalentTo(expectation); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Contain.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Contain.cs index 4c95e2abc2..4fb71e62ee 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Contain.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.Contain.cs @@ -104,7 +104,8 @@ public void Action act = () => { using var _ = new AssertionScope(); - collection.Should().Contain([4]).And.Contain([5, 6]); + collection.Should().Contain([4]); + collection.Should().Contain([5, 6]); }; // Assert @@ -186,6 +187,20 @@ public void When_collection_does_contain_an_expected_item_matching_a_predicate_i "Expected*greater*4*2*"); } + [Fact] + public void Can_chain_another_assertion_on_the_single_result() + { + // Arrange + IEnumerable collection = [1, 2, 3]; + + // Act + Action act = () => collection.Should().Contain(item => item == 2).Which.Should().BeGreaterThan(4); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection[1]*greater*4*2*"); + } + [Fact] public void When_collection_does_contain_an_expected_item_matching_a_predicate_it_should_not_throw() { @@ -395,7 +410,7 @@ public void When_collection_contains_unexpected_items_it_should_throw() } [Fact] - public void When_asserting_multiple_collection_in_assertion_scope_all_should_be_reported() + public void Assertion_scopes_do_not_affect_chained_calls() { // Arrange int[] collection = [1, 2, 3]; @@ -409,7 +424,7 @@ public void When_asserting_multiple_collection_in_assertion_scope_all_should_be_ // Assert act.Should().Throw().WithMessage( - "*to not contain {1, 2}*to not contain 3*"); + "*but found {1, 2}."); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainEquivalentOf.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainEquivalentOf.cs index 1a07b2b20a..b8f3028b4b 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainEquivalentOf.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainEquivalentOf.cs @@ -45,6 +45,21 @@ public void When_character_collection_does_contain_equivalent_it_should_succeed( collection.Should().ContainEquivalentOf(item); } + [Fact] + public void Can_chain_a_successive_assertion_on_the_matching_item() + { + // Arrange + char[] collection = "abc123ab".ToCharArray(); + char item = 'c'; + + // Act + var act = () => collection.Should().ContainEquivalentOf(item).Which.Should().Be('C'); + + // Assert + act.Should().Throw() + .WithMessage("Expected collection[2] to be equal to C, but found c."); + } + [Fact] public void When_string_collection_does_contain_same_string_with_other_case_it_should_throw() { @@ -398,17 +413,17 @@ public void When_asserting_collection_to_not_contain_equivalent_it_should_allow_ // Act Action act = () => { - using (new AssertionScope()) - { - collection.Should().NotContainEquivalentOf(another, "because we want to test {0}", "first message") - .And - .HaveCount(4, "because we want to test {0}", "second message"); - } + using var _ = new AssertionScope(); + + collection.Should() + .NotContainEquivalentOf(another, "because we want to test {0}", "first message") + .And + .HaveCount(4, "because we want to test {0}", "second message"); }; // Assert - act.Should().Throw().WithMessage("Expected collection*not to contain*first message*but*.\n" + - "Expected*4 item(s)*because*second message*but*."); + act.Should().Throw() + .WithMessage("Expected collection*not to contain*first message*but found one at index 2.*"); } } } diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainInOrder.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainInOrder.cs index da7dafbc61..0efa455e49 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainInOrder.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainInOrder.cs @@ -90,7 +90,7 @@ public void When_a_collection_does_not_contain_an_ordered_item_it_should_throw_w } [Fact] - public void When_a_collection_does_not_contain_items_with_assertion_scope_all_items_are_reported() + public void Even_with_an_assertion_scope_only_the_first_failure_in_a_chained_assertion_is_reported() { // Act Action act = () => @@ -100,8 +100,7 @@ public void When_a_collection_does_not_contain_items_with_assertion_scope_all_it }; // Assert - act.Should().Throw().WithMessage( - "*but 4 (index 0)*but 5 (index 0)*"); + act.Should().Throw().WithMessage("*but 4 (index 0) did not appear (in the right order)."); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainSingle.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainSingle.cs index 260662bc6e..15bf529510 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainSingle.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.ContainSingle.cs @@ -33,11 +33,8 @@ public void When_a_collection_contains_a_single_item_matching_a_predicate_it_sho IEnumerable collection = [1, 2, 3]; Expression> expression = item => item == 2; - // Act - Action act = () => collection.Should().ContainSingle(expression); - - // Assert - act.Should().NotThrow(); + // Act / Assert + collection.Should().ContainSingle(expression); } [Fact] @@ -122,7 +119,27 @@ public void When_single_item_matching_a_predicate_is_found_it_should_allow_conti Action act = () => collection.Should().ContainSingle(item => item == 2).Which.Should().BeGreaterThan(4); // Assert - act.Should().Throw().WithMessage("Expected*greater*4*2*"); + act.Should() + .Throw() + .WithMessage("Expected collection[0]*greater*4*2*"); + } + + [Fact] + public void Chained_assertions_are_never_called_when_the_initial_assertion_failed() + { + // Arrange + IEnumerable collection = [1, 2, 3]; + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + collection.Should().ContainSingle(item => item == 4).Which.Should().BeGreaterThan(4); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expected collection to contain a single item matching (item == 4), but no such item was found."); } [Fact] @@ -239,9 +256,8 @@ public void When_single_item_is_found_it_should_allow_continuation() Action act = () => collection.Should().ContainSingle().Which.Should().BeGreaterThan(4); // Assert - const string expectedMessage = "Expected collection to be greater than 4, but found 3."; - - act.Should().Throw().WithMessage(expectedMessage); + act.Should().Throw() + .WithMessage("Expected collection[0] to be greater than 4, but found 3."); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCount.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCount.cs index bc0022bbdc..91f58b5fc1 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCount.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveCount.cs @@ -62,7 +62,7 @@ public void When_collection_has_a_count_larger_than_the_minimum_it_should_not_th } [Fact] - public void When_asserting_a_collection_with_incorrect_predicates_in_assertion_scope_all_are_reported() + public void Even_with_an_assertion_scope_only_the_first_failure_in_a_chained_call_is_reported() { // Arrange int[] collection = [1, 2, 3]; @@ -75,8 +75,7 @@ public void When_asserting_a_collection_with_incorrect_predicates_in_assertion_s }; // Assert - act.Should().Throw().WithMessage( - "*to have a count (c > 3)*to have a count (c < 3)*"); + act.Should().Throw().WithMessage("*count (c > 3), but count is 3: {1, 2, 3}."); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveElementAt.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveElementAt.cs index efad04183c..fa9c3c0a6e 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveElementAt.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.HaveElementAt.cs @@ -22,6 +22,20 @@ public void When_collection_has_expected_element_at_specific_index_it_should_not collection.Should().HaveElementAt(1, 2); } + [Fact] + public void Can_chain_another_assertion_on_the_selected_element() + { + // Arrange + int[] collection = [1, 2, 3]; + + // Act + var act = () => collection.Should().HaveElementAt(index: 1, element: 2).Which.Should().Be(3); + + // Assert + act.Should().Throw() + .WithMessage("Expected collection[1] to be 3, but found 2."); + } + [Fact] public void When_collection_does_not_have_the_expected_element_at_specific_index_it_should_throw() { diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyHaveUniqueItems.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyHaveUniqueItems.cs index 6c86ba71c4..b07d84886b 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyHaveUniqueItems.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.OnlyHaveUniqueItems.cs @@ -177,7 +177,7 @@ public void When_a_collection_contains_multiple_duplicate_items_with_a_predicate } [Fact] - public void When_a_collection_contains_multiple_duplicates_on_different_properties_all_should_be_reported() + public void Only_the_first_failing_assertion_in_a_chain_is_reported() { // Arrange IEnumerable collection = @@ -198,7 +198,7 @@ public void When_a_collection_contains_multiple_duplicates_on_different_properti // Assert act.Should().Throw().WithMessage( - "*have unique items on e.Text*have unique items on e.Number*"); + "*have unique items on e.Text*"); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs index b908e6669c..1713431bcb 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.cs @@ -12,8 +12,22 @@ namespace FluentAssertions.Specs.Collections; /// public partial class CollectionAssertionSpecs { - public class Chainings + public class Chaining { + [Fact] + public void Chaining_something_should_do_something() + { + // Arrange + var languages = new[] { "C#" }; + + // Act + var act = () => languages.Should().ContainSingle() + .Which.Should().EndWith("script"); + + // Assert + act.Should().Throw().WithMessage("Expected languages[0]*"); + } + [Fact] public void Should_support_chaining_constraints_with_and() { @@ -71,7 +85,7 @@ public void When_the_collection_is_not_ordered_according_to_the_subsequent_ascen // Assert action.Should().Throw() - .WithMessage("Expected collection * to be ordered \"by Item2\"*"); + .WithMessage("Expected collection*to be ordered \"by Item2\"*"); } [Fact] @@ -163,7 +177,7 @@ public void When_the_collection_is_not_ordered_according_to_the_subsequent_desce // Assert action.Should().Throw() - .WithMessage("Expected collection * to be ordered \"by Item2\"*"); + .WithMessage("Expected collection*to be ordered \"by Item2\"*"); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainMatch.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainMatch.cs index d274fe904f..6901a1e685 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainMatch.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.ContainMatch.cs @@ -37,7 +37,21 @@ public void When_collection_contains_multiple_matches_it_should_not_throw() } [Fact] - public void When_collection_contains_multiple_matches_which_should_throw() + public void Can_chain_another_assertion_if_a_single_string_matches_the_pattern() + { + // Arrange + IEnumerable collection = ["build succeeded", "test succeeded", "pack failed"]; + + // Act + Action action = () => collection.Should().ContainMatch("*failed*").Which.Should().StartWith("test"); + + // Assert + action.Should().Throw() + .WithMessage("Expected collection[2] to start with*test*pack failed*"); + } + + [Fact] + public void Cannot_chain_another_assertion_if_multiple_strings_match_the_pattern() { // Arrange IEnumerable collection = ["build succeded", "test failed", "pack failed"]; diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValue.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValue.cs index 639b329436..3cfd9ab9d9 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValue.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValue.cs @@ -27,6 +27,23 @@ public void When_dictionary_contains_expected_value_it_should_succeed() act.Should().NotThrow(); } + [Fact] + public void Can_continue_asserting_on_a_single_matching_item() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().ContainValue("One").Which.Should().Be("Two"); + + // Assert + act.Should().Throw().WithMessage("*Expected dictionary[1] to be*Two*, but*One*differs*"); + } + [Fact] public void Null_dictionaries_do_not_contain_any_values() { @@ -82,30 +99,6 @@ public void When_the_specified_value_exists_it_should_allow_continuation_using_t act.Should().Throw().WithMessage("Expected*greater*0*0*"); } - [Fact] - public void When_multiple_matches_for_the_specified_value_exist_continuation_using_the_matched_value_should_fail() - { - // Arrange - var myClass = new MyClass { SomeProperty = 0 }; - - var dictionary = new Dictionary - { - [1] = myClass, - [2] = new() { SomeProperty = 0 } - }; - - // Act - Action act = - () => - dictionary.Should() - .ContainValue(new MyClass { SomeProperty = 0 }) - .Which.Should() - .BeSameAs(myClass); - - // Assert - act.Should().Throw(); - } - [Fact] public void When_a_dictionary_does_not_contain_single_value_it_should_throw_with_clear_explanation() { diff --git a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValues.cs b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValues.cs index ec0247fb4d..07f898177b 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValues.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericDictionaryAssertionSpecs.ContainValues.cs @@ -42,7 +42,7 @@ public void When_a_dictionary_does_not_contain_a_number_of_values_it_should_thro // Assert act.Should().Throw().WithMessage( - "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to contain value {\"Two\", \"Three\"} because we do, but could not find {\"Three\"}."); + "Expected dictionary {[1] = \"One\", [2] = \"Two\"} to contain values {\"Two\", \"Three\"} because we do, but could not find \"Three\"."); } [Fact] @@ -65,6 +65,23 @@ public void } } + [Fact] + public void Can_run_another_assertion_on_the_result() + { + // Arrange + var dictionary = new Dictionary + { + [1] = "One", + [2] = "Two" + }; + + // Act + Action act = () => dictionary.Should().ContainValues("Two", "One").Which.Should().Contain("Three"); + + // Assert + act.Should().Throw().WithMessage("Expected dictionary[1 and 2]*to contain*Three*"); + } + public class NotContainValues { [Fact] diff --git a/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs index 9933c52a5c..69d8e077c3 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/FunctionExceptionAssertionSpecs.cs @@ -435,29 +435,6 @@ public void .WithMessage("*no*exception*that's what he told me*but*ArgumentNullException*"); } - [Fact] - public void When_an_assertion_fails_on_NotThrow_succeeding_message_should_be_included() - { - // Arrange - Func throwingFunction = () => throw new Exception(); - - // Act - Action act = () => - { - using var _ = new AssertionScope(); - - throwingFunction.Should().NotThrow() - .And.BeNull(); - }; - - // Assert - act.Should().Throw() - .WithMessage( - "*Did not expect any exception*" + - "*to be *" - ); - } - #endregion #region NotThrowAfter @@ -594,10 +571,10 @@ public void When_no_exception_should_be_thrown_after_wait_time_the_func_result_s // Act Action act = () => throwShorterThanWaitTime.Should(clock).NotThrowAfter(waitTime, pollInterval) - .Which.Should().Be(42); + .Which.Should().Be(43); // Assert - act.Should().NotThrow(); + act.Should().Throw().WithMessage("Expected throwShorterThanWaitTime.Result to be 43*"); } [Fact] @@ -619,10 +596,7 @@ public void When_an_assertion_fails_on_NotThrowAfter_succeeding_message_should_b // Assert act.Should().Throw() - .WithMessage( - "*Did not expect any exceptions after*" + - "*to be *" - ); + .WithMessage("*Did not expect any exceptions after*"); } #endregion diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionChainSpecs.Chaining.cs b/Tests/FluentAssertions.Specs/Execution/AssertionChainSpecs.Chaining.cs new file mode 100644 index 0000000000..11e959587d --- /dev/null +++ b/Tests/FluentAssertions.Specs/Execution/AssertionChainSpecs.Chaining.cs @@ -0,0 +1,599 @@ +using System; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Execution; + +/// +/// The chaining API specs. +/// +public partial class AssertionChainSpecs +{ + public class Chaining + { + [Fact] + public void A_successful_assertion_does_not_affect_the_chained_failing_assertion() + { + // Act + Action act = () => AssertionChain.GetOrCreate() + .ForCondition(condition: true) + .FailWith("First assertion") + .Then + .FailWith("Second assertion"); + + // Arrange + act.Should().Throw().WithMessage("*Second assertion*"); + } + + [Fact] + public void When_the_previous_assertion_succeeded_it_should_not_affect_the_next_one_with_arguments() + { + // Act + Action act = () => AssertionChain.GetOrCreate() + .ForCondition(true) + .FailWith("First assertion") + .Then + .FailWith("Second {0}", "assertion"); + + // Assert + act.Should().Throw() + .WithMessage("Second \"assertion\""); + } + + [Fact] + public void When_the_previous_assertion_succeeded_it_should_not_affect_the_next_one_with_argument_providers() + { + // Act + Action act = () => AssertionChain.GetOrCreate() + .ForCondition(true) + .FailWith("First assertion") + .Then + .FailWith("Second {0}", () => "assertion"); + + // Assert + act.Should().Throw() + .WithMessage("Second \"assertion\""); + } + + [Fact] + public void When_the_previous_assertion_succeeded_it_should_not_affect_the_next_one_with_a_fail_reason_function() + { + // Act + Action act = () => AssertionChain.GetOrCreate() + .ForCondition(true) + .FailWith("First assertion") + .Then + .FailWith(() => new FailReason("Second {0}", "assertion")); + + // Assert + act.Should().Throw() + .WithMessage("Second \"assertion\""); + } + + [Fact] + public void When_continuing_an_assertion_chain_the_reason_should_be_part_of_consecutive_failures() + { + // Act + Action act = () => AssertionChain.GetOrCreate() + .ForCondition(true) + .FailWith("First assertion") + .Then + .BecauseOf("because reasons") + .FailWith("Expected{reason}"); + + // Assert + act.Should().Throw() + .WithMessage("Expected because reasons"); + } + + [Fact] + public void When_continuing_an_assertion_chain_the_reason_with_arguments_should_be_part_of_consecutive_failures() + { + // Act + Action act = () => AssertionChain.GetOrCreate() + .ForCondition(true) + .FailWith("First assertion") + .Then + .BecauseOf("because {0}", "reasons") + .FailWith("Expected{reason}"); + + // Assert + act.Should().Throw() + .WithMessage("Expected because reasons"); + } + + [Fact] + public void Passing_a_null_value_as_reason_does_not_fail() + { + // Act + Action act = () => AssertionChain.GetOrCreate() + .BecauseOf(null, "only because for method disambiguity") + .ForCondition(false) + .FailWith("First assertion"); + + // Assert + act.Should().Throw() + .WithMessage("First assertion"); + } + + [Fact] + public void When_a_given_is_used_before_an_assertion_then_the_result_should_be_available_for_evaluation() + { + // Act + Action act = () => AssertionChain.GetOrCreate() + .Given(() => new[] { "a", "b" }) + .ForCondition(collection => collection.Length > 0) + .FailWith("First assertion"); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_the_previous_assertion_failed_it_should_not_evaluate_the_succeeding_given_statement() + { + // Arrange + using var _ = new AssertionScope(new IgnoringFailuresAssertionStrategy()); + + // Act / Assert + AssertionChain.GetOrCreate() + .ForCondition(false) + .FailWith("First assertion") + .Then + .Given(() => throw new InvalidOperationException()); + } + + [Fact] + public void When_the_previous_assertion_failed_it_should_not_evaluate_the_succeeding_condition() + { + // Arrange + bool secondConditionEvaluated = false; + + try + { + using var _ = new AssertionScope(); + + // Act + AssertionChain.GetOrCreate() + .Given(() => (string)null) + .ForCondition(s => s is not null) + .FailWith("but is was null") + .Then + .ForCondition(_ => secondConditionEvaluated = true) + .FailWith("it should be 42"); + } + catch + { + // Ignore + } + + // Assert + secondConditionEvaluated.Should().BeFalse("because the 2nd condition should not be invoked"); + } + + [Fact] + public void When_the_previous_assertion_failed_it_should_not_execute_the_succeeding_failure() + { + // Arrange + var scope = new AssertionScope(); + + // Act + AssertionChain.GetOrCreate() + .ForCondition(false) + .FailWith("First assertion") + .Then + .ForCondition(false) + .FailWith("Second assertion"); + + string[] failures = scope.Discard(); + scope.Dispose(); + + Assert.Single(failures); + Assert.Contains("First assertion", failures); + } + + [Fact] + public void When_the_previous_assertion_failed_it_should_not_execute_the_succeeding_failure_with_arguments() + { + // Act + Action act = () => + { + using var _ = new AssertionScope(); + + AssertionChain.GetOrCreate() + .ForCondition(false) + .FailWith("First assertion") + .Then + .FailWith("Second {0}", "assertion"); + }; + + // Assert + act.Should().Throw() + .WithMessage("First assertion"); + } + + [Fact] + public void When_the_previous_assertion_failed_it_should_not_execute_the_succeeding_failure_with_argument_providers() + { + // Act + Action act = () => + { + using var _ = new AssertionScope(); + + AssertionChain.GetOrCreate() + .ForCondition(false) + .FailWith("First assertion") + .Then + .FailWith("Second {0}", () => "assertion"); + }; + + // Assert + act.Should().Throw() + .WithMessage("First assertion"); + } + + [Fact] + public void When_the_previous_assertion_failed_it_should_not_execute_the_succeeding_failure_with_a_fail_reason_function() + { + // Act + Action act = () => + { + using var _ = new AssertionScope(); + + AssertionChain.GetOrCreate() + .ForCondition(false) + .FailWith("First assertion") + .Then + .FailWith(() => new FailReason("Second {0}", "assertion")); + }; + + // Assert + act.Should().Throw() + .WithMessage("First assertion"); + } + + [Fact] + public void When_the_previous_assertion_failed_it_should_not_execute_the_succeeding_expectation() + { + // Act + Action act = () => + { + using var scope = new AssertionScope(); + + AssertionChain.GetOrCreate() + .WithExpectation("Expectations are the root ", c => c + .ForCondition(false) + .FailWith("of disappointment") + .Then + .WithExpectation("Assumptions are the root ", c2 => c2 + .FailWith("of all evil"))); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expectations are the root of disappointment"); + } + + [Fact] + public void When_the_previous_assertion_failed_it_should_not_execute_the_succeeding_expectation_with_arguments() + { + // Act + Action act = () => + { + using var scope = new AssertionScope(); + + AssertionChain.GetOrCreate() + .WithExpectation("Expectations are the {0} ", "root", c => c + .ForCondition(false) + .FailWith("of disappointment") + .Then + .WithExpectation("Assumptions are the {0} ", "root", c2 => c2 + .FailWith("of all evil"))); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expectations are the \"root\" of disappointment"); + } + + [Fact] + public void When_the_previous_assertion_failed_it_should_not_execute_the_succeeding_default_identifier() + { + // Act + Action act = () => + { + using var _ = new AssertionScope(); + + AssertionChain.GetOrCreate() + .WithDefaultIdentifier("identifier") + .ForCondition(false) + .FailWith("Expected {context}") + .Then + .WithDefaultIdentifier("other") + .FailWith("Expected {context}"); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expected identifier"); + } + + [Fact] + public void When_continuing_a_failed_assertion_chain_consecutive_reasons_are_ignored() + { + // Act + Action act = () => + { + using var _ = new AssertionScope(); + + AssertionChain.GetOrCreate() + .BecauseOf("because {0}", "whatever") + .ForCondition(false) + .FailWith("Expected{reason}") + .Then + .BecauseOf("because reasons") + .FailWith("Expected{reason}"); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expected because whatever"); + } + + [Fact] + public void When_continuing_a_failed_assertion_chain_consecutive_reasons_with_arguments_are_ignored() + { + // Act + Action act = () => + { + using var _ = new AssertionScope(); + + AssertionChain.GetOrCreate() + .BecauseOf("because {0}", "whatever") + .ForCondition(false) + .FailWith("Expected{reason}") + .Then + .BecauseOf("because {0}", "reasons") + .FailWith("Expected{reason}"); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expected because whatever"); + } + + [Fact] + public void When_the_previous_assertion_succeeded_it_should_evaluate_the_succeeding_given_statement() + { + // Act + Action act = () => AssertionChain.GetOrCreate() + .ForCondition(true) + .FailWith("First assertion") + .Then + .Given(() => throw new InvalidOperationException()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_the_previous_assertion_succeeded_it_should_not_affect_the_succeeding_expectation() + { + // Act + Action act = () => + { + AssertionChain.GetOrCreate() + .WithExpectation("Expectations are the root ", chain => chain + .ForCondition(true) + .FailWith("of disappointment") + .Then + .WithExpectation("Assumptions are the root ", innerChain => innerChain + .FailWith("of all evil"))); + }; + + // Assert + act.Should().Throw() + .WithMessage("Assumptions are the root of all evil"); + } + + [Fact] + public void When_the_previous_assertion_succeeded_it_should_not_affect_the_succeeding_expectation_with_arguments() + { + // Act + Action act = () => + { + AssertionChain.GetOrCreate() + .WithExpectation("Expectations are the {0} ", "root", c => c + .ForCondition(true) + .FailWith("of disappointment") + .Then + .WithExpectation("Assumptions are the {0} ", "root", c2 => c2 + .FailWith("of all evil"))); + }; + + // Assert + act.Should().Throw() + .WithMessage("Assumptions are the \"root\" of all evil"); + } + + [Fact] + public void When_the_previous_assertion_succeeded_it_should_not_affect_the_succeeding_default_identifier() + { + // Act + Action act = () => + { + AssertionChain.GetOrCreate() + .WithDefaultIdentifier("identifier") + .ForCondition(true) + .FailWith("Expected {context}") + .Then + .WithDefaultIdentifier("other") + .FailWith("Expected {context}"); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expected other"); + } + + [Fact] + public void Continuing_an_assertion_with_occurrence() + { + // Act + Action act = () => + { + AssertionChain.GetOrCreate() + .ForCondition(true) + .FailWith("First assertion") + .Then + .WithExpectation("{expectedOccurrence} ", c => c + .ForConstraint(Exactly.Once(), 2) + .FailWith("Second {0}", "assertion")); + }; + + // Assert + act.Should().Throw() + .WithMessage("Exactly 1 time Second \"assertion\"*"); + } + + [Fact] + public void Continuing_an_assertion_with_occurrence_will_not_be_executed_when_first_assertion_fails() + { + // Act + Action act = () => + { + AssertionChain.GetOrCreate() + .ForCondition(false) + .FailWith("First assertion") + .Then + .WithExpectation("{expectedOccurrence} ", c => c + .ForConstraint(Exactly.Once(), 2) + .FailWith("Second {0}", "assertion")); + }; + + // Assert + act.Should().Throw() + .WithMessage("First assertion"); + } + + [Fact] + public void Continuing_an_assertion_with_occurrence_overrides_the_previous_defined_expectations() + { + // Act + Action act = () => + { + AssertionChain.GetOrCreate() + .WithExpectation("First expectation", c => c + .ForCondition(true) + .FailWith("First assertion") + .Then + .WithExpectation("{expectedOccurrence} ", c2 => c2 + .ForConstraint(Exactly.Once(), 2) + .FailWith("Second {0}", "assertion"))); + }; + + // Assert + act.Should().Throw() + .WithMessage("Exactly 1 time Second \"assertion\"*"); + } + + [Fact] + public void Continuing_an_assertion_after_occurrence_check_works() + { + // Act + Action act = () => + { + AssertionChain.GetOrCreate() + .WithExpectation("{expectedOccurrence} ", c => c + .ForConstraint(Exactly.Once(), 1) + .FailWith("First assertion") + .Then + .WithExpectation("Second expectation ", c2 => c2 + .ForCondition(false) + .FailWith("Second {0}", "assertion"))); + }; + + // Assert + act.Should().Throw() + .WithMessage("Second expectation Second \"assertion\"*"); + } + + [Fact] + public void Continuing_an_assertion_with_occurrence_check_before_defining_expectation_works() + { + // Act + Action act = () => + { + AssertionChain.GetOrCreate() + .ForCondition(true) + .FailWith("First assertion") + .Then + .ForConstraint(Exactly.Once(), 2) + .WithExpectation("Second expectation ", c => c + .FailWith("Second {0}", "assertion")); + }; + + // Assert + act.Should().Throw() + .WithMessage("Second expectation Second \"assertion\"*"); + } + + [Fact] + public void Does_not_continue_a_chained_assertion_after_the_first_one_failed_the_occurrence_check() + { + // Arrange + var scope = new AssertionScope(); + + // Act + AssertionChain.GetOrCreate() + .ForConstraint(Exactly.Once(), 2) + .FailWith("First {0}", "assertion") + .Then + .ForConstraint(Exactly.Once(), 2) + .FailWith("Second {0}", "assertion"); + + string[] failures = scope.Discard(); + + // Assert + Assert.Single(failures); + Assert.Contains("First \"assertion\"", failures); + } + + [Fact] + public void Discard_a_scope_after_continuing_chained_assertion() + { + // Arrange + using var scope = new AssertionScope(); + + // Act + AssertionChain.GetOrCreate() + .ForConstraint(Exactly.Once(), 2) + .FailWith("First {0}", "assertion"); + + var failures = scope.Discard(); + + // Assert + Assert.Single(failures); + Assert.Contains("First \"assertion\"", failures); + } + + // [Fact] + // public void Get_info_about_line_breaks_from_parent_scope_after_continuing_chained_assertion() + // { + // // Arrange + // using var scope = new AssertionScope(); + // scope.FormattingOptions.UseLineBreaks = true; + // + // // Act + // var innerScope = AssertionChain.GetOrCreate() + // .ForConstraint(Exactly.Once(), 1) + // .FailWith("First {0}", "assertion") + // .Then + // .UsingLineBreaks; + // + // // Assert + // innerScope.UsingLineBreaks.Should().Be(scope.UsingLineBreaks); + // } + } +} diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionChainSpecs.MessageFormating.cs b/Tests/FluentAssertions.Specs/Execution/AssertionChainSpecs.MessageFormating.cs new file mode 100644 index 0000000000..63fc8e684e --- /dev/null +++ b/Tests/FluentAssertions.Specs/Execution/AssertionChainSpecs.MessageFormating.cs @@ -0,0 +1,390 @@ +using System; +using System.Collections.Generic; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Execution; + +/// +/// The message formatting specs. +/// +public partial class AssertionChainSpecs +{ + public class MessageFormatting + { + [Fact] + public void Multiple_assertions_in_an_assertion_scope_are_all_reported() + { + // Arrange + var scope = new AssertionScope(); + + AssertionChain.GetOrCreate().FailWith("Failure"); + AssertionChain.GetOrCreate().FailWith("Failure"); + + using (new AssertionScope()) + { + AssertionChain.GetOrCreate().FailWith("Failure"); + AssertionChain.GetOrCreate().FailWith("Failure"); + } + + // Act + Action act = scope.Dispose; + + // Assert + act.Should().Throw() + .Which.Message.Should().Contain("Failure", Exactly.Times(4)); + } + + [InlineData("foo")] + [InlineData("{}")] + [Theory] + public void The_failure_message_uses_the_name_of_the_scope_as_context(string context) + { + // Act + Action act = () => + { + using var _ = new AssertionScope(context); + new[] { 1, 2, 3 }.Should().Equal(3, 2, 1); + }; + + // Assert + act.Should().Throw() + .WithMessage($"Expected {context} to be equal to*"); + } + + [Fact] + public void The_failure_message_uses_the_lazy_name_of_the_scope_as_context() + { + // Act + Action act = () => + { + using var _ = new AssertionScope(() => "lazy foo"); + new[] { 1, 2, 3 }.Should().Equal(3, 2, 1); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expected lazy foo to be equal to*"); + } + + [Fact] + public void The_failure_message_includes_all_failures() + { + // Act + Action act = () => + { + using var _ = new AssertionScope(); + var values = new Dictionary(); + values.Should().ContainKey(0); + values.Should().ContainKey(1); + }; + + // Assert + act.Should().Throw() + .WithMessage( + "Expected * to contain key 0.\nExpected * to contain key 1.\n"); + } + + [Fact] + public void The_failure_message_includes_all_failures_as_well() + { + // Act + Action act = () => + { + using var _ = new AssertionScope(); + var values = new List(); + values.Should().ContainSingle(); + values.Should().ContainSingle(); + }; + + // Assert + act.Should().Throw() + .WithMessage( + "Expected * to contain a single item, but the collection is empty.\n" + + "Expected * to contain a single item, but the collection is empty.\n"); + } + + [Fact] + public void The_reason_can_contain_parentheses() + { + // Act + Action act = () => 1.Should().Be(2, "can't use these in becauseArgs: {0} {1}", "{", "}"); + + // Assert + act.Should().Throw() + .WithMessage("*because can't use these in becauseArgs: { }*"); + } + + [Fact] + public void Because_reason_should_ignore_undefined_arguments() + { + // Act + object[] becauseArgs = null; + Action act = () => 1.Should().Be(2, "it should still work", becauseArgs); + + // Assert + act.Should().Throw() + .WithMessage("*because it should still work*"); + } + + [Fact] + public void Because_reason_should_threat_parentheses_as_literals_if_no_arguments_are_defined() + { + // Act +#pragma warning disable CA2241 + // ReSharper disable once FormatStringProblem + Action act = () => 1.Should().Be(2, "use of {} is okay if there are no because arguments"); +#pragma warning restore CA2241 + + // Assert + act.Should().Throw() + .WithMessage("*because use of {} is okay if there are no because arguments*"); + } + + [Fact] + public void Because_reason_should_inform_about_invalid_parentheses_with_a_default_message() + { + // Act +#pragma warning disable CA2241 + // ReSharper disable once FormatStringProblem + Action act = () => 1.Should().Be(2, "use of {} is considered invalid in because parameter with becauseArgs", + "additional becauseArgs argument"); +#pragma warning restore CA2241 + + // Assert + act.Should().Throw() + .WithMessage( + "*because message 'use of {} is considered invalid in because parameter with becauseArgs' could not be formatted with string.Format*"); + } + + [Fact] + public void Message_should_keep_parentheses_in_literal_values() + { + // Act + Action act = () => "{foo}".Should().Be("{bar}"); + + // Assert + act.Should().Throw() + .WithMessage("Expected string to be \"{bar}\", but \"{foo}\" differs near*"); + } + + [Fact] + public void Message_should_contain_literal_value_if_marked_with_double_parentheses() + { + // Act + Action act = () => AssertionChain.GetOrCreate().FailWith("{{empty}}"); + + // Assert + act.Should().ThrowExactly() + .WithMessage("{empty}*"); + } + + [InlineData("\r")] + [InlineData("\\r")] + [InlineData("\\\r")] + [InlineData("\\\\r")] + [InlineData("\\\\\r")] + [InlineData("\n")] + [InlineData("\\n")] + [InlineData("\\\n")] + [InlineData("\\\\n")] + [InlineData("\\\\\n")] + [Theory] + public void Message_should_not_have_modified_carriage_return_or_line_feed_control_characters(string str) + { + // Act + Action act = () => AssertionChain.GetOrCreate().FailWith(str); + + // Assert + act.Should().ThrowExactly() + .WithMessage(str); + } + + [InlineData("\r")] + [InlineData("\\r")] + [InlineData("\\\r")] + [InlineData(@"\\r")] + [InlineData("\\\\\r")] + [InlineData("\n")] + [InlineData("\\n")] + [InlineData("\\\n")] + [InlineData(@"\\n")] + [InlineData("\\\\\n")] + [Theory] + public void Message_should_not_have_modified_carriage_return_or_line_feed_control_characters_in_supplied_arguments( + string str) + { + // Act + Action act = () => AssertionChain.GetOrCreate().FailWith(@"\{0}\A", str); + + // Assert + act.Should().ThrowExactly() + .WithMessage("\\\"" + str + "\"\\A*"); + } + + [Fact] + public void Message_should_not_have_trailing_backslashes_removed_from_subject() + { + // Arrange / Act + Action act = () => "A\\".Should().Be("A"); + + // Assert + act.Should().Throw() + .WithMessage("""* near "\" *"""); + } + + [Fact] + public void Message_should_not_have_trailing_backslashes_removed_from_expectation() + { + // Arrange / Act + Action act = () => "A".Should().Be("A\\"); + + // Assert + act.Should().Throw() + .WithMessage("""* to be "A\" *"""); + } + + [Fact] + public void Message_should_have_reportable_values_appended_at_the_end() + { + // Arrange + var scope = new AssertionScope(); + scope.AddReportable("SomeKey", "SomeValue"); + scope.AddReportable("AnotherKey", "AnotherValue"); + + AssertionChain.GetOrCreate().FailWith("{SomeKey}{AnotherKey}"); + + // Act + Action act = scope.Dispose; + + // Assert + act.Should().ThrowExactly() + .WithMessage("*With SomeKey:\nSomeValue\nWith AnotherKey:\nAnotherValue"); + } + + [Fact] + public void Deferred_reportable_values_should_not_be_calculated_in_absence_of_failures() + { + // Arrange + var scope = new AssertionScope(); + var deferredValueInvoked = false; + + scope.AddReportable("MyKey", () => + { + deferredValueInvoked = true; + + return "MyValue"; + }); + + // Act + scope.Dispose(); + + // Assert + deferredValueInvoked.Should().BeFalse(); + } + + [Fact] + public void Message_should_start_with_the_defined_expectation() + { + // Act + Action act = () => + { + var assertion = AssertionChain.GetOrCreate(); + + assertion + .WithExpectation("Expectations are the root ", chain => chain + .ForCondition(false) + .FailWith("of disappointment")); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expectations are the root of disappointment"); + } + + [Fact] + public void Message_should_start_with_the_defined_expectation_and_arguments() + { + // Act + Action act = () => + { + var assertion = AssertionChain.GetOrCreate(); + + assertion + .WithExpectation("Expectations are the {0} ", "root", chain => chain.ForCondition(false) + .FailWith("of disappointment")); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expectations are the \"root\" of disappointment"); + } + + [Fact] + public void Message_should_contain_object_as_context_if_identifier_can_not_be_resolved() + { + // Act + Action act = () => AssertionChain.GetOrCreate() + .ForCondition(false) + .FailWith("Expected {context}"); + + // Assert + act.Should().Throw() + .WithMessage("Expected object"); + } + + [Fact] + public void Message_should_contain_the_fallback_value_as_context_if_identifier_can_not_be_resolved() + { + // Act + Action act = () => AssertionChain.GetOrCreate() + .ForCondition(false) + .FailWith("Expected {context:fallback}"); + + // Assert + act.Should().Throw() + .WithMessage("Expected fallback"); + } + + [Fact] + public void Message_should_contain_the_default_identifier_as_context_if_identifier_can_not_be_resolved() + { + // Act + Action act = () => AssertionChain.GetOrCreate() + .WithDefaultIdentifier("identifier") + .ForCondition(false) + .FailWith("Expected {context}"); + + // Assert + act.Should().Throw() + .WithMessage("Expected identifier"); + } + + [Fact] + public void Message_should_contain_the_reason_as_defined() + { + // Act + Action act = () => AssertionChain.GetOrCreate() + .BecauseOf("because reasons") + .FailWith("Expected{reason}"); + + // Assert + act.Should().Throw() + .WithMessage("Expected because reasons"); + } + + [Fact] + public void Message_should_contain_the_reason_as_defined_with_arguments() + { + // Act + Action act = () => AssertionChain.GetOrCreate() + .BecauseOf("because {0}", "reasons") + .FailWith("Expected{reason}"); + + // Assert + act.Should().Throw() + .WithMessage("Expected because reasons"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScope.ChainingApiSpecs.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScope.ChainingApiSpecs.cs deleted file mode 100644 index 11f21eae89..0000000000 --- a/Tests/FluentAssertions.Specs/Execution/AssertionScope.ChainingApiSpecs.cs +++ /dev/null @@ -1,588 +0,0 @@ -using System; -using FluentAssertions.Execution; -using Xunit; -using Xunit.Sdk; - -namespace FluentAssertions.Specs.Execution; - -/// -/// The chaining API specs. -/// -public partial class AssertionScopeSpecs -{ - [Fact] - public void When_the_previous_assertion_succeeded_it_should_not_affect_the_next_one() - { - bool succeeded = false; - - // Act - try - { - Execute.Assertion - .ForCondition(condition: true) - .FailWith("First assertion") - .Then - .FailWith("Second assertion"); - } - catch (Exception e) - { - // Assert - succeeded = e is XunitException xUnitException && xUnitException.Message.Contains("Second"); - } - - if (!succeeded) - { - throw new XunitException("Expected the second assertion to fail"); - } - } - - [Fact] - public void When_the_previous_assertion_succeeded_it_should_not_affect_the_next_one_with_arguments() - { - // Act - Action act = () => Execute.Assertion - .ForCondition(true) - .FailWith("First assertion") - .Then - .FailWith("Second {0}", "assertion"); - - // Assert - act.Should().Throw() - .WithMessage("Second \"assertion\""); - } - - [Fact] - public void When_the_previous_assertion_succeeded_it_should_not_affect_the_next_one_with_argument_providers() - { - // Act - Action act = () => Execute.Assertion - .ForCondition(true) - .FailWith("First assertion") - .Then - .FailWith("Second {0}", () => "assertion"); - - // Assert - act.Should().Throw() - .WithMessage("Second \"assertion\""); - } - - [Fact] - public void When_the_previous_assertion_succeeded_it_should_not_affect_the_next_one_with_a_fail_reason_function() - { - // Act - Action act = () => Execute.Assertion - .ForCondition(true) - .FailWith("First assertion") - .Then - .FailWith(() => new FailReason("Second {0}", "assertion")); - - // Assert - act.Should().Throw() - .WithMessage("Second \"assertion\""); - } - - [Fact] - public void When_continuing_an_assertion_chain_the_reason_should_be_part_of_consecutive_failures() - { - // Act - Action act = () => Execute.Assertion - .ForCondition(true) - .FailWith("First assertion") - .Then - .BecauseOf("because reasons") - .FailWith("Expected{reason}"); - - // Assert - act.Should().Throw() - .WithMessage("Expected because reasons"); - } - - [Fact] - public void When_continuing_an_assertion_chain_the_reason_with_arguments_should_be_part_of_consecutive_failures() - { - // Act - Action act = () => Execute.Assertion - .ForCondition(true) - .FailWith("First assertion") - .Then - .BecauseOf("because {0}", "reasons") - .FailWith("Expected{reason}"); - - // Assert - act.Should().Throw() - .WithMessage("Expected because reasons"); - } - - [Fact] - public void Passing_a_null_value_as_reason_does_not_fail() - { - // Act - Action act = () => Execute.Assertion - .BecauseOf(null, "only because for method disambiguity") - .ForCondition(false) - .FailWith("First assertion"); - - // Assert - act.Should().Throw() - .WithMessage("First assertion"); - } - - [Fact] - public void When_a_given_is_used_before_an_assertion_then_the_result_should_be_available_for_evaluation() - { - // Act - Action act = () => Execute.Assertion - .Given(() => new[] { "a", "b" }) - .ForCondition(collection => collection.Length > 0) - .FailWith("First assertion"); - - // Assert - act.Should().NotThrow(); - } - - [Fact] - public void When_the_previous_assertion_failed_it_should_not_evaluate_the_succeeding_given_statement() - { - // Arrange - using var _ = new AssertionScope(new IgnoringFailuresAssertionStrategy()); - - // Act / Assert - Execute.Assertion - .ForCondition(false) - .FailWith("First assertion") - .Then - .Given(() => throw new InvalidOperationException()); - } - - [Fact] - public void When_the_previous_assertion_failed_it_should_not_evaluate_the_succeeding_condition() - { - // Arrange - bool secondConditionEvaluated = false; - - try - { - using var _ = new AssertionScope(); - - // Act - Execute.Assertion - .Given(() => (string)null) - .ForCondition(s => s is not null) - .FailWith("but is was null") - .Then - .ForCondition(_ => secondConditionEvaluated = true) - .FailWith("it should be 42"); - } - catch - { - // Ignore - } - - // Assert - secondConditionEvaluated.Should().BeFalse("because the 2nd condition should not be invoked"); - } - - [Fact] - public void When_the_previous_assertion_failed_it_should_not_execute_the_succeeding_failure() - { - // Arrange - var scope = new AssertionScope(); - - // Act - Execute.Assertion - .ForCondition(false) - .FailWith("First assertion") - .Then - .ForCondition(false) - .FailWith("Second assertion"); - - string[] failures = scope.Discard(); - scope.Dispose(); - - Assert.Single(failures); - Assert.Contains("First assertion", failures); - } - - [Fact] - public void When_the_previous_assertion_failed_it_should_not_execute_the_succeeding_failure_with_arguments() - { - // Act - Action act = () => - { - using var _ = new AssertionScope(); - - Execute.Assertion - .ForCondition(false) - .FailWith("First assertion") - .Then - .FailWith("Second {0}", "assertion"); - }; - - // Assert - act.Should().Throw() - .WithMessage("First assertion"); - } - - [Fact] - public void When_the_previous_assertion_failed_it_should_not_execute_the_succeeding_failure_with_argument_providers() - { - // Act - Action act = () => - { - using var _ = new AssertionScope(); - - Execute.Assertion - .ForCondition(false) - .FailWith("First assertion") - .Then - .FailWith("Second {0}", () => "assertion"); - }; - - // Assert - act.Should().Throw() - .WithMessage("First assertion"); - } - - [Fact] - public void When_the_previous_assertion_failed_it_should_not_execute_the_succeeding_failure_with_a_fail_reason_function() - { - // Act - Action act = () => - { - using var _ = new AssertionScope(); - - Execute.Assertion - .ForCondition(false) - .FailWith("First assertion") - .Then - .FailWith(() => new FailReason("Second {0}", "assertion")); - }; - - // Assert - act.Should().Throw() - .WithMessage("First assertion"); - } - - [Fact] - public void When_the_previous_assertion_failed_it_should_not_execute_the_succeeding_expectation() - { - // Act - Action act = () => - { - using var _ = new AssertionScope(); - - Execute.Assertion - .WithExpectation("Expectations are the root ") - .ForCondition(false) - .FailWith("of disappointment") - .Then - .WithExpectation("Assumptions are the root ") - .FailWith("of all evil"); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expectations are the root of disappointment"); - } - - [Fact] - public void When_the_previous_assertion_failed_it_should_not_execute_the_succeeding_expectation_with_arguments() - { - // Act - Action act = () => - { - using var _ = new AssertionScope(); - - Execute.Assertion - .WithExpectation("Expectations are the {0} ", "root") - .ForCondition(false) - .FailWith("of disappointment") - .Then - .WithExpectation("Assumptions are the {0} ", "root") - .FailWith("of all evil"); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expectations are the \"root\" of disappointment"); - } - - [Fact] - public void When_the_previous_assertion_failed_it_should_not_execute_the_succeeding_default_identifier() - { - // Act - Action act = () => - { - using var _ = new AssertionScope(); - - Execute.Assertion - .WithDefaultIdentifier("identifier") - .ForCondition(false) - .FailWith("Expected {context}") - .Then - .WithDefaultIdentifier("other") - .FailWith("Expected {context}"); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expected identifier"); - } - - [Fact] - public void When_continuing_a_failed_assertion_chain_consecutive_resons_are_ignored() - { - // Act - Action act = () => - { - using var _ = new AssertionScope(); - - Execute.Assertion - .BecauseOf("because {0}", "whatever") - .ForCondition(false) - .FailWith("Expected{reason}") - .Then - .BecauseOf("because reasons") - .FailWith("Expected{reason}"); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expected because whatever"); - } - - [Fact] - public void When_continuing_a_failed_assertion_chain_consecutive_resons_with_arguments_are_ignored() - { - // Act - Action act = () => - { - using var _ = new AssertionScope(); - - Execute.Assertion - .BecauseOf("because {0}", "whatever") - .ForCondition(false) - .FailWith("Expected{reason}") - .Then - .BecauseOf("because {0}", "reasons") - .FailWith("Expected{reason}"); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expected because whatever"); - } - - [Fact] - public void When_the_previous_assertion_succeeded_it_should_evaluate_the_succeeding_given_statement() - { - // Act - Action act = () => Execute.Assertion - .ForCondition(true) - .FailWith("First assertion") - .Then - .Given(() => throw new InvalidOperationException()); - - // Assert - Assert.Throws(act); - } - - [Fact] - public void When_the_previous_assertion_succeeded_it_should_not_affect_the_succeeding_expectation() - { - // Act - Action act = () => Execute.Assertion - .WithExpectation("Expectations are the root ") - .ForCondition(true) - .FailWith("of disappointment") - .Then - .WithExpectation("Assumptions are the root ") - .FailWith("of all evil"); - - // Assert - act.Should().Throw() - .WithMessage("Assumptions are the root of all evil"); - } - - [Fact] - public void When_the_previous_assertion_succeeded_it_should_not_affect_the_succeeding_expectation_with_arguments() - { - // Act - Action act = () => Execute.Assertion - .WithExpectation("Expectations are the {0} ", "root") - .ForCondition(true) - .FailWith("of disappointment") - .Then - .WithExpectation("Assumptions are the {0} ", "root") - .FailWith("of all evil"); - - // Assert - act.Should().Throw() - .WithMessage("Assumptions are the \"root\" of all evil"); - } - - [Fact] - public void When_the_previous_assertion_succeeded_it_should_not_affect_the_succeeding_default_identifier() - { - // Act - Action act = () => - { - Execute.Assertion - .WithDefaultIdentifier("identifier") - .ForCondition(true) - .FailWith("Expected {context}") - .Then - .WithDefaultIdentifier("other") - .FailWith("Expected {context}"); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expected other"); - } - - [Fact] - public void Continuing_an_assertion_with_occurrence() - { - // Act - Action act = () => Execute.Assertion - .ForCondition(true) - .FailWith("First assertion") - .Then - .WithExpectation("{expectedOccurrence} ") - .ForConstraint(Exactly.Once(), 2) - .FailWith("Second {0}", "assertion"); - - // Assert - act.Should().Throw() - .WithMessage("Exactly 1 time Second \"assertion\"*"); - } - - [Fact] - public void Continuing_an_assertion_with_occurrence_will_not_be_executed_when_first_assertion_fails() - { - // Act - Action act = () => Execute.Assertion - .ForCondition(false) - .FailWith("First assertion") - .Then - .WithExpectation("{expectedOccurrence} ") - .ForConstraint(Exactly.Once(), 2) - .FailWith("Second {0}", "assertion"); - - // Assert - act.Should().Throw() - .WithMessage("First assertion"); - } - - [Fact] - public void Continuing_an_assertion_with_occurrence_overrides_the_previous_defined_expectations() - { - // Act - Action act = () => Execute.Assertion - .WithExpectation("First expectation") - .ForCondition(true) - .FailWith("First assertion") - .Then - .WithExpectation("{expectedOccurrence} ") - .ForConstraint(Exactly.Once(), 2) - .FailWith("Second {0}", "assertion"); - - // Assert - act.Should().Throw() - .WithMessage("Exactly 1 time Second \"assertion\"*"); - } - - [Fact] - public void Continuing_an_assertion_after_occurrence_check_works() - { - // Act - Action act = () => Execute.Assertion - .WithExpectation("{expectedOccurrence} ") - .ForConstraint(Exactly.Once(), 1) - .FailWith("First assertion") - .Then - .WithExpectation("Second expectation ") - .ForCondition(false) - .FailWith("Second {0}", "assertion"); - - // Assert - act.Should().Throw() - .WithMessage("Second expectation Second \"assertion\"*"); - } - - [Fact] - public void Continuing_an_assertion_with_occurrence_check_before_defining_expectation_works() - { - // Act - Action act = () => Execute.Assertion - .ForCondition(true) - .FailWith("First assertion") - .Then - .ForConstraint(Exactly.Once(), 2) - .WithExpectation("Second expectation ") - .FailWith("Second {0}", "assertion"); - - // Assert - act.Should().Throw() - .WithMessage("Second expectation Second \"assertion\"*"); - } - - [Fact] - public void Does_not_continue_a_chained_assertion_after_the_first_one_failed_the_occurrence_check() - { - // Arrange - var scope = new AssertionScope(); - - // Act - Execute.Assertion - .ForConstraint(Exactly.Once(), 2) - .FailWith("First {0}", "assertion") - .Then - .ForConstraint(Exactly.Once(), 2) - .FailWith("Second {0}", "assertion"); - - string[] failures = scope.Discard(); - scope.Dispose(); - - // Assert - Assert.Single(failures); - Assert.Contains("First \"assertion\"", failures); - } - - [Fact] - public void Discard_a_scope_after_continuing_chained_assertion() - { - // Arrange - using var scope = new AssertionScope(); - - // Act - var failures = Execute.Assertion - .ForConstraint(Exactly.Once(), 2) - .FailWith("First {0}", "assertion") - .Then - .Discard(); - - // Assert - Assert.Single(failures); - Assert.Contains("First \"assertion\"", failures); - } - - [Fact] - public void Get_info_about_line_breaks_from_parent_scope_after_continuing_chained_assertion() - { - // Arrange - using var scope = new AssertionScope(); - scope.FormattingOptions.UseLineBreaks = true; - - // Act - var innerScope = Execute.Assertion - .ForConstraint(Exactly.Once(), 1) - .FailWith("First {0}", "assertion") - .Then - .UsingLineBreaks; - - // Assert - innerScope.UsingLineBreaks.Should().Be(scope.UsingLineBreaks); - } -} diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScope.ContextDataSpecs.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScope.ContextDataSpecs.cs deleted file mode 100644 index 1a36fb62bc..0000000000 --- a/Tests/FluentAssertions.Specs/Execution/AssertionScope.ContextDataSpecs.cs +++ /dev/null @@ -1,68 +0,0 @@ -using FluentAssertions.Execution; -using Xunit; - -namespace FluentAssertions.Specs.Execution; - -/// -/// The chaining API specs. -/// -public partial class AssertionScopeSpecs -{ - [Fact] - public void Get_value_when_key_is_present() - { - // Arrange - var scope = new AssertionScope(); - scope.AddNonReportable("SomeKey", "SomeValue"); - scope.AddNonReportable("SomeOtherKey", "SomeOtherValue"); - - // Act - var value = scope.Get("SomeKey"); - - // Assert - value.Should().Be("SomeValue"); - } - - [Fact] - public void Get_default_value_when_key_is_not_present() - { - // Arrange - var scope = new AssertionScope(); - - // Act - var value = scope.Get("SomeKey"); - - // Assert - value.Should().Be(0); - } - - [Fact] - public void Get_default_value_when_nullable_value_is_null() - { - // Arrange - var scope = new AssertionScope(); - - int? someValue = null; - scope.AddNonReportable("SomeKey", someValue); - - // Act - var value = scope.Get("SomeKey"); - - // Assert - value.Should().Be(0); - } - - [Fact] - public void Value_should_be_of_requested_type() - { - // Arrange - var scope = new AssertionScope(); - scope.AddNonReportable("SomeKey", "SomeValue"); - - // Act - var value = scope.Get("SomeKey"); - - // Assert - value.Should().BeOfType(); - } -} diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs deleted file mode 100644 index 4dcd1d7af9..0000000000 --- a/Tests/FluentAssertions.Specs/Execution/AssertionScope.MessageFormatingSpecs.cs +++ /dev/null @@ -1,522 +0,0 @@ -using System; -using System.Collections.Generic; -using FluentAssertions.Execution; -using Xunit; -using Xunit.Sdk; - -namespace FluentAssertions.Specs.Execution; - -/// -/// The message formatting specs. -/// -public partial class AssertionScopeSpecs -{ - [Fact] - public void When_the_same_failure_is_handled_twice_or_more_it_should_still_report_it_once() - { - // Arrange - var scope = new AssertionScope(); - - AssertionScope.Current.FailWith("Failure"); - AssertionScope.Current.FailWith("Failure"); - - using (var nestedScope = new AssertionScope()) - { - nestedScope.FailWith("Failure"); - nestedScope.FailWith("Failure"); - } - - // Act - Action act = scope.Dispose; - - // Assert - act.Should().Throw() - .Which.Message.Should().Contain("Failure", Exactly.Times(4)); - } - - [InlineData("foo")] - [InlineData("{}")] - [Theory] - public void Message_should_use_the_name_of_the_scope_as_context(string context) - { - // Act - Action act = () => - { - using var _ = new AssertionScope(context); - new[] { 1, 2, 3 }.Should().Equal(3, 2, 1); - }; - - // Assert - act.Should().Throw() - .WithMessage($"Expected {context} to be equal to*"); - } - - [Fact] - public void Message_should_use_the_lazy_name_of_the_scope_as_context() - { - // Act - Action act = () => - { - using var _ = new AssertionScope(new Lazy(() => "lazy foo")); - new[] { 1, 2, 3 }.Should().Equal(3, 2, 1); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expected lazy foo to be equal to*"); - } - - [Fact] - public void Nested_scopes_use_the_name_of_their_outer_scope_as_context() - { - // Act - Action act = () => - { - using var outerScope = new AssertionScope("outer"); - using var innerScope = new AssertionScope("inner"); - new[] { 1, 2, 3 }.Should().Equal(3, 2, 1); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expected outer/inner to be equal to*"); - } - - [Fact] - public void The_inner_scope_is_used_when_the_outer_scope_does_not_have_a_context() - { - // Act - Action act = () => - { - using var outerScope = new AssertionScope(); - using var innerScope = new AssertionScope("inner"); - new[] { 1, 2, 3 }.Should().Equal(3, 2, 1); - }; - - // Assert - act.Should().Throw() - .WithMessage("Expected inner to be equal to*"); - } - - [Fact] - public void Message_should_contain_each_unique_failed_assertion_seperately() - { - // Act - Action act = () => - { - using var _ = new AssertionScope(); - var values = new Dictionary(); - values.Should().ContainKey(0); - values.Should().ContainKey(1); - }; - - // Assert - act.Should().Throw() - .WithMessage( - "Expected * to contain key 0.\n" + - "Expected * to contain key 1.\n"); - } - - [Fact] - public void Message_should_contain_the_same_failed_assertion_seperately_if_called_multiple_times() - { - // Act - Action act = () => - { - using var _ = new AssertionScope(); - var values = new List(); - values.Should().ContainSingle(); - values.Should().ContainSingle(); - }; - - // Assert - act.Should().Throw() - .WithMessage( - "Expected * to contain a single item, but the collection is empty.\n" + - "Expected * to contain a single item, but the collection is empty.\n"); - } - - [Fact] - public void Because_reason_should_keep_parentheses_in_arguments_as_literals() - { - // Act - Action act = () => 1.Should().Be(2, "can't use these in becauseArgs: {0} {1}", "{", "}"); - - // Assert - act.Should().Throw() - .WithMessage("*because can't use these in becauseArgs: { }*"); - } - - [Fact] - public void Because_reason_should_ignore_undefined_arguments() - { - // Act - object[] becauseArgs = null; - - // ReSharper disable once FormatStringProblem - Action act = () => 1.Should().Be(2, "it should still work", becauseArgs); - - // Assert - act.Should().Throw() - .WithMessage("*because it should still work*"); - } - - [Fact] - public void Because_reason_should_threat_parentheses_as_literals_if_no_arguments_are_defined() - { - // Act -#pragma warning disable CA2241 - // ReSharper disable once FormatStringProblem - Action act = () => 1.Should().Be(2, "use of {} is okay if there are no because arguments"); -#pragma warning restore CA2241 - - // Assert - act.Should().Throw() - .WithMessage("*because use of {} is okay if there are no because arguments*"); - } - - [Fact] - public void Because_reason_should_inform_about_invalid_parentheses_with_a_default_message() - { - // Act -#pragma warning disable CA2241 - // ReSharper disable once FormatStringProblem - Action act = () => 1.Should().Be(2, "use of {} is considered invalid in because parameter with becauseArgs", - "additional becauseArgs argument"); -#pragma warning restore CA2241 - - // Assert - act.Should().Throw() - .WithMessage( - "*because message 'use of {} is considered invalid in because parameter with becauseArgs' could not be formatted with string.Format*"); - } - - [Fact] - public void Message_should_keep_parentheses_in_literal_values() - { - // Act - Action act = () => "{foo}".Should().Be("{bar}"); - - // Assert - act.Should().Throw() - .WithMessage("Expected string to be \"{bar}\", but \"{foo}\" differs near*"); - } - - [Fact] - public void Message_should_contain_literal_value_if_marked_with_double_parentheses() - { - // Arrange - var scope = new AssertionScope("context"); - - AssertionScope.Current.FailWith("{{empty}}"); - - // Act - Action act = scope.Dispose; - - // Assert - act.Should().ThrowExactly() - .WithMessage("{empty}*"); - } - - [InlineData("\r")] - [InlineData("\\r")] - [InlineData("\\\r")] - [InlineData("\\\\r")] - [InlineData("\\\\\r")] - [InlineData("\n")] - [InlineData("\\n")] - [InlineData("\\\n")] - [InlineData("\\\\n")] - [InlineData("\\\\\n")] - [Theory] - public void Message_should_not_have_modified_carriage_return_or_line_feed_control_characters(string str) - { - // Arrange - var scope = new AssertionScope(); - - AssertionScope.Current.FailWith(str); - - // Act - Action act = scope.Dispose; - - // Assert - act.Should().ThrowExactly() - .WithMessage(str); - } - - [InlineData("\r")] - [InlineData("\\r")] - [InlineData("\\\r")] - [InlineData(@"\\r")] - [InlineData("\\\\\r")] - [InlineData("\n")] - [InlineData("\\n")] - [InlineData("\\\n")] - [InlineData(@"\\n")] - [InlineData("\\\\\n")] - [Theory] - public void Message_should_not_have_modified_carriage_return_or_line_feed_control_characters_in_supplied_arguments(string str) - { - // Arrange - var scope = new AssertionScope(); - - AssertionScope.Current.FailWith(@"\{0}\A", str); - - // Act - Action act = scope.Dispose; - - // Assert - act.Should().ThrowExactly() - .WithMessage("\\\"" + str + "\"\\A*"); - } - - [Fact] - public void Message_should_not_have_trailing_backslashes_removed_from_subject() - { - // Arrange / Act - Action act = () => "A\\".Should().Be("A"); - - // Assert - act.Should().Throw() - .WithMessage("""* near "\" *"""); - } - - [Fact] - public void Message_should_not_have_trailing_backslashes_removed_from_expectation() - { - // Arrange / Act - Action act = () => "A".Should().Be("A\\"); - - // Assert - act.Should().Throw() - .WithMessage("""* to be "A\" *"""); - } - - [Fact] - public void Message_should_have_named_placeholder_be_replaced_by_reportable_value() - { - // Arrange - var scope = new AssertionScope(); - scope.AddReportable("MyKey", "MyValue"); - - AssertionScope.Current.FailWith("{MyKey}"); - - // Act - Action act = scope.Dispose; - - // Assert - act.Should().ThrowExactly() - .WithMessage("MyValue*"); - } - - [Fact] - public void Message_should_have_named_placeholders_be_replaced_by_reportable_values() - { - // Arrange - var scope = new AssertionScope(); - scope.AddReportable("SomeKey", "SomeValue"); - scope.AddReportable("AnotherKey", "AnotherValue"); - - AssertionScope.Current.FailWith("{SomeKey}{AnotherKey}"); - - // Act - Action act = scope.Dispose; - - // Assert - act.Should().ThrowExactly() - .WithMessage("SomeValueAnotherValue*"); - } - - [Fact] - public void Message_should_have_reportable_values_appended_at_the_end() - { - // Arrange - var scope = new AssertionScope(); - scope.AddReportable("SomeKey", "SomeValue"); - scope.AddReportable("AnotherKey", "AnotherValue"); - - AssertionScope.Current.FailWith("{SomeKey}{AnotherKey}"); - - // Act - Action act = scope.Dispose; - - // Assert - act.Should().ThrowExactly() - .WithMessage("*With SomeKey:\nSomeValue\nWith AnotherKey:\nAnotherValue"); - } - - [Fact] - public void Message_should_not_have_nonreportable_values_appended_at_the_end() - { - // Arrange - var scope = new AssertionScope(); - scope.AddNonReportable("SomeKey", "SomeValue"); - - AssertionScope.Current.FailWith("{SomeKey}"); - - // Act - Action act = scope.Dispose; - - // Assert - act.Should().ThrowExactly() - .Which.Message.Should().NotContain("With SomeKey:\nSomeValue"); - } - - [Fact] - public void Message_should_have_named_placeholder_be_replaced_by_nonreportable_value() - { - // Arrange - var scope = new AssertionScope(); - scope.AddNonReportable("SomeKey", "SomeValue"); - - AssertionScope.Current.FailWith("{SomeKey}"); - - // Act - Action act = scope.Dispose; - - // Assert - act.Should().ThrowExactly() - .WithMessage("SomeValue"); - } - - [Fact] - public void Deferred_reportable_values_should_not_be_calculated_in_absence_of_failures() - { - // Arrange - var scope = new AssertionScope(); - var deferredValueInvoked = false; - - scope.AddReportable("MyKey", () => - { - deferredValueInvoked = true; - - return "MyValue"; - }); - - // Act - scope.Dispose(); - - // Assert - deferredValueInvoked.Should().BeFalse(); - } - - [Fact] - public void Message_should_have_named_placeholder_be_replaced_by_defered_reportable_value() - { - // Arrange - var scope = new AssertionScope(); - var deferredValueInvoked = false; - - scope.AddReportable("MyKey", () => - { - deferredValueInvoked = true; - - return "MyValue"; - }); - - AssertionScope.Current.FailWith("{MyKey}"); - - // Act - Action act = scope.Dispose; - - // Assert - act.Should().ThrowExactly() - .WithMessage("MyValue*\n\nWith MyKey:\nMyValue\n"); - - deferredValueInvoked.Should().BeTrue(); - } - - [Fact] - public void Message_should_start_with_the_defined_expectation() - { - // Act - Action act = () => Execute.Assertion - .WithExpectation("Expectations are the root ") - .ForCondition(false) - .FailWith("of disappointment"); - - // Assert - act.Should().Throw() - .WithMessage("Expectations are the root of disappointment"); - } - - [Fact] - public void Message_should_start_with_the_defined_expectation_and_arguments() - { - // Act - Action act = () => Execute.Assertion - .WithExpectation("Expectations are the {0} ", "root") - .ForCondition(false) - .FailWith("of disappointment"); - - // Assert - act.Should().Throw() - .WithMessage("Expectations are the \"root\" of disappointment"); - } - - [Fact] - public void Message_should_contain_object_as_context_if_identifier_can_not_be_resolved() - { - // Act - Action act = () => Execute.Assertion - .ForCondition(false) - .FailWith("Expected {context}"); - - // Assert - act.Should().Throw() - .WithMessage("Expected object"); - } - - [Fact] - public void Message_should_contain_the_fallback_value_as_context_if_identifier_can_not_be_resolved() - { - // Act - Action act = () => Execute.Assertion - .ForCondition(false) - .FailWith("Expected {context:fallback}"); - - // Assert - act.Should().Throw() - .WithMessage("Expected fallback"); - } - - [Fact] - public void Message_should_contain_the_default_identifier_as_context_if_identifier_can_not_be_resolved() - { - // Act - Action act = () => Execute.Assertion - .WithDefaultIdentifier("identifier") - .ForCondition(false) - .FailWith("Expected {context}"); - - // Assert - act.Should().Throw() - .WithMessage("Expected identifier"); - } - - [Fact] - public void Message_should_contain_the_reason_as_defined() - { - // Act - Action act = () => Execute.Assertion - .BecauseOf("because reasons") - .FailWith("Expected{reason}"); - - // Assert - act.Should().Throw() - .WithMessage("Expected because reasons"); - } - - [Fact] - public void Message_should_contain_the_reason_as_defined_with_arguments() - { - // Act - Action act = () => Execute.Assertion - .BecauseOf("because {0}", "reasons") - .FailWith("Expected{reason}"); - - // Assert - act.Should().Throw() - .WithMessage("Expected because reasons"); - } -} diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScope.ScopedFormatters.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.ScopedFormatters.cs similarity index 100% rename from Tests/FluentAssertions.Specs/Execution/AssertionScope.ScopedFormatters.cs rename to Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.ScopedFormatters.cs diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs index 931c352e65..32d48f1360 100644 --- a/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs @@ -24,7 +24,7 @@ public void When_disposed_it_should_throw_any_failures() // Arrange var scope = new AssertionScope(); - AssertionScope.Current.FailWith("Failure1"); + AssertionChain.GetOrCreate().FailWith("Failure1"); // Act Action act = scope.Dispose; @@ -46,7 +46,7 @@ public void When_disposed_it_should_throw_any_failures_and_properly_format_using // Arrange var scope = new AssertionScope(); - AssertionScope.Current.FailWith("Failure{0}", 1); + AssertionChain.GetOrCreate().FailWith("Failure{0}", 1); // Act Action act = scope.Dispose; @@ -69,7 +69,7 @@ public void When_lazy_version_is_not_disposed_it_should_not_execute_fail_reason_ var scope = new AssertionScope(); bool failReasonCalled = false; - AssertionScope.Current + AssertionChain.GetOrCreate() .ForCondition(true) .FailWith(() => { @@ -91,7 +91,9 @@ public void When_lazy_version_is_disposed_it_should_throw_any_failures_and_prope // Arrange var scope = new AssertionScope(); - AssertionScope.Current.FailWith(() => new FailReason("Failure{0}", 1)); + AssertionChain + .GetOrCreate() + .FailWith(() => new FailReason("Failure{0}", 1)); // Act Action act = scope.Dispose; @@ -113,14 +115,14 @@ public void When_multiple_scopes_are_nested_it_should_throw_all_failures_from_th // Arrange var scope = new AssertionScope(); - AssertionScope.Current.FailWith("Failure1"); + AssertionChain.GetOrCreate().FailWith("Failure1"); - using (var nestedScope = new AssertionScope()) + using (new AssertionScope()) { - nestedScope.FailWith("Failure2"); + AssertionChain.GetOrCreate().FailWith("Failure2"); using var deeplyNestedScope = new AssertionScope(); - deeplyNestedScope.FailWith("Failure3"); + AssertionChain.GetOrCreate().FailWith("Failure3"); } // Act @@ -143,14 +145,14 @@ public void When_a_nested_scope_is_discarded_its_failures_should_also_be_discard // Arrange var scope = new AssertionScope(); - AssertionScope.Current.FailWith("Failure1"); + AssertionChain.GetOrCreate().FailWith("Failure1"); - using (var nestedScope = new AssertionScope()) + using (new AssertionScope()) { - nestedScope.FailWith("Failure2"); + AssertionChain.GetOrCreate().FailWith("Failure2"); using var deeplyNestedScope = new AssertionScope(); - deeplyNestedScope.FailWith("Failure3"); + AssertionChain.GetOrCreate().FailWith("Failure3"); deeplyNestedScope.Discard(); } @@ -170,7 +172,7 @@ public void When_a_nested_scope_is_discarded_its_failures_should_also_be_discard } [Fact] - public async Task When_using_AssertionScope_across_thread_boundaries_it_should_work() + public async Task When_using_a_scope_across_thread_boundaries_it_should_work() { using var semaphore = new SemaphoreSlim(0, 1); await Task.WhenAll(SemaphoreYieldAndWait(semaphore), SemaphoreYieldAndRelease(semaphore)); @@ -196,10 +198,10 @@ private static async Task SemaphoreYieldAndRelease(SemaphoreSlim semaphore) public void When_custom_strategy_used_respect_its_behavior() { // Arrange - var scope = new AssertionScope(new FailWithStupidMessageAssertionStrategy()); + using var _ = new AssertionScope(new FailWithStupidMessageAssertionStrategy()); // Act - Action act = () => scope.FailWith("Failure 1"); + Action act = () => AssertionChain.GetOrCreate().FailWith("Failure 1"); // Assert act.Should().ThrowExactly() @@ -240,7 +242,7 @@ public void When_using_a_custom_strategy_it_should_include_failure_messages_of_a public void When_nested_scope_is_disposed_it_passes_reports_to_parent_scope() { // Arrange/Act - using var outerScope = new AssertionScope(); + var outerScope = new AssertionScope(); outerScope.AddReportable("outerReportable", "foo"); using (var innerScope = new AssertionScope()) @@ -248,8 +250,13 @@ public void When_nested_scope_is_disposed_it_passes_reports_to_parent_scope() innerScope.AddReportable("innerReportable", "bar"); } + AssertionChain.GetOrCreate().FailWith("whatever reason"); + + Action act = () => outerScope.Dispose(); + // Assert - outerScope.Get("innerReportable").Should().Be("bar"); + act.Should().Throw() + .Which.Message.Should().Match("Whatever reason*outerReportable*foo*innerReportable*bar*"); } [Fact] @@ -286,6 +293,25 @@ public void Formatting_options_passed_to_inner_assertion_scopes() .Which.Should().Contain("Maximum recursion depth of 1 was reached"); } + [Fact] + public void Multiple_named_scopes_will_prefix_the_caller_identifier() + { + // Arrange + List nonEmptyList = [1, 2]; + + // Act + Action act = () => + { + using var scope1 = new AssertionScope("Test1"); + using var scope2 = new AssertionScope("Test2"); + nonEmptyList.Should().BeEmpty(); + }; + + // Assert + act.Should().Throw() + .WithMessage("Expected Test1/Test2/nonEmptyList to be empty*"); + } + public class CustomAssertionStrategy : IAssertionStrategy { private readonly List failureMessages = []; @@ -326,12 +352,12 @@ public void HandleFailure(string message) internal class FailWithStupidMessageAssertionStrategy : IAssertionStrategy { - public IEnumerable FailureMessages => new string[0]; + public IEnumerable FailureMessages => []; public void HandleFailure(string message) => Services.ThrowException("Good luck with understanding what's going on!"); - public IEnumerable DiscardFailures() => new string[0]; + public IEnumerable DiscardFailures() => []; public void ThrowIfAny(IDictionary context) { diff --git a/Tests/FluentAssertions.Specs/Execution/CallerIdentifierSpecs.cs b/Tests/FluentAssertions.Specs/Execution/CallerIdentificationSpecs.cs similarity index 93% rename from Tests/FluentAssertions.Specs/Execution/CallerIdentifierSpecs.cs rename to Tests/FluentAssertions.Specs/Execution/CallerIdentificationSpecs.cs index c508ade7c9..564ad48dea 100644 --- a/Tests/FluentAssertions.Specs/Execution/CallerIdentifierSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/CallerIdentificationSpecs.cs @@ -14,36 +14,37 @@ // ReSharper disable RedundantStringInterpolation namespace FluentAssertions.Specs.Execution { - public class CallerIdentifierSpecs + public class CallerIdentificationSpecs { [Fact] - public void When_namespace_is_exactly_System_caller_should_be_unknown() + public void Types_in_the_system_namespace_are_excluded_from_identification() { // Act - Action act = () => SystemNamespaceClass.DetermineCallerIdentityInNamespace(); + Action act = () => SystemNamespaceClass.AssertAgainstFailure(); // Assert - act.Should().Throw().WithMessage("Expected function to be*"); + act.Should().Throw().WithMessage("Expected object*", + "because a subject in a system namespace should not be ignored by caller identification"); } [Fact] - public void When_namespace_is_nested_under_System_caller_should_be_unknown() + public void Types_in_a_namespace_nested_under_system_are_excluded_from_identification() { // Act - Action act = () => System.Data.NestedSystemNamespaceClass.DetermineCallerIdentityInNamespace(); + Action act = () => System.Data.NestedSystemNamespaceClass.AssertAgainstFailure(); // Assert - act.Should().Throw().WithMessage("Expected function to be*"); + act.Should().Throw().WithMessage("Expected object*"); } [Fact] - public void When_namespace_is_prefixed_with_System_caller_should_be_known() + public void Types_in_a_namespace_prefixed_with_system_are_excluded_from_identification() { // Act - Action act = () => SystemPrefixed.SystemPrefixedNamespaceClass.DetermineCallerIdentityInNamespace(); + Action act = () => SystemPrefixed.SystemPrefixedNamespaceClass.AssertAgainstFailure(); // Assert - act.Should().Throw().WithMessage("Expected actualCaller to be*"); + act.Should().Throw().WithMessage("Expected actualCaller*"); } [Fact] @@ -570,7 +571,7 @@ 5. Test } [CustomAssertion] - private string GetSubjectId() => AssertionScope.Current.CallerIdentity; + private string GetSubjectId() => AssertionChain.GetOrCreate().CallerIdentifier; } #pragma warning disable IDE0060, RCS1163 // Remove unused parameter @@ -605,10 +606,10 @@ namespace System { public static class SystemNamespaceClass { - public static void DetermineCallerIdentityInNamespace() + public static void AssertAgainstFailure() { - Func actualCaller = () => AssertionScope.Current.CallerIdentity; - actualCaller.Should().BeNull("we want this check to fail for the test"); + object actualCaller = null; + actualCaller.Should().NotBeNull("because we want this to fail and not return the name of the subject"); } } } @@ -617,10 +618,10 @@ namespace SystemPrefixed { public static class SystemPrefixedNamespaceClass { - public static void DetermineCallerIdentityInNamespace() + public static void AssertAgainstFailure() { - Func actualCaller = () => AssertionScope.Current.CallerIdentity; - actualCaller.Should().BeNull("we want this check to fail for the test"); + object actualCaller = null; + actualCaller.Should().NotBeNull("because we want this to fail and return the name of the subject"); } } } @@ -629,10 +630,10 @@ namespace System.Data { public static class NestedSystemNamespaceClass { - public static void DetermineCallerIdentityInNamespace() + public static void AssertAgainstFailure() { - Func actualCaller = () => AssertionScope.Current.CallerIdentity; - actualCaller.Should().BeNull("we want this check to fail for the test"); + object actualCaller = null; + actualCaller.Should().NotBeNull("because we want this to fail and not return the name of the subject"); } } } diff --git a/Tests/FluentAssertions.Specs/Execution/GivenSelectorSpecs.cs b/Tests/FluentAssertions.Specs/Execution/GivenSelectorSpecs.cs index d9808ab3f2..3209ccddbb 100644 --- a/Tests/FluentAssertions.Specs/Execution/GivenSelectorSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/GivenSelectorSpecs.cs @@ -14,7 +14,7 @@ public void A_consecutive_subject_should_be_selected() string value = string.Empty; // Act - Execute.Assertion + AssertionChain.GetOrCreate() .ForCondition(true) .Given(() => "First selector") .Given(_ => value = "Second selector"); @@ -30,7 +30,7 @@ public void After_a_failed_condition_a_consecutive_subject_should_be_ignored() string value = string.Empty; // Act - Execute.Assertion + AssertionChain.GetOrCreate() .ForCondition(false) .Given(() => "First selector") .Given(_ => value = "Second selector"); @@ -43,7 +43,7 @@ public void After_a_failed_condition_a_consecutive_subject_should_be_ignored() public void A_consecutive_condition_should_be_evaluated() { // Act / Assert - Execute.Assertion + AssertionChain.GetOrCreate() .ForCondition(true) .Given(() => "Subject") .ForCondition(_ => true) @@ -54,7 +54,7 @@ public void A_consecutive_condition_should_be_evaluated() public void After_a_failed_condition_a_consecutive_condition_should_be_ignored() { // Act - Action act = () => Execute.Assertion + Action act = () => AssertionChain.GetOrCreate() .ForCondition(false) .Given(() => "Subject") .ForCondition(_ => throw new ApplicationException()) @@ -68,7 +68,7 @@ public void After_a_failed_condition_a_consecutive_condition_should_be_ignored() public void When_continuing_an_assertion_chain_it_fails_with_a_message_after_selecting_the_subject() { // Act - Action act = () => Execute.Assertion + Action act = () => AssertionChain.GetOrCreate() .ForCondition(true) .Given(() => "First") .FailWith("First selector") @@ -85,7 +85,7 @@ public void When_continuing_an_assertion_chain_it_fails_with_a_message_after_sel public void When_continuing_an_assertion_chain_it_fails_with_a_message_with_arguments_after_selecting_the_subject() { // Act - Action act = () => Execute.Assertion + Action act = () => AssertionChain.GetOrCreate() .ForCondition(true) .Given(() => "First") .FailWith("{0} selector", "First") @@ -102,7 +102,7 @@ public void When_continuing_an_assertion_chain_it_fails_with_a_message_with_argu public void When_continuing_an_assertion_chain_it_fails_with_a_message_with_argument_selectors_after_selecting_the_subject() { // Act - Action act = () => Execute.Assertion + Action act = () => AssertionChain.GetOrCreate() .ForCondition(true) .Given(() => "First") .FailWith("{0} selector", _ => "First") @@ -123,7 +123,7 @@ public void When_continuing_a_failed_assertion_chain_consecutive_failure_message { using var _ = new AssertionScope(); - Execute.Assertion + AssertionChain.GetOrCreate() .Given(() => "First") .FailWith("First selector") .Then @@ -143,7 +143,7 @@ public void When_continuing_a_failed_assertion_chain_consecutive_failure_message { using var _ = new AssertionScope(); - Execute.Assertion + AssertionChain.GetOrCreate() .Given(() => "First") .FailWith("{0} selector", "First") .Then @@ -163,7 +163,7 @@ public void When_continuing_a_failed_assertion_chain_consecutive_failure_message { using var _ = new AssertionScope(); - Execute.Assertion + AssertionChain.GetOrCreate() .Given(() => "First") .FailWith("{0} selector", _ => "First") .Then @@ -179,10 +179,13 @@ public void When_continuing_a_failed_assertion_chain_consecutive_failure_message public void The_failure_message_should_be_preceded_by_the_expectation_after_selecting_a_subject() { // Act - Action act = () => Execute.Assertion - .WithExpectation("Expectation ") - .Given(() => "Subject") - .FailWith("Failure"); + Action act = () => + { + AssertionChain.GetOrCreate() + .WithExpectation("Expectation ", chain => chain + .Given(() => "Subject") + .FailWith("Failure")); + }; // Assert act.Should().Throw() @@ -194,12 +197,14 @@ public void The_failure_message_should_not_be_preceded_by_the_expectation_after_selecting_a_subject_and_clearing_the_expectation() { // Act - Action act = () => Execute.Assertion - .WithExpectation("Expectation ") - .Given(() => "Subject") - .ClearExpectation() - .Then - .FailWith("Failure"); + Action act = () => + { + AssertionChain.GetOrCreate() + .WithExpectation("Expectation ", chain => chain + .Given(() => "Subject")) + .Then + .FailWith("Failure"); + }; // Assert act.Should().Throw() @@ -210,38 +215,15 @@ public void public void Clearing_the_expectation_does_not_affect_a_successful_assertion() { // Act - bool result = Execute.Assertion - .WithExpectation("Expectation ") - .Given(() => "Don't care") - .ForCondition(_ => true) - .FailWith("Should not fail") - .Then - .ClearExpectation(); - - // Assert - result.Should().BeTrue(); - } - - [Fact] - public void Clearing_the_expectation_does_not_affect_a_failed_assertion() - { - // Act - using var scope = new AssertionScope(); + var assertionChain = AssertionChain.GetOrCreate(); - bool result = Execute.Assertion - .WithExpectation("Expectation ") - .Given(() => "Don't care") - .ForCondition(_ => false) - .FailWith("Should fail") - .Then - .ClearExpectation(); - - scope.Discard(); + assertionChain + .WithExpectation("Expectation ", chain => chain + .Given(() => "Don't care") + .ForCondition(_ => true) + .FailWith("Should not fail")); // Assert - if (result) - { - throw new XunitException("the assertion failed and should return false"); - } + assertionChain.Succeeded.Should().BeTrue(); } } diff --git a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs index 4d6853ee72..56c5a2aeec 100644 --- a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs +++ b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs @@ -211,32 +211,32 @@ public void When_the_object_is_a_generic_type_without_custom_string_representati act.Should().Throw() .WithMessage( """ - Expected stuff to be equal to + Expected stuff to be equal to { FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] { - Children = {1, 2, 3, 4}, - Description = "Stuff_1", + Children = {1, 2, 3, 4}, + Description = "Stuff_1", StuffId = 1 - }, + }, FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] { - Children = {1, 2, 3, 4}, - Description = "WRONG_DESCRIPTION", + Children = {1, 2, 3, 4}, + Description = "WRONG_DESCRIPTION", StuffId = 2 } - }, but + }, but { FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] { - Children = {1, 2, 3, 4}, - Description = "Stuff_1", + Children = {1, 2, 3, 4}, + Description = "Stuff_1", StuffId = 1 - }, + }, FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] { - Children = {1, 2, 3, 4}, - Description = "Stuff_2", + Children = {1, 2, 3, 4}, + Description = "Stuff_2", StuffId = 2 } } differs at index 1. @@ -254,13 +254,13 @@ public void When_the_object_is_a_user_defined_type_it_should_show_the_name_on_th // Assert act.Should().Throw() - .Which.Message.Should().Be( + .Which.Message.Should().Match( """ Expected stuff to be , but found FluentAssertions.Specs.Formatting.FormatterSpecs+StuffRecord { - RecordChildren = {10, 20, 30, 40}, - RecordDescription = "description", - RecordId = 42, + RecordChildren = {10, 20, 30, 40}, + RecordDescription = "description", + RecordId = 42, SingleChild = FluentAssertions.Specs.Formatting.FormatterSpecs+ChildRecord { ChildRecordId = 24 @@ -293,18 +293,18 @@ public void When_the_object_is_an_anonymous_type_it_should_show_the_properties_r act.Should().Throw() .Which.Message.Should().Be( """ - Expected stuff to be + Expected stuff to be { - Children = {10, 20, 30, 40}, - SingleChild = + Children = {10, 20, 30, 40}, + SingleChild = { ChildId = 4 } - }, but found + }, but found { - Children = {1, 2, 3, 4}, - Description = "absent", - SingleChild = + Children = {1, 2, 3, 4}, + Description = "absent", + SingleChild = { ChildId = 8 } @@ -345,13 +345,13 @@ public void When_the_object_is_a_list_of_anonymous_type_it_should_show_the_prope // Assert act.Should().Throw() - .Which.Message.Should().StartWith( + .Which.Message.Should().Match( """ - Expected stuff to be a collection with 1 item(s), but + Expected stuff to be a collection with 1 item(s), but* { { Description = "absent" - }, + },* { Description = "absent" } @@ -360,17 +360,17 @@ contains 1 item(s) more than { { - ComplexChildren = + ComplexChildren =* { { Property = "hello" - }, + },* { Property = "goodbye" } } } - }. + }.* """); } @@ -403,19 +403,19 @@ public void When_the_object_is_a_tuple_it_should_show_the_properties_recursively // Assert act.Should().Throw() - .Which.Message.Should().Be( + .Which.Message.Should().Match( """ - Expected stuff to be equal to + Expected stuff to be equal to* { - Item1 = 2, - Item2 = "WRONG_DESCRIPTION", + Item1 = 2,* + Item2 = "WRONG_DESCRIPTION",* Item3 = {4, 5, 6, 7} - }, but found + }, but found* { - Item1 = 1, - Item2 = "description", + Item1 = 1,* + Item2 = "description",* Item3 = {1, 2, 3, 4} - }. + }.* """); } @@ -439,16 +439,16 @@ public void When_the_object_is_a_record_it_should_show_the_properties_recursivel // Assert act.Should().Throw() - .Which.Message.Should().Be( + .Which.Message.Should().Match( """ - Expected stuff to be + Expected stuff to be* { RecordDescription = "WRONG_DESCRIPTION" }, but found FluentAssertions.Specs.Formatting.FormatterSpecs+StuffRecord { - RecordChildren = {4, 5, 6, 7}, - RecordDescription = "descriptive", - RecordId = 9, + RecordChildren = {4, 5, 6, 7},* + RecordDescription = "descriptive",* + RecordId = 9,* SingleChild = FluentAssertions.Specs.Formatting.FormatterSpecs+ChildRecord { ChildRecordId = 80 @@ -1193,7 +1193,7 @@ public void When_defining_a_custom_enumerable_value_formatter_it_should_respect_ str.Should().Match(Environment.NewLine + "{*FluentAssertions*FormatterSpecs+CustomClass" + Environment.NewLine + " {" + Environment.NewLine + - " IntProperty = 1, " + Environment.NewLine + + " IntProperty = 1," + Environment.NewLine + " StringProperty = " + Environment.NewLine + " },*…1 more…*}*"); } diff --git a/Tests/FluentAssertions.Specs/OccurrenceConstraintSpecs.cs b/Tests/FluentAssertions.Specs/OccurrenceConstraintSpecs.cs index 307099e068..7024a699dd 100644 --- a/Tests/FluentAssertions.Specs/OccurrenceConstraintSpecs.cs +++ b/Tests/FluentAssertions.Specs/OccurrenceConstraintSpecs.cs @@ -49,7 +49,7 @@ public class OccurrenceConstraintSpecs public void Occurrence_constraint_passes(OccurrenceConstraint constraint, int occurrences) { // Act / Assert - Execute.Assertion + AssertionChain.GetOrCreate() .ForConstraint(constraint, occurrences) .FailWith(""); } @@ -96,7 +96,7 @@ public void Occurrence_constraint_passes(OccurrenceConstraint constraint, int oc public void Occurrence_constraint_fails(OccurrenceConstraint constraint, int occurrences) { // Act - Action act = () => Execute.Assertion + Action act = () => AssertionChain.GetOrCreate() .ForConstraint(constraint, occurrences) .FailWith($"Expected occurrence to be {constraint.Mode} {constraint.ExpectedCount}, but it was {occurrences}"); diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs index e83f7a0394..e57f61e5d8 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using FluentAssertions.Execution; using FluentAssertions.Primitives; using Xunit; @@ -84,7 +85,7 @@ public bool Equals(SomeClass x, SomeClass y) internal class SomeClassAssertions : ObjectAssertions { public SomeClassAssertions(SomeClass value) - : base(value) + : base(value, AssertionChain.GetOrCreate()) { } } diff --git a/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs index 191ea2e41e..54f2c74587 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs @@ -43,10 +43,10 @@ public void When_two_different_objects_are_expected_to_be_the_same_it_should_fai .Should().Throw() .WithMessage( """ - Expected subject to refer to + Expected subject to refer to { UserName = "JohnDoe" - } because they are the same, but found + } because they are the same, but found { Name = "John Doe" }. @@ -61,7 +61,7 @@ public void When_a_derived_class_has_longer_formatting_than_the_base_class() act.Should().Throw() .WithMessage( """ - Expected subject to be empty, but found at least one item + Expected subject to be empty, but found at least one item { FluentAssertions.Specs.Primitives.Complex { @@ -454,7 +454,7 @@ public void Should_throw_a_helpful_error_when_accidentally_using_equals() public class ReferenceTypeAssertionsDummy : ReferenceTypeAssertions { public ReferenceTypeAssertionsDummy(object subject) - : base(subject) + : base(subject, AssertionChain.GetOrCreate()) { } diff --git a/Tests/FluentAssertions.Specs/Primitives/SimpleTimeSpanAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/SimpleTimeSpanAssertionSpecs.cs index 1e2a8a56d8..0cf1b14ae1 100644 --- a/Tests/FluentAssertions.Specs/Primitives/SimpleTimeSpanAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/SimpleTimeSpanAssertionSpecs.cs @@ -1,4 +1,5 @@ using System; +using FluentAssertions.Execution; using FluentAssertions.Extensions; using FluentAssertions.Primitives; using Xunit; @@ -165,7 +166,7 @@ public void When_asserting_value_to_be_equal_to_different_value_it_should_fail() public void A_null_is_not_equal_to_another_value() { // Arrange - var subject = new SimpleTimeSpanAssertions(null); + var subject = new SimpleTimeSpanAssertions(null, AssertionChain.GetOrCreate()); TimeSpan expected = 2.Seconds(); // Act diff --git a/Tests/FluentAssertions.Specs/Primitives/StringComparisonSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/StringComparisonSpecs.cs index 5ece34c048..abbc42f90b 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringComparisonSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringComparisonSpecs.cs @@ -264,15 +264,11 @@ public void When_comparing_strings_for_not_containing_any_equals_it_should_ignor [CulturedFact("tr-TR")] public void When_formatting_reason_arguments_it_should_ignore_culture() { - // Arrange - var scope = new AssertionScope(); - // Act - scope.BecauseOf("{0}", 1.234) - .FailWith("{reason}"); + Action act = () => 1.Should().Be(2, "{0}", 1.234); // Assert - scope.Invoking(e => e.Dispose()).Should().Throw() + act.Should().Throw() .WithMessage("*1.234*", "it should always use . as decimal separator"); } diff --git a/Tests/FluentAssertions.Specs/Specialized/AssemblyAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/AssemblyAssertionSpecs.cs index 50ec7d4f01..debf5e2c06 100644 --- a/Tests/FluentAssertions.Specs/Specialized/AssemblyAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/AssemblyAssertionSpecs.cs @@ -165,7 +165,7 @@ public void When_an_assembly_is_referencing_null_it_should_throw() public class DefineType { [Fact] - public void When_an_assembly_defines_a_type_and_Should_DefineType_is_asserted_it_should_succeed() + public void Can_find_a_specific_type() { // Arrange var thisAssembly = GetType().Assembly; @@ -179,6 +179,22 @@ public void When_an_assembly_defines_a_type_and_Should_DefineType_is_asserted_it act.Should().NotThrow(); } + [Fact] + public void Can_continue_assertions_on_the_found_type() + { + // Arrange + var thisAssembly = GetType().Assembly; + + // Act + Action act = () => thisAssembly + .Should().DefineType(GetType().Namespace, typeof(WellKnownClassWithAttribute).Name) + .Which.Should().BeDecoratedWith(); + + // Assert + act.Should().Throw() + .WithMessage("Expected*WellKnownClassWithAttribute*decorated*SerializableAttribute*not found."); + } + [Fact] public void When_an_assembly_does_not_define_a_type_and_Should_DefineType_is_asserted_it_should_fail_with_a_useful_message() diff --git a/Tests/FluentAssertions.Specs/Specialized/ExecutionTimeAssertionsSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/ExecutionTimeAssertionsSpecs.cs index d1a591ba61..d0f632baa4 100644 --- a/Tests/FluentAssertions.Specs/Specialized/ExecutionTimeAssertionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/ExecutionTimeAssertionsSpecs.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using FluentAssertions.Execution; using FluentAssertions.Extensions; using FluentAssertions.Specialized; using Xunit; @@ -580,7 +581,7 @@ public void When_asserting_on_null_execution_it_should_throw() ExecutionTime executionTime = null; // Act - Func act = () => new ExecutionTimeAssertions(executionTime); + Func act = () => new ExecutionTimeAssertions(executionTime, AssertionChain.GetOrCreate()); // Assert act.Should().Throw() diff --git a/Tests/FluentAssertions.Specs/Specialized/TaskCompletionSourceAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/TaskCompletionSourceAssertionSpecs.cs index 087c9b2d51..2d5a53994f 100644 --- a/Tests/FluentAssertions.Specs/Specialized/TaskCompletionSourceAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/TaskCompletionSourceAssertionSpecs.cs @@ -201,7 +201,7 @@ public async Task When_it_completes_in_time_and_async_result_is_not_expected_it_ // Assert await action.Should().ThrowAsync() - .WithMessage("Expected testSubject to be 42, but found 99."); + .WithMessage("Expected testSubject.Result to be 42, but found 99."); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Specialized/TaskOfTAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/TaskOfTAssertionSpecs.cs index df75d2f527..5ea7158732 100644 --- a/Tests/FluentAssertions.Specs/Specialized/TaskOfTAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/TaskOfTAssertionSpecs.cs @@ -76,6 +76,29 @@ public async Task When_task_completes_fast_it_should_succeed() await action.Should().NotThrowAsync(); } + [Fact] + public async Task Can_chain_another_assertion_on_the_result_of_the_async_operation() + { + // Arrange + var timer = new FakeClock(); + var taskFactory = new TaskCompletionSource(); + + // Act + Func action = async () => + { + Func> func = () => taskFactory.Task; + + (await func.Should(timer).CompleteWithinAsync(100.Milliseconds())) + .Which.Should().Be(42); + }; + + taskFactory.SetResult(42); + timer.Complete(); + + // Assert + await action.Should().NotThrowAsync(); + } + [Fact] public async Task When_task_completes_and_result_is_not_expected_it_should_fail() { @@ -120,7 +143,7 @@ public async Task When_task_completes_and_async_result_is_not_expected_it_should timer.Complete(); // Assert - await action.Should().ThrowAsync().WithMessage("Expected funcSubject to be 42, but found 99."); + await action.Should().ThrowAsync().WithMessage("Expected funcSubject.Result to be 42, but found 99."); } [Fact] @@ -185,7 +208,7 @@ public async Task When_task_does_not_complete_the_result_extension_does_not_hang // Assert var assertionTask = action.Should().ThrowAsync() - .WithMessage("Expected*to complete within 100ms.*Expected*to be 2, but found 0."); + .WithMessage("Expected*to complete within 100ms."); await Awaiting(() => assertionTask).Should().CompleteWithinAsync(200.Seconds()); } @@ -261,6 +284,29 @@ public async Task When_task_does_not_throw_it_should_succeed() await action.Should().NotThrowAsync(); } + [Fact] + public async Task Can_chain_another_assertion_on_the_result_of_the_async_operation() + { + // Arrange + var timer = new FakeClock(); + var taskFactory = new TaskCompletionSource(); + + // Act + Func action = async () => + { + Func> func = () => taskFactory.Task; + + (await func.Should(timer).NotThrowAsync()) + .Which.Should().Be(10); + }; + + taskFactory.SetResult(20); + timer.Complete(); + + // Assert + await action.Should().ThrowAsync().WithMessage("*func.Result to be 10*"); + } + [Fact] public async Task When_task_throws_it_should_fail() { diff --git a/Tests/FluentAssertions.Specs/Types/MethodBaseAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Types/MethodBaseAssertionSpecs.cs index 84a2bf8dc2..997f09fb29 100644 --- a/Tests/FluentAssertions.Specs/Types/MethodBaseAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/MethodBaseAssertionSpecs.cs @@ -389,7 +389,7 @@ public void When_asserting_a_private_member_is_protected_it_throws_with_a_useful // Assert act.Should().Throw() .WithMessage( - "Expected method PrivateMethod to be Protected because we want to test the error message, but it is " + + "Expected method TestClass.PrivateMethod to be Protected because we want to test the error message, but it is " + "Private."); } @@ -426,7 +426,7 @@ public void When_asserting_a_protected_member_is_public_it_throws_with_a_useful_ // Assert act.Should().Throw() .WithMessage( - "Expected method set_ProtectedSetProperty to be Public because we want to test the error message, but it" + + "Expected method TestClass.set_ProtectedSetProperty to be Public because we want to test the error message, but it" + " is Protected."); } @@ -463,7 +463,7 @@ public void When_asserting_a_public_member_is_internal_it_throws_with_a_useful_m // Assert act.Should().Throw() .WithMessage( - "Expected method get_PublicGetProperty to be Internal because we want to test the error message, but it" + + "Expected method TestClass.get_PublicGetProperty to be Internal because we want to test the error message, but it" + " is Public."); } @@ -495,7 +495,7 @@ public void When_asserting_an_internal_member_is_protectedInternal_it_throws_wit // Assert act.Should().Throw() .WithMessage( - "Expected method InternalMethod to be ProtectedInternal because we want to test the error message, but" + + "Expected method TestClass.InternalMethod to be ProtectedInternal because we want to test the error message, but" + " it is Internal."); } @@ -526,7 +526,7 @@ public void When_asserting_a_protected_internal_member_is_private_it_throws_with // Assert act.Should().Throw() .WithMessage( - "Expected method ProtectedInternalMethod to be Private because we want to test the error message, but it is " + + "Expected method TestClass.ProtectedInternalMethod to be Private because we want to test the error message, but it is " + "ProtectedInternal."); } @@ -604,7 +604,7 @@ public void When_asserting_a_private_member_is_not_private_it_throws_with_a_usef // Assert act.Should().Throw() - .WithMessage("Expected method PrivateMethod not to be Private*because we want to test the error message*"); + .WithMessage("Expected method TestClass.PrivateMethod not to be Private*because we want to test the error message*"); } [Fact] @@ -638,7 +638,7 @@ public void When_asserting_a_protected_member_is_not_protected_it_throws_with_a_ // Assert act.Should().Throw() .WithMessage( - "Expected method set_ProtectedSetProperty not to be Protected*because we want to test the error message*"); + "Expected method TestClass.set_ProtectedSetProperty not to be Protected*because we want to test the error message*"); } [Fact] @@ -686,7 +686,7 @@ public void When_asserting_a_public_member_is_not_public_it_throws_with_a_useful // Assert act.Should().Throw() - .WithMessage("Expected method get_PublicGetProperty not to be Public*because we want to test the error message*"); + .WithMessage("Expected method TestClass.get_PublicGetProperty not to be Public*because we want to test the error message*"); } [Fact] @@ -716,7 +716,7 @@ public void When_asserting_an_internal_member_is_not_internal_it_throws_with_a_u // Assert act.Should().Throw() - .WithMessage("Expected method InternalMethod not to be Internal*because we want to test the error message*"); + .WithMessage("Expected method TestClass.InternalMethod not to be Internal*because we want to test the error message*"); } [Fact] @@ -747,7 +747,7 @@ public void When_asserting_a_protected_internal_member_is_not_protected_internal // Assert act.Should().Throw() .WithMessage( - "Expected method ProtectedInternalMethod not to be ProtectedInternal*because we want to test the error message*"); + "Expected method TestClass.ProtectedInternalMethod not to be ProtectedInternal*because we want to test the error message*"); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Types/PropertyInfoAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Types/PropertyInfoAssertionSpecs.cs index e4479a345e..5d247992e8 100644 --- a/Tests/FluentAssertions.Specs/Types/PropertyInfoAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/PropertyInfoAssertionSpecs.cs @@ -19,8 +19,7 @@ public void When_asserting_that_a_property_is_virtual_and_it_is_then_it_succeeds PropertyInfo propertyInfo = typeof(ClassWithAllPropertiesVirtual).GetRuntimeProperty("PublicVirtualProperty"); // Act - Action act = () => - propertyInfo.Should().BeVirtual(); + Action act = () => propertyInfo.Should().BeVirtual(); // Assert act.Should().NotThrow(); @@ -34,13 +33,12 @@ public void When_asserting_that_a_property_is_virtual_and_it_is_not_then_it_fail typeof(ClassWithNonVirtualPublicProperties).GetRuntimeProperty("PublicNonVirtualProperty"); // Act - Action act = () => - propertyInfo.Should().BeVirtual("we want to test the error {0}", "message"); + Action act = () => propertyInfo.Should().BeVirtual("we want to test the error {0}", "message"); // Assert act.Should().Throw() .WithMessage( - "Expected property String FluentAssertions*ClassWithNonVirtualPublicProperties.PublicNonVirtualProperty" + + "Expected property ClassWithNonVirtualPublicProperties.PublicNonVirtualProperty" + " to be virtual because we want to test the error message," + " but it is not."); } @@ -173,8 +171,8 @@ public void When_asserting_a_property_is_decorated_with_attribute_and_it_is_not_ // Assert act.Should().Throw() - .WithMessage("Expected property String " + - "FluentAssertions*ClassWithPropertiesThatAreNotDecoratedWithDummyAttribute.PublicProperty to be decorated with " + + .WithMessage("Expected property " + + "ClassWithPropertiesThatAreNotDecoratedWithDummyAttribute.PublicProperty to be decorated with " + "FluentAssertions*DummyPropertyAttribute because we want to test the error message, but that attribute was not found."); } @@ -194,7 +192,7 @@ public void // Assert act.Should().Throw() .WithMessage( - "Expected property String FluentAssertions*ClassWithPropertiesThatAreNotDecoratedWithDummyAttribute.PublicProperty to be decorated with " + + "Expected property ClassWithPropertiesThatAreNotDecoratedWithDummyAttribute.PublicProperty to be decorated with " + "FluentAssertions*DummyPropertyAttribute because we want to test the error message," + " but that attribute was not found."); } @@ -295,7 +293,7 @@ public void When_asserting_a_readonly_property_is_writable_it_fails_with_useful_ action .Should().Throw() .WithMessage( - "Expected propertyInfo ReadOnlyProperty to have a setter because we want to test the error message."); + "Expected property ClassWithProperties.ReadOnlyProperty to have a setter because we want to test the error message."); } [Fact] @@ -381,7 +379,7 @@ public void When_asserting_a_writeonly_property_is_readable_it_fails_with_useful action .Should().Throw() .WithMessage( - "Expected property WriteOnlyProperty to have a getter because we want to test the error message, but it does not."); + "Expected property *WriteOnlyProperty to have a getter because we want to test the error message, but it does not."); } [Fact] @@ -427,8 +425,8 @@ public void When_asserting_a_readwrite_property_is_not_writable_it_fails_with_us // Assert action .Should().Throw() - .WithMessage( - "Expected propertyInfo ReadWriteProperty not to have a setter because we want to test the error message."); + .WithMessage("Did not expect property ClassWithReadOnlyProperties.ReadWriteProperty" + + " to have a setter because we want to test the error message."); } [Fact] @@ -443,8 +441,8 @@ public void When_asserting_a_writeonly_property_is_not_writable_it_fails_with_us // Assert action .Should().Throw() - .WithMessage( - "Expected propertyInfo WriteOnlyProperty not to have a setter because we want to test the error message."); + .WithMessage("Did not expect property ClassWithProperties.WriteOnlyProperty" + + " to have a setter because we want to test the error message."); } [Fact] @@ -459,7 +457,7 @@ public void When_subject_is_null_not_be_writable_should_fail() // Assert act.Should().Throw() - .WithMessage("Expected property not to have a setter *failure message*, but propertyInfo is ."); + .WithMessage("Expected propertyInfo not to have a setter *failure message*, but it is ."); } } @@ -477,8 +475,8 @@ public void When_asserting_a_readonly_property_is_not_readable_it_fails_with_use // Assert action .Should().Throw() - .WithMessage( - "Expected propertyInfo ReadOnlyProperty not to have a getter because we want to test the error message."); + .WithMessage("Did not expect property ClassWithReadOnlyProperties.ReadOnlyProperty " + + "to have a getter because we want to test the error message."); } [Fact] @@ -493,8 +491,8 @@ public void When_asserting_a_readwrite_property_is_not_readable_it_fails_with_us // Assert action .Should().Throw() - .WithMessage( - "Expected propertyInfo ReadWriteProperty not to have a getter because we want to test the error message."); + .WithMessage("Did not expect property ClassWithReadOnlyProperties.ReadWriteProperty " + + "to have a getter because we want to test the error message."); } [Fact] @@ -553,8 +551,8 @@ public void When_asserting_a_private_read_public_write_property_is_public_readab // Assert action.Should().Throw() - .WithMessage( - "Expected method get_WritePrivateReadProperty to be Public because we want to test the error message, but it is Private."); + .WithMessage("Expected getter of property ClassWithProperties.WritePrivateReadProperty " + + "to be Public because we want to test the error message, but it is Private*"); } [Fact] @@ -572,7 +570,7 @@ public void Do_not_the_check_access_modifier_when_the_property_is_not_readable() // Assert action.Should().Throw() - .WithMessage("Expected property WriteOnlyProperty to have a getter, but it does not."); + .WithMessage("Expected property ClassWithProperties.WriteOnlyProperty to have a getter, but it does not."); } [Fact] @@ -587,7 +585,7 @@ public void When_subject_is_null_be_readable_with_accessmodifier_should_fail() // Assert act.Should().Throw() - .WithMessage("Expected property to be Public *failure message*, but propertyInfo is ."); + .WithMessage("Expected propertyInfo to be Public *failure message*, but it is ."); } [Fact] @@ -633,8 +631,8 @@ public void When_asserting_a_private_write_public_read_property_is_public_writab // Assert action.Should().Throw() - .WithMessage( - "Expected method set_ReadPrivateWriteProperty to be Public because we want to test the error message, but it is Private."); + .WithMessage("Expected setter of property ClassWithProperties.ReadPrivateWriteProperty " + + "to be Public because we want to test the error message, but it is Private."); } [Fact] @@ -652,7 +650,7 @@ public void Do_not_the_check_access_modifier_when_the_property_is_not_writable() // Assert action.Should().Throw() - .WithMessage("Expected propertyInfo ReadOnlyProperty to have a setter."); + .WithMessage("Expected property ClassWithProperties.ReadOnlyProperty to have a setter."); } [Fact] @@ -667,7 +665,7 @@ public void When_subject_is_null_be_writable_with_accessmodifier_should_fail() // Assert act.Should().Throw() - .WithMessage("Expected property to be Public *failure message*, but propertyInfo is ."); + .WithMessage("Expected propertyInfo to be Public *failure message*, but it is ."); } [Fact] @@ -712,8 +710,8 @@ public void When_asserting_a_String_property_returns_an_Int32_it_throw_with_a_us // Assert action.Should().Throw() - .WithMessage("Expected Type of property StringProperty to be System.Int32 because we want to test the error " + - "message, but it is System.String."); + .WithMessage("Expected type of property ClassWithProperties.StringProperty" + + " to be System.Int32 because we want to test the error message, but it is System.String."); } [Fact] @@ -773,7 +771,7 @@ public void When_asserting_a_String_property_returnsOfT_an_Int32_it_throw_with_a // Assert action.Should().Throw() - .WithMessage("Expected Type of property StringProperty to be System.Int32 because we want to test the error " + + .WithMessage("Expected type of property ClassWithProperties.StringProperty to be System.Int32 because we want to test the error " + "message, but it is System.String."); } } @@ -804,8 +802,8 @@ public void When_asserting_a_String_property_does_not_return_a_String_it_throw_w // Assert action.Should().Throw() - .WithMessage("Expected Type of property StringProperty not to be*String*because we want to test the error " + - "message, but it is."); + .WithMessage("Expected type of property ClassWithProperties.StringProperty" + + " not to be System.String because we want to test the error message, but it is."); } [Fact] @@ -842,7 +840,7 @@ public void When_asserting_property_type_is_not_null_it_should_throw() public class NotReturnOfT { [Fact] - public void When_asserting_a_String_property_does_not_returnOfT_an_Int32_it_succeeds() + public void Can_validate_the_type_of_a_property() { // Arrange PropertyInfo propertyInfo = typeof(ClassWithProperties).GetRuntimeProperty("StringProperty"); @@ -855,7 +853,7 @@ public void When_asserting_a_String_property_does_not_returnOfT_an_Int32_it_succ } [Fact] - public void When_asserting_a_String_property_does_not_returnsOfT_a_String_it_throw_with_a_useful_message() + public void When_asserting_a_string_property_does_not_returnsOfT_a_String_it_throw_with_a_useful_message() { // Arrange PropertyInfo propertyInfo = typeof(ClassWithProperties).GetRuntimeProperty("StringProperty"); @@ -865,7 +863,7 @@ public void When_asserting_a_String_property_does_not_returnsOfT_a_String_it_thr // Assert action.Should().Throw() - .WithMessage("Expected Type of property StringProperty not to be*String*because we want to test the error " + + .WithMessage("Expected type of property ClassWithProperties.StringProperty not to be*String*because we want to test the error " + "message, but it is."); } } diff --git a/Tests/FluentAssertions.Specs/Types/PropertyInfoSelectorAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Types/PropertyInfoSelectorAssertionSpecs.cs index cf3dca9c6c..650b56fd00 100644 --- a/Tests/FluentAssertions.Specs/Types/PropertyInfoSelectorAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/PropertyInfoSelectorAssertionSpecs.cs @@ -1,4 +1,5 @@ using System; +using FluentAssertions.Execution; using FluentAssertions.Types; using Xunit; using Xunit.Sdk; @@ -53,9 +54,9 @@ public void .WithMessage("Expected all selected properties" + " to be virtual because we want to test the error message," + " but the following properties are not virtual:*" + - "String FluentAssertions*ClassWithNonVirtualPublicProperties.PublicNonVirtualProperty*" + - "String FluentAssertions*ClassWithNonVirtualPublicProperties.InternalNonVirtualProperty*" + - "String FluentAssertions*ClassWithNonVirtualPublicProperties.ProtectedNonVirtualProperty"); + "ClassWithNonVirtualPublicProperties.PublicNonVirtualProperty*" + + "ClassWithNonVirtualPublicProperties.InternalNonVirtualProperty*" + + "ClassWithNonVirtualPublicProperties.ProtectedNonVirtualProperty"); } } @@ -159,9 +160,9 @@ public void .WithMessage("Expected all selected properties to be decorated with" + " FluentAssertions*DummyPropertyAttribute because we want to test the error message," + " but the following properties are not:*" + - "String FluentAssertions*ClassWithPropertiesThatAreNotDecoratedWithDummyAttribute.PublicProperty*" + - "String FluentAssertions*ClassWithPropertiesThatAreNotDecoratedWithDummyAttribute.InternalProperty*" + - "String FluentAssertions*ClassWithPropertiesThatAreNotDecoratedWithDummyAttribute.ProtectedProperty"); + "ClassWithPropertiesThatAreNotDecoratedWithDummyAttribute.PublicProperty*" + + "ClassWithPropertiesThatAreNotDecoratedWithDummyAttribute.InternalProperty*" + + "ClassWithPropertiesThatAreNotDecoratedWithDummyAttribute.ProtectedProperty"); } } @@ -236,8 +237,8 @@ public void When_a_read_only_property_is_expected_to_be_writable_it_should_throw .WithMessage( "Expected all selected properties to have a setter because we want to test the error message, " + "but the following properties do not:*" + - "String FluentAssertions*ClassWithReadOnlyProperties.ReadOnlyProperty*" + - "String FluentAssertions*ClassWithReadOnlyProperties.ReadOnlyProperty2"); + "ClassWithReadOnlyProperties.ReadOnlyProperty*" + + "ClassWithReadOnlyProperties.ReadOnlyProperty2"); } [Fact] @@ -271,8 +272,8 @@ public void When_a_writable_property_is_expected_to_be_read_only_it_should_throw .WithMessage( "Expected selected properties to not have a setter because we want to test the error message, " + "but the following properties do:*" + - "String FluentAssertions*ClassWithWritableProperties.ReadWriteProperty*" + - "String FluentAssertions*ClassWithWritableProperties.ReadWriteProperty2"); + "ClassWithWritableProperties.ReadWriteProperty*" + + "ClassWithWritableProperties.ReadWriteProperty2"); } [Fact] @@ -295,7 +296,7 @@ public class Miscellaneous public void When_accidentally_using_equals_it_should_throw_a_helpful_error() { // Arrange - var someObject = new PropertyInfoSelectorAssertions(); + var someObject = new PropertyInfoSelectorAssertions(AssertionChain.GetOrCreate()); // Act var action = () => someObject.Equals(null); diff --git a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveExplicitConversionOperator.cs b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveExplicitConversionOperator.cs index 5eedb90a94..89fa79cdd3 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveExplicitConversionOperator.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveExplicitConversionOperator.cs @@ -1,4 +1,5 @@ using System; +using FluentAssertions.Common; using Xunit; using Xunit.Sdk; @@ -19,15 +20,30 @@ public void When_asserting_a_type_has_an_explicit_conversion_operator_which_it_d var sourceType = typeof(TypeWithConversionOperators); var targetType = typeof(byte); + // Act / Assert + type.Should() + .HaveExplicitConversionOperator(sourceType, targetType) + .Which.Should() + .NotBeNull(); + } + + [Fact] + public void Can_chain_an_additional_assertion_on_the_implicit_conversion_operator() + { + // Arrange + var type = typeof(TypeWithConversionOperators); + var sourceType = typeof(TypeWithConversionOperators); + var targetType = typeof(byte); + // Act - Action act = () => - type.Should() - .HaveExplicitConversionOperator(sourceType, targetType) - .Which.Should() - .NotBeNull(); + Action act = () => type + .Should().HaveExplicitConversionOperator(sourceType, targetType) + .Which.Should().HaveAccessModifier(CSharpAccessModifier.Private); // Assert - act.Should().NotThrow(); + act.Should().Throw() + .WithMessage( + "Expected method explicit operator Byte(TypeWithConversionOperators) to be Private, but it is Public."); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveImplicitConversionOperator.cs b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveImplicitConversionOperator.cs index d5ef12601b..f3194619e9 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveImplicitConversionOperator.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveImplicitConversionOperator.cs @@ -1,4 +1,5 @@ using System; +using FluentAssertions.Common; using Xunit; using Xunit.Sdk; @@ -118,6 +119,24 @@ public void When_asserting_a_type_has_an_implicit_conversion_operatorOfT_which_i act.Should().NotThrow(); } + [Fact] + public void Can_chain_an_additional_assertion_on_the_implicit_conversion_operator() + { + // Arrange + var type = typeof(TypeWithConversionOperators); + + // Act + Action act = () => + type.Should() + .HaveImplicitConversionOperator() + .Which.Should() + .HaveAccessModifier(CSharpAccessModifier.Internal); + + // Assert + act.Should().Throw() + .WithMessage("Expected method implicit operator Int32(TypeWithConversionOperators) to be Internal, but it is Public."); + } + [Fact] public void When_asserting_a_type_has_an_implicit_conversion_operatorOfT_which_it_does_not_it_fails() { diff --git a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveProperty.cs b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveProperty.cs index fe7f4cbb6a..543f439ff3 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveProperty.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveProperty.cs @@ -30,6 +30,21 @@ public void When_asserting_a_type_has_a_property_which_it_does_then_it_succeeds( act.Should().NotThrow(); } + [Fact] + public void The_name_of_the_property_is_passed_to_the_chained_assertion() + { + // Arrange + var type = typeof(ClassWithMembers); + + // Act + Action act = () => type + .Should().HaveProperty(typeof(string), "PrivateWriteProtectedReadProperty") + .Which.Should().NotBeWritable(); + + // Assert + act.Should().Throw("Expected property PrivateWriteProtectedReadProperty not to have a setter."); + } + [Fact] public void When_asserting_a_type_has_a_property_which_it_does_not_it_fails() { @@ -42,7 +57,7 @@ public void When_asserting_a_type_has_a_property_which_it_does_not_it_fails() // Assert act.Should().Throw() - .WithMessage("Expected String *ClassWithNoMembers.PublicProperty to exist *failure message*, but it does not."); + .WithMessage("Expected ClassWithNoMembers to have a property PublicProperty of type String because we want to test the failure message, but it does not."); } [Fact] @@ -58,9 +73,8 @@ public void When_asserting_a_type_has_a_property_which_it_has_with_a_different_t // Assert act.Should().Throw() - .WithMessage( - "Expected String *.ClassWithMembers.PrivateWriteProtectedReadProperty to be of type System.Int32 " + - "*failure message*, but it is not."); + .WithMessage("Expected property PrivateWriteProtectedReadProperty " + + "to be of type System.Int32 because we want to test the failure message, but it is not."); } [Fact] @@ -75,7 +89,7 @@ public void When_subject_is_null_have_property_should_fail() // Assert act.Should().Throw() - .WithMessage("Expected String type.PublicProperty to exist *failure message*, but type is ."); + .WithMessage("Cannot determine if a type has a property named PublicProperty if the type is ."); } [Fact] @@ -184,8 +198,7 @@ public void When_asserting_a_type_does_not_have_a_property_which_it_does_not_it_ var type = typeof(ClassWithoutMembers); // Act - Action act = () => - type.Should().NotHaveProperty("Property"); + Action act = () => type.Should().NotHaveProperty("Property"); // Assert act.Should().NotThrow(); @@ -203,9 +216,7 @@ public void When_asserting_a_type_does_not_have_a_property_which_it_does_it_fail // Assert act.Should().Throw() - .WithMessage( - "Expected String *.ClassWithMembers.PrivateWriteProtectedReadProperty to not exist *failure message*" + - ", but it does."); + .WithMessage("Did not expect ClassWithMembers to have a property PrivateWriteProtectedReadProperty because we want to test the failure message, but it does."); } [Fact] @@ -220,7 +231,7 @@ public void When_subject_is_null_not_have_property_should_fail() // Assert act.Should().Throw() - .WithMessage("Expected type.PublicProperty to not exist *failure message*, but type is ."); + .WithMessage("Cannot determine if a type has an unexpected property named PublicProperty if the type is ."); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Xml/XDocumentAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Xml/XDocumentAssertionSpecs.cs index f09023363c..0c7270b0b0 100644 --- a/Tests/FluentAssertions.Specs/Xml/XDocumentAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Xml/XDocumentAssertionSpecs.cs @@ -990,6 +990,25 @@ public void When_asserting_document_has_root_element_with_ns_but_it_does_not_it_ "Expected theDocument to have root element \"{http://www.example.com/2012/test}unknown\", but found ."); } + [Fact] + public void Can_chain_another_assertion_on_the_root_element() + { + // Arrange + var theDocument = XDocument.Parse( + """ + + + + """); + + // Act + Action act = () => theDocument.Should().HaveRoot("parent").Which.Should().HaveElement("unknownChild"); + + // Assert + act.Should().Throw().WithMessage( + "Expected theDocument/parent to have child element*unknownChild*"); + } + [Fact] public void When_asserting_document_has_root_element_with_ns_but_it_does_not_it_should_fail_with_descriptive_message() { @@ -1036,6 +1055,24 @@ public void When_document_has_the_expected_child_element_it_should_not_throw_and element.Should().BeSameAs(document.Element("parent").Element("child")); } + [Fact] + public void Can_chain_another_assertion_on_the_root_element() + { + // Arrange + var document = XDocument.Parse( + """ + + + + """); + + // Act + var act = () => document.Should().HaveElement("child").Which.Should().HaveElement("grandChild"); + + // Assert + act.Should().Throw().WithMessage("Expected document/child to have child element*grandChild*"); + } + [Fact] public void When_asserting_document_has_root_with_child_element_but_it_does_not_it_should_fail() { diff --git a/docs/_pages/exceptions.md b/docs/_pages/exceptions.md index 48570bd9d0..d2447987fa 100644 --- a/docs/_pages/exceptions.md +++ b/docs/_pages/exceptions.md @@ -28,7 +28,7 @@ act.Should().Throw() Notice that the example also verifies that the exception has a particular inner exception with a specific message. In fact, you can even check the individual properties of the exception instance using the And property. ```csharp -Action act = () => subject.Foo(null); +var act = () => subject.Foo(null); act.Should().Throw() .WithParameterName("message"); @@ -37,7 +37,7 @@ act.Should().Throw() An alternative syntax for doing the same is by chaining one or more calls to the `Where()` method: ```csharp -Action act = () => subject.Foo(null); +var act = () => subject.Foo(null); act.Should().Throw().Where(e => e.Message.StartsWith("did")); ``` @@ -53,7 +53,7 @@ The following wildcard specifiers are permitted in the pattern: | ? (question mark) | Exactly one character in that position. | ```csharp -Action act = () => subject.Foo(null); +var act = () => subject.Foo(null); act .Should().Throw() .WithMessage("?did*"); @@ -62,7 +62,7 @@ act On the other hand, you may want to verify that no exceptions were thrown. ```csharp -Action act = () => subject.Foo("Hello"); +var act = () => subject.Foo("Hello"); act.Should().NotThrow(); ``` @@ -71,14 +71,14 @@ We know that a unit test will fail anyhow if an exception was thrown, but this s If you want to verify that a specific exception is not thrown, and want to ignore others, you can do that using an overload: ```csharp -Action act = () => subject.Foo("Hello"); +var act = () => subject.Foo("Hello"); act.Should().NotThrow(); ``` Sometimes you may want to retry an assertion until it either succeeds or a given time elapses. For instance, you could be testing a network service which should become available after a certain time, say, 10 seconds: ```csharp -Action act = () => service.IsReady().Should().BeTrue(); +var act = () => service.IsReady().Should().BeTrue(); act.Should().NotThrowAfter(10.Seconds(), 100.Milliseconds()); ``` @@ -107,7 +107,7 @@ However, if you really want to be explicit about the exact type of exception, yo Talking about the `async` keyword, you can also verify that an asynchronously executed method throws or doesn't throw an exception: ```csharp -Func act = () => asyncObject.ThrowAsync(); +var act = () => asyncObject.ThrowAsync(); await act.Should().ThrowAsync(); await act.Should().NotThrowAsync(); ``` @@ -115,7 +115,7 @@ await act.Should().NotThrowAsync(); Alternatively, you can use the `Awaiting` method like this: ```csharp -Func act = asyncObject.Awaiting(x => x.ThrowAsync()); +var act = asyncObject.Awaiting(x => x.ThrowAsync()); await act.Should().ThrowAsync(); ``` @@ -125,7 +125,7 @@ As for synchronous methods, you can also check that an asynchronously executed m ```csharp Stopwatch watch = Stopwatch.StartNew(); -Func act = async () => +var act = async () => { if (watch.ElapsedMilliseconds <= 1000) { diff --git a/docs/_pages/executiontime.md b/docs/_pages/executiontime.md index 41551dfc3f..2a398b2bf2 100644 --- a/docs/_pages/executiontime.md +++ b/docs/_pages/executiontime.md @@ -34,7 +34,7 @@ subject.ExecutionTimeOf(s => s.ExpensiveMethod()).Should().BeLessThanOrEqualTo(5 Alternatively, to verify the execution time of an arbitrary action, use this syntax: ```csharp -Action someAction = () => Thread.Sleep(100); +var someAction = () => Thread.Sleep(100); someAction.ExecutionTime().Should().BeLessThanOrEqualTo(200.Milliseconds()); ``` @@ -52,7 +52,7 @@ someAction.ExecutionTime().Should().BeCloseTo(150.Milliseconds(), 50.Millisecond If you're dealing with a `Task`, you can also assert that it completed within a specified period of time or not completed: ```csharp -Func someAsyncWork = () => SomethingReturningATask(); +var someAsyncWork = () => SomethingReturningATask(); await someAsyncWork.Should().CompleteWithinAsync(100.Milliseconds()); await someAsyncWork.Should().NotCompleteWithinAsync(100.Milliseconds()); await someAsyncWork.Should().ThrowWithinAsync(100.Milliseconds()); diff --git a/docs/_pages/extensibility.md b/docs/_pages/extensibility.md index 52f8692230..e92aa32d5c 100644 --- a/docs/_pages/extensibility.md +++ b/docs/_pages/extensibility.md @@ -18,20 +18,27 @@ public static class DirectoryInfoExtensions { public static DirectoryInfoAssertions Should(this DirectoryInfo instance) { - return new DirectoryInfoAssertions(instance); + return new DirectoryInfoAssertions(instance, AssertionChain.GetOrCreate()); } } ``` -It's the returned assertions class that provides the actual assertion methods. You don't need to, but if you sub-class the self-referencing generic class `ReferenceTypeAssertions`, you'll already get methods like `BeNull`, `BeSameAs` and `Match` for free. Assuming you did, and you provided an override of the `Identifier` property so that these methods know that we're dealing with a directory, it's time for the the next step. Let's add an extension that allows you to assert that the involved directory contains a particular file. +It's the returned assertions class that provides the actual assertion methods. The `AssertionChain.GetOrCreate()` method is used to start a potential chain of assertions that can be used to support chained constructs using `Which`. + +You don't need to, but if you sub-class the self-referencing generic class `ReferenceTypeAssertions`, you'll already get methods like `BeNull`, `BeSameAs` and `Match` for free. Assuming you did, and you provided an override of the `Identifier` property so that these methods know that we're dealing with a directory, it's time for the the next step. + +Let's add an extension that allows you to assert that the involved directory contains a particular file. ```csharp public class DirectoryInfoAssertions : ReferenceTypeAssertions { - public DirectoryInfoAssertions(DirectoryInfo instance) + private AssertionChain chain; + + public DirectoryInfoAssertions(DirectoryInfo instance, AssertionChain chain) : base(instance) { + this.chain = chain; } protected override string Identifier => "directory"; @@ -40,7 +47,7 @@ public class DirectoryInfoAssertions : public AndConstraint ContainFile( string filename, string because = "", params object[] becauseArgs) { - Execute.Assertion + chain .BecauseOf(because, becauseArgs) .ForCondition(!string.IsNullOrEmpty(filename)) .FailWith("You can't assert a file exist if you don't pass a proper name") @@ -59,13 +66,46 @@ This is quite an elaborate example which shows some of the more advanced extensi * The `Subject` property is used to give the base-class extensions access to the current `DirectoryInfo` object. * `[CustomAssertion]` attribute enables correct subject identification, allowing Fluent Assertions to render more meaningful test fail messages -* `Execute.Assertion` is the point of entrance into the internal fluent assertion API. +* The variable `chain` of type `AssertionChain` is the point of entrance into the internal fluent API. * The optional `because` parameter can contain `string.Format` style place holders which will be filled using the values provided to the `becauseArgs`. They can be used by the caller to provide a reason why the assertion should succeed. By passing those into the `BecauseOf` method, you can refer to the expanded result using the `{reason}` tag in the `FailWith` method. -* The `Then` property is just there to chain multiple assertions together. You can have more than one. +* The `Then` property is just there to chain multiple assertions together. You can have more than one. However, if the first assertion fails, then the successive assertions will not be evaluated anymore. * The `Given` method allows you to perform a lazily evaluated projection on whatever you want. In this case I use it to get a list of `FileInfo` objects from the current directory. Notice that the resulting expression is not evaluated until the final call to `FailWith`. * `FailWith` will evaluate the condition, and raise the appropriate exception specific for the detected test framework. It again can contain numbered placeholders as well as the special named placeholders `{context}` and `{reason}`. I'll explain the former in a minute, but suffice to say that it displays the text "directory" at that point. The remainder of the place holders will be filled by applying the appropriate type-specific value formatter for the provided arguments. If those arguments involve a non-primitive type such as a collection or complex type, the formatters will use recursion to always use the appropriate formatter. * Since we used the `Given` construct to create a projection, the parameters of `FailWith` are formed by a `params` array of `Func` that give you access to the projection (such as the `FileInfo[]` in this particular case). But normally, it's just a `params array` of objects. +## Supporting chaining +Imagine that you want to have your custom `ContainFile` assertion support chaining additional assertions like this: + +```csharp +directoryInfo.Should().ContainFile("trace.dmp").Which.Path.Should().BeginWith("c:\\files"); +``` + +You can support that by replacing the `AndConstraint` your assertion returns by a generic `AndWhichConstraint` and passing the `FileInfo` instance that was found by `ContainFile`, as well as the `AssertionChain` to its constructor. `AndWhichConstraint` has a property called `Which` which (no pun intended) will provide access to the `FileInfo` instance. + +Then, if the first part succeeds, but the second part fails, you'll get something like: + + Expected directoryInfo.Path to begin with "c:\files", but it didn't. + +Notice the `directoryInfo` part that the caller identification logic picks up? You can overrule that by using `AssertionChain.OverrideCallerIdentifier` before you pass it to the constructor of `AndWhichConstraint`. Alternatively, you can also use `WithCallerPostFix`. Check out `GenericCollectionAssertions.Contain` for an example of that. + +## Reusing expectations +A common situation is that you want to execute more than one assertion in a chain, where the first part of the failure message is the same. Instead of repeating this first part, you can use `WithExpectation` to reuse that message in all nested calls to `FailWith` like this: + +```csharp +assertionChain + .BecauseOf(because, becauseArgs) + .WithExpectation("Expected the month part of {context:the date} to be {0}{reason}", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateOnly.") + .Then + .ForCondition(Subject.Value.Month == expected) + .FailWith(", but found {0}.", Subject.Value.Month)); +``` + +If the first assertion fails, you'll get something like this: + + Expected the month part of the date to be January, but found a DateOnly. + ## Scoping your extensions Now what if you want to reuse your newly created extension method within some other extension method? For instance, what if you want to apply that assertion on a collection of directories? Wouldn't it be cool if you can tell your extension method about the current directory? This is where the `AssertionScope` comes into place. @@ -86,12 +126,14 @@ public AndConstraint ContainFileInAllSubdirectories( } ``` -Whatever you pass into its constructor will be used to overwrite the default `{context}` passed to `FailWith`. +Whatever you pass into its constructor will be used to overwrite the default `{context}` passed to `FailWith`: ```csharp .FailWith("Expected {context:directory} to contain {0}{reason}, but found {1}.", ``` +If you don't, `{context}` will be replaced with the variable on which `Should()` is invoked, or, if caller identification failed somehow, with `"directory"`. + So in this case, our nicely created `ContainFile` extension method will display the directory that it used to assert that file existed. You can do a lot more advanced stuff if you want. Just check out the code that is used by the structural equivalency API. ## Rendering objects with beauty @@ -171,7 +213,7 @@ class EnumerableCustomClassFormatter : EnumerableValueFormatter } ``` -### Scoped `IValueFormatter`s +## Scoped `IValueFormatter`s You can add a custom value formatter inside a scope to selectively customize formatting of an object based on the context of the test. To achieve that, you can do following: diff --git a/docs/_pages/introduction.md b/docs/_pages/introduction.md index 178df091bd..0bdd3eb5b3 100644 --- a/docs/_pages/introduction.md +++ b/docs/_pages/introduction.md @@ -36,31 +36,39 @@ numbers.Should().OnlyContain(n => n > 0); numbers.Should().HaveCount(4, "because we thought we put four items in the collection"); ``` -The nice thing about the second failing example is that it will throw an exception with the message +The nice thing about the second failing example is that it will throw an exception with the message (and notice that it uses the name of the variable `numbers`): -> "Expected numbers to contain 4 item(s) because we thought we put four items in the collection, but found 3." + Expected numbers to contain 4 item(s) because we thought we put four items in the collection, but found 3. -To verify that a particular business rule is enforced using exceptions. +To verify that a particular business rule is enforced using exceptions: ```csharp var recipe = new RecipeBuilder() - .With(new IngredientBuilder().For("Milk").WithQuantity(200, Unit.Milliliters)) - .Build(); -Action action = () => recipe.AddIngredient("Milk", 100, Unit.Spoon); + .With(new IngredientBuilder().For("Milk").WithQuantity(200, Unit.Milliliters)) + .Build(); + +var action = () => recipe.AddIngredient("Milk", 100, Unit.Spoon); + action - .Should().Throw() - .WithMessage("*change the unit of an existing ingredient*") - .And.Violations.Should().Contain(BusinessRule.CannotChangeIngredientQuantity); + .Should().Throw() + .WithMessage("*change the unit of an existing ingredient*") + .And.Violations.Should().Contain(BusinessRule.CannotChangeIngredientQuantity); ``` One neat feature is the ability to chain a specific assertion on top of an assertion that acts on a collection or graph of objects. ```csharp dictionary.Should().ContainValue(myClass).Which.SomeProperty.Should().BeGreaterThan(0); + someObject.Should().BeOfType().Which.Message.Should().Be("Other Message"); + xDocument.Should().HaveElement("child").Which.Should().BeOfType().And.HaveAttribute("attr", "1"); ``` +If the first one fails, you will get a message like: + + Expected dictionary["key"].SomeProperty to be greater than 0, but found -2 + This chaining can make your unit tests a lot easier to read. ## Global Configurations @@ -108,7 +116,7 @@ username.Should().Be("jonas"); This will throw a test framework-specific exception with the following message: -`Expected username to be "jonas" with a length of 5, but "dennis" has a length of 6, differs near "den" (index 0).` + Expected username to be "jonas" with a length of 5, but "dennis" has a length of 6, differs near "den" (index 0). The way this works is that Fluent Assertions will try to traverse the current stack trace to find the line and column numbers as well as the full path to the source file. Since it needs the debug symbols for that, this will require you to compile the unit test projects in debug mode, even on your build servers. Also, this does not work with [`PathMap`](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/advanced#pathmap) for unit test projects as it assumes that source files are present on the path returned from [`StackFrame.GetFileName()`](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.stackframe.getfilename). @@ -145,7 +153,7 @@ Alternatively, you can add the `[assembly:CustomAssertionsAssembly]` attribute t ## Assertion Scopes -You can batch multiple assertions into an `AssertionScope` so that FluentAssertions throws one exception at the end of the scope with all failures. +You can batch multiple assertions into an `AssertionScope` so that Fluent Assertions throws one exception at the end of the scope with all failures. E.g. @@ -162,13 +170,39 @@ The above will batch the two failures, and throw an exception at the point of di E.g. Exception thrown at point of dispose contains: ```text -Expected value to be 10, but found 5. +Expected value to be 100, but found 95 (difference of -5). Expected string to be "Expected" with a length of 8, but "Actual" has a length of 6, differs near "Act" (index 0). +``` + +You can even nest two of those scopes and give them suitable names: + +```csharp +using var outerScope = new AssertionScope("Test1"); +using var innerScope = new AssertionScope("Test2"); +nonEmptyList.Should().BeEmpty(); +``` - at........ +This will give you: + + Expected Test1/Test2/nonEmptyList to be empty, but found at least one item {1}. + + +In more sophisticated scenarios, you might want to intercept the assertion raised within an `AssertionScope` and prevent it from throwing an exception. + +```csharp +using (var scope = new AssertionScope()) +{ + 5.Should().Be(10); + // other assertion left out for brevity... + + // Collect all the failure messages that occurred up to this point + string[] failures = scope.Discard(); + + // The closing brace will not throw any exceptions anymore +} ``` -For more information take a look at the [AssertionScopeSpecs.cs](https://github.com/fluentassertions/fluentassertions/blob/master/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs) in Unit Tests. +For more examples take a look at the [AssertionScopeSpecs.cs](https://github.com/fluentassertions/fluentassertions/blob/master/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs) in Unit Tests. ### Scoped `IValueFormatter`s diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 26bc190692..8b62f71665 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -28,6 +28,8 @@ sidebar: * You can mark all assertions in an assembly as custom assertions using the `[CustomAssertionsAssembly]` attribute - [#2389](https://github.com/fluentassertions/fluentassertions/pull/2389) * Improve `BeEmpty()` and `BeNullOrEmpty()` performance for `IEnumerable`, by materializing only the first item - [#2530](https://github.com/fluentassertions/fluentassertions/pull/2530) * All `Should()` methods on reference types are now annotated with the `[NotNull]` attribute for a better Fluent Assertions experience when nullable reference types are enabled - [#2380](https://github.com/fluentassertions/fluentassertions/pull/2380) +* All assertions that support chaining using the `.Which` construct will now amend the caller identifier - [2539](https://github.com/fluentassertions/pull/2539) +* Introduced a `MethodInfoFormatter` and improved the `PropertyInfoFormatter` - [2539](https://github.com/fluentassertions/pull/2539) ### Fixes * Fixed formatting error when checking nullable `DateTimeOffset` with @@ -53,6 +55,7 @@ sidebar: * Fixed `RaisePropertyChangeFor` to return a filtered list of events - [#2677](https://github.com/fluentassertions/fluentassertions/pull/2677) ### Breaking Changes (for users) +* Replaced `Execute.Assertion` with `AssertionChain.GetOrCreate()` - [2539](https://github.com/fluentassertions/pull/2539) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) * Removed obsolete `...OrEqualTo` methods - [#2269](https://github.com/fluentassertions/fluentassertions/pull/2269) * `GenericCollectionAssertions` @@ -83,6 +86,9 @@ sidebar: * The semantics of `BeLowerCased`/`BeUpperCased` have been changed to align with the behavior of `ToLower`/`ToUpper` - [#2660](https://github.com/fluentassertions/fluentassertions/pull/2660) ### Breaking Changes (for extensions) +* Introduced a new `AssertionChain` class whose `GetOrCreate` is used to replace `Execute.Assertion` when writing custom assertions - [2539](https://github.com/fluentassertions/fluentassertions/pull/2539) +* Removed `ClearExpectation` and made `WithExpectation` a scoped operation that takes a nested `AssertionChain` - [2539](https://github.com/fluentassertions/fluentassertions/pull/2539) +* `AndWhichConstraint` now takes an `AssertionChain` instance and a postfix to improve the caller identifier in chained constructs - [2539](https://github.com/fluentassertions/pull/2539) * Add `ForConstraint` to `IAssertionsScope` to support chaining `.ForConstraint()` after `.Then` - [#2324](https://github.com/fluentassertions/fluentassertions/pull/2324) * Refactored `AsyncFunctionAssertions` into real base class - [#2359](https://github.com/fluentassertions/fluentassertions/pull/2359) * Its constructor has been made `protected`. @@ -93,6 +99,7 @@ sidebar: * Renamed `IEquivalencyValidator` to `IValidateChildNodeEquivalency`, and its method `RecursivelyAssertEquality` to `AssertEquivalencyOf` - [#2745](https://github.com/fluentassertions/fluentassertions/pull/2745) * Made `Node`, `Property` and `Field` internal - [#2745](https://github.com/fluentassertions/fluentassertions/pull/2745) + ## 6.12.0 ### What's new diff --git a/docs/_pages/upgradingtov7.md b/docs/_pages/upgradingtov7.md index b6e69bb169..1248cfdd36 100644 --- a/docs/_pages/upgradingtov7.md +++ b/docs/_pages/upgradingtov7.md @@ -10,3 +10,142 @@ sidebar: ## Dropping support for .NET Core 2.x and .NET Core 3.x. As of v7, we've decided to no longer directly target .NET Core. All versions of .NET Core, including .NET 5 are [already out of support by Microsoft](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core). But we still support .NET Standard 2.0 and 2.1, so Fluent Assertions will still work with those deprecated frameworks. + +## From `Execute.Assertion` to `AssertionChain` + +We've made quite some changes to the API that you use to build your own assertions. For example, the `BooleanAssertions` class was instantiated in `AssertionExtensions` like this: + +```csharp +public static BooleanAssertions Should(this bool actualValue) +{ + return new BooleanAssertions(actualValue); +} +``` + +On turn, the `BooleanAssertions` would expose a `BeTrue` method + +```csharp +public AndConstraint BeTrue(string because = "", params object[] becauseArgs) +{ + Execute.Assertion + .ForCondition(Subject == true) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:boolean} to be {0}{reason}, but found {1}.", true, Subject); + + return new AndConstraint((TAssertions)this); +} +``` + +To be able to support chaining multiple assertions where the chained assertion can extend the caller identification, we introduced an `AssertionChain` class which instance can flow from one assertion to another. Because of that, the above code changed to: + +```csharp +public static BooleanAssertions Should(this bool actualValue) +{ + return new BooleanAssertions(actualValue, AssertionChain.GetOrCreate()); +} +``` + +Notice how we pass the call to `AssertionChain.GetOrCreate` to the assertions class? By default `GetOrCreate` will create a new instance of `AssertionChain`. But if the previous assertion method uses `AssertionChain.ReuseOnce`, `GetOrCreate` will return that reused instance only once. + +The new `BeTrue` now looks like: + +```csharp +public AndConstraint BeTrue(string because = "", params object[] becauseArgs) +{ + assertionChain + .ForCondition(Subject == true) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:boolean} to be {0}{reason}, but found {1}.", true, Subject); + + return new AndConstraint((TAssertions)this); +} +``` + +So all of the methods to build an assertion that used to live on the `AssertionScope` (which is what `Execute.Assertion` returned), have now moved to `AssertionChain`. This is great because it allows the second assertion to get access to the state of the first assertion. For instance, if the first assertion failed, any successive attempts to call `FailWith` will not do anything. + +## No more `ClearExpectation` + +If you wanted to reuse the first part of the failure message across multiple failures, you could use the following construct (example taken from `TimeOnlyAssertions.BeCloseTo`): + +```csharp +Execute.Assertion + .BecauseOf(because, becauseArgs) + .WithExpectation("Expected {context:the time} to be within {0} from {1}{reason}, ", precision, nearbyTime) + .ForCondition(Subject is not null) + .FailWith("but found .") + .Then + .ForCondition(Subject?.IsCloseTo(nearbyTime, precision) == true) + .FailWith("but {0} was off by {1}.", Subject, difference) + .Then + .ClearExpectation(); +``` + +When using an `using new AssertionScope()` construct to wrap multiple assertions, all assertions executed within that scope will reuse the same instance of `AssertionScope` (which is what `Execute.Assertion` returned). The problem was that you had to explicitly call `ClearExpectation` to prevent the failure message passed to `WithExpectation` to leak into the next assertion within that scope. People often forgot that. + +We solved this in v7, by making `WithExpectation` use a nested construct. This is what it now looks like: + +```csharp +assertionChain + .BecauseOf(because, becauseArgs) + .WithExpectation("Expected {context:the time} to be within {0} from {1}{reason}, ", precision, nearbyTime, chain => chain + .ForCondition(Subject is not null) + .FailWith("but found .") + .Then + .ForCondition(Subject?.IsCloseTo(nearbyTime, precision) == true) + .FailWith("but {0} was off by {1}.", Subject, difference) + ); +``` + +All the code nested within the `WithExpectation` will share the first part of the failure message, and there's no need to explicitly clear it anymore. + +## Amending caller identifiers with `WithPostfix` + +Imagine the following chained assertion + +```csharp +var element = XElement.Parse( + """ + + + + + """); + + +element.Should().HaveElement("child", AtLeast.Twice()).Which.Should().HaveCount(1); +``` + +Prior to version 7, if the `HaveElement` assertion succeeded, but the `NotBeNull` failed, you would get the following exception: + + Expected element to contain 1 item(s), but found 3: {, , }. + +Now, in v7, it'll will return the following: + + Expected element/child to contain 1 item(s), but found 3: {, , }. + +This is possible because `HaveElement` will pass the `AssertionChain` through `ReuseOnce` to the succeeding `HaveCount()` _and_ amend the automatically detected caller identifier `element` (the part on which the first `Should` is invoked) with `"/child"` using `WithCallerPostfix`. Since this is a common thing in v7, the `AndWhichConstraint` has a constructor that does most of that automatically. + +This is what `HaveElement` looks like (with some details left out): + +```csharp +public AndWhichConstraint HaveElement(XName expected, + string because = "", params object[] becauseArgs) +{ + xElement = Subject!.Element(expected); + + assertionChain + .ForCondition(xElement is not null) + .BecauseOf(because, becauseArgs) + .FailWith( + "Expected {context:subject} to have child element {0}{reason}, but no such child element was found.", + expected.ToString().EscapePlaceholders()); + + return new AndWhichConstraint(this, xElement, assertionChain, "/" + expected); +} +``` + +Notice the last argument to the `AndWhichConstraint` constructor. + +## Other breaking changes + +Check out the [release notes](releases.md) for other changes that might affect the upgrade to v7. \ No newline at end of file diff --git a/qodana.yaml b/qodana.yaml index 3f248f5a33..c4d518d378 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -33,6 +33,7 @@ exclude: - name: SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault - name: UnusedMemberInSuper.Global - name: ArrangeAccessorOwnerBody + - name: ParameterHidesMember - name: CollectionNeverUpdated.Local paths: - Tests From a5f61e8ec8b19655063d0123a7a51da493113845 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:14:51 +0100 Subject: [PATCH 424/845] TUnit Framework Support (#2758) * TUnit Framework Support * Update Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj Co-authored-by: Jonas Nyrup * PR comments * PR comments * TestingPlatformFrameworks build target * Fix * XML comments * releases.md update * Update docs * 0.1.1010 * Target TestFrameworks * Update Build.cs * Remove line * Add tunit to introduction.md --------- Co-authored-by: Jonas Nyrup --- .nuke/build.schema.json | 2 + Build/Build.cs | 42 ++++++++++++++++- FluentAssertions.sln | 9 ++++ .../Execution/LoadableTestFramework.cs | 45 +++++++++++++++++++ .../Execution/TUnitFramework.cs | 8 ++++ .../Execution/TestFrameworkProvider.cs | 1 + .../Execution/XUnit2TestFramework.cs | 37 ++------------- Src/FluentAssertions/FluentAssertions.csproj | 4 +- .../TUnit.Specs/FrameworkSpecs.cs | 21 +++++++++ .../TUnit.Specs/TUnit.Specs.csproj | 19 ++++++++ docs/_pages/about.md | 1 + docs/_pages/introduction.md | 2 +- docs/_pages/releases.md | 1 + docs/index.html | 2 +- 14 files changed, 156 insertions(+), 38 deletions(-) create mode 100644 Src/FluentAssertions/Execution/LoadableTestFramework.cs create mode 100644 Src/FluentAssertions/Execution/TUnitFramework.cs create mode 100644 Tests/TestFrameworks/TUnit.Specs/FrameworkSpecs.cs create mode 100644 Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 09b8a34c49..4e286abbb2 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -60,6 +60,8 @@ "Push", "Restore", "SpellCheck", + "VSTestFrameworks", + "TestingPlatformFrameworks", "TestFrameworks", "UnitTests", "UnitTestsNet47", diff --git a/Build/Build.cs b/Build/Build.cs index 5469ae287b..db80b3ff05 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -232,7 +232,7 @@ class Build : NukeBuild Information($"Code coverage report: \x1b]8;;file://{link.Replace('\\', '/')}\x1b\\{link}\x1b]8;;\x1b\\"); }); - Target TestFrameworks => _ => _ + Target VSTestFrameworks => _ => _ .DependsOn(Compile) .OnlyWhenDynamic(() => RunAllTargets || HasSourceChanges) .Executes(() => @@ -270,6 +270,46 @@ from framework in supportedFrameworks .AddLoggers($"trx;LogFileName={v.project.Name}_{v.framework}.trx")), completeOnFailure: true); }); + Target TestingPlatformFrameworks => _ => _ + .DependsOn(Compile) + .OnlyWhenDynamic(() => RunAllTargets || HasSourceChanges) + .Executes(() => + { + Project[] projects = + [ + Solution.TestFrameworks.TUnit_Specs + ]; + + var testCombinations = + from project in projects + let frameworks = project.GetTargetFrameworks() + from framework in frameworks + select new { project, framework }; + + DotNetTest(s => s + .SetConfiguration(Configuration.Debug) + .SetProcessEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE", "en-US") + .EnableNoBuild() + .CombineWith( + testCombinations, + (settings, v) => settings + .SetProjectFile(v.project) + .SetFramework(v.framework) + .SetProcessArgumentConfigurator(args => args + .Add("--") + .Add("--coverage") + .Add("--report-trx") + .Add($"--report-trx-filename {v.project.Name}_{v.framework}.trx") + .Add($"--results-directory {TestResultsDirectory}") + ) + ) + ); + }); + + Target TestFrameworks => _ => _ + .DependsOn(VSTestFrameworks) + .DependsOn(TestingPlatformFrameworks); + Target Pack => _ => _ .DependsOn(ApiChecks) .DependsOn(TestFrameworks) diff --git a/FluentAssertions.sln b/FluentAssertions.sln index 43bf07b29f..5a0259ef34 100644 --- a/FluentAssertions.sln +++ b/FluentAssertions.sln @@ -57,6 +57,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExampleExtensions", "Tests\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentAssertions.Extensibility.Specs", "Tests\FluentAssertions.Extensibility.Specs\FluentAssertions.Extensibility.Specs.csproj", "{450FC408-A4E2-4483-B064-2007024D6CF1}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TUnit.Specs", "Tests\TestFrameworks\TUnit.Specs\TUnit.Specs.csproj", "{6540564E-9B6E-4E1E-8881-6F0DD0F35576}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution CI|Any CPU = CI|Any CPU @@ -165,6 +167,12 @@ Global {450FC408-A4E2-4483-B064-2007024D6CF1}.Debug|Any CPU.Build.0 = Debug|Any CPU {450FC408-A4E2-4483-B064-2007024D6CF1}.Release|Any CPU.ActiveCfg = Release|Any CPU {450FC408-A4E2-4483-B064-2007024D6CF1}.Release|Any CPU.Build.0 = Release|Any CPU + {6540564E-9B6E-4E1E-8881-6F0DD0F35576}.CI|Any CPU.ActiveCfg = Debug|Any CPU + {6540564E-9B6E-4E1E-8881-6F0DD0F35576}.CI|Any CPU.Build.0 = Debug|Any CPU + {6540564E-9B6E-4E1E-8881-6F0DD0F35576}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6540564E-9B6E-4E1E-8881-6F0DD0F35576}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6540564E-9B6E-4E1E-8881-6F0DD0F35576}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6540564E-9B6E-4E1E-8881-6F0DD0F35576}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -187,6 +195,7 @@ Global {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} {450FC408-A4E2-4483-B064-2007024D6CF1} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} + {6540564E-9B6E-4E1E-8881-6F0DD0F35576} = {4D8FA213-8724-4C43-B68A-F018148D238C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {75DDA3D8-9D6F-4865-93F4-DDE11DEE8290} diff --git a/Src/FluentAssertions/Execution/LoadableTestFramework.cs b/Src/FluentAssertions/Execution/LoadableTestFramework.cs new file mode 100644 index 0000000000..859422a25c --- /dev/null +++ b/Src/FluentAssertions/Execution/LoadableTestFramework.cs @@ -0,0 +1,45 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using System.Reflection; + +namespace FluentAssertions.Execution; + +/// +/// This attempts to load the assembly into the App Domain. +/// If it isn't loadable, then IsAvailable will return false +/// +internal abstract class LoadableTestFramework : ITestFramework +{ + private Assembly assembly; + + public bool IsAvailable + { + get + { + try + { + // For netfx the assembly is not in AppDomain by default, so we can't just scan AppDomain.CurrentDomain + assembly = Assembly.Load(new AssemblyName(AssemblyName)); + + return assembly is not null; + } + catch + { + return false; + } + } + } + + [DoesNotReturn] + public void Throw(string message) + { + Type exceptionType = assembly.GetType(ExceptionFullName) + ?? throw new NotSupportedException($"Failed to create {ExceptionFullName}"); + + throw (Exception)Activator.CreateInstance(exceptionType, message)!; + } + + protected internal abstract string AssemblyName { get; } + + protected abstract string ExceptionFullName { get; } +} diff --git a/Src/FluentAssertions/Execution/TUnitFramework.cs b/Src/FluentAssertions/Execution/TUnitFramework.cs new file mode 100644 index 0000000000..27c097a5c1 --- /dev/null +++ b/Src/FluentAssertions/Execution/TUnitFramework.cs @@ -0,0 +1,8 @@ +namespace FluentAssertions.Execution; + +internal class TUnitFramework : LoadableTestFramework +{ + protected override string ExceptionFullName => "TUnit.Assertions.Exceptions.AssertionException"; + + protected internal override string AssemblyName => "TUnit.Assertions"; +} diff --git a/Src/FluentAssertions/Execution/TestFrameworkProvider.cs b/Src/FluentAssertions/Execution/TestFrameworkProvider.cs index f5e291d8f9..4ceab980ca 100644 --- a/Src/FluentAssertions/Execution/TestFrameworkProvider.cs +++ b/Src/FluentAssertions/Execution/TestFrameworkProvider.cs @@ -18,6 +18,7 @@ internal class TestFrameworkProvider ["mspec"] = new MSpecFramework(), ["nunit"] = new NUnitTestFramework(), ["mstestv2"] = new MSTestFrameworkV2(), + ["tunit"] = new TUnitFramework(), ["xunit2"] = new XUnit2TestFramework() // Keep this the last one as it uses a try/catch approach }; diff --git a/Src/FluentAssertions/Execution/XUnit2TestFramework.cs b/Src/FluentAssertions/Execution/XUnit2TestFramework.cs index 5dc2b38012..55fb5b9423 100644 --- a/Src/FluentAssertions/Execution/XUnit2TestFramework.cs +++ b/Src/FluentAssertions/Execution/XUnit2TestFramework.cs @@ -1,40 +1,11 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using System.Reflection; - -namespace FluentAssertions.Execution; +namespace FluentAssertions.Execution; /// /// Implements the XUnit (version 2) test framework adapter. /// -internal class XUnit2TestFramework : ITestFramework +internal class XUnit2TestFramework : LoadableTestFramework { - private Assembly assembly; - - public bool IsAvailable - { - get - { - try - { - // For netfx the assembly is not in AppDomain by default, so we can't just scan AppDomain.CurrentDomain - assembly = Assembly.Load(new AssemblyName("xunit.assert")); - - return assembly is not null; - } - catch - { - return false; - } - } - } - - [DoesNotReturn] - public void Throw(string message) - { - Type exceptionType = assembly.GetType("Xunit.Sdk.XunitException") - ?? throw new NotSupportedException("Failed to create the XUnit assertion type"); + protected internal override string AssemblyName => "xunit.assert"; - throw (Exception)Activator.CreateInstance(exceptionType, message); - } + protected override string ExceptionFullName => "Xunit.Sdk.XunitException"; } diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index e56b7145ae..cac88d3c4e 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -19,14 +19,14 @@ A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher. - Supports the unit test frameworks MSTest2, NUnit3, NUnit4, XUnit2 and MSpec. + Supports the unit test frameworks MSTest2, NUnit3, NUnit4, XUnit2, MSpec and TUnit. Supported by InfoSupport B.V. https://www.fluentassertions.com https://github.com/fluentassertions/fluentassertions git - MSTest2;xUnit;NUnit;MSpec;TDD;BDD;Fluent;netstandard;uwp + MSTest2;xUnit;NUnit;MSpec;TUnit;TDD;BDD;Fluent;netstandard;uwp Apache-2.0 FluentAssertions.png See https://fluentassertions.com/releases/ diff --git a/Tests/TestFrameworks/TUnit.Specs/FrameworkSpecs.cs b/Tests/TestFrameworks/TUnit.Specs/FrameworkSpecs.cs new file mode 100644 index 0000000000..4cf3173f30 --- /dev/null +++ b/Tests/TestFrameworks/TUnit.Specs/FrameworkSpecs.cs @@ -0,0 +1,21 @@ +using System; +using FluentAssertions; + +namespace TUnit.Specs; + +public class FrameworkSpecs +{ + [Test] + public void When_tunit_is_used_it_should_throw_tunit_exceptions_for_assertion_failures() + { + // Act + Action act = () => 0.Should().Be(1); + + // Assert + Exception exception = act.Should().Throw().Which; + + exception.GetType() + .FullName.Should() + .ContainEquivalentOf("TUnit.Assertions.Exceptions.AssertionException"); + } +} diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj new file mode 100644 index 0000000000..25129b86ba --- /dev/null +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -0,0 +1,19 @@ + + + + Exe + net8.0 + TUnit.Specs + TUnit.Specs + + + + + + + + + + + + diff --git a/docs/_pages/about.md b/docs/_pages/about.md index e0f4565207..6109bf8da6 100644 --- a/docs/_pages/about.md +++ b/docs/_pages/about.md @@ -54,6 +54,7 @@ Fluent Assertions supports the following unit test frameworks: * [NUnit](http://www.nunit.org/) * [XUnit2](https://github.com/xunit/xunit/releases) * [MSpec](https://github.com/machine/machine.specifications) +* [TUnit](https://github.com/thomhurst/TUnit) ## Coding by Example diff --git a/docs/_pages/introduction.md b/docs/_pages/introduction.md index 0bdd3eb5b3..19a8fa74b2 100644 --- a/docs/_pages/introduction.md +++ b/docs/_pages/introduction.md @@ -97,7 +97,7 @@ If, for some unknown reason, Fluent Assertions fails to find the assembly, and y ```xml - + diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 8b62f71665..f797c6f6d7 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -19,6 +19,7 @@ sidebar: * Added `BeNaN` and `NotBeNaN` for assertions on `float` and `double` - [#2606](https://github.com/fluentassertions/fluentassertions/pull/2606) * Added option for event monitoring to ignore failing event accessors - [#2629](https://github.com/fluentassertions/fluentassertions/pull/2629) * Added the capability of associating `IValueFormatter`s to a (nested) `AssertionScope` - [#2676](https://github.com/fluentassertions/fluentassertions/pull/2676) +* Added support for throwing TUnit exceptions when using TUnit as your testing framework - [#2758](https://github.com/fluentassertions/fluentassertions/pull/2758) ### Improvements * Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) diff --git a/docs/index.html b/docs/index.html index a43c695d57..35d1a377a1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -54,7 +54,7 @@ image_path: /assets/images/checklist.svg excerpt: ' Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher. -Supports MSTest2, xUnit2, NUnit3, NUnit4 and MSpec. +Supports MSTest2, xUnit2, NUnit3, NUnit4, MSpec and TUnit. ' - title: "Great Support" image_path: /assets/images/customer-service.svg From acd34a51d7faddcd543808389c0d13ed4f781c38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sat, 26 Oct 2024 08:43:01 +0200 Subject: [PATCH 425/845] Simplify inheritance of `SubsequentOrderingAssertions` (#2439) * Fix inheritance of `SubsequentOrderingAssertions` * Simplify inheritance of `SubsequentOrderingAssertions` * Update releases.md --- .../SubsequentOrderingAssertions.cs | 153 ++++++++++++++- ...uentOrderingGenericCollectionAssertions.cs | 178 ------------------ .../FluentAssertions/net47.verified.txt | 13 +- .../FluentAssertions/net6.0.verified.txt | 13 +- .../netstandard2.0.verified.txt | 13 +- .../netstandard2.1.verified.txt | 13 +- docs/_pages/releases.md | 1 + 7 files changed, 156 insertions(+), 228 deletions(-) delete mode 100644 Src/FluentAssertions/Collections/SubsequentOrderingGenericCollectionAssertions.cs diff --git a/Src/FluentAssertions/Collections/SubsequentOrderingAssertions.cs b/Src/FluentAssertions/Collections/SubsequentOrderingAssertions.cs index 82634696b1..4d5b9b51e7 100644 --- a/Src/FluentAssertions/Collections/SubsequentOrderingAssertions.cs +++ b/Src/FluentAssertions/Collections/SubsequentOrderingAssertions.cs @@ -1,16 +1,165 @@ +using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; +using System.Linq.Expressions; +using FluentAssertions.Common; using FluentAssertions.Execution; namespace FluentAssertions.Collections; [DebuggerNonUserCode] public class SubsequentOrderingAssertions - : SubsequentOrderingGenericCollectionAssertions, T, SubsequentOrderingAssertions> + : GenericCollectionAssertions, T> { + private readonly IOrderedEnumerable previousOrderedEnumerable; + private bool subsequentOrdering; + public SubsequentOrderingAssertions(IEnumerable actualValue, IOrderedEnumerable previousOrderedEnumerable, AssertionChain assertionChain) - : base(actualValue, previousOrderedEnumerable, assertionChain) + : base(actualValue, assertionChain) + { + this.previousOrderedEnumerable = previousOrderedEnumerable; + } + + /// + /// Asserts that a subsequence is ordered in ascending order according to the value of the specified + /// . + /// + /// + /// A lambda expression that references the property that should be used to determine the expected ordering. + /// + /// + /// 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 . + /// + /// + /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. + /// + public AndConstraint> ThenBeInAscendingOrder( + Expression> propertyExpression, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + return ThenBeInAscendingOrder(propertyExpression, GetComparer(), because, becauseArgs); + } + + /// + /// Asserts that a subsequence is ordered in ascending order according to the value of the specified + /// and implementation. + /// + /// + /// A lambda expression that references the property that should be used to determine the expected ordering. + /// + /// + /// The object that should be used to determine the expected ordering. + /// + /// + /// 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 . + /// + /// + /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. + /// + /// is . + public AndConstraint> ThenBeInAscendingOrder( + Expression> propertyExpression, IComparer comparer, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), + "Cannot assert collection ordering without specifying a comparer."); + + return ThenBeOrderedBy(propertyExpression, comparer, SortOrder.Ascending, because, becauseArgs); + } + + /// + /// Asserts that a subsequence is ordered in descending order according to the value of the specified + /// . + /// + /// + /// A lambda expression that references the property that should be used to determine the expected ordering. + /// + /// + /// 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 . + /// + /// + /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. + /// + public AndConstraint> ThenBeInDescendingOrder( + Expression> propertyExpression, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + return ThenBeInDescendingOrder(propertyExpression, GetComparer(), because, becauseArgs); + } + + /// + /// Asserts that a subsequence is ordered in descending order according to the value of the specified + /// and implementation. + /// + /// + /// A lambda expression that references the property that should be used to determine the expected ordering. + /// + /// + /// The object that should be used to determine the expected ordering. + /// + /// + /// 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 . + /// + /// + /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. + /// + /// is . + public AndConstraint> ThenBeInDescendingOrder( + Expression> propertyExpression, IComparer comparer, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), + "Cannot assert collection ordering without specifying a comparer."); + + return ThenBeOrderedBy(propertyExpression, comparer, SortOrder.Descending, because, becauseArgs); + } + + private AndConstraint> ThenBeOrderedBy( + Expression> propertyExpression, + IComparer comparer, + SortOrder direction, + [StringSyntax("CompositeFormat")] string because, + object[] becauseArgs) { + subsequentOrdering = true; + return BeOrderedBy(propertyExpression, comparer, direction, because, becauseArgs); + } + + internal sealed override IOrderedEnumerable GetOrderedEnumerable( + Expression> propertyExpression, + IComparer comparer, + SortOrder direction, + ICollection unordered) + { + if (subsequentOrdering) + { + Func keySelector = propertyExpression.Compile(); + + IOrderedEnumerable expectation = direction == SortOrder.Ascending + ? previousOrderedEnumerable.ThenBy(keySelector, comparer) + : previousOrderedEnumerable.ThenByDescending(keySelector, comparer); + + return expectation; + } + + return base.GetOrderedEnumerable(propertyExpression, comparer, direction, unordered); } } diff --git a/Src/FluentAssertions/Collections/SubsequentOrderingGenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/SubsequentOrderingGenericCollectionAssertions.cs deleted file mode 100644 index 789176f263..0000000000 --- a/Src/FluentAssertions/Collections/SubsequentOrderingGenericCollectionAssertions.cs +++ /dev/null @@ -1,178 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Linq.Expressions; -using FluentAssertions.Common; -using FluentAssertions.Execution; - -namespace FluentAssertions.Collections; - -[DebuggerNonUserCode] -public class SubsequentOrderingGenericCollectionAssertions - : GenericCollectionAssertions - where TCollection : IEnumerable - where TAssertions : SubsequentOrderingGenericCollectionAssertions -{ - private readonly IOrderedEnumerable previousOrderedEnumerable; - private bool subsequentOrdering; - - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, IOrderedEnumerable previousOrderedEnumerable, AssertionChain assertionChain) - : base(actualValue, assertionChain) - { - this.previousOrderedEnumerable = previousOrderedEnumerable; - } - - /// - /// Asserts that a subsequence is ordered in ascending order according to the value of the specified - /// . - /// - /// - /// A lambda expression that references the property that should be used to determine the expected ordering. - /// - /// - /// 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 . - /// - /// - /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. - /// - public AndConstraint> ThenBeInAscendingOrder( - Expression> propertyExpression, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - return ThenBeInAscendingOrder(propertyExpression, GetComparer(), because, becauseArgs); - } - - /// - /// Asserts that a subsequence is ordered in ascending order according to the value of the specified - /// and implementation. - /// - /// - /// A lambda expression that references the property that should be used to determine the expected ordering. - /// - /// - /// The object that should be used to determine the expected ordering. - /// - /// - /// 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 . - /// - /// - /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. - /// - /// is . - public AndConstraint> ThenBeInAscendingOrder( - Expression> propertyExpression, IComparer comparer, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), - "Cannot assert collection ordering without specifying a comparer."); - - return ThenBeOrderedBy(propertyExpression, comparer, SortOrder.Ascending, because, becauseArgs); - } - - /// - /// Asserts that a subsequence is ordered in descending order according to the value of the specified - /// . - /// - /// - /// A lambda expression that references the property that should be used to determine the expected ordering. - /// - /// - /// 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 . - /// - /// - /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. - /// - public AndConstraint> ThenBeInDescendingOrder( - Expression> propertyExpression, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - return ThenBeInDescendingOrder(propertyExpression, GetComparer(), because, becauseArgs); - } - - /// - /// Asserts that a subsequence is ordered in descending order according to the value of the specified - /// and implementation. - /// - /// - /// A lambda expression that references the property that should be used to determine the expected ordering. - /// - /// - /// The object that should be used to determine the expected ordering. - /// - /// - /// 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 . - /// - /// - /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. - /// - /// is . - public AndConstraint> ThenBeInDescendingOrder( - Expression> propertyExpression, IComparer comparer, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), - "Cannot assert collection ordering without specifying a comparer."); - - return ThenBeOrderedBy(propertyExpression, comparer, SortOrder.Descending, because, becauseArgs); - } - - private AndConstraint> ThenBeOrderedBy( - Expression> propertyExpression, - IComparer comparer, - SortOrder direction, - [StringSyntax("CompositeFormat")] string because, - object[] becauseArgs) - { - subsequentOrdering = true; - return BeOrderedBy(propertyExpression, comparer, direction, because, becauseArgs); - } - - internal sealed override IOrderedEnumerable GetOrderedEnumerable( - Expression> propertyExpression, - IComparer comparer, - SortOrder direction, - ICollection unordered) - { - if (subsequentOrdering) - { - Func keySelector = propertyExpression.Compile(); - - IOrderedEnumerable expectation = direction == SortOrder.Ascending - ? previousOrderedEnumerable.ThenBy(keySelector, comparer) - : previousOrderedEnumerable.ThenByDescending(keySelector, comparer); - - return expectation; - } - - return base.GetOrderedEnumerable(propertyExpression, comparer, direction, unordered); - } -} - -[DebuggerNonUserCode] -public class SubsequentOrderingGenericCollectionAssertions - : SubsequentOrderingGenericCollectionAssertions> - where TCollection : IEnumerable -{ - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, IOrderedEnumerable previousOrderedEnumerable, AssertionChain assertionChain) - : base(actualValue, previousOrderedEnumerable, assertionChain) - { - } -} diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 5ec01ef85b..f06accb58e 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -553,20 +553,9 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint Equal(params string[] expected) { } public FluentAssertions.AndConstraint NotContainMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } } - public class SubsequentOrderingAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions, T, FluentAssertions.Collections.SubsequentOrderingAssertions> + public class SubsequentOrderingAssertions : FluentAssertions.Collections.GenericCollectionAssertions, T> { public SubsequentOrderingAssertions(System.Collections.Generic.IEnumerable actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } - } - public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions> - where TCollection : System.Collections.Generic.IEnumerable - { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } - } - public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions - where TCollection : System.Collections.Generic.IEnumerable - where TAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions - { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 81ee39274e..028bf653a2 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -566,20 +566,9 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint Equal(params string[] expected) { } public FluentAssertions.AndConstraint NotContainMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } } - public class SubsequentOrderingAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions, T, FluentAssertions.Collections.SubsequentOrderingAssertions> + public class SubsequentOrderingAssertions : FluentAssertions.Collections.GenericCollectionAssertions, T> { public SubsequentOrderingAssertions(System.Collections.Generic.IEnumerable actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } - } - public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions> - where TCollection : System.Collections.Generic.IEnumerable - { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } - } - public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions - where TCollection : System.Collections.Generic.IEnumerable - where TAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions - { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, 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 a487a84ce0..642189a3fb 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -545,20 +545,9 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint Equal(params string[] expected) { } public FluentAssertions.AndConstraint NotContainMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } } - public class SubsequentOrderingAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions, T, FluentAssertions.Collections.SubsequentOrderingAssertions> + public class SubsequentOrderingAssertions : FluentAssertions.Collections.GenericCollectionAssertions, T> { public SubsequentOrderingAssertions(System.Collections.Generic.IEnumerable actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } - } - public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions> - where TCollection : System.Collections.Generic.IEnumerable - { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } - } - public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions - where TCollection : System.Collections.Generic.IEnumerable - where TAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions - { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, 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 dcbbff6216..7af53de71b 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -553,20 +553,9 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint Equal(params string[] expected) { } public FluentAssertions.AndConstraint NotContainMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } } - public class SubsequentOrderingAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions, T, FluentAssertions.Collections.SubsequentOrderingAssertions> + public class SubsequentOrderingAssertions : FluentAssertions.Collections.GenericCollectionAssertions, T> { public SubsequentOrderingAssertions(System.Collections.Generic.IEnumerable actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } - } - public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions> - where TCollection : System.Collections.Generic.IEnumerable - { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } - } - public class SubsequentOrderingGenericCollectionAssertions : FluentAssertions.Collections.GenericCollectionAssertions - where TCollection : System.Collections.Generic.IEnumerable - where TAssertions : FluentAssertions.Collections.SubsequentOrderingGenericCollectionAssertions - { - public SubsequentOrderingGenericCollectionAssertions(TCollection actualValue, System.Linq.IOrderedEnumerable previousOrderedEnumerable, FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInAscendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index f797c6f6d7..745721cda4 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -85,6 +85,7 @@ sidebar: * Allow fluently calling `WithoutMatchingRules` and `WithoutSelectionRules` while using `BeEquivalentTo` - [#2457](https://github.com/fluentassertions/fluentassertions/pull/2457) * Removed `utcNow` overload for `.Monitor()` - [#2629](https://github.com/fluentassertions/fluentassertions/pull/2629) * The semantics of `BeLowerCased`/`BeUpperCased` have been changed to align with the behavior of `ToLower`/`ToUpper` - [#2660](https://github.com/fluentassertions/fluentassertions/pull/2660) +* Simplified the inheritance of `SubsequentOrderingAssertions` by removing the class `SubsequentOrderingGenericCollectionAssertions` - [#2439](https://github.com/fluentassertions/fluentassertions/pull/2439) ### Breaking Changes (for extensions) * Introduced a new `AssertionChain` class whose `GetOrCreate` is used to replace `Execute.Assertion` when writing custom assertions - [2539](https://github.com/fluentassertions/fluentassertions/pull/2539) From 63a36afb9513f84adb69ffa9422bc75308d6e509 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 17:59:56 +0100 Subject: [PATCH 426/845] Bump JetBrains.Annotations from 2024.2.0 to 2024.3.0 (#2790) Bumps [JetBrains.Annotations](https://github.com/JetBrains/JetBrains.Annotations) from 2024.2.0 to 2024.3.0. - [Commits](https://github.com/JetBrains/JetBrains.Annotations/compare/2024.2...2024.3) --- updated-dependencies: - dependency-name: JetBrains.Annotations dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Src/FluentAssertions/FluentAssertions.csproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index cac88d3c4e..320ba7fdd6 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -45,7 +45,7 @@ - + diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index d2571b63bd..64c8cd9a97 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -26,7 +26,7 @@ - + diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index e79bf1df40..d3f3a4152f 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -26,7 +26,7 @@ - + all From b17df353c8a9dd71e976e4a1d5a827b8eaeceba3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:00:15 +0100 Subject: [PATCH 427/845] Bump Meziantou.Analyzer from 2.0.173 to 2.0.176 (#2791) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.173 to 2.0.176. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.173...2.0.176) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index a3a4bfca87..95798bdaac 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From a64d6a2a15bf71421c5348b2193c9e072acb5708 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:00:29 +0100 Subject: [PATCH 428/845] Bump Microsoft.Testing.Extensions.TrxReport from 1.4.0 to 1.4.1 (#2789) Bumps [Microsoft.Testing.Extensions.TrxReport](https://github.com/microsoft/testfx) from 1.4.0 to 1.4.1. - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog-Platform.md) - [Commits](https://github.com/microsoft/testfx/commits) --- updated-dependencies: - dependency-name: Microsoft.Testing.Extensions.TrxReport dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 25129b86ba..9731f5e34d 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -12,7 +12,7 @@ - + From 6b72afd6578117a1dfe81a666e25eb00ed87d2a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:00:45 +0100 Subject: [PATCH 429/845] Bump Roslynator.Analyzers from 4.12.8 to 4.12.9 (#2792) Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.12.8 to 4.12.9. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.12.8...v4.12.9) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 95798bdaac..f38708c1e6 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 1b1f7160b8a0678865324308812ab37c0968fba1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:01:02 +0100 Subject: [PATCH 430/845] Bump the xunit group with 2 updates (#2788) Bumps the xunit group with 2 updates: [Verify.Xunit](https://github.com/VerifyTests/Verify) and [System.Collections.Immutable](https://github.com/dotnet/runtime). Updates `Verify.Xunit` from 27.0.1 to 27.1.0 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/27.0.1...27.1.0) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 205354d423..71f164dd67 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From db41db41b37b410ce6d9f802e573bdfb8522cf61 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:57:38 +0100 Subject: [PATCH 431/845] Bump rexml from 3.3.7 to 3.3.9 in /docs (#2793) Bumps [rexml](https://github.com/ruby/rexml) from 3.3.7 to 3.3.9. - [Release notes](https://github.com/ruby/rexml/releases) - [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md) - [Commits](https://github.com/ruby/rexml/compare/v3.3.7...v3.3.9) --- updated-dependencies: - dependency-name: rexml dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index b4f9cddf03..3c7949a698 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -245,7 +245,7 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rexml (3.3.7) + rexml (3.3.9) rouge (3.30.0) rubyzip (2.3.2) safe_yaml (1.0.5) From 47a941ecc6f2dd92052a8265e70d29d3a80c4945 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Tue, 29 Oct 2024 14:34:08 +0100 Subject: [PATCH 432/845] Fix Qodana for PRs (#2796) Based on feedback from @hybloid --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index 405f6dddbc..60fb973aae 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.merge_commit_sha }} + ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: 'Qodana Scan' uses: JetBrains/qodana-action@v2024.2 From d091986937fbaa60186689691209b5eff9cef352 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Wed, 30 Oct 2024 19:01:46 +0100 Subject: [PATCH 433/845] Add a bunch of assertions on `XElement` and `XDocument` (#2690) --- .../Xml/XDocumentAssertions.cs | 193 ++- .../Xml/XElementAssertions.cs | 430 ++++- .../FluentAssertions/net47.verified.txt | 22 +- .../FluentAssertions/net6.0.verified.txt | 22 +- .../netstandard2.0.verified.txt | 22 +- .../netstandard2.1.verified.txt | 22 +- .../Xml/XDocumentAssertionSpecs.cs | 546 ++++++- .../Xml/XElementAssertionSpecs.cs | 1452 ++++++++++++++--- docs/_pages/releases.md | 18 +- 9 files changed, 2458 insertions(+), 269 deletions(-) diff --git a/Src/FluentAssertions/Xml/XDocumentAssertions.cs b/Src/FluentAssertions/Xml/XDocumentAssertions.cs index f4c39fb40d..7840d53793 100644 --- a/Src/FluentAssertions/Xml/XDocumentAssertions.cs +++ b/Src/FluentAssertions/Xml/XDocumentAssertions.cs @@ -344,7 +344,198 @@ public AndWhichConstraint> HaveElemen } } - return new AndWhichConstraint>(this, xElements, assertionChain, "/" + expected); + return new AndWhichConstraint>(this, xElements, assertionChain, + "/" + expected); + } + + /// + /// Asserts that the of the current doesn't have the specified child element. + /// + /// + /// The name of the expected child element of the current element's . + /// + /// + /// 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 NotHaveElement(string unexpectedElement, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(unexpectedElement, nameof(unexpectedElement)); + + return NotHaveElement(XNamespace.None + unexpectedElement, because, becauseArgs); + } + + /// + /// Asserts that the of the current doesn't have the specified child element. + /// + /// + /// The full name of the expected child element of the current element's . + /// + /// + /// 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 NotHaveElement(XName unexpectedElement, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(unexpectedElement, nameof(unexpectedElement)); + + assertionChain + .BecauseOf(because, becauseArgs) + .WithExpectation("Did not expect {context:subject} to have an element {0}{reason}, ", unexpectedElement, chain => + chain + .ForCondition(Subject is not null) + .FailWith("but the element itself is .") + .Then + .ForCondition(!Subject!.Root!.Elements(unexpectedElement).Any()) + .FailWith(" but the element {0} was found.", unexpectedElement)); + + return new AndConstraint(this); + } + + /// + /// Asserts that the of the current has the specified child element + /// with the specified name. + /// + /// + /// The name of the expected child element of the current element's . + /// + /// + /// The expected value of this particular element. + /// + /// + /// 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 AndWhichConstraint HaveElementWithValue(string expectedElement, + string expectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(expectedElement, nameof(expectedElement)); + Guard.ThrowIfArgumentIsNull(expectedValue, nameof(expectedValue)); + + return HaveElementWithValue(XNamespace.None + expectedElement, expectedValue, because, becauseArgs); + } + + /// + /// Asserts that the of the current has the specified child element + /// with the specified name. + /// + /// + /// The full name of the expected child element of the current element's . + /// + /// + /// The expected value of this particular element. + /// + /// + /// 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 AndWhichConstraint HaveElementWithValue(XName expectedElement, + string expectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(expectedElement, nameof(expectedElement)); + Guard.ThrowIfArgumentIsNull(expectedValue, nameof(expectedValue)); + + IEnumerable xElements = []; + + assertionChain + .WithExpectation("Expected {context:subject} to have an element {0} with value {1}{reason}, ", + expectedElement.ToString(), expectedValue, chain => chain + .ForCondition(Subject is not null) + .BecauseOf(because, becauseArgs) + .FailWith( + "but the element itself is .", + expectedElement.ToString(), expectedValue) + .Then + .Given(() => + { + xElements = Subject!.Root!.Elements(expectedElement).ToList(); + + return xElements; + }) + .ForCondition(collection => collection.Any()) + .FailWith("but the element {0} isn't found.", expectedElement) + .Then + .ForCondition(collection => collection.Any(e => e.Value == expectedValue)) + .FailWith("but the element {0} does not have such a value.", expectedElement)); + + return new AndWhichConstraint(this, xElements.First()); + } + + /// + /// Asserts that the of the current either doesn't have the + /// specified child element or doesn't have the specified . + /// + /// + /// The name of the unexpected child element of the current element's . + /// + /// + /// The unexpected value of this particular element. + /// + /// + /// 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 NotHaveElementWithValue(string unexpectedElement, + string unexpectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(unexpectedElement, nameof(unexpectedElement)); + Guard.ThrowIfArgumentIsNull(unexpectedValue, nameof(unexpectedValue)); + + return NotHaveElementWithValue(XNamespace.None + unexpectedElement, unexpectedValue, because, becauseArgs); + } + + /// + /// Asserts that the of the current either doesn't have the + /// specified child element or doesn't have the specified . + /// + /// + /// he full name of the unexpected child element of the current element's . + /// + /// + /// The unexpected value of this particular element. + /// + /// + /// 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 NotHaveElementWithValue(XName unexpectedElement, + string unexpectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(unexpectedElement, nameof(unexpectedElement)); + Guard.ThrowIfArgumentIsNull(unexpectedValue, nameof(unexpectedValue)); + + assertionChain + .BecauseOf(because, becauseArgs) + .WithExpectation("Did not expect {context:subject} to have an element {0} with value {1}{reason}, ", + unexpectedElement, unexpectedValue, chain => chain + .ForCondition(Subject is not null) + .FailWith("but the element itself is .") + .Then + .ForCondition(Subject!.Root!.Elements(unexpectedElement) + .FirstOrDefault(e => e.Value == unexpectedValue) is null) + .FailWith("but the element {0} does have this value.", unexpectedElement)); + + return new AndConstraint(this); } /// diff --git a/Src/FluentAssertions/Xml/XElementAssertions.cs b/Src/FluentAssertions/Xml/XElementAssertions.cs index c01c43748d..e92be3b140 100644 --- a/Src/FluentAssertions/Xml/XElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XElementAssertions.cs @@ -161,6 +161,123 @@ public AndConstraint HaveValue(string expected, return new AndConstraint(this); } + /// + /// Asserts that the current has an attribute with the specified . + /// + /// The name of the expected attribute + /// + /// 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 . + /// + /// is . + /// is empty. + public AndConstraint HaveAttribute(string expectedName, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNullOrEmpty(expectedName); + + return HaveAttribute(XNamespace.None + expectedName, because, becauseArgs); + } + + /// + /// Asserts that the current has an attribute with the specified . + /// + /// The name of the expected attribute + /// + /// 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 . + /// + /// is . + public AndConstraint HaveAttribute(XName expectedName, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(expectedName); + + string expectedText = expectedName.ToString(); + + assertionChain + .WithExpectation("Expected attribute {0} in element to exist {reason}, ", expectedText, + chain => chain + .BecauseOf(because, becauseArgs) + .ForCondition(Subject is not null) + .FailWith( + "but {context:member} is .")) + .Then + .WithExpectation("Expected {context:subject} to have attribute {0}{reason}, ", expectedText, + chain => chain + .BecauseOf(because, becauseArgs) + .Given(() => Subject!.Attribute(expectedName)) + .ForCondition(attribute => attribute is not null) + .FailWith("but found no such attribute in {0}.", Subject)); + + return new AndConstraint(this); + } + + /// + /// Asserts that the current doesn't have an attribute with the specified . + /// + /// The name of the unexpected attribute + /// + /// 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 . + /// + /// is . + /// is empty. + public AndConstraint NotHaveAttribute(string unexpectedName, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNullOrEmpty(unexpectedName); + + return NotHaveAttribute(XNamespace.None + unexpectedName, because, becauseArgs); + } + + /// + /// Asserts that the current doesn't have an attribute with the specified . + /// + /// The name of the unexpected attribute + /// + /// 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 . + /// + /// is . + public AndConstraint NotHaveAttribute(XName unexpectedName, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(unexpectedName); + + string unexpectedText = unexpectedName.ToString(); + + assertionChain + .WithExpectation("Did not expect attribute {0} in element to exist{reason}, ", unexpectedText, + chain => chain + .BecauseOf(because, becauseArgs) + .ForCondition(Subject is not null) + .FailWith( + "but {context:member} is .", + unexpectedText)) + .Then + .WithExpectation("Did not expect {context:subject} to have attribute {0}{reason}, ", unexpectedText, + chain => chain + .BecauseOf(because, becauseArgs) + .Given(() => Subject!.Attribute(unexpectedName)) + .ForCondition(attribute => attribute is null) + .FailWith("but found such attribute in {0}.", Subject)); + + return new AndConstraint(this); + } + /// /// Asserts that the current has an attribute with the specified /// and . @@ -176,12 +293,12 @@ public AndConstraint HaveValue(string expected, /// /// is . /// is empty. - public AndConstraint HaveAttribute(string expectedName, string expectedValue, + public AndConstraint HaveAttributeWithValue(string expectedName, string expectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNullOrEmpty(expectedName); - return HaveAttribute(XNamespace.None + expectedName, expectedValue, because, becauseArgs); + return HaveAttributeWithValue(XNamespace.None + expectedName, expectedValue, because, becauseArgs); } /// @@ -198,7 +315,7 @@ public AndConstraint HaveAttribute(string expectedName, stri /// Zero or more objects to format using the placeholders in . /// /// is . - public AndConstraint HaveAttribute(XName expectedName, string expectedValue, + public AndConstraint HaveAttributeWithValue(XName expectedName, string expectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(expectedName); @@ -207,33 +324,93 @@ public AndConstraint HaveAttribute(XName expectedName, strin assertionChain .BecauseOf(because, becauseArgs) - .ForCondition(Subject is not null) - .FailWith( - "Expected attribute {0} in element to have value {1}{reason}, but {context:member} is .", - expectedText, expectedValue); + .WithExpectation("Expected attribute {0} in element to have value {1}{reason}, ", + expectedText, expectedValue, + chain => chain + .ForCondition(Subject is not null) + .FailWith("but {context:member} is .")) + .Then + .WithExpectation("Expected {context:subject} to have attribute {0} with value {1}{reason}, ", + expectedText, expectedValue, + chain => chain + .BecauseOf(because, becauseArgs) + .Given(() => Subject!.Attribute(expectedName)) + .ForCondition(attr => attr is not null) + .FailWith("but found no such attribute in {0}", Subject)) + .Then + .WithExpectation("Expected attribute {0} in {context:subject} to have value {1}{reason}, ", + expectedText, expectedValue, + chain => chain + .BecauseOf(because, becauseArgs) + .Given(() => Subject!.Attribute(expectedName)) + .ForCondition(attr => attr!.Value == expectedValue) + .FailWith("but found {0}.", attr => attr.Value)); - if (assertionChain.Succeeded) - { - XAttribute attribute = Subject!.Attribute(expectedName); + return new AndConstraint(this); + } - assertionChain - .ForCondition(attribute is not null) - .BecauseOf(because, becauseArgs) - .FailWith( - "Expected {context:subject} to have attribute {0} with value {1}{reason}," - + " but found no such attribute in {2}", - expectedText, expectedValue, Subject); - - if (assertionChain.Succeeded) - { - assertionChain - .ForCondition(attribute!.Value == expectedValue) + /// + /// Asserts that the current doesn't have an attribute with the specified + /// and/or . + /// + /// The name of the unexpected attribute + /// The value of the unexpected attribute + /// + /// 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 . + /// + /// is . + /// is empty. + public AndConstraint NotHaveAttributeWithValue(string unexpectedName, string unexpectedValue, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNullOrEmpty(unexpectedName, nameof(unexpectedName)); + Guard.ThrowIfArgumentIsNull(unexpectedValue, nameof(unexpectedValue)); + + return NotHaveAttributeWithValue(XNamespace.None + unexpectedName, unexpectedValue, because, becauseArgs); + } + + /// + /// Asserts that the current doesn't have an attribute with the specified + /// and/or . + /// + /// The name of the unexpected attribute + /// The value of the unexpected attribute + /// + /// 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 . + /// + /// is . + public AndConstraint NotHaveAttributeWithValue(XName unexpectedName, string unexpectedValue, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(unexpectedName, nameof(unexpectedName)); + Guard.ThrowIfArgumentIsNull(unexpectedValue, nameof(unexpectedValue)); + + string unexpectedText = unexpectedName.ToString(); + + assertionChain + .WithExpectation("Did not expect attribute {0} in element to have value {1}{reason}, ", + unexpectedText, unexpectedValue, + chain => chain .BecauseOf(because, becauseArgs) - .FailWith( - "Expected attribute {0} in {context:subject} to have value {1}{reason}, but found {2}.", - expectedText, expectedValue, attribute.Value); - } - } + .ForCondition(Subject is not null) + .FailWith("but {context:member} is .")) + .Then + .WithExpectation("Did not expect {context:subject} to have attribute {0} with value {1}{reason}, ", + unexpectedText, unexpectedValue, + chain => chain + .BecauseOf(because, becauseArgs) + .Given(() => Subject!.Attributes() + .FirstOrDefault(a => a.Name == unexpectedName && a.Value == unexpectedValue)) + .ForCondition(attribute => attribute is null) + .FailWith("but found such attribute in {0}.", Subject)); return new AndConstraint(this); } @@ -381,6 +558,205 @@ public AndWhichConstraint> HaveElement return HaveElement(XNamespace.None + expected, occurrenceConstraint, because, becauseArgs); } + /// + /// Asserts that the of the current doesn't have the specified child element. + /// + /// + /// The name of the expected child element of the current element's . + /// + /// + /// 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 NotHaveElement(string unexpectedElement, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(unexpectedElement, nameof(unexpectedElement)); + + return NotHaveElement(XNamespace.None + unexpectedElement, because, becauseArgs); + } + + /// + /// Asserts that the of the current doesn't have the specified child element. + /// + /// + /// The full name of the expected child element of the current element's . + /// + /// + /// 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 NotHaveElement(XName unexpectedElement, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(unexpectedElement, nameof(unexpectedElement)); + + assertionChain + .ForCondition(Subject is not null) + .BecauseOf(because, becauseArgs) + .FailWith( + "Did not expect {context:subject} to have an element {0}{reason}, but the element itself is .", + unexpectedElement.ToString()); + + if (assertionChain.Succeeded) + { + assertionChain + .BecauseOf(because, becauseArgs) + .ForCondition(!Subject!.Elements(unexpectedElement).Any()) + .FailWith("Did not expect {context:subject} to have an element {0}{reason}, " + + "but the element {0} was found.", unexpectedElement); + } + + return new AndConstraint(this); + } + + /// + /// Asserts that the of the current has the specified child element + /// with the specified name. + /// + /// + /// The name of the expected child element of the current element's . + /// + /// + /// The expected value of this particular element. + /// + /// + /// 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 AndWhichConstraint HaveElementWithValue(string expectedElement, + string expectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(expectedElement, nameof(expectedElement)); + Guard.ThrowIfArgumentIsNull(expectedValue, nameof(expectedValue)); + + return HaveElementWithValue(XNamespace.None + expectedElement, expectedValue, because, becauseArgs); + } + + /// + /// Asserts that the of the current has the specified child element + /// with the specified name. + /// + /// + /// The full name of the expected child element of the current element's . + /// + /// + /// The expected value of this particular element. + /// + /// + /// 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 AndWhichConstraint HaveElementWithValue(XName expectedElement, + string expectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(expectedElement, nameof(expectedElement)); + Guard.ThrowIfArgumentIsNull(expectedValue, nameof(expectedValue)); + + IEnumerable xElements = []; + + assertionChain + .WithExpectation("Expected {context:subject} to have an element {0} with value {1}{reason}, ", + expectedElement.ToString(), expectedValue, + chain => chain + .ForCondition(Subject is not null) + .BecauseOf(because, becauseArgs) + .FailWith("but the element itself is .")) + .Then + .WithExpectation("Expected {context:subject} to have an element {0} with value {1}{reason}, ", + expectedElement, expectedValue, chain => chain + .BecauseOf(because, becauseArgs) + .Given(() => + { + xElements = Subject!.Elements(expectedElement); + + return xElements; + }) + .ForCondition(elements => elements.Any()) + .FailWith("but the element {0} isn't found.", expectedElement) + .Then + .ForCondition(elements => elements.Any(e => e.Value == expectedValue)) + .FailWith("but the element {0} does not have such a value.", expectedElement)); + + return new AndWhichConstraint(this, xElements.First()); + } + + /// + /// Asserts that the of the current either doesn't have the + /// specified child element or doesn't have the specified . + /// + /// + /// The name of the unexpected child element of the current element's . + /// + /// + /// The unexpected value of this particular element. + /// + /// + /// 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 NotHaveElementWithValue(string unexpectedElement, + string unexpectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(unexpectedElement, nameof(unexpectedElement)); + Guard.ThrowIfArgumentIsNull(unexpectedValue, nameof(unexpectedValue)); + + return NotHaveElementWithValue(XNamespace.None + unexpectedElement, unexpectedValue, because, becauseArgs); + } + + /// + /// Asserts that the of the current either doesn't have the + /// specified child element or doesn't have the specified . + /// + /// + /// he full name of the unexpected child element of the current element's . + /// + /// + /// The unexpected value of this particular element. + /// + /// + /// 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 NotHaveElementWithValue(XName unexpectedElement, + string unexpectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(unexpectedElement, nameof(unexpectedElement)); + Guard.ThrowIfArgumentIsNull(unexpectedValue, nameof(unexpectedValue)); + + assertionChain + .WithExpectation("Did not expect {context:subject} to have an element {0} with value {1}{reason}, ", + unexpectedElement.ToString(), unexpectedValue, + chain => chain + .ForCondition(Subject is not null) + .BecauseOf(because, becauseArgs) + .FailWith("but the element itself is .") + .Then + .ForCondition(Subject!.Elements(unexpectedElement) + .FirstOrDefault(e => e.Value == unexpectedValue) is null) + .FailWith("but the element {0} does have this value.", unexpectedElement)); + + return new AndConstraint(this); + } + /// /// Returns the type of the subject the assertion applies on. /// diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index f06accb58e..0bb163517b 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -2550,10 +2550,16 @@ namespace FluentAssertions.Xml public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(System.Xml.Linq.XName expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveRoot(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveRoot(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(System.Xml.Linq.XName unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(System.Xml.Linq.XName unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } } public class XElementAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { @@ -2561,15 +2567,27 @@ namespace FluentAssertions.Xml protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttribute(System.Xml.Linq.XName expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttribute(System.Xml.Linq.XName expectedName, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttributeWithValue(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttributeWithValue(System.Xml.Linq.XName expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(System.Xml.Linq.XName expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttribute(string unexpectedName, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttribute(System.Xml.Linq.XName unexpectedName, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttributeWithValue(string unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttributeWithValue(System.Xml.Linq.XName unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(System.Xml.Linq.XName unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(System.Xml.Linq.XName unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } } public class XmlElementAssertions : FluentAssertions.Xml.XmlNodeAssertions { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 028bf653a2..ef4e55d598 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -2680,10 +2680,16 @@ namespace FluentAssertions.Xml public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(System.Xml.Linq.XName expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveRoot(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveRoot(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(System.Xml.Linq.XName unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(System.Xml.Linq.XName unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } } public class XElementAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { @@ -2691,15 +2697,27 @@ namespace FluentAssertions.Xml protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttribute(System.Xml.Linq.XName expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttribute(System.Xml.Linq.XName expectedName, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttributeWithValue(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttributeWithValue(System.Xml.Linq.XName expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(System.Xml.Linq.XName expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttribute(string unexpectedName, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttribute(System.Xml.Linq.XName unexpectedName, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttributeWithValue(string unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttributeWithValue(System.Xml.Linq.XName unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(System.Xml.Linq.XName unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(System.Xml.Linq.XName unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } } public class XmlElementAssertions : FluentAssertions.Xml.XmlNodeAssertions { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 642189a3fb..cf3bf3559d 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -2494,10 +2494,16 @@ namespace FluentAssertions.Xml public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(System.Xml.Linq.XName expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveRoot(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveRoot(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(System.Xml.Linq.XName unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(System.Xml.Linq.XName unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } } public class XElementAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { @@ -2505,15 +2511,27 @@ namespace FluentAssertions.Xml protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttribute(System.Xml.Linq.XName expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttribute(System.Xml.Linq.XName expectedName, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttributeWithValue(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttributeWithValue(System.Xml.Linq.XName expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(System.Xml.Linq.XName expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttribute(string unexpectedName, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttribute(System.Xml.Linq.XName unexpectedName, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttributeWithValue(string unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttributeWithValue(System.Xml.Linq.XName unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(System.Xml.Linq.XName unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(System.Xml.Linq.XName unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } } public class XmlElementAssertions : FluentAssertions.Xml.XmlNodeAssertions { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 7af53de71b..949879282d 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -2552,10 +2552,16 @@ namespace FluentAssertions.Xml public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(System.Xml.Linq.XName expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveRoot(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveRoot(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(System.Xml.Linq.XName unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(System.Xml.Linq.XName unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } } public class XElementAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { @@ -2563,15 +2569,27 @@ namespace FluentAssertions.Xml protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttribute(System.Xml.Linq.XName expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttribute(System.Xml.Linq.XName expectedName, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttributeWithValue(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttributeWithValue(System.Xml.Linq.XName expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(System.Xml.Linq.XName expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttribute(string unexpectedName, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttribute(System.Xml.Linq.XName unexpectedName, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttributeWithValue(string unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttributeWithValue(System.Xml.Linq.XName unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(System.Xml.Linq.XName unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(System.Xml.Linq.XName unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } } public class XmlElementAssertions : FluentAssertions.Xml.XmlNodeAssertions { diff --git a/Tests/FluentAssertions.Specs/Xml/XDocumentAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Xml/XDocumentAssertionSpecs.cs index 0c7270b0b0..d997bf1a2d 100644 --- a/Tests/FluentAssertions.Specs/Xml/XDocumentAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Xml/XDocumentAssertionSpecs.cs @@ -1193,7 +1193,7 @@ public void XElement matchedElement = document.Should().HaveElement("child").Subject; // Assert - matchedElement.Should().BeOfType().And.HaveAttribute("attr", "1"); + matchedElement.Should().BeOfType().And.HaveAttributeWithValue("attr", "1"); matchedElement.Name.Should().Be(XName.Get("child")); } @@ -1268,6 +1268,221 @@ public void When_asserting_a_document_has_an_element_with_a_null_xname_it_should } } + public class HaveElementWithValue + { + [Fact] + public void The_document_cannot_be_null() + { + // Arrange + XDocument document = null; + + // Act + Action act = () => document.Should().HaveElementWithValue("child", "b"); + + // Assert + act.Should().Throw().WithMessage("*child*b*element itself is *"); + } + + [Fact] + public void The_expected_element_with_the_expected_value_is_valid() + { + // Arrange + var document = XDocument.Parse( + """ + + a + b + + """); + + // Act / Assert + document.Should().HaveElementWithValue("child", "b"); + } + + [Fact] + public void Throws_when_element_is_not_found() + { + // Arrange + var document = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => document.Should().HaveElementWithValue("grandchild", "f"); + + // Assert + act.Should().Throw().WithMessage("*grandchild*f*element*isn't found*"); + } + + [Fact] + public void Throws_when_element_found_but_value_does_not_match() + { + // Arrange + var document = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => document.Should().HaveElementWithValue("child", "c"); + + // Assert + act.Should().Throw().WithMessage("*child*c*element*does not have such a value*"); + } + + [Fact] + public void Throws_when_expected_element_is_null() + { + // Arrange + var document = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => document.Should().HaveElementWithValue(null, "a"); + + // Assert + act.Should().Throw().WithMessage("*expectedElement*"); + } + + [Fact] + public void Throws_when_expected_element_with_namespace_is_null() + { + // Arrange + var document = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => document.Should().HaveElementWithValue((XName)null, "a"); + + // Assert + act.Should().Throw().WithMessage("*expectedElement*"); + } + + [Fact] + public void Throws_when_expected_value_is_null() + { + // Arrange + var document = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => document.Should().HaveElementWithValue("child", null); + + // Assert + act.Should().Throw().WithMessage("*expectedValue*"); + } + + [Fact] + public void Throws_when_expected_value_is_null_and_searching_with_namespace() + { + // Arrange + var document = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => document.Should().HaveElementWithValue(XNamespace.None + "child", null); + + // Assert + act.Should().Throw().WithMessage("*expectedValue*"); + } + + [Fact] + public void The_document_cannot_be_null_and_using_a_namespace() + { + // Arrange + XDocument document = null; + + // Act + Action act = () => + document.Should() + .HaveElementWithValue(XNamespace.None + "child", "b", "we want to test the {0} message", "failure"); + + // Assert + act.Should().Throw().WithMessage("*child*b*failure message*element itself is *"); + } + + [Fact] + public void Has_element_with_namespace_and_specified_value() + { + // Arrange + var document = XDocument.Parse( + """ + + a + b + + """); + + // Act / Assert + document.Should().HaveElementWithValue(XNamespace.None + "child", "b"); + } + + [Fact] + public void Throws_when_element_with_namespace_is_not_found() + { + // Arrange + var document = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => document.Should().HaveElementWithValue(XNamespace.None + "grandchild", "f"); + + // Assert + act.Should().Throw().WithMessage("*grandchild*f*element*isn't found*"); + } + + [Fact] + public void Throws_when_element_with_namespace_found_but_value_does_not_match() + { + // Arrange + var document = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => document.Should().HaveElementWithValue(XNamespace.None + "child", "c"); + + // Assert + act.Should().Throw().WithMessage("*child*c*element*does not have such a value*"); + } + } + public class HaveElementWithOccurrence { [Fact] @@ -1446,4 +1661,333 @@ public void When_asserting_a_null_document_to_have_an_element_count_it_should_fa "Cannot assert the count if the document itself is ."); } } + + public class NotHaveElement + { + [Fact] + public void The_document_cannot_be_null() + { + // Arrange + XDocument document = null; + + // Act + Action act = () => document.Should().NotHaveElement("child"); + + // Assert + act.Should().Throw().WithMessage("*child*b*element itself is *"); + } + + [Fact] + public void The_document_does_not_have_this_element() + { + // Arrange + var document = XDocument.Parse( + """ + + a + b + + """); + + // Act / Assert + document.Should().NotHaveElement("c"); + } + + [Fact] + public void Throws_when_element_found_but_expected_to_be_absent() + { + // Arrange + var document = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => document.Should().NotHaveElement("child"); + + // Assert + act.Should().Throw().WithMessage("*Did not*child*element*was found*"); + } + + [Fact] + public void Throws_when_unexpected_element_is_null() + { + // Arrange + var document = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => document.Should().NotHaveElement(null); + + // Assert + act.Should().Throw().WithMessage("*unexpectedElement*"); + } + + [Fact] + public void Throws_when_unexpected_element_is_null_with_namespace() + { + // Arrange + var document = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => document.Should().NotHaveElement((XName)null); + + // Assert + act.Should().Throw().WithMessage("*unexpectedElement*"); + } + + [Fact] + public void Throws_when_null_with_namespace() + { + // Arrange + XDocument document = null; + + // Act + Action act = () => + document.Should() + .NotHaveElement(XNamespace.None + "child", "we want to test the {0} message", "failure"); + + // Assert + act.Should().Throw().WithMessage("*child*failure message*element itself is *"); + } + + [Fact] + public void Not_have_element_with_with_namespace() + { + // Arrange + var document = XDocument.Parse( + """ + + a + b + + """); + + // Act / Assert + document.Should().NotHaveElement(XNamespace.None + "c"); + } + } + + public class NotHaveElementWithValue + { + [Fact] + public void The_document_cannot_be_null() + { + // Arrange + XDocument element = null; + + // Act + Action act = () => element.Should().NotHaveElementWithValue("child", "b"); + + // Assert + act.Should().Throw().WithMessage("*child*b*element itself is *"); + } + + [Fact] + public void Throws_when_element_with_specified_value_is_found() + { + // Arrange + var element = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().NotHaveElementWithValue("child", "b"); + + // Assert + act.Should().Throw().WithMessage("Did not*element*child*value*b*does have this value*"); + } + + [Fact] + public void Passes_when_element_not_found() + { + // Arrange + var element = XDocument.Parse( + """ + + a + b + + """); + + // Act / Assert + element.Should().NotHaveElementWithValue("c", "f"); + } + + [Fact] + public void Passes_when_element_found_but_value_does_not_match() + { + // Arrange + var element = XDocument.Parse( + """ + + a + b + + """); + + // Act / Assert + element.Should().NotHaveElementWithValue("child", "c"); + } + + [Fact] + public void Throws_when_expected_element_is_null() + { + // Arrange + var element = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().NotHaveElementWithValue(null, "a"); + + // Assert + act.Should().Throw().WithMessage("*expectedElement*"); + } + + [Fact] + public void Throws_when_expected_element_is_null_with_namespace() + { + // Arrange + var element = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().NotHaveElementWithValue((XName)null, "a"); + + // Assert + act.Should().Throw().WithMessage("*expectedElement*"); + } + + [Fact] + public void Throws_when_expected_value_is_null() + { + // Arrange + var element = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().NotHaveElementWithValue("child", null); + + // Assert + act.Should().Throw().WithMessage("*expectedValue*"); + } + + [Fact] + public void Throws_when_expected_value_is_null_with_namespace() + { + // Arrange + var element = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().NotHaveElementWithValue(XNamespace.None + "child", null); + + // Assert + act.Should().Throw().WithMessage("*expectedValue*"); + } + + [Fact] + public void The_document_cannot_be_null_and_searching_with_namespace() + { + // Arrange + XDocument element = null; + + // Act + Action act = () => + element.Should().NotHaveElementWithValue(XNamespace.None + "child", "b", "we want to test the {0} message", + "failure"); + + // Assert + act.Should().Throw().WithMessage("*child*b*failure message*element itself is *"); + } + + [Fact] + public void Throws_when_element_with_specified_value_is_found_with_namespace() + { + // Arrange + var element = XDocument.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().NotHaveElementWithValue(XNamespace.None + "child", "b"); + + // Assert + act.Should().Throw().WithMessage("Did not expect*element*child*value*b*does have this value*"); + } + + [Fact] + public void Passes_when_element_with_namespace_not_found() + { + // Arrange + var element = XDocument.Parse( + """ + + a + b + + """); + + // Act / Assert + element.Should().NotHaveElementWithValue(XNamespace.None + "c", "f"); + } + + [Fact] + public void Passes_when_element_with_namespace_found_but_value_does_not_match() + { + // Arrange + var element = XDocument.Parse( + """ + + a + b + + """); + + // Act / Assert + element.Should().NotHaveElementWithValue(XNamespace.None + "child", "c"); + } + } } diff --git a/Tests/FluentAssertions.Specs/Xml/XElementAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Xml/XElementAssertionSpecs.cs index c84f36c1ac..3b778bbe67 100644 --- a/Tests/FluentAssertions.Specs/Xml/XElementAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Xml/XElementAssertionSpecs.cs @@ -849,584 +849,1590 @@ public void When_xml_element_is_null_then_have_value_should_fail() public class HaveAttribute { [Fact] - public void When_asserting_element_has_attribute_with_specific_value_and_it_does_it_should_succeed() + public void Passes_when_attribute_found() { // Arrange var element = XElement.Parse(@""); - // Act - Action act = () => - element.Should().HaveAttribute("name", "martin"); - - // Assert - act.Should().NotThrow(); + // Act / Assert + element.Should().HaveAttribute("name"); } [Fact] - public void When_asserting_element_has_attribute_with_ns_and_specific_value_and_it_does_it_should_succeed() + public void Passes_when_attribute_found_with_namespace() { // Arrange var element = XElement.Parse(""""""); - // Act - Action act = () => - element.Should().HaveAttribute(XName.Get("name", "http://www.example.com/2012/test"), "martin"); - - // Assert - act.Should().NotThrow(); + // Act / Assert + element.Should().HaveAttribute(XName.Get("name", "http://www.example.com/2012/test")); } [Fact] - public void When_asserting_element_has_attribute_with_specific_value_but_attribute_does_not_exist_it_should_fail() + public void Throws_when_attribute_is_not_found() { // Arrange var theElement = XElement.Parse(""""""); // Act Action act = () => - theElement.Should().HaveAttribute("age", "36"); + theElement.Should().HaveAttribute("age", "because we want to test the failure {0}", "message"); // Assert act.Should().Throw().WithMessage( - "Expected theElement to have attribute \"age\" with value \"36\", but found no such attribute in "); + "Expected theElement to have attribute \"age\"*failure message*, but found no such attribute in *"); } [Fact] - public void When_asserting_element_has_attribute_with_ns_and_specific_value_but_attribute_does_not_exist_it_should_fail() + public void Throws_when_attribute_is_not_found_with_namespace() { // Arrange var theElement = XElement.Parse(""""""); // Act Action act = () => - theElement.Should().HaveAttribute(XName.Get("age", "http://www.example.com/2012/test"), "36"); + theElement.Should().HaveAttribute(XName.Get("age", "http://www.example.com/2012/test"), + "because we want to test the failure {0}", "message"); // Assert act.Should().Throw().WithMessage( - "Expected theElement to have attribute \"{http://www.example.com/2012/test}age\" with value \"36\"," - + " but found no such attribute in "); + "Expected theElement to have attribute \"{http://www.example.com/2012/test}age\"" + + "*failure message*but found no such attribute in *"); } [Fact] - public void - When_asserting_element_has_attribute_with_specific_value_but_attribute_does_not_exist_it_should_fail_with_descriptive_message() + public void Throws_when_xml_element_is_null() { - // Arrange - var theElement = XElement.Parse(""""""); + XElement theElement = null; // Act Action act = () => - { - using var _ = new AssertionScope(); - theElement.Should().HaveAttribute("age", "36", "because we want to test the failure {0}", "message"); - }; + theElement.Should().HaveAttribute("name", "we want to test the failure {0}", "message"); // Assert - act.Should().Throw().WithMessage( - "Expected theElement to have attribute \"age\" with value \"36\" because we want to test the failure message," - + " but found no such attribute in "); + act.Should().Throw() + .WithMessage( + "Expected attribute \"name\" in element *failure message*" + + ", but theElement is ."); } [Fact] - public void - When_asserting_element_has_attribute_with_ns_and_specific_value_but_attribute_does_not_exist_it_should_fail_with_descriptive_message() + public void Throws_when_xml_element_is_null_with_namespace() { - // Arrange - var theElement = XElement.Parse(""""""); + XElement theElement = null; // Act Action act = () => - theElement.Should().HaveAttribute(XName.Get("age", "http://www.example.com/2012/test"), "36", - "because we want to test the failure {0}", "message"); + theElement.Should().HaveAttribute((XName)"name", "we want to test the failure {0}", "message"); // Assert - act.Should().Throw().WithMessage( - "Expected theElement to have attribute \"{http://www.example.com/2012/test}age\" with value \"36\"" - + " because we want to test the failure message," - + " but found no such attribute in "); + act.Should().Throw() + .WithMessage( + "Expected attribute \"name\" in element*failure message*" + + ", but theElement is ."); } [Fact] - public void When_asserting_element_has_attribute_with_specific_value_but_attribute_has_different_value_it_should_fail() + public void Throws_when_expectation_is_null() { - // Arrange - var theElement = XElement.Parse(""""""); + XElement theElement = new("element"); // Act Action act = () => - theElement.Should().HaveAttribute("name", "dennis"); + theElement.Should().HaveAttribute(null); // Assert - act.Should().Throw().WithMessage( - "Expected attribute \"name\" in theElement to have value \"dennis\", but found \"martin\"."); + act.Should().ThrowExactly() + .WithParameterName("expectedName"); } [Fact] - public void - When_asserting_element_has_attribute_with_ns_and_specific_value_but_attribute_has_different_value_it_should_fail() + public void Throws_when_expectation_is_null_with_namespace() { - // Arrange - var theElement = XElement.Parse(""""""); + XElement theElement = new("element"); // Act Action act = () => - theElement.Should().HaveAttribute(XName.Get("name", "http://www.example.com/2012/test"), "dennis"); + theElement.Should().HaveAttribute((XName)null); // Assert - act.Should().Throw().WithMessage( - "Expected attribute \"{http://www.example.com/2012/test}name\" in theElement to have value \"dennis\", but found \"martin\"."); + act.Should().ThrowExactly() + .WithParameterName("expectedName"); } [Fact] - public void - When_asserting_element_has_attribute_with_specific_value_but_attribute_has_different_value_it_should_fail_with_descriptive_message() + public void Throws_when_expectation_is_empty() + { + XElement theElement = new("element"); + + // Act + Action act = () => + theElement.Should().HaveAttribute(string.Empty); + + // Assert + act.Should().ThrowExactly() + .WithParameterName("expectedName"); + } + } + + public class NotHaveAttribute + { + [Fact] + public void Passes_when_attribute_not_found() + { + // Arrange + var element = XElement.Parse(@""); + + // Act / Assert + element.Should().NotHaveAttribute("surname"); + } + + [Fact] + public void Passes_when_attribute_not_found_with_namespace() + { + // Arrange + var element = XElement.Parse(""""""); + + // Act / Assert + element.Should().NotHaveAttribute(XName.Get("surname", "http://www.example.com/2012/test")); + } + + [Fact] + public void Throws_when_attribute_is_found() { // Arrange var theElement = XElement.Parse(""""""); // Act Action act = () => - theElement.Should().HaveAttribute("name", "dennis", "because we want to test the failure {0}", "message"); + theElement.Should().NotHaveAttribute("name", "because we want to test the failure {0}", "message"); // Assert act.Should().Throw().WithMessage( - "Expected attribute \"name\" in theElement to have value \"dennis\"" - + " because we want to test the failure message, but found \"martin\"."); + "Did not expect theElement to have attribute \"name\"*failure message*, but found such attribute in *"); } [Fact] - public void - When_asserting_element_has_attribute_with_ns_and_specific_value_but_attribute_has_different_value_it_should_fail_with_descriptive_message() + public void Throws_when_attribute_is_found_with_namespace() { // Arrange var theElement = XElement.Parse(""""""); // Act Action act = () => - theElement.Should().HaveAttribute(XName.Get("name", "http://www.example.com/2012/test"), "dennis", + theElement.Should().NotHaveAttribute(XName.Get("name", "http://www.example.com/2012/test"), "because we want to test the failure {0}", "message"); // Assert act.Should().Throw().WithMessage( - "Expected attribute \"{http://www.example.com/2012/test}name\" in theElement to have value \"dennis\"" - + " because we want to test the failure message, but found \"martin\"."); + "Did not expect theElement to have attribute \"{http://www.example.com/2012/test}name\"" + + "*failure message*but found such attribute in *"); } [Fact] - public void When_xml_element_is_null_then_have_attribute_should_fail() + public void Throws_when_xml_element_is_null() { XElement theElement = null; // Act Action act = () => - theElement.Should().HaveAttribute("name", "value", "we want to test the failure {0}", "message"); + theElement.Should().NotHaveAttribute("name", "we want to test the failure {0}", "message"); // Assert act.Should().Throw() .WithMessage( - "Expected attribute \"name\" in element to have value \"value\" *failure message*" + + "Did not expect attribute \"name\" in element *failure message*" + ", but theElement is ."); } [Fact] - public void When_xml_element_is_null_then_have_attribute_with_XName_should_fail() + public void Throws_when_xml_element_is_null_with_namespace() { XElement theElement = null; // Act Action act = () => - theElement.Should().HaveAttribute((XName)"name", "value", "we want to test the failure {0}", "message"); + theElement.Should().NotHaveAttribute((XName)"name", "we want to test the failure {0}", "message"); // Assert act.Should().Throw() .WithMessage( - "Expected attribute \"name\" in element to have value \"value\" *failure message*" + + "Did not expect attribute \"name\" in element*failure message*" + ", but theElement is ."); } [Fact] - public void When_asserting_element_has_an_attribute_with_a_null_name_it_should_throw() + public void Throws_when_expectation_is_null() { XElement theElement = new("element"); // Act Action act = () => - theElement.Should().HaveAttribute(null, "value"); + theElement.Should().NotHaveAttribute(null); // Assert act.Should().ThrowExactly() - .WithParameterName("expectedName"); + .WithParameterName("unexpectedName"); } [Fact] - public void When_asserting_element_has_an_attribute_with_a_null_XName_it_should_throw() + public void Throws_when_expectation_is_null_with_namespace() { XElement theElement = new("element"); // Act Action act = () => - theElement.Should().HaveAttribute((XName)null, "value"); + theElement.Should().NotHaveAttribute((XName)null); // Assert act.Should().ThrowExactly() - .WithParameterName("expectedName"); + .WithParameterName("unexpectedName"); } [Fact] - public void When_asserting_element_has_an_attribute_with_an_empty_name_it_should_throw() + public void Throws_when_expectation_is_empty() { XElement theElement = new("element"); // Act Action act = () => - theElement.Should().HaveAttribute(string.Empty, "value"); + theElement.Should().NotHaveAttribute(string.Empty); // Assert act.Should().ThrowExactly() - .WithParameterName("expectedName"); + .WithParameterName("unexpectedName"); } } - public class HaveElement + public class HaveAttributeWithValue { [Fact] - public void When_asserting_element_has_child_element_and_it_does_it_should_succeed() + public void When_asserting_element_has_attribute_with_specific_value_and_it_does_it_should_succeed() { // Arrange - var element = XElement.Parse( - """ - - - - """); + var element = XElement.Parse(@""); // Act Action act = () => - element.Should().HaveElement("child"); + element.Should().HaveAttributeWithValue("name", "martin"); // Assert act.Should().NotThrow(); } [Fact] - public void When_asserting_element_has_child_element_with_ns_and_it_does_it_should_succeed() + public void When_asserting_element_has_attribute_with_ns_and_specific_value_and_it_does_it_should_succeed() { // Arrange - var element = XElement.Parse( - """ - - - - """); + var element = XElement.Parse(""""""); // Act Action act = () => - element.Should().HaveElement(XName.Get("child", "http://www.example.com/2012/test")); + element.Should().HaveAttributeWithValue(XName.Get("name", "http://www.example.com/2012/test"), "martin"); // Assert act.Should().NotThrow(); } [Fact] - public void When_asserting_element_has_child_element_but_it_does_not_it_should_fail() + public void When_asserting_element_has_attribute_with_specific_value_but_attribute_does_not_exist_it_should_fail() { // Arrange - var theElement = XElement.Parse( - """ - - - - """); + var theElement = XElement.Parse(""""""); // Act Action act = () => - theElement.Should().HaveElement("unknown"); + theElement.Should().HaveAttributeWithValue("age", "36"); // Assert act.Should().Throw().WithMessage( - "Expected theElement to have child element \"unknown\", but no such child element was found."); + "Expected theElement to have attribute \"age\" with value \"36\", but found no such attribute in "); } [Fact] - public void When_asserting_element_has_child_element_with_ns_but_it_does_not_it_should_fail() + public void When_asserting_element_has_attribute_with_ns_and_specific_value_but_attribute_does_not_exist_it_should_fail() { // Arrange - var theElement = XElement.Parse( - """ - - - - """); + var theElement = XElement.Parse(""""""); // Act Action act = () => - theElement.Should().HaveElement(XName.Get("unknown", "http://www.example.com/2012/test")); + theElement.Should().HaveAttributeWithValue(XName.Get("age", "http://www.example.com/2012/test"), "36"); // Assert act.Should().Throw().WithMessage( - "Expected theElement to have child element \"{{http://www.example.com/2012/test}}unknown\", but no such child element was found."); + "Expected theElement to have attribute \"{http://www.example.com/2012/test}age\" with value \"36\"," + + " but found no such attribute in "); } [Fact] - public void When_asserting_element_has_child_element_but_it_does_not_it_should_fail_with_descriptive_message() + public void + When_asserting_element_has_attribute_with_specific_value_but_attribute_does_not_exist_it_should_fail_with_descriptive_message() { // Arrange - var theElement = XElement.Parse( - """ - - - - """); + var theElement = XElement.Parse(""""""); // Act Action act = () => - theElement.Should().HaveElement("unknown", "because we want to test the failure message"); + { + using var _ = new AssertionScope(); + theElement.Should().HaveAttributeWithValue("age", "36", "because we want to test the failure {0}", "message"); + }; // Assert act.Should().Throw().WithMessage( - "Expected theElement to have child element \"unknown\" because we want to test the failure message," - + " but no such child element was found."); + "Expected theElement to have attribute \"age\" with value \"36\" because we want to test the failure message," + + " but found no such attribute in "); } [Fact] - public void When_asserting_element_has_child_element_with_ns_but_it_does_not_it_should_fail_with_descriptive_message() + public void + When_asserting_element_has_attribute_with_ns_and_specific_value_but_attribute_does_not_exist_it_should_fail_with_descriptive_message() { // Arrange - var theElement = XElement.Parse( - """ - - - - """); + var theElement = XElement.Parse(""""""); // Act Action act = () => - theElement.Should().HaveElement(XName.Get("unknown", "http://www.example.com/2012/test"), - "because we want to test the failure message"); + theElement.Should().HaveAttributeWithValue(XName.Get("age", "http://www.example.com/2012/test"), "36", + "because we want to test the failure {0}", "message"); // Assert act.Should().Throw().WithMessage( - "Expected theElement to have child element \"{{http://www.example.com/2012/test}}unknown\"" - + " because we want to test the failure message, but no such child element was found."); + "Expected theElement to have attribute \"{http://www.example.com/2012/test}age\" with value \"36\"" + + " because we want to test the failure message," + + " but found no such attribute in "); } [Fact] - public void When_asserting_element_has_child_element_it_should_return_the_matched_element_in_the_which_property() + public void When_asserting_element_has_attribute_with_specific_value_but_attribute_has_different_value_it_should_fail() { // Arrange - var element = XElement.Parse( - """ - - - - """); + var theElement = XElement.Parse(""""""); // Act - var matchedElement = element.Should().HaveElement("child").Subject; + Action act = () => + theElement.Should().HaveAttributeWithValue("name", "dennis"); // Assert - matchedElement.Should().BeOfType() - .And.HaveAttribute("attr", "1"); - - matchedElement.Name.Should().Be(XName.Get("child")); + act.Should().Throw().WithMessage( + "Expected attribute \"name\" in theElement to have value \"dennis\", but found \"martin\"."); } [Fact] - public void When_asserting_element_has_a_child_element_with_a_null_name_it_should_throw() + public void + When_asserting_element_has_attribute_with_ns_and_specific_value_but_attribute_has_different_value_it_should_fail() { - XElement theElement = new("element"); + // Arrange + var theElement = XElement.Parse(""""""); // Act Action act = () => - theElement.Should().HaveElement(null); + theElement.Should().HaveAttributeWithValue(XName.Get("name", "http://www.example.com/2012/test"), "dennis"); // Assert - act.Should().ThrowExactly() - .WithParameterName("expected"); + act.Should().Throw().WithMessage( + "Expected attribute \"{http://www.example.com/2012/test}name\" in theElement to have value \"dennis\", but found \"martin\"."); } [Fact] - public void When_asserting_element_has_a_child_element_with_a_null_XName_it_should_throw() + public void + When_asserting_element_has_attribute_with_specific_value_but_attribute_has_different_value_it_should_fail_with_descriptive_message() { - XElement theElement = new("element"); + // Arrange + var theElement = XElement.Parse(""""""); // Act Action act = () => - theElement.Should().HaveElement((XName)null); + theElement.Should() + .HaveAttributeWithValue("name", "dennis", "because we want to test the failure {0}", "message"); // Assert - act.Should().ThrowExactly() - .WithParameterName("expected"); + act.Should().Throw().WithMessage( + "Expected attribute \"name\" in theElement to have value \"dennis\"" + + " because we want to test the failure message, but found \"martin\"."); } [Fact] - public void When_asserting_element_has_a_child_element_with_an_empty_name_it_should_throw() + public void + When_asserting_element_has_attribute_with_ns_and_specific_value_but_attribute_has_different_value_it_should_fail_with_descriptive_message() { - XElement theElement = new("element"); + // Arrange + var theElement = XElement.Parse(""""""); // Act Action act = () => - theElement.Should().HaveElement(string.Empty); + theElement.Should().HaveAttributeWithValue(XName.Get("name", "http://www.example.com/2012/test"), "dennis", + "because we want to test the failure {0}", "message"); // Assert - act.Should().ThrowExactly() - .WithParameterName("expected"); + act.Should().Throw().WithMessage( + "Expected attribute \"{http://www.example.com/2012/test}name\" in theElement to have value \"dennis\"" + + " because we want to test the failure message, but found \"martin\"."); } - } - public class HaveElementWithOccurrence - { [Fact] - public void Element_has_two_child_elements_and_it_expected_does_it_succeeds() + public void When_xml_element_is_null_then_have_attribute_should_fail() { - // Arrange - var element = XElement.Parse( - """ - - + XElement theElement = null; + + // Act + Action act = () => + theElement.Should().HaveAttributeWithValue("name", "value", "we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected attribute \"name\" in element to have value \"value\" *failure message*" + + ", but theElement is ."); + } + + [Fact] + public void When_xml_element_is_null_then_have_attribute_with_XName_should_fail() + { + XElement theElement = null; + + // Act + Action act = () => + theElement.Should().HaveAttributeWithValue((XName)"name", "value", "we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage( + "Expected attribute \"name\" in element to have value \"value\" *failure message*" + + ", but theElement is ."); + } + + [Fact] + public void When_asserting_element_has_an_attribute_with_a_null_name_it_should_throw() + { + XElement theElement = new("element"); + + // Act + Action act = () => + theElement.Should().HaveAttributeWithValue(null, "value"); + + // Assert + act.Should().ThrowExactly() + .WithParameterName("expectedName"); + } + + [Fact] + public void When_asserting_element_has_an_attribute_with_a_null_XName_it_should_throw() + { + XElement theElement = new("element"); + + // Act + Action act = () => + theElement.Should().HaveAttributeWithValue((XName)null, "value"); + + // Assert + act.Should().ThrowExactly() + .WithParameterName("expectedName"); + } + + [Fact] + public void When_asserting_element_has_an_attribute_with_an_empty_name_it_should_throw() + { + XElement theElement = new("element"); + + // Act + Action act = () => + theElement.Should().HaveAttributeWithValue(string.Empty, "value"); + + // Assert + act.Should().ThrowExactly() + .WithParameterName("expectedName"); + } + } + + public class NotHaveAttributeWithValue + { + [Fact] + public void Passes_when_attribute_does_not_fit() + { + // Arrange + var element = XElement.Parse(@""); + + // Act / Assert + element.Should().NotHaveAttributeWithValue("surname", "martin"); + } + + [Fact] + public void Passes_when_attribute_does_not_fit_with_namespace() + { + // Arrange + var element = XElement.Parse(""""""); + + // Act / Assert + element.Should().NotHaveAttributeWithValue(XName.Get("surname", "http://www.example.com/2012/test"), "martin"); + } + + [Fact] + public void Passes_when_attribute_and_value_does_not_fit() + { + // Arrange + var element = XElement.Parse(@""); + + // Act / Assert + element.Should().NotHaveAttributeWithValue("surname", "mike"); + } + + [Fact] + public void Passes_when_attribute_and_value_does_not_fit_with_namespace() + { + // Arrange + var element = XElement.Parse(""""""); + + // Act / Assert + element.Should().NotHaveAttributeWithValue(XName.Get("surname", "http://www.example.com/2012/test"), "mike"); + } + + [Fact] + public void Passes_when_attribute_fits_and_value_does_not() + { + // Arrange + var element = XElement.Parse(@""); + + // Act / Assert + element.Should().NotHaveAttributeWithValue("name", "mike"); + } + + [Fact] + public void Passes_when_attribute_fits_and_value_does_not_with_namespace() + { + // Arrange + var element = XElement.Parse(""""""); + + // Act / Assert + element.Should().NotHaveAttributeWithValue(XName.Get("name", "http://www.example.com/2012/test"), "mike"); + } + + [Fact] + public void Throws_when_attribute_and_name_fits() + { + // Arrange + var theElement = XElement.Parse(""""""); + + // Act + Action act = () => + { + using var _ = new AssertionScope(); + + theElement.Should() + .NotHaveAttributeWithValue("name", "martin", "because we want to test the failure {0}", "message"); + }; + + // Assert + act.Should().Throw().WithMessage( + "Did not expect theElement to have attribute \"name\" with value \"martin\" because we want to test the failure message," + + " but found such attribute in *"); + } + + [Fact] + public void Throws_when_attribute_and_name_fits_with_namespace() + { + // Arrange + var theElement = XElement.Parse(""""""); + + // Act + Action act = () => + theElement.Should().NotHaveAttributeWithValue(XName.Get("name", "http://www.example.com/2012/test"), "martin", + "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect theElement to have attribute \"{http://www.example.com/2012/test}name\" with value \"martin\"" + + " because we want to test the failure message," + + " but found such attribute in *"); + } + + [Fact] + public void Throws_when_element_is_null() + { + XElement theElement = null; + + // Act + Action act = () => + theElement.Should().NotHaveAttributeWithValue("name", "value", "we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage( + "Did not expect attribute \"name\" in element to have value \"value\"*failure message*, but theElement is ."); + } + + [Fact] + public void Throws_when_element_is_null_with_namespace() + { + XElement theElement = null; + + // Act + Action act = () => + theElement.Should() + .NotHaveAttributeWithValue((XName)"name", "value", "we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw() + .WithMessage( + "Did not expect attribute \"name\" in element to have value \"value\"*failure message*, but theElement is ."); + } + + [Fact] + public void Throws_when_expected_is_null() + { + XElement theElement = new("element"); + + // Act + Action act = () => + theElement.Should().NotHaveAttributeWithValue(null, "value"); + + // Assert + act.Should().ThrowExactly() + .WithParameterName("unexpectedName"); + } + + [Fact] + public void Throws_when_expected_is_null_with_namespace() + { + XElement theElement = new("element"); + + // Act + Action act = () => + theElement.Should().NotHaveAttributeWithValue((XName)null, "value"); + + // Assert + act.Should().ThrowExactly() + .WithParameterName("unexpectedName"); + } + + [Fact] + public void Throws_when_expected_attribute_is_something_but_value_is_null() + { + XElement theElement = new("element"); + + // Act + Action act = () => + theElement.Should().NotHaveAttributeWithValue("some", null); + + // Assert + act.Should().ThrowExactly() + .WithParameterName("unexpectedValue"); + } + + [Fact] + public void Throws_when_expected_attribute_is_something_but_value_is_null_with_namespace() + { + XElement theElement = new("element"); + + // Act + Action act = () => + theElement.Should().NotHaveAttributeWithValue((XName)"some", null); + + // Assert + act.Should().ThrowExactly() + .WithParameterName("unexpectedValue"); + } + + [Fact] + public void Throws_when_expected_is_empty() + { + XElement theElement = new("element"); + + // Act + Action act = () => + theElement.Should().NotHaveAttributeWithValue(string.Empty, "value"); + + // Assert + act.Should().ThrowExactly() + .WithParameterName("unexpectedName"); + } + } + + public class HaveElement + { + [Fact] + public void When_asserting_element_has_child_element_and_it_does_it_should_succeed() + { + // Arrange + var element = XElement.Parse( + """ + + + + """); + + // Act + Action act = () => + element.Should().HaveElement("child"); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_element_has_child_element_with_ns_and_it_does_it_should_succeed() + { + // Arrange + var element = XElement.Parse( + """ + + + + """); + + // Act + Action act = () => + element.Should().HaveElement(XName.Get("child", "http://www.example.com/2012/test")); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void When_asserting_element_has_child_element_but_it_does_not_it_should_fail() + { + // Arrange + var theElement = XElement.Parse( + """ + + + + """); + + // Act + Action act = () => + theElement.Should().HaveElement("unknown"); + + // Assert + act.Should().Throw().WithMessage( + "Expected theElement to have child element \"unknown\", but no such child element was found."); + } + + [Fact] + public void When_asserting_element_has_child_element_with_ns_but_it_does_not_it_should_fail() + { + // Arrange + var theElement = XElement.Parse( + """ + + + + """); + + // Act + Action act = () => + theElement.Should().HaveElement(XName.Get("unknown", "http://www.example.com/2012/test")); + + // Assert + act.Should().Throw().WithMessage( + "Expected theElement to have child element \"{{http://www.example.com/2012/test}}unknown\", but no such child element was found."); + } + + [Fact] + public void When_asserting_element_has_child_element_but_it_does_not_it_should_fail_with_descriptive_message() + { + // Arrange + var theElement = XElement.Parse( + """ + + + + """); + + // Act + Action act = () => + theElement.Should().HaveElement("unknown", "because we want to test the failure message"); + + // Assert + act.Should().Throw().WithMessage( + "Expected theElement to have child element \"unknown\" because we want to test the failure message," + + " but no such child element was found."); + } + + [Fact] + public void When_asserting_element_has_child_element_with_ns_but_it_does_not_it_should_fail_with_descriptive_message() + { + // Arrange + var theElement = XElement.Parse( + """ + + + + """); + + // Act + Action act = () => + theElement.Should().HaveElement(XName.Get("unknown", "http://www.example.com/2012/test"), + "because we want to test the failure message"); + + // Assert + act.Should().Throw().WithMessage( + "Expected theElement to have child element \"{{http://www.example.com/2012/test}}unknown\"" + + " because we want to test the failure message, but no such child element was found."); + } + + [Fact] + public void When_asserting_element_has_child_element_it_should_return_the_matched_element_in_the_which_property() + { + // Arrange + var element = XElement.Parse( + """ + + + + """); + + // Act + var matchedElement = element.Should().HaveElement("child").Subject; + + // Assert + matchedElement.Should().BeOfType() + .And.HaveAttributeWithValue("attr", "1"); + + matchedElement.Name.Should().Be(XName.Get("child")); + } + + [Fact] + public void When_asserting_element_has_a_child_element_with_a_null_name_it_should_throw() + { + XElement theElement = new("element"); + + // Act + Action act = () => + theElement.Should().HaveElement(null); + + // Assert + act.Should().ThrowExactly() + .WithParameterName("expected"); + } + + [Fact] + public void When_asserting_element_has_a_child_element_with_a_null_XName_it_should_throw() + { + XElement theElement = new("element"); + + // Act + Action act = () => + theElement.Should().HaveElement((XName)null); + + // Assert + act.Should().ThrowExactly() + .WithParameterName("expected"); + } + + [Fact] + public void When_asserting_element_has_a_child_element_with_an_empty_name_it_should_throw() + { + XElement theElement = new("element"); + + // Act + Action act = () => + theElement.Should().HaveElement(string.Empty); + + // Assert + act.Should().ThrowExactly() + .WithParameterName("expected"); + } + } + + public class HaveElementWithOccurrence + { + [Fact] + public void Element_has_two_child_elements_and_it_expected_does_it_succeeds() + { + // Arrange + var element = XElement.Parse( + """ + + + + + """); + + // Act / Assert + element.Should().HaveElement("child", Exactly.Twice()); + } + + [Fact] + public void Asserting_element_inside_an_assertion_scope_it_checks_the_whole_assertion_scope_before_failing() + { + // Arrange + XElement element = null; + + // Act + Action act = () => + { + using (new AssertionScope()) + { + element.Should().HaveElement("child", Exactly.Twice()); + element.Should().HaveElement("child", Exactly.Twice()); + } + }; + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void Element_has_two_child_elements_and_three_expected_it_fails() + { + // Arrange + var element = XElement.Parse( + """ + + + + + + """); + + // Act + Action act = () => element.Should().HaveElement("child", Exactly.Twice()); + + // Assert + act.Should().Throw() + .WithMessage("Expected element to have an element \"child\"*exactly*2 times, but found it 3 times."); + } + + [Fact] + public void Element_is_valid_and_expected_null_with_string_overload_it_fails() + { + // Arrange + var element = XElement.Parse( + """ + + + + + """); + + // Act + Action act = () => element.Should().HaveElement(null, Exactly.Twice()); + + // Assert + act.Should().Throw().WithMessage( + "Cannot assert the element has an element if the expected name is .*"); + } + + [Fact] + public void Element_is_valid_and_expected_null_with_x_name_overload_it_fails() + { + // Arrange + var element = XElement.Parse( + """ + + + + + + """); + + // Act + Action act = () => element.Should().HaveElement((XName)null, Exactly.Twice()); + + // Assert + act.Should().Throw().WithMessage( + "Cannot assert the element has an element count if the element name is .*"); + } + + [Fact] + public void Chaining_after_a_successful_occurrence_check_does_continue_the_assertion() + { + // Arrange + var element = XElement.Parse( + """ + + + + + + """); + + // Act / Assert + element.Should().HaveElement("child", AtLeast.Twice()) + .Which.Should().NotBeNull(); + } + + [Fact] + public void Chaining_after_a_non_successful_occurrence_check_does_not_continue_the_assertion() + { + // Arrange + var element = XElement.Parse( + """ + + + + + + """); + + // Act + Action act = () => element.Should().HaveElement("child", Exactly.Once()) + .Which.Should().NotBeNull(); + + // Assert + act.Should().Throw() + .WithMessage("Expected element to have an element \"child\"*exactly*1 time, but found it 3 times."); + } + + [Fact] + public void Null_element_is_expected_to_have_an_element_count_it_should_fail() + { + // Arrange + XElement xElement = null; + + // Act + Action act = () => xElement.Should().HaveElement("child", AtLeast.Once()); + + // Assert + act.Should().Throw().WithMessage( + "Expected* to have an element with count of *, but the element itself is ."); + } + } + + public class HaveElementWithValue + { + [Fact] + public void The_element_cannot_be_null() + { + // Arrange + XElement element = null; + + // Act + Action act = () => element.Should().HaveElementWithValue("child", "b"); + + // Assert + act.Should().Throw().WithMessage("*child*b*element itself is *"); + } + + [Fact] + public void Has_element_with_specified_value() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); + + // Act / Assert + element.Should().HaveElementWithValue("child", "b"); + } + + [Fact] + public void Throws_when_element_is_not_found() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().HaveElementWithValue("c", "f"); + + // Assert + act.Should().Throw().WithMessage("*c*f*element*isn't found*"); + } + + [Fact] + public void Throws_when_element_found_but_value_does_not_match() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().HaveElementWithValue("child", "c"); + + // Assert + act.Should().Throw().WithMessage("*child*c*element*does not have such a value*"); + } + + [Fact] + public void Throws_when_expected_element_is_null() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().HaveElementWithValue(null, "a"); + + // Assert + act.Should().Throw().WithMessage("*expectedElement*"); + } + + [Fact] + public void Throws_when_expected_element_is_null_with_namespace() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().HaveElementWithValue((XName)null, "a"); + + // Assert + act.Should().Throw().WithMessage("*expectedElement*"); + } + + [Fact] + public void Throws_when_expected_value_is_null() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().HaveElementWithValue("child", null); + + // Assert + act.Should().Throw().WithMessage("*expectedValue*"); + } + + [Fact] + public void Throws_when_expected_value_is_null_with_namespace() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().HaveElementWithValue(XNamespace.None + "child", null); + + // Assert + act.Should().Throw().WithMessage("*expectedValue*"); + } + + [Fact] + public void The_element_cannot_be_null_and_searching_with_namespace() + { + // Arrange + XElement element = null; + + // Act + Action act = () => + element.Should() + .HaveElementWithValue(XNamespace.None + "child", "b", "we want to test the {0} message", "failure"); + + // Assert + act.Should().Throw().WithMessage("*child*b*failure message*element itself is *"); + } + + [Fact] + public void Has_element_with_specified_value_with_namespace() + { + // Arrange + var element = XElement.Parse( + """ + + a + b """); // Act / Assert - element.Should().HaveElement("child", Exactly.Twice()); + element.Should().HaveElementWithValue(XNamespace.None + "child", "b"); } [Fact] - public void Asserting_element_inside_an_assertion_scope_it_checks_the_whole_assertion_scope_before_failing() + public void Throws_when_element_with_namespace_not_found() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().HaveElementWithValue(XNamespace.None + "c", "f"); + + // Assert + act.Should().Throw().WithMessage("*c*f*element*isn't found*"); + } + + [Fact] + public void Throws_when_element_with_namespace_found_but_value_does_not_match() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().HaveElementWithValue(XNamespace.None + "child", "c"); + + // Assert + act.Should().Throw().WithMessage("*child*c*element*does not have such a value*"); + } + } + + public class NotHaveElement + { + [Fact] + public void The_element_cannot_be_null() { // Arrange XElement element = null; // Act - Action act = () => - { - using (new AssertionScope()) - { - element.Should().HaveElement("child", Exactly.Twice()); - element.Should().HaveElement("child", Exactly.Twice()); - } - }; + Action act = () => element.Should().NotHaveElement("child"); // Assert - act.Should().NotThrow(); + act.Should().Throw().WithMessage("*child*b*element itself is *"); } [Fact] - public void Element_has_two_child_elements_and_three_expected_it_fails() + public void Element_does_not_have_this_child_element() { // Arrange var element = XElement.Parse( """ - - - + a + b + + """); + + // Act / Assert + element.Should().NotHaveElement("c"); + } + + [Fact] + public void Throws_when_element_found_but_expected_to_be_absent() + { + // Arrange + var element = XElement.Parse( + """ + + a + b """); // Act - Action act = () => element.Should().HaveElement("child", Exactly.Twice()); + Action act = () => element.Should().NotHaveElement("child"); // Assert - act.Should().Throw() - .WithMessage("Expected element to have an element \"child\"*exactly*2 times, but found it 3 times."); + act.Should().Throw().WithMessage("*Did not*child*element*was found*"); } [Fact] - public void Element_is_valid_and_expected_null_with_string_overload_it_fails() + public void Throws_when_unexpected_element_is_null() { // Arrange var element = XElement.Parse( """ - - - + a + b """); // Act - Action act = () => element.Should().HaveElement(null, Exactly.Twice()); + Action act = () => element.Should().NotHaveElement(null); // Assert - act.Should().Throw().WithMessage( - "Cannot assert the element has an element if the expected name is .*"); + act.Should().Throw().WithMessage("*unexpectedElement*"); } [Fact] - public void Element_is_valid_and_expected_null_with_x_name_overload_it_fails() + public void Throws_when_unexpected_element_is_null_with_namespace() { // Arrange var element = XElement.Parse( """ - - - + a + b """); // Act - Action act = () => element.Should().HaveElement((XName)null, Exactly.Twice()); + Action act = () => element.Should().NotHaveElement((XName)null); // Assert - act.Should().Throw().WithMessage( - "Cannot assert the element has an element count if the element name is .*"); + act.Should().Throw().WithMessage("*unexpectedElement*"); } [Fact] - public void Chaining_after_a_successful_occurrence_check_does_continue_the_assertion() + public void The_element_cannot_be_null_and_searching_with_namespace() + { + // Arrange + XElement element = null; + + // Act + Action act = () => + element.Should() + .NotHaveElement(XNamespace.None + "child", "we want to test the {0} message", "failure"); + + // Assert + act.Should().Throw().WithMessage("*child*failure message*element itself is *"); + } + + [Fact] + public void Not_have_element_with_with_namespace() { // Arrange var element = XElement.Parse( """ - - - + a + b """); // Act / Assert - element.Should().HaveElement("child", AtLeast.Twice()) - .Which.Should().NotBeNull(); + element.Should().NotHaveElement(XNamespace.None + "c"); + } + } + + public class NotHaveElementWithValue + { + [Fact] + public void The_element_cannot_be_null() + { + // Arrange + XElement element = null; + + // Act + Action act = () => element.Should().NotHaveElementWithValue("child", "b"); + + // Assert + act.Should().Throw().WithMessage("*child*b*element itself is *"); } [Fact] - public void Chaining_after_a_non_successful_occurrence_check_does_not_continue_the_assertion() + public void Throws_when_element_with_specified_value_is_found() { // Arrange var element = XElement.Parse( """ - - - + a + b """); // Act - Action act = () => element.Should().HaveElement("child", Exactly.Once()) - .Which.Should().NotBeNull(); + Action act = () => element.Should().NotHaveElementWithValue("child", "b"); // Assert - act.Should().Throw() - .WithMessage("Expected element to have an element \"child\"*exactly*1 time, but found it 3 times."); + act.Should().Throw().WithMessage("Did not*element*child*value*b*does have this value*"); } [Fact] - public void Null_element_is_expected_to_have_an_element_count_it_should_fail() + public void Passes_when_element_not_found() { // Arrange - XElement xElement = null; + var element = XElement.Parse( + """ + + a + b + + """); + + // Act / Assert + element.Should().NotHaveElementWithValue("c", "f"); + } + + [Fact] + public void Passes_when_element_found_but_value_does_not_match() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); + + // Act / Assert + element.Should().NotHaveElementWithValue("child", "c"); + } + + [Fact] + public void Throws_when_expected_element_is_null() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); // Act - Action act = () => xElement.Should().HaveElement("child", AtLeast.Once()); + Action act = () => element.Should().NotHaveElementWithValue(null, "a"); // Assert - act.Should().Throw().WithMessage( - "Expected* to have an element with count of *, but the element itself is ."); + act.Should().Throw().WithMessage("*expectedElement*"); + } + + [Fact] + public void Throws_when_expected_element_is_null_with_namespace() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().NotHaveElementWithValue((XName)null, "a"); + + // Assert + act.Should().Throw().WithMessage("*expectedElement*"); + } + + [Fact] + public void Throws_when_expected_value_is_null() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().NotHaveElementWithValue("child", null); + + // Assert + act.Should().Throw().WithMessage("*expectedValue*"); + } + + [Fact] + public void Throws_when_expected_value_is_null_with_namespace() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().NotHaveElementWithValue(XNamespace.None + "child", null); + + // Assert + act.Should().Throw().WithMessage("*expectedValue*"); + } + + [Fact] + public void The_element_cannot_be_null_and_searching_with_namespace() + { + // Arrange + XElement element = null; + + // Act + Action act = () => + element.Should().NotHaveElementWithValue(XNamespace.None + "child", "b", "we want to test the {0} message", + "failure"); + + // Assert + act.Should().Throw().WithMessage("*child*b*failure message*element itself is *"); + } + + [Fact] + public void Throws_when_element_with_specified_value_is_found_with_namespace() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); + + // Act + Action act = () => element.Should().NotHaveElementWithValue(XNamespace.None + "child", "b"); + + // Assert + act.Should().Throw().WithMessage("Did not expect*element*child*value*b*does have this value*"); + } + + [Fact] + public void Passes_when_element_with_namespace_not_found() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); + + // Act / Assert + element.Should().NotHaveElementWithValue(XNamespace.None + "c", "f"); + } + + [Fact] + public void Passes_when_element_with_namespace_found_but_value_does_not_match() + { + // Arrange + var element = XElement.Parse( + """ + + a + b + + """); + + // Act / Assert + element.Should().NotHaveElementWithValue(XNamespace.None + "child", "c"); } } } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 745721cda4..1592a276a7 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -20,6 +20,14 @@ sidebar: * Added option for event monitoring to ignore failing event accessors - [#2629](https://github.com/fluentassertions/fluentassertions/pull/2629) * Added the capability of associating `IValueFormatter`s to a (nested) `AssertionScope` - [#2676](https://github.com/fluentassertions/fluentassertions/pull/2676) * Added support for throwing TUnit exceptions when using TUnit as your testing framework - [#2758](https://github.com/fluentassertions/fluentassertions/pull/2758) +* Added a few more assertions on `XElement` - [#2690](https://github.com/fluentassertions/fluentassertions/pull/2690) + * `[Not]HaveElementWithValue` + * `NotHaveElement` + * `[Not]HaveAttribute` + * `NotHaveAttributeWithValue` +* Added a few more assertions on `XDocument` - [#2690](https://github.com/fluentassertions/fluentassertions/pull/2690) + * `[Not]HaveElementWithValue` + * `NotHaveElement` ### Improvements * Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) @@ -56,7 +64,6 @@ sidebar: * Fixed `RaisePropertyChangeFor` to return a filtered list of events - [#2677](https://github.com/fluentassertions/fluentassertions/pull/2677) ### Breaking Changes (for users) -* Replaced `Execute.Assertion` with `AssertionChain.GetOrCreate()` - [2539](https://github.com/fluentassertions/pull/2539) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) * Removed obsolete `...OrEqualTo` methods - [#2269](https://github.com/fluentassertions/fluentassertions/pull/2269) * `GenericCollectionAssertions` @@ -85,22 +92,15 @@ sidebar: * Allow fluently calling `WithoutMatchingRules` and `WithoutSelectionRules` while using `BeEquivalentTo` - [#2457](https://github.com/fluentassertions/fluentassertions/pull/2457) * Removed `utcNow` overload for `.Monitor()` - [#2629](https://github.com/fluentassertions/fluentassertions/pull/2629) * The semantics of `BeLowerCased`/`BeUpperCased` have been changed to align with the behavior of `ToLower`/`ToUpper` - [#2660](https://github.com/fluentassertions/fluentassertions/pull/2660) -* Simplified the inheritance of `SubsequentOrderingAssertions` by removing the class `SubsequentOrderingGenericCollectionAssertions` - [#2439](https://github.com/fluentassertions/fluentassertions/pull/2439) +* Renamed `HaveAttribute` to `HaveAttributeWithValue` on `XElement` - [#2690](https://github.com/fluentassertions/fluentassertions/pull/2690) ### Breaking Changes (for extensions) -* Introduced a new `AssertionChain` class whose `GetOrCreate` is used to replace `Execute.Assertion` when writing custom assertions - [2539](https://github.com/fluentassertions/fluentassertions/pull/2539) -* Removed `ClearExpectation` and made `WithExpectation` a scoped operation that takes a nested `AssertionChain` - [2539](https://github.com/fluentassertions/fluentassertions/pull/2539) -* `AndWhichConstraint` now takes an `AssertionChain` instance and a postfix to improve the caller identifier in chained constructs - [2539](https://github.com/fluentassertions/pull/2539) * Add `ForConstraint` to `IAssertionsScope` to support chaining `.ForConstraint()` after `.Then` - [#2324](https://github.com/fluentassertions/fluentassertions/pull/2324) * Refactored `AsyncFunctionAssertions` into real base class - [#2359](https://github.com/fluentassertions/fluentassertions/pull/2359) * Its constructor has been made `protected`. * Unused constructors have been removed. * Methods overwritten in `GenericAsyncFunctionAssertions` has been moved to `NonGenericAsyncFunctionAssertions`. * Moved the non-generic `NotThrow` and `NotThrowAfter` from `DelegateAssertions` to `ActionAssertions` - [#2371](https://github.com/fluentassertions/fluentassertions/pull/2371) -* Renamed `EquivalencyResult.AssertionCompleted` to `EquivalencyProven` - [#2745](https://github.com/fluentassertions/fluentassertions/pull/2745) -* Renamed `IEquivalencyValidator` to `IValidateChildNodeEquivalency`, and its method `RecursivelyAssertEquality` to `AssertEquivalencyOf` - [#2745](https://github.com/fluentassertions/fluentassertions/pull/2745) -* Made `Node`, `Property` and `Field` internal - [#2745](https://github.com/fluentassertions/fluentassertions/pull/2745) - ## 6.12.0 From ce965651e88c9d3ca9a4d6baed6b357fc4e163b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Wed, 30 Oct 2024 19:52:28 +0100 Subject: [PATCH 434/845] Correctly specify nullability of Subject for `NumericAssertions` (#2473) * Add `NumericAssertionsBase` to explicitly define nullability for Subject * Fix Qodana issues about using directive not required by the code --- Src/FluentAssertions/AssertionExtensions.cs | 2 +- .../Numeric/NullableNumericAssertions.cs | 13 +- .../Numeric/NumericAssertions.cs | 490 +---------------- .../Numeric/NumericAssertionsBase.cs | 495 ++++++++++++++++++ .../NumericAssertionsExtensions.cs | 68 +-- .../FluentAssertions/net47.verified.txt | 30 +- .../FluentAssertions/net6.0.verified.txt | 30 +- .../netstandard2.0.verified.txt | 30 +- .../netstandard2.1.verified.txt | 30 +- .../AssertionExtensionsSpecs.cs | 1 - 10 files changed, 620 insertions(+), 569 deletions(-) create mode 100644 Src/FluentAssertions/Numeric/NumericAssertionsBase.cs diff --git a/Src/FluentAssertions/AssertionExtensions.cs b/Src/FluentAssertions/AssertionExtensions.cs index a37a1c54e9..4832352cf5 100644 --- a/Src/FluentAssertions/AssertionExtensions.cs +++ b/Src/FluentAssertions/AssertionExtensions.cs @@ -1004,7 +1004,7 @@ public static void Should(this MethodInfoSelectorAssertions _) /// [Obsolete("You are asserting the 'AndConstraint' itself. Remove the 'Should()' method directly following 'And'", error: true)] - public static void Should(this NumericAssertions _) + public static void Should(this NumericAssertionsBase _) where TSubject : struct, IComparable where TAssertions : NumericAssertions { diff --git a/Src/FluentAssertions/Numeric/NullableNumericAssertions.cs b/Src/FluentAssertions/Numeric/NullableNumericAssertions.cs index 88af8fc2b3..6a1efeda3a 100644 --- a/Src/FluentAssertions/Numeric/NullableNumericAssertions.cs +++ b/Src/FluentAssertions/Numeric/NullableNumericAssertions.cs @@ -7,6 +7,9 @@ namespace FluentAssertions.Numeric; +/// +/// Contains a number of methods to assert that a nullable is in the expected state. +/// [DebuggerNonUserCode] public class NullableNumericAssertions : NullableNumericAssertions> where T : struct, IComparable @@ -17,19 +20,25 @@ public NullableNumericAssertions(T? value, AssertionChain assertionChain) } } +/// +/// Contains a number of methods to assert that a nullable is in the expected state. +/// [DebuggerNonUserCode] -public class NullableNumericAssertions : NumericAssertions +public class NullableNumericAssertions : NumericAssertionsBase where T : struct, IComparable where TAssertions : NullableNumericAssertions { private readonly AssertionChain assertionChain; public NullableNumericAssertions(T? value, AssertionChain assertionChain) - : base(value, assertionChain) + : base(assertionChain) { + Subject = value; this.assertionChain = assertionChain; } + public override T? Subject { get; } + /// /// Asserts that a nullable numeric value is not . /// diff --git a/Src/FluentAssertions/Numeric/NumericAssertions.cs b/Src/FluentAssertions/Numeric/NumericAssertions.cs index 87b645a9fd..756f58a818 100644 --- a/Src/FluentAssertions/Numeric/NumericAssertions.cs +++ b/Src/FluentAssertions/Numeric/NumericAssertions.cs @@ -1,10 +1,5 @@ using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Linq.Expressions; -using FluentAssertions.Common; using FluentAssertions.Execution; namespace FluentAssertions.Numeric; @@ -22,498 +17,19 @@ public NumericAssertions(T value, AssertionChain assertionChain) } } -#pragma warning disable CS0659, S1206 // Ignore not overriding Object.GetHashCode() -#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals /// /// Contains a number of methods to assert that an is in the expected state. /// [DebuggerNonUserCode] -public class NumericAssertions +public class NumericAssertions : NumericAssertionsBase where T : struct, IComparable where TAssertions : NumericAssertions { public NumericAssertions(T value, AssertionChain assertionChain) - : this((T?)value, assertionChain) - { - } - - private protected NumericAssertions(T? value, AssertionChain assertionChain) + : base(assertionChain) { Subject = value; - CurrentAssertionChain = assertionChain; - } - - public T? Subject { get; } - - /// - /// Asserts that the integral number value is exactly the same as the value. - /// - /// The expected value. - /// - /// 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 Be(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - CurrentAssertionChain - .ForCondition(Subject?.CompareTo(expected) == 0) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:value} to be {0}{reason}, but found {1}" + GenerateDifferenceMessage(expected), expected, - Subject); - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the integral number value is exactly the same as the value. - /// - /// The expected value. - /// - /// 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 Be(T? expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - CurrentAssertionChain - .ForCondition(expected is { } value ? Subject?.CompareTo(value) == 0 : !Subject.HasValue) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:value} to be {0}{reason}, but found {1}" + GenerateDifferenceMessage(expected), expected, - Subject); - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the integral number value is not the same as the value. - /// - /// The unexpected value. - /// - /// 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 NotBe(T unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - CurrentAssertionChain - .ForCondition(Subject?.CompareTo(unexpected) != 0) - .BecauseOf(because, becauseArgs) - .FailWith("Did not expect {context:value} to be {0}{reason}.", unexpected); - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the integral number value is not the same as the value. - /// - /// The unexpected value. - /// - /// 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 NotBe(T? unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - CurrentAssertionChain - .ForCondition(unexpected is { } value ? Subject?.CompareTo(value) != 0 : Subject.HasValue) - .BecauseOf(because, becauseArgs) - .FailWith("Did not expect {context:value} to be {0}{reason}.", unexpected); - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the numeric value is greater than zero. - /// - /// - /// 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 BePositive([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - CurrentAssertionChain - .ForCondition(Subject?.CompareTo(default) > 0) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:value} to be positive{reason}, but found {0}.", Subject); - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the numeric value is less than zero. - /// - /// - /// 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 BeNegative([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - CurrentAssertionChain - .ForCondition(Subject is { } value && !IsNaN(value) && value.CompareTo(default) < 0) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:value} to be negative{reason}, but found {0}.", Subject); - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the numeric value is less than the specified value. - /// - /// The value to compare the current numeric value with. - /// - /// 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 BeLessThan(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - if (IsNaN(expected)) - { - throw new ArgumentException("A value can never be less than NaN", nameof(expected)); - } - - CurrentAssertionChain - .ForCondition(Subject is { } value && !IsNaN(value) && value.CompareTo(expected) < 0) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:value} to be less than {0}{reason}, but found {1}" + GenerateDifferenceMessage(expected), - expected, Subject); - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the numeric value is less than or equal to the specified value. - /// - /// The value to compare the current numeric value with. - /// - /// 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 BeLessThanOrEqualTo(T expected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - if (IsNaN(expected)) - { - throw new ArgumentException("A value can never be less than or equal to NaN", nameof(expected)); - } - - CurrentAssertionChain - .ForCondition(Subject is { } value && !IsNaN(value) && value.CompareTo(expected) <= 0) - .BecauseOf(because, becauseArgs) - .FailWith( - "Expected {context:value} to be less than or equal to {0}{reason}, but found {1}" + - GenerateDifferenceMessage(expected), expected, Subject); - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the numeric value is greater than the specified value. - /// - /// The value to compare the current numeric value with. - /// - /// 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 BeGreaterThan(T expected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - if (IsNaN(expected)) - { - throw new ArgumentException("A value can never be greater than NaN", nameof(expected)); - } - - CurrentAssertionChain - .ForCondition(Subject?.CompareTo(expected) > 0) - .BecauseOf(because, becauseArgs) - .FailWith( - "Expected {context:value} to be greater than {0}{reason}, but found {1}" + GenerateDifferenceMessage(expected), - expected, Subject); - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the numeric value is greater than or equal to the specified value. - /// - /// The value to compare the current numeric value with. - /// - /// 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 BeGreaterThanOrEqualTo(T expected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - if (IsNaN(expected)) - { - throw new ArgumentException("A value can never be greater than or equal to a NaN", nameof(expected)); - } - - CurrentAssertionChain - .ForCondition(Subject?.CompareTo(expected) >= 0) - .BecauseOf(because, becauseArgs) - .FailWith( - "Expected {context:value} to be greater than or equal to {0}{reason}, but found {1}" + - GenerateDifferenceMessage(expected), expected, Subject); - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that a value is within a range. - /// - /// - /// Where the range is continuous or incremental depends on the actual type of the value. - /// - /// - /// The minimum valid value of the range (inclusive). - /// - /// - /// The maximum valid value of the range (inclusive). - /// - /// - /// 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 BeInRange(T minimumValue, T maximumValue, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - if (IsNaN(minimumValue) || IsNaN(maximumValue)) - { - throw new ArgumentException("A range cannot begin or end with NaN"); - } - - CurrentAssertionChain - .ForCondition(Subject is { } value && value.CompareTo(minimumValue) >= 0 && value.CompareTo(maximumValue) <= 0) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:value} to be between {0} and {1}{reason}, but found {2}.", - minimumValue, maximumValue, Subject); - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that a value is not within a range. - /// - /// - /// Where the range is continuous or incremental depends on the actual type of the value. - /// - /// - /// The minimum valid value of the range. - /// - /// - /// The maximum valid value of the range. - /// - /// - /// 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 NotBeInRange(T minimumValue, T maximumValue, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - if (IsNaN(minimumValue) || IsNaN(maximumValue)) - { - throw new ArgumentException("A range cannot begin or end with NaN"); - } - - CurrentAssertionChain - .ForCondition(Subject is { } value && !(value.CompareTo(minimumValue) >= 0 && value.CompareTo(maximumValue) <= 0)) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:value} to not be between {0} and {1}{reason}, but found {2}.", - minimumValue, maximumValue, Subject); - - 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, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - CurrentAssertionChain - .ForCondition(Subject is { } value && validValues.Contains(value)) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:value} to be one of {0}{reason}, but found {1}.", validValues, Subject); - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the object is of the specified type . - /// - /// - /// The type that the subject is supposed to be of. - /// - /// - /// 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 . - /// - /// is . - public AndConstraint BeOfType(Type expectedType, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull(expectedType); - - Type subjectType = Subject?.GetType(); - - if (expectedType.IsGenericTypeDefinition && subjectType?.IsGenericType == true) - { - subjectType.GetGenericTypeDefinition().Should().Be(expectedType, because, becauseArgs); - } - else - { - subjectType.Should().Be(expectedType, because, becauseArgs); - } - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the object is not of the specified type . - /// - /// - /// The type that the subject is not supposed to be of. - /// - /// - /// 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 . - /// - /// is . - public AndConstraint NotBeOfType(Type unexpectedType, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull(unexpectedType); - - CurrentAssertionChain - .ForCondition(Subject.HasValue) - .BecauseOf(because, becauseArgs) - .FailWith("Expected type not to be " + unexpectedType + "{reason}, but found ."); - - if (CurrentAssertionChain.Succeeded) - { - Subject.GetType().Should().NotBe(unexpectedType, because, becauseArgs); - } - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the is satisfied. - /// - /// - /// The predicate which must be satisfied - /// - /// - /// 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 . - /// - /// is . - public AndConstraint Match(Expression> predicate, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - Guard.ThrowIfArgumentIsNull(predicate); - - CurrentAssertionChain - .ForCondition(predicate.Compile()((T)Subject)) - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:value} to match {0}{reason}, but found {1}.", predicate.Body, 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() instead?"); - - private protected virtual bool IsNaN(T value) => false; - - /// - /// A method to generate additional information upon comparison failures. - /// - /// The current numeric value verified to be non-null. - /// The value to compare the current numeric value with. - /// - /// Returns the difference between a number value and the value. - /// Returns `null` if the compared numbers are small enough that a difference message is irrelevant. - /// - private protected virtual string CalculateDifferenceForFailureMessage(T subject, T expected) => null; - - private string GenerateDifferenceMessage(T? expected) - { - const string noDifferenceMessage = "."; - - if (Subject is not { } subject || expected is not T expectedValue) - { - return noDifferenceMessage; - } - - var difference = CalculateDifferenceForFailureMessage(subject, expectedValue); - return difference is null ? noDifferenceMessage : $" (difference of {difference})."; } - /// - /// Provides access to the that this assertion class was initialized with. - /// - public AssertionChain CurrentAssertionChain { get; } + public override T Subject { get; } } diff --git a/Src/FluentAssertions/Numeric/NumericAssertionsBase.cs b/Src/FluentAssertions/Numeric/NumericAssertionsBase.cs new file mode 100644 index 0000000000..224f4ad286 --- /dev/null +++ b/Src/FluentAssertions/Numeric/NumericAssertionsBase.cs @@ -0,0 +1,495 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Linq.Expressions; +using FluentAssertions.Common; +using FluentAssertions.Execution; + +namespace FluentAssertions.Numeric; + +#pragma warning disable CS0659, S1206 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals +public abstract class NumericAssertionsBase + where T : struct, IComparable + where TAssertions : NumericAssertionsBase +{ + public abstract TSubject Subject { get; } + + protected NumericAssertionsBase(AssertionChain assertionChain) + { + CurrentAssertionChain = assertionChain; + } + + /// + /// Asserts that the integral number value is exactly the same as the value. + /// + /// The expected value. + /// + /// 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 Be(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(Subject is T subject && subject.CompareTo(expected) == 0) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:value} to be {0}{reason}, but found {1}" + GenerateDifferenceMessage(expected), expected, + Subject); + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that the integral number value is exactly the same as the value. + /// + /// The expected value. + /// + /// 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 Be(T? expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(expected is { } value ? Subject is T subject && subject.CompareTo(value) == 0 : Subject is not T) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:value} to be {0}{reason}, but found {1}" + GenerateDifferenceMessage(expected), expected, + Subject); + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that the integral number value is not the same as the value. + /// + /// The unexpected value. + /// + /// 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 NotBe(T unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(Subject is not T subject || subject.CompareTo(unexpected) != 0) + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect {context:value} to be {0}{reason}.", unexpected); + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that the integral number value is not the same as the value. + /// + /// The unexpected value. + /// + /// 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 NotBe(T? unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(unexpected is { } value ? Subject is not T subject || subject.CompareTo(value) != 0 : Subject is T) + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect {context:value} to be {0}{reason}.", unexpected); + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that the numeric value is greater than zero. + /// + /// + /// 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 BePositive([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(Subject is T subject && subject.CompareTo(default) > 0) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:value} to be positive{reason}, but found {0}.", Subject); + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that the numeric value is less than zero. + /// + /// + /// 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 BeNegative([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(Subject is T value && !IsNaN(value) && value.CompareTo(default) < 0) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:value} to be negative{reason}, but found {0}.", Subject); + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that the numeric value is less than the specified value. + /// + /// The value to compare the current numeric value with. + /// + /// 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 BeLessThan(T expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + if (IsNaN(expected)) + { + throw new ArgumentException("A value can never be less than NaN", nameof(expected)); + } + + CurrentAssertionChain + .ForCondition(Subject is T value && !IsNaN(value) && value.CompareTo(expected) < 0) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:value} to be less than {0}{reason}, but found {1}" + GenerateDifferenceMessage(expected), + expected, Subject); + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that the numeric value is less than or equal to the specified value. + /// + /// The value to compare the current numeric value with. + /// + /// 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 BeLessThanOrEqualTo(T expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + if (IsNaN(expected)) + { + throw new ArgumentException("A value can never be less than or equal to NaN", nameof(expected)); + } + + CurrentAssertionChain + .ForCondition(Subject is T value && !IsNaN(value) && value.CompareTo(expected) <= 0) + .BecauseOf(because, becauseArgs) + .FailWith( + "Expected {context:value} to be less than or equal to {0}{reason}, but found {1}" + + GenerateDifferenceMessage(expected), expected, Subject); + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that the numeric value is greater than the specified value. + /// + /// The value to compare the current numeric value with. + /// + /// 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 BeGreaterThan(T expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + if (IsNaN(expected)) + { + throw new ArgumentException("A value can never be greater than NaN", nameof(expected)); + } + + CurrentAssertionChain + .ForCondition(Subject is T subject && subject.CompareTo(expected) > 0) + .BecauseOf(because, becauseArgs) + .FailWith( + "Expected {context:value} to be greater than {0}{reason}, but found {1}" + GenerateDifferenceMessage(expected), + expected, Subject); + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that the numeric value is greater than or equal to the specified value. + /// + /// The value to compare the current numeric value with. + /// + /// 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 BeGreaterThanOrEqualTo(T expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + if (IsNaN(expected)) + { + throw new ArgumentException("A value can never be greater than or equal to a NaN", nameof(expected)); + } + + CurrentAssertionChain + .ForCondition(Subject is T subject && subject.CompareTo(expected) >= 0) + .BecauseOf(because, becauseArgs) + .FailWith( + "Expected {context:value} to be greater than or equal to {0}{reason}, but found {1}" + + GenerateDifferenceMessage(expected), expected, Subject); + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that a value is within a range. + /// + /// + /// Where the range is continuous or incremental depends on the actual type of the value. + /// + /// + /// The minimum valid value of the range (inclusive). + /// + /// + /// The maximum valid value of the range (inclusive). + /// + /// + /// 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 BeInRange(T minimumValue, T maximumValue, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + if (IsNaN(minimumValue) || IsNaN(maximumValue)) + { + throw new ArgumentException("A range cannot begin or end with NaN"); + } + + CurrentAssertionChain + .ForCondition(Subject is T value && value.CompareTo(minimumValue) >= 0 && value.CompareTo(maximumValue) <= 0) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:value} to be between {0} and {1}{reason}, but found {2}.", + minimumValue, maximumValue, Subject); + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that a value is not within a range. + /// + /// + /// Where the range is continuous or incremental depends on the actual type of the value. + /// + /// + /// The minimum valid value of the range. + /// + /// + /// The maximum valid value of the range. + /// + /// + /// 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 NotBeInRange(T minimumValue, T maximumValue, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + if (IsNaN(minimumValue) || IsNaN(maximumValue)) + { + throw new ArgumentException("A range cannot begin or end with NaN"); + } + + CurrentAssertionChain + .ForCondition(Subject is T value && !(value.CompareTo(minimumValue) >= 0 && value.CompareTo(maximumValue) <= 0)) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:value} to not be between {0} and {1}{reason}, but found {2}.", + minimumValue, maximumValue, Subject); + + 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, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(Subject is T value && validValues.Contains(value)) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:value} to be one of {0}{reason}, but found {1}.", validValues, Subject); + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that the object is of the specified type . + /// + /// + /// The type that the subject is supposed to be of. + /// + /// + /// 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 . + /// + /// is . + public AndConstraint BeOfType(Type expectedType, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(expectedType); + + Type subjectType = Subject?.GetType(); + + if (expectedType.IsGenericTypeDefinition && subjectType?.IsGenericType == true) + { + subjectType.GetGenericTypeDefinition().Should().Be(expectedType, because, becauseArgs); + } + else + { + subjectType.Should().Be(expectedType, because, becauseArgs); + } + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that the object is not of the specified type . + /// + /// + /// The type that the subject is not supposed to be of. + /// + /// + /// 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 . + /// + /// is . + public AndConstraint NotBeOfType(Type unexpectedType, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(unexpectedType); + + CurrentAssertionChain + .ForCondition(Subject is T) + .BecauseOf(because, becauseArgs) + .FailWith("Expected type not to be " + unexpectedType + "{reason}, but found ."); + + if (CurrentAssertionChain.Succeeded) + { + Subject.GetType().Should().NotBe(unexpectedType, because, becauseArgs); + } + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that the is satisfied. + /// + /// + /// The predicate which must be satisfied + /// + /// + /// 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 . + /// + /// is . + public AndConstraint Match(Expression> predicate, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(predicate); + + CurrentAssertionChain + .ForCondition(Subject is T expression && predicate.Compile()(expression)) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:value} to match {0}{reason}, but found {1}.", predicate.Body, 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() instead?"); + + private protected virtual bool IsNaN(T value) => false; + + /// + /// A method to generate additional information upon comparison failures. + /// + /// The current numeric value verified to be non-null. + /// The value to compare the current numeric value with. + /// + /// Returns the difference between a number value and the value. + /// Returns `null` if the compared numbers are small enough that a difference message is irrelevant. + /// + private protected virtual string CalculateDifferenceForFailureMessage(T subject, T expected) => null; + + private string GenerateDifferenceMessage(T? expected) + { + const string noDifferenceMessage = "."; + + if (Subject is not T subject || expected is not { } expectedValue) + { + return noDifferenceMessage; + } + + var difference = CalculateDifferenceForFailureMessage(subject, expectedValue); + return difference is null ? noDifferenceMessage : $" (difference of {difference})."; + } + + /// + /// Provides access to the that this assertion class was initialized with. + /// + public AssertionChain CurrentAssertionChain { get; } +} diff --git a/Src/FluentAssertions/NumericAssertionsExtensions.cs b/Src/FluentAssertions/NumericAssertionsExtensions.cs index 20d3b9e6fe..579170798d 100644 --- a/Src/FluentAssertions/NumericAssertionsExtensions.cs +++ b/Src/FluentAssertions/NumericAssertionsExtensions.cs @@ -34,7 +34,7 @@ public static AndConstraint> BeCloseTo(this NumericAsse sbyte nearbyValue, byte delta, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - sbyte actualValue = parent.Subject.Value; + sbyte actualValue = parent.Subject; sbyte minValue = (sbyte)(nearbyValue - delta); if (minValue > nearbyValue) @@ -77,7 +77,7 @@ public static AndConstraint> BeCloseTo(this NumericAsser byte nearbyValue, byte delta, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - byte actualValue = parent.Subject.Value; + byte actualValue = parent.Subject; byte minValue = (byte)(nearbyValue - delta); if (minValue > nearbyValue) @@ -120,7 +120,7 @@ public static AndConstraint> BeCloseTo(this NumericAsse short nearbyValue, ushort delta, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - short actualValue = parent.Subject.Value; + short actualValue = parent.Subject; short minValue = (short)(nearbyValue - delta); if (minValue > nearbyValue) @@ -164,7 +164,7 @@ public static AndConstraint> BeCloseTo(this NumericAss ushort nearbyValue, ushort delta, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - ushort actualValue = parent.Subject.Value; + ushort actualValue = parent.Subject; ushort minValue = (ushort)(nearbyValue - delta); if (minValue > nearbyValue) @@ -208,7 +208,7 @@ public static AndConstraint> BeCloseTo(this NumericAssert int nearbyValue, uint delta, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - int actualValue = parent.Subject.Value; + int actualValue = parent.Subject; int minValue = (int)(nearbyValue - delta); if (minValue > nearbyValue) @@ -253,7 +253,7 @@ public static AndConstraint> BeCloseTo(this NumericAsser uint nearbyValue, uint delta, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - uint actualValue = parent.Subject.Value; + uint actualValue = parent.Subject; uint minValue = nearbyValue - delta; if (minValue > nearbyValue) @@ -298,7 +298,7 @@ public static AndConstraint> BeCloseTo(this NumericAsser long nearbyValue, ulong delta, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - long actualValue = parent.Subject.Value; + long actualValue = parent.Subject; long minValue = GetMinValue(nearbyValue, delta); long maxValue = GetMaxValue(nearbyValue, delta); @@ -331,7 +331,7 @@ public static AndConstraint> BeCloseTo(this NumericAsse ulong nearbyValue, ulong delta, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - ulong actualValue = parent.Subject.Value; + ulong actualValue = parent.Subject; ulong minValue = nearbyValue - delta; if (minValue > nearbyValue) @@ -390,7 +390,7 @@ public static AndConstraint> NotBeCloseTo(this NumericA sbyte distantValue, byte delta, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - sbyte actualValue = parent.Subject.Value; + sbyte actualValue = parent.Subject; sbyte minValue = (sbyte)(distantValue - delta); if (minValue > distantValue) @@ -434,7 +434,7 @@ public static AndConstraint> NotBeCloseTo(this NumericAs byte distantValue, byte delta, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - byte actualValue = parent.Subject.Value; + byte actualValue = parent.Subject; byte minValue = (byte)(distantValue - delta); if (minValue > distantValue) @@ -479,7 +479,7 @@ public static AndConstraint> NotBeCloseTo(this NumericA short distantValue, ushort delta, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - short actualValue = parent.Subject.Value; + short actualValue = parent.Subject; short minValue = (short)(distantValue - delta); if (minValue > distantValue) @@ -524,7 +524,7 @@ public static AndConstraint> NotBeCloseTo(this Numeric ushort distantValue, ushort delta, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - ushort actualValue = parent.Subject.Value; + ushort actualValue = parent.Subject; ushort minValue = (ushort)(distantValue - delta); if (minValue > distantValue) @@ -568,7 +568,7 @@ public static AndConstraint> NotBeCloseTo(this NumericAss int distantValue, uint delta, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - int actualValue = parent.Subject.Value; + int actualValue = parent.Subject; int minValue = (int)(distantValue - delta); if (minValue > distantValue) @@ -613,7 +613,7 @@ public static AndConstraint> NotBeCloseTo(this NumericAs uint distantValue, uint delta, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - uint actualValue = parent.Subject.Value; + uint actualValue = parent.Subject; uint minValue = distantValue - delta; if (minValue > distantValue) @@ -657,7 +657,7 @@ public static AndConstraint> NotBeCloseTo(this NumericAs long distantValue, ulong delta, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - long actualValue = parent.Subject.Value; + long actualValue = parent.Subject; long minValue = GetMinValue(distantValue, delta); long maxValue = GetMaxValue(distantValue, delta); @@ -690,7 +690,7 @@ public static AndConstraint> NotBeCloseTo(this NumericA ulong distantValue, ulong delta, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - ulong actualValue = parent.Subject.Value; + ulong actualValue = parent.Subject; ulong minValue = distantValue - delta; if (minValue > distantValue) @@ -851,17 +851,17 @@ public static AndConstraint> BeApproximately(this Numer if (float.IsPositiveInfinity(expectedValue)) { - FailIfDifferenceOutsidePrecision(float.IsPositiveInfinity(parent.Subject.Value), parent, expectedValue, precision, + FailIfDifferenceOutsidePrecision(float.IsPositiveInfinity(parent.Subject), parent, expectedValue, precision, float.NaN, because, becauseArgs); } else if (float.IsNegativeInfinity(expectedValue)) { - FailIfDifferenceOutsidePrecision(float.IsNegativeInfinity(parent.Subject.Value), parent, expectedValue, precision, + FailIfDifferenceOutsidePrecision(float.IsNegativeInfinity(parent.Subject), parent, expectedValue, precision, float.NaN, because, becauseArgs); } else { - float actualDifference = Math.Abs(expectedValue - parent.Subject.Value); + float actualDifference = Math.Abs(expectedValue - parent.Subject); FailIfDifferenceOutsidePrecision(actualDifference <= precision, parent, expectedValue, precision, actualDifference, because, becauseArgs); @@ -989,17 +989,17 @@ public static AndConstraint> BeApproximately(this Nume if (double.IsPositiveInfinity(expectedValue)) { - FailIfDifferenceOutsidePrecision(double.IsPositiveInfinity(parent.Subject.Value), parent, expectedValue, precision, + FailIfDifferenceOutsidePrecision(double.IsPositiveInfinity(parent.Subject), parent, expectedValue, precision, double.NaN, because, becauseArgs); } else if (double.IsNegativeInfinity(expectedValue)) { - FailIfDifferenceOutsidePrecision(double.IsNegativeInfinity(parent.Subject.Value), parent, expectedValue, precision, + FailIfDifferenceOutsidePrecision(double.IsNegativeInfinity(parent.Subject), parent, expectedValue, precision, double.NaN, because, becauseArgs); } else { - double actualDifference = Math.Abs(expectedValue - parent.Subject.Value); + double actualDifference = Math.Abs(expectedValue - parent.Subject); FailIfDifferenceOutsidePrecision(actualDifference <= precision, parent, expectedValue, precision, actualDifference, because, becauseArgs); @@ -1122,7 +1122,7 @@ public static AndConstraint> BeApproximately(this Num { Guard.ThrowIfArgumentIsNegative(precision); - decimal actualDifference = Math.Abs(expectedValue - parent.Subject.Value); + decimal actualDifference = Math.Abs(expectedValue - parent.Subject); FailIfDifferenceOutsidePrecision(actualDifference <= precision, parent, expectedValue, precision, actualDifference, because, becauseArgs); @@ -1260,17 +1260,17 @@ public static AndConstraint> NotBeApproximately(this Nu if (float.IsPositiveInfinity(unexpectedValue)) { - FailIfDifferenceWithinPrecision(parent, !float.IsPositiveInfinity(parent.Subject.Value), unexpectedValue, precision, + FailIfDifferenceWithinPrecision(parent, !float.IsPositiveInfinity(parent.Subject), unexpectedValue, precision, float.NaN, because, becauseArgs); } else if (float.IsNegativeInfinity(unexpectedValue)) { - FailIfDifferenceWithinPrecision(parent, !float.IsNegativeInfinity(parent.Subject.Value), unexpectedValue, precision, + FailIfDifferenceWithinPrecision(parent, !float.IsNegativeInfinity(parent.Subject), unexpectedValue, precision, float.NaN, because, becauseArgs); } else { - float actualDifference = Math.Abs(unexpectedValue - parent.Subject.Value); + float actualDifference = Math.Abs(unexpectedValue - parent.Subject); FailIfDifferenceWithinPrecision(parent, actualDifference > precision, unexpectedValue, precision, actualDifference, because, becauseArgs); @@ -1392,17 +1392,17 @@ public static AndConstraint> NotBeApproximately(this N if (double.IsPositiveInfinity(unexpectedValue)) { - FailIfDifferenceWithinPrecision(parent, !double.IsPositiveInfinity(parent.Subject.Value), unexpectedValue, precision, + FailIfDifferenceWithinPrecision(parent, !double.IsPositiveInfinity(parent.Subject), unexpectedValue, precision, double.NaN, because, becauseArgs); } else if (double.IsNegativeInfinity(unexpectedValue)) { - FailIfDifferenceWithinPrecision(parent, !double.IsNegativeInfinity(parent.Subject.Value), unexpectedValue, precision, + FailIfDifferenceWithinPrecision(parent, !double.IsNegativeInfinity(parent.Subject), unexpectedValue, precision, double.NaN, because, becauseArgs); } else { - double actualDifference = Math.Abs(unexpectedValue - parent.Subject.Value); + double actualDifference = Math.Abs(unexpectedValue - parent.Subject); FailIfDifferenceWithinPrecision(parent, actualDifference > precision, unexpectedValue, precision, actualDifference, because, becauseArgs); @@ -1517,7 +1517,7 @@ public static AndConstraint> NotBeApproximately(this { Guard.ThrowIfArgumentIsNegative(precision); - decimal actualDifference = Math.Abs(unexpectedValue - parent.Subject.Value); + decimal actualDifference = Math.Abs(unexpectedValue - parent.Subject); FailIfDifferenceWithinPrecision(parent, actualDifference > precision, unexpectedValue, precision, actualDifference, because, becauseArgs); @@ -1556,7 +1556,7 @@ public static AndConstraint> BeNaN(this NumericAssertio [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - float actualValue = parent.Subject.Value; + float actualValue = parent.Subject; parent.CurrentAssertionChain .ForCondition(float.IsNaN(actualValue)) @@ -1580,7 +1580,7 @@ public static AndConstraint> BeNaN(this NumericAsserti [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - double actualValue = parent.Subject.Value; + double actualValue = parent.Subject; parent.CurrentAssertionChain .ForCondition(double.IsNaN(actualValue)) @@ -1656,7 +1656,7 @@ public static AndConstraint> NotBeNaN(this NumericAsser [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - float actualValue = parent.Subject.Value; + float actualValue = parent.Subject; parent.CurrentAssertionChain .ForCondition(!float.IsNaN(actualValue)) @@ -1680,7 +1680,7 @@ public static AndConstraint> NotBeNaN(this NumericAsse [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - double actualValue = parent.Subject.Value; + double actualValue = parent.Subject; parent.CurrentAssertionChain .ForCondition(!double.IsNaN(actualValue)) diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 0bb163517b..65f39a1a57 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -143,7 +143,7 @@ namespace FluentAssertions public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Numeric.NumericAssertions _) + public static void Should(this FluentAssertions.Numeric.NumericAssertionsBase _) where TSubject : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NumericAssertions { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + @@ -1563,29 +1563,25 @@ namespace FluentAssertions.Numeric { public NullableNumericAssertions(T? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } - public class NullableNumericAssertions : FluentAssertions.Numeric.NumericAssertions + public class NullableNumericAssertions : FluentAssertions.Numeric.NumericAssertionsBase where T : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NullableNumericAssertions { public NullableNumericAssertions(T? value, FluentAssertions.Execution.AssertionChain assertionChain) { } + public override T? Subject { get; } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } } - public class NumericAssertions : FluentAssertions.Numeric.NumericAssertions> + public abstract class NumericAssertionsBase where T : struct, System.IComparable + where TAssertions : FluentAssertions.Numeric.NumericAssertionsBase { - public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } - } - public class NumericAssertions - where T : struct, System.IComparable - where TAssertions : FluentAssertions.Numeric.NumericAssertions - { - public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } + protected NumericAssertionsBase(FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.Execution.AssertionChain CurrentAssertionChain { get; } - public T? Subject { get; } + public abstract TSubject Subject { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } @@ -1605,6 +1601,18 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint NotBeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeOfType(System.Type unexpectedType, string because = "", params object[] becauseArgs) { } } + public class NumericAssertions : FluentAssertions.Numeric.NumericAssertions> + where T : struct, System.IComparable + { + public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } + } + public class NumericAssertions : FluentAssertions.Numeric.NumericAssertionsBase + where T : struct, System.IComparable + where TAssertions : FluentAssertions.Numeric.NumericAssertions + { + public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } + public override T Subject { get; } + } } namespace FluentAssertions.Primitives { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index ef4e55d598..fb2011caff 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -156,7 +156,7 @@ namespace FluentAssertions public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Numeric.NumericAssertions _) + public static void Should(this FluentAssertions.Numeric.NumericAssertionsBase _) where TSubject : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NumericAssertions { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + @@ -1588,29 +1588,25 @@ namespace FluentAssertions.Numeric { public NullableNumericAssertions(T? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } - public class NullableNumericAssertions : FluentAssertions.Numeric.NumericAssertions + public class NullableNumericAssertions : FluentAssertions.Numeric.NumericAssertionsBase where T : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NullableNumericAssertions { public NullableNumericAssertions(T? value, FluentAssertions.Execution.AssertionChain assertionChain) { } + public override T? Subject { get; } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } } - public class NumericAssertions : FluentAssertions.Numeric.NumericAssertions> + public abstract class NumericAssertionsBase where T : struct, System.IComparable + where TAssertions : FluentAssertions.Numeric.NumericAssertionsBase { - public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } - } - public class NumericAssertions - where T : struct, System.IComparable - where TAssertions : FluentAssertions.Numeric.NumericAssertions - { - public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } + protected NumericAssertionsBase(FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.Execution.AssertionChain CurrentAssertionChain { get; } - public T? Subject { get; } + public abstract TSubject Subject { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } @@ -1630,6 +1626,18 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint NotBeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeOfType(System.Type unexpectedType, string because = "", params object[] becauseArgs) { } } + public class NumericAssertions : FluentAssertions.Numeric.NumericAssertions> + where T : struct, System.IComparable + { + public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } + } + public class NumericAssertions : FluentAssertions.Numeric.NumericAssertionsBase + where T : struct, System.IComparable + where TAssertions : FluentAssertions.Numeric.NumericAssertions + { + public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } + public override T Subject { get; } + } } namespace FluentAssertions.Primitives { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index cf3bf3559d..606f86deae 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -141,7 +141,7 @@ namespace FluentAssertions public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Numeric.NumericAssertions _) + public static void Should(this FluentAssertions.Numeric.NumericAssertionsBase _) where TSubject : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NumericAssertions { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + @@ -1507,29 +1507,25 @@ namespace FluentAssertions.Numeric { public NullableNumericAssertions(T? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } - public class NullableNumericAssertions : FluentAssertions.Numeric.NumericAssertions + public class NullableNumericAssertions : FluentAssertions.Numeric.NumericAssertionsBase where T : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NullableNumericAssertions { public NullableNumericAssertions(T? value, FluentAssertions.Execution.AssertionChain assertionChain) { } + public override T? Subject { get; } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } } - public class NumericAssertions : FluentAssertions.Numeric.NumericAssertions> + public abstract class NumericAssertionsBase where T : struct, System.IComparable + where TAssertions : FluentAssertions.Numeric.NumericAssertionsBase { - public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } - } - public class NumericAssertions - where T : struct, System.IComparable - where TAssertions : FluentAssertions.Numeric.NumericAssertions - { - public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } + protected NumericAssertionsBase(FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.Execution.AssertionChain CurrentAssertionChain { get; } - public T? Subject { get; } + public abstract TSubject Subject { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } @@ -1549,6 +1545,18 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint NotBeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeOfType(System.Type unexpectedType, string because = "", params object[] becauseArgs) { } } + public class NumericAssertions : FluentAssertions.Numeric.NumericAssertions> + where T : struct, System.IComparable + { + public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } + } + public class NumericAssertions : FluentAssertions.Numeric.NumericAssertionsBase + where T : struct, System.IComparable + where TAssertions : FluentAssertions.Numeric.NumericAssertions + { + public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } + public override T Subject { get; } + } } namespace FluentAssertions.Primitives { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 949879282d..37cbc1f0e2 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -143,7 +143,7 @@ namespace FluentAssertions public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] - public static void Should(this FluentAssertions.Numeric.NumericAssertions _) + public static void Should(this FluentAssertions.Numeric.NumericAssertionsBase _) where TSubject : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NumericAssertions { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + @@ -1563,29 +1563,25 @@ namespace FluentAssertions.Numeric { public NullableNumericAssertions(T? value, FluentAssertions.Execution.AssertionChain assertionChain) { } } - public class NullableNumericAssertions : FluentAssertions.Numeric.NumericAssertions + public class NullableNumericAssertions : FluentAssertions.Numeric.NumericAssertionsBase where T : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NullableNumericAssertions { public NullableNumericAssertions(T? value, FluentAssertions.Execution.AssertionChain assertionChain) { } + public override T? Subject { get; } public FluentAssertions.AndConstraint BeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Match(System.Linq.Expressions.Expression> predicate, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeNull(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveValue(string because = "", params object[] becauseArgs) { } } - public class NumericAssertions : FluentAssertions.Numeric.NumericAssertions> + public abstract class NumericAssertionsBase where T : struct, System.IComparable + where TAssertions : FluentAssertions.Numeric.NumericAssertionsBase { - public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } - } - public class NumericAssertions - where T : struct, System.IComparable - where TAssertions : FluentAssertions.Numeric.NumericAssertions - { - public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } + protected NumericAssertionsBase(FluentAssertions.Execution.AssertionChain assertionChain) { } public FluentAssertions.Execution.AssertionChain CurrentAssertionChain { get; } - public T? Subject { get; } + public abstract TSubject Subject { get; } public FluentAssertions.AndConstraint Be(T expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Be(T? expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeGreaterThan(T expected, string because = "", params object[] becauseArgs) { } @@ -1605,6 +1601,18 @@ namespace FluentAssertions.Numeric public FluentAssertions.AndConstraint NotBeInRange(T minimumValue, T maximumValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeOfType(System.Type unexpectedType, string because = "", params object[] becauseArgs) { } } + public class NumericAssertions : FluentAssertions.Numeric.NumericAssertions> + where T : struct, System.IComparable + { + public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } + } + public class NumericAssertions : FluentAssertions.Numeric.NumericAssertionsBase + where T : struct, System.IComparable + where TAssertions : FluentAssertions.Numeric.NumericAssertions + { + public NumericAssertions(T value, FluentAssertions.Execution.AssertionChain assertionChain) { } + public override T Subject { get; } + } } namespace FluentAssertions.Primitives { diff --git a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs index a49e9516ee..74473ffe21 100644 --- a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs @@ -83,7 +83,6 @@ public void Guarding_equals_throws(object obj) [InlineData(typeof(ExecutionTimeAssertions))] [InlineData(typeof(GuidAssertions))] [InlineData(typeof(MethodInfoSelectorAssertions))] - [InlineData(typeof(NumericAssertions>))] [InlineData(typeof(PropertyInfoSelectorAssertions))] [InlineData(typeof(SimpleTimeSpanAssertions))] [InlineData(typeof(TaskCompletionSourceAssertionsBase))] From 70cae37543ffaa90c38b55291fb28518122d8ac0 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Thu, 31 Oct 2024 20:32:09 +0100 Subject: [PATCH 435/845] Increase code coverage (#2746) * Exclude some unused, but probably needed code from coverage report * Convert concatenation to interpolation * Remove unreachable code path * Add test for missing default path in `GetMemberPath` * Add missing test when chaining two assertions for `StringStartStrategy` and `StringEndStrategy` * Accept API changes * Remove unused `Exception` constructors * Fix XML comment in `AssertionFailedException` --- .../Common/ExpressionExtensions.cs | 6 +++--- .../Execution/AssertionFailedException.cs | 14 ++----------- .../Execution/DefaultAssertionStrategy.cs | 2 ++ Src/FluentAssertions/Formatting/Formatter.cs | 1 + .../Formatting/MaxLinesExceededException.cs | 19 +++-------------- .../Primitives/StringContainsStrategy.cs | 4 ++-- .../Primitives/StringEndStrategy.cs | 7 +++---- .../Primitives/StringEqualityStrategy.cs | 15 ++++++------- .../Primitives/StringStartStrategy.cs | 7 +++---- .../Primitives/StringValidator.cs | 2 +- .../StringValidatorSupportingNull.cs | 5 ----- .../StringWildcardMatchingStrategy.cs | 4 ++-- .../FluentAssertions/net47.verified.txt | 4 ---- .../FluentAssertions/net6.0.verified.txt | 4 ---- .../netstandard2.0.verified.txt | 4 ---- .../netstandard2.1.verified.txt | 4 ---- .../SelectionRulesSpecs.Excluding.cs | 21 +++++++++++++++++++ .../StringAssertionSpecs.EndWith.cs | 15 +++++++++++++ .../StringAssertionSpecs.StartWith.cs | 17 +++++++++++++++ 19 files changed, 81 insertions(+), 74 deletions(-) diff --git a/Src/FluentAssertions/Common/ExpressionExtensions.cs b/Src/FluentAssertions/Common/ExpressionExtensions.cs index 3200353ddb..0a4ac3105b 100644 --- a/Src/FluentAssertions/Common/ExpressionExtensions.cs +++ b/Src/FluentAssertions/Common/ExpressionExtensions.cs @@ -20,7 +20,7 @@ public static PropertyInfo GetPropertyInfo(this Expression when a property expression is expected.", + throw new ArgumentException($"Cannot use <{expression.Body}> when a property expression is expected.", nameof(expression)); } @@ -77,7 +77,7 @@ public static MemberPath GetMemberPath( var indexExpression = (ConstantExpression)binaryExpression.Right; node = binaryExpression.Left; - segments.Add("[" + indexExpression.Value + "]"); + segments.Add($"[{indexExpression.Value}]"); break; case ExpressionType.Parameter: @@ -93,7 +93,7 @@ public static MemberPath GetMemberPath( } node = methodCallExpression.Object; - segments.Add("[" + argumentExpression.Value + "]"); + segments.Add($"[{argumentExpression.Value}]"); break; default: diff --git a/Src/FluentAssertions/Execution/AssertionFailedException.cs b/Src/FluentAssertions/Execution/AssertionFailedException.cs index 391b67227c..916732abe8 100644 --- a/Src/FluentAssertions/Execution/AssertionFailedException.cs +++ b/Src/FluentAssertions/Execution/AssertionFailedException.cs @@ -1,23 +1,13 @@ using System; -using System.Runtime.Serialization; namespace FluentAssertions.Execution; /// /// Represents the default exception in case no test framework is configured. /// -[Serializable] +/// The mandatory exception message #pragma warning disable CA1032, RCS1194 // AssertionFailedException should never be constructed with an empty message -public class AssertionFailedException : Exception +public class AssertionFailedException(string message) : Exception(message) #pragma warning restore CA1032, RCS1194 { - public AssertionFailedException(string message) - : base(message) - { - } - - protected AssertionFailedException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } } diff --git a/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs b/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs index a9739648d3..f8ae691144 100644 --- a/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs +++ b/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs @@ -1,8 +1,10 @@ using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Common; namespace FluentAssertions.Execution; +[ExcludeFromCodeCoverage] internal class DefaultAssertionStrategy : IAssertionStrategy { /// diff --git a/Src/FluentAssertions/Formatting/Formatter.cs b/Src/FluentAssertions/Formatting/Formatter.cs index 4ac3f13bfd..c8683ce37c 100644 --- a/Src/FluentAssertions/Formatting/Formatter.cs +++ b/Src/FluentAssertions/Formatting/Formatter.cs @@ -14,6 +14,7 @@ namespace FluentAssertions.Formatting; public static class Formatter { #region Private Definitions + private static readonly List CustomFormatters = []; private static readonly List DefaultFormatters = diff --git a/Src/FluentAssertions/Formatting/MaxLinesExceededException.cs b/Src/FluentAssertions/Formatting/MaxLinesExceededException.cs index 4920473fe4..f6d5b5b260 100644 --- a/Src/FluentAssertions/Formatting/MaxLinesExceededException.cs +++ b/Src/FluentAssertions/Formatting/MaxLinesExceededException.cs @@ -2,19 +2,6 @@ namespace FluentAssertions.Formatting; -public class MaxLinesExceededException : Exception -{ - public MaxLinesExceededException(string message, Exception innerException) - : base(message, innerException) - { - } - - public MaxLinesExceededException(string message) - : base(message) - { - } - - public MaxLinesExceededException() - { - } -} +#pragma warning disable RCS1194, CA1032 // Add constructors +public class MaxLinesExceededException : Exception; +#pragma warning restore CA1032, RCS1194 diff --git a/Src/FluentAssertions/Primitives/StringContainsStrategy.cs b/Src/FluentAssertions/Primitives/StringContainsStrategy.cs index c82a053b73..4d92ad2bd0 100644 --- a/Src/FluentAssertions/Primitives/StringContainsStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringContainsStrategy.cs @@ -15,7 +15,7 @@ public StringContainsStrategy(IEqualityComparer comparer, OccurrenceCons this.occurrenceConstraint = occurrenceConstraint; } - public string ExpectationDescription => "Expected {context:string} to contain the equivalent of "; + public string ExpectationDescription => "Expected {context:string} {0} to contain the equivalent of "; public void ValidateAgainstMismatch(AssertionChain assertionChain, string subject, string expected) { @@ -24,7 +24,7 @@ public void ValidateAgainstMismatch(AssertionChain assertionChain, string subjec assertionChain .ForConstraint(occurrenceConstraint, actual) .FailWith( - $"Expected {{context:string}} {{0}} to contain the equivalent of {{1}} {{expectedOccurrence}}{{reason}}, but found it {actual.Times()}.", + $"{ExpectationDescription}{{1}} {{expectedOccurrence}}{{reason}}, but found it {actual.Times()}.", subject, expected); } } diff --git a/Src/FluentAssertions/Primitives/StringEndStrategy.cs b/Src/FluentAssertions/Primitives/StringEndStrategy.cs index a2a332491f..ee97e85384 100644 --- a/Src/FluentAssertions/Primitives/StringEndStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringEndStrategy.cs @@ -15,13 +15,13 @@ public StringEndStrategy(IEqualityComparer comparer, string predicateDes this.predicateDescription = predicateDescription; } - public string ExpectationDescription => "Expected {context:string} to " + predicateDescription + " "; + public string ExpectationDescription => $"Expected {{context:string}} to {predicateDescription} "; public void ValidateAgainstMismatch(AssertionChain assertionChain, string subject, string expected) { assertionChain .ForCondition(subject!.Length >= expected.Length) - .FailWith(ExpectationDescription + "{0}{reason}, but {1} is too short.", expected, subject); + .FailWith($"{ExpectationDescription}{{0}}{{reason}}, but {{1}} is too short.", expected, subject); if (!assertionChain.Succeeded) { @@ -36,8 +36,7 @@ public void ValidateAgainstMismatch(AssertionChain assertionChain, string subjec } assertionChain.FailWith( - ExpectationDescription + "{0}{reason}, but {1} differs near " + subject.IndexedSegmentAt(indexOfMismatch) + - ".", + $"{ExpectationDescription}{{0}}{{reason}}, but {{1}} differs near {subject.IndexedSegmentAt(indexOfMismatch)}.", expected, subject); } } diff --git a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs index d2c00a4ac0..2f8d4e4110 100644 --- a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs @@ -44,9 +44,7 @@ public void ValidateAgainstMismatch(AssertionChain assertionChain, string subjec } assertionChain.FailWith( - ExpectationDescription + "the same string{reason}, but they differ " + locationDescription + ":" + - Environment.NewLine - + GetMismatchSegmentForLongStrings(subject, expected, indexOfMismatch) + "."); + $"{ExpectationDescription}the same string{{reason}}, but they differ {locationDescription}:{Environment.NewLine}{GetMismatchSegmentForLongStrings(subject, expected, indexOfMismatch)}."); } else if (ValidateAgainstLengthDifferences(assertionChain, subject, expected)) { @@ -55,23 +53,23 @@ public void ValidateAgainstMismatch(AssertionChain assertionChain, string subjec if (indexOfMismatch != -1) { assertionChain.FailWith( - ExpectationDescription + "{0}{reason}, but {1} differs near " + subject.IndexedSegmentAt(indexOfMismatch) + + $"{ExpectationDescription}{{0}}{{reason}}, but {{1}} differs near " + subject.IndexedSegmentAt(indexOfMismatch) + ".", expected, subject); } } } - public string ExpectationDescription => "Expected {context:string} to " + predicateDescription + " "; + public string ExpectationDescription => $"Expected {{context:string}} to {predicateDescription} "; private void ValidateAgainstSuperfluousWhitespace(AssertionChain assertion, string subject, string expected) { assertion .ForCondition(!(expected.Length > subject.Length && comparer.Equals(expected.TrimEnd(), subject))) - .FailWith(ExpectationDescription + "{0}{reason}, but it misses some extra whitespace at the end.", expected) + .FailWith($"{ExpectationDescription}{{0}}{{reason}}, but it misses some extra whitespace at the end.", expected) .Then .ForCondition(!(subject.Length > expected.Length && comparer.Equals(subject.TrimEnd(), expected))) - .FailWith(ExpectationDescription + "{0}{reason}, but it has unexpected whitespace at the end.", expected); + .FailWith($"{ExpectationDescription}{{0}}{{reason}}, but it has unexpected whitespace at the end.", expected); } private bool ValidateAgainstLengthDifferences(AssertionChain assertion, string subject, string expected) @@ -82,8 +80,7 @@ private bool ValidateAgainstLengthDifferences(AssertionChain assertion, string s { string mismatchSegment = GetMismatchSegmentForStringsOfDifferentLengths(subject, expected); - string message = ExpectationDescription + - "{0} with a length of {1}{reason}, but {2} has a length of {3}, differs near " + mismatchSegment + "."; + string message = $"{ExpectationDescription}{{0}} with a length of {{1}}{{reason}}, but {{2}} has a length of {{3}}, differs near " + mismatchSegment + "."; return new FailReason(message, expected, expected.Length, subject, subject.Length); }); diff --git a/Src/FluentAssertions/Primitives/StringStartStrategy.cs b/Src/FluentAssertions/Primitives/StringStartStrategy.cs index 40b6b7e834..36ff44ca8e 100644 --- a/Src/FluentAssertions/Primitives/StringStartStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringStartStrategy.cs @@ -15,13 +15,13 @@ public StringStartStrategy(IEqualityComparer comparer, string predicateD this.predicateDescription = predicateDescription; } - public string ExpectationDescription => "Expected {context:string} to " + predicateDescription + " "; + public string ExpectationDescription => $"Expected {{context:string}} to {predicateDescription} "; public void ValidateAgainstMismatch(AssertionChain assertionChain, string subject, string expected) { assertionChain .ForCondition(subject.Length >= expected.Length) - .FailWith(ExpectationDescription + "{0}{reason}, but {1} is too short.", expected, subject); + .FailWith($"{ExpectationDescription}{{0}}{{reason}}, but {{1}} is too short.", expected, subject); if (!assertionChain.Succeeded) { @@ -36,8 +36,7 @@ public void ValidateAgainstMismatch(AssertionChain assertionChain, string subjec } assertionChain.FailWith( - ExpectationDescription + "{0}{reason}, but {1} differs near " + subject.IndexedSegmentAt(indexOfMismatch) + - ".", + $"{ExpectationDescription}{{0}}{{reason}}, but {{1}} differs near {subject.IndexedSegmentAt(indexOfMismatch)}.", expected, subject); } } diff --git a/Src/FluentAssertions/Primitives/StringValidator.cs b/Src/FluentAssertions/Primitives/StringValidator.cs index e3402dde81..a1e2b2facc 100644 --- a/Src/FluentAssertions/Primitives/StringValidator.cs +++ b/Src/FluentAssertions/Primitives/StringValidator.cs @@ -42,7 +42,7 @@ private bool ValidateAgainstNulls(string subject, string expected) return true; } - assertionChain.FailWith(comparisonStrategy.ExpectationDescription + "{0}{reason}, but found {1}.", expected, subject); + assertionChain.FailWith($"{comparisonStrategy.ExpectationDescription}{{0}}{{reason}}, but found {{1}}.", expected, subject); return false; } } diff --git a/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs b/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs index f0a20b55e7..f5fb4478b4 100644 --- a/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs +++ b/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs @@ -18,11 +18,6 @@ public StringValidatorSupportingNull(AssertionChain assertionChain, IStringCompa public void Validate(string subject, string expected) { - if (expected is null && subject is null) - { - return; - } - if (expected?.IsLongOrMultiline() == true || subject?.IsLongOrMultiline() == true) { diff --git a/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs b/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs index eca22d9815..83f590048d 100644 --- a/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs @@ -19,11 +19,11 @@ public void ValidateAgainstMismatch(AssertionChain assertionChain, string subjec if (Negate) { - assertionChain.FailWith(ExpectationDescription + "but {1} matches.", expected, subject); + assertionChain.FailWith($"{ExpectationDescription}but {{1}} matches.", expected, subject); } else { - assertionChain.FailWith(ExpectationDescription + "but {1} does not.", expected, subject); + assertionChain.FailWith($"{ExpectationDescription}but {{1}} does not.", expected, subject); } } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 65f39a1a57..6da5a1790f 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -1137,11 +1137,9 @@ namespace FluentAssertions.Execution public FluentAssertions.Execution.AssertionChain WithReportable(string name, System.Func content) { } public static FluentAssertions.Execution.AssertionChain GetOrCreate() { } } - [System.Serializable] public class AssertionFailedException : System.Exception { public AssertionFailedException(string message) { } - protected AssertionFailedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public sealed class AssertionScope : System.IDisposable { @@ -1421,8 +1419,6 @@ namespace FluentAssertions.Formatting public class MaxLinesExceededException : System.Exception { public MaxLinesExceededException() { } - public MaxLinesExceededException(string message) { } - public MaxLinesExceededException(string message, System.Exception innerException) { } } public class MethodInfoFormatter : FluentAssertions.Formatting.IValueFormatter { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index fb2011caff..71e3df8a9d 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -1150,11 +1150,9 @@ namespace FluentAssertions.Execution public FluentAssertions.Execution.AssertionChain WithReportable(string name, System.Func content) { } public static FluentAssertions.Execution.AssertionChain GetOrCreate() { } } - [System.Serializable] public class AssertionFailedException : System.Exception { public AssertionFailedException(string message) { } - protected AssertionFailedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public sealed class AssertionScope : System.IDisposable { @@ -1440,8 +1438,6 @@ namespace FluentAssertions.Formatting public class MaxLinesExceededException : System.Exception { public MaxLinesExceededException() { } - public MaxLinesExceededException(string message) { } - public MaxLinesExceededException(string message, System.Exception innerException) { } } public class MethodInfoFormatter : FluentAssertions.Formatting.IValueFormatter { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 606f86deae..98cceb8555 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -1081,11 +1081,9 @@ namespace FluentAssertions.Execution public FluentAssertions.Execution.AssertionChain WithReportable(string name, System.Func content) { } public static FluentAssertions.Execution.AssertionChain GetOrCreate() { } } - [System.Serializable] public class AssertionFailedException : System.Exception { public AssertionFailedException(string message) { } - protected AssertionFailedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public sealed class AssertionScope : System.IDisposable { @@ -1365,8 +1363,6 @@ namespace FluentAssertions.Formatting public class MaxLinesExceededException : System.Exception { public MaxLinesExceededException() { } - public MaxLinesExceededException(string message) { } - public MaxLinesExceededException(string message, System.Exception innerException) { } } public class MethodInfoFormatter : FluentAssertions.Formatting.IValueFormatter { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 37cbc1f0e2..0424797abb 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -1137,11 +1137,9 @@ namespace FluentAssertions.Execution public FluentAssertions.Execution.AssertionChain WithReportable(string name, System.Func content) { } public static FluentAssertions.Execution.AssertionChain GetOrCreate() { } } - [System.Serializable] public class AssertionFailedException : System.Exception { public AssertionFailedException(string message) { } - protected AssertionFailedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public sealed class AssertionScope : System.IDisposable { @@ -1421,8 +1419,6 @@ namespace FluentAssertions.Formatting public class MaxLinesExceededException : System.Exception { public MaxLinesExceededException() { } - public MaxLinesExceededException(string message) { } - public MaxLinesExceededException(string message, System.Exception innerException) { } } public class MethodInfoFormatter : FluentAssertions.Formatting.IValueFormatter { diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs index 09c3858e6b..7ad01e1238 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs @@ -666,5 +666,26 @@ public void When_excluding_virtual_or_abstract_property_exclusion_works_properly .Excluding(o => o.VirtualProperty) .Excluding(o => o.DerivedProperty2)); } + + [Fact] + public void Abstract_properties_cannot_be_excluded() + { + var obj1 = new Derived + { + DerivedProperty1 = "Something", + DerivedProperty2 = "A" + }; + + var obj2 = new Derived + { + DerivedProperty1 = "Something", + DerivedProperty2 = "B" + }; + + Action act = () => obj1.Should().BeEquivalentTo(obj2, opt => opt + .Excluding(o => o.AbstractProperty + "B")); + + act.Should().Throw().WithMessage("*(o.AbstractProperty + \"B\")*cannot be used to select a member*"); + } } } diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.EndWith.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.EndWith.cs index 1be9e8ce94..2d92079989 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.EndWith.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.EndWith.cs @@ -83,6 +83,21 @@ public void When_string_ending_is_compared_with_string_that_is_longer_it_should_ "\"ABC\" is too short."); } + [Fact] + public void Correctly_stop_further_execution_when_inside_assertion_scope() + { + // Act + Action act = () => + { + using var _ = new AssertionScope(); + "ABC".Should().EndWith("00ABC").And.EndWith("CBA00"); + }; + + // Assert + act.Should().Throw().WithMessage( + "*\"00ABC\"*"); + } + [Fact] public void When_string_ending_is_compared_and_actual_value_is_null_then_it_should_throw() { diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.StartWith.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.StartWith.cs index 74edf7c660..48dc191efc 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.StartWith.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.StartWith.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics.CodeAnalysis; +using FluentAssertions.Execution; using Xunit; using Xunit.Sdk; @@ -89,6 +90,22 @@ public void When_string_start_is_compared_with_string_that_is_longer_it_should_t "Expected string to start with \"ABCDEF\", but \"ABC\" is too short."); } + [Fact] + [SuppressMessage("ReSharper", "StringLiteralTypo")] + public void Correctly_stop_further_execution_when_inside_assertion_scope() + { + // Act + Action act = () => + { + using var _ = new AssertionScope(); + "ABC".Should().StartWith("ABCDEF").And.StartWith("FEDCBA"); + }; + + // Assert + act.Should().Throw().WithMessage( + "*\"ABCDEF\"*"); + } + [Fact] public void When_string_start_is_compared_and_actual_value_is_null_then_it_should_throw() { From f5814c39e57cbe41aa940aec967357b8cc57da7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:41:28 +0100 Subject: [PATCH 436/845] Bump the xunit group with 2 updates (#2802) Bumps the xunit group with 2 updates: [Verify.Xunit](https://github.com/VerifyTests/Verify) and [System.Collections.Immutable](https://github.com/dotnet/runtime). Updates `Verify.Xunit` from 27.1.0 to 28.1.3 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/27.1.0...28.1.3) Updates `System.Collections.Immutable` from 1.5.0 to 8.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v8.0.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 71f164dd67..025ad5845e 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 0ce19e3351bd532e9ad9c30364ee2eaefad4a46f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:42:27 +0100 Subject: [PATCH 437/845] Bump Microsoft.Testing.Extensions.TrxReport from 1.4.1 to 1.4.2 (#2804) Bumps [Microsoft.Testing.Extensions.TrxReport](https://github.com/microsoft/testfx) from 1.4.1 to 1.4.2. - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog-Platform.md) - [Commits](https://github.com/microsoft/testfx/commits) --- updated-dependencies: - dependency-name: Microsoft.Testing.Extensions.TrxReport dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 9731f5e34d..937f9e7acc 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -12,7 +12,7 @@ - + From 2e89439129805ea8e1abe6f61d72ddb35c03cef4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:43:45 +0100 Subject: [PATCH 438/845] Bump Meziantou.Analyzer from 2.0.176 to 2.0.177 (#2803) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.176 to 2.0.177. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.176...2.0.177) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index f38708c1e6..7316556396 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From f7507346fc4ce98c085594e6983e6a06c1a6e280 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:56:41 +0100 Subject: [PATCH 439/845] Bump cspell from 8.15.4 to 8.15.7 (#2805) Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.15.4 to 8.15.7. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.15.7/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 290 ++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 155 insertions(+), 137 deletions(-) diff --git a/package-lock.json b/package-lock.json index cb5788aaa6..20d5f63919 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,19 +7,20 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.15.4" + "cspell": "^8.15.7" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.15.4.tgz", - "integrity": "sha512-t5b2JwGeUmzmjl319mCuaeKGxTvmzLLRmrpdHr+ZZGRO4nf7L48Lbe9A6uwNUvsZe0cXohiNXsrrsuzRVXswVA==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.15.7.tgz", + "integrity": "sha512-lNbrlHhDnOWCJh/vNCliZJz4X1KMEZqWJZpTgmdPrEGS9ZyfEiCmZyoQzw+fauC5Xo7dwd2KdS9VMHftAJqMPQ==", "dependencies": { "@cspell/dict-ada": "^4.0.5", + "@cspell/dict-al": "^1.0.3", "@cspell/dict-aws": "^4.0.7", "@cspell/dict-bash": "^4.1.8", "@cspell/dict-companies": "^3.1.7", - "@cspell/dict-cpp": "^5.1.22", + "@cspell/dict-cpp": "^6.0.0", "@cspell/dict-cryptocurrencies": "^5.0.3", "@cspell/dict-csharp": "^4.0.5", "@cspell/dict-css": "^4.0.16", @@ -31,7 +32,7 @@ "@cspell/dict-en_us": "^4.3.26", "@cspell/dict-en-common-misspellings": "^2.0.7", "@cspell/dict-en-gb": "1.1.33", - "@cspell/dict-filetypes": "^3.0.7", + "@cspell/dict-filetypes": "^3.0.8", "@cspell/dict-flutter": "^1.0.3", "@cspell/dict-fonts": "^4.0.3", "@cspell/dict-fsharp": "^1.0.4", @@ -41,7 +42,7 @@ "@cspell/dict-golang": "^6.0.16", "@cspell/dict-google": "^1.0.4", "@cspell/dict-haskell": "^4.0.4", - "@cspell/dict-html": "^4.0.9", + "@cspell/dict-html": "^4.0.10", "@cspell/dict-html-symbol-entities": "^4.0.3", "@cspell/dict-java": "^5.0.10", "@cspell/dict-julia": "^1.0.4", @@ -50,9 +51,10 @@ "@cspell/dict-lorem-ipsum": "^4.0.3", "@cspell/dict-lua": "^4.0.6", "@cspell/dict-makefile": "^1.0.3", + "@cspell/dict-markdown": "^2.0.7", "@cspell/dict-monkeyc": "^1.0.9", "@cspell/dict-node": "^5.0.4", - "@cspell/dict-npm": "^5.1.8", + "@cspell/dict-npm": "^5.1.9", "@cspell/dict-php": "^4.0.13", "@cspell/dict-powershell": "^5.0.13", "@cspell/dict-public-licenses": "^2.0.11", @@ -61,12 +63,12 @@ "@cspell/dict-ruby": "^5.0.7", "@cspell/dict-rust": "^4.0.9", "@cspell/dict-scala": "^5.0.6", - "@cspell/dict-software-terms": "^4.1.11", + "@cspell/dict-software-terms": "^4.1.12", "@cspell/dict-sql": "^2.1.8", "@cspell/dict-svelte": "^1.0.5", "@cspell/dict-swift": "^2.0.4", - "@cspell/dict-terraform": "^1.0.5", - "@cspell/dict-typescript": "^3.1.10", + "@cspell/dict-terraform": "^1.0.6", + "@cspell/dict-typescript": "^3.1.11", "@cspell/dict-vue": "^3.0.3" }, "engines": { @@ -74,28 +76,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.15.4.tgz", - "integrity": "sha512-solraYhZG4l++NeVCOtpc8DMvwHc46TmJt8DQbgvKtk6wOjTEcFrwKfA6Ei9YKbvyebJlpWMenO3goOll0loYg==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.15.7.tgz", + "integrity": "sha512-kOcJaThztX1A8jkALBiAyp8dWrHPMuDOXki8Q5ZG1dL25wKsAnPyqflXhXg6Up4VGVIkkgy1S3T0Q/i+G5f12w==", "dependencies": { - "@cspell/cspell-types": "8.15.4" + "@cspell/cspell-types": "8.15.7" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.15.4.tgz", - "integrity": "sha512-WfCmZVFC6mX6vYlf02hWwelcSBTbDQgc5YqY+1miuMk+OHSUAHSACjZId6/a4IAID94xScvFfj7jgrdejUVvIQ==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.15.7.tgz", + "integrity": "sha512-EyVSJPqJFrDA9Sj4Nzx13vytloMS0V3HaevhqMFLHJ53QNz/ZP7vuECbXApRAJwLonuToJBvY3b9xzB6eEhU/A==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.15.4.tgz", - "integrity": "sha512-Zr428o+uUTqywrdKyjluJVnDPVAJEqZ1chQLKIrHggUah1cgs5aQ7rZ+0Rv5euYMlC2idZnP7IL6TDaIib80oA==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.15.7.tgz", + "integrity": "sha512-9RPZ5VwjYPYLTLWkoPGHqV3Kuai5QwTWgZJW3Yk2GgJkxss/LDsXME+9CalPcPBQpnCIBEOtE2DjDQbFjAiMnA==", "dependencies": { "global-directory": "^4.0.1" }, @@ -104,17 +106,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.15.4.tgz", - "integrity": "sha512-pXYofnV/V9Y3LZdfFGbmhdxPX/ABjiD3wFjGHt5YhIU9hjVVuvjFlgY7pH2AvRjs4F8xKXv1ReWl44BJOL9gLA==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.15.7.tgz", + "integrity": "sha512-kL+1+K4VApdwZccGlg7Vjmh4CzzjoT+G556/gErdESQFPY0y9/4OPPVKLrFkbEDODtp9Py7aTRHdhl6w1xxCCw==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.15.4.tgz", - "integrity": "sha512-1hDtgYDQVW11zgtrr12EmGW45Deoi7IjZOhzPFLb+3WkhZ46ggWdbrRalWwBolQPDDo6+B2Q6WXz5hdND+Tpwg==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.15.7.tgz", + "integrity": "sha512-QMbGJsUXTdV8/V9Gsc/kBgdkBwm4hvcChhQf6KE9yeg3CZlbd95NkFJuSiqp1phJOWMTzHCZ0Ro7v7P/LGKdVA==", "engines": { "node": ">=18" } @@ -124,6 +126,11 @@ "resolved": "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.0.5.tgz", "integrity": "sha512-6/RtZ/a+lhFVmrx/B7bfP7rzC4yjEYe8o74EybXcvu4Oue6J4Ey2WSYj96iuodloj1LWrkNCQyX5h4Pmcj0Iag==" }, + "node_modules/@cspell/dict-al": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-al/-/dict-al-1.0.3.tgz", + "integrity": "sha512-V1HClwlfU/qwSq2Kt+MkqRAsonNu3mxjSCDyGRecdLGIHmh7yeEeaxqRiO/VZ4KP+eVSiSIlbwrb5YNFfxYZbw==" + }, "node_modules/@cspell/dict-aws": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.7.tgz", @@ -140,9 +147,9 @@ "integrity": "sha512-ncVs/efuAkP1/tLDhWbXukBjgZ5xOUfe03neHMWsE8zvXXc5+Lw6TX5jaJXZLOoES/f4j4AhRE20jsPCF5pm+A==" }, "node_modules/@cspell/dict-cpp": { - "version": "5.1.22", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.1.22.tgz", - "integrity": "sha512-g1/8P5/Q+xnIc8Js4UtBg3XOhcFrFlFbG3UWVtyEx49YTf0r9eyDtDt1qMMDBZT91pyCwLcAEbwS+4i5PIfNZw==" + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.1.tgz", + "integrity": "sha512-AxMC1KVu/9JSme1eG1SPQQTSLQbGUpoICMdKjQEEaB4RyrEev2V6fcVnqH38lzs+zN5Dffh04B2bTW0pT4lr9g==" }, "node_modules/@cspell/dict-cryptocurrencies": { "version": "5.0.3", @@ -205,9 +212,9 @@ "integrity": "sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==" }, "node_modules/@cspell/dict-filetypes": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.7.tgz", - "integrity": "sha512-/DN0Ujp9/EXvpTcgih9JmBaE8n+G0wtsspyNdvHT5luRfpfol1xm/CIQb6xloCXCiLkWX+EMPeLSiVIZq+24dA==" + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.8.tgz", + "integrity": "sha512-D3N8sm/iptzfVwsib/jvpX+K/++rM8SRpLDFUaM4jxm8EyGmSIYRbKZvdIv5BkAWmMlTWoRqlLn7Yb1b11jKJg==" }, "node_modules/@cspell/dict-flutter": { "version": "1.0.3", @@ -255,9 +262,9 @@ "integrity": "sha512-EwQsedEEnND/vY6tqRfg9y7tsnZdxNqOxLXSXTsFA6JRhUlr8Qs88iUUAfsUzWc4nNmmzQH2UbtT25ooG9x4nA==" }, "node_modules/@cspell/dict-html": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.9.tgz", - "integrity": "sha512-BNp7w3m910K4qIVyOBOZxHuFNbVojUY6ES8Y8r7YjYgJkm2lCuQoVwwhPjurnomJ7BPmZTb+3LLJ58XIkgF7JQ==" + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.10.tgz", + "integrity": "sha512-I9uRAcdtHbh0wEtYZlgF0TTcgH0xaw1B54G2CW+tx4vHUwlde/+JBOfIzird4+WcMv4smZOfw+qHf7puFUbI5g==" }, "node_modules/@cspell/dict-html-symbol-entities": { "version": "4.0.3", @@ -299,20 +306,31 @@ "resolved": "https://registry.npmjs.org/@cspell/dict-makefile/-/dict-makefile-1.0.3.tgz", "integrity": "sha512-R3U0DSpvTs6qdqfyBATnePj9Q/pypkje0Nj26mQJ8TOBQutCRAJbr2ZFAeDjgRx5EAJU/+8txiyVF97fbVRViw==" }, + "node_modules/@cspell/dict-markdown": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.7.tgz", + "integrity": "sha512-F9SGsSOokFn976DV4u/1eL4FtKQDSgJHSZ3+haPRU5ki6OEqojxKa8hhj4AUrtNFpmBaJx/WJ4YaEzWqG7hgqg==", + "peerDependencies": { + "@cspell/dict-css": "^4.0.16", + "@cspell/dict-html": "^4.0.10", + "@cspell/dict-html-symbol-entities": "^4.0.3", + "@cspell/dict-typescript": "^3.1.11" + } + }, "node_modules/@cspell/dict-monkeyc": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@cspell/dict-monkeyc/-/dict-monkeyc-1.0.9.tgz", "integrity": "sha512-Jvf6g5xlB4+za3ThvenYKREXTEgzx5gMUSzrAxIiPleVG4hmRb/GBSoSjtkGaibN3XxGx5x809gSTYCA/IHCpA==" }, "node_modules/@cspell/dict-node": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.4.tgz", - "integrity": "sha512-Hz5hiuOvZTd7Cp1IBqUZ7/ChwJeQpD5BJuwCaDn4mPNq4iMcQ1iWBYMThvNVqCEDgKv63X52nT8RAWacss98qg==" + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.5.tgz", + "integrity": "sha512-7NbCS2E8ZZRZwlLrh2sA0vAk9n1kcTUiRp/Nia8YvKaItGXLfxYqD2rMQ3HpB1kEutal6hQLVic3N2Yi1X7AaA==" }, "node_modules/@cspell/dict-npm": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.8.tgz", - "integrity": "sha512-AJELYXeB4fQdIoNfmuaQxB1Hli3cX6XPsQCjfBxlu0QYXhrjB/IrCLLQAjWIywDqJiWyGUFTz4DqaANm8C/r9Q==" + "version": "5.1.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.10.tgz", + "integrity": "sha512-YmOLvM3ERk/yrdk0s0HhMI7Ws4epLRycGQH5uWyvWg5F64C31mbV557+jfxjrn6Ewq3UdT4ILCS9EyCHVyirig==" }, "node_modules/@cspell/dict-php": { "version": "4.0.13", @@ -358,9 +376,9 @@ "integrity": "sha512-tl0YWAfjUVb4LyyE4JIMVE8DlLzb1ecHRmIWc4eT6nkyDqQgHKzdHsnusxFEFMVLIQomgSg0Zz6hJ5S1E4W4ww==" }, "node_modules/@cspell/dict-software-terms": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.11.tgz", - "integrity": "sha512-77CTHxWFTVw6tVoMN8WBMrlNW2F2FbgATwD/6vcOuiyrJUmh8klN5ZK3m+yyK3ZzsnaW2Bduoc0fw2Ckcm/riQ==" + "version": "4.1.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.13.tgz", + "integrity": "sha512-S8TLDjY+piV8nmzn4/acwKjDbUtOqfJ9Cb3gZ9egjU/Fm8DBaQ7ziR1S2wntxlGLud9cly+LoWnEoWJYDZFveQ==" }, "node_modules/@cspell/dict-sql": { "version": "2.1.8", @@ -378,14 +396,14 @@ "integrity": "sha512-CsFF0IFAbRtYNg0yZcdaYbADF5F3DsM8C4wHnZefQy8YcHP/qjAF/GdGfBFBLx+XSthYuBlo2b2XQVdz3cJZBw==" }, "node_modules/@cspell/dict-terraform": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.0.5.tgz", - "integrity": "sha512-qH3epPB2d6d5w1l4hR2OsnN8qDQ4P0z6oDB7+YiNH+BoECXv4Z38MIV1H8cxIzD2wkzkt2JTcFYaVW72MDZAlg==" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.0.6.tgz", + "integrity": "sha512-Sqm5vGbXuI9hCFcr4w6xWf4Y25J9SdleE/IqfM6RySPnk8lISEmVdax4k6+Kinv9qaxyvnIbUUN4WFLWcBPQAg==" }, "node_modules/@cspell/dict-typescript": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.10.tgz", - "integrity": "sha512-7Zek3w4Rh3ZYyhihJ34FdnUBwP3OmRldnEq3hZ+FgQ0PyYZjXv5ztEViRBBxXjiFx1nHozr6pLi74TxToD8xsg==" + "version": "3.1.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.11.tgz", + "integrity": "sha512-FwvK5sKbwrVpdw0e9+1lVTl8FPoHYvfHRuQRQz2Ql5XkC0gwPPkpoyD1zYImjIyZRoYXk3yp9j8ss4iz7A7zoQ==" }, "node_modules/@cspell/dict-vue": { "version": "3.0.3", @@ -393,9 +411,9 @@ "integrity": "sha512-akmYbrgAGumqk1xXALtDJcEcOMYBYMnkjpmGzH13Ozhq1mkPF4VgllFQlm1xYde+BUKNnzMgPEzxrL2qZllgYA==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.15.4.tgz", - "integrity": "sha512-tr0F6EYN6qtniNvt1Uib+PgYQHeo4dQHXE2Optap+hYTOoQ2VoQ+SwBVjZ+Q2bmSAB0fmOyf0AvgsUtnWIpavw==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.15.7.tgz", + "integrity": "sha512-qFlVisdP2lvFcS4Kre4Dl+f4Y7U9w/Y7IQAS+XXl5KlInImMaYhNUDEru8DoUPQHYsXKAPJsu/Y2JloHNE502Q==", "dependencies": { "import-meta-resolve": "^4.1.0" }, @@ -404,25 +422,25 @@ } }, "node_modules/@cspell/filetypes": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.15.4.tgz", - "integrity": "sha512-sNl6jr3ym/4151EY76qlI/00HHsiLZBqW7Vb1tqCzsgSg3EpL30ddjr74So6Sg2PN26Yf09hvxGTJzXn1R4aYw==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.15.7.tgz", + "integrity": "sha512-MeP6gh8Om9vHSxYoYey2BFCib4m+vEyMLQCSub1Gk+uXiJjj1l/S5MFWM9zHhjGBBNNdvuopuUKP6Gcgcw+3Cw==", "engines": { "node": ">=18" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.15.4.tgz", - "integrity": "sha512-m5DeQksbhJFqcSYF8Q0Af/WXmXCMAJocCUShkzOXK+uZNXnvhBZN7VyQ9hL+GRzX8JTPEPdVcz2lFyVE5p+LzQ==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.15.7.tgz", + "integrity": "sha512-SGlkhRnHXoBzLY2SxVppMsREhyaDHpyXQrPDUfsCnyG5DC8UVmXnTVQp9c2kqhAZw6g6g6V7uoqTLqJQmrWOFQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.15.4.tgz", - "integrity": "sha512-K2oZu/oLQPs5suRpLS8uu04O3YMUioSlEU1D66fRoOxzI5NzLt7i7yMg3HQHjChGa09N5bzqmrVdhmQrRZXwGg==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.15.7.tgz", + "integrity": "sha512-IzBsrl54TyO5Ezbyr25ZOUZA3Sg2UbSWDZZar9jSRAsoikcsoy1ivgSumcYJYOH8HAtanfr8YGN0+8UF/kbYqg==", "engines": { "node": ">=18.0" } @@ -522,28 +540,28 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cspell": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.15.4.tgz", - "integrity": "sha512-hUOxcwmNWuHzVeGHyN5v/T9MkyCE5gi0mvatxsM794B2wOuR1ZORgjZH62P2HY1uBkXe/x5C6ITWrSyh0WgAcg==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.15.7.tgz", + "integrity": "sha512-68Bs/brr31M0W6tljNCgHcz09xdfDnRobyyRQJ8z0ZrovfTHHj9gSQldJJt5Fq3AMlCeYbECnKPsY9DkzIP1sQ==", "dependencies": { - "@cspell/cspell-json-reporter": "8.15.4", - "@cspell/cspell-pipe": "8.15.4", - "@cspell/cspell-types": "8.15.4", - "@cspell/dynamic-import": "8.15.4", - "@cspell/url": "8.15.4", + "@cspell/cspell-json-reporter": "8.15.7", + "@cspell/cspell-pipe": "8.15.7", + "@cspell/cspell-types": "8.15.7", + "@cspell/dynamic-import": "8.15.7", + "@cspell/url": "8.15.7", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-dictionary": "8.15.4", - "cspell-gitignore": "8.15.4", - "cspell-glob": "8.15.4", - "cspell-io": "8.15.4", - "cspell-lib": "8.15.4", + "cspell-dictionary": "8.15.7", + "cspell-gitignore": "8.15.7", + "cspell-glob": "8.15.7", + "cspell-io": "8.15.7", + "cspell-lib": "8.15.7", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "get-stdin": "^9.0.0", "semver": "^7.6.3", - "tinyglobby": "^0.2.9" + "tinyglobby": "^0.2.10" }, "bin": { "cspell": "bin.mjs", @@ -557,11 +575,11 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.15.4.tgz", - "integrity": "sha512-vUgikQTRkRMTdkZqSs7F2cTdPpX61cTjr/9L/VCkXkbW38ObCr4650ioiF1Wq3zDF3Gy2bc4ECTpD2PZUXX5SA==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.15.7.tgz", + "integrity": "sha512-orxPKLMLQjk+Px1wlZdMElsHlKFGiwlXhQcG/36hODFKsle9DnGqVefOjH6aWFO5DyDF+Z678leiO2F30wtXEQ==", "dependencies": { - "@cspell/cspell-types": "8.15.4", + "@cspell/cspell-types": "8.15.7", "comment-json": "^4.2.5", "yaml": "^2.6.0" }, @@ -570,13 +588,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.15.4.tgz", - "integrity": "sha512-8+p/l9Saac7qyCbqtELneDoT7CwHu9gYmnI8uXMu34/lPGjhVhy10ZeI0+t1djaO2YyASK400YFKq5uP/5KulA==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.15.7.tgz", + "integrity": "sha512-jmOk9kJ/bsVFg0/ObnNMUHA3wPgHb4eGFx6yF+Lx28eYx9j2XkLZuXXicbNyOWqJ9AzP0CavPmHwAS6bJrxD3Q==", "dependencies": { - "@cspell/cspell-pipe": "8.15.4", - "@cspell/cspell-types": "8.15.4", - "cspell-trie-lib": "8.15.4", + "@cspell/cspell-pipe": "8.15.7", + "@cspell/cspell-types": "8.15.7", + "cspell-trie-lib": "8.15.7", "fast-equals": "^5.0.1" }, "engines": { @@ -584,13 +602,13 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.15.4.tgz", - "integrity": "sha512-9n5PpQ8gEf8YcvEtoZGZ2Ma6wnqSFkD2GrmyjISy39DfIX/jNLN7GX2wJm6OD2P4FjXer95ypmIb/JWTlfmbTw==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.15.7.tgz", + "integrity": "sha512-LxX/PS3z6UqXHUqw3wIB1OJwZrexxKn/EUertYcLce/K2M2wLsUA+uneU5EvUqzkM6vwMHvdv/hl/tROFQJIbw==", "dependencies": { - "@cspell/url": "8.15.4", - "cspell-glob": "8.15.4", - "cspell-io": "8.15.4", + "@cspell/url": "8.15.7", + "cspell-glob": "8.15.7", + "cspell-io": "8.15.7", "find-up-simple": "^1.0.0" }, "bin": { @@ -601,11 +619,11 @@ } }, "node_modules/cspell-glob": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.15.4.tgz", - "integrity": "sha512-TTfRRHRAN+PN9drIz4MAEgKKYnPThBOlPMdFddyuisvU33Do1sPAnqkkOjTEFdi3jAA5KwnSva68SVH6IzzMBQ==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.15.7.tgz", + "integrity": "sha512-BI0mF0IWqVxEGpRkH2kBgT9Ey7lAMlEhvY/zKCy3JQY5PSn/qI3RhlsXrsTDt2RJxhicuzJIe3KiNdUKXQM0Ig==", "dependencies": { - "@cspell/url": "8.15.4", + "@cspell/url": "8.15.7", "micromatch": "^4.0.8" }, "engines": { @@ -613,12 +631,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.15.4.tgz", - "integrity": "sha512-MKiKyYi05mRtXOxPoTv3Ksi0GwYLiK84Uq0C+5PaMrnIjXeed0bsddSFXCT+7ywFJc7PdjhTtz0M/9WWK3UgbA==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.15.7.tgz", + "integrity": "sha512-g7ocpFG9Gam4+b2bHrqhmXVaFNV4BjFjVnaEKS3RoqcMjJuQUa9wD5HWO6AvBJeJf/auvQS7CgmumQqSo9xxCw==", "dependencies": { - "@cspell/cspell-pipe": "8.15.4", - "@cspell/cspell-types": "8.15.4" + "@cspell/cspell-pipe": "8.15.7", + "@cspell/cspell-types": "8.15.7" }, "bin": { "cspell-grammar": "bin.mjs" @@ -628,38 +646,38 @@ } }, "node_modules/cspell-io": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.15.4.tgz", - "integrity": "sha512-rXIEREPTFV9dwwg4EKfvzqlCNOvT6910AYED5YrSt8Y68usRJ9lbqdx0BrDndVCd33bp1o+9JBfHuRiFIQC81g==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.15.7.tgz", + "integrity": "sha512-GEnMPu+xyyHTal2QdCbuRrPUEpjCYo0mF/Tz/YkcZNJdn0sj6MylH2EA0A+d6WzheRpw9ijd1dRvq3h5jJgmuQ==", "dependencies": { - "@cspell/cspell-service-bus": "8.15.4", - "@cspell/url": "8.15.4" + "@cspell/cspell-service-bus": "8.15.7", + "@cspell/url": "8.15.7" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.15.4.tgz", - "integrity": "sha512-iLp/625fvCyFFxSyZYLMgqHIKcrhN4hT7Hw5+ySa38Bp/OfA81ANqWHpsDQ0bGsALTRn/DHBpQYj4xCW/aN9tw==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.15.7.tgz", + "integrity": "sha512-RxxPEymTENc76f8ny1LN+aPyR4Efwyah8m5c20xOwxD/lAhBrNs2PPE1taEMPkI7WTXWjKm4D0DJpZatD+W6pg==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.15.4", - "@cspell/cspell-pipe": "8.15.4", - "@cspell/cspell-resolver": "8.15.4", - "@cspell/cspell-types": "8.15.4", - "@cspell/dynamic-import": "8.15.4", - "@cspell/filetypes": "8.15.4", - "@cspell/strong-weak-map": "8.15.4", - "@cspell/url": "8.15.4", + "@cspell/cspell-bundled-dicts": "8.15.7", + "@cspell/cspell-pipe": "8.15.7", + "@cspell/cspell-resolver": "8.15.7", + "@cspell/cspell-types": "8.15.7", + "@cspell/dynamic-import": "8.15.7", + "@cspell/filetypes": "8.15.7", + "@cspell/strong-weak-map": "8.15.7", + "@cspell/url": "8.15.7", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.15.4", - "cspell-dictionary": "8.15.4", - "cspell-glob": "8.15.4", - "cspell-grammar": "8.15.4", - "cspell-io": "8.15.4", - "cspell-trie-lib": "8.15.4", + "cspell-config-lib": "8.15.7", + "cspell-dictionary": "8.15.7", + "cspell-glob": "8.15.7", + "cspell-grammar": "8.15.7", + "cspell-io": "8.15.7", + "cspell-trie-lib": "8.15.7", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -674,12 +692,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.15.4", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.15.4.tgz", - "integrity": "sha512-sg9klsNHyrfos0Boiio+qy5d6fI9cCNjBqFYrNxvpKpwZ4gEzDzjgEKdZY1C76RD2KoBQ8I1NF5YcGc0+hhhCw==", + "version": "8.15.7", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.15.7.tgz", + "integrity": "sha512-b8WWWOx5wfhT72K43fk3dMoE4H2c1UpbCEVB2JXJ5scub7mjqoT/CRiZlw1IDfQT6BmUtJuD7sZ8NRFanF9hQA==", "dependencies": { - "@cspell/cspell-pipe": "8.15.4", - "@cspell/cspell-types": "8.15.4", + "@cspell/cspell-pipe": "8.15.7", + "@cspell/cspell-types": "8.15.7", "gensequence": "^7.0.0" }, "engines": { @@ -949,11 +967,11 @@ } }, "node_modules/tinyglobby": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.9.tgz", - "integrity": "sha512-8or1+BGEdk1Zkkw2ii16qSS7uVrQJPre5A9o/XkWPATkk23FZh/15BKFxPnlTy6vkljZxLqYCzzBMj30ZrSvjw==", + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.10.tgz", + "integrity": "sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==", "dependencies": { - "fdir": "^6.4.0", + "fdir": "^6.4.2", "picomatch": "^4.0.2" }, "engines": { @@ -961,9 +979,9 @@ } }, "node_modules/tinyglobby/node_modules/fdir": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.0.tgz", - "integrity": "sha512-3oB133prH1o4j/L5lLW7uOCF1PlD+/It2L0eL/iAqWMB91RBbqTewABqxhj0ibBd90EEmWZq7ntIWzVaWcXTGQ==", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz", + "integrity": "sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==", "peerDependencies": { "picomatch": "^3 || ^4" }, diff --git a/package.json b/package.json index 9a329ea4a1..4033b34c85 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.15.4" + "cspell": "^8.15.7" } } From 1933902804b6a7e971945e859b321d23a175de73 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:43:37 +0000 Subject: [PATCH 440/845] Bump cspell from 8.15.7 to 8.16.0 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.15.7 to 8.16.0. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.16.0/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 226 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 114 insertions(+), 114 deletions(-) diff --git a/package-lock.json b/package-lock.json index 20d5f63919..d16bddd998 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,20 +7,20 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.15.7" + "cspell": "^8.16.0" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.15.7.tgz", - "integrity": "sha512-lNbrlHhDnOWCJh/vNCliZJz4X1KMEZqWJZpTgmdPrEGS9ZyfEiCmZyoQzw+fauC5Xo7dwd2KdS9VMHftAJqMPQ==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.16.0.tgz", + "integrity": "sha512-R0Eqq5kTZnmZ0elih5uY3TWjMqqAeMl7ciU7maUs+m1FNjCEdJXtJ9wrQxNgjmXi0tX8cvahZRO3O558tEz/KA==", "dependencies": { "@cspell/dict-ada": "^4.0.5", "@cspell/dict-al": "^1.0.3", "@cspell/dict-aws": "^4.0.7", "@cspell/dict-bash": "^4.1.8", "@cspell/dict-companies": "^3.1.7", - "@cspell/dict-cpp": "^6.0.0", + "@cspell/dict-cpp": "^6.0.1", "@cspell/dict-cryptocurrencies": "^5.0.3", "@cspell/dict-csharp": "^4.0.5", "@cspell/dict-css": "^4.0.16", @@ -53,8 +53,8 @@ "@cspell/dict-makefile": "^1.0.3", "@cspell/dict-markdown": "^2.0.7", "@cspell/dict-monkeyc": "^1.0.9", - "@cspell/dict-node": "^5.0.4", - "@cspell/dict-npm": "^5.1.9", + "@cspell/dict-node": "^5.0.5", + "@cspell/dict-npm": "^5.1.11", "@cspell/dict-php": "^4.0.13", "@cspell/dict-powershell": "^5.0.13", "@cspell/dict-public-licenses": "^2.0.11", @@ -63,7 +63,7 @@ "@cspell/dict-ruby": "^5.0.7", "@cspell/dict-rust": "^4.0.9", "@cspell/dict-scala": "^5.0.6", - "@cspell/dict-software-terms": "^4.1.12", + "@cspell/dict-software-terms": "^4.1.13", "@cspell/dict-sql": "^2.1.8", "@cspell/dict-svelte": "^1.0.5", "@cspell/dict-swift": "^2.0.4", @@ -76,28 +76,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.15.7.tgz", - "integrity": "sha512-kOcJaThztX1A8jkALBiAyp8dWrHPMuDOXki8Q5ZG1dL25wKsAnPyqflXhXg6Up4VGVIkkgy1S3T0Q/i+G5f12w==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.16.0.tgz", + "integrity": "sha512-KLjPK94gA3JNuWy70LeenJ6EL3SFk2ejERKYJ6SVV/cVOKIvVd2qe42yX3/A/DkF2xzuZ2LD4z0sfoqQL1BaqA==", "dependencies": { - "@cspell/cspell-types": "8.15.7" + "@cspell/cspell-types": "8.16.0" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.15.7.tgz", - "integrity": "sha512-EyVSJPqJFrDA9Sj4Nzx13vytloMS0V3HaevhqMFLHJ53QNz/ZP7vuECbXApRAJwLonuToJBvY3b9xzB6eEhU/A==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.16.0.tgz", + "integrity": "sha512-WoCgrv/mrtwCY4lhc6vEcqN3AQ7lT6K0NW5ShoSo116U2tRaW0unApIYH4Va8u7T9g3wyspFEceQRR1xD9qb9w==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.15.7.tgz", - "integrity": "sha512-9RPZ5VwjYPYLTLWkoPGHqV3Kuai5QwTWgZJW3Yk2GgJkxss/LDsXME+9CalPcPBQpnCIBEOtE2DjDQbFjAiMnA==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.16.0.tgz", + "integrity": "sha512-b+99bph43ptkXlQHgPXSkN/jK6LQHy2zL1Fm9up7+x6Yr64bxAzWzoeqJAPtnrPvFuOrFN0jZasZzKBw8CvrrQ==", "dependencies": { "global-directory": "^4.0.1" }, @@ -106,17 +106,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.15.7.tgz", - "integrity": "sha512-kL+1+K4VApdwZccGlg7Vjmh4CzzjoT+G556/gErdESQFPY0y9/4OPPVKLrFkbEDODtp9Py7aTRHdhl6w1xxCCw==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.16.0.tgz", + "integrity": "sha512-+fn763JKA4EYCOv+1VShFq015UMEBAFRDr+rlCnesgLE0fv9TSFVLsjOfh9/g6GuGQLCRLUqKztwwuueeErstQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.15.7.tgz", - "integrity": "sha512-QMbGJsUXTdV8/V9Gsc/kBgdkBwm4hvcChhQf6KE9yeg3CZlbd95NkFJuSiqp1phJOWMTzHCZ0Ro7v7P/LGKdVA==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.16.0.tgz", + "integrity": "sha512-bGrIK7p4NVsK+QX/CYWmjax+FkzfSIZaIaoiBESGV5gmwgXDVRMJ3IP6tQVAmTtckOYHCmtT5CZgI8zXWr8dHQ==", "engines": { "node": ">=18" } @@ -147,9 +147,9 @@ "integrity": "sha512-ncVs/efuAkP1/tLDhWbXukBjgZ5xOUfe03neHMWsE8zvXXc5+Lw6TX5jaJXZLOoES/f4j4AhRE20jsPCF5pm+A==" }, "node_modules/@cspell/dict-cpp": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.1.tgz", - "integrity": "sha512-AxMC1KVu/9JSme1eG1SPQQTSLQbGUpoICMdKjQEEaB4RyrEev2V6fcVnqH38lzs+zN5Dffh04B2bTW0pT4lr9g==" + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.2.tgz", + "integrity": "sha512-yw5eejWvY4bAnc6LUA44m4WsFwlmgPt2uMSnO7QViGMBDuoeopMma4z9XYvs4lSjTi8fIJs/A1YDfM9AVzb8eg==" }, "node_modules/@cspell/dict-cryptocurrencies": { "version": "5.0.3", @@ -197,9 +197,9 @@ "integrity": "sha512-TfqSTxMHZ2jhiqnXlVKM0bUADtCvwKQv2XZL/DI0rx3doG8mEMS8SGPOmiyyGkHpR/pGOq18AFH3BEm4lViHIw==" }, "node_modules/@cspell/dict-en_us": { - "version": "4.3.26", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.26.tgz", - "integrity": "sha512-hDbHYJsi3UgU1J++B0WLiYhWQdsmve3CH53FIaMRAdhrWOHcuw7h1dYkQXHFEP5lOjaq53KUHp/oh5su6VkIZg==" + "version": "4.3.27", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.27.tgz", + "integrity": "sha512-7JYHahRWpi0VykWFTSM03KL/0fs6YtYfpOaTAg4N/d0wB2GfwVG/FJ/SBCjD4LBc6Rx9dzdo95Hs4BB8GPQbOA==" }, "node_modules/@cspell/dict-en-common-misspellings": { "version": "2.0.7", @@ -328,9 +328,9 @@ "integrity": "sha512-7NbCS2E8ZZRZwlLrh2sA0vAk9n1kcTUiRp/Nia8YvKaItGXLfxYqD2rMQ3HpB1kEutal6hQLVic3N2Yi1X7AaA==" }, "node_modules/@cspell/dict-npm": { - "version": "5.1.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.10.tgz", - "integrity": "sha512-YmOLvM3ERk/yrdk0s0HhMI7Ws4epLRycGQH5uWyvWg5F64C31mbV557+jfxjrn6Ewq3UdT4ILCS9EyCHVyirig==" + "version": "5.1.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.11.tgz", + "integrity": "sha512-5ricJyVMw5TmqR0NfsZS8jEJu1+DLzyUXyjpVFnffPuEtz9jF2XswLK0swZqc9uwWrz0M7IhGVCnmq90srVZCA==" }, "node_modules/@cspell/dict-php": { "version": "4.0.13", @@ -376,9 +376,9 @@ "integrity": "sha512-tl0YWAfjUVb4LyyE4JIMVE8DlLzb1ecHRmIWc4eT6nkyDqQgHKzdHsnusxFEFMVLIQomgSg0Zz6hJ5S1E4W4ww==" }, "node_modules/@cspell/dict-software-terms": { - "version": "4.1.13", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.13.tgz", - "integrity": "sha512-S8TLDjY+piV8nmzn4/acwKjDbUtOqfJ9Cb3gZ9egjU/Fm8DBaQ7ziR1S2wntxlGLud9cly+LoWnEoWJYDZFveQ==" + "version": "4.1.14", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.14.tgz", + "integrity": "sha512-p3oZQSQTgdu3UjZ5aaEeU5aKRD00j/oZzt51ohbhhJ94UYECi8te8SfcA45UbGkylSSGcAtJWkuwjCLMiKAgyQ==" }, "node_modules/@cspell/dict-sql": { "version": "2.1.8", @@ -411,9 +411,9 @@ "integrity": "sha512-akmYbrgAGumqk1xXALtDJcEcOMYBYMnkjpmGzH13Ozhq1mkPF4VgllFQlm1xYde+BUKNnzMgPEzxrL2qZllgYA==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.15.7.tgz", - "integrity": "sha512-qFlVisdP2lvFcS4Kre4Dl+f4Y7U9w/Y7IQAS+XXl5KlInImMaYhNUDEru8DoUPQHYsXKAPJsu/Y2JloHNE502Q==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.16.0.tgz", + "integrity": "sha512-FH+B5y71qfunagXiLSJhXP9h/Vwb1Z8Cc/hLmliGekw/Y8BuYknL86tMg9grXBYNmM0kifIv6ZesQl8Km/p/rA==", "dependencies": { "import-meta-resolve": "^4.1.0" }, @@ -422,25 +422,25 @@ } }, "node_modules/@cspell/filetypes": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.15.7.tgz", - "integrity": "sha512-MeP6gh8Om9vHSxYoYey2BFCib4m+vEyMLQCSub1Gk+uXiJjj1l/S5MFWM9zHhjGBBNNdvuopuUKP6Gcgcw+3Cw==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.16.0.tgz", + "integrity": "sha512-u2Ub0uSwXFPJFvXhAO/0FZBj3sMr4CeYCiQwTUsdFRkRMFpbTc7Vf+a+aC2vIj6WcaWrYXrJy3NZF/yjqF6SGw==", "engines": { "node": ">=18" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.15.7.tgz", - "integrity": "sha512-SGlkhRnHXoBzLY2SxVppMsREhyaDHpyXQrPDUfsCnyG5DC8UVmXnTVQp9c2kqhAZw6g6g6V7uoqTLqJQmrWOFQ==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.16.0.tgz", + "integrity": "sha512-R6N12wEIQpBk2uyni/FU1SFSIjP0uql7ynXVcF1ob8/JJeRoikssydi9Xq5J6ghMw+X50u35mFvg9BgWKz0d+g==", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.15.7.tgz", - "integrity": "sha512-IzBsrl54TyO5Ezbyr25ZOUZA3Sg2UbSWDZZar9jSRAsoikcsoy1ivgSumcYJYOH8HAtanfr8YGN0+8UF/kbYqg==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.16.0.tgz", + "integrity": "sha512-zW+6hAieD/FjysfjY4mVv7iHWWasBP3ldj6L+xy2p4Kuax1nug7uuJqMHlAVude/OywNwENG0rYaP/P9Pg4O+w==", "engines": { "node": ">=18.0" } @@ -540,23 +540,23 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cspell": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.15.7.tgz", - "integrity": "sha512-68Bs/brr31M0W6tljNCgHcz09xdfDnRobyyRQJ8z0ZrovfTHHj9gSQldJJt5Fq3AMlCeYbECnKPsY9DkzIP1sQ==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.16.0.tgz", + "integrity": "sha512-U6Up/4nODE+Ca+zqwZXTgBioGuF2JQHLEUIuoRJkJzAZkIBYDqrMXM+zdSL9E39+xb9jAtr9kPAYJf1Eybgi9g==", "dependencies": { - "@cspell/cspell-json-reporter": "8.15.7", - "@cspell/cspell-pipe": "8.15.7", - "@cspell/cspell-types": "8.15.7", - "@cspell/dynamic-import": "8.15.7", - "@cspell/url": "8.15.7", + "@cspell/cspell-json-reporter": "8.16.0", + "@cspell/cspell-pipe": "8.16.0", + "@cspell/cspell-types": "8.16.0", + "@cspell/dynamic-import": "8.16.0", + "@cspell/url": "8.16.0", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-dictionary": "8.15.7", - "cspell-gitignore": "8.15.7", - "cspell-glob": "8.15.7", - "cspell-io": "8.15.7", - "cspell-lib": "8.15.7", + "cspell-dictionary": "8.16.0", + "cspell-gitignore": "8.16.0", + "cspell-glob": "8.16.0", + "cspell-io": "8.16.0", + "cspell-lib": "8.16.0", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "get-stdin": "^9.0.0", @@ -575,11 +575,11 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.15.7.tgz", - "integrity": "sha512-orxPKLMLQjk+Px1wlZdMElsHlKFGiwlXhQcG/36hODFKsle9DnGqVefOjH6aWFO5DyDF+Z678leiO2F30wtXEQ==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.16.0.tgz", + "integrity": "sha512-PGT6ohLtIYXYLIm+R5hTcTrF0dzj8e7WAUJSJe5WlV/7lrwVdwgWaliLcXtSSPmfxgczr6sndX9TMJ2IEmPrmg==", "dependencies": { - "@cspell/cspell-types": "8.15.7", + "@cspell/cspell-types": "8.16.0", "comment-json": "^4.2.5", "yaml": "^2.6.0" }, @@ -588,13 +588,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.15.7.tgz", - "integrity": "sha512-jmOk9kJ/bsVFg0/ObnNMUHA3wPgHb4eGFx6yF+Lx28eYx9j2XkLZuXXicbNyOWqJ9AzP0CavPmHwAS6bJrxD3Q==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.16.0.tgz", + "integrity": "sha512-Y3sN6ttLBKbu0dOLcduY641n5QP1srUvZkW4bOTnG455DbIZfilrP1El/2Hl0RS6hC8LN9PM4bsIm/2xgdbApA==", "dependencies": { - "@cspell/cspell-pipe": "8.15.7", - "@cspell/cspell-types": "8.15.7", - "cspell-trie-lib": "8.15.7", + "@cspell/cspell-pipe": "8.16.0", + "@cspell/cspell-types": "8.16.0", + "cspell-trie-lib": "8.16.0", "fast-equals": "^5.0.1" }, "engines": { @@ -602,13 +602,13 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.15.7.tgz", - "integrity": "sha512-LxX/PS3z6UqXHUqw3wIB1OJwZrexxKn/EUertYcLce/K2M2wLsUA+uneU5EvUqzkM6vwMHvdv/hl/tROFQJIbw==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.16.0.tgz", + "integrity": "sha512-ODKe0ooyzYSBJkwgIVZSRIvzoZfT4tEbFt4fFDT88wPyyfX7xp7MAQhXy5KD1ocXH0WvYbdv37qzn2UbckrahA==", "dependencies": { - "@cspell/url": "8.15.7", - "cspell-glob": "8.15.7", - "cspell-io": "8.15.7", + "@cspell/url": "8.16.0", + "cspell-glob": "8.16.0", + "cspell-io": "8.16.0", "find-up-simple": "^1.0.0" }, "bin": { @@ -619,11 +619,11 @@ } }, "node_modules/cspell-glob": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.15.7.tgz", - "integrity": "sha512-BI0mF0IWqVxEGpRkH2kBgT9Ey7lAMlEhvY/zKCy3JQY5PSn/qI3RhlsXrsTDt2RJxhicuzJIe3KiNdUKXQM0Ig==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.16.0.tgz", + "integrity": "sha512-xJSXRHwfENCNFmjpVSEucXY8E3BrpSCA+TukmOYtLyaMKtn6EAwoCpEU7Oj2tZOjdivprPmQ74k4Dqb1RHjIVQ==", "dependencies": { - "@cspell/url": "8.15.7", + "@cspell/url": "8.16.0", "micromatch": "^4.0.8" }, "engines": { @@ -631,12 +631,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.15.7.tgz", - "integrity": "sha512-g7ocpFG9Gam4+b2bHrqhmXVaFNV4BjFjVnaEKS3RoqcMjJuQUa9wD5HWO6AvBJeJf/auvQS7CgmumQqSo9xxCw==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.16.0.tgz", + "integrity": "sha512-vvbJEkBqXocGH/H975RtkfMzVpNxNGMd0JCDd+NjbpeRyZceuChFw5Tie7kHteFY29SwZovub+Am3F4H1kmf9A==", "dependencies": { - "@cspell/cspell-pipe": "8.15.7", - "@cspell/cspell-types": "8.15.7" + "@cspell/cspell-pipe": "8.16.0", + "@cspell/cspell-types": "8.16.0" }, "bin": { "cspell-grammar": "bin.mjs" @@ -646,38 +646,38 @@ } }, "node_modules/cspell-io": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.15.7.tgz", - "integrity": "sha512-GEnMPu+xyyHTal2QdCbuRrPUEpjCYo0mF/Tz/YkcZNJdn0sj6MylH2EA0A+d6WzheRpw9ijd1dRvq3h5jJgmuQ==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.16.0.tgz", + "integrity": "sha512-WIK5uhPMjGsTAzm2/fGRbIdr7zWsMVG1fn8wNJYUiYELuyvzvLelfI1VG6szaFCGYqd6Uvgb/fS0uNbwGqCLAQ==", "dependencies": { - "@cspell/cspell-service-bus": "8.15.7", - "@cspell/url": "8.15.7" + "@cspell/cspell-service-bus": "8.16.0", + "@cspell/url": "8.16.0" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.15.7.tgz", - "integrity": "sha512-RxxPEymTENc76f8ny1LN+aPyR4Efwyah8m5c20xOwxD/lAhBrNs2PPE1taEMPkI7WTXWjKm4D0DJpZatD+W6pg==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.16.0.tgz", + "integrity": "sha512-fU8CfECyuhT12COIi4ViQu2bTkdqaa+05YSd2ZV8k8NA7lapPaMFnlooxdfcwwgZJfHeMhRVMzvQF1OhWmwGfA==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.15.7", - "@cspell/cspell-pipe": "8.15.7", - "@cspell/cspell-resolver": "8.15.7", - "@cspell/cspell-types": "8.15.7", - "@cspell/dynamic-import": "8.15.7", - "@cspell/filetypes": "8.15.7", - "@cspell/strong-weak-map": "8.15.7", - "@cspell/url": "8.15.7", + "@cspell/cspell-bundled-dicts": "8.16.0", + "@cspell/cspell-pipe": "8.16.0", + "@cspell/cspell-resolver": "8.16.0", + "@cspell/cspell-types": "8.16.0", + "@cspell/dynamic-import": "8.16.0", + "@cspell/filetypes": "8.16.0", + "@cspell/strong-weak-map": "8.16.0", + "@cspell/url": "8.16.0", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.15.7", - "cspell-dictionary": "8.15.7", - "cspell-glob": "8.15.7", - "cspell-grammar": "8.15.7", - "cspell-io": "8.15.7", - "cspell-trie-lib": "8.15.7", + "cspell-config-lib": "8.16.0", + "cspell-dictionary": "8.16.0", + "cspell-glob": "8.16.0", + "cspell-grammar": "8.16.0", + "cspell-io": "8.16.0", + "cspell-trie-lib": "8.16.0", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -692,12 +692,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.15.7", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.15.7.tgz", - "integrity": "sha512-b8WWWOx5wfhT72K43fk3dMoE4H2c1UpbCEVB2JXJ5scub7mjqoT/CRiZlw1IDfQT6BmUtJuD7sZ8NRFanF9hQA==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.16.0.tgz", + "integrity": "sha512-Io1qqI0r4U9ewAWBLClFBBlxLeAoIi15PUGJi4Za1xrlgQJwRE8PMNIJNHKmPEIp78Iute3o/JyC2OfWlxl4Sw==", "dependencies": { - "@cspell/cspell-pipe": "8.15.7", - "@cspell/cspell-types": "8.15.7", + "@cspell/cspell-pipe": "8.16.0", + "@cspell/cspell-types": "8.16.0", "gensequence": "^7.0.0" }, "engines": { diff --git a/package.json b/package.json index 4033b34c85..c7617e1503 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.15.7" + "cspell": "^8.16.0" } } From 7020613791cc1511bcecb41fbf943770678e3195 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:21:24 +0000 Subject: [PATCH 441/845] Bump Microsoft.Testing.Extensions.CodeCoverage from 17.12.4 to 17.12.6 Bumps [Microsoft.Testing.Extensions.CodeCoverage](https://github.com/microsoft/codecoverage) from 17.12.4 to 17.12.6. - [Commits](https://github.com/microsoft/codecoverage/commits) --- updated-dependencies: - dependency-name: Microsoft.Testing.Extensions.CodeCoverage dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 937f9e7acc..848aaf102c 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -13,7 +13,7 @@ - + From 81df233e8c2c9b2e82e64260b045fbdac466618d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:20:53 +0000 Subject: [PATCH 442/845] Bump the nuke group with 2 updates Bumps the nuke group with 2 updates: [Nuke.Common](https://github.com/nuke-build/nuke) and [Nuke.Components](https://github.com/nuke-build/nuke). Updates `Nuke.Common` from 8.1.2 to 8.1.4 - [Release notes](https://github.com/nuke-build/nuke/releases) - [Changelog](https://github.com/nuke-build/nuke/blob/develop/CHANGELOG.md) - [Commits](https://github.com/nuke-build/nuke/compare/8.1.2...8.1.4) Updates `Nuke.Components` from 8.1.2 to 8.1.4 - [Release notes](https://github.com/nuke-build/nuke/releases) - [Changelog](https://github.com/nuke-build/nuke/blob/develop/CHANGELOG.md) - [Commits](https://github.com/nuke-build/nuke/compare/8.1.2...8.1.4) --- updated-dependencies: - dependency-name: Nuke.Common dependency-type: direct:production update-type: version-update:semver-patch dependency-group: nuke - dependency-name: Nuke.Components dependency-type: direct:production update-type: version-update:semver-patch dependency-group: nuke ... Signed-off-by: dependabot[bot] --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 65d6f2de45..8bbc918159 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -6,7 +6,7 @@ CS0649;CS0169 ..\ ..\ - 8.1.2 + 8.1.4 OS_WINDOWS From 74a9f4ab5eb14d077e3dad763b2e258ab0f178be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:20:13 +0000 Subject: [PATCH 443/845] Bump the mstest group with 2 updates Bumps the mstest group with 2 updates: [MSTest.TestAdapter](https://github.com/microsoft/testfx) and [MSTest.TestFramework](https://github.com/microsoft/testfx). Updates `MSTest.TestAdapter` from 3.3.1 to 3.6.2 - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](https://github.com/microsoft/testfx/compare/v3.3.1...v3.6.2) Updates `MSTest.TestFramework` from 3.3.1 to 3.6.2 - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](https://github.com/microsoft/testfx/compare/v3.3.1...v3.6.2) --- updated-dependencies: - dependency-name: MSTest.TestAdapter dependency-type: direct:production update-type: version-update:semver-minor dependency-group: mstest - dependency-name: MSTest.TestFramework dependency-type: direct:production update-type: version-update:semver-minor dependency-group: mstest ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 035b4f93fd..178a9ef538 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + \ No newline at end of file From e125412298811fde7ad0b96126b395bbdfd4cc1e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:19:13 +0000 Subject: [PATCH 444/845] Bump Verify.Xunit from 28.1.3 to 28.2.0 in the xunit group Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify). Updates `Verify.Xunit` from 28.1.3 to 28.2.0 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/28.1.3...28.2.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 025ad5845e..dfdd21f2f8 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From f8700b2a78ead6fb1ee2a9ccf9c1017122d1b670 Mon Sep 17 00:00:00 2001 From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> Date: Mon, 11 Nov 2024 18:35:32 +0100 Subject: [PATCH 445/845] Allow anonymous object for selecting fields/properties at `Exclude` and `Include` (#2488) --- .../Common/ExpressionExtensions.cs | 62 ++- .../Equivalency/EquivalencyOptions.cs | 19 +- .../NestedExclusionOptionBuilder.cs | 10 +- .../ExcludeMemberByPathSelectionRule.cs | 2 + .../SelfReferenceEquivalencyOptions.cs | 2 +- .../SelectionRulesSpecs.Excluding.cs | 411 ++++++++++++++++++ .../SelectionRulesSpecs.Including.cs | 98 +++++ docs/_pages/objectgraphs.md | 18 + docs/_pages/releases.md | 1 + 9 files changed, 602 insertions(+), 21 deletions(-) diff --git a/Src/FluentAssertions/Common/ExpressionExtensions.cs b/Src/FluentAssertions/Common/ExpressionExtensions.cs index 0a4ac3105b..449a2cf358 100644 --- a/Src/FluentAssertions/Common/ExpressionExtensions.cs +++ b/Src/FluentAssertions/Common/ExpressionExtensions.cs @@ -31,21 +31,22 @@ private static MemberInfo AttemptToGetMemberInfoFromExpression(Expres (((expression.Body as UnaryExpression)?.Operand ?? expression.Body) as MemberExpression)?.Member; /// - /// Gets a dotted path of property names representing the property expression, including the declaring type. + /// Gets one or more dotted paths of property names representing the property expression, including the declaring type. /// /// - /// E.g. Parent.Child.Sibling.Name. + /// E.g. ["Parent.Child.Sibling.Name"] or ["A.Dotted.Path1", "A.Dotted.Path2"]. /// /// is . #pragma warning disable MA0051 - public static MemberPath GetMemberPath( + public static IEnumerable GetMemberPaths( this Expression> expression) #pragma warning restore MA0051 { Guard.ThrowIfArgumentIsNull(expression, nameof(expression), "Expected an expression, but found ."); - var segments = new List(); - var declaringTypes = new List(); + string singlePath = null; + List selectors = []; + List declaringTypes = []; Expression node = expression; while (node is not null) @@ -68,7 +69,7 @@ public static MemberPath GetMemberPath( var memberExpression = (MemberExpression)node; node = memberExpression.Expression; - segments.Add(memberExpression.Member.Name); + singlePath = $"{memberExpression.Member.Name}.{singlePath}"; declaringTypes.Add(memberExpression.Member.DeclaringType); break; @@ -77,7 +78,7 @@ public static MemberPath GetMemberPath( var indexExpression = (ConstantExpression)binaryExpression.Right; node = binaryExpression.Left; - segments.Add($"[{indexExpression.Value}]"); + singlePath = $"[{indexExpression.Value}].{singlePath}"; break; case ExpressionType.Parameter: @@ -87,13 +88,26 @@ public static MemberPath GetMemberPath( case ExpressionType.Call: var methodCallExpression = (MethodCallExpression)node; - if (methodCallExpression is not { Method.Name: "get_Item", Arguments: [ConstantExpression argumentExpression] }) + if (methodCallExpression is not + { Method.Name: "get_Item", Arguments: [ConstantExpression argumentExpression] }) { throw new ArgumentException(GetUnsupportedExpressionMessage(expression.Body), nameof(expression)); } node = methodCallExpression.Object; - segments.Add($"[{argumentExpression.Value}]"); + singlePath = $"[{argumentExpression.Value}].{singlePath}"; + break; + case ExpressionType.New: + var newExpression = (NewExpression)node; + + foreach (Expression member in newExpression.Arguments) + { + var expr = member.ToString(); + selectors.Add(expr[expr.IndexOf('.', StringComparison.Ordinal)..]); + declaringTypes.Add(((MemberExpression)member).Member.DeclaringType); + } + + node = null; break; default: @@ -101,15 +115,37 @@ public static MemberPath GetMemberPath( } } - // If any members were accessed in the expression, the first one found is the last member. Type declaringType = declaringTypes.FirstOrDefault() ?? typeof(TDeclaringType); - IEnumerable reversedSegments = segments.AsEnumerable().Reverse(); - string segmentPath = string.Join(".", reversedSegments); + if (singlePath is null) + { +#if NET47 || NETSTANDARD2_0 + return selectors.Select(selector => + GetNewInstance(declaringType, selector)).ToList(); +#else + return selectors.ConvertAll(selector => + GetNewInstance(declaringType, selector)); +#endif + } - return new MemberPath(typeof(TDeclaringType), declaringType, segmentPath.Replace(".[", "[", StringComparison.Ordinal)); + return [GetNewInstance(declaringType, singlePath)]; } + private static MemberPath GetNewInstance(Type declaringType, string dottedPath) => + new(typeof(TReflectedType), declaringType, dottedPath.Trim('.').Replace(".[", "[", StringComparison.Ordinal)); + + /// + /// Gets the first dotted path of property names collected by + /// from a given property expression, including the declaring type. + /// + /// + /// E.g. Parent.Child.Sibling.Name. + /// + /// is . + public static MemberPath GetMemberPath( + this Expression> expression) => + expression.GetMemberPaths().First(); + /// /// Validates that the expression can be used to construct a . /// diff --git a/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs index 1c11e6e79f..1a13929982 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs @@ -29,7 +29,11 @@ public EquivalencyOptions(IEquivalencyOptions defaults) /// public EquivalencyOptions Excluding(Expression> expression) { - AddSelectionRule(new ExcludeMemberByPathSelectionRule(expression.GetMemberPath())); + foreach (var memberPath in expression.GetMemberPaths()) + { + AddSelectionRule(new ExcludeMemberByPathSelectionRule(memberPath)); + } + return this; } @@ -40,9 +44,8 @@ public EquivalencyOptions Excluding(Expression For( Expression>> expression) { - var selectionRule = new ExcludeMemberByPathSelectionRule(expression.GetMemberPath()); - AddSelectionRule(selectionRule); - return new NestedExclusionOptionBuilder(this, selectionRule); + return new NestedExclusionOptionBuilder( + this, new ExcludeMemberByPathSelectionRule(expression.GetMemberPath())); } /// @@ -53,7 +56,11 @@ public NestedExclusionOptionBuilder For( /// public EquivalencyOptions Including(Expression> expression) { - AddSelectionRule(new IncludeMemberByPathSelectionRule(expression.GetMemberPath())); + foreach (var memberPath in expression.GetMemberPaths()) + { + AddSelectionRule(new IncludeMemberByPathSelectionRule(memberPath)); + } + return this; } @@ -77,10 +84,12 @@ public EquivalencyOptions WithoutStrictOrderingFor( Expression> expression) { string expressionMemberPath = expression.GetMemberPath().ToString(); + OrderingRules.Add(new PathBasedOrderingRule(expressionMemberPath) { Invert = true }); + return this; } diff --git a/Src/FluentAssertions/Equivalency/NestedExclusionOptionBuilder.cs b/Src/FluentAssertions/Equivalency/NestedExclusionOptionBuilder.cs index f2716a0c7c..1708c3e7a7 100644 --- a/Src/FluentAssertions/Equivalency/NestedExclusionOptionBuilder.cs +++ b/Src/FluentAssertions/Equivalency/NestedExclusionOptionBuilder.cs @@ -27,8 +27,14 @@ internal NestedExclusionOptionBuilder(EquivalencyOptions capturedO /// public EquivalencyOptions Exclude(Expression> expression) { - var nextPath = expression.GetMemberPath(); - currentPathSelectionRule.AppendPath(nextPath); + var currentSelectionPath = currentPathSelectionRule.CurrentPath; + + foreach (var path in expression.GetMemberPaths()) + { + var newPath = currentSelectionPath.AsParentCollectionOf(path); + capturedOptions.AddSelectionRule(new ExcludeMemberByPathSelectionRule(newPath)); + } + return capturedOptions; } diff --git a/Src/FluentAssertions/Equivalency/Selection/ExcludeMemberByPathSelectionRule.cs b/Src/FluentAssertions/Equivalency/Selection/ExcludeMemberByPathSelectionRule.cs index 4430f4eeec..6f7a19dfb4 100644 --- a/Src/FluentAssertions/Equivalency/Selection/ExcludeMemberByPathSelectionRule.cs +++ b/Src/FluentAssertions/Equivalency/Selection/ExcludeMemberByPathSelectionRule.cs @@ -27,6 +27,8 @@ public void AppendPath(MemberPath nextPath) memberToExclude = memberToExclude.AsParentCollectionOf(nextPath); } + public MemberPath CurrentPath => memberToExclude; + public override string ToString() { return "Exclude member " + memberToExclude; diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index f006bd7364..ef9a6dd699 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -879,7 +879,7 @@ private void RemoveSelectionRule() selectionRules.RemoveAll(selectionRule => selectionRule is T); } - protected TSelf AddSelectionRule(IMemberSelectionRule selectionRule) + protected internal TSelf AddSelectionRule(IMemberSelectionRule selectionRule) { selectionRules.Add(selectionRule); return (TSelf)this; diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs index 050416dcda..206dbf1e78 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs @@ -745,5 +745,416 @@ private interface IHaveDefaultProperty int DefaultProperty => NormalProperty.Length; } #endif + + [Fact] + public void An_anonymous_object_with_multiple_fields_excludes_correctly() + { + // Arrange + var subject = new + { + FirstName = "John", + MiddleName = "X", + LastName = "Doe", + Age = 34 + }; + + var expectation = new + { + FirstName = "John", + MiddleName = "W.", + LastName = "Smith", + Age = 29 + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, opts => opts + .Excluding(p => new { p.MiddleName, p.LastName, p.Age })); + } + + [Fact] + public void An_empty_anonymous_object_excludes_nothing() + { + // Arrange + var subject = new + { + FirstName = "John", + MiddleName = "X", + LastName = "Doe", + Age = 34 + }; + + var expectation = new + { + FirstName = "John", + MiddleName = "W.", + LastName = "Smith", + Age = 29 + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, opts => opts + .Excluding(p => new { })); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void An_anonymous_object_can_exclude_collections() + { + // Arrange + var subject = new + { + Names = new[] + { + "John", + "X.", + "Doe" + }, + Age = 34 + }; + + var expectation = new + { + Names = new[] + { + "John", + "W.", + "Smith" + }, + Age = 34 + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, opts => opts + .Excluding(p => new { p.Names })); + } + + [Fact] + public void An_anonymous_object_can_exclude_nested_objects() + { + // Arrange + var subject = new + { + Names = new + { + FirstName = "John", + MiddleName = "X", + LastName = "Doe", + }, + Age = 34 + }; + + var expectation = new + { + Names = new + { + FirstName = "John", + MiddleName = "W.", + LastName = "Smith", + }, + Age = 34 + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, opts => opts + .Excluding(p => new { p.Names.MiddleName, p.Names.LastName })); + } + + [Fact] + public void An_anonymous_object_can_exclude_nested_objects_inside_collections() + { + // Arrange + var subject = new + { + Names = new + { + FirstName = "John", + MiddleName = "X", + LastName = "Doe", + }, + Pets = new[] + { + new + { + Name = "Dog", + Age = 1, + Color = "Black" + }, + new + { + Name = "Cat", + Age = 1, + Color = "Black" + }, + new + { + Name = "Bird", + Age = 1, + Color = "Black" + }, + } + }; + + var expectation = new + { + Names = new + { + FirstName = "John", + MiddleName = "W.", + LastName = "Smith", + }, + Pets = new[] + { + new + { + Name = "Dog", + Age = 1, + Color = "Black" + }, + new + { + Name = "Dog", + Age = 2, + Color = "Gray" + }, + new + { + Name = "Bird", + Age = 3, + Color = "Black" + }, + } + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, opts => opts + .Excluding(p => new { p.Names.MiddleName, p.Names.LastName }) + .For(p => p.Pets) + .Exclude(p => new { p.Age, p.Name })); + + // Assert + act.Should().Throw().Which.Message.Should() + .NotMatch("*Pets[1].Age*").And + .NotMatch("*Pets[1].Name*").And + .Match("*Pets[1].Color*"); + } + + [Fact] + public void An_anonymous_object_can_exclude_nested_objects_inside_nested_collections() + { + // Arrange + var subject = new + { + Names = new + { + FirstName = "John", + MiddleName = "W.", + LastName = "Smith", + }, + Pets = new[] + { + new + { + Name = "Dog", + Fleas = new[] + { + new + { + Name = "Flea 1", + Age = 1, + }, + new + { + Name = "Flea 2", + Age = 2, + }, + }, + }, + new + { + Name = "Dog", + Fleas = new[] + { + new + { + Name = "Flea 10", + Age = 1, + }, + new + { + Name = "Flea 21", + Age = 3, + }, + }, + }, + new + { + Name = "Dog", + Fleas = new[] + { + new + { + Name = "Flea 1", + Age = 1, + }, + new + { + Name = "Flea 2", + Age = 2, + }, + }, + }, + }, + }; + + var expectation = new + { + Names = new + { + FirstName = "John", + MiddleName = "W.", + LastName = "Smith", + }, + Pets = new[] + { + new + { + Name = "Dog", + Fleas = new[] + { + new + { + Name = "Flea 1", + Age = 1, + }, + new + { + Name = "Flea 2", + Age = 2, + }, + }, + }, + new + { + Name = "Dog", + Fleas = new[] + { + new + { + Name = "Flea 1", + Age = 1, + }, + new + { + Name = "Flea 2", + Age = 1, + }, + }, + }, + new + { + Name = "Bird", + Fleas = new[] + { + new + { + Name = "Flea 1", + Age = 1, + }, + new + { + Name = "Flea 2", + Age = 2, + }, + }, + }, + }, + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, opts => opts + .Excluding(p => new { p.Names.MiddleName, p.Names.LastName }) + .For(person => person.Pets) + .For(pet => pet.Fleas) + .Exclude(flea => new { flea.Name, flea.Age })); + + // Assert + act.Should().Throw().Which.Message.Should() + .NotMatch("*Pets[*].Fleas[*].Age*").And + .NotMatch("*Pets[*].Fleas[*].Name*").And + .Match("*- Exclude*Pets[]Fleas[]Age*").And + .Match("*- Exclude*Pets[]Fleas[]Name*"); + } + + [Fact] + public void An_empty_anonymous_object_excludes_nothing_inside_collections() + { + // Arrange + var subject = new + { + Names = new + { + FirstName = "John", + MiddleName = "X", + LastName = "Doe", + }, + Pets = new[] + { + new + { + Name = "Dog", + Age = 1 + }, + new + { + Name = "Cat", + Age = 1 + }, + new + { + Name = "Bird", + Age = 1 + }, + } + }; + + var expectation = new + { + Names = new + { + FirstName = "John", + MiddleName = "W.", + LastName = "Smith", + }, + Pets = new[] + { + new + { + Name = "Dog", + Age = 1 + }, + new + { + Name = "Dog", + Age = 2 + }, + new + { + Name = "Bird", + Age = 1 + }, + } + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, opts => opts + .Excluding(p => new { p.Names.MiddleName, p.Names.LastName }) + .For(p => p.Pets) + .Exclude(p => new { })); + + // Assert + act.Should().Throw().WithMessage("*Pets[1].Name*Pets[1].Age*"); + } } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs index ee3c97dd05..bf033b8626 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs @@ -408,5 +408,103 @@ private interface IHaveDefaultProperty int DefaultProperty => NormalProperty.Length; } #endif + + [Fact] + public void An_anonymous_object_selects_correctly() + { + // Arrange + var subject = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum", + Field3 = "dolor", + Property1 = "sit", + Property2 = "amet", + Property3 = "consectetur" + }; + + var expectation = new ClassWithSomeFieldsAndProperties + { + Field1 = "Lorem", + Field2 = "ipsum" + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, + opts => opts.Including(o => new { o.Field1, o.Field2, o.Field3 })); + + // Assert + act.Should().Throw().WithMessage("Expected field subject.Field3*"); + } + + [Fact] + public void An_anonymous_object_selects_nested_fields_correctly() + { + // Arrange + var subject = new + { + Field = "Lorem", + NestedField = new + { + FieldB = "ipsum" + } + }; + + var expectation = new + { + FieldA = "Lorem", + NestedField = new + { + FieldB = "no ipsum" + } + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, + opts => opts.Including(o => new { o.NestedField.FieldB })); + + // Assert + act.Should().Throw().WithMessage("Expected*subject.NestedField.FieldB*"); + } + + [Fact] + public void An_anonymous_object_in_combination_with_exclude_selects_nested_fields_correctly() + { + // Arrange + var subject = new + { + FieldA = "Lorem", + NestedField = new + { + FieldB = "ipsum", + FieldC = "ipsum2", + FieldD = "ipsum3", + FieldE = "ipsum4", + } + }; + + var expectation = new + { + FieldA = "Lorem", + NestedField = new + { + FieldB = "no ipsum", + FieldC = "no ipsum2", + FieldD = "no ipsum3", + FieldE = "no ipsum4", + } + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, opts => opts + .Excluding(o => new { o.NestedField }) + .Including(o => new { o.NestedField.FieldB })); + + // Assert + act.Should().Throw() + .Which.Message.Should() + .Match("*Expected*subject.NestedField.FieldB*").And + .NotMatch("*Expected*FieldC*FieldD*FieldE*"); + } } } diff --git a/docs/_pages/objectgraphs.md b/docs/_pages/objectgraphs.md index 37e5b5bb7a..3d5dd92a7e 100644 --- a/docs/_pages/objectgraphs.md +++ b/docs/_pages/objectgraphs.md @@ -147,6 +147,22 @@ orderDto.Should().BeEquivalentTo(order, options => .Exclude(o => o.Name)); ``` +You can also use an anonymous object to exclude members. This can be useful if you want to exclude multiple (maybe nested) fields and avoid writing +`Excluding().Excuding().Excluding()...`. + +```csharp +orderDto.Should().BeEquivalentTo(order, options => + options.Excluding(o => new { o.Customer.Name, o.Customer.LastName, o.Vat })); +``` + +This is also possible after `.For()` like + +```csharp +orderDto.Should().BeEquivalentTo(order, options => + options.For(o => o.Products) + .Exclude(o => new { o.Name, o.Price })); +``` + Of course, `Excluding()` and `ExcludingMissingMembers()` can be combined. You can also take a different approach and explicitly tell Fluent Assertions which members to include. You can directly specify a property expression or use a predicate that acts on the provided `ISubjectInfo`. @@ -191,6 +207,8 @@ orderDto.Should().BeEquivalentTo(order, options => options This configuration affects the initial inclusion of members and happens before any `Exclude`s or other `IMemberSelectionRule`s. This configuration also affects matching. For example, that if properties are excluded, properties will not be inspected when looking for a match on the expected object. +The behavior with anonymous objects for selection also applies to `Include` as it does to `Exclude`. + ### Comparing members with different names Imagine you want to compare an `Order` and an `OrderDto` using `BeEquivalentTo`, but the first type has a `Name` property and the second has a `OrderName` property. You can map those using the following option: diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 332c3d4321..839800e8c7 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -39,6 +39,7 @@ sidebar: * All `Should()` methods on reference types are now annotated with the `[NotNull]` attribute for a better Fluent Assertions experience when nullable reference types are enabled - [#2380](https://github.com/fluentassertions/fluentassertions/pull/2380) * All assertions that support chaining using the `.Which` construct will now amend the caller identifier - [2539](https://github.com/fluentassertions/pull/2539) * Introduced a `MethodInfoFormatter` and improved the `PropertyInfoFormatter` - [2539](https://github.com/fluentassertions/pull/2539) +* `Excluding()` / `For().Exclude()` and `Including()` on `BeEquivalentTo()` now also accepts an anonymous object to include/exclude multiple members at once - [#2488](https://github.com/fluentassertions/fluentassertions/pull/2488) ### Fixes * Fixed formatting error when checking nullable `DateTimeOffset` with From cc8ce055acca38a0d62783348a0d83a8ede57c29 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 17 Nov 2024 16:32:48 +0100 Subject: [PATCH 446/845] Bump the dependencies of several packages --- Directory.Build.props | 2 +- Src/FluentAssertions/Common/TypeExtensions.cs | 18 ---------- Src/FluentAssertions/FluentAssertions.csproj | 4 +-- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- .../Common/TypeExtensionsSpecs.cs | 34 ------------------- .../MSTestV2.Specs/MSTestV2.Specs.csproj | 2 +- .../TUnit.Specs/TUnit.Specs.csproj | 4 +-- Tests/UWP.Specs/UWP.Specs.csproj | 2 +- 8 files changed, 8 insertions(+), 60 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 7316556396..52233d2577 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Src/FluentAssertions/Common/TypeExtensions.cs b/Src/FluentAssertions/Common/TypeExtensions.cs index 73a3cc67df..966bf39bf6 100644 --- a/Src/FluentAssertions/Common/TypeExtensions.cs +++ b/Src/FluentAssertions/Common/TypeExtensions.cs @@ -21,7 +21,6 @@ internal static class TypeExtensions private static readonly ConcurrentDictionary HasValueSemanticsCache = new(); private static readonly ConcurrentDictionary TypeIsRecordCache = new(); - private static readonly ConcurrentDictionary TypeIsCompilerGeneratedCache = new(); public static bool IsDecoratedWith(this Type type) where TAttribute : Attribute @@ -394,23 +393,6 @@ public static bool HasValueSemantics(this Type type) !IsKeyValuePair(t)); } - public static bool IsCompilerGenerated(this Type type) - { - return TypeIsCompilerGeneratedCache.GetOrAdd(type, static t => - t.IsRecord() || - t.IsAnonymous() || - t.IsTuple()); - } - - /// - /// Check if the type has a human-readable name. - /// - /// false for compiler generated type names, otherwise true. - public static bool HasFriendlyName(this Type type) - { - return !type.IsAnonymous() && !type.IsTuple(); - } - private static bool IsTuple(this Type type) { if (!type.IsGenericType) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index a1ee6222a3..aa8437f1c2 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -1,4 +1,4 @@ - + @@ -44,7 +44,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index dfdd21f2f8..bdea1bb3b0 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/Tests/FluentAssertions.Specs/Common/TypeExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/Common/TypeExtensionsSpecs.cs index 93bb01b35f..72c2e297b4 100644 --- a/Tests/FluentAssertions.Specs/Common/TypeExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Common/TypeExtensionsSpecs.cs @@ -146,40 +146,6 @@ public void IsRecord_should_detect_records_correctly(Type type, bool expected) type.IsRecord().Should().Be(expected); } - [Theory] - [InlineData(typeof(Tuple), true)] - [InlineData(typeof(Tuple), true)] - [InlineData(typeof(Tuple), true)] - [InlineData(typeof(Tuple), true)] - [InlineData(typeof(Tuple), true)] - [InlineData(typeof(Tuple), true)] - [InlineData(typeof(Tuple), true)] - [InlineData(typeof(ValueTuple), true)] - [InlineData(typeof(ValueTuple), true)] - [InlineData(typeof(ValueTuple), true)] - [InlineData(typeof(ValueTuple), true)] - [InlineData(typeof(ValueTuple), true)] - [InlineData(typeof(ValueTuple), true)] - [InlineData(typeof(MyRecord), true)] - [InlineData(typeof(MyRecordStruct), true)] - [InlineData(typeof(MyRecordStructWithCustomPrintMembers), true)] - [InlineData(typeof(MyRecordStructWithOverriddenEquality), true)] - [InlineData(typeof(MyReadonlyRecordStruct), true)] - [InlineData(typeof(int), false)] - [InlineData(typeof(string), false)] - [InlineData(typeof(MyClass), false)] - public void Records_and_tuples_are_detected_correctly(Type type, bool expected) - { - type.IsCompilerGenerated().Should().Be(expected); - } - - [Fact] - public void Anonymous_types_are_detected_correctly() - { - var value = new { Id = 1 }; - value.GetType().IsCompilerGenerated().Should().BeTrue(); - } - [Fact] public void When_checking_if_anonymous_type_is_record_it_should_return_false() { diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 178a9ef538..8e1848fe8b 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + \ No newline at end of file diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 848aaf102c..aee979ecbe 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/Tests/UWP.Specs/UWP.Specs.csproj b/Tests/UWP.Specs/UWP.Specs.csproj index 32318e9106..1cd11116a3 100644 --- a/Tests/UWP.Specs/UWP.Specs.csproj +++ b/Tests/UWP.Specs/UWP.Specs.csproj @@ -87,7 +87,7 @@ 6.2.14 - 3.3.1 + 3.6.3 3.3.1 From ad9279ff4e003b075b8f1f5a316ac9922f64fbbd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:00:29 +0100 Subject: [PATCH 447/845] Bump Verify.Xunit from 28.2.0 to 28.3.2 in the xunit group (#2826) Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify). Updates `Verify.Xunit` from 28.2.0 to 28.3.2 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/28.2.0...28.3.2) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index bdea1bb3b0..6aa79ce6aa 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 7a4cc2aca3092ab3c320b06390dc9e6505a983ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:01:21 +0100 Subject: [PATCH 448/845] Bump Meziantou.Analyzer from 2.0.179 to 2.0.180 (#2831) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.179 to 2.0.180. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.179...2.0.180) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 52233d2577..b1b7ec971d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 3e00296d7e62bd81418b2954a128a101f7da1018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Luthi?= Date: Sat, 23 Nov 2024 14:50:47 +0100 Subject: [PATCH 449/845] Add support for xUnit.net v3 (#2718) --- Build/Build.cs | 4 +- FluentAssertions.sln | 18 +++++++ .../Execution/AssertionFailedException.cs | 2 +- .../Execution/IAssertionException.cs | 7 +++ .../Execution/LateBoundTestFramework.cs | 50 +++++++++++++------ .../Execution/LoadableTestFramework.cs | 45 ----------------- .../Execution/TUnitFramework.cs | 2 +- .../Execution/TestFrameworkProvider.cs | 5 +- .../Execution/XUnit2TestFramework.cs | 11 ---- .../Execution/XUnitTestFramework.cs | 11 ++++ Src/FluentAssertions/FluentAssertions.csproj | 2 +- .../MSTestV2.Specs/FrameworkSpecs.cs | 6 ++- .../MSpec.Specs/FrameworkSpecs.cs | 6 ++- .../NUnit3.Specs/FrameworkSpecs.cs | 6 ++- .../NUnit4.Specs/FrameworkSpecs.cs | 6 ++- .../TUnit.Specs/FrameworkSpecs.cs | 6 +-- .../XUnit2.Specs/FrameworkSpecs.cs | 7 ++- .../XUnit3.Specs/FrameworkSpecs.cs | 24 +++++++++ .../XUnit3.Specs/XUnit3.Specs.csproj | 18 +++++++ .../XUnit3Core.Specs/FrameworkSpecs.cs | 20 ++++++++ .../XUnit3Core.Specs/XUnit3Core.Specs.csproj | 18 +++++++ docs/_pages/introduction.md | 4 +- docs/_pages/releases.md | 1 + docs/index.html | 2 +- 24 files changed, 192 insertions(+), 89 deletions(-) create mode 100644 Src/FluentAssertions/Execution/IAssertionException.cs delete mode 100644 Src/FluentAssertions/Execution/LoadableTestFramework.cs delete mode 100644 Src/FluentAssertions/Execution/XUnit2TestFramework.cs create mode 100644 Src/FluentAssertions/Execution/XUnitTestFramework.cs create mode 100644 Tests/TestFrameworks/XUnit3.Specs/FrameworkSpecs.cs create mode 100644 Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj create mode 100644 Tests/TestFrameworks/XUnit3Core.Specs/FrameworkSpecs.cs create mode 100644 Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj diff --git a/Build/Build.cs b/Build/Build.cs index d1e20ac2a5..e377fa3187 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -244,7 +244,9 @@ class Build : NukeBuild Solution.TestFrameworks.MSTestV2_Specs, Solution.TestFrameworks.NUnit3_Specs, Solution.TestFrameworks.NUnit4_Specs, - Solution.TestFrameworks.XUnit2_Specs + Solution.TestFrameworks.XUnit2_Specs, + Solution.TestFrameworks.XUnit3_Specs, + Solution.TestFrameworks.XUnit3Core_Specs, ]; var testCombinations = diff --git a/FluentAssertions.sln b/FluentAssertions.sln index 5a0259ef34..842d66c8b0 100644 --- a/FluentAssertions.sln +++ b/FluentAssertions.sln @@ -59,6 +59,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentAssertions.Extensibil EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TUnit.Specs", "Tests\TestFrameworks\TUnit.Specs\TUnit.Specs.csproj", "{6540564E-9B6E-4E1E-8881-6F0DD0F35576}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnit3.Specs", "Tests\TestFrameworks\XUnit3.Specs\XUnit3.Specs.csproj", "{AF1479D8-519F-4C6B-9E8C-5A84A6D5549A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnit3Core.Specs", "Tests\TestFrameworks\XUnit3Core.Specs\XUnit3Core.Specs.csproj", "{77BB9496-169D-43DA-BCED-7DB3ACD9179A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution CI|Any CPU = CI|Any CPU @@ -173,6 +177,18 @@ Global {6540564E-9B6E-4E1E-8881-6F0DD0F35576}.Debug|Any CPU.Build.0 = Debug|Any CPU {6540564E-9B6E-4E1E-8881-6F0DD0F35576}.Release|Any CPU.ActiveCfg = Release|Any CPU {6540564E-9B6E-4E1E-8881-6F0DD0F35576}.Release|Any CPU.Build.0 = Release|Any CPU + {AF1479D8-519F-4C6B-9E8C-5A84A6D5549A}.CI|Any CPU.ActiveCfg = Debug|Any CPU + {AF1479D8-519F-4C6B-9E8C-5A84A6D5549A}.CI|Any CPU.Build.0 = Debug|Any CPU + {AF1479D8-519F-4C6B-9E8C-5A84A6D5549A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF1479D8-519F-4C6B-9E8C-5A84A6D5549A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF1479D8-519F-4C6B-9E8C-5A84A6D5549A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF1479D8-519F-4C6B-9E8C-5A84A6D5549A}.Release|Any CPU.Build.0 = Release|Any CPU + {77BB9496-169D-43DA-BCED-7DB3ACD9179A}.CI|Any CPU.ActiveCfg = Debug|Any CPU + {77BB9496-169D-43DA-BCED-7DB3ACD9179A}.CI|Any CPU.Build.0 = Debug|Any CPU + {77BB9496-169D-43DA-BCED-7DB3ACD9179A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {77BB9496-169D-43DA-BCED-7DB3ACD9179A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {77BB9496-169D-43DA-BCED-7DB3ACD9179A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {77BB9496-169D-43DA-BCED-7DB3ACD9179A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -196,6 +212,8 @@ Global {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} {450FC408-A4E2-4483-B064-2007024D6CF1} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} {6540564E-9B6E-4E1E-8881-6F0DD0F35576} = {4D8FA213-8724-4C43-B68A-F018148D238C} + {AF1479D8-519F-4C6B-9E8C-5A84A6D5549A} = {4D8FA213-8724-4C43-B68A-F018148D238C} + {77BB9496-169D-43DA-BCED-7DB3ACD9179A} = {4D8FA213-8724-4C43-B68A-F018148D238C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {75DDA3D8-9D6F-4865-93F4-DDE11DEE8290} diff --git a/Src/FluentAssertions/Execution/AssertionFailedException.cs b/Src/FluentAssertions/Execution/AssertionFailedException.cs index 916732abe8..d21f2f6ab8 100644 --- a/Src/FluentAssertions/Execution/AssertionFailedException.cs +++ b/Src/FluentAssertions/Execution/AssertionFailedException.cs @@ -7,7 +7,7 @@ namespace FluentAssertions.Execution; /// /// The mandatory exception message #pragma warning disable CA1032, RCS1194 // AssertionFailedException should never be constructed with an empty message -public class AssertionFailedException(string message) : Exception(message) +public class AssertionFailedException(string message) : Exception(message), IAssertionException #pragma warning restore CA1032, RCS1194 { } diff --git a/Src/FluentAssertions/Execution/IAssertionException.cs b/Src/FluentAssertions/Execution/IAssertionException.cs new file mode 100644 index 0000000000..8c8c519d46 --- /dev/null +++ b/Src/FluentAssertions/Execution/IAssertionException.cs @@ -0,0 +1,7 @@ +namespace FluentAssertions.Execution; + +/// +/// This is a marker interface for xUnit.net v3 to set the test failure cause as an assertion failure. +/// See What’s New in xUnit.net v3 - Third party assertion library extension points. +/// +internal interface IAssertionException; diff --git a/Src/FluentAssertions/Execution/LateBoundTestFramework.cs b/Src/FluentAssertions/Execution/LateBoundTestFramework.cs index 087f4043e5..5c7cbbe423 100644 --- a/Src/FluentAssertions/Execution/LateBoundTestFramework.cs +++ b/Src/FluentAssertions/Execution/LateBoundTestFramework.cs @@ -1,40 +1,58 @@ using System; using System.Diagnostics.CodeAnalysis; +using System.IO; using System.Reflection; namespace FluentAssertions.Execution; internal abstract class LateBoundTestFramework : ITestFramework { - private Assembly assembly; + private readonly bool loadAssembly; + private Func exceptionFactory; - [DoesNotReturn] - public void Throw(string message) + protected LateBoundTestFramework(bool loadAssembly = false) { - Type exceptionType = assembly.GetType(ExceptionFullName); - - if (exceptionType is null) - { - throw new NotSupportedException( - $"Failed to create the assertion exception for the current test framework: \"{ExceptionFullName}, {assembly.FullName}\""); - } - - throw (Exception)Activator.CreateInstance(exceptionType, message); + this.loadAssembly = loadAssembly; + exceptionFactory = _ => throw new InvalidOperationException($"{nameof(IsAvailable)} must be called first."); } + [DoesNotReturn] + public void Throw(string message) => throw exceptionFactory(message); + public bool IsAvailable { get { - string prefix = AssemblyName + ","; + var assembly = FindExceptionAssembly(); + var exceptionType = assembly?.GetType(ExceptionFullName); - assembly = Array.Find(AppDomain.CurrentDomain - .GetAssemblies(), a => a.FullName.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)); + exceptionFactory = exceptionType != null + ? message => (Exception)Activator.CreateInstance(exceptionType, message) + : _ => throw new InvalidOperationException($"{GetType().Name} is not available"); - return assembly is not null; + return exceptionType is not null; } } + private Assembly FindExceptionAssembly() + { + var assembly = Array.Find(AppDomain.CurrentDomain.GetAssemblies(), a => a.GetName().Name == AssemblyName); + + if (assembly is null && loadAssembly) + { + try + { + return Assembly.Load(new AssemblyName(AssemblyName)); + } + catch (FileNotFoundException) + { + return null; + } + } + + return assembly; + } + protected internal abstract string AssemblyName { get; } protected abstract string ExceptionFullName { get; } diff --git a/Src/FluentAssertions/Execution/LoadableTestFramework.cs b/Src/FluentAssertions/Execution/LoadableTestFramework.cs deleted file mode 100644 index 859422a25c..0000000000 --- a/Src/FluentAssertions/Execution/LoadableTestFramework.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using System.Reflection; - -namespace FluentAssertions.Execution; - -/// -/// This attempts to load the assembly into the App Domain. -/// If it isn't loadable, then IsAvailable will return false -/// -internal abstract class LoadableTestFramework : ITestFramework -{ - private Assembly assembly; - - public bool IsAvailable - { - get - { - try - { - // For netfx the assembly is not in AppDomain by default, so we can't just scan AppDomain.CurrentDomain - assembly = Assembly.Load(new AssemblyName(AssemblyName)); - - return assembly is not null; - } - catch - { - return false; - } - } - } - - [DoesNotReturn] - public void Throw(string message) - { - Type exceptionType = assembly.GetType(ExceptionFullName) - ?? throw new NotSupportedException($"Failed to create {ExceptionFullName}"); - - throw (Exception)Activator.CreateInstance(exceptionType, message)!; - } - - protected internal abstract string AssemblyName { get; } - - protected abstract string ExceptionFullName { get; } -} diff --git a/Src/FluentAssertions/Execution/TUnitFramework.cs b/Src/FluentAssertions/Execution/TUnitFramework.cs index 27c097a5c1..33fe376f49 100644 --- a/Src/FluentAssertions/Execution/TUnitFramework.cs +++ b/Src/FluentAssertions/Execution/TUnitFramework.cs @@ -1,6 +1,6 @@ namespace FluentAssertions.Execution; -internal class TUnitFramework : LoadableTestFramework +internal class TUnitFramework() : LateBoundTestFramework(loadAssembly: true) { protected override string ExceptionFullName => "TUnit.Assertions.Exceptions.AssertionException"; diff --git a/Src/FluentAssertions/Execution/TestFrameworkProvider.cs b/Src/FluentAssertions/Execution/TestFrameworkProvider.cs index 4ceab980ca..9710e23af4 100644 --- a/Src/FluentAssertions/Execution/TestFrameworkProvider.cs +++ b/Src/FluentAssertions/Execution/TestFrameworkProvider.cs @@ -18,8 +18,11 @@ internal class TestFrameworkProvider ["mspec"] = new MSpecFramework(), ["nunit"] = new NUnitTestFramework(), ["mstestv2"] = new MSTestFrameworkV2(), + + // Keep TUnitFramework and XUnitTestFramework last as they use a try/catch approach ["tunit"] = new TUnitFramework(), - ["xunit2"] = new XUnit2TestFramework() // Keep this the last one as it uses a try/catch approach + ["xunit2"] = new XUnitTestFramework("xunit.assert"), + ["xunit3"] = new XUnitTestFramework("xunit.v3.assert"), }; private readonly Configuration configuration; diff --git a/Src/FluentAssertions/Execution/XUnit2TestFramework.cs b/Src/FluentAssertions/Execution/XUnit2TestFramework.cs deleted file mode 100644 index 55fb5b9423..0000000000 --- a/Src/FluentAssertions/Execution/XUnit2TestFramework.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace FluentAssertions.Execution; - -/// -/// Implements the XUnit (version 2) test framework adapter. -/// -internal class XUnit2TestFramework : LoadableTestFramework -{ - protected internal override string AssemblyName => "xunit.assert"; - - protected override string ExceptionFullName => "Xunit.Sdk.XunitException"; -} diff --git a/Src/FluentAssertions/Execution/XUnitTestFramework.cs b/Src/FluentAssertions/Execution/XUnitTestFramework.cs new file mode 100644 index 0000000000..6c68fb5b1e --- /dev/null +++ b/Src/FluentAssertions/Execution/XUnitTestFramework.cs @@ -0,0 +1,11 @@ +namespace FluentAssertions.Execution; + +/// +/// Implements the xUnit (version 2 and 3) test framework adapter. +/// +internal class XUnitTestFramework(string assemblyName) : LateBoundTestFramework(loadAssembly: true) +{ + protected internal override string AssemblyName => assemblyName; + + protected override string ExceptionFullName => "Xunit.Sdk.XunitException"; +} diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index aa8437f1c2..655b0f0b85 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -19,7 +19,7 @@ A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher. - Supports the unit test frameworks MSTest2, NUnit3, NUnit4, XUnit2, MSpec and TUnit. + Supports the unit test frameworks MSTest2, NUnit3, NUnit4, XUnit2, XUnit3, MSpec and TUnit. Supported by InfoSupport B.V. diff --git a/Tests/TestFrameworks/MSTestV2.Specs/FrameworkSpecs.cs b/Tests/TestFrameworks/MSTestV2.Specs/FrameworkSpecs.cs index b527e6bff2..a6f8b1e663 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/FrameworkSpecs.cs +++ b/Tests/TestFrameworks/MSTestV2.Specs/FrameworkSpecs.cs @@ -14,6 +14,10 @@ public void When_mstestv2_is_used_it_should_throw_mstest_exceptions_for_assertio Action act = () => 0.Should().Be(1); // Assert - act.Should().Throw(); + Exception exception = act.Should().Throw().Which; + + // Don't reference the exception type explicitly like this: act.Should().Throw() + // It could cause this specs project to load the assembly containing the exception (this actually happens for xUnit) + exception.GetType().FullName.Should().Be("Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException"); } } diff --git a/Tests/TestFrameworks/MSpec.Specs/FrameworkSpecs.cs b/Tests/TestFrameworks/MSpec.Specs/FrameworkSpecs.cs index 0322e46865..4c26788adb 100644 --- a/Tests/TestFrameworks/MSpec.Specs/FrameworkSpecs.cs +++ b/Tests/TestFrameworks/MSpec.Specs/FrameworkSpecs.cs @@ -9,7 +9,11 @@ public class When_mspec_is_used { Because of = () => Exception = Catch.Exception(() => 0.Should().Be(1)); - It should_fail_with_a_specification_exception = () => Exception.Should().BeOfType(); + It should_fail = () => Exception.Should().BeAssignableTo(); + + // Don't reference the exception type explicitly like this: Exception.Should().BeAssignableTo() + // It could cause this specs project to load the assembly containing the exception (this actually happens for xUnit) + It should_fail_with_a_specification_exception = () => Exception.GetType().FullName.Should().Be("Machine.Specifications.SpecificationException"); private static Exception Exception; } diff --git a/Tests/TestFrameworks/NUnit3.Specs/FrameworkSpecs.cs b/Tests/TestFrameworks/NUnit3.Specs/FrameworkSpecs.cs index fd90bc41ff..ad15835584 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/FrameworkSpecs.cs +++ b/Tests/TestFrameworks/NUnit3.Specs/FrameworkSpecs.cs @@ -14,6 +14,10 @@ public void When_nunit3_is_used_it_should_throw_nunit_exceptions_for_assertion_f Action act = () => 0.Should().Be(1); // Assert - act.Should().Throw(); + Exception exception = act.Should().Throw().Which; + + // Don't reference the exception type explicitly like this: act.Should().Throw() + // It could cause this specs project to load the assembly containing the exception (this actually happens for xUnit) + exception.GetType().FullName.Should().Be("NUnit.Framework.AssertionException"); } } diff --git a/Tests/TestFrameworks/NUnit4.Specs/FrameworkSpecs.cs b/Tests/TestFrameworks/NUnit4.Specs/FrameworkSpecs.cs index a3d1bcf2c3..6085148a77 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/FrameworkSpecs.cs +++ b/Tests/TestFrameworks/NUnit4.Specs/FrameworkSpecs.cs @@ -14,6 +14,10 @@ public void Throw_nunit_framework_exception_for_nunit4_tests() Action act = () => 0.Should().Be(1); // Assert - act.Should().Throw(); + Exception exception = act.Should().Throw().Which; + + // Don't reference the exception type explicitly like this: act.Should().Throw() + // It could cause this specs project to load the assembly containing the exception (this actually happens for xUnit) + exception.GetType().FullName.Should().Be("NUnit.Framework.AssertionException"); } } diff --git a/Tests/TestFrameworks/TUnit.Specs/FrameworkSpecs.cs b/Tests/TestFrameworks/TUnit.Specs/FrameworkSpecs.cs index 4cf3173f30..ee06efd844 100644 --- a/Tests/TestFrameworks/TUnit.Specs/FrameworkSpecs.cs +++ b/Tests/TestFrameworks/TUnit.Specs/FrameworkSpecs.cs @@ -14,8 +14,8 @@ public void When_tunit_is_used_it_should_throw_tunit_exceptions_for_assertion_fa // Assert Exception exception = act.Should().Throw().Which; - exception.GetType() - .FullName.Should() - .ContainEquivalentOf("TUnit.Assertions.Exceptions.AssertionException"); + // Don't reference the exception type explicitly like this: act.Should().Throw() + // It could cause this specs project to load the assembly containing the exception (this actually happens for xUnit) + exception.GetType().FullName.Should().Be("TUnit.Assertions.Exceptions.AssertionException"); } } diff --git a/Tests/TestFrameworks/XUnit2.Specs/FrameworkSpecs.cs b/Tests/TestFrameworks/XUnit2.Specs/FrameworkSpecs.cs index 2a7b0f1755..7920d90718 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/FrameworkSpecs.cs +++ b/Tests/TestFrameworks/XUnit2.Specs/FrameworkSpecs.cs @@ -1,7 +1,6 @@ using System; using FluentAssertions; using Xunit; -using Xunit.Sdk; namespace XUnit2.Specs; @@ -14,6 +13,10 @@ public void When_xunit2_is_used_it_should_throw_xunit_exceptions_for_assertion_f Action act = () => 0.Should().Be(1); // Assert - act.Should().Throw(); + Exception exception = act.Should().Throw().Which; + + // Don't reference the exception type explicitly like this: act.Should().Throw() + // It could cause this specs project to load the assembly containing the exception (this actually happens for xUnit) + exception.GetType().FullName.Should().Be("Xunit.Sdk.XunitException"); } } diff --git a/Tests/TestFrameworks/XUnit3.Specs/FrameworkSpecs.cs b/Tests/TestFrameworks/XUnit3.Specs/FrameworkSpecs.cs new file mode 100644 index 0000000000..87db4492eb --- /dev/null +++ b/Tests/TestFrameworks/XUnit3.Specs/FrameworkSpecs.cs @@ -0,0 +1,24 @@ +using System; +using System.Linq; +using FluentAssertions; +using Xunit; + +namespace XUnit3.Specs; + +public class FrameworkSpecs +{ + [Fact] + public void When_xunit3_is_used_it_should_throw_xunit_exceptions_for_assertion_failures() + { + // Act + Action act = () => 0.Should().Be(1); + + // Assert + Exception exception = act.Should().Throw().Which; + + // Don't reference the exception type explicitly like this: act.Should().Throw() + // It could cause this specs project to load the assembly containing the exception (this actually happens for xUnit) + exception.GetType().GetInterfaces().Select(e => e.Name).Should().Contain("IAssertionException"); + exception.GetType().FullName.Should().Be("Xunit.Sdk.XunitException"); + } +} diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj new file mode 100644 index 0000000000..c9ed45dd76 --- /dev/null +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -0,0 +1,18 @@ + + + net472;net6.0 + Exe + + + + + + + + + + + + + + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/FrameworkSpecs.cs b/Tests/TestFrameworks/XUnit3Core.Specs/FrameworkSpecs.cs new file mode 100644 index 0000000000..d72a1825fc --- /dev/null +++ b/Tests/TestFrameworks/XUnit3Core.Specs/FrameworkSpecs.cs @@ -0,0 +1,20 @@ +using System; +using System.Linq; +using FluentAssertions; +using Xunit; + +namespace XUnit3Core.Specs; + +public class FrameworkSpecs +{ + [Fact] + public void When_xunit3_without_xunit_assert_is_used_it_should_throw_IAssertionException_for_assertion_failures() + { + // Act + Action act = () => 0.Should().Be(1); + + // Assert + Exception exception = act.Should().Throw().Which; + exception.GetType().GetInterfaces().Select(e => e.Name).Should().Contain("IAssertionException"); + } +} diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj new file mode 100644 index 0000000000..96eac8f312 --- /dev/null +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -0,0 +1,18 @@ + + + net472;net6.0 + Exe + + + + + + + + + + + + + + diff --git a/docs/_pages/introduction.md b/docs/_pages/introduction.md index 19a8fa74b2..16841ac8b2 100644 --- a/docs/_pages/introduction.md +++ b/docs/_pages/introduction.md @@ -92,12 +92,12 @@ public static class Initializer Fluent Assertions supports a lot of different unit testing frameworks. Just add a reference to the corresponding test framework assembly to the unit test project. Fluent Assertions will automatically find the corresponding assembly and use it for throwing the framework-specific exceptions. -If, for some unknown reason, Fluent Assertions fails to find the assembly, and you're running under .NET 4.7 or a .NET 6.0 project, try specifying the framework explicitly using a configuration setting in the project’s app.config. If it cannot find any of the supported frameworks, it will fall back to using a custom `AssertFailedException` exception class. +If, for some unknown reason, Fluent Assertions fails to find the assembly, and you're running under .NET 4.7 or a .NET 6.0 project, try specifying the framework explicitly using a configuration setting in the project’s app.config. If it cannot find any of the supported frameworks, it will fall back to using a custom `AssertionFailedException` exception class. ```xml - + diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 4c0109f297..bca7ccb742 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -28,6 +28,7 @@ sidebar: * Added a few more assertions on `XDocument` - [#2690](https://github.com/fluentassertions/fluentassertions/pull/2690) * `[Not]HaveElementWithValue` * `NotHaveElement` +* Added support for xUnit.net v3 - [#2718](https://github.com/fluentassertions/fluentassertions/issues/2718) ### Improvements * Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) diff --git a/docs/index.html b/docs/index.html index b2310a2779..73df774cd4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -54,7 +54,7 @@ image_path: /assets/images/checklist.svg excerpt: ' Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher. -Supports MSTest2, xUnit2, NUnit3, NUnit4, MSpec and TUnit. +Supports MSTest2, xUnit2, xUnit3, NUnit3, NUnit4, MSpec and TUnit. ' - title: "Great Support" image_path: /assets/images/customer-service.svg From 0befd893c64756f70cf44709ecb4d3b52670cbbf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 21:51:00 +0100 Subject: [PATCH 450/845] Bump TUnit from 0.2.212 to 0.4.1 (#2841) Bumps [TUnit](https://github.com/thomhurst/TUnit) from 0.2.212 to 0.4.1. - [Commits](https://github.com/thomhurst/TUnit/commits) --- updated-dependencies: - dependency-name: TUnit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index aee979ecbe..67fa7545fa 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -11,7 +11,7 @@ - + From 21c21c943536dbac90ef14e0dc26b5336e0e7190 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 21:51:34 +0100 Subject: [PATCH 451/845] Bump System.Formats.Asn1 from 8.0.1 to 9.0.0 (#2840) Bumps [System.Formats.Asn1](https://github.com/dotnet/runtime) from 8.0.1 to 9.0.0. - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/compare/v8.0.1...v9.0.0) --- updated-dependencies: - dependency-name: System.Formats.Asn1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index f4546c999f..dc49eed481 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -25,6 +25,6 @@ - + From 8e8f28afb277d7f679786314933eeea005c6e72a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 07:57:09 +0100 Subject: [PATCH 452/845] Bump Microsoft.NET.Test.Sdk and Newtonsoft.Json (#2839) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) and [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json). These dependencies needed to be updated together. Updates `Microsoft.NET.Test.Sdk` from 17.11.1 to 17.12.0 - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.11.1...v17.12.0) Updates `Newtonsoft.Json` from 13.0.3 to 13.0.1 - [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases) - [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/13.0.3...13.0.1) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Newtonsoft.Json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 2 +- Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 6aa79ce6aa..1d19199bb8 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -5,7 +5,7 @@ - + all diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 2b469fd312..7b688bce62 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -10,7 +10,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 64c8cd9a97..c1d4217282 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -21,7 +21,7 @@ - + diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 443e147046..936042ac98 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -10,7 +10,7 @@ - + diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index d3f3a4152f..3be852702e 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -21,7 +21,7 @@ - + diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 07dffbe980..4e3f45bb9b 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj index 05731f4a9a..2e58615511 100644 --- a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj +++ b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index e0618ca84b..309480d004 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index 16a52da02b..2a486de291 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index f552e129ee..d3577f1dfe 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj index c9ed45dd76..3510eb353d 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -8,7 +8,7 @@ - + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index 96eac8f312..bc14020d17 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -8,7 +8,7 @@ - + diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 0743b131b4..312dbd460c 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -6,7 +6,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive From 812d6f5ff102b575ef35fd8a1d87661021908f6f Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Tue, 26 Nov 2024 08:56:40 +0100 Subject: [PATCH 453/845] Changed references to the master branch to main (#2842) --- .github/workflows/code_quality.yml | 4 ++-- .github/workflows/codeql.yml | 4 ++-- README.md | 2 +- docs/.travis.yml | 2 +- docs/_includes/editlink.html | 2 +- docs/_pages/introduction.md | 2 +- docs/_pages/typesandmethods.md | 2 +- docs/staticman.yml | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index 60fb973aae..e743e206dc 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -5,7 +5,7 @@ on: pull_request_target: push: branches: - - master + - main - develop jobs: @@ -20,7 +20,7 @@ jobs: - name: 'Qodana Scan' uses: JetBrains/qodana-action@v2024.2 with: - upload-result: ${{ github.ref_name == 'master' || github.ref_name == 'develop' }} + upload-result: ${{ github.ref_name == 'main' || github.ref_name == 'develop' }} args: --baseline,qodana.sarif.json,--ide,QDNET pr-mode: ${{ github.event_name == 'pull_request_target' }} env: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 7cc2c66f69..6148f3423b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -2,9 +2,9 @@ name: "CodeQL" on: push: - branches: [ "develop", "master" ] + branches: [ "develop", "main" ] pull_request: - branches: [ "develop", "master" ] + branches: [ "develop", "main" ] schedule: - cron: '00 15 * * 1' diff --git a/README.md b/README.md index 32df46905c..1efa0d63dd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Extension methods to fluently assert the outcome of .NET tests [![](https://img.shields.io/github/actions/workflow/status/fluentassertions/fluentassertions/build.yml?branch=develop)](https://github.com/fluentassertions/fluentassertions/actions?query=branch%3Adevelop) -[![Coveralls branch](https://img.shields.io/coverallsCoverage/github/fluentassertions/fluentassertions?branch=master)](https://coveralls.io/github/fluentassertions/fluentassertions?branch=master) +[![Coveralls branch](https://img.shields.io/coverallsCoverage/github/fluentassertions/fluentassertions?branch=main)](https://coveralls.io/github/fluentassertions/fluentassertions?branch=main) [![qodana](https://github.com/fluentassertions/fluentassertions/actions/workflows/code_quality.yml/badge.svg)](https://github.com/fluentassertions/fluentassertions/actions/workflows/code_quality.yml) [![](https://img.shields.io/github/release/FluentAssertions/FluentAssertions.svg?label=latest%20release&color=007edf)](https://github.com/FluentAssertions/FluentAssertions/releases/latest) [![](https://img.shields.io/nuget/dt/FluentAssertions.svg?label=downloads&color=007edf&logo=nuget)](https://www.nuget.org/packages/FluentAssertions) diff --git a/docs/.travis.yml b/docs/.travis.yml index 1bb28592f8..83f9ec03d0 100644 --- a/docs/.travis.yml +++ b/docs/.travis.yml @@ -6,6 +6,6 @@ script: branches: only: # Change this to gh-pages if you're deploying using the gh-pages branch - - master + - main rvm: - 2.4 \ No newline at end of file diff --git a/docs/_includes/editlink.html b/docs/_includes/editlink.html index 5412c94bee..f08cccb650 100644 --- a/docs/_includes/editlink.html +++ b/docs/_includes/editlink.html @@ -4,4 +4,4 @@ {% assign path = page.path %} {% endif %} - Edit this page \ No newline at end of file + Edit this page \ No newline at end of file diff --git a/docs/_pages/introduction.md b/docs/_pages/introduction.md index 16841ac8b2..cbca247481 100644 --- a/docs/_pages/introduction.md +++ b/docs/_pages/introduction.md @@ -202,7 +202,7 @@ using (var scope = new AssertionScope()) } ``` -For more examples take a look at the [AssertionScopeSpecs.cs](https://github.com/fluentassertions/fluentassertions/blob/master/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs) in Unit Tests. +For more examples take a look at the [AssertionScopeSpecs.cs](https://github.com/fluentassertions/fluentassertions/blob/main/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs) in Unit Tests. ### Scoped `IValueFormatter`s diff --git a/docs/_pages/typesandmethods.md b/docs/_pages/typesandmethods.md index 96297b5387..5de2cf8eb4 100644 --- a/docs/_pages/typesandmethods.md +++ b/docs/_pages/typesandmethods.md @@ -125,4 +125,4 @@ AllTypes.From(assembly) .ThatAreNotInNamespace("Internal.Main.Test"); ``` -There are so many possibilities and specialized methods that none of these examples do them good. Check out the [TypeAssertionSpecs](https://github.com/fluentassertions/fluentassertions/tree/master/Tests/FluentAssertions.Specs/Types) from the source for more examples. +There are so many possibilities and specialized methods that none of these examples do them good. Check out the [TypeAssertionSpecs](https://github.com/fluentassertions/fluentassertions/tree/main/Tests/FluentAssertions.Specs/Types) from the source for more examples. diff --git a/docs/staticman.yml b/docs/staticman.yml index c8e0ec5c25..e580804fbe 100644 --- a/docs/staticman.yml +++ b/docs/staticman.yml @@ -23,7 +23,7 @@ comments: # # Name of the branch being used. Must match the one sent in the URL of the # request. - branch: "master" + branch: "main" commitMessage: "New comment" From b744cc4857351825b0b3a73a14c646cc1d4f7b27 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Tue, 26 Nov 2024 11:22:15 +0100 Subject: [PATCH 454/845] Fixed a problem in BeEquivalentTo where write-only properties would cause a NRE. The implementation of Type.GetProperties that Reflectify provided crashed on a write-only property that is part of an interface. We didn't have a test for that, and the only other test that covered a similar scenario wasn't properly implemented. --- .../Equivalency/Selection/AllPropertiesSelectionRule.cs | 1 + Src/FluentAssertions/FluentAssertions.csproj | 2 +- .../SelectionRulesSpecs.Accessibility.cs | 4 ++-- Tests/FluentAssertions.Equivalency.Specs/TestTypes.cs | 7 ++++++- docs/_pages/releases.md | 4 ++++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Selection/AllPropertiesSelectionRule.cs b/Src/FluentAssertions/Equivalency/Selection/AllPropertiesSelectionRule.cs index 803bbbf219..cee5cfd696 100644 --- a/Src/FluentAssertions/Equivalency/Selection/AllPropertiesSelectionRule.cs +++ b/Src/FluentAssertions/Equivalency/Selection/AllPropertiesSelectionRule.cs @@ -19,6 +19,7 @@ public IEnumerable SelectMembers(INode currentNode, IEnumerable selectedProperties = context.Type .GetProperties(visibility.ToMemberKind()) + .Where(property => property.GetMethod?.IsPrivate == false) .Select(info => new Property(context.Type, info, currentNode)); return selectedMembers.Union(selectedProperties).ToList(); diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 655b0f0b85..4a01810d69 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -44,7 +44,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Accessibility.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Accessibility.cs index 5639590a9c..090df003ab 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Accessibility.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Accessibility.cs @@ -13,13 +13,13 @@ public class Accessibility public void When_a_property_is_write_only_it_should_be_ignored() { // Arrange - var subject = new ClassWithWriteOnlyProperty + var expected = new ClassWithWriteOnlyProperty { WriteOnlyProperty = 123, SomeOtherProperty = "whatever" }; - var expected = new + var subject = new { SomeOtherProperty = "whatever" }; diff --git a/Tests/FluentAssertions.Equivalency.Specs/TestTypes.cs b/Tests/FluentAssertions.Equivalency.Specs/TestTypes.cs index 2865e5c7e7..06034c13f8 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/TestTypes.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/TestTypes.cs @@ -37,7 +37,7 @@ public class ClassTwo public int ValTwo { get; set; } = 3; } -public class ClassWithWriteOnlyProperty +public class ClassWithWriteOnlyProperty : IHaveWriteOnlyProperty { private int writeOnlyPropertyValue; @@ -49,6 +49,11 @@ public int WriteOnlyProperty public string SomeOtherProperty { get; set; } } +public interface IHaveWriteOnlyProperty +{ + int WriteOnlyProperty { set; } +} + internal enum EnumOne { One = 0, diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index bca7ccb742..3547759f82 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -104,6 +104,10 @@ sidebar: * Methods overwritten in `GenericAsyncFunctionAssertions` has been moved to `NonGenericAsyncFunctionAssertions`. * Moved the non-generic `NotThrow` and `NotThrowAfter` from `DelegateAssertions` to `ActionAssertions` - [#2371](https://github.com/fluentassertions/fluentassertions/pull/2371) +### Fixes + +* Fixed a problem in `BeEquivalentTo` where write-only properties would cause a `NullReferenceException` - [#2836](https://github.com/fluentassertions/fluentassertions/pull/2836) + ## 6.12.3 ### Fixes From 7f032af39615cb026ae73e293a07db5ca86548b2 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Wed, 27 Nov 2024 18:39:34 +0100 Subject: [PATCH 455/845] You can exclude explicitly implemented properties from BeEquivalentTo via ExcludingExplicitlyImplementedProperties (#2851) --- .../Selection/AllPropertiesSelectionRule.cs | 3 +-- .../SelfReferenceEquivalencyOptions.cs | 15 +++++++++-- .../FluentAssertions/net47.verified.txt | 1 + .../FluentAssertions/net6.0.verified.txt | 1 + .../netstandard2.0.verified.txt | 1 + .../netstandard2.1.verified.txt | 1 + .../SelectionRulesSpecs.Interfaces.cs | 26 +++++++++++++++++++ docs/_pages/releases.md | 3 ++- 8 files changed, 46 insertions(+), 5 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Selection/AllPropertiesSelectionRule.cs b/Src/FluentAssertions/Equivalency/Selection/AllPropertiesSelectionRule.cs index cee5cfd696..b683a7ce28 100644 --- a/Src/FluentAssertions/Equivalency/Selection/AllPropertiesSelectionRule.cs +++ b/Src/FluentAssertions/Equivalency/Selection/AllPropertiesSelectionRule.cs @@ -14,8 +14,7 @@ internal class AllPropertiesSelectionRule : IMemberSelectionRule public IEnumerable SelectMembers(INode currentNode, IEnumerable selectedMembers, MemberSelectionContext context) { - MemberVisibility visibility = context.IncludedProperties | MemberVisibility.ExplicitlyImplemented | - MemberVisibility.DefaultInterfaceProperties; + MemberVisibility visibility = context.IncludedProperties; IEnumerable selectedProperties = context.Type .GetProperties(visibility.ToMemberKind()) diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index ef9a6dd699..0f75f84c51 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -273,7 +273,8 @@ public TSelf ExcludingFields() /// public TSelf IncludingProperties() { - includedProperties = MemberVisibility.Public; + includedProperties = MemberVisibility.Public | MemberVisibility.ExplicitlyImplemented | + MemberVisibility.DefaultInterfaceProperties; return (TSelf)this; } @@ -282,7 +283,8 @@ public TSelf IncludingProperties() /// public TSelf IncludingInternalProperties() { - includedProperties = MemberVisibility.Public | MemberVisibility.Internal; + includedProperties = MemberVisibility.Public | MemberVisibility.Internal | MemberVisibility.ExplicitlyImplemented | + MemberVisibility.DefaultInterfaceProperties; return (TSelf)this; } @@ -298,6 +300,15 @@ public TSelf ExcludingProperties() return (TSelf)this; } + /// + /// Excludes properties that are explicitly implemented from the equivalency comparison. + /// + public TSelf ExcludingExplicitlyImplementedProperties() + { + includedProperties &= ~MemberVisibility.ExplicitlyImplemented; + return (TSelf)this; + } + /// /// Instructs the comparison to exclude non-browsable members in the expectation (members set to /// ). It is not required that they be marked non-browsable in the subject. Use diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index ee73f3ae1b..9ec1b74c6c 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -889,6 +889,7 @@ namespace FluentAssertions.Equivalency public TSelf ComparingRecordsByMembers() { } public TSelf ComparingRecordsByValue() { } public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } + public TSelf ExcludingExplicitlyImplementedProperties() { } public TSelf ExcludingFields() { } public TSelf ExcludingMissingMembers() { } public TSelf ExcludingNestedObjects() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index d015a1e4da..f3f47adcc7 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -902,6 +902,7 @@ namespace FluentAssertions.Equivalency public TSelf ComparingRecordsByMembers() { } public TSelf ComparingRecordsByValue() { } public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } + public TSelf ExcludingExplicitlyImplementedProperties() { } public TSelf ExcludingFields() { } public TSelf ExcludingMissingMembers() { } public TSelf ExcludingNestedObjects() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index b68cf3d428..1cfb1dffd7 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -881,6 +881,7 @@ namespace FluentAssertions.Equivalency public TSelf ComparingRecordsByMembers() { } public TSelf ComparingRecordsByValue() { } public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } + public TSelf ExcludingExplicitlyImplementedProperties() { } public TSelf ExcludingFields() { } public TSelf ExcludingMissingMembers() { } public TSelf ExcludingNestedObjects() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 09fd189a11..1de0d65a5e 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -889,6 +889,7 @@ namespace FluentAssertions.Equivalency public TSelf ComparingRecordsByMembers() { } public TSelf ComparingRecordsByValue() { } public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } + public TSelf ExcludingExplicitlyImplementedProperties() { } public TSelf ExcludingFields() { } public TSelf ExcludingMissingMembers() { } public TSelf ExcludingNestedObjects() { } diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs index 9146e70da9..afb4f9f1a4 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs @@ -1,4 +1,5 @@ using System; +using JetBrains.Annotations; using Xunit; using Xunit.Sdk; @@ -291,6 +292,28 @@ public void Can_find_explicitly_implemented_property_on_the_subject() person.Should().BeEquivalentTo(new { Name = "Bob" }); } + [Fact] + public void Can_exclude_explicitly_implemented_properties() + { + // Arrange + var subject = new Person + { + NormalProperty = "Normal", + }; + + ((IPerson)subject).Name = "Bob"; + + var expectation = new Person + { + NormalProperty = "Normal", + }; + + ((IPerson)expectation).Name = "Jim"; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options.ExcludingExplicitlyImplementedProperties()); + } + private interface IPerson { string Name { get; set; } @@ -298,6 +321,9 @@ private interface IPerson private class Person : IPerson { + [UsedImplicitly] + public string NormalProperty { get; set; } + string IPerson.Name { get; set; } } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 3547759f82..3c65690c5d 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,7 +7,7 @@ sidebar: nav: "sidebar" --- -## 7.0 Alpha X +## 8.0 Alpha X ### What's new @@ -41,6 +41,7 @@ sidebar: * All assertions that support chaining using the `.Which` construct will now amend the caller identifier - [2539](https://github.com/fluentassertions/pull/2539) * Introduced a `MethodInfoFormatter` and improved the `PropertyInfoFormatter` - [2539](https://github.com/fluentassertions/pull/2539) * `Excluding()` / `For().Exclude()` and `Including()` on `BeEquivalentTo()` now also accepts an anonymous object to include/exclude multiple members at once - [#2488](https://github.com/fluentassertions/fluentassertions/pull/2488) +* You can exclude explicitly implemented properties from `BeEquivalentTo` via `ExcludingExplicitlyImplementedProperties` - [9999](https://github.com/fluentassertions/pull/9999) ### Fixes * Fixed formatting error when checking nullable `DateTimeOffset` with From 0ac7a58bac941bf3e2492e3ea1cb507a0fd305e5 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Fri, 29 Nov 2024 16:40:34 +0100 Subject: [PATCH 456/845] Downgrade `ConfigurationManager` from 6.0.1 to 6.0.0 #2673 bumped from 4.4.0 -> 6.0.1, but 6.0.0 should be enough. As a testing nuget we should pick the lowest possible version of a package to avoid that tests use a newer package than what is used in production. --- Src/FluentAssertions/FluentAssertions.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 4a01810d69..18a03692a7 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -64,7 +64,7 @@ - + From ef0cfbcce5b43e3331c2fb2d436a6f6353023aba Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sat, 30 Nov 2024 22:11:03 +0100 Subject: [PATCH 457/845] Remove unnecessary initialization that may also cause deadlocks. (#2858) --- Src/FluentAssertions/AssertionOptions.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Src/FluentAssertions/AssertionOptions.cs b/Src/FluentAssertions/AssertionOptions.cs index da44d66a09..3aa20c1658 100644 --- a/Src/FluentAssertions/AssertionOptions.cs +++ b/Src/FluentAssertions/AssertionOptions.cs @@ -15,7 +15,6 @@ public static class AssertionOptions static AssertionOptions() { EquivalencyPlan = new EquivalencyPlan(); - Services.EnsureInitialized(); } /// From 30c29b2b4f5e93965bb9437729858cb7d65a5d29 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 1 Dec 2024 15:41:04 +0100 Subject: [PATCH 458/845] Update releases.md --- docs/_pages/releases.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 3c65690c5d..53a197e694 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -105,15 +105,18 @@ sidebar: * Methods overwritten in `GenericAsyncFunctionAssertions` has been moved to `NonGenericAsyncFunctionAssertions`. * Moved the non-generic `NotThrow` and `NotThrowAfter` from `DelegateAssertions` to `ActionAssertions` - [#2371](https://github.com/fluentassertions/fluentassertions/pull/2371) +## 7.0.0 + ### Fixes +* The expectation node identified as a cyclic reference is still compared to the subject node using simple equality - [2819](https://github.com/fluentassertions/fluentassertions/pull/2819) * Fixed a problem in `BeEquivalentTo` where write-only properties would cause a `NullReferenceException` - [#2836](https://github.com/fluentassertions/fluentassertions/pull/2836) -## 6.12.3 - -### Fixes +### Breaking Changes -* The expectation node identified as a cyclic reference is still compared to the subject node using simple equality - [2819](https://github.com/fluentassertions/fluentassertions/pull/2819) +* Dropped direct support for .NET Core 2.x and .NET Core 3.x - [#2302](https://github.com/fluentassertions/fluentassertions/pull/2302) +* Dropped support for `NSpec3` test framework - [#2356](https://github.com/fluentassertions/fluentassertions/pull/2356) +* Raised dependencies on `System.Configuration.ConfigurationManager` to 6.0.0 and `System.Threading.Tasks.Extensions` to 4.5.4 - [#2673](https://github.com/fluentassertions/fluentassertions/pull/2673) and [#2855](https://github.com/fluentassertions/fluentassertions/pull/2855) ## 6.12.2 From c14f48baa8237401bcfab39b885d1c66e8ed046e Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Mon, 2 Dec 2024 20:01:44 +0100 Subject: [PATCH 459/845] Made the equivalency validator core internal (#2854) --- Src/FluentAssertions/Equivalency/EquivalencyValidator.cs | 2 +- .../ApprovedApi/FluentAssertions/net47.verified.txt | 6 ------ .../ApprovedApi/FluentAssertions/net6.0.verified.txt | 6 ------ .../FluentAssertions/netstandard2.0.verified.txt | 6 ------ .../FluentAssertions/netstandard2.1.verified.txt | 6 ------ docs/_pages/releases.md | 3 ++- 6 files changed, 3 insertions(+), 26 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs index 69f56e5e97..e79505f608 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs @@ -7,7 +7,7 @@ namespace FluentAssertions.Equivalency; /// /// Is responsible for validating the equivalency of a subject with another object. /// -public class EquivalencyValidator : IValidateChildNodeEquivalency +internal class EquivalencyValidator : IValidateChildNodeEquivalency { private const int MaxDepth = 10; diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 9ec1b74c6c..7e8e61f6f2 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -713,12 +713,6 @@ namespace FluentAssertions.Equivalency public bool IsCyclicReference(object expectation) { } public override string ToString() { } } - public class EquivalencyValidator : FluentAssertions.Equivalency.IValidateChildNodeEquivalency - { - public EquivalencyValidator() { } - public void AssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.EquivalencyValidationContext context) { } - public void AssertEquivalencyOf(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context) { } - } public delegate string GetSubjectId(); public interface IAssertionContext { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index f3f47adcc7..adee421342 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -726,12 +726,6 @@ namespace FluentAssertions.Equivalency public bool IsCyclicReference(object expectation) { } public override string ToString() { } } - public class EquivalencyValidator : FluentAssertions.Equivalency.IValidateChildNodeEquivalency - { - public EquivalencyValidator() { } - public void AssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.EquivalencyValidationContext context) { } - public void AssertEquivalencyOf(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context) { } - } public delegate string GetSubjectId(); public interface IAssertionContext { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 1cfb1dffd7..aa33e348bc 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -705,12 +705,6 @@ namespace FluentAssertions.Equivalency public bool IsCyclicReference(object expectation) { } public override string ToString() { } } - public class EquivalencyValidator : FluentAssertions.Equivalency.IValidateChildNodeEquivalency - { - public EquivalencyValidator() { } - public void AssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.EquivalencyValidationContext context) { } - public void AssertEquivalencyOf(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context) { } - } public delegate string GetSubjectId(); public interface IAssertionContext { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 1de0d65a5e..8cedc94813 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -713,12 +713,6 @@ namespace FluentAssertions.Equivalency public bool IsCyclicReference(object expectation) { } public override string ToString() { } } - public class EquivalencyValidator : FluentAssertions.Equivalency.IValidateChildNodeEquivalency - { - public EquivalencyValidator() { } - public void AssertEquality(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.EquivalencyValidationContext context) { } - public void AssertEquivalencyOf(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context) { } - } public delegate string GetSubjectId(); public interface IAssertionContext { diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 53a197e694..07b09ebee4 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -41,7 +41,7 @@ sidebar: * All assertions that support chaining using the `.Which` construct will now amend the caller identifier - [2539](https://github.com/fluentassertions/pull/2539) * Introduced a `MethodInfoFormatter` and improved the `PropertyInfoFormatter` - [2539](https://github.com/fluentassertions/pull/2539) * `Excluding()` / `For().Exclude()` and `Including()` on `BeEquivalentTo()` now also accepts an anonymous object to include/exclude multiple members at once - [#2488](https://github.com/fluentassertions/fluentassertions/pull/2488) -* You can exclude explicitly implemented properties from `BeEquivalentTo` via `ExcludingExplicitlyImplementedProperties` - [9999](https://github.com/fluentassertions/pull/9999) +* You can exclude explicitly implemented properties from `BeEquivalentTo` via `ExcludingExplicitlyImplementedProperties` - [2851](https://github.com/fluentassertions/pull/2851) ### Fixes * Fixed formatting error when checking nullable `DateTimeOffset` with @@ -104,6 +104,7 @@ sidebar: * Unused constructors have been removed. * Methods overwritten in `GenericAsyncFunctionAssertions` has been moved to `NonGenericAsyncFunctionAssertions`. * Moved the non-generic `NotThrow` and `NotThrowAfter` from `DelegateAssertions` to `ActionAssertions` - [#2371](https://github.com/fluentassertions/fluentassertions/pull/2371) +* Made `EquivalencyValidator` `internal` - [#2854](https://github.com/fluentassertions/fluentassertions/pull/2854) ## 7.0.0 From 39371f320e9edaf0c864664702f7f0878d719fd7 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Tue, 3 Dec 2024 14:02:27 +0100 Subject: [PATCH 460/845] Bumped Nuke to v9 (#2865) --- Build/Build.cs | 27 +++++++++++++++++---------- Build/CustomNpmTasks.cs | 5 +++-- Build/_build.csproj | 3 ++- global.json | 8 ++++---- 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/Build/Build.cs b/Build/Build.cs index e377fa3187..e1621d5c5b 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -12,6 +12,7 @@ using Nuke.Common.Tools.GitVersion; using Nuke.Common.Tools.ReportGenerator; using Nuke.Common.Tools.Xunit; +using Nuke.Common.Utilities; using Nuke.Common.Utilities.Collections; using Nuke.Components; using static Nuke.Common.Tools.DotNet.DotNetTasks; @@ -120,7 +121,7 @@ class Build : NukeBuild DotNetBuild(s => s .SetProjectFile(Solution) .SetConfiguration(Configuration) - .When(GenerateBinLog is true, c => c + .When(_ => GenerateBinLog is true, c => c .SetBinaryLog(ArtifactsDirectory / $"{Solution.Core.FluentAssertions.Name}.binlog") ) .EnableNoLogo() @@ -298,12 +299,12 @@ from framework in frameworks (settings, v) => settings .SetProjectFile(v.project) .SetFramework(v.framework) - .SetProcessArgumentConfigurator(args => args - .Add("--") - .Add("--coverage") - .Add("--report-trx") - .Add($"--report-trx-filename {v.project.Name}_{v.framework}.trx") - .Add($"--results-directory {TestResultsDirectory}") + .SetProcessAdditionalArguments( + "--", + "--coverage", + "--report-trx", + $"--report-trx-filename {v.project.Name}_{v.framework}.trx", + $"--results-directory {TestResultsDirectory}" ) ) ); @@ -373,9 +374,15 @@ from framework in frameworks NpmFetchRuntime(); - ReportSummary(s => s - .When(HasCachedNodeModules, conf => conf - .AddPair("Skipped", "Downloading and extracting"))); + ReportSummary(conf => + { + if (HasCachedNodeModules) + { + conf.AddPair("Skipped", "Downloading and extracting"); + } + + return conf; + }); }); bool HasDocumentationChanges => Changes.Any(x => IsDocumentation(x)); diff --git a/Build/CustomNpmTasks.cs b/Build/CustomNpmTasks.cs index 9b71d312d3..840bf988ea 100644 --- a/Build/CustomNpmTasks.cs +++ b/Build/CustomNpmTasks.cs @@ -167,9 +167,10 @@ static void LinkTools() static void SetEnvVars() { - NpmEnvironmentVariables = NukeDictionaryExtensions.AsReadOnly(EnvironmentInfo.Variables + NpmEnvironmentVariables = EnvironmentInfo.Variables .ToDictionary(x => x.Key, x => x.Value) - .SetKeyValue("path", WorkingDirectory)); + .SetKeyValue("path", WorkingDirectory) + .AsReadOnly(); } public static void NpmInstall(bool silent = false, string workingDirectory = null) diff --git a/Build/_build.csproj b/Build/_build.csproj index dc49eed481..9f2311fcb6 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -6,7 +6,8 @@ CS0649;CS0169 ..\ ..\ - 8.1.4 + 9.0.2 + 1 OS_WINDOWS diff --git a/global.json b/global.json index 368a14e31c..b829814972 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { - "sdk": { - "version": "8.0.100", - "rollForward": "latestMajor" - } + "sdk": { + "version": "8.0.404", + "rollForward": "latestMajor" + } } From b088f1e624ed335152d32c52b6be8383adc504fb Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Thu, 5 Dec 2024 18:26:55 +0100 Subject: [PATCH 461/845] Renamed `RespectingRuntimeTypes` and `RespectingDeclaredTypes` to better clarify their purpose (#2866) --- .../Equivalency/EquivalencyOptions.cs | 2 +- .../SelfReferenceEquivalencyOptions.cs | 22 ++++++++++++------- .../ObjectAssertionsExtensions.cs | 4 ++-- .../FluentAssertions/net47.verified.txt | 4 ++-- .../FluentAssertions/net6.0.verified.txt | 4 ++-- .../netstandard2.0.verified.txt | 4 ++-- .../netstandard2.1.verified.txt | 4 ++-- .../AssertionRuleSpecs.cs | 6 ++--- .../CollectionSpecs.cs | 6 ++--- .../DictionarySpecs.cs | 10 ++++----- .../NestedPropertiesSpecs.cs | 2 +- .../SelectionRulesSpecs.Basic.cs | 2 +- .../SelectionRulesSpecs.Excluding.cs | 2 +- .../SelectionRulesSpecs.Interfaces.cs | 10 ++++----- .../SelectionRulesSpecs.MemberHiding.cs | 4 ++-- .../SelectionRulesSpecs.cs | 4 ++-- docs/_pages/objectgraphs.md | 8 +++---- docs/_pages/releases.md | 1 + 18 files changed, 53 insertions(+), 46 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs index 1a13929982..47fa0f7e6b 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs @@ -204,6 +204,6 @@ public EquivalencyOptions() IncludingFields(); IncludingProperties(); - RespectingDeclaredTypes(); + PreferringDeclaredMemberTypes(); } } diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index 0f75f84c51..ad897cdd43 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -204,7 +204,7 @@ EqualityStrategy IEquivalencyOptions.GetEqualityStrategy(Type type) /// public TSelf IncludingAllDeclaredProperties() { - RespectingDeclaredTypes(); + PreferringDeclaredMemberTypes(); ExcludingFields(); IncludingProperties(); @@ -222,7 +222,7 @@ public TSelf IncludingAllDeclaredProperties() /// public TSelf IncludingAllRuntimeProperties() { - RespectingRuntimeTypes(); + PreferringRuntimeMemberTypes(); ExcludingFields(); IncludingProperties(); @@ -331,18 +331,24 @@ public TSelf IgnoringNonBrowsableMembersOnSubject() } /// - /// Instructs the comparison to respect the expectation's runtime type. + /// Instructs the structural equality comparison to use the run-time types + /// of the members to drive the assertion. /// - public TSelf RespectingRuntimeTypes() + public TSelf PreferringRuntimeMemberTypes() { useRuntimeTyping = true; return (TSelf)this; } /// - /// Instructs the comparison to respect the expectation's declared type. + /// Instructs the structural equality comparison to prefer the declared types + /// of the members when executing assertions. /// - public TSelf RespectingDeclaredTypes() + /// + /// In reality, the declared types of the members are only known for the members of the root object, + /// or the objects in a root collection. Beyond that, FluentAssertions only knows the run-time types of the members. + /// + public TSelf PreferringDeclaredMemberTypes() { useRuntimeTyping = false; return (TSelf)this; @@ -778,9 +784,9 @@ public override string ToString() { var builder = new StringBuilder(); - builder.Append("- Use ") + builder.Append("- Prefer the ") .Append(useRuntimeTyping ? "runtime" : "declared") - .AppendLine(" types and members"); + .AppendLine(" type of the members"); if (ignoreNonBrowsableOnSubject) { diff --git a/Src/FluentAssertions/ObjectAssertionsExtensions.cs b/Src/FluentAssertions/ObjectAssertionsExtensions.cs index 5f93f280fa..87281fdc78 100644 --- a/Src/FluentAssertions/ObjectAssertionsExtensions.cs +++ b/Src/FluentAssertions/ObjectAssertionsExtensions.cs @@ -59,7 +59,7 @@ public static AndConstraint BeDataContractSerializable(this var deserializedObject = CreateCloneUsingDataContractSerializer(assertions.Subject); EquivalencyOptions defaultOptions = AssertionOptions.CloneDefaults() - .RespectingRuntimeTypes().IncludingFields().IncludingProperties(); + .PreferringRuntimeMemberTypes().IncludingFields().IncludingProperties(); ((T)deserializedObject).Should().BeEquivalentTo((T)assertions.Subject, _ => options(defaultOptions)); } @@ -105,7 +105,7 @@ public static AndConstraint BeXmlSerializable(this ObjectAsser object deserializedObject = CreateCloneUsingXmlSerializer(assertions.Subject); deserializedObject.Should().BeEquivalentTo(assertions.Subject, - options => options.RespectingRuntimeTypes().IncludingFields().IncludingProperties()); + options => options.PreferringRuntimeMemberTypes().IncludingFields().IncludingProperties()); } catch (Exception exc) { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 7e8e61f6f2..e9a9d7633d 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -903,8 +903,8 @@ namespace FluentAssertions.Equivalency public TSelf IncludingInternalProperties() { } public TSelf IncludingNestedObjects() { } public TSelf IncludingProperties() { } - public TSelf RespectingDeclaredTypes() { } - public TSelf RespectingRuntimeTypes() { } + public TSelf PreferringDeclaredMemberTypes() { } + public TSelf PreferringRuntimeMemberTypes() { } public TSelf ThrowingOnMissingMembers() { } public override string ToString() { } public TSelf Using(FluentAssertions.Equivalency.IEquivalencyStep equivalencyStep) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index adee421342..879f1f7aca 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -916,8 +916,8 @@ namespace FluentAssertions.Equivalency public TSelf IncludingInternalProperties() { } public TSelf IncludingNestedObjects() { } public TSelf IncludingProperties() { } - public TSelf RespectingDeclaredTypes() { } - public TSelf RespectingRuntimeTypes() { } + public TSelf PreferringDeclaredMemberTypes() { } + public TSelf PreferringRuntimeMemberTypes() { } public TSelf ThrowingOnMissingMembers() { } public override string ToString() { } public TSelf Using(FluentAssertions.Equivalency.IEquivalencyStep equivalencyStep) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index aa33e348bc..2261b3dd0e 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -895,8 +895,8 @@ namespace FluentAssertions.Equivalency public TSelf IncludingInternalProperties() { } public TSelf IncludingNestedObjects() { } public TSelf IncludingProperties() { } - public TSelf RespectingDeclaredTypes() { } - public TSelf RespectingRuntimeTypes() { } + public TSelf PreferringDeclaredMemberTypes() { } + public TSelf PreferringRuntimeMemberTypes() { } public TSelf ThrowingOnMissingMembers() { } public override string ToString() { } public TSelf Using(FluentAssertions.Equivalency.IEquivalencyStep equivalencyStep) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 8cedc94813..0702e96d54 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -903,8 +903,8 @@ namespace FluentAssertions.Equivalency public TSelf IncludingInternalProperties() { } public TSelf IncludingNestedObjects() { } public TSelf IncludingProperties() { } - public TSelf RespectingDeclaredTypes() { } - public TSelf RespectingRuntimeTypes() { } + public TSelf PreferringDeclaredMemberTypes() { } + public TSelf PreferringRuntimeMemberTypes() { } public TSelf ThrowingOnMissingMembers() { } public override string ToString() { } public TSelf Using(FluentAssertions.Equivalency.IEquivalencyStep equivalencyStep) { } diff --git a/Tests/FluentAssertions.Equivalency.Specs/AssertionRuleSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/AssertionRuleSpecs.cs index 3a17770ceb..4207daa471 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/AssertionRuleSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/AssertionRuleSpecs.cs @@ -238,7 +238,7 @@ public void When_the_runtime_type_does_match_the_equality_comparer_type_it_shoul // Act Action act = () => subject.Should().BeEquivalentTo(expectation, opt => opt - .RespectingRuntimeTypes() + .PreferringRuntimeMemberTypes() .Using()); // Assert @@ -289,7 +289,7 @@ public void An_equality_comparer_of_non_nullable_type_is_invoked_on_non_nullable // Act subject.Should().BeEquivalentTo(expectation, opt => opt - .RespectingRuntimeTypes() + .PreferringRuntimeMemberTypes() .Using(new DateTimeByYearComparer())); } @@ -303,7 +303,7 @@ public void An_equality_comparer_of_nullable_type_is_not_invoked_on_non_nullable // Act Action act = () => subject.Should().BeEquivalentTo(expectation, opt => opt - .RespectingRuntimeTypes() + .PreferringRuntimeMemberTypes() .Using(new NullableDateTimeByYearComparer())); // Assert diff --git a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs index 2daadc159f..e3bc183c9b 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs @@ -1099,7 +1099,7 @@ public void // Act Action act = - () => collection1.Should().BeEquivalentTo(collection2, opts => opts.RespectingRuntimeTypes()); + () => collection1.Should().BeEquivalentTo(collection2, opts => opts.PreferringRuntimeMemberTypes()); // Assert act.Should().Throw("the runtime type is assignable to two IEnumerable interfaces") @@ -1131,7 +1131,7 @@ public void // Act Action act = - () => collection1.Should().BeEquivalentTo(collection2, opts => opts.RespectingRuntimeTypes()); + () => collection1.Should().BeEquivalentTo(collection2, opts => opts.PreferringRuntimeMemberTypes()); // Assert act.Should().Throw("the items have different runtime types"); @@ -1614,7 +1614,7 @@ public void Action act = () => collection1.Should().BeEquivalentTo(collection2, - opts => opts.RespectingRuntimeTypes()); + opts => opts.PreferringRuntimeMemberTypes()); // Assert act.Should().Throw("the types have different properties"); diff --git a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs index 8153e5090c..2f6cd3688b 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs @@ -471,7 +471,7 @@ public void object object2 = new Dictionary { ["greeting"] = "hello" }; // Act - Action act = () => object1.Should().BeEquivalentTo(object2, opts => opts.RespectingRuntimeTypes()); + Action act = () => object1.Should().BeEquivalentTo(object2, opts => opts.PreferringRuntimeMemberTypes()); // Assert act.Should().NotThrow("the runtime type is a dictionary and the dictionaries are equivalent"); @@ -500,7 +500,7 @@ public void object object2 = new NonGenericDictionary { ["greeting"] = "hello" }; // Act - Action act = () => object1.Should().BeEquivalentTo(object2, opts => opts.RespectingRuntimeTypes()); + Action act = () => object1.Should().BeEquivalentTo(object2, opts => opts.PreferringRuntimeMemberTypes()); // Assert act.Should().NotThrow("the runtime type is a dictionary and the dictionaries are equivalent"); @@ -516,7 +516,7 @@ public void var traceWriter = new StringBuilderTraceWriter(); // Act - object1.Should().BeEquivalentTo(object2, opts => opts.RespectingRuntimeTypes().WithTracing(traceWriter)); + object1.Should().BeEquivalentTo(object2, opts => opts.PreferringRuntimeMemberTypes().WithTracing(traceWriter)); // Assert string trace = traceWriter.ToString(); @@ -564,7 +564,7 @@ public void Action act = () => dictionary1.Should().BeEquivalentTo(dictionary2, - opts => opts.RespectingRuntimeTypes()); + opts => opts.PreferringRuntimeMemberTypes()); // Assert act.Should().Throw("the types have different properties"); @@ -634,7 +634,7 @@ public void Action act = () => actual.Should().BeEquivalentTo(expectation, opts => opts - .RespectingRuntimeTypes() + .PreferringRuntimeMemberTypes() .ComparingByMembers() ); diff --git a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs index a193fc1d42..d9246bb008 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs @@ -118,7 +118,7 @@ public void When_not_all_the_properties_of_the_nested_objects_are_equal_it_shoul .Should().Match( @"Expected property subject.Level.Text to be ""Level2"", but ""Level1"" differs near ""1"" (index 5).*" + "With configuration:*" + - "- Use declared types and members*" + + "- Prefer the declared type of the members*" + "- Compare enums by value*" + "- Compare tuples by their properties*" + "- Compare anonymous types by their properties*" + diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs index ea52aacc04..bcea272ff6 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs @@ -259,7 +259,7 @@ public void Respecting_the_runtime_type_includes_both_properties_and_fields_incl // Act Action act = - () => class1.Should().BeEquivalentTo(class2, opts => opts.RespectingRuntimeTypes()); + () => class1.Should().BeEquivalentTo(class2, opts => opts.PreferringRuntimeMemberTypes()); // Assert act.Should().Throw().Which.Message.Should().Contain("Field1").And.Contain("Property1"); diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs index 206dbf1e78..3413bcf743 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs @@ -640,7 +640,7 @@ public void // Act Action act = - () => class1.Should().BeEquivalentTo(class2, opts => opts.ExcludingProperties().RespectingRuntimeTypes()); + () => class1.Should().BeEquivalentTo(class2, opts => opts.ExcludingProperties().PreferringRuntimeMemberTypes()); // Assert act.Should().NotThrow(); diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs index afb4f9f1a4..93e294f79b 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Interfaces.cs @@ -206,7 +206,7 @@ public void When_respecting_declared_types_explicit_interface_member_on_interfac }; // Act - Action action = () => subject.Should().BeEquivalentTo(expected, opt => opt.RespectingDeclaredTypes()); + Action action = () => subject.Should().BeEquivalentTo(expected, opt => opt.PreferringDeclaredMemberTypes()); // Assert action.Should().NotThrow(); @@ -229,7 +229,7 @@ public void When_respecting_runtime_types_explicit_interface_member_on_interface subject.VehicleId = 1; // interface member // Act - Action action = () => subject.Should().BeEquivalentTo(expected, opt => opt.RespectingRuntimeTypes()); + Action action = () => subject.Should().BeEquivalentTo(expected, opt => opt.PreferringRuntimeMemberTypes()); // Assert action.Should().Throw(); @@ -252,7 +252,7 @@ public void When_respecting_runtime_types_explicit_interface_member_on_interface }; // Act - Action action = () => subject.Should().BeEquivalentTo(expected, opt => opt.RespectingRuntimeTypes()); + Action action = () => subject.Should().BeEquivalentTo(expected, opt => opt.PreferringRuntimeMemberTypes()); // Assert action.Should().Throw(); @@ -352,7 +352,7 @@ public void Excluding_an_interface_property_through_inheritance_should_work() // Act / Assert actual.Should().BeEquivalentTo(expected, options => options .Excluding(a => a.Value1) - .RespectingRuntimeTypes()); + .PreferringRuntimeMemberTypes()); } [Fact] @@ -380,7 +380,7 @@ public void Including_an_interface_property_through_inheritance_should_work() // Act / Assert actual.Should().BeEquivalentTo(expected, options => options .Including(a => a.Value2) - .RespectingRuntimeTypes()); + .PreferringRuntimeMemberTypes()); } public interface IInterfaceWithTwoProperties diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.MemberHiding.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.MemberHiding.cs index 04dcb44071..d5f2e92317 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.MemberHiding.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.MemberHiding.cs @@ -96,7 +96,7 @@ public void Run_type_typing_ignores_hidden_properties_even_when_using_a_referenc expectation.Property = "ExpectedBaseValue"; // Act / Assert - subject.Should().BeEquivalentTo(expectation, o => o.RespectingRuntimeTypes()); + subject.Should().BeEquivalentTo(expectation, o => o.PreferringRuntimeMemberTypes()); } [Fact] @@ -247,7 +247,7 @@ public void Run_type_typing_ignores_hidden_fields_even_when_using_a_reference_to expectation.Field = "ExpectedBaseValue"; // Act / Assert - subject.Should().BeEquivalentTo(expectation, options => options.IncludingFields().RespectingRuntimeTypes()); + subject.Should().BeEquivalentTo(expectation, options => options.IncludingFields().PreferringRuntimeMemberTypes()); } [Fact] diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs index 7e31ed3481..d7e8a097ff 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs @@ -43,8 +43,8 @@ public void Public_methods_follow_fluent_syntax() .IncludingInternalProperties() .IncludingNestedObjects() .IncludingProperties() - .RespectingDeclaredTypes() - .RespectingRuntimeTypes() + .PreferringDeclaredMemberTypes() + .PreferringRuntimeMemberTypes() .ThrowingOnMissingMembers() .Using(new ExtensibilitySpecs.DoEquivalencyStep(() => { })) .Using(new MustMatchByNameRule()) diff --git a/docs/_pages/objectgraphs.md b/docs/_pages/objectgraphs.md index 3d5dd92a7e..bedf643e1f 100644 --- a/docs/_pages/objectgraphs.md +++ b/docs/_pages/objectgraphs.md @@ -83,13 +83,13 @@ This behavior can be configured and you can choose to use run-time types if you ```csharp Dto orderDto = new OrderDto(); -// Use runtime type information of orderDto +// Use the runtime type of the members of orderDto orderDto.Should().BeEquivalentTo(order, options => - options.RespectingRuntimeTypes()); + options.PreferringRuntimeMemberTypes()); -// Use declared type information of orderDto +// Use the declared type information of the members of orderDto orderDto.Should().BeEquivalentTo(order, options => - options.RespectingDeclaredTypes()); + options.PreferringDeclaredMemberTypes()); ``` One exception to this rule is when the declared type is `object`. diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 07b09ebee4..e2095ff57d 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -96,6 +96,7 @@ sidebar: * Removed `utcNow` overload for `.Monitor()` - [#2629](https://github.com/fluentassertions/fluentassertions/pull/2629) * The semantics of `BeLowerCased`/`BeUpperCased` have been changed to align with the behavior of `ToLower`/`ToUpper` - [#2660](https://github.com/fluentassertions/fluentassertions/pull/2660) * Renamed `HaveAttribute` to `HaveAttributeWithValue` on `XElement` - [#2690](https://github.com/fluentassertions/fluentassertions/pull/2690) +* Renamed `RespectingRuntimeTypes` to `PreferringRuntimeMemberTypes` and `RespectingDeclaredTypes` to `PreferringDeclaredMemberTypes` - [#2866](https://github.com/fluentassertions/fluentassertions/pull/2866) ### Breaking Changes (for extensions) * Add `ForConstraint` to `IAssertionsScope` to support chaining `.ForConstraint()` after `.Then` - [#2324](https://github.com/fluentassertions/fluentassertions/pull/2324) From 77ea588c1465754cb1d3ed49c13a2691ed5217ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:11:43 +0100 Subject: [PATCH 462/845] Bump the nuke group with 2 updates (#2871) Bumps the nuke group with 2 updates: [Nuke.Common](https://github.com/nuke-build/nuke) and [Nuke.Components](https://github.com/nuke-build/nuke). Updates `Nuke.Common` from 9.0.2 to 9.0.3 - [Release notes](https://github.com/nuke-build/nuke/releases) - [Changelog](https://github.com/nuke-build/nuke/blob/develop/CHANGELOG.md) - [Commits](https://github.com/nuke-build/nuke/compare/9.0.2...9.0.3) Updates `Nuke.Components` from 9.0.2 to 9.0.3 - [Release notes](https://github.com/nuke-build/nuke/releases) - [Changelog](https://github.com/nuke-build/nuke/blob/develop/CHANGELOG.md) - [Commits](https://github.com/nuke-build/nuke/compare/9.0.2...9.0.3) --- updated-dependencies: - dependency-name: Nuke.Common dependency-type: direct:production update-type: version-update:semver-patch dependency-group: nuke - dependency-name: Nuke.Components dependency-type: direct:production update-type: version-update:semver-patch dependency-group: nuke ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 9f2311fcb6..694af57e9e 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -6,7 +6,7 @@ CS0649;CS0169 ..\ ..\ - 9.0.2 + 9.0.3 1 From 3eb61bc55573b124b003c5a52ae5b42e5c7a4f9b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:12:11 +0100 Subject: [PATCH 463/845] Bump Microsoft.Testing.Extensions.CodeCoverage from 17.12.6 to 17.13.1 (#2873) Bumps [Microsoft.Testing.Extensions.CodeCoverage](https://github.com/microsoft/codecoverage) from 17.12.6 to 17.13.1. - [Commits](https://github.com/microsoft/codecoverage/commits) --- updated-dependencies: - dependency-name: Microsoft.Testing.Extensions.CodeCoverage dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 67fa7545fa..af8fd8c373 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -13,7 +13,7 @@ - + From 5125709215e2e77ae3294b4d6ea53a0c7b54edb5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:12:46 +0100 Subject: [PATCH 464/845] Bump System.Collections.Immutable and System.Reflection.Metadata (#2872) Bumps [System.Collections.Immutable](https://github.com/dotnet/runtime) and [System.Reflection.Metadata](https://github.com/dotnet/runtime). These dependencies needed to be updated together. Updates `System.Collections.Immutable` from 1.5.0 to 9.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v9.0.0) Updates `System.Reflection.Metadata` from 8.0.0 to 9.0.0 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/compare/v8.0.0...v9.0.0) --- updated-dependencies: - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major - dependency-name: System.Reflection.Metadata dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Benchmarks/Benchmarks.csproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index 302951fc31..a8936ebd3e 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -12,7 +12,7 @@ - + diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index c1d4217282..bbeba7f560 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -17,7 +17,7 @@ FluentAssertions.Specs.csproj for net47 does not generate a binding redirect from 4.0.4.0 to 4.0.4.1 Upgrading to 1.6.0 gives "Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0" --> - + diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 3be852702e..7b86481f4d 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -17,7 +17,7 @@ FluentAssertions.Specs.csproj for net47 does not generate a binding redirect from 4.0.4.0 to 4.0.4.1 Upgrading to 1.6.0 gives "Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0" --> - + From d37bc7f68f595e7d2ddf716389c732e670698f23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:13:10 +0100 Subject: [PATCH 465/845] Bump the mstest group with 2 updates (#2870) Bumps the mstest group with 2 updates: [MSTest.TestAdapter](https://github.com/microsoft/testfx) and [MSTest.TestFramework](https://github.com/microsoft/testfx). Updates `MSTest.TestAdapter` from 3.6.3 to 3.6.4 - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](https://github.com/microsoft/testfx/compare/v3.6.3...v3.6.4) Updates `MSTest.TestFramework` from 3.6.3 to 3.6.4 - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](https://github.com/microsoft/testfx/compare/v3.6.3...v3.6.4) --- updated-dependencies: - dependency-name: MSTest.TestAdapter dependency-type: direct:production update-type: version-update:semver-patch dependency-group: mstest - dependency-name: MSTest.TestFramework dependency-type: direct:production update-type: version-update:semver-patch dependency-group: mstest ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 4e3f45bb9b..518a2a535b 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + From 77e30c728f15e0dd06cb043967893276a4d0fc7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:14:31 +0100 Subject: [PATCH 466/845] Bump cspell from 8.16.0 to 8.16.1 (#2868) Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.16.0 to 8.16.1. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.16.1/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 250 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 126 insertions(+), 126 deletions(-) diff --git a/package-lock.json b/package-lock.json index d16bddd998..f3e0a81bb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,20 +7,20 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.16.0" + "cspell": "^8.16.1" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.16.0.tgz", - "integrity": "sha512-R0Eqq5kTZnmZ0elih5uY3TWjMqqAeMl7ciU7maUs+m1FNjCEdJXtJ9wrQxNgjmXi0tX8cvahZRO3O558tEz/KA==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.16.1.tgz", + "integrity": "sha512-EkbtoYpmiN9YPfcOoPcMnIrJBZh13mun64jPyyaYhrPPToiU5+CisZ7ZKUBGnqNaatuciMUxwIudhanQJ7Yhnw==", "dependencies": { "@cspell/dict-ada": "^4.0.5", "@cspell/dict-al": "^1.0.3", "@cspell/dict-aws": "^4.0.7", "@cspell/dict-bash": "^4.1.8", "@cspell/dict-companies": "^3.1.7", - "@cspell/dict-cpp": "^6.0.1", + "@cspell/dict-cpp": "^6.0.2", "@cspell/dict-cryptocurrencies": "^5.0.3", "@cspell/dict-csharp": "^4.0.5", "@cspell/dict-css": "^4.0.16", @@ -29,7 +29,7 @@ "@cspell/dict-docker": "^1.1.11", "@cspell/dict-dotnet": "^5.0.8", "@cspell/dict-elixir": "^4.0.6", - "@cspell/dict-en_us": "^4.3.26", + "@cspell/dict-en_us": "^4.3.28", "@cspell/dict-en-common-misspellings": "^2.0.7", "@cspell/dict-en-gb": "1.1.33", "@cspell/dict-filetypes": "^3.0.8", @@ -39,7 +39,7 @@ "@cspell/dict-fullstack": "^3.2.3", "@cspell/dict-gaming-terms": "^1.0.8", "@cspell/dict-git": "^3.0.3", - "@cspell/dict-golang": "^6.0.16", + "@cspell/dict-golang": "^6.0.17", "@cspell/dict-google": "^1.0.4", "@cspell/dict-haskell": "^4.0.4", "@cspell/dict-html": "^4.0.10", @@ -54,16 +54,16 @@ "@cspell/dict-markdown": "^2.0.7", "@cspell/dict-monkeyc": "^1.0.9", "@cspell/dict-node": "^5.0.5", - "@cspell/dict-npm": "^5.1.11", + "@cspell/dict-npm": "^5.1.14", "@cspell/dict-php": "^4.0.13", "@cspell/dict-powershell": "^5.0.13", "@cspell/dict-public-licenses": "^2.0.11", "@cspell/dict-python": "^4.2.12", "@cspell/dict-r": "^2.0.4", "@cspell/dict-ruby": "^5.0.7", - "@cspell/dict-rust": "^4.0.9", + "@cspell/dict-rust": "^4.0.10", "@cspell/dict-scala": "^5.0.6", - "@cspell/dict-software-terms": "^4.1.13", + "@cspell/dict-software-terms": "^4.1.17", "@cspell/dict-sql": "^2.1.8", "@cspell/dict-svelte": "^1.0.5", "@cspell/dict-swift": "^2.0.4", @@ -76,28 +76,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.16.0.tgz", - "integrity": "sha512-KLjPK94gA3JNuWy70LeenJ6EL3SFk2ejERKYJ6SVV/cVOKIvVd2qe42yX3/A/DkF2xzuZ2LD4z0sfoqQL1BaqA==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.16.1.tgz", + "integrity": "sha512-ue1paJ2OE2BjIBQHXFMHnFqJL5xMrE/TLveOntDSCKJw7edCGP4XJA6Q0ZfUgR/ZAP3SYKNPkajEWbDTMfG+XA==", "dependencies": { - "@cspell/cspell-types": "8.16.0" + "@cspell/cspell-types": "8.16.1" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.16.0.tgz", - "integrity": "sha512-WoCgrv/mrtwCY4lhc6vEcqN3AQ7lT6K0NW5ShoSo116U2tRaW0unApIYH4Va8u7T9g3wyspFEceQRR1xD9qb9w==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.16.1.tgz", + "integrity": "sha512-6N+QZ3y65JRgGrQhZHmaBHESR+nC0J8nySGaYKclit8yk3jLZ/ORw9aoSGIj+dMPzImkNEDh+C1B1zdV4X8W6A==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.16.0.tgz", - "integrity": "sha512-b+99bph43ptkXlQHgPXSkN/jK6LQHy2zL1Fm9up7+x6Yr64bxAzWzoeqJAPtnrPvFuOrFN0jZasZzKBw8CvrrQ==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.16.1.tgz", + "integrity": "sha512-CfVI2JFMwh9/n1QuU9niEONbYCX1XGKqmyCcHQUzAapSqGzbAmFrRFnvyKwNL+mmy1bxli9EZV8f5vBco26f9Q==", "dependencies": { "global-directory": "^4.0.1" }, @@ -106,17 +106,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.16.0.tgz", - "integrity": "sha512-+fn763JKA4EYCOv+1VShFq015UMEBAFRDr+rlCnesgLE0fv9TSFVLsjOfh9/g6GuGQLCRLUqKztwwuueeErstQ==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.16.1.tgz", + "integrity": "sha512-URaralJKcdHZH/Lr25L28GJo2Ub07adHPPhOL83BvmPyGkboehmz5arjNrgQFwS+IvGjHLdp5uzEJd0xyeHGdw==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.16.0.tgz", - "integrity": "sha512-bGrIK7p4NVsK+QX/CYWmjax+FkzfSIZaIaoiBESGV5gmwgXDVRMJ3IP6tQVAmTtckOYHCmtT5CZgI8zXWr8dHQ==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.16.1.tgz", + "integrity": "sha512-B8bHlBaDSMDMEq++H8qO9osKUkzWUrP4CgWQyRqlXZ9EOdnJ469Tp1wghcQ7DezII3aXYrHiVKsUYY9VvjkhIg==", "engines": { "node": ">=18" } @@ -197,9 +197,9 @@ "integrity": "sha512-TfqSTxMHZ2jhiqnXlVKM0bUADtCvwKQv2XZL/DI0rx3doG8mEMS8SGPOmiyyGkHpR/pGOq18AFH3BEm4lViHIw==" }, "node_modules/@cspell/dict-en_us": { - "version": "4.3.27", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.27.tgz", - "integrity": "sha512-7JYHahRWpi0VykWFTSM03KL/0fs6YtYfpOaTAg4N/d0wB2GfwVG/FJ/SBCjD4LBc6Rx9dzdo95Hs4BB8GPQbOA==" + "version": "4.3.28", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.28.tgz", + "integrity": "sha512-BN1PME7cOl7DXRQJ92pEd1f0Xk5sqjcDfThDGkKcsgwbSOY7KnTc/czBW6Pr3WXIchIm6cT12KEfjNqx7U7Rrw==" }, "node_modules/@cspell/dict-en-common-misspellings": { "version": "2.0.7", @@ -247,9 +247,9 @@ "integrity": "sha512-LSxB+psZ0qoj83GkyjeEH/ZViyVsGEF/A6BAo8Nqc0w0HjD2qX/QR4sfA6JHUgQ3Yi/ccxdK7xNIo67L2ScW5A==" }, "node_modules/@cspell/dict-golang": { - "version": "6.0.16", - "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.16.tgz", - "integrity": "sha512-hZOBlgcguv2Hdc93n2zjdAQm1j3grsN9T9WhPnQ1wh2vUDoCLEujg+6gWhjcLb8ECOcwZTWgNyQLWeOxEsAj/w==" + "version": "6.0.17", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.17.tgz", + "integrity": "sha512-uDDLEJ/cHdLiqPw4+5BnmIo2i/TSR+uDvYd6JlBjTmjBKpOCyvUgYRztH7nv5e7virsN5WDiUWah4/ATQGz4Pw==" }, "node_modules/@cspell/dict-google": { "version": "1.0.4", @@ -328,9 +328,9 @@ "integrity": "sha512-7NbCS2E8ZZRZwlLrh2sA0vAk9n1kcTUiRp/Nia8YvKaItGXLfxYqD2rMQ3HpB1kEutal6hQLVic3N2Yi1X7AaA==" }, "node_modules/@cspell/dict-npm": { - "version": "5.1.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.11.tgz", - "integrity": "sha512-5ricJyVMw5TmqR0NfsZS8jEJu1+DLzyUXyjpVFnffPuEtz9jF2XswLK0swZqc9uwWrz0M7IhGVCnmq90srVZCA==" + "version": "5.1.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.15.tgz", + "integrity": "sha512-95D3A8rs9SYlUQUkK48J0F1W3jOsc63dY/vlzuNHE4nuGU2OM4jtoWvLk0ovhBMHwZikaNNTHaHoJyr+VKu+Yg==" }, "node_modules/@cspell/dict-php": { "version": "4.0.13", @@ -348,9 +348,9 @@ "integrity": "sha512-rR5KjRUSnVKdfs5G+gJ4oIvQvm8+NJ6cHWY2N+GE69/FSGWDOPHxulCzeGnQU/c6WWZMSimG9o49i9r//lUQyA==" }, "node_modules/@cspell/dict-python": { - "version": "4.2.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.12.tgz", - "integrity": "sha512-U25eOFu+RE0aEcF2AsxZmq3Lic7y9zspJ9SzjrC0mfJz+yr3YmSCw4E0blMD3mZoNcf7H/vMshuKIY5AY36U+Q==", + "version": "4.2.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.13.tgz", + "integrity": "sha512-mZIcmo9qif8LkJ6N/lqTZawcOk2kVTcuWIUOSbMcjyomO0XZ7iWz15TfONyr03Ea/l7o5ULV+MZ4vx76bAUb7w==", "dependencies": { "@cspell/dict-data-science": "^2.0.5" } @@ -366,9 +366,9 @@ "integrity": "sha512-4/d0hcoPzi5Alk0FmcyqlzFW9lQnZh9j07MJzPcyVO62nYJJAGKaPZL2o4qHeCS/od/ctJC5AHRdoUm0ktsw6Q==" }, "node_modules/@cspell/dict-rust": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.9.tgz", - "integrity": "sha512-Dhr6TIZsMV92xcikKIWei6p/qswS4M+gTkivpWwz4/1oaVk2nRrxJmCdRoVkJlZkkAc17rjxrS12mpnJZI0iWw==" + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.10.tgz", + "integrity": "sha512-6o5C8566VGTTctgcwfF3Iy7314W0oMlFFSQOadQ0OEdJ9Z9ERX/PDimrzP3LGuOrvhtEFoK8pj+BLnunNwRNrw==" }, "node_modules/@cspell/dict-scala": { "version": "5.0.6", @@ -376,9 +376,9 @@ "integrity": "sha512-tl0YWAfjUVb4LyyE4JIMVE8DlLzb1ecHRmIWc4eT6nkyDqQgHKzdHsnusxFEFMVLIQomgSg0Zz6hJ5S1E4W4ww==" }, "node_modules/@cspell/dict-software-terms": { - "version": "4.1.14", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.14.tgz", - "integrity": "sha512-p3oZQSQTgdu3UjZ5aaEeU5aKRD00j/oZzt51ohbhhJ94UYECi8te8SfcA45UbGkylSSGcAtJWkuwjCLMiKAgyQ==" + "version": "4.1.18", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.18.tgz", + "integrity": "sha512-QhOQ3qVFr2Y+uDw2SH15klVNU2S07ecFhG+2gpTO/K4Kuaui3INbVrzHOKW41ofP3ghv9y2TkUUtOP5KfddP8A==" }, "node_modules/@cspell/dict-sql": { "version": "2.1.8", @@ -411,9 +411,9 @@ "integrity": "sha512-akmYbrgAGumqk1xXALtDJcEcOMYBYMnkjpmGzH13Ozhq1mkPF4VgllFQlm1xYde+BUKNnzMgPEzxrL2qZllgYA==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.16.0.tgz", - "integrity": "sha512-FH+B5y71qfunagXiLSJhXP9h/Vwb1Z8Cc/hLmliGekw/Y8BuYknL86tMg9grXBYNmM0kifIv6ZesQl8Km/p/rA==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.16.1.tgz", + "integrity": "sha512-mEfdeS1kFKpJoDsQ8wW6PxO3+ncYuZCWCASR0trbzZDduzO2RcogMUgzP99obHtYbgXadw94qcQWXB8OYTPSwg==", "dependencies": { "import-meta-resolve": "^4.1.0" }, @@ -422,25 +422,25 @@ } }, "node_modules/@cspell/filetypes": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.16.0.tgz", - "integrity": "sha512-u2Ub0uSwXFPJFvXhAO/0FZBj3sMr4CeYCiQwTUsdFRkRMFpbTc7Vf+a+aC2vIj6WcaWrYXrJy3NZF/yjqF6SGw==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.16.1.tgz", + "integrity": "sha512-zpbNg3n26muR1jdMbylw5YsaVGyS9LU5Lfy20gU7RygAk6kFyx3Yz4C84EihBGQHy2gVEsEeyCCxk+R8RXuPZA==", "engines": { "node": ">=18" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.16.0.tgz", - "integrity": "sha512-R6N12wEIQpBk2uyni/FU1SFSIjP0uql7ynXVcF1ob8/JJeRoikssydi9Xq5J6ghMw+X50u35mFvg9BgWKz0d+g==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.16.1.tgz", + "integrity": "sha512-jJQS05wg2iUkLKnPR8NEq3LqvqHWKnvUDFoPwaJzYw6ol/O4yi/lv+Me9+XCPrgjpnAz+8APhWkhrR/O71R1Bw==", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.16.0.tgz", - "integrity": "sha512-zW+6hAieD/FjysfjY4mVv7iHWWasBP3ldj6L+xy2p4Kuax1nug7uuJqMHlAVude/OywNwENG0rYaP/P9Pg4O+w==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.16.1.tgz", + "integrity": "sha512-kGlr7Wdo4xJpXKal/Gqo3Ll5Is7ptlIlLZOB/hzR6R53Fw4N6SdipTDIeHHqC15p2AXTEG6TSNdhk9dA50LY6w==", "engines": { "node": ">=18.0" } @@ -540,23 +540,23 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cspell": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.16.0.tgz", - "integrity": "sha512-U6Up/4nODE+Ca+zqwZXTgBioGuF2JQHLEUIuoRJkJzAZkIBYDqrMXM+zdSL9E39+xb9jAtr9kPAYJf1Eybgi9g==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.16.1.tgz", + "integrity": "sha512-ILuCjnY3JPY2oO62PodTQD6n3DGTKTwB+IU1tE9EC6EP2Xw6z3Ir+hO2DO6QlRUmZlGrkGMek5U06nNmztt4eA==", "dependencies": { - "@cspell/cspell-json-reporter": "8.16.0", - "@cspell/cspell-pipe": "8.16.0", - "@cspell/cspell-types": "8.16.0", - "@cspell/dynamic-import": "8.16.0", - "@cspell/url": "8.16.0", + "@cspell/cspell-json-reporter": "8.16.1", + "@cspell/cspell-pipe": "8.16.1", + "@cspell/cspell-types": "8.16.1", + "@cspell/dynamic-import": "8.16.1", + "@cspell/url": "8.16.1", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-dictionary": "8.16.0", - "cspell-gitignore": "8.16.0", - "cspell-glob": "8.16.0", - "cspell-io": "8.16.0", - "cspell-lib": "8.16.0", + "cspell-dictionary": "8.16.1", + "cspell-gitignore": "8.16.1", + "cspell-glob": "8.16.1", + "cspell-io": "8.16.1", + "cspell-lib": "8.16.1", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "get-stdin": "^9.0.0", @@ -575,26 +575,26 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.16.0.tgz", - "integrity": "sha512-PGT6ohLtIYXYLIm+R5hTcTrF0dzj8e7WAUJSJe5WlV/7lrwVdwgWaliLcXtSSPmfxgczr6sndX9TMJ2IEmPrmg==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.16.1.tgz", + "integrity": "sha512-ohbSi9sI14rMdFc2g17ogObGGkd/x6zUVOzCH1nEOefC9yJYYfsvaMHqdhk0rOjvmF95j5OK4dm5oid+DKQcpw==", "dependencies": { - "@cspell/cspell-types": "8.16.0", + "@cspell/cspell-types": "8.16.1", "comment-json": "^4.2.5", - "yaml": "^2.6.0" + "yaml": "^2.6.1" }, "engines": { "node": ">=18" } }, "node_modules/cspell-dictionary": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.16.0.tgz", - "integrity": "sha512-Y3sN6ttLBKbu0dOLcduY641n5QP1srUvZkW4bOTnG455DbIZfilrP1El/2Hl0RS6hC8LN9PM4bsIm/2xgdbApA==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.16.1.tgz", + "integrity": "sha512-NL/vwf5SjtkWWaEUh+0dogKdEU4UuepJaNh36FX8W1CFtQXj7yEs45x4K7/Fp+pn/4AT7Qe7WpSSWi9z5GcqKg==", "dependencies": { - "@cspell/cspell-pipe": "8.16.0", - "@cspell/cspell-types": "8.16.0", - "cspell-trie-lib": "8.16.0", + "@cspell/cspell-pipe": "8.16.1", + "@cspell/cspell-types": "8.16.1", + "cspell-trie-lib": "8.16.1", "fast-equals": "^5.0.1" }, "engines": { @@ -602,13 +602,13 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.16.0.tgz", - "integrity": "sha512-ODKe0ooyzYSBJkwgIVZSRIvzoZfT4tEbFt4fFDT88wPyyfX7xp7MAQhXy5KD1ocXH0WvYbdv37qzn2UbckrahA==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.16.1.tgz", + "integrity": "sha512-Gg8qvFc8wr1D7TvB+GSfT1jyrUoUmPiG3WdOnQnxOSYKJesOiVvNxLv7YXRFkcUKG1VU6XDUkpb/uzKh3k2rKw==", "dependencies": { - "@cspell/url": "8.16.0", - "cspell-glob": "8.16.0", - "cspell-io": "8.16.0", + "@cspell/url": "8.16.1", + "cspell-glob": "8.16.1", + "cspell-io": "8.16.1", "find-up-simple": "^1.0.0" }, "bin": { @@ -619,11 +619,11 @@ } }, "node_modules/cspell-glob": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.16.0.tgz", - "integrity": "sha512-xJSXRHwfENCNFmjpVSEucXY8E3BrpSCA+TukmOYtLyaMKtn6EAwoCpEU7Oj2tZOjdivprPmQ74k4Dqb1RHjIVQ==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.16.1.tgz", + "integrity": "sha512-EukaXFaUrgrY9G4bB2PguzpkAoOq6ai9acLl6gWD+6DgVEwkLqPmCWjsFJA0MaqVp9QvPsIfCy4KCnx35csG/g==", "dependencies": { - "@cspell/url": "8.16.0", + "@cspell/url": "8.16.1", "micromatch": "^4.0.8" }, "engines": { @@ -631,12 +631,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.16.0.tgz", - "integrity": "sha512-vvbJEkBqXocGH/H975RtkfMzVpNxNGMd0JCDd+NjbpeRyZceuChFw5Tie7kHteFY29SwZovub+Am3F4H1kmf9A==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.16.1.tgz", + "integrity": "sha512-7IRYa0O1xfK2HVbhGSpOPPt5HlP2ZHRHtdLU2iOvMSCkh0cSPERu++kdprvcaOf7E7koo0P+bxHSprcYbU/agg==", "dependencies": { - "@cspell/cspell-pipe": "8.16.0", - "@cspell/cspell-types": "8.16.0" + "@cspell/cspell-pipe": "8.16.1", + "@cspell/cspell-types": "8.16.1" }, "bin": { "cspell-grammar": "bin.mjs" @@ -646,38 +646,38 @@ } }, "node_modules/cspell-io": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.16.0.tgz", - "integrity": "sha512-WIK5uhPMjGsTAzm2/fGRbIdr7zWsMVG1fn8wNJYUiYELuyvzvLelfI1VG6szaFCGYqd6Uvgb/fS0uNbwGqCLAQ==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.16.1.tgz", + "integrity": "sha512-25MOQfy7EhdVeoNUW/+jyb5ArDYSLbaFwVToakHtLGuYk9cW8q8MAHq1W9GzW06wXswT2sQsRvaozmIOTDIOnw==", "dependencies": { - "@cspell/cspell-service-bus": "8.16.0", - "@cspell/url": "8.16.0" + "@cspell/cspell-service-bus": "8.16.1", + "@cspell/url": "8.16.1" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.16.0.tgz", - "integrity": "sha512-fU8CfECyuhT12COIi4ViQu2bTkdqaa+05YSd2ZV8k8NA7lapPaMFnlooxdfcwwgZJfHeMhRVMzvQF1OhWmwGfA==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.16.1.tgz", + "integrity": "sha512-Gn1vJcyhYe78iB+9dms8rnfgDEfJgYocXapFPTOcZV3EUWKcV4wyCiHdbK3j2ElLXmPuSPg4eZSlxxk8ITD0Aw==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.16.0", - "@cspell/cspell-pipe": "8.16.0", - "@cspell/cspell-resolver": "8.16.0", - "@cspell/cspell-types": "8.16.0", - "@cspell/dynamic-import": "8.16.0", - "@cspell/filetypes": "8.16.0", - "@cspell/strong-weak-map": "8.16.0", - "@cspell/url": "8.16.0", + "@cspell/cspell-bundled-dicts": "8.16.1", + "@cspell/cspell-pipe": "8.16.1", + "@cspell/cspell-resolver": "8.16.1", + "@cspell/cspell-types": "8.16.1", + "@cspell/dynamic-import": "8.16.1", + "@cspell/filetypes": "8.16.1", + "@cspell/strong-weak-map": "8.16.1", + "@cspell/url": "8.16.1", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.16.0", - "cspell-dictionary": "8.16.0", - "cspell-glob": "8.16.0", - "cspell-grammar": "8.16.0", - "cspell-io": "8.16.0", - "cspell-trie-lib": "8.16.0", + "cspell-config-lib": "8.16.1", + "cspell-dictionary": "8.16.1", + "cspell-glob": "8.16.1", + "cspell-grammar": "8.16.1", + "cspell-io": "8.16.1", + "cspell-trie-lib": "8.16.1", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -692,12 +692,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.16.0.tgz", - "integrity": "sha512-Io1qqI0r4U9ewAWBLClFBBlxLeAoIi15PUGJi4Za1xrlgQJwRE8PMNIJNHKmPEIp78Iute3o/JyC2OfWlxl4Sw==", + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.16.1.tgz", + "integrity": "sha512-T86nszsjQjyZ35dOWk7qN17Hem0cVeXJ4D1v/gIG+Y0Umo7dBW7AwmTvUy8iMFAra29cSdgRH+yk6q1qdpA+ZA==", "dependencies": { - "@cspell/cspell-pipe": "8.16.0", - "@cspell/cspell-types": "8.16.0", + "@cspell/cspell-pipe": "8.16.1", + "@cspell/cspell-types": "8.16.1", "gensequence": "^7.0.0" }, "engines": { @@ -1035,9 +1035,9 @@ } }, "node_modules/yaml": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.0.tgz", - "integrity": "sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", + "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", "bin": { "yaml": "bin.mjs" }, diff --git a/package.json b/package.json index c7617e1503..0c776dee11 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.16.0" + "cspell": "^8.16.1" } } From 7842a3586e7f81d6efa58521cc75c204c6bcf9bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:14:45 +0100 Subject: [PATCH 467/845] Bump Verify.Xunit from 28.3.2 to 28.4.0 in the xunit group (#2869) Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify). Updates `Verify.Xunit` from 28.3.2 to 28.4.0 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/28.3.2...28.4.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 1d19199bb8..5a0fd9a8ff 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 8987072da3f54c5b0438d5ad4d3c8bcded679a37 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 15 Dec 2024 16:14:28 +0100 Subject: [PATCH 468/845] The CodeQL build needed the .NET 8.0 SDK (#2877) --- .github/workflows/codeql.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6148f3423b..b91ae834b8 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -24,6 +24,12 @@ jobs: language: [ 'csharp' ] steps: + - name: Setup .NET SDKs + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 8.0.x + - name: Checkout repository uses: actions/checkout@v4 From d87ea5dd963072bebf34034157c5ac94efbf1420 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 15 Dec 2024 16:19:03 +0100 Subject: [PATCH 469/845] Renamed ExcludingNestedObjects to WithoutRecursing to better describe its purpose (#2876) --- .../Equivalency/SelfReferenceEquivalencyOptions.cs | 8 ++++---- .../ApprovedApi/FluentAssertions/net47.verified.txt | 2 +- .../ApprovedApi/FluentAssertions/net6.0.verified.txt | 2 +- .../FluentAssertions/netstandard2.0.verified.txt | 2 +- .../FluentAssertions/netstandard2.1.verified.txt | 2 +- .../FluentAssertions.Equivalency.Specs/CollectionSpecs.cs | 2 +- .../FluentAssertions.Equivalency.Specs/DictionarySpecs.cs | 4 ++-- .../NestedPropertiesSpecs.cs | 4 ++-- .../SelectionRulesSpecs.Including.cs | 2 +- .../SelectionRulesSpecs.cs | 2 +- docs/_pages/releases.md | 1 + 11 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index ad897cdd43..be199b415d 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -413,7 +413,7 @@ public Restriction Using(Action /// - /// This is the default behavior. You can override this using . + /// This is the default behavior. You can override this using . /// public TSelf IncludingNestedObjects() { @@ -422,13 +422,13 @@ public TSelf IncludingNestedObjects() } /// - /// Stops the structural equality check from recursively comparing the members any nested objects. + /// Stops the structural equality check from recursively comparing the members of any nested objects. /// /// /// If a property or field points to a complex type or collection, a simple call will - /// be done instead of recursively looking at the properties or fields of the nested object. + /// be done instead of recursively looking at the members of the nested object. /// - public TSelf ExcludingNestedObjects() + public TSelf WithoutRecursing() { isRecursive = false; return (TSelf)this; diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index e9a9d7633d..29780df5ba 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -886,7 +886,6 @@ namespace FluentAssertions.Equivalency public TSelf ExcludingExplicitlyImplementedProperties() { } public TSelf ExcludingFields() { } public TSelf ExcludingMissingMembers() { } - public TSelf ExcludingNestedObjects() { } public TSelf ExcludingNonBrowsableMembers() { } public TSelf ExcludingProperties() { } public TSelf IgnoringCase() { } @@ -923,6 +922,7 @@ namespace FluentAssertions.Equivalency public TSelf WithTracing(FluentAssertions.Equivalency.Tracing.ITraceWriter writer = null) { } public TSelf WithoutAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithoutMatchingRules() { } + public TSelf WithoutRecursing() { } public TSelf WithoutSelectionRules() { } public TSelf WithoutStrictOrdering() { } public TSelf WithoutStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 879f1f7aca..2de7ac489f 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -899,7 +899,6 @@ namespace FluentAssertions.Equivalency public TSelf ExcludingExplicitlyImplementedProperties() { } public TSelf ExcludingFields() { } public TSelf ExcludingMissingMembers() { } - public TSelf ExcludingNestedObjects() { } public TSelf ExcludingNonBrowsableMembers() { } public TSelf ExcludingProperties() { } public TSelf IgnoringCase() { } @@ -936,6 +935,7 @@ namespace FluentAssertions.Equivalency public TSelf WithTracing(FluentAssertions.Equivalency.Tracing.ITraceWriter writer = null) { } public TSelf WithoutAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithoutMatchingRules() { } + public TSelf WithoutRecursing() { } public TSelf WithoutSelectionRules() { } public TSelf WithoutStrictOrdering() { } public TSelf WithoutStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 2261b3dd0e..9aa098ceaf 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -878,7 +878,6 @@ namespace FluentAssertions.Equivalency public TSelf ExcludingExplicitlyImplementedProperties() { } public TSelf ExcludingFields() { } public TSelf ExcludingMissingMembers() { } - public TSelf ExcludingNestedObjects() { } public TSelf ExcludingNonBrowsableMembers() { } public TSelf ExcludingProperties() { } public TSelf IgnoringCase() { } @@ -915,6 +914,7 @@ namespace FluentAssertions.Equivalency public TSelf WithTracing(FluentAssertions.Equivalency.Tracing.ITraceWriter writer = null) { } public TSelf WithoutAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithoutMatchingRules() { } + public TSelf WithoutRecursing() { } public TSelf WithoutSelectionRules() { } public TSelf WithoutStrictOrdering() { } public TSelf WithoutStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 0702e96d54..7e2a958685 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -886,7 +886,6 @@ namespace FluentAssertions.Equivalency public TSelf ExcludingExplicitlyImplementedProperties() { } public TSelf ExcludingFields() { } public TSelf ExcludingMissingMembers() { } - public TSelf ExcludingNestedObjects() { } public TSelf ExcludingNonBrowsableMembers() { } public TSelf ExcludingProperties() { } public TSelf IgnoringCase() { } @@ -923,6 +922,7 @@ namespace FluentAssertions.Equivalency public TSelf WithTracing(FluentAssertions.Equivalency.Tracing.ITraceWriter writer = null) { } public TSelf WithoutAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithoutMatchingRules() { } + public TSelf WithoutRecursing() { } public TSelf WithoutSelectionRules() { } public TSelf WithoutStrictOrdering() { } public TSelf WithoutStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } diff --git a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs index e3bc183c9b..b6bf10bc68 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs @@ -1709,7 +1709,7 @@ public void When_nested_objects_are_excluded_from_collections_it_should_use_simp IList expectationList = new List { expectation }; // Act - Action act = () => actualList.Should().BeEquivalentTo(expectationList, opt => opt.ExcludingNestedObjects()); + Action act = () => actualList.Should().BeEquivalentTo(expectationList, opt => opt.WithoutRecursing()); // Assert act.Should().NotThrow(); diff --git a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs index 2f6cd3688b..ddba50b1d3 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs @@ -587,7 +587,7 @@ public void Can_compare_non_generic_dictionaries_without_recursing() }; // Act - Action act = () => subject.Should().BeEquivalentTo(expected, options => options.ExcludingNestedObjects()); + Action act = () => subject.Should().BeEquivalentTo(expected, options => options.WithoutRecursing()); // Assert act.Should().Throw().WithMessage("Expected subject[\"Key2\"] to be \"Value2\", but found *"); @@ -1262,7 +1262,7 @@ public void Excluding_nested_objects_when_dictionary_is_equivalent() ["CustomerId"] = 33 }; - subject.Should().BeEquivalentTo(expected, opt => opt.ExcludingNestedObjects()); + subject.Should().BeEquivalentTo(expected, opt => opt.WithoutRecursing()); } [Fact] diff --git a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs index d9246bb008..dc88a07bb7 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs @@ -71,7 +71,7 @@ public void // Act Action act = () => subject.Should().BeEquivalentTo(expected, - options => options.ExcludingNestedObjects()); + options => options.WithoutRecursing()); // Assert act.Should().NotThrow(); @@ -84,7 +84,7 @@ public void When_nested_objects_should_be_excluded_it_should_do_a_simple_equalit var item = new Item { Child = new Item() }; // Act - Action act = () => item.Should().BeEquivalentTo(new Item(), options => options.ExcludingNestedObjects()); + Action act = () => item.Should().BeEquivalentTo(new Item(), options => options.WithoutRecursing()); // Assert act.Should().Throw() diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs index bf033b8626..c43e529ec3 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs @@ -346,7 +346,7 @@ public void Including_nested_objects_restores_the_default_behavior() // Act Action act = () => subject.Should().BeEquivalentTo(expected, - options => options.ExcludingNestedObjects().IncludingNestedObjects()); + options => options.WithoutRecursing().IncludingNestedObjects()); // Assert act.Should().Throw().WithMessage("*Level.Level.Text*Level2*Mismatch*"); diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs index d7e8a097ff..78182e78d6 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs @@ -30,7 +30,7 @@ public void Public_methods_follow_fluent_syntax() .Excluding(r => r.Level) .ExcludingFields() .ExcludingMissingMembers() - .ExcludingNestedObjects() + .WithoutRecursing() .ExcludingNonBrowsableMembers() .ExcludingProperties() .IgnoringCyclicReferences() diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index e2095ff57d..381ad919c0 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -97,6 +97,7 @@ sidebar: * The semantics of `BeLowerCased`/`BeUpperCased` have been changed to align with the behavior of `ToLower`/`ToUpper` - [#2660](https://github.com/fluentassertions/fluentassertions/pull/2660) * Renamed `HaveAttribute` to `HaveAttributeWithValue` on `XElement` - [#2690](https://github.com/fluentassertions/fluentassertions/pull/2690) * Renamed `RespectingRuntimeTypes` to `PreferringRuntimeMemberTypes` and `RespectingDeclaredTypes` to `PreferringDeclaredMemberTypes` - [#2866](https://github.com/fluentassertions/fluentassertions/pull/2866) +* Renamed `ExcludingNestedObjects` to `WithoutRecursing` to better describe its purpose - [#2876](https://github.com/fluentassertions/fluentassertions/pull/2876) ### Breaking Changes (for extensions) * Add `ForConstraint` to `IAssertionsScope` to support chaining `.ForConstraint()` after `.Then` - [#2324](https://github.com/fluentassertions/fluentassertions/pull/2324) From 3110761da2edd7bd0e5c1655f9193fada0cfc231 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:46:38 +0100 Subject: [PATCH 470/845] Bump JetBrains/qodana-action from 2024.2 to 2024.3 (#2885) Bumps [JetBrains/qodana-action](https://github.com/jetbrains/qodana-action) from 2024.2 to 2024.3. - [Release notes](https://github.com/jetbrains/qodana-action/releases) - [Commits](https://github.com/jetbrains/qodana-action/compare/v2024.2...v2024.3) --- updated-dependencies: - dependency-name: JetBrains/qodana-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index e743e206dc..50fa6edc53 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2024.2 + uses: JetBrains/qodana-action@v2024.3 with: upload-result: ${{ github.ref_name == 'main' || github.ref_name == 'develop' }} args: --baseline,qodana.sarif.json,--ide,QDNET From 28c3e1dc531106c6f050546fb3e251e5c1526522 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:47:22 +0100 Subject: [PATCH 471/845] Bump Meziantou.Analyzer from 2.0.180 to 2.0.182 (#2883) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.180 to 2.0.182. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.180...2.0.182) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index b1b7ec971d..3b1e1582d3 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 586da19387655b175523ef75ac65d1a4ea585a2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:46:23 +0000 Subject: [PATCH 472/845] Bump cspell from 8.16.1 to 8.17.0 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.16.1 to 8.17.0. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.17.0/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 237 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 120 insertions(+), 119 deletions(-) diff --git a/package-lock.json b/package-lock.json index f3e0a81bb2..92a813adfd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,19 +7,19 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.16.1" + "cspell": "^8.17.0" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.16.1.tgz", - "integrity": "sha512-EkbtoYpmiN9YPfcOoPcMnIrJBZh13mun64jPyyaYhrPPToiU5+CisZ7ZKUBGnqNaatuciMUxwIudhanQJ7Yhnw==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.17.0.tgz", + "integrity": "sha512-kJfHW+/BkhnP/FUQ8Tl1Eb8ZaZRozw1i+UaD0RVxNOlRGev4Lnyq5nszJwmc8NSBwAS1wmq7OTHvnOvJ1YE0og==", "dependencies": { "@cspell/dict-ada": "^4.0.5", "@cspell/dict-al": "^1.0.3", "@cspell/dict-aws": "^4.0.7", "@cspell/dict-bash": "^4.1.8", - "@cspell/dict-companies": "^3.1.7", + "@cspell/dict-companies": "^3.1.8", "@cspell/dict-cpp": "^6.0.2", "@cspell/dict-cryptocurrencies": "^5.0.3", "@cspell/dict-csharp": "^4.0.5", @@ -32,12 +32,12 @@ "@cspell/dict-en_us": "^4.3.28", "@cspell/dict-en-common-misspellings": "^2.0.7", "@cspell/dict-en-gb": "1.1.33", - "@cspell/dict-filetypes": "^3.0.8", + "@cspell/dict-filetypes": "^3.0.9", "@cspell/dict-flutter": "^1.0.3", "@cspell/dict-fonts": "^4.0.3", "@cspell/dict-fsharp": "^1.0.4", "@cspell/dict-fullstack": "^3.2.3", - "@cspell/dict-gaming-terms": "^1.0.8", + "@cspell/dict-gaming-terms": "^1.0.9", "@cspell/dict-git": "^3.0.3", "@cspell/dict-golang": "^6.0.17", "@cspell/dict-google": "^1.0.4", @@ -54,16 +54,16 @@ "@cspell/dict-markdown": "^2.0.7", "@cspell/dict-monkeyc": "^1.0.9", "@cspell/dict-node": "^5.0.5", - "@cspell/dict-npm": "^5.1.14", + "@cspell/dict-npm": "^5.1.17", "@cspell/dict-php": "^4.0.13", "@cspell/dict-powershell": "^5.0.13", "@cspell/dict-public-licenses": "^2.0.11", - "@cspell/dict-python": "^4.2.12", + "@cspell/dict-python": "^4.2.13", "@cspell/dict-r": "^2.0.4", "@cspell/dict-ruby": "^5.0.7", "@cspell/dict-rust": "^4.0.10", "@cspell/dict-scala": "^5.0.6", - "@cspell/dict-software-terms": "^4.1.17", + "@cspell/dict-software-terms": "^4.1.19", "@cspell/dict-sql": "^2.1.8", "@cspell/dict-svelte": "^1.0.5", "@cspell/dict-swift": "^2.0.4", @@ -76,28 +76,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.16.1.tgz", - "integrity": "sha512-ue1paJ2OE2BjIBQHXFMHnFqJL5xMrE/TLveOntDSCKJw7edCGP4XJA6Q0ZfUgR/ZAP3SYKNPkajEWbDTMfG+XA==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.17.0.tgz", + "integrity": "sha512-AJZIjLi/rwOHjTZMQMoGOBht1ERFHUUreTFIOTi4oZCBundnk2bXUteIQthXUCgHL2JSiS9yboUWoAIrekz7Yg==", "dependencies": { - "@cspell/cspell-types": "8.16.1" + "@cspell/cspell-types": "8.17.0" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.16.1.tgz", - "integrity": "sha512-6N+QZ3y65JRgGrQhZHmaBHESR+nC0J8nySGaYKclit8yk3jLZ/ORw9aoSGIj+dMPzImkNEDh+C1B1zdV4X8W6A==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.17.0.tgz", + "integrity": "sha512-2wdF4OfrUtY8oJvLzJdc5Z1qbVUYC706jmTq/48jTeMWl0tfUyb7JslZrnCxYxQmX3EzQhWyoj4lPfgjbxIvbg==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.16.1.tgz", - "integrity": "sha512-CfVI2JFMwh9/n1QuU9niEONbYCX1XGKqmyCcHQUzAapSqGzbAmFrRFnvyKwNL+mmy1bxli9EZV8f5vBco26f9Q==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.17.0.tgz", + "integrity": "sha512-UfvCjFqCUIucqdEWAl1MuezaRS4l3NumWFlaavVdGhdyf5nL+ydmFvrp5YXGQdBzMYnpzwQOwgMU3Jt5xXgFAQ==", "dependencies": { "global-directory": "^4.0.1" }, @@ -106,17 +106,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.16.1.tgz", - "integrity": "sha512-URaralJKcdHZH/Lr25L28GJo2Ub07adHPPhOL83BvmPyGkboehmz5arjNrgQFwS+IvGjHLdp5uzEJd0xyeHGdw==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.17.0.tgz", + "integrity": "sha512-ureBVt/fa5IHooFBfNpZUyTzqMN7aaPhXiGrb1oIfroNZaqiXG5WbvwAeyDrrk2KUa7Fl74/Yr2sOOdT3i7WSg==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.16.1.tgz", - "integrity": "sha512-B8bHlBaDSMDMEq++H8qO9osKUkzWUrP4CgWQyRqlXZ9EOdnJ469Tp1wghcQ7DezII3aXYrHiVKsUYY9VvjkhIg==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.17.0.tgz", + "integrity": "sha512-irrADI/GvabVTD9LRP/8mIH/bdoP7AOBgO7DVgNB+fZHDyJa/omzJjjie5kAZuen0l/3TrOadl3F+K0y/9AZ5A==", "engines": { "node": ">=18" } @@ -142,9 +142,9 @@ "integrity": "sha512-I2CM2pTNthQwW069lKcrVxchJGMVQBzru2ygsHCwgidXRnJL/NTjAPOFTxN58Jc1bf7THWghfEDyKX/oyfc0yg==" }, "node_modules/@cspell/dict-companies": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.7.tgz", - "integrity": "sha512-ncVs/efuAkP1/tLDhWbXukBjgZ5xOUfe03neHMWsE8zvXXc5+Lw6TX5jaJXZLOoES/f4j4AhRE20jsPCF5pm+A==" + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.8.tgz", + "integrity": "sha512-4DVPBwEPWa97g3bgg80i3orGeOGnOiJ7tj3c7n6y7FmqkEgyXcnpxOq0n0HWzwRrwrJp9KIJbtMzSAEynIwyNw==" }, "node_modules/@cspell/dict-cpp": { "version": "6.0.2", @@ -212,9 +212,9 @@ "integrity": "sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==" }, "node_modules/@cspell/dict-filetypes": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.8.tgz", - "integrity": "sha512-D3N8sm/iptzfVwsib/jvpX+K/++rM8SRpLDFUaM4jxm8EyGmSIYRbKZvdIv5BkAWmMlTWoRqlLn7Yb1b11jKJg==" + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.9.tgz", + "integrity": "sha512-U7ycC1cE32A5aEgwzp/iE0TVabonUFnVt+Ygbf6NsIWqEuFWZgZChC7gfztA4T1fpuj602nFdp7eOnTWKORsnQ==" }, "node_modules/@cspell/dict-flutter": { "version": "1.0.3", @@ -237,9 +237,9 @@ "integrity": "sha512-62PbndIyQPH11mAv0PyiyT0vbwD0AXEocPpHlCHzfb5v9SspzCCbzQ/LIBiFmyRa+q5LMW35CnSVu6OXdT+LKg==" }, "node_modules/@cspell/dict-gaming-terms": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.0.8.tgz", - "integrity": "sha512-7OL0zTl93WFWhhtpXFrtm9uZXItC3ncAs8d0iQDMMFVNU1rBr6raBNxJskxE5wx2Ant12fgI66ZGVagXfN+yfA==" + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.0.9.tgz", + "integrity": "sha512-AVIrZt3YiUnxsUzzGYTZ1XqgtkgwGEO0LWIlEf+SiDUEVLtv4CYmmyXFQ+WXDN0pyJ0wOwDazWrP0Cu7avYQmQ==" }, "node_modules/@cspell/dict-git": { "version": "3.0.3", @@ -328,9 +328,9 @@ "integrity": "sha512-7NbCS2E8ZZRZwlLrh2sA0vAk9n1kcTUiRp/Nia8YvKaItGXLfxYqD2rMQ3HpB1kEutal6hQLVic3N2Yi1X7AaA==" }, "node_modules/@cspell/dict-npm": { - "version": "5.1.15", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.15.tgz", - "integrity": "sha512-95D3A8rs9SYlUQUkK48J0F1W3jOsc63dY/vlzuNHE4nuGU2OM4jtoWvLk0ovhBMHwZikaNNTHaHoJyr+VKu+Yg==" + "version": "5.1.17", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.17.tgz", + "integrity": "sha512-RBx4yml+GbjgqmV2R9A8rO+uqjb8hV9arZXxVzW04TNdgGT/VjZnu6/3/QDzEp3DxnbSxknAbIii8BzpF/o5EQ==" }, "node_modules/@cspell/dict-php": { "version": "4.0.13", @@ -376,9 +376,9 @@ "integrity": "sha512-tl0YWAfjUVb4LyyE4JIMVE8DlLzb1ecHRmIWc4eT6nkyDqQgHKzdHsnusxFEFMVLIQomgSg0Zz6hJ5S1E4W4ww==" }, "node_modules/@cspell/dict-software-terms": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.18.tgz", - "integrity": "sha512-QhOQ3qVFr2Y+uDw2SH15klVNU2S07ecFhG+2gpTO/K4Kuaui3INbVrzHOKW41ofP3ghv9y2TkUUtOP5KfddP8A==" + "version": "4.1.19", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.19.tgz", + "integrity": "sha512-6yQa3A8PGa2fJ7bnLI21nBnOa89Rjckdgq8kwvqvZgrAptV/KLfcXbGgFriICbu3GJqTVcnMMh1fLtz+pdwIEg==" }, "node_modules/@cspell/dict-sql": { "version": "2.1.8", @@ -411,10 +411,11 @@ "integrity": "sha512-akmYbrgAGumqk1xXALtDJcEcOMYBYMnkjpmGzH13Ozhq1mkPF4VgllFQlm1xYde+BUKNnzMgPEzxrL2qZllgYA==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.16.1.tgz", - "integrity": "sha512-mEfdeS1kFKpJoDsQ8wW6PxO3+ncYuZCWCASR0trbzZDduzO2RcogMUgzP99obHtYbgXadw94qcQWXB8OYTPSwg==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.17.0.tgz", + "integrity": "sha512-dd5Xz+10crBJmCzseV+9IPgxI0nNqWW43FBG317droxlhc2L7NktlIe6bsVVCjSoGRrKjQFzTn+cV9kJ9FKvPw==", "dependencies": { + "@cspell/url": "8.17.0", "import-meta-resolve": "^4.1.0" }, "engines": { @@ -422,25 +423,25 @@ } }, "node_modules/@cspell/filetypes": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.16.1.tgz", - "integrity": "sha512-zpbNg3n26muR1jdMbylw5YsaVGyS9LU5Lfy20gU7RygAk6kFyx3Yz4C84EihBGQHy2gVEsEeyCCxk+R8RXuPZA==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.17.0.tgz", + "integrity": "sha512-EJ5APmdJV5GWZx5S47R4T3sEwFuP3PugnucqC8wwNutT8cUZrwYOsh/7bqAjkLiXXiUsJllUsDPlpTbxVfPk+g==", "engines": { "node": ">=18" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.16.1.tgz", - "integrity": "sha512-jJQS05wg2iUkLKnPR8NEq3LqvqHWKnvUDFoPwaJzYw6ol/O4yi/lv+Me9+XCPrgjpnAz+8APhWkhrR/O71R1Bw==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.17.0.tgz", + "integrity": "sha512-a2ypnatMb81X/Mx0ibTwiFx1Dg6/oPyNJ9ShTI4cp5gDC1iLJqlXzsYGgTOsGKQ8dYW1hBZxg+hXTfC1ePzDsQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.16.1.tgz", - "integrity": "sha512-kGlr7Wdo4xJpXKal/Gqo3Ll5Is7ptlIlLZOB/hzR6R53Fw4N6SdipTDIeHHqC15p2AXTEG6TSNdhk9dA50LY6w==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.17.0.tgz", + "integrity": "sha512-78ZmsbAZ8RbEWRpLgsOuFxEa7Het4pkHyr2AiC0oUiUnvGuVGmUmT4KLCGvzpOzKKztinwgC+u4G5+sC/J6s7A==", "engines": { "node": ">=18.0" } @@ -540,23 +541,23 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cspell": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.16.1.tgz", - "integrity": "sha512-ILuCjnY3JPY2oO62PodTQD6n3DGTKTwB+IU1tE9EC6EP2Xw6z3Ir+hO2DO6QlRUmZlGrkGMek5U06nNmztt4eA==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.17.0.tgz", + "integrity": "sha512-xg2o85zK0G12LA2dK7+zUHp1+udFYSC3dkQw6+Pfo2T99HrlnlaHn57GnoENgOBqfeSTBaN9ApS0Ekeewa8e1w==", "dependencies": { - "@cspell/cspell-json-reporter": "8.16.1", - "@cspell/cspell-pipe": "8.16.1", - "@cspell/cspell-types": "8.16.1", - "@cspell/dynamic-import": "8.16.1", - "@cspell/url": "8.16.1", + "@cspell/cspell-json-reporter": "8.17.0", + "@cspell/cspell-pipe": "8.17.0", + "@cspell/cspell-types": "8.17.0", + "@cspell/dynamic-import": "8.17.0", + "@cspell/url": "8.17.0", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-dictionary": "8.16.1", - "cspell-gitignore": "8.16.1", - "cspell-glob": "8.16.1", - "cspell-io": "8.16.1", - "cspell-lib": "8.16.1", + "cspell-dictionary": "8.17.0", + "cspell-gitignore": "8.17.0", + "cspell-glob": "8.17.0", + "cspell-io": "8.17.0", + "cspell-lib": "8.17.0", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "get-stdin": "^9.0.0", @@ -575,11 +576,11 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.16.1.tgz", - "integrity": "sha512-ohbSi9sI14rMdFc2g17ogObGGkd/x6zUVOzCH1nEOefC9yJYYfsvaMHqdhk0rOjvmF95j5OK4dm5oid+DKQcpw==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.17.0.tgz", + "integrity": "sha512-MSa1LENlHpb8vlKqu4i4uJ8n+mwnn+dqkggefUq3Mrbkv1v3oTT5XyMyv586p1+r8KeZgISBniHVv7IN9iWvXQ==", "dependencies": { - "@cspell/cspell-types": "8.16.1", + "@cspell/cspell-types": "8.17.0", "comment-json": "^4.2.5", "yaml": "^2.6.1" }, @@ -588,13 +589,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.16.1.tgz", - "integrity": "sha512-NL/vwf5SjtkWWaEUh+0dogKdEU4UuepJaNh36FX8W1CFtQXj7yEs45x4K7/Fp+pn/4AT7Qe7WpSSWi9z5GcqKg==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.17.0.tgz", + "integrity": "sha512-PisnibsCrt/EbL4vmoVZZNWpjtquXBlrrY+iSbbQN5rJXCGX1St79DxgZcSzBLpc6Tt08l/VgFlvTDEGRf2xLA==", "dependencies": { - "@cspell/cspell-pipe": "8.16.1", - "@cspell/cspell-types": "8.16.1", - "cspell-trie-lib": "8.16.1", + "@cspell/cspell-pipe": "8.17.0", + "@cspell/cspell-types": "8.17.0", + "cspell-trie-lib": "8.17.0", "fast-equals": "^5.0.1" }, "engines": { @@ -602,13 +603,13 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.16.1.tgz", - "integrity": "sha512-Gg8qvFc8wr1D7TvB+GSfT1jyrUoUmPiG3WdOnQnxOSYKJesOiVvNxLv7YXRFkcUKG1VU6XDUkpb/uzKh3k2rKw==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.17.0.tgz", + "integrity": "sha512-Qk5sgf6sDOI3egNQJAuGnbi3V63Vk/CUX7/CplcrJbX8Yu9fXmjjGN+ffMtLDay3+VLsOLmFJZWCGfgqW/kP6g==", "dependencies": { - "@cspell/url": "8.16.1", - "cspell-glob": "8.16.1", - "cspell-io": "8.16.1", + "@cspell/url": "8.17.0", + "cspell-glob": "8.17.0", + "cspell-io": "8.17.0", "find-up-simple": "^1.0.0" }, "bin": { @@ -619,11 +620,11 @@ } }, "node_modules/cspell-glob": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.16.1.tgz", - "integrity": "sha512-EukaXFaUrgrY9G4bB2PguzpkAoOq6ai9acLl6gWD+6DgVEwkLqPmCWjsFJA0MaqVp9QvPsIfCy4KCnx35csG/g==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.17.0.tgz", + "integrity": "sha512-Miy0kqDIUfsCdLQTJxlXlt9fXqpakwsmyDNKyGjBPNLPF3OAcSelzzxhOUUyzKRgIqXBx4vP3+EF6ZUO3SKDsQ==", "dependencies": { - "@cspell/url": "8.16.1", + "@cspell/url": "8.17.0", "micromatch": "^4.0.8" }, "engines": { @@ -631,12 +632,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.16.1.tgz", - "integrity": "sha512-7IRYa0O1xfK2HVbhGSpOPPt5HlP2ZHRHtdLU2iOvMSCkh0cSPERu++kdprvcaOf7E7koo0P+bxHSprcYbU/agg==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.17.0.tgz", + "integrity": "sha512-2lvxGetbpCNRZJeGK1AjtBnDYD9gc3lPcjD4wFunPMMQbfi3p/pCUrNtMv8eA/pHaF403ah0MQfS/hgdLczoww==", "dependencies": { - "@cspell/cspell-pipe": "8.16.1", - "@cspell/cspell-types": "8.16.1" + "@cspell/cspell-pipe": "8.17.0", + "@cspell/cspell-types": "8.17.0" }, "bin": { "cspell-grammar": "bin.mjs" @@ -646,38 +647,38 @@ } }, "node_modules/cspell-io": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.16.1.tgz", - "integrity": "sha512-25MOQfy7EhdVeoNUW/+jyb5ArDYSLbaFwVToakHtLGuYk9cW8q8MAHq1W9GzW06wXswT2sQsRvaozmIOTDIOnw==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.17.0.tgz", + "integrity": "sha512-gNmgRCIwa1/kki6/ekgk/dhTpojpppufu1j5FvuKk9Ib4gOibUdVKcxCi8uk6LbwOFrrDTOtRhC6WgdMmXerUQ==", "dependencies": { - "@cspell/cspell-service-bus": "8.16.1", - "@cspell/url": "8.16.1" + "@cspell/cspell-service-bus": "8.17.0", + "@cspell/url": "8.17.0" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.16.1.tgz", - "integrity": "sha512-Gn1vJcyhYe78iB+9dms8rnfgDEfJgYocXapFPTOcZV3EUWKcV4wyCiHdbK3j2ElLXmPuSPg4eZSlxxk8ITD0Aw==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.17.0.tgz", + "integrity": "sha512-+5zMNt+n6/9FbMGKZdDUscpbJe2V54W7cA662f6LbzPXImfNpKZSzU0kSNJ9NyKpaJBoA/Yhb4WrBy1XmscS6g==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.16.1", - "@cspell/cspell-pipe": "8.16.1", - "@cspell/cspell-resolver": "8.16.1", - "@cspell/cspell-types": "8.16.1", - "@cspell/dynamic-import": "8.16.1", - "@cspell/filetypes": "8.16.1", - "@cspell/strong-weak-map": "8.16.1", - "@cspell/url": "8.16.1", + "@cspell/cspell-bundled-dicts": "8.17.0", + "@cspell/cspell-pipe": "8.17.0", + "@cspell/cspell-resolver": "8.17.0", + "@cspell/cspell-types": "8.17.0", + "@cspell/dynamic-import": "8.17.0", + "@cspell/filetypes": "8.17.0", + "@cspell/strong-weak-map": "8.17.0", + "@cspell/url": "8.17.0", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.16.1", - "cspell-dictionary": "8.16.1", - "cspell-glob": "8.16.1", - "cspell-grammar": "8.16.1", - "cspell-io": "8.16.1", - "cspell-trie-lib": "8.16.1", + "cspell-config-lib": "8.17.0", + "cspell-dictionary": "8.17.0", + "cspell-glob": "8.17.0", + "cspell-grammar": "8.17.0", + "cspell-io": "8.17.0", + "cspell-trie-lib": "8.17.0", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -692,12 +693,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.16.1.tgz", - "integrity": "sha512-T86nszsjQjyZ35dOWk7qN17Hem0cVeXJ4D1v/gIG+Y0Umo7dBW7AwmTvUy8iMFAra29cSdgRH+yk6q1qdpA+ZA==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.17.0.tgz", + "integrity": "sha512-QeHTxjSBtyFDb8/mIn4PVY0wwc31U3AOUdwEKD6Mshd3OexvS6UhGqfNvHijIuy2WD6Z/2XHpQYVcQF1UXfKkA==", "dependencies": { - "@cspell/cspell-pipe": "8.16.1", - "@cspell/cspell-types": "8.16.1", + "@cspell/cspell-pipe": "8.17.0", + "@cspell/cspell-types": "8.17.0", "gensequence": "^7.0.0" }, "engines": { diff --git a/package.json b/package.json index 0c776dee11..0289b8d2fe 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.16.1" + "cspell": "^8.17.0" } } From 90ed546ddb97bdcd3bff37ec968300361a87c635 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:45:44 +0000 Subject: [PATCH 473/845] Bump PublicApiGenerator from 11.1.0 to 11.2.0 Bumps [PublicApiGenerator](https://github.com/PublicApiGenerator/PublicApiGenerator) from 11.1.0 to 11.2.0. - [Release notes](https://github.com/PublicApiGenerator/PublicApiGenerator/releases) - [Commits](https://github.com/PublicApiGenerator/PublicApiGenerator/compare/11.1.0...11.2.0) --- updated-dependencies: - dependency-name: PublicApiGenerator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 5a0fd9a8ff..30acfa6990 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -11,7 +11,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + From 6aa748da4b69503ee4a5feda544e7d02079ec9c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:45:02 +0000 Subject: [PATCH 474/845] Bump Verify.Xunit from 28.4.0 to 28.5.0 in the xunit group Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify). Updates `Verify.Xunit` from 28.4.0 to 28.5.0 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/28.4.0...28.5.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 30acfa6990..082a6527b6 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 37c9c0993bd5dd5df1ae5f59665c7fec36ce72f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:45:26 +0000 Subject: [PATCH 475/845] Bump NUnit from 4.2.2 to 4.3.0 in the nunit group Bumps the nunit group with 1 update: [NUnit](https://github.com/nunit/nunit). Updates `NUnit` from 4.2.2 to 4.3.0 - [Release notes](https://github.com/nunit/nunit/releases) - [Changelog](https://github.com/nunit/nunit/blob/main/CHANGES.md) - [Commits](https://github.com/nunit/nunit/compare/4.2.2...4.3.0) --- updated-dependencies: - dependency-name: NUnit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: nunit ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index 2a486de291..cbefd71496 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From c050f6bcaec68195f1d0dd0e44d233c6bbecf033 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Mon, 16 Dec 2024 19:02:28 +0100 Subject: [PATCH 476/845] Suppress Qodana warnings about awaiting a void method. --- .../Exceptions/AsyncFunctionExceptionAssertionSpecs.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs index 5f1eb7ab67..66bcf91d70 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs @@ -1,4 +1,6 @@ -using System; +// ReSharper disable AsyncVoidLambda + +using System; using System.Threading.Tasks; using FluentAssertions.Execution; using FluentAssertions.Extensions; From 87bc87b922dae528a67678511e4128b5f721e70e Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Tue, 17 Dec 2024 16:54:05 +0100 Subject: [PATCH 477/845] Update code_quality.yml (#2889) --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index 50fa6edc53..e743e206dc 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2024.3 + uses: JetBrains/qodana-action@v2024.2 with: upload-result: ${{ github.ref_name == 'main' || github.ref_name == 'develop' }} args: --baseline,qodana.sarif.json,--ide,QDNET From e7fe99a27b70baa82975dffb01a02cbe4c0ced73 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 17 Dec 2024 11:04:05 +0100 Subject: [PATCH 478/845] Exclude analyzers from UWP.Specs E.g. Meziantou.Analyzers does not work well with non-SDK projects. https://github.com/meziantou/Meziantou.Analyzer/issues/732 --- Tests/UWP.Specs/Directory.Build.props | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Tests/UWP.Specs/Directory.Build.props diff --git a/Tests/UWP.Specs/Directory.Build.props b/Tests/UWP.Specs/Directory.Build.props new file mode 100644 index 0000000000..b09e3158ba --- /dev/null +++ b/Tests/UWP.Specs/Directory.Build.props @@ -0,0 +1,7 @@ + + + 12.0 + false + true + + From 3614c1408264d3ecf932280404219c10c59e2d9a Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 17 Dec 2024 15:39:46 +0100 Subject: [PATCH 479/845] Remove unused code --- Tests/UWP.Specs/App.xaml.cs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/Tests/UWP.Specs/App.xaml.cs b/Tests/UWP.Specs/App.xaml.cs index 0b335f4e45..768f758892 100644 --- a/Tests/UWP.Specs/App.xaml.cs +++ b/Tests/UWP.Specs/App.xaml.cs @@ -1,10 +1,7 @@ -using System; -using Microsoft.VisualStudio.TestPlatform.TestExecutor; +using Microsoft.VisualStudio.TestPlatform.TestExecutor; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Navigation; namespace UWP.Specs; @@ -18,19 +15,9 @@ public App() protected override void OnLaunched(LaunchActivatedEventArgs args) { - if (Window.Current.Content is not Frame rootFrame) - { - rootFrame = new Frame(); - rootFrame.NavigationFailed += OnNavigationFailed; - Window.Current.Content = rootFrame; - } - UnitTestClient.Run(args.Arguments); } - private void OnNavigationFailed(object sender, NavigationFailedEventArgs e) => - throw new Exception("Failed to load Page " + e.SourcePageType.FullName); - private void OnSuspending(object sender, SuspendingEventArgs e) => e.SuspendingOperation.GetDeferral().Complete(); } From d37663561a5cd73ced8ec4abafcefc5116d36b66 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 17 Dec 2024 15:40:26 +0100 Subject: [PATCH 480/845] Align manifest with in csproj --- Tests/UWP.Specs/Package.appxmanifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/UWP.Specs/Package.appxmanifest b/Tests/UWP.Specs/Package.appxmanifest index 2a32c3ad91..bbe9c9803a 100644 --- a/Tests/UWP.Specs/Package.appxmanifest +++ b/Tests/UWP.Specs/Package.appxmanifest @@ -10,7 +10,7 @@ - + From 9c50c9203ce28bb3bbaddb24109953a5e15fda0e Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 17 Dec 2024 15:43:35 +0100 Subject: [PATCH 481/845] Upgrade MSTest from 3.3.1 -> 3.6.4 --- Tests/UWP.Specs/UWP.Specs.csproj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tests/UWP.Specs/UWP.Specs.csproj b/Tests/UWP.Specs/UWP.Specs.csproj index 414c2ad5a0..f1a992df33 100644 --- a/Tests/UWP.Specs/UWP.Specs.csproj +++ b/Tests/UWP.Specs/UWP.Specs.csproj @@ -20,6 +20,8 @@ $(NoWarn);2008 true true + + false true @@ -87,10 +89,10 @@ 6.2.14 - 3.3.1 + 3.6.4 - 3.3.1 + 3.6.4 4.3.0 From 6ac14f247581cda1a55b40c24ee8733e8c3598e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:57:42 +0000 Subject: [PATCH 482/845] Bump PolySharp from 1.14.1 to 1.15.0 Bumps [PolySharp](https://github.com/Sergio0694/PolySharp) from 1.14.1 to 1.15.0. - [Release notes](https://github.com/Sergio0694/PolySharp/releases) - [Commits](https://github.com/Sergio0694/PolySharp/compare/1.14.1...1.15.0) --- updated-dependencies: - dependency-name: PolySharp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Src/FluentAssertions/FluentAssertions.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 18a03692a7..c4fa1cd464 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -54,7 +54,7 @@ - + diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 936042ac98..167487a564 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -14,7 +14,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From de6adcf532651ab29b88aa3fafa33056518d98e7 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 17 Dec 2024 16:46:51 +0100 Subject: [PATCH 483/845] Downgrade System.Collections.Immutable to 1.5.0 To avoid testing with newer dependencies than what end users might be using --- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index bbeba7f560..c1d4217282 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -17,7 +17,7 @@ FluentAssertions.Specs.csproj for net47 does not generate a binding redirect from 4.0.4.0 to 4.0.4.1 Upgrading to 1.6.0 gives "Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0" --> - + diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 7b86481f4d..3be852702e 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -17,7 +17,7 @@ FluentAssertions.Specs.csproj for net47 does not generate a binding redirect from 4.0.4.0 to 4.0.4.1 Upgrading to 1.6.0 gives "Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0" --> - + From 0de0d18b7869bad8bf05706d42e79566e80ab7c1 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 18 Dec 2024 09:41:18 +0100 Subject: [PATCH 484/845] Ignore updates to System.Collections.Immutable --- .github/dependabot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a5225a3de5..4d017cab8f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -32,6 +32,7 @@ updates: time: "16:00" timezone: "Europe/Copenhagen" ignore: + - dependency-name: "System.Collections.Immutable" - dependency-name: "System.Configuration.ConfigurationManager" - dependency-name: "System.Threading.Tasks.Extensions" groups: From 1acc7529d3aa37ca9a7452a682c197da3bde9adb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 09:03:01 +0000 Subject: [PATCH 485/845] Bump cspell from 8.17.0 to 8.17.1 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.17.0 to 8.17.1. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.17.1/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 214 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 108 insertions(+), 108 deletions(-) diff --git a/package-lock.json b/package-lock.json index 92a813adfd..5750c9a1ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.17.0" + "cspell": "^8.17.1" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.17.0.tgz", - "integrity": "sha512-kJfHW+/BkhnP/FUQ8Tl1Eb8ZaZRozw1i+UaD0RVxNOlRGev4Lnyq5nszJwmc8NSBwAS1wmq7OTHvnOvJ1YE0og==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.17.1.tgz", + "integrity": "sha512-HmkXS5uX4bk/XxsRS4Q+zRvhgRa81ddGiR2/Xfag9MIi5L5UnEJ4g21EpmIlXkMxYrTu2fp69SZFss5NfcFF9Q==", "dependencies": { "@cspell/dict-ada": "^4.0.5", "@cspell/dict-al": "^1.0.3", @@ -76,28 +76,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.17.0.tgz", - "integrity": "sha512-AJZIjLi/rwOHjTZMQMoGOBht1ERFHUUreTFIOTi4oZCBundnk2bXUteIQthXUCgHL2JSiS9yboUWoAIrekz7Yg==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.17.1.tgz", + "integrity": "sha512-EV9Xkh42Xw3aORvDZfxusICX91DDbqQpYdGKBdPGuhgxWOUYYZKpLXsHCmDkhruMPo2m5gDh++/OqjLRPZofKQ==", "dependencies": { - "@cspell/cspell-types": "8.17.0" + "@cspell/cspell-types": "8.17.1" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.17.0.tgz", - "integrity": "sha512-2wdF4OfrUtY8oJvLzJdc5Z1qbVUYC706jmTq/48jTeMWl0tfUyb7JslZrnCxYxQmX3EzQhWyoj4lPfgjbxIvbg==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.17.1.tgz", + "integrity": "sha512-uhC99Ox+OH3COSgShv4fpVHiotR70dNvAOSkzRvKVRzV6IGyFnxHjmyVVPEV0dsqzVLxltwYTqFhwI+UOwm45A==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.17.0.tgz", - "integrity": "sha512-UfvCjFqCUIucqdEWAl1MuezaRS4l3NumWFlaavVdGhdyf5nL+ydmFvrp5YXGQdBzMYnpzwQOwgMU3Jt5xXgFAQ==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.17.1.tgz", + "integrity": "sha512-XEK2ymTdQNgsV3ny60VkKzWskbICl4zNXh/DbxsoRXHqIRg43MXFpTNkEJ7j873EqdX7BU4opQQ+5D4stWWuhQ==", "dependencies": { "global-directory": "^4.0.1" }, @@ -106,17 +106,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.17.0.tgz", - "integrity": "sha512-ureBVt/fa5IHooFBfNpZUyTzqMN7aaPhXiGrb1oIfroNZaqiXG5WbvwAeyDrrk2KUa7Fl74/Yr2sOOdT3i7WSg==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.17.1.tgz", + "integrity": "sha512-2sFWQtMEWZ4tdz7bw0bAx4NaV1t0ynGfjpuKWdQppsJFKNb+ZPZZ6Ah1dC13AdRRMZaG194kDRFwzNvRaCgWkQ==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.17.0.tgz", - "integrity": "sha512-irrADI/GvabVTD9LRP/8mIH/bdoP7AOBgO7DVgNB+fZHDyJa/omzJjjie5kAZuen0l/3TrOadl3F+K0y/9AZ5A==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.17.1.tgz", + "integrity": "sha512-NJbov7Jp57fh8addoxesjb8atg/APQfssCH5Q9uZuHBN06wEJDgs7fhfE48bU+RBViC9gltblsYZzZZQKzHYKg==", "engines": { "node": ">=18" } @@ -142,9 +142,9 @@ "integrity": "sha512-I2CM2pTNthQwW069lKcrVxchJGMVQBzru2ygsHCwgidXRnJL/NTjAPOFTxN58Jc1bf7THWghfEDyKX/oyfc0yg==" }, "node_modules/@cspell/dict-companies": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.8.tgz", - "integrity": "sha512-4DVPBwEPWa97g3bgg80i3orGeOGnOiJ7tj3c7n6y7FmqkEgyXcnpxOq0n0HWzwRrwrJp9KIJbtMzSAEynIwyNw==" + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.9.tgz", + "integrity": "sha512-w7XEJ2B6x2jq9ws5XNyYgpYj2MxdZ3jW3PETLxjK7nc8pulCFmaGVgZ0JTnDWfJ3QMOczoagn5f9LM2PZ/CuJg==" }, "node_modules/@cspell/dict-cpp": { "version": "6.0.2", @@ -328,9 +328,9 @@ "integrity": "sha512-7NbCS2E8ZZRZwlLrh2sA0vAk9n1kcTUiRp/Nia8YvKaItGXLfxYqD2rMQ3HpB1kEutal6hQLVic3N2Yi1X7AaA==" }, "node_modules/@cspell/dict-npm": { - "version": "5.1.17", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.17.tgz", - "integrity": "sha512-RBx4yml+GbjgqmV2R9A8rO+uqjb8hV9arZXxVzW04TNdgGT/VjZnu6/3/QDzEp3DxnbSxknAbIii8BzpF/o5EQ==" + "version": "5.1.18", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.18.tgz", + "integrity": "sha512-/Nukl+DSxtEWSlb8svWFSpJVctAsM9SP+f5Q1n+qdDcXNKMb1bUCo/d3QZPwyOhuMjDawnsGBUAfp+iq7Mw83Q==" }, "node_modules/@cspell/dict-php": { "version": "4.0.13", @@ -376,9 +376,9 @@ "integrity": "sha512-tl0YWAfjUVb4LyyE4JIMVE8DlLzb1ecHRmIWc4eT6nkyDqQgHKzdHsnusxFEFMVLIQomgSg0Zz6hJ5S1E4W4ww==" }, "node_modules/@cspell/dict-software-terms": { - "version": "4.1.19", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.19.tgz", - "integrity": "sha512-6yQa3A8PGa2fJ7bnLI21nBnOa89Rjckdgq8kwvqvZgrAptV/KLfcXbGgFriICbu3GJqTVcnMMh1fLtz+pdwIEg==" + "version": "4.1.20", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.1.20.tgz", + "integrity": "sha512-ma51njqbk9ZKzZF9NpCZpZ+c50EwR5JTJ2LEXlX0tX+ExVbKpthhlDLhT2+mkUh5Zvj+CLf5F9z0qB4+X3re/w==" }, "node_modules/@cspell/dict-sql": { "version": "2.1.8", @@ -411,11 +411,11 @@ "integrity": "sha512-akmYbrgAGumqk1xXALtDJcEcOMYBYMnkjpmGzH13Ozhq1mkPF4VgllFQlm1xYde+BUKNnzMgPEzxrL2qZllgYA==" }, "node_modules/@cspell/dynamic-import": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.17.0.tgz", - "integrity": "sha512-dd5Xz+10crBJmCzseV+9IPgxI0nNqWW43FBG317droxlhc2L7NktlIe6bsVVCjSoGRrKjQFzTn+cV9kJ9FKvPw==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.17.1.tgz", + "integrity": "sha512-XQtr2olYOtqbg49E+8SISd6I5DzfxmsKINDn0ZgaTFeLalnNdF3ewDU4gOEbApIzGffRa1mW9t19MsiVrznSDw==", "dependencies": { - "@cspell/url": "8.17.0", + "@cspell/url": "8.17.1", "import-meta-resolve": "^4.1.0" }, "engines": { @@ -423,25 +423,25 @@ } }, "node_modules/@cspell/filetypes": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.17.0.tgz", - "integrity": "sha512-EJ5APmdJV5GWZx5S47R4T3sEwFuP3PugnucqC8wwNutT8cUZrwYOsh/7bqAjkLiXXiUsJllUsDPlpTbxVfPk+g==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.17.1.tgz", + "integrity": "sha512-AxYw6j7EPYtDFAFjwybjFpMc9waXQzurfBXmEVfQ5RQRlbylujLZWwR6GnMqofeNg4oGDUpEjcAZFrgdkvMQlA==", "engines": { "node": ">=18" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.17.0.tgz", - "integrity": "sha512-a2ypnatMb81X/Mx0ibTwiFx1Dg6/oPyNJ9ShTI4cp5gDC1iLJqlXzsYGgTOsGKQ8dYW1hBZxg+hXTfC1ePzDsQ==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.17.1.tgz", + "integrity": "sha512-8cY3vLAKdt5gQEMM3Gr57BuQ8sun2NjYNh9qTdrctC1S9gNC7XzFghTYAfHSWR4VrOUcMFLO/izMdsc1KFvFOA==", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.17.0.tgz", - "integrity": "sha512-78ZmsbAZ8RbEWRpLgsOuFxEa7Het4pkHyr2AiC0oUiUnvGuVGmUmT4KLCGvzpOzKKztinwgC+u4G5+sC/J6s7A==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.17.1.tgz", + "integrity": "sha512-LMvReIndW1ckvemElfDgTt282fb2C3C/ZXfsm0pJsTV5ZmtdelCHwzmgSBmY5fDr7D66XDp8EurotSE0K6BTvw==", "engines": { "node": ">=18.0" } @@ -541,23 +541,23 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cspell": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.17.0.tgz", - "integrity": "sha512-xg2o85zK0G12LA2dK7+zUHp1+udFYSC3dkQw6+Pfo2T99HrlnlaHn57GnoENgOBqfeSTBaN9ApS0Ekeewa8e1w==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.17.1.tgz", + "integrity": "sha512-D0lw8XTXrTycNzOn5DkfPJNUT00X53OgvFDm+0SzhBr1r+na8LEh3CnQ6zKYVU0fL0x8vU82vs4jmGjDho9mPg==", "dependencies": { - "@cspell/cspell-json-reporter": "8.17.0", - "@cspell/cspell-pipe": "8.17.0", - "@cspell/cspell-types": "8.17.0", - "@cspell/dynamic-import": "8.17.0", - "@cspell/url": "8.17.0", + "@cspell/cspell-json-reporter": "8.17.1", + "@cspell/cspell-pipe": "8.17.1", + "@cspell/cspell-types": "8.17.1", + "@cspell/dynamic-import": "8.17.1", + "@cspell/url": "8.17.1", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-dictionary": "8.17.0", - "cspell-gitignore": "8.17.0", - "cspell-glob": "8.17.0", - "cspell-io": "8.17.0", - "cspell-lib": "8.17.0", + "cspell-dictionary": "8.17.1", + "cspell-gitignore": "8.17.1", + "cspell-glob": "8.17.1", + "cspell-io": "8.17.1", + "cspell-lib": "8.17.1", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "get-stdin": "^9.0.0", @@ -576,11 +576,11 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.17.0.tgz", - "integrity": "sha512-MSa1LENlHpb8vlKqu4i4uJ8n+mwnn+dqkggefUq3Mrbkv1v3oTT5XyMyv586p1+r8KeZgISBniHVv7IN9iWvXQ==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.17.1.tgz", + "integrity": "sha512-x1S7QWprgUcwuwiJB1Ng0ZTBC4G50qP9qQyg/aroMkcdMsHfk26E8jUGRPNt4ftHFzS4YMhwtXuJQ9IgRUuNPA==", "dependencies": { - "@cspell/cspell-types": "8.17.0", + "@cspell/cspell-types": "8.17.1", "comment-json": "^4.2.5", "yaml": "^2.6.1" }, @@ -589,13 +589,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.17.0.tgz", - "integrity": "sha512-PisnibsCrt/EbL4vmoVZZNWpjtquXBlrrY+iSbbQN5rJXCGX1St79DxgZcSzBLpc6Tt08l/VgFlvTDEGRf2xLA==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.17.1.tgz", + "integrity": "sha512-zSl9l3wii+x16yc2NVZl/+CMLeLBAiuEd5YoFkOYPcbTJnfPwdjMNcj71u7wBvNJ+qwbF+kGbutEt15yHW3NBw==", "dependencies": { - "@cspell/cspell-pipe": "8.17.0", - "@cspell/cspell-types": "8.17.0", - "cspell-trie-lib": "8.17.0", + "@cspell/cspell-pipe": "8.17.1", + "@cspell/cspell-types": "8.17.1", + "cspell-trie-lib": "8.17.1", "fast-equals": "^5.0.1" }, "engines": { @@ -603,13 +603,13 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.17.0.tgz", - "integrity": "sha512-Qk5sgf6sDOI3egNQJAuGnbi3V63Vk/CUX7/CplcrJbX8Yu9fXmjjGN+ffMtLDay3+VLsOLmFJZWCGfgqW/kP6g==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.17.1.tgz", + "integrity": "sha512-bk727Zf4FBCjm9Mwvyreyhgjwe+YhPQEW7PldkHiinKd+Irfez4s8GXLQb1EgV0UpvViqaqBqLmngjZdS30BTA==", "dependencies": { - "@cspell/url": "8.17.0", - "cspell-glob": "8.17.0", - "cspell-io": "8.17.0", + "@cspell/url": "8.17.1", + "cspell-glob": "8.17.1", + "cspell-io": "8.17.1", "find-up-simple": "^1.0.0" }, "bin": { @@ -620,11 +620,11 @@ } }, "node_modules/cspell-glob": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.17.0.tgz", - "integrity": "sha512-Miy0kqDIUfsCdLQTJxlXlt9fXqpakwsmyDNKyGjBPNLPF3OAcSelzzxhOUUyzKRgIqXBx4vP3+EF6ZUO3SKDsQ==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.17.1.tgz", + "integrity": "sha512-cUwM5auSt0RvLX7UkP2GEArJRWc85l51B1voArl+3ZIKeMZwcJpJgN3qvImtF8yRTZwYeYCs1sgsihb179q+mg==", "dependencies": { - "@cspell/url": "8.17.0", + "@cspell/url": "8.17.1", "micromatch": "^4.0.8" }, "engines": { @@ -632,12 +632,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.17.0.tgz", - "integrity": "sha512-2lvxGetbpCNRZJeGK1AjtBnDYD9gc3lPcjD4wFunPMMQbfi3p/pCUrNtMv8eA/pHaF403ah0MQfS/hgdLczoww==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.17.1.tgz", + "integrity": "sha512-H5tLcBuW7aUj9L0rR+FSbnWPEsWb8lWppHVidtqw9Ll1CUHWOZC9HTB2RdrhJZrsz/8DJbM2yNbok0Xt0VAfdw==", "dependencies": { - "@cspell/cspell-pipe": "8.17.0", - "@cspell/cspell-types": "8.17.0" + "@cspell/cspell-pipe": "8.17.1", + "@cspell/cspell-types": "8.17.1" }, "bin": { "cspell-grammar": "bin.mjs" @@ -647,38 +647,38 @@ } }, "node_modules/cspell-io": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.17.0.tgz", - "integrity": "sha512-gNmgRCIwa1/kki6/ekgk/dhTpojpppufu1j5FvuKk9Ib4gOibUdVKcxCi8uk6LbwOFrrDTOtRhC6WgdMmXerUQ==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.17.1.tgz", + "integrity": "sha512-liIOsblt7oVItifzRAbuxiYrwlgw1VOqKppMxVKtYoAn2VUuuEpjCj6jLWpoTqSszR/38o7ChsHY1LHakhJZmw==", "dependencies": { - "@cspell/cspell-service-bus": "8.17.0", - "@cspell/url": "8.17.0" + "@cspell/cspell-service-bus": "8.17.1", + "@cspell/url": "8.17.1" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.17.0.tgz", - "integrity": "sha512-+5zMNt+n6/9FbMGKZdDUscpbJe2V54W7cA662f6LbzPXImfNpKZSzU0kSNJ9NyKpaJBoA/Yhb4WrBy1XmscS6g==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.17.1.tgz", + "integrity": "sha512-66n83Q7bK5tnvkDH7869/pBY/65AKmZVfCOAlsbhJn3YMDbNHFCHR0d1oNMlqG+n65Aco89VGwYfXxImZY+/mA==", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.17.0", - "@cspell/cspell-pipe": "8.17.0", - "@cspell/cspell-resolver": "8.17.0", - "@cspell/cspell-types": "8.17.0", - "@cspell/dynamic-import": "8.17.0", - "@cspell/filetypes": "8.17.0", - "@cspell/strong-weak-map": "8.17.0", - "@cspell/url": "8.17.0", + "@cspell/cspell-bundled-dicts": "8.17.1", + "@cspell/cspell-pipe": "8.17.1", + "@cspell/cspell-resolver": "8.17.1", + "@cspell/cspell-types": "8.17.1", + "@cspell/dynamic-import": "8.17.1", + "@cspell/filetypes": "8.17.1", + "@cspell/strong-weak-map": "8.17.1", + "@cspell/url": "8.17.1", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.17.0", - "cspell-dictionary": "8.17.0", - "cspell-glob": "8.17.0", - "cspell-grammar": "8.17.0", - "cspell-io": "8.17.0", - "cspell-trie-lib": "8.17.0", + "cspell-config-lib": "8.17.1", + "cspell-dictionary": "8.17.1", + "cspell-glob": "8.17.1", + "cspell-grammar": "8.17.1", + "cspell-io": "8.17.1", + "cspell-trie-lib": "8.17.1", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -693,12 +693,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.17.0.tgz", - "integrity": "sha512-QeHTxjSBtyFDb8/mIn4PVY0wwc31U3AOUdwEKD6Mshd3OexvS6UhGqfNvHijIuy2WD6Z/2XHpQYVcQF1UXfKkA==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.17.1.tgz", + "integrity": "sha512-13WNa5s75VwOjlGzWprmfNbBFIfXyA7tYYrbV+LugKkznyNZJeJPojHouEudcLq3SYb2Q6tJ7qyWcuT5bR9qPA==", "dependencies": { - "@cspell/cspell-pipe": "8.17.0", - "@cspell/cspell-types": "8.17.0", + "@cspell/cspell-pipe": "8.17.1", + "@cspell/cspell-types": "8.17.1", "gensequence": "^7.0.0" }, "engines": { diff --git a/package.json b/package.json index 0289b8d2fe..0722564db7 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.17.0" + "cspell": "^8.17.1" } } From dc69b0e8959676e60c142c7fac91e50ca9912767 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 09:06:28 +0000 Subject: [PATCH 486/845] Bump TUnit from 0.4.1 to 0.5.6 Bumps [TUnit](https://github.com/thomhurst/TUnit) from 0.4.1 to 0.5.6. - [Commits](https://github.com/thomhurst/TUnit/commits) --- updated-dependencies: - dependency-name: TUnit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index af8fd8c373..85c800b4dc 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -11,7 +11,7 @@ - + From 05bdcabc53089e3104a439db376579f66ea1965a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 09:06:07 +0000 Subject: [PATCH 487/845] Bump PublicApiGenerator from 11.2.0 to 11.3.0 Bumps [PublicApiGenerator](https://github.com/PublicApiGenerator/PublicApiGenerator) from 11.2.0 to 11.3.0. - [Release notes](https://github.com/PublicApiGenerator/PublicApiGenerator/releases) - [Commits](https://github.com/PublicApiGenerator/PublicApiGenerator/compare/11.2.0...11.3.0) --- updated-dependencies: - dependency-name: PublicApiGenerator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 082a6527b6..ac164b0527 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -11,7 +11,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + From 01bbb742e08df8e9f6ca490027d329fd631958df Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 18 Dec 2024 12:00:38 +0100 Subject: [PATCH 488/845] Accept new API https://github.com/PublicApiGenerator/PublicApiGenerator/pull/398 --- .../FluentAssertions/net47.verified.txt | 60 ++++++++-------- .../FluentAssertions/net6.0.verified.txt | 68 +++++++++---------- .../netstandard2.0.verified.txt | 60 ++++++++-------- .../netstandard2.1.verified.txt | 60 ++++++++-------- 4 files changed, 124 insertions(+), 124 deletions(-) diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 29780df5ba..519a0bbd64 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -42,23 +42,23 @@ namespace FluentAssertions public static FluentAssertions.Events.IMonitor Monitor(this T eventSource) { } public static FluentAssertions.Events.IMonitor Monitor(this T eventSource, System.Action configureOptions) { } public static FluentAssertions.Specialized.ExecutionTimeAssertions Should(this FluentAssertions.Specialized.ExecutionTime executionTime) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Specialized.ExecutionTimeAssertions _) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase _) { } public static FluentAssertions.Types.MethodInfoSelectorAssertions Should(this FluentAssertions.Types.MethodInfoSelector methodSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Types.MethodInfoSelectorAssertions _) { } public static FluentAssertions.Types.PropertyInfoSelectorAssertions Should(this FluentAssertions.Types.PropertyInfoSelector propertyInfoSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Types.PropertyInfoSelectorAssertions _) { } public static FluentAssertions.Types.TypeSelectorAssertions Should(this FluentAssertions.Types.TypeSelector typeSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } public static FluentAssertions.Specialized.ActionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Action action) { } public static FluentAssertions.Collections.StringCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable @this) { } @@ -108,32 +108,32 @@ namespace FluentAssertions public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ulong? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this ushort actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ushort? actualValue) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.BooleanAssertions _) where TAssertions : FluentAssertions.Primitives.BooleanAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateTimeAssertions _) where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateTimeOffsetAssertions _) where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateTimeOffsetRangeAssertions _) where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateTimeRangeAssertions _) where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.GuidAssertions _) where TAssertions : FluentAssertions.Primitives.GuidAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.SimpleTimeSpanAssertions _) where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { } public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable actualValue) { } @@ -141,18 +141,18 @@ namespace FluentAssertions public static FluentAssertions.Specialized.FunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func func) { } public static FluentAssertions.Numeric.ComparableTypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IComparable comparableValue) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Numeric.NumericAssertionsBase _) where TSubject : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NumericAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.EnumAssertions _) where TEnum : struct, System.Enum where TAssertions : FluentAssertions.Primitives.EnumAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.ReferenceTypeAssertions _) where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { } public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IDictionary actualValue) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 2de7ac489f..7f1a4b1739 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -42,23 +42,23 @@ namespace FluentAssertions public static FluentAssertions.Events.IMonitor Monitor(this T eventSource) { } public static FluentAssertions.Events.IMonitor Monitor(this T eventSource, System.Action configureOptions) { } public static FluentAssertions.Specialized.ExecutionTimeAssertions Should(this FluentAssertions.Specialized.ExecutionTime executionTime) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Specialized.ExecutionTimeAssertions _) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase _) { } public static FluentAssertions.Types.MethodInfoSelectorAssertions Should(this FluentAssertions.Types.MethodInfoSelector methodSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Types.MethodInfoSelectorAssertions _) { } public static FluentAssertions.Types.PropertyInfoSelectorAssertions Should(this FluentAssertions.Types.PropertyInfoSelector propertyInfoSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Types.PropertyInfoSelectorAssertions _) { } public static FluentAssertions.Types.TypeSelectorAssertions Should(this FluentAssertions.Types.TypeSelector typeSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } public static FluentAssertions.Specialized.ActionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Action action) { } public static FluentAssertions.Collections.StringCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable @this) { } @@ -113,40 +113,40 @@ namespace FluentAssertions public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ulong? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this ushort actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ushort? actualValue) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.BooleanAssertions _) where TAssertions : FluentAssertions.Primitives.BooleanAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateOnlyAssertions _) where TAssertions : FluentAssertions.Primitives.DateOnlyAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateTimeAssertions _) where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateTimeOffsetAssertions _) where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateTimeOffsetRangeAssertions _) where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateTimeRangeAssertions _) where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.GuidAssertions _) where TAssertions : FluentAssertions.Primitives.GuidAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.SimpleTimeSpanAssertions _) where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.TimeOnlyAssertions _) where TAssertions : FluentAssertions.Primitives.TimeOnlyAssertions { } public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable actualValue) { } @@ -154,18 +154,18 @@ namespace FluentAssertions public static FluentAssertions.Specialized.FunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func func) { } public static FluentAssertions.Numeric.ComparableTypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IComparable comparableValue) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Numeric.NumericAssertionsBase _) where TSubject : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NumericAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.EnumAssertions _) where TEnum : struct, System.Enum where TAssertions : FluentAssertions.Primitives.EnumAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.ReferenceTypeAssertions _) where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { } public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IDictionary actualValue) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 9aa098ceaf..08eaf7cde3 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -40,23 +40,23 @@ namespace FluentAssertions public static System.Action Invoking(this T subject, System.Action action) { } public static System.Func Invoking(this T subject, System.Func action) { } public static FluentAssertions.Specialized.ExecutionTimeAssertions Should(this FluentAssertions.Specialized.ExecutionTime executionTime) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Specialized.ExecutionTimeAssertions _) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase _) { } public static FluentAssertions.Types.MethodInfoSelectorAssertions Should(this FluentAssertions.Types.MethodInfoSelector methodSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Types.MethodInfoSelectorAssertions _) { } public static FluentAssertions.Types.PropertyInfoSelectorAssertions Should(this FluentAssertions.Types.PropertyInfoSelector propertyInfoSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Types.PropertyInfoSelectorAssertions _) { } public static FluentAssertions.Types.TypeSelectorAssertions Should(this FluentAssertions.Types.TypeSelector typeSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } public static FluentAssertions.Specialized.ActionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Action action) { } public static FluentAssertions.Collections.StringCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable @this) { } @@ -106,32 +106,32 @@ namespace FluentAssertions public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ulong? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this ushort actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ushort? actualValue) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.BooleanAssertions _) where TAssertions : FluentAssertions.Primitives.BooleanAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateTimeAssertions _) where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateTimeOffsetAssertions _) where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateTimeOffsetRangeAssertions _) where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateTimeRangeAssertions _) where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.GuidAssertions _) where TAssertions : FluentAssertions.Primitives.GuidAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.SimpleTimeSpanAssertions _) where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { } public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable actualValue) { } @@ -139,18 +139,18 @@ namespace FluentAssertions public static FluentAssertions.Specialized.FunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func func) { } public static FluentAssertions.Numeric.ComparableTypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IComparable comparableValue) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Numeric.NumericAssertionsBase _) where TSubject : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NumericAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.EnumAssertions _) where TEnum : struct, System.Enum where TAssertions : FluentAssertions.Primitives.EnumAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.ReferenceTypeAssertions _) where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { } public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IDictionary actualValue) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 7e2a958685..5e103b1362 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -42,23 +42,23 @@ namespace FluentAssertions public static FluentAssertions.Events.IMonitor Monitor(this T eventSource) { } public static FluentAssertions.Events.IMonitor Monitor(this T eventSource, System.Action configureOptions) { } public static FluentAssertions.Specialized.ExecutionTimeAssertions Should(this FluentAssertions.Specialized.ExecutionTime executionTime) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Specialized.ExecutionTimeAssertions _) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase _) { } public static FluentAssertions.Types.MethodInfoSelectorAssertions Should(this FluentAssertions.Types.MethodInfoSelector methodSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Types.MethodInfoSelectorAssertions _) { } public static FluentAssertions.Types.PropertyInfoSelectorAssertions Should(this FluentAssertions.Types.PropertyInfoSelector propertyInfoSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Types.PropertyInfoSelectorAssertions _) { } public static FluentAssertions.Types.TypeSelectorAssertions Should(this FluentAssertions.Types.TypeSelector typeSelector) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } public static FluentAssertions.Specialized.ActionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Action action) { } public static FluentAssertions.Collections.StringCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable @this) { } @@ -108,32 +108,32 @@ namespace FluentAssertions public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ulong? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this ushort actualValue) { } public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ushort? actualValue) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.BooleanAssertions _) where TAssertions : FluentAssertions.Primitives.BooleanAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateTimeAssertions _) where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateTimeOffsetAssertions _) where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateTimeOffsetRangeAssertions _) where TAssertions : FluentAssertions.Primitives.DateTimeOffsetAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.DateTimeRangeAssertions _) where TAssertions : FluentAssertions.Primitives.DateTimeAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.GuidAssertions _) where TAssertions : FluentAssertions.Primitives.GuidAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.SimpleTimeSpanAssertions _) where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { } public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable actualValue) { } @@ -141,18 +141,18 @@ namespace FluentAssertions public static FluentAssertions.Specialized.FunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func func) { } public static FluentAssertions.Numeric.ComparableTypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IComparable comparableValue) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Numeric.NumericAssertionsBase _) where TSubject : struct, System.IComparable where TAssertions : FluentAssertions.Numeric.NumericAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.EnumAssertions _) where TEnum : struct, System.Enum where TAssertions : FluentAssertions.Primitives.EnumAssertions { } - [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + - "ly following \'And\'", true)] + [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.ReferenceTypeAssertions _) where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { } public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IDictionary actualValue) { } From b46d37e0329c2b13c219eb6e01873301a873ff00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 09:09:05 +0000 Subject: [PATCH 489/845] Bump Roslynator.Analyzers from 4.12.9 to 4.12.10 Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.12.9 to 4.12.10. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.12.9...v4.12.10) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 3b1e1582d3..76a62cad11 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 81496128e02b1696ef9b3038eed614ce76932843 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 09:05:52 +0000 Subject: [PATCH 490/845] Bump LibGit2Sharp from 0.30.0 to 0.31.0 Bumps [LibGit2Sharp](https://github.com/libgit2/libgit2sharp) from 0.30.0 to 0.31.0. - [Release notes](https://github.com/libgit2/libgit2sharp/releases) - [Changelog](https://github.com/libgit2/libgit2sharp/blob/master/CHANGES.md) - [Commits](https://github.com/libgit2/libgit2sharp/compare/0.30.0...0.31.0) --- updated-dependencies: - dependency-name: LibGit2Sharp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 694af57e9e..d453d9ca6c 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -22,7 +22,7 @@ - + From be800650ecda14d64fd90a14dc9651ed1a6cb204 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:33:18 +0000 Subject: [PATCH 491/845] Bump the xunit group with 3 updates Bumps the xunit group with 3 updates: [Verify.Xunit](https://github.com/VerifyTests/Verify), [xunit.v3](https://github.com/xunit/xunit) and [xunit.v3.core](https://github.com/xunit/xunit). Updates `Verify.Xunit` from 28.5.0 to 28.6.0 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/28.5.0...28.6.0) Updates `xunit.v3` from 0.5.0-pre.27 to 1.0.0 - [Commits](https://github.com/xunit/xunit/compare/v3-0.5.0-pre.27...v3-1.0.0) Updates `xunit.v3.core` from 0.5.0-pre.27 to 1.0.0 - [Commits](https://github.com/xunit/xunit/compare/v3-0.5.0-pre.27...v3-1.0.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit - dependency-name: xunit.v3 dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: xunit.v3.core dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index ac164b0527..5fb1683d77 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj index 3510eb353d..323c67cc3f 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -9,7 +9,7 @@ - + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index bc14020d17..5e003843f2 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -9,7 +9,7 @@ - + From 888ecd97760528af2e45d1d6caee6c4647828efe Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 18 Dec 2024 13:03:21 +0100 Subject: [PATCH 492/845] Update xunit.runner.visualstudio where possible 3.0.0 requires net472 where we current only require net47 --- Tests/Approval.Tests/Approval.Tests.csproj | 4 ++-- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 5fb1683d77..e206c9d4fd 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -1,4 +1,4 @@ - + net8.0 @@ -7,7 +7,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 7b688bce62..0c309535e1 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -12,7 +12,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj index 323c67cc3f..bcc9870bf9 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -10,7 +10,7 @@ - + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index 5e003843f2..b823c7eee4 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -10,7 +10,7 @@ - + diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 312dbd460c..37eeb5a60c 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 7449dd77a9a628bf6eddf86488d2eff6d0a13aa7 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 18 Dec 2024 13:28:19 +0100 Subject: [PATCH 493/845] ReportGenerator 5.2.0 -> 5.4.1 --- Build/Build.cs | 2 +- Build/_build.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Build/Build.cs b/Build/Build.cs index e1621d5c5b..0ab797bebf 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -220,7 +220,7 @@ class Build : NukeBuild { ReportGenerator(s => s .SetProcessToolPath(NuGetToolPathResolver.GetPackageExecutable("ReportGenerator", "ReportGenerator.dll", - framework: "net6.0")) + framework: "net8.0")) .SetTargetDirectory(TestResultsDirectory / "reports") .AddReports(TestResultsDirectory / "**/coverage.cobertura.xml") .AddReportTypes( diff --git a/Build/_build.csproj b/Build/_build.csproj index d453d9ca6c..776eecb73f 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -20,7 +20,7 @@ - + From 6c991299a15b20ae697b993f17894cff8766909c Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 18 Dec 2024 13:40:15 +0100 Subject: [PATCH 494/845] GitVersion.Tool 6.0.2 -> 6.1.0 --- Build/Build.cs | 2 +- Build/_build.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Build/Build.cs b/Build/Build.cs index 0ab797bebf..159108a4c6 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -57,7 +57,7 @@ class Build : NukeBuild readonly Solution Solution; [Required] - [GitVersion(Framework = "net6.0", NoCache = true, NoFetch = true)] + [GitVersion(Framework = "net8.0", NoCache = true, NoFetch = true)] readonly GitVersion GitVersion; [Required] diff --git a/Build/_build.csproj b/Build/_build.csproj index 776eecb73f..c777d8b038 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -19,7 +19,7 @@ OS_MAC - + From 38e97111bdf300347d8a85e8f2ba58491432d1bc Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 18 Dec 2024 14:17:23 +0100 Subject: [PATCH 495/845] System.Xml.XPath.XmlDocument 4.3.0 -> 4.7.0 in UWP.Specs 4.7.0 has 0 additional nuget dependencies. This removes nuget warnings about depending on vulnerable packages: * System.Private.Uri 4.3.0 * System.Text.RegularExpressions 4.3.0 https://www.nuget.org/packages/System.Xml.XPath.XmlDocument/4.3.0#dependencies-body-tab https://www.nuget.org/packages/System.Xml.XPath.XmlDocument/4.7.0#dependencies-body-tab --- Tests/UWP.Specs/UWP.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/UWP.Specs/UWP.Specs.csproj b/Tests/UWP.Specs/UWP.Specs.csproj index f1a992df33..5ba35ff8ff 100644 --- a/Tests/UWP.Specs/UWP.Specs.csproj +++ b/Tests/UWP.Specs/UWP.Specs.csproj @@ -95,7 +95,7 @@ 3.6.4 - 4.3.0 + 4.7.0 From f94f5977b0f1f9ad9908adf111b6640646961fc7 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 18 Dec 2024 16:26:53 +0100 Subject: [PATCH 496/845] Use Microsoft.NET.Test.Sdk 17.3.3 instead of default 16.11.0 for UWP.Specs Bumps a dependency on vulnerable newtonsoft.json from 9.0.1 to 13.0.1 --- Tests/UWP.Specs/UWP.Specs.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/UWP.Specs/UWP.Specs.csproj b/Tests/UWP.Specs/UWP.Specs.csproj index 5ba35ff8ff..06c3a03da6 100644 --- a/Tests/UWP.Specs/UWP.Specs.csproj +++ b/Tests/UWP.Specs/UWP.Specs.csproj @@ -22,6 +22,7 @@ true false + 17.3.3 true From 430a25d12bc191aeabcbfc3057e86476621f92fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 09:20:39 +0200 Subject: [PATCH 497/845] Bump actions/checkout from 3 to 4 (#2333) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08caf2633d..a082a5c344 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: DOTNET_NOLOGO: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -55,7 +55,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 From 20215aa5453ad1fb421486aa3a82d237131a5614 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Thu, 16 Nov 2023 11:24:51 +0100 Subject: [PATCH 498/845] Remove .NET Core 2.1.x and 3.1.x from build SDK setup (#2467) --- .github/workflows/build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a082a5c344..90eca1100b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,8 +19,6 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | - 2.1.x - 3.1.x 6.0.x 7.0.x @@ -63,8 +61,6 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | - 2.1.x - 3.1.x 6.0.x 7.0.x From 579c57922d3a77dcc593f9a5aeee17fb222b0d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sun, 19 Nov 2023 17:02:21 +0100 Subject: [PATCH 499/845] Run tests under .NET 8 (#2466) --- .github/workflows/build.yml | 2 ++ README.md | 2 +- Src/FluentAssertions/FluentAssertions.csproj | 2 +- Tests/Benchmarks/BeEquivalentToWithDeeplyNestedStructures.cs | 2 +- Tests/Benchmarks/Benchmarks.csproj | 2 +- Tests/Benchmarks/CollectionEqual.cs | 2 +- Tests/Benchmarks/Issue1657.cs | 2 +- docs/_config.yml | 2 +- docs/index.html | 4 ++-- global.json | 2 +- 10 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90eca1100b..93f4addee0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,7 @@ jobs: dotnet-version: | 6.0.x 7.0.x + 8.0.x - name: Run NUKE run: ./build.ps1 @@ -63,6 +64,7 @@ jobs: dotnet-version: | 6.0.x 7.0.x + 8.0.x - name: Run NUKE run: ./build.sh UnitTests diff --git a/README.md b/README.md index 2551f8e5a3..497e01b244 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ [![open issues](https://img.shields.io/github/issues/fluentassertions/fluentassertions)](https://github.com/fluentassertions/fluentassertions/issues) ![](https://img.shields.io/badge/release%20strategy-githubflow-orange.svg) -A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Targets .NET Framework 4.7, as well as .NET 6, .NET Standard 2.0 and 2.1. +A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher. See https://www.fluentassertions.com for [background information](https://fluentassertions.com/about/), [usage documentation](https://fluentassertions.com/introduction), an [extensibility guide](https://fluentassertions.com/extensibility/), support information and more [tips & tricks](https://fluentassertions.com/tips/). diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 963db04116..edb0f20cbb 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -18,7 +18,7 @@ Dennis Doomen;Jonas Nyrup A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or - BDD-style unit tests. Targets .NET Framework 4.7, .NET 6, as well as .NET Standard 2.0 and 2.1. + BDD-style unit tests. Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher. Supports the unit test frameworks MSTest2, NUnit3, XUnit2 and MSpec. Supported by InfoSupport B.V. diff --git a/Tests/Benchmarks/BeEquivalentToWithDeeplyNestedStructures.cs b/Tests/Benchmarks/BeEquivalentToWithDeeplyNestedStructures.cs index 3cd1072b9e..a247d830b1 100644 --- a/Tests/Benchmarks/BeEquivalentToWithDeeplyNestedStructures.cs +++ b/Tests/Benchmarks/BeEquivalentToWithDeeplyNestedStructures.cs @@ -8,7 +8,7 @@ namespace Benchmarks; [MemoryDiagnoser] [SimpleJob(RuntimeMoniker.Net472)] -[SimpleJob(RuntimeMoniker.Net60)] +[SimpleJob(RuntimeMoniker.Net80)] public class BeEquivalentToWithDeeplyNestedStructures { public class ComplexType diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index 261ff5e0d4..3379c9b0a9 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -1,6 +1,6 @@  - net6;net472 + net472;net8.0 True ..\..\Src\FluentAssertions\FluentAssertions.snk Exe diff --git a/Tests/Benchmarks/CollectionEqual.cs b/Tests/Benchmarks/CollectionEqual.cs index 2173f235cc..38d013a57f 100644 --- a/Tests/Benchmarks/CollectionEqual.cs +++ b/Tests/Benchmarks/CollectionEqual.cs @@ -8,7 +8,7 @@ namespace Benchmarks; [MemoryDiagnoser] [SimpleJob(RuntimeMoniker.Net472)] -[SimpleJob(RuntimeMoniker.Net60)] +[SimpleJob(RuntimeMoniker.Net80)] public class CollectionEqualBenchmarks { private IEnumerable collection1; diff --git a/Tests/Benchmarks/Issue1657.cs b/Tests/Benchmarks/Issue1657.cs index 167bf97771..44f42ad421 100644 --- a/Tests/Benchmarks/Issue1657.cs +++ b/Tests/Benchmarks/Issue1657.cs @@ -9,7 +9,7 @@ namespace Benchmarks; [MemoryDiagnoser] [SimpleJob(RuntimeMoniker.Net472)] -[SimpleJob(RuntimeMoniker.Net60)] +[SimpleJob(RuntimeMoniker.Net80)] public class Issue1657 { private List list; diff --git a/docs/_config.yml b/docs/_config.yml index 0a5592958a..7d0ae17a3c 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -19,7 +19,7 @@ locale : "en-US" title : "Fluent Assertions" title_separator : "-" name : "Dennis Doomen" -description : "A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Targets .NET Framework 4.7, .NET 6.0, as well as .NET Standard 2.0 and 2.1." +description : "A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher." url : "http://www.fluentassertions.com" # the base hostname & protocol for your site e.g. "https://mmistakes.github.io" baseurl : # the subpath of your site, e.g. "/blog" repository : "fluentassertions/fluentassertions" # GitHub username/repo-name e.g. "mmistakes/minimal-mistakes" diff --git a/docs/index.html b/docs/index.html index 1a143b203b..28153ef0a7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -29,7 +29,7 @@ [ Buy us a coffee](https://ko-fi.com/dennisdoomen){: .btn .btn--paypal}
A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or - BDD-style unit tests. Targets .NET Framework 4.7, as well as .NET 6, .NET Standard 2.0 and 2.1.' + BDD-style unit tests. Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher.' feature_row: - title: "Intention-Revealing Unit Tests" image_path: /assets/images/binoculars.svg @@ -53,7 +53,7 @@ - title: "Feature Complete" image_path: /assets/images/checklist.svg excerpt: ' -Targets .NET 4.7, .NET 6, .NET Standard 2.0 and 2.1. +Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher. Supports MSTest2, xUnit2, NUnit3 and MSpec. ' - title: "Great Support" diff --git a/global.json b/global.json index 87f1d59214..368a14e31c 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.101", + "version": "8.0.100", "rollForward": "latestMajor" } } From 97ca5f49322237a40b07b22295c3389af625af82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 15:39:32 +0000 Subject: [PATCH 500/845] Bump actions/setup-dotnet from 3 to 4 Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 3 to 4. - [Release notes](https://github.com/actions/setup-dotnet/releases) - [Commits](https://github.com/actions/setup-dotnet/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-dotnet dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93f4addee0..875d373bb2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: fetch-depth: 0 - name: Setup .NET SDKs - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 6.0.x @@ -59,7 +59,7 @@ jobs: fetch-depth: 0 - name: Setup .NET SDKs - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 6.0.x From 999e056ebf345705a60f8e86a17ef70cff5d0b1b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 16:07:09 +0000 Subject: [PATCH 501/845] Bump actions/upload-artifact from 3 to 4 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 875d373bb2..bded11602b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,7 @@ jobs: file: TestResults/reports/lcov.info - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: ./Artifacts/* only-unit-tests: From 4af8045f8ec02ccb0680e7ec706af95f79a968f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:11:55 +0000 Subject: [PATCH 502/845] Bump andstor/file-existence-action from 2 to 3 Bumps [andstor/file-existence-action](https://github.com/andstor/file-existence-action) from 2 to 3. - [Release notes](https://github.com/andstor/file-existence-action/releases) - [Commits](https://github.com/andstor/file-existence-action/compare/v2...v3) --- updated-dependencies: - dependency-name: andstor/file-existence-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bded11602b..4ed1319b1e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: - name: Check for 'lcov.info' existence id: check_files - uses: andstor/file-existence-action@v2 + uses: andstor/file-existence-action@v3 with: files: "TestResults/reports/lcov.info" From 53dbb8066cd7830dcb0195c806e59aa193dbdd4b Mon Sep 17 00:00:00 2001 From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com> Date: Sun, 13 Oct 2024 15:54:03 +0200 Subject: [PATCH 503/845] Bump macOS/ubuntu version for tests (#2777) * Bump macOS version for tests * Bump ubuntu version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ed1319b1e..1b2d3a6fe0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: strategy: matrix: - os: [ubuntu-22.04, macos-12] + os: [ubuntu-24.04, macos-15] runs-on: ${{ matrix.os }} From bb3a89ff43e2a27826b4356fdc4cac7bff31ed9c Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Thu, 19 Dec 2024 12:47:13 +0100 Subject: [PATCH 504/845] System.Collections is not needed since net472 --- Tests/Benchmarks/Benchmarks.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index 3379c9b0a9..cb4d1f9215 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -11,7 +11,6 @@ - From 8be39be6465e93d783155e0021215861d670df9a Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Thu, 19 Dec 2024 12:50:58 +0100 Subject: [PATCH 505/845] Ignore nuget warnings from MSpec --- Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj index 55dc9b5f52..df63c74a74 100644 --- a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj +++ b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj @@ -3,6 +3,7 @@ net6.0 MSpec.Specs MSpec.Specs + $(NoWarn);NU1903
From 4782170c9715501751dac11604bf2fb31563326a Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Thu, 28 Nov 2024 19:39:12 +0100 Subject: [PATCH 506/845] Including or excluding members did not work when WithMapping was used. --- .github/workflows/codeql.yml | 1 + FluentAssertions.sln.DotSettings | 1 + Src/FluentAssertions/Common/MemberPath.cs | 2 +- .../Common/StringExtensions.cs | 11 -- Src/FluentAssertions/Common/TypeExtensions.cs | 2 +- .../Equivalency/AssertionChainExtensions.cs | 2 +- .../EquivalencyValidationContext.cs | 4 +- .../Equivalency/EquivalencyValidator.cs | 2 +- .../Equivalency/Execution/ObjectInfo.cs | 2 +- Src/FluentAssertions/Equivalency/Field.cs | 15 +- Src/FluentAssertions/Equivalency/INode.cs | 42 ++--- .../Matching/MappedMemberMatchingRule.cs | 2 +- .../Matching/MappedPathMatchingRule.cs | 2 +- .../Matching/MustMatchByNameRule.cs | 8 +- .../Matching/TryMatchByNameRule.cs | 4 +- Src/FluentAssertions/Equivalency/Node.cs | 71 ++++---- Src/FluentAssertions/Equivalency/Pathway.cs | 73 ++++++++ Src/FluentAssertions/Equivalency/Property.cs | 6 +- .../Selection/MemberToMemberInfoAdapter.cs | 4 +- .../SelectMemberByPathSelectionRule.cs | 2 +- .../Steps/AssertionRuleEquivalencyStep.cs | 6 +- .../Equivalency/Steps/AutoConversionStep.cs | 4 +- .../Steps/DictionaryEquivalencyStep.cs | 4 +- .../Steps/EnumerableEquivalencyValidator.cs | 14 +- .../Steps/StringEqualityEquivalencyStep.cs | 2 +- .../StructuralEqualityEquivalencyStep.cs | 10 +- .../Steps/ValueTypeEquivalencyStep.cs | 2 +- .../FluentAssertions/net47.verified.txt | 18 +- .../FluentAssertions/net6.0.verified.txt | 18 +- .../netstandard2.0.verified.txt | 18 +- .../netstandard2.1.verified.txt | 18 +- .../BasicSpecs.cs | 4 +- .../ExtensibilitySpecs.cs | 4 +- .../MemberLessObjectsSpecs.cs | 2 +- .../MemberMatchingSpecs.cs | 163 +++++++++++++++++- .../NestedPropertiesSpecs.cs | 2 +- .../SelectionRulesSpecs.Basic.cs | 6 +- .../SelectionRulesSpecs.Browsability.cs | 2 +- .../SelectionRulesSpecs.cs | 2 +- .../Execution/CallerIdentificationSpecs.cs | 2 +- .../Numeric/ComparableSpecs.cs | 2 +- docs/_pages/releases.md | 1 + 42 files changed, 401 insertions(+), 159 deletions(-) create mode 100644 Src/FluentAssertions/Equivalency/Pathway.cs diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index b91ae834b8..bd99c3708c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -31,6 +31,7 @@ jobs: 8.0.x - name: Checkout repository + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. diff --git a/FluentAssertions.sln.DotSettings b/FluentAssertions.sln.DotSettings index 57338f40c4..63be72f08a 100644 --- a/FluentAssertions.sln.DotSettings +++ b/FluentAssertions.sln.DotSettings @@ -145,6 +145,7 @@ <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> OUTLINE + Minimal SOLUTION_FOLDER True True diff --git a/Src/FluentAssertions/Common/MemberPath.cs b/Src/FluentAssertions/Common/MemberPath.cs index 77cf3a3c20..80a69302a6 100644 --- a/Src/FluentAssertions/Common/MemberPath.cs +++ b/Src/FluentAssertions/Common/MemberPath.cs @@ -20,7 +20,7 @@ internal class MemberPath private static readonly MemberPathSegmentEqualityComparer MemberPathSegmentEqualityComparer = new(); public MemberPath(IMember member, string parentPath) - : this(member.ReflectedType, member.DeclaringType, parentPath.Combine(member.Name)) + : this(member.ReflectedType, member.DeclaringType, parentPath.Combine(member.Expectation.Name)) { } diff --git a/Src/FluentAssertions/Common/StringExtensions.cs b/Src/FluentAssertions/Common/StringExtensions.cs index a5177c4e0e..b871f3f60a 100644 --- a/Src/FluentAssertions/Common/StringExtensions.cs +++ b/Src/FluentAssertions/Common/StringExtensions.cs @@ -59,12 +59,6 @@ public static bool ContainsSpecificCollectionIndex(this string indexedPath) public static string EscapePlaceholders(this string value) => value.Replace("{", "{{", StringComparison.Ordinal).Replace("}", "}}", StringComparison.Ordinal); - /// - /// Replaces all characters that might conflict with formatting placeholders with their escaped counterparts. - /// - internal static string UnescapePlaceholders(this string value) => - value.Replace("{{", "{", StringComparison.Ordinal).Replace("}}", "}", StringComparison.Ordinal); - /// /// Joins a string with one or more other strings using a specified separator. /// @@ -78,11 +72,6 @@ public static string Combine(this string @this, string other, string separator = return other.Length != 0 ? other : string.Empty; } - if (other.Length == 0) - { - return @this; - } - if (other.StartsWith('[')) { separator = string.Empty; diff --git a/Src/FluentAssertions/Common/TypeExtensions.cs b/Src/FluentAssertions/Common/TypeExtensions.cs index 966bf39bf6..c13fd8030a 100644 --- a/Src/FluentAssertions/Common/TypeExtensions.cs +++ b/Src/FluentAssertions/Common/TypeExtensions.cs @@ -138,7 +138,7 @@ public static bool IsEquivalentTo(this IMember property, IMember otherProperty) { return (property.DeclaringType.IsSameOrInherits(otherProperty.DeclaringType) || otherProperty.DeclaringType.IsSameOrInherits(property.DeclaringType)) && - property.Name == otherProperty.Name; + property.Expectation.Name == otherProperty.Expectation.Name; } /// diff --git a/Src/FluentAssertions/Equivalency/AssertionChainExtensions.cs b/Src/FluentAssertions/Equivalency/AssertionChainExtensions.cs index 95227db2cb..d7cfd1e1e5 100644 --- a/Src/FluentAssertions/Equivalency/AssertionChainExtensions.cs +++ b/Src/FluentAssertions/Equivalency/AssertionChainExtensions.cs @@ -10,7 +10,7 @@ internal static class AssertionChainExtensions /// public static AssertionChain For(this AssertionChain chain, IEquivalencyValidationContext context) { - chain.OverrideCallerIdentifier(() => context.CurrentNode.Description); + chain.OverrideCallerIdentifier(() => context.CurrentNode.Subject.Description); return chain .WithReportable("configuration", () => context.Options.ToString()) diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs index 2fbced998e..f596364fa8 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs @@ -74,7 +74,7 @@ public bool IsCyclicReference(object expectation) bool compareByMembers = expectation is not null && Options.GetEqualityStrategy(expectation.GetType()) is EqualityStrategy.Members or EqualityStrategy.ForceMembers; - var reference = new ObjectReference(expectation, CurrentNode.PathAndName, compareByMembers); + var reference = new ObjectReference(expectation, CurrentNode.Subject.PathAndName, compareByMembers); return CyclicReferenceDetector.IsCyclicReference(reference); } @@ -82,6 +82,6 @@ public bool IsCyclicReference(object expectation) public override string ToString() { - return Invariant($"{{Path=\"{CurrentNode.Description}\"}}"); + return Invariant($"{{Path=\"{CurrentNode.Subject.PathAndName}\"}}"); } } diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs index e79505f608..df89ff076a 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs @@ -90,7 +90,7 @@ private static void AssertEquivalencyForCyclicReference(Comparands comparands, A private void TryToProveNodesAreEquivalent(Comparands comparands, IEquivalencyValidationContext context) { - using var _ = context.Tracer.WriteBlock(node => node.Description); + using var _ = context.Tracer.WriteBlock(node => node.Expectation.Description); foreach (IEquivalencyStep step in AssertionOptions.EquivalencyPlan) { diff --git a/Src/FluentAssertions/Equivalency/Execution/ObjectInfo.cs b/Src/FluentAssertions/Equivalency/Execution/ObjectInfo.cs index 0f45024f21..345e572a05 100644 --- a/Src/FluentAssertions/Equivalency/Execution/ObjectInfo.cs +++ b/Src/FluentAssertions/Equivalency/Execution/ObjectInfo.cs @@ -8,7 +8,7 @@ public ObjectInfo(Comparands comparands, INode currentNode) { Type = currentNode.Type; ParentType = currentNode.ParentType; - Path = currentNode.PathAndName; + Path = currentNode.Expectation.PathAndName; CompileTimeType = comparands.CompileTimeType; RuntimeType = comparands.RuntimeType; } diff --git a/Src/FluentAssertions/Equivalency/Field.cs b/Src/FluentAssertions/Equivalency/Field.cs index 175a78d677..fc3d00a2fd 100644 --- a/Src/FluentAssertions/Equivalency/Field.cs +++ b/Src/FluentAssertions/Equivalency/Field.cs @@ -6,7 +6,7 @@ namespace FluentAssertions.Equivalency; /// -/// A specialized type of that represents a field of an object in a structural equivalency assertion. +/// A specialized type of that represents a field of an object in a structural equivalency assertion. /// internal class Field : Node, IMember { @@ -14,18 +14,13 @@ internal class Field : Node, IMember private bool? isBrowsable; public Field(FieldInfo fieldInfo, INode parent) - : this(fieldInfo.ReflectedType, fieldInfo, parent) - { - } - - public Field(Type reflectedType, FieldInfo fieldInfo, INode parent) { this.fieldInfo = fieldInfo; DeclaringType = fieldInfo.DeclaringType; - ReflectedType = reflectedType; - Path = parent.PathAndName; + ReflectedType = fieldInfo.ReflectedType; + Subject = new Pathway(parent.Subject.PathAndName, fieldInfo.Name, pathAndName => $"field {parent.GetSubjectId().Combine(pathAndName)}"); + Expectation = new Pathway(parent.Expectation.PathAndName, fieldInfo.Name, pathAndName => $"field {pathAndName}"); GetSubjectId = parent.GetSubjectId; - Name = fieldInfo.Name; Type = fieldInfo.FieldType; ParentType = fieldInfo.DeclaringType; RootIsCollection = parent.RootIsCollection; @@ -40,8 +35,6 @@ public object GetValue(object obj) public Type DeclaringType { get; set; } - public override string Description => $"field {GetSubjectId().Combine(PathAndName)}"; - public CSharpAccessModifier GetterAccessibility => fieldInfo.GetCSharpAccessModifier(); public CSharpAccessModifier SetterAccessibility => fieldInfo.GetCSharpAccessModifier(); diff --git a/Src/FluentAssertions/Equivalency/INode.cs b/Src/FluentAssertions/Equivalency/INode.cs index 29274315a0..d266ec307e 100644 --- a/Src/FluentAssertions/Equivalency/INode.cs +++ b/Src/FluentAssertions/Equivalency/INode.cs @@ -1,5 +1,4 @@ using System; -using JetBrains.Annotations; namespace FluentAssertions.Equivalency; @@ -15,14 +14,6 @@ public interface INode ///
GetSubjectId GetSubjectId { get; } - /// - /// Gets the name of this node. - /// - /// - /// "Property2" - /// - string Name { get; set; } - /// /// Gets the type of this node, e.g. the type of the field or property, or the type of the collection item. /// @@ -34,24 +25,17 @@ public interface INode /// /// Is for the root object. /// - [CanBeNull] Type ParentType { get; } /// - /// Gets the path from the root object UNTIL the current node, separated by dots or index/key brackets. + /// Gets the path from the root of the subject upto and including the current node. /// - /// - /// "Parent[0].Property2" - /// - string Path { get; } + Pathway Subject { get; internal set; } /// - /// Gets the full path from the root object up to and including the name of the node. + /// Gets the path from the root of the expectation upto and including the current node. /// - /// - /// "Parent[0]" - /// - string PathAndName { get; } + Pathway Expectation { get; } /// /// Gets a zero-based number representing the depth within the object graph @@ -62,14 +46,6 @@ public interface INode /// int Depth { get; } - /// - /// Gets the path including the description of the subject. - /// - /// - /// "property subject.Parent[0].Property2" - /// - string Description { get; } - /// /// Gets a value indicating whether the current node is the root. /// @@ -79,4 +55,14 @@ public interface INode /// Gets a value indicating if the root of this graph is a collection. /// bool RootIsCollection { get; } + + /// + /// Adjusts the current node to reflect a remapped subject member during a structural equivalency check. + /// Ensures that assertion failures report the correct subject member name when the matching process selects + /// a different member in the subject compared to the expectation. + /// + /// + /// The specific member in the subject that the current node should be remapped to. + /// + void AdjustForRemappedSubject(IMember subjectMember); } diff --git a/Src/FluentAssertions/Equivalency/Matching/MappedMemberMatchingRule.cs b/Src/FluentAssertions/Equivalency/Matching/MappedMemberMatchingRule.cs index faa1aaaea2..0eace99527 100644 --- a/Src/FluentAssertions/Equivalency/Matching/MappedMemberMatchingRule.cs +++ b/Src/FluentAssertions/Equivalency/Matching/MappedMemberMatchingRule.cs @@ -33,7 +33,7 @@ public MappedMemberMatchingRule(string expectationMemberName, string subjectMemb public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options, AssertionChain assertionChain) { if (parent.Type.IsSameOrInherits(typeof(TExpectation)) && subject is TSubject && - expectedMember.Name == expectationMemberName) + expectedMember.Subject.Name == expectationMemberName) { var member = MemberFactory.Find(subject, subjectMemberName, parent); diff --git a/Src/FluentAssertions/Equivalency/Matching/MappedPathMatchingRule.cs b/Src/FluentAssertions/Equivalency/Matching/MappedPathMatchingRule.cs index 88c44a8f4c..3c529aec80 100644 --- a/Src/FluentAssertions/Equivalency/Matching/MappedPathMatchingRule.cs +++ b/Src/FluentAssertions/Equivalency/Matching/MappedPathMatchingRule.cs @@ -52,7 +52,7 @@ public IMember Match(IMember expectedMember, object subject, INode parent, IEqui path = path.WithCollectionAsRoot(); } - if (path.IsEquivalentTo(expectedMember.PathAndName)) + if (path.IsEquivalentTo(expectedMember.Expectation.PathAndName)) { var member = MemberFactory.Find(subject, subjectPath.MemberName, parent); diff --git a/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs b/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs index 44715cb8de..e34bfa5076 100644 --- a/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs +++ b/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs @@ -16,7 +16,7 @@ public IMember Match(IMember expectedMember, object subject, INode parent, IEqui if (options.IncludedProperties != MemberVisibility.None) { PropertyInfo propertyInfo = subject.GetType().FindProperty( - expectedMember.Name, + expectedMember.Subject.Name, options.IncludedProperties | MemberVisibility.ExplicitlyImplemented | MemberVisibility.DefaultInterfaceProperties); subjectMember = propertyInfo is not null && !propertyInfo.IsIndexer() ? new Property(propertyInfo, parent) : null; @@ -25,7 +25,7 @@ public IMember Match(IMember expectedMember, object subject, INode parent, IEqui if (subjectMember is null && options.IncludedFields != MemberVisibility.None) { FieldInfo fieldInfo = subject.GetType().FindField( - expectedMember.Name, + expectedMember.Subject.Name, options.IncludedFields); subjectMember = fieldInfo is not null ? new Field(fieldInfo, parent) : null; @@ -34,12 +34,12 @@ public IMember Match(IMember expectedMember, object subject, INode parent, IEqui if (subjectMember is null) { assertionChain.FailWith( - $"Expectation has {expectedMember.Description} that the other object does not have."); + $"Expectation has {expectedMember.Expectation} that the other object does not have."); } else if (options.IgnoreNonBrowsableOnSubject && !subjectMember.IsBrowsable) { assertionChain.FailWith( - $"Expectation has {expectedMember.Description} that is non-browsable in the other object, and non-browsable " + + $"Expectation has {expectedMember.Expectation} that is non-browsable in the other object, and non-browsable " + "members on the subject are ignored with the current configuration"); } else diff --git a/Src/FluentAssertions/Equivalency/Matching/TryMatchByNameRule.cs b/Src/FluentAssertions/Equivalency/Matching/TryMatchByNameRule.cs index 9d6d7dc95c..19e729daaa 100644 --- a/Src/FluentAssertions/Equivalency/Matching/TryMatchByNameRule.cs +++ b/Src/FluentAssertions/Equivalency/Matching/TryMatchByNameRule.cs @@ -13,7 +13,7 @@ public IMember Match(IMember expectedMember, object subject, INode parent, IEqui { if (options.IncludedProperties != MemberVisibility.None) { - PropertyInfo property = subject.GetType().FindProperty(expectedMember.Name, + PropertyInfo property = subject.GetType().FindProperty(expectedMember.Expectation.Name, options.IncludedProperties | MemberVisibility.ExplicitlyImplemented); if (property is not null && !property.IsIndexer()) @@ -23,7 +23,7 @@ public IMember Match(IMember expectedMember, object subject, INode parent, IEqui } FieldInfo field = subject.GetType() - .FindField(expectedMember.Name, options.IncludedFields); + .FindField(expectedMember.Expectation.Name, options.IncludedFields); return field is not null ? new Field(field, parent) : null; } diff --git a/Src/FluentAssertions/Equivalency/Node.cs b/Src/FluentAssertions/Equivalency/Node.cs index 96ee51e87f..4f6d9d6f4e 100644 --- a/Src/FluentAssertions/Equivalency/Node.cs +++ b/Src/FluentAssertions/Equivalency/Node.cs @@ -12,10 +12,8 @@ internal class Node : INode private GetSubjectId subjectIdProvider; - private string path; - private string name; - private string pathAndName; private string cachedSubjectId; + private Pathway subject; public GetSubjectId GetSubjectId { @@ -27,29 +25,21 @@ public GetSubjectId GetSubjectId public Type ParentType { get; protected set; } - public string Path + public Pathway Subject { - get => path; - protected set - { - path = value; - pathAndName = null; - } - } - - public string PathAndName => pathAndName ??= Path.Combine(Name); - - public string Name - { - get => name; + get => subject; set { - name = value; - pathAndName = null; + subject = value; + + if (Expectation is null) + { + Expectation = value; + } } } - public virtual string Description => $"{GetSubjectId().Combine(PathAndName)}"; + public Pathway Expectation { get; protected set; } public bool IsRoot { @@ -57,20 +47,28 @@ public bool IsRoot { // If the root is a collection, we need treat the objects in that collection as the root of the graph because all options // refer to the type of the collection items. - return PathAndName.Length == 0 || (RootIsCollection && IsFirstIndex); + return Subject.PathAndName.Length == 0 || (RootIsCollection && IsFirstIndex); } } - private bool IsFirstIndex => MatchFirstIndex.IsMatch(PathAndName); + private bool IsFirstIndex => MatchFirstIndex.IsMatch(Subject.PathAndName); public bool RootIsCollection { get; protected set; } + public void AdjustForRemappedSubject(IMember subjectMember) + { + if (subject.Name != subjectMember.Subject.Name) + { + subject.Name = subjectMember.Subject.Name; + } + } + public int Depth { get { const char memberSeparator = '.'; - return PathAndName.Count(chr => chr == memberSeparator); + return Subject.PathAndName.Count(chr => chr == memberSeparator); } } @@ -84,8 +82,7 @@ public static INode From(GetSubjectId getSubjectId) return new Node { subjectIdProvider = () => getSubjectId() ?? "root", - Name = string.Empty, - Path = string.Empty, + Subject = new Pathway(string.Empty, string.Empty, _ => getSubjectId()), Type = typeof(T), ParentType = null, RootIsCollection = IsCollection(typeof(T)) @@ -94,12 +91,16 @@ public static INode From(GetSubjectId getSubjectId) public static INode FromCollectionItem(string index, INode parent) { + Pathway.GetDescription getDescription = pathAndName => parent.GetSubjectId().Combine(pathAndName); + + string itemName = "[" + index + "]"; + return new Node { Type = typeof(T), ParentType = parent.Type, - Name = "[" + index + "]", - Path = parent.PathAndName, + Subject = new Pathway(parent.Subject, itemName, getDescription), + Expectation = new Pathway(parent.Expectation, itemName, getDescription), GetSubjectId = parent.GetSubjectId, RootIsCollection = parent.RootIsCollection }; @@ -107,12 +108,16 @@ public static INode FromCollectionItem(string index, INode parent) public static INode FromDictionaryItem(object key, INode parent) { + Pathway.GetDescription getDescription = pathAndName => parent.GetSubjectId().Combine(pathAndName); + + string itemName = "[" + key + "]"; + return new Node { Type = typeof(T), ParentType = parent.Type, - Name = "[" + key + "]", - Path = parent.PathAndName, + Subject = new Pathway(parent.Subject, itemName, getDescription), + Expectation = new Pathway(parent.Expectation, itemName, getDescription), GetSubjectId = parent.GetSubjectId, RootIsCollection = parent.RootIsCollection }; @@ -138,7 +143,7 @@ public override bool Equals(object obj) return Equals((Node)obj); } - private bool Equals(Node other) => (Type, Name, Path) == (other.Type, other.Name, other.Path); + private bool Equals(Node other) => (Type, Subject.Name, Subject.Path) == (other.Type, other.Subject.Name, other.Subject.Path); public override int GetHashCode() { @@ -146,11 +151,11 @@ public override int GetHashCode() { #pragma warning disable CA1307 int hashCode = Type.GetHashCode(); - hashCode = (hashCode * 397) + Path.GetHashCode(); - hashCode = (hashCode * 397) + Name.GetHashCode(); + hashCode = (hashCode * 397) + Subject.Path.GetHashCode(); + hashCode = (hashCode * 397) + Subject.Name.GetHashCode(); return hashCode; } } - public override string ToString() => Description; + public override string ToString() => Subject.Description; } diff --git a/Src/FluentAssertions/Equivalency/Pathway.cs b/Src/FluentAssertions/Equivalency/Pathway.cs new file mode 100644 index 0000000000..d5d322f7f2 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Pathway.cs @@ -0,0 +1,73 @@ +using FluentAssertions.Common; + +namespace FluentAssertions.Equivalency; + +/// +/// Represents the path of a field or property in an object graph. +/// +public record Pathway +{ + public delegate string GetDescription(string pathAndName); + + private readonly string path = string.Empty; + private string name = string.Empty; + private string pathAndName; + + private readonly GetDescription getDescription; + + public Pathway(string path, string name, GetDescription getDescription) + { + Path = path; + Name = name; + this.getDescription = getDescription; + } + + /// + /// Creates an instance of with the specified parent and name and a factory + /// to provide a description for the path and name. + /// + public Pathway(Pathway parent, string name, GetDescription getDescription) + { + Path = parent.PathAndName; + Name = name; + this.getDescription = getDescription; + } + + /// + /// Gets the path of the field or property without the name. + /// + public string Path + { + get => path; + private init + { + path = value; + pathAndName = null; + } + } + + /// + /// Gets the name of the field or property without the path. + /// + public string Name + { + get => name; + internal set + { + name = value; + pathAndName = null; + } + } + + /// + /// Gets the path and name of the field or property separated by dots. + /// + public string PathAndName => pathAndName ??= path.Combine(name); + + /// + /// Gets the display representation of this path. + /// + public string Description => getDescription(PathAndName); + + public override string ToString() => Description; +} diff --git a/Src/FluentAssertions/Equivalency/Property.cs b/Src/FluentAssertions/Equivalency/Property.cs index b198221339..33cce0a884 100644 --- a/Src/FluentAssertions/Equivalency/Property.cs +++ b/Src/FluentAssertions/Equivalency/Property.cs @@ -24,10 +24,10 @@ public Property(Type reflectedType, PropertyInfo propertyInfo, INode parent) ReflectedType = reflectedType; this.propertyInfo = propertyInfo; DeclaringType = propertyInfo.DeclaringType; - Name = propertyInfo.Name; + Subject = new Pathway(parent.Subject.PathAndName, propertyInfo.Name, pathAndName => $"property {parent.GetSubjectId().Combine(pathAndName)}"); + Expectation = new Pathway(parent.Expectation.PathAndName, propertyInfo.Name, pathAndName => $"property {pathAndName}"); Type = propertyInfo.PropertyType; ParentType = propertyInfo.DeclaringType; - Path = parent.PathAndName; GetSubjectId = parent.GetSubjectId; RootIsCollection = parent.RootIsCollection; } @@ -41,8 +41,6 @@ public object GetValue(object obj) public Type ReflectedType { get; } - public override string Description => $"property {GetSubjectId().Combine(PathAndName)}"; - public CSharpAccessModifier GetterAccessibility => propertyInfo.GetGetMethod(nonPublic: true).GetCSharpAccessModifier(); public CSharpAccessModifier SetterAccessibility => propertyInfo.GetSetMethod(nonPublic: true).GetCSharpAccessModifier(); diff --git a/Src/FluentAssertions/Equivalency/Selection/MemberToMemberInfoAdapter.cs b/Src/FluentAssertions/Equivalency/Selection/MemberToMemberInfoAdapter.cs index b855a5b69d..da84255f61 100644 --- a/Src/FluentAssertions/Equivalency/Selection/MemberToMemberInfoAdapter.cs +++ b/Src/FluentAssertions/Equivalency/Selection/MemberToMemberInfoAdapter.cs @@ -14,9 +14,9 @@ public MemberToMemberInfoAdapter(IMember member) { this.member = member; DeclaringType = member.DeclaringType; - Name = member.Name; + Name = member.Expectation.Name; Type = member.Type; - Path = member.PathAndName; + Path = member.Expectation.PathAndName; } public string Name { get; } diff --git a/Src/FluentAssertions/Equivalency/Selection/SelectMemberByPathSelectionRule.cs b/Src/FluentAssertions/Equivalency/Selection/SelectMemberByPathSelectionRule.cs index 77b9507bbb..ac37b31834 100644 --- a/Src/FluentAssertions/Equivalency/Selection/SelectMemberByPathSelectionRule.cs +++ b/Src/FluentAssertions/Equivalency/Selection/SelectMemberByPathSelectionRule.cs @@ -11,7 +11,7 @@ internal abstract class SelectMemberByPathSelectionRule : IMemberSelectionRule public IEnumerable SelectMembers(INode currentNode, IEnumerable selectedMembers, MemberSelectionContext context) { - var currentPath = RemoveRootIndexQualifier(currentNode.PathAndName); + var currentPath = RemoveRootIndexQualifier(currentNode.Expectation.PathAndName); var members = selectedMembers.ToList(); AddOrRemoveMembersFrom(members, currentNode, currentPath, context); diff --git a/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs index 2a1990786b..08498cb7dc 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs @@ -72,12 +72,12 @@ private bool ExecuteAssertion(Comparands comparands, IEquivalencyValidationConte assertionChain .ForCondition(subjectIsNull || comparands.Subject.GetType().IsSameOrInherits(typeof(TSubject))) - .FailWith("Expected " + context.CurrentNode.Description + " from subject to be a {0}{reason}, but found a {1}.", + .FailWith("Expected " + context.CurrentNode.Subject + " from subject to be a {0}{reason}, but found a {1}.", typeof(TSubject), comparands.Subject?.GetType()) .Then .ForCondition(expectationIsNull || comparands.Expectation.GetType().IsSameOrInherits(typeof(TSubject))) .FailWith( - "Expected " + context.CurrentNode.Description + " from expectation to be a {0}{reason}, but found a {1}.", + "Expected " + context.CurrentNode.Subject + " from expectation to be a {0}{reason}, but found a {1}.", typeof(TSubject), comparands.Expectation?.GetType()); if (assertionChain.Succeeded) @@ -88,7 +88,7 @@ private bool ExecuteAssertion(Comparands comparands, IEquivalencyValidationConte } // Caller identitification should not get confused about invoking a Should within the assertion action - string callerIdentifier = context.CurrentNode.Description; + string callerIdentifier = context.CurrentNode.Subject.ToString(); assertionChain.OverrideCallerIdentifier(() => callerIdentifier); assertionChain.ReuseOnce(); diff --git a/Src/FluentAssertions/Equivalency/Steps/AutoConversionStep.cs b/Src/FluentAssertions/Equivalency/Steps/AutoConversionStep.cs index e91c7daf5b..9d45787682 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AutoConversionStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AutoConversionStep.cs @@ -37,14 +37,14 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon if (TryChangeType(comparands.Subject, expectationType, out object convertedSubject)) { context.Tracer.WriteLine(member => - Invariant($"Converted subject {comparands.Subject} at {member.Description} to {expectationType}")); + Invariant($"Converted subject {comparands.Subject} at {member.Subject} to {expectationType}")); comparands.Subject = convertedSubject; } else { context.Tracer.WriteLine(member => - Invariant($"Subject {comparands.Subject} at {member.Description} could not be converted to {expectationType}")); + Invariant($"Subject {comparands.Subject} at {member.Subject} could not be converted to {expectationType}")); } return EquivalencyResult.ContinueWithNext; diff --git a/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs index 2b9f777887..67db86940f 100644 --- a/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs @@ -25,7 +25,7 @@ protected override EquivalencyResult OnHandle(Comparands comparands, if (context.Options.IsRecursive) { context.Tracer.WriteLine(member => - Invariant($"Recursing into dictionary item {key} at {member.Description}")); + Invariant($"Recursing into dictionary item {key} at {member.Expectation}")); nestedValidator.AssertEquivalencyOf(new Comparands(subject[key], expectation[key], typeof(object)), context.AsDictionaryItem(key)); } @@ -33,7 +33,7 @@ protected override EquivalencyResult OnHandle(Comparands comparands, { context.Tracer.WriteLine(member => Invariant( - $"Comparing dictionary item {key} at {member.Description} between subject and expectation")); + $"Comparing dictionary item {key} at {member.Expectation} between subject and expectation")); assertionChain.WithCallerPostfix($"[{key.ToFormattedString()}]").ReuseOnce(); subject[key].Should().Be(expectation[key], context.Reason.FormattedMessage, context.Reason.Arguments); diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs index c2e7d5640f..11e01ebb00 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs @@ -42,7 +42,7 @@ public void Execute(object[] subject, T[] expectation) if (Recursive) { using var _ = context.Tracer.WriteBlock(member => - Invariant($"Structurally comparing {subject} and expectation {expectation} at {member.Description}")); + Invariant($"Structurally comparing {subject} and expectation {expectation} at {member.Expectation}")); AssertElementGraphEquivalency(subject, expectation, context.CurrentNode); } @@ -50,7 +50,7 @@ public void Execute(object[] subject, T[] expectation) { using var _ = context.Tracer.WriteBlock(member => Invariant( - $"Comparing subject {subject} and expectation {expectation} at {member.Description} using simple value equality")); + $"Comparing subject {subject} and expectation {expectation} at {member.Expectation} using simple value equality")); subject.Should().BeEquivalentTo(expectation); } @@ -102,7 +102,7 @@ private void AssertElementGraphEquivalencyWithStrictOrdering(object[] subject using var _ = context.Tracer.WriteBlock(member => Invariant( - $"Strictly comparing expectation {expectation} at {member.Description} to item with index {index} in {subjects}")); + $"Strictly comparing expectation {expectation} at {member.Expectation} to item with index {index} in {subjects}")); bool succeeded = StrictlyMatchAgainst(subjects, expectation, index); if (!succeeded) @@ -111,7 +111,7 @@ private void AssertElementGraphEquivalencyWithStrictOrdering(object[] subject if (failedCount >= FailedItemsFastFailThreshold) { context.Tracer.WriteLine(member => - $"Aborting strict order comparison of collections after {FailedItemsFastFailThreshold} items failed at {member.Description}"); + $"Aborting strict order comparison of collections after {FailedItemsFastFailThreshold} items failed at {member.Expectation}"); break; } @@ -129,7 +129,7 @@ private void AssertElementGraphEquivalencyWithLooseOrdering(object[] subjects using var _ = context.Tracer.WriteBlock(member => Invariant( - $"Finding the best match of {expectation} within all items in {subjects} at {member.Description}[{index}]")); + $"Finding the best match of {expectation} within all items in {subjects} at {member.Expectation}[{index}]")); bool succeeded = LooselyMatchAgainst(subjects, expectation, index); @@ -140,7 +140,7 @@ private void AssertElementGraphEquivalencyWithLooseOrdering(object[] subjects if (failedCount >= FailedItemsFastFailThreshold) { context.Tracer.WriteLine(member => - $"Fail failing loose order comparison of collection after {FailedItemsFastFailThreshold} items failed at {member.Description}"); + $"Fail failing loose order comparison of collection after {FailedItemsFastFailThreshold} items failed at {member.Expectation}"); break; } @@ -156,7 +156,7 @@ private bool LooselyMatchAgainst(IList subjects, T expectation, int e int index = 0; GetTraceMessage getMessage = member => - $"Comparing subject at {member.Description}[{index}] with the expectation at {member.Description}[{expectationIndex}]"; + $"Comparing subject at {member.Subject}[{index}] with the expectation at {member.Expectation}[{expectationIndex}]"; int indexToBeRemoved = -1; diff --git a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs index ec0e70fd24..13087b32d5 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs @@ -79,7 +79,7 @@ private static bool ValidateAgainstNulls(AssertionChain assertionChain, Comparan if (onlyOneNull) { assertionChain.FailWith( - $"Expected {currentNode.Description} to be {{0}}{{reason}}, but found {{1}}.", expected, subject); + $"Expected {currentNode.Subject.Description} to be {{0}}{{reason}}, but found {{1}}.", expected, subject); return false; } diff --git a/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs index 0c43280b73..188b4f7d79 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs @@ -60,7 +60,6 @@ private static void AssertMemberEquality(Comparands comparands, IEquivalencyVali var assertionChain = AssertionChain.GetOrCreate().For(context); IMember matchingMember = FindMatchFor(selectedMember, context.CurrentNode, comparands.Subject, options, assertionChain); - if (matchingMember is not null) { var nestedComparands = new Comparands @@ -70,12 +69,9 @@ private static void AssertMemberEquality(Comparands comparands, IEquivalencyVali CompileTimeType = selectedMember.Type }; - if (selectedMember.Name != matchingMember.Name) - { - // In case the matching process selected a different member on the subject, - // adjust the current member so that assertion failures report the proper name. - selectedMember.Name = matchingMember.Name; - } + // In case the matching process selected a different member on the subject, + // adjust the current member so that assertion failures report the proper name. + selectedMember.AdjustForRemappedSubject(matchingMember); parent.AssertEquivalencyOf(nestedComparands, context.AsNestedMember(selectedMember)); } diff --git a/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs index ee7d1b400d..2af82fa77d 100644 --- a/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs @@ -24,7 +24,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon ? $"{expectationType} overrides Equals" : "we are forced to use Equals"; - return $"Treating {member.Description} as a value type because {strategyName}."; + return $"Treating {member.Expectation.Description} as a value type because {strategyName}."; }); AssertionChain.GetOrCreate() diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 519a0bbd64..7b35d6f795 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -792,15 +792,14 @@ namespace FluentAssertions.Equivalency public interface INode { int Depth { get; } - string Description { get; } + FluentAssertions.Equivalency.Pathway Expectation { get; } FluentAssertions.Equivalency.GetSubjectId GetSubjectId { get; } bool IsRoot { get; } - string Name { get; set; } System.Type ParentType { get; } - string Path { get; } - string PathAndName { get; } bool RootIsCollection { get; } + FluentAssertions.Equivalency.Pathway Subject { get; } System.Type Type { get; } + void AdjustForRemappedSubject(FluentAssertions.Equivalency.IMember subjectMember); } public interface IObjectInfo { @@ -858,6 +857,17 @@ namespace FluentAssertions.Equivalency public System.Collections.Generic.IEnumerator GetEnumerator() { } public bool IsOrderingStrictFor(FluentAssertions.Equivalency.IObjectInfo objectInfo) { } } + public class Pathway : System.IEquatable + { + public Pathway(FluentAssertions.Equivalency.Pathway parent, string name, FluentAssertions.Equivalency.Pathway.GetDescription getDescription) { } + public Pathway(string path, string name, FluentAssertions.Equivalency.Pathway.GetDescription getDescription) { } + public string Description { get; } + public string Name { get; } + public string Path { get; } + public string PathAndName { get; } + public override string ToString() { } + public delegate string GetDescription(string pathAndName); + } public abstract class SelfReferenceEquivalencyOptions : FluentAssertions.Equivalency.IEquivalencyOptions where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 7f1a4b1739..0bc2794b35 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -805,15 +805,14 @@ namespace FluentAssertions.Equivalency public interface INode { int Depth { get; } - string Description { get; } + FluentAssertions.Equivalency.Pathway Expectation { get; } FluentAssertions.Equivalency.GetSubjectId GetSubjectId { get; } bool IsRoot { get; } - string Name { get; set; } System.Type ParentType { get; } - string Path { get; } - string PathAndName { get; } bool RootIsCollection { get; } + FluentAssertions.Equivalency.Pathway Subject { get; } System.Type Type { get; } + void AdjustForRemappedSubject(FluentAssertions.Equivalency.IMember subjectMember); } public interface IObjectInfo { @@ -871,6 +870,17 @@ namespace FluentAssertions.Equivalency public System.Collections.Generic.IEnumerator GetEnumerator() { } public bool IsOrderingStrictFor(FluentAssertions.Equivalency.IObjectInfo objectInfo) { } } + public class Pathway : System.IEquatable + { + public Pathway(FluentAssertions.Equivalency.Pathway parent, string name, FluentAssertions.Equivalency.Pathway.GetDescription getDescription) { } + public Pathway(string path, string name, FluentAssertions.Equivalency.Pathway.GetDescription getDescription) { } + public string Description { get; } + public string Name { get; } + public string Path { get; } + public string PathAndName { get; } + public override string ToString() { } + public delegate string GetDescription(string pathAndName); + } public abstract class SelfReferenceEquivalencyOptions : FluentAssertions.Equivalency.IEquivalencyOptions where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 08eaf7cde3..f736cd8706 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -784,15 +784,14 @@ namespace FluentAssertions.Equivalency public interface INode { int Depth { get; } - string Description { get; } + FluentAssertions.Equivalency.Pathway Expectation { get; } FluentAssertions.Equivalency.GetSubjectId GetSubjectId { get; } bool IsRoot { get; } - string Name { get; set; } System.Type ParentType { get; } - string Path { get; } - string PathAndName { get; } bool RootIsCollection { get; } + FluentAssertions.Equivalency.Pathway Subject { get; } System.Type Type { get; } + void AdjustForRemappedSubject(FluentAssertions.Equivalency.IMember subjectMember); } public interface IObjectInfo { @@ -850,6 +849,17 @@ namespace FluentAssertions.Equivalency public System.Collections.Generic.IEnumerator GetEnumerator() { } public bool IsOrderingStrictFor(FluentAssertions.Equivalency.IObjectInfo objectInfo) { } } + public class Pathway : System.IEquatable + { + public Pathway(FluentAssertions.Equivalency.Pathway parent, string name, FluentAssertions.Equivalency.Pathway.GetDescription getDescription) { } + public Pathway(string path, string name, FluentAssertions.Equivalency.Pathway.GetDescription getDescription) { } + public string Description { get; } + public string Name { get; } + public string Path { get; } + public string PathAndName { get; } + public override string ToString() { } + public delegate string GetDescription(string pathAndName); + } public abstract class SelfReferenceEquivalencyOptions : FluentAssertions.Equivalency.IEquivalencyOptions where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 5e103b1362..b1b8bf6f2f 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -792,15 +792,14 @@ namespace FluentAssertions.Equivalency public interface INode { int Depth { get; } - string Description { get; } + FluentAssertions.Equivalency.Pathway Expectation { get; } FluentAssertions.Equivalency.GetSubjectId GetSubjectId { get; } bool IsRoot { get; } - string Name { get; set; } System.Type ParentType { get; } - string Path { get; } - string PathAndName { get; } bool RootIsCollection { get; } + FluentAssertions.Equivalency.Pathway Subject { get; } System.Type Type { get; } + void AdjustForRemappedSubject(FluentAssertions.Equivalency.IMember subjectMember); } public interface IObjectInfo { @@ -858,6 +857,17 @@ namespace FluentAssertions.Equivalency public System.Collections.Generic.IEnumerator GetEnumerator() { } public bool IsOrderingStrictFor(FluentAssertions.Equivalency.IObjectInfo objectInfo) { } } + public class Pathway : System.IEquatable + { + public Pathway(FluentAssertions.Equivalency.Pathway parent, string name, FluentAssertions.Equivalency.Pathway.GetDescription getDescription) { } + public Pathway(string path, string name, FluentAssertions.Equivalency.Pathway.GetDescription getDescription) { } + public string Description { get; } + public string Name { get; } + public string Path { get; } + public string PathAndName { get; } + public override string ToString() { } + public delegate string GetDescription(string pathAndName); + } public abstract class SelfReferenceEquivalencyOptions : FluentAssertions.Equivalency.IEquivalencyOptions where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { diff --git a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs index b1c54dd353..de6f2016d0 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs @@ -580,7 +580,7 @@ public void When_asserting_equivalence_including_only_fields_it_should_not_match // Assert act.Should().Throw() - .WithMessage("Expectation has field onlyAProperty.Value that the other object does not have.*"); + .WithMessage("Expectation has field Value that the other object does not have.*"); } [Fact] @@ -595,7 +595,7 @@ public void When_asserting_equivalence_including_only_properties_it_should_not_m // Assert act.Should().Throw() - .WithMessage("Expectation has property onlyAField.Value that the other object does not have*"); + .WithMessage("Expectation has property Value that the other object does not have*"); } [Fact] diff --git a/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs index af8beba7ce..f586ebb26f 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/ExtensibilitySpecs.cs @@ -76,7 +76,7 @@ public bool OverridesStandardIncludeRules public IEnumerable SelectMembers(INode currentNode, IEnumerable selectedMembers, MemberSelectionContext context) { - return selectedMembers.Where(pi => !pi.Name.EndsWith("Id", StringComparison.Ordinal)).ToArray(); + return selectedMembers.Where(pi => !pi.Subject.Name.EndsWith("Id", StringComparison.Ordinal)).ToArray(); } bool IMemberSelectionRule.IncludesMembers @@ -145,7 +145,7 @@ internal class ForeignKeyMatchingRule : IMemberMatchingRule public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options, AssertionChain assertionChain) { - string name = expectedMember.Name; + string name = expectedMember.Subject.Name; if (name.EndsWith("Id", StringComparison.Ordinal)) { diff --git a/Tests/FluentAssertions.Equivalency.Specs/MemberLessObjectsSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/MemberLessObjectsSpecs.cs index 688bfa5884..d1768baad8 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/MemberLessObjectsSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/MemberLessObjectsSpecs.cs @@ -139,7 +139,7 @@ public void When_throwing_on_missing_members_and_there_is_a_missing_member_shoul // Assert act.Should().Throw() - .WithMessage("Expectation has property subject.Age that the other object does not have*"); + .WithMessage("Expectation has property Age that the other object does not have*"); } [Fact] diff --git a/Tests/FluentAssertions.Equivalency.Specs/MemberMatchingSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/MemberMatchingSpecs.cs index 1fdd15a919..a4b032705c 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/MemberMatchingSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/MemberMatchingSpecs.cs @@ -1,5 +1,6 @@ -using System; +using System; using System.Diagnostics.CodeAnalysis; +using JetBrains.Annotations; using Xunit; using Xunit.Sdk; @@ -87,7 +88,8 @@ public void Nested_properties_can_be_mapped_using_a_nested_type_and_property_nam public void Nested_explicitly_implemented_properties_can_be_mapped_using_a_nested_type_and_property_names() { // Arrange - var subject = new ParentOfSubjectWithExplicitlyImplementedProperty([new SubjectWithExplicitImplementedProperty()]); + var subject = + new ParentOfSubjectWithExplicitlyImplementedProperty(new[] { new SubjectWithExplicitImplementedProperty() }); ((IProperty)subject.Children[0]).Property = "Hello"; @@ -537,10 +539,166 @@ public void Can_map_members_of_a_root_collection() c.WithMapping(s => s.EntityId, d => d.Id)); } + [Fact] + public void Can_explicitly_include_a_property_on_a_mapped_type() + { + // Arrange + var expectation = new CustomerWithPropertiesDto + { + AddressInformation = new CustomerWithPropertiesDto.ResidenceDto + { + Address = "123 Main St", + IsValidated = true, + }, + }; + + var subject = new CustomerWithProperty + { + Address = new CustomerWithProperty.Residence + { + Address = "123 Main St", + }, + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, o => o + .Including(r => r.AddressInformation.Address) + .WithMapping(s => s.AddressInformation, d => d.Address)); + } + + [Fact] + public void Can_exclude_a_property_on_a_mapped_type() + { + // Arrange + var expectation = new CustomerWithPropertiesDto + { + AddressInformation = new CustomerWithPropertiesDto.ResidenceDto + { + Address = "123 Main St", + IsValidated = true, + }, + }; + + var subject = new CustomerWithProperty + { + Address = new CustomerWithProperty.Residence + { + Address = "123 Main St", + }, + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, o => o + .Excluding(r => r.AddressInformation.IsValidated) + .WithMapping(s => s.AddressInformation, d => d.Address)); + } + + [Fact] + public void Can_explicitly_include_a_field_on_a_mapped_type() + { + // Arrange + var expectation = new CustomerWithFieldDto + { + AddressInformation = new CustomerWithFieldDto.ResidenceDto + { + Address = "123 Main St", + IsValidated = true, + }, + }; + + var subject = new CustomerWithField + { + Address = new CustomerWithField.Residence + { + Address = "123 Main St", + }, + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, o => o + .Including(r => r.AddressInformation.Address) + .WithMapping(s => s.AddressInformation, d => d.Address)); + } + + [Fact] + public void Can_exclude_a_field_on_a_mapped_type() + { + // Arrange + var expectation = new CustomerWithFieldDto + { + AddressInformation = new CustomerWithFieldDto.ResidenceDto + { + Address = "123 Main St", + IsValidated = true, + }, + }; + + var subject = new CustomerWithField + { + Address = new CustomerWithField.Residence + { + Address = "123 Main St", + }, + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, o => o + .Excluding(r => r.AddressInformation.IsValidated) + .WithMapping(s => s.AddressInformation, d => d.Address)); + } + + private class CustomerWithProperty + { + public Residence Address { get; set; } + + public class Residence + { + [UsedImplicitly] + public string Address { get; set; } + } + } + + private class CustomerWithPropertiesDto + { + public ResidenceDto AddressInformation { get; set; } + + public class ResidenceDto + { + public string Address { get; set; } + + public bool IsValidated { get; set; } + } + } + + private class CustomerWithField + { + public Residence Address; + + public class Residence + { + [UsedImplicitly] + public string Address; + } + } + + private class CustomerWithFieldDto + { + public ResidenceDto AddressInformation; + + public class ResidenceDto + { + public string Address; + + [UsedImplicitly] + public bool IsValidated; + } + } + private class Entity { public int EntityId { get; init; } + [UsedImplicitly] public string Name { get; init; } } @@ -548,6 +706,7 @@ private class EntityDto { public int Id { get; init; } + [UsedImplicitly] public string Name { get; init; } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs index dc88a07bb7..971cebed16 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs @@ -229,7 +229,7 @@ public void When_not_all_the_properties_of_the_nested_object_exist_on_the_expect // Assert act .Should().Throw() - .WithMessage("Expectation has property subject.Level.OtherProperty that the other object does not have*"); + .WithMessage("Expectation has property Level.OtherProperty that the other object does not have*"); } [Fact] diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs index bcea272ff6..53e10cf7f0 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs @@ -31,7 +31,7 @@ public void Property_names_are_case_sensitive() // Assert act.Should().Throw().WithMessage( - "Expectation*subject.name**other*not have*"); + "Expectation*name**other*not have*"); } [Fact] @@ -53,7 +53,7 @@ public void Field_names_are_case_sensitive() // Assert act.Should().Throw().WithMessage( - "Expectation*subject.name**other*not have*"); + "Expectation*name**other*not have*"); } private class ClassWithFieldInLowerCase @@ -120,7 +120,7 @@ public void When_the_expected_object_has_a_property_not_available_on_the_subject // Assert act.Should().Throw().WithMessage( - "Expectation has property subject.City that the other object does not have*"); + "Expectation has property City that the other object does not have*"); } [Fact] diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Browsability.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Browsability.cs index 2754452d5e..dd93169c9c 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Browsability.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Browsability.cs @@ -248,7 +248,7 @@ public void When_non_browsable_property_on_subject_is_ignored_but_is_present_on_ // Assert action.Should().Throw().WithMessage( - "Expectation has * subject.*ThatMightBeNonBrowsable that is non-browsable in the other object, and non-browsable " + + "Expectation has*ThatMightBeNonBrowsable that is non-browsable in the other object, and non-browsable " + "members on the subject are ignored with the current configuration*"); } diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs index 78182e78d6..1ad5900528 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs @@ -1,4 +1,4 @@ -using System; +using System; using FluentAssertions.Equivalency.Matching; using FluentAssertions.Equivalency.Ordering; using FluentAssertions.Equivalency.Selection; diff --git a/Tests/FluentAssertions.Specs/Execution/CallerIdentificationSpecs.cs b/Tests/FluentAssertions.Specs/Execution/CallerIdentificationSpecs.cs index 564ad48dea..a298db914a 100644 --- a/Tests/FluentAssertions.Specs/Execution/CallerIdentificationSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/CallerIdentificationSpecs.cs @@ -567,7 +567,7 @@ 5. Test var node = Node.From(GetSubjectId); // Assert - node.Description.Should().StartWith("node.Description"); + node.Subject.Description.Should().StartWith("node.Subject.Description"); } [CustomAssertion] diff --git a/Tests/FluentAssertions.Specs/Numeric/ComparableSpecs.cs b/Tests/FluentAssertions.Specs/Numeric/ComparableSpecs.cs index c762fe199d..7f02063c19 100644 --- a/Tests/FluentAssertions.Specs/Numeric/ComparableSpecs.cs +++ b/Tests/FluentAssertions.Specs/Numeric/ComparableSpecs.cs @@ -236,7 +236,7 @@ public void When_two_instances_are_not_equivalent_it_should_throw() act .Should().Throw() .WithMessage( - "Expectation has property subject.SomeOtherProperty*that the other object does not have*"); + "Expectation has property SomeOtherProperty*that the other object does not have*"); } } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 381ad919c0..b002f2c1e4 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -65,6 +65,7 @@ sidebar: * Fixed `ThrowWithinAsync` not respecting `OperationCanceledException` - [#2614](https://github.com/fluentassertions/fluentassertions/pull/2614) * Fixed using `BeEquivalentTo` with an `IEqualityComparer` targeting nullable types - [#2648](https://github.com/fluentassertions/fluentassertions/pull/2648) * Fixed `RaisePropertyChangeFor` to return a filtered list of events - [#2677](https://github.com/fluentassertions/fluentassertions/pull/2677) +* Including or excluding members did not work when `WithMapping` was used in `BeEquivalentTo` - [#2860](https://github.com/fluentassertions/fluentassertions/pull/2860) ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) From d14740ab919fb74a03312c4ea6b5713819aa69d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:46:30 +0100 Subject: [PATCH 507/845] Bump Verify.Xunit from 28.6.0 to 28.7.0 in the xunit group (#2902) Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify). Updates `Verify.Xunit` from 28.6.0 to 28.7.0 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/28.6.0...28.7.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index e206c9d4fd..8dd730cc7c 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 418048056e66323279180dcb836152811154cc5e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:46:47 +0100 Subject: [PATCH 508/845] Bump Meziantou.Analyzer from 2.0.182 to 2.0.183 (#2906) Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.182 to 2.0.183. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.182...2.0.183) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 76a62cad11..9f34e20055 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 280ea43df6005c66b10fb59f8ddcef1294e6f4bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:47:06 +0100 Subject: [PATCH 509/845] Bump TUnit from 0.5.6 to 0.5.28 (#2905) Bumps [TUnit](https://github.com/thomhurst/TUnit) from 0.5.6 to 0.5.28. - [Commits](https://github.com/thomhurst/TUnit/commits) --- updated-dependencies: - dependency-name: TUnit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 85c800b4dc..b9ec4c52ba 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -11,7 +11,7 @@ - + From acd0cf80cea9bccce9327a8683ed7fa6341b922d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:47:22 +0100 Subject: [PATCH 510/845] Bump NUnit from 4.3.0 to 4.3.1 in the nunit group (#2904) Bumps the nunit group with 1 update: [NUnit](https://github.com/nunit/nunit). Updates `NUnit` from 4.3.0 to 4.3.1 - [Release notes](https://github.com/nunit/nunit/releases) - [Changelog](https://github.com/nunit/nunit/blob/main/CHANGES.md) - [Commits](https://github.com/nunit/nunit/compare/4.3.0...4.3.1) --- updated-dependencies: - dependency-name: NUnit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: nunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index cbefd71496..b9b909bd9b 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 35b4c694829d9671ed1d453c88f114609668b8b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:02:12 +0100 Subject: [PATCH 511/845] Bump the mstest group with 2 updates (#2903) Bumps the mstest group with 2 updates: [MSTest.TestAdapter](https://github.com/microsoft/testfx) and [MSTest.TestFramework](https://github.com/microsoft/testfx). Updates `MSTest.TestAdapter` from 3.6.4 to 3.7.0 - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](https://github.com/microsoft/testfx/compare/v3.6.4...v3.7.0) Updates `MSTest.TestFramework` from 3.6.4 to 3.7.0 - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](https://github.com/microsoft/testfx/compare/v3.6.4...v3.7.0) --- updated-dependencies: - dependency-name: MSTest.TestAdapter dependency-type: direct:production update-type: version-update:semver-minor dependency-group: mstest - dependency-name: MSTest.TestFramework dependency-type: direct:production update-type: version-update:semver-minor dependency-group: mstest ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 518a2a535b..3784246c54 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + From 37f16956994630c5f84b8374ef86b22300bcafdd Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Fri, 27 Dec 2024 11:46:23 +0100 Subject: [PATCH 512/845] Update MSTest for UWP --- Tests/UWP.Specs/UWP.Specs.csproj | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Tests/UWP.Specs/UWP.Specs.csproj b/Tests/UWP.Specs/UWP.Specs.csproj index 06c3a03da6..c1bca1a52f 100644 --- a/Tests/UWP.Specs/UWP.Specs.csproj +++ b/Tests/UWP.Specs/UWP.Specs.csproj @@ -20,8 +20,6 @@ $(NoWarn);2008 true true - - false 17.3.3 @@ -90,10 +88,10 @@ 6.2.14 - 3.6.4 + 3.7.0 - 3.6.4 + 3.7.0 4.7.0 From db24d225917f606c0f4a076ddbfecb2eee1e6120 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Fri, 27 Dec 2024 12:51:31 +0100 Subject: [PATCH 513/845] Remove release notes from 8.0.0 that were backported to 6.12.x or 7.0.0 --- docs/_pages/releases.md | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index b002f2c1e4..105bd34b1a 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -36,7 +36,6 @@ sidebar: * This also adds the capability to ignore casing, leading or trailing whitespace on strings when using `BeEquivalentTo` on object graphs or collections. * Also adds the capability to ignore the newline style on strings - [#2565](https://github.com/fluentassertions/fluentassertions/pull/2565) * You can mark all assertions in an assembly as custom assertions using the `[CustomAssertionsAssembly]` attribute - [#2389](https://github.com/fluentassertions/fluentassertions/pull/2389) -* Improve `BeEmpty()` and `BeNullOrEmpty()` performance for `IEnumerable`, by materializing only the first item - [#2530](https://github.com/fluentassertions/fluentassertions/pull/2530) * All `Should()` methods on reference types are now annotated with the `[NotNull]` attribute for a better Fluent Assertions experience when nullable reference types are enabled - [#2380](https://github.com/fluentassertions/fluentassertions/pull/2380) * All assertions that support chaining using the `.Which` construct will now amend the caller identifier - [2539](https://github.com/fluentassertions/pull/2539) * Introduced a `MethodInfoFormatter` and improved the `PropertyInfoFormatter` - [2539](https://github.com/fluentassertions/pull/2539) @@ -44,26 +43,7 @@ sidebar: * You can exclude explicitly implemented properties from `BeEquivalentTo` via `ExcludingExplicitlyImplementedProperties` - [2851](https://github.com/fluentassertions/pull/2851) ### Fixes -* Fixed formatting error when checking nullable `DateTimeOffset` with -`BeWithin(...).Before(...)` - [#2312](https://github.com/fluentassertions/fluentassertions/pull/2312) -* `BeEquivalentTo` will now find and can map subject properties that are implemented through an explicitly-implemented interface - [#2152](https://github.com/fluentassertions/fluentassertions/pull/2152) -* Fixed that the `because` and `becauseArgs` were not passed down the equivalency tree - [#2318](https://github.com/fluentassertions/fluentassertions/pull/2318) -* `BeEquivalentTo` can again compare a non-generic `IDictionary` with a generic one - [#2358](https://github.com/fluentassertions/fluentassertions/pull/2358) -* Fixed that the `FormattingOptions` were not respected in inner `AssertionScope` - [#2329](https://github.com/fluentassertions/fluentassertions/pull/2329) -* Capitalize `true` and `false` in failure messages and make them formattable to a custom `BooleanFormatter` - [#2390](https://github.com/fluentassertions/fluentassertions/pull/2390), [#2393](https://github.com/fluentassertions/fluentassertions/pull/2393) -* Improved the failure message for `NotBeOfType` when wrapped in an `AssertionScope` and the subject is null - [#2399](https://github.com/fluentassertions/fluentassertions/pull/2399) -* Improved the failure message for `BeWritable`/`BeReadable` when wrapped in an `AssertionScope` and the subject is read-only/write-only - [#2399](https://github.com/fluentassertions/fluentassertions/pull/2399) -* Improved the failure message for `ThrowExactly[Async]` when wrapped in an `AssertionScope` and no exception is thrown - [#2398](https://github.com/fluentassertions/fluentassertions/pull/2398) -* Improved the failure message for `[Not]HaveExplicitProperty` when wrapped in an `AssertionScope` and not implementing the interface - [#2403](https://github.com/fluentassertions/fluentassertions/pull/2403) -* Improved the failure message for `[Not]HaveExplicitMethod` when wrapped in an `AssertionScope` and not implementing the interface - [#2403](https://github.com/fluentassertions/fluentassertions/pull/2403) -* Changed `BeEquivalentTo` to exclude `private protected` members from the comparison - [#2417](https://github.com/fluentassertions/fluentassertions/pull/2417) -* Fixed using `BeEquivalentTo` on an empty `ArraySegment` - [#2445](https://github.com/fluentassertions/fluentassertions/pull/2445), [#2511](https://github.com/fluentassertions/fluentassertions/pull/2511) -* `BeEquivalentTo` with a custom comparer can now handle null values - [#2489](https://github.com/fluentassertions/fluentassertions/pull/2489) * Fixed incorrect treatment of "\\r\\n" as new line - [#2569](https://github.com/fluentassertions/fluentassertions/pull/2569) -* Ensured that nested calls to `AssertionScope(context)` create a chained context - [#2607](https://github.com/fluentassertions/fluentassertions/pull/2607) -* One overload of the `AssertionScope` constructor would not create an actual scope associated with the thread - [#2607](https://github.com/fluentassertions/fluentassertions/pull/2607) -* Fixed `ThrowWithinAsync` not respecting `OperationCanceledException` - [#2614](https://github.com/fluentassertions/fluentassertions/pull/2614) -* Fixed using `BeEquivalentTo` with an `IEqualityComparer` targeting nullable types - [#2648](https://github.com/fluentassertions/fluentassertions/pull/2648) * Fixed `RaisePropertyChangeFor` to return a filtered list of events - [#2677](https://github.com/fluentassertions/fluentassertions/pull/2677) * Including or excluding members did not work when `WithMapping` was used in `BeEquivalentTo` - [#2860](https://github.com/fluentassertions/fluentassertions/pull/2860) @@ -86,7 +66,6 @@ sidebar: * Dropped direct support for .NET Core 2.x and .NET Core 3.x - [#2302](https://github.com/fluentassertions/fluentassertions/pull/2302) * `AllSatisfy` now succeeds when asserting that an empty collection satisfies some predicates - [#2321](https://github.com/fluentassertions/fluentassertions/pull/2321) * `OnlyContain` now succeeds when asserting that an empty collection matches some predicates - [#2350](https://github.com/fluentassertions/fluentassertions/pull/2350) -* Dropped support for `NSpec3` test framework - [#2356](https://github.com/fluentassertions/fluentassertions/pull/2356) * Dropped support for `BinaryFormatter` - [#2278](https://github.com/fluentassertions/fluentassertions/pull/2278) * Renamed "...AssertionOptions" to "...Options" - [#2414](https://github.com/fluentassertions/fluentassertions/pull/2414) * `EquivalencyAssertionOptions` to `EquivalencyOptions` From 86279147569461ed026ac9f7f3f9323067bfd595 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 15:47:14 +0000 Subject: [PATCH 514/845] Bump NUnit from 4.3.1 to 4.3.2 in the nunit group Bumps the nunit group with 1 update: [NUnit](https://github.com/nunit/nunit). Updates `NUnit` from 4.3.1 to 4.3.2 - [Release notes](https://github.com/nunit/nunit/releases) - [Changelog](https://github.com/nunit/nunit/blob/main/CHANGES.md) - [Commits](https://github.com/nunit/nunit/compare/4.3.1...4.3.2) --- updated-dependencies: - dependency-name: NUnit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: nunit ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index b9b909bd9b..8da6aae173 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 5a5cc8223a492c4a65c71ddea4d931a1846c8356 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 15:50:27 +0000 Subject: [PATCH 515/845] Bump TUnit from 0.5.28 to 0.6.15 Bumps [TUnit](https://github.com/thomhurst/TUnit) from 0.5.28 to 0.6.15. - [Commits](https://github.com/thomhurst/TUnit/commits) --- updated-dependencies: - dependency-name: TUnit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index b9ec4c52ba..7970fb93d9 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -11,7 +11,7 @@ - + From bfb91b2bd41bee13087efb198d80098d5ba7f7f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 15:50:04 +0000 Subject: [PATCH 516/845] Bump Meziantou.Analyzer from 2.0.183 to 2.0.184 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.183 to 2.0.184. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.183...2.0.184) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 9f34e20055..2bd9a9c1a2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 0350cd0775ec6affbbbb4995965c3dec16b26fe4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 15:51:05 +0000 Subject: [PATCH 517/845] Bump Reflectify from 1.3.0 to 1.4.0 Bumps [Reflectify](https://github.com/dennisdoomen/Reflectify) from 1.3.0 to 1.4.0. - [Release notes](https://github.com/dennisdoomen/Reflectify/releases) - [Commits](https://github.com/dennisdoomen/Reflectify/compare/1.3.0...1.4.0) --- updated-dependencies: - dependency-name: Reflectify dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Src/FluentAssertions/FluentAssertions.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index c4fa1cd464..82f04edebe 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -44,7 +44,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 6f669833e801e1919837e8b57ac26a5cfe2386cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 17:02:53 +0000 Subject: [PATCH 518/845] Bump Microsoft.Testing.Extensions.TrxReport from 1.4.3 to 1.5.0 Bumps [Microsoft.Testing.Extensions.TrxReport](https://github.com/microsoft/testfx) from 1.4.3 to 1.5.0. - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog-Platform.md) - [Commits](https://github.com/microsoft/testfx/commits) --- updated-dependencies: - dependency-name: Microsoft.Testing.Extensions.TrxReport dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 7970fb93d9..66f0dbe958 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -12,7 +12,7 @@ - + From ef87dd16e6ecd175d61daa84992ca7bb2f0eb723 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Fri, 3 Jan 2025 10:31:09 +0100 Subject: [PATCH 519/845] Remove support for `HttpResponseMessage` assertions (#2909) --- Src/FluentAssertions/AssertionExtensions.cs | 11 - Src/FluentAssertions/FluentAssertions.csproj | 4 - .../HttpResponseMessageAssertions.cs | 241 ---------------- .../FluentAssertions/net47.verified.txt | 18 -- .../FluentAssertions/net6.0.verified.txt | 18 -- .../netstandard2.0.verified.txt | 18 -- .../netstandard2.1.verified.txt | 18 -- Tests/Benchmarks/Benchmarks.csproj | 3 - ...luentAssertions.Extensibility.Specs.csproj | 4 - .../HttpResponseMessageAssertionSpecs.cs | 270 ------------------ .../XUnit2.Specs/XUnit2.Specs.csproj | 5 +- .../XUnit3.Specs/XUnit3.Specs.csproj | 3 - .../XUnit3Core.Specs/XUnit3Core.Specs.csproj | 3 - docs/_data/navigation.yml | 4 +- docs/_pages/httpresponsemessages.md | 20 +- docs/_pages/releases.md | 3 +- .../{upgradingtov7.md => upgradingtov8.md} | 21 +- 17 files changed, 19 insertions(+), 645 deletions(-) delete mode 100644 Src/FluentAssertions/Primitives/HttpResponseMessageAssertions.cs delete mode 100644 Tests/FluentAssertions.Specs/Primitives/HttpResponseMessageAssertionSpecs.cs rename docs/_pages/{upgradingtov7.md => upgradingtov8.md} (92%) diff --git a/Src/FluentAssertions/AssertionExtensions.cs b/Src/FluentAssertions/AssertionExtensions.cs index 4832352cf5..7abf3d92da 100644 --- a/Src/FluentAssertions/AssertionExtensions.cs +++ b/Src/FluentAssertions/AssertionExtensions.cs @@ -5,7 +5,6 @@ using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq.Expressions; -using System.Net.Http; using System.Reflection; using System.Threading.Tasks; using System.Xml.Linq; @@ -307,16 +306,6 @@ public static NullableBooleanAssertions Should(this bool? actualValue) return new NullableBooleanAssertions(actualValue, AssertionChain.GetOrCreate()); } - /// - /// Returns an object that can be used to assert the - /// current . - /// - [Pure] - public static HttpResponseMessageAssertions Should([NotNull] this HttpResponseMessage actualValue) - { - return new HttpResponseMessageAssertions(actualValue, AssertionChain.GetOrCreate()); - } - /// /// Returns an object that can be used to assert the /// current . diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 82f04edebe..55a0d60fa2 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -90,10 +90,6 @@ - - $(TargetFramework) - - diff --git a/Src/FluentAssertions/Primitives/HttpResponseMessageAssertions.cs b/Src/FluentAssertions/Primitives/HttpResponseMessageAssertions.cs deleted file mode 100644 index e483ac43b7..0000000000 --- a/Src/FluentAssertions/Primitives/HttpResponseMessageAssertions.cs +++ /dev/null @@ -1,241 +0,0 @@ -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Net; -using System.Net.Http; -using FluentAssertions.Execution; - -namespace FluentAssertions.Primitives; - -/// -/// Contains a number of methods to assert that a is in the expected state. -/// -[DebuggerNonUserCode] -public class HttpResponseMessageAssertions : HttpResponseMessageAssertions -{ - public HttpResponseMessageAssertions(HttpResponseMessage value, AssertionChain assertionChain) - : base(value, assertionChain) - { - } -} - -/// -/// Contains a number of methods to assert that a is in the expected state. -/// -[DebuggerNonUserCode] -public class HttpResponseMessageAssertions : ObjectAssertions - where TAssertions : HttpResponseMessageAssertions -{ - private readonly AssertionChain assertionChain; - - protected HttpResponseMessageAssertions(HttpResponseMessage value, AssertionChain assertionChain) - : base(value, assertionChain) - { - this.assertionChain = assertionChain; - } - - /// - /// Asserts that the is successful (2xx). - /// - /// - /// 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 BeSuccessful([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - assertionChain - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected HttpStatusCode to be successful (2xx){reason}, but HttpResponseMessage was ."); - - if (assertionChain.Succeeded) - { - assertionChain - .ForCondition(Subject!.IsSuccessStatusCode) - .BecauseOf(because, becauseArgs) - .FailWith("Expected HttpStatusCode to be successful (2xx){reason}, but found {0}.", Subject.StatusCode); - } - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the is redirection (3xx). - /// - /// - /// 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 BeRedirection([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - assertionChain - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected HttpStatusCode to be redirection (3xx){reason}, but HttpResponseMessage was ."); - - if (assertionChain.Succeeded) - { - assertionChain - .ForCondition((int)Subject!.StatusCode is >= 300 and <= 399) - .BecauseOf(because, becauseArgs) - .FailWith("Expected HttpStatusCode to be redirection (3xx){reason}, but found {0}.", Subject.StatusCode); - } - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the is either client (4xx) or server error (5xx). - /// - /// - /// 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 HaveError([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - assertionChain - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected HttpStatusCode to be an error{reason}, but HttpResponseMessage was ."); - - if (assertionChain.Succeeded) - { - assertionChain - .ForCondition(IsClientError() || IsServerError()) - .BecauseOf(because, becauseArgs) - .FailWith("Expected HttpStatusCode to be an error{reason}, but found {0}.", Subject.StatusCode); - } - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the is client error (4xx). - /// - /// - /// 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 HaveClientError([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - assertionChain - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected HttpStatusCode to be client error (4xx){reason}, but HttpResponseMessage was ."); - - if (assertionChain.Succeeded) - { - assertionChain - .ForCondition(IsClientError()) - .BecauseOf(because, becauseArgs) - .FailWith("Expected HttpStatusCode to be client error (4xx){reason}, but found {0}.", Subject.StatusCode); - } - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the is server error (5xx). - /// - /// - /// 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 HaveServerError([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - assertionChain - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected HttpStatusCode to be server error (5xx){reason}, but HttpResponseMessage was ."); - - if (assertionChain.Succeeded) - { - assertionChain - .ForCondition(IsServerError()) - .BecauseOf(because, becauseArgs) - .FailWith("Expected HttpStatusCode to be server error (5xx){reason}, but found {0}.", Subject.StatusCode); - } - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the is equal to the specified value. - /// - /// The expected value - /// - /// 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 HaveStatusCode(HttpStatusCode expected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - assertionChain - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected HttpStatusCode to be {0}{reason}, but HttpResponseMessage was .", expected); - - if (assertionChain.Succeeded) - { - assertionChain - .ForCondition(Subject!.StatusCode == expected) - .BecauseOf(because, becauseArgs) - .FailWith("Expected HttpStatusCode to be {0}{reason}, but found {1}.", expected, Subject.StatusCode); - } - - return new AndConstraint((TAssertions)this); - } - - /// - /// Asserts that the is not equal to the specified value. - /// - /// The unexpected value - /// - /// 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 NotHaveStatusCode(HttpStatusCode unexpected, - [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) - { - assertionChain - .ForCondition(Subject is not null) - .BecauseOf(because, becauseArgs) - .FailWith("Expected HttpStatusCode not to be {0}{reason}, but HttpResponseMessage was .", unexpected); - - if (assertionChain.Succeeded) - { - assertionChain - .ForCondition(Subject!.StatusCode != unexpected) - .BecauseOf(because, becauseArgs) - .FailWith("Expected HttpStatusCode not to be {0}{reason}, but found {1}.", unexpected, Subject.StatusCode); - } - - return new AndConstraint((TAssertions)this); - } - - private bool IsServerError() => (int)Subject.StatusCode is >= 500 and <= 599; - - private bool IsClientError() => (int)Subject.StatusCode is >= 400 and <= 499; - - protected override string Identifier => "HTTP response message"; -} diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 7b35d6f795..6080e9932d 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -71,7 +71,6 @@ namespace FluentAssertions public static FluentAssertions.Primitives.NullableGuidAssertions Should(this System.Guid? actualValue) { } public static FluentAssertions.Streams.BufferedStreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.BufferedStream actualValue) { } public static FluentAssertions.Streams.StreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.Stream actualValue) { } - public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Net.Http.HttpResponseMessage actualValue) { } public static FluentAssertions.Types.AssemblyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.ConstructorInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.ConstructorInfo constructorInfo) { } public static FluentAssertions.Types.MethodInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.MethodInfo methodInfo) { } @@ -1805,23 +1804,6 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } } - public class HttpResponseMessageAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions - { - public HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value, FluentAssertions.Execution.AssertionChain assertionChain) { } - } - public class HttpResponseMessageAssertions : FluentAssertions.Primitives.ObjectAssertions - where TAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions - { - protected HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value, FluentAssertions.Execution.AssertionChain assertionChain) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeRedirection(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSuccessful(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveClientError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveServerError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveStatusCode(System.Net.HttpStatusCode expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveStatusCode(System.Net.HttpStatusCode unexpected, string because = "", params object[] becauseArgs) { } - } public class NullableBooleanAssertions : FluentAssertions.Primitives.NullableBooleanAssertions { public NullableBooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 0bc2794b35..ee28acf4cc 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -73,7 +73,6 @@ namespace FluentAssertions public static FluentAssertions.Primitives.NullableGuidAssertions Should(this System.Guid? actualValue) { } public static FluentAssertions.Streams.BufferedStreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.BufferedStream actualValue) { } public static FluentAssertions.Streams.StreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.Stream actualValue) { } - public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Net.Http.HttpResponseMessage actualValue) { } public static FluentAssertions.Types.AssemblyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.ConstructorInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.ConstructorInfo constructorInfo) { } public static FluentAssertions.Types.MethodInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.MethodInfo methodInfo) { } @@ -1863,23 +1862,6 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } } - public class HttpResponseMessageAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions - { - public HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value, FluentAssertions.Execution.AssertionChain assertionChain) { } - } - public class HttpResponseMessageAssertions : FluentAssertions.Primitives.ObjectAssertions - where TAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions - { - protected HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value, FluentAssertions.Execution.AssertionChain assertionChain) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeRedirection(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSuccessful(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveClientError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveServerError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveStatusCode(System.Net.HttpStatusCode expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveStatusCode(System.Net.HttpStatusCode unexpected, string because = "", params object[] becauseArgs) { } - } public class NullableBooleanAssertions : FluentAssertions.Primitives.NullableBooleanAssertions { public NullableBooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index f736cd8706..87549bd529 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -69,7 +69,6 @@ namespace FluentAssertions public static FluentAssertions.Primitives.NullableGuidAssertions Should(this System.Guid? actualValue) { } public static FluentAssertions.Streams.BufferedStreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.BufferedStream actualValue) { } public static FluentAssertions.Streams.StreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.Stream actualValue) { } - public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Net.Http.HttpResponseMessage actualValue) { } public static FluentAssertions.Types.AssemblyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.ConstructorInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.ConstructorInfo constructorInfo) { } public static FluentAssertions.Types.MethodInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.MethodInfo methodInfo) { } @@ -1749,23 +1748,6 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } } - public class HttpResponseMessageAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions - { - public HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value, FluentAssertions.Execution.AssertionChain assertionChain) { } - } - public class HttpResponseMessageAssertions : FluentAssertions.Primitives.ObjectAssertions - where TAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions - { - protected HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value, FluentAssertions.Execution.AssertionChain assertionChain) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeRedirection(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSuccessful(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveClientError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveServerError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveStatusCode(System.Net.HttpStatusCode expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveStatusCode(System.Net.HttpStatusCode unexpected, string because = "", params object[] becauseArgs) { } - } public class NullableBooleanAssertions : FluentAssertions.Primitives.NullableBooleanAssertions { public NullableBooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index b1b8bf6f2f..8e5e2ee43e 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -71,7 +71,6 @@ namespace FluentAssertions public static FluentAssertions.Primitives.NullableGuidAssertions Should(this System.Guid? actualValue) { } public static FluentAssertions.Streams.BufferedStreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.BufferedStream actualValue) { } public static FluentAssertions.Streams.StreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.Stream actualValue) { } - public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Net.Http.HttpResponseMessage actualValue) { } public static FluentAssertions.Types.AssemblyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.ConstructorInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.ConstructorInfo constructorInfo) { } public static FluentAssertions.Types.MethodInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.MethodInfo methodInfo) { } @@ -1805,23 +1804,6 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } } - public class HttpResponseMessageAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions - { - public HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value, FluentAssertions.Execution.AssertionChain assertionChain) { } - } - public class HttpResponseMessageAssertions : FluentAssertions.Primitives.ObjectAssertions - where TAssertions : FluentAssertions.Primitives.HttpResponseMessageAssertions - { - protected HttpResponseMessageAssertions(System.Net.Http.HttpResponseMessage value, FluentAssertions.Execution.AssertionChain assertionChain) { } - protected override string Identifier { get; } - public FluentAssertions.AndConstraint BeRedirection(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeSuccessful(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveClientError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveServerError(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveStatusCode(System.Net.HttpStatusCode expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveStatusCode(System.Net.HttpStatusCode unexpected, string because = "", params object[] becauseArgs) { } - } public class NullableBooleanAssertions : FluentAssertions.Primitives.NullableBooleanAssertions { public NullableBooleanAssertions(bool? value, FluentAssertions.Execution.AssertionChain assertionChain) { } diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index a8936ebd3e..48c71a7539 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -14,7 +14,4 @@ - - - diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 167487a564..fe0a5c0ea7 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -32,8 +32,4 @@ - - - - diff --git a/Tests/FluentAssertions.Specs/Primitives/HttpResponseMessageAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/HttpResponseMessageAssertionSpecs.cs deleted file mode 100644 index b19c491a4c..0000000000 --- a/Tests/FluentAssertions.Specs/Primitives/HttpResponseMessageAssertionSpecs.cs +++ /dev/null @@ -1,270 +0,0 @@ -using System; -using System.Net; -using System.Net.Http; -using Xunit; -using Xunit.Sdk; - -namespace FluentAssertions.Specs.Primitives; - -public class HttpResponseMessageAssertionSpecs -{ - [Theory] - [InlineData(HttpStatusCode.OK)] - [InlineData(HttpStatusCode.Accepted)] - public void Should_succeed_when_status_code_is_successful(HttpStatusCode statusCodeOfResponse) - { - // Arrange - var testee = new HttpResponseMessage(statusCodeOfResponse); - - // Act / Assert - testee.Should().BeSuccessful(); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_status_code_error_is_successful() - { - // Arrange - Action action = () => new HttpResponseMessage(HttpStatusCode.Gone).Should() - .BeSuccessful("because we want to test the failure {0}", "message"); - - // Act / Assert - action.Should().Throw() - .WithMessage( - "Expected HttpStatusCode to be successful (2xx) because we want to test the failure message, but found HttpStatusCode.Gone {value: 410}."); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_success_but_response_is_null() - { - // Arrange - Action action = () => - ((HttpResponseMessage)null).Should().BeSuccessful("because we want to test the failure {0}", "message"); - - // Act / Assert - action.Should().Throw() - .WithMessage( - "Expected HttpStatusCode to be successful (2xx) because we want to test the failure message, but HttpResponseMessage was ."); - } - - [Theory] - [InlineData(HttpStatusCode.Moved)] - public void Should_succeed_when_status_code_is_redirect(HttpStatusCode statusCodeOfResponse) - { - // Arrange - var testee = new HttpResponseMessage(statusCodeOfResponse); - - // Act / Assert - testee.Should().BeRedirection(); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_status_code_error_is_redirection() - { - // Arrange - Action action = () => new HttpResponseMessage(HttpStatusCode.Gone).Should() - .BeRedirection("because we want to test the failure {0}", "message"); - - // Act / Assert - action.Should().Throw() - .WithMessage( - "Expected HttpStatusCode to be redirection (3xx) because we want to test the failure message, but found HttpStatusCode.Gone {value: 410}."); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_redirect_but_response_is_null() - { - // Arrange - Action action = () => - ((HttpResponseMessage)null).Should().BeRedirection("because we want to test the failure {0}", "message"); - - // Act / Assert - action.Should().Throw() - .WithMessage( - "Expected HttpStatusCode to be redirection (3xx) because we want to test the failure message, but HttpResponseMessage was ."); - } - - [Theory] - [InlineData(HttpStatusCode.Gone)] - [InlineData(HttpStatusCode.BadRequest)] - public void Should_succeed_when_status_code_is_client_error(HttpStatusCode statusCodeOfResponse) - { - // Arrange - var testee = new HttpResponseMessage(statusCodeOfResponse); - - // Act / Assert - testee.Should().HaveClientError(); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_status_code_success_is_client_error() - { - // Arrange - Action action = () => new HttpResponseMessage(HttpStatusCode.OK).Should() - .HaveClientError("because we want to test the failure {0}", "message"); - - // Act / Assert - action.Should().Throw() - .WithMessage( - "Expected HttpStatusCode to be client error (4xx) because we want to test the failure message, but found HttpStatusCode.OK {value: 200}."); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_client_error_but_response_is_null() - { - // Arrange - Action action = () => - ((HttpResponseMessage)null).Should().HaveClientError("because we want to test the failure {0}", "message"); - - // Act / Assert - action.Should().Throw() - .WithMessage( - "Expected HttpStatusCode to be client error (4xx) because we want to test the failure message, but HttpResponseMessage was ."); - } - - [Theory] - [InlineData(HttpStatusCode.InternalServerError)] - public void Should_succeed_when_status_code_is_server_error(HttpStatusCode statusCodeOfResponse) - { - // Arrange - var testee = new HttpResponseMessage(statusCodeOfResponse); - - // Act / Assert - testee.Should().HaveServerError(); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_status_code_success_is_server_error() - { - // Arrange - Action action = () => new HttpResponseMessage(HttpStatusCode.OK).Should() - .HaveServerError("because we want to test the failure {0}", "message"); - - // Act / Assert - action.Should().Throw() - .WithMessage( - "Expected HttpStatusCode to be server error (5xx) because we want to test the failure message, but found HttpStatusCode.OK {value: 200}."); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_server_error_but_response_is_null() - { - // Arrange - Action action = () => - ((HttpResponseMessage)null).Should().HaveServerError("because we want to test the failure {0}", "message"); - - // Act / Assert - action.Should().Throw() - .WithMessage( - "Expected HttpStatusCode to be server error (5xx) because we want to test the failure message, but HttpResponseMessage was ."); - } - - [Theory] - [InlineData(HttpStatusCode.BadRequest)] - [InlineData(HttpStatusCode.InternalServerError)] - public void Should_succeed_when_status_code_is_error(HttpStatusCode statusCodeOfResponse) - { - // Arrange - var testee = new HttpResponseMessage(statusCodeOfResponse); - - // Act / Assert - testee.Should().HaveError(); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_status_code_success_is_error() - { - // Arrange - Action action = () => new HttpResponseMessage(HttpStatusCode.OK).Should() - .HaveError("because we want to test the failure {0}", "message"); - - // Act / Assert - action.Should().Throw() - .WithMessage( - "Expected HttpStatusCode to be an error because we want to test the failure message, but found HttpStatusCode.OK {value: 200}."); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_error_but_response_is_null() - { - // Arrange - Action action = () => - ((HttpResponseMessage)null).Should().HaveError("because we want to test the failure {0}", "message"); - - // Act / Assert - action.Should().Throw() - .WithMessage( - "Expected HttpStatusCode to be an error because we want to test the failure message, but HttpResponseMessage was ."); - } - - [Fact] - public void Should_succeed_when_status_code_to_be_equal_to_the_same_value() - { - // Arrange - Action action = () => new HttpResponseMessage(HttpStatusCode.OK).Should().HaveStatusCode(HttpStatusCode.OK); - - // Act / Assert - action.Should().NotThrow(); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_status_code_value_to_be_equal_to_a_different_value() - { - // Arrange - Action action = () => new HttpResponseMessage(HttpStatusCode.OK).Should().HaveStatusCode(HttpStatusCode.Gone, - "because we want to test the failure {0}", "message"); - - // Act / Assert - action.Should().Throw() - .WithMessage( - "Expected HttpStatusCode to be HttpStatusCode.Gone {value: 410} because we want to test the failure message, but found HttpStatusCode.OK {value: 200}.*"); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_certain_status_code_but_response_is_null() - { - // Arrange - Action action = () => ((HttpResponseMessage)null).Should() - .HaveStatusCode(HttpStatusCode.Gone, "because we want to test the failure {0}", "message"); - - // Act / Assert - action.Should().Throw() - .WithMessage( - "Expected HttpStatusCode to be HttpStatusCode.Gone {value: 410} because we want to test the failure message, but HttpResponseMessage was ."); - } - - [Fact] - public void Should_succeed_when_status_code_value_not_to_be_equal_to_the_same_value() - { - // Arrange - Action action = () => new HttpResponseMessage(HttpStatusCode.OK).Should().NotHaveStatusCode(HttpStatusCode.Gone); - - // Act / Assert - action.Should().NotThrow(); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_status_code_value_not_to_be_equal_to_a_different_value() - { - // Arrange - Action action = () => new HttpResponseMessage(HttpStatusCode.OK).Should().NotHaveStatusCode(HttpStatusCode.OK, - "because we want to test the failure {0}", "message"); - - // Act / Assert - action.Should().Throw() - .WithMessage( - "Expected HttpStatusCode not to be HttpStatusCode.OK {value: 200} because we want to test the failure message, but found HttpStatusCode.OK {value: 200}.*"); - } - - [Fact] - public void Should_fail_with_descriptive_message_when_asserting_against_certain_status_code_but_response_is_null() - { - // Arrange - Action action = () => ((HttpResponseMessage)null).Should() - .NotHaveStatusCode(HttpStatusCode.Gone, "because we want to test the failure {0}", "message"); - - // Act / Assert - action.Should().Throw() - .WithMessage( - "Expected HttpStatusCode not to be HttpStatusCode.Gone {value: 410} because we want to test the failure message, but HttpResponseMessage was ."); - } -} diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index d3577f1dfe..c6559a7a12 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -18,7 +18,4 @@ runtime; build; native; contentfiles; analyzers - - - - \ No newline at end of file + diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj index bcc9870bf9..755debc6d5 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -12,7 +12,4 @@ - - - diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index b823c7eee4..b03fd4d223 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -12,7 +12,4 @@ - - - diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index 0f3795226d..efae3d15fa 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -105,5 +105,5 @@ sidebar: url: https://continuousimprover.com/2018/02/fluent-assertions-50-best-unit-test.html#upgrading-tips - title: Upgrading to 6.0 url: /upgradingtov6 - - title: Upgrading to 7.0 - url: /upgradingtov7 + - title: Upgrading to 8.0 + url: /upgradingtov8 diff --git a/docs/_pages/httpresponsemessages.md b/docs/_pages/httpresponsemessages.md index 96575c1087..269d894ea1 100644 --- a/docs/_pages/httpresponsemessages.md +++ b/docs/_pages/httpresponsemessages.md @@ -7,22 +7,4 @@ sidebar: nav: "sidebar" --- -```csharp -var successfulResponse = new HttpResponseMessage(HttpStatusCode.OK); -successfulResponse.Should().BeSuccessful("it's set to OK"); // (HttpStatusCode = 2xx) - -var redirectResponse = new HttpResponseMessage(HttpStatusCode.Moved); -redirectResponse.Should().BeRedirection("it's set to Moved"); // (HttpStatusCode = 3xx) - -var clientErrorResponse = new HttpResponseMessage(HttpStatusCode.BadRequest); -clientErrorResponse.Should().HaveClientError("it's set to BadRequest"); // (HttpStatusCode = 4xx) -clientErrorResponse.Should().HaveError("it's set to BadRequest"); // (HttpStatusCode = 4xx or 5xx) - -var serverErrorResponse = new HttpResponseMessage(HttpStatusCode.InternalServerError); -serverErrorResponse.Should().HaveServerError("it's set to InternalServerError"); // (HttpStatusCode = 5xx) -serverErrorResponse.Should().HaveError("it's set to InternalServerError"); // (HttpStatusCode = 4xx or 5xx) - -var anotherResponse = new HttpResponseMessage(HttpStatusCode.Moved); -anotherResponse.Should().HaveStatusCode(HttpStatusCode.Moved); -anotherResponse.Should().NotHaveStatusCode(HttpStatusCode.OK); -``` +The support for assertions on this type was removed in FluentAssertions 8.0. If you need to do assertions like these, we recommend you adopt [FluentAssertions.Web](https://github.com/adrianiftode/FluentAssertions.Web). diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 105bd34b1a..8f26f33bd3 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -45,7 +45,7 @@ sidebar: ### Fixes * Fixed incorrect treatment of "\\r\\n" as new line - [#2569](https://github.com/fluentassertions/fluentassertions/pull/2569) * Fixed `RaisePropertyChangeFor` to return a filtered list of events - [#2677](https://github.com/fluentassertions/fluentassertions/pull/2677) -* Including or excluding members did not work when `WithMapping` was used in `BeEquivalentTo` - [#2860](https://github.com/fluentassertions/fluentassertions/pull/2860) +* Including or excluding members did not work when `WithMapping` was used in `BeEquivalentTo` - [#2860](https://github.com/fluentassertions/fluentassertions/pull/2860) ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) @@ -78,6 +78,7 @@ sidebar: * Renamed `HaveAttribute` to `HaveAttributeWithValue` on `XElement` - [#2690](https://github.com/fluentassertions/fluentassertions/pull/2690) * Renamed `RespectingRuntimeTypes` to `PreferringRuntimeMemberTypes` and `RespectingDeclaredTypes` to `PreferringDeclaredMemberTypes` - [#2866](https://github.com/fluentassertions/fluentassertions/pull/2866) * Renamed `ExcludingNestedObjects` to `WithoutRecursing` to better describe its purpose - [#2876](https://github.com/fluentassertions/fluentassertions/pull/2876) +* Removed direct support for assertions on `HttpResponseMessage`. Use [FluentAssertions.Web](https://github.com/adrianiftode/FluentAssertions.Web) instead. - [#2909](https://github.com/fluentassertions/fluentassertions/pull/2909) ### Breaking Changes (for extensions) * Add `ForConstraint` to `IAssertionsScope` to support chaining `.ForConstraint()` after `.Then` - [#2324](https://github.com/fluentassertions/fluentassertions/pull/2324) diff --git a/docs/_pages/upgradingtov7.md b/docs/_pages/upgradingtov8.md similarity index 92% rename from docs/_pages/upgradingtov7.md rename to docs/_pages/upgradingtov8.md index 1248cfdd36..323a81ede1 100644 --- a/docs/_pages/upgradingtov7.md +++ b/docs/_pages/upgradingtov8.md @@ -1,6 +1,6 @@ --- -title: Upgrading to version 7.0 -permalink: /upgradingtov7 +title: Upgrading to version 8.0 +permalink: /upgradingtov8 layout: single toc: true sidebar: @@ -22,7 +22,7 @@ public static BooleanAssertions Should(this bool actualValue) } ``` -On turn, the `BooleanAssertions` would expose a `BeTrue` method +On turn, the `BooleanAssertions` would expose a `BeTrue` method ```csharp public AndConstraint BeTrue(string because = "", params object[] becauseArgs) @@ -45,7 +45,7 @@ public static BooleanAssertions Should(this bool actualValue) } ``` -Notice how we pass the call to `AssertionChain.GetOrCreate` to the assertions class? By default `GetOrCreate` will create a new instance of `AssertionChain`. But if the previous assertion method uses `AssertionChain.ReuseOnce`, `GetOrCreate` will return that reused instance only once. +Notice how we pass the call to `AssertionChain.GetOrCreate` to the assertions class? By default `GetOrCreate` will create a new instance of `AssertionChain`. But if the previous assertion method uses `AssertionChain.ReuseOnce`, `GetOrCreate` will return that reused instance only once. The new `BeTrue` now looks like: @@ -61,7 +61,7 @@ public AndConstraint BeTrue(string because = "", params object[] be } ``` -So all of the methods to build an assertion that used to live on the `AssertionScope` (which is what `Execute.Assertion` returned), have now moved to `AssertionChain`. This is great because it allows the second assertion to get access to the state of the first assertion. For instance, if the first assertion failed, any successive attempts to call `FailWith` will not do anything. +So all of the methods to build an assertion that used to live on the `AssertionScope` (which is what `Execute.Assertion` returned), have now moved to `AssertionChain`. This is great because it allows the second assertion to get access to the state of the first assertion. For instance, if the first assertion failed, any successive attempts to call `FailWith` will not do anything. ## No more `ClearExpectation` @@ -80,7 +80,7 @@ Execute.Assertion .ClearExpectation(); ``` -When using an `using new AssertionScope()` construct to wrap multiple assertions, all assertions executed within that scope will reuse the same instance of `AssertionScope` (which is what `Execute.Assertion` returned). The problem was that you had to explicitly call `ClearExpectation` to prevent the failure message passed to `WithExpectation` to leak into the next assertion within that scope. People often forgot that. +When using an `using new AssertionScope()` construct to wrap multiple assertions, all assertions executed within that scope will reuse the same instance of `AssertionScope` (which is what `Execute.Assertion` returned). The problem was that you had to explicitly call `ClearExpectation` to prevent the failure message passed to `WithExpectation` to leak into the next assertion within that scope. People often forgot that. We solved this in v7, by making `WithExpectation` use a nested construct. This is what it now looks like: @@ -123,7 +123,7 @@ Now, in v7, it'll will return the following: Expected element/child to contain 1 item(s), but found 3: {, , }. -This is possible because `HaveElement` will pass the `AssertionChain` through `ReuseOnce` to the succeeding `HaveCount()` _and_ amend the automatically detected caller identifier `element` (the part on which the first `Should` is invoked) with `"/child"` using `WithCallerPostfix`. Since this is a common thing in v7, the `AndWhichConstraint` has a constructor that does most of that automatically. +This is possible because `HaveElement` will pass the `AssertionChain` through `ReuseOnce` to the succeeding `HaveCount()` _and_ amend the automatically detected caller identifier `element` (the part on which the first `Should` is invoked) with `"/child"` using `WithCallerPostfix`. Since this is a common thing in v7, the `AndWhichConstraint` has a constructor that does most of that automatically. This is what `HaveElement` looks like (with some details left out): @@ -146,6 +146,11 @@ public AndWhichConstraint HaveElement(XName expect Notice the last argument to the `AndWhichConstraint` constructor. +## Drop direct support for assertions on `HttpResponseMessage` + +If you need to do so, please refer to [FluentAssertions.Web](https://github.com/adrianiftode/FluentAssertions.Web) which +offers a bunch of extensions on the HTTP specific types. + ## Other breaking changes -Check out the [release notes](releases.md) for other changes that might affect the upgrade to v7. \ No newline at end of file +Check out the [release notes](releases.md) for other changes that might affect the upgrade to v8. From 192abeea3b12cf8fa4ac01aa032f743c66388922 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sat, 4 Jan 2025 16:33:32 +0100 Subject: [PATCH 520/845] Consolidated the existing global configuration options. (#2901) --- .editorconfig | 5 + .github/dependabot.yml | 1 - Src/FluentAssertions/AndWhichConstraint.cs | 3 +- .../AssertionConfiguration.cs | 11 + .../Services.cs => AssertionEngine.cs} | 45 +- Src/FluentAssertions/AssertionExtensions.cs | 2 +- .../GenericCollectionAssertions.cs | 32 +- .../GenericDictionaryAssertions.cs | 8 +- .../Collections/StringCollectionAssertions.cs | 8 +- .../Common/AppSettingsConfigurationStore.cs | 17 - Src/FluentAssertions/Common/Configuration.cs | 130 ------ .../ConfigurationStoreExceptionInterceptor.cs | 31 -- .../Common/IConfigurationStore.cs | 6 - Src/FluentAssertions/Common/IReflector.cs | 10 - .../Common/NullConfigurationStore.cs | 9 - ...FrameworkReflector.cs => TypeReflector.cs} | 5 +- .../Common/ValueFormatterDetectionMode.cs | 10 +- .../Configuration/GlobalConfiguration.cs | 22 + .../GlobalEquivalencyOptions.cs} | 61 +-- .../Configuration/GlobalFormattingOptions.cs | 34 ++ .../Configuration/TestFramework.cs | 14 + .../{ => Equivalency}/EquivalencyPlan.cs | 17 +- .../Equivalency/EquivalencyValidator.cs | 2 +- .../Execution/AssertionScope.cs | 2 +- .../Execution/CollectingAssertionStrategy.cs | 3 +- .../Execution/DefaultAssertionStrategy.cs | 3 +- .../Execution/ITestFramework.cs | 2 +- .../Execution/TestFrameworkFactory.cs | 74 ++++ .../Execution/TestFrameworkProvider.cs | 97 ----- Src/FluentAssertions/FluentAssertions.csproj | 20 - .../Formatting/AttributeBasedFormatter.cs | 23 +- .../Formatting/FormattedObjectGraph.cs | 2 +- Src/FluentAssertions/Formatting/Formatter.cs | 2 +- .../Formatting/FormattingOptions.cs | 10 +- .../Numeric/ComparableTypeAssertions.cs | 6 +- .../ObjectAssertionsExtensions.cs | 4 +- .../Primitives/ObjectAssertions.cs | 10 +- .../Primitives/StringAssertions.cs | 14 +- .../Specialized/ExceptionAssertions.cs | 2 +- .../FluentAssertions/net47.verified.txt | 112 ++--- .../FluentAssertions/net6.0.verified.txt | 112 ++--- .../netstandard2.0.verified.txt | 112 ++--- .../netstandard2.1.verified.txt | 112 ++--- .../Common/ConfigurationSpecs.cs | 81 ---- .../ConfigurationSpecsDefinition.cs | 7 + .../EquivalencyOptionsSpecs.cs} | 85 +--- .../Configuration/FormattingOptionsSpecs.cs | 216 ++++++++++ .../Configuration/GlobalConfigurationSpecs.cs | 54 +++ .../TestFrameworkFactorySpecs.cs | 57 +++ .../ConfigurationSpecs.cs | 36 -- .../Execution/AssertionScopeSpecs.cs | 5 +- .../Execution/TestFrameworkProviderTests.cs | 84 ---- .../Formatting/FormatterSpecs.cs | 406 +++++------------- .../Formatting/FormatterSpecsDefinition.cs | 7 + .../MultidimensionalArrayFormatterSpecs.cs | 1 - docs/_pages/extensibility.md | 20 +- docs/_pages/introduction.md | 4 +- docs/_pages/objectgraphs.md | 10 +- docs/_pages/releases.md | 2 + 59 files changed, 1028 insertions(+), 1252 deletions(-) create mode 100644 Src/FluentAssertions/AssertionConfiguration.cs rename Src/FluentAssertions/{Common/Services.cs => AssertionEngine.cs} (71%) delete mode 100644 Src/FluentAssertions/Common/AppSettingsConfigurationStore.cs delete mode 100644 Src/FluentAssertions/Common/Configuration.cs delete mode 100644 Src/FluentAssertions/Common/ConfigurationStoreExceptionInterceptor.cs delete mode 100644 Src/FluentAssertions/Common/IConfigurationStore.cs delete mode 100644 Src/FluentAssertions/Common/IReflector.cs delete mode 100644 Src/FluentAssertions/Common/NullConfigurationStore.cs rename Src/FluentAssertions/Common/{FullFrameworkReflector.cs => TypeReflector.cs} (90%) create mode 100644 Src/FluentAssertions/Configuration/GlobalConfiguration.cs rename Src/FluentAssertions/{AssertionOptions.cs => Configuration/GlobalEquivalencyOptions.cs} (50%) create mode 100644 Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs create mode 100644 Src/FluentAssertions/Configuration/TestFramework.cs rename Src/FluentAssertions/{ => Equivalency}/EquivalencyPlan.cs (82%) create mode 100644 Src/FluentAssertions/Execution/TestFrameworkFactory.cs delete mode 100644 Src/FluentAssertions/Execution/TestFrameworkProvider.cs delete mode 100644 Tests/FluentAssertions.Specs/Common/ConfigurationSpecs.cs create mode 100644 Tests/FluentAssertions.Specs/Configuration/ConfigurationSpecsDefinition.cs rename Tests/FluentAssertions.Specs/{AssertionOptionsSpecs.cs => Configuration/EquivalencyOptionsSpecs.cs} (78%) create mode 100644 Tests/FluentAssertions.Specs/Configuration/FormattingOptionsSpecs.cs create mode 100644 Tests/FluentAssertions.Specs/Configuration/GlobalConfigurationSpecs.cs create mode 100644 Tests/FluentAssertions.Specs/Configuration/TestFrameworkFactorySpecs.cs delete mode 100644 Tests/FluentAssertions.Specs/ConfigurationSpecs.cs delete mode 100644 Tests/FluentAssertions.Specs/Execution/TestFrameworkProviderTests.cs create mode 100644 Tests/FluentAssertions.Specs/Formatting/FormatterSpecsDefinition.cs diff --git a/.editorconfig b/.editorconfig index 0ea4ede3a9..341cae8083 100644 --- a/.editorconfig +++ b/.editorconfig @@ -146,6 +146,11 @@ dotnet_diagnostic.CA1307.severity = error dotnet_diagnostic.CA1308.severity = error # CA1309: Use ordinal StringComparison dotnet_diagnostic.CA1309.severity = error + +# Purpose: Rename virtual/interface member ITestFramework.Throw(string) so that it no longer conflicts with the reserved language keyword 'Throw' +# Reason: We don't care about other languages than C# +dotnet_diagnostic.CA1716.severity = none + # CA1724: Type names should not match namespaces dotnet_diagnostic.CA1724.severity = none # CA1819: Properties should not return arrays diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4d017cab8f..4cff2d053e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -33,7 +33,6 @@ updates: timezone: "Europe/Copenhagen" ignore: - dependency-name: "System.Collections.Immutable" - - dependency-name: "System.Configuration.ConfigurationManager" - dependency-name: "System.Threading.Tasks.Extensions" groups: xunit: diff --git a/Src/FluentAssertions/AndWhichConstraint.cs b/Src/FluentAssertions/AndWhichConstraint.cs index 858423955f..49df87657e 100644 --- a/Src/FluentAssertions/AndWhichConstraint.cs +++ b/Src/FluentAssertions/AndWhichConstraint.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using FluentAssertions.Common; using FluentAssertions.Execution; using FluentAssertions.Formatting; @@ -84,7 +83,7 @@ private static TSubject Single(IEnumerable subjects) string message = "More than one object found. FluentAssertions cannot determine which object is meant." + $" Found objects:{Environment.NewLine}{foundObjects}"; - Services.ThrowException(message); + AssertionEngine.TestFramework.Throw(message); } return matchedElements.Single(); diff --git a/Src/FluentAssertions/AssertionConfiguration.cs b/Src/FluentAssertions/AssertionConfiguration.cs new file mode 100644 index 0000000000..82a2833716 --- /dev/null +++ b/Src/FluentAssertions/AssertionConfiguration.cs @@ -0,0 +1,11 @@ +using FluentAssertions.Configuration; + +namespace FluentAssertions; + +/// +/// Provides access to the global configuration and options to customize the behavior of FluentAssertions. +/// +public static class AssertionConfiguration +{ + public static GlobalConfiguration Current => AssertionEngine.Configuration; +} diff --git a/Src/FluentAssertions/Common/Services.cs b/Src/FluentAssertions/AssertionEngine.cs similarity index 71% rename from Src/FluentAssertions/Common/Services.cs rename to Src/FluentAssertions/AssertionEngine.cs index 551b09f2d2..bab1ebc19c 100644 --- a/Src/FluentAssertions/Common/Services.cs +++ b/Src/FluentAssertions/AssertionEngine.cs @@ -1,47 +1,44 @@ using System; using System.Linq; using System.Reflection; +using FluentAssertions.Configuration; using FluentAssertions.Execution; using FluentAssertions.Extensibility; using JetBrains.Annotations; -namespace FluentAssertions.Common; +namespace FluentAssertions; /// -/// Maintains the framework-specific services. +/// Represents the run-time configuration of the assertion library. /// -public static class Services +public static class AssertionEngine { private static readonly object Lockable = new(); - private static Configuration configuration; private static bool isInitialized; - static Services() + static AssertionEngine() { EnsureInitialized(); } - public static IConfigurationStore ConfigurationStore { get; set; } + /// + /// Gets or sets the run-time test framework used for throwing assertion exceptions. + /// + public static ITestFramework TestFramework { get; set; } - public static Configuration Configuration - { - get - { - lock (Lockable) - { - return configuration ??= new Configuration(ConfigurationStore); - } - } - } - - public static Action ThrowException { get; set; } - - public static IReflector Reflector { get; set; } + /// + /// Provides access to the global configuration and options to customize the behavior of FluentAssertions. + /// + public static GlobalConfiguration Configuration { get; private set; } = new(); + /// + /// Resets the configuration to its default state and forces the engine to reinitialize the next time it is used. + /// [PublicAPI] public static void ResetToDefaults() { isInitialized = false; + Configuration = new(); EnsureInitialized(); } @@ -58,13 +55,7 @@ internal static void EnsureInitialized() { ExecuteCustomInitializers(); - Reflector = new FullFrameworkReflector(); -#if NETFRAMEWORK || NET6_0_OR_GREATER - ConfigurationStore = new ConfigurationStoreExceptionInterceptor(new AppSettingsConfigurationStore()); -#else - ConfigurationStore = new NullConfigurationStore(); -#endif - ThrowException = new TestFrameworkProvider(Configuration).Throw; + TestFramework = TestFrameworkFactory.GetFramework(Configuration.TestFramework); isInitialized = true; } diff --git a/Src/FluentAssertions/AssertionExtensions.cs b/Src/FluentAssertions/AssertionExtensions.cs index 7abf3d92da..c68660cb1d 100644 --- a/Src/FluentAssertions/AssertionExtensions.cs +++ b/Src/FluentAssertions/AssertionExtensions.cs @@ -35,7 +35,7 @@ public static class AssertionExtensions static AssertionExtensions() { - Services.EnsureInitialized(); + AssertionEngine.EnsureInitialized(); } /// diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index bdb58c40c7..ebc69508e9 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -137,7 +137,7 @@ public AndConstraint AllBeAssignableTo(Type expectedType, /// and the result is equal. /// The type of a collection property is ignored as long as the collection implements and all /// items in the collection are structurally equal. - /// Notice that actual behavior is determined by the global defaults managed by . + /// Notice that actual behavior is determined by the global defaults managed by . /// /// The expected element. /// @@ -162,14 +162,14 @@ public AndConstraint AllBeEquivalentTo(TExpectation e /// and the result is equal. /// The type of a collection property is ignored as long as the collection implements and all /// items in the collection are structurally equal. - /// Notice that actual behavior is determined by the global defaults managed by . + /// Notice that actual behavior is determined by the global defaults managed by . /// /// The expected element. /// /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the /// class. The global defaults are determined by the - /// class. + /// class. /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -309,7 +309,7 @@ public AndConstraint BeEmpty([StringSyntax("CompositeFormat")] stri /// and the result is equal. /// The type of a collection property is ignored as long as the collection implements and all /// items in the collection are structurally equal. - /// Notice that actual behavior is determined by the global defaults managed by . + /// Notice that actual behavior is determined by the global defaults managed by . /// /// An with the expected elements. /// @@ -334,14 +334,14 @@ public AndConstraint BeEquivalentTo(IEnumerable and all /// items in the collection are structurally equal. - /// Notice that actual behavior is determined by the global defaults managed by . + /// Notice that actual behavior is determined by the global defaults managed by . /// /// An with the expected elements. /// /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the /// class. The global defaults are determined by the - /// class. + /// class. /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -359,7 +359,7 @@ public AndConstraint BeEquivalentTo(IEnumerable> options = - config(AssertionOptions.CloneDefaults()).AsCollection(); + config(AssertionConfiguration.Current.Equivalency.CloneDefaults()).AsCollection(); var context = new EquivalencyValidationContext( @@ -844,7 +844,7 @@ public AndConstraint Contain(IEnumerable expected, [StringSyntax /// /// By default, objects within the collection are seen as equivalent to the expected object when both object graphs have equally named properties with the same /// value, irrespective of the type of those objects. - /// Notice that actual behavior is determined by the global defaults managed by . + /// Notice that actual behavior is determined by the global defaults managed by . /// /// /// The expected element. @@ -873,7 +873,7 @@ public AndWhichConstraint ContainEquivalentOf(TExp /// /// By default, objects within the collection are seen as equivalent to the expected object when both object graphs have equally named properties with the same /// value, irrespective of the type of those objects. - /// Notice that actual behavior is determined by the global defaults managed by . + /// Notice that actual behavior is determined by the global defaults managed by . /// /// /// The expected element. @@ -881,7 +881,7 @@ public AndWhichConstraint ContainEquivalentOf(TExp /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the /// class. The global defaults are determined by the - /// class. + /// class. /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -905,7 +905,7 @@ public AndWhichConstraint ContainEquivalentOf(TExp if (assertionChain.Succeeded) { - EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); using var scope = new AssertionScope(); assertionChain.AddReportable("configuration", () => options.ToString()); @@ -1849,7 +1849,7 @@ public AndConstraint NotBeEquivalentTo(IEnumerable configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the /// class. The global defaults are determined by the - /// class. + /// class. /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -2339,7 +2339,7 @@ public AndConstraint NotContain(IEnumerable unexpected, [StringS /// /// By default, objects within the collection are seen as not equivalent to the expected object when both object graphs have unequally named properties with the same /// value, irrespective of the type of those objects. - /// Notice that actual behavior is determined by the global defaults managed by . + /// Notice that actual behavior is determined by the global defaults managed by . /// /// /// The unexpected element. @@ -2368,7 +2368,7 @@ public AndConstraint NotContainEquivalentOf(TExpectat /// /// By default, objects within the collection are seen as not equivalent to the expected object when both object graphs have unequally named properties with the same /// value, irrespective of the type of those objects. - /// Notice that actual behavior is determined by the global defaults managed by . + /// Notice that actual behavior is determined by the global defaults managed by . /// /// /// The unexpected element. @@ -2376,7 +2376,7 @@ public AndConstraint NotContainEquivalentOf(TExpectat /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the /// class. The global defaults are determined by the - /// class. + /// class. /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -2402,7 +2402,7 @@ public AndConstraint NotContainEquivalentOf(TExpectat if (assertionChain.Succeeded) { - EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); var foundIndices = new List(); diff --git a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs index 381e082a1b..51331ba9c7 100644 --- a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs @@ -172,7 +172,7 @@ public AndConstraint NotEqual(T unexpected, /// and the result is equal. /// The type of the values in the dictionaries are ignored as long as both dictionaries contain the same keys and /// the values for each key are structurally equivalent. Notice that actual behavior is determined by the global - /// defaults managed by the class. + /// defaults managed by the class. /// /// The expected element. /// @@ -197,14 +197,14 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// and the result is equal. /// The type of the values in the dictionaries are ignored as long as both dictionaries contain the same keys and /// the values for each key are structurally equivalent. Notice that actual behavior is determined by the global - /// defaults managed by the class. + /// defaults managed by the class. /// /// The expected element. /// /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the /// class. The global defaults are determined by the - /// class. + /// class. /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -220,7 +220,7 @@ public AndConstraint BeEquivalentTo(TExpectation expe { Guard.ThrowIfArgumentIsNull(config); - EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); var context = new EquivalencyValidationContext(Node.From(() => CurrentAssertionChain.CallerIdentifier), options) diff --git a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs index 6d2fce15ca..f6a9482bee 100644 --- a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs @@ -113,8 +113,8 @@ public AndConstraint BeEquivalentTo(IEnumerable expectation /// /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the - /// class. The global defaults are determined by the - /// class. + /// class. The global defaults can be modified through + /// . /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -131,7 +131,7 @@ public AndConstraint BeEquivalentTo(IEnumerable expectation Guard.ThrowIfArgumentIsNull(config); EquivalencyOptions> - options = config(AssertionOptions.CloneDefaults()).AsCollection(); + options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()).AsCollection(); var context = new EquivalencyValidationContext(Node.From>(() => CurrentAssertionChain.CallerIdentifier), options) @@ -177,7 +177,7 @@ public AndConstraint AllBe(string expectation, /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the /// class. The global defaults are determined by the - /// class. + /// class. /// /// /// A formatted phrase as is supported by explaining why the assertion diff --git a/Src/FluentAssertions/Common/AppSettingsConfigurationStore.cs b/Src/FluentAssertions/Common/AppSettingsConfigurationStore.cs deleted file mode 100644 index ee12469337..0000000000 --- a/Src/FluentAssertions/Common/AppSettingsConfigurationStore.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Even though .NET Standard 2.0 seems to support the ConfigurationManager class according -// to the NuGet package at https://www.nuget.org/packages/System.Configuration.ConfigurationManager, -// it will often throw a PlatformNotSupport exception. See -// https://docs.microsoft.com/en-us/dotnet/api/system.configuration.configurationmanager?view=netframework-4.8 - -using System.Configuration; - -namespace FluentAssertions.Common; - -internal class AppSettingsConfigurationStore : IConfigurationStore -{ - public string GetSetting(string name) - { - string value = ConfigurationManager.AppSettings[name]; - return !string.IsNullOrEmpty(value) ? value : null; - } -} diff --git a/Src/FluentAssertions/Common/Configuration.cs b/Src/FluentAssertions/Common/Configuration.cs deleted file mode 100644 index a74cee2744..0000000000 --- a/Src/FluentAssertions/Common/Configuration.cs +++ /dev/null @@ -1,130 +0,0 @@ -using System; -using FluentAssertions.Formatting; - -namespace FluentAssertions.Common; - -public class Configuration -{ - /// - /// Defines the key for the configuration of the test framework to be assumed in FluentAssertions. - /// - private const string TestFrameworkConfigurationKey = "FluentAssertions.TestFramework"; - - #region Private Definitions - - private readonly object propertiesAccessLock = new(); - private readonly IConfigurationStore store; - private string valueFormatterAssembly; - private ValueFormatterDetectionMode? valueFormatterDetectionMode; - private string testFrameworkName; - - #endregion - - /// - /// Gets the active configuration, - /// - public static Configuration Current => Services.Configuration; - - public Configuration(IConfigurationStore store) - { - this.store = store; - } - - /// - /// Gets or sets the mode on how Fluent Assertions will find custom implementations of - /// . - /// - public ValueFormatterDetectionMode ValueFormatterDetectionMode - { - get - { - lock (propertiesAccessLock) - { - return valueFormatterDetectionMode ??= DetermineFormatterDetectionMode(); - } - } - - set - { - valueFormatterDetectionMode = value; - } - } - - private ValueFormatterDetectionMode DetermineFormatterDetectionMode() - { - if (ValueFormatterAssembly is not null) - { - return ValueFormatterDetectionMode.Specific; - } - - string setting = store.GetSetting("valueFormatters"); - - if (!string.IsNullOrEmpty(setting)) - { - try - { - return (ValueFormatterDetectionMode)Enum.Parse(typeof(ValueFormatterDetectionMode), setting, ignoreCase: true); - } - catch (ArgumentException) - { - throw new InvalidOperationException( - $"'{setting}' is not a valid option for detecting value formatters. Valid options include Disabled, Specific and Scan."); - } - } - - return ValueFormatterDetectionMode.Disabled; - } - - /// - /// Gets or sets the assembly name to scan for custom value formatters in case - /// is set to . - /// - public string ValueFormatterAssembly - { - get - { - if (valueFormatterAssembly is null) - { - string assemblyName = store.GetSetting("valueFormattersAssembly"); - - if (!string.IsNullOrEmpty(assemblyName)) - { - valueFormatterAssembly = assemblyName; - } - } - - return valueFormatterAssembly; - } - - set - { - lock (propertiesAccessLock) - { - valueFormatterAssembly = value; - valueFormatterDetectionMode = null; - } - } - } - - /// - /// Gets or sets the name of the test framework to use. - /// - /// - /// If no name is provided, Fluent Assertions - /// will try to detect it by scanning the currently loaded assemblies. If it can't find a suitable provider, - /// and the run-time platform supports it, it'll try to get it from the . - /// - public string TestFrameworkName - { - get - { - if (string.IsNullOrEmpty(testFrameworkName)) - { - testFrameworkName = store.GetSetting(TestFrameworkConfigurationKey); - } - - return testFrameworkName; - } - set => testFrameworkName = value; - } -} diff --git a/Src/FluentAssertions/Common/ConfigurationStoreExceptionInterceptor.cs b/Src/FluentAssertions/Common/ConfigurationStoreExceptionInterceptor.cs deleted file mode 100644 index e4760a6c6b..0000000000 --- a/Src/FluentAssertions/Common/ConfigurationStoreExceptionInterceptor.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace FluentAssertions.Common; - -internal class ConfigurationStoreExceptionInterceptor : IConfigurationStore -{ - private readonly IConfigurationStore configurationStore; - - private bool underlyingStoreUnavailable; - - public ConfigurationStoreExceptionInterceptor(IConfigurationStore configurationStore) - { - this.configurationStore = configurationStore; - } - - public string GetSetting(string name) - { - if (underlyingStoreUnavailable) - { - return null; - } - - try - { - return configurationStore.GetSetting(name); - } - catch - { - underlyingStoreUnavailable = true; - return null; - } - } -} diff --git a/Src/FluentAssertions/Common/IConfigurationStore.cs b/Src/FluentAssertions/Common/IConfigurationStore.cs deleted file mode 100644 index c8ce460506..0000000000 --- a/Src/FluentAssertions/Common/IConfigurationStore.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace FluentAssertions.Common; - -public interface IConfigurationStore -{ - string GetSetting(string name); -} diff --git a/Src/FluentAssertions/Common/IReflector.cs b/Src/FluentAssertions/Common/IReflector.cs deleted file mode 100644 index 90b9c9ff84..0000000000 --- a/Src/FluentAssertions/Common/IReflector.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; - -namespace FluentAssertions.Common; - -public interface IReflector -{ - IEnumerable GetAllTypesFromAppDomain(Func predicate); -} diff --git a/Src/FluentAssertions/Common/NullConfigurationStore.cs b/Src/FluentAssertions/Common/NullConfigurationStore.cs deleted file mode 100644 index b25caf75cf..0000000000 --- a/Src/FluentAssertions/Common/NullConfigurationStore.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace FluentAssertions.Common; - -internal class NullConfigurationStore : IConfigurationStore -{ - public string GetSetting(string name) - { - return string.Empty; - } -} diff --git a/Src/FluentAssertions/Common/FullFrameworkReflector.cs b/Src/FluentAssertions/Common/TypeReflector.cs similarity index 90% rename from Src/FluentAssertions/Common/FullFrameworkReflector.cs rename to Src/FluentAssertions/Common/TypeReflector.cs index f9fba7a4a8..d630c2f0a3 100644 --- a/Src/FluentAssertions/Common/FullFrameworkReflector.cs +++ b/Src/FluentAssertions/Common/TypeReflector.cs @@ -6,9 +6,9 @@ namespace FluentAssertions.Common; -internal class FullFrameworkReflector : IReflector +internal static class TypeReflector { - public IEnumerable GetAllTypesFromAppDomain(Func predicate) + public static IEnumerable GetAllTypesFromAppDomain(Func predicate) { return AppDomain.CurrentDomain .GetAssemblies() @@ -21,6 +21,7 @@ private static bool IsRelevant(Assembly ass) string assemblyName = ass.GetName().Name; return + assemblyName is not null && !assemblyName.StartsWith("microsoft.", StringComparison.OrdinalIgnoreCase) && !assemblyName.StartsWith("xunit", StringComparison.OrdinalIgnoreCase) && !assemblyName.StartsWith("jetbrains.", StringComparison.OrdinalIgnoreCase) && diff --git a/Src/FluentAssertions/Common/ValueFormatterDetectionMode.cs b/Src/FluentAssertions/Common/ValueFormatterDetectionMode.cs index 8d8d170950..cc938cc6a2 100644 --- a/Src/FluentAssertions/Common/ValueFormatterDetectionMode.cs +++ b/Src/FluentAssertions/Common/ValueFormatterDetectionMode.cs @@ -1,8 +1,10 @@ -namespace FluentAssertions.Common; +using FluentAssertions.Configuration; + +namespace FluentAssertions.Common; /// /// Defines the modes in which custom implementations of -/// are detected as configured through . +/// are detected as configured through . /// public enum ValueFormatterDetectionMode { @@ -12,13 +14,13 @@ public enum ValueFormatterDetectionMode Disabled, /// - /// Only custom value formatters exposed through the assembly set in + /// Only custom value formatters exposed through the assembly set in /// are detected. /// Specific, /// - /// All custom value formatters in any assembly loaded in the current will be detected. + /// All custom value formatters in any assembly loaded in the current AppDomain will be detected. /// Scan, } diff --git a/Src/FluentAssertions/Configuration/GlobalConfiguration.cs b/Src/FluentAssertions/Configuration/GlobalConfiguration.cs new file mode 100644 index 0000000000..9baee410e8 --- /dev/null +++ b/Src/FluentAssertions/Configuration/GlobalConfiguration.cs @@ -0,0 +1,22 @@ +namespace FluentAssertions.Configuration; + +public class GlobalConfiguration +{ + /// + /// Provides access to the formatting defaults for all assertions. + /// + public GlobalFormattingOptions Formatting { get; set; } = new(); + + /// + /// Provides access to the defaults used by the structural equivalency assertions. + /// + public GlobalEquivalencyOptions Equivalency { get; set; } = new(); + + /// + /// Sets a specific test framework to be used by FluentAssertions when throwing assertion exceptions. + /// + /// + /// If set to , the test framework will be automatically detected by scanning the appdomain. + /// + public TestFramework? TestFramework { get; set; } +} diff --git a/Src/FluentAssertions/AssertionOptions.cs b/Src/FluentAssertions/Configuration/GlobalEquivalencyOptions.cs similarity index 50% rename from Src/FluentAssertions/AssertionOptions.cs rename to Src/FluentAssertions/Configuration/GlobalEquivalencyOptions.cs index 3aa20c1658..1dbf8efb10 100644 --- a/Src/FluentAssertions/AssertionOptions.cs +++ b/Src/FluentAssertions/Configuration/GlobalEquivalencyOptions.cs @@ -1,29 +1,22 @@ -using System; +using System; using FluentAssertions.Common; using FluentAssertions.Equivalency; -using FluentAssertions.Formatting; -namespace FluentAssertions; +namespace FluentAssertions.Configuration; -/// -/// Holds any global options that control the behavior of FluentAssertions. -/// -public static class AssertionOptions +public class GlobalEquivalencyOptions { - private static EquivalencyOptions defaults = new(); - - static AssertionOptions() - { - EquivalencyPlan = new EquivalencyPlan(); - } + private EquivalencyOptions defaults = new(); /// - /// Creates a clone of the default options and allows the caller to modify them. + /// Represents a mutable plan consisting of steps that are executed while asserting a (collection of) object(s) + /// is structurally equivalent to another (collection of) object(s). /// - public static EquivalencyOptions CloneDefaults() - { - return new EquivalencyOptions(defaults); - } + /// + /// Members on this property are not thread-safe and should not be invoked from within a unit test. + /// See the docs on how to safely use it. + /// + public EquivalencyPlan Plan { get; } = new(); /// /// Allows configuring the defaults used during a structural equivalency assertion. @@ -32,34 +25,22 @@ public static EquivalencyOptions CloneDefaults() /// This method is not thread-safe and should not be invoked from within a unit test. /// See the docs on how to safely use it. /// - /// + /// /// An action that is used to configure the defaults. /// - /// is . - public static void AssertEquivalencyUsing( - Func defaultsConfigurer) + /// is . + public void Modify(Func configureOptions) { - Guard.ThrowIfArgumentIsNull(defaultsConfigurer); + Guard.ThrowIfArgumentIsNull(configureOptions); - defaults = defaultsConfigurer(defaults); + defaults = configureOptions(defaults); } /// - /// Represents a mutable plan consisting of steps that are executed while asserting a (collection of) object(s) - /// is structurally equivalent to another (collection of) object(s). - /// - /// - /// Members on this property are not thread-safe and should not be invoked from within a unit test. - /// See the docs on how to safely use it. - /// - public static EquivalencyPlan EquivalencyPlan { get; } - - /// - /// Gets the default formatting options used by the formatters in Fluent Assertions. + /// Creates a clone of the default options and allows the caller to modify them. /// - /// - /// Members on this property should not be invoked from within a unit test. - /// See the docs on how to safely use it. - /// - public static FormattingOptions FormattingOptions { get; } = new(); + internal EquivalencyOptions CloneDefaults() + { + return new EquivalencyOptions(defaults); + } } diff --git a/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs b/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs new file mode 100644 index 0000000000..f09c55d8f5 --- /dev/null +++ b/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs @@ -0,0 +1,34 @@ +using FluentAssertions.Common; +using FluentAssertions.Formatting; + +namespace FluentAssertions.Configuration; + +public class GlobalFormattingOptions : FormattingOptions +{ + private string valueFormatterAssembly; + + public string ValueFormatterAssembly + { + get => valueFormatterAssembly; + set + { + valueFormatterAssembly = value; + ValueFormatterDetectionMode = ValueFormatterDetectionMode.Specific; + } + } + + public ValueFormatterDetectionMode ValueFormatterDetectionMode { get; set; } + + internal new GlobalFormattingOptions Clone() + { + return new GlobalFormattingOptions + { + UseLineBreaks = UseLineBreaks, + MaxDepth = MaxDepth, + MaxLines = MaxLines, + ScopedFormatters = [..ScopedFormatters], + ValueFormatterAssembly = ValueFormatterAssembly, + ValueFormatterDetectionMode = ValueFormatterDetectionMode + }; + } +} diff --git a/Src/FluentAssertions/Configuration/TestFramework.cs b/Src/FluentAssertions/Configuration/TestFramework.cs new file mode 100644 index 0000000000..8ee15577d6 --- /dev/null +++ b/Src/FluentAssertions/Configuration/TestFramework.cs @@ -0,0 +1,14 @@ +namespace FluentAssertions.Configuration; + +/// +/// The test frameworks supported by Fluent Assertions. +/// +public enum TestFramework +{ + XUnit2, + XUnit3, + TUnit, + MsTest, + NUnit, + MSpec +} diff --git a/Src/FluentAssertions/EquivalencyPlan.cs b/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs similarity index 82% rename from Src/FluentAssertions/EquivalencyPlan.cs rename to Src/FluentAssertions/Equivalency/EquivalencyPlan.cs index 13ee80b49c..9ef026fca2 100644 --- a/Src/FluentAssertions/EquivalencyPlan.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs @@ -4,12 +4,11 @@ using System.Collections; using System.Collections.Generic; using System.Linq; -using FluentAssertions.Equivalency; using FluentAssertions.Equivalency.Steps; #endregion -namespace FluentAssertions; +namespace FluentAssertions.Equivalency; /// /// Represents a mutable collection of equivalency steps that can be reordered and/or amended with additional @@ -34,7 +33,7 @@ IEnumerator IEnumerable.GetEnumerator() /// . /// /// - /// This method is not thread-safe and should not be invoked on from within a unit test. + /// This method is not thread-safe and should not be modified through from within a unit test. /// See the docs on how to safely use it. /// public void Add() @@ -47,7 +46,7 @@ public void Add() /// Adds a new right after the specified . /// /// - /// This method is not thread-safe and should not be invoked on from within a unit test. + /// This method is not thread-safe and should not be modified through from within a unit test. /// See the docs on how to safely use it. /// public void AddAfter() @@ -69,7 +68,7 @@ public void AddAfter() /// Inserts a new before any of the built-in steps. /// /// - /// This method is not thread-safe and should not be invoked on from within a unit test. + /// This method is not thread-safe and should not be modified through from within a unit test. /// See the docs on how to safely use it. /// public void Insert() @@ -82,7 +81,7 @@ public void Insert() /// Inserts a new just before the . /// /// - /// This method is not thread-safe and should not be invoked on from within a unit test. + /// This method is not thread-safe and should not be modified through from within a unit test. /// See the docs on how to safely use it. /// public void InsertBefore() @@ -104,7 +103,7 @@ public void InsertBefore() /// Removes all instances of the specified from the current step. /// /// - /// This method is not thread-safe and should not be invoked on from within a unit test. + /// This method is not thread-safe and should not be modified through from within a unit test. /// See the docs on how to safely use it. /// public void Remove() @@ -117,7 +116,7 @@ public void Remove() /// Removes each and every built-in . /// /// - /// This method is not thread-safe and should not be invoked on from within a unit test. + /// This method is not thread-safe and should not be modified through from within a unit test. /// See the docs on how to safely use it. /// public void Clear() @@ -129,7 +128,7 @@ public void Clear() /// Removes all custom s. /// /// - /// This method should not be invoked on from within a unit test. + /// This method is not thread-safe and should not be modified through from within a unit test. /// See the docs on how to safely use it. /// public void Reset() diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs index df89ff076a..1f7a3086fe 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs @@ -92,7 +92,7 @@ private void TryToProveNodesAreEquivalent(Comparands comparands, IEquivalencyVal { using var _ = context.Tracer.WriteBlock(node => node.Expectation.Description); - foreach (IEquivalencyStep step in AssertionOptions.EquivalencyPlan) + foreach (IEquivalencyStep step in AssertionConfiguration.Current.Equivalency.Plan) { var result = step.Handle(comparands, context, this); diff --git a/Src/FluentAssertions/Execution/AssertionScope.cs b/Src/FluentAssertions/Execution/AssertionScope.cs index a5d6783eb6..1a3e135c05 100644 --- a/Src/FluentAssertions/Execution/AssertionScope.cs +++ b/Src/FluentAssertions/Execution/AssertionScope.cs @@ -130,7 +130,7 @@ public static AssertionScope Current /// /// Exposes the options the scope will use for formatting objects in case an assertion fails. /// - public FormattingOptions FormattingOptions { get; } = AssertionOptions.FormattingOptions.Clone(); + public FormattingOptions FormattingOptions { get; } = AssertionConfiguration.Current.Formatting.Clone(); /// /// Adds a pre-formatted failure message to the current scope. diff --git a/Src/FluentAssertions/Execution/CollectingAssertionStrategy.cs b/Src/FluentAssertions/Execution/CollectingAssertionStrategy.cs index 96b801d73f..4c017f1806 100644 --- a/Src/FluentAssertions/Execution/CollectingAssertionStrategy.cs +++ b/Src/FluentAssertions/Execution/CollectingAssertionStrategy.cs @@ -3,7 +3,6 @@ using System.Globalization; using System.Linq; using System.Text; -using FluentAssertions.Common; namespace FluentAssertions.Execution; @@ -44,7 +43,7 @@ public void ThrowIfAny(IDictionary context) } } - Services.ThrowException(builder.ToString()); + AssertionEngine.TestFramework.Throw(builder.ToString()); } } diff --git a/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs b/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs index f8ae691144..2a0a5d8e03 100644 --- a/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs +++ b/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using FluentAssertions.Common; namespace FluentAssertions.Execution; @@ -17,7 +16,7 @@ internal class DefaultAssertionStrategy : IAssertionStrategy /// public void HandleFailure(string message) { - Services.ThrowException(message); + AssertionEngine.TestFramework.Throw(message); } /// diff --git a/Src/FluentAssertions/Execution/ITestFramework.cs b/Src/FluentAssertions/Execution/ITestFramework.cs index dcbdabb840..9aa877ea26 100644 --- a/Src/FluentAssertions/Execution/ITestFramework.cs +++ b/Src/FluentAssertions/Execution/ITestFramework.cs @@ -5,7 +5,7 @@ namespace FluentAssertions.Execution; /// /// Represents an abstraction of a particular test framework such as MSTest, nUnit, etc. /// -internal interface ITestFramework +public interface ITestFramework { /// /// Gets a value indicating whether the corresponding test framework is currently available. diff --git a/Src/FluentAssertions/Execution/TestFrameworkFactory.cs b/Src/FluentAssertions/Execution/TestFrameworkFactory.cs new file mode 100644 index 0000000000..34ab089dde --- /dev/null +++ b/Src/FluentAssertions/Execution/TestFrameworkFactory.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using FluentAssertions.Configuration; + +namespace FluentAssertions.Execution; + +/// +/// Determines the test framework, either by scanning the current app domain for known test framework assemblies or by +/// passing the framework name directly. +/// +internal static class TestFrameworkFactory +{ + private static readonly Dictionary Frameworks = new() + { + [TestFramework.MSpec] = new MSpecFramework(), + [TestFramework.NUnit] = new NUnitTestFramework(), + [TestFramework.MsTest] = new MSTestFrameworkV2(), + + // Keep TUnitFramework and XUnitTestFramework last as they use a try/catch approach + [TestFramework.TUnit] = new TUnitFramework(), + [TestFramework.XUnit2] = new XUnitTestFramework("xunit.assert"), + [TestFramework.XUnit3] = new XUnitTestFramework("xunit.v3.assert"), + }; + + public static ITestFramework GetFramework(TestFramework? testFrameWork) + { + ITestFramework framework = null; + + if (testFrameWork is not null) + { + framework = AttemptToDetectUsingSetting((TestFramework)testFrameWork); + } + + framework ??= AttemptToDetectUsingDynamicScanning(); + + return framework ?? new FallbackTestFramework(); + } + + private static ITestFramework AttemptToDetectUsingSetting(TestFramework framework) + { + if (!Frameworks.TryGetValue(framework, out ITestFramework implementation)) + { + string frameworks = string.Join(", ", Frameworks.Keys); + var message = + $"FluentAssertions was configured to use the test framework '{framework}' but this is not supported. " + + $"Please use one of the supported frameworks: {frameworks}."; + + throw new InvalidOperationException(message); + } + + if (!implementation.IsAvailable) + { + string frameworks = string.Join(", ", Frameworks.Keys); + + var innerMessage = implementation is LateBoundTestFramework lateBoundTestFramework + ? $"the required assembly '{lateBoundTestFramework.AssemblyName}' could not be found" + : "it could not be found"; + + var message = + $"FluentAssertions was configured to use the test framework '{framework}' but {innerMessage}. " + + $"Please use one of the supported frameworks: {frameworks}."; + + throw new InvalidOperationException(message); + } + + return implementation; + } + + private static ITestFramework AttemptToDetectUsingDynamicScanning() + { + return Frameworks.Values.FirstOrDefault(framework => framework.IsAvailable); + } +} diff --git a/Src/FluentAssertions/Execution/TestFrameworkProvider.cs b/Src/FluentAssertions/Execution/TestFrameworkProvider.cs deleted file mode 100644 index 9710e23af4..0000000000 --- a/Src/FluentAssertions/Execution/TestFrameworkProvider.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using FluentAssertions.Common; - -namespace FluentAssertions.Execution; - -/// -/// Implements a wrapper around all supported test frameworks to throw the correct assertion exception. -/// -internal class TestFrameworkProvider -{ - #region Private Definitions - - private static readonly Dictionary Frameworks = new(StringComparer.OrdinalIgnoreCase) - { - ["mspec"] = new MSpecFramework(), - ["nunit"] = new NUnitTestFramework(), - ["mstestv2"] = new MSTestFrameworkV2(), - - // Keep TUnitFramework and XUnitTestFramework last as they use a try/catch approach - ["tunit"] = new TUnitFramework(), - ["xunit2"] = new XUnitTestFramework("xunit.assert"), - ["xunit3"] = new XUnitTestFramework("xunit.v3.assert"), - }; - - private readonly Configuration configuration; - - private ITestFramework testFramework; - - #endregion - - public TestFrameworkProvider(Configuration configuration) - { - this.configuration = configuration; - } - - [DoesNotReturn] - public void Throw(string message) - { - testFramework ??= DetectFramework(); - testFramework.Throw(message); - } - - private ITestFramework DetectFramework() - { - ITestFramework detectedFramework = AttemptToDetectUsingAppSetting() - ?? AttemptToDetectUsingDynamicScanning() - ?? new FallbackTestFramework(); - - return detectedFramework; - } - - private ITestFramework AttemptToDetectUsingAppSetting() - { - string frameworkName = configuration.TestFrameworkName; - - if (string.IsNullOrEmpty(frameworkName)) - { - return null; - } - - if (!Frameworks.TryGetValue(frameworkName, out ITestFramework framework)) - { - string frameworks = string.Join(", ", Frameworks.Keys); - - var message = - $"FluentAssertions was configured to use the test framework '{frameworkName}' but this is not supported. " + - $"Please use one of the supported frameworks: {frameworks}."; - - throw new InvalidOperationException(message); - } - - if (!framework.IsAvailable) - { - string frameworks = string.Join(", ", Frameworks.Keys); - - var innerMessage = framework is LateBoundTestFramework lateBoundTestFramework - ? $"the required assembly '{lateBoundTestFramework.AssemblyName}' could not be found" - : "it could not be found"; - - var message = - $"FluentAssertions was configured to use the test framework '{frameworkName}' but {innerMessage}. " + - $"Please use one of the supported frameworks: {frameworks}."; - - throw new InvalidOperationException(message); - } - - return framework; - } - - private static ITestFramework AttemptToDetectUsingDynamicScanning() - { - return Frameworks.Values.FirstOrDefault(framework => framework.IsAvailable); - } -} diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 55a0d60fa2..4eabaf2f90 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -59,24 +59,8 @@ - - - - - - - - - - - - - - - - @@ -85,12 +69,8 @@ - - - - diff --git a/Src/FluentAssertions/Formatting/AttributeBasedFormatter.cs b/Src/FluentAssertions/Formatting/AttributeBasedFormatter.cs index 430b8241d1..913e32282a 100644 --- a/Src/FluentAssertions/Formatting/AttributeBasedFormatter.cs +++ b/Src/FluentAssertions/Formatting/AttributeBasedFormatter.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Reflection; using FluentAssertions.Common; +using FluentAssertions.Configuration; namespace FluentAssertions.Formatting; @@ -13,7 +14,7 @@ namespace FluentAssertions.Formatting; public class AttributeBasedFormatter : IValueFormatter { private Dictionary formatters; - private ValueFormatterDetectionMode detectionMode = ValueFormatterDetectionMode.Disabled; + private ValueFormatterDetectionMode detectionMode; /// /// Indicates whether the current can handle the specified . @@ -27,10 +28,7 @@ public bool CanHandle(object value) return IsScanningEnabled && value is not null && GetFormatter(value) is not null; } - private static bool IsScanningEnabled - { - get { return Configuration.Current.ValueFormatterDetectionMode != ValueFormatterDetectionMode.Disabled; } - } + private static bool IsScanningEnabled => AssertionConfiguration.Current.Formatting.ValueFormatterDetectionMode == ValueFormatterDetectionMode.Scan; public void Format(object value, FormattedObjectGraph formattedGraph, FormattingContext context, FormatChild formatChild) { @@ -71,9 +69,12 @@ private Dictionary Formatters private void HandleValueFormatterDetectionModeChanges() { - if (detectionMode != Configuration.Current.ValueFormatterDetectionMode) + ValueFormatterDetectionMode configuredDetectionMode = + AssertionEngine.Configuration.Formatting.ValueFormatterDetectionMode; + + if (detectionMode != configuredDetectionMode) { - detectionMode = Configuration.Current.ValueFormatterDetectionMode; + detectionMode = configuredDetectionMode; formatters = null; } } @@ -81,7 +82,7 @@ private void HandleValueFormatterDetectionModeChanges() private static Dictionary FindCustomFormatters() { var query = - from type in Services.Reflector.GetAllTypesFromAppDomain(Applicable) + from type in TypeReflector.GetAllTypesFromAppDomain(Applicable) where type is not null from method in type.GetMethods(BindingFlags.Static | BindingFlags.Public) where method.IsStatic @@ -100,11 +101,11 @@ into formatterGroup private static bool Applicable(Assembly assembly) { - Configuration configuration = Configuration.Current; - ValueFormatterDetectionMode mode = configuration.ValueFormatterDetectionMode; + GlobalFormattingOptions options = AssertionEngine.Configuration.Formatting; + ValueFormatterDetectionMode mode = options.ValueFormatterDetectionMode; return mode == ValueFormatterDetectionMode.Scan || ( mode == ValueFormatterDetectionMode.Specific && - assembly.FullName.Split(',')[0].Equals(configuration.ValueFormatterAssembly, StringComparison.OrdinalIgnoreCase)); + assembly.FullName.Split(',')[0].Equals(options.ValueFormatterAssembly, StringComparison.OrdinalIgnoreCase)); } } diff --git a/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs b/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs index e86f2185b4..91e8d421bf 100644 --- a/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs +++ b/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs @@ -117,7 +117,7 @@ private void AppendWithoutExceedingMaximumLines(string line) lines.Add( $"(Output has exceeded the maximum of {maxLines} lines. " + - $"Increase {nameof(FormattingOptions)}.{nameof(FormattingOptions.MaxLines)} on {nameof(AssertionScope)} or {nameof(AssertionOptions)} to include more lines.)"); + $"Increase {nameof(FormattingOptions)}.{nameof(FormattingOptions.MaxLines)} on {nameof(AssertionScope)} or {nameof(AssertionConfiguration)} to include more lines.)"); throw new MaxLinesExceededException(); } diff --git a/Src/FluentAssertions/Formatting/Formatter.cs b/Src/FluentAssertions/Formatting/Formatter.cs index c8683ce37c..8b1d75d0f1 100644 --- a/Src/FluentAssertions/Formatting/Formatter.cs +++ b/Src/FluentAssertions/Formatting/Formatter.cs @@ -140,7 +140,7 @@ private static void FormatChild(string path, object value, FormattedObjectGraph else if (graph.Depth > options.MaxDepth) { output.AddLine($"Maximum recursion depth of {options.MaxDepth} was reached. " + - $" Increase {nameof(FormattingOptions.MaxDepth)} on {nameof(AssertionScope)} or {nameof(AssertionOptions)} to get more details."); + $" Increase {nameof(FormattingOptions.MaxDepth)} on {nameof(AssertionScope)} or {nameof(AssertionConfiguration)} to get more details."); } else { diff --git a/Src/FluentAssertions/Formatting/FormattingOptions.cs b/Src/FluentAssertions/Formatting/FormattingOptions.cs index 769baf610f..b608525b60 100644 --- a/Src/FluentAssertions/Formatting/FormattingOptions.cs +++ b/Src/FluentAssertions/Formatting/FormattingOptions.cs @@ -5,13 +5,13 @@ namespace FluentAssertions.Formatting; public class FormattingOptions { - internal List ScopedFormatters { get; private set; } = []; + internal List ScopedFormatters { get; set; } = []; /// /// Indicates whether the formatter should use line breaks when the supports it. /// /// - /// This value should not be changed on from within a unit test. + /// This property is not thread-safe and should not be modified through from within a unit test. /// See the docs on how to safely use it. /// public bool UseLineBreaks { get; set; } @@ -20,7 +20,7 @@ public class FormattingOptions /// Determines the depth until which the library should try to render an object graph. /// /// - /// This value should not be changed on from within a unit test. + /// This property is not thread-safe and should not be modified through from within a unit test. /// See the docs on how to safely use it. /// /// @@ -36,7 +36,7 @@ public class FormattingOptions /// Because of technical reasons, the actual output may be one or two lines longer. /// /// - /// This value should not be changed on from within a unit test. + /// This property is not thread-safe and should not be modified through from within a unit test. /// See the docs on how to safely use it. /// /// @@ -71,7 +71,7 @@ internal FormattingOptions Clone() UseLineBreaks = UseLineBreaks, MaxDepth = MaxDepth, MaxLines = MaxLines, - ScopedFormatters = [..ScopedFormatters] + ScopedFormatters = [..ScopedFormatters], }; } } diff --git a/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs b/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs index 3a40a75be1..919f944d8e 100644 --- a/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs +++ b/Src/FluentAssertions/Numeric/ComparableTypeAssertions.cs @@ -67,7 +67,7 @@ public AndConstraint Be(T expected, [StringSyntax("CompositeFormat" /// /// Objects are equivalent when both object graphs have equally named properties with the same value, /// irrespective of the type of those objects. Two properties are also equal if one type can be converted to another and the result is equal. - /// Notice that actual behavior is determined by the global defaults managed by . + /// Notice that actual behavior is determined by the global defaults managed by . /// /// The expected element. /// @@ -95,7 +95,7 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the /// class. The global defaults are determined by the - /// class. + /// class. /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -111,7 +111,7 @@ public AndConstraint BeEquivalentTo(TExpectation expe { Guard.ThrowIfArgumentIsNull(config); - EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); var context = new EquivalencyValidationContext( Node.From(() => CurrentAssertionChain.CallerIdentifier), options) diff --git a/Src/FluentAssertions/ObjectAssertionsExtensions.cs b/Src/FluentAssertions/ObjectAssertionsExtensions.cs index 87281fdc78..72b8cf5764 100644 --- a/Src/FluentAssertions/ObjectAssertionsExtensions.cs +++ b/Src/FluentAssertions/ObjectAssertionsExtensions.cs @@ -38,7 +38,7 @@ public static AndConstraint BeDataContractSerializable(this Ob /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the /// class. The global defaults are determined by the - /// class. + /// class. /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -58,7 +58,7 @@ public static AndConstraint BeDataContractSerializable(this { var deserializedObject = CreateCloneUsingDataContractSerializer(assertions.Subject); - EquivalencyOptions defaultOptions = AssertionOptions.CloneDefaults() + EquivalencyOptions defaultOptions = AssertionConfiguration.Current.Equivalency.CloneDefaults() .PreferringRuntimeMemberTypes().IncludingFields().IncludingProperties(); ((T)deserializedObject).Should().BeEquivalentTo((T)assertions.Subject, _ => options(defaultOptions)); diff --git a/Src/FluentAssertions/Primitives/ObjectAssertions.cs b/Src/FluentAssertions/Primitives/ObjectAssertions.cs index 9c536c3d66..f75f84120c 100644 --- a/Src/FluentAssertions/Primitives/ObjectAssertions.cs +++ b/Src/FluentAssertions/Primitives/ObjectAssertions.cs @@ -243,7 +243,7 @@ public AndConstraint NotBe(TSubject unexpected, IEqualityComparer and all /// items in the collection are structurally equal. - /// Notice that actual behavior is determined by the global defaults managed by . + /// Notice that actual behavior is determined by the global defaults managed by . /// /// The expected element. /// @@ -273,7 +273,7 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the /// class. The global defaults are determined by the - /// class. + /// class. /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -289,7 +289,7 @@ public AndConstraint BeEquivalentTo(TExpectation expe { Guard.ThrowIfArgumentIsNull(config); - EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); var context = new EquivalencyValidationContext(Node.From(() => CurrentAssertionChain.CallerIdentifier), options) @@ -318,7 +318,7 @@ public AndConstraint BeEquivalentTo(TExpectation expe /// irrespective of the type of those objects. Two properties are also equal if one type can be converted to another and the result is equal. /// The type of a collection property is ignored as long as the collection implements and all /// items in the collection are structurally equal. - /// Notice that actual behavior is determined by the global defaults managed by . + /// Notice that actual behavior is determined by the global defaults managed by . /// /// The unexpected element. /// @@ -349,7 +349,7 @@ public AndConstraint NotBeEquivalentTo( /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the /// class. The global defaults are determined by the - /// class. + /// class. /// /// /// A formatted phrase as is supported by explaining why the assertion diff --git a/Src/FluentAssertions/Primitives/StringAssertions.cs b/Src/FluentAssertions/Primitives/StringAssertions.cs index 7e1fac4730..d114002e9b 100644 --- a/Src/FluentAssertions/Primitives/StringAssertions.cs +++ b/Src/FluentAssertions/Primitives/StringAssertions.cs @@ -150,7 +150,7 @@ public AndConstraint BeEquivalentTo(string expected, { Guard.ThrowIfArgumentIsNull(config); - EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); var expectation = new StringValidator(assertionChain, new StringEqualityStrategy(options.GetStringComparerOrDefault(), "be equivalent to"), @@ -473,7 +473,7 @@ public AndConstraint MatchEquivalentOf(string wildcardPattern, Guard.ThrowIfArgumentIsNull(config); - EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); var stringWildcardMatchingValidator = new StringValidator(assertionChain, new StringWildcardMatchingStrategy @@ -598,7 +598,7 @@ public AndConstraint NotMatchEquivalentOf(string wildcardPattern, Guard.ThrowIfArgumentIsNull(config); - EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); var stringWildcardMatchingValidator = new StringValidator(assertionChain, new StringWildcardMatchingStrategy @@ -987,7 +987,7 @@ public AndConstraint StartWithEquivalentOf(string expected, Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare string start equivalence with ."); Guard.ThrowIfArgumentIsNull(config); - EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); var stringStartValidator = new StringValidator(assertionChain, new StringStartStrategy(options.GetStringComparerOrDefault(), "start with equivalent of"), @@ -1182,7 +1182,7 @@ public AndConstraint EndWithEquivalentOf(string expected, Guard.ThrowIfArgumentIsNull(expected, nameof(expected), "Cannot compare string end equivalence with ."); Guard.ThrowIfArgumentIsNull(config); - EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); var stringEndValidator = new StringValidator(assertionChain, new StringEndStrategy(options.GetStringComparerOrDefault(), "end with equivalent of"), @@ -1419,7 +1419,7 @@ public AndConstraint ContainEquivalentOf(string expected, Guard.ThrowIfArgumentIsNull(occurrenceConstraint); Guard.ThrowIfArgumentIsNull(config); - EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); var stringContainValidator = new StringValidatorSupportingNull(assertionChain, new StringContainsStrategy(options.GetStringComparerOrDefault(), occurrenceConstraint), @@ -2009,7 +2009,7 @@ internal AndConstraint Be(string expected, { Guard.ThrowIfArgumentIsNull(config); - EquivalencyOptions options = config(AssertionOptions.CloneDefaults()); + EquivalencyOptions options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); var expectation = new StringValidator(assertionChain, new StringEqualityStrategy(options.GetStringComparerOrDefault(), "be"), diff --git a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs index ceaa98ec85..a92e40a8ae 100644 --- a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs @@ -246,7 +246,7 @@ private TException SingleSubject { string thrownExceptions = BuildExceptionsString(Subject); - Services.ThrowException( + AssertionEngine.TestFramework.Throw( $"More than one exception was thrown. FluentAssertions cannot determine which Exception was meant.{Environment.NewLine}{thrownExceptions}"); } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 6080e9932d..dab2f677bd 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -24,6 +24,16 @@ namespace FluentAssertions public TSubject Subject { get; } public TSubject Which { get; } } + public static class AssertionConfiguration + { + public static FluentAssertions.Configuration.GlobalConfiguration Current { get; } + } + public static class AssertionEngine + { + public static FluentAssertions.Configuration.GlobalConfiguration Configuration { get; } + public static FluentAssertions.Execution.ITestFramework TestFramework { get; set; } + public static void ResetToDefaults() { } + } public static class AssertionExtensions { public static TTo As(this object subject) { } @@ -159,13 +169,6 @@ namespace FluentAssertions public static FluentAssertions.Collections.GenericDictionaryAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TCollection actualValue) where TCollection : System.Collections.Generic.IEnumerable> { } } - public static class AssertionOptions - { - public static FluentAssertions.EquivalencyPlan EquivalencyPlan { get; } - public static FluentAssertions.Formatting.FormattingOptions FormattingOptions { get; } - public static void AssertEquivalencyUsing(System.Func defaultsConfigurer) { } - public static FluentAssertions.Equivalency.EquivalencyOptions CloneDefaults() { } - } public static class AsyncAssertionsExtensions { public static System.Threading.Tasks.Task, T>> WithResult(this System.Threading.Tasks.Task, T>> task, T expected, string because = "", params object[] becauseArgs) { } @@ -207,23 +210,6 @@ namespace FluentAssertions public static FluentAssertions.Primitives.NullableEnumAssertions Should(this TEnum? @enum) where TEnum : struct, System.Enum { } } - public class EquivalencyPlan : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - public EquivalencyPlan() { } - public void Add() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void AddAfter() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void Clear() { } - public System.Collections.Generic.IEnumerator GetEnumerator() { } - public void Insert() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void InsertBefore() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void Remove() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep { } - public void Reset() { } - } public static class EventRaisingExtensions { public static FluentAssertions.Events.IEventRecording WithArgs(this FluentAssertions.Events.IEventRecording eventRecording, System.Linq.Expressions.Expression> predicate) { } @@ -580,14 +566,6 @@ namespace FluentAssertions.Common InvalidForCSharp = 5, PrivateProtected = 6, } - public class Configuration - { - public Configuration(FluentAssertions.Common.IConfigurationStore store) { } - public string TestFrameworkName { get; set; } - public string ValueFormatterAssembly { get; set; } - public FluentAssertions.Common.ValueFormatterDetectionMode ValueFormatterDetectionMode { get; set; } - public static FluentAssertions.Common.Configuration Current { get; } - } public static class DateTimeExtensions { public static System.DateTimeOffset ToDateTimeOffset(this System.DateTime dateTime) { } @@ -599,26 +577,10 @@ namespace FluentAssertions.Common System.Threading.Tasks.Task DelayAsync(System.TimeSpan delay, System.Threading.CancellationToken cancellationToken); FluentAssertions.Common.ITimer StartTimer(); } - public interface IConfigurationStore - { - string GetSetting(string name); - } - public interface IReflector - { - System.Collections.Generic.IEnumerable GetAllTypesFromAppDomain(System.Func predicate); - } public interface ITimer : System.IDisposable { System.TimeSpan Elapsed { get; } } - public static class Services - { - public static FluentAssertions.Common.Configuration Configuration { get; } - public static FluentAssertions.Common.IConfigurationStore ConfigurationStore { get; set; } - public static FluentAssertions.Common.IReflector Reflector { get; set; } - public static System.Action ThrowException { get; set; } - public static void ResetToDefaults() { } - } public delegate FluentAssertions.Common.ITimer StartTimer(); public enum ValueFormatterDetectionMode { @@ -627,6 +589,37 @@ namespace FluentAssertions.Common Scan = 2, } } +namespace FluentAssertions.Configuration +{ + public class GlobalConfiguration + { + public GlobalConfiguration() { } + public FluentAssertions.Configuration.GlobalEquivalencyOptions Equivalency { get; set; } + public FluentAssertions.Configuration.GlobalFormattingOptions Formatting { get; set; } + public FluentAssertions.Configuration.TestFramework? TestFramework { get; set; } + } + public class GlobalEquivalencyOptions + { + public GlobalEquivalencyOptions() { } + public FluentAssertions.Equivalency.EquivalencyPlan Plan { get; } + public void Modify(System.Func configureOptions) { } + } + public class GlobalFormattingOptions : FluentAssertions.Formatting.FormattingOptions + { + public GlobalFormattingOptions() { } + public string ValueFormatterAssembly { get; set; } + public FluentAssertions.Common.ValueFormatterDetectionMode ValueFormatterDetectionMode { get; set; } + } + public enum TestFramework + { + XUnit2 = 0, + XUnit3 = 1, + TUnit = 2, + MsTest = 3, + NUnit = 4, + MSpec = 5, + } +} namespace FluentAssertions.Equivalency { public class Comparands @@ -686,6 +679,23 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Equivalency.EquivalencyOptions WithStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.EquivalencyOptions WithoutStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } } + public class EquivalencyPlan : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + public EquivalencyPlan() { } + public void Add() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } + public void AddAfter() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } + public void Clear() { } + public System.Collections.Generic.IEnumerator GetEnumerator() { } + public void Insert() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } + public void InsertBefore() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } + public void Remove() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep { } + public void Reset() { } + } public enum EquivalencyResult { ContinueWithNext = 0, @@ -1196,6 +1206,12 @@ namespace FluentAssertions.Execution { object Clone(); } + public interface ITestFramework + { + bool IsAvailable { get; } + [System.Diagnostics.CodeAnalysis.DoesNotReturn] + void Throw(string message); + } public class Reason { public Reason(string formattedMessage, object[] arguments) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index ee28acf4cc..df0ff1d327 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -24,6 +24,16 @@ namespace FluentAssertions public TSubject Subject { get; } public TSubject Which { get; } } + public static class AssertionConfiguration + { + public static FluentAssertions.Configuration.GlobalConfiguration Current { get; } + } + public static class AssertionEngine + { + public static FluentAssertions.Configuration.GlobalConfiguration Configuration { get; } + public static FluentAssertions.Execution.ITestFramework TestFramework { get; set; } + public static void ResetToDefaults() { } + } public static class AssertionExtensions { public static TTo As(this object subject) { } @@ -172,13 +182,6 @@ namespace FluentAssertions public static FluentAssertions.Collections.GenericDictionaryAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TCollection actualValue) where TCollection : System.Collections.Generic.IEnumerable> { } } - public static class AssertionOptions - { - public static FluentAssertions.EquivalencyPlan EquivalencyPlan { get; } - public static FluentAssertions.Formatting.FormattingOptions FormattingOptions { get; } - public static void AssertEquivalencyUsing(System.Func defaultsConfigurer) { } - public static FluentAssertions.Equivalency.EquivalencyOptions CloneDefaults() { } - } public static class AsyncAssertionsExtensions { public static System.Threading.Tasks.Task, T>> WithResult(this System.Threading.Tasks.Task, T>> task, T expected, string because = "", params object[] becauseArgs) { } @@ -220,23 +223,6 @@ namespace FluentAssertions public static FluentAssertions.Primitives.NullableEnumAssertions Should(this TEnum? @enum) where TEnum : struct, System.Enum { } } - public class EquivalencyPlan : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - public EquivalencyPlan() { } - public void Add() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void AddAfter() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void Clear() { } - public System.Collections.Generic.IEnumerator GetEnumerator() { } - public void Insert() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void InsertBefore() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void Remove() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep { } - public void Reset() { } - } public static class EventRaisingExtensions { public static FluentAssertions.Events.IEventRecording WithArgs(this FluentAssertions.Events.IEventRecording eventRecording, System.Linq.Expressions.Expression> predicate) { } @@ -593,14 +579,6 @@ namespace FluentAssertions.Common InvalidForCSharp = 5, PrivateProtected = 6, } - public class Configuration - { - public Configuration(FluentAssertions.Common.IConfigurationStore store) { } - public string TestFrameworkName { get; set; } - public string ValueFormatterAssembly { get; set; } - public FluentAssertions.Common.ValueFormatterDetectionMode ValueFormatterDetectionMode { get; set; } - public static FluentAssertions.Common.Configuration Current { get; } - } public static class DateTimeExtensions { public static System.DateTimeOffset ToDateTimeOffset(this System.DateTime dateTime) { } @@ -612,26 +590,10 @@ namespace FluentAssertions.Common System.Threading.Tasks.Task DelayAsync(System.TimeSpan delay, System.Threading.CancellationToken cancellationToken); FluentAssertions.Common.ITimer StartTimer(); } - public interface IConfigurationStore - { - string GetSetting(string name); - } - public interface IReflector - { - System.Collections.Generic.IEnumerable GetAllTypesFromAppDomain(System.Func predicate); - } public interface ITimer : System.IDisposable { System.TimeSpan Elapsed { get; } } - public static class Services - { - public static FluentAssertions.Common.Configuration Configuration { get; } - public static FluentAssertions.Common.IConfigurationStore ConfigurationStore { get; set; } - public static FluentAssertions.Common.IReflector Reflector { get; set; } - public static System.Action ThrowException { get; set; } - public static void ResetToDefaults() { } - } public delegate FluentAssertions.Common.ITimer StartTimer(); public enum ValueFormatterDetectionMode { @@ -640,6 +602,37 @@ namespace FluentAssertions.Common Scan = 2, } } +namespace FluentAssertions.Configuration +{ + public class GlobalConfiguration + { + public GlobalConfiguration() { } + public FluentAssertions.Configuration.GlobalEquivalencyOptions Equivalency { get; set; } + public FluentAssertions.Configuration.GlobalFormattingOptions Formatting { get; set; } + public FluentAssertions.Configuration.TestFramework? TestFramework { get; set; } + } + public class GlobalEquivalencyOptions + { + public GlobalEquivalencyOptions() { } + public FluentAssertions.Equivalency.EquivalencyPlan Plan { get; } + public void Modify(System.Func configureOptions) { } + } + public class GlobalFormattingOptions : FluentAssertions.Formatting.FormattingOptions + { + public GlobalFormattingOptions() { } + public string ValueFormatterAssembly { get; set; } + public FluentAssertions.Common.ValueFormatterDetectionMode ValueFormatterDetectionMode { get; set; } + } + public enum TestFramework + { + XUnit2 = 0, + XUnit3 = 1, + TUnit = 2, + MsTest = 3, + NUnit = 4, + MSpec = 5, + } +} namespace FluentAssertions.Equivalency { public class Comparands @@ -699,6 +692,23 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Equivalency.EquivalencyOptions WithStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.EquivalencyOptions WithoutStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } } + public class EquivalencyPlan : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + public EquivalencyPlan() { } + public void Add() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } + public void AddAfter() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } + public void Clear() { } + public System.Collections.Generic.IEnumerator GetEnumerator() { } + public void Insert() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } + public void InsertBefore() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } + public void Remove() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep { } + public void Reset() { } + } public enum EquivalencyResult { ContinueWithNext = 0, @@ -1209,6 +1219,12 @@ namespace FluentAssertions.Execution { object Clone(); } + public interface ITestFramework + { + bool IsAvailable { get; } + [System.Diagnostics.CodeAnalysis.DoesNotReturn] + void Throw(string message); + } public class Reason { public Reason(string formattedMessage, object[] arguments) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 87549bd529..1935d91863 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -24,6 +24,16 @@ namespace FluentAssertions public TSubject Subject { get; } public TSubject Which { get; } } + public static class AssertionConfiguration + { + public static FluentAssertions.Configuration.GlobalConfiguration Current { get; } + } + public static class AssertionEngine + { + public static FluentAssertions.Configuration.GlobalConfiguration Configuration { get; } + public static FluentAssertions.Execution.ITestFramework TestFramework { get; set; } + public static void ResetToDefaults() { } + } public static class AssertionExtensions { public static TTo As(this object subject) { } @@ -157,13 +167,6 @@ namespace FluentAssertions public static FluentAssertions.Collections.GenericDictionaryAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TCollection actualValue) where TCollection : System.Collections.Generic.IEnumerable> { } } - public static class AssertionOptions - { - public static FluentAssertions.EquivalencyPlan EquivalencyPlan { get; } - public static FluentAssertions.Formatting.FormattingOptions FormattingOptions { get; } - public static void AssertEquivalencyUsing(System.Func defaultsConfigurer) { } - public static FluentAssertions.Equivalency.EquivalencyOptions CloneDefaults() { } - } public static class AsyncAssertionsExtensions { public static System.Threading.Tasks.Task, T>> WithResult(this System.Threading.Tasks.Task, T>> task, T expected, string because = "", params object[] becauseArgs) { } @@ -205,23 +208,6 @@ namespace FluentAssertions public static FluentAssertions.Primitives.NullableEnumAssertions Should(this TEnum? @enum) where TEnum : struct, System.Enum { } } - public class EquivalencyPlan : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - public EquivalencyPlan() { } - public void Add() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void AddAfter() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void Clear() { } - public System.Collections.Generic.IEnumerator GetEnumerator() { } - public void Insert() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void InsertBefore() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void Remove() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep { } - public void Reset() { } - } public static class Exactly { public static FluentAssertions.OccurrenceConstraint Once() { } @@ -572,14 +558,6 @@ namespace FluentAssertions.Common InvalidForCSharp = 5, PrivateProtected = 6, } - public class Configuration - { - public Configuration(FluentAssertions.Common.IConfigurationStore store) { } - public string TestFrameworkName { get; set; } - public string ValueFormatterAssembly { get; set; } - public FluentAssertions.Common.ValueFormatterDetectionMode ValueFormatterDetectionMode { get; set; } - public static FluentAssertions.Common.Configuration Current { get; } - } public static class DateTimeExtensions { public static System.DateTimeOffset ToDateTimeOffset(this System.DateTime dateTime) { } @@ -591,26 +569,10 @@ namespace FluentAssertions.Common System.Threading.Tasks.Task DelayAsync(System.TimeSpan delay, System.Threading.CancellationToken cancellationToken); FluentAssertions.Common.ITimer StartTimer(); } - public interface IConfigurationStore - { - string GetSetting(string name); - } - public interface IReflector - { - System.Collections.Generic.IEnumerable GetAllTypesFromAppDomain(System.Func predicate); - } public interface ITimer : System.IDisposable { System.TimeSpan Elapsed { get; } } - public static class Services - { - public static FluentAssertions.Common.Configuration Configuration { get; } - public static FluentAssertions.Common.IConfigurationStore ConfigurationStore { get; set; } - public static FluentAssertions.Common.IReflector Reflector { get; set; } - public static System.Action ThrowException { get; set; } - public static void ResetToDefaults() { } - } public delegate FluentAssertions.Common.ITimer StartTimer(); public enum ValueFormatterDetectionMode { @@ -619,6 +581,37 @@ namespace FluentAssertions.Common Scan = 2, } } +namespace FluentAssertions.Configuration +{ + public class GlobalConfiguration + { + public GlobalConfiguration() { } + public FluentAssertions.Configuration.GlobalEquivalencyOptions Equivalency { get; set; } + public FluentAssertions.Configuration.GlobalFormattingOptions Formatting { get; set; } + public FluentAssertions.Configuration.TestFramework? TestFramework { get; set; } + } + public class GlobalEquivalencyOptions + { + public GlobalEquivalencyOptions() { } + public FluentAssertions.Equivalency.EquivalencyPlan Plan { get; } + public void Modify(System.Func configureOptions) { } + } + public class GlobalFormattingOptions : FluentAssertions.Formatting.FormattingOptions + { + public GlobalFormattingOptions() { } + public string ValueFormatterAssembly { get; set; } + public FluentAssertions.Common.ValueFormatterDetectionMode ValueFormatterDetectionMode { get; set; } + } + public enum TestFramework + { + XUnit2 = 0, + XUnit3 = 1, + TUnit = 2, + MsTest = 3, + NUnit = 4, + MSpec = 5, + } +} namespace FluentAssertions.Equivalency { public class Comparands @@ -678,6 +671,23 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Equivalency.EquivalencyOptions WithStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.EquivalencyOptions WithoutStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } } + public class EquivalencyPlan : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + public EquivalencyPlan() { } + public void Add() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } + public void AddAfter() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } + public void Clear() { } + public System.Collections.Generic.IEnumerator GetEnumerator() { } + public void Insert() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } + public void InsertBefore() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } + public void Remove() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep { } + public void Reset() { } + } public enum EquivalencyResult { ContinueWithNext = 0, @@ -1140,6 +1150,12 @@ namespace FluentAssertions.Execution { object Clone(); } + public interface ITestFramework + { + bool IsAvailable { get; } + [System.Diagnostics.CodeAnalysis.DoesNotReturn] + void Throw(string message); + } public class Reason { public Reason(string formattedMessage, object[] arguments) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 8e5e2ee43e..62c3a6c5bf 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -24,6 +24,16 @@ namespace FluentAssertions public TSubject Subject { get; } public TSubject Which { get; } } + public static class AssertionConfiguration + { + public static FluentAssertions.Configuration.GlobalConfiguration Current { get; } + } + public static class AssertionEngine + { + public static FluentAssertions.Configuration.GlobalConfiguration Configuration { get; } + public static FluentAssertions.Execution.ITestFramework TestFramework { get; set; } + public static void ResetToDefaults() { } + } public static class AssertionExtensions { public static TTo As(this object subject) { } @@ -159,13 +169,6 @@ namespace FluentAssertions public static FluentAssertions.Collections.GenericDictionaryAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TCollection actualValue) where TCollection : System.Collections.Generic.IEnumerable> { } } - public static class AssertionOptions - { - public static FluentAssertions.EquivalencyPlan EquivalencyPlan { get; } - public static FluentAssertions.Formatting.FormattingOptions FormattingOptions { get; } - public static void AssertEquivalencyUsing(System.Func defaultsConfigurer) { } - public static FluentAssertions.Equivalency.EquivalencyOptions CloneDefaults() { } - } public static class AsyncAssertionsExtensions { public static System.Threading.Tasks.Task, T>> WithResult(this System.Threading.Tasks.Task, T>> task, T expected, string because = "", params object[] becauseArgs) { } @@ -207,23 +210,6 @@ namespace FluentAssertions public static FluentAssertions.Primitives.NullableEnumAssertions Should(this TEnum? @enum) where TEnum : struct, System.Enum { } } - public class EquivalencyPlan : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - public EquivalencyPlan() { } - public void Add() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void AddAfter() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void Clear() { } - public System.Collections.Generic.IEnumerator GetEnumerator() { } - public void Insert() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void InsertBefore() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } - public void Remove() - where TStep : FluentAssertions.Equivalency.IEquivalencyStep { } - public void Reset() { } - } public static class EventRaisingExtensions { public static FluentAssertions.Events.IEventRecording WithArgs(this FluentAssertions.Events.IEventRecording eventRecording, System.Linq.Expressions.Expression> predicate) { } @@ -580,14 +566,6 @@ namespace FluentAssertions.Common InvalidForCSharp = 5, PrivateProtected = 6, } - public class Configuration - { - public Configuration(FluentAssertions.Common.IConfigurationStore store) { } - public string TestFrameworkName { get; set; } - public string ValueFormatterAssembly { get; set; } - public FluentAssertions.Common.ValueFormatterDetectionMode ValueFormatterDetectionMode { get; set; } - public static FluentAssertions.Common.Configuration Current { get; } - } public static class DateTimeExtensions { public static System.DateTimeOffset ToDateTimeOffset(this System.DateTime dateTime) { } @@ -599,26 +577,10 @@ namespace FluentAssertions.Common System.Threading.Tasks.Task DelayAsync(System.TimeSpan delay, System.Threading.CancellationToken cancellationToken); FluentAssertions.Common.ITimer StartTimer(); } - public interface IConfigurationStore - { - string GetSetting(string name); - } - public interface IReflector - { - System.Collections.Generic.IEnumerable GetAllTypesFromAppDomain(System.Func predicate); - } public interface ITimer : System.IDisposable { System.TimeSpan Elapsed { get; } } - public static class Services - { - public static FluentAssertions.Common.Configuration Configuration { get; } - public static FluentAssertions.Common.IConfigurationStore ConfigurationStore { get; set; } - public static FluentAssertions.Common.IReflector Reflector { get; set; } - public static System.Action ThrowException { get; set; } - public static void ResetToDefaults() { } - } public delegate FluentAssertions.Common.ITimer StartTimer(); public enum ValueFormatterDetectionMode { @@ -627,6 +589,37 @@ namespace FluentAssertions.Common Scan = 2, } } +namespace FluentAssertions.Configuration +{ + public class GlobalConfiguration + { + public GlobalConfiguration() { } + public FluentAssertions.Configuration.GlobalEquivalencyOptions Equivalency { get; set; } + public FluentAssertions.Configuration.GlobalFormattingOptions Formatting { get; set; } + public FluentAssertions.Configuration.TestFramework? TestFramework { get; set; } + } + public class GlobalEquivalencyOptions + { + public GlobalEquivalencyOptions() { } + public FluentAssertions.Equivalency.EquivalencyPlan Plan { get; } + public void Modify(System.Func configureOptions) { } + } + public class GlobalFormattingOptions : FluentAssertions.Formatting.FormattingOptions + { + public GlobalFormattingOptions() { } + public string ValueFormatterAssembly { get; set; } + public FluentAssertions.Common.ValueFormatterDetectionMode ValueFormatterDetectionMode { get; set; } + } + public enum TestFramework + { + XUnit2 = 0, + XUnit3 = 1, + TUnit = 2, + MsTest = 3, + NUnit = 4, + MSpec = 5, + } +} namespace FluentAssertions.Equivalency { public class Comparands @@ -686,6 +679,23 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Equivalency.EquivalencyOptions WithStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.EquivalencyOptions WithoutStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } } + public class EquivalencyPlan : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + public EquivalencyPlan() { } + public void Add() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } + public void AddAfter() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } + public void Clear() { } + public System.Collections.Generic.IEnumerator GetEnumerator() { } + public void Insert() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } + public void InsertBefore() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep, new () { } + public void Remove() + where TStep : FluentAssertions.Equivalency.IEquivalencyStep { } + public void Reset() { } + } public enum EquivalencyResult { ContinueWithNext = 0, @@ -1196,6 +1206,12 @@ namespace FluentAssertions.Execution { object Clone(); } + public interface ITestFramework + { + bool IsAvailable { get; } + [System.Diagnostics.CodeAnalysis.DoesNotReturn] + void Throw(string message); + } public class Reason { public Reason(string formattedMessage, object[] arguments) { } diff --git a/Tests/FluentAssertions.Specs/Common/ConfigurationSpecs.cs b/Tests/FluentAssertions.Specs/Common/ConfigurationSpecs.cs deleted file mode 100644 index 43ed874d6d..0000000000 --- a/Tests/FluentAssertions.Specs/Common/ConfigurationSpecs.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using System.Collections.Generic; -using FluentAssertions.Common; -using Xunit; - -namespace FluentAssertions.Specs.Common; - -public class ConfigurationSpecs -{ - [Fact] - public void Value_formatter_detection_mode_is_disabled_with_empty_store() - { - // Arrange - var store = new DummyConfigurationStore([]); - var sut = new Configuration(store); - - // Act / Assert - sut.ValueFormatterDetectionMode.Should().Be(ValueFormatterDetectionMode.Disabled); - } - - [Fact] - public void Value_formatter_detection_mode_is_specific_with_given_value_formatters_assembly() - { - // Arrange - var store = new DummyConfigurationStore(new Dictionary - { - { "valueFormattersAssembly", "foo" } - }); - - var sut = new Configuration(store); - - // Act / Assert - sut.ValueFormatterDetectionMode.Should().Be(ValueFormatterDetectionMode.Specific); - } - - [Fact] - public void Value_formatter_detection_mode_can_be_specified_in_configuration_store() - { - // Arrange - var store = new DummyConfigurationStore(new Dictionary - { - { "valueFormatters", nameof(ValueFormatterDetectionMode.Scan) } - }); - - var sut = new Configuration(store); - - // Act / Assert - sut.ValueFormatterDetectionMode.Should().Be(ValueFormatterDetectionMode.Scan); - } - - [Fact] - public void Value_formatter_detection_mode_throws_when_configured_incorrectly() - { - // Arrange - var store = new DummyConfigurationStore(new Dictionary - { - { "valueFormatters", "foo" } - }); - - var sut = new Configuration(store); - - // Act - var act = () => sut.ValueFormatterDetectionMode; - - // Assert - act.Should().Throw(); - } - - private class DummyConfigurationStore : IConfigurationStore - { - private readonly Dictionary settings; - - public DummyConfigurationStore(Dictionary settings) - { - this.settings = settings; - } - - public string GetSetting(string name) - => settings.TryGetValue(name, out var value) ? value : null; - } -} diff --git a/Tests/FluentAssertions.Specs/Configuration/ConfigurationSpecsDefinition.cs b/Tests/FluentAssertions.Specs/Configuration/ConfigurationSpecsDefinition.cs new file mode 100644 index 0000000000..b972dbb6fe --- /dev/null +++ b/Tests/FluentAssertions.Specs/Configuration/ConfigurationSpecsDefinition.cs @@ -0,0 +1,7 @@ +using Xunit; + +namespace FluentAssertions.Specs.Configuration; + +// Due to tests that call the static AssertionConfiguration or AssertionEngine, we need to disable parallelization +[CollectionDefinition("ConfigurationSpecs", DisableParallelization = true)] +public class ConfigurationSpecsDefinition; diff --git a/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs b/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs similarity index 78% rename from Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs rename to Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs index a931266d0b..d114aeadf6 100644 --- a/Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs @@ -6,45 +6,43 @@ using FluentAssertions.Equivalency; using FluentAssertions.Equivalency.Steps; using FluentAssertions.Execution; -using FluentAssertions.Formatting; +using JetBrains.Annotations; using Xunit; using Xunit.Sdk; -namespace FluentAssertions.Specs; +namespace FluentAssertions.Specs.Configuration; -public class AssertionOptionsSpecs +public class EquivalencyOptionsSpecs { - // Due to tests that call AssertionOptions - [CollectionDefinition("AssertionOptionsSpecs", DisableParallelization = true)] - public class AssertionOptionsSpecsDefinition; - + [Collection("ConfigurationSpecs")] public abstract class Given_temporary_global_assertion_options : GivenWhenThen { protected override void Dispose(bool disposing) { - AssertionOptions.AssertEquivalencyUsing(_ => new EquivalencyOptions()); + AssertionConfiguration.Current.Equivalency.Modify(_ => new EquivalencyOptions()); base.Dispose(disposing); } } - [Collection("AssertionOptionsSpecs")] + [Collection("ConfigurationSpecs")] public class When_injecting_a_null_configurer : GivenSubject { public When_injecting_a_null_configurer() { - When(() => () => AssertionOptions.AssertEquivalencyUsing(defaultsConfigurer: null)); + When(() => () => AssertionConfiguration.Current.Equivalency.Modify(configureOptions: null)); } [Fact] public void It_should_throw() { Result.Should().ThrowExactly() - .WithParameterName("defaultsConfigurer"); + .WithParameterName("configureOptions"); } } - [Collection("AssertionOptionsSpecs")] + [Collection("ConfigurationSpecs")] + public class When_concurrently_getting_equality_strategy : GivenSubject { public When_concurrently_getting_equality_strategy() @@ -68,7 +66,6 @@ public void It_should_not_throw() } } - [Collection("AssertionOptionsSpecs")] public class When_modifying_global_reference_type_settings_a_previous_assertion_should_not_have_any_effect : Given_temporary_global_assertion_options { @@ -80,7 +77,7 @@ public When_modifying_global_reference_type_settings_a_previous_assertion_should new MyValueType { Value = 1 }.Should().BeEquivalentTo(new MyValueType { Value = 2 }); }); - When(() => AssertionOptions.AssertEquivalencyUsing(o => o.ComparingByMembers())); + When(() => AssertionConfiguration.Current.Equivalency.Modify(o => o.ComparingByMembers())); } [Fact] @@ -101,7 +98,6 @@ internal class MyValueType } } - [Collection("AssertionOptionsSpecs")] public class When_modifying_global_value_type_settings_a_previous_assertion_should_not_have_any_effect : Given_temporary_global_assertion_options { @@ -113,7 +109,7 @@ public When_modifying_global_value_type_settings_a_previous_assertion_should_not new MyClass { Value = 1 }.Should().BeEquivalentTo(new MyClass { Value = 1 }); }); - When(() => AssertionOptions.AssertEquivalencyUsing(o => o.ComparingByValue())); + When(() => AssertionConfiguration.Current.Equivalency.Modify(o => o.ComparingByValue())); } [Fact] @@ -138,7 +134,7 @@ public When_modifying_record_settings_globally() { When(() => { - AssertionOptions.AssertEquivalencyUsing( + AssertionConfiguration.Current.Equivalency.Modify( options => options.ComparingByValue(typeof(Position))); }); } @@ -151,6 +147,7 @@ public void It_should_use_the_global_settings_for_comparing_records() private record Position { + [UsedImplicitly] private readonly int value; public Position(int value) @@ -160,14 +157,13 @@ public Position(int value) } } - [Collection("AssertionOptionsSpecs")] public class When_assertion_doubles_should_always_allow_small_deviations : Given_temporary_global_assertion_options { public When_assertion_doubles_should_always_allow_small_deviations() { When(() => { - AssertionOptions.AssertEquivalencyUsing(options => options + AssertionConfiguration.Current.Equivalency.Modify(options => options .Using(ctx => ctx.Subject.Should().BeApproximately(ctx.Expectation, 0.01)) .WhenTypeIs()); }); @@ -192,14 +188,13 @@ public void Then_it_should_ignore_small_differences_without_the_need_of_local_op } } - [Collection("AssertionOptionsSpecs")] public class When_local_similar_options_are_used : Given_temporary_global_assertion_options { public When_local_similar_options_are_used() { When(() => { - AssertionOptions.AssertEquivalencyUsing(options => options + AssertionConfiguration.Current.Equivalency.Modify(options => options .Using(ctx => ctx.Subject.Should().BeApproximately(ctx.Expectation, 0.01)) .WhenTypeIs()); }); @@ -244,7 +239,7 @@ public void Then_they_should_not_affect_any_other_assertions() } } - [Collection("AssertionOptionsSpecs")] + [Collection("ConfigurationSpecs")] public class Given_self_resetting_equivalency_plan : GivenWhenThen { protected override void Dispose(bool disposing) @@ -255,11 +250,10 @@ protected override void Dispose(bool disposing) protected static EquivalencyPlan Plan { - get { return AssertionOptions.EquivalencyPlan; } + get { return AssertionConfiguration.Current.Equivalency.Plan; } } } - [Collection("AssertionOptionsSpecs")] public class When_inserting_a_step : Given_self_resetting_equivalency_plan { public When_inserting_a_step() @@ -276,7 +270,6 @@ public void Then_it_should_precede_all_other_steps() } } - [Collection("AssertionOptionsSpecs")] public class When_inserting_a_step_before_another : Given_self_resetting_equivalency_plan { public When_inserting_a_step_before_another() @@ -294,7 +287,6 @@ public void Then_it_should_precede_that_particular_step() } } - [Collection("AssertionOptionsSpecs")] public class When_appending_a_step : Given_self_resetting_equivalency_plan { public When_appending_a_step() @@ -312,7 +304,6 @@ public void Then_it_should_precede_the_final_builtin_step() } } - [Collection("AssertionOptionsSpecs")] public class When_appending_a_step_after_another : Given_self_resetting_equivalency_plan { public When_appending_a_step_after_another() @@ -330,7 +321,6 @@ public void Then_it_should_precede_the_final_builtin_step() } } - [Collection("AssertionOptionsSpecs")] public class When_appending_a_step_and_no_builtin_steps_are_there : Given_self_resetting_equivalency_plan { public When_appending_a_step_and_no_builtin_steps_are_there() @@ -351,7 +341,6 @@ public void Then_it_should_precede_the_simple_equality_step() } } - [Collection("AssertionOptionsSpecs")] public class When_removing_a_specific_step : Given_self_resetting_equivalency_plan { public When_removing_a_specific_step() @@ -366,7 +355,6 @@ public void Then_it_should_precede_the_simple_equality_step() } } - [Collection("AssertionOptionsSpecs")] public class When_removing_a_specific_step_that_doesnt_exist : Given_self_resetting_equivalency_plan { public When_removing_a_specific_step_that_doesnt_exist() @@ -381,42 +369,7 @@ public void Then_it_should_precede_the_simple_equality_step() } } - [Collection("AssertionOptionsSpecs")] - public class When_global_formatting_settings_are_modified : GivenWhenThen - { - private FormattingOptions oldSettings; - - public When_global_formatting_settings_are_modified() - { - Given(() => oldSettings = AssertionOptions.FormattingOptions.Clone()); - - When(() => - { - AssertionOptions.FormattingOptions.UseLineBreaks = true; - AssertionOptions.FormattingOptions.MaxDepth = 123; - AssertionOptions.FormattingOptions.MaxLines = 33; - }); - } - - [Fact] - public void Then_the_current_assertion_scope_should_use_these_settings() - { - AssertionScope.Current.FormattingOptions.UseLineBreaks.Should().BeTrue(); - AssertionScope.Current.FormattingOptions.MaxDepth.Should().Be(123); - AssertionScope.Current.FormattingOptions.MaxLines.Should().Be(33); - } - - protected override void Dispose(bool disposing) - { - AssertionOptions.FormattingOptions.MaxDepth = oldSettings.MaxDepth; - AssertionOptions.FormattingOptions.UseLineBreaks = oldSettings.UseLineBreaks; - AssertionOptions.FormattingOptions.MaxLines = oldSettings.MaxLines; - - base.Dispose(disposing); - } - } - - internal class MyEquivalencyStep : IEquivalencyStep + private class MyEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, IValidateChildNodeEquivalency valueChildNodes) diff --git a/Tests/FluentAssertions.Specs/Configuration/FormattingOptionsSpecs.cs b/Tests/FluentAssertions.Specs/Configuration/FormattingOptionsSpecs.cs new file mode 100644 index 0000000000..201a2c1055 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Configuration/FormattingOptionsSpecs.cs @@ -0,0 +1,216 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using FluentAssertions.Common; +using FluentAssertions.Execution; +using FluentAssertions.Formatting; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Configuration; + +[Collection("ConfigurationSpecs")] +public sealed class FormattingOptionsSpecs : IDisposable +{ + [Fact] + public void When_global_formatting_settings_are_modified() + { + AssertionConfiguration.Current.Formatting.UseLineBreaks = true; + AssertionConfiguration.Current.Formatting.MaxDepth = 123; + AssertionConfiguration.Current.Formatting.MaxLines = 33; + + AssertionScope.Current.FormattingOptions.UseLineBreaks.Should().BeTrue(); + AssertionScope.Current.FormattingOptions.MaxDepth.Should().Be(123); + AssertionScope.Current.FormattingOptions.MaxLines.Should().Be(33); + } + + [Fact] + public void When_a_custom_formatter_exists_in_any_loaded_assembly_it_should_override_the_default_formatters() + { + // Arrange + AssertionConfiguration.Current.Formatting.ValueFormatterDetectionMode = ValueFormatterDetectionMode.Scan; + + var subject = new SomeClassWithCustomFormatter + { + Property = "SomeValue" + }; + + // Act + string result = Formatter.ToString(subject); + + // Assert + result.Should().Be("Property = SomeValue", "it should use my custom formatter"); + } + + [Fact] + public void When_a_base_class_has_a_custom_formatter_it_should_override_the_default_formatters() + { + // Arrange + AssertionConfiguration.Current.Formatting.ValueFormatterDetectionMode = ValueFormatterDetectionMode.Scan; + + var subject = new SomeClassInheritedFromClassWithCustomFormatterLvl1 + { + Property = "SomeValue" + }; + + // Act + string result = Formatter.ToString(subject); + + // Assert + result.Should().Be("Property = SomeValue", "it should use my custom formatter"); + } + + [Fact] + public void When_there_are_multiple_custom_formatters_it_should_select_a_more_specific_one() + { + // Arrange + AssertionConfiguration.Current.Formatting.ValueFormatterDetectionMode = ValueFormatterDetectionMode.Scan; + + var subject = new SomeClassInheritedFromClassWithCustomFormatterLvl2 + { + Property = "SomeValue" + }; + + // Act + string result = Formatter.ToString(subject); + + // Assert + result.Should().Be("Property is SomeValue", "it should use my custom formatter"); + } + + [Fact] + public void When_a_base_class_has_multiple_custom_formatters_it_should_work_the_same_as_for_the_base_class() + { + // Arrange + AssertionConfiguration.Current.Formatting.ValueFormatterDetectionMode = ValueFormatterDetectionMode.Scan; + + var subject = new SomeClassInheritedFromClassWithCustomFormatterLvl3 + { + Property = "SomeValue" + }; + + // Act + string result = Formatter.ToString(subject); + + // Assert + result.Should().Be("Property is SomeValue", "it should use my custom formatter"); + } + + [Fact] + public void When_no_custom_formatter_exists_in_the_specified_assembly_it_should_use_the_default() + { + // Arrange + AssertionConfiguration.Current.Formatting.ValueFormatterAssembly = "FluentAssertions"; + + var subject = new SomeClassWithCustomFormatter + { + Property = "SomeValue" + }; + + // Act + string result = Formatter.ToString(subject); + + // Assert + result.Should().Be(subject.ToString()); + } + + [Fact] + public void When_formatter_scanning_is_disabled_it_should_use_the_default_formatters() + { + // Arrange + AssertionConfiguration.Current.Formatting.ValueFormatterDetectionMode = ValueFormatterDetectionMode.Disabled; + + var subject = new SomeClassWithCustomFormatter + { + Property = "SomeValue" + }; + + // Act + string result = Formatter.ToString(subject); + + // Assert + result.Should().Be(subject.ToString()); + } + + [Fact] + public void When_no_formatter_scanning_is_configured_it_should_use_the_default_formatters() + { + // Arrange + AssertionConfiguration.Current.Formatting.ValueFormatterDetectionMode = ValueFormatterDetectionMode.Disabled; + + var subject = new SomeClassWithCustomFormatter + { + Property = "SomeValue" + }; + + // Act + string result = Formatter.ToString(subject); + + // Assert + result.Should().Be(subject.ToString()); + } + + public class SomeClassWithCustomFormatter + { + public string Property { get; set; } + + public override string ToString() + { + return "The value of my property is " + Property; + } + } + + public class SomeOtherClassWithCustomFormatter + { + public string Property { get; set; } + + public override string ToString() + { + return "The value of my property is " + Property; + } + } + + public class SomeClassInheritedFromClassWithCustomFormatterLvl1 : SomeClassWithCustomFormatter; + + public class SomeClassInheritedFromClassWithCustomFormatterLvl2 : SomeClassInheritedFromClassWithCustomFormatterLvl1; + + public class SomeClassInheritedFromClassWithCustomFormatterLvl3 : SomeClassInheritedFromClassWithCustomFormatterLvl2; + + public static class CustomFormatter + { + [ValueFormatter] + public static int Bar(SomeClassWithCustomFormatter _) + { + return -1; + } + + [ValueFormatter] + public static void Foo(SomeClassWithCustomFormatter value, FormattedObjectGraph output) + { + output.AddFragment("Property = " + value.Property); + } + + [ValueFormatter] + [SuppressMessage("ReSharper", "CA1801")] + public static void Foo(SomeOtherClassWithCustomFormatter _, FormattedObjectGraph output) + { + throw new XunitException("Should never be called"); + } + + [ValueFormatter] + public static void Foo(SomeClassInheritedFromClassWithCustomFormatterLvl2 value, FormattedObjectGraph output) + { + output.AddFragment("Property is " + value.Property); + } + + [ValueFormatter] + public static void Foo2(SomeClassInheritedFromClassWithCustomFormatterLvl2 value, FormattedObjectGraph output) + { + output.AddFragment("Property is " + value.Property); + } + } + + public void Dispose() + { + AssertionEngine.ResetToDefaults(); + } +} diff --git a/Tests/FluentAssertions.Specs/Configuration/GlobalConfigurationSpecs.cs b/Tests/FluentAssertions.Specs/Configuration/GlobalConfigurationSpecs.cs new file mode 100644 index 0000000000..68325f808f --- /dev/null +++ b/Tests/FluentAssertions.Specs/Configuration/GlobalConfigurationSpecs.cs @@ -0,0 +1,54 @@ +using System; +using System.Threading.Tasks; +using FluentAssertions.Execution; +using Xunit; + +namespace FluentAssertions.Specs.Configuration; + +[Collection("ConfigurationSpecs")] +public sealed class GlobalConfigurationSpecs : IDisposable +{ + [Fact] + public void Concurrently_accessing_the_configuration_is_safe() + { + // Act + Action act = () => Parallel.For( + 0, + 10000, + new ParallelOptions + { + MaxDegreeOfParallelism = 8 + }, + __ => + { + AssertionConfiguration.Current.Formatting.ValueFormatterAssembly = string.Empty; + _ = AssertionConfiguration.Current.Formatting.ValueFormatterDetectionMode; + } + ); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void Can_override_the_runtime_test_framework() + { + // Arrange + AssertionEngine.TestFramework = new NotImplementedTestFramework(); + + // Act + var act = () => 1.Should().Be(2); + + // Assert + act.Should().Throw(); + } + + private class NotImplementedTestFramework : ITestFramework + { + public bool IsAvailable => true; + + public void Throw(string message) => throw new NotImplementedException(); + } + + public void Dispose() => AssertionEngine.ResetToDefaults(); +} diff --git a/Tests/FluentAssertions.Specs/Configuration/TestFrameworkFactorySpecs.cs b/Tests/FluentAssertions.Specs/Configuration/TestFrameworkFactorySpecs.cs new file mode 100644 index 0000000000..ed4c33af86 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Configuration/TestFrameworkFactorySpecs.cs @@ -0,0 +1,57 @@ +using System; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; +using TestFramework = FluentAssertions.Configuration.TestFramework; + +namespace FluentAssertions.Specs.Configuration; + +public class TestFrameworkFactorySpecs +{ + [Fact] + public void When_running_xunit_test_implicitly_it_should_be_detected() + { + // Arrange + var testFramework = TestFrameworkFactory.GetFramework(null); + + // Act + Action act = () => testFramework.Throw("MyMessage"); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_running_xunit_test_explicitly_it_should_be_detected() + { + // Arrange + var testFramework = TestFrameworkFactory.GetFramework(TestFramework.XUnit2); + + // Act + Action act = () => testFramework.Throw("MyMessage"); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void When_running_test_with_unknown_test_framework_it_should_throw() + { + // Act + Action act = () => TestFrameworkFactory.GetFramework((TestFramework)42); + + // Assert + act.Should().Throw() + .WithMessage("*the test framework '42' but this is not supported*"); + } + + [Fact] + public void When_running_test_with_late_bound_but_unavailable_test_framework_it_should_throw() + { + // Act + Action act = () => TestFrameworkFactory.GetFramework(TestFramework.NUnit); + + act.Should().Throw() + .WithMessage("*test framework 'nunit' but the required assembly 'nunit.framework' could not be found*"); + } +} diff --git a/Tests/FluentAssertions.Specs/ConfigurationSpecs.cs b/Tests/FluentAssertions.Specs/ConfigurationSpecs.cs deleted file mode 100644 index 36cbc680ef..0000000000 --- a/Tests/FluentAssertions.Specs/ConfigurationSpecs.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Threading.Tasks; -using FluentAssertions.Common; -using Xunit; - -namespace FluentAssertions.Specs; - -[Collection("ConfigurationSpecs")] -public class ConfigurationSpecs -{ - [Fact] - public void When_concurrently_accessing_current_Configuration_no_exception_should_be_thrown() - { - // Act - Action act = () => Parallel.For( - 0, - 10000, - new ParallelOptions - { - MaxDegreeOfParallelism = 8 - }, - __ => - { - Configuration.Current.ValueFormatterAssembly = string.Empty; - _ = Configuration.Current.ValueFormatterDetectionMode; - } - ); - - // Assert - act.Should().NotThrow(); - } -} - -// Due to tests that call Configuration.Current -[CollectionDefinition("ConfigurationSpecs", DisableParallelization = true)] -public class ConfigurationSpecsDefinition; diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs index 32d48f1360..a3279cd60a 100644 --- a/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs @@ -6,7 +6,6 @@ using System.Threading; using System.Threading.Tasks; using FluentAssertions; -using FluentAssertions.Common; using FluentAssertions.Execution; using Xunit; using Xunit.Sdk; @@ -340,7 +339,7 @@ public void ThrowIfAny(IDictionary context) } } - Services.ThrowException(builder.ToString()); + AssertionEngine.TestFramework.Throw(builder.ToString()); } } @@ -355,7 +354,7 @@ internal class FailWithStupidMessageAssertionStrategy : IAssertionStrategy public IEnumerable FailureMessages => []; public void HandleFailure(string message) => - Services.ThrowException("Good luck with understanding what's going on!"); + AssertionEngine.TestFramework.Throw("Good luck with understanding what's going on!"); public IEnumerable DiscardFailures() => []; diff --git a/Tests/FluentAssertions.Specs/Execution/TestFrameworkProviderTests.cs b/Tests/FluentAssertions.Specs/Execution/TestFrameworkProviderTests.cs deleted file mode 100644 index bf934d4c12..0000000000 --- a/Tests/FluentAssertions.Specs/Execution/TestFrameworkProviderTests.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using FluentAssertions.Common; -using FluentAssertions.Execution; -using Xunit; -using Xunit.Sdk; - -namespace FluentAssertions.Specs.Execution; - -public class TestFrameworkProviderTests -{ - [Fact] - public void When_running_xunit_test_implicitly_it_should_be_detected() - { - // Arrange - var configuration = new Configuration(new TestConfigurationStore()); - var testFrameworkProvider = new TestFrameworkProvider(configuration); - - // Act - Action act = () => testFrameworkProvider.Throw("MyMessage"); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_running_xunit_test_explicitly_it_should_be_detected() - { - // Arrange - var configuration = new Configuration(new TestConfigurationStore()) - { - TestFrameworkName = "xunit2" - }; - - var testFrameworkProvider = new TestFrameworkProvider(configuration); - - // Act - Action act = () => testFrameworkProvider.Throw("MyMessage"); - - // Assert - act.Should().Throw(); - } - - [Fact] - public void When_running_test_with_unknown_test_framework_it_should_throw() - { - // Arrange - var configuration = new Configuration(new TestConfigurationStore()) - { - TestFrameworkName = "foo" - }; - - var testFrameworkProvider = new TestFrameworkProvider(configuration); - - // Act - Action act = () => testFrameworkProvider.Throw("MyMessage"); - - // Assert - act.Should().Throw() - .WithMessage("*the test framework 'foo' but this is not supported*"); - } - - [Fact] - public void When_running_test_with_late_bound_but_unavailable_test_framework_it_should_throw() - { - // Arrange - var configuration = new Configuration(new TestConfigurationStore()) - { - TestFrameworkName = "nunit" - }; - - var testFrameworkProvider = new TestFrameworkProvider(configuration); - - // Act - Action act = () => testFrameworkProvider.Throw("MyMessage"); - - act.Should().Throw() - .WithMessage("*test framework 'nunit' but the required assembly 'nunit.framework' could not be found*"); - } - - private sealed class TestConfigurationStore : IConfigurationStore - { - string IConfigurationStore.GetSetting(string name) => string.Empty; - } -} diff --git a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs index 56c5a2aeec..788fd49e77 100644 --- a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs +++ b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs @@ -1,10 +1,8 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; using System.Threading.Tasks; -using FluentAssertions.Common; using FluentAssertions.Extensions; using FluentAssertions.Formatting; using FluentAssertions.Specs.Common; @@ -14,7 +12,7 @@ namespace FluentAssertions.Specs.Formatting; [Collection("FormatterSpecs")] -public class FormatterSpecs +public sealed class FormatterSpecs : IDisposable { [Fact] public void When_value_contains_cyclic_reference_it_should_create_descriptive_error_message() @@ -210,44 +208,44 @@ public void When_the_object_is_a_generic_type_without_custom_string_representati // Assert act.Should().Throw() .WithMessage( - """ - Expected stuff to be equal to - { - FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] - { - Children = {1, 2, 3, 4}, - Description = "Stuff_1", - StuffId = 1 - }, - FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] - { - Children = {1, 2, 3, 4}, - Description = "WRONG_DESCRIPTION", - StuffId = 2 - } - }, but - { - FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] + """ + Expected stuff to be equal to { - Children = {1, 2, 3, 4}, - Description = "Stuff_1", - StuffId = 1 - }, - FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] + FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] + { + Children = {1, 2, 3, 4}, + Description = "Stuff_1", + StuffId = 1 + }, + FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] + { + Children = {1, 2, 3, 4}, + Description = "WRONG_DESCRIPTION", + StuffId = 2 + } + }, but { - Children = {1, 2, 3, 4}, - Description = "Stuff_2", - StuffId = 2 - } - } differs at index 1. - """); + FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] + { + Children = {1, 2, 3, 4}, + Description = "Stuff_1", + StuffId = 1 + }, + FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] + { + Children = {1, 2, 3, 4}, + Description = "Stuff_2", + StuffId = 2 + } + } differs at index 1. + """); } [Fact] public void When_the_object_is_a_user_defined_type_it_should_show_the_name_on_the_initial_line() { // Arrange - var stuff = new StuffRecord(42, "description", new(24), [10, 20, 30, 40]); + var stuff = new StuffRecord(42, "description", new ChildRecord(24), [10, 20, 30, 40]); // Act Action act = () => stuff.Should().BeNull(); @@ -255,18 +253,18 @@ public void When_the_object_is_a_user_defined_type_it_should_show_the_name_on_th // Assert act.Should().Throw() .Which.Message.Should().Match( - """ - Expected stuff to be , but found FluentAssertions.Specs.Formatting.FormatterSpecs+StuffRecord - { - RecordChildren = {10, 20, 30, 40}, - RecordDescription = "description", - RecordId = 42, - SingleChild = FluentAssertions.Specs.Formatting.FormatterSpecs+ChildRecord + """ + Expected stuff to be , but found FluentAssertions.Specs.Formatting.FormatterSpecs+StuffRecord { - ChildRecordId = 24 - } - }. - """); + RecordChildren = {10, 20, 30, 40}, + RecordDescription = "description", + RecordId = 42, + SingleChild = FluentAssertions.Specs.Formatting.FormatterSpecs+ChildRecord + { + ChildRecordId = 24 + } + }. + """); } [Fact] @@ -292,28 +290,29 @@ public void When_the_object_is_an_anonymous_type_it_should_show_the_properties_r // Assert act.Should().Throw() .Which.Message.Should().Be( - """ - Expected stuff to be - { - Children = {10, 20, 30, 40}, - SingleChild = + """ + Expected stuff to be { - ChildId = 4 - } - }, but found - { - Children = {1, 2, 3, 4}, - Description = "absent", - SingleChild = + Children = {10, 20, 30, 40}, + SingleChild = + { + ChildId = 4 + } + }, but found { - ChildId = 8 - } - }. - """); + Children = {1, 2, 3, 4}, + Description = "absent", + SingleChild = + { + ChildId = 8 + } + }. + """); } [Fact] - public void When_the_object_is_a_list_of_anonymous_type_it_should_show_the_properties_recursively_with_newlines_and_indentation() + public void + When_the_object_is_a_list_of_anonymous_type_it_should_show_the_properties_recursively_with_newlines_and_indentation() { // Arrange var stuff = new[] @@ -346,32 +345,32 @@ public void When_the_object_is_a_list_of_anonymous_type_it_should_show_the_prope // Assert act.Should().Throw() .Which.Message.Should().Match( - """ - Expected stuff to be a collection with 1 item(s), but* - { + """ + Expected stuff to be a collection with 1 item(s), but* { - Description = "absent" - },* - { - Description = "absent" + { + Description = "absent" + },* + { + Description = "absent" + } } - } - contains 1 item(s) more than + contains 1 item(s) more than - { { - ComplexChildren =* { + ComplexChildren =* { - Property = "hello" - },* - { - Property = "goodbye" + { + Property = "hello" + },* + { + Property = "goodbye" + } } } - } - }.* - """); + }.* + """); } [Fact] @@ -404,19 +403,19 @@ public void When_the_object_is_a_tuple_it_should_show_the_properties_recursively // Assert act.Should().Throw() .Which.Message.Should().Match( - """ - Expected stuff to be equal to* - { - Item1 = 2,* - Item2 = "WRONG_DESCRIPTION",* - Item3 = {4, 5, 6, 7} - }, but found* - { - Item1 = 1,* - Item2 = "description",* - Item3 = {1, 2, 3, 4} - }.* - """); + """ + Expected stuff to be equal to* + { + Item1 = 2,* + Item2 = "WRONG_DESCRIPTION",* + Item3 = {4, 5, 6, 7} + }, but found* + { + Item1 = 1,* + Item2 = "description",* + Item3 = {1, 2, 3, 4} + }.* + """); } [Fact] @@ -426,7 +425,7 @@ public void When_the_object_is_a_record_it_should_show_the_properties_recursivel var stuff = new StuffRecord( RecordId: 9, RecordDescription: "descriptive", - SingleChild: new(ChildRecordId: 80), + SingleChild: new ChildRecord(ChildRecordId: 80), RecordChildren: [4, 5, 6, 7]); var expectedStuff = new @@ -440,21 +439,21 @@ public void When_the_object_is_a_record_it_should_show_the_properties_recursivel // Assert act.Should().Throw() .Which.Message.Should().Match( - """ - Expected stuff to be* - { - RecordDescription = "WRONG_DESCRIPTION" - }, but found FluentAssertions.Specs.Formatting.FormatterSpecs+StuffRecord - { - RecordChildren = {4, 5, 6, 7},* - RecordDescription = "descriptive",* - RecordId = 9,* - SingleChild = FluentAssertions.Specs.Formatting.FormatterSpecs+ChildRecord + """ + Expected stuff to be* { - ChildRecordId = 80 - } - }. - """); + RecordDescription = "WRONG_DESCRIPTION" + }, but found FluentAssertions.Specs.Formatting.FormatterSpecs+StuffRecord + { + RecordChildren = {4, 5, 6, 7},* + RecordDescription = "descriptive",* + RecordId = 9,* + SingleChild = FluentAssertions.Specs.Formatting.FormatterSpecs+ChildRecord + { + ChildRecordId = 80 + } + }. + """); } [Fact] @@ -946,193 +945,6 @@ private record StuffRecord(int RecordId, string RecordDescription, ChildRecord S private record ChildRecord(int ChildRecordId); - [Fact] - public void When_a_custom_formatter_exists_in_any_loaded_assembly_it_should_override_the_default_formatters() - { - // Arrange - Configuration.Current.ValueFormatterDetectionMode = ValueFormatterDetectionMode.Scan; - - var subject = new SomeClassWithCustomFormatter - { - Property = "SomeValue" - }; - - // Act - string result = Formatter.ToString(subject); - - // Assert - result.Should().Be("Property = SomeValue", "it should use my custom formatter"); - } - - [Fact] - public void When_a_base_class_has_a_custom_formatter_it_should_override_the_default_formatters() - { - // Arrange - Configuration.Current.ValueFormatterDetectionMode = ValueFormatterDetectionMode.Scan; - - var subject = new SomeClassInheritedFromClassWithCustomFormatterLvl1 - { - Property = "SomeValue" - }; - - // Act - string result = Formatter.ToString(subject); - - // Assert - result.Should().Be("Property = SomeValue", "it should use my custom formatter"); - } - - [Fact] - public void When_there_are_multiple_custom_formatters_it_should_select_a_more_specific_one() - { - // Arrange - Configuration.Current.ValueFormatterDetectionMode = ValueFormatterDetectionMode.Scan; - - var subject = new SomeClassInheritedFromClassWithCustomFormatterLvl2 - { - Property = "SomeValue" - }; - - // Act - string result = Formatter.ToString(subject); - - // Assert - result.Should().Be("Property is SomeValue", "it should use my custom formatter"); - } - - [Fact] - public void When_a_base_class_has_multiple_custom_formatters_it_should_work_the_same_as_for_the_base_class() - { - // Arrange - Configuration.Current.ValueFormatterDetectionMode = ValueFormatterDetectionMode.Scan; - - var subject = new SomeClassInheritedFromClassWithCustomFormatterLvl3 - { - Property = "SomeValue" - }; - - // Act - string result = Formatter.ToString(subject); - - // Assert - result.Should().Be("Property is SomeValue", "it should use my custom formatter"); - } - - [Fact] - public void When_no_custom_formatter_exists_in_the_specified_assembly_it_should_use_the_default() - { - // Arrange - Configuration.Current.ValueFormatterAssembly = "FluentAssertions"; - - var subject = new SomeClassWithCustomFormatter - { - Property = "SomeValue" - }; - - // Act - string result = Formatter.ToString(subject); - - // Assert - result.Should().Be(subject.ToString()); - } - - [Fact] - public void When_formatter_scanning_is_disabled_it_should_use_the_default_formatters() - { - // Arrange - Configuration.Current.ValueFormatterDetectionMode = ValueFormatterDetectionMode.Disabled; - - var subject = new SomeClassWithCustomFormatter - { - Property = "SomeValue" - }; - - // Act - string result = Formatter.ToString(subject); - - // Assert - result.Should().Be(subject.ToString()); - } - - [Fact] - public void When_no_formatter_scanning_is_configured_it_should_use_the_default_formatters() - { - // Arrange - Services.ResetToDefaults(); - Configuration.Current.ValueFormatterDetectionMode = ValueFormatterDetectionMode.Disabled; - - var subject = new SomeClassWithCustomFormatter - { - Property = "SomeValue" - }; - - // Act - string result = Formatter.ToString(subject); - - // Assert - result.Should().Be(subject.ToString()); - } - - public class SomeClassWithCustomFormatter - { - public string Property { get; set; } - - public override string ToString() - { - return "The value of my property is " + Property; - } - } - - public class SomeOtherClassWithCustomFormatter - { - public string Property { get; set; } - - public override string ToString() - { - return "The value of my property is " + Property; - } - } - - public class SomeClassInheritedFromClassWithCustomFormatterLvl1 : SomeClassWithCustomFormatter; - - public class SomeClassInheritedFromClassWithCustomFormatterLvl2 : SomeClassInheritedFromClassWithCustomFormatterLvl1; - - public class SomeClassInheritedFromClassWithCustomFormatterLvl3 : SomeClassInheritedFromClassWithCustomFormatterLvl2; - - public static class CustomFormatter - { - [ValueFormatter] - public static int Bar(SomeClassWithCustomFormatter _) - { - return -1; - } - - [ValueFormatter] - public static void Foo(SomeClassWithCustomFormatter value, FormattedObjectGraph output) - { - output.AddFragment("Property = " + value.Property); - } - - [ValueFormatter] - [SuppressMessage("ReSharper", "CA1801")] - public static void Foo(SomeOtherClassWithCustomFormatter _, FormattedObjectGraph output) - { - throw new XunitException("Should never be called"); - } - - [ValueFormatter] - public static void Foo(SomeClassInheritedFromClassWithCustomFormatterLvl2 value, FormattedObjectGraph output) - { - output.AddFragment("Property is " + value.Property); - } - - [ValueFormatter] - public static void Foo2(SomeClassInheritedFromClassWithCustomFormatterLvl2 value, FormattedObjectGraph output) - { - output.AddFragment("Property is " + value.Property); - } - } - [Fact] public void When_defining_a_custom_value_formatter_it_should_respect_the_overrides() { @@ -1217,11 +1029,9 @@ public FormatterScope(IValueFormatter formatter) public void Dispose() => Formatter.RemoveFormatter(formatter); } -} -// Due to the tests that call Configuration.Current -[CollectionDefinition("FormatterSpecs", DisableParallelization = true)] -public class FormatterSpecsDefinition; + public void Dispose() => AssertionEngine.ResetToDefaults(); +} internal class ExceptionThrowingClass { diff --git a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecsDefinition.cs b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecsDefinition.cs new file mode 100644 index 0000000000..bf90d4e8f9 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecsDefinition.cs @@ -0,0 +1,7 @@ +using Xunit; + +namespace FluentAssertions.Specs.Formatting; + +// Due to the tests that (temporarily) modify the active formatters collection. +[CollectionDefinition("FormatterSpecs", DisableParallelization = true)] +public class FormatterSpecsDefinition; diff --git a/Tests/FluentAssertions.Specs/Formatting/MultidimensionalArrayFormatterSpecs.cs b/Tests/FluentAssertions.Specs/Formatting/MultidimensionalArrayFormatterSpecs.cs index eeb94d9800..c824a0accd 100644 --- a/Tests/FluentAssertions.Specs/Formatting/MultidimensionalArrayFormatterSpecs.cs +++ b/Tests/FluentAssertions.Specs/Formatting/MultidimensionalArrayFormatterSpecs.cs @@ -4,7 +4,6 @@ namespace FluentAssertions.Specs.Formatting; -[Collection("FormatterSpecs")] public class MultidimensionalArrayFormatterSpecs { [Theory] diff --git a/docs/_pages/extensibility.md b/docs/_pages/extensibility.md index e92aa32d5c..79262e8224 100644 --- a/docs/_pages/extensibility.md +++ b/docs/_pages/extensibility.md @@ -271,7 +271,7 @@ The default behavior is to treat every type that overrides `Object.Equals` as on You can easily override this by using the `ComparingByValue` options for individual assertion, or to do the same using the global options: ```csharp -AssertionOptions.AssertEquivalencyUsing(options => options +AssertionConfiguration.Current.Equivalency.Modify(options => options .ComparingByValue()); ``` @@ -281,7 +281,7 @@ Primitive types are never compared by their members and trying to call e.g. `Com ## Equivalency assertion step by step -The entire structural equivalency API is built around the concept of a plan containing equivalency steps that are run in a predefined order. Each step is an implementation of the `IEquivalencyStep` which exposes a single method `Handle`. You can pass your own implementation to a particular assertion call by passing it into the `Using` method (which puts it behind the final default step) or directly tweak the global `AssertionOptions.EquivalencyPlan`. Checkout the underlying `EquivalencyPlan` to see how it relates your custom step to the other steps. That said, the `Handle` method has the following signature: +The entire structural equivalency API is built around the concept of a plan containing equivalency steps that are run in a predefined order. Each step is an implementation of the `IEquivalencyStep` which exposes a single method `Handle`. You can pass your own implementation to a particular assertion call by passing it into the `Using` method (which puts it behind the final default step) or directly tweak the global `AssertionConfiguration.Current.Equivalency.EquivalencyPlan`. Checkout the underlying `EquivalencyPlan` to see how it relates your custom step to the other steps. That said, the `Handle` method has the following signature: ```csharp EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, IValidateChildNodeEquivalency nestedValidator); @@ -310,7 +310,7 @@ Since `Should().Be()` internally uses the `{context}` placeholder I discussed at ## About selection, matching and ordering -Next to tuning the value type evaluation and changing the internal execution plan of the equivalency API, there are a couple of more specific extension methods. They are internally used by some of the methods provided by the `options` parameter, but you can add your own by calling the appropriate overloads of the `Using` methods. You can even do this globally by using the static `AssertionOptions.AssertEquivalencyUsing` method. +Next to tuning the value type evaluation and changing the internal execution plan of the equivalency API, there are a couple of more specific extension methods. They are internally used by some of the methods provided by the `options` parameter, but you can add your own by calling the appropriate overloads of the `Using` methods. You can even do this globally by using the static `AssertionConfiguration.Current.Equivalency.Modify` method. The interface `IMemberSelectionRule` defines an abstraction that defines what members (fields and properties) of the subject need to be included in the equivalency assertion operation. The main in-out parameter is a collection of `IMember` objects representing the fields and properties that need to be included. However, if your selection rule needs to start from scratch, you should override `IncludesMembers` and return `false`. As an example, the `AllPublicPropertiesSelectionRule` looks like this: @@ -344,9 +344,7 @@ The final interface, the `IOrderingRule`, is used to determine whether FA should ## Thread Safety -The classes `AssertionOptions` and `Formatter` control the global configuration by having static state, so one must be careful when they are mutated. -They are both designed to be configured from a single setup point in your test project and not from within individual unit tests. -Not following this could change the outcome of tests depending on the order they are run in or throw unexpected exceptions when run parallel. +The classes `AssertionConfiguration` and `Formatter` control the global configuration by having static state, so one must be careful when they are mutated. They are both designed to be configured from a single setup point in your test project and not from within individual unit tests. Not following this could change the outcome of tests depending on the order they are run in or throw unexpected exceptions when run parallel. In order to ensure they are configured exactly once, a test framework specific solution might be required depending on the version of .NET you are using. @@ -360,7 +358,7 @@ internal static class Initializer [ModuleInitializer] public static void SetDefaults() { - AssertionOptions.AssertEquivalencyUsing( + AssertionConfiguration.Current.Equivalency.Modify( options => { }); } } @@ -375,7 +373,7 @@ public static class Initializer { public static void Initialize() { - AssertionOptions.AssertEquivalencyUsing(options => options + AssertionConfiguration.Current.Equivalency.Modify(options => options .ComparingByValue()); } } @@ -392,7 +390,7 @@ public static class TestInitializer [AssemblyInitialize] public static void SetDefaults(TestContext context) { - AssertionOptions.AssertEquivalencyUsing( + AssertionConfiguration.Current.Equivalency.Modify( options => { }); } } @@ -414,7 +412,7 @@ namespace MyNamespace public MyFramework(IMessageSink messageSink) : base(messageSink) { - AssertionOptions.AssertEquivalencyUsing( + AssertionConfiguration.Current.Equivalency.Modify( options => { }); } } @@ -430,4 +428,4 @@ Add the assembly level attribute so that xUnit.net picks up your custom test fra Note: * The `nameof` operator cannot be used to reference the `MyFramework` class. If your global configuration doesn't work, ensure there is no typo in the assembly level attribute declaration and that the assembly containing the `MyFramework` class is referenced by the test assembly and gets copied to the output folder. -* Because you have to add the assembly level attribute per assembly you can define different `AssertionOptions` per test assembly if required. +* Because you have to add the assembly level attribute per assembly you can define different assertion options per test assembly if required. diff --git a/docs/_pages/introduction.md b/docs/_pages/introduction.md index cbca247481..65627ba714 100644 --- a/docs/_pages/introduction.md +++ b/docs/_pages/introduction.md @@ -73,7 +73,7 @@ This chaining can make your unit tests a lot easier to read. ## Global Configurations -Fluent Assertions `AssertionOptions` has several methods and properties that can be used to change the way it executes assertions or the defaults it will use for comparing object graphs. Changing those settings at the right time can be difficult, depending on the test framework. That's why Fluent Assertions offers a special assembly-level attribute that can be used to have some code executed _before_ the first assertion is executed. It will be called only once per test run, but you can use the attribute multiple times. +Fluent Assertions' `AssertionConfiguration` has several methods and properties that can be used to change the way it executes assertions or the defaults it will use for comparing object graphs. Changing those settings at the right time can be difficult, depending on the test framework. That's why Fluent Assertions offers a special assembly-level attribute that can be used to have some code executed _before_ the first assertion is executed. It will be called only once per test run, but you can use the attribute multiple times. ```csharp [assembly: AssertionEngineInitializer(typeof(Initializer), nameof(Initializer.Initialize))] @@ -82,7 +82,7 @@ public static class Initializer { public static void Initialize() { - AssertionOptions.AssertEquivalencyUsing(options => options + AssertionConfiguration.Current.Equivalency.Modify(options => options .ComparingByValue()); } } diff --git a/docs/_pages/objectgraphs.md b/docs/_pages/objectgraphs.md index bedf643e1f..f0756e45f2 100644 --- a/docs/_pages/objectgraphs.md +++ b/docs/_pages/objectgraphs.md @@ -59,7 +59,7 @@ actual.Should().BeEquivalentTo(expected, options => options Or do the same using the global options: ```csharp -AssertionOptions.AssertEquivalencyUsing(options => options +AssertionConfiguration.Current.Equivalency.Modify(options => options .ComparingByValue()); ``` @@ -340,7 +340,7 @@ orderDto.Should().BeEquivalentTo(expectation, options => options.WithStrictOrder In case you chose to use strict ordering by default you can still configure non-strict ordering in specific tests: ```csharp -AssertionOptions.AssertEquivalencyUsing(options => options.WithStrictOrdering()); +AssertionConfiguration.Current.Equivalency.Modify(options => options.WithStrictOrdering()); orderDto.Should().BeEquivalentTo(expectation, options => options.WithoutStrictOrdering()); ``` @@ -418,12 +418,12 @@ Alternatively, you could write your own implementation of `ITraceWriter` for spe ### Global Configuration Even though the structural equivalency API is pretty flexible, you might want to change some of these options on a global scale. -This is where the static class `AssertionOptions` comes into play. +This is where the static class `AssertionConfiguration` comes into play. For instance, to always compare enumerations by name, use the following statement: ```csharp -AssertionOptions.AssertEquivalencyUsing(options => +AssertionConfiguration.Current.Equivalency.Modify(options => options.ComparingEnumsByName); ``` -All the options available to an individual call to `Should().BeEquivalentTo` are supported, with the exception of some of the overloads that are specific to the type of the subject (for obvious reasons). +All the options available to an individual call to `Should().BeEquivalentTo` are supported, with the exception of some of the overloads that are specific to the type of the expectation (for obvious reasons). diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 8f26f33bd3..84c44b7cd9 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -79,6 +79,8 @@ sidebar: * Renamed `RespectingRuntimeTypes` to `PreferringRuntimeMemberTypes` and `RespectingDeclaredTypes` to `PreferringDeclaredMemberTypes` - [#2866](https://github.com/fluentassertions/fluentassertions/pull/2866) * Renamed `ExcludingNestedObjects` to `WithoutRecursing` to better describe its purpose - [#2876](https://github.com/fluentassertions/fluentassertions/pull/2876) * Removed direct support for assertions on `HttpResponseMessage`. Use [FluentAssertions.Web](https://github.com/adrianiftode/FluentAssertions.Web) instead. - [#2909](https://github.com/fluentassertions/fluentassertions/pull/2909) +* Consolidated the configuration options under `Configuration` and `Services` into `GlobalConfiguration` accessible through `AssertionEngine.Configuration` and `AssertionConfiguration.Current.Configuration` - [#2901](https://github.com/fluentassertions/fluentassertions/pull/2901) +* Removed support for setting configuration settings through an `app.config` file - [#2901](https://github.com/fluentassertions/fluentassertions/pull/2901) ### Breaking Changes (for extensions) * Add `ForConstraint` to `IAssertionsScope` to support chaining `.ForConstraint()` after `.Then` - [#2324](https://github.com/fluentassertions/fluentassertions/pull/2324) From 9f658d045b6c2b45dec5a342b1c7f43789436b78 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 4 Jan 2025 15:40:08 +0000 Subject: [PATCH 521/845] Bump coverlet.collector from 6.0.2 to 6.0.3 Bumps [coverlet.collector](https://github.com/coverlet-coverage/coverlet) from 6.0.2 to 6.0.3. - [Release notes](https://github.com/coverlet-coverage/coverlet/releases) - [Commits](https://github.com/coverlet-coverage/coverlet/compare/v6.0.2...v6.0.3) --- updated-dependencies: - dependency-name: coverlet.collector dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 2 +- Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 0c309535e1..9f74a7f23d 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -16,7 +16,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index c1d4217282..e522550546 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -34,7 +34,7 @@ runtime; build; native; contentfiles; analyzers - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index fe0a5c0ea7..988496888c 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -23,7 +23,7 @@ all runtime; build; native; contentfiles; analyzers - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 3be852702e..964635f1ef 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -33,7 +33,7 @@ runtime; build; native; contentfiles; analyzers - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 3784246c54..cc2b6e495e 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj index 2e58615511..9806bf6878 100644 --- a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj +++ b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj @@ -9,7 +9,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index 309480d004..4cd13476dd 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index 8da6aae173..45d9a0e8fe 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index c6559a7a12..cb6d3fd52f 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj index 755debc6d5..40b42aa5ca 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -7,7 +7,7 @@ - + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index b03fd4d223..fc505eec72 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -7,7 +7,7 @@ - + diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 37eeb5a60c..4d857cd118 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 77ce5770a8eda8087496551b2572b923bab4d55d Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 4 Jan 2025 15:27:21 +0100 Subject: [PATCH 522/845] Remove the dependency on Chill --- .../Configuration/GlobalFormattingOptions.cs | 2 +- .../Formatting/FormattingOptions.cs | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 1 - .../Configuration/EquivalencyOptionsSpecs.cs | 318 +++++++----------- .../FluentAssertions.Specs.csproj | 1 - 5 files changed, 119 insertions(+), 205 deletions(-) diff --git a/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs b/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs index f09c55d8f5..b01bfcd99c 100644 --- a/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs +++ b/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs @@ -26,7 +26,7 @@ public string ValueFormatterAssembly UseLineBreaks = UseLineBreaks, MaxDepth = MaxDepth, MaxLines = MaxLines, - ScopedFormatters = [..ScopedFormatters], + ScopedFormatters = [.. ScopedFormatters], ValueFormatterAssembly = ValueFormatterAssembly, ValueFormatterDetectionMode = ValueFormatterDetectionMode }; diff --git a/Src/FluentAssertions/Formatting/FormattingOptions.cs b/Src/FluentAssertions/Formatting/FormattingOptions.cs index b608525b60..8cb16870f8 100644 --- a/Src/FluentAssertions/Formatting/FormattingOptions.cs +++ b/Src/FluentAssertions/Formatting/FormattingOptions.cs @@ -71,7 +71,7 @@ internal FormattingOptions Clone() UseLineBreaks = UseLineBreaks, MaxDepth = MaxDepth, MaxLines = MaxLines, - ScopedFormatters = [..ScopedFormatters], + ScopedFormatters = [.. ScopedFormatters], }; } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index e522550546..62de053860 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -25,7 +25,6 @@ - diff --git a/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs b/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs index d114aeadf6..6dc2121810 100644 --- a/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs @@ -2,7 +2,6 @@ using System.Collections; using System.Linq; using System.Threading.Tasks; -using Chill; using FluentAssertions.Equivalency; using FluentAssertions.Equivalency.Steps; using FluentAssertions.Execution; @@ -14,77 +13,52 @@ namespace FluentAssertions.Specs.Configuration; public class EquivalencyOptionsSpecs { - [Collection("ConfigurationSpecs")] - public abstract class Given_temporary_global_assertion_options : GivenWhenThen + [Fact] + public void When_injecting_a_null_configurer_it_should_throw() { - protected override void Dispose(bool disposing) - { - AssertionConfiguration.Current.Equivalency.Modify(_ => new EquivalencyOptions()); + // Arrange / Act + var action = () => AssertionConfiguration.Current.Equivalency.Modify(configureOptions: null); - base.Dispose(disposing); - } + // Assert + action.Should().ThrowExactly() + .WithParameterName("configureOptions"); } - [Collection("ConfigurationSpecs")] - public class When_injecting_a_null_configurer : GivenSubject + [Fact] + public void When_concurrently_getting_equality_strategy_it_should_not_throw() { - public When_injecting_a_null_configurer() + // Arrange / Act + var action = () => { - When(() => () => AssertionConfiguration.Current.Equivalency.Modify(configureOptions: null)); - } - - [Fact] - public void It_should_throw() - { - Result.Should().ThrowExactly() - .WithParameterName("configureOptions"); - } - } - - [Collection("ConfigurationSpecs")] - - public class When_concurrently_getting_equality_strategy : GivenSubject - { - public When_concurrently_getting_equality_strategy() - { - When(() => - { #pragma warning disable CA1859 // https://github.com/dotnet/roslyn-analyzers/issues/6704 - IEquivalencyOptions equivalencyOptions = new EquivalencyOptions(); + IEquivalencyOptions equivalencyOptions = new EquivalencyOptions(); #pragma warning restore CA1859 - return () => Parallel.For(0, 10_000, new ParallelOptions { MaxDegreeOfParallelism = 8 }, - _ => equivalencyOptions.GetEqualityStrategy(typeof(IEnumerable)) - ); - }); - } + return () => Parallel.For(0, 10_000, new ParallelOptions { MaxDegreeOfParallelism = 8 }, + _ => equivalencyOptions.GetEqualityStrategy(typeof(IEnumerable)) + ); + }; - [Fact] - public void It_should_not_throw() - { - Result.Should().NotThrow(); - } + // Assert + action.Should().NotThrow(); } - public class When_modifying_global_reference_type_settings_a_previous_assertion_should_not_have_any_effect - : Given_temporary_global_assertion_options + [Collection("ConfigurationSpecs")] + public sealed class Given_temporary_global_assertion_options : IDisposable { - public When_modifying_global_reference_type_settings_a_previous_assertion_should_not_have_any_effect() + [Fact] + public void When_modifying_global_reference_type_settings_a_previous_assertion_should_not_have_any_effect_it_should_try_to_compare_the_classes_by_member_semantics_and_thus_throw() { - Given(() => - { - // Trigger a first equivalency check using the default global settings - new MyValueType { Value = 1 }.Should().BeEquivalentTo(new MyValueType { Value = 2 }); - }); + // Arrange + // Trigger a first equivalency check using the default global settings + new MyValueType { Value = 1 }.Should().BeEquivalentTo(new MyValueType { Value = 2 }); - When(() => AssertionConfiguration.Current.Equivalency.Modify(o => o.ComparingByMembers())); - } + AssertionConfiguration.Current.Equivalency.Modify(o => o.ComparingByMembers()); - [Fact] - public void It_should_try_to_compare_the_classes_by_member_semantics_and_thus_throw() - { + // Act Action act = () => new MyValueType { Value = 1 }.Should().BeEquivalentTo(new MyValueType { Value = 2 }); + // Assert act.Should().Throw(); } @@ -96,29 +70,20 @@ internal class MyValueType public override int GetHashCode() => 0; } - } - - public class When_modifying_global_value_type_settings_a_previous_assertion_should_not_have_any_effect - : Given_temporary_global_assertion_options - { - public When_modifying_global_value_type_settings_a_previous_assertion_should_not_have_any_effect() - { - Given(() => - { - // Trigger a first equivalency check using the default global settings - new MyClass { Value = 1 }.Should().BeEquivalentTo(new MyClass { Value = 1 }); - }); - - When(() => AssertionConfiguration.Current.Equivalency.Modify(o => o.ComparingByValue())); - } [Fact] - public void It_should_try_to_compare_the_classes_by_value_semantics_and_thus_throw() + public void When_modifying_global_value_type_settings_a_previous_assertion_should_not_have_any_effect_it_should_try_to_compare_the_classes_by_value_semantics_and_thus_throw() { - MyClass myClass = new() { Value = 1 }; + // Arrange + // Trigger a first equivalency check using the default global settings + new MyClass { Value = 1 }.Should().BeEquivalentTo(new MyClass { Value = 1 }); + + AssertionConfiguration.Current.Equivalency.Modify(o => o.ComparingByValue()); - Action act = () => myClass.Should().BeEquivalentTo(new MyClass { Value = 1 }); + // Act + Action act = () => new MyClass() { Value = 1 }.Should().BeEquivalentTo(new MyClass { Value = 1 }); + // Assert act.Should().Throw(); } @@ -126,22 +91,14 @@ internal class MyClass { public int Value { get; set; } } - } - - public class When_modifying_record_settings_globally : Given_temporary_global_assertion_options - { - public When_modifying_record_settings_globally() - { - When(() => - { - AssertionConfiguration.Current.Equivalency.Modify( - options => options.ComparingByValue(typeof(Position))); - }); - } [Fact] - public void It_should_use_the_global_settings_for_comparing_records() + public void When_modifying_record_settings_globally_it_should_use_the_global_settings_for_comparing_records() { + // Arrange + AssertionConfiguration.Current.Equivalency.Modify(o => o.ComparingByValue(typeof(Position))); + + // Act / Assert new Position(123).Should().BeEquivalentTo(new Position(123)); } @@ -155,23 +112,15 @@ public Position(int value) this.value = value; } } - } - - public class When_assertion_doubles_should_always_allow_small_deviations : Given_temporary_global_assertion_options - { - public When_assertion_doubles_should_always_allow_small_deviations() - { - When(() => - { - AssertionConfiguration.Current.Equivalency.Modify(options => options - .Using(ctx => ctx.Subject.Should().BeApproximately(ctx.Expectation, 0.01)) - .WhenTypeIs()); - }); - } [Fact] - public void Then_it_should_ignore_small_differences_without_the_need_of_local_options() + public void When_assertion_doubles_should_always_allow_small_deviations_then_it_should_ignore_small_differences_without_the_need_of_local_options() { + // Arrange + AssertionConfiguration.Current.Equivalency.Modify(options => options + .Using(ctx => ctx.Subject.Should().BeApproximately(ctx.Expectation, 0.01)) + .WhenTypeIs()); + var actual = new { Value = 1D / 3D @@ -182,27 +131,21 @@ public void Then_it_should_ignore_small_differences_without_the_need_of_local_op Value = 0.33D }; + // Act Action act = () => actual.Should().BeEquivalentTo(expected); + // Assert act.Should().NotThrow(); } - } - - public class When_local_similar_options_are_used : Given_temporary_global_assertion_options - { - public When_local_similar_options_are_used() - { - When(() => - { - AssertionConfiguration.Current.Equivalency.Modify(options => options - .Using(ctx => ctx.Subject.Should().BeApproximately(ctx.Expectation, 0.01)) - .WhenTypeIs()); - }); - } [Fact] - public void Then_they_should_override_the_global_options() + public void When_local_similar_options_are_used_then_they_should_override_the_global_options() { + // Arrange + AssertionConfiguration.Current.Equivalency.Modify(options => options + .Using(ctx => ctx.Subject.Should().BeApproximately(ctx.Expectation, 0.01)) + .WhenTypeIs()); + var actual = new { Value = 1D / 3D @@ -213,16 +156,23 @@ public void Then_they_should_override_the_global_options() Value = 0.33D }; + // Act Action act = () => actual.Should().BeEquivalentTo(expected, options => options .Using(ctx => ctx.Subject.Should().Be(ctx.Expectation)) .WhenTypeIs()); + // Assert act.Should().Throw().WithMessage("Expected*"); } [Fact] - public void Then_they_should_not_affect_any_other_assertions() + public void When_local_similar_options_are_used_then_they_should_not_affect_any_other_assertions() { + // Arrange + AssertionConfiguration.Current.Equivalency.Modify(options => options + .Using(ctx => ctx.Subject.Should().BeApproximately(ctx.Expectation, 0.01)) + .WhenTypeIs()); + var actual = new { Value = 1D / 3D @@ -233,150 +183,116 @@ public void Then_they_should_not_affect_any_other_assertions() Value = 0.33D }; + // Act Action act = () => actual.Should().BeEquivalentTo(expected); + // Assert act.Should().NotThrow(); } - } - - [Collection("ConfigurationSpecs")] - public class Given_self_resetting_equivalency_plan : GivenWhenThen - { - protected override void Dispose(bool disposing) - { - Plan.Reset(); - base.Dispose(disposing); - } - protected static EquivalencyPlan Plan - { - get { return AssertionConfiguration.Current.Equivalency.Plan; } - } + public void Dispose() => + AssertionConfiguration.Current.Equivalency.Modify(_ => new EquivalencyOptions()); } - public class When_inserting_a_step : Given_self_resetting_equivalency_plan + [Collection("ConfigurationSpecs")] + public sealed class Given_self_resetting_equivalency_plan : IDisposable { - public When_inserting_a_step() - { - When(() => Plan.Insert()); - } + private static EquivalencyPlan Plan => AssertionConfiguration.Current.Equivalency.Plan; [Fact] - public void Then_it_should_precede_all_other_steps() + public void When_inserting_a_step_then_it_should_precede_all_other_steps() { + // Arrange / Act + Plan.Insert(); + + // Assert var addedStep = Plan.LastOrDefault(s => s is MyEquivalencyStep); Plan.Should().StartWith(addedStep); } - } - - public class When_inserting_a_step_before_another : Given_self_resetting_equivalency_plan - { - public When_inserting_a_step_before_another() - { - When(() => Plan.InsertBefore()); - } [Fact] - public void Then_it_should_precede_that_particular_step() + public void When_inserting_a_step_before_another_then_it_should_precede_that_particular_step() { + // Arrange / Act + Plan.InsertBefore(); + + // Assert var addedStep = Plan.LastOrDefault(s => s is MyEquivalencyStep); var successor = Plan.LastOrDefault(s => s is DictionaryEquivalencyStep); Plan.Should().HaveElementPreceding(successor, addedStep); } - } - - public class When_appending_a_step : Given_self_resetting_equivalency_plan - { - public When_appending_a_step() - { - When(() => Plan.Add()); - } [Fact] - public void Then_it_should_precede_the_final_builtin_step() + public void When_appending_a_step_then_it_should_precede_the_final_builtin_step() { + // Arrange / Act + Plan.Add(); + + // Assert var equivalencyStep = Plan.LastOrDefault(s => s is SimpleEqualityEquivalencyStep); var subjectStep = Plan.LastOrDefault(s => s is MyEquivalencyStep); Plan.Should().HaveElementPreceding(equivalencyStep, subjectStep); } - } - - public class When_appending_a_step_after_another : Given_self_resetting_equivalency_plan - { - public When_appending_a_step_after_another() - { - When(() => Plan.AddAfter()); - } [Fact] - public void Then_it_should_precede_the_final_builtin_step() + public void When_appending_a_step_after_another_then_it_should_precede_the_final_builtin_step() { + // Arrange / Act + Plan.AddAfter(); + + // Assert var addedStep = Plan.LastOrDefault(s => s is MyEquivalencyStep); var predecessor = Plan.LastOrDefault(s => s is DictionaryEquivalencyStep); Plan.Should().HaveElementSucceeding(predecessor, addedStep); } - } - - public class When_appending_a_step_and_no_builtin_steps_are_there : Given_self_resetting_equivalency_plan - { - public When_appending_a_step_and_no_builtin_steps_are_there() - { - When(() => - { - Plan.Clear(); - Plan.Add(); - }); - } [Fact] - public void Then_it_should_precede_the_simple_equality_step() + public void When_appending_a_step_and_no_builtin_steps_are_there_then_it_should_precede_the_simple_equality_step() { - var subjectStep = Plan.LastOrDefault(s => s is MyEquivalencyStep); + // Arrange / Act + Plan.Clear(); + Plan.Add(); + // Assert + var subjectStep = Plan.LastOrDefault(s => s is MyEquivalencyStep); Plan.Should().EndWith(subjectStep); } - } - - public class When_removing_a_specific_step : Given_self_resetting_equivalency_plan - { - public When_removing_a_specific_step() - { - When(() => Plan.Remove()); - } [Fact] - public void Then_it_should_precede_the_simple_equality_step() + public void When_removing_a_specific_step_then_it_should_precede_the_simple_equality_step() { - Plan.Should().NotContain(s => s is SimpleEqualityEquivalencyStep); - } - } + // Arrange / Act + Plan.Remove(); - public class When_removing_a_specific_step_that_doesnt_exist : Given_self_resetting_equivalency_plan - { - public When_removing_a_specific_step_that_doesnt_exist() - { - WhenAction = () => Plan.Remove(); + // Assert + Plan.Should().NotContain(s => s is SimpleEqualityEquivalencyStep); } [Fact] - public void Then_it_should_precede_the_simple_equality_step() + public void When_removing_a_specific_step_that_doesnt_exist_Then_it_should_precede_the_simple_equality_step() { - WhenAction.Should().NotThrow(); + // Arrange / Act + var action = () => Plan.Remove(); + + // Assert + action.Should().NotThrow(); } - } - private class MyEquivalencyStep : IEquivalencyStep - { - public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, - IValidateChildNodeEquivalency valueChildNodes) + private class MyEquivalencyStep : IEquivalencyStep { - AssertionChain.GetOrCreate().For(context).FailWith(GetType().FullName); + public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, + IValidateChildNodeEquivalency valueChildNodes) + { + AssertionChain.GetOrCreate().For(context).FailWith(GetType().FullName); - return EquivalencyResult.EquivalencyProven; + return EquivalencyResult.EquivalencyProven; + } } + + public void Dispose() => Plan.Reset(); } } diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 964635f1ef..8125e41020 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -25,7 +25,6 @@ - From cb0950d9d0abb6fb9819fe87d206cf8f4e53344b Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sat, 4 Jan 2025 17:41:40 +0100 Subject: [PATCH 523/845] Addressed some Qodana warnings --- .../Configuration/EquivalencyOptionsSpecs.cs | 2 ++ .../Configuration/FormattingOptionsSpecs.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs b/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs index 6dc2121810..4e896783cf 100644 --- a/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs @@ -64,6 +64,7 @@ public void When_modifying_global_reference_type_settings_a_previous_assertion_s internal class MyValueType { + [UsedImplicitly] public int Value { get; set; } public override bool Equals(object obj) => true; @@ -89,6 +90,7 @@ public void When_modifying_global_value_type_settings_a_previous_assertion_shoul internal class MyClass { + [UsedImplicitly] public int Value { get; set; } } diff --git a/Tests/FluentAssertions.Specs/Configuration/FormattingOptionsSpecs.cs b/Tests/FluentAssertions.Specs/Configuration/FormattingOptionsSpecs.cs index 201a2c1055..f4d3d11e66 100644 --- a/Tests/FluentAssertions.Specs/Configuration/FormattingOptionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Configuration/FormattingOptionsSpecs.cs @@ -3,6 +3,7 @@ using FluentAssertions.Common; using FluentAssertions.Execution; using FluentAssertions.Formatting; +using JetBrains.Annotations; using Xunit; using Xunit.Sdk; @@ -161,6 +162,7 @@ public override string ToString() public class SomeOtherClassWithCustomFormatter { + [UsedImplicitly] public string Property { get; set; } public override string ToString() From da17a6ae212edd33c12b0ca8cb35713ccae45d7d Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sat, 4 Jan 2025 17:42:20 +0100 Subject: [PATCH 524/845] GlobalConfiguration.TestFramework did not reconfigure the run-time test framework being used. --- Src/FluentAssertions/AssertionEngine.cs | 28 +++++++++++++++++-- .../Configuration/GlobalConfiguration.cs | 12 +++++++- .../Configuration/GlobalConfigurationSpecs.cs | 16 ++++++++++- 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/Src/FluentAssertions/AssertionEngine.cs b/Src/FluentAssertions/AssertionEngine.cs index bab1ebc19c..f3cb9878f5 100644 --- a/Src/FluentAssertions/AssertionEngine.cs +++ b/Src/FluentAssertions/AssertionEngine.cs @@ -14,6 +14,7 @@ namespace FluentAssertions; public static class AssertionEngine { private static readonly object Lockable = new(); + private static ITestFramework testFramework; private static bool isInitialized; static AssertionEngine() @@ -24,7 +25,29 @@ static AssertionEngine() /// /// Gets or sets the run-time test framework used for throwing assertion exceptions. /// - public static ITestFramework TestFramework { get; set; } + public static ITestFramework TestFramework + { + get + { + if (testFramework is not null) + { + return testFramework; + } + + lock (Lockable) + { +#pragma warning disable CA1508 + if (testFramework is null) +#pragma warning restore CA1508 + { + testFramework = TestFrameworkFactory.GetFramework(Configuration.TestFramework); + } + } + + return testFramework; + } + set => testFramework = value; + } /// /// Provides access to the global configuration and options to customize the behavior of FluentAssertions. @@ -39,6 +62,7 @@ public static void ResetToDefaults() { isInitialized = false; Configuration = new(); + testFramework = null; EnsureInitialized(); } @@ -55,8 +79,6 @@ internal static void EnsureInitialized() { ExecuteCustomInitializers(); - TestFramework = TestFrameworkFactory.GetFramework(Configuration.TestFramework); - isInitialized = true; } } diff --git a/Src/FluentAssertions/Configuration/GlobalConfiguration.cs b/Src/FluentAssertions/Configuration/GlobalConfiguration.cs index 9baee410e8..ebe6577e69 100644 --- a/Src/FluentAssertions/Configuration/GlobalConfiguration.cs +++ b/Src/FluentAssertions/Configuration/GlobalConfiguration.cs @@ -2,6 +2,8 @@ namespace FluentAssertions.Configuration; public class GlobalConfiguration { + private TestFramework? testFramework; + /// /// Provides access to the formatting defaults for all assertions. /// @@ -18,5 +20,13 @@ public class GlobalConfiguration /// /// If set to , the test framework will be automatically detected by scanning the appdomain. /// - public TestFramework? TestFramework { get; set; } + public TestFramework? TestFramework + { + get => testFramework; + set + { + testFramework = value; + AssertionEngine.TestFramework = null; + } + } } diff --git a/Tests/FluentAssertions.Specs/Configuration/GlobalConfigurationSpecs.cs b/Tests/FluentAssertions.Specs/Configuration/GlobalConfigurationSpecs.cs index 68325f808f..8f0782cdcf 100644 --- a/Tests/FluentAssertions.Specs/Configuration/GlobalConfigurationSpecs.cs +++ b/Tests/FluentAssertions.Specs/Configuration/GlobalConfigurationSpecs.cs @@ -1,5 +1,6 @@ using System; using System.Threading.Tasks; +using FluentAssertions.Configuration; using FluentAssertions.Execution; using Xunit; @@ -31,7 +32,7 @@ public void Concurrently_accessing_the_configuration_is_safe() } [Fact] - public void Can_override_the_runtime_test_framework() + public void Can_override_the_runtime_test_framework_implementation() { // Arrange AssertionEngine.TestFramework = new NotImplementedTestFramework(); @@ -43,6 +44,19 @@ public void Can_override_the_runtime_test_framework() act.Should().Throw(); } + [Fact] + public void Can_override_the_runtime_test_framework() + { + // Arrange + AssertionEngine.Configuration.TestFramework = TestFramework.NUnit; + + // Act + var act = () => 1.Should().Be(2); + + // Assert + act.Should().Throw().WithMessage("*nunit.framework*"); + } + private class NotImplementedTestFramework : ITestFramework { public bool IsAvailable => true; From 35c19ab08368afdee67f9124db54ecd373f27b6b Mon Sep 17 00:00:00 2001 From: Soonil Hong Date: Sat, 4 Jan 2025 19:51:23 -0500 Subject: [PATCH 525/845] Fix syntax error - `enum` is reserved word so cannot be used as an identifier --- docs/_pages/enums.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/_pages/enums.md b/docs/_pages/enums.md index 47ad27e035..87883d7e06 100644 --- a/docs/_pages/enums.md +++ b/docs/_pages/enums.md @@ -16,9 +16,11 @@ The basic ones, `Be` and `HaveFlag`, just calls directly into `Enum.Equals` and ```csharp enum MyEnum { One = 1, Two = 2, Three = 3} -enum.Should().Be(MyEnum.One); -enum.Should().NotBe(MyEnum.Two); -enum.Should().BeOneOf(MyEnum.One, MyEnum.Two); +myEnum = MyEnum.One; + +myEnum.Should().Be(MyEnum.One); +myEnum.Should().NotBe(MyEnum.Two); +myEnum.Should().BeOneOf(MyEnum.One, MyEnum.Two); regexOptions.Should().HaveFlag(RegexOptions.Global); regexOptions.Should().NotHaveFlag(RegexOptions.CaseInsensitive); @@ -50,4 +52,4 @@ myEnum.Should().BeDefined(); myEnum = (MyEnum)99; myEnum.Should().NotBeDefined(); -``` \ No newline at end of file +``` From bb3a9b7865e15491abf02799eb34c8aea7ed9f7a Mon Sep 17 00:00:00 2001 From: Soonil Hong Date: Sat, 4 Jan 2025 19:59:25 -0500 Subject: [PATCH 526/845] Add missing semicolon --- docs/_pages/collections.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_pages/collections.md b/docs/_pages/collections.md index a0a4d9cc36..692900a14c 100644 --- a/docs/_pages/collections.md +++ b/docs/_pages/collections.md @@ -53,7 +53,7 @@ collection.Should().Contain(collection, "", 5, 6); // It should contain the orig collection.Should().OnlyContain(x => x < 10); collection.Should().ContainItemsAssignableTo(); -collection.Should().NotContainItemsAssignableTo() +collection.Should().NotContainItemsAssignableTo(); collection.Should().ContainInOrder(new[] { 1, 5, 8 }); collection.Should().NotContainInOrder(new[] { 5, 1, 2 }); From 15b628b0ce443375500cbf567849b7a885f3dfa7 Mon Sep 17 00:00:00 2001 From: Soonil Hong Date: Sat, 4 Jan 2025 19:48:49 -0500 Subject: [PATCH 527/845] Add missing semicolons --- docs/_pages/enums.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/_pages/enums.md b/docs/_pages/enums.md index 87883d7e06..1ac07817cc 100644 --- a/docs/_pages/enums.md +++ b/docs/_pages/enums.md @@ -32,11 +32,11 @@ If you want to compare enums of different types, you can use `HaveSameValueAs` o enum SameNameEnum { One = 11 } enum SameValueEnum { OneOne = 1 } -MyEnum.One.Should().HaveSameNameAs(SameNameEnum.One) -MyEnum.One.Should().HaveSameValueAs(SameValueEnum.OneOne) +MyEnum.One.Should().HaveSameNameAs(SameNameEnum.One); +MyEnum.One.Should().HaveSameValueAs(SameValueEnum.OneOne); -MyEnum.One.Should().NotHaveSameNameAs(SameValueEnum.OneOne) -MyEnum.One.Should().NotHaveSameValueAs(SameNameEnum.One) +MyEnum.One.Should().NotHaveSameNameAs(SameValueEnum.OneOne); +MyEnum.One.Should().NotHaveSameValueAs(SameNameEnum.One); ``` Lastly, if you want to verify than an enum has a specific integral value, you can use `HaveValue`. From 6b76731b62f225a983e10ac2e8093ec001bd0793 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 5 Jan 2025 11:12:33 +0100 Subject: [PATCH 528/845] Adopt the GitVersion config to properly handle pre-release tags Without "when-current-commit-tagged" set to "true", GitVersion would calculate the number of a commit tagged with 8.0.0-rc.1 to be 8.0.0-rc.2. Also removed some of the settings that are the default. --- GitVersion.yml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/GitVersion.yml b/GitVersion.yml index 34b4dff528..25189405f0 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,20 +1,10 @@ -next-version: 7.0.0 -workflow: GitHubFlow/v1 +workflow: GitFlow/v1 +commit-message-incrementing: Disabled branches: - develop: - regex: ^dev(elop)?(ment)?$ - label: alpha - increment: Minor release: - regex: releases?[/-] label: rc - increment: Patch + prevent-increment: + when-current-commit-tagged: true pull-request: - mode: ContinuousDelivery regex: ((pull|pull\-requests|pr)[/-]|[/-](merge)) label: pr - label-number-pattern: '[/-]?(?\d+)' - prevent-increment: - of-merged-branch: false -ignore: - sha: [] From c5b2f9ab0a8226e51be12e5fc55e98a6336d8d2d Mon Sep 17 00:00:00 2001 From: Soonil Hong Date: Sat, 4 Jan 2025 19:46:50 -0500 Subject: [PATCH 529/845] Update enums.md to fix typo --- docs/_pages/enums.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_pages/enums.md b/docs/_pages/enums.md index 1ac07817cc..9d1636e3f9 100644 --- a/docs/_pages/enums.md +++ b/docs/_pages/enums.md @@ -39,7 +39,7 @@ MyEnum.One.Should().NotHaveSameNameAs(SameValueEnum.OneOne); MyEnum.One.Should().NotHaveSameValueAs(SameNameEnum.One); ``` -Lastly, if you want to verify than an enum has a specific integral value, you can use `HaveValue`. +Lastly, if you want to verify that an enum has a specific integral value, you can use `HaveValue`. ```csharp MyEnum.One.Should().HaveValue(1); From 9f0e349a5949bcb10853b701a06a9abcc820a10d Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 5 Jan 2025 13:06:22 +0100 Subject: [PATCH 530/845] Include the release branches in the CodeQL runs --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index bd99c3708c..ce80ecec8d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -2,9 +2,9 @@ name: "CodeQL" on: push: - branches: [ "develop", "main" ] + branches: [ "develop", "main", "release*" ] pull_request: - branches: [ "develop", "main" ] + branches: [ "develop", "main", "release*" ] schedule: - cron: '00 15 * * 1' From db91ba54a8e0cd23f7b025750b3223112a9fa87f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 5 Jan 2025 13:32:03 +0100 Subject: [PATCH 531/845] Bump TUnit from 0.6.15 to 0.6.33 (#2924) Bumps [TUnit](https://github.com/thomhurst/TUnit) from 0.6.15 to 0.6.33. - [Commits](https://github.com/thomhurst/TUnit/commits) --- updated-dependencies: - dependency-name: TUnit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 66f0dbe958..56e89143a6 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -11,7 +11,7 @@ - + From 66aa565d65a6b6cde4b9dc74b2d21df019e66099 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 5 Jan 2025 13:32:19 +0100 Subject: [PATCH 532/845] Bump Verify.Xunit from 28.7.0 to 28.7.1 in the xunit group (#2923) Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify). Updates `Verify.Xunit` from 28.7.0 to 28.7.1 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/28.7.0...28.7.1) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 8dd730cc7c..ea9d17e128 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 9600078b4c3dbe5a37ec04460c572af25406a027 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 5 Jan 2025 13:40:58 +0100 Subject: [PATCH 533/845] GlobalEquivalencyOptions.CloneDefaults needs to be public This is needed by packages like FluentAssertions.DataSets to be able to hook into the equivalency engine. --- .../Configuration/GlobalEquivalencyOptions.cs | 7 ++++++- .../ApprovedApi/FluentAssertions/net47.verified.txt | 1 + .../ApprovedApi/FluentAssertions/net6.0.verified.txt | 1 + .../FluentAssertions/netstandard2.0.verified.txt | 1 + .../FluentAssertions/netstandard2.1.verified.txt | 1 + 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Src/FluentAssertions/Configuration/GlobalEquivalencyOptions.cs b/Src/FluentAssertions/Configuration/GlobalEquivalencyOptions.cs index 1dbf8efb10..059efa534a 100644 --- a/Src/FluentAssertions/Configuration/GlobalEquivalencyOptions.cs +++ b/Src/FluentAssertions/Configuration/GlobalEquivalencyOptions.cs @@ -1,6 +1,7 @@ using System; using FluentAssertions.Common; using FluentAssertions.Equivalency; +using JetBrains.Annotations; namespace FluentAssertions.Configuration; @@ -39,7 +40,11 @@ public void Modify(Func configureOptions /// /// Creates a clone of the default options and allows the caller to modify them. /// - internal EquivalencyOptions CloneDefaults() + /// + /// Can be used by external packages like FluentAssertions.DataSets to create a copy of the default equivalency options. + /// + [PublicAPI] + public EquivalencyOptions CloneDefaults() { return new EquivalencyOptions(defaults); } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index dab2f677bd..d7caf87f0e 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -602,6 +602,7 @@ namespace FluentAssertions.Configuration { public GlobalEquivalencyOptions() { } public FluentAssertions.Equivalency.EquivalencyPlan Plan { get; } + public FluentAssertions.Equivalency.EquivalencyOptions CloneDefaults() { } public void Modify(System.Func configureOptions) { } } public class GlobalFormattingOptions : FluentAssertions.Formatting.FormattingOptions diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index df0ff1d327..9ec3870298 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -615,6 +615,7 @@ namespace FluentAssertions.Configuration { public GlobalEquivalencyOptions() { } public FluentAssertions.Equivalency.EquivalencyPlan Plan { get; } + public FluentAssertions.Equivalency.EquivalencyOptions CloneDefaults() { } public void Modify(System.Func configureOptions) { } } public class GlobalFormattingOptions : FluentAssertions.Formatting.FormattingOptions diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 1935d91863..b93f47c081 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -594,6 +594,7 @@ namespace FluentAssertions.Configuration { public GlobalEquivalencyOptions() { } public FluentAssertions.Equivalency.EquivalencyPlan Plan { get; } + public FluentAssertions.Equivalency.EquivalencyOptions CloneDefaults() { } public void Modify(System.Func configureOptions) { } } public class GlobalFormattingOptions : FluentAssertions.Formatting.FormattingOptions diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 62c3a6c5bf..caacae1599 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -602,6 +602,7 @@ namespace FluentAssertions.Configuration { public GlobalEquivalencyOptions() { } public FluentAssertions.Equivalency.EquivalencyPlan Plan { get; } + public FluentAssertions.Equivalency.EquivalencyOptions CloneDefaults() { } public void Modify(System.Func configureOptions) { } } public class GlobalFormattingOptions : FluentAssertions.Formatting.FormattingOptions From dde0521ea47cead992dfeb42946c18fa6d3280b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:10:20 +0000 Subject: [PATCH 534/845] Bump Verify.Xunit from 28.7.1 to 28.8.1 in the xunit group Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify). Updates `Verify.Xunit` from 28.7.1 to 28.8.1 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/commits) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index ea9d17e128..2eb75efe22 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From fe25caca6bbac75aa0938c33cb8a1f990818675a Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Mon, 6 Jan 2025 19:25:00 +0100 Subject: [PATCH 535/845] Fix a crash when using `WithStrictOrderingFor(x => x)` with `BeEquivalentTo` (#2932) --- .../Common/ExpressionExtensions.cs | 6 ++-- .../CollectionSpecs.cs | 34 ++++++++++++++++--- docs/_pages/releases.md | 1 + 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/Src/FluentAssertions/Common/ExpressionExtensions.cs b/Src/FluentAssertions/Common/ExpressionExtensions.cs index 449a2cf358..3d287828d1 100644 --- a/Src/FluentAssertions/Common/ExpressionExtensions.cs +++ b/Src/FluentAssertions/Common/ExpressionExtensions.cs @@ -143,8 +143,10 @@ private static MemberPath GetNewInstance(Type declaringType, str /// /// is . public static MemberPath GetMemberPath( - this Expression> expression) => - expression.GetMemberPaths().First(); + this Expression> expression) + { + return expression.GetMemberPaths().FirstOrDefault() ?? new MemberPath(""); + } /// /// Validates that the expression can be used to construct a . diff --git a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs index b6bf10bc68..15e8bd9b0d 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs @@ -1602,6 +1602,20 @@ public void When_an_unordered_collection_must_not_be_strict_using_an_expression_ .WithMessage("*not strict*"); } + [Fact] + public void Can_request_strict_ordering_using_an_expression_that_points_to_the_collection_items() + { + // Arrange + var subject = new List { "first", "second" }; + + var expectation = new List { "second", "first" }; + + var act = () => subject.Should().BeEquivalentTo(expectation, + options => options.WithStrictOrderingFor(v => v)); + + act.Should().Throw().WithMessage("Expected*second*but*first*"); + } + [Fact] public void When_asserting_equivalence_of_collections_and_configured_to_use_runtime_properties_it_should_respect_the_runtime_type() @@ -2559,7 +2573,10 @@ public void When_two_unordered_lists_are_structurally_equivalent_and_order_is_st // Arrange Customer[] subject = [ - new Customer { Name = "John", Age = 27, Id = 1 }, new Customer { Name = "Jane", Age = 24, Id = 2 } + new() + { Name = "John", Age = 27, Id = 1 }, + new() + { Name = "Jane", Age = 24, Id = 2 } ]; var expectation = new Collection @@ -2583,7 +2600,10 @@ public void When_two_unordered_lists_are_structurally_equivalent_and_order_was_r // Arrange Customer[] subject = [ - new Customer { Name = "John", Age = 27, Id = 1 }, new Customer { Name = "Jane", Age = 24, Id = 2 } + new() + { Name = "John", Age = 27, Id = 1 }, + new() + { Name = "Jane", Age = 24, Id = 2 } ]; var expectation = new Collection @@ -2612,7 +2632,10 @@ public void When_two_unordered_lists_are_structurally_equivalent_and_order_was_r // Arrange Customer[] subject = [ - new Customer { Name = "John", Age = 27, Id = 1 }, new Customer { Name = "Jane", Age = 24, Id = 2 } + new() + { Name = "John", Age = 27, Id = 1 }, + new() + { Name = "Jane", Age = 24, Id = 2 } ]; var expectation = new Collection @@ -2635,7 +2658,10 @@ public void When_two_unordered_lists_are_structurally_equivalent_it_should_succe // Arrange Customer[] subject = [ - new Customer { Name = "John", Age = 27, Id = 1 }, new Customer { Name = "Jane", Age = 24, Id = 2 } + new() + { Name = "John", Age = 27, Id = 1 }, + new() + { Name = "Jane", Age = 24, Id = 2 } ]; var expectation = new Collection diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 84c44b7cd9..4c09daa75f 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -46,6 +46,7 @@ sidebar: * Fixed incorrect treatment of "\\r\\n" as new line - [#2569](https://github.com/fluentassertions/fluentassertions/pull/2569) * Fixed `RaisePropertyChangeFor` to return a filtered list of events - [#2677](https://github.com/fluentassertions/fluentassertions/pull/2677) * Including or excluding members did not work when `WithMapping` was used in `BeEquivalentTo` - [#2860](https://github.com/fluentassertions/fluentassertions/pull/2860) +* Fix a crash when using `WithStrictOrderingFor(x => x)` with `BeEquivalentTo` - [#](https://github.com/fluentassertions/fluentassertions/pull/x) ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) From 8b0d129a9f027e6c8fd795781e36134373a10aec Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 6 Jan 2025 20:00:31 +0100 Subject: [PATCH 536/845] Avoid InvalidOperationException when not having any elements --- Src/FluentAssertions/Xml/XDocumentAssertions.cs | 2 +- Src/FluentAssertions/Xml/XElementAssertions.cs | 2 +- Tests/FluentAssertions.Specs/Xml/XDocumentAssertionSpecs.cs | 6 +++++- Tests/FluentAssertions.Specs/Xml/XElementAssertionSpecs.cs | 6 +++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Src/FluentAssertions/Xml/XDocumentAssertions.cs b/Src/FluentAssertions/Xml/XDocumentAssertions.cs index 7840d53793..d650f4514a 100644 --- a/Src/FluentAssertions/Xml/XDocumentAssertions.cs +++ b/Src/FluentAssertions/Xml/XDocumentAssertions.cs @@ -472,7 +472,7 @@ public AndWhichConstraint HaveElementWithValue(XN .ForCondition(collection => collection.Any(e => e.Value == expectedValue)) .FailWith("but the element {0} does not have such a value.", expectedElement)); - return new AndWhichConstraint(this, xElements.First()); + return new AndWhichConstraint(this, xElements.FirstOrDefault()); } /// diff --git a/Src/FluentAssertions/Xml/XElementAssertions.cs b/Src/FluentAssertions/Xml/XElementAssertions.cs index e92be3b140..056a52f840 100644 --- a/Src/FluentAssertions/Xml/XElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XElementAssertions.cs @@ -690,7 +690,7 @@ public AndWhichConstraint HaveElementWithValue(XNa .ForCondition(elements => elements.Any(e => e.Value == expectedValue)) .FailWith("but the element {0} does not have such a value.", expectedElement)); - return new AndWhichConstraint(this, xElements.First()); + return new AndWhichConstraint(this, xElements.FirstOrDefault()); } /// diff --git a/Tests/FluentAssertions.Specs/Xml/XDocumentAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Xml/XDocumentAssertionSpecs.cs index d997bf1a2d..0c4736320e 100644 --- a/Tests/FluentAssertions.Specs/Xml/XDocumentAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Xml/XDocumentAssertionSpecs.cs @@ -1457,7 +1457,11 @@ public void Throws_when_element_with_namespace_is_not_found() """); // Act - Action act = () => document.Should().HaveElementWithValue(XNamespace.None + "grandchild", "f"); + Action act = () => + { + using var _ = new AssertionScope(); + document.Should().HaveElementWithValue(XNamespace.None + "grandchild", "f"); + }; // Assert act.Should().Throw().WithMessage("*grandchild*f*element*isn't found*"); diff --git a/Tests/FluentAssertions.Specs/Xml/XElementAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Xml/XElementAssertionSpecs.cs index 3b778bbe67..ff85c03724 100644 --- a/Tests/FluentAssertions.Specs/Xml/XElementAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Xml/XElementAssertionSpecs.cs @@ -2081,7 +2081,11 @@ public void Throws_when_element_with_namespace_not_found() """); // Act - Action act = () => element.Should().HaveElementWithValue(XNamespace.None + "c", "f"); + Action act = () => + { + using var _ = new AssertionScope(); + element.Should().HaveElementWithValue(XNamespace.None + "c", "f"); + }; // Assert act.Should().Throw().WithMessage("*c*f*element*isn't found*"); From bcc974bf37e69d5f8fcf32f2945fe319bb39c26b Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 6 Jan 2025 20:01:15 +0100 Subject: [PATCH 537/845] Simplify FirstOrDefault() + null check to Any() --- Src/FluentAssertions/Xml/XDocumentAssertions.cs | 4 ++-- Src/FluentAssertions/Xml/XElementAssertions.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Src/FluentAssertions/Xml/XDocumentAssertions.cs b/Src/FluentAssertions/Xml/XDocumentAssertions.cs index d650f4514a..8a798ab87f 100644 --- a/Src/FluentAssertions/Xml/XDocumentAssertions.cs +++ b/Src/FluentAssertions/Xml/XDocumentAssertions.cs @@ -531,8 +531,8 @@ public AndConstraint NotHaveElementWithValue(XName unexpect .ForCondition(Subject is not null) .FailWith("but the element itself is .") .Then - .ForCondition(Subject!.Root!.Elements(unexpectedElement) - .FirstOrDefault(e => e.Value == unexpectedValue) is null) + .ForCondition(!Subject!.Root!.Elements(unexpectedElement) + .Any(e => e.Value == unexpectedValue)) .FailWith("but the element {0} does have this value.", unexpectedElement)); return new AndConstraint(this); diff --git a/Src/FluentAssertions/Xml/XElementAssertions.cs b/Src/FluentAssertions/Xml/XElementAssertions.cs index 056a52f840..14b7a84b78 100644 --- a/Src/FluentAssertions/Xml/XElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XElementAssertions.cs @@ -750,8 +750,8 @@ public AndConstraint NotHaveElementWithValue(XName unexpecte .BecauseOf(because, becauseArgs) .FailWith("but the element itself is .") .Then - .ForCondition(Subject!.Elements(unexpectedElement) - .FirstOrDefault(e => e.Value == unexpectedValue) is null) + .ForCondition(!Subject!.Elements(unexpectedElement) + .Any(e => e.Value == unexpectedValue)) .FailWith("but the element {0} does have this value.", unexpectedElement)); return new AndConstraint(this); From 7426493a99852dbe4fbc57d56890515afb4c217a Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Tue, 7 Jan 2025 08:52:53 +0100 Subject: [PATCH 538/845] Fix release note PR-link --- docs/_pages/releases.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 4c09daa75f..123cbcfb13 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -46,7 +46,7 @@ sidebar: * Fixed incorrect treatment of "\\r\\n" as new line - [#2569](https://github.com/fluentassertions/fluentassertions/pull/2569) * Fixed `RaisePropertyChangeFor` to return a filtered list of events - [#2677](https://github.com/fluentassertions/fluentassertions/pull/2677) * Including or excluding members did not work when `WithMapping` was used in `BeEquivalentTo` - [#2860](https://github.com/fluentassertions/fluentassertions/pull/2860) -* Fix a crash when using `WithStrictOrderingFor(x => x)` with `BeEquivalentTo` - [#](https://github.com/fluentassertions/fluentassertions/pull/x) +* Fix a crash when using `WithStrictOrderingFor(x => x)` with `BeEquivalentTo` - [#2932](https://github.com/fluentassertions/fluentassertions/pull/2932) ### Breaking Changes (for users) * Moved support for `DataSet`, `DataTable`, `DataRow` and `DataColumn` into a new package `FluentAssertions.DataSet` - [#2267](https://github.com/fluentassertions/fluentassertions/pull/2267) From 3d8f03fdbe788b8c87b2f49b13b6b8d9033a181b Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger | alu-one Date: Tue, 7 Jan 2025 08:54:29 +0100 Subject: [PATCH 539/845] Fix several link texts --- docs/_pages/releases.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 123cbcfb13..9a9e7333eb 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -37,10 +37,10 @@ sidebar: * Also adds the capability to ignore the newline style on strings - [#2565](https://github.com/fluentassertions/fluentassertions/pull/2565) * You can mark all assertions in an assembly as custom assertions using the `[CustomAssertionsAssembly]` attribute - [#2389](https://github.com/fluentassertions/fluentassertions/pull/2389) * All `Should()` methods on reference types are now annotated with the `[NotNull]` attribute for a better Fluent Assertions experience when nullable reference types are enabled - [#2380](https://github.com/fluentassertions/fluentassertions/pull/2380) -* All assertions that support chaining using the `.Which` construct will now amend the caller identifier - [2539](https://github.com/fluentassertions/pull/2539) -* Introduced a `MethodInfoFormatter` and improved the `PropertyInfoFormatter` - [2539](https://github.com/fluentassertions/pull/2539) +* All assertions that support chaining using the `.Which` construct will now amend the caller identifier - [#2539](https://github.com/fluentassertions/pull/2539) +* Introduced a `MethodInfoFormatter` and improved the `PropertyInfoFormatter` - [#2539](https://github.com/fluentassertions/pull/2539) * `Excluding()` / `For().Exclude()` and `Including()` on `BeEquivalentTo()` now also accepts an anonymous object to include/exclude multiple members at once - [#2488](https://github.com/fluentassertions/fluentassertions/pull/2488) -* You can exclude explicitly implemented properties from `BeEquivalentTo` via `ExcludingExplicitlyImplementedProperties` - [2851](https://github.com/fluentassertions/pull/2851) +* You can exclude explicitly implemented properties from `BeEquivalentTo` via `ExcludingExplicitlyImplementedProperties` - [#2851](https://github.com/fluentassertions/pull/2851) ### Fixes * Fixed incorrect treatment of "\\r\\n" as new line - [#2569](https://github.com/fluentassertions/fluentassertions/pull/2569) @@ -96,7 +96,7 @@ sidebar: ### Fixes -* The expectation node identified as a cyclic reference is still compared to the subject node using simple equality - [2819](https://github.com/fluentassertions/fluentassertions/pull/2819) +* The expectation node identified as a cyclic reference is still compared to the subject node using simple equality - [#2819](https://github.com/fluentassertions/fluentassertions/pull/2819) * Fixed a problem in `BeEquivalentTo` where write-only properties would cause a `NullReferenceException` - [#2836](https://github.com/fluentassertions/fluentassertions/pull/2836) ### Breaking Changes @@ -108,7 +108,7 @@ sidebar: ## 6.12.2 ### Fixes -* Better handling of normal vs explicitly implemented vs default interface properties - [2794](https://github.com/fluentassertions/fluentassertions/pull/2794) +* Better handling of normal vs explicitly implemented vs default interface properties - [#2794](https://github.com/fluentassertions/fluentassertions/pull/2794) ## 6.12.1 From e5283d0856f8d18fb1ab9bc175d30d130b23fcb7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:08:30 +0000 Subject: [PATCH 540/845] Bump Meziantou.Analyzer from 2.0.184 to 2.0.186 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.184 to 2.0.186. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.184...2.0.186) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 2bd9a9c1a2..9d396e38fb 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 266fede621c21c70ee3bee119f73a7893155fb75 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:05:12 +0000 Subject: [PATCH 541/845] Bump Microsoft.Testing.Extensions.TrxReport from 1.5.0 to 1.5.1 Bumps [Microsoft.Testing.Extensions.TrxReport](https://github.com/microsoft/testfx) from 1.5.0 to 1.5.1. - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog-Platform.md) - [Commits](https://github.com/microsoft/testfx/commits) --- updated-dependencies: - dependency-name: Microsoft.Testing.Extensions.TrxReport dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 56e89143a6..736e0df558 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -12,7 +12,7 @@ - + From f77fe325fb03040d8b32973a0377ef9213990ba4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:04:08 +0000 Subject: [PATCH 542/845] Bump the xunit group with 3 updates Bumps the xunit group with 3 updates: [xunit](https://github.com/xunit/xunit), [xunit.v3](https://github.com/xunit/xunit) and [xunit.v3.core](https://github.com/xunit/xunit). Updates `xunit` from 2.9.2 to 2.9.3 - [Commits](https://github.com/xunit/xunit/compare/v2-2.9.2...v2-2.9.3) Updates `xunit.v3` from 1.0.0 to 1.0.1 - [Commits](https://github.com/xunit/xunit/compare/v3-1.0.0...v3-1.0.1) Updates `xunit.v3.core` from 1.0.0 to 1.0.1 - [Commits](https://github.com/xunit/xunit/compare/v3-1.0.0...v3-1.0.1) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: xunit.v3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: xunit.v3.core dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 2eb75efe22..f0701285a0 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -6,7 +6,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 9f74a7f23d..a2d3be6570 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -11,7 +11,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 62de053860..e83ffe734b 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -27,7 +27,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 988496888c..ea6745be3d 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -18,7 +18,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 8125e41020..acc609ca0d 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -26,7 +26,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index cb6d3fd52f..19446126ae 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj index 40b42aa5ca..bf0e30ac91 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -9,7 +9,7 @@ - + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index fc505eec72..520ccb7460 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -9,7 +9,7 @@ - + diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index 4d857cd118..7ba04d5a9a 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -7,7 +7,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From bfbf5098e10923b86a820c01284b17b594b8f7c0 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Tue, 14 Jan 2025 08:56:15 +0100 Subject: [PATCH 543/845] Update landing page (#2944) * updated website * removed some elements of the page (Powered By for example) * updated some basic texts. * updated the icons and updated some colors. * fixed the footer to mention Xceed * added the xceed logo to the assets. * added another logo to the resources. * Update README.md updated the readme to reflect the changes to FA * removed the funding section. --------- Co-authored-by: mattd1980 --- .github/FUNDING.yml | 6 -- README.md | 20 ++--- docs/_includes/footer.html | 2 +- docs/_includes/masthead.html | 2 +- docs/_sass/minimal-mistakes/_variables.scss | 6 +- docs/assets/images/FA_Full_Logo.png | Bin 0 -> 17392 bytes docs/assets/images/FA_Partner_Logo.png | Bin 0 -> 147204 bytes docs/assets/images/FA_Solo_Logo.png | Bin 0 -> 37325 bytes docs/assets/images/Now An Xceed partner.png | Bin 0 -> 147204 bytes docs/assets/images/binoculars.svg | 40 +-------- docs/assets/images/book.svg | 49 +---------- docs/assets/images/checklist.svg | 90 +------------------- docs/assets/images/community.svg | 44 +--------- docs/assets/images/customer-service.svg | 60 +------------ docs/assets/images/gift.svg | 59 ------------- docs/assets/images/jigsaws.svg | 45 +--------- docs/assets/images/twitter.svg | 52 ----------- docs/assets/images/vote.svg | 55 +----------- docs/assets/images/xceed_logo_small.png | Bin 0 -> 20001 bytes docs/assets/images/xceed_logo_whiteB.png | Bin 0 -> 2881 bytes docs/index.html | 48 ++++------- 21 files changed, 37 insertions(+), 541 deletions(-) delete mode 100644 .github/FUNDING.yml create mode 100644 docs/assets/images/FA_Full_Logo.png create mode 100644 docs/assets/images/FA_Partner_Logo.png create mode 100644 docs/assets/images/FA_Solo_Logo.png create mode 100644 docs/assets/images/Now An Xceed partner.png delete mode 100644 docs/assets/images/gift.svg delete mode 100644 docs/assets/images/twitter.svg create mode 100644 docs/assets/images/xceed_logo_small.png create mode 100644 docs/assets/images/xceed_logo_whiteB.png diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 7ab3cb088b..0000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,6 +0,0 @@ -# These are supported funding model platforms - -github: fluentassertions -ko_fi: dennisdoomen -patreon: fluentassertions -custom: ["https://paypal.me/fluentassertions"] diff --git a/README.md b/README.md index 1efa0d63dd..34d9279621 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - + # Extension methods to fluently assert the outcome of .NET tests [![](https://img.shields.io/github/actions/workflow/status/fluentassertions/fluentassertions/build.yml?branch=develop)](https://github.com/fluentassertions/fluentassertions/actions?query=branch%3Adevelop) @@ -14,12 +14,15 @@ [![open issues](https://img.shields.io/github/issues/fluentassertions/fluentassertions)](https://github.com/fluentassertions/fluentassertions/issues) ![](https://img.shields.io/badge/release%20strategy-githubflow-orange.svg) -A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher. +Fluent Assertions provides a comprehensive set of extension methods that enable developers to express the expected outcomes of TDD (Test-Driven Development) and BDD (Behavior-Driven Development) unit tests in a natural, readable style. It is compatible with .NET Standard 2.0+, .NET Framework 4.7+, and .NET 6+. -See https://www.fluentassertions.com for [background information](https://fluentassertions.com/about/), [usage documentation](https://fluentassertions.com/introduction), an [extensibility guide](https://fluentassertions.com/extensibility/), support information and more [tips & tricks](https://fluentassertions.com/tips/). +Visit https://www.fluentassertions.com for [background information](https://fluentassertions.com/about/), [usage documentation](https://fluentassertions.com/introduction), an [extensibility guide](https://fluentassertions.com/extensibility/), support information and more [tips & tricks](https://fluentassertions.com/tips/). ![](https://repobeats.axiom.co/api/embed/282ed7bca0ede1ac7751ebde6b3ef091a0c6c52d.svg) +# Xceed Partnership FAQ +Xceed is now an official Partner to Fluent Assertions! [Learn what this partnership means for our users](https://xceed.com/fluent-assertions-faq/). After extensive discussions with the Fluent Assertions team, we are thrilled about the future of the product and look forward to its continued growth and development. + # Who created this? Originally authored by Dennis Doomen with Jonas Nyrup as the productive side-kick. Notable contributions were provided by Artur Krajewski, Lukas Grützmacher and David Omid. @@ -32,13 +35,4 @@ This is a special set of tests that use the [Verify](https://github.com/VerifyTe If you've verified the changes and decided they are valid, you can accept them using `AcceptApiChanges.ps1` or `AcceptApiChanges.sh`. Alternatively, you can use the [Verify Support](https://plugins.jetbrains.com/plugin/17240-verify-support) plug-in to compare the changes and accept them right from inside Rider. See also the [Contribution Guidelines](CONTRIBUTING.md). # Powered By -  -  - -With support from the following public [sponsors](https://github.com/sponsors/fluentassertions) - - - - - - + diff --git a/docs/_includes/footer.html b/docs/_includes/footer.html index 8f50a773f9..51f3a19c16 100644 --- a/docs/_includes/footer.html +++ b/docs/_includes/footer.html @@ -22,4 +22,4 @@ - + diff --git a/docs/_includes/masthead.html b/docs/_includes/masthead.html index 59020ef4f4..8f71e1d0dc 100644 --- a/docs/_includes/masthead.html +++ b/docs/_includes/masthead.html @@ -2,7 +2,7 @@
[Pure] - public static AssemblyAssertions Should(this Assembly assembly) + public static AssemblyAssertions Should([NotNull] this Assembly assembly) { return new AssemblyAssertions(assembly); } @@ -182,7 +183,7 @@ public static AssemblyAssertions Should(this Assembly assembly) /// current . ///
[Pure] - public static XDocumentAssertions Should(this XDocument actualValue) + public static XDocumentAssertions Should([NotNull] this XDocument actualValue) { return new XDocumentAssertions(actualValue); } @@ -192,7 +193,7 @@ public static XDocumentAssertions Should(this XDocument actualValue) /// current . ///
[Pure] - public static XElementAssertions Should(this XElement actualValue) + public static XElementAssertions Should([NotNull] this XElement actualValue) { return new XElementAssertions(actualValue); } @@ -202,7 +203,7 @@ public static XElementAssertions Should(this XElement actualValue) /// current . ///
[Pure] - public static XAttributeAssertions Should(this XAttribute actualValue) + public static XAttributeAssertions Should([NotNull] this XAttribute actualValue) { return new XAttributeAssertions(actualValue); } @@ -212,7 +213,7 @@ public static XAttributeAssertions Should(this XAttribute actualValue) /// current . ///
[Pure] - public static StreamAssertions Should(this Stream actualValue) + public static StreamAssertions Should([NotNull] this Stream actualValue) { return new StreamAssertions(actualValue); } @@ -222,7 +223,7 @@ public static StreamAssertions Should(this Stream actualValue) /// current . ///
[Pure] - public static BufferedStreamAssertions Should(this BufferedStream actualValue) + public static BufferedStreamAssertions Should([NotNull] this BufferedStream actualValue) { return new BufferedStreamAssertions(actualValue); } @@ -279,7 +280,7 @@ private static void ForceEnumeration(T subject, Func enumerab /// current . /// [Pure] - public static ObjectAssertions Should(this object actualValue) + public static ObjectAssertions Should([NotNull] this object actualValue) { return new ObjectAssertions(actualValue); } @@ -299,7 +300,7 @@ public static BooleanAssertions Should(this bool actualValue) /// current nullable . /// [Pure] - public static NullableBooleanAssertions Should(this bool? actualValue) + public static NullableBooleanAssertions Should([NotNull] this bool? actualValue) { return new NullableBooleanAssertions(actualValue); } @@ -309,7 +310,7 @@ public static NullableBooleanAssertions Should(this bool? actualValue) /// current . /// [Pure] - public static HttpResponseMessageAssertions Should(this HttpResponseMessage actualValue) + public static HttpResponseMessageAssertions Should([NotNull] this HttpResponseMessage actualValue) { return new HttpResponseMessageAssertions(actualValue); } @@ -329,7 +330,7 @@ public static GuidAssertions Should(this Guid actualValue) /// current nullable . /// [Pure] - public static NullableGuidAssertions Should(this Guid? actualValue) + public static NullableGuidAssertions Should([NotNull] this Guid? actualValue) { return new NullableGuidAssertions(actualValue); } @@ -339,7 +340,7 @@ public static NullableGuidAssertions Should(this Guid? actualValue) /// current . /// [Pure] - public static GenericCollectionAssertions Should(this IEnumerable actualValue) + public static GenericCollectionAssertions Should([NotNull] this IEnumerable actualValue) { return new GenericCollectionAssertions(actualValue); } @@ -349,7 +350,7 @@ public static GenericCollectionAssertions Should(this IEnumerable actua /// current . /// [Pure] - public static StringCollectionAssertions Should(this IEnumerable @this) + public static StringCollectionAssertions Should([NotNull] this IEnumerable @this) { return new StringCollectionAssertions(@this); } @@ -360,7 +361,7 @@ public static StringCollectionAssertions Should(this IEnumerable @this) /// [Pure] public static GenericDictionaryAssertions, TKey, TValue> Should( - this IDictionary actualValue) + [NotNull] this IDictionary actualValue) { return new GenericDictionaryAssertions, TKey, TValue>(actualValue); } @@ -371,7 +372,7 @@ public static GenericDictionaryAssertions, TKey, TValu /// [Pure] public static GenericDictionaryAssertions>, TKey, TValue> Should( - this IEnumerable> actualValue) + [NotNull] this IEnumerable> actualValue) { return new GenericDictionaryAssertions>, TKey, TValue>(actualValue); } @@ -382,7 +383,7 @@ public static GenericDictionaryAssertions /// [Pure] public static GenericDictionaryAssertions Should( - this TCollection actualValue) + [NotNull] this TCollection actualValue) where TCollection : IEnumerable> { return new GenericDictionaryAssertions(actualValue); @@ -392,7 +393,7 @@ public static GenericDictionaryAssertions Should. /// [Pure] - public static GenericCollectionAssertions Should(this DataTableCollection actualValue) + public static GenericCollectionAssertions Should([NotNull] this DataTableCollection actualValue) { return new GenericCollectionAssertions( ReadOnlyNonGenericCollectionWrapper.Create(actualValue)); @@ -402,7 +403,7 @@ public static GenericCollectionAssertions Should(this DataTableCollec /// Returns an assertions object that provides methods for asserting the state of a . /// [Pure] - public static GenericCollectionAssertions Should(this DataColumnCollection actualValue) + public static GenericCollectionAssertions Should([NotNull] this DataColumnCollection actualValue) { return new GenericCollectionAssertions( ReadOnlyNonGenericCollectionWrapper.Create(actualValue)); @@ -412,7 +413,7 @@ public static GenericCollectionAssertions Should(this DataColumnColl /// Returns an assertions object that provides methods for asserting the state of a . /// [Pure] - public static GenericCollectionAssertions Should(this DataRowCollection actualValue) + public static GenericCollectionAssertions Should([NotNull] this DataRowCollection actualValue) { return new GenericCollectionAssertions( ReadOnlyNonGenericCollectionWrapper.Create(actualValue)); @@ -423,7 +424,7 @@ public static GenericCollectionAssertions Should(this DataRowCollection /// current . /// [Pure] - public static DataColumnAssertions Should(this DataColumn actualValue) + public static DataColumnAssertions Should([NotNull] this DataColumn actualValue) { return new DataColumnAssertions(actualValue); } @@ -453,7 +454,7 @@ public static DateTimeOffsetAssertions Should(this DateTimeOffset actualValue) /// current nullable . /// [Pure] - public static NullableDateTimeAssertions Should(this DateTime? actualValue) + public static NullableDateTimeAssertions Should([NotNull] this DateTime? actualValue) { return new NullableDateTimeAssertions(actualValue); } @@ -463,7 +464,7 @@ public static NullableDateTimeAssertions Should(this DateTime? actualValue) /// current nullable . /// [Pure] - public static NullableDateTimeOffsetAssertions Should(this DateTimeOffset? actualValue) + public static NullableDateTimeOffsetAssertions Should([NotNull] this DateTimeOffset? actualValue) { return new NullableDateTimeOffsetAssertions(actualValue); } @@ -484,7 +485,7 @@ public static DateOnlyAssertions Should(this DateOnly actualValue) /// current nullable . /// [Pure] - public static NullableDateOnlyAssertions Should(this DateOnly? actualValue) + public static NullableDateOnlyAssertions Should([NotNull] this DateOnly? actualValue) { return new NullableDateOnlyAssertions(actualValue); } @@ -504,7 +505,7 @@ public static TimeOnlyAssertions Should(this TimeOnly actualValue) /// current nullable . /// [Pure] - public static NullableTimeOnlyAssertions Should(this TimeOnly? actualValue) + public static NullableTimeOnlyAssertions Should([NotNull] this TimeOnly? actualValue) { return new NullableTimeOnlyAssertions(actualValue); } @@ -516,7 +517,7 @@ public static NullableTimeOnlyAssertions Should(this TimeOnly? actualValue) /// current . /// [Pure] - public static ComparableTypeAssertions Should(this IComparable comparableValue) + public static ComparableTypeAssertions Should([NotNull] this IComparable comparableValue) { return new ComparableTypeAssertions(comparableValue); } @@ -536,7 +537,7 @@ public static NumericAssertions Should(this int actualValue) /// current nullable . /// [Pure] - public static NullableNumericAssertions Should(this int? actualValue) + public static NullableNumericAssertions Should([NotNull] this int? actualValue) { return new NullableInt32Assertions(actualValue); } @@ -556,7 +557,7 @@ public static NumericAssertions Should(this uint actualValue) /// current nullable . /// [Pure] - public static NullableNumericAssertions Should(this uint? actualValue) + public static NullableNumericAssertions Should([NotNull] this uint? actualValue) { return new NullableUInt32Assertions(actualValue); } @@ -576,7 +577,7 @@ public static NumericAssertions Should(this decimal actualValue) /// current nullable . /// [Pure] - public static NullableNumericAssertions Should(this decimal? actualValue) + public static NullableNumericAssertions Should([NotNull] this decimal? actualValue) { return new NullableDecimalAssertions(actualValue); } @@ -596,7 +597,7 @@ public static NumericAssertions Should(this byte actualValue) /// current nullable . /// [Pure] - public static NullableNumericAssertions Should(this byte? actualValue) + public static NullableNumericAssertions Should([NotNull] this byte? actualValue) { return new NullableByteAssertions(actualValue); } @@ -616,7 +617,7 @@ public static NumericAssertions Should(this sbyte actualValue) /// current nullable . /// [Pure] - public static NullableNumericAssertions Should(this sbyte? actualValue) + public static NullableNumericAssertions Should([NotNull] this sbyte? actualValue) { return new NullableSByteAssertions(actualValue); } @@ -636,7 +637,7 @@ public static NumericAssertions Should(this short actualValue) /// current nullable . /// [Pure] - public static NullableNumericAssertions Should(this short? actualValue) + public static NullableNumericAssertions Should([NotNull] this short? actualValue) { return new NullableInt16Assertions(actualValue); } @@ -656,7 +657,7 @@ public static NumericAssertions Should(this ushort actualValue) /// current nullable . /// [Pure] - public static NullableNumericAssertions Should(this ushort? actualValue) + public static NullableNumericAssertions Should([NotNull] this ushort? actualValue) { return new NullableUInt16Assertions(actualValue); } @@ -676,7 +677,7 @@ public static NumericAssertions Should(this long actualValue) /// current nullable . /// [Pure] - public static NullableNumericAssertions Should(this long? actualValue) + public static NullableNumericAssertions Should([NotNull] this long? actualValue) { return new NullableInt64Assertions(actualValue); } @@ -696,7 +697,7 @@ public static NumericAssertions Should(this ulong actualValue) /// current nullable . /// [Pure] - public static NullableNumericAssertions Should(this ulong? actualValue) + public static NullableNumericAssertions Should([NotNull] this ulong? actualValue) { return new NullableUInt64Assertions(actualValue); } @@ -716,7 +717,7 @@ public static NumericAssertions Should(this float actualValue) /// current nullable . /// [Pure] - public static NullableNumericAssertions Should(this float? actualValue) + public static NullableNumericAssertions Should([NotNull] this float? actualValue) { return new NullableSingleAssertions(actualValue); } @@ -736,7 +737,7 @@ public static NumericAssertions Should(this double actualValue) /// current nullable . /// [Pure] - public static NullableNumericAssertions Should(this double? actualValue) + public static NullableNumericAssertions Should([NotNull] this double? actualValue) { return new NullableDoubleAssertions(actualValue); } @@ -746,7 +747,7 @@ public static NullableNumericAssertions Should(this double? actualValue) /// current . /// [Pure] - public static StringAssertions Should(this string actualValue) + public static StringAssertions Should([NotNull] this string actualValue) { return new StringAssertions(actualValue); } @@ -766,7 +767,7 @@ public static SimpleTimeSpanAssertions Should(this TimeSpan actualValue) /// current nullable . /// [Pure] - public static NullableSimpleTimeSpanAssertions Should(this TimeSpan? actualValue) + public static NullableSimpleTimeSpanAssertions Should([NotNull] this TimeSpan? actualValue) { return new NullableSimpleTimeSpanAssertions(actualValue); } @@ -776,7 +777,7 @@ public static NullableSimpleTimeSpanAssertions Should(this TimeSpan? actualValue /// current . /// [Pure] - public static TypeAssertions Should(this Type subject) + public static TypeAssertions Should([NotNull] this Type subject) { return new TypeAssertions(subject); } @@ -800,7 +801,7 @@ public static TypeSelectorAssertions Should(this TypeSelector typeSelector) /// /// [Pure] - public static ConstructorInfoAssertions Should(this ConstructorInfo constructorInfo) + public static ConstructorInfoAssertions Should([NotNull] this ConstructorInfo constructorInfo) { return new ConstructorInfoAssertions(constructorInfo); } @@ -810,7 +811,7 @@ public static ConstructorInfoAssertions Should(this ConstructorInfo constructorI /// /// [Pure] - public static MethodInfoAssertions Should(this MethodInfo methodInfo) + public static MethodInfoAssertions Should([NotNull] this MethodInfo methodInfo) { return new MethodInfoAssertions(methodInfo); } @@ -835,7 +836,7 @@ public static MethodInfoSelectorAssertions Should(this MethodInfoSelector method /// /// [Pure] - public static PropertyInfoAssertions Should(this PropertyInfo propertyInfo) + public static PropertyInfoAssertions Should([NotNull] this PropertyInfo propertyInfo) { return new PropertyInfoAssertions(propertyInfo); } @@ -859,7 +860,7 @@ public static PropertyInfoSelectorAssertions Should(this PropertyInfoSelector pr /// current . /// [Pure] - public static ActionAssertions Should(this Action action) + public static ActionAssertions Should([NotNull] this Action action) { return new ActionAssertions(action, Extractor); } @@ -869,7 +870,7 @@ public static ActionAssertions Should(this Action action) /// current . /// [Pure] - public static NonGenericAsyncFunctionAssertions Should(this Func action) + public static NonGenericAsyncFunctionAssertions Should([NotNull] this Func action) { return new NonGenericAsyncFunctionAssertions(action, Extractor); } @@ -879,7 +880,7 @@ public static NonGenericAsyncFunctionAssertions Should(this Func action) /// current System.Func{Task{T}}. /// [Pure] - public static GenericAsyncFunctionAssertions Should(this Func> action) + public static GenericAsyncFunctionAssertions Should([NotNull] this Func> action) { return new GenericAsyncFunctionAssertions(action, Extractor); } @@ -889,7 +890,7 @@ public static GenericAsyncFunctionAssertions Should(this Func> act /// current . /// [Pure] - public static FunctionAssertions Should(this Func func) + public static FunctionAssertions Should([NotNull] this Func func) { return new FunctionAssertions(func, Extractor); } diff --git a/Src/FluentAssertions/DataRowAssertionExtensions.cs b/Src/FluentAssertions/DataRowAssertionExtensions.cs index b48db92509..eba15937e8 100644 --- a/Src/FluentAssertions/DataRowAssertionExtensions.cs +++ b/Src/FluentAssertions/DataRowAssertionExtensions.cs @@ -16,7 +16,7 @@ public static class DataRowAssertionExtensions /// current . /// [Pure] - public static DataRowAssertions Should(this TDataRow actualValue) + public static DataRowAssertions Should([System.Diagnostics.CodeAnalysis.NotNullAttribute] this TDataRow actualValue) where TDataRow : DataRow { return new DataRowAssertions(actualValue); diff --git a/Src/FluentAssertions/DataSetAssertionExtensions.cs b/Src/FluentAssertions/DataSetAssertionExtensions.cs index e993ddf88b..0afdeed8cd 100644 --- a/Src/FluentAssertions/DataSetAssertionExtensions.cs +++ b/Src/FluentAssertions/DataSetAssertionExtensions.cs @@ -16,7 +16,7 @@ public static class DataSetAssertionExtensions /// current . /// [Pure] - public static DataSetAssertions Should(this TDataSet actualValue) + public static DataSetAssertions Should([System.Diagnostics.CodeAnalysis.NotNullAttribute] this TDataSet actualValue) where TDataSet : DataSet { return new DataSetAssertions(actualValue); diff --git a/Src/FluentAssertions/DataTableAssertionExtensions.cs b/Src/FluentAssertions/DataTableAssertionExtensions.cs index ee7ea0e191..e2687ba51b 100644 --- a/Src/FluentAssertions/DataTableAssertionExtensions.cs +++ b/Src/FluentAssertions/DataTableAssertionExtensions.cs @@ -16,7 +16,7 @@ public static class DataTableAssertionExtensions /// current . /// [Pure] - public static DataTableAssertions Should(this TDataTable actualValue) + public static DataTableAssertions Should([System.Diagnostics.CodeAnalysis.NotNullAttribute] this TDataTable actualValue) where TDataTable : DataTable { return new DataTableAssertions(actualValue); diff --git a/Src/FluentAssertions/EnumAssertionsExtensions.cs b/Src/FluentAssertions/EnumAssertionsExtensions.cs index 31688fb9cc..fa447a7d1f 100644 --- a/Src/FluentAssertions/EnumAssertionsExtensions.cs +++ b/Src/FluentAssertions/EnumAssertionsExtensions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Contracts; using FluentAssertions.Primitives; @@ -27,7 +28,7 @@ public static EnumAssertions Should(this TEnum @enum) /// current . /// [Pure] - public static NullableEnumAssertions Should(this TEnum? @enum) + public static NullableEnumAssertions Should([NotNull] this TEnum? @enum) where TEnum : struct, Enum { return new NullableEnumAssertions(@enum); diff --git a/Src/FluentAssertions/Xml/XmlAssertionExtensions.cs b/Src/FluentAssertions/Xml/XmlAssertionExtensions.cs index 771bd359be..2db9562915 100644 --- a/Src/FluentAssertions/Xml/XmlAssertionExtensions.cs +++ b/Src/FluentAssertions/Xml/XmlAssertionExtensions.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Xml; using FluentAssertions.Xml; @@ -7,12 +8,12 @@ namespace FluentAssertions; [DebuggerNonUserCode] public static class XmlAssertionExtensions { - public static XmlNodeAssertions Should(this XmlNode actualValue) + public static XmlNodeAssertions Should([NotNull] this XmlNode actualValue) { return new XmlNodeAssertions(actualValue); } - public static XmlElementAssertions Should(this XmlElement actualValue) + public static XmlElementAssertions Should([NotNull] this XmlElement actualValue) { return new XmlElementAssertions(actualValue); } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 021b98ac14..982d423d22 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -57,58 +57,58 @@ namespace FluentAssertions [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } - public static FluentAssertions.Specialized.ActionAssertions Should(this System.Action action) { } - public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Collections.Generic.IEnumerable @this) { } - public static FluentAssertions.Data.DataColumnAssertions Should(this System.Data.DataColumn actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataColumnCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataRowCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataTableCollection actualValue) { } + public static FluentAssertions.Specialized.ActionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Action action) { } + public static FluentAssertions.Collections.StringCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable @this) { } + public static FluentAssertions.Data.DataColumnAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Data.DataColumn actualValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Data.DataColumnCollection actualValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Data.DataRowCollection actualValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Data.DataTableCollection actualValue) { } public static FluentAssertions.Primitives.DateTimeAssertions Should(this System.DateTime actualValue) { } - public static FluentAssertions.Primitives.NullableDateTimeAssertions Should(this System.DateTime? actualValue) { } + public static FluentAssertions.Primitives.NullableDateTimeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.DateTime? actualValue) { } public static FluentAssertions.Primitives.DateTimeOffsetAssertions Should(this System.DateTimeOffset actualValue) { } - public static FluentAssertions.Primitives.NullableDateTimeOffsetAssertions Should(this System.DateTimeOffset? actualValue) { } - public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should(this System.Func action) { } + public static FluentAssertions.Primitives.NullableDateTimeOffsetAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.DateTimeOffset? actualValue) { } + public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func action) { } public static FluentAssertions.Primitives.GuidAssertions Should(this System.Guid actualValue) { } - public static FluentAssertions.Primitives.NullableGuidAssertions Should(this System.Guid? actualValue) { } - public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } - public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } - public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Reflection.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } - public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } - public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } - public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } + public static FluentAssertions.Primitives.NullableGuidAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Guid? actualValue) { } + public static FluentAssertions.Streams.BufferedStreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.BufferedStream actualValue) { } + public static FluentAssertions.Streams.StreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.Stream actualValue) { } + public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Net.Http.HttpResponseMessage actualValue) { } + public static FluentAssertions.Reflection.AssemblyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.Assembly assembly) { } + public static FluentAssertions.Types.ConstructorInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.ConstructorInfo constructorInfo) { } + public static FluentAssertions.Types.MethodInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.MethodInfo methodInfo) { } + public static FluentAssertions.Types.PropertyInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.PropertyInfo propertyInfo) { } public static FluentAssertions.Primitives.SimpleTimeSpanAssertions Should(this System.TimeSpan actualValue) { } - public static FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions Should(this System.TimeSpan? actualValue) { } - public static FluentAssertions.Types.TypeAssertions Should(this System.Type subject) { } - public static FluentAssertions.Xml.XAttributeAssertions Should(this System.Xml.Linq.XAttribute actualValue) { } - public static FluentAssertions.Xml.XDocumentAssertions Should(this System.Xml.Linq.XDocument actualValue) { } - public static FluentAssertions.Xml.XElementAssertions Should(this System.Xml.Linq.XElement actualValue) { } + public static FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.TimeSpan? actualValue) { } + public static FluentAssertions.Types.TypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Type subject) { } + public static FluentAssertions.Xml.XAttributeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XAttribute actualValue) { } + public static FluentAssertions.Xml.XDocumentAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XDocument actualValue) { } + public static FluentAssertions.Xml.XElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XElement actualValue) { } public static FluentAssertions.Primitives.BooleanAssertions Should(this bool actualValue) { } - public static FluentAssertions.Primitives.NullableBooleanAssertions Should(this bool? actualValue) { } + public static FluentAssertions.Primitives.NullableBooleanAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this bool? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this byte actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this byte? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this byte? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this decimal actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this decimal? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this decimal? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this double actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this double? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this double? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this float actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this float? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this float? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this int actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this int? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this int? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this long actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this long? actualValue) { } - public static FluentAssertions.Primitives.ObjectAssertions Should(this object actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this long? actualValue) { } + public static FluentAssertions.Primitives.ObjectAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this object actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this sbyte actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this sbyte? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this sbyte? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this short actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this short? actualValue) { } - public static FluentAssertions.Primitives.StringAssertions Should(this string actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this short? actualValue) { } + public static FluentAssertions.Primitives.StringAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this string actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this uint actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this uint? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this uint? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this ulong actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ulong? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this ulong? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this ushort actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ushort? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this ushort? actualValue) { } [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.BooleanAssertions _) @@ -137,10 +137,10 @@ namespace FluentAssertions "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.SimpleTimeSpanAssertions _) where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Collections.Generic.IEnumerable actualValue) { } - public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should(this System.Func> action) { } - public static FluentAssertions.Specialized.FunctionAssertions Should(this System.Func func) { } - public static FluentAssertions.Numeric.ComparableTypeAssertions Should(this System.IComparable comparableValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable actualValue) { } + public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func> action) { } + public static FluentAssertions.Specialized.FunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func func) { } + public static FluentAssertions.Numeric.ComparableTypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IComparable comparableValue) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'"), true)] @@ -156,9 +156,9 @@ namespace FluentAssertions "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.ReferenceTypeAssertions _) where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { } - public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should(this System.Collections.Generic.IDictionary actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should(this System.Collections.Generic.IEnumerable> actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions Should(this TCollection actualValue) + public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IDictionary actualValue) { } + public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable> actualValue) { } + public static FluentAssertions.Collections.GenericDictionaryAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TCollection actualValue) where TCollection : System.Collections.Generic.IEnumerable> { } } public static class AssertionOptions @@ -206,7 +206,7 @@ namespace FluentAssertions } public static class DataRowAssertionExtensions { - public static FluentAssertions.Data.DataRowAssertions Should(this TDataRow actualValue) + public static FluentAssertions.Data.DataRowAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TDataRow actualValue) where TDataRow : System.Data.DataRow { } } public static class DataRowCollectionAssertionExtensions @@ -218,12 +218,12 @@ namespace FluentAssertions } public static class DataSetAssertionExtensions { - public static FluentAssertions.Data.DataSetAssertions Should(this TDataSet actualValue) + public static FluentAssertions.Data.DataSetAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TDataSet actualValue) where TDataSet : System.Data.DataSet { } } public static class DataTableAssertionExtensions { - public static FluentAssertions.Data.DataTableAssertions Should(this TDataTable actualValue) + public static FluentAssertions.Data.DataTableAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TDataTable actualValue) where TDataTable : System.Data.DataTable { } } public static class DataTableCollectionAssertionExtensions @@ -239,7 +239,7 @@ namespace FluentAssertions { public static FluentAssertions.Primitives.EnumAssertions Should(this TEnum @enum) where TEnum : struct, System.Enum { } - public static FluentAssertions.Primitives.NullableEnumAssertions Should(this TEnum? @enum) + public static FluentAssertions.Primitives.NullableEnumAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TEnum? @enum) where TEnum : struct, System.Enum { } } public class EquivalencyPlan : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable @@ -398,8 +398,8 @@ namespace FluentAssertions } public static class XmlAssertionExtensions { - public static FluentAssertions.Xml.XmlElementAssertions Should(this System.Xml.XmlElement actualValue) { } - public static FluentAssertions.Xml.XmlNodeAssertions Should(this System.Xml.XmlNode actualValue) { } + public static FluentAssertions.Xml.XmlElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlElement actualValue) { } + public static FluentAssertions.Xml.XmlNodeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlNode actualValue) { } } } namespace FluentAssertions.Collections diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 4f53076eae..c980fab663 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -57,63 +57,63 @@ namespace FluentAssertions [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } - public static FluentAssertions.Specialized.ActionAssertions Should(this System.Action action) { } - public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Collections.Generic.IEnumerable @this) { } - public static FluentAssertions.Data.DataColumnAssertions Should(this System.Data.DataColumn actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataColumnCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataRowCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataTableCollection actualValue) { } + public static FluentAssertions.Specialized.ActionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Action action) { } + public static FluentAssertions.Collections.StringCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable @this) { } + public static FluentAssertions.Data.DataColumnAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Data.DataColumn actualValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Data.DataColumnCollection actualValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Data.DataRowCollection actualValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Data.DataTableCollection actualValue) { } public static FluentAssertions.Primitives.DateOnlyAssertions Should(this System.DateOnly actualValue) { } - public static FluentAssertions.Primitives.NullableDateOnlyAssertions Should(this System.DateOnly? actualValue) { } + public static FluentAssertions.Primitives.NullableDateOnlyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.DateOnly? actualValue) { } public static FluentAssertions.Primitives.DateTimeAssertions Should(this System.DateTime actualValue) { } - public static FluentAssertions.Primitives.NullableDateTimeAssertions Should(this System.DateTime? actualValue) { } + public static FluentAssertions.Primitives.NullableDateTimeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.DateTime? actualValue) { } public static FluentAssertions.Primitives.DateTimeOffsetAssertions Should(this System.DateTimeOffset actualValue) { } - public static FluentAssertions.Primitives.NullableDateTimeOffsetAssertions Should(this System.DateTimeOffset? actualValue) { } - public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should(this System.Func action) { } + public static FluentAssertions.Primitives.NullableDateTimeOffsetAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.DateTimeOffset? actualValue) { } + public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func action) { } public static FluentAssertions.Primitives.GuidAssertions Should(this System.Guid actualValue) { } - public static FluentAssertions.Primitives.NullableGuidAssertions Should(this System.Guid? actualValue) { } - public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } - public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } - public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Reflection.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } - public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } - public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } - public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } + public static FluentAssertions.Primitives.NullableGuidAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Guid? actualValue) { } + public static FluentAssertions.Streams.BufferedStreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.BufferedStream actualValue) { } + public static FluentAssertions.Streams.StreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.Stream actualValue) { } + public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Net.Http.HttpResponseMessage actualValue) { } + public static FluentAssertions.Reflection.AssemblyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.Assembly assembly) { } + public static FluentAssertions.Types.ConstructorInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.ConstructorInfo constructorInfo) { } + public static FluentAssertions.Types.MethodInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.MethodInfo methodInfo) { } + public static FluentAssertions.Types.PropertyInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.PropertyInfo propertyInfo) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } public static FluentAssertions.Primitives.TimeOnlyAssertions Should(this System.TimeOnly actualValue) { } - public static FluentAssertions.Primitives.NullableTimeOnlyAssertions Should(this System.TimeOnly? actualValue) { } + public static FluentAssertions.Primitives.NullableTimeOnlyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.TimeOnly? actualValue) { } public static FluentAssertions.Primitives.SimpleTimeSpanAssertions Should(this System.TimeSpan actualValue) { } - public static FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions Should(this System.TimeSpan? actualValue) { } - public static FluentAssertions.Types.TypeAssertions Should(this System.Type subject) { } - public static FluentAssertions.Xml.XAttributeAssertions Should(this System.Xml.Linq.XAttribute actualValue) { } - public static FluentAssertions.Xml.XDocumentAssertions Should(this System.Xml.Linq.XDocument actualValue) { } - public static FluentAssertions.Xml.XElementAssertions Should(this System.Xml.Linq.XElement actualValue) { } + public static FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.TimeSpan? actualValue) { } + public static FluentAssertions.Types.TypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Type subject) { } + public static FluentAssertions.Xml.XAttributeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XAttribute actualValue) { } + public static FluentAssertions.Xml.XDocumentAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XDocument actualValue) { } + public static FluentAssertions.Xml.XElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XElement actualValue) { } public static FluentAssertions.Primitives.BooleanAssertions Should(this bool actualValue) { } - public static FluentAssertions.Primitives.NullableBooleanAssertions Should(this bool? actualValue) { } + public static FluentAssertions.Primitives.NullableBooleanAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this bool? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this byte actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this byte? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this byte? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this decimal actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this decimal? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this decimal? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this double actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this double? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this double? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this float actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this float? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this float? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this int actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this int? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this int? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this long actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this long? actualValue) { } - public static FluentAssertions.Primitives.ObjectAssertions Should(this object actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this long? actualValue) { } + public static FluentAssertions.Primitives.ObjectAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this object actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this sbyte actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this sbyte? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this sbyte? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this short actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this short? actualValue) { } - public static FluentAssertions.Primitives.StringAssertions Should(this string actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this short? actualValue) { } + public static FluentAssertions.Primitives.StringAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this string actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this uint actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this uint? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this uint? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this ulong actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ulong? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this ulong? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this ushort actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ushort? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this ushort? actualValue) { } [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.BooleanAssertions _) @@ -150,10 +150,10 @@ namespace FluentAssertions "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.TimeOnlyAssertions _) where TAssertions : FluentAssertions.Primitives.TimeOnlyAssertions { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Collections.Generic.IEnumerable actualValue) { } - public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should(this System.Func> action) { } - public static FluentAssertions.Specialized.FunctionAssertions Should(this System.Func func) { } - public static FluentAssertions.Numeric.ComparableTypeAssertions Should(this System.IComparable comparableValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable actualValue) { } + public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func> action) { } + public static FluentAssertions.Specialized.FunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func func) { } + public static FluentAssertions.Numeric.ComparableTypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IComparable comparableValue) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'"), true)] @@ -169,9 +169,9 @@ namespace FluentAssertions "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.ReferenceTypeAssertions _) where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { } - public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should(this System.Collections.Generic.IDictionary actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should(this System.Collections.Generic.IEnumerable> actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions Should(this TCollection actualValue) + public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IDictionary actualValue) { } + public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable> actualValue) { } + public static FluentAssertions.Collections.GenericDictionaryAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TCollection actualValue) where TCollection : System.Collections.Generic.IEnumerable> { } } public static class AssertionOptions @@ -219,7 +219,7 @@ namespace FluentAssertions } public static class DataRowAssertionExtensions { - public static FluentAssertions.Data.DataRowAssertions Should(this TDataRow actualValue) + public static FluentAssertions.Data.DataRowAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TDataRow actualValue) where TDataRow : System.Data.DataRow { } } public static class DataRowCollectionAssertionExtensions @@ -231,12 +231,12 @@ namespace FluentAssertions } public static class DataSetAssertionExtensions { - public static FluentAssertions.Data.DataSetAssertions Should(this TDataSet actualValue) + public static FluentAssertions.Data.DataSetAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TDataSet actualValue) where TDataSet : System.Data.DataSet { } } public static class DataTableAssertionExtensions { - public static FluentAssertions.Data.DataTableAssertions Should(this TDataTable actualValue) + public static FluentAssertions.Data.DataTableAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TDataTable actualValue) where TDataTable : System.Data.DataTable { } } public static class DataTableCollectionAssertionExtensions @@ -252,7 +252,7 @@ namespace FluentAssertions { public static FluentAssertions.Primitives.EnumAssertions Should(this TEnum @enum) where TEnum : struct, System.Enum { } - public static FluentAssertions.Primitives.NullableEnumAssertions Should(this TEnum? @enum) + public static FluentAssertions.Primitives.NullableEnumAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TEnum? @enum) where TEnum : struct, System.Enum { } } public class EquivalencyPlan : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable @@ -411,8 +411,8 @@ namespace FluentAssertions } public static class XmlAssertionExtensions { - public static FluentAssertions.Xml.XmlElementAssertions Should(this System.Xml.XmlElement actualValue) { } - public static FluentAssertions.Xml.XmlNodeAssertions Should(this System.Xml.XmlNode actualValue) { } + public static FluentAssertions.Xml.XmlElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlElement actualValue) { } + public static FluentAssertions.Xml.XmlNodeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlNode actualValue) { } } } namespace FluentAssertions.Collections diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 65a643089c..e0d61489e4 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -56,58 +56,58 @@ namespace FluentAssertions [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } - public static FluentAssertions.Specialized.ActionAssertions Should(this System.Action action) { } - public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Collections.Generic.IEnumerable @this) { } - public static FluentAssertions.Data.DataColumnAssertions Should(this System.Data.DataColumn actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataColumnCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataRowCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataTableCollection actualValue) { } + public static FluentAssertions.Specialized.ActionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Action action) { } + public static FluentAssertions.Collections.StringCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable @this) { } + public static FluentAssertions.Data.DataColumnAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Data.DataColumn actualValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Data.DataColumnCollection actualValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Data.DataRowCollection actualValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Data.DataTableCollection actualValue) { } public static FluentAssertions.Primitives.DateTimeAssertions Should(this System.DateTime actualValue) { } - public static FluentAssertions.Primitives.NullableDateTimeAssertions Should(this System.DateTime? actualValue) { } + public static FluentAssertions.Primitives.NullableDateTimeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.DateTime? actualValue) { } public static FluentAssertions.Primitives.DateTimeOffsetAssertions Should(this System.DateTimeOffset actualValue) { } - public static FluentAssertions.Primitives.NullableDateTimeOffsetAssertions Should(this System.DateTimeOffset? actualValue) { } - public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should(this System.Func action) { } + public static FluentAssertions.Primitives.NullableDateTimeOffsetAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.DateTimeOffset? actualValue) { } + public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func action) { } public static FluentAssertions.Primitives.GuidAssertions Should(this System.Guid actualValue) { } - public static FluentAssertions.Primitives.NullableGuidAssertions Should(this System.Guid? actualValue) { } - public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } - public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } - public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Reflection.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } - public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } - public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } - public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } + public static FluentAssertions.Primitives.NullableGuidAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Guid? actualValue) { } + public static FluentAssertions.Streams.BufferedStreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.BufferedStream actualValue) { } + public static FluentAssertions.Streams.StreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.Stream actualValue) { } + public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Net.Http.HttpResponseMessage actualValue) { } + public static FluentAssertions.Reflection.AssemblyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.Assembly assembly) { } + public static FluentAssertions.Types.ConstructorInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.ConstructorInfo constructorInfo) { } + public static FluentAssertions.Types.MethodInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.MethodInfo methodInfo) { } + public static FluentAssertions.Types.PropertyInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.PropertyInfo propertyInfo) { } public static FluentAssertions.Primitives.SimpleTimeSpanAssertions Should(this System.TimeSpan actualValue) { } - public static FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions Should(this System.TimeSpan? actualValue) { } - public static FluentAssertions.Types.TypeAssertions Should(this System.Type subject) { } - public static FluentAssertions.Xml.XAttributeAssertions Should(this System.Xml.Linq.XAttribute actualValue) { } - public static FluentAssertions.Xml.XDocumentAssertions Should(this System.Xml.Linq.XDocument actualValue) { } - public static FluentAssertions.Xml.XElementAssertions Should(this System.Xml.Linq.XElement actualValue) { } + public static FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.TimeSpan? actualValue) { } + public static FluentAssertions.Types.TypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Type subject) { } + public static FluentAssertions.Xml.XAttributeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XAttribute actualValue) { } + public static FluentAssertions.Xml.XDocumentAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XDocument actualValue) { } + public static FluentAssertions.Xml.XElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XElement actualValue) { } public static FluentAssertions.Primitives.BooleanAssertions Should(this bool actualValue) { } - public static FluentAssertions.Primitives.NullableBooleanAssertions Should(this bool? actualValue) { } + public static FluentAssertions.Primitives.NullableBooleanAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this bool? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this byte actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this byte? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this byte? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this decimal actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this decimal? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this decimal? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this double actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this double? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this double? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this float actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this float? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this float? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this int actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this int? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this int? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this long actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this long? actualValue) { } - public static FluentAssertions.Primitives.ObjectAssertions Should(this object actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this long? actualValue) { } + public static FluentAssertions.Primitives.ObjectAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this object actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this sbyte actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this sbyte? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this sbyte? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this short actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this short? actualValue) { } - public static FluentAssertions.Primitives.StringAssertions Should(this string actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this short? actualValue) { } + public static FluentAssertions.Primitives.StringAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this string actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this uint actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this uint? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this uint? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this ulong actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ulong? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this ulong? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this ushort actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ushort? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this ushort? actualValue) { } [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.BooleanAssertions _) @@ -136,10 +136,10 @@ namespace FluentAssertions "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.SimpleTimeSpanAssertions _) where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Collections.Generic.IEnumerable actualValue) { } - public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should(this System.Func> action) { } - public static FluentAssertions.Specialized.FunctionAssertions Should(this System.Func func) { } - public static FluentAssertions.Numeric.ComparableTypeAssertions Should(this System.IComparable comparableValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable actualValue) { } + public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func> action) { } + public static FluentAssertions.Specialized.FunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func func) { } + public static FluentAssertions.Numeric.ComparableTypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IComparable comparableValue) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'"), true)] @@ -155,9 +155,9 @@ namespace FluentAssertions "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.ReferenceTypeAssertions _) where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { } - public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should(this System.Collections.Generic.IDictionary actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should(this System.Collections.Generic.IEnumerable> actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions Should(this TCollection actualValue) + public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IDictionary actualValue) { } + public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable> actualValue) { } + public static FluentAssertions.Collections.GenericDictionaryAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TCollection actualValue) where TCollection : System.Collections.Generic.IEnumerable> { } } public static class AssertionOptions @@ -205,7 +205,7 @@ namespace FluentAssertions } public static class DataRowAssertionExtensions { - public static FluentAssertions.Data.DataRowAssertions Should(this TDataRow actualValue) + public static FluentAssertions.Data.DataRowAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TDataRow actualValue) where TDataRow : System.Data.DataRow { } } public static class DataRowCollectionAssertionExtensions @@ -217,12 +217,12 @@ namespace FluentAssertions } public static class DataSetAssertionExtensions { - public static FluentAssertions.Data.DataSetAssertions Should(this TDataSet actualValue) + public static FluentAssertions.Data.DataSetAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TDataSet actualValue) where TDataSet : System.Data.DataSet { } } public static class DataTableAssertionExtensions { - public static FluentAssertions.Data.DataTableAssertions Should(this TDataTable actualValue) + public static FluentAssertions.Data.DataTableAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TDataTable actualValue) where TDataTable : System.Data.DataTable { } } public static class DataTableCollectionAssertionExtensions @@ -238,7 +238,7 @@ namespace FluentAssertions { public static FluentAssertions.Primitives.EnumAssertions Should(this TEnum @enum) where TEnum : struct, System.Enum { } - public static FluentAssertions.Primitives.NullableEnumAssertions Should(this TEnum? @enum) + public static FluentAssertions.Primitives.NullableEnumAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TEnum? @enum) where TEnum : struct, System.Enum { } } public class EquivalencyPlan : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable @@ -391,8 +391,8 @@ namespace FluentAssertions } public static class XmlAssertionExtensions { - public static FluentAssertions.Xml.XmlElementAssertions Should(this System.Xml.XmlElement actualValue) { } - public static FluentAssertions.Xml.XmlNodeAssertions Should(this System.Xml.XmlNode actualValue) { } + public static FluentAssertions.Xml.XmlElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlElement actualValue) { } + public static FluentAssertions.Xml.XmlNodeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlNode actualValue) { } } } namespace FluentAssertions.Collections diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index a225ab0c10..ae31cb0aa9 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -57,58 +57,58 @@ namespace FluentAssertions [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Types.TypeSelectorAssertions _) { } - public static FluentAssertions.Specialized.ActionAssertions Should(this System.Action action) { } - public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Collections.Generic.IEnumerable @this) { } - public static FluentAssertions.Data.DataColumnAssertions Should(this System.Data.DataColumn actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataColumnCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataRowCollection actualValue) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Data.DataTableCollection actualValue) { } + public static FluentAssertions.Specialized.ActionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Action action) { } + public static FluentAssertions.Collections.StringCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable @this) { } + public static FluentAssertions.Data.DataColumnAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Data.DataColumn actualValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Data.DataColumnCollection actualValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Data.DataRowCollection actualValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Data.DataTableCollection actualValue) { } public static FluentAssertions.Primitives.DateTimeAssertions Should(this System.DateTime actualValue) { } - public static FluentAssertions.Primitives.NullableDateTimeAssertions Should(this System.DateTime? actualValue) { } + public static FluentAssertions.Primitives.NullableDateTimeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.DateTime? actualValue) { } public static FluentAssertions.Primitives.DateTimeOffsetAssertions Should(this System.DateTimeOffset actualValue) { } - public static FluentAssertions.Primitives.NullableDateTimeOffsetAssertions Should(this System.DateTimeOffset? actualValue) { } - public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should(this System.Func action) { } + public static FluentAssertions.Primitives.NullableDateTimeOffsetAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.DateTimeOffset? actualValue) { } + public static FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func action) { } public static FluentAssertions.Primitives.GuidAssertions Should(this System.Guid actualValue) { } - public static FluentAssertions.Primitives.NullableGuidAssertions Should(this System.Guid? actualValue) { } - public static FluentAssertions.Streams.BufferedStreamAssertions Should(this System.IO.BufferedStream actualValue) { } - public static FluentAssertions.Streams.StreamAssertions Should(this System.IO.Stream actualValue) { } - public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should(this System.Net.Http.HttpResponseMessage actualValue) { } - public static FluentAssertions.Reflection.AssemblyAssertions Should(this System.Reflection.Assembly assembly) { } - public static FluentAssertions.Types.ConstructorInfoAssertions Should(this System.Reflection.ConstructorInfo constructorInfo) { } - public static FluentAssertions.Types.MethodInfoAssertions Should(this System.Reflection.MethodInfo methodInfo) { } - public static FluentAssertions.Types.PropertyInfoAssertions Should(this System.Reflection.PropertyInfo propertyInfo) { } + public static FluentAssertions.Primitives.NullableGuidAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Guid? actualValue) { } + public static FluentAssertions.Streams.BufferedStreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.BufferedStream actualValue) { } + public static FluentAssertions.Streams.StreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.Stream actualValue) { } + public static FluentAssertions.Primitives.HttpResponseMessageAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Net.Http.HttpResponseMessage actualValue) { } + public static FluentAssertions.Reflection.AssemblyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.Assembly assembly) { } + public static FluentAssertions.Types.ConstructorInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.ConstructorInfo constructorInfo) { } + public static FluentAssertions.Types.MethodInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.MethodInfo methodInfo) { } + public static FluentAssertions.Types.PropertyInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.PropertyInfo propertyInfo) { } public static FluentAssertions.Primitives.SimpleTimeSpanAssertions Should(this System.TimeSpan actualValue) { } - public static FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions Should(this System.TimeSpan? actualValue) { } - public static FluentAssertions.Types.TypeAssertions Should(this System.Type subject) { } - public static FluentAssertions.Xml.XAttributeAssertions Should(this System.Xml.Linq.XAttribute actualValue) { } - public static FluentAssertions.Xml.XDocumentAssertions Should(this System.Xml.Linq.XDocument actualValue) { } - public static FluentAssertions.Xml.XElementAssertions Should(this System.Xml.Linq.XElement actualValue) { } + public static FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.TimeSpan? actualValue) { } + public static FluentAssertions.Types.TypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Type subject) { } + public static FluentAssertions.Xml.XAttributeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XAttribute actualValue) { } + public static FluentAssertions.Xml.XDocumentAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XDocument actualValue) { } + public static FluentAssertions.Xml.XElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.Linq.XElement actualValue) { } public static FluentAssertions.Primitives.BooleanAssertions Should(this bool actualValue) { } - public static FluentAssertions.Primitives.NullableBooleanAssertions Should(this bool? actualValue) { } + public static FluentAssertions.Primitives.NullableBooleanAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this bool? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this byte actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this byte? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this byte? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this decimal actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this decimal? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this decimal? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this double actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this double? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this double? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this float actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this float? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this float? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this int actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this int? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this int? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this long actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this long? actualValue) { } - public static FluentAssertions.Primitives.ObjectAssertions Should(this object actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this long? actualValue) { } + public static FluentAssertions.Primitives.ObjectAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this object actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this sbyte actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this sbyte? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this sbyte? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this short actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this short? actualValue) { } - public static FluentAssertions.Primitives.StringAssertions Should(this string actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this short? actualValue) { } + public static FluentAssertions.Primitives.StringAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this string actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this uint actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this uint? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this uint? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this ulong actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ulong? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this ulong? actualValue) { } public static FluentAssertions.Numeric.NumericAssertions Should(this ushort actualValue) { } - public static FluentAssertions.Numeric.NullableNumericAssertions Should(this ushort? actualValue) { } + public static FluentAssertions.Numeric.NullableNumericAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this ushort? actualValue) { } [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.BooleanAssertions _) @@ -137,10 +137,10 @@ namespace FluentAssertions "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.SimpleTimeSpanAssertions _) where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Collections.Generic.IEnumerable actualValue) { } - public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should(this System.Func> action) { } - public static FluentAssertions.Specialized.FunctionAssertions Should(this System.Func func) { } - public static FluentAssertions.Numeric.ComparableTypeAssertions Should(this System.IComparable comparableValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable actualValue) { } + public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func> action) { } + public static FluentAssertions.Specialized.FunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func func) { } + public static FluentAssertions.Numeric.ComparableTypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IComparable comparableValue) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } [System.Obsolete(("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'"), true)] @@ -156,9 +156,9 @@ namespace FluentAssertions "ly following \'And\'"), true)] public static void Should(this FluentAssertions.Primitives.ReferenceTypeAssertions _) where TAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { } - public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should(this System.Collections.Generic.IDictionary actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should(this System.Collections.Generic.IEnumerable> actualValue) { } - public static FluentAssertions.Collections.GenericDictionaryAssertions Should(this TCollection actualValue) + public static FluentAssertions.Collections.GenericDictionaryAssertions, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IDictionary actualValue) { } + public static FluentAssertions.Collections.GenericDictionaryAssertions>, TKey, TValue> Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Collections.Generic.IEnumerable> actualValue) { } + public static FluentAssertions.Collections.GenericDictionaryAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TCollection actualValue) where TCollection : System.Collections.Generic.IEnumerable> { } } public static class AssertionOptions @@ -206,7 +206,7 @@ namespace FluentAssertions } public static class DataRowAssertionExtensions { - public static FluentAssertions.Data.DataRowAssertions Should(this TDataRow actualValue) + public static FluentAssertions.Data.DataRowAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TDataRow actualValue) where TDataRow : System.Data.DataRow { } } public static class DataRowCollectionAssertionExtensions @@ -218,12 +218,12 @@ namespace FluentAssertions } public static class DataSetAssertionExtensions { - public static FluentAssertions.Data.DataSetAssertions Should(this TDataSet actualValue) + public static FluentAssertions.Data.DataSetAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TDataSet actualValue) where TDataSet : System.Data.DataSet { } } public static class DataTableAssertionExtensions { - public static FluentAssertions.Data.DataTableAssertions Should(this TDataTable actualValue) + public static FluentAssertions.Data.DataTableAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TDataTable actualValue) where TDataTable : System.Data.DataTable { } } public static class DataTableCollectionAssertionExtensions @@ -239,7 +239,7 @@ namespace FluentAssertions { public static FluentAssertions.Primitives.EnumAssertions Should(this TEnum @enum) where TEnum : struct, System.Enum { } - public static FluentAssertions.Primitives.NullableEnumAssertions Should(this TEnum? @enum) + public static FluentAssertions.Primitives.NullableEnumAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this TEnum? @enum) where TEnum : struct, System.Enum { } } public class EquivalencyPlan : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable @@ -398,8 +398,8 @@ namespace FluentAssertions } public static class XmlAssertionExtensions { - public static FluentAssertions.Xml.XmlElementAssertions Should(this System.Xml.XmlElement actualValue) { } - public static FluentAssertions.Xml.XmlNodeAssertions Should(this System.Xml.XmlNode actualValue) { } + public static FluentAssertions.Xml.XmlElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlElement actualValue) { } + public static FluentAssertions.Xml.XmlNodeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlNode actualValue) { } } } namespace FluentAssertions.Collections diff --git a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs index 0b71d3a8b4..93ca8882dd 100644 --- a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs @@ -1,5 +1,6 @@ -using System; +using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; using FluentAssertions.Common; @@ -157,6 +158,45 @@ public void Should_methods_have_a_matching_overload_to_guard_against_chaining_an "AssertionExtensions.cs should have a guard overload of Should calling InvalidShouldCall()"); } + [Theory] + [MemberData(nameof(GetShouldMethods), true)] + public void Should_methods_returning_reference_or_nullable_type_assertions_are_annotated_with_not_null_attribute(MethodInfo method) + { + var notNullAttribute = method.GetParameters().Single().GetCustomAttribute(); + notNullAttribute.Should().NotBeNull(); + } + + [Theory] + [MemberData(nameof(GetShouldMethods), false)] + public void Should_methods_not_returning_reference_or_nullable_type_assertions_are_not_annotated_with_not_null_attribute(MethodInfo method) + { + var notNullAttribute = method.GetParameters().Single().GetCustomAttribute(); + notNullAttribute.Should().BeNull(); + } + + public static IEnumerable GetShouldMethods(bool referenceOrNullableTypes) + { + return AllTypes.From(typeof(FluentAssertions.AssertionExtensions).Assembly) + .ThatAreClasses() + .ThatAreStatic() + .Where(t => t.IsPublic) + .SelectMany(t => t.GetMethods(BindingFlags.Static | BindingFlags.Public)) + .Where(m => m.Name == "Should" + && !IsGuardOverload(m) + && m.GetParameters().Length == 1 + && (referenceOrNullableTypes ? IsReferenceOrNullableTypeAssertion(m) : !IsReferenceOrNullableTypeAssertion(m))) + .Select(m => new object[] { m }); + } + + private static bool ReturnsReferenceTypeAssertions(MethodInfo m) => + m.ReturnType.IsAssignableToOpenGeneric(typeof(ReferenceTypeAssertions<,>)); + + private static bool IsNullableTypeAssertion(MethodInfo m) => + m.GetParameters()[0].ParameterType.IsAssignableToOpenGeneric(typeof(Nullable<>)); + + private static bool IsReferenceOrNullableTypeAssertion(MethodInfo m) => + ReturnsReferenceTypeAssertions(m) || IsNullableTypeAssertion(m); + private static bool IsGuardOverload(MethodInfo m) => m.ReturnType == typeof(void) && m.IsDefined(typeof(ObsoleteAttribute)); diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 80de6c94b7..48390c5c32 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,6 +7,11 @@ sidebar: nav: "sidebar" --- +## 7.2.0 + +### Improvements +* All `Should()` methods on reference types are now annotated with the `[NotNull]` attribute for a better Fluent Assertions experience when nullable reference types are enabled - [#2987](https://github.com/fluentassertions/fluentassertions/pull/2987) + ## 7.1.0 ### Improvements From e046cef96ec0cdd0a09458de4b2f109103944d89 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 1 Feb 2025 17:55:10 +0100 Subject: [PATCH 570/845] Move #2307 release notes to 7.2.0 --- docs/_pages/releases.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 48390c5c32..cf5f1a03f1 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -10,13 +10,12 @@ sidebar: ## 7.2.0 ### Improvements +* Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) * All `Should()` methods on reference types are now annotated with the `[NotNull]` attribute for a better Fluent Assertions experience when nullable reference types are enabled - [#2987](https://github.com/fluentassertions/fluentassertions/pull/2987) ## 7.1.0 ### Improvements -* Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) - * Added compatibility with xUnit.net v3 - [#2970](https://github.com/fluentassertions/fluentassertions/issues/2970) * Added support for throwing TUnit exceptions when using TUnit as your testing framework - [#2971](https://github.com/fluentassertions/fluentassertions/pull/2971) From e2e0ce2735eaf33f4b1fbc2cfee98984634f17a3 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Thu, 16 Nov 2023 11:24:51 +0100 Subject: [PATCH 571/845] Remove .NET Core 2.1.x and 3.1.x from build SDK setup (#2467) --- .github/workflows/build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2e842f562e..8ec57bde6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,8 +19,6 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | - 2.1.x - 3.1.x 6.0.x 7.0.x @@ -63,8 +61,6 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | - 2.1.x - 3.1.x 6.0.x 8.0.x From 17b5618538d85a4583a3506a538b78b0971963d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 09:20:39 +0200 Subject: [PATCH 572/845] Bump actions/checkout from 3 to 4 (#2333) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8ec57bde6f..5fd6b8ce7e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: DOTNET_NOLOGO: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -53,7 +53,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 From 8e051b3dcc56544e23ca90faa5b6f52ab56ec690 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 15:39:32 +0000 Subject: [PATCH 573/845] Bump actions/setup-dotnet from 3 to 4 Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 3 to 4. - [Release notes](https://github.com/actions/setup-dotnet/releases) - [Commits](https://github.com/actions/setup-dotnet/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-dotnet dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5fd6b8ce7e..52431e1d44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: fetch-depth: 0 - name: Setup .NET SDKs - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 6.0.x @@ -58,7 +58,7 @@ jobs: fetch-depth: 0 - name: Setup .NET SDKs - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 6.0.x From 1cc5fb08951fa48152006573506c1d68aae3ca01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 16:07:09 +0000 Subject: [PATCH 574/845] Bump actions/upload-artifact from 3 to 4 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 52431e1d44..661f8da345 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,7 @@ jobs: file: TestResults/reports/lcov.info - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: ./Artifacts/* only-unit-tests: From d05fd9dc2b433cd990aeecebc402190597c1df5b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:11:55 +0000 Subject: [PATCH 575/845] Bump andstor/file-existence-action from 2 to 3 Bumps [andstor/file-existence-action](https://github.com/andstor/file-existence-action) from 2 to 3. - [Release notes](https://github.com/andstor/file-existence-action/releases) - [Commits](https://github.com/andstor/file-existence-action/compare/v2...v3) --- updated-dependencies: - dependency-name: andstor/file-existence-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 661f8da345..06e708ee0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: - name: Check for 'lcov.info' existence id: check_files - uses: andstor/file-existence-action@v2 + uses: andstor/file-existence-action@v3 with: files: "TestResults/reports/lcov.info" From 49207d880f685ca89f7aa61e76e308af80fa7715 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:55:53 +0000 Subject: [PATCH 576/845] Bump cspell from 8.17.2 to 8.17.3 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.17.2 to 8.17.3. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.17.3/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 490 ++++++++++++++++++++++++++++------------------ package.json | 2 +- 2 files changed, 300 insertions(+), 192 deletions(-) diff --git a/package-lock.json b/package-lock.json index d4b8075c84..2d9c68502b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,31 +7,32 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.17.2" + "cspell": "^8.17.3" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.17.2.tgz", - "integrity": "sha512-t+DQtruJF2cYfXF5GC4F0O/PQR04hL5WH55R9oOaor5i7K8ejbw6+jex2LB0XbZFf3qBhXNSnMPuM3b/113LnA==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.17.3.tgz", + "integrity": "sha512-6uOF726o3JnExAUKM20OJJXZo+Qf9Jt64nkVwnVXx7Upqr5I9Pb1npYPEAIpUA03SnWYmKwUIqhAmkwrN+bLPA==", + "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.0", "@cspell/dict-al": "^1.1.0", "@cspell/dict-aws": "^4.0.9", "@cspell/dict-bash": "^4.2.0", - "@cspell/dict-companies": "^3.1.12", + "@cspell/dict-companies": "^3.1.13", "@cspell/dict-cpp": "^6.0.3", "@cspell/dict-cryptocurrencies": "^5.0.4", "@cspell/dict-csharp": "^4.0.6", "@cspell/dict-css": "^4.0.17", "@cspell/dict-dart": "^2.3.0", - "@cspell/dict-data-science": "^2.0.6", + "@cspell/dict-data-science": "^2.0.7", "@cspell/dict-django": "^4.1.4", "@cspell/dict-docker": "^1.1.12", "@cspell/dict-dotnet": "^5.0.9", "@cspell/dict-elixir": "^4.0.7", - "@cspell/dict-en_us": "^4.3.29", - "@cspell/dict-en-common-misspellings": "^2.0.8", + "@cspell/dict-en_us": "^4.3.30", + "@cspell/dict-en-common-misspellings": "^2.0.9", "@cspell/dict-en-gb": "1.1.33", "@cspell/dict-filetypes": "^3.0.10", "@cspell/dict-flutter": "^1.1.0", @@ -41,7 +42,7 @@ "@cspell/dict-gaming-terms": "^1.1.0", "@cspell/dict-git": "^3.0.4", "@cspell/dict-golang": "^6.0.18", - "@cspell/dict-google": "^1.0.5", + "@cspell/dict-google": "^1.0.8", "@cspell/dict-haskell": "^4.0.5", "@cspell/dict-html": "^4.0.11", "@cspell/dict-html-symbol-entities": "^4.0.3", @@ -56,17 +57,17 @@ "@cspell/dict-markdown": "^2.0.9", "@cspell/dict-monkeyc": "^1.0.10", "@cspell/dict-node": "^5.0.6", - "@cspell/dict-npm": "^5.1.22", + "@cspell/dict-npm": "^5.1.24", "@cspell/dict-php": "^4.0.14", "@cspell/dict-powershell": "^5.0.14", - "@cspell/dict-public-licenses": "^2.0.12", - "@cspell/dict-python": "^4.2.14", + "@cspell/dict-public-licenses": "^2.0.13", + "@cspell/dict-python": "^4.2.15", "@cspell/dict-r": "^2.1.0", "@cspell/dict-ruby": "^5.0.7", "@cspell/dict-rust": "^4.0.11", "@cspell/dict-scala": "^5.0.7", "@cspell/dict-shell": "^1.1.0", - "@cspell/dict-software-terms": "^4.2.2", + "@cspell/dict-software-terms": "^4.2.4", "@cspell/dict-sql": "^2.2.0", "@cspell/dict-svelte": "^1.0.6", "@cspell/dict-swift": "^2.0.5", @@ -79,28 +80,31 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.17.2.tgz", - "integrity": "sha512-9QFzuSApaK7SYB50iCTRIUDjFZf6DXTFj8+qTR2cky+/YmEcHDpJieJVCd3STONO4m2JyqIsV7faEuA6M0YcHg==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.17.3.tgz", + "integrity": "sha512-RWSfyHOin/d9CqLjz00JMvPkag3yUSsQZr6G9BnCT5cMEO/ws8wQZzA54CNj/LAOccbknTX65SSroPPAtxs56w==", + "license": "MIT", "dependencies": { - "@cspell/cspell-types": "8.17.2" + "@cspell/cspell-types": "8.17.3" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.17.2.tgz", - "integrity": "sha512-LOTKK+hZSUc7vaN8SBEOcv+9dMYbo84awbsjjdI+HkKVBfTt3Lzlu6IJImw39L6pTDAJ1ZxOUdWO89jcxpyihg==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.17.3.tgz", + "integrity": "sha512-DqqSWKt9NLWPGloYxZTpzUhgdW8ObMkZmOOF6TyqpJ4IbckEct8ULgskNorTNRlmmjLniaNgvg6JSHuYO3Urxw==", + "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.17.2.tgz", - "integrity": "sha512-Z2ndlzVIiXOCBnQby9q+OXcxeddiuCi//pnhO9Jf6Ixgthn+Yg7bwzAnHu+CM1SJaQnZCntGyimdxfojm+WDdA==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.17.3.tgz", + "integrity": "sha512-yQlVaIsWiax6RRuuacZs++kl6Y9rwH9ZkVlsG9fhdeCJ5Xf3WCW+vmX1chzhhKDzRr8CF9fsvb1uagd/5/bBYA==", + "license": "MIT", "dependencies": { "global-directory": "^4.0.1" }, @@ -109,17 +113,19 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.17.2.tgz", - "integrity": "sha512-Cp4kVxJRyyDRd5RVTASlu+ygWG+dgy6GyH7lzb6P8SOXt1mxzCBK6Q5Dc1XHAsvhRaLrnMziCO/5Pj9/0DKs6w==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.17.3.tgz", + "integrity": "sha512-CC3nob/Kbuesz5WTW+LjAHnDFXJrA49pW5ckmbufJxNnoAk7EJez/qr7/ELMTf6Fl3A5xZ776Lhq7738Hy/fmQ==", + "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.17.2.tgz", - "integrity": "sha512-4kMBhX92p0pchEzYTpyLCoe/bUJ29YYvMINTeHTd//hLQh0ZAyMGY1opDm1tqaXX0qpYmWG60KcvN4fCR0i6lw==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.17.3.tgz", + "integrity": "sha512-ozgeuSioX9z2wtlargfgdw3LKwDFAfm8gxu+xwNREvXiLsevb+lb7ZlY5/ay+MahqR5Hfs7XzYzBLTKL/ldn9g==", + "license": "MIT", "engines": { "node": ">=18" } @@ -127,200 +133,239 @@ "node_modules/@cspell/dict-ada": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.1.0.tgz", - "integrity": "sha512-7SvmhmX170gyPd+uHXrfmqJBY5qLcCX8kTGURPVeGxmt8XNXT75uu9rnZO+jwrfuU2EimNoArdVy5GZRGljGNg==" + "integrity": "sha512-7SvmhmX170gyPd+uHXrfmqJBY5qLcCX8kTGURPVeGxmt8XNXT75uu9rnZO+jwrfuU2EimNoArdVy5GZRGljGNg==", + "license": "MIT" }, "node_modules/@cspell/dict-al": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-al/-/dict-al-1.1.0.tgz", - "integrity": "sha512-PtNI1KLmYkELYltbzuoztBxfi11jcE9HXBHCpID2lou/J4VMYKJPNqe4ZjVzSI9NYbMnMnyG3gkbhIdx66VSXg==" + "integrity": "sha512-PtNI1KLmYkELYltbzuoztBxfi11jcE9HXBHCpID2lou/J4VMYKJPNqe4ZjVzSI9NYbMnMnyG3gkbhIdx66VSXg==", + "license": "MIT" }, "node_modules/@cspell/dict-aws": { "version": "4.0.9", "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.9.tgz", - "integrity": "sha512-bDYdnnJGwSkIZ4gzrauu7qzOs/ZAY/FnU4k11LgdMI8BhwMfsbsy2EI1iS+sD/BI5ZnNT9kU5YR3WADeNOmhRg==" + "integrity": "sha512-bDYdnnJGwSkIZ4gzrauu7qzOs/ZAY/FnU4k11LgdMI8BhwMfsbsy2EI1iS+sD/BI5ZnNT9kU5YR3WADeNOmhRg==", + "license": "MIT" }, "node_modules/@cspell/dict-bash": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.2.0.tgz", "integrity": "sha512-HOyOS+4AbCArZHs/wMxX/apRkjxg6NDWdt0jF9i9XkvJQUltMwEhyA2TWYjQ0kssBsnof+9amax2lhiZnh3kCg==", + "license": "MIT", "dependencies": { "@cspell/dict-shell": "1.1.0" } }, "node_modules/@cspell/dict-companies": { - "version": "3.1.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.12.tgz", - "integrity": "sha512-99FxBNdLOQc3nVQ663Xh7JqDLbIy/AdqOecQ5bk3HpmXpSkoDvTT7XCUU5nQZvmFBrrQlXFKlRRYjLfTEOUDdA==" + "version": "3.1.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.13.tgz", + "integrity": "sha512-EAaFMxnSG4eQKup9D81EnWAYIzorLWG7b7Zzf+Suu0bVeFBpCYESss/EWtnmb5ZZNfKAGxtoMqfL3vRfyJERIQ==", + "license": "MIT" }, "node_modules/@cspell/dict-cpp": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.3.tgz", - "integrity": "sha512-OFrVXdxCeGKnon36Pe3yFjBuY4kzzEwWFf3vDz+cJTodZDkjFkBifQeTtt5YfimgF8cfAJZXkBCsxjipAgmAiw==" + "integrity": "sha512-OFrVXdxCeGKnon36Pe3yFjBuY4kzzEwWFf3vDz+cJTodZDkjFkBifQeTtt5YfimgF8cfAJZXkBCsxjipAgmAiw==", + "license": "MIT" }, "node_modules/@cspell/dict-cryptocurrencies": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-5.0.4.tgz", - "integrity": "sha512-6iFu7Abu+4Mgqq08YhTKHfH59mpMpGTwdzDB2Y8bbgiwnGFCeoiSkVkgLn1Kel2++hYcZ8vsAW/MJS9oXxuMag==" + "integrity": "sha512-6iFu7Abu+4Mgqq08YhTKHfH59mpMpGTwdzDB2Y8bbgiwnGFCeoiSkVkgLn1Kel2++hYcZ8vsAW/MJS9oXxuMag==", + "license": "MIT" }, "node_modules/@cspell/dict-csharp": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.6.tgz", - "integrity": "sha512-w/+YsqOknjQXmIlWDRmkW+BHBPJZ/XDrfJhZRQnp0wzpPOGml7W0q1iae65P2AFRtTdPKYmvSz7AL5ZRkCnSIw==" + "integrity": "sha512-w/+YsqOknjQXmIlWDRmkW+BHBPJZ/XDrfJhZRQnp0wzpPOGml7W0q1iae65P2AFRtTdPKYmvSz7AL5ZRkCnSIw==", + "license": "MIT" }, "node_modules/@cspell/dict-css": { "version": "4.0.17", "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.17.tgz", - "integrity": "sha512-2EisRLHk6X/PdicybwlajLGKF5aJf4xnX2uuG5lexuYKt05xV/J/OiBADmi8q9obhxf1nesrMQbqAt+6CsHo/w==" + "integrity": "sha512-2EisRLHk6X/PdicybwlajLGKF5aJf4xnX2uuG5lexuYKt05xV/J/OiBADmi8q9obhxf1nesrMQbqAt+6CsHo/w==", + "license": "MIT" }, "node_modules/@cspell/dict-dart": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.3.0.tgz", - "integrity": "sha512-1aY90lAicek8vYczGPDKr70pQSTQHwMFLbmWKTAI6iavmb1fisJBS1oTmMOKE4ximDf86MvVN6Ucwx3u/8HqLg==" + "integrity": "sha512-1aY90lAicek8vYczGPDKr70pQSTQHwMFLbmWKTAI6iavmb1fisJBS1oTmMOKE4ximDf86MvVN6Ucwx3u/8HqLg==", + "license": "MIT" }, "node_modules/@cspell/dict-data-science": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.6.tgz", - "integrity": "sha512-gOYKZOg358yhnnQfr1/f232REmjeIymXUHJdrLEMPirluv2rzMWvEBBazqRVQ++jMUNg9IduVI0v096ZWMDekA==" + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.7.tgz", + "integrity": "sha512-XhAkK+nSW6zmrnWzusmZ1BpYLc62AWYHZc2p17u4nE2Z9XG5DleG55PCZxXQTKz90pmwlhFM9AfpkJsYaBWATA==", + "license": "MIT" }, "node_modules/@cspell/dict-django": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.4.tgz", - "integrity": "sha512-fX38eUoPvytZ/2GA+g4bbdUtCMGNFSLbdJJPKX2vbewIQGfgSFJKY56vvcHJKAvw7FopjvgyS/98Ta9WN1gckg==" + "integrity": "sha512-fX38eUoPvytZ/2GA+g4bbdUtCMGNFSLbdJJPKX2vbewIQGfgSFJKY56vvcHJKAvw7FopjvgyS/98Ta9WN1gckg==", + "license": "MIT" }, "node_modules/@cspell/dict-docker": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.12.tgz", - "integrity": "sha512-6d25ZPBnYZaT9D9An/x6g/4mk542R8bR3ipnby3QFCxnfdd6xaWiTcwDPsCgwN2aQZIQ1jX/fil9KmBEqIK/qA==" + "integrity": "sha512-6d25ZPBnYZaT9D9An/x6g/4mk542R8bR3ipnby3QFCxnfdd6xaWiTcwDPsCgwN2aQZIQ1jX/fil9KmBEqIK/qA==", + "license": "MIT" }, "node_modules/@cspell/dict-dotnet": { "version": "5.0.9", "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.9.tgz", - "integrity": "sha512-JGD6RJW5sHtO5lfiJl11a5DpPN6eKSz5M1YBa1I76j4dDOIqgZB6rQexlDlK1DH9B06X4GdDQwdBfnpAB0r2uQ==" + "integrity": "sha512-JGD6RJW5sHtO5lfiJl11a5DpPN6eKSz5M1YBa1I76j4dDOIqgZB6rQexlDlK1DH9B06X4GdDQwdBfnpAB0r2uQ==", + "license": "MIT" }, "node_modules/@cspell/dict-elixir": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-4.0.7.tgz", - "integrity": "sha512-MAUqlMw73mgtSdxvbAvyRlvc3bYnrDqXQrx5K9SwW8F7fRYf9V4vWYFULh+UWwwkqkhX9w03ZqFYRTdkFku6uA==" + "integrity": "sha512-MAUqlMw73mgtSdxvbAvyRlvc3bYnrDqXQrx5K9SwW8F7fRYf9V4vWYFULh+UWwwkqkhX9w03ZqFYRTdkFku6uA==", + "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.3.29", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.29.tgz", - "integrity": "sha512-7kHP0sJ271oS5RqakxvhWvHFoCUFCBDV6+cgIRIpKwW0aYVB4F2AwElGsdeE/XEmihhYUje7e/e6X3IEWHrcrQ==" + "version": "4.3.30", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.30.tgz", + "integrity": "sha512-p0G5fByj5fUnMyFUlkN3kaqE3nuQkqpYV47Gn9n8k2TszsdLY55xj9UoFE4YIcjOiyU1bR/YDJ5daiPMYXTJ/A==", + "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.8.tgz", - "integrity": "sha512-l1u/pDjwrPyWwBd1hCkZhdsK8yLbLFPD2xWz+1tFFI7WaV9ckDZoF3woRc/0wFGRy53yrfSAVuwhoYOQnHe/fA==" + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.9.tgz", + "integrity": "sha512-O/jAr1VNtuyCFckbTmpeEf43ZFWVD9cJFvWaA6rO2IVmLirJViHWJUyBZOuQcesSplzEIw80MAYmnK06/MDWXQ==", + "license": "CC BY-SA 4.0" }, "node_modules/@cspell/dict-en-gb": { "version": "1.1.33", "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz", - "integrity": "sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==" + "integrity": "sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==", + "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { "version": "3.0.10", "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.10.tgz", - "integrity": "sha512-JEN3627joBVtpa1yfkdN9vz1Z129PoKGHBKjXCEziJvf2Zt1LeULWYYYg/O6pzRR4yzRa5YbXDTuyrN7vX7DFg==" + "integrity": "sha512-JEN3627joBVtpa1yfkdN9vz1Z129PoKGHBKjXCEziJvf2Zt1LeULWYYYg/O6pzRR4yzRa5YbXDTuyrN7vX7DFg==", + "license": "MIT" }, "node_modules/@cspell/dict-flutter": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-flutter/-/dict-flutter-1.1.0.tgz", - "integrity": "sha512-3zDeS7zc2p8tr9YH9tfbOEYfopKY/srNsAa+kE3rfBTtQERAZeOhe5yxrnTPoufctXLyuUtcGMUTpxr3dO0iaA==" + "integrity": "sha512-3zDeS7zc2p8tr9YH9tfbOEYfopKY/srNsAa+kE3rfBTtQERAZeOhe5yxrnTPoufctXLyuUtcGMUTpxr3dO0iaA==", + "license": "MIT" }, "node_modules/@cspell/dict-fonts": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.4.tgz", - "integrity": "sha512-cHFho4hjojBcHl6qxidl9CvUb492IuSk7xIf2G2wJzcHwGaCFa2o3gRcxmIg1j62guetAeDDFELizDaJlVRIOg==" + "integrity": "sha512-cHFho4hjojBcHl6qxidl9CvUb492IuSk7xIf2G2wJzcHwGaCFa2o3gRcxmIg1j62guetAeDDFELizDaJlVRIOg==", + "license": "MIT" }, "node_modules/@cspell/dict-fsharp": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-fsharp/-/dict-fsharp-1.1.0.tgz", - "integrity": "sha512-oguWmHhGzgbgbEIBKtgKPrFSVAFtvGHaQS0oj+vacZqMObwkapcTGu7iwf4V3Bc2T3caf0QE6f6rQfIJFIAVsw==" + "integrity": "sha512-oguWmHhGzgbgbEIBKtgKPrFSVAFtvGHaQS0oj+vacZqMObwkapcTGu7iwf4V3Bc2T3caf0QE6f6rQfIJFIAVsw==", + "license": "MIT" }, "node_modules/@cspell/dict-fullstack": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.3.tgz", - "integrity": "sha512-62PbndIyQPH11mAv0PyiyT0vbwD0AXEocPpHlCHzfb5v9SspzCCbzQ/LIBiFmyRa+q5LMW35CnSVu6OXdT+LKg==" + "integrity": "sha512-62PbndIyQPH11mAv0PyiyT0vbwD0AXEocPpHlCHzfb5v9SspzCCbzQ/LIBiFmyRa+q5LMW35CnSVu6OXdT+LKg==", + "license": "MIT" }, "node_modules/@cspell/dict-gaming-terms": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.1.0.tgz", - "integrity": "sha512-46AnDs9XkgJ2f1Sqol1WgfJ8gOqp60fojpc9Wxch7x+BA63g4JfMV5/M5x0sI0TLlLY8EBSglcr8wQF/7C80AQ==" + "integrity": "sha512-46AnDs9XkgJ2f1Sqol1WgfJ8gOqp60fojpc9Wxch7x+BA63g4JfMV5/M5x0sI0TLlLY8EBSglcr8wQF/7C80AQ==", + "license": "MIT" }, "node_modules/@cspell/dict-git": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.4.tgz", - "integrity": "sha512-C44M+m56rYn6QCsLbiKiedyPTMZxlDdEYAsPwwlL5bhMDDzXZ3Ic8OCQIhMbiunhCOJJT+er4URmOmM+sllnjg==" + "integrity": "sha512-C44M+m56rYn6QCsLbiKiedyPTMZxlDdEYAsPwwlL5bhMDDzXZ3Ic8OCQIhMbiunhCOJJT+er4URmOmM+sllnjg==", + "license": "MIT" }, "node_modules/@cspell/dict-golang": { "version": "6.0.18", "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.18.tgz", - "integrity": "sha512-Mt+7NwfodDwUk7423DdaQa0YaA+4UoV3XSxQwZioqjpFBCuxfvvv4l80MxCTAAbK6duGj0uHbGTwpv8fyKYPKg==" + "integrity": "sha512-Mt+7NwfodDwUk7423DdaQa0YaA+4UoV3XSxQwZioqjpFBCuxfvvv4l80MxCTAAbK6duGj0uHbGTwpv8fyKYPKg==", + "license": "MIT" }, "node_modules/@cspell/dict-google": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-google/-/dict-google-1.0.5.tgz", - "integrity": "sha512-KNrzfUsoFat94slWzo36g601sIGz6KtE4kBMM0gpqwFLK/MXRyaW65IL4SwysY0PEhuRzg9spLLMnUXuVcY2hQ==" + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-google/-/dict-google-1.0.8.tgz", + "integrity": "sha512-BnMHgcEeaLyloPmBs8phCqprI+4r2Jb8rni011A8hE+7FNk7FmLE3kiwxLFrcZnnb7eqM0agW4zUaNoB0P+z8A==", + "license": "MIT" }, "node_modules/@cspell/dict-haskell": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@cspell/dict-haskell/-/dict-haskell-4.0.5.tgz", - "integrity": "sha512-s4BG/4tlj2pPM9Ha7IZYMhUujXDnI0Eq1+38UTTCpatYLbQqDwRFf2KNPLRqkroU+a44yTUAe0rkkKbwy4yRtQ==" + "integrity": "sha512-s4BG/4tlj2pPM9Ha7IZYMhUujXDnI0Eq1+38UTTCpatYLbQqDwRFf2KNPLRqkroU+a44yTUAe0rkkKbwy4yRtQ==", + "license": "MIT" }, "node_modules/@cspell/dict-html": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.11.tgz", - "integrity": "sha512-QR3b/PB972SRQ2xICR1Nw/M44IJ6rjypwzA4jn+GH8ydjAX9acFNfc+hLZVyNe0FqsE90Gw3evLCOIF0vy1vQw==" + "integrity": "sha512-QR3b/PB972SRQ2xICR1Nw/M44IJ6rjypwzA4jn+GH8ydjAX9acFNfc+hLZVyNe0FqsE90Gw3evLCOIF0vy1vQw==", + "license": "MIT" }, "node_modules/@cspell/dict-html-symbol-entities": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.3.tgz", - "integrity": "sha512-aABXX7dMLNFdSE8aY844X4+hvfK7977sOWgZXo4MTGAmOzR8524fjbJPswIBK7GaD3+SgFZ2yP2o0CFvXDGF+A==" + "integrity": "sha512-aABXX7dMLNFdSE8aY844X4+hvfK7977sOWgZXo4MTGAmOzR8524fjbJPswIBK7GaD3+SgFZ2yP2o0CFvXDGF+A==", + "license": "MIT" }, "node_modules/@cspell/dict-java": { "version": "5.0.11", "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.11.tgz", - "integrity": "sha512-T4t/1JqeH33Raa/QK/eQe26FE17eUCtWu+JsYcTLkQTci2dk1DfcIKo8YVHvZXBnuM43ATns9Xs0s+AlqDeH7w==" + "integrity": "sha512-T4t/1JqeH33Raa/QK/eQe26FE17eUCtWu+JsYcTLkQTci2dk1DfcIKo8YVHvZXBnuM43ATns9Xs0s+AlqDeH7w==", + "license": "MIT" }, "node_modules/@cspell/dict-julia": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-julia/-/dict-julia-1.1.0.tgz", - "integrity": "sha512-CPUiesiXwy3HRoBR3joUseTZ9giFPCydSKu2rkh6I2nVjXnl5vFHzOMLXpbF4HQ1tH2CNfnDbUndxD+I+7eL9w==" + "integrity": "sha512-CPUiesiXwy3HRoBR3joUseTZ9giFPCydSKu2rkh6I2nVjXnl5vFHzOMLXpbF4HQ1tH2CNfnDbUndxD+I+7eL9w==", + "license": "MIT" }, "node_modules/@cspell/dict-k8s": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.10.tgz", - "integrity": "sha512-313haTrX9prep1yWO7N6Xw4D6tvUJ0Xsx+YhCP+5YrrcIKoEw5Rtlg8R4PPzLqe6zibw6aJ+Eqq+y76Vx5BZkw==" + "integrity": "sha512-313haTrX9prep1yWO7N6Xw4D6tvUJ0Xsx+YhCP+5YrrcIKoEw5Rtlg8R4PPzLqe6zibw6aJ+Eqq+y76Vx5BZkw==", + "license": "MIT" }, "node_modules/@cspell/dict-kotlin": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-kotlin/-/dict-kotlin-1.1.0.tgz", - "integrity": "sha512-vySaVw6atY7LdwvstQowSbdxjXG6jDhjkWVWSjg1XsUckyzH1JRHXe9VahZz1i7dpoFEUOWQrhIe5B9482UyJQ==" + "integrity": "sha512-vySaVw6atY7LdwvstQowSbdxjXG6jDhjkWVWSjg1XsUckyzH1JRHXe9VahZz1i7dpoFEUOWQrhIe5B9482UyJQ==", + "license": "MIT" }, "node_modules/@cspell/dict-latex": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-4.0.3.tgz", - "integrity": "sha512-2KXBt9fSpymYHxHfvhUpjUFyzrmN4c4P8mwIzweLyvqntBT3k0YGZJSriOdjfUjwSygrfEwiuPI1EMrvgrOMJw==" + "integrity": "sha512-2KXBt9fSpymYHxHfvhUpjUFyzrmN4c4P8mwIzweLyvqntBT3k0YGZJSriOdjfUjwSygrfEwiuPI1EMrvgrOMJw==", + "license": "MIT" }, "node_modules/@cspell/dict-lorem-ipsum": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.4.tgz", - "integrity": "sha512-+4f7vtY4dp2b9N5fn0za/UR0kwFq2zDtA62JCbWHbpjvO9wukkbl4rZg4YudHbBgkl73HRnXFgCiwNhdIA1JPw==" + "integrity": "sha512-+4f7vtY4dp2b9N5fn0za/UR0kwFq2zDtA62JCbWHbpjvO9wukkbl4rZg4YudHbBgkl73HRnXFgCiwNhdIA1JPw==", + "license": "MIT" }, "node_modules/@cspell/dict-lua": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-4.0.7.tgz", - "integrity": "sha512-Wbr7YSQw+cLHhTYTKV6cAljgMgcY+EUAxVIZW3ljKswEe4OLxnVJ7lPqZF5JKjlXdgCjbPSimsHqyAbC5pQN/Q==" + "integrity": "sha512-Wbr7YSQw+cLHhTYTKV6cAljgMgcY+EUAxVIZW3ljKswEe4OLxnVJ7lPqZF5JKjlXdgCjbPSimsHqyAbC5pQN/Q==", + "license": "MIT" }, "node_modules/@cspell/dict-makefile": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@cspell/dict-makefile/-/dict-makefile-1.0.4.tgz", - "integrity": "sha512-E4hG/c0ekPqUBvlkrVvzSoAA+SsDA9bLi4xSV3AXHTVru7Y2bVVGMPtpfF+fI3zTkww/jwinprcU1LSohI3ylw==" + "integrity": "sha512-E4hG/c0ekPqUBvlkrVvzSoAA+SsDA9bLi4xSV3AXHTVru7Y2bVVGMPtpfF+fI3zTkww/jwinprcU1LSohI3ylw==", + "license": "MIT" }, "node_modules/@cspell/dict-markdown": { "version": "2.0.9", "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.9.tgz", "integrity": "sha512-j2e6Eg18BlTb1mMP1DkyRFMM/FLS7qiZjltpURzDckB57zDZbUyskOFdl4VX7jItZZEeY0fe22bSPOycgS1Z5A==", + "license": "MIT", "peerDependencies": { "@cspell/dict-css": "^4.0.17", "@cspell/dict-html": "^4.0.11", @@ -331,107 +376,127 @@ "node_modules/@cspell/dict-monkeyc": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/@cspell/dict-monkeyc/-/dict-monkeyc-1.0.10.tgz", - "integrity": "sha512-7RTGyKsTIIVqzbvOtAu6Z/lwwxjGRtY5RkKPlXKHEoEAgIXwfDxb5EkVwzGQwQr8hF/D3HrdYbRT8MFBfsueZw==" + "integrity": "sha512-7RTGyKsTIIVqzbvOtAu6Z/lwwxjGRtY5RkKPlXKHEoEAgIXwfDxb5EkVwzGQwQr8hF/D3HrdYbRT8MFBfsueZw==", + "license": "MIT" }, "node_modules/@cspell/dict-node": { "version": "5.0.6", "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.6.tgz", - "integrity": "sha512-CEbhPCpxGvRNByGolSBTrXXW2rJA4bGqZuTx1KKO85mwR6aadeOmUE7xf/8jiCkXSy+qvr9aJeh+jlfXcsrziQ==" + "integrity": "sha512-CEbhPCpxGvRNByGolSBTrXXW2rJA4bGqZuTx1KKO85mwR6aadeOmUE7xf/8jiCkXSy+qvr9aJeh+jlfXcsrziQ==", + "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.1.23", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.23.tgz", - "integrity": "sha512-/xK7G1/H5M73J3CAb3WmVXlMbK6zjZrfwmOOBiB7SSbK6h7/WmwRBuLC0UwO50x07NJUuVmJek5ELaNa81guVw==" + "version": "5.1.24", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.24.tgz", + "integrity": "sha512-yAyyHetElLR236sqWQkBtiLbzCGexV5zzLMHyQPptKQQK88BTQR5f9wXW2EtSgJw/4gUchpSWQWxMlkIfK/iQQ==", + "license": "MIT" }, "node_modules/@cspell/dict-php": { "version": "4.0.14", "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.14.tgz", - "integrity": "sha512-7zur8pyncYZglxNmqsRycOZ6inpDoVd4yFfz1pQRe5xaRWMiK3Km4n0/X/1YMWhh3e3Sl/fQg5Axb2hlN68t1g==" + "integrity": "sha512-7zur8pyncYZglxNmqsRycOZ6inpDoVd4yFfz1pQRe5xaRWMiK3Km4n0/X/1YMWhh3e3Sl/fQg5Axb2hlN68t1g==", + "license": "MIT" }, "node_modules/@cspell/dict-powershell": { "version": "5.0.14", "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.14.tgz", - "integrity": "sha512-ktjjvtkIUIYmj/SoGBYbr3/+CsRGNXGpvVANrY0wlm/IoGlGywhoTUDYN0IsGwI2b8Vktx3DZmQkfb3Wo38jBA==" + "integrity": "sha512-ktjjvtkIUIYmj/SoGBYbr3/+CsRGNXGpvVANrY0wlm/IoGlGywhoTUDYN0IsGwI2b8Vktx3DZmQkfb3Wo38jBA==", + "license": "MIT" }, "node_modules/@cspell/dict-public-licenses": { "version": "2.0.13", "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.13.tgz", - "integrity": "sha512-1Wdp/XH1ieim7CadXYE7YLnUlW0pULEjVl9WEeziZw3EKCAw8ZI8Ih44m4bEa5VNBLnuP5TfqC4iDautAleQzQ==" + "integrity": "sha512-1Wdp/XH1ieim7CadXYE7YLnUlW0pULEjVl9WEeziZw3EKCAw8ZI8Ih44m4bEa5VNBLnuP5TfqC4iDautAleQzQ==", + "license": "MIT" }, "node_modules/@cspell/dict-python": { - "version": "4.2.14", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.14.tgz", - "integrity": "sha512-NZ/rsTH5gqTlEwbSg0vn5b1TsyzrUvA6ykwCVCwsVDdlQAS82cyDsF9JqHp8S4d6PFykmkfSxtAXYyOUr0KCbg==", + "version": "4.2.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.15.tgz", + "integrity": "sha512-VNXhj0Eh+hdHN89MgyaoSAexBQKmYtJaMhucbMI7XmBs4pf8fuFFN3xugk51/A4TZJr8+RImdFFsGMOw+I4bDA==", + "license": "MIT", "dependencies": { - "@cspell/dict-data-science": "^2.0.6" + "@cspell/dict-data-science": "^2.0.7" } }, "node_modules/@cspell/dict-r": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-r/-/dict-r-2.1.0.tgz", - "integrity": "sha512-k2512wgGG0lTpTYH9w5Wwco+lAMf3Vz7mhqV8+OnalIE7muA0RSuD9tWBjiqLcX8zPvEJr4LdgxVju8Gk3OKyA==" + "integrity": "sha512-k2512wgGG0lTpTYH9w5Wwco+lAMf3Vz7mhqV8+OnalIE7muA0RSuD9tWBjiqLcX8zPvEJr4LdgxVju8Gk3OKyA==", + "license": "MIT" }, "node_modules/@cspell/dict-ruby": { "version": "5.0.7", "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.7.tgz", - "integrity": "sha512-4/d0hcoPzi5Alk0FmcyqlzFW9lQnZh9j07MJzPcyVO62nYJJAGKaPZL2o4qHeCS/od/ctJC5AHRdoUm0ktsw6Q==" + "integrity": "sha512-4/d0hcoPzi5Alk0FmcyqlzFW9lQnZh9j07MJzPcyVO62nYJJAGKaPZL2o4qHeCS/od/ctJC5AHRdoUm0ktsw6Q==", + "license": "MIT" }, "node_modules/@cspell/dict-rust": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.11.tgz", - "integrity": "sha512-OGWDEEzm8HlkSmtD8fV3pEcO2XBpzG2XYjgMCJCRwb2gRKvR+XIm6Dlhs04N/K2kU+iH8bvrqNpM8fS/BFl0uw==" + "integrity": "sha512-OGWDEEzm8HlkSmtD8fV3pEcO2XBpzG2XYjgMCJCRwb2gRKvR+XIm6Dlhs04N/K2kU+iH8bvrqNpM8fS/BFl0uw==", + "license": "MIT" }, "node_modules/@cspell/dict-scala": { "version": "5.0.7", "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.7.tgz", - "integrity": "sha512-yatpSDW/GwulzO3t7hB5peoWwzo+Y3qTc0pO24Jf6f88jsEeKmDeKkfgPbYuCgbE4jisGR4vs4+jfQZDIYmXPA==" + "integrity": "sha512-yatpSDW/GwulzO3t7hB5peoWwzo+Y3qTc0pO24Jf6f88jsEeKmDeKkfgPbYuCgbE4jisGR4vs4+jfQZDIYmXPA==", + "license": "MIT" }, "node_modules/@cspell/dict-shell": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-shell/-/dict-shell-1.1.0.tgz", - "integrity": "sha512-D/xHXX7T37BJxNRf5JJHsvziFDvh23IF/KvkZXNSh8VqcRdod3BAz9VGHZf6VDqcZXr1VRqIYR3mQ8DSvs3AVQ==" + "integrity": "sha512-D/xHXX7T37BJxNRf5JJHsvziFDvh23IF/KvkZXNSh8VqcRdod3BAz9VGHZf6VDqcZXr1VRqIYR3mQ8DSvs3AVQ==", + "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.2.2.tgz", - "integrity": "sha512-cgteXRzx2W/Ug7QSdFJrVxLES7krrZEjZ9J6sXRWOsVYFpgu2Gup8NKmjKOZ8NTnCjHQFrMnbmKdv56q9Kwixw==" + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.2.4.tgz", + "integrity": "sha512-GRkuaFfjFHPYynyRMuisKyE3gRiVK0REClRWfnH9+5iCs5TKDURsMpWJGNsgQ6N5jAKKrtWXVKjepkDHjMldjQ==", + "license": "MIT" }, "node_modules/@cspell/dict-sql": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.2.0.tgz", - "integrity": "sha512-MUop+d1AHSzXpBvQgQkCiok8Ejzb+nrzyG16E8TvKL2MQeDwnIvMe3bv90eukP6E1HWb+V/MA/4pnq0pcJWKqQ==" + "integrity": "sha512-MUop+d1AHSzXpBvQgQkCiok8Ejzb+nrzyG16E8TvKL2MQeDwnIvMe3bv90eukP6E1HWb+V/MA/4pnq0pcJWKqQ==", + "license": "MIT" }, "node_modules/@cspell/dict-svelte": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@cspell/dict-svelte/-/dict-svelte-1.0.6.tgz", - "integrity": "sha512-8LAJHSBdwHCoKCSy72PXXzz7ulGROD0rP1CQ0StOqXOOlTUeSFaJJlxNYjlONgd2c62XBQiN2wgLhtPN+1Zv7Q==" + "integrity": "sha512-8LAJHSBdwHCoKCSy72PXXzz7ulGROD0rP1CQ0StOqXOOlTUeSFaJJlxNYjlONgd2c62XBQiN2wgLhtPN+1Zv7Q==", + "license": "MIT" }, "node_modules/@cspell/dict-swift": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-2.0.5.tgz", - "integrity": "sha512-3lGzDCwUmnrfckv3Q4eVSW3sK3cHqqHlPprFJZD4nAqt23ot7fic5ALR7J4joHpvDz36nHX34TgcbZNNZOC/JA==" + "integrity": "sha512-3lGzDCwUmnrfckv3Q4eVSW3sK3cHqqHlPprFJZD4nAqt23ot7fic5ALR7J4joHpvDz36nHX34TgcbZNNZOC/JA==", + "license": "MIT" }, "node_modules/@cspell/dict-terraform": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.1.0.tgz", - "integrity": "sha512-G55pcUUxeXAhejstmD35B47SkFd4uqCQimc+CMgq8Nx0dr03guL2iMsz8faRWQGkCnGimX8S91rbOhDv9p/heg==" + "integrity": "sha512-G55pcUUxeXAhejstmD35B47SkFd4uqCQimc+CMgq8Nx0dr03guL2iMsz8faRWQGkCnGimX8S91rbOhDv9p/heg==", + "license": "MIT" }, "node_modules/@cspell/dict-typescript": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.2.0.tgz", - "integrity": "sha512-Pk3zNePLT8qg51l0M4g1ISowYAEGxTuNfZlgkU5SvHa9Cu7x/BWoyYq9Fvc3kAyoisCjRPyvWF4uRYrPitPDFw==" + "integrity": "sha512-Pk3zNePLT8qg51l0M4g1ISowYAEGxTuNfZlgkU5SvHa9Cu7x/BWoyYq9Fvc3kAyoisCjRPyvWF4uRYrPitPDFw==", + "license": "MIT" }, "node_modules/@cspell/dict-vue": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.4.tgz", - "integrity": "sha512-0dPtI0lwHcAgSiQFx8CzvqjdoXROcH+1LyqgROCpBgppommWpVhbQ0eubnKotFEXgpUCONVkeZJ6Ql8NbTEu+w==" + "integrity": "sha512-0dPtI0lwHcAgSiQFx8CzvqjdoXROcH+1LyqgROCpBgppommWpVhbQ0eubnKotFEXgpUCONVkeZJ6Ql8NbTEu+w==", + "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.17.2.tgz", - "integrity": "sha512-n3AVbyBlTn/pLtYK62mqgDfJIuQHUTY/k8SMUCjyjfgoqd3LcKhS1PmbLfDWPMTODK30cSMMTLejjy2bL6ksEw==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.17.3.tgz", + "integrity": "sha512-Kg6IJhGHPv+9OxpxaXUpcqgnHEOhMLRWHLyx7FADZ+CJyO4AVeWQfhpTRM6KXhzIl7dPlLG1g8JAQxaoy88KTw==", + "license": "MIT", "dependencies": { - "@cspell/url": "8.17.2", + "@cspell/url": "8.17.3", "import-meta-resolve": "^4.1.0" }, "engines": { @@ -439,25 +504,28 @@ } }, "node_modules/@cspell/filetypes": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.17.2.tgz", - "integrity": "sha512-2B+dB4Ls2xiOjg+vEEbAuJTHtMfXSihVzfLGnj9+qUfq47iqrz4ZBvCOfZhYdiVaaZJoZUgIw8ljrUfqFzYDAg==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.17.3.tgz", + "integrity": "sha512-UFqRmJPccOSo+RYP/jZ4cr0s7ni37GrvnNAg1H/qIIxfmBYsexTAmsNzMqxp1M31NeI1Cx3LL7PspPMT0ms+7w==", + "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.17.2.tgz", - "integrity": "sha512-LbbhdVwtqyJ71X+O7e2PqpDp7zLiY8jmW2CJFLjZYWTUawgav2bpwECGq6O9Gnwqe+fj7yWxGJFDSpXQcCJQAw==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.17.3.tgz", + "integrity": "sha512-l/CaFc3CITI/dC+whEBZ05Om0KXR3V2whhVOWOBPIqA5lCjWAyvWWvmFD+CxWd0Hs6Qcb/YDnMyJW14aioXN4g==", + "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.17.2.tgz", - "integrity": "sha512-yy4eYWNX2iutXmy4Igbn/hL/NYaNt94DylohPtgVr0Zxnn/AAArt9Bv1KXPpjB8VFy2wzzPzWmZ+MWDUVpHCbg==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.17.3.tgz", + "integrity": "sha512-gcsCz8g0qY94C8RXiAlUH/89n84Q9RSptP91XrvnLOT+Xva9Aibd7ywd5k9ameuf8Nagyl0ezB1MInZ30S9SRw==", + "license": "MIT", "engines": { "node": ">=18.0" } @@ -465,12 +533,14 @@ "node_modules/array-timsort": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", - "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==" + "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", + "license": "MIT" }, "node_modules/braces": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", "dependencies": { "fill-range": "^7.1.1" }, @@ -482,6 +552,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "license": "MIT", "engines": { "node": ">=6" } @@ -516,6 +587,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/clear-module/-/clear-module-4.1.2.tgz", "integrity": "sha512-LWAxzHqdHsAZlPlEyJ2Poz6AIs384mPeqLVCru2p0BrP9G/kVGuhNyZYClLO6cXlnuJjzC8xtsJIuMjKqLXoAw==", + "license": "MIT", "dependencies": { "parent-module": "^2.0.0", "resolve-from": "^5.0.0" @@ -528,9 +600,10 @@ } }, "node_modules/commander": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-13.0.0.tgz", - "integrity": "sha512-oPYleIY8wmTVzkvQq10AEok6YcTC4sRUBl8F9gVuwchGVUCTbl/vhLTaQqutuuySYOsu8YTgV+OxKc/8Yvx+mQ==", + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz", + "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==", + "license": "MIT", "engines": { "node": ">=18" } @@ -539,6 +612,7 @@ "version": "4.2.5", "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.5.tgz", "integrity": "sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw==", + "license": "MIT", "dependencies": { "array-timsort": "^1.0.3", "core-util-is": "^1.0.3", @@ -553,26 +627,28 @@ "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" }, "node_modules/cspell": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.17.2.tgz", - "integrity": "sha512-y+INkxDa+M9f+gsyyMLjKh1tF20r2g5Gn22peSRJglrNLQtmDuRtDT9vyDHANXZcH5g6pHDnENQu/+P2Tiyu8Q==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.17.3.tgz", + "integrity": "sha512-fBZg674Dir9y/FWMwm2JyixM/1eB2vnqHJjRxOgGS/ZiZ3QdQ3LkK02Aqvlni8ffWYDZnYnYY9rfWmql9bb42w==", + "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "8.17.2", - "@cspell/cspell-pipe": "8.17.2", - "@cspell/cspell-types": "8.17.2", - "@cspell/dynamic-import": "8.17.2", - "@cspell/url": "8.17.2", + "@cspell/cspell-json-reporter": "8.17.3", + "@cspell/cspell-pipe": "8.17.3", + "@cspell/cspell-types": "8.17.3", + "@cspell/dynamic-import": "8.17.3", + "@cspell/url": "8.17.3", "chalk": "^5.4.1", "chalk-template": "^1.1.0", - "commander": "^13.0.0", - "cspell-dictionary": "8.17.2", - "cspell-gitignore": "8.17.2", - "cspell-glob": "8.17.2", - "cspell-io": "8.17.2", - "cspell-lib": "8.17.2", + "commander": "^13.1.0", + "cspell-dictionary": "8.17.3", + "cspell-gitignore": "8.17.3", + "cspell-glob": "8.17.3", + "cspell-io": "8.17.3", + "cspell-lib": "8.17.3", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "get-stdin": "^9.0.0", @@ -591,11 +667,12 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.17.2.tgz", - "integrity": "sha512-g08lRd/smLk2je0j7HlCjdDa0dSTyI2oRP3gScWlsyXjb4NSr9qO0Wzyn5BfPgrqFdS/z4dXbHe+tnLQZCt9iQ==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.17.3.tgz", + "integrity": "sha512-+N32Q6xck3D2RqZIFwq8s0TnzHYMpyh4bgNtYqW5DIP3TLDiA4/MJGjwmLKAg/s9dkre6n8/++vVli3MZAOhIg==", + "license": "MIT", "dependencies": { - "@cspell/cspell-types": "8.17.2", + "@cspell/cspell-types": "8.17.3", "comment-json": "^4.2.5", "yaml": "^2.7.0" }, @@ -604,13 +681,14 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.17.2.tgz", - "integrity": "sha512-2JC9RRsZruCs3AHId/8X63fSxDoF94dleRp8y/dXS9LIX7NruofohUJwzc/3tlgzCWWdaek1RXhO5xaYX74QtA==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.17.3.tgz", + "integrity": "sha512-89I/lpQKdkX17RCFrUIJnc70Rjfpup/o+ynHZen0hUxGTfLsEJPrK6H2oGvic3Yrv5q8IOtwM1p8vqPqBkBheA==", + "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.17.2", - "@cspell/cspell-types": "8.17.2", - "cspell-trie-lib": "8.17.2", + "@cspell/cspell-pipe": "8.17.3", + "@cspell/cspell-types": "8.17.3", + "cspell-trie-lib": "8.17.3", "fast-equals": "^5.2.2" }, "engines": { @@ -618,13 +696,14 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.17.2.tgz", - "integrity": "sha512-zCTTN30zV96LkZmUDrLamEHpLLUGohKglKJ4iXoHQC8pDU3xTsV2qzeCQjM9SEmU3VbE1TzWq+vj0fslasv6pA==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.17.3.tgz", + "integrity": "sha512-rQamjb8R+Nwib/Bpcgf+xv5IdsOHgbP+fe4hCgv0jjgUPkeOR2c4dGwc0WS+2UkJbc+wQohpzBGDLRYGSB/hQw==", + "license": "MIT", "dependencies": { - "@cspell/url": "8.17.2", - "cspell-glob": "8.17.2", - "cspell-io": "8.17.2", + "@cspell/url": "8.17.3", + "cspell-glob": "8.17.3", + "cspell-io": "8.17.3", "find-up-simple": "^1.0.0" }, "bin": { @@ -635,11 +714,12 @@ } }, "node_modules/cspell-glob": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.17.2.tgz", - "integrity": "sha512-MTgrWX12oY8Pq/M3PEYCTHwD6w6l+DPtBWm958nhR4dboUbwi/3KfqCtdorkhnuClqLDQuuZHp0uGBXB4cdQrw==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.17.3.tgz", + "integrity": "sha512-0ov9A0E6OuOO7KOxlGCxJ09LR/ubZ6xcGwWc5bu+jp/8onUowQfe+9vZdznj/o8/vcf5JkDzyhRSBsdhWKqoAg==", + "license": "MIT", "dependencies": { - "@cspell/url": "8.17.2", + "@cspell/url": "8.17.3", "micromatch": "^4.0.8" }, "engines": { @@ -647,12 +727,13 @@ } }, "node_modules/cspell-grammar": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.17.2.tgz", - "integrity": "sha512-Asg5XRvrg2yHCvBwzARBPSwI4P5/unN+bKBlxqFazHgR72WJE+ASeobfUNfGi/RxJA2+m0hO91oYtvq6LfK52w==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.17.3.tgz", + "integrity": "sha512-wfjkkvHthnKJtEaTgx3cPUPquGRXfgXSCwvMJaDyUi36KBlopXX38PejBTdmuqrvp7bINLSuHErml9wAfL5Fxw==", + "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.17.2", - "@cspell/cspell-types": "8.17.2" + "@cspell/cspell-pipe": "8.17.3", + "@cspell/cspell-types": "8.17.3" }, "bin": { "cspell-grammar": "bin.mjs" @@ -662,38 +743,40 @@ } }, "node_modules/cspell-io": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.17.2.tgz", - "integrity": "sha512-IUdhbO6gsWYiM2dgudFJQTfnFCDYjLOqal3SxH5o8oOWeu5iIZ+s3N8E1odz0L5zF2Go7zDQSKvPr7Y9OOoRfw==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.17.3.tgz", + "integrity": "sha512-NwEVb3Kr8loV1C8Stz9QSMgUrBkxqf2s7A9H2/RBnfvQBt9CWZS6NgoNxTPwHj3h1sUNl9reDkMQQzkKtgWGBQ==", + "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "8.17.2", - "@cspell/url": "8.17.2" + "@cspell/cspell-service-bus": "8.17.3", + "@cspell/url": "8.17.3" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.17.2.tgz", - "integrity": "sha512-ZgkTvGh9FO+R3v5TaTqlrJEylWyZhNOzbtrQ5W35Hb3tZ9IJJklxjlcGe+gbFsjGi56kLj6c5L2NR7YX/Fdu5Q==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.17.3.tgz", + "integrity": "sha512-KpwYIj8HwFyTzCCQcyezlmomvyNfPwZQmqTh4V126sFvf9HLoMdfyq8KYDZmZ//4HzwrF/ufJOF3CpuVUiJHfA==", + "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.17.2", - "@cspell/cspell-pipe": "8.17.2", - "@cspell/cspell-resolver": "8.17.2", - "@cspell/cspell-types": "8.17.2", - "@cspell/dynamic-import": "8.17.2", - "@cspell/filetypes": "8.17.2", - "@cspell/strong-weak-map": "8.17.2", - "@cspell/url": "8.17.2", + "@cspell/cspell-bundled-dicts": "8.17.3", + "@cspell/cspell-pipe": "8.17.3", + "@cspell/cspell-resolver": "8.17.3", + "@cspell/cspell-types": "8.17.3", + "@cspell/dynamic-import": "8.17.3", + "@cspell/filetypes": "8.17.3", + "@cspell/strong-weak-map": "8.17.3", + "@cspell/url": "8.17.3", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.17.2", - "cspell-dictionary": "8.17.2", - "cspell-glob": "8.17.2", - "cspell-grammar": "8.17.2", - "cspell-io": "8.17.2", - "cspell-trie-lib": "8.17.2", + "cspell-config-lib": "8.17.3", + "cspell-dictionary": "8.17.3", + "cspell-glob": "8.17.3", + "cspell-grammar": "8.17.3", + "cspell-io": "8.17.3", + "cspell-trie-lib": "8.17.3", "env-paths": "^3.0.0", "fast-equals": "^5.2.2", "gensequence": "^7.0.0", @@ -708,12 +791,13 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.17.2", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.17.2.tgz", - "integrity": "sha512-Bw9q8EWFihkQGo8fNdfkUqYOTsC161+wrQxR7m74K4bKEmQgm0mS0sLHKUwxEOZVGGLmIw9dMQl+8WnTgqOaMQ==", + "version": "8.17.3", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.17.3.tgz", + "integrity": "sha512-6LE5BeT2Rwv0bkQckpxX0K1fnFCWfeJ8zVPFtYOaix0trtqj0VNuwWzYDnxyW+OwMioCH29yRAMODa+JDFfUrA==", + "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.17.2", - "@cspell/cspell-types": "8.17.2", + "@cspell/cspell-pipe": "8.17.3", + "@cspell/cspell-types": "8.17.3", "gensequence": "^7.0.0" }, "engines": { @@ -724,6 +808,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", + "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -735,6 +820,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -747,6 +833,7 @@ "version": "5.2.2", "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.2.2.tgz", "integrity": "sha512-V7/RktU11J3I36Nwq2JnZEM7tNm17eBJz+u25qdxBZeCKiX6BkVSZQjwWIr+IobgnZy+ag73tTZgZi7tr0LrBw==", + "license": "MIT", "engines": { "node": ">=6.0.0" } @@ -772,6 +859,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -783,6 +871,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz", "integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==", + "license": "MIT", "engines": { "node": ">=18" }, @@ -811,6 +900,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/gensequence/-/gensequence-7.0.0.tgz", "integrity": "sha512-47Frx13aZh01afHJTB3zTtKIlFI6vWY+MYCN9Qpew6i52rfKjnhCF/l1YlC8UmEMvvntZZ6z4PiCcmyuedR2aQ==", + "license": "MIT", "engines": { "node": ">=18" } @@ -831,6 +921,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", "integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==", + "license": "MIT", "dependencies": { "ini": "4.1.1" }, @@ -845,14 +936,16 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -868,6 +961,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "license": "MIT", "dependencies": { "callsites": "^3.0.0" }, @@ -879,6 +973,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "license": "MIT", "engines": { "node": ">=4" } @@ -887,6 +982,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -896,6 +992,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", + "license": "ISC", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } @@ -904,6 +1001,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -925,6 +1023,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -937,6 +1036,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz", "integrity": "sha512-uo0Z9JJeWzv8BG+tRcapBKNJ0dro9cLyczGzulS6EfeyAdeC9sbojtW6XwvYxJkEne9En+J2XEl4zyglVeIwFg==", + "license": "MIT", "dependencies": { "callsites": "^3.1.0" }, @@ -948,6 +1048,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -959,6 +1060,7 @@ "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "license": "MIT", "engines": { "node": ">=0.10" } @@ -967,6 +1069,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "license": "MIT", "engines": { "node": ">=8" } @@ -1022,6 +1125,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -1032,17 +1136,20 @@ "node_modules/vscode-languageserver-textdocument": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", - "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==" + "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==", + "license": "MIT" }, "node_modules/vscode-uri": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", - "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==", + "license": "MIT" }, "node_modules/xdg-basedir": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -1054,6 +1161,7 @@ "version": "2.7.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", + "license": "ISC", "bin": { "yaml": "bin.mjs" }, diff --git a/package.json b/package.json index 09386166ef..9cda852c7c 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.17.2" + "cspell": "^8.17.3" } } From e0efc46871cfe78b12b47cf778024faae0ee61d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:48:04 +0000 Subject: [PATCH 577/845] Bump Roslynator.Analyzers from 4.12.10 to 4.12.11 Bumps [Roslynator.Analyzers](https://github.com/dotnet/roslynator) from 4.12.10 to 4.12.11. - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.12.10...v4.12.11) --- updated-dependencies: - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 9d396e38fb..409d83d342 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive
- + all runtime; build; native; contentfiles; analyzers; buildtransitive From 089211fe9e345260585e70a2ac87f1540b3b7b67 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:44:46 +0000 Subject: [PATCH 578/845] Bump TUnit from 0.7.24 to 0.10.6 Bumps [TUnit](https://github.com/thomhurst/TUnit) from 0.7.24 to 0.10.6. - [Release notes](https://github.com/thomhurst/TUnit/releases) - [Commits](https://github.com/thomhurst/TUnit/compare/v0.7.24...v0.10.6) --- updated-dependencies: - dependency-name: TUnit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 68546f3aa1..1f361d5650 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -11,7 +11,7 @@ - + From 7b53b8a82c36a48a7ae4bb14cd81c4f338187e41 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Fri, 24 Jan 2025 20:53:49 +0100 Subject: [PATCH 579/845] Improves the subject identification for chained assertions and those that use Which --- Src/FluentAssertions/AndWhichConstraint.cs | 23 ++++ .../CallerStatementBuilder.cs | 51 +++++---- .../CallerIdentification/ParsingState.cs | 19 +++- .../SemicolonParsingStrategy.cs | 2 +- .../ShouldCallParsingStrategy.cs | 46 +++++--- .../WhichParsingStrategy.cs | 54 ++++++++++ Src/FluentAssertions/CallerIdentifier.cs | 62 +++++++---- .../GenericCollectionAssertions.cs | 6 +- .../Common/StringExtensions.cs | 13 +-- .../Execution/AssertionChain.cs | 45 +++----- .../Execution/SubjectIdentificationBuilder.cs | 102 ++++++++++++++++++ .../Types/MemberInfoAssertions.cs | 2 +- Src/FluentAssertions/Types/TypeAssertions.cs | 8 +- .../FluentAssertions/net47.verified.txt | 2 + .../FluentAssertions/net6.0.verified.txt | 2 + .../netstandard2.0.verified.txt | 2 + .../netstandard2.1.verified.txt | 2 + .../AndWhichConstraintSpecs.cs | 3 +- .../Execution/CallerIdentificationSpecs.cs | 63 +++++++++++ .../Types/MethodInfoAssertionSpecs.cs | 14 --- docs/_pages/releases.md | 3 + 21 files changed, 404 insertions(+), 120 deletions(-) create mode 100644 Src/FluentAssertions/CallerIdentification/WhichParsingStrategy.cs create mode 100644 Src/FluentAssertions/Execution/SubjectIdentificationBuilder.cs diff --git a/Src/FluentAssertions/AndWhichConstraint.cs b/Src/FluentAssertions/AndWhichConstraint.cs index 49df87657e..37d6183a47 100644 --- a/Src/FluentAssertions/AndWhichConstraint.cs +++ b/Src/FluentAssertions/AndWhichConstraint.cs @@ -47,12 +47,29 @@ public AndWhichConstraint(TParent parent, TSubject subject, AssertionChain asser /// /// If contains more than one object, a clear exception is thrown. /// + // REFACTOR: In a next major version, we need to remove this overload and make the AssertionChain required public AndWhichConstraint(TParent parent, IEnumerable subjects) : base(parent) { getSubject = new Lazy(() => Single(subjects)); } + /// + /// Creates an object that allows continuing an assertion executed through and + /// which resulted in a potential collection of objects through on an + /// existing . + /// + /// + /// If contains more than one object, a clear exception is thrown. + /// + public AndWhichConstraint(TParent parent, IEnumerable subjects, AssertionChain assertionChain) + : base(parent) + { + getSubject = new Lazy(() => Single(subjects)); + + this.assertionChain = assertionChain; + } + /// /// Creates an object that allows continuing an assertion executed through and /// which resulted in a potential collection of objects through on an @@ -108,6 +125,12 @@ public TSubject Which { assertionChain.WithCallerPostfix(pathPostfix).ReuseOnce(); } + else + { + // Make sure the caller identification restarts with the code following the Which property. + assertionChain?.AdvanceToNextIdentifier(); + assertionChain?.ReuseOnce(); + } return getSubject.Value; } diff --git a/Src/FluentAssertions/CallerIdentification/CallerStatementBuilder.cs b/Src/FluentAssertions/CallerIdentification/CallerStatementBuilder.cs index 7f922f2009..543338a3f0 100644 --- a/Src/FluentAssertions/CallerIdentification/CallerStatementBuilder.cs +++ b/Src/FluentAssertions/CallerIdentification/CallerStatementBuilder.cs @@ -4,48 +4,62 @@ namespace FluentAssertions.CallerIdentification; +// REFACTOR: This is not a builder, but a parser, so rename it accordingly. internal class CallerStatementBuilder { private readonly StringBuilder statement; - private readonly List priorityOrderedParsingStrategies; - private ParsingState parsingState = ParsingState.InProgress; + private readonly List parsingStrategies; + private readonly List candidates = new(); + private ParsingState state = ParsingState.InProgress; internal CallerStatementBuilder() { statement = new StringBuilder(); - priorityOrderedParsingStrategies = + parsingStrategies = [ new QuotesParsingStrategy(), new MultiLineCommentParsingStrategy(), new SingleLineCommentParsingStrategy(), new SemicolonParsingStrategy(), new ShouldCallParsingStrategy(), + new WhichParsingStrategy(), new AwaitParsingStrategy(), new AddNonEmptySymbolParsingStrategy() ]; } - internal void Append(string symbols) + /// + /// Gets the identifiers preceding a Should or Which clause as extracted from lines of code passed to + /// + public string[] Identifiers => candidates.ToArray(); + + public void Append(string symbols) { using var symbolEnumerator = symbols.GetEnumerator(); - while (symbolEnumerator.MoveNext() && parsingState != ParsingState.Done) + while (symbolEnumerator.MoveNext() && state != ParsingState.Completed) { - var hasParsingStrategyWaitingForEndContext = priorityOrderedParsingStrategies - .Exists(s => s.IsWaitingForContextEnd()); + // The logic ensures that parsing does not continue with irrelevant strategies when a strategy is currently in the middle + // of a multi-symbol context (e.g., waiting for "_/" to match the beginning "/_"). In such cases, it skips over strategies + // that aren't waiting for the "end of context" while allowing the active (waiting) strategy to resume processing. + IEnumerable activeParsers = parsingStrategies; + if (parsingStrategies.Exists(s => s.IsWaitingForContextEnd())) + { + activeParsers = parsingStrategies.SkipWhile(parsingStrategy => !parsingStrategy.IsWaitingForContextEnd()); + } - parsingState = ParsingState.InProgress; + state = ParsingState.InProgress; - foreach (var parsingStrategy in - priorityOrderedParsingStrategies - .SkipWhile(parsingStrategy => - hasParsingStrategyWaitingForEndContext - && !parsingStrategy.IsWaitingForContextEnd())) + foreach (IParsingStrategy parser in activeParsers) { - parsingState = parsingStrategy.Parse(symbolEnumerator.Current, statement); + state = parser.Parse(symbolEnumerator.Current, statement); + if (state == ParsingState.CandidateFound) + { + candidates.Add(statement.ToString()); + } - if (parsingState != ParsingState.InProgress) + if (state != ParsingState.InProgress) { break; } @@ -57,11 +71,8 @@ internal void Append(string symbols) return; } - priorityOrderedParsingStrategies - .ForEach(strategy => strategy.NotifyEndOfLineReached()); + parsingStrategies.ForEach(strategy => strategy.NotifyEndOfLineReached()); } - internal bool IsDone() => parsingState == ParsingState.Done; - - public override string ToString() => statement.ToString(); + public bool IsDone() => state == ParsingState.Completed; } diff --git a/Src/FluentAssertions/CallerIdentification/ParsingState.cs b/Src/FluentAssertions/CallerIdentification/ParsingState.cs index 6548ae2627..18ac092068 100644 --- a/Src/FluentAssertions/CallerIdentification/ParsingState.cs +++ b/Src/FluentAssertions/CallerIdentification/ParsingState.cs @@ -2,7 +2,24 @@ internal enum ParsingState { + /// + /// Is returned by a parser when the next one can take a look at the current symbol + /// InProgress, + + /// + /// Is returned by a parser when it decides a symbol has been processed enough and no + /// other parsers need to look at the current symbol anymore. + /// GoToNextSymbol, - Done + + /// + /// Is returned by a parser if it has found a candidate identifier. + /// + CandidateFound, + + /// + /// Is returned by a parser to indicate that the parsing has been fully completed. + /// + Completed } diff --git a/Src/FluentAssertions/CallerIdentification/SemicolonParsingStrategy.cs b/Src/FluentAssertions/CallerIdentification/SemicolonParsingStrategy.cs index 17a6601cc0..c5480ef6b5 100644 --- a/Src/FluentAssertions/CallerIdentification/SemicolonParsingStrategy.cs +++ b/Src/FluentAssertions/CallerIdentification/SemicolonParsingStrategy.cs @@ -9,7 +9,7 @@ public ParsingState Parse(char symbol, StringBuilder statement) if (symbol is ';') { statement.Clear(); - return ParsingState.Done; + return ParsingState.Completed; } return ParsingState.InProgress; diff --git a/Src/FluentAssertions/CallerIdentification/ShouldCallParsingStrategy.cs b/Src/FluentAssertions/CallerIdentification/ShouldCallParsingStrategy.cs index 4ff4555312..e7a82a85dd 100644 --- a/Src/FluentAssertions/CallerIdentification/ShouldCallParsingStrategy.cs +++ b/Src/FluentAssertions/CallerIdentification/ShouldCallParsingStrategy.cs @@ -2,37 +2,49 @@ namespace FluentAssertions.CallerIdentification; +/// +/// Tries to determine if the statement ends with ".Should(" or ".Should.", and assumes +/// the preceding identifier is the actual identifier. +/// internal class ShouldCallParsingStrategy : IParsingStrategy { - private const string ShouldCall = ".Should"; + private const string ExpectedPhrase = ".Should"; public ParsingState Parse(char symbol, StringBuilder statement) { - if (statement.Length >= ShouldCall.Length + 1) + if (IsLongEnough(statement) && EndsWithExpectedPhrase(statement) && EndsWithInvocation(statement)) { - var leftIndex = statement.Length - 2; - var rightIndex = ShouldCall.Length - 1; + // Remove the ".Should." or ".Should(" part from the statement, so we keep the actual identifier + statement.Remove(statement.Length - (ExpectedPhrase.Length + 1), ExpectedPhrase.Length + 1); + return ParsingState.CandidateFound; + } - for (var i = 0; i < ShouldCall.Length; i++) - { - if (statement[leftIndex - i] != ShouldCall[rightIndex - i]) - { - return ParsingState.InProgress; - } - } + return ParsingState.InProgress; + } + + private static bool IsLongEnough(StringBuilder statement) => statement.Length >= ExpectedPhrase.Length + 1; - if (statement[^1] is not ('(' or '.')) + private static bool EndsWithExpectedPhrase(StringBuilder statement) + { + // Start from the index on the character just before the last ( or . + var rightIndexInStatement = statement.Length - 2; + + var rightIndexInExpectedPhrase = ExpectedPhrase.Length - 1; + + // Do a reverse comparison to see if the statement ends with ".Should" + for (var i = 0; i < ExpectedPhrase.Length; i++) + { + if (statement[rightIndexInStatement - i] != ExpectedPhrase[rightIndexInExpectedPhrase - i]) { - return ParsingState.InProgress; + return false; } - - statement.Remove(statement.Length - (ShouldCall.Length + 1), ShouldCall.Length + 1); - return ParsingState.Done; } - return ParsingState.InProgress; + return true; } + private static bool EndsWithInvocation(StringBuilder statement) => statement[^1] is '(' or '.'; + public bool IsWaitingForContextEnd() { return false; diff --git a/Src/FluentAssertions/CallerIdentification/WhichParsingStrategy.cs b/Src/FluentAssertions/CallerIdentification/WhichParsingStrategy.cs new file mode 100644 index 0000000000..872deb78e5 --- /dev/null +++ b/Src/FluentAssertions/CallerIdentification/WhichParsingStrategy.cs @@ -0,0 +1,54 @@ +using System.Text; + +namespace FluentAssertions.CallerIdentification; + +/// +/// Tries to find the .Which. construct and assumes everything preceding it has become irrelevant +/// for the chained assertion. +/// +internal class WhichParsingStrategy : IParsingStrategy +{ + private const string ExpectedPhrase = ".Which."; + + public ParsingState Parse(char symbol, StringBuilder statement) + { + if (IsLongEnough(statement) && EndsWithExpectedPhrase(statement)) + { + // Remove everything we collected up to know and assume everything following the + // .Which. property is a new assertion + statement.Clear(); + } + + return ParsingState.InProgress; + } + + private static bool IsLongEnough(StringBuilder statement) => statement.Length >= ExpectedPhrase.Length; + + private static bool EndsWithExpectedPhrase(StringBuilder statement) + { + // Start from the index of the last character + var rightIndexInStatement = statement.Length - 1; + + var rightIndexInExpectedPhrase = ExpectedPhrase.Length - 1; + + // Do a reverse comparison to see if the statement ends with ".Which." + for (var i = 0; i < ExpectedPhrase.Length; i++) + { + if (statement[rightIndexInStatement - i] != ExpectedPhrase[rightIndexInExpectedPhrase - i]) + { + return false; + } + } + + return true; + } + + public bool IsWaitingForContextEnd() + { + return false; + } + + public void NotifyEndOfLineReached() + { + } +} diff --git a/Src/FluentAssertions/CallerIdentifier.cs b/Src/FluentAssertions/CallerIdentifier.cs index fc815fc972..afa39a93bb 100644 --- a/Src/FluentAssertions/CallerIdentifier.cs +++ b/Src/FluentAssertions/CallerIdentifier.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; @@ -19,9 +20,28 @@ public static class CallerIdentifier { public static Action Logger { get; set; } = _ => { }; + /// + /// Gets the identifier that precedes the first Should call in the chain. + /// public static string DetermineCallerIdentity() { - string caller = null; + return DetermineCallerIdentities().FirstOrDefault(); + } + + /// + /// Gets all identifiers of all assertions in order of appearance. + /// + /// + /// For example, given the following code + /// collection.Should().ContainSingle() + /// .Which.Parameters.Should().ContainSingle() + /// .Which.Should().Be(3) + /// + /// will return collection, Parameters and an empty string. + /// + public static string[] DetermineCallerIdentities() + { + string[] callers = []; try { @@ -57,7 +77,7 @@ public static string DetermineCallerIdentity() && !IsCustomAssertion(frame) && !IsCurrentAssembly(frame)) { - caller = ExtractVariableNameFrom(frame); + callers = ExtractCallersFrom(frame).ToArray(); break; } } @@ -68,7 +88,7 @@ public static string DetermineCallerIdentity() Logger(e.ToString()); } - return caller; + return callers; } private sealed class StackFrameReference : IDisposable @@ -169,26 +189,23 @@ private static bool IsCompilerServices(StackFrame frame) return frame.GetMethod()?.DeclaringType?.Namespace is "System.Runtime.CompilerServices"; } - private static string ExtractVariableNameFrom(StackFrame frame) + private static IEnumerable ExtractCallersFrom(StackFrame frame) { - string caller = null; - string statement = GetSourceCodeStatementFrom(frame); + string[] identifiers = GetCallerIdentifiersFrom(frame); - if (!string.IsNullOrEmpty(statement)) + foreach (string identifier in identifiers) { - Logger(statement); + Logger(identifier); - if (!IsBooleanLiteral(statement) && !IsNumeric(statement) && !IsStringLiteral(statement) && - !StartsWithNewKeyword(statement)) + if (!IsBooleanLiteral(identifier) && !IsNumeric(identifier) && !IsStringLiteral(identifier) && + !StartsWithNewKeyword(identifier)) { - caller = statement; + yield return identifier; } } - - return caller; } - private static string GetSourceCodeStatementFrom(StackFrame frame) + private static string[] GetCallerIdentifiersFrom(StackFrame frame) { string fileName = frame.GetFileName(); int expectedLineNumber = frame.GetFileLineNumber(); @@ -209,19 +226,18 @@ private static string GetSourceCodeStatementFrom(StackFrame frame) currentLine++; } - return currentLine == expectedLineNumber - && line != null - ? GetSourceCodeStatementFrom(frame, reader, line) + return currentLine == expectedLineNumber && line != null + ? GetCallerIdentifiersFrom(frame, reader, line) : null; } catch { // We don't care. Just assume the symbol file is not available or unreadable - return null; + return []; } } - private static string GetSourceCodeStatementFrom(StackFrame frame, StreamReader reader, string line) + private static string[] GetCallerIdentifiersFrom(StackFrame frame, StreamReader reader, string line) { int column = frame.GetFileColumnNumber(); @@ -230,15 +246,15 @@ private static string GetSourceCodeStatementFrom(StackFrame frame, StreamReader line = line.Substring(Math.Min(column - 1, line.Length - 1)); } - var sb = new CallerStatementBuilder(); + var parser = new CallerStatementBuilder(); do { - sb.Append(line); + parser.Append(line); } - while (!sb.IsDone() && (line = reader.ReadLine()) != null); + while (!parser.IsDone() && (line = reader.ReadLine()) != null); - return sb.ToString(); + return parser.Identifiers; } private static bool StartsWithNewKeyword(string candidate) diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index ebc69508e9..7984f73a72 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -725,7 +725,7 @@ public AndWhichConstraint Contain(T expected, matches = collection.Where(item => EqualityComparer.Default.Equals(item, expected)); } - return new AndWhichConstraint((TAssertions)this, matches); + return new AndWhichConstraint((TAssertions)this, matches, assertionChain); } /// @@ -775,9 +775,7 @@ public AndWhichConstraint Contain(Expression> pred matches = Subject.Where(func); } - assertionChain.WithCallerPostfix($"[{firstMatchingIndex}]").ReuseOnce(); - - return new AndWhichConstraint((TAssertions)this, matches); + return new AndWhichConstraint((TAssertions)this, matches, assertionChain, $"[{firstMatchingIndex}]"); } /// diff --git a/Src/FluentAssertions/Common/StringExtensions.cs b/Src/FluentAssertions/Common/StringExtensions.cs index b871f3f60a..9730aaf3b9 100644 --- a/Src/FluentAssertions/Common/StringExtensions.cs +++ b/Src/FluentAssertions/Common/StringExtensions.cs @@ -60,24 +60,25 @@ public static string EscapePlaceholders(this string value) => value.Replace("{", "{{", StringComparison.Ordinal).Replace("}", "}}", StringComparison.Ordinal); /// - /// Joins a string with one or more other strings using a specified separator. + /// Joins a string with another string using the specified separator. /// /// - /// Any string that is empty (including the original string) is ignored. + /// Any string that is empty or null (including the original string) is ignored. Also, if the second + /// string starts with an index operator, the separator is omitted. /// public static string Combine(this string @this, string other, string separator = ".") { - if (@this.Length == 0) + if (@this.IsNullOrEmpty()) { - return other.Length != 0 ? other : string.Empty; + return !other.IsNullOrEmpty() ? other : string.Empty; } - if (other.StartsWith('[')) + if (other is null || other.StartsWith('[')) { separator = string.Empty; } - return @this + separator + other; + return @this + separator + (other ?? ""); } /// diff --git a/Src/FluentAssertions/Execution/AssertionChain.cs b/Src/FluentAssertions/Execution/AssertionChain.cs index a565ca8d79..8be7c48ee9 100644 --- a/Src/FluentAssertions/Execution/AssertionChain.cs +++ b/Src/FluentAssertions/Execution/AssertionChain.cs @@ -17,14 +17,13 @@ public sealed class AssertionChain { private readonly Func getCurrentScope; private readonly ContextDataDictionary contextData = new(); + private readonly SubjectIdentificationBuilder identifierBuilder; private string fallbackIdentifier = "object"; - private Func getCallerIdentifier; private Func reason; private bool? succeeded; // We need to keep track of this because we don't want the second successful assertion hide the first unsuccessful assertion private Func expectation; - private string callerPostfix = string.Empty; private static readonly AsyncLocal Instance = new(); @@ -52,7 +51,7 @@ public void ReuseOnce() /// This property is used to track if the caller identifier has been customized using the /// method or similar methods that modify the identifier. /// - public bool HasOverriddenCallerIdentifier { get; private set; } + public bool HasOverriddenCallerIdentifier => identifierBuilder.HasOverriddenIdentifier; /// /// Either starts a new assertion chain, or, when was called, for once, will return @@ -68,31 +67,14 @@ public static AssertionChain GetOrCreate() } return new AssertionChain(() => AssertionScope.Current, - () => FluentAssertions.CallerIdentifier.DetermineCallerIdentity()); + () => FluentAssertions.CallerIdentifier.DetermineCallerIdentities()); } - private AssertionChain(Func getCurrentScope, Func getCallerIdentifier) + private AssertionChain(Func getCurrentScope, Func getCallerIdentifiers) { this.getCurrentScope = getCurrentScope; - this.getCallerIdentifier = () => - { - var scopeName = getCurrentScope().Name(); - var callerIdentifier = getCallerIdentifier(); - - if (scopeName is null) - { - return callerIdentifier; - } - else if (callerIdentifier is null) - { - return scopeName; - } - else - { - return $"{scopeName}/{callerIdentifier}"; - } - }; + identifierBuilder = new SubjectIdentificationBuilder(getCallerIdentifiers, () => getCurrentScope().Name()); } /// @@ -102,7 +84,7 @@ private AssertionChain(Func getCurrentScope, Func getCal /// /// Can be overridden with . /// - public string CallerIdentifier => getCallerIdentifier() + callerPostfix; + public string CallerIdentifier => identifierBuilder.Build(); /// /// Adds an explanation of why the assertion is supposed to succeed to the scope. @@ -291,8 +273,7 @@ private Continuation FailWith(Func getFailureReason) /// public void OverrideCallerIdentifier(Func getCallerIdentifier) { - this.getCallerIdentifier = getCallerIdentifier; - HasOverriddenCallerIdentifier = true; + identifierBuilder.OverrideSubjectIdentifier(getCallerIdentifier); } /// @@ -305,12 +286,20 @@ public void OverrideCallerIdentifier(Func getCallerIdentifier) /// public AssertionChain WithCallerPostfix(string postfix) { - callerPostfix = postfix; - HasOverriddenCallerIdentifier = true; + identifierBuilder.UsePostfix(postfix); return this; } + /// + /// Marks the next assertion as being part of a chained call to Should where it needs to find the next + /// caller identifier. + /// + internal void AdvanceToNextIdentifier() + { + identifierBuilder.AdvanceToNextSubject(); + } + /// /// Adds some information to the assertion that will be included in the message /// that is emitted if an assertion fails. diff --git a/Src/FluentAssertions/Execution/SubjectIdentificationBuilder.cs b/Src/FluentAssertions/Execution/SubjectIdentificationBuilder.cs new file mode 100644 index 0000000000..b30f391c9f --- /dev/null +++ b/Src/FluentAssertions/Execution/SubjectIdentificationBuilder.cs @@ -0,0 +1,102 @@ +using System; +using FluentAssertions.Common; + +namespace FluentAssertions.Execution; + +/// +/// Responsible for constructing the code phrase that identifies the subject-under-test and which is used +/// in assertion failures managed by a single . +/// +/// +/// Takes into account the caller identifiers extracted from the invoking code, any scopes created through +/// (nested) instances of and modifications made by the +/// . +/// +internal class SubjectIdentificationBuilder +{ + private readonly Func getScopeName; + private readonly Lazy identifiersExtractedFromTheCode; + private int identifierIndex; + private Func getSubject; + + public SubjectIdentificationBuilder(Func getCallerIdentifiers, Func getScopeName) + { + this.getScopeName = getScopeName; + + identifiersExtractedFromTheCode = new(() => getCallerIdentifiers()); + + getSubject = () => GetIdentifier(0); + } + + /// + /// Tells the builder to assume the assertion has moved to the next identifier in a chained assertion. + /// + public void AdvanceToNextSubject() + { + identifierIndex++; + var localIndex = identifierIndex; + + getSubject = () => GetIdentifier(localIndex); + } + + /// + /// Indicates whether the subject identifier has been overridden with a custom value during the assertion process. + /// + /// + /// When or is called, + /// this property is set to true, signaling that a manually defined identifier is now used instead of + /// automatically constructed identifiers. + /// + public bool HasOverriddenIdentifier { get; private set; } + + /// + /// Completely overrides the construction process with the specified lazy-evaluated identifier. + /// + public void OverrideSubjectIdentifier(Func getSubject) + { + HasOverriddenIdentifier = true; + this.getSubject = getSubject; + } + + /// + /// Appends the given postfix to the current subject and combines that with next subject. + /// + /// + /// If the postfix is [0], the current identifier is collection, and the next one + /// is Parameters, this method will assume the subject is collection[0].Parameters. + /// + public void UsePostfix(string postfix) + { + var localIndex = identifierIndex; + getSubject = () => (GetIdentifier(localIndex) + postfix).Combine(GetIdentifier(localIndex + 1)); + + HasOverriddenIdentifier = true; + } + + /// + /// Returns the constructed subject identifier. + /// + public string Build() + { + var scopeName = getScopeName(); + var callerIdentifier = getSubject(); + + if (scopeName is null) + { + return callerIdentifier; + } + else if (callerIdentifier is null) + { + return scopeName; + } + else + { + return $"{scopeName}/{callerIdentifier}"; + } + } + + private string GetIdentifier(int index) + { + return identifiersExtractedFromTheCode.Value.Length > index ? identifiersExtractedFromTheCode.Value[index] : null; + } +} diff --git a/Src/FluentAssertions/Types/MemberInfoAssertions.cs b/Src/FluentAssertions/Types/MemberInfoAssertions.cs index 348d8f484f..3e214fd28c 100644 --- a/Src/FluentAssertions/Types/MemberInfoAssertions.cs +++ b/Src/FluentAssertions/Types/MemberInfoAssertions.cs @@ -104,7 +104,7 @@ public AndWhichConstraint, TAttribut ", but that attribute was not found."); } - return new AndWhichConstraint, TAttribute>(this, attributes); + return new AndWhichConstraint, TAttribute>(this, attributes, assertionChain); } /// diff --git a/Src/FluentAssertions/Types/TypeAssertions.cs b/Src/FluentAssertions/Types/TypeAssertions.cs index 1efa74d961..37699196a0 100644 --- a/Src/FluentAssertions/Types/TypeAssertions.cs +++ b/Src/FluentAssertions/Types/TypeAssertions.cs @@ -251,7 +251,7 @@ public AndWhichConstraint BeDecoratedWith(this, attributes); + return new AndWhichConstraint(this, attributes, assertionChain); } /// @@ -287,7 +287,7 @@ public AndWhichConstraint BeDecoratedWith(this, attributes); + return new AndWhichConstraint(this, attributes, assertionChain); } /// @@ -312,7 +312,7 @@ public AndWhichConstraint BeDecoratedWithOrInherit(this, attributes); + return new AndWhichConstraint(this, attributes, assertionChain); } /// @@ -348,7 +348,7 @@ public AndWhichConstraint BeDecoratedWithOrInherit(this, attributes); + return new AndWhichConstraint(this, attributes, assertionChain); } /// diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 125c549256..05b4c07fd9 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -19,6 +19,7 @@ namespace FluentAssertions { public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects) { } public AndWhichConstraint(TParent parent, TSubject subject) { } + public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects, FluentAssertions.Execution.AssertionChain assertionChain) { } public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects, FluentAssertions.Execution.AssertionChain assertionChain, string pathPostfix) { } public AndWhichConstraint(TParent parent, TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain, string pathPostfix = "") { } public TSubject Subject { get; } @@ -191,6 +192,7 @@ namespace FluentAssertions public static class CallerIdentifier { public static System.Action Logger { get; set; } + public static string[] DetermineCallerIdentities() { } public static string DetermineCallerIdentity() { } } [System.AttributeUsage(System.AttributeTargets.Method)] diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 0829729382..784751b7cd 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -19,6 +19,7 @@ namespace FluentAssertions { public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects) { } public AndWhichConstraint(TParent parent, TSubject subject) { } + public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects, FluentAssertions.Execution.AssertionChain assertionChain) { } public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects, FluentAssertions.Execution.AssertionChain assertionChain, string pathPostfix) { } public AndWhichConstraint(TParent parent, TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain, string pathPostfix = "") { } public TSubject Subject { get; } @@ -204,6 +205,7 @@ namespace FluentAssertions public static class CallerIdentifier { public static System.Action Logger { get; set; } + public static string[] DetermineCallerIdentities() { } public static string DetermineCallerIdentity() { } } [System.AttributeUsage(System.AttributeTargets.Method)] diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 8b4d66bb7d..0d8eb031a6 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -19,6 +19,7 @@ namespace FluentAssertions { public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects) { } public AndWhichConstraint(TParent parent, TSubject subject) { } + public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects, FluentAssertions.Execution.AssertionChain assertionChain) { } public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects, FluentAssertions.Execution.AssertionChain assertionChain, string pathPostfix) { } public AndWhichConstraint(TParent parent, TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain, string pathPostfix = "") { } public TSubject Subject { get; } @@ -189,6 +190,7 @@ namespace FluentAssertions public static class CallerIdentifier { public static System.Action Logger { get; set; } + public static string[] DetermineCallerIdentities() { } public static string DetermineCallerIdentity() { } } [System.AttributeUsage(System.AttributeTargets.Method)] diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 22504da4e3..fb4ece81e4 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -19,6 +19,7 @@ namespace FluentAssertions { public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects) { } public AndWhichConstraint(TParent parent, TSubject subject) { } + public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects, FluentAssertions.Execution.AssertionChain assertionChain) { } public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects, FluentAssertions.Execution.AssertionChain assertionChain, string pathPostfix) { } public AndWhichConstraint(TParent parent, TSubject subject, FluentAssertions.Execution.AssertionChain assertionChain, string pathPostfix = "") { } public TSubject Subject { get; } @@ -191,6 +192,7 @@ namespace FluentAssertions public static class CallerIdentifier { public static System.Action Logger { get; set; } + public static string[] DetermineCallerIdentities() { } public static string DetermineCallerIdentity() { } } [System.AttributeUsage(System.AttributeTargets.Method)] diff --git a/Tests/FluentAssertions.Specs/AndWhichConstraintSpecs.cs b/Tests/FluentAssertions.Specs/AndWhichConstraintSpecs.cs index a4aa52a96c..d59a6c423e 100644 --- a/Tests/FluentAssertions.Specs/AndWhichConstraintSpecs.cs +++ b/Tests/FluentAssertions.Specs/AndWhichConstraintSpecs.cs @@ -1,5 +1,6 @@ using System; using FluentAssertions.Collections; +using FluentAssertions.Execution; using Xunit; using Xunit.Sdk; @@ -11,7 +12,7 @@ public class AndWhichConstraintSpecs public void When_many_objects_are_provided_accessing_which_should_throw_a_descriptive_exception() { // Arrange - var continuation = new AndWhichConstraint(null, ["hello", "world"]); + var continuation = new AndWhichConstraint(null, ["hello", "world"], AssertionChain.GetOrCreate()); // Act Action act = () => _ = continuation.Which; diff --git a/Tests/FluentAssertions.Specs/Execution/CallerIdentificationSpecs.cs b/Tests/FluentAssertions.Specs/Execution/CallerIdentificationSpecs.cs index a298db914a..f9a5e33dd7 100644 --- a/Tests/FluentAssertions.Specs/Execution/CallerIdentificationSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/CallerIdentificationSpecs.cs @@ -2,11 +2,14 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; +using System.Reflection; using System.Threading.Tasks; using FluentAssertions; +using FluentAssertions.Common; using FluentAssertions.Equivalency; using FluentAssertions.Execution; using FluentAssertions.Extensions; +using FluentAssertions.Specs.Types; using Xunit; using Xunit.Sdk; @@ -31,6 +34,7 @@ public void Types_in_the_system_namespace_are_excluded_from_identification() public void Types_in_a_namespace_nested_under_system_are_excluded_from_identification() { // Act + // ReSharper disable once RedundantNameQualifier Action act = () => System.Data.NestedSystemNamespaceClass.AssertAgainstFailure(); // Assert @@ -41,6 +45,7 @@ public void Types_in_a_namespace_nested_under_system_are_excluded_from_identific public void Types_in_a_namespace_prefixed_with_system_are_excluded_from_identification() { // Act + // ReSharper disable once RedundantNameQualifier Action act = () => SystemPrefixed.SystemPrefixedNamespaceClass.AssertAgainstFailure(); // Assert @@ -154,6 +159,7 @@ public void When_the_caller_contains_multiple_members_it_should_include_them_all { // Arrange string test1 = "test1"; + var foo = new Foo { Field = "test3" @@ -172,6 +178,7 @@ public void When_the_caller_contains_multiple_members_across_multiple_lines_it_s { // Arrange string test1 = "test1"; + var foo = new Foo { Field = "test3" @@ -570,6 +577,62 @@ 5. Test node.Subject.Description.Should().StartWith("node.Subject.Description"); } + [Fact] + public void When_a_method_is_decorated_with_an_attribute_it_should_allow_chaining_assertions_on_it() + { + // Arrange + MethodInfo methodInfo = + typeof(ClassWithAllMethodsDecoratedWithDummyAttribute).GetParameterlessMethod("PublicDoNothing"); + + // Act + Action act = () => methodInfo.Should().BeDecoratedWith().Which.Filter.Should().BeFalse(); + + // Assert + act.Should().Throw().WithMessage("Expected Filter to be False, but found True."); + } + + [Fact] + public void Can_handle_chained_assertions() + { + // Arrange + var collection = new[] + { + new + { + Parameters = new[] { "a", "b", "c" } + } + }; + + // Act + Action act = () => collection.Should().ContainSingle().Which.Parameters[0].Should().Be("d"); + + // Assert + act.Should().Throw() + .WithMessage("Expected collection[0].Parameters[0] to be \"d\", but*"); + } + + [Fact] + public void Can_handle_chained_assertions_spread_over_multiple_lines() + { + // Arrange + var collection = new[] + { + new + { + Parameters = new[] { "a", "b", "c" } + } + }; + + // Act + Action act = () => collection.Should().ContainSingle() + .Which + .Parameters[0].Should().Be("d"); + + // Assert + act.Should().Throw() + .WithMessage("Expected collection[0].Parameters[0] to be \"d\", but*"); + } + [CustomAssertion] private string GetSubjectId() => AssertionChain.GetOrCreate().CallerIdentifier; } diff --git a/Tests/FluentAssertions.Specs/Types/MethodInfoAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Types/MethodInfoAssertionSpecs.cs index 83787028e9..2fc1b4af3b 100644 --- a/Tests/FluentAssertions.Specs/Types/MethodInfoAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/MethodInfoAssertionSpecs.cs @@ -223,20 +223,6 @@ public void When_asserting_a_class_is_decorated_with_MethodImpl_attribute_and_it "System.Runtime.CompilerServices.MethodImplAttribute, but the attribute was not found."); } - [Fact] - public void When_a_method_is_decorated_with_an_attribute_it_should_allow_chaining_assertions_on_it() - { - // Arrange - MethodInfo methodInfo = - typeof(ClassWithAllMethodsDecoratedWithDummyAttribute).GetParameterlessMethod("PublicDoNothing"); - - // Act - Action act = () => methodInfo.Should().BeDecoratedWith().Which.Filter.Should().BeFalse(); - - // Assert - act.Should().Throw(); - } - [Fact] public void When_asserting_a_method_is_decorated_with_an_attribute_but_it_is_not_it_throws_with_a_useful_message() { diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index b579e39a69..c966ea51ce 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -9,6 +9,9 @@ sidebar: ## 8.1.0 +### Improvements +* Improved subject identification when chaining multiple assertions using `Which` - [#3000](https://github.com/fluentassertions/fluentassertions/pull/3000) +* All `Should()` methods on reference types are now annotated with the `[NotNull]` attribute for a better Fluent Assertions experience when nullable reference types are enabled - [#2987](https://github.com/fluentassertions/fluentassertions/pull/2987) * Provide a toggle to suppress the soft warning that commercial use requires a paid license - [#2984](https://github.com/fluentassertions/fluentassertions/pull/2984) ## 8.0.0 From 32fa7388f7508ad0f778719cc7860f9e2bdf1624 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Fri, 7 Feb 2025 18:26:35 +0100 Subject: [PATCH 580/845] Rename CallerStatementBuilder to StatementParser Renamed the class to better reflect its responsibility as a parser rather than a builder. Adjusted all references to the class accordingly to maintain consistency. This improves clarity and aligns with naming conventions. --- .../{CallerStatementBuilder.cs => StatementParser.cs} | 5 ++--- Src/FluentAssertions/CallerIdentifier.cs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) rename Src/FluentAssertions/CallerIdentification/{CallerStatementBuilder.cs => StatementParser.cs} (94%) diff --git a/Src/FluentAssertions/CallerIdentification/CallerStatementBuilder.cs b/Src/FluentAssertions/CallerIdentification/StatementParser.cs similarity index 94% rename from Src/FluentAssertions/CallerIdentification/CallerStatementBuilder.cs rename to Src/FluentAssertions/CallerIdentification/StatementParser.cs index 543338a3f0..2b9497653d 100644 --- a/Src/FluentAssertions/CallerIdentification/CallerStatementBuilder.cs +++ b/Src/FluentAssertions/CallerIdentification/StatementParser.cs @@ -4,15 +4,14 @@ namespace FluentAssertions.CallerIdentification; -// REFACTOR: This is not a builder, but a parser, so rename it accordingly. -internal class CallerStatementBuilder +internal class StatementParser { private readonly StringBuilder statement; private readonly List parsingStrategies; private readonly List candidates = new(); private ParsingState state = ParsingState.InProgress; - internal CallerStatementBuilder() + internal StatementParser() { statement = new StringBuilder(); diff --git a/Src/FluentAssertions/CallerIdentifier.cs b/Src/FluentAssertions/CallerIdentifier.cs index afa39a93bb..358931da78 100644 --- a/Src/FluentAssertions/CallerIdentifier.cs +++ b/Src/FluentAssertions/CallerIdentifier.cs @@ -246,7 +246,7 @@ private static string[] GetCallerIdentifiersFrom(StackFrame frame, StreamReader line = line.Substring(Math.Min(column - 1, line.Length - 1)); } - var parser = new CallerStatementBuilder(); + var parser = new StatementParser(); do { From 34bd903a840408f5cc74fc3d9ecca94421dd4410 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 16:29:24 +0000 Subject: [PATCH 581/845] Bump Meziantou.Analyzer and Microsoft.NETFramework.ReferenceAssemblies Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) and [Microsoft.NETFramework.ReferenceAssemblies](https://github.com/Microsoft/dotnet). These dependencies needed to be updated together. Updates `Meziantou.Analyzer` from 2.0.186 to 2.0.187 - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.186...2.0.187) Updates `Microsoft.NETFramework.ReferenceAssemblies` from 1.0.3 to 1.0.3 - [Commits](https://github.com/Microsoft/dotnet/commits) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.NETFramework.ReferenceAssemblies dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 409d83d342..311033e83a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From ac82b9bd19779475d6657017795b1f57973bf483 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 16:24:51 +0000 Subject: [PATCH 582/845] Bump Microsoft.NET.Test.Sdk, Microsoft.NETFramework.ReferenceAssemblies and Newtonsoft.Json Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest), [Microsoft.NETFramework.ReferenceAssemblies](https://github.com/Microsoft/dotnet) and [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json). These dependencies needed to be updated together. Updates `Microsoft.NET.Test.Sdk` from 17.12.0 to 17.13.0 - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.12.0...v17.13.0) Updates `Microsoft.NETFramework.ReferenceAssemblies` from 1.0.3 to 1.0.3 - [Commits](https://github.com/Microsoft/dotnet/commits) Updates `Newtonsoft.Json` from 13.0.3 to 13.0.1 - [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases) - [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/13.0.3...13.0.1) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Microsoft.NETFramework.ReferenceAssemblies dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Newtonsoft.Json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 2 +- Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 6d9eaceee4..791e7a7605 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -5,7 +5,7 @@ - + all diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index a5bcdce878..4b17da6c53 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -10,7 +10,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 4450f2c3db..94d8b7fb0b 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj index 346aca047a..7ec6f151de 100644 --- a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj +++ b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index d075613994..89a93dede5 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index 75dd07d7a1..56fce6a867 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj index a675828fc8..d53fd12997 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj +++ b/Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj @@ -11,7 +11,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj index b5a1275982..d98ecf1f3a 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -8,7 +8,7 @@ - + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index 565b679012..facac32944 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -8,7 +8,7 @@ - + diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index b558486990..d852640e63 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -6,7 +6,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive From 1823e76696858f62a5cc709d462bdc797762a0b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 16:19:16 +0000 Subject: [PATCH 583/845] Bump Microsoft.NETFramework.ReferenceAssemblies and Roslynator.Analyzers Bumps [Microsoft.NETFramework.ReferenceAssemblies](https://github.com/Microsoft/dotnet) and [Roslynator.Analyzers](https://github.com/dotnet/roslynator). These dependencies needed to be updated together. Updates `Microsoft.NETFramework.ReferenceAssemblies` from 1.0.3 to 1.0.3 - [Commits](https://github.com/Microsoft/dotnet/commits) Updates `Roslynator.Analyzers` from 4.12.11 to 4.13.0 - [Release notes](https://github.com/dotnet/roslynator/releases) - [Changelog](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) - [Commits](https://github.com/dotnet/roslynator/compare/v4.12.11...v4.13.0) --- updated-dependencies: - dependency-name: Microsoft.NETFramework.ReferenceAssemblies dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Roslynator.Analyzers dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 311033e83a..2f23cead51 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 4f452e1a942f84f519d07ea3f7f9636c29611aec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 18:07:32 +0000 Subject: [PATCH 584/845] Bump the xunit group with 3 updates Bumps the xunit group with 3 updates: [Verify.Xunit](https://github.com/VerifyTests/Verify), [xunit.v3.core](https://github.com/xunit/xunit) and [Microsoft.NETFramework.ReferenceAssemblies](https://github.com/Microsoft/dotnet). Updates `Verify.Xunit` from 28.9.0 to 28.10.1 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/28.9.0...28.10.1) Updates `xunit.v3.core` from 1.0.1 to 1.1.0 - [Commits](https://github.com/xunit/xunit/commits) Updates `Microsoft.NETFramework.ReferenceAssemblies` from 1.0.3 to 1.0.3 - [Commits](https://github.com/Microsoft/dotnet/commits) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit - dependency-name: xunit.v3.core dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit - dependency-name: Microsoft.NETFramework.ReferenceAssemblies dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 791e7a7605..169d827da4 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index facac32944..59089025d2 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -9,7 +9,7 @@ - + From 898c336fba59c883ae013619a18eab099d40421f Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 10 Feb 2025 20:32:12 +0100 Subject: [PATCH 585/845] ReportGenerator 5.4.1 -> 5.4.4 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 1c2cc869f9..504b3f3f65 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -20,7 +20,7 @@ - + From 049b6b2dd59b93108a4490e30632a5e173da8b0d Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 10 Feb 2025 20:32:47 +0100 Subject: [PATCH 586/845] xunit.runner.console 2.9.2 -> 2.9.3 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 504b3f3f65..548508b78a 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -21,7 +21,7 @@ - + From 5db0bc18a2ea0fb4f94472750dd335f4363aa6c1 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 10 Feb 2025 20:34:12 +0100 Subject: [PATCH 587/845] Remove unused build constants --- Build/_build.csproj | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 548508b78a..31894d6f91 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -9,15 +9,6 @@ 9.0.4 1 - - OS_WINDOWS - - - OS_LINUX - - - OS_MAC - From d56fea934dd4a7138c25f471fc7aa9b29be6583b Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 10 Feb 2025 21:01:55 +0100 Subject: [PATCH 588/845] Microsoft.NET.Test.Sdk 17.12.0 -> 17.13.0 --- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- .../FluentAssertions.Extensibility.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index d818e162a9..6437ee9643 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -21,7 +21,7 @@ - + diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 3339b6fd79..200a3b5aa8 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -10,7 +10,7 @@ - + diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 3ad4e54785..ac59d95b02 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -21,7 +21,7 @@ - + From 64f88501d294222b70139c7518646925e1bb3098 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 10 Feb 2025 21:06:10 +0100 Subject: [PATCH 589/845] Downgrade System.Collections.Immutable again Could be related to https://github.com/dependabot/dependabot-core/issues/4075 https://github.com/dependabot/dependabot-core/issues/11398 --- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 6437ee9643..77c4b66723 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -17,7 +17,7 @@ FluentAssertions.Specs.csproj for net47 does not generate a binding redirect from 4.0.4.0 to 4.0.4.1 Upgrading to 1.6.0 gives "Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0" --> - + diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index ac59d95b02..233682d337 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -17,7 +17,7 @@ FluentAssertions.Specs.csproj for net47 does not generate a binding redirect from 4.0.4.0 to 4.0.4.1 Upgrading to 1.6.0 gives "Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0" --> - + From e6b7670dca5e7b10a14e2768862d2198043e2eb9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 18:08:03 +0000 Subject: [PATCH 590/845] Bump NUnit3TestAdapter from 4.6.0 to 5.0.0 in the nunit group Bumps the nunit group with 1 update: [NUnit3TestAdapter](https://github.com/nunit/nunit3-vs-adapter). Updates `NUnit3TestAdapter` from 4.6.0 to 5.0.0 - [Release notes](https://github.com/nunit/nunit3-vs-adapter/releases) - [Commits](https://github.com/nunit/nunit3-vs-adapter/compare/V4.6.0...V5.0.0) --- updated-dependencies: - dependency-name: NUnit3TestAdapter dependency-type: direct:production update-type: version-update:semver-major dependency-group: nunit ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index 89a93dede5..abae2907ef 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -13,7 +13,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index 56fce6a867..fe9dc463b6 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -13,7 +13,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 3dd8243e396432a55dd12a74a5a548a5f085fac5 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Thu, 28 Nov 2024 19:20:09 +0100 Subject: [PATCH 591/845] Fixed a regression in which CompleteWithinAsync treated a canceled task as an exception. --- .../Specialized/AsyncFunctionAssertions.cs | 11 +- .../GenericAsyncFunctionAssertions.cs | 2 +- .../Specialized/TaskAssertionSpecs.cs | 78 +++++++++++ .../TaskCompletionSourceAssertionSpecs.cs | 128 ++++++++++++++++++ .../Specialized/TaskOfTAssertionSpecs.cs | 42 ++++++ docs/_pages/releases.md | 4 + 6 files changed, 258 insertions(+), 7 deletions(-) diff --git a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs index 2a80ef257e..75d0fc0e64 100644 --- a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs @@ -60,7 +60,7 @@ public async Task> CompleteWithinAsync( if (success) { - bool completesWithinTimeout = await CompletesWithinTimeoutAsync(task, remainingTime); + bool completesWithinTimeout = await CompletesWithinTimeoutAsync(task, remainingTime, _ => Task.CompletedTask); Execute.Assertion .ForCondition(completesWithinTimeout) @@ -97,7 +97,7 @@ public async Task> NotCompleteWithinAsync( if (remainingTime >= TimeSpan.Zero) { - bool completesWithinTimeout = await CompletesWithinTimeoutAsync(task, remainingTime); + bool completesWithinTimeout = await CompletesWithinTimeoutAsync(task, remainingTime, _ => Task.CompletedTask); Execute.Assertion .ForCondition(!completesWithinTimeout) @@ -271,7 +271,7 @@ private async Task InvokeWithInterceptionAsync(TimeSpan timeout) // Here we do not need to know whether the task completes (successfully) in timeout // or does not complete. We are only interested in the exception which is thrown, not returned. // So, we can ignore the result. - _ = await CompletesWithinTimeoutAsync(task, remainingTime); + _ = await CompletesWithinTimeoutAsync(task, remainingTime, cancelledTask => cancelledTask); } return null; @@ -431,7 +431,7 @@ private protected (TTask result, TimeSpan remainingTime) InvokeWithTimer(TimeSpa /// /// Monitors the specified task whether it completes withing the remaining time span. /// - private protected async Task CompletesWithinTimeoutAsync(Task target, TimeSpan remainingTime) + private protected async Task CompletesWithinTimeoutAsync(Task target, TimeSpan remainingTime, Func onTaskCanceled) { using var delayCancellationTokenSource = new CancellationTokenSource(); @@ -452,8 +452,7 @@ private protected async Task CompletesWithinTimeoutAsync(Task target, Time if (target.IsCanceled) { - // Rethrow the exception causing the task be canceled. - await target; + await onTaskCanceled(target); } // The monitored task is completed, we shall cancel the clock. diff --git a/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs index d389955d0e..65dc8260cb 100644 --- a/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs @@ -51,7 +51,7 @@ public GenericAsyncFunctionAssertions(Func> subject, IExtractExcep if (success) { - bool completesWithinTimeout = await CompletesWithinTimeoutAsync(task, remainingTime); + bool completesWithinTimeout = await CompletesWithinTimeoutAsync(task, remainingTime, _ => Task.CompletedTask); success = Execute.Assertion .ForCondition(completesWithinTimeout) diff --git a/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs index dcab1926ff..8dac3e4c20 100644 --- a/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/TaskAssertionSpecs.cs @@ -104,6 +104,46 @@ public async Task When_task_completes_late_it_should_fail() // Assert await action.Should().ThrowAsync(); } + + [Fact] + public async Task Canceled_tasks_are_also_completed() + { + // Arrange + var timer = new FakeClock(); + var taskFactory = new TaskCompletionSource(); + + // Act + Func action = () => taskFactory + .Awaiting(t => (Task)t.Task) + .Should(timer) + .CompleteWithinAsync(100.Milliseconds()); + + taskFactory.SetCanceled(); + timer.Complete(); + + // Assert + await action.Should().NotThrowAsync(); + } + + [Fact] + public async Task Excepted_tasks_unexpectedly_completed() + { + // Arrange + var timer = new FakeClock(); + var taskFactory = new TaskCompletionSource(); + + // Act + Func action = () => taskFactory + .Awaiting(t => (Task)t.Task) + .Should(timer) + .CompleteWithinAsync(100.Milliseconds()); + + taskFactory.SetException(new OperationCanceledException()); + timer.Complete(); + + // Assert + await action.Should().ThrowAsync(); + } } public class NotCompleteWithinAsync @@ -185,6 +225,44 @@ public async Task When_task_completes_late_it_should_succeed() // Assert await action.Should().NotThrowAsync(); } + + [Fact] + public async Task Canceled_tasks_are_also_completed() + { + // Arrange + var timer = new FakeClock(); + var taskFactory = new TaskCompletionSource(); + + // Act + Func action = () => taskFactory + .Awaiting(t => (Task)t.Task).Should(timer) + .NotCompleteWithinAsync(100.Milliseconds()); + + taskFactory.SetCanceled(); + timer.Complete(); + + // Assert + await action.Should().ThrowAsync(); + } + + [Fact] + public async Task Excepted_tasks_unexpectedly_completed() + { + // Arrange + var timer = new FakeClock(); + var taskFactory = new TaskCompletionSource(); + + // Act + Func action = () => taskFactory + .Awaiting(t => (Task)t.Task).Should(timer) + .NotCompleteWithinAsync(100.Milliseconds()); + + taskFactory.SetException(new OperationCanceledException()); + timer.Complete(); + + // Assert + await action.Should().ThrowAsync(); + } } public class ThrowAsync diff --git a/Tests/FluentAssertions.Specs/Specialized/TaskCompletionSourceAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/TaskCompletionSourceAssertionSpecs.cs index 087c9b2d51..a3305f33b3 100644 --- a/Tests/FluentAssertions.Specs/Specialized/TaskCompletionSourceAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/TaskCompletionSourceAssertionSpecs.cs @@ -73,6 +73,38 @@ public async Task When_it_completes_in_time_and_it_is_not_expected_it_should_fai await action.Should().ThrowAsync().WithMessage("*to not complete within*because test testArg*"); } + [Fact] + public async Task When_it_is_canceled_before_completion_and_it_is_not_expected_it_should_fail() + { + // Arrange + var subject = new TaskCompletionSource(); + var timer = new FakeClock(); + + // Act + Func action = () => subject.Should(timer).NotCompleteWithinAsync(1.Seconds()); + subject.SetCanceled(); + timer.Complete(); + + // Assert + await action.Should().ThrowAsync(); + } + + [Fact] + public async Task When_it_throws_before_completion_and_it_is_not_expected_it_should_fail() + { + // Arrange + var subject = new TaskCompletionSource(); + var timer = new FakeClock(); + + // Act + Func action = () => subject.Should(timer).NotCompleteWithinAsync(1.Seconds()); + subject.SetException(new OperationCanceledException()); + timer.Complete(); + + // Assert + await action.Should().ThrowAsync(); + } + [Fact] public async Task When_it_did_not_complete_in_time_and_it_is_not_expected_it_should_succeed() { @@ -115,6 +147,38 @@ public async Task When_accidentally_using_equals_it_should_throw_a_helpful_error await action.Should().ThrowAsync() .WithMessage("Equals is not part of Fluent Assertions. Did you mean CompleteWithinAsync() instead?"); } + + [Fact] + public async Task Canceled_tasks_are_also_completed() + { + // Arrange + var subject = new TaskCompletionSource(); + var timer = new FakeClock(); + + // Act + Func action = () => subject.Should(timer).CompleteWithinAsync(1.Seconds()); + subject.SetCanceled(); + timer.Complete(); + + // Assert + await action.Should().NotThrowAsync(); + } + + [Fact] + public async Task Excepted_tasks_unexpectedly_completed() + { + // Arrange + var subject = new TaskCompletionSource(); + var timer = new FakeClock(); + + // Act + Func action = () => subject.Should(timer).CompleteWithinAsync(1.Seconds()); + subject.SetException(new OperationCanceledException()); + timer.Complete(); + + // Assert + await action.Should().NotThrowAsync(); + } } #endif @@ -136,6 +200,38 @@ public async Task When_it_completes_in_time_it_should_succeed() await action.Should().NotThrowAsync(); } + [Fact] + public async Task Canceled_tasks_do_not_return_default_value() + { + // Arrange + var subject = new TaskCompletionSource(); + var timer = new FakeClock(); + + // Act + Func action = () => subject.Should(timer).CompleteWithinAsync(1.Seconds()).WithResult(false); + subject.SetCanceled(); + timer.Complete(); + + // Assert + await action.Should().ThrowAsync(); + } + + [Fact] + public async Task Exception_throwing_tasks_do_not_cause_a_default_value_to_be_returned() + { + // Arrange + var subject = new TaskCompletionSource(); + var timer = new FakeClock(); + + // Act + Func action = () => subject.Should(timer).CompleteWithinAsync(1.Seconds()).WithResult(false); + subject.SetException(new OperationCanceledException()); + timer.Complete(); + + // Assert + await action.Should().ThrowAsync(); + } + [Fact] public async Task When_it_completes_in_time_and_result_is_expected_it_should_succeed() { @@ -251,6 +347,38 @@ await action.Should().ThrowAsync() .WithMessage("Did not expect*to complete within*because test testArg*"); } + [Fact] + public async Task Canceled_tasks_are_also_completed() + { + // Arrange + var subject = new TaskCompletionSource(); + var timer = new FakeClock(); + + // Act + Func action = () => subject.Should(timer).NotCompleteWithinAsync(1.Seconds()); + subject.SetCanceled(); + timer.Complete(); + + // Assert + await action.Should().ThrowAsync(); + } + + [Fact] + public async Task Excepted_tasks_unexpectedly_completed() + { + // Arrange + var subject = new TaskCompletionSource(); + var timer = new FakeClock(); + + // Act + Func action = () => subject.Should(timer).NotCompleteWithinAsync(1.Seconds()); + subject.SetException(new OperationCanceledException()); + timer.Complete(); + + // Assert + await action.Should().ThrowAsync(); + } + [Fact] public async Task When_it_did_not_complete_in_time_and_it_is_not_expected_it_should_succeed() { diff --git a/Tests/FluentAssertions.Specs/Specialized/TaskOfTAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/TaskOfTAssertionSpecs.cs index 31bd834ef8..ce7d03cb53 100644 --- a/Tests/FluentAssertions.Specs/Specialized/TaskOfTAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/TaskOfTAssertionSpecs.cs @@ -215,6 +215,48 @@ public async Task When_task_consumes_time_in_sync_portion_it_should_fail() // Assert await action.Should().ThrowAsync(); } + + [Fact] + public async Task Canceled_tasks_do_not_cause_a_default_value_to_be_returned() + { + // Arrange + var timer = new FakeClock(); + var taskFactory = new TaskCompletionSource(); + + // Act + Func action = () => taskFactory + .Awaiting(t => t.Task) + .Should(timer) + .CompleteWithinAsync(100.Milliseconds()) + .WithResult(0); + + taskFactory.SetCanceled(); + timer.Complete(); + + // Assert + await action.Should().ThrowAsync(); + } + + [Fact] + public async Task Exception_throwing_tasks_do_not_cause_a_default_value_to_be_returned() + { + // Arrange + var timer = new FakeClock(); + var taskFactory = new TaskCompletionSource(); + + // Act + Func action = () => taskFactory + .Awaiting(t => t.Task) + .Should(timer) + .CompleteWithinAsync(100.Milliseconds()) + .WithResult(0); + + taskFactory.SetException(new OperationCanceledException()); + timer.Complete(); + + // Assert + await action.Should().ThrowAsync(); + } } public class NotThrowAsync diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index cf5f1a03f1..2d3f7526cb 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -9,6 +9,10 @@ sidebar: ## 7.2.0 +### Fixes + +* Fixed a regression in which `CompleteWithinAsync` treated a canceled task as an exception - [#2853](https://github.com/fluentassertions/fluentassertions/pull/2853) + ### Improvements * Improve failure message for string assertions when checking for equality - [#2307](https://github.com/fluentassertions/fluentassertions/pull/2307) * All `Should()` methods on reference types are now annotated with the `[NotNull]` attribute for a better Fluent Assertions experience when nullable reference types are enabled - [#2987](https://github.com/fluentassertions/fluentassertions/pull/2987) From 886ac059047286720504bee5c5c546c5a271b4b4 Mon Sep 17 00:00:00 2001 From: Teal Date: Fri, 14 Feb 2025 01:19:42 -0500 Subject: [PATCH 592/845] Fixed typo in introduction page that incorrectly showed result of an assertion (#3019) --- docs/_pages/introduction.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_pages/introduction.md b/docs/_pages/introduction.md index 7f673f46fa..4fcbbc3464 100644 --- a/docs/_pages/introduction.md +++ b/docs/_pages/introduction.md @@ -170,7 +170,7 @@ The above will batch the two failures, and throw an exception at the point of di E.g. Exception thrown at point of dispose contains: ```text -Expected value to be 100, but found 95 (difference of -5). +Expected value to be 10, but found 5 (difference of -5). Expected string to be "Expected" with a length of 8, but "Actual" has a length of 6, differs near "Act" (index 0). ``` @@ -255,7 +255,7 @@ using (var innerScope = new AssertionScope()) Version 7 will remain fully open-source indefinitely and receive bugfixes and other important corrections. -Versions 8 and beyond are/will be free for open-source projects and non-commercial use, but commercial use requires a [paid license](https://xceed.com/products/unit-testing/fluent-assertions/). Check out the [license page](LICENSE) for more information. +Versions 8 and beyond are/will be free for open-source projects and non-commercial use, but commercial use requires a [paid license](https://xceed.com/products/unit-testing/fluent-assertions/). Check out the [license page](LICENSE) for more information. Since Fluent Assertions 8 doesn't need any license key, there's a soft warning that is displayed for every test run. This is to remind consumers that you need a paid license for commercial use. To suppress this warning, there's a static property called `License.Accepted` that can be set to `true`. You can add the following code to your test project to automatically toggle this flag. @@ -271,4 +271,4 @@ public static class AssertionEngineInitializer License.Accepted = true; } } -``` \ No newline at end of file +``` From d75eee32d3108c739adc184735342e9a06857133 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 16:41:40 +0000 Subject: [PATCH 593/845] Bump Verify.Xunit from 28.10.1 to 28.11.0 in the xunit group Bumps the xunit group with 1 update: [Verify.Xunit](https://github.com/VerifyTests/Verify). Updates `Verify.Xunit` from 28.10.1 to 28.11.0 - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/28.10.1...28.11.0) --- updated-dependencies: - dependency-name: Verify.Xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 169d827da4..7fc4bea4f2 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From f46c84f1c99754f54a6c56e31de434271fbbcf41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 16:51:01 +0000 Subject: [PATCH 594/845] Bump TUnit from 0.10.6 to 0.13.3 Bumps [TUnit](https://github.com/thomhurst/TUnit) from 0.10.6 to 0.13.3. - [Release notes](https://github.com/thomhurst/TUnit/releases) - [Commits](https://github.com/thomhurst/TUnit/compare/v0.10.6...v0.13.3) --- updated-dependencies: - dependency-name: TUnit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 1f361d5650..5419262afa 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -11,7 +11,7 @@ - + From ee5d4995ba76e98cde8f6fe46d9def1e4e71378e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 16:43:45 +0000 Subject: [PATCH 595/845] Bump Microsoft.Testing.Extensions.CodeCoverage from 17.13.1 to 17.14.1 Bumps [Microsoft.Testing.Extensions.CodeCoverage](https://github.com/microsoft/codecoverage) from 17.13.1 to 17.14.1. - [Commits](https://github.com/microsoft/codecoverage/commits) --- updated-dependencies: - dependency-name: Microsoft.Testing.Extensions.CodeCoverage dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 5419262afa..bd5f7d6470 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -13,7 +13,7 @@ - + From 09d3108fd5a1e2f5f2f627815e25f1177fb473e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 16:42:35 +0000 Subject: [PATCH 596/845] Bump the mstest group with 2 updates Bumps the mstest group with 2 updates: [MSTest.TestAdapter](https://github.com/microsoft/testfx) and [MSTest.TestFramework](https://github.com/microsoft/testfx). Updates `MSTest.TestAdapter` from 3.7.3 to 3.8.0 - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](https://github.com/microsoft/testfx/compare/v3.7.3...v3.8.0) Updates `MSTest.TestFramework` from 3.7.3 to 3.8.0 - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](https://github.com/microsoft/testfx/compare/v3.7.3...v3.8.0) --- updated-dependencies: - dependency-name: MSTest.TestAdapter dependency-type: direct:production update-type: version-update:semver-minor dependency-group: mstest - dependency-name: MSTest.TestFramework dependency-type: direct:production update-type: version-update:semver-minor dependency-group: mstest ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 94d8b7fb0b..a111f720c0 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + From e3693feef680a08d0f02d995270cd0833a9ff0da Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 15:55:01 +0100 Subject: [PATCH 597/845] Bump Microsoft.NETFramework.ReferenceAssemblies, System.Collections.Immutable and System.Reflection.Metadata (#3025) * Bump Microsoft.NETFramework.ReferenceAssemblies, System.Collections.Immutable and System.Reflection.Metadata Bumps [Microsoft.NETFramework.ReferenceAssemblies](https://github.com/Microsoft/dotnet), [System.Collections.Immutable](https://github.com/dotnet/runtime) and [System.Reflection.Metadata](https://github.com/dotnet/runtime). These dependencies needed to be updated together. Updates `Microsoft.NETFramework.ReferenceAssemblies` from 1.0.3 to 1.0.3 - [Commits](https://github.com/Microsoft/dotnet/commits) Updates `System.Collections.Immutable` from 1.5.0 to 9.0.2 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits/v9.0.2) Updates `System.Reflection.Metadata` from 8.0.1 to 9.0.2 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/compare/v8.0.1...v9.0.2) --- updated-dependencies: - dependency-name: Microsoft.NETFramework.ReferenceAssemblies dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Collections.Immutable dependency-type: direct:production update-type: version-update:semver-major - dependency-name: System.Reflection.Metadata dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * undo bumping System.Collections.Immutable --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jonas Nyrup --- Tests/Benchmarks/Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index 6f82f5aa8c..a5ec8efa58 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -12,6 +12,6 @@ - + From af8910f56ca8b9f898bd28b13312db091800a198 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Thu, 20 Feb 2025 22:24:52 +0100 Subject: [PATCH 598/845] Update releases.md --- docs/_pages/releases.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index d7464fb163..a6cfbbcac9 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -14,6 +14,10 @@ sidebar: * All `Should()` methods on reference types are now annotated with the `[NotNull]` attribute for a better Fluent Assertions experience when nullable reference types are enabled - [#2987](https://github.com/fluentassertions/fluentassertions/pull/2987) * Provide a toggle to suppress the soft warning that commercial use requires a paid license - [#2984](https://github.com/fluentassertions/fluentassertions/pull/2984) +## Fixes + +* Fixed a regression in which `CompleteWithinAsync` treated a canceled task as an exception - [#2853](https://github.com/fluentassertions/fluentassertions/pull/2853) + ## 8.0.0 ### License Change From 3405157e4372c17416329fbf958943d3afd7e999 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Fri, 21 Feb 2025 08:41:31 +0100 Subject: [PATCH 599/845] Fix a formatting exception when {} is used as a dictionary key. --- .../Matching/MustMatchByNameRule.cs | 6 ++-- .../Steps/AssertionRuleEquivalencyStep.cs | 6 ++-- .../Equivalency/Steps/EnumEqualityStep.cs | 11 ++++--- .../Steps/StringEqualityEquivalencyStep.cs | 4 +-- .../Execution/StringExtensions.cs | 24 ++++++++++++++ .../Execution/WithoutFormattingWrapper.cs | 11 +++++++ Src/FluentAssertions/Formatting/Formatter.cs | 1 + .../Formatting/PassthroughValueFormatter.cs | 17 ++++++++++ .../Specialized/ExceptionAssertions.cs | 5 +-- .../AssertionChainSpecs.MessageFormating.cs | 33 +++++++++++++++++++ docs/_pages/releases.md | 6 ++++ 11 files changed, 109 insertions(+), 15 deletions(-) create mode 100644 Src/FluentAssertions/Execution/StringExtensions.cs create mode 100644 Src/FluentAssertions/Execution/WithoutFormattingWrapper.cs create mode 100644 Src/FluentAssertions/Formatting/PassthroughValueFormatter.cs diff --git a/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs b/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs index e34bfa5076..e6f4633563 100644 --- a/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs +++ b/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs @@ -34,13 +34,13 @@ public IMember Match(IMember expectedMember, object subject, INode parent, IEqui if (subjectMember is null) { assertionChain.FailWith( - $"Expectation has {expectedMember.Expectation} that the other object does not have."); + "Expectation has {0} that the other object does not have.", expectedMember.Expectation.AsNonFormattable()); } else if (options.IgnoreNonBrowsableOnSubject && !subjectMember.IsBrowsable) { assertionChain.FailWith( - $"Expectation has {expectedMember.Expectation} that is non-browsable in the other object, and non-browsable " + - "members on the subject are ignored with the current configuration"); + "Expectation has {0} that is non-browsable in the other object, and non-browsable " + + "members on the subject are ignored with the current configuration", expectedMember.Expectation.AsNonFormattable()); } else { diff --git a/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs index 08498cb7dc..5911ff619d 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs @@ -72,12 +72,14 @@ private bool ExecuteAssertion(Comparands comparands, IEquivalencyValidationConte assertionChain .ForCondition(subjectIsNull || comparands.Subject.GetType().IsSameOrInherits(typeof(TSubject))) - .FailWith("Expected " + context.CurrentNode.Subject + " from subject to be a {0}{reason}, but found a {1}.", + .FailWith("Expected {0} from subject to be a {1}{reason}, but found a {2}.", + context.CurrentNode.Subject.AsNonFormattable(), typeof(TSubject), comparands.Subject?.GetType()) .Then .ForCondition(expectationIsNull || comparands.Expectation.GetType().IsSameOrInherits(typeof(TSubject))) .FailWith( - "Expected " + context.CurrentNode.Subject + " from expectation to be a {0}{reason}, but found a {1}.", + "Expected {0} from expectation to be a {1}{reason}, but found a {2}.", + context.CurrentNode.Subject.AsNonFormattable(), typeof(TSubject), comparands.Expectation?.GetType()); if (assertionChain.Succeeded) diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs b/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs index a089bdc445..70b21e82f9 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs @@ -29,7 +29,8 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon string expectationName = GetDisplayNameForEnumComparison(comparands.Expectation, expectationsUnderlyingValue); return new FailReason( - $"Expected {{context:enum}} to be equivalent to {expectationName}{{reason}}, but found {{0}}.", + "Expected {context:enum} to be equivalent to {0}{reason}, but found {1}.", + expectationName.AsNonFormattable(), comparands.Subject); }); @@ -67,7 +68,8 @@ private static void HandleByValue(AssertionChain assertionChain, Comparands comp string expectationName = GetDisplayNameForEnumComparison(comparands.Expectation, expectationsUnderlyingValue); return new FailReason( - $"Expected {{context:enum}} to equal {expectationName} by value{{reason}}, but found {subjectsName}."); + "Expected {context:enum} to equal {0} by value{reason}, but found {1}.", + expectationName.AsNonFormattable(), subjectsName.AsNonFormattable()); }); } @@ -88,7 +90,8 @@ private static void HandleByName(AssertionChain assertionChain, Comparands compa string expectationName = GetDisplayNameForEnumComparison(comparands.Expectation, expectationsUnderlyingValue); return new FailReason( - $"Expected {{context:enum}} to equal {expectationName} by name{{reason}}, but found {subjectsName}."); + "Expected {context:enum} to equal {0} by name{reason}, but found {1}.", + expectationName.AsNonFormattable(), subjectsName.AsNonFormattable()); }); } @@ -102,7 +105,7 @@ private static string GetDisplayNameForEnumComparison(object o, decimal? v) string typePart = o.GetType().Name; string namePart = o.ToString().Replace(", ", "|", StringComparison.Ordinal); string valuePart = v.Value.ToString(CultureInfo.InvariantCulture); - return $"{typePart}.{namePart} {{{{value: {valuePart}}}}}"; + return $"{typePart}.{namePart} {{value: {valuePart}}}"; } private static decimal? ExtractDecimal(object o) diff --git a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs index 13087b32d5..dc385bc0c3 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs @@ -79,7 +79,7 @@ private static bool ValidateAgainstNulls(AssertionChain assertionChain, Comparan if (onlyOneNull) { assertionChain.FailWith( - $"Expected {currentNode.Subject.Description} to be {{0}}{{reason}}, but found {{1}}.", expected, subject); + "Expected {0} to be {1}{reason}, but found {2}.", currentNode.Subject.Description.AsNonFormattable(), expected, subject); return false; } @@ -95,7 +95,7 @@ private static bool ValidateSubjectIsString(AssertionChain assertionChain, Compa } assertionChain.FailWith( - $"Expected {currentNode} to be {{0}}, but found {{1}}.", + "Expected {0} to be {1}, but found {2}.", currentNode.AsNonFormattable(), comparands.RuntimeType, comparands.Subject.GetType()); return assertionChain.Succeeded; diff --git a/Src/FluentAssertions/Execution/StringExtensions.cs b/Src/FluentAssertions/Execution/StringExtensions.cs new file mode 100644 index 0000000000..1e120616c3 --- /dev/null +++ b/Src/FluentAssertions/Execution/StringExtensions.cs @@ -0,0 +1,24 @@ +namespace FluentAssertions.Execution; + +internal static class StringExtensions +{ + /// + /// Can be used + /// + /// + /// + public static WithoutFormattingWrapper AsNonFormattable(this string value) + { + return new WithoutFormattingWrapper(value); + } + + /// + /// Can be used + /// + /// + /// + public static WithoutFormattingWrapper AsNonFormattable(this object value) + { + return new WithoutFormattingWrapper(value?.ToString()); + } +} diff --git a/Src/FluentAssertions/Execution/WithoutFormattingWrapper.cs b/Src/FluentAssertions/Execution/WithoutFormattingWrapper.cs new file mode 100644 index 0000000000..0696cde026 --- /dev/null +++ b/Src/FluentAssertions/Execution/WithoutFormattingWrapper.cs @@ -0,0 +1,11 @@ +using FluentAssertions.Formatting; + +namespace FluentAssertions.Execution; + +/// +/// Wrapper to tell the not to apply any value formatters on this string. +/// +internal class WithoutFormattingWrapper(string value) +{ + public override string ToString() => value; +} diff --git a/Src/FluentAssertions/Formatting/Formatter.cs b/Src/FluentAssertions/Formatting/Formatter.cs index 8b1d75d0f1..c55e0db303 100644 --- a/Src/FluentAssertions/Formatting/Formatter.cs +++ b/Src/FluentAssertions/Formatting/Formatter.cs @@ -19,6 +19,7 @@ public static class Formatter private static readonly List DefaultFormatters = [ + new PassthroughValueFormatter(), new XmlReaderValueFormatter(), new XmlNodeFormatter(), new AttributeBasedFormatter(), diff --git a/Src/FluentAssertions/Formatting/PassthroughValueFormatter.cs b/Src/FluentAssertions/Formatting/PassthroughValueFormatter.cs new file mode 100644 index 0000000000..190a0cc4dc --- /dev/null +++ b/Src/FluentAssertions/Formatting/PassthroughValueFormatter.cs @@ -0,0 +1,17 @@ +using FluentAssertions.Execution; + +namespace FluentAssertions.Formatting; + +/// +/// Ensures that any value wrapped in a +/// is passed through as-is. +/// +internal class PassthroughValueFormatter : IValueFormatter +{ + public bool CanHandle(object value) => value is WithoutFormattingWrapper; + + public void Format(object value, FormattedObjectGraph formattedGraph, FormattingContext context, FormatChild formatChild) + { + formattedGraph.AddFragment(((WithoutFormattingWrapper)value).ToString()); + } +} diff --git a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs index a92e40a8ae..fb3244279f 100644 --- a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs @@ -287,10 +287,7 @@ private void AssertExceptionMessage(IEnumerable messages, string expecta foreach (string failure in results.GetTheFailuresForTheSetWithTheFewestFailures()) { - string replacedCurlyBraces = - failure.EscapePlaceholders(); - - assertionChain.FailWith(replacedCurlyBraces); + assertionChain.FailWith("{0}", failure.AsNonFormattable()); } } } diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionChainSpecs.MessageFormating.cs b/Tests/FluentAssertions.Specs/Execution/AssertionChainSpecs.MessageFormating.cs index 63fc8e684e..8a2d24e6cf 100644 --- a/Tests/FluentAssertions.Specs/Execution/AssertionChainSpecs.MessageFormating.cs +++ b/Tests/FluentAssertions.Specs/Execution/AssertionChainSpecs.MessageFormating.cs @@ -386,5 +386,38 @@ public void Message_should_contain_the_reason_as_defined_with_arguments() act.Should().Throw() .WithMessage("Expected because reasons"); } + + [Theory] + [InlineData("{0}{0}", "\"foo\"\"foo\"")] + [InlineData("{{0}}{0}", "{0}\"foo\"")] + [InlineData("{0}{{0}}", "\"foo\"{0}")] + [InlineData("{{{0}}}{0}", "{\"foo\"}\"foo\"")] + [InlineData("{0}{{{0}}}", "\"foo\"{\"foo\"}")] + public void Can_handle_escaped_braces(string format, string expected) + { + AssertionChain.GetOrCreate() + .Invoking(e => e.FailWith(format, "foo")) + .Should().Throw().WithMessage(expected); + } + + [Theory] + [InlineData("{")] + [InlineData("}")] + [InlineData("{}")] + [InlineData("{0}")] + [InlineData("{{0}}")] + public void Can_handle_more_braces_in_dictionary_keys(string key) + { + // Arrange + var subject = new Dictionary { [key] = "" }; + var expectation = new Dictionary { [key] = null }; + + // Act + var act = () => expectation.Should().BeEquivalentTo(subject); + + // Assert + act.Should().Throw() + .WithMessage($"Expected expectation[{key}] to be \"\", but found .*"); + } } } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index a6cfbbcac9..08328b5df2 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,6 +7,12 @@ sidebar: nav: "sidebar" --- +## 8.1.1 + +## Fixes + +* Fix a formatting exception when {} is used as a dictionary key - [#3008](https://github.com/fluentassertions/fluentassertions/pull/3008) + ## 8.1.0 ### Improvements From 4d70568e468ffbbc83ea6eb4495b6f16ad53c59a Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Fri, 21 Feb 2025 14:22:11 +0100 Subject: [PATCH 600/845] Removed the PS script that opens the FA website because it misbehaves. --- Src/FluentAssertions/FluentAssertions.csproj | 1 - Src/init.ps1 | 34 -------------------- docs/_pages/releases.md | 1 + 3 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 Src/init.ps1 diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 4f27656ded..8e7f266134 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -44,7 +44,6 @@ Check out the [license page](LICENSE) for more information. - diff --git a/Src/init.ps1 b/Src/init.ps1 deleted file mode 100644 index 26cc286168..0000000000 --- a/Src/init.ps1 +++ /dev/null @@ -1,34 +0,0 @@ -param($installPath, $toolsPath, $package, $project) -#Get Default browser -$DefaultSettingPath = 'HKCU:\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice' -$DefaultBrowserName = (Get-Item $DefaultSettingPath | Get-ItemProperty).ProgId - -if($DefaultBrowserName -eq 'AppXq0fevzme2pys62n3e0fbqa7peapykr8v') -{ - #Open url in edge - start Microsoft-edge:$packageKeyForm -} -else -{ - try - { - #Create PSDrive to HKEY_CLASSES_ROOT - $null = New-PSDrive -PSProvider registry -Root 'HKEY_CLASSES_ROOT' -Name 'HKCR' - - #Get the default browser executable command/path - $DefaultBrowserOpenCommand = (Get-Item "HKCR:\$DefaultBrowserName\shell\open\command" | Get-ItemProperty).'(default)' - $DefaultBrowserPath = [regex]::Match($DefaultBrowserOpenCommand,'\".+?\"') - - #Open URL in browser - Start-Process -FilePath $DefaultBrowserPath ('--new-window', "https://xceed.com/fluent-assertions/") - } - catch - { - Throw $_.Exception - } - finally - { - #Clean up PSDrive for 'HKEY_CLASSES_ROOT - Remove-PSDrive -Name 'HKCR' - } -} \ No newline at end of file diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 08328b5df2..643d9d1972 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -12,6 +12,7 @@ sidebar: ## Fixes * Fix a formatting exception when {} is used as a dictionary key - [#3008](https://github.com/fluentassertions/fluentassertions/pull/3008) +* Removed the PowerShell script that opens the website because it misbehaves - [#3030](https://github.com/fluentassertions/fluentassertions/pull/3030) ## 8.1.0 From 3828bf70263d0ecc04033bb9d521f013f24c869f Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 23 Feb 2025 18:32:38 +0100 Subject: [PATCH 601/845] Restore `StringSyntax` annotations --- .../GenericCollectionAssertions.cs | 35 +++++++++++-------- .../Execution/AssertionChain.cs | 3 +- .../Specialized/ExceptionAssertions.cs | 23 +++++++----- .../Specialized/FunctionAssertions.cs | 2 +- .../Streams/BufferedStreamAssertions.cs | 7 ++-- .../Xml/Equivalency/XmlReaderValidator.cs | 4 ++- 6 files changed, 47 insertions(+), 27 deletions(-) diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index 7984f73a72..908a8bfad4 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -1122,8 +1122,8 @@ public AndConstraint ContainItemsAssignableTo( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint - NotContainItemsAssignableTo(string because = "", params object[] becauseArgs) => + public AndConstraint NotContainItemsAssignableTo( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) => NotContainItemsAssignableTo(typeof(TExpectation), because, becauseArgs); /// @@ -1168,7 +1168,8 @@ public AndConstraint NotContainItemsAssignableTo(Type type, /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint ContainSingle(string because = "", params object[] becauseArgs) + public AndWhichConstraint ContainSingle( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { assertionChain .BecauseOf(because, becauseArgs) @@ -1217,7 +1218,7 @@ public AndWhichConstraint ContainSingle(string because = "", par /// /// is . public AndWhichConstraint ContainSingle(Expression> predicate, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(predicate); @@ -1784,7 +1785,8 @@ public AndConstraint IntersectWith(IEnumerable otherCollection, /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) + public AndConstraint NotBeEmpty( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { assertionChain .BecauseOf(because, becauseArgs) @@ -1858,7 +1860,7 @@ public AndConstraint NotBeEquivalentTo(IEnumerable public AndConstraint NotBeEquivalentTo(IEnumerable unexpected, Func, EquivalencyOptions> config, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot verify inequivalence against a collection."); @@ -1984,7 +1986,8 @@ public AndConstraint NotBeInAscendingOrder( /// /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// - public AndConstraint NotBeInAscendingOrder(string because = "", params object[] becauseArgs) + public AndConstraint NotBeInAscendingOrder( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotBeInAscendingOrder(GetComparer(), because, becauseArgs); } @@ -2109,7 +2112,8 @@ public AndConstraint NotBeInDescendingOrder( /// /// Empty and single element collections are considered to be ordered both in ascending and descending order at the same time. /// - public AndConstraint NotBeInDescendingOrder(string because = "", params object[] becauseArgs) + public AndConstraint NotBeInDescendingOrder( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotBeInDescendingOrder(GetComparer(), because, becauseArgs); } @@ -2147,7 +2151,8 @@ public AndConstraint NotBeInDescendingOrder(Func compari /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeNullOrEmpty(string because = "", params object[] becauseArgs) + public AndConstraint NotBeNullOrEmpty( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return NotBeNull(because, becauseArgs) .And.NotBeEmpty(because, becauseArgs); @@ -2671,7 +2676,8 @@ public AndConstraint NotContainNulls(Expression /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotContainNulls(string because = "", params object[] becauseArgs) + public AndConstraint NotContainNulls( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { assertionChain .BecauseOf(because, becauseArgs) @@ -2786,7 +2792,7 @@ public AndConstraint NotHaveCount(int unexpected, [StringSyntax("Co /// /// is . public AndConstraint NotHaveSameCount(IEnumerable otherCollection, - string because = "", + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(otherCollection, nameof(otherCollection), "Cannot verify count against a collection."); @@ -2956,7 +2962,8 @@ public AndConstraint OnlyHaveUniqueItems(Expression /// Zero or more objects to format using the placeholders in . /// - public AndConstraint OnlyHaveUniqueItems(string because = "", params object[] becauseArgs) + public AndConstraint OnlyHaveUniqueItems( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { assertionChain .BecauseOf(because, becauseArgs) @@ -3306,7 +3313,7 @@ internal AndConstraint> BeOrderedBy( Expression> propertyExpression, IComparer comparer, SortOrder direction, - string because, + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { if (IsValidProperty(propertyExpression, because, becauseArgs)) @@ -3535,7 +3542,7 @@ private AndConstraint NotBeOrderedBy( Expression> propertyExpression, IComparer comparer, SortOrder direction, - string because, + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { if (IsValidProperty(propertyExpression, because, becauseArgs)) diff --git a/Src/FluentAssertions/Execution/AssertionChain.cs b/Src/FluentAssertions/Execution/AssertionChain.cs index 8be7c48ee9..5422c05c1e 100644 --- a/Src/FluentAssertions/Execution/AssertionChain.cs +++ b/Src/FluentAssertions/Execution/AssertionChain.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Threading; @@ -109,7 +110,7 @@ public AssertionChain BecauseOf(Reason reason) /// /// Zero or more objects to format using the placeholders in . /// - public AssertionChain BecauseOf(string because, params object[] becauseArgs) + public AssertionChain BecauseOf([StringSyntax("CompositeFormat")] string because, params object[] becauseArgs) { reason = () => { diff --git a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs index fb3244279f..9ada515f2d 100644 --- a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs @@ -101,7 +101,8 @@ public virtual ExceptionAssertions WithMessage(string expectedWildca /// /// Zero or more objects to format using the placeholders in . /// - public virtual ExceptionAssertions WithInnerException(string because = "", + public virtual ExceptionAssertions WithInnerException( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TInnerException : Exception { @@ -120,7 +121,8 @@ public virtual ExceptionAssertions WithInnerException /// Zero or more objects to format using the placeholders in . /// - public ExceptionAssertions WithInnerException(Type innerException, string because = "", + public ExceptionAssertions WithInnerException(Type innerException, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(innerException); @@ -139,7 +141,8 @@ public ExceptionAssertions WithInnerException(Type innerException, st /// /// Zero or more objects to format using the placeholders in . /// - public virtual ExceptionAssertions WithInnerExceptionExactly(string because = "", + public virtual ExceptionAssertions WithInnerExceptionExactly( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) where TInnerException : Exception { @@ -158,7 +161,8 @@ public virtual ExceptionAssertions WithInnerExceptionExactly /// Zero or more objects to format using the placeholders in . /// - public ExceptionAssertions WithInnerExceptionExactly(Type innerException, string because = "", + public ExceptionAssertions WithInnerExceptionExactly(Type innerException, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(innerException); @@ -181,7 +185,7 @@ public ExceptionAssertions WithInnerExceptionExactly(Type innerExcept /// /// is . public ExceptionAssertions Where(Expression> exceptionExpression, - string because = "", params object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(exceptionExpression); @@ -197,7 +201,8 @@ public ExceptionAssertions Where(Expression> return this; } - private IEnumerable AssertInnerExceptionExactly(Type innerException, string because = "", + private IEnumerable AssertInnerExceptionExactly(Type innerException, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { assertionChain @@ -217,7 +222,8 @@ private IEnumerable AssertInnerExceptionExactly(Type innerException, return expectedExceptions; } - private IEnumerable AssertInnerExceptions(Type innerException, string because = "", + private IEnumerable AssertInnerExceptions(Type innerException, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { assertionChain @@ -262,7 +268,8 @@ private static string BuildExceptionsString(IEnumerable exceptions) "\t" + Formatter.ToString(exception))); } - private void AssertExceptionMessage(IEnumerable messages, string expectation, string because, params object[] becauseArgs) + private void AssertExceptionMessage(IEnumerable messages, string expectation, + [StringSyntax("CompositeFormat")] string because, params object[] becauseArgs) { var results = new AssertionResultSet(); diff --git a/Src/FluentAssertions/Specialized/FunctionAssertions.cs b/Src/FluentAssertions/Specialized/FunctionAssertions.cs index 0219cab38f..99d5561c30 100644 --- a/Src/FluentAssertions/Specialized/FunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/FunctionAssertions.cs @@ -113,7 +113,7 @@ public AndWhichConstraint, T> NotThrowAfter(TimeSpan waitT } internal TResult NotThrowAfter(Func subject, IClock clock, TimeSpan waitTime, TimeSpan pollInterval, - string because, object[] becauseArgs) + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { Guard.ThrowIfArgumentIsNegative(waitTime); Guard.ThrowIfArgumentIsNegative(pollInterval); diff --git a/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs b/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs index 0233d67c38..58b5d20955 100644 --- a/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs +++ b/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.IO; using FluentAssertions.Execution; @@ -41,7 +42,8 @@ public BufferedStreamAssertions(BufferedStream stream, AssertionChain assertionC /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint HaveBufferSize(int expected, string because = "", params object[] becauseArgs) + public AndConstraint HaveBufferSize(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { assertionChain .BecauseOf(because, becauseArgs) @@ -72,7 +74,8 @@ public AndConstraint HaveBufferSize(int expected, string because = /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveBufferSize(int unexpected, string because = "", params object[] becauseArgs) + public AndConstraint NotHaveBufferSize(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { assertionChain .BecauseOf(because, becauseArgs) diff --git a/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs b/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs index b82b4bba6f..ad676f998f 100644 --- a/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs +++ b/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Xml; using FluentAssertions.Execution; @@ -15,7 +16,8 @@ internal class XmlReaderValidator private XmlIterator expectationIterator; private Node currentNode = Node.CreateRoot(); - public XmlReaderValidator(AssertionChain assertionChain, XmlReader subjectReader, XmlReader expectationReader, string because, object[] becauseArgs) + public XmlReaderValidator(AssertionChain assertionChain, XmlReader subjectReader, XmlReader expectationReader, + [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { this.assertionChain = assertionChain; assertionChain.BecauseOf(because, becauseArgs); From 7d18305efdf6074527bb62d9e6567af1bfe88fd5 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 23 Feb 2025 18:58:00 +0100 Subject: [PATCH 602/845] Adjust incorrect explaining comment about regex --- Src/FluentAssertions/Common/StringExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/FluentAssertions/Common/StringExtensions.cs b/Src/FluentAssertions/Common/StringExtensions.cs index 9730aaf3b9..cce0ca4833 100644 --- a/Src/FluentAssertions/Common/StringExtensions.cs +++ b/Src/FluentAssertions/Common/StringExtensions.cs @@ -120,7 +120,7 @@ public static string RemoveNewlineStyle(this string @this) public static string RemoveTrailingWhitespaceFromLines(this string input) { - // This regex matches whitespace characters (\s) that are followed by a line ending (\r?\n) + // This regex matches space (' ') and tab ('\t') characters followed by a line ending ('\r\n' or '\n') return Regex.Replace(input, @"[ \t]+(?=\r?\n)", string.Empty); } From 6751587db92a83805fbc35600bd9314022179e6a Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 23 Feb 2025 19:18:23 +0100 Subject: [PATCH 603/845] Remove `|` from regex character classes `|` means the literal `|` and not alternation. I.e. `[a|b]` means "`a`, `|` or `b`". On the other hand in groups `(a|b)` means "either `a` or `b`" --- Src/FluentAssertions/Execution/FailureMessageFormatter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/FluentAssertions/Execution/FailureMessageFormatter.cs b/Src/FluentAssertions/Execution/FailureMessageFormatter.cs index 3559ea97b6..9fc73c1682 100644 --- a/Src/FluentAssertions/Execution/FailureMessageFormatter.cs +++ b/Src/FluentAssertions/Execution/FailureMessageFormatter.cs @@ -94,7 +94,7 @@ public string Format(string message, object[] messageArgs) private static string SubstituteIdentifier(string message, string identifier, string fallbackIdentifier) { - const string pattern = @"(?:\s|^)\{context(?:\:(?[a-z|A-Z|\s]+))?\}"; + const string pattern = @"(?:\s|^)\{context(?:\:(?[a-zA-Z\s]+))?\}"; message = Regex.Replace(message, pattern, match => { @@ -125,7 +125,7 @@ private static string SubstituteIdentifier(string message, string identifier, st private static string SubstituteContextualTags(string message, ContextDataDictionary contextData) { - const string pattern = @"(?[a-z|A-Z]+)(?:\:(?[a-z|A-Z|\s]+))?\}(?!\})"; + const string pattern = @"(?[a-zA-Z]+)(?:\:(?[a-zA-Z\s]+))?\}(?!\})"; return Regex.Replace(message, pattern, match => { From c53c9eb2064fc9d55744670b4e9bf218e34fbf76 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 16:55:52 +0000 Subject: [PATCH 604/845] Bump cspell from 8.17.3 to 8.17.5 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.17.3 to 8.17.5. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.17.5/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 293 ++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 151 insertions(+), 144 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2d9c68502b..9b66594f76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,21 +7,21 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.17.3" + "cspell": "^8.17.5" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.17.3.tgz", - "integrity": "sha512-6uOF726o3JnExAUKM20OJJXZo+Qf9Jt64nkVwnVXx7Upqr5I9Pb1npYPEAIpUA03SnWYmKwUIqhAmkwrN+bLPA==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.17.5.tgz", + "integrity": "sha512-b/Ntabar+g4gsRNwOct909cvatO/auHhNvBzJZfyFQzryI1nqHMaSFuDsrrtzbhQkGJ4GiMAKCXZC2EOdHMgmw==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.0", "@cspell/dict-al": "^1.1.0", "@cspell/dict-aws": "^4.0.9", "@cspell/dict-bash": "^4.2.0", - "@cspell/dict-companies": "^3.1.13", - "@cspell/dict-cpp": "^6.0.3", + "@cspell/dict-companies": "^3.1.14", + "@cspell/dict-cpp": "^6.0.4", "@cspell/dict-cryptocurrencies": "^5.0.4", "@cspell/dict-csharp": "^4.0.6", "@cspell/dict-css": "^4.0.17", @@ -31,14 +31,14 @@ "@cspell/dict-docker": "^1.1.12", "@cspell/dict-dotnet": "^5.0.9", "@cspell/dict-elixir": "^4.0.7", - "@cspell/dict-en_us": "^4.3.30", + "@cspell/dict-en_us": "^4.3.33", "@cspell/dict-en-common-misspellings": "^2.0.9", "@cspell/dict-en-gb": "1.1.33", - "@cspell/dict-filetypes": "^3.0.10", + "@cspell/dict-filetypes": "^3.0.11", "@cspell/dict-flutter": "^1.1.0", "@cspell/dict-fonts": "^4.0.4", "@cspell/dict-fsharp": "^1.1.0", - "@cspell/dict-fullstack": "^3.2.3", + "@cspell/dict-fullstack": "^3.2.5", "@cspell/dict-gaming-terms": "^1.1.0", "@cspell/dict-git": "^3.0.4", "@cspell/dict-golang": "^6.0.18", @@ -57,7 +57,7 @@ "@cspell/dict-markdown": "^2.0.9", "@cspell/dict-monkeyc": "^1.0.10", "@cspell/dict-node": "^5.0.6", - "@cspell/dict-npm": "^5.1.24", + "@cspell/dict-npm": "^5.1.27", "@cspell/dict-php": "^4.0.14", "@cspell/dict-powershell": "^5.0.14", "@cspell/dict-public-licenses": "^2.0.13", @@ -67,7 +67,7 @@ "@cspell/dict-rust": "^4.0.11", "@cspell/dict-scala": "^5.0.7", "@cspell/dict-shell": "^1.1.0", - "@cspell/dict-software-terms": "^4.2.4", + "@cspell/dict-software-terms": "^4.2.5", "@cspell/dict-sql": "^2.2.0", "@cspell/dict-svelte": "^1.0.6", "@cspell/dict-swift": "^2.0.5", @@ -80,30 +80,30 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.17.3.tgz", - "integrity": "sha512-RWSfyHOin/d9CqLjz00JMvPkag3yUSsQZr6G9BnCT5cMEO/ws8wQZzA54CNj/LAOccbknTX65SSroPPAtxs56w==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.17.5.tgz", + "integrity": "sha512-+eVFCdnda74Frv8hguHYwDtxvqDuJJ/luFRl4dC5oknPMRab0JCHM1DDYjp3NzsehTex0HmcxplxqVW6QoDosg==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "8.17.3" + "@cspell/cspell-types": "8.17.5" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.17.3.tgz", - "integrity": "sha512-DqqSWKt9NLWPGloYxZTpzUhgdW8ObMkZmOOF6TyqpJ4IbckEct8ULgskNorTNRlmmjLniaNgvg6JSHuYO3Urxw==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.17.5.tgz", + "integrity": "sha512-VOIfFdIo3FYQFcSpIyGkqHupOx0LgfBrWs79IKnTT1II27VUHPF+0oGq0WWf4c2Zpd8tzdHvS3IUhGarWZq69g==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.17.3.tgz", - "integrity": "sha512-yQlVaIsWiax6RRuuacZs++kl6Y9rwH9ZkVlsG9fhdeCJ5Xf3WCW+vmX1chzhhKDzRr8CF9fsvb1uagd/5/bBYA==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.17.5.tgz", + "integrity": "sha512-5MhYInligPbGctWxoklAKxtg+sxvtJCuRKGSQHHA0JlCOLSsducypl780P6zvpjLK59XmdfC+wtFONxSmRbsuA==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" @@ -113,18 +113,18 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.17.3.tgz", - "integrity": "sha512-CC3nob/Kbuesz5WTW+LjAHnDFXJrA49pW5ckmbufJxNnoAk7EJez/qr7/ELMTf6Fl3A5xZ776Lhq7738Hy/fmQ==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.17.5.tgz", + "integrity": "sha512-Ur3IK0R92G/2J6roopG9cU/EhoYAMOx2um7KYlq93cdrly8RBAK2NCcGCL7DbjQB6C9RYEAV60ueMUnQ45RrCQ==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.17.3.tgz", - "integrity": "sha512-ozgeuSioX9z2wtlargfgdw3LKwDFAfm8gxu+xwNREvXiLsevb+lb7ZlY5/ay+MahqR5Hfs7XzYzBLTKL/ldn9g==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.17.5.tgz", + "integrity": "sha512-91y2+0teunRSRZj940ORDA3kdjyenrUiM+4j6nQQH24sAIAJdRmQl2LG3eUTmeaSReJGkZIpnToQ6DyU5cC88Q==", "license": "MIT", "engines": { "node": ">=18" @@ -158,15 +158,15 @@ } }, "node_modules/@cspell/dict-companies": { - "version": "3.1.13", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.13.tgz", - "integrity": "sha512-EAaFMxnSG4eQKup9D81EnWAYIzorLWG7b7Zzf+Suu0bVeFBpCYESss/EWtnmb5ZZNfKAGxtoMqfL3vRfyJERIQ==", + "version": "3.1.14", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.14.tgz", + "integrity": "sha512-iqo1Ce4L7h0l0GFSicm2wCLtfuymwkvgFGhmu9UHyuIcTbdFkDErH+m6lH3Ed+QuskJlpQ9dM7puMIGqUlVERw==", "license": "MIT" }, "node_modules/@cspell/dict-cpp": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.3.tgz", - "integrity": "sha512-OFrVXdxCeGKnon36Pe3yFjBuY4kzzEwWFf3vDz+cJTodZDkjFkBifQeTtt5YfimgF8cfAJZXkBCsxjipAgmAiw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.4.tgz", + "integrity": "sha512-IvXx3TlM+OL0CFriapk7ZHmeY89dSSdo/BZ3DGf+WUS+BWd64H+z/xr3xkkqY0Eu6MV/vdzNfkLm5zl45FDMGg==", "license": "MIT" }, "node_modules/@cspell/dict-cryptocurrencies": { @@ -224,9 +224,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.3.30", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.30.tgz", - "integrity": "sha512-p0G5fByj5fUnMyFUlkN3kaqE3nuQkqpYV47Gn9n8k2TszsdLY55xj9UoFE4YIcjOiyU1bR/YDJ5daiPMYXTJ/A==", + "version": "4.3.33", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.33.tgz", + "integrity": "sha512-HniqQjzPVn24NEkHooBIw1cH+iO3AKMA9oDTwazUYQP1/ldqXsz6ce4+fdHia2nqypmic/lHVkQgIVhP48q/sA==", "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { @@ -242,9 +242,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.10.tgz", - "integrity": "sha512-JEN3627joBVtpa1yfkdN9vz1Z129PoKGHBKjXCEziJvf2Zt1LeULWYYYg/O6pzRR4yzRa5YbXDTuyrN7vX7DFg==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.11.tgz", + "integrity": "sha512-bBtCHZLo7MiSRUqx5KEiPdGOmXIlDGY+L7SJEtRWZENpAKE+96rT7hj+TUUYWBbCzheqHr0OXZJFEKDgsG/uZg==", "license": "MIT" }, "node_modules/@cspell/dict-flutter": { @@ -266,9 +266,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-fullstack": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.3.tgz", - "integrity": "sha512-62PbndIyQPH11mAv0PyiyT0vbwD0AXEocPpHlCHzfb5v9SspzCCbzQ/LIBiFmyRa+q5LMW35CnSVu6OXdT+LKg==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.5.tgz", + "integrity": "sha512-XNmNdovPUS9Vc2JvfBscy8zZfwyxR11sB4fxU2lXh7LzUvOn2/OkKAzj41JTdiWfVnJ/yvsRkspe+b7kr+DIQw==", "license": "MIT" }, "node_modules/@cspell/dict-gaming-terms": { @@ -386,9 +386,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.1.24", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.24.tgz", - "integrity": "sha512-yAyyHetElLR236sqWQkBtiLbzCGexV5zzLMHyQPptKQQK88BTQR5f9wXW2EtSgJw/4gUchpSWQWxMlkIfK/iQQ==", + "version": "5.1.27", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.27.tgz", + "integrity": "sha512-LGss1yrjhxSmxL4VfMC+UBDMVHfqHudgC7b39M74EVys+nNC4/lqDHacb6Aw7i6aUn9mzdNIkdTTD+LdDcHvPA==", "license": "MIT" }, "node_modules/@cspell/dict-php": { @@ -449,9 +449,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.2.4.tgz", - "integrity": "sha512-GRkuaFfjFHPYynyRMuisKyE3gRiVK0REClRWfnH9+5iCs5TKDURsMpWJGNsgQ6N5jAKKrtWXVKjepkDHjMldjQ==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.2.5.tgz", + "integrity": "sha512-CaRzkWti3AgcXoxuRcMijaNG7YUk/MH1rHjB8VX34v3UdCxXXeqvRyElRKnxhFeVLB/robb2UdShqh/CpskxRg==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -491,12 +491,12 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.17.3.tgz", - "integrity": "sha512-Kg6IJhGHPv+9OxpxaXUpcqgnHEOhMLRWHLyx7FADZ+CJyO4AVeWQfhpTRM6KXhzIl7dPlLG1g8JAQxaoy88KTw==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.17.5.tgz", + "integrity": "sha512-tY+cVkRou+0VKvH+K1NXv8/R7mOlW3BDGSs9fcgvhatj0m00Yf8blFC7tE4VVI9Qh2bkC/KDFqM24IqZbuwXUQ==", "license": "MIT", "dependencies": { - "@cspell/url": "8.17.3", + "@cspell/url": "8.17.5", "import-meta-resolve": "^4.1.0" }, "engines": { @@ -504,27 +504,27 @@ } }, "node_modules/@cspell/filetypes": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.17.3.tgz", - "integrity": "sha512-UFqRmJPccOSo+RYP/jZ4cr0s7ni37GrvnNAg1H/qIIxfmBYsexTAmsNzMqxp1M31NeI1Cx3LL7PspPMT0ms+7w==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.17.5.tgz", + "integrity": "sha512-Fj6py2Rl+FEnMiXhRQUM1A5QmyeCLxi6dY/vQ0qfH6tp6KSaBiaC8wuPUKhr8hKyTd3+8lkUbobDhUf6xtMEXg==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.17.3.tgz", - "integrity": "sha512-l/CaFc3CITI/dC+whEBZ05Om0KXR3V2whhVOWOBPIqA5lCjWAyvWWvmFD+CxWd0Hs6Qcb/YDnMyJW14aioXN4g==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.17.5.tgz", + "integrity": "sha512-Z4eo+rZJr1086wZWycBiIG/n7gGvVoqn28I7ZicS8xedRYu/4yp2loHgLn4NpxG3e46+dNWs4La6vinod+UydQ==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.17.3.tgz", - "integrity": "sha512-gcsCz8g0qY94C8RXiAlUH/89n84Q9RSptP91XrvnLOT+Xva9Aibd7ywd5k9ameuf8Nagyl0ezB1MInZ30S9SRw==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.17.5.tgz", + "integrity": "sha512-GNQqST7zI85dAFVyao6oiTeg5rNhO9FH1ZAd397qQhvwfxrrniNfuoewu8gPXyP0R4XBiiaCwhBL7w9S/F5guw==", "license": "MIT", "engines": { "node": ">=18.0" @@ -631,29 +631,29 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.17.3.tgz", - "integrity": "sha512-fBZg674Dir9y/FWMwm2JyixM/1eB2vnqHJjRxOgGS/ZiZ3QdQ3LkK02Aqvlni8ffWYDZnYnYY9rfWmql9bb42w==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.17.5.tgz", + "integrity": "sha512-l3Cfp87d7Yrodem675irdxV6+7+OsdR+jNwYHe33Dgnd6ePEfooYrvmfGdXF9rlQrNLUQp/HqYgHJzSq19UEsg==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "8.17.3", - "@cspell/cspell-pipe": "8.17.3", - "@cspell/cspell-types": "8.17.3", - "@cspell/dynamic-import": "8.17.3", - "@cspell/url": "8.17.3", + "@cspell/cspell-json-reporter": "8.17.5", + "@cspell/cspell-pipe": "8.17.5", + "@cspell/cspell-types": "8.17.5", + "@cspell/dynamic-import": "8.17.5", + "@cspell/url": "8.17.5", "chalk": "^5.4.1", "chalk-template": "^1.1.0", "commander": "^13.1.0", - "cspell-dictionary": "8.17.3", - "cspell-gitignore": "8.17.3", - "cspell-glob": "8.17.3", - "cspell-io": "8.17.3", - "cspell-lib": "8.17.3", + "cspell-dictionary": "8.17.5", + "cspell-gitignore": "8.17.5", + "cspell-glob": "8.17.5", + "cspell-io": "8.17.5", + "cspell-lib": "8.17.5", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "get-stdin": "^9.0.0", - "semver": "^7.6.3", - "tinyglobby": "^0.2.10" + "semver": "^7.7.1", + "tinyglobby": "^0.2.12" }, "bin": { "cspell": "bin.mjs", @@ -667,12 +667,12 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.17.3.tgz", - "integrity": "sha512-+N32Q6xck3D2RqZIFwq8s0TnzHYMpyh4bgNtYqW5DIP3TLDiA4/MJGjwmLKAg/s9dkre6n8/++vVli3MZAOhIg==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.17.5.tgz", + "integrity": "sha512-XDc+UJO5RZ9S9e2Ajz332XjT7dv6Og2UqCiSnAlvHt7t/MacLHSPARZFIivheObNkWZ7E1iWI681RxKoH4o40w==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "8.17.3", + "@cspell/cspell-types": "8.17.5", "comment-json": "^4.2.5", "yaml": "^2.7.0" }, @@ -681,14 +681,14 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.17.3.tgz", - "integrity": "sha512-89I/lpQKdkX17RCFrUIJnc70Rjfpup/o+ynHZen0hUxGTfLsEJPrK6H2oGvic3Yrv5q8IOtwM1p8vqPqBkBheA==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.17.5.tgz", + "integrity": "sha512-O/Uuhv1RuDu+5WYQml0surudweaTvr+2YJSmPSdlihByUSiogCbpGqwrRow7wQv/C5p1W1FlFjotvUfoR0fxHA==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.17.3", - "@cspell/cspell-types": "8.17.3", - "cspell-trie-lib": "8.17.3", + "@cspell/cspell-pipe": "8.17.5", + "@cspell/cspell-types": "8.17.5", + "cspell-trie-lib": "8.17.5", "fast-equals": "^5.2.2" }, "engines": { @@ -696,14 +696,14 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.17.3.tgz", - "integrity": "sha512-rQamjb8R+Nwib/Bpcgf+xv5IdsOHgbP+fe4hCgv0jjgUPkeOR2c4dGwc0WS+2UkJbc+wQohpzBGDLRYGSB/hQw==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.17.5.tgz", + "integrity": "sha512-I27fgOUZzH14jeIYo65LooB60fZ42f6OJL1lOR9Mk6IrIlDyUtzherGR+xx5KshK2katYkX42Qu4zsVYM6VFPA==", "license": "MIT", "dependencies": { - "@cspell/url": "8.17.3", - "cspell-glob": "8.17.3", - "cspell-io": "8.17.3", + "@cspell/url": "8.17.5", + "cspell-glob": "8.17.5", + "cspell-io": "8.17.5", "find-up-simple": "^1.0.0" }, "bin": { @@ -714,12 +714,12 @@ } }, "node_modules/cspell-glob": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.17.3.tgz", - "integrity": "sha512-0ov9A0E6OuOO7KOxlGCxJ09LR/ubZ6xcGwWc5bu+jp/8onUowQfe+9vZdznj/o8/vcf5JkDzyhRSBsdhWKqoAg==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.17.5.tgz", + "integrity": "sha512-OXquou7UykInlGV5et5lNKYYrW0dwa28aEF995x1ocANND7o0bbHmFlbgyci/Lp4uFQai8sifmfFJbuIg2IC/A==", "license": "MIT", "dependencies": { - "@cspell/url": "8.17.3", + "@cspell/url": "8.17.5", "micromatch": "^4.0.8" }, "engines": { @@ -727,13 +727,13 @@ } }, "node_modules/cspell-grammar": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.17.3.tgz", - "integrity": "sha512-wfjkkvHthnKJtEaTgx3cPUPquGRXfgXSCwvMJaDyUi36KBlopXX38PejBTdmuqrvp7bINLSuHErml9wAfL5Fxw==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.17.5.tgz", + "integrity": "sha512-st2n+FVw25MvMbsGb3TeJNRr6Oih4g14rjOd/UJN0qn+ceH360SAShUFqSd4kHHu2ADazI/TESFU6FRtMTPNOg==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.17.3", - "@cspell/cspell-types": "8.17.3" + "@cspell/cspell-pipe": "8.17.5", + "@cspell/cspell-types": "8.17.5" }, "bin": { "cspell-grammar": "bin.mjs" @@ -743,47 +743,47 @@ } }, "node_modules/cspell-io": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.17.3.tgz", - "integrity": "sha512-NwEVb3Kr8loV1C8Stz9QSMgUrBkxqf2s7A9H2/RBnfvQBt9CWZS6NgoNxTPwHj3h1sUNl9reDkMQQzkKtgWGBQ==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.17.5.tgz", + "integrity": "sha512-oevM/8l0s6nc1NCYPqNFumrW50QSHoa6wqUT8cWs09gtZdE2AWG0U6bIE8ZEVz6e6FxS+6IenGKTdUUwP0+3fg==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "8.17.3", - "@cspell/url": "8.17.3" + "@cspell/cspell-service-bus": "8.17.5", + "@cspell/url": "8.17.5" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.17.3.tgz", - "integrity": "sha512-KpwYIj8HwFyTzCCQcyezlmomvyNfPwZQmqTh4V126sFvf9HLoMdfyq8KYDZmZ//4HzwrF/ufJOF3CpuVUiJHfA==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.17.5.tgz", + "integrity": "sha512-S3KuOrcST1d2BYmTXA+hnbRdho5n3w5GUvEaCx3QZQBwAPfLpAwJbe2yig1TxBpyEJ5LqP02i/mDg1pUCOP0hQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.17.3", - "@cspell/cspell-pipe": "8.17.3", - "@cspell/cspell-resolver": "8.17.3", - "@cspell/cspell-types": "8.17.3", - "@cspell/dynamic-import": "8.17.3", - "@cspell/filetypes": "8.17.3", - "@cspell/strong-weak-map": "8.17.3", - "@cspell/url": "8.17.3", + "@cspell/cspell-bundled-dicts": "8.17.5", + "@cspell/cspell-pipe": "8.17.5", + "@cspell/cspell-resolver": "8.17.5", + "@cspell/cspell-types": "8.17.5", + "@cspell/dynamic-import": "8.17.5", + "@cspell/filetypes": "8.17.5", + "@cspell/strong-weak-map": "8.17.5", + "@cspell/url": "8.17.5", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.17.3", - "cspell-dictionary": "8.17.3", - "cspell-glob": "8.17.3", - "cspell-grammar": "8.17.3", - "cspell-io": "8.17.3", - "cspell-trie-lib": "8.17.3", + "cspell-config-lib": "8.17.5", + "cspell-dictionary": "8.17.5", + "cspell-glob": "8.17.5", + "cspell-grammar": "8.17.5", + "cspell-io": "8.17.5", + "cspell-trie-lib": "8.17.5", "env-paths": "^3.0.0", "fast-equals": "^5.2.2", "gensequence": "^7.0.0", - "import-fresh": "^3.3.0", + "import-fresh": "^3.3.1", "resolve-from": "^5.0.0", "vscode-languageserver-textdocument": "^1.0.12", - "vscode-uri": "^3.0.8", + "vscode-uri": "^3.1.0", "xdg-basedir": "^5.1.0" }, "engines": { @@ -791,13 +791,13 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.17.3", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.17.3.tgz", - "integrity": "sha512-6LE5BeT2Rwv0bkQckpxX0K1fnFCWfeJ8zVPFtYOaix0trtqj0VNuwWzYDnxyW+OwMioCH29yRAMODa+JDFfUrA==", + "version": "8.17.5", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.17.5.tgz", + "integrity": "sha512-9hjI3nRQxtGEua6CgnLbK3sGHLx9dXR/BHwI/csRL4dN5GGRkE5X3CCoy1RJVL7iGFLIzi43+L10xeFRmWniKw==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.17.3", - "@cspell/cspell-types": "8.17.3", + "@cspell/cspell-pipe": "8.17.5", + "@cspell/cspell-types": "8.17.5", "gensequence": "^7.0.0" }, "engines": { @@ -1075,9 +1075,10 @@ } }, "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -1086,21 +1087,26 @@ } }, "node_modules/tinyglobby": { - "version": "0.2.10", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.10.tgz", - "integrity": "sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==", + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", + "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", + "license": "MIT", "dependencies": { - "fdir": "^6.4.2", + "fdir": "^6.4.3", "picomatch": "^4.0.2" }, "engines": { "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" } }, "node_modules/tinyglobby/node_modules/fdir": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz", - "integrity": "sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==", + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "license": "MIT", "peerDependencies": { "picomatch": "^3 || ^4" }, @@ -1114,6 +1120,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -1140,9 +1147,9 @@ "license": "MIT" }, "node_modules/vscode-uri": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", - "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.1.0.tgz", + "integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==", "license": "MIT" }, "node_modules/xdg-basedir": { diff --git a/package.json b/package.json index 9cda852c7c..c2002c9c6b 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.17.3" + "cspell": "^8.17.5" } } From 669f817c4420d2824e2238a2f530fae57f6b740d Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Thu, 27 Feb 2025 18:07:36 +0100 Subject: [PATCH 605/845] Handle missing caller identifier Fixes #3031 Regression from #3000 where previously `getCallerIdentifier() + callerPostfix` would return an empty string. --- .../Execution/SubjectIdentificationBuilder.cs | 2 +- .../Execution/AssertionChainSpecs.Chaining.cs | 14 ++++++++++++++ docs/_pages/releases.md | 6 ++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Src/FluentAssertions/Execution/SubjectIdentificationBuilder.cs b/Src/FluentAssertions/Execution/SubjectIdentificationBuilder.cs index b30f391c9f..8d8371000d 100644 --- a/Src/FluentAssertions/Execution/SubjectIdentificationBuilder.cs +++ b/Src/FluentAssertions/Execution/SubjectIdentificationBuilder.cs @@ -83,7 +83,7 @@ public string Build() if (scopeName is null) { - return callerIdentifier; + return callerIdentifier ?? ""; } else if (callerIdentifier is null) { diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionChainSpecs.Chaining.cs b/Tests/FluentAssertions.Specs/Execution/AssertionChainSpecs.Chaining.cs index 11e959587d..45c53e0570 100644 --- a/Tests/FluentAssertions.Specs/Execution/AssertionChainSpecs.Chaining.cs +++ b/Tests/FluentAssertions.Specs/Execution/AssertionChainSpecs.Chaining.cs @@ -578,6 +578,20 @@ public void Discard_a_scope_after_continuing_chained_assertion() Assert.Contains("First \"assertion\"", failures); } + [Fact] + public void Returns_an_empty_identification_when_neither_scope_name_nor_caller_identifier_are_available() + { + // Arrange + var assertionChain = AssertionChain.GetOrCreate(); + assertionChain.OverrideCallerIdentifier(() => null); + + // Act + string identification = assertionChain.CallerIdentifier; + + // Assert + identification.Should().BeEmpty(); + } + // [Fact] // public void Get_info_about_line_breaks_from_parent_scope_after_continuing_chained_assertion() // { diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 643d9d1972..e37c2fcf8f 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,6 +7,12 @@ sidebar: nav: "sidebar" --- +## 8.1.2 + +## Fixes + +* Fixed a regression from 8.1.0 where a `NullReferenceException` was thrown during subject identification - [#3036](https://github.com/fluentassertions/fluentassertions/pull/3036 + ## 8.1.1 ## Fixes From fa6eae15d0e318eb9a5f31706d80249623dd8d8c Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 2 Mar 2025 15:30:27 +0100 Subject: [PATCH 606/845] Avoid regex for checking if a path is nested --- .../Equivalency/Matching/MappedMemberMatchingRule.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Matching/MappedMemberMatchingRule.cs b/Src/FluentAssertions/Equivalency/Matching/MappedMemberMatchingRule.cs index 0eace99527..6730620579 100644 --- a/Src/FluentAssertions/Equivalency/Matching/MappedMemberMatchingRule.cs +++ b/Src/FluentAssertions/Equivalency/Matching/MappedMemberMatchingRule.cs @@ -1,5 +1,4 @@ using System; -using System.Text.RegularExpressions; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -16,12 +15,12 @@ internal class MappedMemberMatchingRule : IMemberMatchin public MappedMemberMatchingRule(string expectationMemberName, string subjectMemberName) { - if (Regex.IsMatch(expectationMemberName, @"[\.\[\]]")) + if (IsNestedPath(expectationMemberName)) { throw new ArgumentException("The expectation's member name cannot be a nested path", nameof(expectationMemberName)); } - if (Regex.IsMatch(subjectMemberName, @"[\.\[\]]")) + if (IsNestedPath(subjectMemberName)) { throw new ArgumentException("The subject's member name cannot be a nested path", nameof(subjectMemberName)); } @@ -30,6 +29,9 @@ public MappedMemberMatchingRule(string expectationMemberName, string subjectMemb this.subjectMemberName = subjectMemberName; } + private static bool IsNestedPath(string path) => + path.Contains('.', StringComparison.Ordinal) || path.Contains('[', StringComparison.Ordinal) || path.Contains(']', StringComparison.Ordinal); + public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options, AssertionChain assertionChain) { if (parent.Type.IsSameOrInherits(typeof(TExpectation)) && subject is TSubject && From 66df7d067960592f8ac4b595afe43b8c6b991c61 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 2 Mar 2025 15:51:43 +0100 Subject: [PATCH 607/845] Use char overload of `string.Replace` --- Src/FluentAssertions/Common/StringExtensions.cs | 2 +- .../Formatting/MultidimensionalArrayFormatterSpecs.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/FluentAssertions/Common/StringExtensions.cs b/Src/FluentAssertions/Common/StringExtensions.cs index cce0ca4833..833e4bcad3 100644 --- a/Src/FluentAssertions/Common/StringExtensions.cs +++ b/Src/FluentAssertions/Common/StringExtensions.cs @@ -115,7 +115,7 @@ public static string RemoveNewLines(this string @this) public static string RemoveNewlineStyle(this string @this) { return @this.Replace("\r\n", "\n", StringComparison.Ordinal) - .Replace("\r", "\n", StringComparison.Ordinal); + .Replace('\r', '\n'); } public static string RemoveTrailingWhitespaceFromLines(this string input) diff --git a/Tests/FluentAssertions.Specs/Formatting/MultidimensionalArrayFormatterSpecs.cs b/Tests/FluentAssertions.Specs/Formatting/MultidimensionalArrayFormatterSpecs.cs index c824a0accd..a2dde8f348 100644 --- a/Tests/FluentAssertions.Specs/Formatting/MultidimensionalArrayFormatterSpecs.cs +++ b/Tests/FluentAssertions.Specs/Formatting/MultidimensionalArrayFormatterSpecs.cs @@ -75,6 +75,6 @@ public void When_formatting_a_multi_dimensional_array_with_bounds_it_should_show // Assert result.Should().Match( "{{{'1-5-7', '1-5-8', '1-5-9', '1-5-10'}, {'1-6-7', '1-6-8', '1-6-9', '1-6-10'}, {'1-7-7', '1-7-8', '1-7-9', '1-7-10'}}, {{'2-5-7', '2-5-8', '2-5-9', '2-5-10'}, {'2-6-7', '2-6-8', '2-6-9', '2-6-10'}, {'2-7-7', '2-7-8', '2-7-9', '2-7-10'}}}" - .Replace("'", "\"")); + .Replace('\'', '"')); } } From 0a649cb006744405050f0a72ad48442831b3c8cd Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 2 Mar 2025 16:02:48 +0100 Subject: [PATCH 608/845] Add polyfill for splitting on a single `char` or `string` --- Src/FluentAssertions/Common/MemberPath.cs | 2 +- Src/FluentAssertions/Common/StringExtensions.cs | 2 +- .../Equivalency/Execution/ObjectReference.cs | 2 +- .../Equivalency/Tracing/StringBuilderTraceWriter.cs | 2 +- Src/FluentAssertions/Formatting/XElementValueFormatter.cs | 2 +- Src/FluentAssertions/Polyfill/SystemExtensions.cs | 6 ++++++ 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Src/FluentAssertions/Common/MemberPath.cs b/Src/FluentAssertions/Common/MemberPath.cs index 80a69302a6..5679ad3594 100644 --- a/Src/FluentAssertions/Common/MemberPath.cs +++ b/Src/FluentAssertions/Common/MemberPath.cs @@ -116,7 +116,7 @@ public bool HasSameParentAs(MemberPath path) private string[] Segments => segments ??= dottedPath .Replace("[]", "[*]", StringComparison.Ordinal) - .Split(new[] { '.', '[', ']' }, StringSplitOptions.RemoveEmptyEntries); + .Split(['.', '[', ']'], StringSplitOptions.RemoveEmptyEntries); /// /// Returns a copy of the current object as if it represented an un-indexed item in a collection. diff --git a/Src/FluentAssertions/Common/StringExtensions.cs b/Src/FluentAssertions/Common/StringExtensions.cs index 833e4bcad3..88e164df1a 100644 --- a/Src/FluentAssertions/Common/StringExtensions.cs +++ b/Src/FluentAssertions/Common/StringExtensions.cs @@ -103,7 +103,7 @@ public static string Capitalize(this string @this) public static string IndentLines(this string @this) { return string.Join(Environment.NewLine, - @this.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries).Select(x => $"\t{x}")); + @this.Split(['\r', '\n'], StringSplitOptions.RemoveEmptyEntries).Select(x => $"\t{x}")); } public static string RemoveNewLines(this string @this) diff --git a/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs b/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs index e888baa9b2..c0b3fb9fdb 100644 --- a/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs +++ b/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs @@ -39,7 +39,7 @@ public override bool Equals(object obj) private string[] GetPathElements() => pathElements ??= path.ToUpperInvariant().Replace("][", "].[", StringComparison.Ordinal) - .Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries); + .Split('.', StringSplitOptions.RemoveEmptyEntries); private bool IsParentOrChildOf(ObjectReference other) { diff --git a/Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs b/Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs index 9e6fcd72f7..a0752de0e3 100644 --- a/Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs +++ b/Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs @@ -28,7 +28,7 @@ public IDisposable AddBlock(string trace) private void WriteLine(string trace) { - foreach (string traceLine in trace.Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries)) + foreach (string traceLine in trace.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries)) { builder.Append(new string(' ', depth * 2)).AppendLine(traceLine); } diff --git a/Src/FluentAssertions/Formatting/XElementValueFormatter.cs b/Src/FluentAssertions/Formatting/XElementValueFormatter.cs index 0845dc96ed..953fea7476 100644 --- a/Src/FluentAssertions/Formatting/XElementValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/XElementValueFormatter.cs @@ -48,6 +48,6 @@ private static string FormatElementWithChildren(XElement element) private static string[] SplitIntoSeparateLines(XElement element) { string formattedXml = element.ToString(); - return formattedXml.Split([Environment.NewLine], StringSplitOptions.None); + return formattedXml.Split(Environment.NewLine, StringSplitOptions.None); } } diff --git a/Src/FluentAssertions/Polyfill/SystemExtensions.cs b/Src/FluentAssertions/Polyfill/SystemExtensions.cs index 88a5af634d..a725bd4f3c 100644 --- a/Src/FluentAssertions/Polyfill/SystemExtensions.cs +++ b/Src/FluentAssertions/Polyfill/SystemExtensions.cs @@ -23,6 +23,12 @@ public static bool Contains(this string str, char value, StringComparison compar // https://source.dot.net/#System.Private.CoreLib/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs,1014 public static bool StartsWith(this string str, char value) => str.Length != 0 && str[0] == value; + + public static string[] Split(this string str, char separator, StringSplitOptions options = StringSplitOptions.None) => + str.Split([separator], options); + + public static string[] Split(this string str, string separator, StringSplitOptions options = StringSplitOptions.None) => + str.Split([separator], options); } #endif From 04defbe85c05581c443d819b5d01bf84f0d62222 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 9 Feb 2025 20:55:10 +0100 Subject: [PATCH 609/845] Reworked formatting and support multi-dimensional arrays. --- .editorconfig | 8 + Build/_build.v3.ncrunchproject | 5 + FluentAssertions.sln.DotSettings | 3 + FluentAssertions.v3.ncrunchsolution | 8 + Src/FluentAssertions/Formatting/Anchor.cs | 93 ++++ .../Formatting/BuildingLineState.cs | 44 ++ .../Formatting/DefaultValueFormatter.cs | 7 +- .../Formatting/EnumerableValueFormatter.cs | 21 +- .../Formatting/FlushedLineState.cs | 51 ++ .../Formatting/FormattedObjectGraph.cs | 254 ++++----- Src/FluentAssertions/Formatting/ILineState.cs | 26 + Src/FluentAssertions/Formatting/Line.cs | 111 ++++ .../Formatting/LineCollection.cs | 95 ++++ .../Formatting/StringValueFormatter.cs | 9 +- Tests/.editorconfig | 14 + .../Approval.Tests.v3.ncrunchproject | 5 + .../FluentAssertions/net47.verified.txt | 3 +- .../FluentAssertions/net6.0.verified.txt | 3 +- .../netstandard2.0.verified.txt | 3 +- .../netstandard2.1.verified.txt | 3 +- .../Benchmarks.net472.v3.ncrunchproject | 3 + .../Formatting/FormatterSpecs.cs | 516 ++++++++++++------ .../ReferenceTypeAssertionsSpecs.cs | 9 +- .../Xml/XmlNodeFormatterSpecs.cs | 4 +- docs/_pages/releases.md | 6 +- 25 files changed, 961 insertions(+), 343 deletions(-) create mode 100644 Build/_build.v3.ncrunchproject create mode 100644 FluentAssertions.v3.ncrunchsolution create mode 100644 Src/FluentAssertions/Formatting/Anchor.cs create mode 100644 Src/FluentAssertions/Formatting/BuildingLineState.cs create mode 100644 Src/FluentAssertions/Formatting/FlushedLineState.cs create mode 100644 Src/FluentAssertions/Formatting/ILineState.cs create mode 100644 Src/FluentAssertions/Formatting/Line.cs create mode 100644 Src/FluentAssertions/Formatting/LineCollection.cs create mode 100644 Tests/Approval.Tests/Approval.Tests.v3.ncrunchproject create mode 100644 Tests/Benchmarks/Benchmarks.net472.v3.ncrunchproject diff --git a/.editorconfig b/.editorconfig index 341cae8083..1902d22742 100644 --- a/.editorconfig +++ b/.editorconfig @@ -194,6 +194,11 @@ dotnet_diagnostic.IDE0055.severity = error dotnet_diagnostic.CS1574.severity = error # StyleCop + +# Purpose: An opening square bracket within a C# statement is not spaced correctly. +# Reason: Doesn't understand the new collection initializers +dotnet_diagnostic.SA1010.severity = none + # SA1028: Code should not contain trailing whitespace dotnet_diagnostic.SA1028.severity = suggestion # SA1101: Prefix local calls with this @@ -303,6 +308,9 @@ dotnet_diagnostic.AV2305.severity = none # AV2407: Region should be removed dotnet_diagnostic.AV2407.severity = none +# Keep at least a single blank line between members +resharper_csharp_blank_lines_around_single_line_invocable = 1 + # Convert lambda expression to method group resharper_convert_closure_to_method_group_highlighting = none diff --git a/Build/_build.v3.ncrunchproject b/Build/_build.v3.ncrunchproject new file mode 100644 index 0000000000..319cd523ce --- /dev/null +++ b/Build/_build.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + True + + \ No newline at end of file diff --git a/FluentAssertions.sln.DotSettings b/FluentAssertions.sln.DotSettings index bdc20de29a..14861b12e8 100644 --- a/FluentAssertions.sln.DotSettings +++ b/FluentAssertions.sln.DotSettings @@ -1,4 +1,7 @@  + Default + Inherit + ReturnDefaultValue True True False diff --git a/FluentAssertions.v3.ncrunchsolution b/FluentAssertions.v3.ncrunchsolution new file mode 100644 index 0000000000..fe9b0700d2 --- /dev/null +++ b/FluentAssertions.v3.ncrunchsolution @@ -0,0 +1,8 @@ + + + True + False + True + True + + \ No newline at end of file diff --git a/Src/FluentAssertions/Formatting/Anchor.cs b/Src/FluentAssertions/Formatting/Anchor.cs new file mode 100644 index 0000000000..798b09e035 --- /dev/null +++ b/Src/FluentAssertions/Formatting/Anchor.cs @@ -0,0 +1,93 @@ +namespace FluentAssertions.Formatting; + +/// +/// Represents a point in the formatted object graph where a new fragment or line can be inserted. +/// +internal class Anchor +{ + private readonly FormattedObjectGraph parent; + private readonly int indentation; + private readonly int characterIndex; + private readonly Line line; + private readonly bool lineWasEmptyAtCreation; + + public Anchor(FormattedObjectGraph parent, Line line) + { + indentation = parent.Indentation; + this.parent = parent; + this.line = line; + lineWasEmptyAtCreation = line is null || line.Length == 0; + + // Track the point in the graph where this instance was created. + characterIndex = line?.LengthWithoutOffset ?? 0; + } + + public bool UseLineBreaks { get; set; } + + public void InsertFragment(string fragment) + { + // Insert the fragment to the line and character position the anchor points at. + if (line is null) + { + parent.InsertAtLineStartOrTop(fragment); + } + else + { + line.Insert(characterIndex, fragment); + } + + // If the current line already contained text beyond the anchor point, move that part to the next line. + if (line is not null && !RenderOnSingleLine) + { + parent.SplitLine(line, characterIndex + fragment.Length); + } + } + + public void InsertLineOrFragment(string fragment) + { + if (RenderOnSingleLine) + { + if (line is null) + { + parent.InsertAtLineStartOrTop(fragment); + } + else + { + line.Insert(characterIndex, fragment); + } + } + else + { + string fragmentWithWhitespace = FormattedObjectGraph.MakeWhitespace(indentation) + fragment; + + // If the line was empty when the anchor was created, we can insert the fragment right here. + // But if it wasn't empty, we need to continue the fragment on the next line. + if (lineWasEmptyAtCreation) + { + parent.InsertAtTop(fragmentWithWhitespace); + } + else + { + parent.AddLineAfter(line, fragmentWithWhitespace); + } + } + } + + internal void AddLineOrFragment(string fragment) + { + if (line is null) + { + parent.AddLineOrFragment(fragment); + } + else if (RenderOnSingleLine) + { + line.Append(fragment); + } + else + { + parent.AddLine(fragment); + } + } + + private bool RenderOnSingleLine => !UseLineBreaks && !parent.HasLinesBeyond(line); +} diff --git a/Src/FluentAssertions/Formatting/BuildingLineState.cs b/Src/FluentAssertions/Formatting/BuildingLineState.cs new file mode 100644 index 0000000000..6cfe6c3b0c --- /dev/null +++ b/Src/FluentAssertions/Formatting/BuildingLineState.cs @@ -0,0 +1,44 @@ +using System.Text; + +namespace FluentAssertions.Formatting; + +/// +/// Represents the behavior of when it's still in the building phase and tries +/// to be as efficient as possible by using a . +/// +internal class BuildingLineState : ILineState +{ + private StringBuilder builder = new(); + + public ILineState Flush() + { + var newState = new FlushedLineState(builder.ToString()); + builder = null; + + return newState; + } + + public int Length => builder.Length; + + public void Append(string fragment) + { + builder.Append(fragment); + } + + public void InsertAtStart(string fragment) + { + builder.Insert(0, fragment); + } + + public void InsertAt(int startIndex, string fragment) + { + builder.Insert(startIndex, fragment); + } + + public Line Truncate(int characterIndex, int indentation, int whitespaceOffset) + { + return null; + } + + public string Render() => builder.ToString(); +} diff --git a/Src/FluentAssertions/Formatting/DefaultValueFormatter.cs b/Src/FluentAssertions/Formatting/DefaultValueFormatter.cs index d35e44443c..01ff94aab3 100644 --- a/Src/FluentAssertions/Formatting/DefaultValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/DefaultValueFormatter.cs @@ -76,8 +76,10 @@ private void WriteTypeAndMemberValues(object obj, FormattedObjectGraph formatted private void WriteTypeName(FormattedObjectGraph formattedGraph, Type type) { - var typeName = type.HasFriendlyName() ? TypeDisplayName(type) : string.Empty; - formattedGraph.AddFragment(typeName); + if (type.HasFriendlyName()) + { + formattedGraph.AddFragment(TypeDisplayName(type)); + } } private void WriteTypeValue(object obj, FormattedObjectGraph formattedGraph, FormatChild formatChild, Type type) @@ -89,7 +91,6 @@ private void WriteTypeValue(object obj, FormattedObjectGraph formattedGraph, For } else { - formattedGraph.EnsureInitialNewLine(); formattedGraph.AddLine("{"); WriteMemberValues(obj, members, formattedGraph, formatChild); formattedGraph.AddFragmentOnNewLine("}"); diff --git a/Src/FluentAssertions/Formatting/EnumerableValueFormatter.cs b/Src/FluentAssertions/Formatting/EnumerableValueFormatter.cs index 09d6a25a28..fe15e11746 100644 --- a/Src/FluentAssertions/Formatting/EnumerableValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/EnumerableValueFormatter.cs @@ -33,8 +33,9 @@ public void Format(object value, FormattedObjectGraph formattedGraph, Formatting using var iterator = new Iterator(collection, MaxItems); - var iteratorGraph = formattedGraph.KeepOnSingleLineAsLongAsPossible(); - FormattedObjectGraph.PossibleMultilineFragment separatingCommaGraph = null; + var startingAnchor = formattedGraph.GetAnchor(); + startingAnchor.UseLineBreaks = context.UseLineBreaks; + Anchor commaSeparatorAnchor = null; while (iterator.MoveNext()) { @@ -46,26 +47,26 @@ public void Format(object value, FormattedObjectGraph formattedGraph, Formatting { using IDisposable _ = formattedGraph.WithIndentation(); string moreItemsMessage = value is ICollection c ? $"…{c.Count - MaxItems} more…" : "…more…"; - iteratorGraph.AddLineOrFragment(moreItemsMessage); + formattedGraph.AddLineOrFragment(moreItemsMessage); } - separatingCommaGraph?.InsertLineOrFragment(", "); - separatingCommaGraph = formattedGraph.KeepOnSingleLineAsLongAsPossible(); + commaSeparatorAnchor?.InsertFragment(", "); + commaSeparatorAnchor = formattedGraph.GetAnchor(); - // We cannot know whether or not the enumerable will take up more than one line of - // output until we have formatted the first item. So we format the first item, then + // We cannot know whether the enumerable will take up more than one line of + // output until we have formatted all items. So we format items, then // go back and insert the enumerable's opening brace in the correct place depending // on whether that first item was all on one line or not. if (iterator.IsLast) { - iteratorGraph.AddStartingLineOrFragment("{"); - iteratorGraph.AddLineOrFragment("}"); + startingAnchor.InsertLineOrFragment("{"); + startingAnchor.AddLineOrFragment("}"); } } if (iterator.IsEmpty) { - iteratorGraph.AddFragment("{empty}"); + formattedGraph.AddFragment("{empty}"); } } } diff --git a/Src/FluentAssertions/Formatting/FlushedLineState.cs b/Src/FluentAssertions/Formatting/FlushedLineState.cs new file mode 100644 index 0000000000..4697c7d686 --- /dev/null +++ b/Src/FluentAssertions/Formatting/FlushedLineState.cs @@ -0,0 +1,51 @@ +using System.Text; + +namespace FluentAssertions.Formatting; + +/// +/// Represents the behavior of when most of the appending and inserting +/// has completed, and it no longer needs an internal . +/// +/// +internal class FlushedLineState(string content) : ILineState +{ + private string content = content; + + public ILineState Flush() + { + return this; + } + + public int Length => content.Length; + + public void Append(string fragment) + { + content += fragment; + } + + public void InsertAtStart(string fragment) + { + content = fragment + content; + } + + public void InsertAt(int startIndex, string fragment) + { + content = content.Insert(startIndex, fragment); + } + + public Line Truncate(int characterIndex, int indentation, int whitespaceOffset) + { + string truncatedContent = content.Substring(characterIndex + whitespaceOffset); + + if (truncatedContent.Trim().Length > 0) + { + content = content.Substring(0, characterIndex + whitespaceOffset); + + return new Line(new string(' ', whitespaceOffset) + truncatedContent, indentation, whitespaceOffset); + } + + return null; + } + + public string Render() => content; +} diff --git a/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs b/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs index 91e8d421bf..641fadac5a 100644 --- a/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs +++ b/Src/FluentAssertions/Formatting/FormattedObjectGraph.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; using System.Linq; -using System.Text; -using FluentAssertions.Execution; namespace FluentAssertions.Formatting; @@ -17,17 +14,38 @@ namespace FluentAssertions.Formatting; /// public class FormattedObjectGraph { - private readonly int maxLines; - private readonly List lines = []; - private readonly StringBuilder lineBuilder = new(); - private int indentation; - private string lineBuilderWhitespace = string.Empty; + private readonly LineCollection lines; + /// + /// The current line that is being written to, or if there is no active line. + /// + private Line currentLine; + + /// + /// This class is used by the class to collect all the output of the (nested calls of an) into + /// a the final representation. + /// + /// + /// The will ensure that the number of lines will be limited + /// to the maximum number of lines provided through its constructor. It will throw + /// a if the number of lines exceeds the maximum. + /// public FormattedObjectGraph(int maxLines) { - this.maxLines = maxLines; + lines = new LineCollection(maxLines); } + /// + /// Represents the current level of indentation applied to newly added lines or fragments. + /// + /// + /// The indentation level determines the amount of leading whitespace to be added to each line, + /// calculated based on . It is incremented or decremented with methods such as + /// , and affects all subsequent lines or fragments added to + /// the . + /// + internal int Indentation { get; private set; } + /// /// The number of spaces that should be used by every indentation level. /// @@ -36,7 +54,7 @@ public FormattedObjectGraph(int maxLines) /// /// Returns the number of lines of text currently in the graph. /// - public int LineCount => lines.Count + (lineBuilder.Length > 0 ? 1 : 0); + public int LineCount => lines.Count; /// /// Starts a new line with the provided text fragment. Additional text can be added to @@ -45,84 +63,72 @@ public FormattedObjectGraph(int maxLines) public void AddFragmentOnNewLine(string fragment) { FlushCurrentLine(); - - AddFragment(fragment); + GetCurrentLine().Append(fragment); } /// - /// Starts a new line with the provided line of text that does not allow - /// adding more fragments of text. + /// If there's only one line, adds a fragment to that line. If there are more lines, adds the fragment as + /// a new line that does not allow any further fragments. /// - public void AddLine(string line) + public void AddLineOrFragment(string fragment) { - FlushCurrentLine(); - - AppendWithoutExceedingMaximumLines(Whitespace + line); - } - - /// - /// Adds a new fragment of text to the current line. - /// - public void AddFragment(string fragment) - { - if (lineBuilderWhitespace.Length > 0) + if (lines.Count == 1) { - lineBuilder.Append(lineBuilderWhitespace); - lineBuilderWhitespace = string.Empty; + AddFragment(fragment); + } + else + { + AddLine(fragment); } - - lineBuilder.Append(fragment); } /// - /// Adds a new line if there are no lines and no fragment that would cause a new line. + /// Starts a new line with the provided text that does not allow adding more + /// fragments of text. /// - internal void EnsureInitialNewLine() + public void AddLine(string content) { - if (LineCount == 0) - { - InsertInitialNewLine(); - } + FlushCurrentLine(); + + GetCurrentLine().Append(content); + FlushCurrentLine(); } /// - /// Inserts an empty line as the first line unless it is already. + /// Adds a new fragment of text to the current line. /// - private void InsertInitialNewLine() + public void AddFragment(string fragment) { - if (lines.Count == 0 || !string.IsNullOrEmpty(lines[0])) - { - lines.Insert(0, string.Empty); - lineBuilderWhitespace = Whitespace; - } + GetCurrentLine().Append(fragment); } private void FlushCurrentLine() { - string line = lineBuilder.ToString().TrimEnd(); - if (line.Length > 0) + // We only need to flush the line if there's something to flush. + if (currentLine is not null) { - AppendWithoutExceedingMaximumLines(lineBuilderWhitespace + line); + currentLine.Flush(); + currentLine = null; } - - lineBuilder.Clear(); - lineBuilderWhitespace = Whitespace; } - private void AppendWithoutExceedingMaximumLines(string line) + private Line GetCurrentLine() { - if (lines.Count == maxLines) + // We prefer to lazily initialize the current line so we don't waste memory. + if (currentLine is null) { - lines.Add(string.Empty); - - lines.Add( - $"(Output has exceeded the maximum of {maxLines} lines. " + - $"Increase {nameof(FormattingOptions)}.{nameof(FormattingOptions.MaxLines)} on {nameof(AssertionScope)} or {nameof(AssertionConfiguration)} to include more lines.)"); + currentLine = new Line(Indentation); + lines.Add(currentLine); + } - throw new MaxLinesExceededException(); + // A single-line rendering doesn't need any indentation, so we postpone that decision + // until we know whether there will be more lines. + if (lines.Count > 1) + { + currentLine.EnsureWhitespace(); } - lines.Add(line); + return currentLine; } /// @@ -133,124 +139,60 @@ private void AppendWithoutExceedingMaximumLines(string line) /// public IDisposable WithIndentation() { - indentation++; + Indentation++; return new Disposable(() => { - if (indentation > 0) + if (Indentation > 0) { - indentation--; + Indentation--; } }); } /// - /// Returns the final textual multi-line representation of the object graph. - /// - public override string ToString() - { - return string.Join(Environment.NewLine, lines.Concat([lineBuilder.ToString()])); - } - - internal PossibleMultilineFragment KeepOnSingleLineAsLongAsPossible() - { - return new PossibleMultilineFragment(this); - } - - private string Whitespace => MakeWhitespace(indentation); - - private static string MakeWhitespace(int indent) => new(' ', indent * SpacesPerIndentation); - - /// - /// Write fragments that may be on a single line or span multiple lines, - /// and this is not known until later parts of the fragment are written. + /// Get a reference to the current line (or the last line if there is no active line), so that we can + /// insert fragments and lines at that specific point. /// - internal record PossibleMultilineFragment + internal Anchor GetAnchor() { - private readonly FormattedObjectGraph parentGraph; - private readonly int startingLineBuilderIndex; - private readonly int startingLineCount; - - public PossibleMultilineFragment(FormattedObjectGraph parentGraph) - { - this.parentGraph = parentGraph; - startingLineBuilderIndex = parentGraph.lineBuilder.Length; - startingLineCount = parentGraph.lines.Count; - } - - /// - /// Write the fragment at the position the graph was in when this instance was created. - /// - /// - /// If more lines have been added since this instance was created then write the - /// fragment on a new line, otherwise write it on the same line. - /// - /// - internal void AddStartingLineOrFragment(string fragment) + if (lines.Count == 0) { - if (FormatOnSingleLine) - { - parentGraph.lineBuilder.Insert(startingLineBuilderIndex, fragment); - } - else - { - parentGraph.InsertInitialNewLine(); - parentGraph.lines.Insert(startingLineCount + 1, parentGraph.Whitespace + fragment); - InsertAtStartOfLine(startingLineCount + 2, MakeWhitespace(1)); - } + return new Anchor(this, null); } - private bool FormatOnSingleLine => parentGraph.lines.Count == startingLineCount; + return new Anchor(this, currentLine ?? lines.Last()); + } - private void InsertAtStartOfLine(int lineIndex, string insertion) - { - if (!parentGraph.lines[lineIndex].StartsWith(insertion, StringComparison.Ordinal)) - { - parentGraph.lines[lineIndex] = parentGraph.lines[lineIndex].Insert(0, insertion); - } - } + internal static string MakeWhitespace(int indent) => new(' ', indent * SpacesPerIndentation); - public void InsertLineOrFragment(string fragment) - { - if (FormatOnSingleLine) - { - parentGraph.lineBuilder.Insert(startingLineBuilderIndex, fragment); - } - else - { - parentGraph.lines[startingLineCount] = parentGraph.lines[startingLineCount] - .Insert(startingLineBuilderIndex, InsertNewLineIntoFragment(fragment)); - } - } + internal bool HasLinesBeyond(Line line) => lines.HasLinesBeyond(line); - private string InsertNewLineIntoFragment(string fragment) - { - if (StartingLineHasBeenAddedTo()) - { - return fragment + Environment.NewLine + MakeWhitespace(parentGraph.indentation + 1); - } + internal void AddLineAfter(Line line, string content) + { + lines.AddLineAfter(line, new Line(content)); + } - return fragment; - } + internal void InsertAtTop(string content) + { + lines.InsertAtTop(new Line(content)); + } - private bool StartingLineHasBeenAddedTo() => parentGraph.lines[startingLineCount].Length > startingLineBuilderIndex; + internal void InsertAtLineStartOrTop(string fragment) + { + lines.InsertAtLineStartOrTop(fragment); + } - /// - /// If more lines have been added since this instance was created then write the - /// fragment on a new line, otherwise write it on the same line. - /// - internal void AddLineOrFragment(string fragment) - { - if (FormatOnSingleLine) - { - parentGraph.AddFragment(fragment); - } - else - { - parentGraph.AddFragmentOnNewLine(fragment); - } - } + internal void SplitLine(Line line, int characterIndex) + { + lines.SplitLine(line, characterIndex); + } - internal void AddFragment(string fragment) => parentGraph.AddFragment(fragment); + /// + /// Returns the final textual multi-line representation of the object graph. + /// + public override string ToString() + { + return string.Join(Environment.NewLine, lines.Select(line => line.ToString())); } } diff --git a/Src/FluentAssertions/Formatting/ILineState.cs b/Src/FluentAssertions/Formatting/ILineState.cs new file mode 100644 index 0000000000..1b0e0fe307 --- /dev/null +++ b/Src/FluentAssertions/Formatting/ILineState.cs @@ -0,0 +1,26 @@ +namespace FluentAssertions.Formatting; + +/// +/// Represents the state management of a line for structured content building or rendering. +/// +/// +/// This interface defines the operations that can be performed on a line, +/// including appending content, inserting content at specific positions, +/// truncating the line, and rendering its content. +/// +internal interface ILineState +{ + ILineState Flush(); + + int Length { get; } + + void Append(string fragment); + + void InsertAtStart(string fragment); + + void InsertAt(int startIndex, string fragment); + + Line Truncate(int characterIndex, int indentation, int whitespaceOffset); + + string Render(); +} diff --git a/Src/FluentAssertions/Formatting/Line.cs b/Src/FluentAssertions/Formatting/Line.cs new file mode 100644 index 0000000000..bab01f9edc --- /dev/null +++ b/Src/FluentAssertions/Formatting/Line.cs @@ -0,0 +1,111 @@ +using System; + +namespace FluentAssertions.Formatting; + +/// +/// Represents a single line of output rendered through the . +/// +internal class Line +{ + /// + /// The level of indentation at the time this line was created. + /// + private int indentation; + + private ILineState state; + + /// + /// If any whitespace was inserted at the beginning of the line without an knowing about it, this + /// will be the length of that whitespace so that any calls to will be offset by this amount. + /// + private int whitespaceOffset; + + /// + /// Creates an empty line with the specified indentation that will be applied when + /// actual fragments are added. + /// + public Line(int indentation) + { + state = new BuildingLineState(); + this.indentation = indentation; + } + + public Line(string content) + { + state = new FlushedLineState(content); + } + + public Line(string truncatedContent, int indentation, int whitespaceOffset) + { + state = new FlushedLineState(truncatedContent); + this.indentation = indentation; + this.whitespaceOffset = whitespaceOffset; + } + + /// + /// Is used to close off the internal string builder. + /// + public void Flush() + { + state = state.Flush(); + } + + /// + /// Gets the length of the content, including any whitespace that was inserted at the beginning of the line. + /// + public int Length => state.Length; + + /// + /// Gets the length of the content without the offset of any whitespace that was inserted at the beginning of the line. + /// + public int LengthWithoutOffset => Length - whitespaceOffset; + + public void Append(string fragment) + { + state.Append(fragment); + } + + public void InsertAtStart(string fragment) + { + state.InsertAtStart(fragment); + } + + public void Insert(int characterIndex, string fragment) + { + int startIndex = Math.Min(characterIndex + whitespaceOffset, Length); + state.InsertAt(startIndex, fragment); + } + + /// + /// Ensures that the line is prefixed with the correct amount of whitespace. + /// + /// + /// Since we don't add the whitespace for the first line until we know that there is a second line, we need to be able + /// to fixup the whitespace for the second line at a later time. + /// + public void EnsureWhitespace() + { + if (indentation > 0) + { + string whitespace = FormattedObjectGraph.MakeWhitespace(indentation); + whitespaceOffset = whitespace.Length; + + state.InsertAt(0, whitespace); + + indentation = 0; + } + } + + /// + /// Truncates the current line at the specified character index and returns the remainder as a new line. + /// Returns if the remainder is empty. + /// + public Line Truncate(int characterIndex) + { + Flush(); + + return state.Truncate(characterIndex, indentation, whitespaceOffset); + } + + public override string ToString() => state.Render().TrimEnd(); +} diff --git a/Src/FluentAssertions/Formatting/LineCollection.cs b/Src/FluentAssertions/Formatting/LineCollection.cs new file mode 100644 index 0000000000..ec07978a17 --- /dev/null +++ b/Src/FluentAssertions/Formatting/LineCollection.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using FluentAssertions.Execution; + +namespace FluentAssertions.Formatting; + +/// +/// A collection of lines that will throw a when the number of lines +/// exceeds the maximum. +/// +internal class LineCollection(int maxLines) : IEnumerable +{ + private readonly List lines = []; + + public int Count => lines.Count; + + public bool HasLinesBeyond(Line line) + { + // Null means that we're referring to the top of the list + return (line is null && lines.Count > 1) || (line is not null && lines.IndexOf(line) < (lines.Count - 1)); + } + + public void Add(Line line) + { + lines.Add(line); + OnCollectionIsModified(); + } + + public void AddLineAfter(Line line, Line newLine) + { + int index = lines.IndexOf(line); + + Insert(index + 1, newLine); + } + + public void InsertAtTop(Line newLine) + { + Insert(0, newLine); + } + + public void InsertAtLineStartOrTop(string fragment) + { + // If there's a single line, insert at the beginning of that line + // If there are more than one line, insert as a new line at the top + if (lines.Count == 1) + { + lines[0].InsertAtStart(fragment); + } + else + { + Insert(0, new Line(fragment)); + } + } + + public void SplitLine(Line line, int characterIndex) + { + int lineIndex = lines.IndexOf(line); + + Line remainder = line.Truncate(characterIndex); + if (remainder is not null) + { + Insert(lineIndex + 1, remainder); + } + } + + private void Insert(int index, Line item) + { + lines.Insert(index, item); + OnCollectionIsModified(); + + if (index == 0 && lines.Count > 1) + { + lines[1].EnsureWhitespace(); + } + } + + private void OnCollectionIsModified() + { + if (lines.Count > maxLines) + { + lines.Add(new Line(0)); + + lines.Add(new Line( + $"(Output has exceeded the maximum of {maxLines} lines. " + + $"Increase {nameof(FormattingOptions)}.{nameof(FormattingOptions.MaxLines)} on {nameof(AssertionScope)} or {nameof(AssertionConfiguration)} to include more lines.)")); + + throw new MaxLinesExceededException(); + } + } + + public IEnumerator GetEnumerator() => lines.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); +} diff --git a/Src/FluentAssertions/Formatting/StringValueFormatter.cs b/Src/FluentAssertions/Formatting/StringValueFormatter.cs index 752619dbca..fdf30f7b52 100644 --- a/Src/FluentAssertions/Formatting/StringValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/StringValueFormatter.cs @@ -20,6 +20,13 @@ public void Format(object value, FormattedObjectGraph formattedGraph, Formatting "{value}" """; - formattedGraph.AddFragment(result); + if (context.UseLineBreaks) + { + formattedGraph.AddFragmentOnNewLine(result); + } + else + { + formattedGraph.AddFragment(result); + } } } diff --git a/Tests/.editorconfig b/Tests/.editorconfig index d7c1e5c6d3..2936a92f5c 100644 --- a/Tests/.editorconfig +++ b/Tests/.editorconfig @@ -1,5 +1,9 @@ [*.cs] + + + + # IDE0051: Private member is unused dotnet_diagnostic.IDE0051.severity = none # IDE0070: GetHashCode implementation can be simplified @@ -35,6 +39,11 @@ dotnet_diagnostic.CA1052.severity = none # CA1062: Validate arguments of public methods dotnet_diagnostic.CA1062.severity = none + +# Purpose: Implement IDisposable correctly +# Reason: Not important in test classes +dotnet_diagnostic.CA1063.severity = none + # CA1064: Exceptions should be public dotnet_diagnostic.CA1064.severity = none # CA1307: Specify StringComparison @@ -57,6 +66,11 @@ dotnet_diagnostic.CA1812.severity = none dotnet_diagnostic.CA1813.severity = none # CA1814: Prefer jagged arrays over multidimensional dotnet_diagnostic.CA1814.severity = none + +# Purpose: Call GC.SuppressFinalize correctly +# Reason: Not important in test classes +dotnet_diagnostic.CA1816.severity = none + # CA1822: Member does not access instance data and can be marked as static dotnet_diagnostic.CA1822.severity = none # CA1825: Avoid unnecessary zero-length array allocations. Use Array.Empty() instead diff --git a/Tests/Approval.Tests/Approval.Tests.v3.ncrunchproject b/Tests/Approval.Tests/Approval.Tests.v3.ncrunchproject new file mode 100644 index 0000000000..7b5b2139ff --- /dev/null +++ b/Tests/Approval.Tests/Approval.Tests.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + True + + \ No newline at end of file diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 05b4c07fd9..a1ac90a110 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -1390,7 +1390,8 @@ namespace FluentAssertions.Formatting public static int SpacesPerIndentation { get; } public void AddFragment(string fragment) { } public void AddFragmentOnNewLine(string fragment) { } - public void AddLine(string line) { } + public void AddLine(string content) { } + public void AddLineOrFragment(string fragment) { } public override string ToString() { } public System.IDisposable WithIndentation() { } } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 784751b7cd..a8f3c5051d 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -1409,7 +1409,8 @@ namespace FluentAssertions.Formatting public static int SpacesPerIndentation { get; } public void AddFragment(string fragment) { } public void AddFragmentOnNewLine(string fragment) { } - public void AddLine(string line) { } + public void AddLine(string content) { } + public void AddLineOrFragment(string fragment) { } public override string ToString() { } public System.IDisposable WithIndentation() { } } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 0d8eb031a6..a5068f244d 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -1334,7 +1334,8 @@ namespace FluentAssertions.Formatting public static int SpacesPerIndentation { get; } public void AddFragment(string fragment) { } public void AddFragmentOnNewLine(string fragment) { } - public void AddLine(string line) { } + public void AddLine(string content) { } + public void AddLineOrFragment(string fragment) { } public override string ToString() { } public System.IDisposable WithIndentation() { } } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index fb4ece81e4..3b545b4271 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -1390,7 +1390,8 @@ namespace FluentAssertions.Formatting public static int SpacesPerIndentation { get; } public void AddFragment(string fragment) { } public void AddFragmentOnNewLine(string fragment) { } - public void AddLine(string line) { } + public void AddLine(string content) { } + public void AddLineOrFragment(string fragment) { } public override string ToString() { } public System.IDisposable WithIndentation() { } } diff --git a/Tests/Benchmarks/Benchmarks.net472.v3.ncrunchproject b/Tests/Benchmarks/Benchmarks.net472.v3.ncrunchproject new file mode 100644 index 0000000000..95a483b433 --- /dev/null +++ b/Tests/Benchmarks/Benchmarks.net472.v3.ncrunchproject @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs index 788fd49e77..b21bf168f6 100644 --- a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs +++ b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs @@ -12,7 +12,7 @@ namespace FluentAssertions.Specs.Formatting; [Collection("FormatterSpecs")] -public sealed class FormatterSpecs : IDisposable +public class FormatterSpecs : IDisposable { [Fact] public void When_value_contains_cyclic_reference_it_should_create_descriptive_error_message() @@ -185,60 +185,27 @@ public void When_the_object_is_a_generic_type_without_custom_string_representati } }; - var expectedStuff = new List> - { - new() - { - StuffId = 1, - Description = "Stuff_1", - Children = [1, 2, 3, 4] - }, - new() - { - StuffId = 2, - Description = "WRONG_DESCRIPTION", - Children = [1, 2, 3, 4] - } - }; - // Act - Action act = () => stuff.Should().NotBeNull() - .And.Equal(expectedStuff, (t1, t2) => t1.StuffId == t2.StuffId && t1.Description == t2.Description); + var actual = Formatter.ToString(stuff); // Assert - act.Should().Throw() - .WithMessage( - """ - Expected stuff to be equal to + actual.Should().Match( + """ + { + FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] { - FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] - { - Children = {1, 2, 3, 4}, - Description = "Stuff_1", - StuffId = 1 - }, - FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] - { - Children = {1, 2, 3, 4}, - Description = "WRONG_DESCRIPTION", - StuffId = 2 - } - }, but + Children = {1, 2, 3, 4}, + Description = "Stuff_1", + StuffId = 1 + }, + FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] { - FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] - { - Children = {1, 2, 3, 4}, - Description = "Stuff_1", - StuffId = 1 - }, - FluentAssertions.Specs.Formatting.FormatterSpecs+Stuff`1[[System.Int32*]] - { - Children = {1, 2, 3, 4}, - Description = "Stuff_2", - StuffId = 2 - } - } differs at index 1. - """); + Children = {1, 2, 3, 4}, + Description = "Stuff_2", + StuffId = 2 + } + } + """); } [Fact] @@ -278,36 +245,21 @@ public void When_the_object_is_an_anonymous_type_it_should_show_the_properties_r Children = new[] { 1, 2, 3, 4 }, }; - var expectedStuff = new - { - SingleChild = new { ChildId = 4 }, - Children = new[] { 10, 20, 30, 40 }, - }; - // Act - Action act = () => stuff.Should().Be(expectedStuff); + string actual = Formatter.ToString(stuff); // Assert - act.Should().Throw() - .Which.Message.Should().Be( - """ - Expected stuff to be - { - Children = {10, 20, 30, 40}, - SingleChild = - { - ChildId = 4 - } - }, but found + actual.Should().Match( + """ + { + Children = {1, 2, 3, 4}, + Description = "absent", + SingleChild = { - Children = {1, 2, 3, 4}, - Description = "absent", - SingleChild = - { - ChildId = 8 - } - }. - """); + ChildId = 8 + } + } + """); } [Fact] @@ -315,20 +267,7 @@ public void When_the_object_is_a_list_of_anonymous_type_it_should_show_the_properties_recursively_with_newlines_and_indentation() { // Arrange - var stuff = new[] - { - new - { - Description = "absent", - }, - new - { - Description = "absent", - }, - }; - - var expectedStuff = new[] - { + var expectedStuff = new { ComplexChildren = new[] @@ -336,41 +275,26 @@ public void new { Property = "hello" }, new { Property = "goodbye" }, }, - }, - }; + }; // Act - Action act = () => stuff.Should().BeEquivalentTo(expectedStuff); + var actual = Formatter.ToString(expectedStuff); // Assert - act.Should().Throw() - .Which.Message.Should().Match( - """ - Expected stuff to be a collection with 1 item(s), but* + actual.Should().Be( + """ + { + ComplexChildren = { { - Description = "absent" - },* + Property = "hello" + }, { - Description = "absent" + Property = "goodbye" } } - contains 1 item(s) more than - - { - { - ComplexChildren =* - { - { - Property = "hello" - },* - { - Property = "goodbye" - } - } - } - }.* - """); + } + """); } [Fact] @@ -386,7 +310,7 @@ public void When_the_object_is_an_empty_anonymous_type_it_should_show_braces_on_ // Assert act.Should().Throw() - .Which.Message.Should().Match("*but found { }*"); + .Which.Message.Should().Match("*but found *{ }*"); } [Fact] @@ -395,27 +319,18 @@ public void When_the_object_is_a_tuple_it_should_show_the_properties_recursively // Arrange (int TupleId, string Description, List Children) stuff = (1, "description", [1, 2, 3, 4]); - (int, string, List) expectedStuff = (2, "WRONG_DESCRIPTION", new List { 4, 5, 6, 7 }); - // Act - Action act = () => stuff.Should().Be(expectedStuff); + string actual = Formatter.ToString(stuff); // Assert - act.Should().Throw() - .Which.Message.Should().Match( - """ - Expected stuff to be equal to* - { - Item1 = 2,* - Item2 = "WRONG_DESCRIPTION",* - Item3 = {4, 5, 6, 7} - }, but found* - { - Item1 = 1,* - Item2 = "description",* - Item3 = {1, 2, 3, 4} - }.* - """); + actual.Should().Match( + """ + { + Item1 = 1,* + Item2 = "description",* + Item3 = {1, 2, 3, 4} + } + """); } [Fact] @@ -428,32 +343,22 @@ public void When_the_object_is_a_record_it_should_show_the_properties_recursivel SingleChild: new ChildRecord(ChildRecordId: 80), RecordChildren: [4, 5, 6, 7]); - var expectedStuff = new - { - RecordDescription = "WRONG_DESCRIPTION", - }; - - // Act - Action act = () => stuff.Should().Be(expectedStuff); + var actual = Formatter.ToString(stuff); // Assert - act.Should().Throw() - .Which.Message.Should().Match( - """ - Expected stuff to be* - { - RecordDescription = "WRONG_DESCRIPTION" - }, but found FluentAssertions.Specs.Formatting.FormatterSpecs+StuffRecord + actual.Should().Match( + """ + FluentAssertions.Specs.Formatting.FormatterSpecs+StuffRecord + { + RecordChildren = {4, 5, 6, 7},* + RecordDescription = "descriptive",* + RecordId = 9,* + SingleChild = FluentAssertions.Specs.Formatting.FormatterSpecs+ChildRecord { - RecordChildren = {4, 5, 6, 7},* - RecordDescription = "descriptive",* - RecordId = 9,* - SingleChild = FluentAssertions.Specs.Formatting.FormatterSpecs+ChildRecord - { - ChildRecordId = 80 - } - }. - """); + ChildRecordId = 80 + } + } + """); } [Fact] @@ -913,7 +818,7 @@ public void string result = Formatter.ToString(subject, new FormattingOptions { UseLineBreaks = true }); // Assert - result.Should().Contain($"FluentAssertions.Specs.Formatting.FormatterSpecs+A, {Environment.NewLine}"); + result.Should().Contain($"FluentAssertions.Specs.Formatting.FormatterSpecs+A,{Environment.NewLine}"); result.Should().Contain($"FluentAssertions.Specs.Formatting.FormatterSpecs+B{Environment.NewLine}"); } @@ -1002,7 +907,7 @@ public void When_defining_a_custom_enumerable_value_formatter_it_should_respect_ // Act string str = Formatter.ToString(values); - str.Should().Match(Environment.NewLine + + str.Should().Match( "{*FluentAssertions*FormatterSpecs+CustomClass" + Environment.NewLine + " {" + Environment.NewLine + " IntProperty = 1," + Environment.NewLine + @@ -1030,6 +935,297 @@ public FormatterScope(IValueFormatter formatter) public void Dispose() => Formatter.RemoveFormatter(formatter); } + [Fact] + public void Can_render_an_array_containing_anonymous_types() + { + // Act + var actual = Formatter.ToString(new[] { new { Value = 1 }, new { Value = 2 } }); + + // Assert + actual.Should().Be( + """ + { + { + Value = 1 + }, + { + Value = 2 + } + } + """); + } + + [Fact] + public void Can_render_an_array_on_a_single_line() + { + // Act + var actual = Formatter.ToString(new[] { "abc", "def", "efg" }); + + // Assert + actual.Should().Be(@"{""abc"", ""def"", ""efg""}"); + } + + [Fact] + public void Can_render_an_array_using_line_breaks() + { + // Act + var actual = Formatter.ToString(new[] { "abc", "def", "efg" }, new FormattingOptions + { + UseLineBreaks = true + }); + + // Assert + actual.Should().Be(""" + { + "abc", + "def", + "efg" + } + """); + } + + [Fact] + public void Can_render_a_single_item_array_using_line_breaks() + { + // Act + var actual = Formatter.ToString(new[] { "abc" }, new FormattingOptions + { + UseLineBreaks = true + }); + + // Assert + actual.Should().Be(""" + { + "abc" + } + """); + } + + [Fact] + public void Can_render_a_single_item_array_on_a_single_line() + { + // Act + var actual = Formatter.ToString(new[] { "abc" }); + + // Assert + actual.Should().Be("""{"abc"}"""); + } + + [Fact] + public void Can_render_a_collection_with_anonymous_types_using_line_breaks() + { + // Act + var actual = Formatter.ToString(new[] + { + new { Value = "abc" }, new { Value = "def" }, new { Value = "efg" } + }, new FormattingOptions { UseLineBreaks = true }); + + // Assert + actual.Should().Be( + """ + { + { + Value = + "abc" + }, + { + Value = + "def" + }, + { + Value = + "efg" + } + } + """); + } + + [Fact] + public void Can_render_a_simple_anonymous_object() + { + // Act + var actual = Formatter.ToString(new + { + SingleChild = new { ChildId = 4 }, + Children = new[] { 10, 20, 30, 40 }, + }); + + // Assert + actual.Should().Be( + """ + { + Children = {10, 20, 30, 40}, + SingleChild = + { + ChildId = 4 + } + } + """); + } + + [Fact] + public void Can_format_a_multi_dimensional_array_with_linebreaks() + { + // Arrange + var points = new Point[][] + { + [new Point("0,0")], + [new Point("1,0")], + }; + + // Act + var result = Formatter.ToString(points, new FormattingOptions { UseLineBreaks = true }); + + // Arrange + result.Should().Be( + """ + { + { + P0,0 + }, + { + P1,0 + } + } + """); + } + + [Fact] + public void Can_format_an_enumerable_using_line_breaks() + { + // Arrange + Point[] points = [new("0,0"), new("1,0")]; + + var result = Formatter.ToString(points, new FormattingOptions { UseLineBreaks = true }); + + result.Should().Be( + """ + { + P0,0, + P1,0 + } + """); + } + + [Fact] + public void Can_format_an_enumerable_without_line_breaks() + { + // Arrange + Point[] points = [new("0,0"), new("1,0")]; + + // Act + var result = Formatter.ToString(points, new FormattingOptions { UseLineBreaks = false }); + + // Assert + result.Should().Be("{P0,0, P1,0}"); + } + + private class Point(string name) + { + public override string ToString() => "P" + name; + } + + [Fact] + public void A_formatter_can_force_new_line() + { + // Arrange + var formatter = new FormatterUsingAddLine(); + using var _ = new FormatterScope(formatter); + + // Act + string result = Formatter.ToString(null); + + // Assert + result.Should().Be( + """ + first fragment + separate line + last fragment + """); + } + + private class FormatterUsingAddLine : IValueFormatter + { + public bool CanHandle(object value) => true; + + public void Format(object value, FormattedObjectGraph formattedGraph, FormattingContext context, FormatChild formatChild) + { + formattedGraph.AddFragment("first fragment"); + formattedGraph.AddLine("separate line"); + formattedGraph.AddFragment("last fragment"); + } + } + + [Fact] + public void A_formatter_can_insert_a_line_or_fragment() + { + // Arrange + var formatter = new FormatterUsingInsertLineOrFragment(); + using var _ = new FormatterScope(formatter); + + // Act + string result = Formatter.ToString(null); + + // Assert + result.Should().Be("fragment"); + } + + private class FormatterUsingInsertLineOrFragment : IValueFormatter + { + public bool CanHandle(object value) => true; + + public void Format(object value, FormattedObjectGraph formattedGraph, FormattingContext context, FormatChild formatChild) + { + formattedGraph.GetAnchor().InsertLineOrFragment("fragment"); + } + } + + [Fact] + public void A_formatter_can_use_an_anchor_on_an_empty_graph() + { + using var _ = new FormatterScope(new FormatterUsingInsertFragment()); + + // Act + string result = Formatter.ToString(null); + + // Assert + result.Should().Be("fragment"); + } + + private class FormatterUsingInsertFragment : IValueFormatter + { + public bool CanHandle(object value) => true; + + public void Format(object value, FormattedObjectGraph formattedGraph, FormattingContext context, FormatChild formatChild) + { + formattedGraph.GetAnchor().InsertFragment("fragment"); + } + } + + [Fact] + public void Can_insert_a_fragment_when_using_linebreaks() + { + using var _ = new FormatterScope(new InsertUsingLinebreaksFormatter()); + + // Act + string result = Formatter.ToString(null); + + // Assert + result.Should().Be("fragment"); + } + + private class InsertUsingLinebreaksFormatter : IValueFormatter + { + public bool CanHandle(object value) => true; + + public void Format(object value, FormattedObjectGraph formattedGraph, FormattingContext context, FormatChild formatChild) + { + Anchor anchor = formattedGraph.GetAnchor(); + anchor.UseLineBreaks = true; + anchor.InsertFragment("fragment"); + } + } + public void Dispose() => AssertionEngine.ResetToDefaults(); } diff --git a/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs index 54f2c74587..4bf90fff87 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ReferenceTypeAssertionsSpecs.cs @@ -43,11 +43,9 @@ public void When_two_different_objects_are_expected_to_be_the_same_it_should_fai .Should().Throw() .WithMessage( """ - Expected subject to refer to - { + Expected subject to refer to { UserName = "JohnDoe" - } because they are the same, but found - { + } because they are the same, but found { Name = "John Doe" }. """); @@ -61,8 +59,7 @@ public void When_a_derived_class_has_longer_formatting_than_the_base_class() act.Should().Throw() .WithMessage( """ - Expected subject to be empty, but found at least one item - { + Expected subject to be empty, but found at least one item { FluentAssertions.Specs.Primitives.Complex { Statement = "goodbye" diff --git a/Tests/FluentAssertions.Specs/Xml/XmlNodeFormatterSpecs.cs b/Tests/FluentAssertions.Specs/Xml/XmlNodeFormatterSpecs.cs index ef83197743..9f2ea3fc86 100644 --- a/Tests/FluentAssertions.Specs/Xml/XmlNodeFormatterSpecs.cs +++ b/Tests/FluentAssertions.Specs/Xml/XmlNodeFormatterSpecs.cs @@ -18,7 +18,7 @@ public void When_a_node_is_20_chars_long_it_should_not_be_trimmed() string result = Formatter.ToString(xmlDoc); // Assert - result.Should().Be(@"" + Environment.NewLine); + result.Should().Be(@""); } [Fact] @@ -32,6 +32,6 @@ public void When_a_node_is_longer_then_20_chars_it_should_be_trimmed() string result = Formatter.ToString(xmlDoc); // Assert - result.Should().Be(@" Date: Wed, 26 Mar 2025 11:06:13 -0700 Subject: [PATCH 610/845] Update index.html --- docs/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/index.html b/docs/index.html index 564a606211..30de4677dc 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,8 +6,8 @@ overlay_color: "#373737" overlay_filter: "0.5" overlay_image: "/assets/images/FA_Partner_Logo.png" - cta_label: "Fluent Assertions 7.1 and 8 are out now!" - cta_url: "https://fluentassertions.com/releases/#800" + cta_label: "Fluent Assertions 7.2 and 8.2 are out!" + cta_url: "https://fluentassertions.com/releases/#820" caption: " " excerpt: 'Now an Xceed Partner! - [Learn More](https://xceed.com/fluent-assertions-faq/)
From 34e1a872d950edffb34542b3a3e75562072ea742 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 2 Mar 2025 16:02:48 +0100 Subject: [PATCH 611/845] Improve rendering of exception messages when using WithMessage --- Src/FluentAssertions/Formatting/Line.cs | 6 +- .../Primitives/IStringComparisonStrategy.cs | 6 +- .../Primitives/StringContainsStrategy.cs | 14 ++- .../Primitives/StringEndStrategy.cs | 19 +++- .../Primitives/StringEqualityStrategy.cs | 12 ++- .../Primitives/StringStartStrategy.cs | 15 ++- .../Primitives/StringValidator.cs | 25 ++--- .../StringValidatorSupportingNull.cs | 2 +- .../StringWildcardMatchingStrategy.cs | 59 ++++++++-- .../Specialized/ExceptionAssertions.cs | 72 ++++++------- .../Exceptions/OuterExceptionSpecs.cs | 101 +++++++++++++++++- .../FluentAssertions.Specs.csproj | 3 +- 12 files changed, 249 insertions(+), 85 deletions(-) diff --git a/Src/FluentAssertions/Formatting/Line.cs b/Src/FluentAssertions/Formatting/Line.cs index bab01f9edc..d5971f81f0 100644 --- a/Src/FluentAssertions/Formatting/Line.cs +++ b/Src/FluentAssertions/Formatting/Line.cs @@ -107,5 +107,9 @@ public Line Truncate(int characterIndex) return state.Truncate(characterIndex, indentation, whitespaceOffset); } - public override string ToString() => state.Render().TrimEnd(); + public override string ToString() + { + // Only trim spaces, but keep line breaks. + return state.Render().TrimEnd(' '); + } } diff --git a/Src/FluentAssertions/Primitives/IStringComparisonStrategy.cs b/Src/FluentAssertions/Primitives/IStringComparisonStrategy.cs index 6dffb8b1f4..01152ac4e6 100644 --- a/Src/FluentAssertions/Primitives/IStringComparisonStrategy.cs +++ b/Src/FluentAssertions/Primitives/IStringComparisonStrategy.cs @@ -8,12 +8,12 @@ namespace FluentAssertions.Primitives; internal interface IStringComparisonStrategy { /// - /// The prefix for the message when the assertion fails. + /// Asserts that neither the nor the strings are null. /// - string ExpectationDescription { get; } + void AssertNeitherIsNull(AssertionChain assertionChain, string subject, string expected); /// /// Asserts that the matches the value. /// - void ValidateAgainstMismatch(AssertionChain assertionChain, string subject, string expected); + void AssertForEquality(AssertionChain assertionChain, string subject, string expected); } diff --git a/Src/FluentAssertions/Primitives/StringContainsStrategy.cs b/Src/FluentAssertions/Primitives/StringContainsStrategy.cs index 4d92ad2bd0..6411133327 100644 --- a/Src/FluentAssertions/Primitives/StringContainsStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringContainsStrategy.cs @@ -15,16 +15,22 @@ public StringContainsStrategy(IEqualityComparer comparer, OccurrenceCons this.occurrenceConstraint = occurrenceConstraint; } - public string ExpectationDescription => "Expected {context:string} {0} to contain the equivalent of "; - - public void ValidateAgainstMismatch(AssertionChain assertionChain, string subject, string expected) + public void AssertForEquality(AssertionChain assertionChain, string subject, string expected) { int actual = subject.CountSubstring(expected, comparer); assertionChain .ForConstraint(occurrenceConstraint, actual) .FailWith( - $"{ExpectationDescription}{{1}} {{expectedOccurrence}}{{reason}}, but found it {actual.Times()}.", + $"Expected {{context:string}} {{0}} to contain the equivalent of {{1}} {{expectedOccurrence}}{{reason}}, but found it {actual.Times()}.", subject, expected); } + + public void AssertNeitherIsNull(AssertionChain assertionChain, string subject, string expected) + { + if (subject is null || expected is null) + { + assertionChain.FailWith("Expected {context:string} to contain the equivalent of {0}{reason}, but found {1}", subject, expected); + } + } } diff --git a/Src/FluentAssertions/Primitives/StringEndStrategy.cs b/Src/FluentAssertions/Primitives/StringEndStrategy.cs index ee97e85384..3a2d0044e0 100644 --- a/Src/FluentAssertions/Primitives/StringEndStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringEndStrategy.cs @@ -15,13 +15,11 @@ public StringEndStrategy(IEqualityComparer comparer, string predicateDes this.predicateDescription = predicateDescription; } - public string ExpectationDescription => $"Expected {{context:string}} to {predicateDescription} "; - - public void ValidateAgainstMismatch(AssertionChain assertionChain, string subject, string expected) + public void AssertForEquality(AssertionChain assertionChain, string subject, string expected) { assertionChain .ForCondition(subject!.Length >= expected.Length) - .FailWith($"{ExpectationDescription}{{0}}{{reason}}, but {{1}} is too short.", expected, subject); + .FailWith($"{ExpectationDescription}, but {{1}} is too short.", expected, subject); if (!assertionChain.Succeeded) { @@ -36,7 +34,18 @@ public void ValidateAgainstMismatch(AssertionChain assertionChain, string subjec } assertionChain.FailWith( - $"{ExpectationDescription}{{0}}{{reason}}, but {{1}} differs near {subject.IndexedSegmentAt(indexOfMismatch)}.", + $"{ExpectationDescription}, but {{1}} differs near {subject.IndexedSegmentAt(indexOfMismatch)}.", expected, subject); } + + /// + public void AssertNeitherIsNull(AssertionChain assertionChain, string subject, string expected) + { + if (subject is null || expected is null) + { + assertionChain.FailWith($"{ExpectationDescription}, but found {{1}}.", expected, subject); + } + } + + private string ExpectationDescription => $"Expected {{context:string}} to {predicateDescription} {{0}}{{reason}}"; } diff --git a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs index 2f8d4e4110..ba26a0307a 100644 --- a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs @@ -18,7 +18,7 @@ public StringEqualityStrategy(IEqualityComparer comparer, string predica this.predicateDescription = predicateDescription; } - public void ValidateAgainstMismatch(AssertionChain assertionChain, string subject, string expected) + public void AssertForEquality(AssertionChain assertionChain, string subject, string expected) { ValidateAgainstSuperfluousWhitespace(assertionChain, subject, expected); @@ -60,7 +60,15 @@ public void ValidateAgainstMismatch(AssertionChain assertionChain, string subjec } } - public string ExpectationDescription => $"Expected {{context:string}} to {predicateDescription} "; + public void AssertNeitherIsNull(AssertionChain assertionChain, string subject, string expected) + { + if (subject is null || expected is null) + { + assertionChain.FailWith($"{ExpectationDescription}{{0}}{{reason}}, but found {{1}}.", expected, subject); + } + } + + private string ExpectationDescription => $"Expected {{context:string}} to {predicateDescription} "; private void ValidateAgainstSuperfluousWhitespace(AssertionChain assertion, string subject, string expected) { diff --git a/Src/FluentAssertions/Primitives/StringStartStrategy.cs b/Src/FluentAssertions/Primitives/StringStartStrategy.cs index 36ff44ca8e..4738d90355 100644 --- a/Src/FluentAssertions/Primitives/StringStartStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringStartStrategy.cs @@ -15,9 +15,7 @@ public StringStartStrategy(IEqualityComparer comparer, string predicateD this.predicateDescription = predicateDescription; } - public string ExpectationDescription => $"Expected {{context:string}} to {predicateDescription} "; - - public void ValidateAgainstMismatch(AssertionChain assertionChain, string subject, string expected) + public void AssertForEquality(AssertionChain assertionChain, string subject, string expected) { assertionChain .ForCondition(subject.Length >= expected.Length) @@ -39,4 +37,15 @@ public void ValidateAgainstMismatch(AssertionChain assertionChain, string subjec $"{ExpectationDescription}{{0}}{{reason}}, but {{1}} differs near {subject.IndexedSegmentAt(indexOfMismatch)}.", expected, subject); } + + /// + public void AssertNeitherIsNull(AssertionChain assertionChain, string subject, string expected) + { + if (subject is null || expected is null) + { + assertionChain.FailWith($"{ExpectationDescription}{{0}}{{reason}}, but found {{1}}.", expected, subject); + } + } + + private string ExpectationDescription => $"Expected {{context:string}} to {predicateDescription} "; } diff --git a/Src/FluentAssertions/Primitives/StringValidator.cs b/Src/FluentAssertions/Primitives/StringValidator.cs index a1e2b2facc..c98ff29fda 100644 --- a/Src/FluentAssertions/Primitives/StringValidator.cs +++ b/Src/FluentAssertions/Primitives/StringValidator.cs @@ -22,27 +22,16 @@ public void Validate(string subject, string expected) return; } - if (!ValidateAgainstNulls(subject, expected)) - { - return; - } + comparisonStrategy.AssertNeitherIsNull(assertionChain, subject, expected); - if (expected.IsLongOrMultiline() || subject.IsLongOrMultiline()) + if (assertionChain.Succeeded) { - assertionChain = assertionChain.UsingLineBreaks; - } + if (expected.IsLongOrMultiline() || subject.IsLongOrMultiline()) + { + assertionChain = assertionChain.UsingLineBreaks; + } - comparisonStrategy.ValidateAgainstMismatch(assertionChain, subject, expected); - } - - private bool ValidateAgainstNulls(string subject, string expected) - { - if (expected is null == subject is null) - { - return true; + comparisonStrategy.AssertForEquality(assertionChain, subject, expected); } - - assertionChain.FailWith($"{comparisonStrategy.ExpectationDescription}{{0}}{{reason}}, but found {{1}}.", expected, subject); - return false; } } diff --git a/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs b/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs index f5fb4478b4..cabd1a6e37 100644 --- a/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs +++ b/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs @@ -24,6 +24,6 @@ public void Validate(string subject, string expected) assertionChain = assertionChain.UsingLineBreaks; } - comparisonStrategy.ValidateAgainstMismatch(assertionChain, subject, expected); + comparisonStrategy.AssertForEquality(assertionChain, subject, expected); } } diff --git a/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs b/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs index 83f590048d..d545ce52a0 100644 --- a/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Linq; using System.Text; using System.Text.RegularExpressions; using FluentAssertions.Common; @@ -8,22 +10,47 @@ namespace FluentAssertions.Primitives; internal class StringWildcardMatchingStrategy : IStringComparisonStrategy { - public void ValidateAgainstMismatch(AssertionChain assertionChain, string subject, string expected) + public void AssertForEquality(AssertionChain assertionChain, string subject, string expected) { bool isMatch = IsMatch(subject, expected); - if (isMatch != Negate) { return; } - if (Negate) + if (IsLongOrMultiline(subject) || IsLongOrMultiline(expected)) { - assertionChain.FailWith($"{ExpectationDescription}but {{1}} matches.", expected, subject); + expected = RenderAsIndentedBlock(expected); + subject = RenderAsIndentedBlock(subject); + + assertionChain + .FailWith($$""" + {{ExpectationDescription}} + + {0}, + + {reason}but + + {1} + + {{OutcomeDescription}}. + + """, expected.AsNonFormattable(), + subject.AsNonFormattable()); } else { - assertionChain.FailWith($"{ExpectationDescription}but {{1}} does not.", expected, subject); + assertionChain.FailWith($"{ExpectationDescription} {{0}}{{reason}}, but {{1}} {OutcomeDescription}.", expected, + subject); + } + } + + /// + public void AssertNeitherIsNull(AssertionChain assertionChain, string subject, string expected) + { + if (subject is null || expected is null) + { + assertionChain.FailWith($"{ExpectationDescription} {{0}}{{reason}}, but found {{1}}.", expected, subject); } } @@ -48,6 +75,18 @@ private static string ConvertWildcardToRegEx(string wildcardExpression) + "$"; } + private static string RenderAsIndentedBlock(string message) + { + string[] lines = message.Split(["\r\n", "\n", "\r"], StringSplitOptions.None); + + return " \"" + string.Join(Environment.NewLine + " ", lines) + "\""; + } + + private static bool IsLongOrMultiline(string message) + { + return message.Length > 80 || message.Contains(Environment.NewLine, StringComparison.Ordinal); + } + private string CleanNewLines(string input) { if (IgnoreAllNewlines) @@ -63,7 +102,7 @@ private string CleanNewLines(string input) return input; } - public string ExpectationDescription + private string ExpectationDescription { get { @@ -72,13 +111,17 @@ public string ExpectationDescription builder .Append(Negate ? "Did not expect " : "Expected ") .Append("{context:string}") - .Append(IgnoreCase ? " to match the equivalent of" : " to match") - .Append(" {0}{reason}, "); + .Append(IgnoreCase ? " to match the equivalent of" : " to match"); return builder.ToString(); } } + private string OutcomeDescription + { + get { return Negate ? "matches" : "does not"; } + } + /// /// Gets or sets a value indicating whether the subject should not match the pattern. /// diff --git a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs index 9ada515f2d..b611fa08d5 100644 --- a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs @@ -84,12 +84,40 @@ public virtual ExceptionAssertions WithMessage(string expectedWildca .ForCondition(Subject.Any()) .FailWith("Expected exception with message {0}{reason}, but no exception was thrown.", expectedWildcardPattern); - AssertExceptionMessage(Subject.Select(exc => exc.Message), expectedWildcardPattern, because, - becauseArgs); + AssertExceptionMessage(expectedWildcardPattern, because, becauseArgs); return this; } + private void AssertExceptionMessage(string expectedWildcardPattern, string because, object[] becauseArgs) + { + var results = new AssertionResultSet(); + + foreach (string message in Subject.Select(exc => exc.Message)) + { + using (var scope = new AssertionScope()) + { + var chain = AssertionChain.GetOrCreate(); + chain.OverrideCallerIdentifier(() => "exception message"); + chain.ReuseOnce(); + + message.Should().MatchEquivalentOf(expectedWildcardPattern, because, becauseArgs); + + results.AddSet(message, scope.Discard()); + } + + if (results.ContainsSuccessfulSet()) + { + break; + } + } + + foreach (string failure in results.GetTheFailuresForTheSetWithTheFewestFailures()) + { + assertionChain.FailWith("{0}", failure.AsNonFormattable()); + } + } + /// /// Asserts that the thrown exception contains an inner exception of type . /// @@ -167,7 +195,8 @@ public ExceptionAssertions WithInnerExceptionExactly(Type innerExcept { Guard.ThrowIfArgumentIsNull(innerException); - return new ExceptionAssertions(AssertInnerExceptionExactly(innerException, because, becauseArgs), assertionChain); + return new ExceptionAssertions(AssertInnerExceptionExactly(innerException, because, becauseArgs), + assertionChain); } /// @@ -195,7 +224,7 @@ public ExceptionAssertions Where(Expression> .ForCondition(condition(SingleSubject)) .BecauseOf(because, becauseArgs) .FailWith("Expected exception where {0}{reason}, but the condition was not met by:" - + Environment.NewLine + Environment.NewLine + "{1}.", + + Environment.NewLine + Environment.NewLine + "{1}.", exceptionExpression, Subject); return this; @@ -262,39 +291,6 @@ private TException SingleSubject private static string BuildExceptionsString(IEnumerable exceptions) { - return string.Join(Environment.NewLine, - exceptions.Select( - exception => - "\t" + Formatter.ToString(exception))); - } - - private void AssertExceptionMessage(IEnumerable messages, string expectation, - [StringSyntax("CompositeFormat")] string because, params object[] becauseArgs) - { - var results = new AssertionResultSet(); - - foreach (string message in messages) - { - using (var scope = new AssertionScope()) - { - var chain = AssertionChain.GetOrCreate(); - chain.OverrideCallerIdentifier(() => "exception message"); - chain.ReuseOnce(); - - message.Should().MatchEquivalentOf(expectation, because, becauseArgs); - - results.AddSet(message, scope.Discard()); - } - - if (results.ContainsSuccessfulSet()) - { - break; - } - } - - foreach (string failure in results.GetTheFailuresForTheSetWithTheFewestFailures()) - { - assertionChain.FailWith("{0}", failure.AsNonFormattable()); - } + return string.Join(Environment.NewLine, exceptions.Select(exception => "\t" + Formatter.ToString(exception))); } } diff --git a/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs index f4c56646be..09af399d21 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics.CodeAnalysis; +using Bogus; using Xunit; using Xunit.Sdk; @@ -41,6 +42,104 @@ public void When_subject_throws_expected_exception_but_with_unexpected_message_i } } + [Fact] + public void Long_exception_messages_are_rendered_over_multiple_lines() + { + // Arrange + Does testSubject = Does.Throw(new InvalidOperationException("some")); + + try + { + // Act + testSubject + .Invoking(x => x.Do()) + .Should().Throw() + .WithMessage(new Faker().Random.String2(101)); + + throw new XunitException("This point should not be reached"); + } + catch (XunitException ex) + { + // Assert + ex.Message.Should().Match( + """ + Expected exception message to match the equivalent of + + "*", + + but + + "some" + + does not. + + """); + } + } + + [Fact] + public void Multiline_exception_messages_are_rendered_over_multiple_lines() + { + // Arrange + Does testSubject = Does.Throw(new InvalidOperationException("some")); + + try + { + // Act + testSubject + .Invoking(x => x.Do()) + .Should().Throw() + .WithMessage(""" + line1* + line2 + """); + + throw new XunitException("This point should not be reached"); + } + catch (XunitException ex) + { + // Assert + ex.Message.Should().Match( + """ + Expected exception message to match the equivalent of + + "line1* + line2", + + but + + "some" + + does not. + + """); + } + } + + [Fact] + public void Short_exception_messages_are_rendered_on_a_single_line() + { + // Arrange + Does testSubject = Does.Throw(new InvalidOperationException("some")); + + try + { + // Act + testSubject + .Invoking(x => x.Do()) + .Should().Throw() + .WithMessage(new Faker().Random.String2(50)); + + throw new XunitException("This point should not be reached"); + } + catch (XunitException ex) + { + // Assert + ex.Message.Should().Match( + """Expected exception message to match the equivalent of "*", but "some" does not."""); + } + } + [Fact] public void When_subject_throws_expected_exception_with_message_starting_with_expected_message_it_should_not_throw() { @@ -177,7 +276,7 @@ public void { // Assert ex.Message.Should().Match( - "Expected exception message to match the equivalent of*\"message2\", but*message2*someParam*"); + "Expected exception message to match the equivalent of*\"message2\",*but*message2*someParam*"); } } diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 233682d337..f67a676849 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -1,4 +1,4 @@ - + net47;net6.0;net8.0 @@ -25,6 +25,7 @@ + From 5286c268178cf7125c821ba2689709d664ba3977 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 14:15:08 +0000 Subject: [PATCH 612/845] Bump cspell from 8.17.5 to 8.18.1 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.17.5 to 8.18.1. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.18.1/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 295 ++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 142 insertions(+), 155 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9b66594f76..f7d1fa307a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.17.5" + "cspell": "^8.18.1" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.17.5.tgz", - "integrity": "sha512-b/Ntabar+g4gsRNwOct909cvatO/auHhNvBzJZfyFQzryI1nqHMaSFuDsrrtzbhQkGJ4GiMAKCXZC2EOdHMgmw==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.18.1.tgz", + "integrity": "sha512-gxciVVfQqCVXYH0p2Q5D7x7/SgaW3Wv5UjRwO+TCme0P2lVLl/IcfjkujZX+6UQkT7X4QRglXo1QN141UcCRCQ==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.0", @@ -21,7 +21,7 @@ "@cspell/dict-aws": "^4.0.9", "@cspell/dict-bash": "^4.2.0", "@cspell/dict-companies": "^3.1.14", - "@cspell/dict-cpp": "^6.0.4", + "@cspell/dict-cpp": "^6.0.6", "@cspell/dict-cryptocurrencies": "^5.0.4", "@cspell/dict-csharp": "^4.0.6", "@cspell/dict-css": "^4.0.17", @@ -31,17 +31,17 @@ "@cspell/dict-docker": "^1.1.12", "@cspell/dict-dotnet": "^5.0.9", "@cspell/dict-elixir": "^4.0.7", - "@cspell/dict-en_us": "^4.3.33", - "@cspell/dict-en-common-misspellings": "^2.0.9", + "@cspell/dict-en_us": "^4.3.35", + "@cspell/dict-en-common-misspellings": "^2.0.10", "@cspell/dict-en-gb": "1.1.33", "@cspell/dict-filetypes": "^3.0.11", "@cspell/dict-flutter": "^1.1.0", "@cspell/dict-fonts": "^4.0.4", "@cspell/dict-fsharp": "^1.1.0", - "@cspell/dict-fullstack": "^3.2.5", + "@cspell/dict-fullstack": "^3.2.6", "@cspell/dict-gaming-terms": "^1.1.0", "@cspell/dict-git": "^3.0.4", - "@cspell/dict-golang": "^6.0.18", + "@cspell/dict-golang": "^6.0.19", "@cspell/dict-google": "^1.0.8", "@cspell/dict-haskell": "^4.0.5", "@cspell/dict-html": "^4.0.11", @@ -57,21 +57,21 @@ "@cspell/dict-markdown": "^2.0.9", "@cspell/dict-monkeyc": "^1.0.10", "@cspell/dict-node": "^5.0.6", - "@cspell/dict-npm": "^5.1.27", + "@cspell/dict-npm": "^5.1.31", "@cspell/dict-php": "^4.0.14", "@cspell/dict-powershell": "^5.0.14", "@cspell/dict-public-licenses": "^2.0.13", - "@cspell/dict-python": "^4.2.15", + "@cspell/dict-python": "^4.2.16", "@cspell/dict-r": "^2.1.0", - "@cspell/dict-ruby": "^5.0.7", + "@cspell/dict-ruby": "^5.0.8", "@cspell/dict-rust": "^4.0.11", "@cspell/dict-scala": "^5.0.7", "@cspell/dict-shell": "^1.1.0", - "@cspell/dict-software-terms": "^4.2.5", + "@cspell/dict-software-terms": "^5.0.2", "@cspell/dict-sql": "^2.2.0", "@cspell/dict-svelte": "^1.0.6", "@cspell/dict-swift": "^2.0.5", - "@cspell/dict-terraform": "^1.1.0", + "@cspell/dict-terraform": "^1.1.1", "@cspell/dict-typescript": "^3.2.0", "@cspell/dict-vue": "^3.0.4" }, @@ -80,30 +80,30 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.17.5.tgz", - "integrity": "sha512-+eVFCdnda74Frv8hguHYwDtxvqDuJJ/luFRl4dC5oknPMRab0JCHM1DDYjp3NzsehTex0HmcxplxqVW6QoDosg==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.18.1.tgz", + "integrity": "sha512-/U3/8bcOL5O35fI9F7nN7Mhic0K01ZRxRV/+5jj7atltBbqgFSxViHCZBX0lDZJM96gUHn+3r6q6/8VEJahpDA==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "8.17.5" + "@cspell/cspell-types": "8.18.1" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.17.5.tgz", - "integrity": "sha512-VOIfFdIo3FYQFcSpIyGkqHupOx0LgfBrWs79IKnTT1II27VUHPF+0oGq0WWf4c2Zpd8tzdHvS3IUhGarWZq69g==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.18.1.tgz", + "integrity": "sha512-QHndTQPkR1c02pvvQ7UKFtLjCXgY0OcX8zjTLrCkynmcQxJFjAZAh9cJ7NMOAxab+ciSnkaVf4KWaRSEG17z8Q==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.17.5.tgz", - "integrity": "sha512-5MhYInligPbGctWxoklAKxtg+sxvtJCuRKGSQHHA0JlCOLSsducypl780P6zvpjLK59XmdfC+wtFONxSmRbsuA==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.18.1.tgz", + "integrity": "sha512-T2sUBv0p9Hnfyg1xT1u3ESKuIWaaIDo0I8idh5DSlTpHgLjdIeAwasmFjEJ28qZv8OKSGawcSQKgJbStfbZASQ==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" @@ -113,18 +113,18 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.17.5.tgz", - "integrity": "sha512-Ur3IK0R92G/2J6roopG9cU/EhoYAMOx2um7KYlq93cdrly8RBAK2NCcGCL7DbjQB6C9RYEAV60ueMUnQ45RrCQ==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.18.1.tgz", + "integrity": "sha512-PwWl7EyhGIu4wHEhvBJb6xVlqMtFwQk0qLDArBvugL6nA+MX9NfG/w7PTgS7tCkFjVF1ku2sDzDLTDWwEk+MLw==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.17.5.tgz", - "integrity": "sha512-91y2+0teunRSRZj940ORDA3kdjyenrUiM+4j6nQQH24sAIAJdRmQl2LG3eUTmeaSReJGkZIpnToQ6DyU5cC88Q==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.18.1.tgz", + "integrity": "sha512-d/nMG+qnMbI/1JPm+lD0KcKpgtEHMRsHxkdtGyNCDgvHL/JOGaSHc5ERS3IUgBW0Dfya/3z9wPdaMcHEzt7YCQ==", "license": "MIT", "engines": { "node": ">=18" @@ -164,9 +164,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-cpp": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.4.tgz", - "integrity": "sha512-IvXx3TlM+OL0CFriapk7ZHmeY89dSSdo/BZ3DGf+WUS+BWd64H+z/xr3xkkqY0Eu6MV/vdzNfkLm5zl45FDMGg==", + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.6.tgz", + "integrity": "sha512-HMV1chsExuZt5IL9rYBW7GmhNZDVdQJEd1WtFgOO6jqiNxbpTG3Is3Pkldl7FpusBQQZr4BdjMit5bnPpVRy3A==", "license": "MIT" }, "node_modules/@cspell/dict-cryptocurrencies": { @@ -224,15 +224,15 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.3.33", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.33.tgz", - "integrity": "sha512-HniqQjzPVn24NEkHooBIw1cH+iO3AKMA9oDTwazUYQP1/ldqXsz6ce4+fdHia2nqypmic/lHVkQgIVhP48q/sA==", + "version": "4.3.35", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.35.tgz", + "integrity": "sha512-HF6QNyPHkxeo/SosaZXRQlnKDUTjIzrGKyqfbw/fPPlPYrXefAZZ40ofheb5HnbUicR7xqV/lsc/HQfqYshGIw==", "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.9.tgz", - "integrity": "sha512-O/jAr1VNtuyCFckbTmpeEf43ZFWVD9cJFvWaA6rO2IVmLirJViHWJUyBZOuQcesSplzEIw80MAYmnK06/MDWXQ==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.10.tgz", + "integrity": "sha512-80mXJLtr0tVEtzowrI7ycVae/ULAYImZUlr0kUTpa8i57AUk7Zy3pYBs44EYIKW7ZC9AHu4Qjjfq4vriAtyTDQ==", "license": "CC BY-SA 4.0" }, "node_modules/@cspell/dict-en-gb": { @@ -266,9 +266,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-fullstack": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.5.tgz", - "integrity": "sha512-XNmNdovPUS9Vc2JvfBscy8zZfwyxR11sB4fxU2lXh7LzUvOn2/OkKAzj41JTdiWfVnJ/yvsRkspe+b7kr+DIQw==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.6.tgz", + "integrity": "sha512-cSaq9rz5RIU9j+0jcF2vnKPTQjxGXclntmoNp4XB7yFX2621PxJcekGjwf/lN5heJwVxGLL9toR0CBlGKwQBgA==", "license": "MIT" }, "node_modules/@cspell/dict-gaming-terms": { @@ -284,9 +284,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-golang": { - "version": "6.0.18", - "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.18.tgz", - "integrity": "sha512-Mt+7NwfodDwUk7423DdaQa0YaA+4UoV3XSxQwZioqjpFBCuxfvvv4l80MxCTAAbK6duGj0uHbGTwpv8fyKYPKg==", + "version": "6.0.19", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.19.tgz", + "integrity": "sha512-VS+oinB2/CbgmHE06kMJlj52OVMZM0S2EEXph3oaroNTgTuclSwdFylQmOEjquZi55kW+n3FM9MyWXiitB7Dtg==", "license": "MIT" }, "node_modules/@cspell/dict-google": { @@ -386,9 +386,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.1.27", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.27.tgz", - "integrity": "sha512-LGss1yrjhxSmxL4VfMC+UBDMVHfqHudgC7b39M74EVys+nNC4/lqDHacb6Aw7i6aUn9mzdNIkdTTD+LdDcHvPA==", + "version": "5.1.31", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.31.tgz", + "integrity": "sha512-Oh9nrhgNV4UD1hlbgO3TFQqQRKziwc7qXKoQiC4oqOYIhMs2WL9Ezozku7FY1e7o5XbCIZX9nRH0ymNx/Rwj6w==", "license": "MIT" }, "node_modules/@cspell/dict-php": { @@ -410,9 +410,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-python": { - "version": "4.2.15", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.15.tgz", - "integrity": "sha512-VNXhj0Eh+hdHN89MgyaoSAexBQKmYtJaMhucbMI7XmBs4pf8fuFFN3xugk51/A4TZJr8+RImdFFsGMOw+I4bDA==", + "version": "4.2.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.16.tgz", + "integrity": "sha512-LkQssFt1hPOWXIQiD8ScTkz/41RL7Ti0V/2ytUzEW82dc0atIEksrBg8MuOjWXktp0Dk5tDwRLgmIvhV3CFFOA==", "license": "MIT", "dependencies": { "@cspell/dict-data-science": "^2.0.7" @@ -425,9 +425,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-ruby": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.7.tgz", - "integrity": "sha512-4/d0hcoPzi5Alk0FmcyqlzFW9lQnZh9j07MJzPcyVO62nYJJAGKaPZL2o4qHeCS/od/ctJC5AHRdoUm0ktsw6Q==", + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.8.tgz", + "integrity": "sha512-ixuTneU0aH1cPQRbWJvtvOntMFfeQR2KxT8LuAv5jBKqQWIHSxzGlp+zX3SVyoeR0kOWiu64/O5Yn836A5yMcQ==", "license": "MIT" }, "node_modules/@cspell/dict-rust": { @@ -449,9 +449,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-4.2.5.tgz", - "integrity": "sha512-CaRzkWti3AgcXoxuRcMijaNG7YUk/MH1rHjB8VX34v3UdCxXXeqvRyElRKnxhFeVLB/robb2UdShqh/CpskxRg==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.0.2.tgz", + "integrity": "sha512-aCzP+M0WXRLYXTriDMZygUe5s4jKyau/nCA6gBGt4EoHfXn+Ua/+DrW766oXOkkESIlqTBtRgb9gWwQvUdOXSQ==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -473,9 +473,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-terraform": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.1.0.tgz", - "integrity": "sha512-G55pcUUxeXAhejstmD35B47SkFd4uqCQimc+CMgq8Nx0dr03guL2iMsz8faRWQGkCnGimX8S91rbOhDv9p/heg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.1.1.tgz", + "integrity": "sha512-07KFDwCU7EnKl4hOZLsLKlj6Zceq/IsQ3LRWUyIjvGFfZHdoGtFdCp3ZPVgnFaAcd/DKv+WVkrOzUBSYqHopQQ==", "license": "MIT" }, "node_modules/@cspell/dict-typescript": { @@ -491,12 +491,12 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.17.5.tgz", - "integrity": "sha512-tY+cVkRou+0VKvH+K1NXv8/R7mOlW3BDGSs9fcgvhatj0m00Yf8blFC7tE4VVI9Qh2bkC/KDFqM24IqZbuwXUQ==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.18.1.tgz", + "integrity": "sha512-VJHfS/Iv0Rx7wn1pjPmwgsaw6r72N5Cx2gL0slWk8Cogc8YiK7/6jsGnsvxJZVkHntJoiT8PrkIvhNKb3awD3g==", "license": "MIT", "dependencies": { - "@cspell/url": "8.17.5", + "@cspell/url": "8.18.1", "import-meta-resolve": "^4.1.0" }, "engines": { @@ -504,27 +504,27 @@ } }, "node_modules/@cspell/filetypes": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.17.5.tgz", - "integrity": "sha512-Fj6py2Rl+FEnMiXhRQUM1A5QmyeCLxi6dY/vQ0qfH6tp6KSaBiaC8wuPUKhr8hKyTd3+8lkUbobDhUf6xtMEXg==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.18.1.tgz", + "integrity": "sha512-vTOb2itP0pjrccvt8wcKiTGyw0pFMTPI85H12T6n8ZhqXTktPgQH2gEf/SU/5tkPNnBKr4GJ+FdU5hJ27HzgXQ==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.17.5.tgz", - "integrity": "sha512-Z4eo+rZJr1086wZWycBiIG/n7gGvVoqn28I7ZicS8xedRYu/4yp2loHgLn4NpxG3e46+dNWs4La6vinod+UydQ==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.18.1.tgz", + "integrity": "sha512-gsgv+5ZQD4aHNHDdfNGoafVYkqRynyYgaodt9Dp/3o0YKYcxGf2jrX8SJ35MfZ61qln0n7P4Djrg+bFV2zNH5w==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.17.5.tgz", - "integrity": "sha512-GNQqST7zI85dAFVyao6oiTeg5rNhO9FH1ZAd397qQhvwfxrrniNfuoewu8gPXyP0R4XBiiaCwhBL7w9S/F5guw==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.18.1.tgz", + "integrity": "sha512-FRJbLYDC9ucpTOzbF6MohP2u5X3NU5L0RoVuoYCynqm/QOI38XP6WOEaI4H58CAn857bOIKZk0LZRPTGzi6Qlg==", "license": "MIT", "engines": { "node": ">=18.0" @@ -631,24 +631,24 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.17.5.tgz", - "integrity": "sha512-l3Cfp87d7Yrodem675irdxV6+7+OsdR+jNwYHe33Dgnd6ePEfooYrvmfGdXF9rlQrNLUQp/HqYgHJzSq19UEsg==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.18.1.tgz", + "integrity": "sha512-RE3LIgN9NAVcYBNX2NQVhLergok8EPymOuCUhu1vBR8cjRmioksn3CJeCoQgD8rPjalM+S9thYkMtOZc5Jjv2A==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "8.17.5", - "@cspell/cspell-pipe": "8.17.5", - "@cspell/cspell-types": "8.17.5", - "@cspell/dynamic-import": "8.17.5", - "@cspell/url": "8.17.5", + "@cspell/cspell-json-reporter": "8.18.1", + "@cspell/cspell-pipe": "8.18.1", + "@cspell/cspell-types": "8.18.1", + "@cspell/dynamic-import": "8.18.1", + "@cspell/url": "8.18.1", "chalk": "^5.4.1", "chalk-template": "^1.1.0", "commander": "^13.1.0", - "cspell-dictionary": "8.17.5", - "cspell-gitignore": "8.17.5", - "cspell-glob": "8.17.5", - "cspell-io": "8.17.5", - "cspell-lib": "8.17.5", + "cspell-dictionary": "8.18.1", + "cspell-gitignore": "8.18.1", + "cspell-glob": "8.18.1", + "cspell-io": "8.18.1", + "cspell-lib": "8.18.1", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "get-stdin": "^9.0.0", @@ -667,12 +667,12 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.17.5.tgz", - "integrity": "sha512-XDc+UJO5RZ9S9e2Ajz332XjT7dv6Og2UqCiSnAlvHt7t/MacLHSPARZFIivheObNkWZ7E1iWI681RxKoH4o40w==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.18.1.tgz", + "integrity": "sha512-zdJ0uhLROSUrHoibysPw+AkxKPUmiG95hDtiL7s8smewkuaS1hpjqwsDBx981nHYs3xW3qDUfVATrAkSzb0VMw==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "8.17.5", + "@cspell/cspell-types": "8.18.1", "comment-json": "^4.2.5", "yaml": "^2.7.0" }, @@ -681,14 +681,14 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.17.5.tgz", - "integrity": "sha512-O/Uuhv1RuDu+5WYQml0surudweaTvr+2YJSmPSdlihByUSiogCbpGqwrRow7wQv/C5p1W1FlFjotvUfoR0fxHA==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.18.1.tgz", + "integrity": "sha512-vKHEPSfkMKMR4S4tk6K2vHC+f3kdJK8Kdh/C0jDh6RRDjDsyAPxshtbremxOgAX6X8GaRUCROoMZ7FhB92+Y9w==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.17.5", - "@cspell/cspell-types": "8.17.5", - "cspell-trie-lib": "8.17.5", + "@cspell/cspell-pipe": "8.18.1", + "@cspell/cspell-types": "8.18.1", + "cspell-trie-lib": "8.18.1", "fast-equals": "^5.2.2" }, "engines": { @@ -696,15 +696,14 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.17.5.tgz", - "integrity": "sha512-I27fgOUZzH14jeIYo65LooB60fZ42f6OJL1lOR9Mk6IrIlDyUtzherGR+xx5KshK2katYkX42Qu4zsVYM6VFPA==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.18.1.tgz", + "integrity": "sha512-gp/AdUtW6FqpKY4YyYJ3kz0OsXApwsV1FOUA9Z0VnOYKVZtt2snh4uNlI4Ltq+wh7pDU8mqaPWmX6Xy+HSRDkQ==", "license": "MIT", "dependencies": { - "@cspell/url": "8.17.5", - "cspell-glob": "8.17.5", - "cspell-io": "8.17.5", - "find-up-simple": "^1.0.0" + "@cspell/url": "8.18.1", + "cspell-glob": "8.18.1", + "cspell-io": "8.18.1" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -714,12 +713,12 @@ } }, "node_modules/cspell-glob": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.17.5.tgz", - "integrity": "sha512-OXquou7UykInlGV5et5lNKYYrW0dwa28aEF995x1ocANND7o0bbHmFlbgyci/Lp4uFQai8sifmfFJbuIg2IC/A==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.18.1.tgz", + "integrity": "sha512-tlZXvzsN7dByHo69dz/HbJuQDUtrfhdioZ/LHaW7W9diG9NpaghgEfyX4fmsIXjU/2f66LDpYVY6osjtlOgyrg==", "license": "MIT", "dependencies": { - "@cspell/url": "8.17.5", + "@cspell/url": "8.18.1", "micromatch": "^4.0.8" }, "engines": { @@ -727,13 +726,13 @@ } }, "node_modules/cspell-grammar": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.17.5.tgz", - "integrity": "sha512-st2n+FVw25MvMbsGb3TeJNRr6Oih4g14rjOd/UJN0qn+ceH360SAShUFqSd4kHHu2ADazI/TESFU6FRtMTPNOg==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.18.1.tgz", + "integrity": "sha512-V6XTN1B++7EzJA0H4g4XbNJtqm6Y3/iXdLeZ6sMRDaNFKXXwTbWRtn8gukDQIytyw09AnCUKeqGSzCVqw26Omg==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.17.5", - "@cspell/cspell-types": "8.17.5" + "@cspell/cspell-pipe": "8.18.1", + "@cspell/cspell-types": "8.18.1" }, "bin": { "cspell-grammar": "bin.mjs" @@ -743,40 +742,40 @@ } }, "node_modules/cspell-io": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.17.5.tgz", - "integrity": "sha512-oevM/8l0s6nc1NCYPqNFumrW50QSHoa6wqUT8cWs09gtZdE2AWG0U6bIE8ZEVz6e6FxS+6IenGKTdUUwP0+3fg==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.18.1.tgz", + "integrity": "sha512-mm9SUEF2yShuTXDSjCbsAqYTEb6jrtgcCnlqIzpsZOJOOe+zj/VyzTy2NJvOrdvR59dikdaqB75VGBMfHi804g==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "8.17.5", - "@cspell/url": "8.17.5" + "@cspell/cspell-service-bus": "8.18.1", + "@cspell/url": "8.18.1" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.17.5.tgz", - "integrity": "sha512-S3KuOrcST1d2BYmTXA+hnbRdho5n3w5GUvEaCx3QZQBwAPfLpAwJbe2yig1TxBpyEJ5LqP02i/mDg1pUCOP0hQ==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.18.1.tgz", + "integrity": "sha512-t1j+XB7515yHmrczK6I1N6j0a72vmL/6OxsMJnCucHC6DO0WkOqmHulNRH7LpFacnns0dx15lmrAqPg7gQFcIg==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.17.5", - "@cspell/cspell-pipe": "8.17.5", - "@cspell/cspell-resolver": "8.17.5", - "@cspell/cspell-types": "8.17.5", - "@cspell/dynamic-import": "8.17.5", - "@cspell/filetypes": "8.17.5", - "@cspell/strong-weak-map": "8.17.5", - "@cspell/url": "8.17.5", + "@cspell/cspell-bundled-dicts": "8.18.1", + "@cspell/cspell-pipe": "8.18.1", + "@cspell/cspell-resolver": "8.18.1", + "@cspell/cspell-types": "8.18.1", + "@cspell/dynamic-import": "8.18.1", + "@cspell/filetypes": "8.18.1", + "@cspell/strong-weak-map": "8.18.1", + "@cspell/url": "8.18.1", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.17.5", - "cspell-dictionary": "8.17.5", - "cspell-glob": "8.17.5", - "cspell-grammar": "8.17.5", - "cspell-io": "8.17.5", - "cspell-trie-lib": "8.17.5", + "cspell-config-lib": "8.18.1", + "cspell-dictionary": "8.18.1", + "cspell-glob": "8.18.1", + "cspell-grammar": "8.18.1", + "cspell-io": "8.18.1", + "cspell-trie-lib": "8.18.1", "env-paths": "^3.0.0", "fast-equals": "^5.2.2", "gensequence": "^7.0.0", @@ -791,13 +790,13 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.17.5", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.17.5.tgz", - "integrity": "sha512-9hjI3nRQxtGEua6CgnLbK3sGHLx9dXR/BHwI/csRL4dN5GGRkE5X3CCoy1RJVL7iGFLIzi43+L10xeFRmWniKw==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.18.1.tgz", + "integrity": "sha512-UaB36wsyp2eWeMtrbS6Q2t2WFvpedmGXJ879yHn9qKD7ViyUpI4cAbh6v7gWMUu+gjqCulXtke64k1ddmBihPQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.17.5", - "@cspell/cspell-types": "8.17.5", + "@cspell/cspell-pipe": "8.18.1", + "@cspell/cspell-types": "8.18.1", "gensequence": "^7.0.0" }, "engines": { @@ -867,18 +866,6 @@ "node": ">=8" } }, - "node_modules/find-up-simple": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz", - "integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/flat-cache": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-5.0.0.tgz", @@ -1165,9 +1152,9 @@ } }, "node_modules/yaml": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", - "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.1.tgz", + "integrity": "sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==", "license": "ISC", "bin": { "yaml": "bin.mjs" diff --git a/package.json b/package.json index c2002c9c6b..ca81df58d5 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.17.5" + "cspell": "^8.18.1" } } From 72c7e4c2d8def6689d0bd13fd9ce866557012fb3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 15:10:09 +0000 Subject: [PATCH 613/845] Bump cspell from 8.18.1 to 8.19.2 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.18.1 to 8.19.2. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.19.2/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 8.19.2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 432 +++++++++++++++++++--------------------------- package.json | 2 +- 2 files changed, 182 insertions(+), 252 deletions(-) diff --git a/package-lock.json b/package-lock.json index f7d1fa307a..d1efe861ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,31 +7,31 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.18.1" + "cspell": "^8.19.2" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.18.1.tgz", - "integrity": "sha512-gxciVVfQqCVXYH0p2Q5D7x7/SgaW3Wv5UjRwO+TCme0P2lVLl/IcfjkujZX+6UQkT7X4QRglXo1QN141UcCRCQ==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.19.2.tgz", + "integrity": "sha512-17yxicBRJj/00KlZ9y3fziuY3Y8neK2PA+wzf/NhnyA6AhU60TjLGj2yocKtlg8TYBeQK2kRiKq/2Uy0tv1RKg==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.0", "@cspell/dict-al": "^1.1.0", - "@cspell/dict-aws": "^4.0.9", + "@cspell/dict-aws": "^4.0.10", "@cspell/dict-bash": "^4.2.0", - "@cspell/dict-companies": "^3.1.14", - "@cspell/dict-cpp": "^6.0.6", + "@cspell/dict-companies": "^3.1.15", + "@cspell/dict-cpp": "^6.0.8", "@cspell/dict-cryptocurrencies": "^5.0.4", "@cspell/dict-csharp": "^4.0.6", "@cspell/dict-css": "^4.0.17", "@cspell/dict-dart": "^2.3.0", - "@cspell/dict-data-science": "^2.0.7", + "@cspell/dict-data-science": "^2.0.8", "@cspell/dict-django": "^4.1.4", - "@cspell/dict-docker": "^1.1.12", + "@cspell/dict-docker": "^1.1.13", "@cspell/dict-dotnet": "^5.0.9", "@cspell/dict-elixir": "^4.0.7", - "@cspell/dict-en_us": "^4.3.35", + "@cspell/dict-en_us": "^4.4.2", "@cspell/dict-en-common-misspellings": "^2.0.10", "@cspell/dict-en-gb": "1.1.33", "@cspell/dict-filetypes": "^3.0.11", @@ -39,9 +39,9 @@ "@cspell/dict-fonts": "^4.0.4", "@cspell/dict-fsharp": "^1.1.0", "@cspell/dict-fullstack": "^3.2.6", - "@cspell/dict-gaming-terms": "^1.1.0", + "@cspell/dict-gaming-terms": "^1.1.1", "@cspell/dict-git": "^3.0.4", - "@cspell/dict-golang": "^6.0.19", + "@cspell/dict-golang": "^6.0.20", "@cspell/dict-google": "^1.0.8", "@cspell/dict-haskell": "^4.0.5", "@cspell/dict-html": "^4.0.11", @@ -54,25 +54,25 @@ "@cspell/dict-lorem-ipsum": "^4.0.4", "@cspell/dict-lua": "^4.0.7", "@cspell/dict-makefile": "^1.0.4", - "@cspell/dict-markdown": "^2.0.9", + "@cspell/dict-markdown": "^2.0.10", "@cspell/dict-monkeyc": "^1.0.10", - "@cspell/dict-node": "^5.0.6", - "@cspell/dict-npm": "^5.1.31", + "@cspell/dict-node": "^5.0.7", + "@cspell/dict-npm": "^5.2.0", "@cspell/dict-php": "^4.0.14", "@cspell/dict-powershell": "^5.0.14", "@cspell/dict-public-licenses": "^2.0.13", - "@cspell/dict-python": "^4.2.16", + "@cspell/dict-python": "^4.2.17", "@cspell/dict-r": "^2.1.0", "@cspell/dict-ruby": "^5.0.8", "@cspell/dict-rust": "^4.0.11", "@cspell/dict-scala": "^5.0.7", "@cspell/dict-shell": "^1.1.0", - "@cspell/dict-software-terms": "^5.0.2", + "@cspell/dict-software-terms": "^5.0.5", "@cspell/dict-sql": "^2.2.0", "@cspell/dict-svelte": "^1.0.6", "@cspell/dict-swift": "^2.0.5", "@cspell/dict-terraform": "^1.1.1", - "@cspell/dict-typescript": "^3.2.0", + "@cspell/dict-typescript": "^3.2.1", "@cspell/dict-vue": "^3.0.4" }, "engines": { @@ -80,30 +80,30 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.18.1.tgz", - "integrity": "sha512-/U3/8bcOL5O35fI9F7nN7Mhic0K01ZRxRV/+5jj7atltBbqgFSxViHCZBX0lDZJM96gUHn+3r6q6/8VEJahpDA==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.19.2.tgz", + "integrity": "sha512-vW7mybZi5TN0ejB4XY2hpXT0XSDiUduN69Gn+WZtNZYeLV3NWIH/RtzgT7VDGyKUadUeEvbemH3MdW34cCuZjA==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "8.18.1" + "@cspell/cspell-types": "8.19.2" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.18.1.tgz", - "integrity": "sha512-QHndTQPkR1c02pvvQ7UKFtLjCXgY0OcX8zjTLrCkynmcQxJFjAZAh9cJ7NMOAxab+ciSnkaVf4KWaRSEG17z8Q==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.19.2.tgz", + "integrity": "sha512-UF9s/bph/ELak6ZDEox9SbvPGU0giZ10jISKkR65MDg3nO7TQxm8TQB4PuNfwrt7Eybm+P10XroeXWfW5BfFmA==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.18.1.tgz", - "integrity": "sha512-T2sUBv0p9Hnfyg1xT1u3ESKuIWaaIDo0I8idh5DSlTpHgLjdIeAwasmFjEJ28qZv8OKSGawcSQKgJbStfbZASQ==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.19.2.tgz", + "integrity": "sha512-OWm3DWJXbFKpzETmzHXQ6cu7xrOoctU2BuqeRaR2nHHmuHLBEnOeS6OOQeYfWg4vTO5uGnFblWpCBYxFdny08Q==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" @@ -113,18 +113,18 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.18.1.tgz", - "integrity": "sha512-PwWl7EyhGIu4wHEhvBJb6xVlqMtFwQk0qLDArBvugL6nA+MX9NfG/w7PTgS7tCkFjVF1ku2sDzDLTDWwEk+MLw==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.19.2.tgz", + "integrity": "sha512-+krdoByfZGMu7dMue4hMqRTJ/R+Lgzvz0fE9WhVdXhq6TB0EmR/y1b32fQ8XDfZQnOGpg+ZWiVbvAJp1QYmvuQ==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.18.1.tgz", - "integrity": "sha512-d/nMG+qnMbI/1JPm+lD0KcKpgtEHMRsHxkdtGyNCDgvHL/JOGaSHc5ERS3IUgBW0Dfya/3z9wPdaMcHEzt7YCQ==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.19.2.tgz", + "integrity": "sha512-nmaxkoRZlHwMkUyNBHMT+vHaSUoCphS1DGAlfdkAt/vft8aisqFuH75hzcI52L4B1T8k/UYjn9BBwV1nQb14Ng==", "license": "MIT", "engines": { "node": ">=18" @@ -143,9 +143,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-aws": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.9.tgz", - "integrity": "sha512-bDYdnnJGwSkIZ4gzrauu7qzOs/ZAY/FnU4k11LgdMI8BhwMfsbsy2EI1iS+sD/BI5ZnNT9kU5YR3WADeNOmhRg==", + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.10.tgz", + "integrity": "sha512-0qW4sI0GX8haELdhfakQNuw7a2pnWXz3VYQA2MpydH2xT2e6EN9DWFpKAi8DfcChm8MgDAogKkoHtIo075iYng==", "license": "MIT" }, "node_modules/@cspell/dict-bash": { @@ -158,15 +158,15 @@ } }, "node_modules/@cspell/dict-companies": { - "version": "3.1.14", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.14.tgz", - "integrity": "sha512-iqo1Ce4L7h0l0GFSicm2wCLtfuymwkvgFGhmu9UHyuIcTbdFkDErH+m6lH3Ed+QuskJlpQ9dM7puMIGqUlVERw==", + "version": "3.1.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.15.tgz", + "integrity": "sha512-vnGYTJFrqM9HdtgpZFOThFTjlPyJWqPi0eidMKyZxMKTHhP7yg6mD5X9WPEPvfiysmJYMnA6KKYQEBqoKFPU9g==", "license": "MIT" }, "node_modules/@cspell/dict-cpp": { - "version": "6.0.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.6.tgz", - "integrity": "sha512-HMV1chsExuZt5IL9rYBW7GmhNZDVdQJEd1WtFgOO6jqiNxbpTG3Is3Pkldl7FpusBQQZr4BdjMit5bnPpVRy3A==", + "version": "6.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.8.tgz", + "integrity": "sha512-BzurRZilWqaJt32Gif6/yCCPi+FtrchjmnehVEIFzbWyeBd/VOUw77IwrEzehZsu5cRU91yPWuWp5fUsKfDAXA==", "license": "MIT" }, "node_modules/@cspell/dict-cryptocurrencies": { @@ -194,9 +194,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-data-science": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.7.tgz", - "integrity": "sha512-XhAkK+nSW6zmrnWzusmZ1BpYLc62AWYHZc2p17u4nE2Z9XG5DleG55PCZxXQTKz90pmwlhFM9AfpkJsYaBWATA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.8.tgz", + "integrity": "sha512-uyAtT+32PfM29wRBeAkUSbkytqI8bNszNfAz2sGPtZBRmsZTYugKMEO9eDjAIE/pnT9CmbjNuoiXhk+Ss4fCOg==", "license": "MIT" }, "node_modules/@cspell/dict-django": { @@ -206,9 +206,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-docker": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.12.tgz", - "integrity": "sha512-6d25ZPBnYZaT9D9An/x6g/4mk542R8bR3ipnby3QFCxnfdd6xaWiTcwDPsCgwN2aQZIQ1jX/fil9KmBEqIK/qA==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.13.tgz", + "integrity": "sha512-85X+ZC/CPT3ie26DcfeMFkZSNuhS8DlAqPXzAjilHtGE/Nj+QnS3jyBz0spDJOJrjh8wx1+ro2oCK98sbVcztw==", "license": "MIT" }, "node_modules/@cspell/dict-dotnet": { @@ -224,9 +224,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.3.35", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.35.tgz", - "integrity": "sha512-HF6QNyPHkxeo/SosaZXRQlnKDUTjIzrGKyqfbw/fPPlPYrXefAZZ40ofheb5HnbUicR7xqV/lsc/HQfqYshGIw==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.2.tgz", + "integrity": "sha512-mvpv2kWayuOExCnDgvhlYDoW7gbGvGVTyuof9aFGy0+8ALYAJ2AtlvYCqzdTTKvvsYBrxAEEWFkUh75kHnHibg==", "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { @@ -272,9 +272,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-gaming-terms": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.1.0.tgz", - "integrity": "sha512-46AnDs9XkgJ2f1Sqol1WgfJ8gOqp60fojpc9Wxch7x+BA63g4JfMV5/M5x0sI0TLlLY8EBSglcr8wQF/7C80AQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.1.1.tgz", + "integrity": "sha512-tb8GFxjTLDQstkJcJ90lDqF4rKKlMUKs5/ewePN9P+PYRSehqDpLI5S5meOfPit8LGszeOrjUdBQ4zXo7NpMyQ==", "license": "MIT" }, "node_modules/@cspell/dict-git": { @@ -284,9 +284,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-golang": { - "version": "6.0.19", - "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.19.tgz", - "integrity": "sha512-VS+oinB2/CbgmHE06kMJlj52OVMZM0S2EEXph3oaroNTgTuclSwdFylQmOEjquZi55kW+n3FM9MyWXiitB7Dtg==", + "version": "6.0.20", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.20.tgz", + "integrity": "sha512-b7nd9XXs+apMMzNSWorjirQsbmlwcTC0ViQJU8u+XNose3z0y7oNeEpbTPTVoN1+1sO9aOHuFwfwoOMFCDS14Q==", "license": "MIT" }, "node_modules/@cspell/dict-google": { @@ -362,15 +362,15 @@ "license": "MIT" }, "node_modules/@cspell/dict-markdown": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.9.tgz", - "integrity": "sha512-j2e6Eg18BlTb1mMP1DkyRFMM/FLS7qiZjltpURzDckB57zDZbUyskOFdl4VX7jItZZEeY0fe22bSPOycgS1Z5A==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.10.tgz", + "integrity": "sha512-vtVa6L/84F9sTjclTYDkWJF/Vx2c5xzxBKkQp+CEFlxOF2SYgm+RSoEvAvg5vj4N5kuqR4350ZlY3zl2eA3MXw==", "license": "MIT", "peerDependencies": { "@cspell/dict-css": "^4.0.17", "@cspell/dict-html": "^4.0.11", "@cspell/dict-html-symbol-entities": "^4.0.3", - "@cspell/dict-typescript": "^3.2.0" + "@cspell/dict-typescript": "^3.2.1" } }, "node_modules/@cspell/dict-monkeyc": { @@ -380,15 +380,15 @@ "license": "MIT" }, "node_modules/@cspell/dict-node": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.6.tgz", - "integrity": "sha512-CEbhPCpxGvRNByGolSBTrXXW2rJA4bGqZuTx1KKO85mwR6aadeOmUE7xf/8jiCkXSy+qvr9aJeh+jlfXcsrziQ==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.7.tgz", + "integrity": "sha512-ZaPpBsHGQCqUyFPKLyCNUH2qzolDRm1/901IO8e7btk7bEDF56DN82VD43gPvD4HWz3yLs/WkcLa01KYAJpnOw==", "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.1.31", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.1.31.tgz", - "integrity": "sha512-Oh9nrhgNV4UD1hlbgO3TFQqQRKziwc7qXKoQiC4oqOYIhMs2WL9Ezozku7FY1e7o5XbCIZX9nRH0ymNx/Rwj6w==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.0.tgz", + "integrity": "sha512-kTUdbSE8SuIMKMlASMbI8/SEwv3EmI8eBcwdrtu4PHA+XVx+8JvQCB5fcWK9mn/94Y7LQ1kDIm+yfAZfwopY0A==", "license": "MIT" }, "node_modules/@cspell/dict-php": { @@ -410,12 +410,12 @@ "license": "MIT" }, "node_modules/@cspell/dict-python": { - "version": "4.2.16", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.16.tgz", - "integrity": "sha512-LkQssFt1hPOWXIQiD8ScTkz/41RL7Ti0V/2ytUzEW82dc0atIEksrBg8MuOjWXktp0Dk5tDwRLgmIvhV3CFFOA==", + "version": "4.2.17", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.17.tgz", + "integrity": "sha512-xqMKfVc8d7yDaOChFdL2uWAN3Mw9qObB/Zr6t5w1OHbi23gWs7V1lI9d0mXAoqSK6N3mosbum4OIq/FleQDnlw==", "license": "MIT", "dependencies": { - "@cspell/dict-data-science": "^2.0.7" + "@cspell/dict-data-science": "^2.0.8" } }, "node_modules/@cspell/dict-r": { @@ -449,9 +449,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.0.2.tgz", - "integrity": "sha512-aCzP+M0WXRLYXTriDMZygUe5s4jKyau/nCA6gBGt4EoHfXn+Ua/+DrW766oXOkkESIlqTBtRgb9gWwQvUdOXSQ==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.0.5.tgz", + "integrity": "sha512-ZjAOa8FI8/JrxaRqKT3eS7AQXFjU174xxQoKYMkmdwSyNIj7WUCAg10UeLqeMjFVv36zIO0Hm0dD2+Bvn18SLA==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -479,9 +479,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-typescript": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.2.0.tgz", - "integrity": "sha512-Pk3zNePLT8qg51l0M4g1ISowYAEGxTuNfZlgkU5SvHa9Cu7x/BWoyYq9Fvc3kAyoisCjRPyvWF4uRYrPitPDFw==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.2.1.tgz", + "integrity": "sha512-jdnKg4rBl75GUBTsUD6nTJl7FGvaIt5wWcWP7TZSC3rV1LfkwvbUiY3PiGpfJlAIdnLYSeFWIpYU9gyVgz206w==", "license": "MIT" }, "node_modules/@cspell/dict-vue": { @@ -491,12 +491,12 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.18.1.tgz", - "integrity": "sha512-VJHfS/Iv0Rx7wn1pjPmwgsaw6r72N5Cx2gL0slWk8Cogc8YiK7/6jsGnsvxJZVkHntJoiT8PrkIvhNKb3awD3g==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.19.2.tgz", + "integrity": "sha512-Ylsda+IrXhrIlAyGhCbc62tEk8F4MpO3u8llUQtWKhhvqbcxY+waC0d8S9u95egCACTTZIVDyrcxHX1lGg5+mw==", "license": "MIT", "dependencies": { - "@cspell/url": "8.18.1", + "@cspell/url": "8.19.2", "import-meta-resolve": "^4.1.0" }, "engines": { @@ -504,27 +504,27 @@ } }, "node_modules/@cspell/filetypes": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.18.1.tgz", - "integrity": "sha512-vTOb2itP0pjrccvt8wcKiTGyw0pFMTPI85H12T6n8ZhqXTktPgQH2gEf/SU/5tkPNnBKr4GJ+FdU5hJ27HzgXQ==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.19.2.tgz", + "integrity": "sha512-GqS/N0gTcnaAcBOVdWrehI+w6e+TzLSDj+zjW0DFWAbqnFDUOI9+1XtISINzMV6apOrBg8sMmFuaqif3TqvuZw==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.18.1.tgz", - "integrity": "sha512-gsgv+5ZQD4aHNHDdfNGoafVYkqRynyYgaodt9Dp/3o0YKYcxGf2jrX8SJ35MfZ61qln0n7P4Djrg+bFV2zNH5w==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.19.2.tgz", + "integrity": "sha512-W/C6AK+z6sGOfdUsf75S/iLxyJkps8LEI/m9G/+R6RTHF4oyCGzh0JChHdnSjXrb0RpIPQjGOdwJcJOqVn/7/A==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.18.1.tgz", - "integrity": "sha512-FRJbLYDC9ucpTOzbF6MohP2u5X3NU5L0RoVuoYCynqm/QOI38XP6WOEaI4H58CAn857bOIKZk0LZRPTGzi6Qlg==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.19.2.tgz", + "integrity": "sha512-B6NzFapXtS4DkGHhW8wGNE7u8v6Y3dMzdbvV2VxD6N0ByEiWqvsB2rW55z8e4fUOlGKLtedrBTFPPFIuSPs4Wg==", "license": "MIT", "engines": { "node": ">=18.0" @@ -536,18 +536,6 @@ "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", "license": "MIT" }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "license": "MIT", - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -631,29 +619,29 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.18.1.tgz", - "integrity": "sha512-RE3LIgN9NAVcYBNX2NQVhLergok8EPymOuCUhu1vBR8cjRmioksn3CJeCoQgD8rPjalM+S9thYkMtOZc5Jjv2A==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.19.2.tgz", + "integrity": "sha512-CwH6eARg9nQE5WDSGFac4gde3S8L+1jhgd5rDe4enoGXqW0hBwsDvbIPCaiQTjG4KN+3u2QFxNMsX5lLBJjTmw==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "8.18.1", - "@cspell/cspell-pipe": "8.18.1", - "@cspell/cspell-types": "8.18.1", - "@cspell/dynamic-import": "8.18.1", - "@cspell/url": "8.18.1", + "@cspell/cspell-json-reporter": "8.19.2", + "@cspell/cspell-pipe": "8.19.2", + "@cspell/cspell-types": "8.19.2", + "@cspell/dynamic-import": "8.19.2", + "@cspell/url": "8.19.2", "chalk": "^5.4.1", "chalk-template": "^1.1.0", "commander": "^13.1.0", - "cspell-dictionary": "8.18.1", - "cspell-gitignore": "8.18.1", - "cspell-glob": "8.18.1", - "cspell-io": "8.18.1", - "cspell-lib": "8.18.1", + "cspell-dictionary": "8.19.2", + "cspell-gitignore": "8.19.2", + "cspell-glob": "8.19.2", + "cspell-io": "8.19.2", + "cspell-lib": "8.19.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "get-stdin": "^9.0.0", "semver": "^7.7.1", - "tinyglobby": "^0.2.12" + "tinyglobby": "^0.2.13" }, "bin": { "cspell": "bin.mjs", @@ -667,28 +655,28 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.18.1.tgz", - "integrity": "sha512-zdJ0uhLROSUrHoibysPw+AkxKPUmiG95hDtiL7s8smewkuaS1hpjqwsDBx981nHYs3xW3qDUfVATrAkSzb0VMw==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.19.2.tgz", + "integrity": "sha512-FW7rYL952LSIzTpesmTw856dIV7jhKFvbH/Ug9i74/omC57vsA/caLH8SqYXS+Z2PslihBKKCU8j2aB2qiybMQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "8.18.1", + "@cspell/cspell-types": "8.19.2", "comment-json": "^4.2.5", - "yaml": "^2.7.0" + "yaml": "^2.7.1" }, "engines": { "node": ">=18" } }, "node_modules/cspell-dictionary": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.18.1.tgz", - "integrity": "sha512-vKHEPSfkMKMR4S4tk6K2vHC+f3kdJK8Kdh/C0jDh6RRDjDsyAPxshtbremxOgAX6X8GaRUCROoMZ7FhB92+Y9w==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.19.2.tgz", + "integrity": "sha512-YEVM61V0d4TmxB0Dtk3L5I7Rz3WA8Y4vjxO7rPX2piieMwp7T7l4aHb/ZpHx7JqsJSSzp9vjtgVrwVE0gCJpZw==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.18.1", - "@cspell/cspell-types": "8.18.1", - "cspell-trie-lib": "8.18.1", + "@cspell/cspell-pipe": "8.19.2", + "@cspell/cspell-types": "8.19.2", + "cspell-trie-lib": "8.19.2", "fast-equals": "^5.2.2" }, "engines": { @@ -696,14 +684,14 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.18.1.tgz", - "integrity": "sha512-gp/AdUtW6FqpKY4YyYJ3kz0OsXApwsV1FOUA9Z0VnOYKVZtt2snh4uNlI4Ltq+wh7pDU8mqaPWmX6Xy+HSRDkQ==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.19.2.tgz", + "integrity": "sha512-GxWHMow+o5RqVYw9WjIbExiWE1abnF0PqrbVh3gcwCoM/xYTBfGUDBnpD/PQB4uqH1oDolMfu1wp5/J1D97OFw==", "license": "MIT", "dependencies": { - "@cspell/url": "8.18.1", - "cspell-glob": "8.18.1", - "cspell-io": "8.18.1" + "@cspell/url": "8.19.2", + "cspell-glob": "8.19.2", + "cspell-io": "8.19.2" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -713,26 +701,26 @@ } }, "node_modules/cspell-glob": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.18.1.tgz", - "integrity": "sha512-tlZXvzsN7dByHo69dz/HbJuQDUtrfhdioZ/LHaW7W9diG9NpaghgEfyX4fmsIXjU/2f66LDpYVY6osjtlOgyrg==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.19.2.tgz", + "integrity": "sha512-5/UBFLMh+3vhAyI3ep4Oqrt0rAb1mQHXmmpwk+WDpiS9CoSjoATIvibH5Ln9riwiIt1Bo7lH0BqfEQ3NtcegUg==", "license": "MIT", "dependencies": { - "@cspell/url": "8.18.1", - "micromatch": "^4.0.8" + "@cspell/url": "8.19.2", + "picomatch": "^4.0.2" }, "engines": { "node": ">=18" } }, "node_modules/cspell-grammar": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.18.1.tgz", - "integrity": "sha512-V6XTN1B++7EzJA0H4g4XbNJtqm6Y3/iXdLeZ6sMRDaNFKXXwTbWRtn8gukDQIytyw09AnCUKeqGSzCVqw26Omg==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.19.2.tgz", + "integrity": "sha512-jrgMWIivZ9HFLXqdkR5eQ7tmvePYYnFRy4Hs1VGpCr36DqPcrURxtONFJuLCJwKl0xRSlhPIeC8fpIeEwtxUvQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.18.1", - "@cspell/cspell-types": "8.18.1" + "@cspell/cspell-pipe": "8.19.2", + "@cspell/cspell-types": "8.19.2" }, "bin": { "cspell-grammar": "bin.mjs" @@ -742,40 +730,40 @@ } }, "node_modules/cspell-io": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.18.1.tgz", - "integrity": "sha512-mm9SUEF2yShuTXDSjCbsAqYTEb6jrtgcCnlqIzpsZOJOOe+zj/VyzTy2NJvOrdvR59dikdaqB75VGBMfHi804g==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.19.2.tgz", + "integrity": "sha512-qt0QaUCw1/atoA960ev8z2ryT5+vGpXYcp71bzE52PPBACW2vKhwlBfc/4YpCC8pcNQGj6N9hzEX+G6nDTHnUw==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "8.18.1", - "@cspell/url": "8.18.1" + "@cspell/cspell-service-bus": "8.19.2", + "@cspell/url": "8.19.2" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.18.1.tgz", - "integrity": "sha512-t1j+XB7515yHmrczK6I1N6j0a72vmL/6OxsMJnCucHC6DO0WkOqmHulNRH7LpFacnns0dx15lmrAqPg7gQFcIg==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.19.2.tgz", + "integrity": "sha512-we1IeovendX+vRhdOQpOdwFX7CRxLDMMGcm0Sy6Duo66IKerPYeSJwbTfQi8G8e5ZIU14F0psnjoBaOBcqpLrg==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.18.1", - "@cspell/cspell-pipe": "8.18.1", - "@cspell/cspell-resolver": "8.18.1", - "@cspell/cspell-types": "8.18.1", - "@cspell/dynamic-import": "8.18.1", - "@cspell/filetypes": "8.18.1", - "@cspell/strong-weak-map": "8.18.1", - "@cspell/url": "8.18.1", + "@cspell/cspell-bundled-dicts": "8.19.2", + "@cspell/cspell-pipe": "8.19.2", + "@cspell/cspell-resolver": "8.19.2", + "@cspell/cspell-types": "8.19.2", + "@cspell/dynamic-import": "8.19.2", + "@cspell/filetypes": "8.19.2", + "@cspell/strong-weak-map": "8.19.2", + "@cspell/url": "8.19.2", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.18.1", - "cspell-dictionary": "8.18.1", - "cspell-glob": "8.18.1", - "cspell-grammar": "8.18.1", - "cspell-io": "8.18.1", - "cspell-trie-lib": "8.18.1", + "cspell-config-lib": "8.19.2", + "cspell-dictionary": "8.19.2", + "cspell-glob": "8.19.2", + "cspell-grammar": "8.19.2", + "cspell-io": "8.19.2", + "cspell-trie-lib": "8.19.2", "env-paths": "^3.0.0", "fast-equals": "^5.2.2", "gensequence": "^7.0.0", @@ -790,13 +778,13 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.18.1.tgz", - "integrity": "sha512-UaB36wsyp2eWeMtrbS6Q2t2WFvpedmGXJ879yHn9qKD7ViyUpI4cAbh6v7gWMUu+gjqCulXtke64k1ddmBihPQ==", + "version": "8.19.2", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.19.2.tgz", + "integrity": "sha512-/0DuCmBwz1B3yOlxCgib98uVVdIBOp/PNWEA3pmmjPOiWvOb/bBdw5C5o+ghnf93scDZQJF3l8a2sAQmsZkkIw==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.18.1", - "@cspell/cspell-types": "8.18.1", + "@cspell/cspell-pipe": "8.19.2", + "@cspell/cspell-types": "8.19.2", "gensequence": "^7.0.0" }, "engines": { @@ -843,6 +831,20 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "license": "MIT" }, + "node_modules/fdir": { + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", + "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, "node_modules/file-entry-cache": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-9.1.0.tgz", @@ -854,18 +856,6 @@ "node": ">=18" } }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/flat-cache": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-5.0.0.tgz", @@ -984,15 +974,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -1006,19 +987,6 @@ "json-buffer": "3.0.1" } }, - "node_modules/micromatch": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "license": "MIT", - "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/parent-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz", @@ -1032,12 +1000,12 @@ } }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "license": "MIT", "engines": { - "node": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" @@ -1074,12 +1042,12 @@ } }, "node_modules/tinyglobby": { - "version": "0.2.12", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", - "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz", + "integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==", "license": "MIT", "dependencies": { - "fdir": "^6.4.3", + "fdir": "^6.4.4", "picomatch": "^4.0.2" }, "engines": { @@ -1089,44 +1057,6 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, - "node_modules/tinyglobby/node_modules/fdir": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", - "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", - "license": "MIT", - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/vscode-languageserver-textdocument": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", diff --git a/package.json b/package.json index ca81df58d5..177b0800e0 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.18.1" + "cspell": "^8.19.2" } } From 53531c51f6766b8f98cc34946876f9a604166431 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 15:51:17 +0000 Subject: [PATCH 614/845] Bump cspell from 8.19.2 to 8.19.3 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.19.2 to 8.19.3. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.19.3/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 8.19.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 225 ++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 107 insertions(+), 120 deletions(-) diff --git a/package-lock.json b/package-lock.json index d1efe861ba..c6f574b2e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.19.2" + "cspell": "^8.19.3" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.19.2.tgz", - "integrity": "sha512-17yxicBRJj/00KlZ9y3fziuY3Y8neK2PA+wzf/NhnyA6AhU60TjLGj2yocKtlg8TYBeQK2kRiKq/2Uy0tv1RKg==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.19.3.tgz", + "integrity": "sha512-HRxcvD+fqgq6Ag6K7TMnlsO1Uq2nc3V/ug4huZSKK/+tErB1i/m4N4gkOzO0pFtQsJDhGdlio3Wud2ce6kVpdw==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.0", @@ -31,7 +31,7 @@ "@cspell/dict-docker": "^1.1.13", "@cspell/dict-dotnet": "^5.0.9", "@cspell/dict-elixir": "^4.0.7", - "@cspell/dict-en_us": "^4.4.2", + "@cspell/dict-en_us": "^4.4.3", "@cspell/dict-en-common-misspellings": "^2.0.10", "@cspell/dict-en-gb": "1.1.33", "@cspell/dict-filetypes": "^3.0.11", @@ -57,7 +57,7 @@ "@cspell/dict-markdown": "^2.0.10", "@cspell/dict-monkeyc": "^1.0.10", "@cspell/dict-node": "^5.0.7", - "@cspell/dict-npm": "^5.2.0", + "@cspell/dict-npm": "^5.2.1", "@cspell/dict-php": "^4.0.14", "@cspell/dict-powershell": "^5.0.14", "@cspell/dict-public-licenses": "^2.0.13", @@ -80,30 +80,30 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.19.2.tgz", - "integrity": "sha512-vW7mybZi5TN0ejB4XY2hpXT0XSDiUduN69Gn+WZtNZYeLV3NWIH/RtzgT7VDGyKUadUeEvbemH3MdW34cCuZjA==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.19.3.tgz", + "integrity": "sha512-LQ5FLYrifDFcliDuIakN93KfoY89Gs0ppSdJbaYdrqrC8HGaPSkH9GG9MCMNPlwdU0Ivy+s2WRr6TlKqdcf3ag==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "8.19.2" + "@cspell/cspell-types": "8.19.3" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.19.2.tgz", - "integrity": "sha512-UF9s/bph/ELak6ZDEox9SbvPGU0giZ10jISKkR65MDg3nO7TQxm8TQB4PuNfwrt7Eybm+P10XroeXWfW5BfFmA==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.19.3.tgz", + "integrity": "sha512-Z90x+Kbq1P3A7iOsRe6FnsF2nisMKCY6bln03mTvHW0MmT8F69BEZTSZaL4z+kQ0L8qbjthJ+FqbQKYNNbPZpg==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.19.2.tgz", - "integrity": "sha512-OWm3DWJXbFKpzETmzHXQ6cu7xrOoctU2BuqeRaR2nHHmuHLBEnOeS6OOQeYfWg4vTO5uGnFblWpCBYxFdny08Q==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.19.3.tgz", + "integrity": "sha512-hsEx/7q0tDCOFtMmlkpynlApgAWo4/7q846Y1deyDChtIElmS0dfuzdKzv3jvFi3KdTVgJyhJb+o7/OHH2D/4A==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" @@ -113,18 +113,18 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.19.2.tgz", - "integrity": "sha512-+krdoByfZGMu7dMue4hMqRTJ/R+Lgzvz0fE9WhVdXhq6TB0EmR/y1b32fQ8XDfZQnOGpg+ZWiVbvAJp1QYmvuQ==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.19.3.tgz", + "integrity": "sha512-K66Vj8O+SWjPUTFq1wfpq5uoDLmZcB7tY3m154WQa94RNpW+/z9kLXVPxW1FctRXfjxfc7bqfLq4LF6Yiu72fg==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.19.2.tgz", - "integrity": "sha512-nmaxkoRZlHwMkUyNBHMT+vHaSUoCphS1DGAlfdkAt/vft8aisqFuH75hzcI52L4B1T8k/UYjn9BBwV1nQb14Ng==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.19.3.tgz", + "integrity": "sha512-q6aUHJSvUe0Bt57djQN7qQ/AVV9O6nVNO7Nj0rZxFsv/73CtUvJseSrpjlZgkHTRCjOL0iRsVG+B8IPaxjczgw==", "license": "MIT", "engines": { "node": ">=18" @@ -224,9 +224,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.2.tgz", - "integrity": "sha512-mvpv2kWayuOExCnDgvhlYDoW7gbGvGVTyuof9aFGy0+8ALYAJ2AtlvYCqzdTTKvvsYBrxAEEWFkUh75kHnHibg==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.3.tgz", + "integrity": "sha512-KnsS19kL5lYEk2P9xGNwvZF5ZbDYv1Tkv4BKIx4n4jKlgUj9iHv7L0Q+2cCvllKDGjuP715G/3Rg0McKdHR1Xg==", "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { @@ -386,9 +386,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.0.tgz", - "integrity": "sha512-kTUdbSE8SuIMKMlASMbI8/SEwv3EmI8eBcwdrtu4PHA+XVx+8JvQCB5fcWK9mn/94Y7LQ1kDIm+yfAZfwopY0A==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.1.tgz", + "integrity": "sha512-aqcit8e/Hsnsmd2QoDDAaai+l80bQItwLggmlio/e5NTAfUu7qIVmx+/VFtUlXQH6sMKp+aAvxPC3K8tH86+qg==", "license": "MIT" }, "node_modules/@cspell/dict-php": { @@ -491,12 +491,12 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.19.2.tgz", - "integrity": "sha512-Ylsda+IrXhrIlAyGhCbc62tEk8F4MpO3u8llUQtWKhhvqbcxY+waC0d8S9u95egCACTTZIVDyrcxHX1lGg5+mw==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.19.3.tgz", + "integrity": "sha512-haAl+/HOLAPc6Cs7YkbpyIK1Htomp3/D42scl2FCe4PU860uFyjyOWeq99u2wetDI/SQn1Ry3sSOKRCjIGlHWA==", "license": "MIT", "dependencies": { - "@cspell/url": "8.19.2", + "@cspell/url": "8.19.3", "import-meta-resolve": "^4.1.0" }, "engines": { @@ -504,27 +504,27 @@ } }, "node_modules/@cspell/filetypes": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.19.2.tgz", - "integrity": "sha512-GqS/N0gTcnaAcBOVdWrehI+w6e+TzLSDj+zjW0DFWAbqnFDUOI9+1XtISINzMV6apOrBg8sMmFuaqif3TqvuZw==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.19.3.tgz", + "integrity": "sha512-j6WEjuvh3t2zsBUvZm6leGhcpQtuCMroSjyGLSE7xNM5SRYOdd+KkO81erwyA/yAweTGlI6wYyXofUd+mRVFMw==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.19.2.tgz", - "integrity": "sha512-W/C6AK+z6sGOfdUsf75S/iLxyJkps8LEI/m9G/+R6RTHF4oyCGzh0JChHdnSjXrb0RpIPQjGOdwJcJOqVn/7/A==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.19.3.tgz", + "integrity": "sha512-IKzzbVDEjAprH0vH16heKbqCMqNtdU4tZXbp7mjJ3P3Xodl4csERrFRNqSwlyQMqfpjVU5n+wO7BSq/2S/uzRg==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@cspell/url": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.19.2.tgz", - "integrity": "sha512-B6NzFapXtS4DkGHhW8wGNE7u8v6Y3dMzdbvV2VxD6N0ByEiWqvsB2rW55z8e4fUOlGKLtedrBTFPPFIuSPs4Wg==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.19.3.tgz", + "integrity": "sha512-EATITl9WlmOuhdlUluHlYXCV7LFPuSw9CZ4gejPpjyDwQJUQg4ktHVNfy3hJ5I3h4SEiW0GWd68Gd61McmTO2A==", "license": "MIT", "engines": { "node": ">=18.0" @@ -619,27 +619,26 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.19.2.tgz", - "integrity": "sha512-CwH6eARg9nQE5WDSGFac4gde3S8L+1jhgd5rDe4enoGXqW0hBwsDvbIPCaiQTjG4KN+3u2QFxNMsX5lLBJjTmw==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.19.3.tgz", + "integrity": "sha512-ebmaOv/fCkLccsI2GM0OKmKq8ZOD6nZRmhK7g9Z1SWVofJGCtr7RcxRhtvqBwVyK16EXbzPIVtLAj0jIBhC2qw==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "8.19.2", - "@cspell/cspell-pipe": "8.19.2", - "@cspell/cspell-types": "8.19.2", - "@cspell/dynamic-import": "8.19.2", - "@cspell/url": "8.19.2", + "@cspell/cspell-json-reporter": "8.19.3", + "@cspell/cspell-pipe": "8.19.3", + "@cspell/cspell-types": "8.19.3", + "@cspell/dynamic-import": "8.19.3", + "@cspell/url": "8.19.3", "chalk": "^5.4.1", "chalk-template": "^1.1.0", "commander": "^13.1.0", - "cspell-dictionary": "8.19.2", - "cspell-gitignore": "8.19.2", - "cspell-glob": "8.19.2", - "cspell-io": "8.19.2", - "cspell-lib": "8.19.2", + "cspell-dictionary": "8.19.3", + "cspell-gitignore": "8.19.3", + "cspell-glob": "8.19.3", + "cspell-io": "8.19.3", + "cspell-lib": "8.19.3", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", - "get-stdin": "^9.0.0", "semver": "^7.7.1", "tinyglobby": "^0.2.13" }, @@ -655,12 +654,12 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.19.2.tgz", - "integrity": "sha512-FW7rYL952LSIzTpesmTw856dIV7jhKFvbH/Ug9i74/omC57vsA/caLH8SqYXS+Z2PslihBKKCU8j2aB2qiybMQ==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.19.3.tgz", + "integrity": "sha512-GjSrLU1KFLVzFa5qQA8DMF04BXW6r3xnfhwHFqU/8tEqtQXxKemGWnc9mt42Ey5hoe366lvhbIoh+vUhGf/IKA==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "8.19.2", + "@cspell/cspell-types": "8.19.3", "comment-json": "^4.2.5", "yaml": "^2.7.1" }, @@ -669,14 +668,14 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.19.2.tgz", - "integrity": "sha512-YEVM61V0d4TmxB0Dtk3L5I7Rz3WA8Y4vjxO7rPX2piieMwp7T7l4aHb/ZpHx7JqsJSSzp9vjtgVrwVE0gCJpZw==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.19.3.tgz", + "integrity": "sha512-tycnHhLHvqKl4a2hVg/tIIai0wmcHHSAlgBAXAnSl+0g2DRrQ5GDT+9tHJ8B373o62jD8f5jHwbfJrLgHiNXWg==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.19.2", - "@cspell/cspell-types": "8.19.2", - "cspell-trie-lib": "8.19.2", + "@cspell/cspell-pipe": "8.19.3", + "@cspell/cspell-types": "8.19.3", + "cspell-trie-lib": "8.19.3", "fast-equals": "^5.2.2" }, "engines": { @@ -684,14 +683,14 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.19.2.tgz", - "integrity": "sha512-GxWHMow+o5RqVYw9WjIbExiWE1abnF0PqrbVh3gcwCoM/xYTBfGUDBnpD/PQB4uqH1oDolMfu1wp5/J1D97OFw==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.19.3.tgz", + "integrity": "sha512-8ZislUTep+b1UIn03w6dKCs5CXrQlQDL1OG/FpyjyLC/OQHo3Gd7YMQWOhImZ3ZpnkIskcB+iU5XPOW04lkqPQ==", "license": "MIT", "dependencies": { - "@cspell/url": "8.19.2", - "cspell-glob": "8.19.2", - "cspell-io": "8.19.2" + "@cspell/url": "8.19.3", + "cspell-glob": "8.19.3", + "cspell-io": "8.19.3" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -701,12 +700,12 @@ } }, "node_modules/cspell-glob": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.19.2.tgz", - "integrity": "sha512-5/UBFLMh+3vhAyI3ep4Oqrt0rAb1mQHXmmpwk+WDpiS9CoSjoATIvibH5Ln9riwiIt1Bo7lH0BqfEQ3NtcegUg==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.19.3.tgz", + "integrity": "sha512-Fv4coZmCmqaNq2UfXhVqQbHschhAcm3rwoxPyBqQcDYpvCQ4Q2+qnHQkK1nAxmDjus4KFM/QKrBoxSlD90bD9g==", "license": "MIT", "dependencies": { - "@cspell/url": "8.19.2", + "@cspell/url": "8.19.3", "picomatch": "^4.0.2" }, "engines": { @@ -714,13 +713,13 @@ } }, "node_modules/cspell-grammar": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.19.2.tgz", - "integrity": "sha512-jrgMWIivZ9HFLXqdkR5eQ7tmvePYYnFRy4Hs1VGpCr36DqPcrURxtONFJuLCJwKl0xRSlhPIeC8fpIeEwtxUvQ==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.19.3.tgz", + "integrity": "sha512-5VJjqTPRpJZpQvoGj0W88yo0orY/YVuG5P8NVIwnfMAMRAnw2PAb7fsDydO9bPdFKdGPQ4CWoO++ed0g/Ra6jQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.19.2", - "@cspell/cspell-types": "8.19.2" + "@cspell/cspell-pipe": "8.19.3", + "@cspell/cspell-types": "8.19.3" }, "bin": { "cspell-grammar": "bin.mjs" @@ -730,40 +729,40 @@ } }, "node_modules/cspell-io": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.19.2.tgz", - "integrity": "sha512-qt0QaUCw1/atoA960ev8z2ryT5+vGpXYcp71bzE52PPBACW2vKhwlBfc/4YpCC8pcNQGj6N9hzEX+G6nDTHnUw==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.19.3.tgz", + "integrity": "sha512-kJa4ZQdr6QwFEo3TxcyXBLAs2DiogrdtYa4tK87Wzyg3+Am1l7Z9AN8gZWQ+tZIi3BC0FYj4PsBdZ4qdmcY98g==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "8.19.2", - "@cspell/url": "8.19.2" + "@cspell/cspell-service-bus": "8.19.3", + "@cspell/url": "8.19.3" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.19.2.tgz", - "integrity": "sha512-we1IeovendX+vRhdOQpOdwFX7CRxLDMMGcm0Sy6Duo66IKerPYeSJwbTfQi8G8e5ZIU14F0psnjoBaOBcqpLrg==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.19.3.tgz", + "integrity": "sha512-tVxrZYG7VCjjzARoTBQ7F/3FCjIGbzN0YbFcB3g4KLvbEuH83uLXm2MNdN9yDMaiD1XZ0CzP14eKiwpSMT7tjQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.19.2", - "@cspell/cspell-pipe": "8.19.2", - "@cspell/cspell-resolver": "8.19.2", - "@cspell/cspell-types": "8.19.2", - "@cspell/dynamic-import": "8.19.2", - "@cspell/filetypes": "8.19.2", - "@cspell/strong-weak-map": "8.19.2", - "@cspell/url": "8.19.2", + "@cspell/cspell-bundled-dicts": "8.19.3", + "@cspell/cspell-pipe": "8.19.3", + "@cspell/cspell-resolver": "8.19.3", + "@cspell/cspell-types": "8.19.3", + "@cspell/dynamic-import": "8.19.3", + "@cspell/filetypes": "8.19.3", + "@cspell/strong-weak-map": "8.19.3", + "@cspell/url": "8.19.3", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.19.2", - "cspell-dictionary": "8.19.2", - "cspell-glob": "8.19.2", - "cspell-grammar": "8.19.2", - "cspell-io": "8.19.2", - "cspell-trie-lib": "8.19.2", + "cspell-config-lib": "8.19.3", + "cspell-dictionary": "8.19.3", + "cspell-glob": "8.19.3", + "cspell-grammar": "8.19.3", + "cspell-io": "8.19.3", + "cspell-trie-lib": "8.19.3", "env-paths": "^3.0.0", "fast-equals": "^5.2.2", "gensequence": "^7.0.0", @@ -778,13 +777,13 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.19.2", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.19.2.tgz", - "integrity": "sha512-/0DuCmBwz1B3yOlxCgib98uVVdIBOp/PNWEA3pmmjPOiWvOb/bBdw5C5o+ghnf93scDZQJF3l8a2sAQmsZkkIw==", + "version": "8.19.3", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.19.3.tgz", + "integrity": "sha512-Z33vT0M/Vi10L9XaxKPTQu0AA0nmq91QWY5CzBymZY7LhOf6yGYcCgoTHluQms8YLCWaiX9pgTOF2/W1wlNiVg==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.19.2", - "@cspell/cspell-types": "8.19.2", + "@cspell/cspell-pipe": "8.19.3", + "@cspell/cspell-types": "8.19.3", "gensequence": "^7.0.0" }, "engines": { @@ -882,18 +881,6 @@ "node": ">=18" } }, - "node_modules/get-stdin": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-9.0.0.tgz", - "integrity": "sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/global-directory": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", diff --git a/package.json b/package.json index 177b0800e0..eef0ae3b5c 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.19.2" + "cspell": "^8.19.3" } } From a67ad29c1d9dbe543151b8da6e50b622f70dc618 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 14:50:06 +0000 Subject: [PATCH 615/845] Bump cspell from 8.19.3 to 9.0.0 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.19.3 to 9.0.0. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.0.0/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 300 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 151 insertions(+), 151 deletions(-) diff --git a/package-lock.json b/package-lock.json index c6f574b2e5..71665f2cdc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,20 +7,20 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^8.19.3" + "cspell": "^9.0.0" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.19.3.tgz", - "integrity": "sha512-HRxcvD+fqgq6Ag6K7TMnlsO1Uq2nc3V/ug4huZSKK/+tErB1i/m4N4gkOzO0pFtQsJDhGdlio3Wud2ce6kVpdw==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.0.0.tgz", + "integrity": "sha512-S2nM8iWGY252XrEOt9qAVMDgBBiQYcv7cxi/g1sBZL4sx/lDF02QSn926aVLYF9LNsGxjjliV7bbYoIU2oDjtQ==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.0", "@cspell/dict-al": "^1.1.0", "@cspell/dict-aws": "^4.0.10", "@cspell/dict-bash": "^4.2.0", - "@cspell/dict-companies": "^3.1.15", + "@cspell/dict-companies": "^3.2.1", "@cspell/dict-cpp": "^6.0.8", "@cspell/dict-cryptocurrencies": "^5.0.4", "@cspell/dict-csharp": "^4.0.6", @@ -28,13 +28,13 @@ "@cspell/dict-dart": "^2.3.0", "@cspell/dict-data-science": "^2.0.8", "@cspell/dict-django": "^4.1.4", - "@cspell/dict-docker": "^1.1.13", + "@cspell/dict-docker": "^1.1.14", "@cspell/dict-dotnet": "^5.0.9", "@cspell/dict-elixir": "^4.0.7", - "@cspell/dict-en_us": "^4.4.3", + "@cspell/dict-en_us": "^4.4.6", "@cspell/dict-en-common-misspellings": "^2.0.10", - "@cspell/dict-en-gb": "1.1.33", - "@cspell/dict-filetypes": "^3.0.11", + "@cspell/dict-en-gb-mit": "^3.0.3", + "@cspell/dict-filetypes": "^3.0.12", "@cspell/dict-flutter": "^1.1.0", "@cspell/dict-fonts": "^4.0.4", "@cspell/dict-fsharp": "^1.1.0", @@ -57,17 +57,17 @@ "@cspell/dict-markdown": "^2.0.10", "@cspell/dict-monkeyc": "^1.0.10", "@cspell/dict-node": "^5.0.7", - "@cspell/dict-npm": "^5.2.1", + "@cspell/dict-npm": "^5.2.3", "@cspell/dict-php": "^4.0.14", "@cspell/dict-powershell": "^5.0.14", "@cspell/dict-public-licenses": "^2.0.13", - "@cspell/dict-python": "^4.2.17", + "@cspell/dict-python": "^4.2.18", "@cspell/dict-r": "^2.1.0", "@cspell/dict-ruby": "^5.0.8", "@cspell/dict-rust": "^4.0.11", "@cspell/dict-scala": "^5.0.7", "@cspell/dict-shell": "^1.1.0", - "@cspell/dict-software-terms": "^5.0.5", + "@cspell/dict-software-terms": "^5.0.7", "@cspell/dict-sql": "^2.2.0", "@cspell/dict-svelte": "^1.0.6", "@cspell/dict-swift": "^2.0.5", @@ -76,58 +76,58 @@ "@cspell/dict-vue": "^3.0.4" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.19.3.tgz", - "integrity": "sha512-LQ5FLYrifDFcliDuIakN93KfoY89Gs0ppSdJbaYdrqrC8HGaPSkH9GG9MCMNPlwdU0Ivy+s2WRr6TlKqdcf3ag==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.0.0.tgz", + "integrity": "sha512-6ooEVbicB148ScT475aGMPlgRLO/XlLC/yNecrnVlB/sbERCgDYqi+iJHgE4+BjpVQ8Ant/VRCWrncWMAH6D8g==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "8.19.3" + "@cspell/cspell-types": "9.0.0" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.19.3.tgz", - "integrity": "sha512-Z90x+Kbq1P3A7iOsRe6FnsF2nisMKCY6bln03mTvHW0MmT8F69BEZTSZaL4z+kQ0L8qbjthJ+FqbQKYNNbPZpg==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.0.0.tgz", + "integrity": "sha512-ur1m4SOs9GP0eIC7n+II/Ea2xuEBWVI438d/zcoC+DWMElQD99OPxVVpPmGoMIPx4YzNlXWQH4kcygnG2a3ogg==", "license": "MIT", "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.19.3.tgz", - "integrity": "sha512-hsEx/7q0tDCOFtMmlkpynlApgAWo4/7q846Y1deyDChtIElmS0dfuzdKzv3jvFi3KdTVgJyhJb+o7/OHH2D/4A==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.0.0.tgz", + "integrity": "sha512-D2bPNpKNmwJM7r28cK6gDpgZKslGALNeyjpg9jFJLfstvHyn9m6vXsZbDuOJLKoEU3CLhkDSmRyNiEb2n18xhA==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.19.3.tgz", - "integrity": "sha512-K66Vj8O+SWjPUTFq1wfpq5uoDLmZcB7tY3m154WQa94RNpW+/z9kLXVPxW1FctRXfjxfc7bqfLq4LF6Yiu72fg==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.0.0.tgz", + "integrity": "sha512-KcvYBh/MrODNgavbjKTiWpI9BklGy9/suMCC/ZThUrjWpbndwHjxcbge4DLlKyVqYbe78B0KjKgZsuqQvOqJjg==", "license": "MIT", "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.19.3.tgz", - "integrity": "sha512-q6aUHJSvUe0Bt57djQN7qQ/AVV9O6nVNO7Nj0rZxFsv/73CtUvJseSrpjlZgkHTRCjOL0iRsVG+B8IPaxjczgw==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.0.0.tgz", + "integrity": "sha512-iBtN+AVC1v/V35qGOzHLyIvFJEr3pljtJgB4pM0TIZuzPQrm9lr3vV+WSCeOXqiTuY8DEXeMCZN+30QOi4ElNQ==", "license": "MIT", "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/@cspell/dict-ada": { @@ -158,9 +158,9 @@ } }, "node_modules/@cspell/dict-companies": { - "version": "3.1.15", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.1.15.tgz", - "integrity": "sha512-vnGYTJFrqM9HdtgpZFOThFTjlPyJWqPi0eidMKyZxMKTHhP7yg6mD5X9WPEPvfiysmJYMnA6KKYQEBqoKFPU9g==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.2.1.tgz", + "integrity": "sha512-ryaeJ1KhTTKL4mtinMtKn8wxk6/tqD4vX5tFP+Hg89SiIXmbMk5vZZwVf+eyGUWJOyw5A1CVj9EIWecgoi+jYQ==", "license": "MIT" }, "node_modules/@cspell/dict-cpp": { @@ -206,9 +206,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-docker": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.13.tgz", - "integrity": "sha512-85X+ZC/CPT3ie26DcfeMFkZSNuhS8DlAqPXzAjilHtGE/Nj+QnS3jyBz0spDJOJrjh8wx1+ro2oCK98sbVcztw==", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.14.tgz", + "integrity": "sha512-p6Qz5mokvcosTpDlgSUREdSbZ10mBL3ndgCdEKMqjCSZJFdfxRdNdjrGER3lQ6LMq5jGr1r7nGXA0gvUJK80nw==", "license": "MIT" }, "node_modules/@cspell/dict-dotnet": { @@ -224,9 +224,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.3.tgz", - "integrity": "sha512-KnsS19kL5lYEk2P9xGNwvZF5ZbDYv1Tkv4BKIx4n4jKlgUj9iHv7L0Q+2cCvllKDGjuP715G/3Rg0McKdHR1Xg==", + "version": "4.4.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.6.tgz", + "integrity": "sha512-9QFpNzyvqNkCc3QCJb2RmG87rXz2Iz3R6o9fknOyzN7HL/LRMwipuksricriPYPs+h3ZSQm4Jtgc+sX4gWY5vg==", "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { @@ -235,16 +235,16 @@ "integrity": "sha512-80mXJLtr0tVEtzowrI7ycVae/ULAYImZUlr0kUTpa8i57AUk7Zy3pYBs44EYIKW7ZC9AHu4Qjjfq4vriAtyTDQ==", "license": "CC BY-SA 4.0" }, - "node_modules/@cspell/dict-en-gb": { - "version": "1.1.33", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz", - "integrity": "sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==", + "node_modules/@cspell/dict-en-gb-mit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.0.3.tgz", + "integrity": "sha512-usV5ddTBRTFCHoN9Swo1Vt9U4uPNRHS9oLtjOTWJtVj5O0OxJ+NxCXCZjjCm0afe6gw/GuvlnE4Ji7Vf53ObfQ==", "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.11.tgz", - "integrity": "sha512-bBtCHZLo7MiSRUqx5KEiPdGOmXIlDGY+L7SJEtRWZENpAKE+96rT7hj+TUUYWBbCzheqHr0OXZJFEKDgsG/uZg==", + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.12.tgz", + "integrity": "sha512-+ds5wgNdlUxuJvhg8A1TjuSpalDFGCh7SkANCWvIplg6QZPXL4j83lqxP7PgjHpx7PsBUS7vw0aiHPjZy9BItw==", "license": "MIT" }, "node_modules/@cspell/dict-flutter": { @@ -386,9 +386,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.1.tgz", - "integrity": "sha512-aqcit8e/Hsnsmd2QoDDAaai+l80bQItwLggmlio/e5NTAfUu7qIVmx+/VFtUlXQH6sMKp+aAvxPC3K8tH86+qg==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.3.tgz", + "integrity": "sha512-EdGkCpAq66Mhi9Qldgsr+NvPVL4TdtmdlqDe4VBp0P3n6J0B7b0jT1MlVDIiLR+F1eqBfL0qjfHf0ey1CafeNw==", "license": "MIT" }, "node_modules/@cspell/dict-php": { @@ -410,9 +410,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-python": { - "version": "4.2.17", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.17.tgz", - "integrity": "sha512-xqMKfVc8d7yDaOChFdL2uWAN3Mw9qObB/Zr6t5w1OHbi23gWs7V1lI9d0mXAoqSK6N3mosbum4OIq/FleQDnlw==", + "version": "4.2.18", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.18.tgz", + "integrity": "sha512-hYczHVqZBsck7DzO5LumBLJM119a3F17aj8a7lApnPIS7cmEwnPc2eACNscAHDk7qAo2127oI7axUoFMe9/g1g==", "license": "MIT", "dependencies": { "@cspell/dict-data-science": "^2.0.8" @@ -449,9 +449,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.0.5.tgz", - "integrity": "sha512-ZjAOa8FI8/JrxaRqKT3eS7AQXFjU174xxQoKYMkmdwSyNIj7WUCAg10UeLqeMjFVv36zIO0Hm0dD2+Bvn18SLA==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.0.7.tgz", + "integrity": "sha512-6ttSc0/EzDN44DF2Bk/37cr3IntzuNcZ4MbUy/zEhfhDMiuQoXslILpAs/9FoKEuFpsm6A+8manT2GytWwr/HA==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -491,43 +491,43 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.19.3.tgz", - "integrity": "sha512-haAl+/HOLAPc6Cs7YkbpyIK1Htomp3/D42scl2FCe4PU860uFyjyOWeq99u2wetDI/SQn1Ry3sSOKRCjIGlHWA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.0.0.tgz", + "integrity": "sha512-SE7RFKH4FlXzLFli/vGMayteUVyXDbaZpb1bqymO3uAHO9ZgY+faid4vV/qoVMUgKK+P7hIq5e3MB7swmFAZBg==", "license": "MIT", "dependencies": { - "@cspell/url": "8.19.3", + "@cspell/url": "9.0.0", "import-meta-resolve": "^4.1.0" }, "engines": { - "node": ">=18.0" + "node": ">=20" } }, "node_modules/@cspell/filetypes": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.19.3.tgz", - "integrity": "sha512-j6WEjuvh3t2zsBUvZm6leGhcpQtuCMroSjyGLSE7xNM5SRYOdd+KkO81erwyA/yAweTGlI6wYyXofUd+mRVFMw==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.0.0.tgz", + "integrity": "sha512-PL6ty0Xdn1UmRXwIwkze3IizgVbJSCvP0yMQF5xRQixTfidBfxrvnqjAWOGNuQifgIk1PVyFvik7ubLG0skw3w==", "license": "MIT", "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.19.3.tgz", - "integrity": "sha512-IKzzbVDEjAprH0vH16heKbqCMqNtdU4tZXbp7mjJ3P3Xodl4csERrFRNqSwlyQMqfpjVU5n+wO7BSq/2S/uzRg==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.0.0.tgz", + "integrity": "sha512-LQw0f8nm1C7my6JqjtvTkFQ9Mt561vay0za5Vh5J9yCZxGbOvZ+/Doe925WM5NaqaxC3/wGUdEK1HxMxi9fyBA==", "license": "MIT", "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.19.3.tgz", - "integrity": "sha512-EATITl9WlmOuhdlUluHlYXCV7LFPuSw9CZ4gejPpjyDwQJUQg4ktHVNfy3hJ5I3h4SEiW0GWd68Gd61McmTO2A==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.0.0.tgz", + "integrity": "sha512-l30nTnD35w6wzABJry38tYuwMNaR9VweZb2go78F3vh8V15kGOpi1gWd7s6K2M8An7kqDS4L3Bgp019s7CJQQQ==", "license": "MIT", "engines": { - "node": ">=18.0" + "node": ">=20" } }, "node_modules/array-timsort": { @@ -619,24 +619,24 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.19.3.tgz", - "integrity": "sha512-ebmaOv/fCkLccsI2GM0OKmKq8ZOD6nZRmhK7g9Z1SWVofJGCtr7RcxRhtvqBwVyK16EXbzPIVtLAj0jIBhC2qw==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.0.0.tgz", + "integrity": "sha512-z/HtX5DvLn7iixniOwzDqxpg0wL08obTdbZ2xj4aSZCcaJVIypFoli0FhiH0wHX2whiUTk0NTSp9X9eN7aoOKg==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "8.19.3", - "@cspell/cspell-pipe": "8.19.3", - "@cspell/cspell-types": "8.19.3", - "@cspell/dynamic-import": "8.19.3", - "@cspell/url": "8.19.3", + "@cspell/cspell-json-reporter": "9.0.0", + "@cspell/cspell-pipe": "9.0.0", + "@cspell/cspell-types": "9.0.0", + "@cspell/dynamic-import": "9.0.0", + "@cspell/url": "9.0.0", "chalk": "^5.4.1", "chalk-template": "^1.1.0", "commander": "^13.1.0", - "cspell-dictionary": "8.19.3", - "cspell-gitignore": "8.19.3", - "cspell-glob": "8.19.3", - "cspell-io": "8.19.3", - "cspell-lib": "8.19.3", + "cspell-dictionary": "9.0.0", + "cspell-gitignore": "9.0.0", + "cspell-glob": "9.0.0", + "cspell-io": "9.0.0", + "cspell-lib": "9.0.0", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "semver": "^7.7.1", @@ -647,122 +647,122 @@ "cspell-esm": "bin.mjs" }, "engines": { - "node": ">=18" + "node": ">=20" }, "funding": { "url": "https://github.com/streetsidesoftware/cspell?sponsor=1" } }, "node_modules/cspell-config-lib": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.19.3.tgz", - "integrity": "sha512-GjSrLU1KFLVzFa5qQA8DMF04BXW6r3xnfhwHFqU/8tEqtQXxKemGWnc9mt42Ey5hoe366lvhbIoh+vUhGf/IKA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.0.0.tgz", + "integrity": "sha512-JVjKeQz/kdt/bxdFRzyvNjJKJ3eaIUtP5gWq+HtNMqCpBFlwCiR+M8jSsIXVOTTT5mqJ5IsBU/jZ+FvrixNYnQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "8.19.3", + "@cspell/cspell-types": "9.0.0", "comment-json": "^4.2.5", "yaml": "^2.7.1" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/cspell-dictionary": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.19.3.tgz", - "integrity": "sha512-tycnHhLHvqKl4a2hVg/tIIai0wmcHHSAlgBAXAnSl+0g2DRrQ5GDT+9tHJ8B373o62jD8f5jHwbfJrLgHiNXWg==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.0.0.tgz", + "integrity": "sha512-+fWdlzTqqjRsAfImcC2UIvSeDTn0HItw1WuYqARuRRA+UlsdDA2uARDyiH4gBnc+0/GOIhQaItYBS5XXljWEpw==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.19.3", - "@cspell/cspell-types": "8.19.3", - "cspell-trie-lib": "8.19.3", + "@cspell/cspell-pipe": "9.0.0", + "@cspell/cspell-types": "9.0.0", + "cspell-trie-lib": "9.0.0", "fast-equals": "^5.2.2" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/cspell-gitignore": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.19.3.tgz", - "integrity": "sha512-8ZislUTep+b1UIn03w6dKCs5CXrQlQDL1OG/FpyjyLC/OQHo3Gd7YMQWOhImZ3ZpnkIskcB+iU5XPOW04lkqPQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.0.0.tgz", + "integrity": "sha512-qHt2yXIIOYJBvhx7vO6shcIH8LN+9QoY/+iqNZm4OagWtmpPRqMCsZQj6PUuzcBMGhOQ0U10f/m5OzIIBGwKvQ==", "license": "MIT", "dependencies": { - "@cspell/url": "8.19.3", - "cspell-glob": "8.19.3", - "cspell-io": "8.19.3" + "@cspell/url": "9.0.0", + "cspell-glob": "9.0.0", + "cspell-io": "9.0.0" }, "bin": { "cspell-gitignore": "bin.mjs" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/cspell-glob": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.19.3.tgz", - "integrity": "sha512-Fv4coZmCmqaNq2UfXhVqQbHschhAcm3rwoxPyBqQcDYpvCQ4Q2+qnHQkK1nAxmDjus4KFM/QKrBoxSlD90bD9g==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.0.0.tgz", + "integrity": "sha512-9xBcpFy7oHxELFLqvMs5WPT/ThU/NyrKYfuNcLUkBtxz/qGbqykWIcmdLl130fLwpcIGdq31rVSni6NsMGSriw==", "license": "MIT", "dependencies": { - "@cspell/url": "8.19.3", + "@cspell/url": "9.0.0", "picomatch": "^4.0.2" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/cspell-grammar": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.19.3.tgz", - "integrity": "sha512-5VJjqTPRpJZpQvoGj0W88yo0orY/YVuG5P8NVIwnfMAMRAnw2PAb7fsDydO9bPdFKdGPQ4CWoO++ed0g/Ra6jQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.0.0.tgz", + "integrity": "sha512-nTvYmxvlwnAeVZtd8rw6/3c3QsUZqDGlFtGIQMk6sKdH4n8eDPFH2K3Hag1aPOzPQJQF8XTxzgGmRnCWkPhdYg==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.19.3", - "@cspell/cspell-types": "8.19.3" + "@cspell/cspell-pipe": "9.0.0", + "@cspell/cspell-types": "9.0.0" }, "bin": { "cspell-grammar": "bin.mjs" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/cspell-io": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.19.3.tgz", - "integrity": "sha512-kJa4ZQdr6QwFEo3TxcyXBLAs2DiogrdtYa4tK87Wzyg3+Am1l7Z9AN8gZWQ+tZIi3BC0FYj4PsBdZ4qdmcY98g==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.0.0.tgz", + "integrity": "sha512-LtyqO0bDPCKCb/3zy/IvF4nL+FuU9GeLQ9G5bnSMFOYU/kD7w5UqzE1erzC/UublMRDRyKMlSDl8QutXCeq7zw==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "8.19.3", - "@cspell/url": "8.19.3" + "@cspell/cspell-service-bus": "9.0.0", + "@cspell/url": "9.0.0" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.19.3.tgz", - "integrity": "sha512-tVxrZYG7VCjjzARoTBQ7F/3FCjIGbzN0YbFcB3g4KLvbEuH83uLXm2MNdN9yDMaiD1XZ0CzP14eKiwpSMT7tjQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.0.0.tgz", + "integrity": "sha512-5ocoFmsrW1ju954kPzm1/mhAgnIQFjFjSS8YaQ6ylxCsqV9lCadf9tT2nnC2HrZB9ILVWElsrhxkQWt2DpZQsQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.19.3", - "@cspell/cspell-pipe": "8.19.3", - "@cspell/cspell-resolver": "8.19.3", - "@cspell/cspell-types": "8.19.3", - "@cspell/dynamic-import": "8.19.3", - "@cspell/filetypes": "8.19.3", - "@cspell/strong-weak-map": "8.19.3", - "@cspell/url": "8.19.3", + "@cspell/cspell-bundled-dicts": "9.0.0", + "@cspell/cspell-pipe": "9.0.0", + "@cspell/cspell-resolver": "9.0.0", + "@cspell/cspell-types": "9.0.0", + "@cspell/dynamic-import": "9.0.0", + "@cspell/filetypes": "9.0.0", + "@cspell/strong-weak-map": "9.0.0", + "@cspell/url": "9.0.0", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.19.3", - "cspell-dictionary": "8.19.3", - "cspell-glob": "8.19.3", - "cspell-grammar": "8.19.3", - "cspell-io": "8.19.3", - "cspell-trie-lib": "8.19.3", + "cspell-config-lib": "9.0.0", + "cspell-dictionary": "9.0.0", + "cspell-glob": "9.0.0", + "cspell-grammar": "9.0.0", + "cspell-io": "9.0.0", + "cspell-trie-lib": "9.0.0", "env-paths": "^3.0.0", "fast-equals": "^5.2.2", "gensequence": "^7.0.0", @@ -773,21 +773,21 @@ "xdg-basedir": "^5.1.0" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/cspell-trie-lib": { - "version": "8.19.3", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.19.3.tgz", - "integrity": "sha512-Z33vT0M/Vi10L9XaxKPTQu0AA0nmq91QWY5CzBymZY7LhOf6yGYcCgoTHluQms8YLCWaiX9pgTOF2/W1wlNiVg==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.0.0.tgz", + "integrity": "sha512-2s/an4sbIR8NAfkjuH6/ngap3BmfTVjxPCY2PwrzIm1WNUbEuYkY3vb1Rc4rOJ7nCTBpdu0o7/sI9ZGpMUcUzQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.19.3", - "@cspell/cspell-types": "8.19.3", + "@cspell/cspell-pipe": "9.0.0", + "@cspell/cspell-types": "9.0.0", "gensequence": "^7.0.0" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/env-paths": { diff --git a/package.json b/package.json index eef0ae3b5c..5d509a4244 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^8.19.3" + "cspell": "^9.0.0" } } From 9d57de92a5d408a27e957da96824493caac2d4ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 14:50:43 +0000 Subject: [PATCH 616/845] Bump cspell from 9.0.0 to 9.0.1 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 9.0.0 to 9.0.1. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.0.1/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.0.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 236 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 119 insertions(+), 119 deletions(-) diff --git a/package-lock.json b/package-lock.json index 71665f2cdc..bc528e8a7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.0.0" + "cspell": "^9.0.1" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.0.0.tgz", - "integrity": "sha512-S2nM8iWGY252XrEOt9qAVMDgBBiQYcv7cxi/g1sBZL4sx/lDF02QSn926aVLYF9LNsGxjjliV7bbYoIU2oDjtQ==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.0.1.tgz", + "integrity": "sha512-h7gTqg0VF4N8VhOPk66XewuSsT56OP2ujgxtAyYQ4H+NuYd3HMfS0h/I3/y9uBhllwOEamaeAzYhc5JF/qIrsQ==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.0", @@ -31,9 +31,9 @@ "@cspell/dict-docker": "^1.1.14", "@cspell/dict-dotnet": "^5.0.9", "@cspell/dict-elixir": "^4.0.7", - "@cspell/dict-en_us": "^4.4.6", - "@cspell/dict-en-common-misspellings": "^2.0.10", - "@cspell/dict-en-gb-mit": "^3.0.3", + "@cspell/dict-en_us": "^4.4.8", + "@cspell/dict-en-common-misspellings": "^2.0.11", + "@cspell/dict-en-gb-mit": "^3.0.6", "@cspell/dict-filetypes": "^3.0.12", "@cspell/dict-flutter": "^1.1.0", "@cspell/dict-fonts": "^4.0.4", @@ -41,7 +41,7 @@ "@cspell/dict-fullstack": "^3.2.6", "@cspell/dict-gaming-terms": "^1.1.1", "@cspell/dict-git": "^3.0.4", - "@cspell/dict-golang": "^6.0.20", + "@cspell/dict-golang": "^6.0.21", "@cspell/dict-google": "^1.0.8", "@cspell/dict-haskell": "^4.0.5", "@cspell/dict-html": "^4.0.11", @@ -67,7 +67,7 @@ "@cspell/dict-rust": "^4.0.11", "@cspell/dict-scala": "^5.0.7", "@cspell/dict-shell": "^1.1.0", - "@cspell/dict-software-terms": "^5.0.7", + "@cspell/dict-software-terms": "^5.0.8", "@cspell/dict-sql": "^2.2.0", "@cspell/dict-svelte": "^1.0.6", "@cspell/dict-swift": "^2.0.5", @@ -80,30 +80,30 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.0.0.tgz", - "integrity": "sha512-6ooEVbicB148ScT475aGMPlgRLO/XlLC/yNecrnVlB/sbERCgDYqi+iJHgE4+BjpVQ8Ant/VRCWrncWMAH6D8g==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.0.1.tgz", + "integrity": "sha512-Rpn7Tuq9t8bZpXZFV43NkhCl0LaPDJZSON4/JFxGbOcH16ryXfrx7oObUTIIyxSxO3fGkzaJZHIwGibRJSsbNQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.0.0" + "@cspell/cspell-types": "9.0.1" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-pipe": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.0.0.tgz", - "integrity": "sha512-ur1m4SOs9GP0eIC7n+II/Ea2xuEBWVI438d/zcoC+DWMElQD99OPxVVpPmGoMIPx4YzNlXWQH4kcygnG2a3ogg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.0.1.tgz", + "integrity": "sha512-bhFcvF2a8KYKVh/OebCfJ8LFw5GYHyUsUjAbxnznTBrYOFSIclDjwUwT29yVDXwnQkJkB6Px5Y9e2VvtFizVFg==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.0.0.tgz", - "integrity": "sha512-D2bPNpKNmwJM7r28cK6gDpgZKslGALNeyjpg9jFJLfstvHyn9m6vXsZbDuOJLKoEU3CLhkDSmRyNiEb2n18xhA==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.0.1.tgz", + "integrity": "sha512-AhIXAhX1qt7Y3EyiP/5rAk7Ow7DJpAyB44wPbfdF9p1vhnk6oQ7RslnD3G6S9o/vNxZ0DWFPREMWx19J/3c+hw==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" @@ -113,18 +113,18 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.0.0.tgz", - "integrity": "sha512-KcvYBh/MrODNgavbjKTiWpI9BklGy9/suMCC/ZThUrjWpbndwHjxcbge4DLlKyVqYbe78B0KjKgZsuqQvOqJjg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.0.1.tgz", + "integrity": "sha512-DoW6hLkFIO3BXePtUYQEax3FTH9fkwCUbf6qphAEXnr4PjoyPZsgBhR6iCrZd4DyhuFiRvK3Cgpq2o3O0NdODQ==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.0.0.tgz", - "integrity": "sha512-iBtN+AVC1v/V35qGOzHLyIvFJEr3pljtJgB4pM0TIZuzPQrm9lr3vV+WSCeOXqiTuY8DEXeMCZN+30QOi4ElNQ==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.0.1.tgz", + "integrity": "sha512-8FRmvyV1AYEepJB3J7jji1ZYG9yOK0eYr4WuUVPfUJa6N3HyeZjWKhxbVvqedmEI74f5Ls3cQKHY1T2Yvqk/ag==", "license": "MIT", "engines": { "node": ">=20" @@ -224,21 +224,21 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.4.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.6.tgz", - "integrity": "sha512-9QFpNzyvqNkCc3QCJb2RmG87rXz2Iz3R6o9fknOyzN7HL/LRMwipuksricriPYPs+h3ZSQm4Jtgc+sX4gWY5vg==", + "version": "4.4.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.8.tgz", + "integrity": "sha512-OkNUVuU9Q+Sf827/61YPkk6ya6dSsllzeYniBFqNW9TkoqQXT3vggkgmtCE1aEhSvVctMwxpPYoC8pZgn1TeSA==", "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.10.tgz", - "integrity": "sha512-80mXJLtr0tVEtzowrI7ycVae/ULAYImZUlr0kUTpa8i57AUk7Zy3pYBs44EYIKW7ZC9AHu4Qjjfq4vriAtyTDQ==", + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.11.tgz", + "integrity": "sha512-xFQjeg0wFHh9sFhshpJ+5BzWR1m9Vu8pD0CGPkwZLK9oii8AD8RXNchabLKy/O5VTLwyqPOi9qpyp1cxm3US4Q==", "license": "CC BY-SA 4.0" }, "node_modules/@cspell/dict-en-gb-mit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.0.3.tgz", - "integrity": "sha512-usV5ddTBRTFCHoN9Swo1Vt9U4uPNRHS9oLtjOTWJtVj5O0OxJ+NxCXCZjjCm0afe6gw/GuvlnE4Ji7Vf53ObfQ==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.0.6.tgz", + "integrity": "sha512-QYDwuXi9Yh+AvU1omhz8sWX+A1SxWI3zeK1HdGfTrICZavhp8xxcQGTa5zxTTFRCcQc483YzUH2Dl+6Zd50tJg==", "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { @@ -284,9 +284,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-golang": { - "version": "6.0.20", - "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.20.tgz", - "integrity": "sha512-b7nd9XXs+apMMzNSWorjirQsbmlwcTC0ViQJU8u+XNose3z0y7oNeEpbTPTVoN1+1sO9aOHuFwfwoOMFCDS14Q==", + "version": "6.0.21", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.21.tgz", + "integrity": "sha512-D3wG1MWhFx54ySFJ00CS1MVjR4UiBVsOWGIjJ5Av+HamnguqEshxbF9mvy+BX0KqzdLVzwFkoLBs8QeOID56HA==", "license": "MIT" }, "node_modules/@cspell/dict-google": { @@ -449,9 +449,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.0.7.tgz", - "integrity": "sha512-6ttSc0/EzDN44DF2Bk/37cr3IntzuNcZ4MbUy/zEhfhDMiuQoXslILpAs/9FoKEuFpsm6A+8manT2GytWwr/HA==", + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.0.8.tgz", + "integrity": "sha512-VsJesitvaHZpMgNwHHms3yDsZz7LNToC2HuSAnyt1znn37ribiJF1ty0jWhVQO6fv7K4PM1KsKTJIwqBwc446g==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -491,12 +491,12 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.0.0.tgz", - "integrity": "sha512-SE7RFKH4FlXzLFli/vGMayteUVyXDbaZpb1bqymO3uAHO9ZgY+faid4vV/qoVMUgKK+P7hIq5e3MB7swmFAZBg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.0.1.tgz", + "integrity": "sha512-BoWzHwkufo90ubMZUN8Jy4HQYYWFW7psVCdG/4RUgfvVnazkPfLxWBbsPQsLrlIP0utaqei7D9FU0K7r7mpl4A==", "license": "MIT", "dependencies": { - "@cspell/url": "9.0.0", + "@cspell/url": "9.0.1", "import-meta-resolve": "^4.1.0" }, "engines": { @@ -504,27 +504,27 @@ } }, "node_modules/@cspell/filetypes": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.0.0.tgz", - "integrity": "sha512-PL6ty0Xdn1UmRXwIwkze3IizgVbJSCvP0yMQF5xRQixTfidBfxrvnqjAWOGNuQifgIk1PVyFvik7ubLG0skw3w==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.0.1.tgz", + "integrity": "sha512-swZu3ra2AueyjEz/bPsvwFuHGYhjWZBx1K9FSvZA/yDIX5RVr6orQSuf9zvXNFui6Nyk0tudLnn3y9jT0LHk8A==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/strong-weak-map": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.0.0.tgz", - "integrity": "sha512-LQw0f8nm1C7my6JqjtvTkFQ9Mt561vay0za5Vh5J9yCZxGbOvZ+/Doe925WM5NaqaxC3/wGUdEK1HxMxi9fyBA==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.0.1.tgz", + "integrity": "sha512-u87PWr1xACqs/F3HibZ4Eb0Za/ghWIa6WLvEKV9OaiLfEUQuczbrXPVgHmGr83H0XXWUKy8FvVbWGFmXwiw+gQ==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.0.0.tgz", - "integrity": "sha512-l30nTnD35w6wzABJry38tYuwMNaR9VweZb2go78F3vh8V15kGOpi1gWd7s6K2M8An7kqDS4L3Bgp019s7CJQQQ==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.0.1.tgz", + "integrity": "sha512-8xaLrsQ742dmwXwS6tjreps3NpSQe6WEZFPQQT2DprVJXGZnfQR8ob0c+kPhD0hu9A6PwShJsRsfh3DQGKCqAw==", "license": "MIT", "engines": { "node": ">=20" @@ -619,24 +619,24 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.0.0.tgz", - "integrity": "sha512-z/HtX5DvLn7iixniOwzDqxpg0wL08obTdbZ2xj4aSZCcaJVIypFoli0FhiH0wHX2whiUTk0NTSp9X9eN7aoOKg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.0.1.tgz", + "integrity": "sha512-AJqsX+3eSTz9GmIuyEZUzCCTbvCPw6+Nv7UYa4PCn7vNV3XEb5LHTp5i9y2i65fNaeNEcQXLrLYoY/JcBFmUSQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "9.0.0", - "@cspell/cspell-pipe": "9.0.0", - "@cspell/cspell-types": "9.0.0", - "@cspell/dynamic-import": "9.0.0", - "@cspell/url": "9.0.0", + "@cspell/cspell-json-reporter": "9.0.1", + "@cspell/cspell-pipe": "9.0.1", + "@cspell/cspell-types": "9.0.1", + "@cspell/dynamic-import": "9.0.1", + "@cspell/url": "9.0.1", "chalk": "^5.4.1", "chalk-template": "^1.1.0", "commander": "^13.1.0", - "cspell-dictionary": "9.0.0", - "cspell-gitignore": "9.0.0", - "cspell-glob": "9.0.0", - "cspell-io": "9.0.0", - "cspell-lib": "9.0.0", + "cspell-dictionary": "9.0.1", + "cspell-gitignore": "9.0.1", + "cspell-glob": "9.0.1", + "cspell-io": "9.0.1", + "cspell-lib": "9.0.1", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "semver": "^7.7.1", @@ -654,12 +654,12 @@ } }, "node_modules/cspell-config-lib": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.0.0.tgz", - "integrity": "sha512-JVjKeQz/kdt/bxdFRzyvNjJKJ3eaIUtP5gWq+HtNMqCpBFlwCiR+M8jSsIXVOTTT5mqJ5IsBU/jZ+FvrixNYnQ==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.0.1.tgz", + "integrity": "sha512-hbeyU6cY4NPKh69L4QpBZgGz00f7rLk10xPlCo6MxEmCqSOTuXXvDEUR51d2ED69G+GyFAeZi5VU9IdJ4jhvzQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.0.0", + "@cspell/cspell-types": "9.0.1", "comment-json": "^4.2.5", "yaml": "^2.7.1" }, @@ -668,14 +668,14 @@ } }, "node_modules/cspell-dictionary": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.0.0.tgz", - "integrity": "sha512-+fWdlzTqqjRsAfImcC2UIvSeDTn0HItw1WuYqARuRRA+UlsdDA2uARDyiH4gBnc+0/GOIhQaItYBS5XXljWEpw==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.0.1.tgz", + "integrity": "sha512-I9gjRpfV4djxN0i2p9OzWIrkjtUaGUyVE9atvRbkHUMeqDUhC2Qt0Mb9tnF8I7qnHeZt+U44vUa9Dg7yrJ+k4Q==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.0.0", - "@cspell/cspell-types": "9.0.0", - "cspell-trie-lib": "9.0.0", + "@cspell/cspell-pipe": "9.0.1", + "@cspell/cspell-types": "9.0.1", + "cspell-trie-lib": "9.0.1", "fast-equals": "^5.2.2" }, "engines": { @@ -683,14 +683,14 @@ } }, "node_modules/cspell-gitignore": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.0.0.tgz", - "integrity": "sha512-qHt2yXIIOYJBvhx7vO6shcIH8LN+9QoY/+iqNZm4OagWtmpPRqMCsZQj6PUuzcBMGhOQ0U10f/m5OzIIBGwKvQ==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.0.1.tgz", + "integrity": "sha512-xjgOmeGbHEaeF0erRQ2QXwqxWqGDiI4mu+NjCL7ZHPoAM5y8PEO6IbxVNabIB1xC4QAborbtEQ/8ydDWLJcPoQ==", "license": "MIT", "dependencies": { - "@cspell/url": "9.0.0", - "cspell-glob": "9.0.0", - "cspell-io": "9.0.0" + "@cspell/url": "9.0.1", + "cspell-glob": "9.0.1", + "cspell-io": "9.0.1" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -700,12 +700,12 @@ } }, "node_modules/cspell-glob": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.0.0.tgz", - "integrity": "sha512-9xBcpFy7oHxELFLqvMs5WPT/ThU/NyrKYfuNcLUkBtxz/qGbqykWIcmdLl130fLwpcIGdq31rVSni6NsMGSriw==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.0.1.tgz", + "integrity": "sha512-dQU/ln6J9Qe31zk1cLJnq/WNAjRrTUig1GG8WA2oK1jHZKY9VbyJLb5DUFnDUx35cI0jdOEnGSCWi8qNjHSc1Q==", "license": "MIT", "dependencies": { - "@cspell/url": "9.0.0", + "@cspell/url": "9.0.1", "picomatch": "^4.0.2" }, "engines": { @@ -713,13 +713,13 @@ } }, "node_modules/cspell-grammar": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.0.0.tgz", - "integrity": "sha512-nTvYmxvlwnAeVZtd8rw6/3c3QsUZqDGlFtGIQMk6sKdH4n8eDPFH2K3Hag1aPOzPQJQF8XTxzgGmRnCWkPhdYg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.0.1.tgz", + "integrity": "sha512-FZ1z1p3pslfotZT/W/VRZjB4S+z0ETrTbNmQ5pGmhdY0nm7Slmg+8nIJluLEjBneBGTJIOcLjYykwS2vI6jzxw==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.0.0", - "@cspell/cspell-types": "9.0.0" + "@cspell/cspell-pipe": "9.0.1", + "@cspell/cspell-types": "9.0.1" }, "bin": { "cspell-grammar": "bin.mjs" @@ -729,40 +729,40 @@ } }, "node_modules/cspell-io": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.0.0.tgz", - "integrity": "sha512-LtyqO0bDPCKCb/3zy/IvF4nL+FuU9GeLQ9G5bnSMFOYU/kD7w5UqzE1erzC/UublMRDRyKMlSDl8QutXCeq7zw==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.0.1.tgz", + "integrity": "sha512-L5fZY0glVeQb6nmt1WL1wKzZzoHJUkBQ9BGCrwqSXIrjZrYmBNSKixCjo6o9n2keRUwpNjsvZj1TQDKDV+FsXA==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "9.0.0", - "@cspell/url": "9.0.0" + "@cspell/cspell-service-bus": "9.0.1", + "@cspell/url": "9.0.1" }, "engines": { "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.0.0.tgz", - "integrity": "sha512-5ocoFmsrW1ju954kPzm1/mhAgnIQFjFjSS8YaQ6ylxCsqV9lCadf9tT2nnC2HrZB9ILVWElsrhxkQWt2DpZQsQ==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.0.1.tgz", + "integrity": "sha512-F4vJG6GmAGVAuhgcepO12UtG7yev7Rcfa31MLIyYNTrd5NeORzM+GTHnL970FlEflwYPYjcSTGwkyowQ+ZbmDg==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.0.0", - "@cspell/cspell-pipe": "9.0.0", - "@cspell/cspell-resolver": "9.0.0", - "@cspell/cspell-types": "9.0.0", - "@cspell/dynamic-import": "9.0.0", - "@cspell/filetypes": "9.0.0", - "@cspell/strong-weak-map": "9.0.0", - "@cspell/url": "9.0.0", + "@cspell/cspell-bundled-dicts": "9.0.1", + "@cspell/cspell-pipe": "9.0.1", + "@cspell/cspell-resolver": "9.0.1", + "@cspell/cspell-types": "9.0.1", + "@cspell/dynamic-import": "9.0.1", + "@cspell/filetypes": "9.0.1", + "@cspell/strong-weak-map": "9.0.1", + "@cspell/url": "9.0.1", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "9.0.0", - "cspell-dictionary": "9.0.0", - "cspell-glob": "9.0.0", - "cspell-grammar": "9.0.0", - "cspell-io": "9.0.0", - "cspell-trie-lib": "9.0.0", + "cspell-config-lib": "9.0.1", + "cspell-dictionary": "9.0.1", + "cspell-glob": "9.0.1", + "cspell-grammar": "9.0.1", + "cspell-io": "9.0.1", + "cspell-trie-lib": "9.0.1", "env-paths": "^3.0.0", "fast-equals": "^5.2.2", "gensequence": "^7.0.0", @@ -777,13 +777,13 @@ } }, "node_modules/cspell-trie-lib": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.0.0.tgz", - "integrity": "sha512-2s/an4sbIR8NAfkjuH6/ngap3BmfTVjxPCY2PwrzIm1WNUbEuYkY3vb1Rc4rOJ7nCTBpdu0o7/sI9ZGpMUcUzQ==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.0.1.tgz", + "integrity": "sha512-gIupiHwLdsQun79biJgiqmXffKUGzFjGLFEeVptI2Zy5Oa3XhRJsHap4PyeleErONkpzxMG1tgpOWzhOqwl65Q==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.0.0", - "@cspell/cspell-types": "9.0.0", + "@cspell/cspell-pipe": "9.0.1", + "@cspell/cspell-types": "9.0.1", "gensequence": "^7.0.0" }, "engines": { diff --git a/package.json b/package.json index 5d509a4244..14ff472b1c 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.0.0" + "cspell": "^9.0.1" } } From 852b5e72debf7f949649511045292e8997913f94 Mon Sep 17 00:00:00 2001 From: Rob Date: Mon, 19 May 2025 14:46:54 +0200 Subject: [PATCH 617/845] Fix links to test suites in bug report template --- .github/ISSUE_TEMPLATE/01_bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.yml b/.github/ISSUE_TEMPLATE/01_bug_report.yml index dc156456c0..834f8bf8f8 100644 --- a/.github/ISSUE_TEMPLATE/01_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/01_bug_report.yml @@ -13,7 +13,7 @@ body: * Checked existing open *and* closed [issues](https://github.com/fluentassertions/fluentassertions/issues?utf8=%E2%9C%93&q=is%3Aissue), to see if the issue has already been reported? * Tried reproducing your problem in a new isolated project? * Read the [documentation](https://fluentassertions.com/introduction)? - * Searched the two [test](https://github.com/fluentassertions/fluentassertions/tree/develop/Tests/FluentAssertions.Specs) [suites](https://github.com/fluentassertions/fluentassertions/tree/develop/Tests/FluentAssertions.Equivalency.Specs) if there is a test documenting the expected behavior? + * Searched the two [test](https://github.com/fluentassertions/fluentassertions/tree/main/Tests/FluentAssertions.Specs) [suites](https://github.com/fluentassertions/fluentassertions/tree/main/Tests/FluentAssertions.Equivalency.Specs) if there is a test documenting the expected behavior? * Considered if this is a general question and not a bug? For general questions please use [Stack Overflow](https://stackoverflow.com/questions/tagged/fluent-assertions?mixed=1). - type: textarea id: background From 7142e0f801cbfabb0f2c970081b73702da03c22f Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sat, 24 May 2025 14:42:42 +0200 Subject: [PATCH 618/845] Clarify the date/time type when comparing non-compatible dates, times --- .../Equivalency/Comparands.cs | 3 + .../Equivalency/EquivalencyPlan.cs | 1 + .../Steps/DateAndTimeEquivalencyStep.cs | 53 ++++++ .../FluentAssertions/net47.verified.txt | 5 + .../FluentAssertions/net6.0.verified.txt | 5 + .../netstandard2.0.verified.txt | 5 + .../netstandard2.1.verified.txt | 5 + .../DateTimePropertiesSpecs.cs | 156 ++++++++++++++++++ docs/_pages/releases.md | 7 + 9 files changed, 240 insertions(+) create mode 100644 Src/FluentAssertions/Equivalency/Steps/DateAndTimeEquivalencyStep.cs diff --git a/Src/FluentAssertions/Equivalency/Comparands.cs b/Src/FluentAssertions/Equivalency/Comparands.cs index af121392ab..4e763acf9b 100644 --- a/Src/FluentAssertions/Equivalency/Comparands.cs +++ b/Src/FluentAssertions/Equivalency/Comparands.cs @@ -29,6 +29,9 @@ public Comparands(object subject, object expectation, Type compileTimeType) /// public object Expectation { get; set; } + /// + /// Gets the compile-time type of the expectation object. + /// public Type CompileTimeType { get diff --git a/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs b/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs index 9ef026fca2..f8975a0ba2 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs @@ -152,6 +152,7 @@ private static List GetDefaultSteps() new GenericEnumerableEquivalencyStep(), new EnumerableEquivalencyStep(), new StringEqualityEquivalencyStep(), + new DateAndTimeEquivalencyStep(), new EnumEqualityStep(), new ValueTypeEquivalencyStep(), new StructuralEqualityEquivalencyStep(), diff --git a/Src/FluentAssertions/Equivalency/Steps/DateAndTimeEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/DateAndTimeEquivalencyStep.cs new file mode 100644 index 0000000000..6b04dbb728 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Steps/DateAndTimeEquivalencyStep.cs @@ -0,0 +1,53 @@ +using System; +using FluentAssertions.Execution; + +namespace FluentAssertions.Equivalency.Steps; + +// AV1000: Type 'DateAndTimeEquivalencyStep' contains the word 'and', which suggests it has multiple purpose +#pragma warning disable AV1000 + +/// +/// Specific equivalency step for handling date and time types where the types are different and the failure message +/// should make that clear. +/// +public class DateAndTimeEquivalencyStep : IEquivalencyStep +{ + public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, + IValidateChildNodeEquivalency valueChildNodes) + { + object subject = comparands.Subject; + object expectation = comparands.Expectation; + + Type expectedType = comparands.GetExpectedType(context.Options); + Type subjectType = subject?.GetType(); + + if (IsOfDateOrTimeType(expectedType) && IsOfDateOrTimeType(subjectType) && subjectType != expectedType) + { + AssertionChain.GetOrCreate() + .For(context) + .ForCondition(subject!.Equals(expectation)) + .FailWith("Expected {context} to be {0} (of type {1}){reason}, but found {2} (of type {3}).", expectation, + expectedType, subject, subjectType); + + return EquivalencyResult.EquivalencyProven; + } + + return EquivalencyResult.ContinueWithNext; + } + +#if NET6_0_OR_GREATER + private static bool IsOfDateOrTimeType(Type type) => + type == typeof(DateTime) || + type == typeof(DateTimeOffset) || + type == typeof(TimeSpan) || + type == typeof(TimeOnly) || + type == typeof(DateOnly); +#else + private static bool IsOfDateOrTimeType(Type type) => + type == typeof(DateTime) || + type == typeof(DateTimeOffset) || + type == typeof(TimeSpan); +#endif +} + +#pragma warning restore AV1000 diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index a1ac90a110..a27b801a94 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -982,6 +982,11 @@ namespace FluentAssertions.Equivalency.Steps public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } + public class DateAndTimeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep + { + public DateAndTimeEquivalencyStep() { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + } public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index a8f3c5051d..399891910b 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -995,6 +995,11 @@ namespace FluentAssertions.Equivalency.Steps public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } + public class DateAndTimeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep + { + public DateAndTimeEquivalencyStep() { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + } public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index a5068f244d..acbf851e37 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -974,6 +974,11 @@ namespace FluentAssertions.Equivalency.Steps public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } + public class DateAndTimeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep + { + public DateAndTimeEquivalencyStep() { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + } public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 3b545b4271..44fb44ddd2 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -982,6 +982,11 @@ namespace FluentAssertions.Equivalency.Steps public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } + public class DateAndTimeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep + { + public DateAndTimeEquivalencyStep() { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + } public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } diff --git a/Tests/FluentAssertions.Equivalency.Specs/DateTimePropertiesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DateTimePropertiesSpecs.cs index d0c8a799e1..e6fe32b7c8 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/DateTimePropertiesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/DateTimePropertiesSpecs.cs @@ -1,4 +1,5 @@ using System; +using FluentAssertions.Extensions; using Xunit; using Xunit.Sdk; @@ -150,4 +151,159 @@ public void act.Should().Throw().WithMessage( "Expected*Time*to be <2013-12-09 15:58:00>, but found .*"); } + +#if NET6_0_OR_GREATER + [Fact] + public void Clarifies_that_a_date_time_is_compared_with_a_date_only() + { + // Arrange + var subject = new + { + SomeDate = new DateOnly(2020, 1, 2) + }; + + // Act + var act = () => subject.Should().BeEquivalentTo(new + { + SomeDate = 2.January(2020) + }); + + // Assert + act.Should().Throw().WithMessage("*SomeDate*DateTime*found*DateOnly*"); + } + + [Fact] + public void Clarifies_that_a_date_only_is_compared_with_a_date_time() + { + // Arrange + var subject = new + { + SomeDate = 2.January(2020) + }; + + // Act + var act = () => subject.Should().BeEquivalentTo(new + { + SomeDate = new DateOnly(2020, 1, 2) + }); + + // Assert + act.Should().Throw().WithMessage("*SomeDate*DateOnly*found*DateTime*"); + } + + [Fact] + public void Clarifies_that_a_time_only_is_compared_with_a_date_time() + { + // Arrange + var subject = new + { + SomeDate = new DateTime(2020, 1, 2).At(9, 30) + }; + + // Act + var act = () => subject.Should().BeEquivalentTo(new + { + SomeDate = new TimeOnly(9, 30) + }); + + // Assert + act.Should().Throw().WithMessage("*SomeDate*TimeOnly*found*DateTime*"); + } + + [Fact] + public void Clarifies_that_a_date_time_is_compared_with_a_time_only() + { + // Arrange + var subject = new + { + SomeDate = new TimeOnly(9, 30) + }; + + // Act + var act = () => subject.Should().BeEquivalentTo(new + { + SomeDate = new DateTime(2020, 1, 2).At(9, 30) + }); + + // Assert + act.Should().Throw().WithMessage("*SomeDate*DateTime*found*TimeOnly*"); + } + + [Fact] + public void Clarifies_that_a_time_only_is_compared_with_a_time_span() + { + // Arrange + var subject = new + { + SomeTime = new TimeOnly(9, 30) + }; + + // Act + var act = () => subject.Should().BeEquivalentTo(new + { + SomeTime = new TimeSpan(9, 30, 0) + }); + + // Assert + act.Should().Throw().WithMessage("*SomeTime*TimeSpan*found*TimeOnly*"); + } + + [Fact] + public void Clarifies_that_a_time_span_is_compared_with_a_time_only() + { + // Arrange + var subject = new + { + SomeTime = new TimeSpan(9, 30, 0) + }; + + // Act + var act = () => subject.Should().BeEquivalentTo(new + { + SomeTime = new TimeOnly(9, 30) + }); + + // Assert + act.Should().Throw().WithMessage("*SomeTime*TimeOnly*found*TimeSpan*"); + } + +#endif + + [Fact] + public void Clarifies_that_a_date_time_is_compared_to_a_date_time_offset() + { + // Arrange + var subject = new + { + SomeDate = 2.January(2020) + }; + + // Act + var act = () => subject.Should().BeEquivalentTo(new + { + SomeDate = new DateTimeOffset(2.January(2020), TimeSpan.Zero) + }); + + // Assert + act.Should().Throw().WithMessage("*SomeDate*DateTimeOffset*found*DateTime*"); + } + + [Fact] + public void Clarifies_that_a_date_time_offset_is_compared_to_a_date_time() + { + // Arrange + var subject = new + { + SomeDate = new DateTimeOffset(2.January(2020), TimeSpan.Zero) + }; + + // Act + var act = () => subject.Should().BeEquivalentTo(new + { + SomeDate = 2.January(2020) + }); + + // Assert + act.Should().Throw().WithMessage("*SomeDate*DateTime*found*DateTimeOffset*"); + } } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index f888433419..b7013598bb 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,6 +7,13 @@ sidebar: nav: "sidebar" --- +## 8.3.0 + +## Enhancements + +* Clarify the date/time type when comparing non-compatible dates and times in `BeEquivalentTo` - [3049](https://github.com/fluentassertions/fluentassertions/pull/3049) +* Improve the rendering of exception messages when using `WithMessage` for better readability - [3039](https://github.com/fluentassertions/fluentassertions/pull/3039) + ## 8.2.0 ## Fixes From 88ae37f5d307e15a9307ca921c94a62960f35c2a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 15:05:01 +0000 Subject: [PATCH 619/845] Bump cspell from 9.0.1 to 9.0.2 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 9.0.1 to 9.0.2. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.0.2/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.0.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 258 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 130 insertions(+), 130 deletions(-) diff --git a/package-lock.json b/package-lock.json index bc528e8a7a..a1206c0df7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.0.1" + "cspell": "^9.0.2" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.0.1.tgz", - "integrity": "sha512-h7gTqg0VF4N8VhOPk66XewuSsT56OP2ujgxtAyYQ4H+NuYd3HMfS0h/I3/y9uBhllwOEamaeAzYhc5JF/qIrsQ==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.0.2.tgz", + "integrity": "sha512-gGFSfVIvYtO95O3Yhcd1o0sOZHjVaCPwYq3MnaNsBBzaMviIZli4FZW9Z+XNKsgo1zRzbl2SdOXJPP0VcyAY0A==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.0", @@ -40,7 +40,7 @@ "@cspell/dict-fsharp": "^1.1.0", "@cspell/dict-fullstack": "^3.2.6", "@cspell/dict-gaming-terms": "^1.1.1", - "@cspell/dict-git": "^3.0.4", + "@cspell/dict-git": "^3.0.5", "@cspell/dict-golang": "^6.0.21", "@cspell/dict-google": "^1.0.8", "@cspell/dict-haskell": "^4.0.5", @@ -67,7 +67,7 @@ "@cspell/dict-rust": "^4.0.11", "@cspell/dict-scala": "^5.0.7", "@cspell/dict-shell": "^1.1.0", - "@cspell/dict-software-terms": "^5.0.8", + "@cspell/dict-software-terms": "^5.0.9", "@cspell/dict-sql": "^2.2.0", "@cspell/dict-svelte": "^1.0.6", "@cspell/dict-swift": "^2.0.5", @@ -80,30 +80,30 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.0.1.tgz", - "integrity": "sha512-Rpn7Tuq9t8bZpXZFV43NkhCl0LaPDJZSON4/JFxGbOcH16ryXfrx7oObUTIIyxSxO3fGkzaJZHIwGibRJSsbNQ==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.0.2.tgz", + "integrity": "sha512-Hy9hKG53cFhLwiSZuRVAd5YfBb5pPj3V2Val69TW1j4+sy3podewqm4sb3RqoB01LcDkLI/mOeMwHz1xyIjfoA==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.0.1" + "@cspell/cspell-types": "9.0.2" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-pipe": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.0.1.tgz", - "integrity": "sha512-bhFcvF2a8KYKVh/OebCfJ8LFw5GYHyUsUjAbxnznTBrYOFSIclDjwUwT29yVDXwnQkJkB6Px5Y9e2VvtFizVFg==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.0.2.tgz", + "integrity": "sha512-M1e+u3dyGCJicSZ16xmoVut4pI8ynfqILYiDAYC9+rbn04wJdnWD46ElIZnRriFXx7fu/UsUEexu3lFaqKVGEg==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.0.1.tgz", - "integrity": "sha512-AhIXAhX1qt7Y3EyiP/5rAk7Ow7DJpAyB44wPbfdF9p1vhnk6oQ7RslnD3G6S9o/vNxZ0DWFPREMWx19J/3c+hw==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.0.2.tgz", + "integrity": "sha512-JkMQb+hcEyZ2ALvEeJvfxoIblRpZlnek50Ew5sLSSZciRuhNvQZS5+Apwt1GXHitTo8/bqXFxABNP36O++YAwA==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" @@ -113,18 +113,18 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.0.1.tgz", - "integrity": "sha512-DoW6hLkFIO3BXePtUYQEax3FTH9fkwCUbf6qphAEXnr4PjoyPZsgBhR6iCrZd4DyhuFiRvK3Cgpq2o3O0NdODQ==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.0.2.tgz", + "integrity": "sha512-OjfZ3vnBjmkctC9xs/87/9bx/3kZYUPJkWsZxzfH4rla/HeIUrm9UZlDqCibhWifhPHrDdV9hDW5QEGXkYR2hw==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.0.1.tgz", - "integrity": "sha512-8FRmvyV1AYEepJB3J7jji1ZYG9yOK0eYr4WuUVPfUJa6N3HyeZjWKhxbVvqedmEI74f5Ls3cQKHY1T2Yvqk/ag==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.0.2.tgz", + "integrity": "sha512-RioULo34qbUXuCCLi/DCDxdb++Nm1ospNXzVkKZrSvTG4AjkC95ZhfIOp9jbGSWqL2PGdaHVXgG77EyQbAk5xA==", "license": "MIT", "engines": { "node": ">=20" @@ -224,9 +224,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.4.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.8.tgz", - "integrity": "sha512-OkNUVuU9Q+Sf827/61YPkk6ya6dSsllzeYniBFqNW9TkoqQXT3vggkgmtCE1aEhSvVctMwxpPYoC8pZgn1TeSA==", + "version": "4.4.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.9.tgz", + "integrity": "sha512-5gjqpUwhE+qP9A9wxD1+MGGJ3DNqTgSpiOsS10cGJfV4p/Z194XkDUZrUrJsnJA/3fsCZHAzcNWh8m0bw1v++A==", "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { @@ -236,9 +236,9 @@ "license": "CC BY-SA 4.0" }, "node_modules/@cspell/dict-en-gb-mit": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.0.6.tgz", - "integrity": "sha512-QYDwuXi9Yh+AvU1omhz8sWX+A1SxWI3zeK1HdGfTrICZavhp8xxcQGTa5zxTTFRCcQc483YzUH2Dl+6Zd50tJg==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.0.7.tgz", + "integrity": "sha512-fdZbu4jbkzjjTO0jPBGINwQwzNFGapMnhH9D4mDa4UzGGyQFVRx6n/FFwxnfs7CXbuCV6UFSwjHZEAB8pfWn0A==", "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { @@ -278,9 +278,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-git": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.4.tgz", - "integrity": "sha512-C44M+m56rYn6QCsLbiKiedyPTMZxlDdEYAsPwwlL5bhMDDzXZ3Ic8OCQIhMbiunhCOJJT+er4URmOmM+sllnjg==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.5.tgz", + "integrity": "sha512-I7l86J2nOcpBY0OcwXLTGMbcXbEE7nxZme9DmYKrNgmt35fcLu+WKaiXW7P29V+lIXjJo/wKrEDY+wUEwVuABQ==", "license": "MIT" }, "node_modules/@cspell/dict-golang": { @@ -386,9 +386,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.3.tgz", - "integrity": "sha512-EdGkCpAq66Mhi9Qldgsr+NvPVL4TdtmdlqDe4VBp0P3n6J0B7b0jT1MlVDIiLR+F1eqBfL0qjfHf0ey1CafeNw==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.4.tgz", + "integrity": "sha512-/hK5ii9OzSOQkmTjkzJlEYWz+PBnz2hRq5Xu7d4aDURaynO9xMAcK31JJlKNQulBkVbQHxFZLUrzjdzdAr/Opw==", "license": "MIT" }, "node_modules/@cspell/dict-php": { @@ -449,9 +449,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.0.8.tgz", - "integrity": "sha512-VsJesitvaHZpMgNwHHms3yDsZz7LNToC2HuSAnyt1znn37ribiJF1ty0jWhVQO6fv7K4PM1KsKTJIwqBwc446g==", + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.0.10.tgz", + "integrity": "sha512-2nTcVKTYJKU5GzeviXGPtRRC9d23MtfpD4PM4pLSzl29/5nx5MxOUHkzPuJdyaw9mXIz8Rm9IlGeVAvQoTI8aw==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -491,12 +491,12 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.0.1.tgz", - "integrity": "sha512-BoWzHwkufo90ubMZUN8Jy4HQYYWFW7psVCdG/4RUgfvVnazkPfLxWBbsPQsLrlIP0utaqei7D9FU0K7r7mpl4A==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.0.2.tgz", + "integrity": "sha512-KhcoNUj6Ij2P8fbRC7QOn3jzbTZFxoQpFGanGU9f+4DfZBH86PCADyKYH+ZpJPlYgrI+Jh4wKzF5y5YKKNrdrw==", "license": "MIT", "dependencies": { - "@cspell/url": "9.0.1", + "@cspell/url": "9.0.2", "import-meta-resolve": "^4.1.0" }, "engines": { @@ -504,27 +504,27 @@ } }, "node_modules/@cspell/filetypes": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.0.1.tgz", - "integrity": "sha512-swZu3ra2AueyjEz/bPsvwFuHGYhjWZBx1K9FSvZA/yDIX5RVr6orQSuf9zvXNFui6Nyk0tudLnn3y9jT0LHk8A==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.0.2.tgz", + "integrity": "sha512-8KEIgptldoZT3pM+yhYV8nXq5T9Sz0YvZIqwDGEqKJ6j447K+I91QWS7RQDrvHkElMi/2g/h08Efg0RIT+QEaQ==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/strong-weak-map": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.0.1.tgz", - "integrity": "sha512-u87PWr1xACqs/F3HibZ4Eb0Za/ghWIa6WLvEKV9OaiLfEUQuczbrXPVgHmGr83H0XXWUKy8FvVbWGFmXwiw+gQ==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.0.2.tgz", + "integrity": "sha512-SHTPUcu2e6aYxI5sr1L/9pzz68CArV6WzMvAio//5LbtKI6NtDp/7tARBwLi1G3A3C0289zDHbDKm3wc1lRNhQ==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.0.1.tgz", - "integrity": "sha512-8xaLrsQ742dmwXwS6tjreps3NpSQe6WEZFPQQT2DprVJXGZnfQR8ob0c+kPhD0hu9A6PwShJsRsfh3DQGKCqAw==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.0.2.tgz", + "integrity": "sha512-KwCDL0ejgwVSZB8KTp8FhDe42UOaebTVIMi3O5GcYHi9Cut8B5QU4tbQOFGXP6E4pjimeO9yIkr9Z34kTljj/g==", "license": "MIT", "engines": { "node": ">=20" @@ -588,12 +588,12 @@ } }, "node_modules/commander": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz", - "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.0.tgz", + "integrity": "sha512-2uM9rYjPvyq39NwLRqaiLtWHyDC1FvryJDa2ATTVims5YAS4PupsEQsDvP14FqhFr0P49CYDugi59xaxJlTXRA==", "license": "MIT", "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/comment-json": { @@ -619,27 +619,27 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.0.1.tgz", - "integrity": "sha512-AJqsX+3eSTz9GmIuyEZUzCCTbvCPw6+Nv7UYa4PCn7vNV3XEb5LHTp5i9y2i65fNaeNEcQXLrLYoY/JcBFmUSQ==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.0.2.tgz", + "integrity": "sha512-VwPNTTivvv/NyovXUMcTYc7BaOgun7k8FhRWaVKxZPEsl/9r9WTLmQ1dNbHRq56LajH2b7wKGQYuRsfov3UWTg==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "9.0.1", - "@cspell/cspell-pipe": "9.0.1", - "@cspell/cspell-types": "9.0.1", - "@cspell/dynamic-import": "9.0.1", - "@cspell/url": "9.0.1", + "@cspell/cspell-json-reporter": "9.0.2", + "@cspell/cspell-pipe": "9.0.2", + "@cspell/cspell-types": "9.0.2", + "@cspell/dynamic-import": "9.0.2", + "@cspell/url": "9.0.2", "chalk": "^5.4.1", "chalk-template": "^1.1.0", - "commander": "^13.1.0", - "cspell-dictionary": "9.0.1", - "cspell-gitignore": "9.0.1", - "cspell-glob": "9.0.1", - "cspell-io": "9.0.1", - "cspell-lib": "9.0.1", + "commander": "^14.0.0", + "cspell-dictionary": "9.0.2", + "cspell-gitignore": "9.0.2", + "cspell-glob": "9.0.2", + "cspell-io": "9.0.2", + "cspell-lib": "9.0.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", - "semver": "^7.7.1", + "semver": "^7.7.2", "tinyglobby": "^0.2.13" }, "bin": { @@ -654,28 +654,28 @@ } }, "node_modules/cspell-config-lib": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.0.1.tgz", - "integrity": "sha512-hbeyU6cY4NPKh69L4QpBZgGz00f7rLk10xPlCo6MxEmCqSOTuXXvDEUR51d2ED69G+GyFAeZi5VU9IdJ4jhvzQ==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.0.2.tgz", + "integrity": "sha512-8rCmGUEzlytnNeAazvbBdLeUoN18Cct8k6KLePiUS0GglYomSAvcPWsamSk9jeh947m0cu2dhjZPnKQlp11XBA==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.0.1", + "@cspell/cspell-types": "9.0.2", "comment-json": "^4.2.5", - "yaml": "^2.7.1" + "yaml": "^2.8.0" }, "engines": { "node": ">=20" } }, "node_modules/cspell-dictionary": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.0.1.tgz", - "integrity": "sha512-I9gjRpfV4djxN0i2p9OzWIrkjtUaGUyVE9atvRbkHUMeqDUhC2Qt0Mb9tnF8I7qnHeZt+U44vUa9Dg7yrJ+k4Q==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.0.2.tgz", + "integrity": "sha512-u1jLnqu+2IJiGKdUP9LF1/vseOrCh6hUACHZQ8JsCbHC2KU/DL68s4IgS5jDyK5lBcwPOWzQOiTuXQSEardpFQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.0.1", - "@cspell/cspell-types": "9.0.1", - "cspell-trie-lib": "9.0.1", + "@cspell/cspell-pipe": "9.0.2", + "@cspell/cspell-types": "9.0.2", + "cspell-trie-lib": "9.0.2", "fast-equals": "^5.2.2" }, "engines": { @@ -683,14 +683,14 @@ } }, "node_modules/cspell-gitignore": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.0.1.tgz", - "integrity": "sha512-xjgOmeGbHEaeF0erRQ2QXwqxWqGDiI4mu+NjCL7ZHPoAM5y8PEO6IbxVNabIB1xC4QAborbtEQ/8ydDWLJcPoQ==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.0.2.tgz", + "integrity": "sha512-2CXpUYa+mf1I0oMH/V0qzT0zP95IqYzaS9BfEB7AcSmjrvuIgmiGLztUNrG5mMMBAlHk7sfI8gAEMMvr/Q7sTQ==", "license": "MIT", "dependencies": { - "@cspell/url": "9.0.1", - "cspell-glob": "9.0.1", - "cspell-io": "9.0.1" + "@cspell/url": "9.0.2", + "cspell-glob": "9.0.2", + "cspell-io": "9.0.2" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -700,12 +700,12 @@ } }, "node_modules/cspell-glob": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.0.1.tgz", - "integrity": "sha512-dQU/ln6J9Qe31zk1cLJnq/WNAjRrTUig1GG8WA2oK1jHZKY9VbyJLb5DUFnDUx35cI0jdOEnGSCWi8qNjHSc1Q==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.0.2.tgz", + "integrity": "sha512-trTskAU7tw9RpCb+/uPM4zWByZEavHh3SIrjz7Du/ritjZi85O80HItNw5O3ext4zSPfNNLL3kBT7fLLphFHrw==", "license": "MIT", "dependencies": { - "@cspell/url": "9.0.1", + "@cspell/url": "9.0.2", "picomatch": "^4.0.2" }, "engines": { @@ -713,13 +713,13 @@ } }, "node_modules/cspell-grammar": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.0.1.tgz", - "integrity": "sha512-FZ1z1p3pslfotZT/W/VRZjB4S+z0ETrTbNmQ5pGmhdY0nm7Slmg+8nIJluLEjBneBGTJIOcLjYykwS2vI6jzxw==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.0.2.tgz", + "integrity": "sha512-3hrNZJYEgWSaCvH3rpFq43PX9pxdJt60+pFG3CTZAdpcI97DDsrdH3f7a6h8sNAb+pN59JnV2DtWexsAVL6vjA==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.0.1", - "@cspell/cspell-types": "9.0.1" + "@cspell/cspell-pipe": "9.0.2", + "@cspell/cspell-types": "9.0.2" }, "bin": { "cspell-grammar": "bin.mjs" @@ -729,40 +729,40 @@ } }, "node_modules/cspell-io": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.0.1.tgz", - "integrity": "sha512-L5fZY0glVeQb6nmt1WL1wKzZzoHJUkBQ9BGCrwqSXIrjZrYmBNSKixCjo6o9n2keRUwpNjsvZj1TQDKDV+FsXA==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.0.2.tgz", + "integrity": "sha512-TO93FTgQjjp62nAn213885RdyOTsQwdjSHdeYaaNiaTBOBgj2jR8M8bi3+h2imGBlinlYERoVbPF9wghJEK2nw==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "9.0.1", - "@cspell/url": "9.0.1" + "@cspell/cspell-service-bus": "9.0.2", + "@cspell/url": "9.0.2" }, "engines": { "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.0.1.tgz", - "integrity": "sha512-F4vJG6GmAGVAuhgcepO12UtG7yev7Rcfa31MLIyYNTrd5NeORzM+GTHnL970FlEflwYPYjcSTGwkyowQ+ZbmDg==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.0.2.tgz", + "integrity": "sha512-uoPQ0f+umOGUQB/q0H+K/gWfd7xJMaPlt5rXMMTeKIPHLDRBE7lBx4mHVCmgevL+oTNSLpIE5FdqRDbr+Q+Awg==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.0.1", - "@cspell/cspell-pipe": "9.0.1", - "@cspell/cspell-resolver": "9.0.1", - "@cspell/cspell-types": "9.0.1", - "@cspell/dynamic-import": "9.0.1", - "@cspell/filetypes": "9.0.1", - "@cspell/strong-weak-map": "9.0.1", - "@cspell/url": "9.0.1", + "@cspell/cspell-bundled-dicts": "9.0.2", + "@cspell/cspell-pipe": "9.0.2", + "@cspell/cspell-resolver": "9.0.2", + "@cspell/cspell-types": "9.0.2", + "@cspell/dynamic-import": "9.0.2", + "@cspell/filetypes": "9.0.2", + "@cspell/strong-weak-map": "9.0.2", + "@cspell/url": "9.0.2", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "9.0.1", - "cspell-dictionary": "9.0.1", - "cspell-glob": "9.0.1", - "cspell-grammar": "9.0.1", - "cspell-io": "9.0.1", - "cspell-trie-lib": "9.0.1", + "cspell-config-lib": "9.0.2", + "cspell-dictionary": "9.0.2", + "cspell-glob": "9.0.2", + "cspell-grammar": "9.0.2", + "cspell-io": "9.0.2", + "cspell-trie-lib": "9.0.2", "env-paths": "^3.0.0", "fast-equals": "^5.2.2", "gensequence": "^7.0.0", @@ -777,13 +777,13 @@ } }, "node_modules/cspell-trie-lib": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.0.1.tgz", - "integrity": "sha512-gIupiHwLdsQun79biJgiqmXffKUGzFjGLFEeVptI2Zy5Oa3XhRJsHap4PyeleErONkpzxMG1tgpOWzhOqwl65Q==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.0.2.tgz", + "integrity": "sha512-inXu6YEoJFLYnxgcXy3quCoGgSWYRye1kM4dj8kbYtNAQgUVD93hPFdmPWObwhVawsS3rQybckG3DSnmxBe9Fg==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.0.1", - "@cspell/cspell-types": "9.0.1", + "@cspell/cspell-pipe": "9.0.2", + "@cspell/cspell-types": "9.0.2", "gensequence": "^7.0.0" }, "engines": { @@ -1017,9 +1017,9 @@ } }, "node_modules/semver": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", - "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -1069,15 +1069,15 @@ } }, "node_modules/yaml": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.1.tgz", - "integrity": "sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", + "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", "license": "ISC", "bin": { "yaml": "bin.mjs" }, "engines": { - "node": ">= 14" + "node": ">= 14.6" } } } diff --git a/package.json b/package.json index 14ff472b1c..4992038dee 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.0.1" + "cspell": "^9.0.2" } } From 68825b152fd6038d7c9272f8c11bb568318cfb39 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 15:59:08 +0000 Subject: [PATCH 620/845] Bump JetBrains/qodana-action from 2024.2 to 2025.1 Bumps [JetBrains/qodana-action](https://github.com/jetbrains/qodana-action) from 2024.2 to 2025.1. - [Release notes](https://github.com/jetbrains/qodana-action/releases) - [Commits](https://github.com/jetbrains/qodana-action/compare/v2024.2...v2025.1) --- updated-dependencies: - dependency-name: JetBrains/qodana-action dependency-version: '2025.1' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index e743e206dc..301d4fdb4e 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2024.2 + uses: JetBrains/qodana-action@v2025.1 with: upload-result: ${{ github.ref_name == 'main' || github.ref_name == 'develop' }} args: --baseline,qodana.sarif.json,--ide,QDNET From 58a620e2b843b7ce95a7a611f69b30d2ae7ace67 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Fri, 30 May 2025 17:17:01 +0200 Subject: [PATCH 621/845] Fix qodana warnings --- .../Collections/GenericCollectionAssertions.cs | 2 -- Src/FluentAssertions/Formatting/LineCollection.cs | 1 - .../Primitives/StringWildcardMatchingStrategy.cs | 2 -- Src/FluentAssertions/Streams/BufferedStreamAssertions.cs | 4 +++- Tests/FluentAssertions.Specs/Xml/XmlNodeFormatterSpecs.cs | 3 +-- 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index 908a8bfad4..43de5f4a8d 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -3050,8 +3050,6 @@ public AndConstraint AllSatisfy(Action expected, [StringSyntax(" chain => chain .FailWithPreFormatted(failureMessage)); } - - return new AndConstraint((TAssertions)this); } return new AndConstraint((TAssertions)this); diff --git a/Src/FluentAssertions/Formatting/LineCollection.cs b/Src/FluentAssertions/Formatting/LineCollection.cs index ec07978a17..7abde5c7cd 100644 --- a/Src/FluentAssertions/Formatting/LineCollection.cs +++ b/Src/FluentAssertions/Formatting/LineCollection.cs @@ -1,4 +1,3 @@ -using System; using System.Collections; using System.Collections.Generic; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs b/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs index d545ce52a0..ce93197ef5 100644 --- a/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Text; using System.Text.RegularExpressions; using FluentAssertions.Common; diff --git a/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs b/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs index 58b5d20955..1073684a4c 100644 --- a/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs +++ b/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs @@ -1,7 +1,9 @@ using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.IO; using FluentAssertions.Execution; +#if NET6_0_OR_GREATER || NETSTANDARD2_1 +using System.Diagnostics.CodeAnalysis; +#endif namespace FluentAssertions.Streams; diff --git a/Tests/FluentAssertions.Specs/Xml/XmlNodeFormatterSpecs.cs b/Tests/FluentAssertions.Specs/Xml/XmlNodeFormatterSpecs.cs index 9f2ea3fc86..2cbc17d949 100644 --- a/Tests/FluentAssertions.Specs/Xml/XmlNodeFormatterSpecs.cs +++ b/Tests/FluentAssertions.Specs/Xml/XmlNodeFormatterSpecs.cs @@ -1,5 +1,4 @@ -using System; -using System.Xml; +using System.Xml; using FluentAssertions.Formatting; using Xunit; From 45cd650ba458a7fb627d62168e0854d9c61e1135 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Fri, 30 May 2025 17:45:14 +0200 Subject: [PATCH 622/845] Remove default argument from string.Split It's a leftover from 0a649cb006744405050f0a72ad48442831b3c8cd that added polyfill for `string.Split(string separator, StringSplitOptions options = StringSplitOptions.None)`. Before that commit we used the `string[] separator` overload which requires `StringSplitOptions` --- Src/FluentAssertions/Formatting/XElementValueFormatter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/FluentAssertions/Formatting/XElementValueFormatter.cs b/Src/FluentAssertions/Formatting/XElementValueFormatter.cs index 953fea7476..3d34495f38 100644 --- a/Src/FluentAssertions/Formatting/XElementValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/XElementValueFormatter.cs @@ -48,6 +48,6 @@ private static string FormatElementWithChildren(XElement element) private static string[] SplitIntoSeparateLines(XElement element) { string formattedXml = element.ToString(); - return formattedXml.Split(Environment.NewLine, StringSplitOptions.None); + return formattedXml.Split(Environment.NewLine); } } From f986068750e04cf3b4d60166dd07d60e812c59e1 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Mon, 2 Jun 2025 20:26:01 +0200 Subject: [PATCH 623/845] Added the Contributor License Grant to the PR template --- .github/PULL_REQUEST_TEMPLATE.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 04e2a43489..8497d08c65 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -10,3 +10,14 @@ * [ ] If the PR changes the public API the changes needs to be included by running [AcceptApiChanges.ps1](../tree/develop/AcceptApiChanges.ps1) or [AcceptApiChanges.sh](../tree/develop/AcceptApiChanges.sh). * [ ] If the PR affects [the documentation](../tree/develop/docs/_pages), please include your changes in this pull request so the documentation will appear on the [website](https://www.fluentassertions.com/introduction). * [ ] Please also run `./build.sh --target spellcheck` or `.\build.ps1 --target spellcheck` before pushing and check the good outcome + +## CONTRIBUTOR LICENSE GRANT + +By submitting this contribution, the contributor hereby irrevocably grants to the project owners and maintainers a perpetual, worldwide, royalty-free, irrevocable license to use, reproduce, modify, distribute, sublicense, and create derivative works of the contribution for any purpose and under any terms, including proprietary licensing. + +The contributor waives any moral rights in the contribution to the extent permitted by law and agrees not to assert any claim of authorship or control over the contribution. The contributor represents that they are the sole author of the contribution and that it is provided free of any third-party claims. + +The contributor understands and agrees that the maintainers may, at their sole discretion, use, license, or redistribute the contribution as part of any work and under any terms they choose, without further permission or attribution. + +* [ ] I have read the Contributor License Grant and accept the conditions +* [ ] I'm interested in a free license for Fluent Assertions and will share my email address through sales@xceed.com \ No newline at end of file From 6875868e176633184e7704a3e81fa0a0e39304f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 16:29:30 +0000 Subject: [PATCH 624/845] Bump cspell from 9.0.2 to 9.1.1 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 9.0.2 to 9.1.1. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.1.1/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.1.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 293 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 148 insertions(+), 147 deletions(-) diff --git a/package-lock.json b/package-lock.json index a1206c0df7..2321e9b679 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.0.2" + "cspell": "^9.1.1" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.0.2.tgz", - "integrity": "sha512-gGFSfVIvYtO95O3Yhcd1o0sOZHjVaCPwYq3MnaNsBBzaMviIZli4FZW9Z+XNKsgo1zRzbl2SdOXJPP0VcyAY0A==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.1.1.tgz", + "integrity": "sha512-AbaIez18Puo9SbnhYsZnzG90ohelWWFQVbEIdtwMmRRItoIevF8wcNkQrFeFCXINs+FZH+aDGkt7oA1dwKgJFA==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.0", @@ -31,33 +31,33 @@ "@cspell/dict-docker": "^1.1.14", "@cspell/dict-dotnet": "^5.0.9", "@cspell/dict-elixir": "^4.0.7", - "@cspell/dict-en_us": "^4.4.8", - "@cspell/dict-en-common-misspellings": "^2.0.11", - "@cspell/dict-en-gb-mit": "^3.0.6", + "@cspell/dict-en_us": "^4.4.11", + "@cspell/dict-en-common-misspellings": "^2.1.1", + "@cspell/dict-en-gb-mit": "^3.1.1", "@cspell/dict-filetypes": "^3.0.12", "@cspell/dict-flutter": "^1.1.0", "@cspell/dict-fonts": "^4.0.4", "@cspell/dict-fsharp": "^1.1.0", "@cspell/dict-fullstack": "^3.2.6", "@cspell/dict-gaming-terms": "^1.1.1", - "@cspell/dict-git": "^3.0.5", - "@cspell/dict-golang": "^6.0.21", + "@cspell/dict-git": "^3.0.6", + "@cspell/dict-golang": "^6.0.22", "@cspell/dict-google": "^1.0.8", "@cspell/dict-haskell": "^4.0.5", "@cspell/dict-html": "^4.0.11", "@cspell/dict-html-symbol-entities": "^4.0.3", "@cspell/dict-java": "^5.0.11", "@cspell/dict-julia": "^1.1.0", - "@cspell/dict-k8s": "^1.0.10", + "@cspell/dict-k8s": "^1.0.11", "@cspell/dict-kotlin": "^1.1.0", "@cspell/dict-latex": "^4.0.3", "@cspell/dict-lorem-ipsum": "^4.0.4", "@cspell/dict-lua": "^4.0.7", "@cspell/dict-makefile": "^1.0.4", - "@cspell/dict-markdown": "^2.0.10", + "@cspell/dict-markdown": "^2.0.11", "@cspell/dict-monkeyc": "^1.0.10", "@cspell/dict-node": "^5.0.7", - "@cspell/dict-npm": "^5.2.3", + "@cspell/dict-npm": "^5.2.6", "@cspell/dict-php": "^4.0.14", "@cspell/dict-powershell": "^5.0.14", "@cspell/dict-public-licenses": "^2.0.13", @@ -67,12 +67,12 @@ "@cspell/dict-rust": "^4.0.11", "@cspell/dict-scala": "^5.0.7", "@cspell/dict-shell": "^1.1.0", - "@cspell/dict-software-terms": "^5.0.9", + "@cspell/dict-software-terms": "^5.1.0", "@cspell/dict-sql": "^2.2.0", "@cspell/dict-svelte": "^1.0.6", "@cspell/dict-swift": "^2.0.5", "@cspell/dict-terraform": "^1.1.1", - "@cspell/dict-typescript": "^3.2.1", + "@cspell/dict-typescript": "^3.2.2", "@cspell/dict-vue": "^3.0.4" }, "engines": { @@ -80,30 +80,30 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.0.2.tgz", - "integrity": "sha512-Hy9hKG53cFhLwiSZuRVAd5YfBb5pPj3V2Val69TW1j4+sy3podewqm4sb3RqoB01LcDkLI/mOeMwHz1xyIjfoA==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.1.1.tgz", + "integrity": "sha512-bvbBXr77yz0xu/6GckWMWoUyjSL5MqF86y7g0DkGnNpB5Bu5fCNAltR5yNo1xlBCtbUwB0zrlPENSSxRmNpPCA==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.0.2" + "@cspell/cspell-types": "9.1.1" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-pipe": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.0.2.tgz", - "integrity": "sha512-M1e+u3dyGCJicSZ16xmoVut4pI8ynfqILYiDAYC9+rbn04wJdnWD46ElIZnRriFXx7fu/UsUEexu3lFaqKVGEg==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.1.1.tgz", + "integrity": "sha512-WFh6+Fig//8Ev8mxBHjKiKhYfJHez5JyI2ioWBgh16EL08k5kfqIsANX8/ij+k0QvfObA4J4LRJ6RUoExvD+4g==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.0.2.tgz", - "integrity": "sha512-JkMQb+hcEyZ2ALvEeJvfxoIblRpZlnek50Ew5sLSSZciRuhNvQZS5+Apwt1GXHitTo8/bqXFxABNP36O++YAwA==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.1.1.tgz", + "integrity": "sha512-nnHE6ZA4tGA0jU1Yco6OuXUwPvFqHrWqMwvbmOHRLPZRLrtbqKUQGxUuSHlM3aGLHBfaPZSZqBl5rvGyj2EX1Q==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" @@ -113,18 +113,18 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.0.2.tgz", - "integrity": "sha512-OjfZ3vnBjmkctC9xs/87/9bx/3kZYUPJkWsZxzfH4rla/HeIUrm9UZlDqCibhWifhPHrDdV9hDW5QEGXkYR2hw==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.1.1.tgz", + "integrity": "sha512-0eFZe4dsEaETsNsqcFilWwfi2VRHRxldSkNZFGXf/QbamSK89VNf0X/q9CtAU90PVgJAzYevV2r6uyWX2poZpQ==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.0.2.tgz", - "integrity": "sha512-RioULo34qbUXuCCLi/DCDxdb++Nm1ospNXzVkKZrSvTG4AjkC95ZhfIOp9jbGSWqL2PGdaHVXgG77EyQbAk5xA==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.1.1.tgz", + "integrity": "sha512-xouQmxgAuEz+jnmyzQV6LoAKzwTt/wF1xjRgVW1ssMFDlRGPtvEOmfk3yk79Ror0AnHmA5O1xXpFQ/VgFU56MQ==", "license": "MIT", "engines": { "node": ">=20" @@ -224,21 +224,21 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.4.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.9.tgz", - "integrity": "sha512-5gjqpUwhE+qP9A9wxD1+MGGJ3DNqTgSpiOsS10cGJfV4p/Z194XkDUZrUrJsnJA/3fsCZHAzcNWh8m0bw1v++A==", + "version": "4.4.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.11.tgz", + "integrity": "sha512-ls3ASwIL0uuAEXsxB7NsIe6GRBQ+NZfqI5k1qtNgOZ1eh1MFYjCiF+YcqArH5SFHNzOwCHRKzlLeX0ZFIok7GQ==", "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.0.11.tgz", - "integrity": "sha512-xFQjeg0wFHh9sFhshpJ+5BzWR1m9Vu8pD0CGPkwZLK9oii8AD8RXNchabLKy/O5VTLwyqPOi9qpyp1cxm3US4Q==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.1.tgz", + "integrity": "sha512-6m2EEm4WUgsNzFzz/2boeOVrZenYQRaDXFtDNcaQK5Ly4A37HTRPm8uVvE8cAlACVk+HBHhH/4e7ebxdXwId9w==", "license": "CC BY-SA 4.0" }, "node_modules/@cspell/dict-en-gb-mit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.0.7.tgz", - "integrity": "sha512-fdZbu4jbkzjjTO0jPBGINwQwzNFGapMnhH9D4mDa4UzGGyQFVRx6n/FFwxnfs7CXbuCV6UFSwjHZEAB8pfWn0A==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.1.tgz", + "integrity": "sha512-sZbuOPlAGDwudoquXjaSA+TbJEzfG0MkUeF4Iz3tdL9xOYDb6lgueNVnDJfBrw6jrKKDdOI68MJqiLjW4uth8A==", "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { @@ -278,15 +278,15 @@ "license": "MIT" }, "node_modules/@cspell/dict-git": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.5.tgz", - "integrity": "sha512-I7l86J2nOcpBY0OcwXLTGMbcXbEE7nxZme9DmYKrNgmt35fcLu+WKaiXW7P29V+lIXjJo/wKrEDY+wUEwVuABQ==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.6.tgz", + "integrity": "sha512-nazfOqyxlBOQGgcur9ssEOEQCEZkH8vXfQe8SDEx8sCN/g0SFm8ktabgLVmBOXjy3RzjVNLlM2nBfRQ7e6+5hQ==", "license": "MIT" }, "node_modules/@cspell/dict-golang": { - "version": "6.0.21", - "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.21.tgz", - "integrity": "sha512-D3wG1MWhFx54ySFJ00CS1MVjR4UiBVsOWGIjJ5Av+HamnguqEshxbF9mvy+BX0KqzdLVzwFkoLBs8QeOID56HA==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.22.tgz", + "integrity": "sha512-FvV0m3Y0nUFxw36uDCD8UtfOPv4wsZnnlabNwB3xNZ2IBn0gBURuMUZywScb9sd2wXM8VFBRoU//tc6NQsOVOg==", "license": "MIT" }, "node_modules/@cspell/dict-google": { @@ -326,9 +326,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-k8s": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.10.tgz", - "integrity": "sha512-313haTrX9prep1yWO7N6Xw4D6tvUJ0Xsx+YhCP+5YrrcIKoEw5Rtlg8R4PPzLqe6zibw6aJ+Eqq+y76Vx5BZkw==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.11.tgz", + "integrity": "sha512-8ojNwB5j4PfZ1Gq9n5c/HKJCtZD3h6+wFy+zpALpDWFFQ2qT22Be30+3PVd+G5gng8or0LeK8VgKKd0l1uKPTA==", "license": "MIT" }, "node_modules/@cspell/dict-kotlin": { @@ -362,15 +362,15 @@ "license": "MIT" }, "node_modules/@cspell/dict-markdown": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.10.tgz", - "integrity": "sha512-vtVa6L/84F9sTjclTYDkWJF/Vx2c5xzxBKkQp+CEFlxOF2SYgm+RSoEvAvg5vj4N5kuqR4350ZlY3zl2eA3MXw==", + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.11.tgz", + "integrity": "sha512-stZieFKJyMQbzKTVoalSx2QqCpB0j8nPJF/5x+sBnDIWgMC65jp8Wil+jccWh9/vnUVukP3Ejewven5NC7SWuQ==", "license": "MIT", "peerDependencies": { "@cspell/dict-css": "^4.0.17", "@cspell/dict-html": "^4.0.11", "@cspell/dict-html-symbol-entities": "^4.0.3", - "@cspell/dict-typescript": "^3.2.1" + "@cspell/dict-typescript": "^3.2.2" } }, "node_modules/@cspell/dict-monkeyc": { @@ -386,9 +386,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.4.tgz", - "integrity": "sha512-/hK5ii9OzSOQkmTjkzJlEYWz+PBnz2hRq5Xu7d4aDURaynO9xMAcK31JJlKNQulBkVbQHxFZLUrzjdzdAr/Opw==", + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.6.tgz", + "integrity": "sha512-VGEY1ZjE8c8JCA+dic1IdYmVTNfVtWAw7V2n4TXO1+mKfRL+BsPsqEoH8iR0OMutC9QXjVNh32rzMh4D3E+Lxw==", "license": "MIT" }, "node_modules/@cspell/dict-php": { @@ -449,9 +449,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.0.10.tgz", - "integrity": "sha512-2nTcVKTYJKU5GzeviXGPtRRC9d23MtfpD4PM4pLSzl29/5nx5MxOUHkzPuJdyaw9mXIz8Rm9IlGeVAvQoTI8aw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.0.tgz", + "integrity": "sha512-8zsOVzcHpb4PAaKtOWAIJRbpaNINaUZRsHzqFb3K9hQIC6hxmet/avLlCeKdnmBVZkn3TmRN5caxTJamJvbXww==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -479,9 +479,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-typescript": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.2.1.tgz", - "integrity": "sha512-jdnKg4rBl75GUBTsUD6nTJl7FGvaIt5wWcWP7TZSC3rV1LfkwvbUiY3PiGpfJlAIdnLYSeFWIpYU9gyVgz206w==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.2.2.tgz", + "integrity": "sha512-H9Y+uUHsTIDFO/jdfUAcqmcd5osT+2DB5b0aRCHfLWN/twUbGn/1qq3b7YwEvttxKlYzWHU3uNFf+KfA93VY7w==", "license": "MIT" }, "node_modules/@cspell/dict-vue": { @@ -491,12 +491,12 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.0.2.tgz", - "integrity": "sha512-KhcoNUj6Ij2P8fbRC7QOn3jzbTZFxoQpFGanGU9f+4DfZBH86PCADyKYH+ZpJPlYgrI+Jh4wKzF5y5YKKNrdrw==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.1.1.tgz", + "integrity": "sha512-jcg5Wti4kcPh4Deds009MEZvuN3tViUft079MTsdSpNPNhRf/gKwSIQnkda9g4ppsVPh5mxkE0nUZLxfZRZYMg==", "license": "MIT", "dependencies": { - "@cspell/url": "9.0.2", + "@cspell/url": "9.1.1", "import-meta-resolve": "^4.1.0" }, "engines": { @@ -504,27 +504,27 @@ } }, "node_modules/@cspell/filetypes": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.0.2.tgz", - "integrity": "sha512-8KEIgptldoZT3pM+yhYV8nXq5T9Sz0YvZIqwDGEqKJ6j447K+I91QWS7RQDrvHkElMi/2g/h08Efg0RIT+QEaQ==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.1.1.tgz", + "integrity": "sha512-kQ1mD+hPxh8KRbDtPvCb6nuODwJV26W43sC77I5Vpk+IDXZqxEhkTCXB6OefnfplOl6+wU0e/EAw+7XYtlKjfg==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/strong-weak-map": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.0.2.tgz", - "integrity": "sha512-SHTPUcu2e6aYxI5sr1L/9pzz68CArV6WzMvAio//5LbtKI6NtDp/7tARBwLi1G3A3C0289zDHbDKm3wc1lRNhQ==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.1.1.tgz", + "integrity": "sha512-D9dDws2MmE24zxkT9TcxYzOAiZncllgcfAGVswklM+dpQeHyZgRDPpdjVhz+nrYrwVwTbdWlRNJ9RiwzRN+jpA==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.0.2.tgz", - "integrity": "sha512-KwCDL0ejgwVSZB8KTp8FhDe42UOaebTVIMi3O5GcYHi9Cut8B5QU4tbQOFGXP6E4pjimeO9yIkr9Z34kTljj/g==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.1.1.tgz", + "integrity": "sha512-/RL/QTcaFBr0UGl6uLc9d2kPCEpqWHmBs8uFRnBottJ3I5tMOiaVtkEKFTx5FIxrlWTjZwW3rWaIUspNX5ejUw==", "license": "MIT", "engines": { "node": ">=20" @@ -619,28 +619,29 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.0.2.tgz", - "integrity": "sha512-VwPNTTivvv/NyovXUMcTYc7BaOgun7k8FhRWaVKxZPEsl/9r9WTLmQ1dNbHRq56LajH2b7wKGQYuRsfov3UWTg==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.1.1.tgz", + "integrity": "sha512-srPIS39EzbgRLncBIbsJy3GzYWxrSm0mbXj24XLxZgVBjMps+/uxpVo0aXEFy4JClUSNBoYxhCb+vSHZUoqu3w==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "9.0.2", - "@cspell/cspell-pipe": "9.0.2", - "@cspell/cspell-types": "9.0.2", - "@cspell/dynamic-import": "9.0.2", - "@cspell/url": "9.0.2", + "@cspell/cspell-json-reporter": "9.1.1", + "@cspell/cspell-pipe": "9.1.1", + "@cspell/cspell-types": "9.1.1", + "@cspell/dynamic-import": "9.1.1", + "@cspell/url": "9.1.1", "chalk": "^5.4.1", "chalk-template": "^1.1.0", "commander": "^14.0.0", - "cspell-dictionary": "9.0.2", - "cspell-gitignore": "9.0.2", - "cspell-glob": "9.0.2", - "cspell-io": "9.0.2", - "cspell-lib": "9.0.2", + "cspell-config-lib": "9.1.1", + "cspell-dictionary": "9.1.1", + "cspell-gitignore": "9.1.1", + "cspell-glob": "9.1.1", + "cspell-io": "9.1.1", + "cspell-lib": "9.1.1", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "semver": "^7.7.2", - "tinyglobby": "^0.2.13" + "tinyglobby": "^0.2.14" }, "bin": { "cspell": "bin.mjs", @@ -654,12 +655,12 @@ } }, "node_modules/cspell-config-lib": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.0.2.tgz", - "integrity": "sha512-8rCmGUEzlytnNeAazvbBdLeUoN18Cct8k6KLePiUS0GglYomSAvcPWsamSk9jeh947m0cu2dhjZPnKQlp11XBA==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.1.1.tgz", + "integrity": "sha512-fi/ohH5mIeba416Jl0DREm+A4QssC3OCY8wjze7hAZ9lOzFuuBmyjoo5OD/J48stkCt1pf2TIAAU3up5o/oaBw==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.0.2", + "@cspell/cspell-types": "9.1.1", "comment-json": "^4.2.5", "yaml": "^2.8.0" }, @@ -668,14 +669,14 @@ } }, "node_modules/cspell-dictionary": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.0.2.tgz", - "integrity": "sha512-u1jLnqu+2IJiGKdUP9LF1/vseOrCh6hUACHZQ8JsCbHC2KU/DL68s4IgS5jDyK5lBcwPOWzQOiTuXQSEardpFQ==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.1.1.tgz", + "integrity": "sha512-VobPhTE/+hMsI5qppKsuljdDkG23av16bNRBR0hA0O/pG07SXZ6nzwWIwdPoKSjiWSGTmmCGXv45W0sn20ahbA==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.0.2", - "@cspell/cspell-types": "9.0.2", - "cspell-trie-lib": "9.0.2", + "@cspell/cspell-pipe": "9.1.1", + "@cspell/cspell-types": "9.1.1", + "cspell-trie-lib": "9.1.1", "fast-equals": "^5.2.2" }, "engines": { @@ -683,14 +684,14 @@ } }, "node_modules/cspell-gitignore": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.0.2.tgz", - "integrity": "sha512-2CXpUYa+mf1I0oMH/V0qzT0zP95IqYzaS9BfEB7AcSmjrvuIgmiGLztUNrG5mMMBAlHk7sfI8gAEMMvr/Q7sTQ==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.1.1.tgz", + "integrity": "sha512-8gx61lyxdAMLulL7Mtb10jOBzL/e3rU34YW0kaTT3LkHBb/LGapmOFKRiJyt2bA/UA6kJkR/wPLmsjUfRJwOmA==", "license": "MIT", "dependencies": { - "@cspell/url": "9.0.2", - "cspell-glob": "9.0.2", - "cspell-io": "9.0.2" + "@cspell/url": "9.1.1", + "cspell-glob": "9.1.1", + "cspell-io": "9.1.1" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -700,12 +701,12 @@ } }, "node_modules/cspell-glob": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.0.2.tgz", - "integrity": "sha512-trTskAU7tw9RpCb+/uPM4zWByZEavHh3SIrjz7Du/ritjZi85O80HItNw5O3ext4zSPfNNLL3kBT7fLLphFHrw==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.1.1.tgz", + "integrity": "sha512-f274mlln/QG/wj12xF/SnvfdUAx0pGjIxnNOYGwRXS1MbaH0B4F9pkhkMqY0GwqAsvPxT6NzJybAoivS4Icvzg==", "license": "MIT", "dependencies": { - "@cspell/url": "9.0.2", + "@cspell/url": "9.1.1", "picomatch": "^4.0.2" }, "engines": { @@ -713,13 +714,13 @@ } }, "node_modules/cspell-grammar": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.0.2.tgz", - "integrity": "sha512-3hrNZJYEgWSaCvH3rpFq43PX9pxdJt60+pFG3CTZAdpcI97DDsrdH3f7a6h8sNAb+pN59JnV2DtWexsAVL6vjA==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.1.1.tgz", + "integrity": "sha512-IBOOzmj1z4IWHSis6iGZNbE0syEiT0Rz4NbbHwscCMc30jgbotupscn6T8PhqmDwmlXCW81C4vGSMzqQh0UaLQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.0.2", - "@cspell/cspell-types": "9.0.2" + "@cspell/cspell-pipe": "9.1.1", + "@cspell/cspell-types": "9.1.1" }, "bin": { "cspell-grammar": "bin.mjs" @@ -729,40 +730,40 @@ } }, "node_modules/cspell-io": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.0.2.tgz", - "integrity": "sha512-TO93FTgQjjp62nAn213885RdyOTsQwdjSHdeYaaNiaTBOBgj2jR8M8bi3+h2imGBlinlYERoVbPF9wghJEK2nw==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.1.1.tgz", + "integrity": "sha512-LMzoBvbWqVokrkrnLrdnCzX8Sf77Q42nvj7Q36G4sqZaB3Lr/ih+iZ4t5l90Wlsnst5flrQmIy0YNtndAWzp2A==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "9.0.2", - "@cspell/url": "9.0.2" + "@cspell/cspell-service-bus": "9.1.1", + "@cspell/url": "9.1.1" }, "engines": { "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.0.2.tgz", - "integrity": "sha512-uoPQ0f+umOGUQB/q0H+K/gWfd7xJMaPlt5rXMMTeKIPHLDRBE7lBx4mHVCmgevL+oTNSLpIE5FdqRDbr+Q+Awg==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.1.1.tgz", + "integrity": "sha512-On2m0/UFtsKenEHTfvNA5EoKI5YcnOzgGQF3yX4CllvtGQXCewB5U1TBCqTR/0wckw5q94iqZJDF2oY3GBGBAg==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.0.2", - "@cspell/cspell-pipe": "9.0.2", - "@cspell/cspell-resolver": "9.0.2", - "@cspell/cspell-types": "9.0.2", - "@cspell/dynamic-import": "9.0.2", - "@cspell/filetypes": "9.0.2", - "@cspell/strong-weak-map": "9.0.2", - "@cspell/url": "9.0.2", + "@cspell/cspell-bundled-dicts": "9.1.1", + "@cspell/cspell-pipe": "9.1.1", + "@cspell/cspell-resolver": "9.1.1", + "@cspell/cspell-types": "9.1.1", + "@cspell/dynamic-import": "9.1.1", + "@cspell/filetypes": "9.1.1", + "@cspell/strong-weak-map": "9.1.1", + "@cspell/url": "9.1.1", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "9.0.2", - "cspell-dictionary": "9.0.2", - "cspell-glob": "9.0.2", - "cspell-grammar": "9.0.2", - "cspell-io": "9.0.2", - "cspell-trie-lib": "9.0.2", + "cspell-config-lib": "9.1.1", + "cspell-dictionary": "9.1.1", + "cspell-glob": "9.1.1", + "cspell-grammar": "9.1.1", + "cspell-io": "9.1.1", + "cspell-trie-lib": "9.1.1", "env-paths": "^3.0.0", "fast-equals": "^5.2.2", "gensequence": "^7.0.0", @@ -777,13 +778,13 @@ } }, "node_modules/cspell-trie-lib": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.0.2.tgz", - "integrity": "sha512-inXu6YEoJFLYnxgcXy3quCoGgSWYRye1kM4dj8kbYtNAQgUVD93hPFdmPWObwhVawsS3rQybckG3DSnmxBe9Fg==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.1.1.tgz", + "integrity": "sha512-eULMGTTbvmuOWpAM34wodpbAM3dXscLL26WOn9/9uyQJ36dZ0u8B+ctrYf17Ij/wcpGzLqwTNspJN2fkbiXkBQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.0.2", - "@cspell/cspell-types": "9.0.2", + "@cspell/cspell-pipe": "9.1.1", + "@cspell/cspell-types": "9.1.1", "gensequence": "^7.0.0" }, "engines": { @@ -831,9 +832,9 @@ "license": "MIT" }, "node_modules/fdir": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", - "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", + "version": "6.4.6", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.6.tgz", + "integrity": "sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==", "license": "MIT", "peerDependencies": { "picomatch": "^3 || ^4" @@ -1029,9 +1030,9 @@ } }, "node_modules/tinyglobby": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz", - "integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==", + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", + "integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==", "license": "MIT", "dependencies": { "fdir": "^6.4.4", diff --git a/package.json b/package.json index 4992038dee..28e338fe7f 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.0.2" + "cspell": "^9.1.1" } } From 7928d551ec2615a98b19d51161e374641ecd4fb0 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Fri, 20 Jun 2025 18:27:17 +0200 Subject: [PATCH 625/845] Allow excluding properties by name anywhere in the graph --- .../ExcludeMembersByNameSelectionRule.cs | 38 +++++++ .../SelfReferenceEquivalencyOptions.cs | 14 +++ .../FluentAssertions/net47.verified.txt | 1 + .../FluentAssertions/net6.0.verified.txt | 1 + .../netstandard2.0.verified.txt | 1 + .../netstandard2.1.verified.txt | 1 + .../SelectionRulesSpecs.Excluding.cs | 105 +++++++++++++++++- docs/_pages/objectgraphs.md | 7 ++ docs/_pages/releases.md | 6 + 9 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 Src/FluentAssertions/Equivalency/Selection/ExcludeMembersByNameSelectionRule.cs diff --git a/Src/FluentAssertions/Equivalency/Selection/ExcludeMembersByNameSelectionRule.cs b/Src/FluentAssertions/Equivalency/Selection/ExcludeMembersByNameSelectionRule.cs new file mode 100644 index 0000000000..d9ff233fc6 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Selection/ExcludeMembersByNameSelectionRule.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using System.Linq; + +namespace FluentAssertions.Equivalency.Selection; + +/// +/// Represents a member selection rule that excludes certain fields or properties from being considered during +/// structural equality checks based on their names. +/// +internal class ExcludeMembersByNameSelectionRule : IMemberSelectionRule +{ + private readonly string[] membersToExclude; + private readonly string description; + + /// + /// Initializes the rule with a list of filed or property names to exclude from the structural equality check. + /// + public ExcludeMembersByNameSelectionRule(string[] membersToExclude) + { + this.membersToExclude = membersToExclude; + description = string.Join(", ", membersToExclude); + } + + public bool IncludesMembers => false; + + public IEnumerable SelectMembers(INode currentNode, IEnumerable selectedMembers, + MemberSelectionContext context) + { + return selectedMembers.Where(m => !membersToExclude.Contains(m.Expectation.Name)).ToArray(); + } + + /// + /// 2 + public override string ToString() + { + return "Exclude members named: " + description; + } +} diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index be199b415d..5bf49e5958 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -275,6 +275,7 @@ public TSelf IncludingProperties() { includedProperties = MemberVisibility.Public | MemberVisibility.ExplicitlyImplemented | MemberVisibility.DefaultInterfaceProperties; + return (TSelf)this; } @@ -285,6 +286,7 @@ public TSelf IncludingInternalProperties() { includedProperties = MemberVisibility.Public | MemberVisibility.Internal | MemberVisibility.ExplicitlyImplemented | MemberVisibility.DefaultInterfaceProperties; + return (TSelf)this; } @@ -300,6 +302,18 @@ public TSelf ExcludingProperties() return (TSelf)this; } + /// + /// Excludes the specified member(s) from the structural equality check anywhere in the object graph. + /// + public TSelf ExcludingMembersNamed(params string[] memberNames) + { + Guard.ThrowIfArgumentIsNull(memberNames, nameof(memberNames), "Member names cannot be null."); + Guard.ThrowIfArgumentIsEmpty(memberNames, nameof(memberNames), "At least one member name must be specified."); + + AddSelectionRule(new ExcludeMembersByNameSelectionRule(memberNames)); + return (TSelf)this; + } + /// /// Excludes properties that are explicitly implemented from the equivalency comparison. /// diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index a27b801a94..6c466132e1 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -911,6 +911,7 @@ namespace FluentAssertions.Equivalency public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } public TSelf ExcludingExplicitlyImplementedProperties() { } public TSelf ExcludingFields() { } + public TSelf ExcludingMembersNamed(params string[] memberNames) { } public TSelf ExcludingMissingMembers() { } public TSelf ExcludingNonBrowsableMembers() { } public TSelf ExcludingProperties() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 399891910b..58bd68268e 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -924,6 +924,7 @@ namespace FluentAssertions.Equivalency public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } public TSelf ExcludingExplicitlyImplementedProperties() { } public TSelf ExcludingFields() { } + public TSelf ExcludingMembersNamed(params string[] memberNames) { } public TSelf ExcludingMissingMembers() { } public TSelf ExcludingNonBrowsableMembers() { } public TSelf ExcludingProperties() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index acbf851e37..d7fcbae1e8 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -903,6 +903,7 @@ namespace FluentAssertions.Equivalency public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } public TSelf ExcludingExplicitlyImplementedProperties() { } public TSelf ExcludingFields() { } + public TSelf ExcludingMembersNamed(params string[] memberNames) { } public TSelf ExcludingMissingMembers() { } public TSelf ExcludingNonBrowsableMembers() { } public TSelf ExcludingProperties() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 44fb44ddd2..572d0840c1 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -911,6 +911,7 @@ namespace FluentAssertions.Equivalency public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } public TSelf ExcludingExplicitlyImplementedProperties() { } public TSelf ExcludingFields() { } + public TSelf ExcludingMembersNamed(params string[] memberNames) { } public TSelf ExcludingMissingMembers() { } public TSelf ExcludingNonBrowsableMembers() { } public TSelf ExcludingProperties() { } diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs index 3413bcf743..44b8686a82 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs @@ -685,7 +685,8 @@ public void Abstract_properties_cannot_be_excluded() Action act = () => obj1.Should().BeEquivalentTo(obj2, opt => opt .Excluding(o => o.AbstractProperty + "B")); - act.Should().Throw().WithMessage("*(o.AbstractProperty + \"B\")*cannot be used to select a member*"); + act.Should().Throw() + .WithMessage("*(o.AbstractProperty + \"B\")*cannot be used to select a member*"); } #if NETCOREAPP3_0_OR_GREATER @@ -1156,5 +1157,107 @@ public void An_empty_anonymous_object_excludes_nothing_inside_collections() // Assert act.Should().Throw().WithMessage("*Pets[1].Name*Pets[1].Age*"); } + + [Fact] + public void Can_exclude_root_properties_by_name() + { + // Arrange + var subject = new + { + FirstName = "John", + LastName = "Doe", + Age = 30 + }; + + var expectation = new + { + FirstName = "John", + LastName = "Smith", + Age = 35 + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .ExcludingMembersNamed("LastName", "Age")); + } + + [Fact] + public void Can_exclude_properties_deeper_in_the_graph_by_name() + { + // Arrange + var subject = new + { + Person = new + { + FirstName = "John", + LastName = "Doe", + Age = 30 + }, + Address = new + { + Street = "123 Main St", + City = "Anytown", + ZipCode = "12345" + } + }; + + var expectation = new + { + Person = new + { + FirstName = "John", + LastName = "Smith", + Age = 35 + }, + Address = new + { + Street = "123 Main St", + City = "Othertown", + ZipCode = "54321" + } + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .ExcludingMembersNamed("LastName", "Age", "City", "ZipCode")); + } + + [Fact] + public void Must_provide_property_names_when_excluding_by_name() + { + // Arrange + var subject = new + { + FirstName = "John", + LastName = "Doe" + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(subject, options => options + .ExcludingMembersNamed()); + + // Assert + act.Should().Throw() + .WithMessage("*least one*name*"); + } + + [Fact] + public void Cannot_provide_null_as_a_property_name() + { + // Arrange + var subject = new + { + FirstName = "John", + LastName = "Doe" + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(subject, options => options + .ExcludingMembersNamed(null)); + + // Assert + act.Should().Throw() + .WithMessage("*Member names cannot be null*"); + } } } diff --git a/docs/_pages/objectgraphs.md b/docs/_pages/objectgraphs.md index f0756e45f2..04d0776066 100644 --- a/docs/_pages/objectgraphs.md +++ b/docs/_pages/objectgraphs.md @@ -123,6 +123,13 @@ orderDto.Should().BeEquivalentTo(order, options => options .Excluding(ctx => ctx.Path == "Level.Level.Text")); ``` +And if you want to exclude one or more specific properties everywhere in the object graph just by their names, use `ExcludingMembersNamed` like this: + +```csharp +orderDto.Should().BeEquivalentTo(order, options => options + .ExcludingMembersNamed("ID", "Version")); +``` + Maybe far-fetched, but you may even decide to exclude a member on a particular nested object by its index. ```csharp diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index b7013598bb..2e5c3aafd0 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,6 +7,12 @@ sidebar: nav: "sidebar" --- +## 8.4.0 + +## Enhancements + +* Added `ExcludingMembersNamed` to `BeEquivalentTo` to exclude fields and properties anywhere in the graph - [3062](https://github.com/fluentassertions/fluentassertions/pull/3062) + ## 8.3.0 ## Enhancements From cc607f1d3d539f246ddb239cc3decb06d3807d41 Mon Sep 17 00:00:00 2001 From: Xceed-DelvaJB <194259764+Xceed-DelvaJB@users.noreply.github.com> Date: Tue, 24 Jun 2025 02:49:46 -0400 Subject: [PATCH 626/845] =?UTF-8?q?Added=20Should().Throw(),=20ThrowAsync(?= =?UTF-8?q?)=20and=20ThrowWithinAsync()=20flavors=20that=20don=E2=80=99t?= =?UTF-8?q?=20require=20a=20specific=20exception=20type=20(#3059)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Specialized/AsyncFunctionAssertions.cs | 36 +++++++++++++++++++ .../Specialized/DelegateAssertions.cs | 16 +++++++++ .../FluentAssertions/net47.verified.txt | 3 ++ .../FluentAssertions/net6.0.verified.txt | 3 ++ .../netstandard2.0.verified.txt | 3 ++ .../netstandard2.1.verified.txt | 3 ++ .../AsyncFunctionExceptionAssertionSpecs.cs | 30 +++++++++++++++- .../Exceptions/ThrowAssertionsSpecs.cs | 36 +++++++++++++++++-- docs/_pages/releases.md | 3 +- 9 files changed, 128 insertions(+), 5 deletions(-) diff --git a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs index 6f5d0cc81a..6f6d2e8838 100644 --- a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs @@ -112,6 +112,22 @@ public async Task> ThrowExactlyAsync return new ExceptionAssertions([], assertionChain); } + /// + /// Asserts that the current throws any exception. + /// + /// + /// (Optional) 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 async Task> ThrowAsync( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + return await ThrowAsync(because, becauseArgs); + } + /// /// Asserts that the current throws an exception of type . /// @@ -141,6 +157,26 @@ public async Task> ThrowAsync( return new ExceptionAssertions([], assertionChain); } + /// + /// Asserts that the current throws any exception within a specific timeout. + /// + /// + /// The allowed time span for the operation. + /// + /// + /// (Optional) + /// 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 async Task> ThrowWithinAsync(TimeSpan timeSpan, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + return await ThrowWithinAsync(timeSpan, because, becauseArgs); + } + /// /// Asserts that the current throws an exception of type /// within a specific timeout. diff --git a/Src/FluentAssertions/Specialized/DelegateAssertions.cs b/Src/FluentAssertions/Specialized/DelegateAssertions.cs index f10a4b5885..b0586629b8 100644 --- a/Src/FluentAssertions/Specialized/DelegateAssertions.cs +++ b/Src/FluentAssertions/Specialized/DelegateAssertions.cs @@ -30,6 +30,22 @@ private protected DelegateAssertions(TDelegate @delegate, IExtractExceptions ext this.assertionChain = assertionChain; } + /// + /// Asserts that the current throws any exception. + /// + /// + /// (Optional) + /// 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 ExceptionAssertions Throw([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + return Throw(because, becauseArgs); + } + /// /// Asserts that the current throws an exception of type . /// diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 6c466132e1..e54ea43a32 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -2091,10 +2091,12 @@ namespace FluentAssertions.Specialized public System.Threading.Tasks.Task> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) where TException : System.Exception { } + public System.Threading.Tasks.Task> ThrowAsync(string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> ThrowAsync(string because = "", params object[] becauseArgs) where TException : System.Exception { } public System.Threading.Tasks.Task> ThrowExactlyAsync(string because = "", params object[] becauseArgs) where TException : System.Exception { } + public System.Threading.Tasks.Task> ThrowWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> ThrowWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) where TException : System.Exception { } } @@ -2116,6 +2118,7 @@ namespace FluentAssertions.Specialized protected abstract void InvokeSubject(); public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) where TException : System.Exception { } + public FluentAssertions.Specialized.ExceptionAssertions Throw(string because = "", params object[] becauseArgs) { } public FluentAssertions.Specialized.ExceptionAssertions Throw(string because = "", params object[] becauseArgs) where TException : System.Exception { } public FluentAssertions.Specialized.ExceptionAssertions ThrowExactly(string because = "", params object[] becauseArgs) diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 58bd68268e..0aa96806bc 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -2212,10 +2212,12 @@ namespace FluentAssertions.Specialized public System.Threading.Tasks.Task> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) where TException : System.Exception { } + public System.Threading.Tasks.Task> ThrowAsync(string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> ThrowAsync(string because = "", params object[] becauseArgs) where TException : System.Exception { } public System.Threading.Tasks.Task> ThrowExactlyAsync(string because = "", params object[] becauseArgs) where TException : System.Exception { } + public System.Threading.Tasks.Task> ThrowWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> ThrowWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) where TException : System.Exception { } } @@ -2237,6 +2239,7 @@ namespace FluentAssertions.Specialized protected abstract void InvokeSubject(); public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) where TException : System.Exception { } + public FluentAssertions.Specialized.ExceptionAssertions Throw(string because = "", params object[] becauseArgs) { } public FluentAssertions.Specialized.ExceptionAssertions Throw(string because = "", params object[] becauseArgs) where TException : System.Exception { } public FluentAssertions.Specialized.ExceptionAssertions ThrowExactly(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 d7fcbae1e8..217fcf8803 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -2035,10 +2035,12 @@ namespace FluentAssertions.Specialized public System.Threading.Tasks.Task> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) where TException : System.Exception { } + public System.Threading.Tasks.Task> ThrowAsync(string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> ThrowAsync(string because = "", params object[] becauseArgs) where TException : System.Exception { } public System.Threading.Tasks.Task> ThrowExactlyAsync(string because = "", params object[] becauseArgs) where TException : System.Exception { } + public System.Threading.Tasks.Task> ThrowWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> ThrowWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) where TException : System.Exception { } } @@ -2060,6 +2062,7 @@ namespace FluentAssertions.Specialized protected abstract void InvokeSubject(); public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) where TException : System.Exception { } + public FluentAssertions.Specialized.ExceptionAssertions Throw(string because = "", params object[] becauseArgs) { } public FluentAssertions.Specialized.ExceptionAssertions Throw(string because = "", params object[] becauseArgs) where TException : System.Exception { } public FluentAssertions.Specialized.ExceptionAssertions ThrowExactly(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 572d0840c1..a380bf1828 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -2091,10 +2091,12 @@ namespace FluentAssertions.Specialized public System.Threading.Tasks.Task> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> NotThrowAsync(string because = "", params object[] becauseArgs) where TException : System.Exception { } + public System.Threading.Tasks.Task> ThrowAsync(string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> ThrowAsync(string because = "", params object[] becauseArgs) where TException : System.Exception { } public System.Threading.Tasks.Task> ThrowExactlyAsync(string because = "", params object[] becauseArgs) where TException : System.Exception { } + public System.Threading.Tasks.Task> ThrowWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { } public System.Threading.Tasks.Task> ThrowWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) where TException : System.Exception { } } @@ -2116,6 +2118,7 @@ namespace FluentAssertions.Specialized protected abstract void InvokeSubject(); public FluentAssertions.AndConstraint NotThrow(string because = "", params object[] becauseArgs) where TException : System.Exception { } + public FluentAssertions.Specialized.ExceptionAssertions Throw(string because = "", params object[] becauseArgs) { } public FluentAssertions.Specialized.ExceptionAssertions Throw(string because = "", params object[] becauseArgs) where TException : System.Exception { } public FluentAssertions.Specialized.ExceptionAssertions ThrowExactly(string because = "", params object[] becauseArgs) diff --git a/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs index 66bcf91d70..6617d0b65b 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs @@ -936,7 +936,21 @@ public async Task When_async_method_throws_aggregate_exception_containing_expect } [Fact] - public async Task When_async_method_throws_the_expected_exception_it_should_succeed() + public async Task Succeeds_for_any_exception_thrown_by_async_method() + { + // Arrange + Func task = () => Throw.Async(); + + // Act + Func action = () => task + .Should().ThrowAsync(); + + // Assert + await action.Should().NotThrowAsync(); + } + + [Fact] + public async Task Succeeds_for_expected_exception_thrown_by_async_method() { // Arrange Func task = () => Throw.Async(); @@ -949,6 +963,20 @@ public async Task When_async_method_throws_the_expected_exception_it_should_succ await action.Should().NotThrowAsync(); } + [Fact] + public async Task Succeeds_for_any_exception_thrown_within_timespan_by_async_method() + { + // Arrange + Func task = () => Throw.Async(); + + // Act + Func action = () => task.Should().ThrowWithinAsync( + 100.Milliseconds()); + + // Assert + await action.Should().NotThrowAsync(); + } + [Fact] public async Task When_async_method_does_not_throw_the_expected_inner_exception_it_should_fail() { diff --git a/Tests/FluentAssertions.Specs/Exceptions/ThrowAssertionsSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/ThrowAssertionsSpecs.cs index b568253735..ae93bd1eb6 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/ThrowAssertionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/ThrowAssertionsSpecs.cs @@ -7,7 +7,17 @@ namespace FluentAssertions.Specs.Exceptions; public class ThrowAssertionsSpecs { [Fact] - public void When_subject_throws_expected_exception_it_should_not_do_anything() + public void Succeeds_for_any_exception_thrown_by_subject() + { + // Arrange + Does testSubject = Does.Throw(); + + // Act / Assert + testSubject.Invoking(x => x.Do()).Should().Throw(); + } + + [Fact] + public void Succeeds_for_expected_exception_thrown_by_subject() { // Arrange Does testSubject = Does.Throw(); @@ -17,7 +27,17 @@ public void When_subject_throws_expected_exception_it_should_not_do_anything() } [Fact] - public void When_func_throws_expected_exception_it_should_not_do_anything() + public void Succeeds_for_any_exception_thrown_by_func() + { + // Arrange + Does testSubject = Does.Throw(); + + // Act / Assert + testSubject.Invoking(x => x.Return()).Should().Throw(); + } + + [Fact] + public void Succeeds_for_expected_exception_thrown_by_func() { // Arrange Does testSubject = Does.Throw(); @@ -27,7 +47,17 @@ public void When_func_throws_expected_exception_it_should_not_do_anything() } [Fact] - public void When_action_throws_expected_exception_it_should_not_do_anything() + public void Succeeds_for_any_exception_thrown_by_action() + { + // Arrange + var act = new Action(() => throw new InvalidOperationException("Some exception")); + + // Act / Assert + act.Should().Throw(); + } + + [Fact] + public void Succeeds_for_expected_exception_thrown_by_action() { // Arrange var act = new Action(() => throw new InvalidOperationException("Some exception")); diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 2e5c3aafd0..e9aa3856ef 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -12,6 +12,7 @@ sidebar: ## Enhancements * Added `ExcludingMembersNamed` to `BeEquivalentTo` to exclude fields and properties anywhere in the graph - [3062](https://github.com/fluentassertions/fluentassertions/pull/3062) +* Added `Should().Throw()`, `ThrowAsync()` and `ThrowWithinAsync()` flavors that don’t require a specific exception type - [3059](https://github.com/fluentassertions/fluentassertions/pull/3059) ## 8.3.0 @@ -24,7 +25,7 @@ sidebar: ## Fixes -* Fixed a regression from 8.1.0 where a `NullReferenceException` was thrown during subject identification - [#3036](https://github.com/fluentassertions/fluentassertions/pull/3036 +* Fixed a regression from 8.1.0 where a `NullReferenceException` was thrown during subject identification - [#3036](https://github.com/fluentassertions/fluentassertions/pull/3036) ## Enhancements From 77d36c876f145fc1cf09090ba8a872f44f7805f7 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Thu, 26 Jun 2025 21:42:05 +0200 Subject: [PATCH 627/845] Try to reduce the number of boolean parameters in our code --- .editorconfig | 471 +++++++++--------- Src/FluentAssertions/AssertionExtensions.cs | 4 + Src/FluentAssertions/Common/TypeExtensions.cs | 8 +- .../EquivalencyValidationContext.cs | 8 +- .../Equivalency/Execution/ObjectReference.cs | 25 +- .../Execution/AssertionChain.cs | 6 +- .../Execution/AssertionScope.cs | 16 +- .../Execution/ContextDataDictionary.cs | 12 +- .../Execution/LateBoundTestFramework.cs | 17 +- .../Execution/TUnitFramework.cs | 7 +- .../Execution/XUnitTestFramework.cs | 13 +- .../Primitives/BooleanAssertions.cs | 2 + .../Primitives/NullableBooleanAssertions.cs | 2 + .../Xml/Equivalency/XmlReaderValidator.cs | 15 +- .../Xml/XDocumentAssertions.cs | 4 +- .../Xml/XElementAssertions.cs | 6 +- Src/FluentAssertions/Xml/XmlNodeAssertions.cs | 6 +- Tests/.editorconfig | 15 + 18 files changed, 349 insertions(+), 288 deletions(-) diff --git a/.editorconfig b/.editorconfig index 1902d22742..09ea95a062 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,9 +1,10 @@ root = true # EditorConfig is awesome: http://EditorConfig.org -# top-most EditorConfig file +#################################################################### +## Global settings +#################################################################### -# Global settings [*] end_of_line = crlf insert_final_newline = true @@ -110,13 +111,11 @@ csharp_space_after_dot = false csharp_space_after_keywords_in_control_flow_statements = true csharp_space_after_semicolon_in_for_statement = true csharp_space_around_binary_operators = before_and_after -csharp_space_around_declaration_statements = do_not_ignore csharp_space_before_colon_in_inheritance_clause = true csharp_space_before_comma = false csharp_space_before_dot = false csharp_space_before_open_square_brackets = false csharp_space_before_semicolon_in_for_statement = false -csharp_space_between_attribute_sections = false csharp_space_between_empty_square_brackets = false csharp_space_between_method_call_empty_parameter_list_parentheses = false csharp_space_between_method_call_name_and_opening_parenthesis = false @@ -127,295 +126,283 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false csharp_space_between_parentheses = false csharp_space_between_square_brackets = false -# FxCop Analyzers -dotnet_diagnostic.CA1030.severity = none -dotnet_diagnostic.CA1034.severity = none -dotnet_diagnostic.CA1062.severity = suggestion -dotnet_code_quality.CA1062.exclude_extension_method_this_parameter = true -dotnet_code_quality.exclude_extension_method_this_parameter = true -dotnet_code_quality.null_check_validation_methods = ThrowIfArgumentIsNull -# CA1031: Do not catch general exception types -dotnet_diagnostic.CA1031.severity = none -# CA1303: Do not pass literals as localized parameters -dotnet_diagnostic.CA1303.severity = none -# CA1304: Specify CultureInfo -dotnet_diagnostic.CA1304.severity = error -# CA1307: Specify StringComparison for clarity -dotnet_diagnostic.CA1307.severity = error -# CA1308: Normalize strings to uppercase -dotnet_diagnostic.CA1308.severity = error -# CA1309: Use ordinal StringComparison -dotnet_diagnostic.CA1309.severity = error - -# Purpose: Rename virtual/interface member ITestFramework.Throw(string) so that it no longer conflicts with the reserved language keyword 'Throw' -# Reason: We don't care about other languages than C# -dotnet_diagnostic.CA1716.severity = none +#################################################################### +## Rider/ReSharper Settings +#################################################################### -# CA1724: Type names should not match namespaces -dotnet_diagnostic.CA1724.severity = none -# CA1819: Properties should not return arrays -dotnet_diagnostic.CA1819.severity = none -# CA1851: Possible multiple enumerations of IEnumerable collection. Related to GH-issue #2000 -dotnet_diagnostic.CA1851.severity = suggestion -# CA1859: Use concrete types when possible for improved performance -dotnet_diagnostic.CA1859.severity = suggestion -# CA1860: Avoid using 'Enumerable.Any()' extension method -dotnet_diagnostic.CA1860.severity = warning -# CA1861: Avoid constant arrays as arguments -dotnet_diagnostic.CA1861.severity = none -# CA2007: Do not directly await a Task -dotnet_diagnostic.CA2007.severity = none -# CA2225: Operator overloads have named alternates -dotnet_diagnostic.CA2225.severity = none -# CA3075: Insecure DTD Processing -dotnet_diagnostic.CA3075.severity = none -# CA5369: Use XmlReader for Deserialize -dotnet_diagnostic.CA5369.severity = none +# Keep enough blank lines between code blocks to make it readable. +resharper_blank_lines_after_multiline_statements = 1 +resharper_blank_lines_around_single_line_auto_property = 1 +resharper_blank_lines_before_case = 1 -# Banned API Analyzers -dotnet_diagnostic.RS0030.severity = error +# Purpose: Don't put elements of an array on new lines, unless the length exceeds the maximum line length. +resharper_wrap_array_initializer_style = chop_always -# IDE0004: Remove unnecessary cast -dotnet_diagnostic.IDE0004.severity = error +# Purpose: Always put elements of an object initializer on new lines, unless the length exceeds the maximum line length. +resharper_wrap_object_and_collection_initializer_style = chop_always -# IDE0005: Remove unnecessary usings/imports -dotnet_diagnostic.IDE0005.severity = suggestion +resharper_unused_parameter_local_highlighting = error +resharper_not_accessed_positional_property_global_highlighting = error -# IDE0051: Remove unused private members (no reads or writes) -dotnet_diagnostic.IDE0051.severity = error +# Do not remove redundant else blocks +resharper_redundant_if_else_block_highlighting = none -# IDE0052: Remove unread private members (writes but no reads) -dotnet_diagnostic.IDE0052.severity = error +#################################################################### +## Roslyn Analyzers and Code Fixes +#################################################################### -# IDE0055: Fix formatting -dotnet_diagnostic.IDE0055.severity = error +# Purpose: Field contains the word 'and', which suggests doing multiple thing +# Rationale: We do not want to enforce this rule in our codebase. +dotnet_diagnostic.AV1115.severity = suggestion -# CS1574: XML comment on 'construct' has syntactically incorrect cref attribute 'name' -dotnet_diagnostic.CS1574.severity = error +# Purpose: Return interfaces to unchangeable collections +# Rationale: We do not want to enforce this rule in our codebase. +dotnet_diagnostic.AV1130.severity = suggestion -# StyleCop +# Purpose: null is returned from method which has return type of string, collection or task +# Rationale: It's a good suggestion, but can be hard to implement. +dotnet_diagnostic.AV1135.severity = suggestion -# Purpose: An opening square bracket within a C# statement is not spaced correctly. -# Reason: Doesn't understand the new collection initializers -dotnet_diagnostic.SA1010.severity = none +# Purpose contains x statements, which exceeds the maximum of 7 statements +# Rationale: 7 is the ideal Clean Code value, 15 is what we think is reasonable, 40 is the absolute maximum. +dotnet_diagnostic.AV1500.max_statement_count = 40 +dotnet_diagnostic.AV1500.severity = error -# SA1028: Code should not contain trailing whitespace -dotnet_diagnostic.SA1028.severity = suggestion -# SA1101: Prefix local calls with this -dotnet_diagnostic.SA1101.severity = none -# SA1116: The parameters should begin on the line after the declaration, whenever the parameter span across multiple lines -dotnet_diagnostic.SA1116.severity = none -# SA1117: The parameters should all be placed on the same line or each parameter should be placed on its own line. -dotnet_diagnostic.SA1117.severity = none -# SA1200: Using directive should appear within a namespace declaration -dotnet_diagnostic.SA1200.severity = none +# Purpose: Loop statement contains nested loop +# Rationale: We don't want to completely prevent this. +dotnet_diagnostic.AV1532.severity = suggestion -# Purpose: Use string. Empty for empty strings -# Reason: There's no performance difference. See https://medium.com/@dk.kravtsov/string-empty-vs-in-c-70c64971161f -dotnet_diagnostic.SA1122.severity = none +# Purpose: Overloaded method should call another overload +# Rationale: Does often lead to more complex code +dotnet_diagnostic.AV1551.severity = none -# SA1124: Do not use regions -dotnet_diagnostic.SA1124.severity = none -# SA1201: A property should not follow a method -dotnet_diagnostic.SA1201.severity = none -# SA1202: 'public' members should come before 'private' members -dotnet_diagnostic.SA1202.severity = none -# SA1204: Static members should appear before non-static members -dotnet_diagnostic.SA1204.severity = none -# SA1312: variable should begin with lower-case letter -dotnet_diagnostic.SA1312.severity = suggestion # re-enable if using statements can be discarded -# SA1313: parameter should begin with lower-case letter -dotnet_diagnostic.SA1313.severity = suggestion # re-enable when parameters discards are available -# SA1316: Tuple element names should use correct casing -dotnet_diagnostic.SA1316.severity = none -# SA1402: File may only contain a single type. Handled better by AV1507 -dotnet_diagnostic.SA1402.severity = none -# SA1404: Code analysis suppression should have justification -dotnet_diagnostic.SA1404.severity = none -# SA1413: Use trailing comma in multi-line initializers -dotnet_diagnostic.SA1413.severity = none -# SA1600: Elements should be documented -dotnet_diagnostic.SA1600.severity = suggestion -# SA1602: Enumeration items should be documented -dotnet_diagnostic.SA1602.severity = suggestion -# SA1611: The documentation for parameter is missing -dotnet_diagnostic.SA1611.severity = suggestion -# SA1612: The parameter documentation for parameter should be at position -dotnet_diagnostic.SA1612.severity = suggestion -# SA1614: Element parameter documentation should have text -dotnet_diagnostic.SA1614.severity = suggestion -# SA1615: Element return value should be documented -dotnet_diagnostic.SA1615.severity = none -# SA1616: Element return value documentation should have text -dotnet_diagnostic.SA1616.severity = suggestion -# SA1618: The documentation for type parameter is missing -dotnet_diagnostic.SA1618.severity = suggestion -# SA1623: The property's documentation summary text should begin with: 'Gets' -dotnet_diagnostic.SA1623.severity = none -# SA1629: Documentation text should end with a period -dotnet_diagnostic.SA1629.severity = none -# SA1633: The file header is missing or not located at the top of the file -dotnet_diagnostic.SA1633.severity = none -# SA1642: Constructor summary documentation should begin with standard text -dotnet_diagnostic.SA1642.severity = suggestion +# Purpose: Method contains optional parameter 'because' +# Rationale: This is good advice, but in our case the entire purpose +dotnet_diagnostic.AV1554.severity = none + +# Parameter is invoked with a named argument +# Rationale: We do not want to enforce this rule in our codebase. +dotnet_diagnostic.AV1555.severity = none -# CSharpGuidelines +# Purpose: Don’t declare signatures with more than 3 parameters +# Rationale: 3 is the ideal number of parameters for a method, but more than 5 in a constructor is a problem dotnet_diagnostic.AV1561.max_parameter_count = 5 -# AV1008: Class should be non-static or its name should be suffixed with Extensions -dotnet_diagnostic.AV1008.severity = none -# AV1010: Type hides inherited member -dotnet_diagnostic.AV1010.severity = none -# AV1115: Member or local function contains the word 'and', which suggests doing multiple things -dotnet_diagnostic.AV1115.severity = suggestion -# AV1130: Return type in signature for Type should be a collection interface instead of a concrete type -dotnet_diagnostic.AV1130.severity = none -# AV1135: null is returned from method which has return type of string, collection or task -dotnet_diagnostic.AV1135.severity = none # re-enable if we can distinguish between string, collection and task -# AV1210: Catch a specific exception instead of Exception, SystemException or ApplicationException -dotnet_diagnostic.AV1210.severity = none -# AV1250: Evaluate LINQ query before returning it -dotnet_diagnostic.AV1250.severity = suggestion -# AV1500: Method 'CallerIdentifier.DetermineCallerIdentity()' contains 10 statements, which exceeds the maximum of 7 statements -dotnet_diagnostic.AV1500.severity = none -# AV1532: Loop statement contains nested loop -dotnet_diagnostic.AV1532.severity = suggestion -# AV1535: Missing block in case or default clause of switch statement -dotnet_diagnostic.AV1535.severity = none # re-enable if we can adjust the formatting to not indent the scope braces -# AV1537: If-else-if construct should end with an unconditional else clause -dotnet_diagnostic.AV1537.severity = suggestion -# AV1551: Method overload with the most parameters should be virtual -dotnet_diagnostic.AV1551.severity = none -# AV1555: Avoid using non-(nullable-)boolean named arguments -dotnet_diagnostic.AV1555.severity = suggestion -# AV1561: Method contains 5 parameters, which exceeds the maximum of 3 parameters -dotnet_diagnostic.AV1561.severity = suggestion -# AV1564: Parameter in public or internal member is of type bool or bool? -dotnet_diagnostic.AV1564.severity = suggestion -# AV1554: Do not use optional parameters in interface methods or their concrete implementations -dotnet_diagnostic.AV1554.severity = none -# AV1580: Argument for parameter calls nested method +dotnet_diagnostic.AV1561.max_constructor_parameter_count = 8 +dotnet_diagnostic.AV1561.severity = error + +# Purpose: Argument for parameter calls nested method +# Rationale: Modern debuggers allow stepping into nested calls, so no need to avoid them. dotnet_diagnostic.AV1580.severity = none -# AV1706: Parameter 'p' should have a more descriptive name -dotnet_diagnostic.AV1706.severity = suggestion -# AV1708: Type name contains term that should be avoided -dotnet_diagnostic.AV1708.severity = suggestion -# AV1710: Field contains the name of its containing type -dotnet_diagnostic.AV1710.severity = none -# AV2202: Replace call to Nullable.HasValue with null check -dotnet_diagnostic.AV2202.severity = none -# AV2305: Missing XML comment for internally visible type or member + +# Purpose: Parameter 'x' should have a more descriptive name +# Rationale: Not always useful +dotnet_diagnostic.AV1706.severity = none + +# Purpose: Field contains the name of its containing type +# Rationale: It's not smart enough to understand that CustomFormatters is not the same as Formatter +dotnet_diagnostic.AV1710.severity = suggestion + +# Purpose: Name of async method +# Rationale: We prefer to only use the "Async" suffix if a synchronous and asynchronous version of the method exists. +dotnet_diagnostic.AV1755.severity = none + +# Purpose: Replace call to Nullable.HasValue with null check +# Rationale: Should be a suggestion, not an error +dotnet_diagnostic.AV2202.severity = suggestion + +# Purpose: Missing XML comment for internally visible type or member +# Rationale: We do not want to enforce this rule in our codebase. dotnet_diagnostic.AV2305.severity = none -# AV2407: Region should be removed -dotnet_diagnostic.AV2407.severity = none -# Keep at least a single blank line between members -resharper_csharp_blank_lines_around_single_line_invocable = 1 +# Purpose: Consider making 'RaiseXXX' an event +# Rationale: Should only be a suggestion +dotnet_diagnostic.CA1030.severity = suggestion -# Convert lambda expression to method group -resharper_convert_closure_to_method_group_highlighting = none +# Purpose: Modify 'WriteMemberValueTextFor' to catch a more specific allowed exception type +# Rationale: We know what we are doing, so we don't want to enforce this. +dotnet_diagnostic.CA1031.severity = none -# Start each element in a object or collection initializer on a new line -resharper_wrap_object_and_collection_initializer_style = chop_always +# Purpose: Change the type of property 'from 'string' to 'System.Uri' +# Rationale: Not a bad idea, but not always practical in existing codebases. +dotnet_diagnostic.CA1056.severity = suggestion -# Force an empty line -resharper_blank_lines_after_multiline_statements = 1 +# Purpose: In externally visible method validate parameter 'formattedGraph' is non-null before using it. +# Rationale: Not a bad idea, but not always practical in existing codebases. +dotnet_diagnostic.CA1062.severity = suggestion -# Don't remove existing line breaks -resharper_keep_existing_initializer_arrangement = true -resharper_keep_existing_arrangement = true +# Purpose: Method passes a literal string as parameter +# Rationale: Very specific rule for localizable applications +dotnet_diagnostic.CA1303.severity = suggestion -# We care about that extra else after an else-if -resharper_redundant_if_else_block_highlighting = none +# Purpose: Rename virtual/interface member so that it no longer conflicts with the reserved language keyword 'Throw'. +# Rationale: We only support C# +dotnet_diagnostic.CA1716.severity = none -# Don't remove explicit default cases in switch statements -resharper_redundant_empty_switch_section_highlighting = none +# Purpose: Properties should not return arrays +# Rationale: Although returning arrays has some performance implications, we don't want to force this. +dotnet_diagnostic.CA1819.severity = suggestion -resharper_align_multiline_binary_expressions_chain = false +# Purpose: Use concrete types when possible for improved performance +# Rationale: Does not need to be enforced in all cases, especially when using interfaces creates less coupling +dotnet_diagnostic.CA1859.severity = suggestion -# Only use new() when the type is obvious -resharper_object_creation_when_type_not_evident = explicitly_typed -resharper_object_creation_when_type_evident = target_typed +# Purpose: Use Task.ConfigureAwait(false) if the current SynchronizationContext is not needed +# Rationale: Not relevant for .NET Core web applications. +dotnet_diagnostic.CA2007.severity = none -# Indent 4 spaces per necessary indention -resharper_continuous_indent_multiplier = 1 +# Purpose: Pass System.Uri objects instead of strings +# Rationale: Although nice to have, this rule is not always practical in existing codebases. +dotnet_diagnostic.CA2234.severity = suggestion -# Avoid breaking a generic definition -resharper_wrap_before_extends_colon = true +# Purpose: Use string.Equals instead of Equals operator +# Rationale: Does not improve readability +dotnet_diagnostic.MA0006.severity = none -resharper_blank_lines_before_multiline_statements = 1 +# Purpose: Regular expressions should not be vulnerable to Denial of Service attacks +# Rationale: See https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0009.md +dotnet_diagnostic.MA0009.severity = suggestion -resharper_parentheses_non_obvious_operations = arithmetic, multiplicative, equality, relational, additive -resharper_parentheses_redundancy_style = remove_if_not_clarifies_precedence +# Purpose: Use an overload of 'System.ArgumentException' with the parameter name +# Rationale: We don't want to force this +dotnet_diagnostic.MA0015.severity = suggestion -dotnet_analyzer_diagnostic.category-roslynator.severity = error +# Purpose: Use an explicit StringComparer to compute hash codes +# Rationale: Too farfetched +dotnet_diagnostic.MA0021.severity = suggestion -# Purpose: Remove trailing white-space -# Reason: It also complains about this when pressing enter to start a new empty line. -dotnet_diagnostic.RCS1037.severity = none +# Purpose: Closing parenthesis should not be preceded by a space +# Rationale: This conflicts with record constructors +dotnet_diagnostic.SA1009.severity = none -# Remove suffix 'Async' from non-asynchronous method name. Disabled because we like that suffix for now. -dotnet_diagnostic.RCS1047.severity = none +# Purpose: Code should not contain trailing whitespace +# Rationale: We don't want to force this. +dotnet_diagnostic.SA1028.severity = none -# Combine 'Enumerable.Where' method chain. It doesn't make it more readable in all cases. -dotnet_diagnostic.RCS1112.severity = suggestion +# Purpose: Prefix local calls with this +# Rationale: We don't want to force this +dotnet_diagnostic.SA1101.severity = none -# Inline local variable. -dotnet_diagnostic.RCS1124.severity = suggestion +# Purpose: Generic type constraints should be on their own line +# Rationale: We don't want to force this +dotnet_diagnostic.SA1127.severity = none -# Add exception to documentation comment. Nice suggestion, but we don't want to document exceptions for internal code. -dotnet_diagnostic.RCS1140.severity = suggestion +# Purpose: Ordering rules +# Rationale: We prefer to order members so we can read code like a book +dotnet_diagnostic.SA1201.severity = none +dotnet_diagnostic.SA1202.severity = none +dotnet_diagnostic.SA1204.severity = none -# Missing documentation -dotnet_diagnostic.RCS1141.severity = suggestion -dotnet_diagnostic.RCS1142.severity = suggestion +# Purpose: The parameters should begin on the line after the declaration, whenever the parameter span across multiple lines +# Rationale: We don't want to force this +dotnet_diagnostic.SA1116.severity = none -# Use conditional access. Suggestion because it doesn't always improve readability -dotnet_diagnostic.RCS1146.severity = suggestion +# Purpose: The parameters should all be placed on the same line or each parameter should be placed on its own lin +# Rationale: We don't want to force this +dotnet_diagnostic.SA1117.severity = none -# Enum should declare explicit values. Disabled because we're not storing them. -dotnet_diagnostic.RCS1161.severity = none +# Purpose: Use string.Empty for empty string +# Rationale: There is no performance difference in modern .NET versions, so no need to enforce this. +dotnet_diagnostic.SA1122.severity = none -# Static member in generic type should use a type parameter. Disabled because it's not always applicable. -dotnet_diagnostic.RCS1158.severity = none +# Purpose: Do not use region +# Rationale: Is up to the developer to decide if they want to use regions or not. +dotnet_diagnostic.SA1124.severity = none -# Add region name to #endregion. -dotnet_diagnostic.RCS1189.severity = none +# Purpose: Variable '_' should begin with lower-case lette +# Rationale: Does not understand discard parameters +dotnet_diagnostic.SA1312.severity = none -# Convert comment to documentation comment. Disabled because it also complains about SMELL/REFACTOR comments -dotnet_diagnostic.RCS1181.severity = none +# Purpose: Parameter '_' should begin with lower-case lette +# Rationale: Does not understand discard parameters +dotnet_diagnostic.SA1313.severity = none -# Use Regex instance instead of static method. Disabled because it's not always worth it. -dotnet_diagnostic.RCS1186.severity = none +# Purpose: File may only contain a single type +# Rationale: Although we prefer to have one type per file, we don't want to force this. +dotnet_diagnostic.SA1402.severity = suggestion -# Use bit shift operator. -dotnet_diagnostic.RCS1237.severity = none +# Purpose: Code analysis suppression should have justification +# Rationale: If we do it, we have reasons for it. +dotnet_diagnostic.SA1404.severity = none -# RCS1228: Unused element in documentation comment. (Equivalent to SA1614) -dotnet_diagnostic.RCS1228.severity = suggestion +# Purpose: Use trailing comma in multi-line initialize +# Rationale: We don't want to force this +dotnet_diagnostic.SA1413.severity = none -# Use an overload that has a IEqualityComparer or IComparer parameter -dotnet_diagnostic.MA0002.severity = suggestion +# Purpose: A closing brace should not be preceded by a blank line +# Rationale: We don't care +dotnet_diagnostic.SA1508.severity = none -# Use Task.ConfigureAwait(false) as the current SynchronizationContext is not needed -dotnet_diagnostic.MA0004.severity = none +# Purpose: File is required to end with a single newline character ( +# Rationale: We don't care +dotnet_diagnostic.SA1518.severity = none -# Use string.Equals instead of Equals operator -dotnet_diagnostic.MA0006.severity = none +# Purpose: Elements should be documented +# Rationale: We don't want to force documentation for all elements +dotnet_diagnostic.SA1600.severity = suggestion -# Add regex evaluation timeout -dotnet_diagnostic.MA0009.severity = none +# Purpose: Partial elements should be documented +# Rationale: We don't want to force this +dotnet_diagnostic.SA1601.severity = suggestion -# Use an overload of 'ToString' that has a 'System.IFormatProvider' parameter. Already caught by CA1305. -dotnet_diagnostic.MA0011.severity = none +# Purpose: Enumeration items should be documented +# Rationale: We don't want to force this +dotnet_diagnostic.SA1602.severity = suggestion -# Use an overload of 'System.ArgumentException' with the parameter name. Just a suggestion since we have a bunch of justified exceptions. -dotnet_diagnostic.MA0015.severity = suggestion +# Purpose: Element parameters should be documented +# Rationale: We don't want to force this +dotnet_diagnostic.SA1611.severity = suggestion + +# Purpose: The parameter documentation for 'because' should be at position 3 +# Rationale: We don't want to force this +dotnet_diagnostic.SA1612.severity = suggestion + +# Purpose: Element return value should be documented +# Rationale: We don't want to force this +dotnet_diagnostic.SA1615.severity = none + +# Purpose: Generic type parameters should be documented +# Rationale: We don't want to force this +dotnet_diagnostic.SA1618.severity = suggestion + +# Purpose: Element return value should be documented +# Rationale: We don't want to force this +dotnet_diagnostic.sa1622.severity = suggestion + +# Purpose: The property's documentation summary text should begin with: 'Gets or sets' +# Rationale: We don't want to force this +dotnet_diagnostic.SA1623.severity = none + +# Purpose: Documentation text should end with a period +# Rationale: We don't want to force this +dotnet_diagnostic.SA1629.severity = none + +# Purpose: The file header is missing or not located at the top of the file +# Rationale: We don't want to force this +dotnet_diagnostic.SA1633.severity = none + +# Purpose: Constructor summary documentation should begin with standard text +# Rationale: We don't want to force this +dotnet_diagnostic.SA1642.severity = none + +# Purpose: File name should match first type name +# Rationale: To keep the content-only package simple, we keep everything together +dotnet_diagnostic.SA1649.severity = none + +# Purpose: Use file header +# Rationale: We don't want to force this +dotnet_diagnostic.SA1633.severity = none -# Use an explicit StringComparer to compute hash codes -dotnet_diagnostic.MA0021.severity = none +#################################################################### +## Duplicate rules +#################################################################### -# Declare types in namespaces. Already caught by CA1050 -dotnet_diagnostic.MA0047.severity = none +dotnet_diagnostic.MA0004.severity = none # duplicate of CA2007 +dotnet_diagnostic.AV2407.severity = none # duplicate of SA1124 +dotnet_diagnostic.RCS1102.severity = none # duplicate of CA1052 +dotnet_diagnostic.SA1401.severity = none # duplicate of CA1051 +dotnet_diagnostic.MA0069.severity = none # duplicate of CA2211 +dotnet_diagnostic.AV1210.severity = none # duplicate of CA1031 +dotnet_diagnostic.MA0051.severity = none # duplicate of AV1500 +dotnet_diagnostic.MA0011.severity = none # duplicate of CA1305 +dotnet_diagnostic.CA1050.severity = none # duplicate of MA0047 (which is more explanatory) -# Use an overload of 'GetHashCode' that has a StringComparison parameter -dotnet_diagnostic.MA0074.severity = none diff --git a/Src/FluentAssertions/AssertionExtensions.cs b/Src/FluentAssertions/AssertionExtensions.cs index 56b207a30d..c3f8c668ff 100644 --- a/Src/FluentAssertions/AssertionExtensions.cs +++ b/Src/FluentAssertions/AssertionExtensions.cs @@ -286,6 +286,8 @@ public static ObjectAssertions Should([NotNull] this object actualValue) return new ObjectAssertions(actualValue, AssertionChain.GetOrCreate()); } +#pragma warning disable AV1564 // Avoid signatures that take a bool parameter + /// /// Returns an object that can be used to assert the /// current . @@ -306,6 +308,8 @@ public static NullableBooleanAssertions Should([NotNull] this bool? actualValue) return new NullableBooleanAssertions(actualValue, AssertionChain.GetOrCreate()); } +#pragma warning restore AV1564 + /// /// Returns an object that can be used to assert the /// current . diff --git a/Src/FluentAssertions/Common/TypeExtensions.cs b/Src/FluentAssertions/Common/TypeExtensions.cs index c13fd8030a..4cd89baa9c 100644 --- a/Src/FluentAssertions/Common/TypeExtensions.cs +++ b/Src/FluentAssertions/Common/TypeExtensions.cs @@ -99,21 +99,21 @@ public static IEnumerable GetMatchingOrInheritedAttributes GetCustomAttributes(this MemberInfo type, bool inherit = false) + public static IEnumerable GetCustomAttributes(this MemberInfo type) where TAttribute : Attribute { // Do not use MemberInfo.GetCustomAttributes. // There is an issue with PropertyInfo and EventInfo preventing the inherit option to work. // https://github.com/dotnet/runtime/issues/30219 - return CustomAttributeExtensions.GetCustomAttributes(type, inherit); + return CustomAttributeExtensions.GetCustomAttributes(type, inherit: false); } private static IEnumerable GetCustomAttributes(MemberInfo type, - Expression> isMatchingAttributePredicate, bool inherit = false) + Expression> isMatchingAttributePredicate) where TAttribute : Attribute { Func isMatchingAttribute = isMatchingAttributePredicate.Compile(); - return GetCustomAttributes(type, inherit).Where(isMatchingAttribute); + return GetCustomAttributes(type).Where(isMatchingAttribute); } private static TAttribute[] GetCustomAttributes(this Type type, bool inherit = false) diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs index f596364fa8..f71912f83b 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs @@ -71,10 +71,12 @@ public IEquivalencyValidationContext Clone() public bool IsCyclicReference(object expectation) { - bool compareByMembers = expectation is not null && Options.GetEqualityStrategy(expectation.GetType()) - is EqualityStrategy.Members or EqualityStrategy.ForceMembers; + EqualityStrategy strategy = expectation is not null + ? Options.GetEqualityStrategy(expectation.GetType()) + : EqualityStrategy.Equals; + + var reference = new ObjectReference(expectation, CurrentNode.Subject.PathAndName, strategy); - var reference = new ObjectReference(expectation, CurrentNode.Subject.PathAndName, compareByMembers); return CyclicReferenceDetector.IsCyclicReference(reference); } diff --git a/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs b/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs index c0b3fb9fdb..ffd6ad2f03 100644 --- a/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs +++ b/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs @@ -13,14 +13,22 @@ internal class ObjectReference { private readonly object @object; private readonly string path; - private readonly bool? compareByMembers; private string[] pathElements; - public ObjectReference(object @object, string path, bool? compareByMembers = null) + public ObjectReference(object @object, string path, EqualityStrategy equalityStrategy) { this.@object = @object; this.path = path; - this.compareByMembers = compareByMembers; + + CompareByMembers = equalityStrategy is EqualityStrategy.Members or EqualityStrategy.ForceMembers; + } + + public ObjectReference(object @object, string path) + { + this.@object = @object; + this.path = path; + + CompareByMembers = @object?.GetType().OverridesEquals() == false; } /// @@ -69,5 +77,14 @@ public override string ToString() return Invariant($"{{\"{path}\", {@object}}}"); } - public bool CompareByMembers => compareByMembers ?? @object?.GetType().OverridesEquals() == false; + /// + /// Indicates whether the equality comparison for the object should be based on its members rather than its default + /// implementation of + /// + /// + /// This property returns if the equality strategy is set to or + /// , and the object does not override its method. + /// Otherwise, it returns + /// + public bool CompareByMembers { get; } } diff --git a/Src/FluentAssertions/Execution/AssertionChain.cs b/Src/FluentAssertions/Execution/AssertionChain.cs index 5422c05c1e..050fa1ab98 100644 --- a/Src/FluentAssertions/Execution/AssertionChain.cs +++ b/Src/FluentAssertions/Execution/AssertionChain.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; @@ -132,6 +132,7 @@ public AssertionChain BecauseOf([StringSyntax("CompositeFormat")] string because return this; } + [SuppressMessage("Maintainability", "AV1564:Parameter in public or internal member is of type bool or bool?")] public AssertionChain ForCondition(bool condition) { if (PreviousAssertionSucceeded) @@ -146,8 +147,7 @@ public AssertionChain ForConstraint(OccurrenceConstraint constraint, int actualO { if (PreviousAssertionSucceeded) { - constraint.RegisterContextData((key, value) => contextData.Add( - new ContextDataDictionary.DataItem(key, value, reportable: false, requiresFormatting: false))); + constraint.RegisterContextData((key, value) => contextData.Add(new ContextDataDictionary.DataItem(key, value))); succeeded = constraint.Assert(actualOccurrences); } diff --git a/Src/FluentAssertions/Execution/AssertionScope.cs b/Src/FluentAssertions/Execution/AssertionScope.cs index 1a3e135c05..67ab3576f7 100644 --- a/Src/FluentAssertions/Execution/AssertionScope.cs +++ b/Src/FluentAssertions/Execution/AssertionScope.cs @@ -146,7 +146,10 @@ public void AddPreFormattedFailure(string formattedFailureMessage) /// internal void AddReportable(string key, string value) { - reportableData.Add(new ContextDataDictionary.DataItem(key, value, reportable: true, requiresFormatting: false)); + reportableData.Add(new ContextDataDictionary.DataItem(key, value) + { + Reportable = true, + }); } /// @@ -155,8 +158,10 @@ internal void AddReportable(string key, string value) /// internal void AddReportable(string key, Func valueFunc) { - reportableData.Add(new ContextDataDictionary.DataItem(key, new DeferredReportable(valueFunc), reportable: true, - requiresFormatting: false)); + reportableData.Add(new ContextDataDictionary.DataItem(key, new DeferredReportable(valueFunc)) + { + Reportable = true + }); } /// @@ -202,7 +207,10 @@ public void Dispose() { if (tracing.Length > 0) { - reportableData.Add(new ContextDataDictionary.DataItem("trace", tracing.ToString(), reportable: true, requiresFormatting: false)); + reportableData.Add(new ContextDataDictionary.DataItem("trace", tracing.ToString()) + { + Reportable = true + }); } assertionStrategy.ThrowIfAny(reportableData.GetReportable()); diff --git a/Src/FluentAssertions/Execution/ContextDataDictionary.cs b/Src/FluentAssertions/Execution/ContextDataDictionary.cs index 23ebd90548..7b051e7ab7 100644 --- a/Src/FluentAssertions/Execution/ContextDataDictionary.cs +++ b/Src/FluentAssertions/Execution/ContextDataDictionary.cs @@ -54,20 +54,24 @@ public void Add(DataItem item) } } - public class DataItem(string key, object value, bool reportable, bool requiresFormatting) + public class DataItem(string key, object value) { public string Key { get; } = key; public object Value { get; } = value; - public bool Reportable { get; } = reportable; + public bool Reportable { get; init; } - public bool RequiresFormatting { get; } = requiresFormatting; + public bool RequiresFormatting { get; init; } public DataItem Clone() { object clone = Value is ICloneable2 cloneable ? cloneable.Clone() : Value; - return new DataItem(Key, clone, Reportable, RequiresFormatting); + return new DataItem(Key, clone) + { + Reportable = Reportable, + RequiresFormatting = RequiresFormatting + }; } } } diff --git a/Src/FluentAssertions/Execution/LateBoundTestFramework.cs b/Src/FluentAssertions/Execution/LateBoundTestFramework.cs index 112b678bb0..6f044410da 100644 --- a/Src/FluentAssertions/Execution/LateBoundTestFramework.cs +++ b/Src/FluentAssertions/Execution/LateBoundTestFramework.cs @@ -7,14 +7,15 @@ namespace FluentAssertions.Execution; internal abstract class LateBoundTestFramework : ITestFramework { - private readonly bool loadAssembly; - private Func exceptionFactory; + private Func exceptionFactory = + _ => throw new InvalidOperationException($"{nameof(IsAvailable)} must be called first."); - protected LateBoundTestFramework(bool loadAssembly = false) - { - this.loadAssembly = loadAssembly; - exceptionFactory = _ => throw new InvalidOperationException($"{nameof(IsAvailable)} must be called first."); - } + /// + /// When set to true, the assembly specified by the AssemblyName property will + /// be dynamically loaded if it is not already loaded in the application domain. + /// When set to false, the framework will not attempt to load the assembly dynamically. + /// + protected bool LoadAssembly { get; init; } [DoesNotReturn] public void Throw(string message) => throw exceptionFactory(message); @@ -38,7 +39,7 @@ private Assembly FindExceptionAssembly() { var assembly = Array.Find(AppDomain.CurrentDomain.GetAssemblies(), a => a.GetName().Name == AssemblyName); - if (assembly is null && loadAssembly) + if (assembly is null && LoadAssembly) { try { diff --git a/Src/FluentAssertions/Execution/TUnitFramework.cs b/Src/FluentAssertions/Execution/TUnitFramework.cs index 33fe376f49..94e8337ee6 100644 --- a/Src/FluentAssertions/Execution/TUnitFramework.cs +++ b/Src/FluentAssertions/Execution/TUnitFramework.cs @@ -1,7 +1,12 @@ namespace FluentAssertions.Execution; -internal class TUnitFramework() : LateBoundTestFramework(loadAssembly: true) +internal class TUnitFramework : LateBoundTestFramework { + public TUnitFramework() + { + LoadAssembly = true; + } + protected override string ExceptionFullName => "TUnit.Assertions.Exceptions.AssertionException"; protected internal override string AssemblyName => "TUnit.Assertions"; diff --git a/Src/FluentAssertions/Execution/XUnitTestFramework.cs b/Src/FluentAssertions/Execution/XUnitTestFramework.cs index 6c68fb5b1e..8ef0c1d7dc 100644 --- a/Src/FluentAssertions/Execution/XUnitTestFramework.cs +++ b/Src/FluentAssertions/Execution/XUnitTestFramework.cs @@ -3,8 +3,19 @@ namespace FluentAssertions.Execution; /// /// Implements the xUnit (version 2 and 3) test framework adapter. /// -internal class XUnitTestFramework(string assemblyName) : LateBoundTestFramework(loadAssembly: true) +internal class XUnitTestFramework : LateBoundTestFramework { + private readonly string assemblyName; + + /// + /// Implements the xUnit (version 2 and 3) test framework adapter. + /// + public XUnitTestFramework(string assemblyName) + { + this.assemblyName = assemblyName; + LoadAssembly = true; + } + protected internal override string AssemblyName => assemblyName; protected override string ExceptionFullName => "Xunit.Sdk.XunitException"; diff --git a/Src/FluentAssertions/Primitives/BooleanAssertions.cs b/Src/FluentAssertions/Primitives/BooleanAssertions.cs index 4932df3e13..45fa01878c 100644 --- a/Src/FluentAssertions/Primitives/BooleanAssertions.cs +++ b/Src/FluentAssertions/Primitives/BooleanAssertions.cs @@ -9,6 +9,7 @@ namespace FluentAssertions.Primitives; /// Contains a number of methods to assert that a is in the expected state. /// [DebuggerNonUserCode] +[SuppressMessage("Maintainability", "AV1564:Parameter in public or internal member is of type bool or bool?")] public class BooleanAssertions : BooleanAssertions { @@ -24,6 +25,7 @@ public BooleanAssertions(bool? value, AssertionChain assertionChain) /// Contains a number of methods to assert that a is in the expected state. /// [DebuggerNonUserCode] +[SuppressMessage("Maintainability", "AV1564:Parameter in public or internal member is of type bool or bool?")] public class BooleanAssertions where TAssertions : BooleanAssertions { diff --git a/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs b/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs index 0a856363fa..de72180353 100644 --- a/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs @@ -8,6 +8,7 @@ namespace FluentAssertions.Primitives; /// Contains a number of methods to assert that a nullable is in the expected state. /// [DebuggerNonUserCode] +[SuppressMessage("Maintainability", "AV1564:Parameter in public or internal member is of type bool or bool?")] public class NullableBooleanAssertions : NullableBooleanAssertions { public NullableBooleanAssertions(bool? value, AssertionChain assertionChain) @@ -20,6 +21,7 @@ public NullableBooleanAssertions(bool? value, AssertionChain assertionChain) /// Contains a number of methods to assert that a nullable is in the expected state. /// [DebuggerNonUserCode] +[SuppressMessage("Maintainability", "AV1564:Parameter in public or internal member is of type bool or bool?")] public class NullableBooleanAssertions : BooleanAssertions where TAssertions : NullableBooleanAssertions { diff --git a/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs b/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs index ad676f998f..acc0021125 100644 --- a/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs +++ b/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; @@ -26,24 +26,27 @@ public XmlReaderValidator(AssertionChain assertionChain, XmlReader subjectReader this.expectationReader = expectationReader; } - public void Validate(bool shouldBeEquivalent) + public void AssertThatItIsEquivalent() { Failure failure = Validate(); - if (shouldBeEquivalent && failure is not null) + if (failure is not null) { assertionChain.FailWith(failure.FormatString, failure.FormatParams); } + } + + public void AssertThatIsNotEquivalent() + { + Failure failure = Validate(); - if (!shouldBeEquivalent && failure is null) + if (failure is null) { assertionChain.FailWith("Did not expect {context:subject} to be equivalent{reason}, but it is."); } } -#pragma warning disable MA0051 private Failure Validate() -#pragma warning restore MA0051 { if (subjectReader is null && expectationReader is null) { diff --git a/Src/FluentAssertions/Xml/XDocumentAssertions.cs b/Src/FluentAssertions/Xml/XDocumentAssertions.cs index 8a798ab87f..e3ce0a033d 100644 --- a/Src/FluentAssertions/Xml/XDocumentAssertions.cs +++ b/Src/FluentAssertions/Xml/XDocumentAssertions.cs @@ -94,7 +94,7 @@ public AndConstraint BeEquivalentTo(XDocument expected, using (XmlReader otherReader = expected?.CreateReader()) { var xmlReaderValidator = new XmlReaderValidator(assertionChain, subjectReader, otherReader, because, becauseArgs); - xmlReaderValidator.Validate(shouldBeEquivalent: true); + xmlReaderValidator.AssertThatItIsEquivalent(); } return new AndConstraint(this); @@ -119,7 +119,7 @@ public AndConstraint NotBeEquivalentTo(XDocument unexpected using (XmlReader otherReader = unexpected?.CreateReader()) { var xmlReaderValidator = new XmlReaderValidator(assertionChain, subjectReader, otherReader, because, becauseArgs); - xmlReaderValidator.Validate(shouldBeEquivalent: false); + xmlReaderValidator.AssertThatIsNotEquivalent(); } return new AndConstraint(this); diff --git a/Src/FluentAssertions/Xml/XElementAssertions.cs b/Src/FluentAssertions/Xml/XElementAssertions.cs index 14b7a84b78..42fa3e12a3 100644 --- a/Src/FluentAssertions/Xml/XElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XElementAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; @@ -97,7 +97,7 @@ public AndConstraint BeEquivalentTo(XElement expected, using (XmlReader expectedReader = expected?.CreateReader()) { var xmlReaderValidator = new XmlReaderValidator(assertionChain, subjectReader, expectedReader, because, becauseArgs); - xmlReaderValidator.Validate(shouldBeEquivalent: true); + xmlReaderValidator.AssertThatItIsEquivalent(); } return new AndConstraint(this); @@ -123,7 +123,7 @@ public AndConstraint NotBeEquivalentTo(XElement unexpected, using (XmlReader otherReader = unexpected?.CreateReader()) { var xmlReaderValidator = new XmlReaderValidator(assertionChain, subjectReader, otherReader, because, becauseArgs); - xmlReaderValidator.Validate(shouldBeEquivalent: false); + xmlReaderValidator.AssertThatIsNotEquivalent(); } return new AndConstraint(this); diff --git a/Src/FluentAssertions/Xml/XmlNodeAssertions.cs b/Src/FluentAssertions/Xml/XmlNodeAssertions.cs index 1a3356ee65..c47e1c8ca9 100644 --- a/Src/FluentAssertions/Xml/XmlNodeAssertions.cs +++ b/Src/FluentAssertions/Xml/XmlNodeAssertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Xml; using FluentAssertions.Execution; @@ -53,7 +53,7 @@ public AndConstraint BeEquivalentTo(XmlNode expected, using (var expectedReader = new XmlNodeReader(expected)) { var xmlReaderValidator = new XmlReaderValidator(assertionChain, subjectReader, expectedReader, because, becauseArgs); - xmlReaderValidator.Validate(shouldBeEquivalent: true); + xmlReaderValidator.AssertThatItIsEquivalent(); } return new AndConstraint((TAssertions)this); @@ -78,7 +78,7 @@ public AndConstraint NotBeEquivalentTo(XmlNode unexpected, using (var unexpectedReader = new XmlNodeReader(unexpected)) { var xmlReaderValidator = new XmlReaderValidator(assertionChain, subjectReader, unexpectedReader, because, becauseArgs); - xmlReaderValidator.Validate(shouldBeEquivalent: false); + xmlReaderValidator.AssertThatIsNotEquivalent(); } return new AndConstraint((TAssertions)this); diff --git a/Tests/.editorconfig b/Tests/.editorconfig index 2936a92f5c..301ba6381b 100644 --- a/Tests/.editorconfig +++ b/Tests/.editorconfig @@ -25,6 +25,11 @@ dotnet_diagnostic.CA1024.severity = none dotnet_diagnostic.CA1028.severity = none # CA1032: Implement standard exception constructors dotnet_diagnostic.CA1032.severity = none + +# Purpose: Do not nest types. Alternatively, change its accessibility so that it is not externally visible +# Reason: We have a lot of nested types to group tests, so we disable this rule +dotnet_diagnostic.CA1034.severity = none + # CA1036: Override methods on comparable types dotnet_diagnostic.CA1036.severity = none # CA1040: Avoid empty interfaces @@ -60,6 +65,11 @@ dotnet_diagnostic.CA1714.severity = none dotnet_diagnostic.CA1716.severity = none # CA1720: Identifiers should not contain type names dotnet_diagnostic.CA1720.severity = none + +# Purpose: The type name Interfaces conflicts in whole or in part with the namespace name +# Reason: We don't care about this in tests +dotnet_diagnostic.CA1724.severity = none + # CA1812: Type is an internal class that is apparently never instantiated. dotnet_diagnostic.CA1812.severity = none # CA1813 Avoid unsealed attributes @@ -94,6 +104,7 @@ dotnet_diagnostic.CA5394.severity = none dotnet_diagnostic.AV1000.severity = none # AV1008: Class should be non-static or its name should be suffixed with Extensions dotnet_diagnostic.AV1008.severity = none + # AV1115: Member or local function contains the word 'and', which suggests doing multiple things dotnet_diagnostic.AV1115.severity = none # AV1135: Do not return null for strings, collections or tasks @@ -197,6 +208,10 @@ dotnet_diagnostic.RCS1213.severity = none # Implement IComparable when implementing IComparable. Disabled since we don't want to be so strict in tests. dotnet_diagnostic.RCS1241.severity = none +# Purpose: Use an overload that has a IEqualityComparer or IComparer parameter +# Reason: Not important in tests +dotnet_diagnostic.MA0002.severity = none + # Use Array.Empty(). We don't care. dotnet_diagnostic.MA0005.severity = none From 1a715af5ee3e302b267bb7f2122bd375e0b04350 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Thu, 26 Jun 2025 21:45:52 +0200 Subject: [PATCH 628/845] Be more explicit about equality strategies when strings are compared --- .../Equivalency/Execution/ObjectReference.cs | 4 +++- .../Selection/ExcludeMembersByNameSelectionRule.cs | 3 ++- Src/FluentAssertions/Events/EventAssertions.cs | 1 + Src/FluentAssertions/Events/EventMonitor.cs | 2 +- Src/FluentAssertions/Execution/ContextDataDictionary.cs | 5 ++++- Src/FluentAssertions/Primitives/StringAssertions.cs | 9 +++++---- Src/FluentAssertions/Types/AssemblyAssertions.cs | 6 +++--- 7 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs b/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs index ffd6ad2f03..4d68cb292d 100644 --- a/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs +++ b/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs @@ -57,7 +57,9 @@ private bool IsParentOrChildOf(ObjectReference other) int commonElements = Math.Min(elements.Length, otherPath.Length); int longerPathAdditionalElements = Math.Max(elements.Length, otherPath.Length) - commonElements; - return longerPathAdditionalElements > 0 && otherPath.Take(commonElements).SequenceEqual(elements.Take(commonElements)); + return longerPathAdditionalElements > 0 && otherPath + .Take(commonElements) + .SequenceEqual(elements.Take(commonElements), StringComparer.Ordinal); } /// diff --git a/Src/FluentAssertions/Equivalency/Selection/ExcludeMembersByNameSelectionRule.cs b/Src/FluentAssertions/Equivalency/Selection/ExcludeMembersByNameSelectionRule.cs index d9ff233fc6..271e5c15d6 100644 --- a/Src/FluentAssertions/Equivalency/Selection/ExcludeMembersByNameSelectionRule.cs +++ b/Src/FluentAssertions/Equivalency/Selection/ExcludeMembersByNameSelectionRule.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; @@ -26,7 +27,7 @@ public ExcludeMembersByNameSelectionRule(string[] membersToExclude) public IEnumerable SelectMembers(INode currentNode, IEnumerable selectedMembers, MemberSelectionContext context) { - return selectedMembers.Where(m => !membersToExclude.Contains(m.Expectation.Name)).ToArray(); + return selectedMembers.Where(m => !membersToExclude.Contains(m.Expectation.Name, StringComparer.Ordinal)).ToArray(); } /// diff --git a/Src/FluentAssertions/Events/EventAssertions.cs b/Src/FluentAssertions/Events/EventAssertions.cs index 6d624bda02..36210c41eb 100644 --- a/Src/FluentAssertions/Events/EventAssertions.cs +++ b/Src/FluentAssertions/Events/EventAssertions.cs @@ -99,6 +99,7 @@ public void NotRaise(string eventName, [StringSyntax("CompositeFormat")] string /// /// Returns only the events having arguments of type targeting the property. /// + [SuppressMessage("Usage", "MA0002:IEqualityComparer or IComparer is missing")] public IEventRecording RaisePropertyChangeFor(Expression> propertyExpression, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { diff --git a/Src/FluentAssertions/Events/EventMonitor.cs b/Src/FluentAssertions/Events/EventMonitor.cs index bcb2efbec6..20ae36d1ea 100644 --- a/Src/FluentAssertions/Events/EventMonitor.cs +++ b/Src/FluentAssertions/Events/EventMonitor.cs @@ -17,7 +17,7 @@ internal sealed class EventMonitor : IMonitor { private readonly WeakReference subject; - private readonly ConcurrentDictionary recorderMap = new(); + private readonly ConcurrentDictionary recorderMap = new(StringComparer.Ordinal); public EventMonitor(object eventSource, EventMonitorOptions options) { diff --git a/Src/FluentAssertions/Execution/ContextDataDictionary.cs b/Src/FluentAssertions/Execution/ContextDataDictionary.cs index 7b051e7ab7..7bc42fdd97 100644 --- a/Src/FluentAssertions/Execution/ContextDataDictionary.cs +++ b/Src/FluentAssertions/Execution/ContextDataDictionary.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using FluentAssertions.Formatting; @@ -13,7 +14,9 @@ internal class ContextDataDictionary public IDictionary GetReportable() { - return items.Where(item => item.Reportable).ToDictionary(item => item.Key, item => item.Value); + return items + .Where(item => item.Reportable) + .ToDictionary(item => item.Key, item => item.Value, StringComparer.Ordinal); } public string AsStringOrDefault(string key) diff --git a/Src/FluentAssertions/Primitives/StringAssertions.cs b/Src/FluentAssertions/Primitives/StringAssertions.cs index d114002e9b..ab9398dfcf 100644 --- a/Src/FluentAssertions/Primitives/StringAssertions.cs +++ b/Src/FluentAssertions/Primitives/StringAssertions.cs @@ -95,7 +95,7 @@ public AndConstraint BeOneOf(IEnumerable validValues, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { assertionChain - .ForCondition(validValues.Contains(Subject)) + .ForCondition(validValues.Contains(Subject, StringComparer.Ordinal)) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:string} to be one of {0}{reason}, but found {1}.", validValues, Subject); @@ -1593,12 +1593,13 @@ public AndConstraint NotContain(string unexpected, public AndConstraint NotContainAll(IEnumerable values, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - ThrowIfValuesNullOrEmpty(values); + IList strings = values?.ConvertOrCastToList(); + ThrowIfValuesNullOrEmpty(strings); - var matches = values.Count(v => Contains(Subject, v, StringComparison.Ordinal)); + var matches = strings!.Count(v => Contains(Subject, v, StringComparison.Ordinal)); assertionChain - .ForCondition(matches != values.Count()) + .ForCondition(matches != strings.Count) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:string} {0} to contain all of the strings: {1}{reason}.", Subject, values); diff --git a/Src/FluentAssertions/Types/AssemblyAssertions.cs b/Src/FluentAssertions/Types/AssemblyAssertions.cs index 5ceac78772..c133a77deb 100644 --- a/Src/FluentAssertions/Types/AssemblyAssertions.cs +++ b/Src/FluentAssertions/Types/AssemblyAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; @@ -58,7 +58,7 @@ public AndConstraint NotReference(Assembly assembly, assertionChain .BecauseOf(because, becauseArgs) - .ForCondition(!references.Contains(assemblyName)) + .ForCondition(!references.Contains(assemblyName, StringComparer.Ordinal)) .FailWith("Expected assembly {0} not to reference assembly {1}{reason}.", subjectName, assemblyName); } @@ -97,7 +97,7 @@ public AndConstraint Reference(Assembly assembly, assertionChain .BecauseOf(because, becauseArgs) - .ForCondition(references.Contains(assemblyName)) + .ForCondition(references.Contains(assemblyName, StringComparer.Ordinal)) .FailWith("Expected assembly {0} to reference assembly {1}{reason}, but it does not.", subjectName, assemblyName); } From 7cb08388222e8c1dfe10786a51a6dd281d33875e Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Thu, 26 Jun 2025 21:46:29 +0200 Subject: [PATCH 629/845] Fixes or suppressions needed to comply to the new .editorconfig --- Src/FluentAssertions/CallerIdentifier.cs | 6 +-- .../GenericCollectionAssertions.cs | 28 +++++++---- .../GenericDictionaryAssertions.cs | 13 +++-- .../Collections/StringCollectionAssertions.cs | 1 + .../Common/ExpressionExtensions.cs | 35 +++++++++++++- Src/FluentAssertions/Common/IClock.cs | 1 - ...cs => KeyValuePairCollectionExtensions.cs} | 47 ++++++++----------- Src/FluentAssertions/Common/MemberPath.cs | 10 ++-- .../Common/MethodInfoExtensions.cs | 4 +- .../Common/StringExtensions.cs | 1 - .../Configuration/GlobalFormattingOptions.cs | 2 + Src/FluentAssertions/Equivalency/Digit.cs | 10 ++-- .../Equivalency/EqualityStrategyProvider.cs | 17 ++++--- .../Equivalency/IMemberMatchingRule.cs | 3 -- .../SelfReferenceEquivalencyOptions.cs | 4 +- .../Equivalency/Steps/EnumEqualityStep.cs | 6 +++ .../Steps/GenericDictionaryEquivalencyStep.cs | 3 ++ .../Execution/AssertionChain.cs | 9 ++-- .../Execution/AssertionScope.cs | 2 +- .../Execution/LateBoundTestFramework.cs | 4 +- .../Execution/StringExtensions.cs | 8 +--- .../Extensions/FluentDateTimeExtensions.cs | 6 ++- .../Formatting/FlushedLineState.cs | 1 - Src/FluentAssertions/Formatting/Formatter.cs | 2 + .../NumericAssertionsExtensions.cs | 4 ++ .../ObjectAssertionsExtensions.cs | 4 +- .../Primitives/StringAssertions.cs | 2 +- .../Primitives/StringEqualityStrategy.cs | 4 ++ .../Specialized/AsyncFunctionAssertions.cs | 2 +- .../Specialized/ExecutionTimeAssertions.cs | 2 +- .../Specialized/FunctionAssertions.cs | 1 + .../Types/AssemblyAssertions.cs | 2 +- .../Types/ConstructorInfoAssertions.cs | 1 - Src/FluentAssertions/Types/TypeAssertions.cs | 1 + .../Xml/Equivalency/XmlReaderValidator.cs | 21 +++++++-- .../Xml/XElementAssertions.cs | 2 +- .../Xml/XmlElementAssertions.cs | 1 - Src/FluentAssertions/Xml/XmlNodeAssertions.cs | 2 +- .../BasicSpecs.cs | 2 + .../DictionarySpecs.cs | 2 + .../SelectionRulesSpecs.MemberHiding.cs | 2 + .../Execution/AssertionScopeSpecs.cs | 4 +- .../Primitives/ObjectAssertionSpecs.cs | 2 + .../Types/TypeSelectorSpecs.cs | 4 +- 44 files changed, 180 insertions(+), 108 deletions(-) rename Src/FluentAssertions/Common/{DictionaryHelpers.cs => KeyValuePairCollectionExtensions.cs} (67%) diff --git a/Src/FluentAssertions/CallerIdentifier.cs b/Src/FluentAssertions/CallerIdentifier.cs index 358931da78..4948e4ea0f 100644 --- a/Src/FluentAssertions/CallerIdentifier.cs +++ b/Src/FluentAssertions/CallerIdentifier.cs @@ -191,9 +191,7 @@ private static bool IsCompilerServices(StackFrame frame) private static IEnumerable ExtractCallersFrom(StackFrame frame) { - string[] identifiers = GetCallerIdentifiersFrom(frame); - - foreach (string identifier in identifiers) + foreach (string identifier in GetCallerIdentifiersFrom(frame)) { Logger(identifier); @@ -212,7 +210,7 @@ private static string[] GetCallerIdentifiersFrom(StackFrame frame) if (string.IsNullOrEmpty(fileName) || expectedLineNumber == 0) { - return null; + return []; } try diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index 43de5f4a8d..afff6d0f95 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -903,7 +903,8 @@ public AndWhichConstraint ContainEquivalentOf(TExp if (assertionChain.Succeeded) { - EquivalencyOptions options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); + EquivalencyOptions options = + config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); using var scope = new AssertionScope(); assertionChain.AddReportable("configuration", () => options.ToString()); @@ -1185,20 +1186,28 @@ public AndWhichConstraint ContainSingle( switch (actualItems.Count) { case 0: // Fail, Collection is empty + { assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} to contain a single item{reason}, but the collection is empty."); break; + } + case 1: // Success Condition + { match = actualItems.Single(); break; + } + default: // Fail, Collection contains more than a single item + { assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} to contain a single item{reason}, but found {0}.", Subject); break; + } } } @@ -2405,7 +2414,8 @@ public AndConstraint NotContainEquivalentOf(TExpectat if (assertionChain.Succeeded) { - EquivalencyOptions options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); + EquivalencyOptions options = + config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); var foundIndices = new List(); @@ -2613,7 +2623,7 @@ public AndConstraint NotContainInConsecutiveOrder(IEnumerable un .FailWith( "Expected {context:collection} {0} to not contain items {1} in consecutive order{reason}, " + "but items appeared in order ending at index {2}.", - Subject, unexpectedItems, (subjectIndex + consecutiveItems) - 2); + Subject, unexpectedItems, subjectIndex + consecutiveItems - 2); } subjectIndex++; @@ -3042,7 +3052,7 @@ public AndConstraint AllSatisfy(Action expected, [StringSyntax(" if (failuresFromInspectors.Length > 0) { string failureMessage = Environment.NewLine - + string.Join(Environment.NewLine, failuresFromInspectors.Select(x => x.IndentLines())); + + string.Join(Environment.NewLine, failuresFromInspectors.Select(x => x.IndentLines())); assertionChain .BecauseOf(because, becauseArgs) @@ -3126,7 +3136,7 @@ public AndConstraint SatisfyRespectively(IEnumerable> exp if (failuresFromInspectors.Length > 0) { string failureMessage = Environment.NewLine - + string.Join(Environment.NewLine, failuresFromInspectors.Select(x => x.IndentLines())); + + string.Join(Environment.NewLine, failuresFromInspectors.Select(x => x.IndentLines())); assertionChain .BecauseOf(because, becauseArgs) @@ -3211,8 +3221,8 @@ public AndConstraint Satisfy(IEnumerable>> message += doubleNewLine + "The following predicates did not have matching elements:"; message += doubleNewLine + - string.Join(Environment.NewLine, - unmatchedPredicates.Select(predicate => Formatter.ToString(predicate.Expression))); + string.Join(Environment.NewLine, + unmatchedPredicates.Select(predicate => Formatter.ToString(predicate.Expression))); } List> unmatchedElements = maximumMatchingSolution.GetUnmatchedElements(); @@ -3478,7 +3488,7 @@ private static T SuccessorOf(T predecessor, TCollection subject) { IList collection = subject.ConvertOrCastToList(); int index = collection.IndexOf(predecessor); - return index < (collection.Count - 1) ? collection[index + 1] : default; + return index < collection.Count - 1 ? collection[index + 1] : default; } private string[] CollectFailuresFromInspectors(IEnumerable> elementInspectors) @@ -3598,7 +3608,7 @@ private AndConstraint> BeInOrder( assertionChain .BecauseOf(because, becauseArgs) .FailWith("Expected {context:collection} to be in " + sortOrder + - " order{reason}, but found {0} where item at index {1} is in wrong order.", + " order{reason}, but found {0} where item at index {1} is in wrong order.", actualItems, index); return new AndConstraint>( diff --git a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs index 51331ba9c7..68f3c66a4a 100644 --- a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs @@ -68,8 +68,8 @@ public AndConstraint Equal(T expected, if (assertionChain.Succeeded) { - IEnumerable subjectKeys = GetKeys(Subject); - IEnumerable expectedKeys = GetKeys(expected); + ICollection subjectKeys = GetKeys(Subject).ConvertOrCastToCollection(); + ICollection expectedKeys = GetKeys(expected).ConvertOrCastToCollection(); IEnumerable missingKeys = expectedKeys.Except(subjectKeys); IEnumerable additionalKeys = subjectKeys.Except(expectedKeys); @@ -139,8 +139,8 @@ public AndConstraint NotEqual(T unexpected, .FailWith("Expected dictionaries not to be equal{reason}, but they both reference the same object."); } - IEnumerable subjectKeys = GetKeys(Subject); - IEnumerable unexpectedKeys = GetKeys(unexpected); + IEnumerable subjectKeys = GetKeys(Subject).ConvertOrCastToCollection(); + IEnumerable unexpectedKeys = GetKeys(unexpected).ConvertOrCastToCollection(); IEnumerable missingKeys = unexpectedKeys.Except(subjectKeys); IEnumerable additionalKeys = subjectKeys.Except(unexpectedKeys); @@ -665,7 +665,7 @@ public AndConstraint Contain(params KeyValuePair[] ex /// /// is . /// is empty. - [SuppressMessage("Design", "MA0051:Method is too long", Justification = "Needs refactoring")] + [SuppressMessage("Class Design", "AV1010:Member hides inherited member")] public new AndConstraint Contain(IEnumerable> expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { @@ -750,6 +750,7 @@ public AndConstraint Contain(params KeyValuePair[] ex /// /// Zero or more objects to format using the placeholders in . /// + [SuppressMessage("Class Design", "AV1010:Member hides inherited member")] public new AndConstraint Contain(KeyValuePair expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { @@ -835,6 +836,7 @@ public AndConstraint NotContain(params KeyValuePair[] /// /// is . /// is empty. + [SuppressMessage("Class Design", "AV1010:Member hides inherited member")] public new AndConstraint NotContain(IEnumerable> items, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { @@ -903,6 +905,7 @@ public AndConstraint NotContain(params KeyValuePair[] /// /// Zero or more objects to format using the placeholders in . /// + [SuppressMessage("Class Design", "AV1010:Member hides inherited member")] public new AndConstraint NotContain(KeyValuePair item, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { diff --git a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs index f6a9482bee..20fcd05306 100644 --- a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs @@ -53,6 +53,7 @@ public StringCollectionAssertions(TCollection actualValue, AssertionChain assert /// the element order, use instead. /// /// An with the expected elements. + [SuppressMessage("Class Design", "AV1010:Member hides inherited member")] public new AndConstraint Equal(params string[] expected) { return base.Equal(expected.AsEnumerable()); diff --git a/Src/FluentAssertions/Common/ExpressionExtensions.cs b/Src/FluentAssertions/Common/ExpressionExtensions.cs index 3d287828d1..bca2089a11 100644 --- a/Src/FluentAssertions/Common/ExpressionExtensions.cs +++ b/Src/FluentAssertions/Common/ExpressionExtensions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Linq.Expressions; using System.Reflection; @@ -37,10 +38,9 @@ private static MemberInfo AttemptToGetMemberInfoFromExpression(Expres /// E.g. ["Parent.Child.Sibling.Name"] or ["A.Dotted.Path1", "A.Dotted.Path2"]. /// /// is . -#pragma warning disable MA0051 + [SuppressMessage("Maintainability", "AV1500:Member or local function contains too many statements")] public static IEnumerable GetMemberPaths( this Expression> expression) -#pragma warning restore MA0051 { Guard.ThrowIfArgumentIsNull(expression, nameof(expression), "Expected an expression, but found ."); @@ -56,36 +56,47 @@ public static IEnumerable GetMemberPaths GetMemberPaths GetMemberPaths( #pragma warning restore IDE0010 { case ExpressionType.Lambda: + { node = ((LambdaExpression)node).Body; break; + } case ExpressionType.Convert: case ExpressionType.ConvertChecked: + { var unaryExpression = (UnaryExpression)node; node = unaryExpression.Operand; break; + } case ExpressionType.MemberAccess: + { var memberExpression = (MemberExpression)node; node = memberExpression.Expression; break; + } case ExpressionType.ArrayIndex: + { var binaryExpression = (BinaryExpression)node; node = binaryExpression.Left; break; + } case ExpressionType.Parameter: + { node = null; break; + } case ExpressionType.Call: + { var methodCallExpression = (MethodCallExpression)node; if (methodCallExpression is not { Method.Name: "get_Item", Arguments: [ConstantExpression] }) @@ -201,9 +229,12 @@ public static void ValidateMemberPath( node = methodCallExpression.Object; break; + } default: + { throw new ArgumentException(GetUnsupportedExpressionMessage(expression.Body), nameof(expression)); + } } } } diff --git a/Src/FluentAssertions/Common/IClock.cs b/Src/FluentAssertions/Common/IClock.cs index 9e711b48bb..ad953a8ad3 100644 --- a/Src/FluentAssertions/Common/IClock.cs +++ b/Src/FluentAssertions/Common/IClock.cs @@ -19,7 +19,6 @@ public interface IClock /// Creates a task that will complete after a time delay. ///
/// The time span to wait before completing the returned task - /// /// A task that represents the time delay. /// Task DelayAsync(TimeSpan delay, CancellationToken cancellationToken); diff --git a/Src/FluentAssertions/Common/DictionaryHelpers.cs b/Src/FluentAssertions/Common/KeyValuePairCollectionExtensions.cs similarity index 67% rename from Src/FluentAssertions/Common/DictionaryHelpers.cs rename to Src/FluentAssertions/Common/KeyValuePairCollectionExtensions.cs index 9570577726..1b2cbc65ce 100644 --- a/Src/FluentAssertions/Common/DictionaryHelpers.cs +++ b/Src/FluentAssertions/Common/KeyValuePairCollectionExtensions.cs @@ -4,7 +4,7 @@ namespace FluentAssertions.Common; -internal static class DictionaryHelpers +internal static class KeyValuePairCollectionExtensions { public static IEnumerable GetKeys(this TCollection collection) where TCollection : IEnumerable> @@ -31,18 +31,13 @@ public static IEnumerable GetValues(this TCol public static bool ContainsKey(this TCollection collection, TKey key) where TCollection : IEnumerable> { + Func areSameOrEqual = ObjectExtensions.GetComparer(); return collection switch { IDictionary dictionary => dictionary.ContainsKey(key), IReadOnlyDictionary readOnlyDictionary => readOnlyDictionary.ContainsKey(key), - _ => ContainsKey(collection, key), + _ => collection.Any(kvp => areSameOrEqual(kvp.Key, key)), }; - - static bool ContainsKey(TCollection collection, TKey key) - { - Func areSameOrEqual = ObjectExtensions.GetComparer(); - return collection.Any(kvp => areSameOrEqual(kvp.Key, key)); - } } public static bool TryGetValue(this TCollection collection, TKey key, out TValue value) @@ -52,41 +47,37 @@ public static bool TryGetValue(this TCollection colle { IDictionary dictionary => dictionary.TryGetValue(key, out value), IReadOnlyDictionary readOnlyDictionary => readOnlyDictionary.TryGetValue(key, out value), - _ => TryGetValue(collection, key, out value), + _ => TryGetValueLocal(collection, key, out value), }; + } - static bool TryGetValue(TCollection collection, TKey key, out TValue value) - { - Func areSameOrEqual = ObjectExtensions.GetComparer(); + private static bool TryGetValueLocal(TCollection collection, TKey key, out TValue value) + where TCollection : IEnumerable> + { + Func areSameOrEqual = ObjectExtensions.GetComparer(); - foreach (var kvp in collection) + foreach (var kvp in collection) + { + if (areSameOrEqual(kvp.Key, key)) { - if (areSameOrEqual(kvp.Key, key)) - { - value = kvp.Value; - return true; - } + value = kvp.Value; + return true; } - - value = default; - return false; } + + value = default; + return false; } public static TValue GetValue(this TCollection collection, TKey key) where TCollection : IEnumerable> { + Func areSameOrEqual = ObjectExtensions.GetComparer(); return collection switch { IDictionary dictionary => dictionary[key], IReadOnlyDictionary readOnlyDictionary => readOnlyDictionary[key], - _ => GetValue(collection, key), + _ => collection.First(kvp => areSameOrEqual(kvp.Key, key)).Value, }; - - static TValue GetValue(TCollection collection, TKey key) - { - Func areSameOrEqual = ObjectExtensions.GetComparer(); - return collection.First(kvp => areSameOrEqual(kvp.Key, key)).Value; - } } } diff --git a/Src/FluentAssertions/Common/MemberPath.cs b/Src/FluentAssertions/Common/MemberPath.cs index 5679ad3594..58334bcbca 100644 --- a/Src/FluentAssertions/Common/MemberPath.cs +++ b/Src/FluentAssertions/Common/MemberPath.cs @@ -17,7 +17,7 @@ internal class MemberPath private string[] segments; - private static readonly MemberPathSegmentEqualityComparer MemberPathSegmentEqualityComparer = new(); + private static readonly MemberPathSegmentEqualityComparer SegmentEqualityComparer = new(); public MemberPath(IMember member, string parentPath) : this(member.ReflectedType, member.DeclaringType, parentPath.Combine(member.Expectation.Name)) @@ -63,7 +63,7 @@ public bool IsSameAs(MemberPath candidate) { string[] candidateSegments = candidate.Segments; - return candidateSegments.SequenceEqual(Segments, MemberPathSegmentEqualityComparer); + return candidateSegments.SequenceEqual(Segments, SegmentEqualityComparer); } return false; @@ -74,7 +74,7 @@ private bool IsParentOf(MemberPath candidate) string[] candidateSegments = candidate.Segments; return candidateSegments.Length > Segments.Length && - candidateSegments.Take(Segments.Length).SequenceEqual(Segments, MemberPathSegmentEqualityComparer); + candidateSegments.Take(Segments.Length).SequenceEqual(Segments, SegmentEqualityComparer); } private bool IsChildOf(MemberPath candidate) @@ -83,7 +83,7 @@ private bool IsChildOf(MemberPath candidate) return candidateSegments.Length < Segments.Length && candidateSegments.SequenceEqual(Segments.Take(candidateSegments.Length), - MemberPathSegmentEqualityComparer); + SegmentEqualityComparer); } public MemberPath AsParentCollectionOf(MemberPath nextPath) @@ -103,7 +103,7 @@ public bool IsEquivalentTo(string path) public bool HasSameParentAs(MemberPath path) { return Segments.Length == path.Segments.Length - && GetParentSegments().SequenceEqual(path.GetParentSegments(), MemberPathSegmentEqualityComparer); + && GetParentSegments().SequenceEqual(path.GetParentSegments(), SegmentEqualityComparer); } private IEnumerable GetParentSegments() => Segments.Take(Segments.Length - 1); diff --git a/Src/FluentAssertions/Common/MethodInfoExtensions.cs b/Src/FluentAssertions/Common/MethodInfoExtensions.cs index 5219f0570b..560bd5498c 100644 --- a/Src/FluentAssertions/Common/MethodInfoExtensions.cs +++ b/Src/FluentAssertions/Common/MethodInfoExtensions.cs @@ -14,7 +14,7 @@ internal static class MethodInfoExtensions /// They are a subset of which can be checked on a type and therefore this mask has to be applied to check only for options. ///
private static readonly Lazy ImplementationOptionsMask = - new(() => Enum.GetValues(typeof(MethodImplOptions)).Cast().Sum(x => x)); + new(() => Enum.GetValues(typeof(MethodImplOptions)).Cast().Sum(optionValue => optionValue)); internal static bool IsAsync(this MethodInfo methodInfo) { @@ -45,7 +45,7 @@ internal static bool IsNonVirtual(this MethodInfo method) return !method.IsVirtual || method.IsFinal; } - private static (bool success, MethodImplAttribute attribute) RecreateMethodImplAttribute(MethodBase methodBase) + private static (bool Success, MethodImplAttribute Attribute) RecreateMethodImplAttribute(MethodBase methodBase) { MethodImplAttributes implementationFlags = methodBase.MethodImplementationFlags; diff --git a/Src/FluentAssertions/Common/StringExtensions.cs b/Src/FluentAssertions/Common/StringExtensions.cs index 88e164df1a..859f375f19 100644 --- a/Src/FluentAssertions/Common/StringExtensions.cs +++ b/Src/FluentAssertions/Common/StringExtensions.cs @@ -99,7 +99,6 @@ public static string Capitalize(this string @this) /// /// Appends tab character at the beginning of each line in a string. /// - /// public static string IndentLines(this string @this) { return string.Join(Environment.NewLine, diff --git a/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs b/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs index b01bfcd99c..4676e9c890 100644 --- a/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs +++ b/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs @@ -1,3 +1,4 @@ +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Common; using FluentAssertions.Formatting; @@ -19,6 +20,7 @@ public string ValueFormatterAssembly public ValueFormatterDetectionMode ValueFormatterDetectionMode { get; set; } + [SuppressMessage("Class Design", "AV1010:Member hides inherited member")] internal new GlobalFormattingOptions Clone() { return new GlobalFormattingOptions diff --git a/Src/FluentAssertions/Equivalency/Digit.cs b/Src/FluentAssertions/Equivalency/Digit.cs index 29d8f9ddb0..123b552896 100644 --- a/Src/FluentAssertions/Equivalency/Digit.cs +++ b/Src/FluentAssertions/Equivalency/Digit.cs @@ -5,13 +5,13 @@ namespace FluentAssertions.Equivalency; internal class Digit { private readonly int length; - private readonly Digit nextDigit; + private readonly Digit next; private int index; - public Digit(int length, Digit nextDigit) + public Digit(int length, Digit next) { this.length = length; - this.nextDigit = nextDigit; + this.next = next; } public int[] GetIndices() @@ -23,7 +23,7 @@ public int[] GetIndices() while (digit is not null) { indices.Add(digit.index); - digit = digit.nextDigit; + digit = digit.next; } return indices.ToArray(); @@ -31,7 +31,7 @@ public int[] GetIndices() public bool Increment() { - bool success = nextDigit?.Increment() == true; + bool success = next?.Increment() == true; if (!success) { diff --git a/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs b/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs index 57d58d62d7..1d1c62864a 100644 --- a/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs +++ b/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs @@ -48,24 +48,29 @@ public EqualityStrategy GetEqualityStrategy(Type type) { return EqualityStrategy.ForceMembers; } - else if (valueTypes.Count > 0 && valueTypes.Exists(t => typeKey.IsSameOrInherits(t))) + + if (valueTypes.Count > 0 && valueTypes.Exists(t => typeKey.IsSameOrInherits(t))) { return EqualityStrategy.ForceEquals; } - else if (!typeKey.IsPrimitive && referenceTypes.Count > 0 && - referenceTypes.Exists(t => typeKey.IsAssignableToOpenGeneric(t))) + + if (!typeKey.IsPrimitive && referenceTypes.Count > 0 && + referenceTypes.Exists(t => typeKey.IsAssignableToOpenGeneric(t))) { return EqualityStrategy.ForceMembers; } - else if (valueTypes.Count > 0 && valueTypes.Exists(t => typeKey.IsAssignableToOpenGeneric(t))) + + if (valueTypes.Count > 0 && valueTypes.Exists(t => typeKey.IsAssignableToOpenGeneric(t))) { return EqualityStrategy.ForceEquals; } - else if ((compareRecordsByValue.HasValue || defaultStrategy is null) && typeKey.IsRecord()) + + if ((compareRecordsByValue != null || defaultStrategy is null) && typeKey.IsRecord()) { return compareRecordsByValue is true ? EqualityStrategy.ForceEquals : EqualityStrategy.ForceMembers; } - else if (defaultStrategy is not null) + + if (defaultStrategy is not null) { return defaultStrategy(typeKey); } diff --git a/Src/FluentAssertions/Equivalency/IMemberMatchingRule.cs b/Src/FluentAssertions/Equivalency/IMemberMatchingRule.cs index 0a59d796eb..4354dee1b5 100644 --- a/Src/FluentAssertions/Equivalency/IMemberMatchingRule.cs +++ b/Src/FluentAssertions/Equivalency/IMemberMatchingRule.cs @@ -23,9 +23,6 @@ public interface IMemberMatchingRule /// /// The subject object for which a matching member must be returned. Can never be . /// - /// - /// - /// /// /// Returns the of the property with which to compare the subject with, or /// if no match was found. diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index 5bf49e5958..720906b45e 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -15,7 +15,7 @@ namespace FluentAssertions.Equivalency; -#pragma warning disable CA1033 //An unsealed externally visible type provides an explicit method implementation of a public interface and does not provide an alternative externally visible method that has the same name. +#pragma warning disable CA1033 // An unsealed externally visible type provides an explicit method implementation of a public interface and does not provide an alternative externally visible method that has the same name. /// /// Represents the run-time behavior of a structural equivalency assertion. @@ -793,7 +793,6 @@ internal IEqualityComparer GetStringComparerOrDefault() /// A string that represents the current object. /// /// 2 - [SuppressMessage("Design", "MA0051:Method is too long")] public override string ToString() { var builder = new StringBuilder(); @@ -863,6 +862,7 @@ public override string ToString() /// /// Defines additional overrides when used with /// + [SuppressMessage("Design", "CA1034:Nested types should not be visible")] public class Restriction { private readonly Action> action; diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs b/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs index 70b21e82f9..0cf246e82d 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs @@ -39,15 +39,21 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon switch (context.Options.EnumEquivalencyHandling) { case EnumEquivalencyHandling.ByValue: + { HandleByValue(assertionChain, comparands, context.Reason); break; + } case EnumEquivalencyHandling.ByName: + { HandleByName(assertionChain, comparands, context.Reason); break; + } default: + { throw new InvalidOperationException($"Do not know how to handle {context.Options.EnumEquivalencyHandling}"); + } } } diff --git a/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs index 01b58bb808..1d398fdcd2 100644 --- a/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; using FluentAssertions.Execution; @@ -154,6 +155,7 @@ private static void FailWithLengthDifference(missingKeys, additionalKeys); } + [SuppressMessage("Maintainability", "AV1561:Signature contains too many parameters")] private static void AssertDictionaryEquivalence(Comparands comparands, AssertionChain assertionChain, IEquivalencyValidationContext context, IValidateChildNodeEquivalency parent, DictionaryInterfaceInfo actualDictionary, @@ -164,6 +166,7 @@ private static void AssertDictionaryEquivalence(Comparands comparands, Assertion .Invoke(null, [assertionChain, context, parent, context.Options, comparands.Subject, comparands.Expectation]); } + [SuppressMessage("Maintainability", "AV1561:Signature contains too many parameters")] private static void AssertDictionaryEquivalence( AssertionChain assertionChain, EquivalencyValidationContext context, diff --git a/Src/FluentAssertions/Execution/AssertionChain.cs b/Src/FluentAssertions/Execution/AssertionChain.cs index 050fa1ab98..7e9a3c77aa 100644 --- a/Src/FluentAssertions/Execution/AssertionChain.cs +++ b/Src/FluentAssertions/Execution/AssertionChain.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; @@ -221,10 +221,9 @@ public Continuation FailWith(string message, params object[] args) public Continuation FailWith(string message, params Func[] argProviders) { - return FailWith( - () => new FailReason( - message, - argProviders.Select(a => a()).ToArray())); + return FailWith(() => new FailReason( + message, + argProviders.Select(a => a()).ToArray())); } public Continuation FailWith(Func getFailureReason) diff --git a/Src/FluentAssertions/Execution/AssertionScope.cs b/Src/FluentAssertions/Execution/AssertionScope.cs index 67ab3576f7..53c56c0c79 100644 --- a/Src/FluentAssertions/Execution/AssertionScope.cs +++ b/Src/FluentAssertions/Execution/AssertionScope.cs @@ -73,7 +73,7 @@ private AssertionScope(Func name, IAssertionStrategy assertionStrategy) CurrentScope.Value = this; this.assertionStrategy = assertionStrategy - ?? throw new ArgumentNullException(nameof(assertionStrategy)); + ?? throw new ArgumentNullException(nameof(assertionStrategy)); if (parent is not null) { diff --git a/Src/FluentAssertions/Execution/LateBoundTestFramework.cs b/Src/FluentAssertions/Execution/LateBoundTestFramework.cs index 6f044410da..010150d46a 100644 --- a/Src/FluentAssertions/Execution/LateBoundTestFramework.cs +++ b/Src/FluentAssertions/Execution/LateBoundTestFramework.cs @@ -11,9 +11,9 @@ internal abstract class LateBoundTestFramework : ITestFramework _ => throw new InvalidOperationException($"{nameof(IsAvailable)} must be called first."); /// - /// When set to true, the assembly specified by the AssemblyName property will + /// When set to , the assembly specified by the property will /// be dynamically loaded if it is not already loaded in the application domain. - /// When set to false, the framework will not attempt to load the assembly dynamically. + /// When set to , the framework will not attempt to load the assembly dynamically. /// protected bool LoadAssembly { get; init; } diff --git a/Src/FluentAssertions/Execution/StringExtensions.cs b/Src/FluentAssertions/Execution/StringExtensions.cs index 1e120616c3..ab1b13eb16 100644 --- a/Src/FluentAssertions/Execution/StringExtensions.cs +++ b/Src/FluentAssertions/Execution/StringExtensions.cs @@ -3,20 +3,16 @@ namespace FluentAssertions.Execution; internal static class StringExtensions { /// - /// Can be used + /// Wraps the specified string in a to prevent any formatting applied during output. /// - /// - /// public static WithoutFormattingWrapper AsNonFormattable(this string value) { return new WithoutFormattingWrapper(value); } /// - /// Can be used + /// Wraps the specified value in a to prevent any formatting applied during output. /// - /// - /// public static WithoutFormattingWrapper AsNonFormattable(this object value) { return new WithoutFormattingWrapper(value?.ToString()); diff --git a/Src/FluentAssertions/Extensions/FluentDateTimeExtensions.cs b/Src/FluentAssertions/Extensions/FluentDateTimeExtensions.cs index a9068bad60..fea03e6028 100644 --- a/Src/FluentAssertions/Extensions/FluentDateTimeExtensions.cs +++ b/Src/FluentAssertions/Extensions/FluentDateTimeExtensions.cs @@ -1,4 +1,6 @@ -using System; +#pragma warning disable AV1561 // Don’t declare signatures with more than 3 parameters + +using System; using System.Diagnostics; using FluentAssertions.Common; @@ -311,3 +313,5 @@ public static DateTimeOffset WithOffset(this DateTime self, TimeSpan offset) return self.ToDateTimeOffset(offset); } } + +#pragma warning restore AV1561 diff --git a/Src/FluentAssertions/Formatting/FlushedLineState.cs b/Src/FluentAssertions/Formatting/FlushedLineState.cs index 4697c7d686..274a68de95 100644 --- a/Src/FluentAssertions/Formatting/FlushedLineState.cs +++ b/Src/FluentAssertions/Formatting/FlushedLineState.cs @@ -6,7 +6,6 @@ namespace FluentAssertions.Formatting; /// Represents the behavior of when most of the appending and inserting /// has completed, and it no longer needs an internal . /// -/// internal class FlushedLineState(string content) : ILineState { private string content = content; diff --git a/Src/FluentAssertions/Formatting/Formatter.cs b/Src/FluentAssertions/Formatting/Formatter.cs index c55e0db303..17e0e7a957 100644 --- a/Src/FluentAssertions/Formatting/Formatter.cs +++ b/Src/FluentAssertions/Formatting/Formatter.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using FluentAssertions.Common; using FluentAssertions.Equivalency.Execution; @@ -127,6 +128,7 @@ public static string ToString(object value, FormattingOptions options = null) } } + [SuppressMessage("Maintainability", "AV1561:Signature contains too many parameters")] private static void FormatChild(string path, object value, FormattedObjectGraph output, FormattingContext context, FormattingOptions options, ObjectGraph graph) { diff --git a/Src/FluentAssertions/NumericAssertionsExtensions.cs b/Src/FluentAssertions/NumericAssertionsExtensions.cs index 579170798d..01e48fe96b 100644 --- a/Src/FluentAssertions/NumericAssertionsExtensions.cs +++ b/Src/FluentAssertions/NumericAssertionsExtensions.cs @@ -354,6 +354,7 @@ public static AndConstraint> BeCloseTo(this NumericAsse return new AndConstraint>(parent); } + [SuppressMessage("Maintainability", "AV1561:Signature contains too many parameters")] private static void FailIfValueOutsideBounds(AssertionChain assertionChain, bool valueWithinBounds, TValue nearbyValue, TDelta delta, TValue actualValue, [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) @@ -715,6 +716,7 @@ public static AndConstraint> NotBeCloseTo(this NumericA return new AndConstraint>(parent); } + [SuppressMessage("Maintainability", "AV1561:Signature contains too many parameters")] private static void FailIfValueInsideBounds( AssertionChain assertionChain, bool valueOutsideBounds, @@ -1130,6 +1132,7 @@ public static AndConstraint> BeApproximately(this Num return new AndConstraint>(parent); } + [SuppressMessage("Maintainability", "AV1561:Signature contains too many parameters")] private static void FailIfDifferenceOutsidePrecision( bool differenceWithinPrecision, NumericAssertions parent, T expectedValue, T precision, T actualDifference, @@ -1525,6 +1528,7 @@ public static AndConstraint> NotBeApproximately(this return new AndConstraint>(parent); } + [SuppressMessage("Maintainability", "AV1561:Signature contains too many parameters")] private static void FailIfDifferenceWithinPrecision( NumericAssertions parent, bool differenceOutsidePrecision, T unexpectedValue, T precision, T actualDifference, diff --git a/Src/FluentAssertions/ObjectAssertionsExtensions.cs b/Src/FluentAssertions/ObjectAssertionsExtensions.cs index 72b8cf5764..319548a6ae 100644 --- a/Src/FluentAssertions/ObjectAssertionsExtensions.cs +++ b/Src/FluentAssertions/ObjectAssertionsExtensions.cs @@ -15,7 +15,6 @@ public static class ObjectAssertionsExtensions /// Asserts that an object can be serialized and deserialized using the data contract serializer and that it stills retains /// the values of all members. /// - /// /// /// 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. @@ -33,7 +32,6 @@ public static AndConstraint BeDataContractSerializable(this Ob /// Asserts that an object can be serialized and deserialized using the data contract serializer and that it stills retains /// the values of all members. /// - /// /// /// A reference to the configuration object that can be used /// to influence the way the object graphs are compared. You can also provide an alternative instance of the @@ -89,7 +87,6 @@ private static object CreateCloneUsingDataContractSerializer(object subject) /// Asserts that an object can be serialized and deserialized using the XML serializer and that it stills retains /// the values of all members. /// - /// /// /// 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. @@ -120,6 +117,7 @@ public static AndConstraint BeXmlSerializable(this ObjectAsser return new AndConstraint(assertions); } + [SuppressMessage("Security", "CA5369:Use XmlReader for \'XmlSerializer.Deserialize()\'")] private static object CreateCloneUsingXmlSerializer(object subject) { using var stream = new MemoryStream(); diff --git a/Src/FluentAssertions/Primitives/StringAssertions.cs b/Src/FluentAssertions/Primitives/StringAssertions.cs index ab9398dfcf..6c4a8a9833 100644 --- a/Src/FluentAssertions/Primitives/StringAssertions.cs +++ b/Src/FluentAssertions/Primitives/StringAssertions.cs @@ -1593,7 +1593,7 @@ public AndConstraint NotContain(string unexpected, public AndConstraint NotContainAll(IEnumerable values, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - IList strings = values?.ConvertOrCastToList(); + ICollection strings = values?.ConvertOrCastToCollection(); ThrowIfValuesNullOrEmpty(strings); var matches = strings!.Count(v => Contains(Subject, v, StringComparison.Ordinal)); diff --git a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs index ba26a0307a..2bb4ff376f 100644 --- a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs @@ -58,6 +58,10 @@ public void AssertForEquality(AssertionChain assertionChain, string subject, str expected, subject); } } + else + { + // Then it's fine + } } public void AssertNeitherIsNull(AssertionChain assertionChain, string subject, string expected) diff --git a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs index 6f6d2e8838..a775860198 100644 --- a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs @@ -313,7 +313,7 @@ public async Task> NotThrowAsync([StringS /// /// Invokes the subject and measures the sync execution time. /// - private protected (TTask result, TimeSpan remainingTime) InvokeWithTimer(TimeSpan timeSpan) + private protected (TTask Result, TimeSpan RemainingTime) InvokeWithTimer(TimeSpan timeSpan) { ITimer timer = Clock.StartTimer(); TTask result = Subject.Invoke(); diff --git a/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs b/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs index 0dfaf1446d..b87cd19fc3 100644 --- a/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs @@ -33,7 +33,7 @@ public ExecutionTimeAssertions(ExecutionTime executionTime, AssertionChain asser /// Polling stops when condition returns the expected result. /// The rate at which the condition is re-checked. /// The elapsed time. (use this, don't measure twice) - private (bool isRunning, TimeSpan elapsed) PollUntil(Func condition, bool expectedResult, TimeSpan rate) + private (bool IsRunning, TimeSpan Elapsed) PollUntil(Func condition, bool expectedResult, TimeSpan rate) { TimeSpan elapsed = execution.ElapsedTime; bool isRunning = execution.IsRunning; diff --git a/Src/FluentAssertions/Specialized/FunctionAssertions.cs b/Src/FluentAssertions/Specialized/FunctionAssertions.cs index 99d5561c30..4a093c1444 100644 --- a/Src/FluentAssertions/Specialized/FunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/FunctionAssertions.cs @@ -112,6 +112,7 @@ public AndWhichConstraint, T> NotThrowAfter(TimeSpan waitT return new AndWhichConstraint, T>(this, result, assertionChain, ".Result"); } + [SuppressMessage("Maintainability", "AV1561:Signature contains too many parameters")] internal TResult NotThrowAfter(Func subject, IClock clock, TimeSpan waitTime, TimeSpan pollInterval, [StringSyntax("CompositeFormat")] string because, object[] becauseArgs) { diff --git a/Src/FluentAssertions/Types/AssemblyAssertions.cs b/Src/FluentAssertions/Types/AssemblyAssertions.cs index c133a77deb..f0ba014e31 100644 --- a/Src/FluentAssertions/Types/AssemblyAssertions.cs +++ b/Src/FluentAssertions/Types/AssemblyAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; diff --git a/Src/FluentAssertions/Types/ConstructorInfoAssertions.cs b/Src/FluentAssertions/Types/ConstructorInfoAssertions.cs index 8c1d105952..c65c9d8cfd 100644 --- a/Src/FluentAssertions/Types/ConstructorInfoAssertions.cs +++ b/Src/FluentAssertions/Types/ConstructorInfoAssertions.cs @@ -14,7 +14,6 @@ public class ConstructorInfoAssertions : MethodBaseAssertions class. /// /// The constructorInfo from which to select properties. - /// public ConstructorInfoAssertions(ConstructorInfo constructorInfo, AssertionChain assertionChain) : base(constructorInfo, assertionChain) { diff --git a/Src/FluentAssertions/Types/TypeAssertions.cs b/Src/FluentAssertions/Types/TypeAssertions.cs index 37699196a0..3fc3d8fdac 100644 --- a/Src/FluentAssertions/Types/TypeAssertions.cs +++ b/Src/FluentAssertions/Types/TypeAssertions.cs @@ -15,6 +15,7 @@ namespace FluentAssertions.Types; /// Contains a number of methods to assert that a meets certain expectations. /// [DebuggerNonUserCode] +[SuppressMessage("Class Design", "AV1010:Member hides inherited member")] public class TypeAssertions : ReferenceTypeAssertions { private readonly AssertionChain assertionChain; diff --git a/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs b/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs index acc0021125..79290986d4 100644 --- a/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs +++ b/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; @@ -85,6 +85,7 @@ private Failure Validate() #pragma warning restore IDE0010 { case XmlNodeType.Element: + { failure = ValidateStartElement(); if (failure is not null) @@ -114,24 +115,36 @@ private Failure Validate() { subjectIterator.MoveToEndElement(); } + else + { + // Both are either empty or not empty, so we can continue + } + // Both are either empty or not empty, so we can continue break; + } case XmlNodeType.EndElement: + { // No need to verify end element, if it doesn't match // the start element it isn't valid XML, so the parser // would handle that. currentNode.Pop(); currentNode = currentNode.Parent; break; + } case XmlNodeType.Text: + { failure = ValidateText(); break; + } default: + { throw new NotSupportedException( $"{expectationIterator.NodeType} found at {currentNode.GetXPath()} is not supported for equivalency comparison."); + } } if (failure is not null) @@ -167,9 +180,9 @@ private Failure ValidateAttributes() foreach (AttributeData subjectAttribute in subjectAttributes) { - AttributeData expectedAttribute = expectedAttributes.SingleOrDefault( - ea => ea.NamespaceUri == subjectAttribute.NamespaceUri - && ea.LocalName == subjectAttribute.LocalName); + AttributeData expectedAttribute = expectedAttributes.SingleOrDefault(ea => + ea.NamespaceUri == subjectAttribute.NamespaceUri + && ea.LocalName == subjectAttribute.LocalName); if (expectedAttribute is null) { diff --git a/Src/FluentAssertions/Xml/XElementAssertions.cs b/Src/FluentAssertions/Xml/XElementAssertions.cs index 42fa3e12a3..5570c5f2ef 100644 --- a/Src/FluentAssertions/Xml/XElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XElementAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/Src/FluentAssertions/Xml/XmlElementAssertions.cs b/Src/FluentAssertions/Xml/XmlElementAssertions.cs index 651eda0fd0..daeffcd3fd 100644 --- a/Src/FluentAssertions/Xml/XmlElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XmlElementAssertions.cs @@ -18,7 +18,6 @@ public class XmlElementAssertions : XmlNodeAssertions /// Initializes a new instance of the class. /// - /// public XmlElementAssertions(XmlElement xmlElement, AssertionChain assertionChain) : base(xmlElement, assertionChain) { diff --git a/Src/FluentAssertions/Xml/XmlNodeAssertions.cs b/Src/FluentAssertions/Xml/XmlNodeAssertions.cs index c47e1c8ca9..f903b7ec0a 100644 --- a/Src/FluentAssertions/Xml/XmlNodeAssertions.cs +++ b/Src/FluentAssertions/Xml/XmlNodeAssertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Xml; using FluentAssertions.Execution; diff --git a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs index de6f2016d0..bde7eee116 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Net; using FluentAssertions.Extensions; using Xunit; @@ -194,6 +195,7 @@ public class VirtualClass { public string Property { get; set; } + [SuppressMessage("Class Design", "AV1010:Member hides inherited member")] public new virtual bool Equals(object obj) { return obj is VirtualClass other && other.Property == Property; diff --git a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs index ddba50b1d3..ba15c61d19 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using FluentAssertions.Equivalency.Tracing; @@ -1304,6 +1305,7 @@ public void Custom_types_which_implementing_dictionaries_pass_with_swapped_subje internal class NonGenericChildDictionary : Dictionary { + [SuppressMessage("Class Design", "AV1010:Member hides inherited member")] public new void Add(string key, int value) { base.Add(key, value); diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.MemberHiding.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.MemberHiding.cs index d5f2e92317..8ef535eea8 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.MemberHiding.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.MemberHiding.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using JetBrains.Annotations; using Xunit; @@ -6,6 +7,7 @@ namespace FluentAssertions.Equivalency.Specs; public partial class SelectionRulesSpecs { + [SuppressMessage("Class Design", "AV1010:Member hides inherited member")] public class MemberHiding { [Fact] diff --git a/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs b/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs index a3279cd60a..9398f2e740 100644 --- a/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs +++ b/Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs @@ -366,9 +366,9 @@ public void ThrowIfAny(IDictionary context) } } -#pragma warning disable RCS1110, CA1050, S3903 // Declare type inside namespace. +#pragma warning disable MA0047 public class AssertionScopeSpecsWithoutNamespace -#pragma warning restore RCS1110, CA1050, S3903 // Declare type inside namespace. +#pragma warning restore MA0047 { [Fact] public void This_class_should_not_be_inside_a_namespace() diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs index e57f61e5d8..38970cc6c8 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; using FluentAssertions.Primitives; using Xunit; @@ -41,6 +42,7 @@ public void Should_throw_a_helpful_error_when_accidentally_using_equals() internal class DumbObjectEqualityComparer : IEqualityComparer { // ReSharper disable once MemberHidesStaticFromOuterClass + [SuppressMessage("Class Design", "AV1010:Member hides inherited member")] public new bool Equals(object x, object y) { return (x == y) || (x is not null && y is not null && x.Equals(y)); diff --git a/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs b/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs index 3d2306a0e3..024da6d991 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs @@ -885,8 +885,8 @@ internal enum InternalEnumValueType; internal interface InternalInterfaceNotValueType; } -#pragma warning disable RCS1110, S3903 // Declare type inside namespace. +#pragma warning disable MA0047 internal class ClassInGlobalNamespace; -#pragma warning restore RCS1110, S3903 +#pragma warning restore MA0047 #endregion From 16d63727089bf2498e76c185c48450bf134267bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 17:54:00 +0000 Subject: [PATCH 630/845] Bump cspell from 9.1.1 to 9.1.2 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 9.1.1 to 9.1.2. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.1.2/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.1.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 436 ++++++++++++++++++---------------------------- package.json | 2 +- 2 files changed, 169 insertions(+), 269 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2321e9b679..697887765c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,14 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.1.1" + "cspell": "^9.1.2" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.1.1.tgz", - "integrity": "sha512-AbaIez18Puo9SbnhYsZnzG90ohelWWFQVbEIdtwMmRRItoIevF8wcNkQrFeFCXINs+FZH+aDGkt7oA1dwKgJFA==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.1.2.tgz", + "integrity": "sha512-mdhxj7j1zqXYKO/KPx2MgN3RPAvqoWvncxz2dOMFBcuUteZPt58NenUoi0VZXEhV/FM2V80NvhHZZafaIcxVjQ==", "dependencies": { "@cspell/dict-ada": "^4.1.0", "@cspell/dict-al": "^1.1.0", @@ -57,7 +56,7 @@ "@cspell/dict-markdown": "^2.0.11", "@cspell/dict-monkeyc": "^1.0.10", "@cspell/dict-node": "^5.0.7", - "@cspell/dict-npm": "^5.2.6", + "@cspell/dict-npm": "^5.2.7", "@cspell/dict-php": "^4.0.14", "@cspell/dict-powershell": "^5.0.14", "@cspell/dict-public-licenses": "^2.0.13", @@ -67,7 +66,7 @@ "@cspell/dict-rust": "^4.0.11", "@cspell/dict-scala": "^5.0.7", "@cspell/dict-shell": "^1.1.0", - "@cspell/dict-software-terms": "^5.1.0", + "@cspell/dict-software-terms": "^5.1.1", "@cspell/dict-sql": "^2.2.0", "@cspell/dict-svelte": "^1.0.6", "@cspell/dict-swift": "^2.0.5", @@ -80,31 +79,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.1.1.tgz", - "integrity": "sha512-bvbBXr77yz0xu/6GckWMWoUyjSL5MqF86y7g0DkGnNpB5Bu5fCNAltR5yNo1xlBCtbUwB0zrlPENSSxRmNpPCA==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.1.2.tgz", + "integrity": "sha512-sSva/ACXDJd9LufzecR9LC+lNWUuGWNtVHdVj0orJxOIZjHUCNBXwVSgL2fmMg7jNQS6qoJFJ7F/QPXdwITijg==", "dependencies": { - "@cspell/cspell-types": "9.1.1" + "@cspell/cspell-types": "9.1.2" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-pipe": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.1.1.tgz", - "integrity": "sha512-WFh6+Fig//8Ev8mxBHjKiKhYfJHez5JyI2ioWBgh16EL08k5kfqIsANX8/ij+k0QvfObA4J4LRJ6RUoExvD+4g==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.1.2.tgz", + "integrity": "sha512-/pIhsf4SI4Q/kvehq9GsGKLgbQsRhiDgthQIgO6YOrEa761wOI2hVdRyc0Tgc1iAGiJEedDaFsAhabVRJBeo2g==", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.1.1.tgz", - "integrity": "sha512-nnHE6ZA4tGA0jU1Yco6OuXUwPvFqHrWqMwvbmOHRLPZRLrtbqKUQGxUuSHlM3aGLHBfaPZSZqBl5rvGyj2EX1Q==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.1.2.tgz", + "integrity": "sha512-dNDx7yMl2h1Ousk08lizTou+BUvce4RPSnPXrQPB7B7CscgZloSyuP3Yyj1Zt81pHNpggrym4Ezx6tMdyPjESw==", "dependencies": { "global-directory": "^4.0.1" }, @@ -113,19 +109,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.1.1.tgz", - "integrity": "sha512-0eFZe4dsEaETsNsqcFilWwfi2VRHRxldSkNZFGXf/QbamSK89VNf0X/q9CtAU90PVgJAzYevV2r6uyWX2poZpQ==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.1.2.tgz", + "integrity": "sha512-YOsUctzCMzEJbKdzNyvPkyMen/i7sGO3Xgcczn848GJPlRsJc50QwsoU67SY7zEARz6y2WS0tv5F5RMrRO4idw==", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.1.1.tgz", - "integrity": "sha512-xouQmxgAuEz+jnmyzQV6LoAKzwTt/wF1xjRgVW1ssMFDlRGPtvEOmfk3yk79Ror0AnHmA5O1xXpFQ/VgFU56MQ==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.1.2.tgz", + "integrity": "sha512-bSDDjoQi4pbh1BULEA596XCo1PMShTpTb4J2lj8jVYqYgXYQNjSmQFA1fj4NHesC84JpK1um4ybzXBcqtniC7Q==", "engines": { "node": ">=20" } @@ -133,26 +127,22 @@ "node_modules/@cspell/dict-ada": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.1.0.tgz", - "integrity": "sha512-7SvmhmX170gyPd+uHXrfmqJBY5qLcCX8kTGURPVeGxmt8XNXT75uu9rnZO+jwrfuU2EimNoArdVy5GZRGljGNg==", - "license": "MIT" + "integrity": "sha512-7SvmhmX170gyPd+uHXrfmqJBY5qLcCX8kTGURPVeGxmt8XNXT75uu9rnZO+jwrfuU2EimNoArdVy5GZRGljGNg==" }, "node_modules/@cspell/dict-al": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-al/-/dict-al-1.1.0.tgz", - "integrity": "sha512-PtNI1KLmYkELYltbzuoztBxfi11jcE9HXBHCpID2lou/J4VMYKJPNqe4ZjVzSI9NYbMnMnyG3gkbhIdx66VSXg==", - "license": "MIT" + "integrity": "sha512-PtNI1KLmYkELYltbzuoztBxfi11jcE9HXBHCpID2lou/J4VMYKJPNqe4ZjVzSI9NYbMnMnyG3gkbhIdx66VSXg==" }, "node_modules/@cspell/dict-aws": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.10.tgz", - "integrity": "sha512-0qW4sI0GX8haELdhfakQNuw7a2pnWXz3VYQA2MpydH2xT2e6EN9DWFpKAi8DfcChm8MgDAogKkoHtIo075iYng==", - "license": "MIT" + "integrity": "sha512-0qW4sI0GX8haELdhfakQNuw7a2pnWXz3VYQA2MpydH2xT2e6EN9DWFpKAi8DfcChm8MgDAogKkoHtIo075iYng==" }, "node_modules/@cspell/dict-bash": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.2.0.tgz", "integrity": "sha512-HOyOS+4AbCArZHs/wMxX/apRkjxg6NDWdt0jF9i9XkvJQUltMwEhyA2TWYjQ0kssBsnof+9amax2lhiZnh3kCg==", - "license": "MIT", "dependencies": { "@cspell/dict-shell": "1.1.0" } @@ -160,212 +150,177 @@ "node_modules/@cspell/dict-companies": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.2.1.tgz", - "integrity": "sha512-ryaeJ1KhTTKL4mtinMtKn8wxk6/tqD4vX5tFP+Hg89SiIXmbMk5vZZwVf+eyGUWJOyw5A1CVj9EIWecgoi+jYQ==", - "license": "MIT" + "integrity": "sha512-ryaeJ1KhTTKL4mtinMtKn8wxk6/tqD4vX5tFP+Hg89SiIXmbMk5vZZwVf+eyGUWJOyw5A1CVj9EIWecgoi+jYQ==" }, "node_modules/@cspell/dict-cpp": { "version": "6.0.8", "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.8.tgz", - "integrity": "sha512-BzurRZilWqaJt32Gif6/yCCPi+FtrchjmnehVEIFzbWyeBd/VOUw77IwrEzehZsu5cRU91yPWuWp5fUsKfDAXA==", - "license": "MIT" + "integrity": "sha512-BzurRZilWqaJt32Gif6/yCCPi+FtrchjmnehVEIFzbWyeBd/VOUw77IwrEzehZsu5cRU91yPWuWp5fUsKfDAXA==" }, "node_modules/@cspell/dict-cryptocurrencies": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-5.0.4.tgz", - "integrity": "sha512-6iFu7Abu+4Mgqq08YhTKHfH59mpMpGTwdzDB2Y8bbgiwnGFCeoiSkVkgLn1Kel2++hYcZ8vsAW/MJS9oXxuMag==", - "license": "MIT" + "integrity": "sha512-6iFu7Abu+4Mgqq08YhTKHfH59mpMpGTwdzDB2Y8bbgiwnGFCeoiSkVkgLn1Kel2++hYcZ8vsAW/MJS9oXxuMag==" }, "node_modules/@cspell/dict-csharp": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.6.tgz", - "integrity": "sha512-w/+YsqOknjQXmIlWDRmkW+BHBPJZ/XDrfJhZRQnp0wzpPOGml7W0q1iae65P2AFRtTdPKYmvSz7AL5ZRkCnSIw==", - "license": "MIT" + "integrity": "sha512-w/+YsqOknjQXmIlWDRmkW+BHBPJZ/XDrfJhZRQnp0wzpPOGml7W0q1iae65P2AFRtTdPKYmvSz7AL5ZRkCnSIw==" }, "node_modules/@cspell/dict-css": { "version": "4.0.17", "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.17.tgz", - "integrity": "sha512-2EisRLHk6X/PdicybwlajLGKF5aJf4xnX2uuG5lexuYKt05xV/J/OiBADmi8q9obhxf1nesrMQbqAt+6CsHo/w==", - "license": "MIT" + "integrity": "sha512-2EisRLHk6X/PdicybwlajLGKF5aJf4xnX2uuG5lexuYKt05xV/J/OiBADmi8q9obhxf1nesrMQbqAt+6CsHo/w==" }, "node_modules/@cspell/dict-dart": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.3.0.tgz", - "integrity": "sha512-1aY90lAicek8vYczGPDKr70pQSTQHwMFLbmWKTAI6iavmb1fisJBS1oTmMOKE4ximDf86MvVN6Ucwx3u/8HqLg==", - "license": "MIT" + "integrity": "sha512-1aY90lAicek8vYczGPDKr70pQSTQHwMFLbmWKTAI6iavmb1fisJBS1oTmMOKE4ximDf86MvVN6Ucwx3u/8HqLg==" }, "node_modules/@cspell/dict-data-science": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.8.tgz", - "integrity": "sha512-uyAtT+32PfM29wRBeAkUSbkytqI8bNszNfAz2sGPtZBRmsZTYugKMEO9eDjAIE/pnT9CmbjNuoiXhk+Ss4fCOg==", - "license": "MIT" + "integrity": "sha512-uyAtT+32PfM29wRBeAkUSbkytqI8bNszNfAz2sGPtZBRmsZTYugKMEO9eDjAIE/pnT9CmbjNuoiXhk+Ss4fCOg==" }, "node_modules/@cspell/dict-django": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.4.tgz", - "integrity": "sha512-fX38eUoPvytZ/2GA+g4bbdUtCMGNFSLbdJJPKX2vbewIQGfgSFJKY56vvcHJKAvw7FopjvgyS/98Ta9WN1gckg==", - "license": "MIT" + "integrity": "sha512-fX38eUoPvytZ/2GA+g4bbdUtCMGNFSLbdJJPKX2vbewIQGfgSFJKY56vvcHJKAvw7FopjvgyS/98Ta9WN1gckg==" }, "node_modules/@cspell/dict-docker": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.14.tgz", - "integrity": "sha512-p6Qz5mokvcosTpDlgSUREdSbZ10mBL3ndgCdEKMqjCSZJFdfxRdNdjrGER3lQ6LMq5jGr1r7nGXA0gvUJK80nw==", - "license": "MIT" + "integrity": "sha512-p6Qz5mokvcosTpDlgSUREdSbZ10mBL3ndgCdEKMqjCSZJFdfxRdNdjrGER3lQ6LMq5jGr1r7nGXA0gvUJK80nw==" }, "node_modules/@cspell/dict-dotnet": { "version": "5.0.9", "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.9.tgz", - "integrity": "sha512-JGD6RJW5sHtO5lfiJl11a5DpPN6eKSz5M1YBa1I76j4dDOIqgZB6rQexlDlK1DH9B06X4GdDQwdBfnpAB0r2uQ==", - "license": "MIT" + "integrity": "sha512-JGD6RJW5sHtO5lfiJl11a5DpPN6eKSz5M1YBa1I76j4dDOIqgZB6rQexlDlK1DH9B06X4GdDQwdBfnpAB0r2uQ==" }, "node_modules/@cspell/dict-elixir": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-4.0.7.tgz", - "integrity": "sha512-MAUqlMw73mgtSdxvbAvyRlvc3bYnrDqXQrx5K9SwW8F7fRYf9V4vWYFULh+UWwwkqkhX9w03ZqFYRTdkFku6uA==", - "license": "MIT" + "integrity": "sha512-MAUqlMw73mgtSdxvbAvyRlvc3bYnrDqXQrx5K9SwW8F7fRYf9V4vWYFULh+UWwwkqkhX9w03ZqFYRTdkFku6uA==" }, "node_modules/@cspell/dict-en_us": { - "version": "4.4.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.11.tgz", - "integrity": "sha512-ls3ASwIL0uuAEXsxB7NsIe6GRBQ+NZfqI5k1qtNgOZ1eh1MFYjCiF+YcqArH5SFHNzOwCHRKzlLeX0ZFIok7GQ==", - "license": "MIT" + "version": "4.4.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.12.tgz", + "integrity": "sha512-p/ACn/SXcfCTAIAUfbvHrG/jacLDzo6V9Vc5mjtTMSaqeJVir4w5G9r1Pz19zcUvFzgio/Kg5b2xmosjPirLsg==" }, "node_modules/@cspell/dict-en-common-misspellings": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.1.tgz", - "integrity": "sha512-6m2EEm4WUgsNzFzz/2boeOVrZenYQRaDXFtDNcaQK5Ly4A37HTRPm8uVvE8cAlACVk+HBHhH/4e7ebxdXwId9w==", - "license": "CC BY-SA 4.0" + "integrity": "sha512-6m2EEm4WUgsNzFzz/2boeOVrZenYQRaDXFtDNcaQK5Ly4A37HTRPm8uVvE8cAlACVk+HBHhH/4e7ebxdXwId9w==" }, "node_modules/@cspell/dict-en-gb-mit": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.1.tgz", - "integrity": "sha512-sZbuOPlAGDwudoquXjaSA+TbJEzfG0MkUeF4Iz3tdL9xOYDb6lgueNVnDJfBrw6jrKKDdOI68MJqiLjW4uth8A==", - "license": "MIT" + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.2.tgz", + "integrity": "sha512-IOsS2auF07ZOUqXsp4zuCaf3W5/OolWLvdq9xPd/ZQH2BfoFEmjdhelYaRuOKOmd6+SWdEbGhEeI7oLZSREqIQ==" }, "node_modules/@cspell/dict-filetypes": { "version": "3.0.12", "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.12.tgz", - "integrity": "sha512-+ds5wgNdlUxuJvhg8A1TjuSpalDFGCh7SkANCWvIplg6QZPXL4j83lqxP7PgjHpx7PsBUS7vw0aiHPjZy9BItw==", - "license": "MIT" + "integrity": "sha512-+ds5wgNdlUxuJvhg8A1TjuSpalDFGCh7SkANCWvIplg6QZPXL4j83lqxP7PgjHpx7PsBUS7vw0aiHPjZy9BItw==" }, "node_modules/@cspell/dict-flutter": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-flutter/-/dict-flutter-1.1.0.tgz", - "integrity": "sha512-3zDeS7zc2p8tr9YH9tfbOEYfopKY/srNsAa+kE3rfBTtQERAZeOhe5yxrnTPoufctXLyuUtcGMUTpxr3dO0iaA==", - "license": "MIT" + "integrity": "sha512-3zDeS7zc2p8tr9YH9tfbOEYfopKY/srNsAa+kE3rfBTtQERAZeOhe5yxrnTPoufctXLyuUtcGMUTpxr3dO0iaA==" }, "node_modules/@cspell/dict-fonts": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.4.tgz", - "integrity": "sha512-cHFho4hjojBcHl6qxidl9CvUb492IuSk7xIf2G2wJzcHwGaCFa2o3gRcxmIg1j62guetAeDDFELizDaJlVRIOg==", - "license": "MIT" + "integrity": "sha512-cHFho4hjojBcHl6qxidl9CvUb492IuSk7xIf2G2wJzcHwGaCFa2o3gRcxmIg1j62guetAeDDFELizDaJlVRIOg==" }, "node_modules/@cspell/dict-fsharp": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-fsharp/-/dict-fsharp-1.1.0.tgz", - "integrity": "sha512-oguWmHhGzgbgbEIBKtgKPrFSVAFtvGHaQS0oj+vacZqMObwkapcTGu7iwf4V3Bc2T3caf0QE6f6rQfIJFIAVsw==", - "license": "MIT" + "integrity": "sha512-oguWmHhGzgbgbEIBKtgKPrFSVAFtvGHaQS0oj+vacZqMObwkapcTGu7iwf4V3Bc2T3caf0QE6f6rQfIJFIAVsw==" }, "node_modules/@cspell/dict-fullstack": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.6.tgz", - "integrity": "sha512-cSaq9rz5RIU9j+0jcF2vnKPTQjxGXclntmoNp4XB7yFX2621PxJcekGjwf/lN5heJwVxGLL9toR0CBlGKwQBgA==", - "license": "MIT" + "integrity": "sha512-cSaq9rz5RIU9j+0jcF2vnKPTQjxGXclntmoNp4XB7yFX2621PxJcekGjwf/lN5heJwVxGLL9toR0CBlGKwQBgA==" }, "node_modules/@cspell/dict-gaming-terms": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.1.1.tgz", - "integrity": "sha512-tb8GFxjTLDQstkJcJ90lDqF4rKKlMUKs5/ewePN9P+PYRSehqDpLI5S5meOfPit8LGszeOrjUdBQ4zXo7NpMyQ==", - "license": "MIT" + "integrity": "sha512-tb8GFxjTLDQstkJcJ90lDqF4rKKlMUKs5/ewePN9P+PYRSehqDpLI5S5meOfPit8LGszeOrjUdBQ4zXo7NpMyQ==" }, "node_modules/@cspell/dict-git": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.6.tgz", - "integrity": "sha512-nazfOqyxlBOQGgcur9ssEOEQCEZkH8vXfQe8SDEx8sCN/g0SFm8ktabgLVmBOXjy3RzjVNLlM2nBfRQ7e6+5hQ==", - "license": "MIT" + "integrity": "sha512-nazfOqyxlBOQGgcur9ssEOEQCEZkH8vXfQe8SDEx8sCN/g0SFm8ktabgLVmBOXjy3RzjVNLlM2nBfRQ7e6+5hQ==" }, "node_modules/@cspell/dict-golang": { "version": "6.0.22", "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.22.tgz", - "integrity": "sha512-FvV0m3Y0nUFxw36uDCD8UtfOPv4wsZnnlabNwB3xNZ2IBn0gBURuMUZywScb9sd2wXM8VFBRoU//tc6NQsOVOg==", - "license": "MIT" + "integrity": "sha512-FvV0m3Y0nUFxw36uDCD8UtfOPv4wsZnnlabNwB3xNZ2IBn0gBURuMUZywScb9sd2wXM8VFBRoU//tc6NQsOVOg==" }, "node_modules/@cspell/dict-google": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@cspell/dict-google/-/dict-google-1.0.8.tgz", - "integrity": "sha512-BnMHgcEeaLyloPmBs8phCqprI+4r2Jb8rni011A8hE+7FNk7FmLE3kiwxLFrcZnnb7eqM0agW4zUaNoB0P+z8A==", - "license": "MIT" + "integrity": "sha512-BnMHgcEeaLyloPmBs8phCqprI+4r2Jb8rni011A8hE+7FNk7FmLE3kiwxLFrcZnnb7eqM0agW4zUaNoB0P+z8A==" }, "node_modules/@cspell/dict-haskell": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@cspell/dict-haskell/-/dict-haskell-4.0.5.tgz", - "integrity": "sha512-s4BG/4tlj2pPM9Ha7IZYMhUujXDnI0Eq1+38UTTCpatYLbQqDwRFf2KNPLRqkroU+a44yTUAe0rkkKbwy4yRtQ==", - "license": "MIT" + "integrity": "sha512-s4BG/4tlj2pPM9Ha7IZYMhUujXDnI0Eq1+38UTTCpatYLbQqDwRFf2KNPLRqkroU+a44yTUAe0rkkKbwy4yRtQ==" }, "node_modules/@cspell/dict-html": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.11.tgz", - "integrity": "sha512-QR3b/PB972SRQ2xICR1Nw/M44IJ6rjypwzA4jn+GH8ydjAX9acFNfc+hLZVyNe0FqsE90Gw3evLCOIF0vy1vQw==", - "license": "MIT" + "integrity": "sha512-QR3b/PB972SRQ2xICR1Nw/M44IJ6rjypwzA4jn+GH8ydjAX9acFNfc+hLZVyNe0FqsE90Gw3evLCOIF0vy1vQw==" }, "node_modules/@cspell/dict-html-symbol-entities": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.3.tgz", - "integrity": "sha512-aABXX7dMLNFdSE8aY844X4+hvfK7977sOWgZXo4MTGAmOzR8524fjbJPswIBK7GaD3+SgFZ2yP2o0CFvXDGF+A==", - "license": "MIT" + "integrity": "sha512-aABXX7dMLNFdSE8aY844X4+hvfK7977sOWgZXo4MTGAmOzR8524fjbJPswIBK7GaD3+SgFZ2yP2o0CFvXDGF+A==" }, "node_modules/@cspell/dict-java": { "version": "5.0.11", "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.11.tgz", - "integrity": "sha512-T4t/1JqeH33Raa/QK/eQe26FE17eUCtWu+JsYcTLkQTci2dk1DfcIKo8YVHvZXBnuM43ATns9Xs0s+AlqDeH7w==", - "license": "MIT" + "integrity": "sha512-T4t/1JqeH33Raa/QK/eQe26FE17eUCtWu+JsYcTLkQTci2dk1DfcIKo8YVHvZXBnuM43ATns9Xs0s+AlqDeH7w==" }, "node_modules/@cspell/dict-julia": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-julia/-/dict-julia-1.1.0.tgz", - "integrity": "sha512-CPUiesiXwy3HRoBR3joUseTZ9giFPCydSKu2rkh6I2nVjXnl5vFHzOMLXpbF4HQ1tH2CNfnDbUndxD+I+7eL9w==", - "license": "MIT" + "integrity": "sha512-CPUiesiXwy3HRoBR3joUseTZ9giFPCydSKu2rkh6I2nVjXnl5vFHzOMLXpbF4HQ1tH2CNfnDbUndxD+I+7eL9w==" }, "node_modules/@cspell/dict-k8s": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.11.tgz", - "integrity": "sha512-8ojNwB5j4PfZ1Gq9n5c/HKJCtZD3h6+wFy+zpALpDWFFQ2qT22Be30+3PVd+G5gng8or0LeK8VgKKd0l1uKPTA==", - "license": "MIT" + "integrity": "sha512-8ojNwB5j4PfZ1Gq9n5c/HKJCtZD3h6+wFy+zpALpDWFFQ2qT22Be30+3PVd+G5gng8or0LeK8VgKKd0l1uKPTA==" }, "node_modules/@cspell/dict-kotlin": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-kotlin/-/dict-kotlin-1.1.0.tgz", - "integrity": "sha512-vySaVw6atY7LdwvstQowSbdxjXG6jDhjkWVWSjg1XsUckyzH1JRHXe9VahZz1i7dpoFEUOWQrhIe5B9482UyJQ==", - "license": "MIT" + "integrity": "sha512-vySaVw6atY7LdwvstQowSbdxjXG6jDhjkWVWSjg1XsUckyzH1JRHXe9VahZz1i7dpoFEUOWQrhIe5B9482UyJQ==" }, "node_modules/@cspell/dict-latex": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-4.0.3.tgz", - "integrity": "sha512-2KXBt9fSpymYHxHfvhUpjUFyzrmN4c4P8mwIzweLyvqntBT3k0YGZJSriOdjfUjwSygrfEwiuPI1EMrvgrOMJw==", - "license": "MIT" + "integrity": "sha512-2KXBt9fSpymYHxHfvhUpjUFyzrmN4c4P8mwIzweLyvqntBT3k0YGZJSriOdjfUjwSygrfEwiuPI1EMrvgrOMJw==" }, "node_modules/@cspell/dict-lorem-ipsum": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.4.tgz", - "integrity": "sha512-+4f7vtY4dp2b9N5fn0za/UR0kwFq2zDtA62JCbWHbpjvO9wukkbl4rZg4YudHbBgkl73HRnXFgCiwNhdIA1JPw==", - "license": "MIT" + "integrity": "sha512-+4f7vtY4dp2b9N5fn0za/UR0kwFq2zDtA62JCbWHbpjvO9wukkbl4rZg4YudHbBgkl73HRnXFgCiwNhdIA1JPw==" }, "node_modules/@cspell/dict-lua": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-4.0.7.tgz", - "integrity": "sha512-Wbr7YSQw+cLHhTYTKV6cAljgMgcY+EUAxVIZW3ljKswEe4OLxnVJ7lPqZF5JKjlXdgCjbPSimsHqyAbC5pQN/Q==", - "license": "MIT" + "integrity": "sha512-Wbr7YSQw+cLHhTYTKV6cAljgMgcY+EUAxVIZW3ljKswEe4OLxnVJ7lPqZF5JKjlXdgCjbPSimsHqyAbC5pQN/Q==" }, "node_modules/@cspell/dict-makefile": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@cspell/dict-makefile/-/dict-makefile-1.0.4.tgz", - "integrity": "sha512-E4hG/c0ekPqUBvlkrVvzSoAA+SsDA9bLi4xSV3AXHTVru7Y2bVVGMPtpfF+fI3zTkww/jwinprcU1LSohI3ylw==", - "license": "MIT" + "integrity": "sha512-E4hG/c0ekPqUBvlkrVvzSoAA+SsDA9bLi4xSV3AXHTVru7Y2bVVGMPtpfF+fI3zTkww/jwinprcU1LSohI3ylw==" }, "node_modules/@cspell/dict-markdown": { "version": "2.0.11", "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.11.tgz", "integrity": "sha512-stZieFKJyMQbzKTVoalSx2QqCpB0j8nPJF/5x+sBnDIWgMC65jp8Wil+jccWh9/vnUVukP3Ejewven5NC7SWuQ==", - "license": "MIT", "peerDependencies": { "@cspell/dict-css": "^4.0.17", "@cspell/dict-html": "^4.0.11", @@ -376,44 +331,37 @@ "node_modules/@cspell/dict-monkeyc": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/@cspell/dict-monkeyc/-/dict-monkeyc-1.0.10.tgz", - "integrity": "sha512-7RTGyKsTIIVqzbvOtAu6Z/lwwxjGRtY5RkKPlXKHEoEAgIXwfDxb5EkVwzGQwQr8hF/D3HrdYbRT8MFBfsueZw==", - "license": "MIT" + "integrity": "sha512-7RTGyKsTIIVqzbvOtAu6Z/lwwxjGRtY5RkKPlXKHEoEAgIXwfDxb5EkVwzGQwQr8hF/D3HrdYbRT8MFBfsueZw==" }, "node_modules/@cspell/dict-node": { "version": "5.0.7", "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.7.tgz", - "integrity": "sha512-ZaPpBsHGQCqUyFPKLyCNUH2qzolDRm1/901IO8e7btk7bEDF56DN82VD43gPvD4HWz3yLs/WkcLa01KYAJpnOw==", - "license": "MIT" + "integrity": "sha512-ZaPpBsHGQCqUyFPKLyCNUH2qzolDRm1/901IO8e7btk7bEDF56DN82VD43gPvD4HWz3yLs/WkcLa01KYAJpnOw==" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.6.tgz", - "integrity": "sha512-VGEY1ZjE8c8JCA+dic1IdYmVTNfVtWAw7V2n4TXO1+mKfRL+BsPsqEoH8iR0OMutC9QXjVNh32rzMh4D3E+Lxw==", - "license": "MIT" + "version": "5.2.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.9.tgz", + "integrity": "sha512-1uxRQ0LGPweRX8U9EEoU/tk5GGtTLAJT0BMmeHbe2AfzxX3nYSZtK/q52h9yg/wZLgvnFYzha2DL70uuT8oZuA==" }, "node_modules/@cspell/dict-php": { "version": "4.0.14", "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.14.tgz", - "integrity": "sha512-7zur8pyncYZglxNmqsRycOZ6inpDoVd4yFfz1pQRe5xaRWMiK3Km4n0/X/1YMWhh3e3Sl/fQg5Axb2hlN68t1g==", - "license": "MIT" + "integrity": "sha512-7zur8pyncYZglxNmqsRycOZ6inpDoVd4yFfz1pQRe5xaRWMiK3Km4n0/X/1YMWhh3e3Sl/fQg5Axb2hlN68t1g==" }, "node_modules/@cspell/dict-powershell": { "version": "5.0.14", "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.14.tgz", - "integrity": "sha512-ktjjvtkIUIYmj/SoGBYbr3/+CsRGNXGpvVANrY0wlm/IoGlGywhoTUDYN0IsGwI2b8Vktx3DZmQkfb3Wo38jBA==", - "license": "MIT" + "integrity": "sha512-ktjjvtkIUIYmj/SoGBYbr3/+CsRGNXGpvVANrY0wlm/IoGlGywhoTUDYN0IsGwI2b8Vktx3DZmQkfb3Wo38jBA==" }, "node_modules/@cspell/dict-public-licenses": { "version": "2.0.13", "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.13.tgz", - "integrity": "sha512-1Wdp/XH1ieim7CadXYE7YLnUlW0pULEjVl9WEeziZw3EKCAw8ZI8Ih44m4bEa5VNBLnuP5TfqC4iDautAleQzQ==", - "license": "MIT" + "integrity": "sha512-1Wdp/XH1ieim7CadXYE7YLnUlW0pULEjVl9WEeziZw3EKCAw8ZI8Ih44m4bEa5VNBLnuP5TfqC4iDautAleQzQ==" }, "node_modules/@cspell/dict-python": { "version": "4.2.18", "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.18.tgz", "integrity": "sha512-hYczHVqZBsck7DzO5LumBLJM119a3F17aj8a7lApnPIS7cmEwnPc2eACNscAHDk7qAo2127oI7axUoFMe9/g1g==", - "license": "MIT", "dependencies": { "@cspell/dict-data-science": "^2.0.8" } @@ -421,82 +369,69 @@ "node_modules/@cspell/dict-r": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-r/-/dict-r-2.1.0.tgz", - "integrity": "sha512-k2512wgGG0lTpTYH9w5Wwco+lAMf3Vz7mhqV8+OnalIE7muA0RSuD9tWBjiqLcX8zPvEJr4LdgxVju8Gk3OKyA==", - "license": "MIT" + "integrity": "sha512-k2512wgGG0lTpTYH9w5Wwco+lAMf3Vz7mhqV8+OnalIE7muA0RSuD9tWBjiqLcX8zPvEJr4LdgxVju8Gk3OKyA==" }, "node_modules/@cspell/dict-ruby": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.8.tgz", - "integrity": "sha512-ixuTneU0aH1cPQRbWJvtvOntMFfeQR2KxT8LuAv5jBKqQWIHSxzGlp+zX3SVyoeR0kOWiu64/O5Yn836A5yMcQ==", - "license": "MIT" + "integrity": "sha512-ixuTneU0aH1cPQRbWJvtvOntMFfeQR2KxT8LuAv5jBKqQWIHSxzGlp+zX3SVyoeR0kOWiu64/O5Yn836A5yMcQ==" }, "node_modules/@cspell/dict-rust": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.11.tgz", - "integrity": "sha512-OGWDEEzm8HlkSmtD8fV3pEcO2XBpzG2XYjgMCJCRwb2gRKvR+XIm6Dlhs04N/K2kU+iH8bvrqNpM8fS/BFl0uw==", - "license": "MIT" + "integrity": "sha512-OGWDEEzm8HlkSmtD8fV3pEcO2XBpzG2XYjgMCJCRwb2gRKvR+XIm6Dlhs04N/K2kU+iH8bvrqNpM8fS/BFl0uw==" }, "node_modules/@cspell/dict-scala": { "version": "5.0.7", "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.7.tgz", - "integrity": "sha512-yatpSDW/GwulzO3t7hB5peoWwzo+Y3qTc0pO24Jf6f88jsEeKmDeKkfgPbYuCgbE4jisGR4vs4+jfQZDIYmXPA==", - "license": "MIT" + "integrity": "sha512-yatpSDW/GwulzO3t7hB5peoWwzo+Y3qTc0pO24Jf6f88jsEeKmDeKkfgPbYuCgbE4jisGR4vs4+jfQZDIYmXPA==" }, "node_modules/@cspell/dict-shell": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-shell/-/dict-shell-1.1.0.tgz", - "integrity": "sha512-D/xHXX7T37BJxNRf5JJHsvziFDvh23IF/KvkZXNSh8VqcRdod3BAz9VGHZf6VDqcZXr1VRqIYR3mQ8DSvs3AVQ==", - "license": "MIT" + "integrity": "sha512-D/xHXX7T37BJxNRf5JJHsvziFDvh23IF/KvkZXNSh8VqcRdod3BAz9VGHZf6VDqcZXr1VRqIYR3mQ8DSvs3AVQ==" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.0.tgz", - "integrity": "sha512-8zsOVzcHpb4PAaKtOWAIJRbpaNINaUZRsHzqFb3K9hQIC6hxmet/avLlCeKdnmBVZkn3TmRN5caxTJamJvbXww==", - "license": "MIT" + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.2.tgz", + "integrity": "sha512-MssT9yyInezB6mFqHTDNOIVjbMakORllIt7IJ91LrgiQOcDLzidR0gN9pE340s655TJ8U5MJNAfRfH0oRU14KQ==" }, "node_modules/@cspell/dict-sql": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.2.0.tgz", - "integrity": "sha512-MUop+d1AHSzXpBvQgQkCiok8Ejzb+nrzyG16E8TvKL2MQeDwnIvMe3bv90eukP6E1HWb+V/MA/4pnq0pcJWKqQ==", - "license": "MIT" + "integrity": "sha512-MUop+d1AHSzXpBvQgQkCiok8Ejzb+nrzyG16E8TvKL2MQeDwnIvMe3bv90eukP6E1HWb+V/MA/4pnq0pcJWKqQ==" }, "node_modules/@cspell/dict-svelte": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@cspell/dict-svelte/-/dict-svelte-1.0.6.tgz", - "integrity": "sha512-8LAJHSBdwHCoKCSy72PXXzz7ulGROD0rP1CQ0StOqXOOlTUeSFaJJlxNYjlONgd2c62XBQiN2wgLhtPN+1Zv7Q==", - "license": "MIT" + "integrity": "sha512-8LAJHSBdwHCoKCSy72PXXzz7ulGROD0rP1CQ0StOqXOOlTUeSFaJJlxNYjlONgd2c62XBQiN2wgLhtPN+1Zv7Q==" }, "node_modules/@cspell/dict-swift": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-2.0.5.tgz", - "integrity": "sha512-3lGzDCwUmnrfckv3Q4eVSW3sK3cHqqHlPprFJZD4nAqt23ot7fic5ALR7J4joHpvDz36nHX34TgcbZNNZOC/JA==", - "license": "MIT" + "integrity": "sha512-3lGzDCwUmnrfckv3Q4eVSW3sK3cHqqHlPprFJZD4nAqt23ot7fic5ALR7J4joHpvDz36nHX34TgcbZNNZOC/JA==" }, "node_modules/@cspell/dict-terraform": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.1.1.tgz", - "integrity": "sha512-07KFDwCU7EnKl4hOZLsLKlj6Zceq/IsQ3LRWUyIjvGFfZHdoGtFdCp3ZPVgnFaAcd/DKv+WVkrOzUBSYqHopQQ==", - "license": "MIT" + "integrity": "sha512-07KFDwCU7EnKl4hOZLsLKlj6Zceq/IsQ3LRWUyIjvGFfZHdoGtFdCp3ZPVgnFaAcd/DKv+WVkrOzUBSYqHopQQ==" }, "node_modules/@cspell/dict-typescript": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.2.2.tgz", - "integrity": "sha512-H9Y+uUHsTIDFO/jdfUAcqmcd5osT+2DB5b0aRCHfLWN/twUbGn/1qq3b7YwEvttxKlYzWHU3uNFf+KfA93VY7w==", - "license": "MIT" + "integrity": "sha512-H9Y+uUHsTIDFO/jdfUAcqmcd5osT+2DB5b0aRCHfLWN/twUbGn/1qq3b7YwEvttxKlYzWHU3uNFf+KfA93VY7w==" }, "node_modules/@cspell/dict-vue": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.4.tgz", - "integrity": "sha512-0dPtI0lwHcAgSiQFx8CzvqjdoXROcH+1LyqgROCpBgppommWpVhbQ0eubnKotFEXgpUCONVkeZJ6Ql8NbTEu+w==", - "license": "MIT" + "integrity": "sha512-0dPtI0lwHcAgSiQFx8CzvqjdoXROcH+1LyqgROCpBgppommWpVhbQ0eubnKotFEXgpUCONVkeZJ6Ql8NbTEu+w==" }, "node_modules/@cspell/dynamic-import": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.1.1.tgz", - "integrity": "sha512-jcg5Wti4kcPh4Deds009MEZvuN3tViUft079MTsdSpNPNhRf/gKwSIQnkda9g4ppsVPh5mxkE0nUZLxfZRZYMg==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.1.2.tgz", + "integrity": "sha512-Kg22HCx5m0znVPLea2jRrvMnzHZAAzqcDr5g6Dbd4Pizs5b3SPQuRpFmYaDvKo26JNZnfRqA9eweiuE5aQAf2A==", "dependencies": { - "@cspell/url": "9.1.1", + "@cspell/url": "9.1.2", "import-meta-resolve": "^4.1.0" }, "engines": { @@ -504,28 +439,25 @@ } }, "node_modules/@cspell/filetypes": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.1.1.tgz", - "integrity": "sha512-kQ1mD+hPxh8KRbDtPvCb6nuODwJV26W43sC77I5Vpk+IDXZqxEhkTCXB6OefnfplOl6+wU0e/EAw+7XYtlKjfg==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.1.2.tgz", + "integrity": "sha512-j+6kDz3GbeYwwtlzVosqVaSiFGMhf0u3y8eAP3IV2bTelhP2ZiOLD+yNbAyYGao7p10/Sqv+Ri0yT7IsGLniww==", "engines": { "node": ">=20" } }, "node_modules/@cspell/strong-weak-map": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.1.1.tgz", - "integrity": "sha512-D9dDws2MmE24zxkT9TcxYzOAiZncllgcfAGVswklM+dpQeHyZgRDPpdjVhz+nrYrwVwTbdWlRNJ9RiwzRN+jpA==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.1.2.tgz", + "integrity": "sha512-6X9oXnklvdt1pd0x0Mh6qXaaIRxjt0G50Xz5ZGm3wpAagv0MFvTThdmYVFfBuZ91x7fDT3u77y3d1uqdGQW1CA==", "engines": { "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.1.1.tgz", - "integrity": "sha512-/RL/QTcaFBr0UGl6uLc9d2kPCEpqWHmBs8uFRnBottJ3I5tMOiaVtkEKFTx5FIxrlWTjZwW3rWaIUspNX5ejUw==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.1.2.tgz", + "integrity": "sha512-PMJBuLYQIdFnEfPHQXaVE5hHUkbbOxOIRmHyZwWEc9+79tIaIkiwLpjZvbm8p6f9WXAaESqXs/uK2tUC/bjwmw==", "engines": { "node": ">=20" } @@ -533,14 +465,12 @@ "node_modules/array-timsort": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", - "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", - "license": "MIT" + "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==" }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "license": "MIT", "engines": { "node": ">=6" } @@ -575,7 +505,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/clear-module/-/clear-module-4.1.2.tgz", "integrity": "sha512-LWAxzHqdHsAZlPlEyJ2Poz6AIs384mPeqLVCru2p0BrP9G/kVGuhNyZYClLO6cXlnuJjzC8xtsJIuMjKqLXoAw==", - "license": "MIT", "dependencies": { "parent-module": "^2.0.0", "resolve-from": "^5.0.0" @@ -600,7 +529,6 @@ "version": "4.2.5", "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.5.tgz", "integrity": "sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw==", - "license": "MIT", "dependencies": { "array-timsort": "^1.0.3", "core-util-is": "^1.0.3", @@ -615,29 +543,27 @@ "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "license": "MIT" + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cspell": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.1.1.tgz", - "integrity": "sha512-srPIS39EzbgRLncBIbsJy3GzYWxrSm0mbXj24XLxZgVBjMps+/uxpVo0aXEFy4JClUSNBoYxhCb+vSHZUoqu3w==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.1.2.tgz", + "integrity": "sha512-XtFNCt2ZCvdSAbtntlYBumShdDsSbKdgPhwx/PfEL42uhXWR1owQPTxhtHz3nBF2SR11iDI3LDMMGDp8Fw0Gdg==", "dependencies": { - "@cspell/cspell-json-reporter": "9.1.1", - "@cspell/cspell-pipe": "9.1.1", - "@cspell/cspell-types": "9.1.1", - "@cspell/dynamic-import": "9.1.1", - "@cspell/url": "9.1.1", + "@cspell/cspell-json-reporter": "9.1.2", + "@cspell/cspell-pipe": "9.1.2", + "@cspell/cspell-types": "9.1.2", + "@cspell/dynamic-import": "9.1.2", + "@cspell/url": "9.1.2", "chalk": "^5.4.1", "chalk-template": "^1.1.0", "commander": "^14.0.0", - "cspell-config-lib": "9.1.1", - "cspell-dictionary": "9.1.1", - "cspell-gitignore": "9.1.1", - "cspell-glob": "9.1.1", - "cspell-io": "9.1.1", - "cspell-lib": "9.1.1", + "cspell-config-lib": "9.1.2", + "cspell-dictionary": "9.1.2", + "cspell-gitignore": "9.1.2", + "cspell-glob": "9.1.2", + "cspell-io": "9.1.2", + "cspell-lib": "9.1.2", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "semver": "^7.7.2", @@ -655,12 +581,11 @@ } }, "node_modules/cspell-config-lib": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.1.1.tgz", - "integrity": "sha512-fi/ohH5mIeba416Jl0DREm+A4QssC3OCY8wjze7hAZ9lOzFuuBmyjoo5OD/J48stkCt1pf2TIAAU3up5o/oaBw==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.1.2.tgz", + "integrity": "sha512-QvHHGUuMI5h3ymU6O/Qz8zfhMhvPTuopT1FgebYRBB1cyggl4KnEJKU9m7wy/SQ1IGSlFDtQp6rCy70ujTfavQ==", "dependencies": { - "@cspell/cspell-types": "9.1.1", + "@cspell/cspell-types": "9.1.2", "comment-json": "^4.2.5", "yaml": "^2.8.0" }, @@ -669,14 +594,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.1.1.tgz", - "integrity": "sha512-VobPhTE/+hMsI5qppKsuljdDkG23av16bNRBR0hA0O/pG07SXZ6nzwWIwdPoKSjiWSGTmmCGXv45W0sn20ahbA==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.1.2.tgz", + "integrity": "sha512-Osn5f9ugkX/zA3PVtSmYKRer3gZX3YqVB0UH0wVNzi8Ryl/1RUuYLIcvd0SDEhiVW56WKxFLfZ5sggTz/l9cDA==", "dependencies": { - "@cspell/cspell-pipe": "9.1.1", - "@cspell/cspell-types": "9.1.1", - "cspell-trie-lib": "9.1.1", + "@cspell/cspell-pipe": "9.1.2", + "@cspell/cspell-types": "9.1.2", + "cspell-trie-lib": "9.1.2", "fast-equals": "^5.2.2" }, "engines": { @@ -684,14 +608,13 @@ } }, "node_modules/cspell-gitignore": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.1.1.tgz", - "integrity": "sha512-8gx61lyxdAMLulL7Mtb10jOBzL/e3rU34YW0kaTT3LkHBb/LGapmOFKRiJyt2bA/UA6kJkR/wPLmsjUfRJwOmA==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.1.2.tgz", + "integrity": "sha512-dbi7xPYYNT79gci9C3G/tldp13cvhuNXnIOSXJ5lXSDhinZFfrpFc0bOj195nn3HTL/EvlQ9Ga1a1+jOIZNVBQ==", "dependencies": { - "@cspell/url": "9.1.1", - "cspell-glob": "9.1.1", - "cspell-io": "9.1.1" + "@cspell/url": "9.1.2", + "cspell-glob": "9.1.2", + "cspell-io": "9.1.2" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -701,12 +624,11 @@ } }, "node_modules/cspell-glob": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.1.1.tgz", - "integrity": "sha512-f274mlln/QG/wj12xF/SnvfdUAx0pGjIxnNOYGwRXS1MbaH0B4F9pkhkMqY0GwqAsvPxT6NzJybAoivS4Icvzg==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.1.2.tgz", + "integrity": "sha512-l7Mqirn5h2tilTXgRamRIqqnzeA7R5iJEtJkY/zHDMEBeLWTR/5ai7dBp2+ooe8gIebpDtvv4938IXa5/75E6g==", "dependencies": { - "@cspell/url": "9.1.1", + "@cspell/url": "9.1.2", "picomatch": "^4.0.2" }, "engines": { @@ -714,13 +636,12 @@ } }, "node_modules/cspell-grammar": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.1.1.tgz", - "integrity": "sha512-IBOOzmj1z4IWHSis6iGZNbE0syEiT0Rz4NbbHwscCMc30jgbotupscn6T8PhqmDwmlXCW81C4vGSMzqQh0UaLQ==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.1.2.tgz", + "integrity": "sha512-vUcnlUqJKK0yhwYHfGC71zjGyEn918l64U/NWb1ijn1VXrL6gsh3w8Acwdo++zbpOASd9HTAuuZelveDJKLLgA==", "dependencies": { - "@cspell/cspell-pipe": "9.1.1", - "@cspell/cspell-types": "9.1.1" + "@cspell/cspell-pipe": "9.1.2", + "@cspell/cspell-types": "9.1.2" }, "bin": { "cspell-grammar": "bin.mjs" @@ -730,40 +651,38 @@ } }, "node_modules/cspell-io": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.1.1.tgz", - "integrity": "sha512-LMzoBvbWqVokrkrnLrdnCzX8Sf77Q42nvj7Q36G4sqZaB3Lr/ih+iZ4t5l90Wlsnst5flrQmIy0YNtndAWzp2A==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.1.2.tgz", + "integrity": "sha512-oLPxbteI+uFV9ZPcJjII7Lr/C/gVXpdmDLlAMwR8/7LHGnEfxXR0lqYu5GZVEvZ7riX9whCUOsQWQQqr2u2Fzw==", "dependencies": { - "@cspell/cspell-service-bus": "9.1.1", - "@cspell/url": "9.1.1" + "@cspell/cspell-service-bus": "9.1.2", + "@cspell/url": "9.1.2" }, "engines": { "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.1.1.tgz", - "integrity": "sha512-On2m0/UFtsKenEHTfvNA5EoKI5YcnOzgGQF3yX4CllvtGQXCewB5U1TBCqTR/0wckw5q94iqZJDF2oY3GBGBAg==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.1.2.tgz", + "integrity": "sha512-OFCssgfp6Z2gd1K8j2FsYr9YGoA/C6xXlcUwgU75Ut/XMZ/S44chdA9fUupGd4dUOw+CZl0qKzSP21J6kYObIw==", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.1.1", - "@cspell/cspell-pipe": "9.1.1", - "@cspell/cspell-resolver": "9.1.1", - "@cspell/cspell-types": "9.1.1", - "@cspell/dynamic-import": "9.1.1", - "@cspell/filetypes": "9.1.1", - "@cspell/strong-weak-map": "9.1.1", - "@cspell/url": "9.1.1", + "@cspell/cspell-bundled-dicts": "9.1.2", + "@cspell/cspell-pipe": "9.1.2", + "@cspell/cspell-resolver": "9.1.2", + "@cspell/cspell-types": "9.1.2", + "@cspell/dynamic-import": "9.1.2", + "@cspell/filetypes": "9.1.2", + "@cspell/strong-weak-map": "9.1.2", + "@cspell/url": "9.1.2", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "9.1.1", - "cspell-dictionary": "9.1.1", - "cspell-glob": "9.1.1", - "cspell-grammar": "9.1.1", - "cspell-io": "9.1.1", - "cspell-trie-lib": "9.1.1", + "cspell-config-lib": "9.1.2", + "cspell-dictionary": "9.1.2", + "cspell-glob": "9.1.2", + "cspell-grammar": "9.1.2", + "cspell-io": "9.1.2", + "cspell-trie-lib": "9.1.2", "env-paths": "^3.0.0", "fast-equals": "^5.2.2", "gensequence": "^7.0.0", @@ -778,13 +697,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.1.1.tgz", - "integrity": "sha512-eULMGTTbvmuOWpAM34wodpbAM3dXscLL26WOn9/9uyQJ36dZ0u8B+ctrYf17Ij/wcpGzLqwTNspJN2fkbiXkBQ==", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.1.2.tgz", + "integrity": "sha512-TkIQaknRRusUznqy+HwpqKCETCAznrzPJJHRHi8m6Zo3tAMsnIpaBQPRN8xem6w8/r/yJqFhLrsLSma0swyviQ==", "dependencies": { - "@cspell/cspell-pipe": "9.1.1", - "@cspell/cspell-types": "9.1.1", + "@cspell/cspell-pipe": "9.1.2", + "@cspell/cspell-types": "9.1.2", "gensequence": "^7.0.0" }, "engines": { @@ -795,7 +713,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -807,7 +724,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -820,7 +736,6 @@ "version": "5.2.2", "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.2.2.tgz", "integrity": "sha512-V7/RktU11J3I36Nwq2JnZEM7tNm17eBJz+u25qdxBZeCKiX6BkVSZQjwWIr+IobgnZy+ag73tTZgZi7tr0LrBw==", - "license": "MIT", "engines": { "node": ">=6.0.0" } @@ -877,7 +792,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/gensequence/-/gensequence-7.0.0.tgz", "integrity": "sha512-47Frx13aZh01afHJTB3zTtKIlFI6vWY+MYCN9Qpew6i52rfKjnhCF/l1YlC8UmEMvvntZZ6z4PiCcmyuedR2aQ==", - "license": "MIT", "engines": { "node": ">=18" } @@ -886,7 +800,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", "integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==", - "license": "MIT", "dependencies": { "ini": "4.1.1" }, @@ -901,7 +814,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", - "license": "MIT", "engines": { "node": ">=8" } @@ -910,7 +822,6 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", - "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -926,7 +837,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "license": "MIT", "dependencies": { "callsites": "^3.0.0" }, @@ -938,7 +848,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "license": "MIT", "engines": { "node": ">=4" } @@ -947,7 +856,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -957,7 +865,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", - "license": "ISC", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } @@ -979,7 +886,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz", "integrity": "sha512-uo0Z9JJeWzv8BG+tRcapBKNJ0dro9cLyczGzulS6EfeyAdeC9sbojtW6XwvYxJkEne9En+J2XEl4zyglVeIwFg==", - "license": "MIT", "dependencies": { "callsites": "^3.1.0" }, @@ -1003,7 +909,6 @@ "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", - "license": "MIT", "engines": { "node": ">=0.10" } @@ -1012,7 +917,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "license": "MIT", "engines": { "node": ">=8" } @@ -1048,20 +952,17 @@ "node_modules/vscode-languageserver-textdocument": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", - "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==", - "license": "MIT" + "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==" }, "node_modules/vscode-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.1.0.tgz", - "integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==", - "license": "MIT" + "integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==" }, "node_modules/xdg-basedir": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", - "license": "MIT", "engines": { "node": ">=12" }, @@ -1073,7 +974,6 @@ "version": "2.8.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", - "license": "ISC", "bin": { "yaml": "bin.mjs" }, diff --git a/package.json b/package.json index 28e338fe7f..c29afa5e0d 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.1.1" + "cspell": "^9.1.2" } } From 74f07de571afbe9c82e3c326c0fdd5ff1edfe94b Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Fri, 27 Jun 2025 22:19:57 +0200 Subject: [PATCH 631/845] Add `WithStrictTyping` and `WithStrictTypingFor` to `BeEquivalentTo` to ensure types also match --- .../Equivalency/EquivalencyPlan.cs | 1 + .../CollectionMemberOptionsDecorator.cs | 6 +- .../IEquivalencyValidationContext.cs | 4 +- .../SelfReferenceEquivalencyOptions.cs | 52 +++- .../Equivalency/Steps/TypeEquivalencyStep.cs | 59 +++++ .../Typing/AlwaysBeStrictTypingRule.cs | 21 ++ .../Equivalency/Typing/IContainTypingRules.cs | 14 + .../Equivalency/Typing/ITypingRule.cs | 13 + .../Typing/PredicateBasedTypingRule.cs | 39 +++ .../FluentAssertions/net47.verified.txt | 8 + .../FluentAssertions/net6.0.verified.txt | 8 + .../netstandard2.0.verified.txt | 8 + .../netstandard2.1.verified.txt | 8 + .../UsersOfGetClosedGenericInterfaces.cs | 4 + .../ConfigurationSpecsDefinition.cs | 7 + .../TypeEqualitySpecs.cs | 243 ++++++++++++++++++ docs/_data/navigation.yml | 2 +- docs/_pages/objectgraphs.md | 37 ++- docs/_pages/releases.md | 14 +- 19 files changed, 538 insertions(+), 10 deletions(-) create mode 100644 Src/FluentAssertions/Equivalency/Steps/TypeEquivalencyStep.cs create mode 100644 Src/FluentAssertions/Equivalency/Typing/AlwaysBeStrictTypingRule.cs create mode 100644 Src/FluentAssertions/Equivalency/Typing/IContainTypingRules.cs create mode 100644 Src/FluentAssertions/Equivalency/Typing/ITypingRule.cs create mode 100644 Src/FluentAssertions/Equivalency/Typing/PredicateBasedTypingRule.cs create mode 100644 Tests/FluentAssertions.Equivalency.Specs/ConfigurationSpecsDefinition.cs create mode 100644 Tests/FluentAssertions.Equivalency.Specs/TypeEqualitySpecs.cs diff --git a/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs b/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs index f8975a0ba2..9e3f22a58a 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs @@ -142,6 +142,7 @@ private static List GetDefaultSteps() [ new RunAllUserStepsEquivalencyStep(), new AutoConversionStep(), + new TypeEquivalencyStep(), new ReferenceEqualityEquivalencyStep(), new GenericDictionaryEquivalencyStep(), new XDocumentEquivalencyStep(), diff --git a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs index acdf0654b5..4b2188150b 100644 --- a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs +++ b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs @@ -4,13 +4,14 @@ using FluentAssertions.Equivalency.Ordering; using FluentAssertions.Equivalency.Selection; using FluentAssertions.Equivalency.Tracing; +using FluentAssertions.Equivalency.Typing; namespace FluentAssertions.Equivalency.Execution; /// /// Ensures that all the rules remove the collection index from the path before processing it further. /// -internal class CollectionMemberOptionsDecorator : IEquivalencyOptions +internal class CollectionMemberOptionsDecorator : IEquivalencyOptions, IContainTypingRules { private readonly IEquivalencyOptions inner; @@ -32,6 +33,9 @@ public IEnumerable MatchingRules get { return inner.MatchingRules.ToArray(); } } + /// + public IEnumerable TypingRules => (inner as IContainTypingRules)?.TypingRules ?? []; + public OrderingRuleCollection OrderingRules { get diff --git a/Src/FluentAssertions/Equivalency/IEquivalencyValidationContext.cs b/Src/FluentAssertions/Equivalency/IEquivalencyValidationContext.cs index 0f17b42e34..4ea00fa840 100644 --- a/Src/FluentAssertions/Equivalency/IEquivalencyValidationContext.cs +++ b/Src/FluentAssertions/Equivalency/IEquivalencyValidationContext.cs @@ -17,7 +17,7 @@ public interface IEquivalencyValidationContext /// /// A formatted phrase and the placeholder values explaining why the assertion is needed. /// - public Reason Reason { get; } + Reason Reason { get; } /// /// Gets an object that can be used by the equivalency algorithm to provide a trace when the @@ -31,7 +31,7 @@ public interface IEquivalencyValidationContext /// Determines whether the specified object reference is a cyclic reference to the same object earlier in the /// equivalency validation. /// - public bool IsCyclicReference(object expectation); + bool IsCyclicReference(object expectation); /// /// Creates a context from the current object intended to assert the equivalency of a nested member. diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index 720906b45e..b1a77a08a9 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -12,6 +12,7 @@ using FluentAssertions.Equivalency.Selection; using FluentAssertions.Equivalency.Steps; using FluentAssertions.Equivalency.Tracing; +using FluentAssertions.Equivalency.Typing; namespace FluentAssertions.Equivalency; @@ -20,7 +21,7 @@ namespace FluentAssertions.Equivalency; /// /// Represents the run-time behavior of a structural equivalency assertion. /// -public abstract class SelfReferenceEquivalencyOptions : IEquivalencyOptions +public abstract class SelfReferenceEquivalencyOptions : IEquivalencyOptions, IContainTypingRules where TSelf : SelfReferenceEquivalencyOptions { #region Private Definitions @@ -33,6 +34,9 @@ public abstract class SelfReferenceEquivalencyOptions : IEquivalencyOptio [DebuggerBrowsable(DebuggerBrowsableState.Never)] private readonly List matchingRules = []; + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private readonly List typingRules = []; + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private readonly List userEquivalencySteps = []; @@ -100,6 +104,11 @@ protected SelfReferenceEquivalencyOptions(IEquivalencyOptions defaults) matchingRules.AddRange(defaults.MatchingRules); OrderingRules = new OrderingRuleCollection(defaults.OrderingRules); + if (defaults is IContainTypingRules typingRulesContainer) + { + typingRules.AddRange(typingRulesContainer.TypingRules); + } + TraceWriter = defaults.TraceWriter; RemoveSelectionRule(); @@ -148,6 +157,8 @@ IEnumerable IEquivalencyOptions.SelectionRules /// IEnumerable IEquivalencyOptions.UserEquivalencySteps => userEquivalencySteps; + IEnumerable IContainTypingRules.TypingRules => typingRules; + public ConversionSelector ConversionSelector { get; } = new(); /// @@ -279,6 +290,20 @@ public TSelf IncludingProperties() return (TSelf)this; } + /// + /// Disables the strict typing requirement for all members, allowing members in the expectation to be of different types + /// than members in the subject. + /// + /// + /// This is particularly useful when you have enabled strict typing globally or for specific tests but want to override it + /// for a particular assertion. + /// + public TSelf WithoutStrictTyping() + { + typingRules.Clear(); + return (TSelf)this; + } + /// /// Instructs the comparison to include public and internal properties. /// @@ -598,6 +623,26 @@ public TSelf WithoutStrictOrderingFor(Expression> predic return (TSelf)this; } + /// + /// Causes all type comparisons to be strict, requiring exact type equality between + /// subject and expectation. + /// + public TSelf WithStrictTyping() + { + typingRules.Add(new AlwaysBeStrictTypingRule()); + return (TSelf)this; + } + + /// + /// Causes the types identified by the provided to be + /// compared using strict typing, requiring exact type equality. + /// + public TSelf WithStrictTypingFor(Expression> predicate) + { + typingRules.Add(new PredicateBasedTypingRule(predicate)); + return (TSelf)this; + } + /// /// Causes to compare Enum properties using the result of their ToString method. /// @@ -839,6 +884,11 @@ public override string ToString() builder.Append("- ").AppendLine(rule.ToString()); } + foreach (ITypingRule rule in typingRules) + { + builder.Append("- ").AppendLine(rule.ToString()); + } + foreach (IMemberMatchingRule rule in matchingRules) { builder.Append("- ").AppendLine(rule.ToString()); diff --git a/Src/FluentAssertions/Equivalency/Steps/TypeEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/TypeEquivalencyStep.cs new file mode 100644 index 0000000000..e63c850e43 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Steps/TypeEquivalencyStep.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections; +using System.Linq; +using FluentAssertions.Equivalency.Typing; +using FluentAssertions.Execution; + +namespace FluentAssertions.Equivalency.Steps; + +/// +/// An equivalency step that asserts two objects must be of the same type to be equivalent. +/// +/// +/// This differs from the default equivalency assertion which states that two objects are equivalent if they have the +/// same properties and values, regardless of their type. +/// +public class TypeEquivalencyStep : IEquivalencyStep +{ + public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, + IValidateChildNodeEquivalency valueChildNodes) + { + if (context.Options is not IContainTypingRules options) + { + return EquivalencyResult.ContinueWithNext; + } + + // When comparing using a collection we want to compare the children of the collection not the collection itself (the root object) + if (comparands.Subject is IEnumerable) + { + return EquivalencyResult.ContinueWithNext; + } + + // If both are null or reference the same instance, there's no need to have this step check anything + if (ReferenceEquals(comparands.Subject, comparands.Expectation)) + { + return EquivalencyResult.ContinueWithNext; + } + + // The above checks if both were null, but if only one is null then there's no need to have this step check anything + if (comparands.Subject is null || comparands.Expectation is null) + { + return EquivalencyResult.ContinueWithNext; + } + + // Check if strict typing should be applied based on typing rules + bool shouldUseStrictTyping = options.TypingRules.Any(rule => rule.UseStrictTyping(comparands, context.CurrentNode)); + if (!shouldUseStrictTyping) + { + return EquivalencyResult.ContinueWithNext; + } + + Type expectedType = comparands.GetExpectedType(context.Options); + + AssertionChain.GetOrCreate().For(context) + .ForCondition(comparands.Subject.GetType() == expectedType) + .FailWith("Expected {context:subject} to be of type {0}, but found {1}", expectedType, comparands.Subject.GetType()); + + return EquivalencyResult.ContinueWithNext; + } +} diff --git a/Src/FluentAssertions/Equivalency/Typing/AlwaysBeStrictTypingRule.cs b/Src/FluentAssertions/Equivalency/Typing/AlwaysBeStrictTypingRule.cs new file mode 100644 index 0000000000..8f81205c2c --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Typing/AlwaysBeStrictTypingRule.cs @@ -0,0 +1,21 @@ +namespace FluentAssertions.Equivalency.Typing; + +/// +/// An implementation of that applies strict typing to all objects. +/// +internal class AlwaysBeStrictTypingRule : ITypingRule +{ + /// + public bool UseStrictTyping(Comparands comparands, INode node) + { + return true; + } + + /// + /// Returns a string representation of this object. + /// + public override string ToString() + { + return "The types of the fields and properties must be the same"; + } +} diff --git a/Src/FluentAssertions/Equivalency/Typing/IContainTypingRules.cs b/Src/FluentAssertions/Equivalency/Typing/IContainTypingRules.cs new file mode 100644 index 0000000000..cc8793bad0 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Typing/IContainTypingRules.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; + +namespace FluentAssertions.Equivalency.Typing; + +/// +/// Marks a type as containing typing rules that influence how types are compared during equivalency assertions. +/// +internal interface IContainTypingRules +{ + /// + /// Gets a collection of typing rules that determine how types are handled during equivalency assertions. + /// + IEnumerable TypingRules { get; } +} diff --git a/Src/FluentAssertions/Equivalency/Typing/ITypingRule.cs b/Src/FluentAssertions/Equivalency/Typing/ITypingRule.cs new file mode 100644 index 0000000000..48cac976c8 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Typing/ITypingRule.cs @@ -0,0 +1,13 @@ +namespace FluentAssertions.Equivalency.Typing; + +/// +/// Represents a rule that determines whether the types of the fields and properties in an object graph should be the same between +/// subject and expectation. +/// +internal interface ITypingRule +{ + /// + /// Determines whether strict typing should be applied to the given node in the object graph. + /// + bool UseStrictTyping(Comparands comparands, INode node); +} diff --git a/Src/FluentAssertions/Equivalency/Typing/PredicateBasedTypingRule.cs b/Src/FluentAssertions/Equivalency/Typing/PredicateBasedTypingRule.cs new file mode 100644 index 0000000000..3aea5b3db2 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Typing/PredicateBasedTypingRule.cs @@ -0,0 +1,39 @@ +using System; +using System.Linq.Expressions; +using FluentAssertions.Equivalency.Execution; + +namespace FluentAssertions.Equivalency.Typing; + +/// +/// An implementation of that uses a predicate to determine +/// whether strict typing should be applied during equivalency comparison. +/// +internal class PredicateBasedTypingRule : ITypingRule +{ + private readonly Func predicate; + private readonly string description; + + /// + /// Initializes a new instance of the class with a predicate. + /// + /// A predicate that determines whether strict typing should be applied. + public PredicateBasedTypingRule(Expression> predicate) + { + description = predicate.Body.ToString(); + this.predicate = predicate.Compile(); + } + + /// + public bool UseStrictTyping(Comparands comparands, INode node) + { + return predicate(new ObjectInfo(comparands, node)); + } + + /// + /// Returns a string representation of this object. + /// + public override string ToString() + { + return $"Use strict typing when {description}"; + } +} diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index e54ea43a32..fc62d6eb1a 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -946,6 +946,8 @@ namespace FluentAssertions.Equivalency public TSelf WithAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithStrictOrdering() { } public TSelf WithStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } + public TSelf WithStrictTyping() { } + public TSelf WithStrictTypingFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithTracing(FluentAssertions.Equivalency.Tracing.ITraceWriter writer = null) { } public TSelf WithoutAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithoutMatchingRules() { } @@ -953,6 +955,7 @@ namespace FluentAssertions.Equivalency public TSelf WithoutSelectionRules() { } public TSelf WithoutStrictOrdering() { } public TSelf WithoutStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } + public TSelf WithoutStrictTyping() { } public class Restriction { public Restriction(TSelf options, System.Action> action) { } @@ -1044,6 +1047,11 @@ namespace FluentAssertions.Equivalency.Steps public StructuralEqualityEquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + public class TypeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep + { + public TypeEquivalencyStep() { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + } public class ValueTypeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public ValueTypeEquivalencyStep() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 0aa96806bc..b6d1745277 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -959,6 +959,8 @@ namespace FluentAssertions.Equivalency public TSelf WithAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithStrictOrdering() { } public TSelf WithStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } + public TSelf WithStrictTyping() { } + public TSelf WithStrictTypingFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithTracing(FluentAssertions.Equivalency.Tracing.ITraceWriter writer = null) { } public TSelf WithoutAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithoutMatchingRules() { } @@ -966,6 +968,7 @@ namespace FluentAssertions.Equivalency public TSelf WithoutSelectionRules() { } public TSelf WithoutStrictOrdering() { } public TSelf WithoutStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } + public TSelf WithoutStrictTyping() { } public class Restriction { public Restriction(TSelf options, System.Action> action) { } @@ -1057,6 +1060,11 @@ namespace FluentAssertions.Equivalency.Steps public StructuralEqualityEquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + public class TypeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep + { + public TypeEquivalencyStep() { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + } public class ValueTypeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public ValueTypeEquivalencyStep() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 217fcf8803..54db3dc68f 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -938,6 +938,8 @@ namespace FluentAssertions.Equivalency public TSelf WithAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithStrictOrdering() { } public TSelf WithStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } + public TSelf WithStrictTyping() { } + public TSelf WithStrictTypingFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithTracing(FluentAssertions.Equivalency.Tracing.ITraceWriter writer = null) { } public TSelf WithoutAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithoutMatchingRules() { } @@ -945,6 +947,7 @@ namespace FluentAssertions.Equivalency public TSelf WithoutSelectionRules() { } public TSelf WithoutStrictOrdering() { } public TSelf WithoutStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } + public TSelf WithoutStrictTyping() { } public class Restriction { public Restriction(TSelf options, System.Action> action) { } @@ -1036,6 +1039,11 @@ namespace FluentAssertions.Equivalency.Steps public StructuralEqualityEquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + public class TypeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep + { + public TypeEquivalencyStep() { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + } public class ValueTypeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public ValueTypeEquivalencyStep() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index a380bf1828..59a3c42265 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -946,6 +946,8 @@ namespace FluentAssertions.Equivalency public TSelf WithAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithStrictOrdering() { } public TSelf WithStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } + public TSelf WithStrictTyping() { } + public TSelf WithStrictTypingFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithTracing(FluentAssertions.Equivalency.Tracing.ITraceWriter writer = null) { } public TSelf WithoutAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithoutMatchingRules() { } @@ -953,6 +955,7 @@ namespace FluentAssertions.Equivalency public TSelf WithoutSelectionRules() { } public TSelf WithoutStrictOrdering() { } public TSelf WithoutStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } + public TSelf WithoutStrictTyping() { } public class Restriction { public Restriction(TSelf options, System.Action> action) { } @@ -1044,6 +1047,11 @@ namespace FluentAssertions.Equivalency.Steps public StructuralEqualityEquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + public class TypeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep + { + public TypeEquivalencyStep() { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + } public class ValueTypeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public ValueTypeEquivalencyStep() { } diff --git a/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs b/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs index 9261eb12ae..33762a05cb 100644 --- a/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs +++ b/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs @@ -8,6 +8,7 @@ using FluentAssertions.Equivalency; using FluentAssertions.Equivalency.Steps; using FluentAssertions.Equivalency.Tracing; +using FluentAssertions.Equivalency.Typing; using FluentAssertions.Execution; namespace Benchmarks; @@ -48,6 +49,9 @@ private class Config : IEquivalencyOptions public IEnumerable MatchingRules => throw new NotImplementedException(); + /// + public IEnumerable TypingRules => throw new NotImplementedException(); + public bool IsRecursive => throw new NotImplementedException(); public bool AllowInfiniteRecursion => throw new NotImplementedException(); diff --git a/Tests/FluentAssertions.Equivalency.Specs/ConfigurationSpecsDefinition.cs b/Tests/FluentAssertions.Equivalency.Specs/ConfigurationSpecsDefinition.cs new file mode 100644 index 0000000000..c169880e82 --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/ConfigurationSpecsDefinition.cs @@ -0,0 +1,7 @@ +using Xunit; + +namespace FluentAssertions.Equivalency.Specs; + +// Due to tests that call the static AssertionConfiguration or AssertionEngine, we need to disable parallelization +[CollectionDefinition("ConfigurationSpecs", DisableParallelization = true)] +public class ConfigurationSpecsDefinition; diff --git a/Tests/FluentAssertions.Equivalency.Specs/TypeEqualitySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/TypeEqualitySpecs.cs new file mode 100644 index 0000000000..b37648e1aa --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/TypeEqualitySpecs.cs @@ -0,0 +1,243 @@ +using System; +using System.Collections.Generic; +using JetBrains.Annotations; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Equivalency.Specs; + +[Collection("ConfigurationSpecs")] +public class TypeEqualitySpecs +{ + [Fact] + public void Throws_when_top_level_types_are_expected_to_match() + { + // Arrange + var subject = new FooWithNestedClass(); + + var expectation = new BarWithNested(); + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, x => x.WithStrictTyping()); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject*type*TypeEqualitySpecs+BarWithNested*but*TypeEqualitySpecs+FooWithNestedClass*") + .WithMessage("*The types of the fields and properties must be the same*"); + } + + [Fact] + public void By_default_the_runtime_type_is_ignored() + { + // Arrange + Nested subject = new(); + + Nested expectation = new NestedSubtype(); + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, x => x.WithStrictTyping()); + } + + [Fact] + public void Can_check_the_runtime_type_if_that_was_requested() + { + // Arrange + Nested subject = new(); + + Nested expectation = new NestedSubtype(); + + // Act / Assert + Action act = () => subject.Should().BeEquivalentTo(expectation, x => x + .PreferringRuntimeMemberTypes() + .WithStrictTyping()); + + act.Should().Throw().WithMessage( + "Expected subject to be of type *TypeEqualitySpecs+NestedSubtype*, but found *TypeEqualitySpecs+Nested*"); + } + + [Fact] + public void Uses_the_declared_type_for_members_of_root_objects() + { + // Arrange + var subject = new FooWithNestedClass + { + Nested = new Nested() + }; + + var expectation = new BarWithNested + { + Nested = new NestedSubtype() + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, x => x + .WithStrictTypingFor(info => info.Path.EndsWith("Nested"))); + } + + [Fact] + public void The_collection_type_is_ignored() + { + // Arrange + var subject = new[] + { + new FooWithNestedClass + { + Nested = new Nested() + } + }; + + var expectation = new List + { + new() + { + Nested = new NestedSubtype() + } + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, x => x + .WithStrictTyping()); + + // Assert + act.Should().Throw() + .WithMessage("Expected subject[0]*BarWithNested*but*FooWithNestedClass*"); + } + + [Fact] + public void Can_use_the_runtime_type_for_members_of_root_objects() + { + // Arrange + var subject = new FooWithNestedClass + { + Nested = new Nested() + }; + + var expectation = new BarWithNested + { + Nested = new NestedSubtype() + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, x => x + .PreferringRuntimeMemberTypes() + .WithStrictTypingFor(info => info.Path.EndsWith("Nested"))); + + // Assert + act.Should().Throw() + .WithMessage("Expected property subject.Nested*NestedSubtype*but*Nested*") + .WithMessage("*Use strict typing when info.Path.EndsWith(\"Nested\")*"); + } + + [Fact] + public void Requesting_strict_typing_for_nested_members_ignores_root_objects_of_mismatching_types() + { + // Arrange + var subject = new + { + Nested = new Nested(), + OtherProperty = "value" + }; + + var expectation = new + { + Nested = new Nested() + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, x => + x.WithStrictTypingFor(info => info.Path.EndsWith("Nested"))); + } + + [Fact] + public void Can_request_strict_typing_for_nested_members_for_mismatching_roots() + { + // Arrange + var subject = new + { + Nested = new Nested(), + OtherProperty = "value" + }; + + var expectation = new + { + Nested = new NestedSubtype() + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, x => + x.WithStrictTypingFor(info => info.Path.EndsWith("Nested"))); + + // Assert + act.Should().Throw() + .WithMessage("*subject.Nested*NestedSubtype*but*Nested*"); + } + + [Fact] + public void Can_request_strict_typing_for_the_root_only() + { + // Arrange + var subject = new + { + Nested = new Nested(), + OtherProperty = "value" + }; + + var expectation = new + { + Nested = new NestedSubtype() + }; + + // Act / Assert + Action act = () => subject.Should().BeEquivalentTo(expectation, x => + x.WithStrictTypingFor(info => info.Path.Length == 0)); + + act.Should().Throw() + .WithMessage("Expected*AnonymousType*NestedSubtype*but*AnonymousType*Nested*String*"); + } + + [Fact] + public void Can_override_globally_applied_strict_typing_for_individual_assertions() + { + try + { + // Arrange + AssertionConfiguration.Current.Equivalency.Modify(x => x.WithStrictTyping()); + + var subject = new FooWithNestedClass + { + Nested = new Nested() + }; + + var expectation = new BarWithNested + { + Nested = new Nested() + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, x => x.WithoutStrictTyping()); + } + finally + { + AssertionEngine.ResetToDefaults(); + } + } + + private class FooWithNestedClass + { + [UsedImplicitly] + public Nested Nested { get; set; } + } + + private class BarWithNested + { + [UsedImplicitly] + public Nested Nested { get; set; } + } + + private class Nested + { + public string Name { get; set; } + } + + private class NestedSubtype : Nested; +} diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index efae3d15fa..826fa47aca 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -61,7 +61,7 @@ sidebar: url: /data - title: Exceptions url: /exceptions - - title: Object graph comparison + - title: Object Graphs url: /objectgraphs - title: Event Monitoring url: /eventmonitoring diff --git a/docs/_pages/objectgraphs.md b/docs/_pages/objectgraphs.md index 04d0776066..08622eaeab 100644 --- a/docs/_pages/objectgraphs.md +++ b/docs/_pages/objectgraphs.md @@ -1,5 +1,5 @@ --- -title: Object graph comparison +title: Object graphs permalink: /objectgraphs/ layout: single classes: wide @@ -37,6 +37,41 @@ orderDto.Should().BeEquivalentTo(order, options => options.ExcludingNestedObjects()); ``` +### Strict typing (or not) + +By default, `BeEquivalentTo` will consider objects equivalent as long as their members match, regardless of whether the types are exactly the same. This means that objects of different types can be considered equivalent if they have the same structure and values. + +However, sometimes you may want to ensure that not only the values match, but also the types are exactly the same. For such scenarios, you can use the strict typing options: + +```csharp +// Ensure all types must match exactly throughout the entire object graph +orderDto.Should().BeEquivalentTo(order, options => + options.WithStrictTyping()); +``` + +If you only want to enforce strict typing for specific members or paths, you can use `WithStrictTypingFor`: + +```csharp +// Only enforce strict typing for properties named "Nested" +orderDto.Should().BeEquivalentTo(order, options => + options.WithStrictTypingFor(info => info.Path.EndsWith("Nested"))); + +// Only enforce strict typing for the root object +orderDto.Should().BeEquivalentTo(order, options => + options.WithStrictTypingFor(info => info.Path.Length == 0)); +``` + +The predicate in `WithStrictTypingFor` receives an `IObjectInfo` parameter that provides information about the current member being compared, including its path in the object graph. This allows you to precisely control where strict typing should be applied. + +You can also disable strict typing that was previously enabled (for example, through global configuration): + +```csharp +orderDto.Should().BeEquivalentTo(order, options => + options.WithoutStrictTyping()); +``` + +**Note:** When using strict typing with runtime types (via `PreferringRuntimeMemberTypes()`), the comparison will use the actual runtime type rather than the declared type for the type equality check. + ### Value Types To determine whether Fluent Assertions should recurs into an object's properties or fields, it needs to understand what types have value semantics and what types should be treated as reference types. The default behavior is to treat every type that overrides `Object.Equals` as an object that was designed to have value semantics. Anonymous types, `record`s, `record struct`s and tuples also override this method, but because the community proved us that they use them quite often in equivalency comparisons, we decided to always compare them by their members. diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index e9aa3856ef..222b02c847 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,19 +7,25 @@ sidebar: nav: "sidebar" --- +## 8.5.0 + +## What's new + +* Add `WithStrictTyping` and `WithStrictTypingFor` to `BeEquivalentTo` to ensure types also match - [#3066](https://github.com/fluentassertions/fluentassertions/pull/3066) + ## 8.4.0 ## Enhancements -* Added `ExcludingMembersNamed` to `BeEquivalentTo` to exclude fields and properties anywhere in the graph - [3062](https://github.com/fluentassertions/fluentassertions/pull/3062) -* Added `Should().Throw()`, `ThrowAsync()` and `ThrowWithinAsync()` flavors that don’t require a specific exception type - [3059](https://github.com/fluentassertions/fluentassertions/pull/3059) +* Added `ExcludingMembersNamed` to `BeEquivalentTo` to exclude fields and properties anywhere in the graph - [#3062](https://github.com/fluentassertions/fluentassertions/pull/3062) +* Added `Should().Throw()`, `ThrowAsync()` and `ThrowWithinAsync()` flavors that don’t require a specific exception type - [#3059](https://github.com/fluentassertions/fluentassertions/pull/3059) ## 8.3.0 ## Enhancements -* Clarify the date/time type when comparing non-compatible dates and times in `BeEquivalentTo` - [3049](https://github.com/fluentassertions/fluentassertions/pull/3049) -* Improve the rendering of exception messages when using `WithMessage` for better readability - [3039](https://github.com/fluentassertions/fluentassertions/pull/3039) +* Clarify the date/time type when comparing non-compatible dates and times in `BeEquivalentTo` - [#3049](https://github.com/fluentassertions/fluentassertions/pull/3049) +* Improve the rendering of exception messages when using `WithMessage` for better readability - [#3039](https://github.com/fluentassertions/fluentassertions/pull/3039) ## 8.2.0 From 9678cd6ea0da233951b28ec60d69cfb704e31b44 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 29 Jun 2025 09:28:23 +0200 Subject: [PATCH 632/845] Ensured WithTracing is safe when used with BeEquivalentTo globally --- .../EquivalencyValidationContext.cs | 14 ++++++++ .../Equivalency/EquivalencyValidator.cs | 2 ++ .../SelfReferenceEquivalencyOptions.cs | 2 +- .../Tracing/InternalTraceWriter.cs | 5 +++ .../TracingSpecs.cs | 34 +++++++++++++++++++ docs/_pages/releases.md | 4 +++ 6 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 Src/FluentAssertions/Equivalency/Tracing/InternalTraceWriter.cs create mode 100644 Tests/FluentAssertions.Equivalency.Specs/TracingSpecs.cs diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs index f71912f83b..d6cee4a0cd 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs @@ -82,6 +82,20 @@ public bool IsCyclicReference(object expectation) public ITraceWriter TraceWriter { get; set; } + /// + /// This method ensures that tracing starts with a fresh state when invoked. + /// + internal void ResetTracing() + { + // SMELL: We need to ensure that if tracing is enabled using the built-in internal writer, + // we start with a fresh instance of InternalTraceWriter. We can't add extend ITraceWriter + // as that would be a breaking change. + if (TraceWriter is InternalTraceWriter) + { + TraceWriter = new InternalTraceWriter(); + } + } + public override string ToString() { return Invariant($"{{Path=\"{CurrentNode.Subject.PathAndName}\"}}"); diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs index 1f7a3086fe..6a796efdec 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs @@ -13,6 +13,8 @@ internal class EquivalencyValidator : IValidateChildNodeEquivalency public void AssertEquality(Comparands comparands, EquivalencyValidationContext context) { + context.ResetTracing(); + using var scope = new AssertionScope(); RecursivelyAssertEquivalencyOf(comparands, context); diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index b1a77a08a9..1e2bb6b046 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -747,7 +747,7 @@ public TSelf ComparingByValue(Type type) /// public TSelf WithTracing(ITraceWriter writer = null) { - TraceWriter = writer ?? new StringBuilderTraceWriter(); + TraceWriter = writer ?? new InternalTraceWriter(); return (TSelf)this; } diff --git a/Src/FluentAssertions/Equivalency/Tracing/InternalTraceWriter.cs b/Src/FluentAssertions/Equivalency/Tracing/InternalTraceWriter.cs new file mode 100644 index 0000000000..1df987b6ae --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Tracing/InternalTraceWriter.cs @@ -0,0 +1,5 @@ +namespace FluentAssertions.Equivalency.Tracing; + +internal sealed class InternalTraceWriter : StringBuilderTraceWriter +{ +} diff --git a/Tests/FluentAssertions.Equivalency.Specs/TracingSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/TracingSpecs.cs new file mode 100644 index 0000000000..617f4fc276 --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/TracingSpecs.cs @@ -0,0 +1,34 @@ +using System.Threading.Tasks; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Equivalency.Specs; + +[Collection("ConfigurationSpecs")] +public class TracingSpecs +{ + [Fact] + public void Tracing_must_be_safe_when_executed_concurrently() + { + try + { + // Arrange + AssertionConfiguration.Current.Equivalency.Modify(e => e.WithTracing()); + + Parallel.For(1, 10_000, (_, _) => + { + try + { + new { A = "a" }.Should().BeEquivalentTo(new { A = "b" }); + } + catch (XunitException) + { + } + }); + } + finally + { + AssertionEngine.ResetToDefaults(); + } + } +} diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 222b02c847..5f1565fb92 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -13,6 +13,10 @@ sidebar: * Add `WithStrictTyping` and `WithStrictTypingFor` to `BeEquivalentTo` to ensure types also match - [#3066](https://github.com/fluentassertions/fluentassertions/pull/3066) +## Fixes + +* Ensured `WithTracing` is safe when used with `BeEquivalentTo` globally - [#3067](https://github.com/fluentassertions/fluentassertions/pull/3067) + ## 8.4.0 ## Enhancements From 12d0c6576be112726c69d4fc935e471805d73bb2 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 16:23:41 +0200 Subject: [PATCH 633/845] Use .NET 9 SDK --- .github/workflows/build.yml | 4 ++-- .github/workflows/codeql.yml | 2 +- Build/Build.cs | 4 ++-- Build/_build.csproj | 2 +- README.md | 2 +- global.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 232e4136b4..6aec010023 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,8 +20,8 @@ jobs: with: dotnet-version: | 6.0.x - 7.0.x 8.0.x + 9.0.x - name: Cache .nuke/temp uses: actions/cache@v4 @@ -75,8 +75,8 @@ jobs: with: dotnet-version: | 6.0.x - 7.0.x 8.0.x + 9.0.x - name: Run NUKE run: ./build.sh UnitTests diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ce80ecec8d..552c62131d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,7 +28,7 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: | - 8.0.x + 9.0.x - name: Checkout repository diff --git a/Build/Build.cs b/Build/Build.cs index 159108a4c6..f8cbf75bf0 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -57,7 +57,7 @@ class Build : NukeBuild readonly Solution Solution; [Required] - [GitVersion(Framework = "net8.0", NoCache = true, NoFetch = true)] + [GitVersion(Framework = "net9.0", NoCache = true, NoFetch = true)] readonly GitVersion GitVersion; [Required] @@ -220,7 +220,7 @@ class Build : NukeBuild { ReportGenerator(s => s .SetProcessToolPath(NuGetToolPathResolver.GetPackageExecutable("ReportGenerator", "ReportGenerator.dll", - framework: "net8.0")) + framework: "net9.0")) .SetTargetDirectory(TestResultsDirectory / "reports") .AddReports(TestResultsDirectory / "**/coverage.cobertura.xml") .AddReportTypes( diff --git a/Build/_build.csproj b/Build/_build.csproj index 31894d6f91..76122848a3 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -1,7 +1,7 @@  Exe - net8.0 + net9.0 CS0649;CS0169 ..\ diff --git a/README.md b/README.md index 48a219198c..9ef506eeac 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Visit https://www.fluentassertions.com for [background information](https://flue Originally authored by Dennis Doomen with Jonas Nyrup as the productive side-kick. Xceed is now an official Partner to Fluent Assertions! [Learn what this partnership means for our users](https://xceed.com/fluent-assertions-faq/). After extensive discussions with the Fluent Assertions team, we are thrilled about the future of the product and look forward to its continued growth and development. # How do I build this? -Install Visual Studio 2022 17.8+ or JetBrains Rider 2021.3 as well as the Build Tools 2022 (including the Universal Windows Platform build tools). You will also need to have .NET Framework 4.7 SDK and .NET 8.0 SDK installed. Check the [global.json](global.json) for the current minimum required version. +Install Visual Studio 2022 17.14+ or JetBrains Rider 2024.3 as well as the Build Tools 2022 (including the Universal Windows Platform build tools). You will also need to have .NET Framework 4.7 SDK and .NET 9.0 SDK installed. Check the [global.json](global.json) for the current minimum required version. # What are these Approval.Tests? This is a special set of tests that use the [Verify](https://github.com/VerifyTests/Verify) project to verify whether you've introduced any breaking changes in the public API of the library. diff --git a/global.json b/global.json index b829814972..c48f9699dd 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.404", + "version": "9.0.300", "rollForward": "latestMajor" } } From 32a32c91591acdefe5f366a13be63e5d073e2af2 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 16:43:42 +0200 Subject: [PATCH 634/845] Use C# 13.0 --- Directory.Build.props | 2 +- Tests/UWP.Specs/Directory.Build.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 2f23cead51..772591388f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 12.0 + 13.0 false true diff --git a/Tests/UWP.Specs/Directory.Build.props b/Tests/UWP.Specs/Directory.Build.props index b09e3158ba..0d251bdbd1 100644 --- a/Tests/UWP.Specs/Directory.Build.props +++ b/Tests/UWP.Specs/Directory.Build.props @@ -1,6 +1,6 @@ - 12.0 + 13.0 false true From 1da2345b1ed1410d6e978b1aa5e83e2646492946 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 16:52:57 +0200 Subject: [PATCH 635/845] Pin VB to version 16.9 It worked with 12.0 by coincidence as both VB and C# has a version 12.0, but VB does not have a version 13.0 --- Tests/VB.Specs/VB.Specs.vbproj | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index d852640e63..cfc7e3edc4 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -3,6 +3,7 @@ net6.0 VB.Specs + 16.9 From 82dcf2b2098d6789aa804a2e622c02947ee5e464 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:10:37 +0200 Subject: [PATCH 636/845] Update .NET analyzers to .NET 9 wave --- Directory.Build.props | 2 +- Tests/.editorconfig | 4 ++++ .../SelectionRulesSpecs.Basic.cs | 4 ++-- .../FluentAssertions.Specs/Events/EventAssertionSpecs.cs | 6 +++--- .../Primitives/StringAssertionSpecs.MatchRegex.cs | 8 ++++++++ 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 772591388f..ddbfa632c5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -13,7 +13,7 @@ true - 8.0 + 9.0 All true diff --git a/Tests/.editorconfig b/Tests/.editorconfig index 301ba6381b..24826087b3 100644 --- a/Tests/.editorconfig +++ b/Tests/.editorconfig @@ -55,6 +55,8 @@ dotnet_diagnostic.CA1064.severity = none dotnet_diagnostic.CA1307.severity = none # CA1506 Rewrite or refactor the code to decrease its class coupling dotnet_diagnostic.CA1506.severity = none +# CA1515 CA1515: Consider making public types internal +dotnet_diagnostic.CA1515.severity = none # CA1707: Remove the underscores from member name dotnet_diagnostic.CA1707.severity = none # CA1711: Rename type name so that it does not end in 'Enum' @@ -97,6 +99,8 @@ dotnet_diagnostic.CA2201.severity = none dotnet_diagnostic.CA2208.severity = none # CA2227: Collection properties should be read only dotnet_diagnostic.CA2227.severity = none +# CA2263: Prefer generic overload when type is known +dotnet_diagnostic.CA2263.severity = none # CA5394 Random is an insecure random number generator dotnet_diagnostic.CA5394.severity = none diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs index 53e10cf7f0..a86d39c2ea 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Basic.cs @@ -311,9 +311,9 @@ private class Test : ITest private interface ITest { - public string Name { get; } + string Name { get; } - public int NameLength => Name.Length; + int NameLength => Name.Length; } #endif diff --git a/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs index 69d4746e03..8c6530f81c 100644 --- a/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Events/EventAssertionSpecs.cs @@ -1151,17 +1151,17 @@ private interface IAddOkEvent private interface IAddFailingRecordableEvent { - public event EventHandler AddFailingRecorableEvent; + event EventHandler AddFailingRecorableEvent; } private interface IAddFailingEvent { - public event EventHandler AddFailingEvent; + event EventHandler AddFailingEvent; } private interface IRemoveFailingEvent { - public event EventHandler RemoveFailingEvent; + event EventHandler RemoveFailingEvent; } private class TestEventBrokenEventHandlerRaising diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.MatchRegex.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.MatchRegex.cs index a8527618b2..f39221f4f5 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.MatchRegex.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.MatchRegex.cs @@ -78,7 +78,9 @@ public void When_a_string_is_matched_against_an_invalid_regex_string_it_should_t { // Arrange string subject = "hello world!"; +#pragma warning disable RE0001 // Invalid regex pattern string invalidRegex = ".**"; // Use local variable for this invalid regex to avoid static R# analysis errors +#pragma warning restore RE0001 // Invalid regex pattern // Act Action act = () => subject.Should().MatchRegex(invalidRegex); @@ -93,7 +95,9 @@ public void When_a_string_is_matched_against_an_invalid_regex_string_it_should_o { // Arrange string subject = "hello world!"; +#pragma warning disable RE0001 // Invalid regex pattern string invalidRegex = ".**"; // Use local variable for this invalid regex to avoid static R# analysis errors +#pragma warning restore RE0001 // Invalid regex pattern // Act Action act = () => @@ -421,7 +425,9 @@ public void When_a_string_is_negatively_matched_against_an_invalid_regex_string_ { // Arrange string subject = "hello world!"; +#pragma warning disable RE0001 // Invalid regex pattern string invalidRegex = ".**"; // Use local variable for this invalid regex to avoid static R# analysis errors +#pragma warning restore RE0001 // Invalid regex pattern // Act Action act = () => subject.Should().NotMatchRegex(invalidRegex); @@ -436,7 +442,9 @@ public void When_a_string_is_negatively_matched_against_an_invalid_regex_string_ { // Arrange string subject = "hello world!"; +#pragma warning disable RE0001 // Invalid regex pattern string invalidRegex = ".**"; // Use local variable for this invalid regex to avoid static R# analysis errors +#pragma warning restore RE0001 // Invalid regex pattern // Act Action act = () => From 79713f72ba6241dcd813cea865d47a660785551e Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:20:01 +0200 Subject: [PATCH 637/845] Use generic Enum.GetValues Resolves CA2263: prefer generic overload --- Src/FluentAssertions/Common/MethodInfoExtensions.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/Common/MethodInfoExtensions.cs b/Src/FluentAssertions/Common/MethodInfoExtensions.cs index 560bd5498c..98637454ed 100644 --- a/Src/FluentAssertions/Common/MethodInfoExtensions.cs +++ b/Src/FluentAssertions/Common/MethodInfoExtensions.cs @@ -13,8 +13,12 @@ internal static class MethodInfoExtensions /// A sum of all possible . It's needed to calculate what options were used when decorating with . /// They are a subset of which can be checked on a type and therefore this mask has to be applied to check only for options. /// - private static readonly Lazy ImplementationOptionsMask = - new(() => Enum.GetValues(typeof(MethodImplOptions)).Cast().Sum(optionValue => optionValue)); + private static readonly int ImplementationOptionsMask = +#if NET6_0_OR_GREATER + Enum.GetValues().Cast().Sum(optionValue => optionValue); +#else + Enum.GetValues(typeof(MethodImplOptions)).Cast().Sum(optionValue => optionValue); +#endif internal static bool IsAsync(this MethodInfo methodInfo) { @@ -50,7 +54,7 @@ private static (bool Success, MethodImplAttribute Attribute) RecreateMethodImplA MethodImplAttributes implementationFlags = methodBase.MethodImplementationFlags; int implementationFlagsMatchingImplementationOptions = - (int)implementationFlags & ImplementationOptionsMask.Value; + (int)implementationFlags & ImplementationOptionsMask; MethodImplOptions implementationOptions = (MethodImplOptions)implementationFlagsMatchingImplementationOptions; From 5b4202a90f11873edcef783d8e28bcfe8ab70477 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:20:36 +0200 Subject: [PATCH 638/845] GitVersion.Tool 6.1.0 -> 6.3.0 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 76122848a3..fefec26dc2 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -10,7 +10,7 @@ 1 - + From 3162cf5ed7b3320df066833beb7abec545e1b4b6 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:21:25 +0200 Subject: [PATCH 639/845] ReportGenerator 5.4.4 -> 5.4.8 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index fefec26dc2..310c905c42 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -11,7 +11,7 @@ - + From 92940a82f6366ef37dbf032b3fb5e67344ef06a5 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:21:39 +0200 Subject: [PATCH 640/845] SharpCompress 0.39.0 -> 0.40.0 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 310c905c42..e66f168f8c 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -16,7 +16,7 @@ - + From e1ef5233fbd65304ba276728fb57301258246d37 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:22:45 +0200 Subject: [PATCH 641/845] BenchmarkDotNet 0.14.0 -> 0.15.2 --- Tests/Benchmarks/Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index a5ec8efa58..c3908f41e9 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -9,7 +9,7 @@ - + From efa822acd7110602bd0902aaf484e08787c64543 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:23:45 +0200 Subject: [PATCH 642/845] Machine.Specifications 1.1.2 -> 1.1.3 --- Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj index 7ec6f151de..2c55a4349a 100644 --- a/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj +++ b/Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj @@ -13,7 +13,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + From 74d81b87454ba272e7fb46acf04841a33c6b4c65 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:24:49 +0200 Subject: [PATCH 643/845] Meziantou.Analyzer 2.0.187 -> 2.0.203 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index ddbfa632c5..d9519a589c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From bb54ab8241367ca43c8da55bfa679b970a8d47a1 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:25:18 +0200 Subject: [PATCH 644/845] Roslynator.Analyzers 4.13.0 -> 4.13.1 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index d9519a589c..7dd8810c34 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 99f037fec345b05e1368035e92cbdd055f7d8054 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:25:59 +0200 Subject: [PATCH 645/845] Microsoft.CodeAnalysis.BannedApiAnalyzers 3.3.4 -> 4.14.0 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 7dd8810c34..106b8b8cbb 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -18,7 +18,7 @@ true - + all runtime; build; native; contentfiles; analyzers; buildtransitive From ab4df711b32d9d1ca3da0292314e797793380416 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:26:42 +0200 Subject: [PATCH 646/845] PublicApiGenerator 11.4.1 ->11.4.6 --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 7fc4bea4f2..9b09da139b 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -11,7 +11,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + From 4b7c226e4bbaa28577850e5313e47289be3ebb7d Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:34:34 +0200 Subject: [PATCH 647/845] PublicApiGenerator update --- .../FluentAssertions/net47.verified.txt | 50 ++++++++--------- .../FluentAssertions/net6.0.verified.txt | 54 +++++++++---------- .../netstandard2.0.verified.txt | 50 ++++++++--------- .../netstandard2.1.verified.txt | 50 ++++++++--------- 4 files changed, 102 insertions(+), 102 deletions(-) diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index fc62d6eb1a..55857f91e6 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -284,13 +284,13 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, double expectedValue, double precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, float expectedValue, float precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, byte nearbyValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, int nearbyValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, long nearbyValue, ulong delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, sbyte nearbyValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint nearbyValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong nearbyValue, ulong delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } @@ -305,13 +305,13 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, double unexpectedValue, double precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, float unexpectedValue, float precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, byte distantValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short distantValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, int distantValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, long distantValue, ulong delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, sbyte distantValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort distantValue, ushort delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short distantValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint distantValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong distantValue, ulong delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort distantValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } @@ -426,8 +426,8 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCount(System.Linq.Expressions.Expression> countPredicate, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThan(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountLessThan(int expected, string because = "", params object[] becauseArgs) { } @@ -1693,7 +1693,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOnOrAfter(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOnOrBefore(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(params System.DateTime[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(params System.Nullable[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(params System.DateTime?[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTime expected, string because = "", params object[] becauseArgs) { } @@ -1744,7 +1744,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOnOrAfter(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOnOrBefore(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(params System.DateTimeOffset[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(params System.Nullable[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(params System.DateTimeOffset?[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } @@ -2036,10 +2036,10 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Match(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchRegex(string regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint MatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(System.Text.RegularExpressions.Regex regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint MatchRegex(string regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(string unexpected, string because = "", params object[] becauseArgs) { } @@ -2061,8 +2061,8 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotMatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotMatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWith(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } @@ -2579,20 +2579,20 @@ namespace FluentAssertions.Xml protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElementWithValue(System.Xml.Linq.XName expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveRoot(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveRoot(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveRoot(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveElement(System.Xml.Linq.XName unexpectedElement, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveElementWithValue(System.Xml.Linq.XName unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } } public class XElementAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { @@ -2600,27 +2600,27 @@ namespace FluentAssertions.Xml protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveAttribute(System.Xml.Linq.XName expectedName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttributeWithValue(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveAttributeWithValue(System.Xml.Linq.XName expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttributeWithValue(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElementWithValue(System.Xml.Linq.XName expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveAttribute(string unexpectedName, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveAttribute(System.Xml.Linq.XName unexpectedName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveAttributeWithValue(string unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttribute(string unexpectedName, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveAttributeWithValue(System.Xml.Linq.XName unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttributeWithValue(string unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveElement(System.Xml.Linq.XName unexpectedElement, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveElementWithValue(System.Xml.Linq.XName unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } } public class XmlElementAssertions : FluentAssertions.Xml.XmlNodeAssertions { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index b6d1745277..1e08d9a6ee 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -297,13 +297,13 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, double expectedValue, double precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, float expectedValue, float precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, byte nearbyValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, int nearbyValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, long nearbyValue, ulong delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, sbyte nearbyValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint nearbyValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong nearbyValue, ulong delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } @@ -318,13 +318,13 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, double unexpectedValue, double precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, float unexpectedValue, float precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, byte distantValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short distantValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, int distantValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, long distantValue, ulong delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, sbyte distantValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort distantValue, ushort delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short distantValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint distantValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong distantValue, ulong delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort distantValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } @@ -439,8 +439,8 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCount(System.Linq.Expressions.Expression> countPredicate, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThan(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountLessThan(int expected, string because = "", params object[] becauseArgs) { } @@ -1712,7 +1712,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOnOrAfter(System.DateOnly expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOnOrBefore(System.DateOnly expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(params System.DateOnly[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(params System.Nullable[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(params System.DateOnly?[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } @@ -1751,7 +1751,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOnOrAfter(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOnOrBefore(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(params System.DateTime[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(params System.Nullable[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(params System.DateTime?[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTime expected, string because = "", params object[] becauseArgs) { } @@ -1802,7 +1802,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOnOrAfter(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOnOrBefore(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(params System.DateTimeOffset[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(params System.Nullable[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(params System.DateTimeOffset?[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } @@ -2120,10 +2120,10 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Match(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchRegex(string regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint MatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(System.Text.RegularExpressions.Regex regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint MatchRegex(string regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(string unexpected, string because = "", params object[] becauseArgs) { } @@ -2145,8 +2145,8 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotMatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotMatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWith(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } @@ -2170,8 +2170,8 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeCloseTo(System.TimeOnly nearbyTime, System.TimeSpan precision, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOnOrAfter(System.TimeOnly expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOnOrBefore(System.TimeOnly expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint BeOneOf(params System.Nullable[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(params System.TimeOnly[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(params System.TimeOnly?[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } @@ -2709,20 +2709,20 @@ namespace FluentAssertions.Xml protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElementWithValue(System.Xml.Linq.XName expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveRoot(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveRoot(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveRoot(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveElement(System.Xml.Linq.XName unexpectedElement, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveElementWithValue(System.Xml.Linq.XName unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } } public class XElementAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { @@ -2730,27 +2730,27 @@ namespace FluentAssertions.Xml protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveAttribute(System.Xml.Linq.XName expectedName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttributeWithValue(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveAttributeWithValue(System.Xml.Linq.XName expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttributeWithValue(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElementWithValue(System.Xml.Linq.XName expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveAttribute(string unexpectedName, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveAttribute(System.Xml.Linq.XName unexpectedName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveAttributeWithValue(string unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttribute(string unexpectedName, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveAttributeWithValue(System.Xml.Linq.XName unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttributeWithValue(string unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveElement(System.Xml.Linq.XName unexpectedElement, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveElementWithValue(System.Xml.Linq.XName unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } } public class XmlElementAssertions : FluentAssertions.Xml.XmlNodeAssertions { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 54db3dc68f..b7394b1037 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -276,13 +276,13 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, double expectedValue, double precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, float expectedValue, float precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, byte nearbyValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, int nearbyValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, long nearbyValue, ulong delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, sbyte nearbyValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint nearbyValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong nearbyValue, ulong delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } @@ -297,13 +297,13 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, double unexpectedValue, double precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, float unexpectedValue, float precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, byte distantValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short distantValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, int distantValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, long distantValue, ulong delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, sbyte distantValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort distantValue, ushort delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short distantValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint distantValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong distantValue, ulong delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort distantValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } @@ -418,8 +418,8 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCount(System.Linq.Expressions.Expression> countPredicate, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThan(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountLessThan(int expected, string because = "", params object[] becauseArgs) { } @@ -1637,7 +1637,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOnOrAfter(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOnOrBefore(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(params System.DateTime[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(params System.Nullable[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(params System.DateTime?[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTime expected, string because = "", params object[] becauseArgs) { } @@ -1688,7 +1688,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOnOrAfter(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOnOrBefore(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(params System.DateTimeOffset[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(params System.Nullable[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(params System.DateTimeOffset?[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } @@ -1980,10 +1980,10 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Match(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchRegex(string regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint MatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(System.Text.RegularExpressions.Regex regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint MatchRegex(string regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(string unexpected, string because = "", params object[] becauseArgs) { } @@ -2005,8 +2005,8 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotMatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotMatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWith(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } @@ -2523,20 +2523,20 @@ namespace FluentAssertions.Xml protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElementWithValue(System.Xml.Linq.XName expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveRoot(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveRoot(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveRoot(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveElement(System.Xml.Linq.XName unexpectedElement, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveElementWithValue(System.Xml.Linq.XName unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } } public class XElementAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { @@ -2544,27 +2544,27 @@ namespace FluentAssertions.Xml protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveAttribute(System.Xml.Linq.XName expectedName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttributeWithValue(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveAttributeWithValue(System.Xml.Linq.XName expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttributeWithValue(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElementWithValue(System.Xml.Linq.XName expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveAttribute(string unexpectedName, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveAttribute(System.Xml.Linq.XName unexpectedName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveAttributeWithValue(string unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttribute(string unexpectedName, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveAttributeWithValue(System.Xml.Linq.XName unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttributeWithValue(string unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveElement(System.Xml.Linq.XName unexpectedElement, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveElementWithValue(System.Xml.Linq.XName unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } } public class XmlElementAssertions : FluentAssertions.Xml.XmlNodeAssertions { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 59a3c42265..f5cc40c438 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -284,13 +284,13 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, double expectedValue, double precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, float expectedValue, float precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, byte nearbyValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, int nearbyValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, long nearbyValue, ulong delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, sbyte nearbyValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint nearbyValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong nearbyValue, ulong delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> BeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort nearbyValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> BeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } @@ -305,13 +305,13 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, double unexpectedValue, double precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeApproximately(this FluentAssertions.Numeric.NumericAssertions parent, float unexpectedValue, float precision, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, byte distantValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short distantValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, int distantValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, long distantValue, ulong delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, sbyte distantValue, byte delta, string because = "", params object[] becauseArgs) { } - public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort distantValue, ushort delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, short distantValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, uint distantValue, uint delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ulong distantValue, ulong delta, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint> NotBeCloseTo(this FluentAssertions.Numeric.NumericAssertions parent, ushort distantValue, ushort delta, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NullableNumericAssertions parent, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint> NotBeNaN(this FluentAssertions.Numeric.NumericAssertions parent, string because = "", params object[] becauseArgs) { } @@ -426,8 +426,8 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Equal(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } public override bool Equals(object obj) { } - public FluentAssertions.AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCount(System.Linq.Expressions.Expression> countPredicate, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveCount(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThan(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountGreaterThanOrEqualTo(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveCountLessThan(int expected, string because = "", params object[] becauseArgs) { } @@ -1693,7 +1693,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOnOrAfter(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOnOrBefore(System.DateTime expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(params System.DateTime[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(params System.Nullable[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(params System.DateTime?[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTime expected, string because = "", params object[] becauseArgs) { } @@ -1744,7 +1744,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint BeOnOrAfter(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOnOrBefore(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(params System.DateTimeOffset[] validValues) { } - public FluentAssertions.AndConstraint BeOneOf(params System.Nullable[] validValues) { } + public FluentAssertions.AndConstraint BeOneOf(params System.DateTimeOffset?[] validValues) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeOneOf(System.Collections.Generic.IEnumerable validValues, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeSameDateAs(System.DateTimeOffset expected, string because = "", params object[] becauseArgs) { } @@ -2036,10 +2036,10 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint Match(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchEquivalentOf(string wildcardPattern, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint MatchRegex(string regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint MatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint MatchRegex(System.Text.RegularExpressions.Regex regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint MatchRegex(string regularExpression, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(string unexpected, string because = "", params object[] becauseArgs) { } @@ -2061,8 +2061,8 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotMatch(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchEquivalentOf(string wildcardPattern, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotMatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotMatchRegex(System.Text.RegularExpressions.Regex regularExpression, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotMatchRegex(string regularExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWith(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotStartWithEquivalentOf(string unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } @@ -2581,20 +2581,20 @@ namespace FluentAssertions.Xml protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XDocument expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElementWithValue(System.Xml.Linq.XName expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveRoot(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveRoot(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveRoot(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XDocument unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveElement(System.Xml.Linq.XName unexpectedElement, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveElementWithValue(System.Xml.Linq.XName unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } } public class XElementAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions { @@ -2602,27 +2602,27 @@ namespace FluentAssertions.Xml protected override string Identifier { get; } public FluentAssertions.AndConstraint Be(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.Linq.XElement expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveAttribute(System.Xml.Linq.XName expectedName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint HaveAttributeWithValue(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttribute(string expectedName, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveAttributeWithValue(System.Xml.Linq.XName expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveAttributeWithValue(string expectedName, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElement(System.Xml.Linq.XName expected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElement(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint> HaveElement(System.Xml.Linq.XName expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint> HaveElement(string expected, FluentAssertions.OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint HaveElementWithValue(System.Xml.Linq.XName expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveValue(string expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBe(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.Linq.XElement unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveAttribute(string unexpectedName, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveAttribute(System.Xml.Linq.XName unexpectedName, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveAttributeWithValue(string unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttribute(string unexpectedName, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveAttributeWithValue(System.Xml.Linq.XName unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveAttributeWithValue(string unexpectedName, string unexpectedValue, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveElement(System.Xml.Linq.XName unexpectedElement, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElement(string unexpectedElement, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveElementWithValue(System.Xml.Linq.XName unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, string because = "", params object[] becauseArgs) { } } public class XmlElementAssertions : FluentAssertions.Xml.XmlNodeAssertions { From 89f82c5133cd5da202bcf0a7f4253e4831b64c27 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:35:45 +0200 Subject: [PATCH 648/845] TUnit 0.13.3 -> 0.25.21 --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index bd5f7d6470..45fd4ab73e 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -11,7 +11,7 @@ - + From 95e95f9699d25a43628f981bbeb86761d8421cb2 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:36:10 +0200 Subject: [PATCH 649/845] Reflectify 1.5.0 -> 1.6.0 --- Src/FluentAssertions/FluentAssertions.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 8e7f266134..6a34e4c0da 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -43,11 +43,11 @@ Check out the [license page](LICENSE) for more information. - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 9639d46e61190671dc0026cdac7e1a86b5d3f4d2 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:52:13 +0200 Subject: [PATCH 650/845] xunit.v3 1.y.z -> 2.0.3 xunit.runner.visualstudio 3.1.1 requires .net 8 --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj | 6 +++--- .../TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 9b09da139b..96cfbdfc80 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -7,7 +7,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj index d98ecf1f3a..9653a90fcf 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -1,6 +1,6 @@ - net472;net6.0 + net472;net8.0 Exe @@ -9,7 +9,7 @@ - - + + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index 59089025d2..074b8a07ae 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -1,6 +1,6 @@ - net472;net6.0 + net472;net8.0 Exe @@ -9,7 +9,7 @@ - - + + From 227ce49ef3ee10516733aba09ebdabe1c0c17b38 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:52:42 +0200 Subject: [PATCH 651/845] Verify.Xunit 28.11.0 -> 30.4.0 --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 96cfbdfc80..dc71966bfb 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 82230878aa38a47342702238a6bd55380ab26bf2 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 5 Jul 2025 17:58:45 +0200 Subject: [PATCH 652/845] MSTest 3.8.0 -> 3.9.3 --- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 4 ++-- Tests/UWP.Specs/UWP.Specs.csproj | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index a111f720c0..6413c5f75d 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/Tests/UWP.Specs/UWP.Specs.csproj b/Tests/UWP.Specs/UWP.Specs.csproj index 25dbdc473f..bacf21fc14 100644 --- a/Tests/UWP.Specs/UWP.Specs.csproj +++ b/Tests/UWP.Specs/UWP.Specs.csproj @@ -88,14 +88,14 @@ 6.2.14 - 3.7.3 + 3.9.3 - 3.7.3 + 3.9.3 4.7.0 - + \ No newline at end of file From ecd2166797c440204afba1cb78eed54390d014be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 17:05:59 +0000 Subject: [PATCH 653/845] Bump cspell from 9.1.2 to 9.1.3 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 9.1.2 to 9.1.3. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.1.3/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.1.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 266 ++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 140 insertions(+), 128 deletions(-) diff --git a/package-lock.json b/package-lock.json index 697887765c..a4f6676642 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,17 +7,17 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.1.2" + "cspell": "^9.1.3" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.1.2.tgz", - "integrity": "sha512-mdhxj7j1zqXYKO/KPx2MgN3RPAvqoWvncxz2dOMFBcuUteZPt58NenUoi0VZXEhV/FM2V80NvhHZZafaIcxVjQ==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.1.3.tgz", + "integrity": "sha512-WbOkD32fjxz0hHMP6oTvAgi2VBlzYcqKPNwCo+4b9HefLWV5aiLaxp04d8CeifaAdlYjkjuqRTJXh/HfUeLCVg==", "dependencies": { "@cspell/dict-ada": "^4.1.0", "@cspell/dict-al": "^1.1.0", - "@cspell/dict-aws": "^4.0.10", + "@cspell/dict-aws": "^4.0.11", "@cspell/dict-bash": "^4.2.0", "@cspell/dict-companies": "^3.2.1", "@cspell/dict-cpp": "^6.0.8", @@ -30,9 +30,9 @@ "@cspell/dict-docker": "^1.1.14", "@cspell/dict-dotnet": "^5.0.9", "@cspell/dict-elixir": "^4.0.7", - "@cspell/dict-en_us": "^4.4.11", - "@cspell/dict-en-common-misspellings": "^2.1.1", - "@cspell/dict-en-gb-mit": "^3.1.1", + "@cspell/dict-en_us": "^4.4.13", + "@cspell/dict-en-common-misspellings": "^2.1.2", + "@cspell/dict-en-gb-mit": "^3.1.3", "@cspell/dict-filetypes": "^3.0.12", "@cspell/dict-flutter": "^1.1.0", "@cspell/dict-fonts": "^4.0.4", @@ -56,7 +56,7 @@ "@cspell/dict-markdown": "^2.0.11", "@cspell/dict-monkeyc": "^1.0.10", "@cspell/dict-node": "^5.0.7", - "@cspell/dict-npm": "^5.2.7", + "@cspell/dict-npm": "^5.2.9", "@cspell/dict-php": "^4.0.14", "@cspell/dict-powershell": "^5.0.14", "@cspell/dict-public-licenses": "^2.0.13", @@ -66,11 +66,11 @@ "@cspell/dict-rust": "^4.0.11", "@cspell/dict-scala": "^5.0.7", "@cspell/dict-shell": "^1.1.0", - "@cspell/dict-software-terms": "^5.1.1", + "@cspell/dict-software-terms": "^5.1.2", "@cspell/dict-sql": "^2.2.0", "@cspell/dict-svelte": "^1.0.6", "@cspell/dict-swift": "^2.0.5", - "@cspell/dict-terraform": "^1.1.1", + "@cspell/dict-terraform": "^1.1.2", "@cspell/dict-typescript": "^3.2.2", "@cspell/dict-vue": "^3.0.4" }, @@ -79,28 +79,28 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.1.2.tgz", - "integrity": "sha512-sSva/ACXDJd9LufzecR9LC+lNWUuGWNtVHdVj0orJxOIZjHUCNBXwVSgL2fmMg7jNQS6qoJFJ7F/QPXdwITijg==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.1.3.tgz", + "integrity": "sha512-FvzlSQuU+bNeo77v0KrA/lkoe324cHvZNhkx7Dtp1aj01FeBr5Y36gozR3DNY6tewBi6hC7uLeeNg/iSBf6CWg==", "dependencies": { - "@cspell/cspell-types": "9.1.2" + "@cspell/cspell-types": "9.1.3" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-pipe": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.1.2.tgz", - "integrity": "sha512-/pIhsf4SI4Q/kvehq9GsGKLgbQsRhiDgthQIgO6YOrEa761wOI2hVdRyc0Tgc1iAGiJEedDaFsAhabVRJBeo2g==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.1.3.tgz", + "integrity": "sha512-Cns37ml7IaXMWBci9XOqdTkP9nFtOO8+sJ4VvtbVO68Zo8v0vq74ApDbPgGI2HzYtn7Jj2hxQqGIBdLnmrMPyA==", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.1.2.tgz", - "integrity": "sha512-dNDx7yMl2h1Ousk08lizTou+BUvce4RPSnPXrQPB7B7CscgZloSyuP3Yyj1Zt81pHNpggrym4Ezx6tMdyPjESw==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.1.3.tgz", + "integrity": "sha512-3h9AkbY+YutBG91fQxeSpfIRT50sfrNQ7IAS0N6fCvJ6z0sXed7UPYwf90NauQp/1lN/bVlHFFAgxDEyG720Yg==", "dependencies": { "global-directory": "^4.0.1" }, @@ -109,17 +109,17 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.1.2.tgz", - "integrity": "sha512-YOsUctzCMzEJbKdzNyvPkyMen/i7sGO3Xgcczn848GJPlRsJc50QwsoU67SY7zEARz6y2WS0tv5F5RMrRO4idw==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.1.3.tgz", + "integrity": "sha512-Ss4cCnkJI3IHDSOQKxhtAfypvZZDzuJeXbZFVimLvO22/8GdVH+vQxAFm3kBY+ACVUAe13MQIYzZxuFHaM9y8g==", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.1.2.tgz", - "integrity": "sha512-bSDDjoQi4pbh1BULEA596XCo1PMShTpTb4J2lj8jVYqYgXYQNjSmQFA1fj4NHesC84JpK1um4ybzXBcqtniC7Q==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.1.3.tgz", + "integrity": "sha512-JPLFMp6qKj4fjsEDvMjVXFZg+j3HaRQ7raFtR2RPidYyKcUHPCVhX0wfJ0vuYxkC0Yst+99tgVxR8Wi57xs2Ew==", "engines": { "node": ">=20" } @@ -135,9 +135,9 @@ "integrity": "sha512-PtNI1KLmYkELYltbzuoztBxfi11jcE9HXBHCpID2lou/J4VMYKJPNqe4ZjVzSI9NYbMnMnyG3gkbhIdx66VSXg==" }, "node_modules/@cspell/dict-aws": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.10.tgz", - "integrity": "sha512-0qW4sI0GX8haELdhfakQNuw7a2pnWXz3VYQA2MpydH2xT2e6EN9DWFpKAi8DfcChm8MgDAogKkoHtIo075iYng==" + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.11.tgz", + "integrity": "sha512-nesbrYbxP/ek7Nc3X1ENWxAXJ/2XIKGxauF0k4VSPLtMvWP50gHAEe+zmqFciFolwIVVjF2l+juDdUdBMPbMiw==" }, "node_modules/@cspell/dict-bash": { "version": "4.2.0", @@ -203,19 +203,19 @@ "integrity": "sha512-MAUqlMw73mgtSdxvbAvyRlvc3bYnrDqXQrx5K9SwW8F7fRYf9V4vWYFULh+UWwwkqkhX9w03ZqFYRTdkFku6uA==" }, "node_modules/@cspell/dict-en_us": { - "version": "4.4.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.12.tgz", - "integrity": "sha512-p/ACn/SXcfCTAIAUfbvHrG/jacLDzo6V9Vc5mjtTMSaqeJVir4w5G9r1Pz19zcUvFzgio/Kg5b2xmosjPirLsg==" + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.13.tgz", + "integrity": "sha512-6TEHCJKmRqq7fQI7090p+ju12vhuGcNkc6YfxHrcjO816m53VPVaS6IfG6+6OqelQiOMjr0ZD8IHcDIkwThSFw==" }, "node_modules/@cspell/dict-en-common-misspellings": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.1.tgz", - "integrity": "sha512-6m2EEm4WUgsNzFzz/2boeOVrZenYQRaDXFtDNcaQK5Ly4A37HTRPm8uVvE8cAlACVk+HBHhH/4e7ebxdXwId9w==" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.2.tgz", + "integrity": "sha512-r74AObInM1XOUxd3lASnNZNDOIA9Bka7mBDTkvkOeCGoLQhn+Cr7h1889u4K07KHbecKMHP6zw5zQhkdocNzCw==" }, "node_modules/@cspell/dict-en-gb-mit": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.2.tgz", - "integrity": "sha512-IOsS2auF07ZOUqXsp4zuCaf3W5/OolWLvdq9xPd/ZQH2BfoFEmjdhelYaRuOKOmd6+SWdEbGhEeI7oLZSREqIQ==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.3.tgz", + "integrity": "sha512-4aY8ySQxSNSRILtf9lJIfSR+su86u8VL6z41gOIhvLIvYnHMFiohV7ebM91GbtdZXBazL7zmGFcpm2EnBzewug==" }, "node_modules/@cspell/dict-filetypes": { "version": "3.0.12", @@ -339,9 +339,9 @@ "integrity": "sha512-ZaPpBsHGQCqUyFPKLyCNUH2qzolDRm1/901IO8e7btk7bEDF56DN82VD43gPvD4HWz3yLs/WkcLa01KYAJpnOw==" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.9.tgz", - "integrity": "sha512-1uxRQ0LGPweRX8U9EEoU/tk5GGtTLAJT0BMmeHbe2AfzxX3nYSZtK/q52h9yg/wZLgvnFYzha2DL70uuT8oZuA==" + "version": "5.2.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.10.tgz", + "integrity": "sha512-MGR5S5e/0zcX3ln4eXQNYs3HBkX/JciqAmnCS0mNVx2jic1TtWBxJx+a33+95OhZeWF2Z/qL63FUQqZrJL27VA==" }, "node_modules/@cspell/dict-php": { "version": "4.0.14", @@ -392,9 +392,9 @@ "integrity": "sha512-D/xHXX7T37BJxNRf5JJHsvziFDvh23IF/KvkZXNSh8VqcRdod3BAz9VGHZf6VDqcZXr1VRqIYR3mQ8DSvs3AVQ==" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.2.tgz", - "integrity": "sha512-MssT9yyInezB6mFqHTDNOIVjbMakORllIt7IJ91LrgiQOcDLzidR0gN9pE340s655TJ8U5MJNAfRfH0oRU14KQ==" + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.3.tgz", + "integrity": "sha512-kHQmiMvAuXvF54S1uLZNVUJatnDv8L+pRnPMAiFXPTdudi6oM04TzI8yj8anm7gLcpfmJLCIECnc3s+we5eeXw==" }, "node_modules/@cspell/dict-sql": { "version": "2.2.0", @@ -412,9 +412,9 @@ "integrity": "sha512-3lGzDCwUmnrfckv3Q4eVSW3sK3cHqqHlPprFJZD4nAqt23ot7fic5ALR7J4joHpvDz36nHX34TgcbZNNZOC/JA==" }, "node_modules/@cspell/dict-terraform": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.1.1.tgz", - "integrity": "sha512-07KFDwCU7EnKl4hOZLsLKlj6Zceq/IsQ3LRWUyIjvGFfZHdoGtFdCp3ZPVgnFaAcd/DKv+WVkrOzUBSYqHopQQ==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.1.2.tgz", + "integrity": "sha512-RB9dnhxKIiWpwQB+b3JuFa8X4m+6Ny92Y4Z5QARR7jEtapg8iF2ODZX1yLtozp4kFVoRsUKEP6vj3MLv87VTdg==" }, "node_modules/@cspell/dict-typescript": { "version": "3.2.2", @@ -427,11 +427,11 @@ "integrity": "sha512-0dPtI0lwHcAgSiQFx8CzvqjdoXROcH+1LyqgROCpBgppommWpVhbQ0eubnKotFEXgpUCONVkeZJ6Ql8NbTEu+w==" }, "node_modules/@cspell/dynamic-import": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.1.2.tgz", - "integrity": "sha512-Kg22HCx5m0znVPLea2jRrvMnzHZAAzqcDr5g6Dbd4Pizs5b3SPQuRpFmYaDvKo26JNZnfRqA9eweiuE5aQAf2A==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.1.3.tgz", + "integrity": "sha512-+8PxTslsh+oTxmhYdnfQZ/brYGFAnfqLR9xotWE4Ks3HoaLOhZsp6FF9kvlEp/gNOjpyhHn1UhT/Gr5fT4+QhQ==", "dependencies": { - "@cspell/url": "9.1.2", + "@cspell/url": "9.1.3", "import-meta-resolve": "^4.1.0" }, "engines": { @@ -439,25 +439,25 @@ } }, "node_modules/@cspell/filetypes": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.1.2.tgz", - "integrity": "sha512-j+6kDz3GbeYwwtlzVosqVaSiFGMhf0u3y8eAP3IV2bTelhP2ZiOLD+yNbAyYGao7p10/Sqv+Ri0yT7IsGLniww==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.1.3.tgz", + "integrity": "sha512-HRJEggDo6OJJmCc/gq7oriMqkqVDema+oLpGBh1a/M7ulw+CzoHkOa//1ohpAJh5KsWj9Tej9Va4BUZ/SaCwUA==", "engines": { "node": ">=20" } }, "node_modules/@cspell/strong-weak-map": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.1.2.tgz", - "integrity": "sha512-6X9oXnklvdt1pd0x0Mh6qXaaIRxjt0G50Xz5ZGm3wpAagv0MFvTThdmYVFfBuZ91x7fDT3u77y3d1uqdGQW1CA==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.1.3.tgz", + "integrity": "sha512-+96SI9R6TOY+xGBOK5LiOgX/W/9gAKus1Cvngh2LdtDVZwgVqpqvm5LoXxLhUT+Vs5UsndRBzblSdNpziSwZtA==", "engines": { "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.1.2.tgz", - "integrity": "sha512-PMJBuLYQIdFnEfPHQXaVE5hHUkbbOxOIRmHyZwWEc9+79tIaIkiwLpjZvbm8p6f9WXAaESqXs/uK2tUC/bjwmw==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.1.3.tgz", + "integrity": "sha512-LQQKY0O4QYUNKyDod8VfEBvqeJNGHJlx1v0gDq00eMvaClnkIz+y2ObGdtDlF7ZbG7TgI6PQ3ahJdlqfRPe3ZQ==", "engines": { "node": ">=20" } @@ -546,24 +546,24 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cspell": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.1.2.tgz", - "integrity": "sha512-XtFNCt2ZCvdSAbtntlYBumShdDsSbKdgPhwx/PfEL42uhXWR1owQPTxhtHz3nBF2SR11iDI3LDMMGDp8Fw0Gdg==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.1.3.tgz", + "integrity": "sha512-QxpQn9rGIZN/neMU4hx9T4s9AL5nyRhumNCdYHjjU8Pi4ztZOzuVWbOQD1Oq5ygb92Aci76/DwbJQ1dmb4631Q==", "dependencies": { - "@cspell/cspell-json-reporter": "9.1.2", - "@cspell/cspell-pipe": "9.1.2", - "@cspell/cspell-types": "9.1.2", - "@cspell/dynamic-import": "9.1.2", - "@cspell/url": "9.1.2", + "@cspell/cspell-json-reporter": "9.1.3", + "@cspell/cspell-pipe": "9.1.3", + "@cspell/cspell-types": "9.1.3", + "@cspell/dynamic-import": "9.1.3", + "@cspell/url": "9.1.3", "chalk": "^5.4.1", "chalk-template": "^1.1.0", "commander": "^14.0.0", - "cspell-config-lib": "9.1.2", - "cspell-dictionary": "9.1.2", - "cspell-gitignore": "9.1.2", - "cspell-glob": "9.1.2", - "cspell-io": "9.1.2", - "cspell-lib": "9.1.2", + "cspell-config-lib": "9.1.3", + "cspell-dictionary": "9.1.3", + "cspell-gitignore": "9.1.3", + "cspell-glob": "9.1.3", + "cspell-io": "9.1.3", + "cspell-lib": "9.1.3", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "semver": "^7.7.2", @@ -581,12 +581,13 @@ } }, "node_modules/cspell-config-lib": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.1.2.tgz", - "integrity": "sha512-QvHHGUuMI5h3ymU6O/Qz8zfhMhvPTuopT1FgebYRBB1cyggl4KnEJKU9m7wy/SQ1IGSlFDtQp6rCy70ujTfavQ==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.1.3.tgz", + "integrity": "sha512-B3DdOTZNIOQahSkOYqaq2fOc8fq/jFkrOFd36kge/GAyEpY2Um/Kp/GQ6caOcev+ju0h3iGaO24OLCx6QJ3YoQ==", "dependencies": { - "@cspell/cspell-types": "9.1.2", + "@cspell/cspell-types": "9.1.3", "comment-json": "^4.2.5", + "smol-toml": "^1.4.1", "yaml": "^2.8.0" }, "engines": { @@ -594,13 +595,13 @@ } }, "node_modules/cspell-dictionary": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.1.2.tgz", - "integrity": "sha512-Osn5f9ugkX/zA3PVtSmYKRer3gZX3YqVB0UH0wVNzi8Ryl/1RUuYLIcvd0SDEhiVW56WKxFLfZ5sggTz/l9cDA==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.1.3.tgz", + "integrity": "sha512-BXWwYQ64LaSOd7+8TLZax3AeUnTJUuIl+Tl32/dqcVpgDF4P0eAUVE5xap+QZ2rzKRVFjD8r5M6IR2QrA23o0g==", "dependencies": { - "@cspell/cspell-pipe": "9.1.2", - "@cspell/cspell-types": "9.1.2", - "cspell-trie-lib": "9.1.2", + "@cspell/cspell-pipe": "9.1.3", + "@cspell/cspell-types": "9.1.3", + "cspell-trie-lib": "9.1.3", "fast-equals": "^5.2.2" }, "engines": { @@ -608,13 +609,13 @@ } }, "node_modules/cspell-gitignore": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.1.2.tgz", - "integrity": "sha512-dbi7xPYYNT79gci9C3G/tldp13cvhuNXnIOSXJ5lXSDhinZFfrpFc0bOj195nn3HTL/EvlQ9Ga1a1+jOIZNVBQ==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.1.3.tgz", + "integrity": "sha512-yc7Td6L7ZHejm1OzwY/hyfBgyz3gpToMPDyztwbwOdrxXNLRIgDZVPvjVS67XvNf3dv55J19A/8r5Xd7yaV60w==", "dependencies": { - "@cspell/url": "9.1.2", - "cspell-glob": "9.1.2", - "cspell-io": "9.1.2" + "@cspell/url": "9.1.3", + "cspell-glob": "9.1.3", + "cspell-io": "9.1.3" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -624,11 +625,11 @@ } }, "node_modules/cspell-glob": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.1.2.tgz", - "integrity": "sha512-l7Mqirn5h2tilTXgRamRIqqnzeA7R5iJEtJkY/zHDMEBeLWTR/5ai7dBp2+ooe8gIebpDtvv4938IXa5/75E6g==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.1.3.tgz", + "integrity": "sha512-If7gSgbWlUhLcmNA9zPflWzdUZs4wyRKB/Ze584wrht7zJR4yJm2Rptk2+M8kXEhx3zYS6UGhSL0alPbVAbjgQ==", "dependencies": { - "@cspell/url": "9.1.2", + "@cspell/url": "9.1.3", "picomatch": "^4.0.2" }, "engines": { @@ -636,12 +637,12 @@ } }, "node_modules/cspell-grammar": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.1.2.tgz", - "integrity": "sha512-vUcnlUqJKK0yhwYHfGC71zjGyEn918l64U/NWb1ijn1VXrL6gsh3w8Acwdo++zbpOASd9HTAuuZelveDJKLLgA==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.1.3.tgz", + "integrity": "sha512-L1OVY9RyZXPT+qesw0c7aRKTxQIC7nrLKDQ97hRrQhK23hv5Q8o7GVs1S7pXRNZ/oA8V+VNG2CgjLiKnVM2jnw==", "dependencies": { - "@cspell/cspell-pipe": "9.1.2", - "@cspell/cspell-types": "9.1.2" + "@cspell/cspell-pipe": "9.1.3", + "@cspell/cspell-types": "9.1.3" }, "bin": { "cspell-grammar": "bin.mjs" @@ -651,38 +652,38 @@ } }, "node_modules/cspell-io": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.1.2.tgz", - "integrity": "sha512-oLPxbteI+uFV9ZPcJjII7Lr/C/gVXpdmDLlAMwR8/7LHGnEfxXR0lqYu5GZVEvZ7riX9whCUOsQWQQqr2u2Fzw==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.1.3.tgz", + "integrity": "sha512-fdgAVrthOY1pPsBZHWVjEVn6uHMAshj2n75eu2rvUd6EcmMuLR13EcIXHoMcQo/1Az05x2UgG7HuK+0MuRcikQ==", "dependencies": { - "@cspell/cspell-service-bus": "9.1.2", - "@cspell/url": "9.1.2" + "@cspell/cspell-service-bus": "9.1.3", + "@cspell/url": "9.1.3" }, "engines": { "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.1.2.tgz", - "integrity": "sha512-OFCssgfp6Z2gd1K8j2FsYr9YGoA/C6xXlcUwgU75Ut/XMZ/S44chdA9fUupGd4dUOw+CZl0qKzSP21J6kYObIw==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.1.3.tgz", + "integrity": "sha512-egESsnErAPtC/wuqbHWW28eRKChkg5h+vFQQuZ0iThuOSZ65jeSM0ESOt8W3TH2JD7EGo2pvPED/7rZjjnMIcQ==", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.1.2", - "@cspell/cspell-pipe": "9.1.2", - "@cspell/cspell-resolver": "9.1.2", - "@cspell/cspell-types": "9.1.2", - "@cspell/dynamic-import": "9.1.2", - "@cspell/filetypes": "9.1.2", - "@cspell/strong-weak-map": "9.1.2", - "@cspell/url": "9.1.2", + "@cspell/cspell-bundled-dicts": "9.1.3", + "@cspell/cspell-pipe": "9.1.3", + "@cspell/cspell-resolver": "9.1.3", + "@cspell/cspell-types": "9.1.3", + "@cspell/dynamic-import": "9.1.3", + "@cspell/filetypes": "9.1.3", + "@cspell/strong-weak-map": "9.1.3", + "@cspell/url": "9.1.3", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "9.1.2", - "cspell-dictionary": "9.1.2", - "cspell-glob": "9.1.2", - "cspell-grammar": "9.1.2", - "cspell-io": "9.1.2", - "cspell-trie-lib": "9.1.2", + "cspell-config-lib": "9.1.3", + "cspell-dictionary": "9.1.3", + "cspell-glob": "9.1.3", + "cspell-grammar": "9.1.3", + "cspell-io": "9.1.3", + "cspell-trie-lib": "9.1.3", "env-paths": "^3.0.0", "fast-equals": "^5.2.2", "gensequence": "^7.0.0", @@ -697,12 +698,12 @@ } }, "node_modules/cspell-trie-lib": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.1.2.tgz", - "integrity": "sha512-TkIQaknRRusUznqy+HwpqKCETCAznrzPJJHRHi8m6Zo3tAMsnIpaBQPRN8xem6w8/r/yJqFhLrsLSma0swyviQ==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.1.3.tgz", + "integrity": "sha512-fvI0ede/rPr+SB0zX8le426c5lroNdmMTkl4fFk2e0w5/JZRHIfkuenhWe0MZeb18d1NPRIiLgxoD87zswLynw==", "dependencies": { - "@cspell/cspell-pipe": "9.1.2", - "@cspell/cspell-types": "9.1.2", + "@cspell/cspell-pipe": "9.1.3", + "@cspell/cspell-types": "9.1.3", "gensequence": "^7.0.0" }, "engines": { @@ -933,6 +934,17 @@ "node": ">=10" } }, + "node_modules/smol-toml": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.4.1.tgz", + "integrity": "sha512-CxdwHXyYTONGHThDbq5XdwbFsuY4wlClRGejfE2NtwUtiHYsP1QtNsHb/hnj31jKYSchztJsaA8pSQoVzkfCFg==", + "engines": { + "node": ">= 18" + }, + "funding": { + "url": "https://github.com/sponsors/cyyynthia" + } + }, "node_modules/tinyglobby": { "version": "0.2.14", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", diff --git a/package.json b/package.json index c29afa5e0d..ccb009d5ab 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.1.2" + "cspell": "^9.1.3" } } From 2ffeb498c64e247503c32d760b3c120ebbfc2982 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Fri, 11 Jul 2025 22:49:56 +1000 Subject: [PATCH 654/845] remove Microsoft.SourceLink.GitHub not required since sdk 8 https://github.com/dotnet/sourcelink?tab=readme-ov-file#using-source-link-in-net-projects --- Src/FluentAssertions/FluentAssertions.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 6a34e4c0da..d4dde24256 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -56,7 +56,6 @@ Check out the [license page](LICENSE) for more information. - From 6b24a56f428246dc770ad4cf97c732970743ccaa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 16:42:44 +0000 Subject: [PATCH 655/845] Bump cspell from 9.1.3 to 9.1.5 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 9.1.3 to 9.1.5. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.1.5/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.1.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 783 ++++++++++++++++++++++++++-------------------- package.json | 2 +- 2 files changed, 443 insertions(+), 342 deletions(-) diff --git a/package-lock.json b/package-lock.json index a4f6676642..440e49733e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,100 +7,104 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.1.3" + "cspell": "^9.1.5" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.1.3.tgz", - "integrity": "sha512-WbOkD32fjxz0hHMP6oTvAgi2VBlzYcqKPNwCo+4b9HefLWV5aiLaxp04d8CeifaAdlYjkjuqRTJXh/HfUeLCVg==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.1.5.tgz", + "integrity": "sha512-CdaWYdxnXBFRWAga2qhB/WVO4oCxgSeV1hosvnFCBxrFUyG5KuqYRJdYgCQcITs6dpA3IdNNa7+zWX8JvxnH+A==", + "license": "MIT", "dependencies": { - "@cspell/dict-ada": "^4.1.0", - "@cspell/dict-al": "^1.1.0", - "@cspell/dict-aws": "^4.0.11", - "@cspell/dict-bash": "^4.2.0", - "@cspell/dict-companies": "^3.2.1", - "@cspell/dict-cpp": "^6.0.8", - "@cspell/dict-cryptocurrencies": "^5.0.4", - "@cspell/dict-csharp": "^4.0.6", - "@cspell/dict-css": "^4.0.17", - "@cspell/dict-dart": "^2.3.0", - "@cspell/dict-data-science": "^2.0.8", - "@cspell/dict-django": "^4.1.4", - "@cspell/dict-docker": "^1.1.14", - "@cspell/dict-dotnet": "^5.0.9", - "@cspell/dict-elixir": "^4.0.7", - "@cspell/dict-en_us": "^4.4.13", - "@cspell/dict-en-common-misspellings": "^2.1.2", - "@cspell/dict-en-gb-mit": "^3.1.3", - "@cspell/dict-filetypes": "^3.0.12", - "@cspell/dict-flutter": "^1.1.0", - "@cspell/dict-fonts": "^4.0.4", - "@cspell/dict-fsharp": "^1.1.0", - "@cspell/dict-fullstack": "^3.2.6", - "@cspell/dict-gaming-terms": "^1.1.1", - "@cspell/dict-git": "^3.0.6", - "@cspell/dict-golang": "^6.0.22", - "@cspell/dict-google": "^1.0.8", - "@cspell/dict-haskell": "^4.0.5", - "@cspell/dict-html": "^4.0.11", - "@cspell/dict-html-symbol-entities": "^4.0.3", - "@cspell/dict-java": "^5.0.11", - "@cspell/dict-julia": "^1.1.0", - "@cspell/dict-k8s": "^1.0.11", - "@cspell/dict-kotlin": "^1.1.0", - "@cspell/dict-latex": "^4.0.3", - "@cspell/dict-lorem-ipsum": "^4.0.4", - "@cspell/dict-lua": "^4.0.7", - "@cspell/dict-makefile": "^1.0.4", - "@cspell/dict-markdown": "^2.0.11", - "@cspell/dict-monkeyc": "^1.0.10", - "@cspell/dict-node": "^5.0.7", - "@cspell/dict-npm": "^5.2.9", - "@cspell/dict-php": "^4.0.14", - "@cspell/dict-powershell": "^5.0.14", - "@cspell/dict-public-licenses": "^2.0.13", - "@cspell/dict-python": "^4.2.18", - "@cspell/dict-r": "^2.1.0", - "@cspell/dict-ruby": "^5.0.8", - "@cspell/dict-rust": "^4.0.11", - "@cspell/dict-scala": "^5.0.7", - "@cspell/dict-shell": "^1.1.0", - "@cspell/dict-software-terms": "^5.1.2", - "@cspell/dict-sql": "^2.2.0", - "@cspell/dict-svelte": "^1.0.6", - "@cspell/dict-swift": "^2.0.5", - "@cspell/dict-terraform": "^1.1.2", - "@cspell/dict-typescript": "^3.2.2", - "@cspell/dict-vue": "^3.0.4" + "@cspell/dict-ada": "^4.1.1", + "@cspell/dict-al": "^1.1.1", + "@cspell/dict-aws": "^4.0.12", + "@cspell/dict-bash": "^4.2.1", + "@cspell/dict-companies": "^3.2.2", + "@cspell/dict-cpp": "^6.0.9", + "@cspell/dict-cryptocurrencies": "^5.0.5", + "@cspell/dict-csharp": "^4.0.7", + "@cspell/dict-css": "^4.0.18", + "@cspell/dict-dart": "^2.3.1", + "@cspell/dict-data-science": "^2.0.9", + "@cspell/dict-django": "^4.1.5", + "@cspell/dict-docker": "^1.1.15", + "@cspell/dict-dotnet": "^5.0.10", + "@cspell/dict-elixir": "^4.0.8", + "@cspell/dict-en_us": "^4.4.14", + "@cspell/dict-en-common-misspellings": "^2.1.3", + "@cspell/dict-en-gb-mit": "^3.1.4", + "@cspell/dict-filetypes": "^3.0.13", + "@cspell/dict-flutter": "^1.1.1", + "@cspell/dict-fonts": "^4.0.5", + "@cspell/dict-fsharp": "^1.1.1", + "@cspell/dict-fullstack": "^3.2.7", + "@cspell/dict-gaming-terms": "^1.1.2", + "@cspell/dict-git": "^3.0.7", + "@cspell/dict-golang": "^6.0.23", + "@cspell/dict-google": "^1.0.9", + "@cspell/dict-haskell": "^4.0.6", + "@cspell/dict-html": "^4.0.12", + "@cspell/dict-html-symbol-entities": "^4.0.4", + "@cspell/dict-java": "^5.0.12", + "@cspell/dict-julia": "^1.1.1", + "@cspell/dict-k8s": "^1.0.12", + "@cspell/dict-kotlin": "^1.1.1", + "@cspell/dict-latex": "^4.0.4", + "@cspell/dict-lorem-ipsum": "^4.0.5", + "@cspell/dict-lua": "^4.0.8", + "@cspell/dict-makefile": "^1.0.5", + "@cspell/dict-markdown": "^2.0.12", + "@cspell/dict-monkeyc": "^1.0.11", + "@cspell/dict-node": "^5.0.8", + "@cspell/dict-npm": "^5.2.11", + "@cspell/dict-php": "^4.0.15", + "@cspell/dict-powershell": "^5.0.15", + "@cspell/dict-public-licenses": "^2.0.14", + "@cspell/dict-python": "^4.2.19", + "@cspell/dict-r": "^2.1.1", + "@cspell/dict-ruby": "^5.0.9", + "@cspell/dict-rust": "^4.0.12", + "@cspell/dict-scala": "^5.0.8", + "@cspell/dict-shell": "^1.1.1", + "@cspell/dict-software-terms": "^5.1.4", + "@cspell/dict-sql": "^2.2.1", + "@cspell/dict-svelte": "^1.0.7", + "@cspell/dict-swift": "^2.0.6", + "@cspell/dict-terraform": "^1.1.3", + "@cspell/dict-typescript": "^3.2.3", + "@cspell/dict-vue": "^3.0.5" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.1.3.tgz", - "integrity": "sha512-FvzlSQuU+bNeo77v0KrA/lkoe324cHvZNhkx7Dtp1aj01FeBr5Y36gozR3DNY6tewBi6hC7uLeeNg/iSBf6CWg==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.1.5.tgz", + "integrity": "sha512-tnapaKwxlHa7e5kuy0quJjW0oZlqetTbbsmYlayavm4PEVhuuNEp+skj4t957aRMGSq76t8Kgl7vS5Qp41ToMw==", + "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.1.3" + "@cspell/cspell-types": "9.1.5" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-pipe": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.1.3.tgz", - "integrity": "sha512-Cns37ml7IaXMWBci9XOqdTkP9nFtOO8+sJ4VvtbVO68Zo8v0vq74ApDbPgGI2HzYtn7Jj2hxQqGIBdLnmrMPyA==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.1.5.tgz", + "integrity": "sha512-6zmRfbqTHpYcI/n5uoerQVMqY31lnhA34BHU97uZn6kaW5rXTmQLze/WKmlrs+LAFfDL6MHIOLBJAusZw5Bb5g==", + "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.1.3.tgz", - "integrity": "sha512-3h9AkbY+YutBG91fQxeSpfIRT50sfrNQ7IAS0N6fCvJ6z0sXed7UPYwf90NauQp/1lN/bVlHFFAgxDEyG720Yg==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.1.5.tgz", + "integrity": "sha512-xZdTdcOcRoShrmA7S3tX5s8UmxFNaef5xdv8TABDjnTr6oPLBsZ5S3kPBZ8T+xlkj3MUB593SIkhD/0G74vLpw==", + "license": "MIT", "dependencies": { "global-directory": "^4.0.1" }, @@ -109,329 +113,390 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.1.3.tgz", - "integrity": "sha512-Ss4cCnkJI3IHDSOQKxhtAfypvZZDzuJeXbZFVimLvO22/8GdVH+vQxAFm3kBY+ACVUAe13MQIYzZxuFHaM9y8g==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.1.5.tgz", + "integrity": "sha512-mAXtwYw5Xobn8uicZjblI+8SPscKHK3eDGm7hnYeThb/kzS83uQog0+8LbSh+YiXDrAqzXn73kXMHg1D+EvMpQ==", + "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.1.3.tgz", - "integrity": "sha512-JPLFMp6qKj4fjsEDvMjVXFZg+j3HaRQ7raFtR2RPidYyKcUHPCVhX0wfJ0vuYxkC0Yst+99tgVxR8Wi57xs2Ew==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.1.5.tgz", + "integrity": "sha512-SPX9vHhqCtPE0wayvwmczax8X0oAXA3sBFIW31CoSyiu4lJ5sfKM4ZaoL25Wu4bW6GlYhaW4+diemmTdLHquag==", + "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/dict-ada": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.1.0.tgz", - "integrity": "sha512-7SvmhmX170gyPd+uHXrfmqJBY5qLcCX8kTGURPVeGxmt8XNXT75uu9rnZO+jwrfuU2EimNoArdVy5GZRGljGNg==" + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.1.1.tgz", + "integrity": "sha512-E+0YW9RhZod/9Qy2gxfNZiHJjCYFlCdI69br1eviQQWB8yOTJX0JHXLs79kOYhSW0kINPVUdvddEBe6Lu6CjGQ==", + "license": "MIT" }, "node_modules/@cspell/dict-al": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-al/-/dict-al-1.1.0.tgz", - "integrity": "sha512-PtNI1KLmYkELYltbzuoztBxfi11jcE9HXBHCpID2lou/J4VMYKJPNqe4ZjVzSI9NYbMnMnyG3gkbhIdx66VSXg==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-al/-/dict-al-1.1.1.tgz", + "integrity": "sha512-sD8GCaZetgQL4+MaJLXqbzWcRjfKVp8x+px3HuCaaiATAAtvjwUQ5/Iubiqwfd1boIh2Y1/3EgM3TLQ7Q8e0wQ==", + "license": "MIT" }, "node_modules/@cspell/dict-aws": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.11.tgz", - "integrity": "sha512-nesbrYbxP/ek7Nc3X1ENWxAXJ/2XIKGxauF0k4VSPLtMvWP50gHAEe+zmqFciFolwIVVjF2l+juDdUdBMPbMiw==" + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.12.tgz", + "integrity": "sha512-k1F48eYlX+LsCK2QjqpfHBrjNwNwRyut/XsGumyhUXZsm+j9NVuxQaFCjiEwXi81KE0YE3GBVdwSjqhuUOkpnQ==", + "license": "MIT" }, "node_modules/@cspell/dict-bash": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.2.0.tgz", - "integrity": "sha512-HOyOS+4AbCArZHs/wMxX/apRkjxg6NDWdt0jF9i9XkvJQUltMwEhyA2TWYjQ0kssBsnof+9amax2lhiZnh3kCg==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.2.1.tgz", + "integrity": "sha512-SBnzfAyEAZLI9KFS7DUG6Xc1vDFuLllY3jz0WHvmxe8/4xV3ufFE3fGxalTikc1VVeZgZmxYiABw4iGxVldYEg==", + "license": "MIT", "dependencies": { - "@cspell/dict-shell": "1.1.0" + "@cspell/dict-shell": "1.1.1" } }, "node_modules/@cspell/dict-companies": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.2.1.tgz", - "integrity": "sha512-ryaeJ1KhTTKL4mtinMtKn8wxk6/tqD4vX5tFP+Hg89SiIXmbMk5vZZwVf+eyGUWJOyw5A1CVj9EIWecgoi+jYQ==" + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.2.2.tgz", + "integrity": "sha512-iIuEBPfWzSQugIOn+OKOVsdfE9UloON5SKl57TbvC//D5mgIwPAMZGYT69yv20cjc5E6oMu353hCV3WFy9XO9A==", + "license": "MIT" }, "node_modules/@cspell/dict-cpp": { - "version": "6.0.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.8.tgz", - "integrity": "sha512-BzurRZilWqaJt32Gif6/yCCPi+FtrchjmnehVEIFzbWyeBd/VOUw77IwrEzehZsu5cRU91yPWuWp5fUsKfDAXA==" + "version": "6.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.9.tgz", + "integrity": "sha512-Xdq9MwGh0D5rsnbOqFW24NIClXXRhN11KJdySMibpcqYGeomxB2ODFBuhj1H7azO7kVGkGH0Okm4yQ2TRzBx0g==", + "license": "MIT" }, "node_modules/@cspell/dict-cryptocurrencies": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-5.0.4.tgz", - "integrity": "sha512-6iFu7Abu+4Mgqq08YhTKHfH59mpMpGTwdzDB2Y8bbgiwnGFCeoiSkVkgLn1Kel2++hYcZ8vsAW/MJS9oXxuMag==" + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-5.0.5.tgz", + "integrity": "sha512-R68hYYF/rtlE6T/dsObStzN5QZw+0aQBinAXuWCVqwdS7YZo0X33vGMfChkHaiCo3Z2+bkegqHlqxZF4TD3rUA==", + "license": "MIT" }, "node_modules/@cspell/dict-csharp": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.6.tgz", - "integrity": "sha512-w/+YsqOknjQXmIlWDRmkW+BHBPJZ/XDrfJhZRQnp0wzpPOGml7W0q1iae65P2AFRtTdPKYmvSz7AL5ZRkCnSIw==" + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.7.tgz", + "integrity": "sha512-H16Hpu8O/1/lgijFt2lOk4/nnldFtQ4t8QHbyqphqZZVE5aS4J/zD/WvduqnLY21aKhZS6jo/xF5PX9jyqPKUA==", + "license": "MIT" }, "node_modules/@cspell/dict-css": { - "version": "4.0.17", - "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.17.tgz", - "integrity": "sha512-2EisRLHk6X/PdicybwlajLGKF5aJf4xnX2uuG5lexuYKt05xV/J/OiBADmi8q9obhxf1nesrMQbqAt+6CsHo/w==" + "version": "4.0.18", + "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.18.tgz", + "integrity": "sha512-EF77RqROHL+4LhMGW5NTeKqfUd/e4OOv6EDFQ/UQQiFyWuqkEKyEz0NDILxOFxWUEVdjT2GQ2cC7t12B6pESwg==", + "license": "MIT" }, "node_modules/@cspell/dict-dart": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.3.0.tgz", - "integrity": "sha512-1aY90lAicek8vYczGPDKr70pQSTQHwMFLbmWKTAI6iavmb1fisJBS1oTmMOKE4ximDf86MvVN6Ucwx3u/8HqLg==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.3.1.tgz", + "integrity": "sha512-xoiGnULEcWdodXI6EwVyqpZmpOoh8RA2Xk9BNdR7DLamV/QMvEYn8KJ7NlRiTSauJKPNkHHQ5EVHRM6sTS7jdg==", + "license": "MIT" }, "node_modules/@cspell/dict-data-science": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.8.tgz", - "integrity": "sha512-uyAtT+32PfM29wRBeAkUSbkytqI8bNszNfAz2sGPtZBRmsZTYugKMEO9eDjAIE/pnT9CmbjNuoiXhk+Ss4fCOg==" + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.9.tgz", + "integrity": "sha512-wTOFMlxv06veIwKdXUwdGxrQcK44Zqs426m6JGgHIB/GqvieZQC5n0UI+tUm5OCxuNyo4OV6mylT4cRMjtKtWQ==", + "license": "MIT" }, "node_modules/@cspell/dict-django": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.4.tgz", - "integrity": "sha512-fX38eUoPvytZ/2GA+g4bbdUtCMGNFSLbdJJPKX2vbewIQGfgSFJKY56vvcHJKAvw7FopjvgyS/98Ta9WN1gckg==" + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.5.tgz", + "integrity": "sha512-AvTWu99doU3T8ifoMYOMLW2CXKvyKLukPh1auOPwFGHzueWYvBBN+OxF8wF7XwjTBMMeRleVdLh3aWCDEX/ZWg==", + "license": "MIT" }, "node_modules/@cspell/dict-docker": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.14.tgz", - "integrity": "sha512-p6Qz5mokvcosTpDlgSUREdSbZ10mBL3ndgCdEKMqjCSZJFdfxRdNdjrGER3lQ6LMq5jGr1r7nGXA0gvUJK80nw==" + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.15.tgz", + "integrity": "sha512-wYthMAbEbqDBr9P90VC9aT3zjErrJbUtIr91pDmse7Y5WUvQtAwFhiJHgmNrtx2fZ2idII0eYvpMqoEO+FYFxw==", + "license": "MIT" }, "node_modules/@cspell/dict-dotnet": { - "version": "5.0.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.9.tgz", - "integrity": "sha512-JGD6RJW5sHtO5lfiJl11a5DpPN6eKSz5M1YBa1I76j4dDOIqgZB6rQexlDlK1DH9B06X4GdDQwdBfnpAB0r2uQ==" + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.10.tgz", + "integrity": "sha512-ooar8BP/RBNP1gzYfJPStKEmpWy4uv/7JCq6FOnJLeD1yyfG3d/LFMVMwiJo+XWz025cxtkM3wuaikBWzCqkmg==", + "license": "MIT" }, "node_modules/@cspell/dict-elixir": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-4.0.7.tgz", - "integrity": "sha512-MAUqlMw73mgtSdxvbAvyRlvc3bYnrDqXQrx5K9SwW8F7fRYf9V4vWYFULh+UWwwkqkhX9w03ZqFYRTdkFku6uA==" + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-4.0.8.tgz", + "integrity": "sha512-CyfphrbMyl4Ms55Vzuj+mNmd693HjBFr9hvU+B2YbFEZprE5AG+EXLYTMRWrXbpds4AuZcvN3deM2XVB80BN/Q==", + "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.4.13", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.13.tgz", - "integrity": "sha512-6TEHCJKmRqq7fQI7090p+ju12vhuGcNkc6YfxHrcjO816m53VPVaS6IfG6+6OqelQiOMjr0ZD8IHcDIkwThSFw==" + "version": "4.4.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.15.tgz", + "integrity": "sha512-mhWaLui5aq0pgM4oIqAJNbOW/wQG3epe4nu22eqYTLQN+ztdzyn7aFpE+9yTtZTNvldK0xtN7jgk2mtHZ9w+1A==", + "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.2.tgz", - "integrity": "sha512-r74AObInM1XOUxd3lASnNZNDOIA9Bka7mBDTkvkOeCGoLQhn+Cr7h1889u4K07KHbecKMHP6zw5zQhkdocNzCw==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.3.tgz", + "integrity": "sha512-v1I97Hr1OrK+mwHsVzbY4vsPxx6mA5quhxzanF6XuRofz00wH4HPz8Q3llzRHxka5Wl/59gyan04UkUrvP4gdA==", + "license": "CC BY-SA 4.0" }, "node_modules/@cspell/dict-en-gb-mit": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.3.tgz", - "integrity": "sha512-4aY8ySQxSNSRILtf9lJIfSR+su86u8VL6z41gOIhvLIvYnHMFiohV7ebM91GbtdZXBazL7zmGFcpm2EnBzewug==" + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.5.tgz", + "integrity": "sha512-ovJScYOzSeik0cmr2L379VDWXaFD/FMlC6yXz1X3soGPheGkjVSgI3HICAv7Lk+knf906ifhAcEIrbTPKq9EnQ==", + "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.12.tgz", - "integrity": "sha512-+ds5wgNdlUxuJvhg8A1TjuSpalDFGCh7SkANCWvIplg6QZPXL4j83lqxP7PgjHpx7PsBUS7vw0aiHPjZy9BItw==" + "version": "3.0.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.13.tgz", + "integrity": "sha512-g6rnytIpQlMNKGJT1JKzWkC+b3xCliDKpQ3ANFSq++MnR4GaLiifaC4JkVON11Oh/UTplYOR1nY3BR4X30bswA==", + "license": "MIT" }, "node_modules/@cspell/dict-flutter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-flutter/-/dict-flutter-1.1.0.tgz", - "integrity": "sha512-3zDeS7zc2p8tr9YH9tfbOEYfopKY/srNsAa+kE3rfBTtQERAZeOhe5yxrnTPoufctXLyuUtcGMUTpxr3dO0iaA==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-flutter/-/dict-flutter-1.1.1.tgz", + "integrity": "sha512-UlOzRcH2tNbFhZmHJN48Za/2/MEdRHl2BMkCWZBYs+30b91mWvBfzaN4IJQU7dUZtowKayVIF9FzvLZtZokc5A==", + "license": "MIT" }, "node_modules/@cspell/dict-fonts": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.4.tgz", - "integrity": "sha512-cHFho4hjojBcHl6qxidl9CvUb492IuSk7xIf2G2wJzcHwGaCFa2o3gRcxmIg1j62guetAeDDFELizDaJlVRIOg==" + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.5.tgz", + "integrity": "sha512-BbpkX10DUX/xzHs6lb7yzDf/LPjwYIBJHJlUXSBXDtK/1HaeS+Wqol4Mlm2+NAgZ7ikIE5DQMViTgBUY3ezNoQ==", + "license": "MIT" }, "node_modules/@cspell/dict-fsharp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-fsharp/-/dict-fsharp-1.1.0.tgz", - "integrity": "sha512-oguWmHhGzgbgbEIBKtgKPrFSVAFtvGHaQS0oj+vacZqMObwkapcTGu7iwf4V3Bc2T3caf0QE6f6rQfIJFIAVsw==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-fsharp/-/dict-fsharp-1.1.1.tgz", + "integrity": "sha512-imhs0u87wEA4/cYjgzS0tAyaJpwG7vwtC8UyMFbwpmtw+/bgss+osNfyqhYRyS/ehVCWL17Ewx2UPkexjKyaBA==", + "license": "MIT" }, "node_modules/@cspell/dict-fullstack": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.6.tgz", - "integrity": "sha512-cSaq9rz5RIU9j+0jcF2vnKPTQjxGXclntmoNp4XB7yFX2621PxJcekGjwf/lN5heJwVxGLL9toR0CBlGKwQBgA==" + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.7.tgz", + "integrity": "sha512-IxEk2YAwAJKYCUEgEeOg3QvTL4XLlyArJElFuMQevU1dPgHgzWElFevN5lsTFnvMFA1riYsVinqJJX0BanCFEg==", + "license": "MIT" }, "node_modules/@cspell/dict-gaming-terms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.1.1.tgz", - "integrity": "sha512-tb8GFxjTLDQstkJcJ90lDqF4rKKlMUKs5/ewePN9P+PYRSehqDpLI5S5meOfPit8LGszeOrjUdBQ4zXo7NpMyQ==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.1.2.tgz", + "integrity": "sha512-9XnOvaoTBscq0xuD6KTEIkk9hhdfBkkvJAIsvw3JMcnp1214OCGW8+kako5RqQ2vTZR3Tnf3pc57o7VgkM0q1Q==", + "license": "MIT" }, "node_modules/@cspell/dict-git": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.6.tgz", - "integrity": "sha512-nazfOqyxlBOQGgcur9ssEOEQCEZkH8vXfQe8SDEx8sCN/g0SFm8ktabgLVmBOXjy3RzjVNLlM2nBfRQ7e6+5hQ==" + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.7.tgz", + "integrity": "sha512-odOwVKgfxCQfiSb+nblQZc4ErXmnWEnv8XwkaI4sNJ7cNmojnvogYVeMqkXPjvfrgEcizEEA4URRD2Ms5PDk1w==", + "license": "MIT" }, "node_modules/@cspell/dict-golang": { - "version": "6.0.22", - "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.22.tgz", - "integrity": "sha512-FvV0m3Y0nUFxw36uDCD8UtfOPv4wsZnnlabNwB3xNZ2IBn0gBURuMUZywScb9sd2wXM8VFBRoU//tc6NQsOVOg==" + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.23.tgz", + "integrity": "sha512-oXqUh/9dDwcmVlfUF5bn3fYFqbUzC46lXFQmi5emB0vYsyQXdNWsqi6/yH3uE7bdRE21nP7Yo0mR1jjFNyLamg==", + "license": "MIT" }, "node_modules/@cspell/dict-google": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-google/-/dict-google-1.0.8.tgz", - "integrity": "sha512-BnMHgcEeaLyloPmBs8phCqprI+4r2Jb8rni011A8hE+7FNk7FmLE3kiwxLFrcZnnb7eqM0agW4zUaNoB0P+z8A==" + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-google/-/dict-google-1.0.9.tgz", + "integrity": "sha512-biL65POqialY0i4g6crj7pR6JnBkbsPovB2WDYkj3H4TuC/QXv7Pu5pdPxeUJA6TSCHI7T5twsO4VSVyRxD9CA==", + "license": "MIT" }, "node_modules/@cspell/dict-haskell": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-haskell/-/dict-haskell-4.0.5.tgz", - "integrity": "sha512-s4BG/4tlj2pPM9Ha7IZYMhUujXDnI0Eq1+38UTTCpatYLbQqDwRFf2KNPLRqkroU+a44yTUAe0rkkKbwy4yRtQ==" + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-haskell/-/dict-haskell-4.0.6.tgz", + "integrity": "sha512-ib8SA5qgftExpYNjWhpYIgvDsZ/0wvKKxSP+kuSkkak520iPvTJumEpIE+qPcmJQo4NzdKMN8nEfaeci4OcFAQ==", + "license": "MIT" }, "node_modules/@cspell/dict-html": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.11.tgz", - "integrity": "sha512-QR3b/PB972SRQ2xICR1Nw/M44IJ6rjypwzA4jn+GH8ydjAX9acFNfc+hLZVyNe0FqsE90Gw3evLCOIF0vy1vQw==" + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.12.tgz", + "integrity": "sha512-JFffQ1dDVEyJq6tCDWv0r/RqkdSnV43P2F/3jJ9rwLgdsOIXwQbXrz6QDlvQLVvNSnORH9KjDtenFTGDyzfCaA==", + "license": "MIT" }, "node_modules/@cspell/dict-html-symbol-entities": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.3.tgz", - "integrity": "sha512-aABXX7dMLNFdSE8aY844X4+hvfK7977sOWgZXo4MTGAmOzR8524fjbJPswIBK7GaD3+SgFZ2yP2o0CFvXDGF+A==" + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.4.tgz", + "integrity": "sha512-afea+0rGPDeOV9gdO06UW183Qg6wRhWVkgCFwiO3bDupAoyXRuvupbb5nUyqSTsLXIKL8u8uXQlJ9pkz07oVXw==", + "license": "MIT" }, "node_modules/@cspell/dict-java": { - "version": "5.0.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.11.tgz", - "integrity": "sha512-T4t/1JqeH33Raa/QK/eQe26FE17eUCtWu+JsYcTLkQTci2dk1DfcIKo8YVHvZXBnuM43ATns9Xs0s+AlqDeH7w==" + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.12.tgz", + "integrity": "sha512-qPSNhTcl7LGJ5Qp6VN71H8zqvRQK04S08T67knMq9hTA8U7G1sTKzLmBaDOFhq17vNX/+rT+rbRYp+B5Nwza1A==", + "license": "MIT" }, "node_modules/@cspell/dict-julia": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-julia/-/dict-julia-1.1.0.tgz", - "integrity": "sha512-CPUiesiXwy3HRoBR3joUseTZ9giFPCydSKu2rkh6I2nVjXnl5vFHzOMLXpbF4HQ1tH2CNfnDbUndxD+I+7eL9w==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-julia/-/dict-julia-1.1.1.tgz", + "integrity": "sha512-WylJR9TQ2cgwd5BWEOfdO3zvDB+L7kYFm0I9u0s9jKHWQ6yKmfKeMjU9oXxTBxIufhCXm92SKwwVNAC7gjv+yA==", + "license": "MIT" }, "node_modules/@cspell/dict-k8s": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.11.tgz", - "integrity": "sha512-8ojNwB5j4PfZ1Gq9n5c/HKJCtZD3h6+wFy+zpALpDWFFQ2qT22Be30+3PVd+G5gng8or0LeK8VgKKd0l1uKPTA==" + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.12.tgz", + "integrity": "sha512-2LcllTWgaTfYC7DmkMPOn9GsBWsA4DZdlun4po8s2ysTP7CPEnZc1ZfK6pZ2eI4TsZemlUQQ+NZxMe9/QutQxg==", + "license": "MIT" }, "node_modules/@cspell/dict-kotlin": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-kotlin/-/dict-kotlin-1.1.0.tgz", - "integrity": "sha512-vySaVw6atY7LdwvstQowSbdxjXG6jDhjkWVWSjg1XsUckyzH1JRHXe9VahZz1i7dpoFEUOWQrhIe5B9482UyJQ==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-kotlin/-/dict-kotlin-1.1.1.tgz", + "integrity": "sha512-J3NzzfgmxRvEeOe3qUXnSJQCd38i/dpF9/t3quuWh6gXM+krsAXP75dY1CzDmS8mrJAlBdVBeAW5eAZTD8g86Q==", + "license": "MIT" }, "node_modules/@cspell/dict-latex": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-4.0.3.tgz", - "integrity": "sha512-2KXBt9fSpymYHxHfvhUpjUFyzrmN4c4P8mwIzweLyvqntBT3k0YGZJSriOdjfUjwSygrfEwiuPI1EMrvgrOMJw==" + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-4.0.4.tgz", + "integrity": "sha512-YdTQhnTINEEm/LZgTzr9Voz4mzdOXH7YX+bSFs3hnkUHCUUtX/mhKgf1CFvZ0YNM2afjhQcmLaR9bDQVyYBvpA==", + "license": "MIT" }, "node_modules/@cspell/dict-lorem-ipsum": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.4.tgz", - "integrity": "sha512-+4f7vtY4dp2b9N5fn0za/UR0kwFq2zDtA62JCbWHbpjvO9wukkbl4rZg4YudHbBgkl73HRnXFgCiwNhdIA1JPw==" + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.5.tgz", + "integrity": "sha512-9a4TJYRcPWPBKkQAJ/whCu4uCAEgv/O2xAaZEI0n4y1/l18Yyx8pBKoIX5QuVXjjmKEkK7hi5SxyIsH7pFEK9Q==", + "license": "MIT" }, "node_modules/@cspell/dict-lua": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-4.0.7.tgz", - "integrity": "sha512-Wbr7YSQw+cLHhTYTKV6cAljgMgcY+EUAxVIZW3ljKswEe4OLxnVJ7lPqZF5JKjlXdgCjbPSimsHqyAbC5pQN/Q==" + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-4.0.8.tgz", + "integrity": "sha512-N4PkgNDMu9JVsRu7JBS/3E/dvfItRgk9w5ga2dKq+JupP2Y3lojNaAVFhXISh4Y0a6qXDn2clA6nvnavQ/jjLA==", + "license": "MIT" }, "node_modules/@cspell/dict-makefile": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-makefile/-/dict-makefile-1.0.4.tgz", - "integrity": "sha512-E4hG/c0ekPqUBvlkrVvzSoAA+SsDA9bLi4xSV3AXHTVru7Y2bVVGMPtpfF+fI3zTkww/jwinprcU1LSohI3ylw==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-makefile/-/dict-makefile-1.0.5.tgz", + "integrity": "sha512-4vrVt7bGiK8Rx98tfRbYo42Xo2IstJkAF4tLLDMNQLkQ86msDlYSKG1ZCk8Abg+EdNcFAjNhXIiNO+w4KflGAQ==", + "license": "MIT" }, "node_modules/@cspell/dict-markdown": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.11.tgz", - "integrity": "sha512-stZieFKJyMQbzKTVoalSx2QqCpB0j8nPJF/5x+sBnDIWgMC65jp8Wil+jccWh9/vnUVukP3Ejewven5NC7SWuQ==", + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.12.tgz", + "integrity": "sha512-ufwoliPijAgWkD/ivAMC+A9QD895xKiJRF/fwwknQb7kt7NozTLKFAOBtXGPJAB4UjhGBpYEJVo2elQ0FCAH9A==", + "license": "MIT", "peerDependencies": { - "@cspell/dict-css": "^4.0.17", - "@cspell/dict-html": "^4.0.11", - "@cspell/dict-html-symbol-entities": "^4.0.3", - "@cspell/dict-typescript": "^3.2.2" + "@cspell/dict-css": "^4.0.18", + "@cspell/dict-html": "^4.0.12", + "@cspell/dict-html-symbol-entities": "^4.0.4", + "@cspell/dict-typescript": "^3.2.3" } }, "node_modules/@cspell/dict-monkeyc": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-monkeyc/-/dict-monkeyc-1.0.10.tgz", - "integrity": "sha512-7RTGyKsTIIVqzbvOtAu6Z/lwwxjGRtY5RkKPlXKHEoEAgIXwfDxb5EkVwzGQwQr8hF/D3HrdYbRT8MFBfsueZw==" + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-monkeyc/-/dict-monkeyc-1.0.11.tgz", + "integrity": "sha512-7Q1Ncu0urALI6dPTrEbSTd//UK0qjRBeaxhnm8uY5fgYNFYAG+u4gtnTIo59S6Bw5P++4H3DiIDYoQdY/lha8w==", + "license": "MIT" }, "node_modules/@cspell/dict-node": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.7.tgz", - "integrity": "sha512-ZaPpBsHGQCqUyFPKLyCNUH2qzolDRm1/901IO8e7btk7bEDF56DN82VD43gPvD4HWz3yLs/WkcLa01KYAJpnOw==" + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.8.tgz", + "integrity": "sha512-AirZcN2i84ynev3p2/1NCPEhnNsHKMz9zciTngGoqpdItUb2bDt1nJBjwlsrFI78GZRph/VaqTVFwYikmncpXg==", + "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.10.tgz", - "integrity": "sha512-MGR5S5e/0zcX3ln4eXQNYs3HBkX/JciqAmnCS0mNVx2jic1TtWBxJx+a33+95OhZeWF2Z/qL63FUQqZrJL27VA==" + "version": "5.2.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.12.tgz", + "integrity": "sha512-f5xcEl6+JZCFvDCOKJJuKv1ZMOzq9sBg/7y/iuqkBOgjeGDdB+PSrOJWk2jqu3PzXjjX39KJkt7mRUzv8Mrh1g==", + "license": "MIT" }, "node_modules/@cspell/dict-php": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.14.tgz", - "integrity": "sha512-7zur8pyncYZglxNmqsRycOZ6inpDoVd4yFfz1pQRe5xaRWMiK3Km4n0/X/1YMWhh3e3Sl/fQg5Axb2hlN68t1g==" + "version": "4.0.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.15.tgz", + "integrity": "sha512-iepGB2gtToMWSTvybesn4/lUp4LwXcEm0s8vasJLP76WWVkq1zYjmeS+WAIzNgsuURyZ/9mGqhS0CWMuo74ODw==", + "license": "MIT" }, "node_modules/@cspell/dict-powershell": { - "version": "5.0.14", - "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.14.tgz", - "integrity": "sha512-ktjjvtkIUIYmj/SoGBYbr3/+CsRGNXGpvVANrY0wlm/IoGlGywhoTUDYN0IsGwI2b8Vktx3DZmQkfb3Wo38jBA==" + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.15.tgz", + "integrity": "sha512-l4S5PAcvCFcVDMJShrYD0X6Huv9dcsQPlsVsBGbH38wvuN7gS7+GxZFAjTNxDmTY1wrNi1cCatSg6Pu2BW4rgg==", + "license": "MIT" }, "node_modules/@cspell/dict-public-licenses": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.13.tgz", - "integrity": "sha512-1Wdp/XH1ieim7CadXYE7YLnUlW0pULEjVl9WEeziZw3EKCAw8ZI8Ih44m4bEa5VNBLnuP5TfqC4iDautAleQzQ==" + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.14.tgz", + "integrity": "sha512-8NhNzQWALF6+NlLeKZKilSHbeW9MWeiD+NcrjehMAcovKFbsn8smmQG/bVxw+Ymtd6WEgNpLgswAqNsbSQQ4og==", + "license": "MIT" }, "node_modules/@cspell/dict-python": { - "version": "4.2.18", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.18.tgz", - "integrity": "sha512-hYczHVqZBsck7DzO5LumBLJM119a3F17aj8a7lApnPIS7cmEwnPc2eACNscAHDk7qAo2127oI7axUoFMe9/g1g==", + "version": "4.2.19", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.19.tgz", + "integrity": "sha512-9S2gTlgILp1eb6OJcVZeC8/Od83N8EqBSg5WHVpx97eMMJhifOzePkE0kDYjyHMtAFznCQTUu0iQEJohNQ5B0A==", + "license": "MIT", "dependencies": { - "@cspell/dict-data-science": "^2.0.8" + "@cspell/dict-data-science": "^2.0.9" } }, "node_modules/@cspell/dict-r": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-r/-/dict-r-2.1.0.tgz", - "integrity": "sha512-k2512wgGG0lTpTYH9w5Wwco+lAMf3Vz7mhqV8+OnalIE7muA0RSuD9tWBjiqLcX8zPvEJr4LdgxVju8Gk3OKyA==" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-r/-/dict-r-2.1.1.tgz", + "integrity": "sha512-71Ka+yKfG4ZHEMEmDxc6+blFkeTTvgKbKAbwiwQAuKl3zpqs1Y0vUtwW2N4b3LgmSPhV3ODVY0y4m5ofqDuKMw==", + "license": "MIT" }, "node_modules/@cspell/dict-ruby": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.8.tgz", - "integrity": "sha512-ixuTneU0aH1cPQRbWJvtvOntMFfeQR2KxT8LuAv5jBKqQWIHSxzGlp+zX3SVyoeR0kOWiu64/O5Yn836A5yMcQ==" + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.9.tgz", + "integrity": "sha512-H2vMcERMcANvQshAdrVx0XoWaNX8zmmiQN11dZZTQAZaNJ0xatdJoSqY8C8uhEMW89bfgpN+NQgGuDXW2vmXEw==", + "license": "MIT" }, "node_modules/@cspell/dict-rust": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.11.tgz", - "integrity": "sha512-OGWDEEzm8HlkSmtD8fV3pEcO2XBpzG2XYjgMCJCRwb2gRKvR+XIm6Dlhs04N/K2kU+iH8bvrqNpM8fS/BFl0uw==" + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.12.tgz", + "integrity": "sha512-z2QiH+q9UlNhobBJArvILRxV8Jz0pKIK7gqu4TgmEYyjiu1TvnGZ1tbYHeu9w3I/wOP6UMDoCBTty5AlYfW0mw==", + "license": "MIT" }, "node_modules/@cspell/dict-scala": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.7.tgz", - "integrity": "sha512-yatpSDW/GwulzO3t7hB5peoWwzo+Y3qTc0pO24Jf6f88jsEeKmDeKkfgPbYuCgbE4jisGR4vs4+jfQZDIYmXPA==" + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.8.tgz", + "integrity": "sha512-YdftVmumv8IZq9zu1gn2U7A4bfM2yj9Vaupydotyjuc+EEZZSqAafTpvW/jKLWji2TgybM1L2IhmV0s/Iv9BTw==", + "license": "MIT" }, "node_modules/@cspell/dict-shell": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-shell/-/dict-shell-1.1.0.tgz", - "integrity": "sha512-D/xHXX7T37BJxNRf5JJHsvziFDvh23IF/KvkZXNSh8VqcRdod3BAz9VGHZf6VDqcZXr1VRqIYR3mQ8DSvs3AVQ==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-shell/-/dict-shell-1.1.1.tgz", + "integrity": "sha512-T37oYxE7OV1x/1D4/13Y8JZGa1QgDCXV7AVt3HLXjn0Fe3TaNDvf5sU0fGnXKmBPqFFrHdpD3uutAQb1dlp15g==", + "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.3.tgz", - "integrity": "sha512-kHQmiMvAuXvF54S1uLZNVUJatnDv8L+pRnPMAiFXPTdudi6oM04TzI8yj8anm7gLcpfmJLCIECnc3s+we5eeXw==" + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.4.tgz", + "integrity": "sha512-zeinnVFfha+Snh8hMk4hRJTYWNLcRNaHRSvMMVe1DU8oljb1agfq6ouBt/uypIzwgGgAopPz9ArGyc/gVn9y8w==", + "license": "MIT" }, "node_modules/@cspell/dict-sql": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.2.0.tgz", - "integrity": "sha512-MUop+d1AHSzXpBvQgQkCiok8Ejzb+nrzyG16E8TvKL2MQeDwnIvMe3bv90eukP6E1HWb+V/MA/4pnq0pcJWKqQ==" + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.2.1.tgz", + "integrity": "sha512-qDHF8MpAYCf4pWU8NKbnVGzkoxMNrFqBHyG/dgrlic5EQiKANCLELYtGlX5auIMDLmTf1inA0eNtv74tyRJ/vg==", + "license": "MIT" }, "node_modules/@cspell/dict-svelte": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-svelte/-/dict-svelte-1.0.6.tgz", - "integrity": "sha512-8LAJHSBdwHCoKCSy72PXXzz7ulGROD0rP1CQ0StOqXOOlTUeSFaJJlxNYjlONgd2c62XBQiN2wgLhtPN+1Zv7Q==" + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-svelte/-/dict-svelte-1.0.7.tgz", + "integrity": "sha512-hGZsGqP0WdzKkdpeVLBivRuSNzOTvN036EBmpOwxH+FTY2DuUH7ecW+cSaMwOgmq5JFSdTcbTNFlNC8HN8lhaQ==", + "license": "MIT" }, "node_modules/@cspell/dict-swift": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-2.0.5.tgz", - "integrity": "sha512-3lGzDCwUmnrfckv3Q4eVSW3sK3cHqqHlPprFJZD4nAqt23ot7fic5ALR7J4joHpvDz36nHX34TgcbZNNZOC/JA==" + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-2.0.6.tgz", + "integrity": "sha512-PnpNbrIbex2aqU1kMgwEKvCzgbkHtj3dlFLPMqW1vSniop7YxaDTtvTUO4zA++ugYAEL+UK8vYrBwDPTjjvSnA==", + "license": "MIT" }, "node_modules/@cspell/dict-terraform": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.1.2.tgz", - "integrity": "sha512-RB9dnhxKIiWpwQB+b3JuFa8X4m+6Ny92Y4Z5QARR7jEtapg8iF2ODZX1yLtozp4kFVoRsUKEP6vj3MLv87VTdg==" + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.1.3.tgz", + "integrity": "sha512-gr6wxCydwSFyyBKhBA2xkENXtVFToheqYYGFvlMZXWjviynXmh+NK/JTvTCk/VHk3+lzbO9EEQKee6VjrAUSbA==", + "license": "MIT" }, "node_modules/@cspell/dict-typescript": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.2.2.tgz", - "integrity": "sha512-H9Y+uUHsTIDFO/jdfUAcqmcd5osT+2DB5b0aRCHfLWN/twUbGn/1qq3b7YwEvttxKlYzWHU3uNFf+KfA93VY7w==" + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.2.3.tgz", + "integrity": "sha512-zXh1wYsNljQZfWWdSPYwQhpwiuW0KPW1dSd8idjMRvSD0aSvWWHoWlrMsmZeRl4qM4QCEAjua8+cjflm41cQBg==", + "license": "MIT" }, "node_modules/@cspell/dict-vue": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.4.tgz", - "integrity": "sha512-0dPtI0lwHcAgSiQFx8CzvqjdoXROcH+1LyqgROCpBgppommWpVhbQ0eubnKotFEXgpUCONVkeZJ6Ql8NbTEu+w==" + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.5.tgz", + "integrity": "sha512-Mqutb8jbM+kIcywuPQCCaK5qQHTdaByoEO2J9LKFy3sqAdiBogNkrplqUK0HyyRFgCfbJUgjz3N85iCMcWH0JA==", + "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.1.3.tgz", - "integrity": "sha512-+8PxTslsh+oTxmhYdnfQZ/brYGFAnfqLR9xotWE4Ks3HoaLOhZsp6FF9kvlEp/gNOjpyhHn1UhT/Gr5fT4+QhQ==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.1.5.tgz", + "integrity": "sha512-vf6mSD9XW3fvl/uXShiZJ58f+FV6uoOPoFV0+xyg78h80bpXOagJeAd/vy0YcGcP/kcAcgRK0q22wCeKkGbeOA==", + "license": "MIT", "dependencies": { - "@cspell/url": "9.1.3", + "@cspell/url": "9.1.5", "import-meta-resolve": "^4.1.0" }, "engines": { @@ -439,25 +504,28 @@ } }, "node_modules/@cspell/filetypes": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.1.3.tgz", - "integrity": "sha512-HRJEggDo6OJJmCc/gq7oriMqkqVDema+oLpGBh1a/M7ulw+CzoHkOa//1ohpAJh5KsWj9Tej9Va4BUZ/SaCwUA==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.1.5.tgz", + "integrity": "sha512-Rhy+jBQwLKP6QnW2hIUYZiJ7TfJpTTW/gMfXJYf38BMIKkDlSx1bJV0j6VTcQF3EdqY6f5HmY48uDzNB87ygQQ==", + "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/strong-weak-map": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.1.3.tgz", - "integrity": "sha512-+96SI9R6TOY+xGBOK5LiOgX/W/9gAKus1Cvngh2LdtDVZwgVqpqvm5LoXxLhUT+Vs5UsndRBzblSdNpziSwZtA==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.1.5.tgz", + "integrity": "sha512-/IvDGDZAGk41Gm6i/YDpu7Cn47Ap6c+ZXHRb5/BdzK7oomSfeDA77YBTMJrbwSQQEt/NDY+5LXxmB161xIQxSw==", + "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.1.3.tgz", - "integrity": "sha512-LQQKY0O4QYUNKyDod8VfEBvqeJNGHJlx1v0gDq00eMvaClnkIz+y2ObGdtDlF7ZbG7TgI6PQ3ahJdlqfRPe3ZQ==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.1.5.tgz", + "integrity": "sha512-2AxwDCf4fwXF558Qf4fHUAreVUvEaRhWagkX3uO6PES+54/uNmLDmjL3Xl6R+GpGGrIeRrBGtc/nqAeamK9g+g==", + "license": "MIT", "engines": { "node": ">=20" } @@ -465,12 +533,14 @@ "node_modules/array-timsort": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", - "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==" + "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", + "license": "MIT" }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "license": "MIT", "engines": { "node": ">=6" } @@ -505,6 +575,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/clear-module/-/clear-module-4.1.2.tgz", "integrity": "sha512-LWAxzHqdHsAZlPlEyJ2Poz6AIs384mPeqLVCru2p0BrP9G/kVGuhNyZYClLO6cXlnuJjzC8xtsJIuMjKqLXoAw==", + "license": "MIT", "dependencies": { "parent-module": "^2.0.0", "resolve-from": "^5.0.0" @@ -529,6 +600,7 @@ "version": "4.2.5", "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.5.tgz", "integrity": "sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw==", + "license": "MIT", "dependencies": { "array-timsort": "^1.0.3", "core-util-is": "^1.0.3", @@ -543,27 +615,29 @@ "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" }, "node_modules/cspell": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.1.3.tgz", - "integrity": "sha512-QxpQn9rGIZN/neMU4hx9T4s9AL5nyRhumNCdYHjjU8Pi4ztZOzuVWbOQD1Oq5ygb92Aci76/DwbJQ1dmb4631Q==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.1.5.tgz", + "integrity": "sha512-AlFoGplH1YyRoCFHg2K0auS8vDna4yJjUiuP2mVZn82MaEKJQ4tMgnvUMdP+HtPP1lFlQ0iCvFr6+VVqCJVEDg==", + "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "9.1.3", - "@cspell/cspell-pipe": "9.1.3", - "@cspell/cspell-types": "9.1.3", - "@cspell/dynamic-import": "9.1.3", - "@cspell/url": "9.1.3", + "@cspell/cspell-json-reporter": "9.1.5", + "@cspell/cspell-pipe": "9.1.5", + "@cspell/cspell-types": "9.1.5", + "@cspell/dynamic-import": "9.1.5", + "@cspell/url": "9.1.5", "chalk": "^5.4.1", "chalk-template": "^1.1.0", "commander": "^14.0.0", - "cspell-config-lib": "9.1.3", - "cspell-dictionary": "9.1.3", - "cspell-gitignore": "9.1.3", - "cspell-glob": "9.1.3", - "cspell-io": "9.1.3", - "cspell-lib": "9.1.3", + "cspell-config-lib": "9.1.5", + "cspell-dictionary": "9.1.5", + "cspell-gitignore": "9.1.5", + "cspell-glob": "9.1.5", + "cspell-io": "9.1.5", + "cspell-lib": "9.1.5", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "semver": "^7.7.2", @@ -581,11 +655,12 @@ } }, "node_modules/cspell-config-lib": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.1.3.tgz", - "integrity": "sha512-B3DdOTZNIOQahSkOYqaq2fOc8fq/jFkrOFd36kge/GAyEpY2Um/Kp/GQ6caOcev+ju0h3iGaO24OLCx6QJ3YoQ==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.1.5.tgz", + "integrity": "sha512-VE3tsr2y+FwTENoAPFqzx8xE/+xTkllW3/i0HDRai5Kv8o35+ilTozY476bOI7fj445wNqPR8JstEdV314fdGA==", + "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.1.3", + "@cspell/cspell-types": "9.1.5", "comment-json": "^4.2.5", "smol-toml": "^1.4.1", "yaml": "^2.8.0" @@ -595,13 +670,14 @@ } }, "node_modules/cspell-dictionary": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.1.3.tgz", - "integrity": "sha512-BXWwYQ64LaSOd7+8TLZax3AeUnTJUuIl+Tl32/dqcVpgDF4P0eAUVE5xap+QZ2rzKRVFjD8r5M6IR2QrA23o0g==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.1.5.tgz", + "integrity": "sha512-UpMFtKs9O028yIxea/svTyUPPgNzlVdZXsht5O47nDuK+pVfZu+ngJOGSwmyoafQqd25jY00WRFXhQ5h503u1g==", + "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.1.3", - "@cspell/cspell-types": "9.1.3", - "cspell-trie-lib": "9.1.3", + "@cspell/cspell-pipe": "9.1.5", + "@cspell/cspell-types": "9.1.5", + "cspell-trie-lib": "9.1.5", "fast-equals": "^5.2.2" }, "engines": { @@ -609,13 +685,14 @@ } }, "node_modules/cspell-gitignore": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.1.3.tgz", - "integrity": "sha512-yc7Td6L7ZHejm1OzwY/hyfBgyz3gpToMPDyztwbwOdrxXNLRIgDZVPvjVS67XvNf3dv55J19A/8r5Xd7yaV60w==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.1.5.tgz", + "integrity": "sha512-zTLVv0xhuMKxCTdy1M68MuOYvDD/6IKLg8aL+06kO2TM3tQR91mJVSrazT9c+AmmpstOhzcVGmXf6vBNNDUa0Q==", + "license": "MIT", "dependencies": { - "@cspell/url": "9.1.3", - "cspell-glob": "9.1.3", - "cspell-io": "9.1.3" + "@cspell/url": "9.1.5", + "cspell-glob": "9.1.5", + "cspell-io": "9.1.5" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -625,11 +702,12 @@ } }, "node_modules/cspell-glob": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.1.3.tgz", - "integrity": "sha512-If7gSgbWlUhLcmNA9zPflWzdUZs4wyRKB/Ze584wrht7zJR4yJm2Rptk2+M8kXEhx3zYS6UGhSL0alPbVAbjgQ==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.1.5.tgz", + "integrity": "sha512-aMlUCSLcxVL7BdFAlxHHCvA/R35Jr457t4XJiJOoUCupybr5cBPvn8PNpEllBKhG60n6F/QN2uIt+r1tCJbAaQ==", + "license": "MIT", "dependencies": { - "@cspell/url": "9.1.3", + "@cspell/url": "9.1.5", "picomatch": "^4.0.2" }, "engines": { @@ -637,12 +715,13 @@ } }, "node_modules/cspell-grammar": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.1.3.tgz", - "integrity": "sha512-L1OVY9RyZXPT+qesw0c7aRKTxQIC7nrLKDQ97hRrQhK23hv5Q8o7GVs1S7pXRNZ/oA8V+VNG2CgjLiKnVM2jnw==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.1.5.tgz", + "integrity": "sha512-TSqlFZk2thBghPSEKb1DeLoLVxlko/KBrg7siCaJV8aBi0Juve48f4+rIfSW9L7Nd5Y7VpuYxI0iriP4LTE+Dw==", + "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.1.3", - "@cspell/cspell-types": "9.1.3" + "@cspell/cspell-pipe": "9.1.5", + "@cspell/cspell-types": "9.1.5" }, "bin": { "cspell-grammar": "bin.mjs" @@ -652,38 +731,40 @@ } }, "node_modules/cspell-io": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.1.3.tgz", - "integrity": "sha512-fdgAVrthOY1pPsBZHWVjEVn6uHMAshj2n75eu2rvUd6EcmMuLR13EcIXHoMcQo/1Az05x2UgG7HuK+0MuRcikQ==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.1.5.tgz", + "integrity": "sha512-i4bw5QDZp1yoxii+bmD/V6eFGIX5IzGwROko/6X84JHjtJGItiiA3kLfO69fZuXhzuzn9GjWRhSVX6wHafRAtQ==", + "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "9.1.3", - "@cspell/url": "9.1.3" + "@cspell/cspell-service-bus": "9.1.5", + "@cspell/url": "9.1.5" }, "engines": { "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.1.3.tgz", - "integrity": "sha512-egESsnErAPtC/wuqbHWW28eRKChkg5h+vFQQuZ0iThuOSZ65jeSM0ESOt8W3TH2JD7EGo2pvPED/7rZjjnMIcQ==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.1.5.tgz", + "integrity": "sha512-vxHPePzJRVFMN6NfKlCeekH11OZrxG7yW06BJ312tzsK/xovQ6Y+Rv2w2WC9h5TKHhPN2vP0aDPls/5ASH9PDA==", + "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.1.3", - "@cspell/cspell-pipe": "9.1.3", - "@cspell/cspell-resolver": "9.1.3", - "@cspell/cspell-types": "9.1.3", - "@cspell/dynamic-import": "9.1.3", - "@cspell/filetypes": "9.1.3", - "@cspell/strong-weak-map": "9.1.3", - "@cspell/url": "9.1.3", + "@cspell/cspell-bundled-dicts": "9.1.5", + "@cspell/cspell-pipe": "9.1.5", + "@cspell/cspell-resolver": "9.1.5", + "@cspell/cspell-types": "9.1.5", + "@cspell/dynamic-import": "9.1.5", + "@cspell/filetypes": "9.1.5", + "@cspell/strong-weak-map": "9.1.5", + "@cspell/url": "9.1.5", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "9.1.3", - "cspell-dictionary": "9.1.3", - "cspell-glob": "9.1.3", - "cspell-grammar": "9.1.3", - "cspell-io": "9.1.3", - "cspell-trie-lib": "9.1.3", + "cspell-config-lib": "9.1.5", + "cspell-dictionary": "9.1.5", + "cspell-glob": "9.1.5", + "cspell-grammar": "9.1.5", + "cspell-io": "9.1.5", + "cspell-trie-lib": "9.1.5", "env-paths": "^3.0.0", "fast-equals": "^5.2.2", "gensequence": "^7.0.0", @@ -698,12 +779,13 @@ } }, "node_modules/cspell-trie-lib": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.1.3.tgz", - "integrity": "sha512-fvI0ede/rPr+SB0zX8le426c5lroNdmMTkl4fFk2e0w5/JZRHIfkuenhWe0MZeb18d1NPRIiLgxoD87zswLynw==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.1.5.tgz", + "integrity": "sha512-wDP7wUH54vVrdDCkpd6W0H3DkWbYhYzm6yDGqi/aN/Z0q/ZR2tBByEY4IjYeJ6VNxhzJZq4+2xYZQaQkZWJgwQ==", + "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.1.3", - "@cspell/cspell-types": "9.1.3", + "@cspell/cspell-pipe": "9.1.5", + "@cspell/cspell-types": "9.1.5", "gensequence": "^7.0.0" }, "engines": { @@ -714,6 +796,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", + "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -725,6 +808,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -737,6 +821,7 @@ "version": "5.2.2", "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.2.2.tgz", "integrity": "sha512-V7/RktU11J3I36Nwq2JnZEM7tNm17eBJz+u25qdxBZeCKiX6BkVSZQjwWIr+IobgnZy+ag73tTZgZi7tr0LrBw==", + "license": "MIT", "engines": { "node": ">=6.0.0" } @@ -793,6 +878,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/gensequence/-/gensequence-7.0.0.tgz", "integrity": "sha512-47Frx13aZh01afHJTB3zTtKIlFI6vWY+MYCN9Qpew6i52rfKjnhCF/l1YlC8UmEMvvntZZ6z4PiCcmyuedR2aQ==", + "license": "MIT", "engines": { "node": ">=18" } @@ -801,6 +887,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", "integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==", + "license": "MIT", "dependencies": { "ini": "4.1.1" }, @@ -815,6 +902,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", + "license": "MIT", "engines": { "node": ">=8" } @@ -823,6 +911,7 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -838,6 +927,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "license": "MIT", "dependencies": { "callsites": "^3.0.0" }, @@ -849,6 +939,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "license": "MIT", "engines": { "node": ">=4" } @@ -857,6 +948,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -866,6 +958,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", + "license": "ISC", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } @@ -887,6 +980,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz", "integrity": "sha512-uo0Z9JJeWzv8BG+tRcapBKNJ0dro9cLyczGzulS6EfeyAdeC9sbojtW6XwvYxJkEne9En+J2XEl4zyglVeIwFg==", + "license": "MIT", "dependencies": { "callsites": "^3.1.0" }, @@ -910,6 +1004,7 @@ "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "license": "MIT", "engines": { "node": ">=0.10" } @@ -918,6 +1013,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "license": "MIT", "engines": { "node": ">=8" } @@ -938,6 +1034,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.4.1.tgz", "integrity": "sha512-CxdwHXyYTONGHThDbq5XdwbFsuY4wlClRGejfE2NtwUtiHYsP1QtNsHb/hnj31jKYSchztJsaA8pSQoVzkfCFg==", + "license": "BSD-3-Clause", "engines": { "node": ">= 18" }, @@ -964,17 +1061,20 @@ "node_modules/vscode-languageserver-textdocument": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", - "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==" + "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==", + "license": "MIT" }, "node_modules/vscode-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.1.0.tgz", - "integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==" + "integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==", + "license": "MIT" }, "node_modules/xdg-basedir": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -986,6 +1086,7 @@ "version": "2.8.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", + "license": "ISC", "bin": { "yaml": "bin.mjs" }, diff --git a/package.json b/package.json index ccb009d5ab..40c3d4e126 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.1.3" + "cspell": "^9.1.5" } } From 29f6c062087a0cf7eade45797eb9db41e839cd6f Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 20 Jul 2025 09:43:19 +0200 Subject: [PATCH 656/845] Added PackageGuard to the build pipeline --- .github/workflows/build.yml | 1 + .nuke/build.schema.json | 6 ++++++ .packageguard/cache.bin | Bin 0 -> 138014 bytes .packageguard/config.json | 18 ++++++++++++++++++ Build/Build.cs | 17 +++++++++++++++++ Build/_build.csproj | 1 + 6 files changed, 43 insertions(+) create mode 100644 .packageguard/cache.bin create mode 100644 .packageguard/config.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6aec010023..58084ca2ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,6 +34,7 @@ jobs: run: ./build.ps1 env: NuGetApiKey: ${{ secrets.NUGETAPIKEY }} + GitHubApiKey: ${{ secrets.GITHUB_TOKEN }} - name: Check for 'lcov.info' existence id: check_files diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index bf407fbe72..91b6d5c140 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -33,6 +33,7 @@ "Pack", "Push", "Restore", + "ScanPackages", "SpellCheck", "TestFrameworks", "TestingPlatformFrameworks", @@ -128,6 +129,11 @@ ], "description": "Use this parameter if you encounter build problems in any way, to generate a .binlog file which holds some useful information" }, + "GitHubApiKey": { + "type": "string", + "description": "The key to use for scanning packages on GitHub", + "default": "Secrets must be entered via 'nuke :secrets [profile]'" + }, "NuGetApiKey": { "type": "string", "description": "The key to push to Nuget", diff --git a/.packageguard/cache.bin b/.packageguard/cache.bin new file mode 100644 index 0000000000000000000000000000000000000000..3497aa80b66af138be704484a9d82f497f0abe0d GIT binary patch literal 138014 zcmeHw`;#PDb>3RCpd=w-3CXf7$sS1-lE8hltGcIWW~CL|-P1GM%XCjO)iXN~9kFCr zWq0RvRc38wRzLO+@DC0L5sq;9HwTU&0)%-95QtrY*GK|A03l>p!5V3hEK9Ng839Jf zB4YgAoA+eid{t#Vn$D`qh>e}9>Z)_|e)pVn&pr1%?0@voLzVyg;K76MdFY{smY?oA z23xfqidSPg_Ja(gw`?}hUFR8@)yo@ra|&Pvy8 zHFuue<^QmT+i~oB-@q@w8@~)j{5(GRY2|VBj;TD((Sl}LP2+^!b8YKC_ zd_TtVAy{u>Ql@tr0$N>&0Q#Hw`Y$Sv)e}&n22eSf^9S`m;OP&QrymSdnht;!)8W9H z5-Bj_RNOv8SekXcfSkYU1XQoyu!xs z#OJS3p1UXNy@${Q?ekv>6I1$+%9I9Mir#a4(w`$=pF`vHh{G(`r}yuaRr{ZKydUqe zYFNI^)p|dEyRJ-az}4cUi?T|mn99FVrZVa(@wpAMIs%JOS$zSI^Dld>3YOO~yv&7p zFMfVQnazL;BdHfhb#3JI23a0LBwV3?z(f6GJk)jUMWoH3F4+}DoBam9 z^N8}`j(*JihwoxHZP=EFO-Sr?hu(qR?qE06_W9n{)=f*hvA(*tSzkN9o%xUP_&=pQ zzJhz~c`JX7ul_K;`nch(ICyxMEnAlD>B3_8JN&VNKi1}Ji)^W_-chWS-I%Bw-4kM&b`8avm7NwgfAMDY)#S@dR*d~JV{+lK4838JjtF&bGP z%K_ei0iGIqfVHQ(=8@hqtj1~9V2Q7c!Qguj9(n^0t(vO$3~$%x8*cX<7_E-x818}Y zbPPvZwVTG1%a-0cbxrrlC*|9Kz1V@*ZdJYpsxJZ68|LnH)2r3_Z^^iuXA9K`+kFII zemM3Bf$bVv%PK9+Cqle-ep2~Ic=n%Do?Vg3mbr^}H9VvESKy~r{v1E}u^2LJ6QX%! zteBSWn1=gJeC5UXN{wNbwFO0my$^qRTp2AxKvkq-v^7ce{E_=z%w!K5YIm+pC9g` z{XT-QR9jrSyioZI{OU)OFtI>2WCQkV_~~N<0~S)Abm;yH^Z$_)=x*59Kx~J!M->i{ z%LQOb-@c9{|&A^q$s=SUMIZKj|QnLo;NPwG*7! zUG4>ESB;JVA2!ZT8#tb{NPe%xcK@6X%{)VBg7*0fbLJ+R+#SeE%vM__TpeT_FS4bj zh_n3zVAt!4e(1ZK#t6ex#VMXYHn|Nk9_l^1UuoFk)YIz|I_%ITabFM`@!?adj1MijSmFsNZqr`U;`Yul{u zIi|J0ZQHHD;gB?}2euPqlqY@DA#Y8%BVdB!RJ7I7J=}n{gOetAH>-ER1KRWpwJVn{ z&7a>9WPp8yAlTL&TxmxDP>Oh9#FP>FKO9mC-svmCGt#4RD&iNS?5>Sp)QV8UTaHaGX|Eh>iO z??9zo%A-<pa6cd&*8COt~|DKS7Q4!*5toDaI!)UQ>Tk;%C^Cp#;&Pb z?DE{n(jub|{Wxk?KXpB$&5%mtCkC!MrybAUcl6G|DZ7binz|b>7S9u@DF@=AZuZX4 zgHIk1ItB-ErWBY)(Cisa+tFEVp#&^FFgFXZ#S*Y|z$g=oI4mN3w57$mF@!!CJ&4kX18$kBZaLtG&dj^{9nxe@Z zWD~PX12fl*p!Hs$#VbXSG2(nP2{nOxlH|T6Ci`AROQs9)sfcXl6YCNc5AXMiZ z0a;M`hQO^Ovx}!!B3?W^QH%Wjq|AN@fUe{RG(s9-PlW)nM|6FhHC+x3xKcnj9A7)Y}KTchImKhnlEx!?hg001wgw#GGDdc2Jat_6JmmjNB*WjHyy6 z@p_qzm)1Gwa+#k27ra7I84B;14T(q7(3B?+DqqSAn3e9{9%3>H8l=t+#W?H#Di@5=IQ(?}U`#EEbR+r@XxbT8U@c z=aRQrQL=4boJywCDzDE{@Sexx^12NH@=DqeXTUItXhXM9fIB!~#h2l&AaqC3##tvT zS_Xx3>NwFgIltq5W*`IwUrFSyn)<$FyB3KA_^r#d?lwy&k zg?y?K4IZMbx6G$SGAqF`t(-s+KxuPltGw88Q&-Qv)498R0nE+I$ETtYmXexwX7~nR z;B84H4C^M_PNJ+J~DT<<(O^MJv<7_^iHb+q{LFm^C)Ee)U>aB z;28JqpADmpI%VOcFS3h@ODXR8Rs5&YL&#eQ?Vb2dhT1w})*Wiaz_#yhk5+V>YDMHa z->#s#rz3Xu2}(+0n~Xw23C)Z6neF-i|w>tfJzmjh3D))m218 zMc$mHx}vOnxm?LIdDCh?#GDD?#My@7;qo=q*Ktov-e4PlmrfxZb+n9jaWi3#k)747d+#TihS(*lv zB2A`&Onv4NS#Y*E2s=AMkdVu6TduwrxxGZ?s6yY@JpQ$Vk|Q|p4k5lZvUr>E|%>4m~J&&WA@3-lrD;0cSzmNL{~DqL#k-3 zy1sz6VC-y7C~V3z_Ows`vkv-0Fa^`l?-qjatvW_J88l!MVzh){afgKytxs&`y*4*F$qP>yz8`3EXIE0OZ( zIiEAWW*sayP8I7iXjQfQ{lU)l=Fv_Qo9b_XJ(aoG2hpvG^8I zQ*l;y?wAiDGIy6fVFbBu@q2VCh>_3Jl%yMVE)|d~=$>7&x0r!iz>{;e8Um8D{X(3a zkdBKa9izD!#^z+B5Vt_uDX^SYTkn`G_@j2Tpqc1edct^5A;OKm8dNEyKM(>3Jk@yy zjN_P>YMbWmHwK<|H$u!Dj?F&hPHB-{jC8FSHCEw!aA^MocCs4&?c+2S-7|Kc6rCl; z6%kca`_9WZlJ>9Ssb1axsp?K+=US_agoI_+<>m`A-4h>3l5Ymd*Y+prrxM1A$|p_# zSPnqpQ+<&12e|#jmZTZHl4Rb1=X`4D=UjWLYa%0(w@J===EPUzz`uflZ{{6%?L=>* zfMMuR-${HT$^KiA?dBz$09X#N%e!c2&&cnIs(wihewG&(Z^FcO@=h#v-QouUiY}wP zC#5UHY{C!Z^PkCXLuD~|1?a1`hiEt|YEVV9+(l*VBRruTaoK&IY+7JFZ>?nHor!a^2tFZJjRf1h1s{3`J%oAhROLoWX81ielR2 zdAAEvy{m8J~+EaI$3>$aUI|9@=asr8XDP#9c5)>YQpu5~lFz6`yLKqu8jP18zVs|k{F2glu z$ZXX42X}~i^sQXvQJ!5@Z#(LnanW8>^{9Mv=6dwZ&m!k`h#*%_E?&B`BEhE@>}VGi zUG6;#hU5)jauK=a+iJcUt-fJ#kxEi@V4F0XmQ+X;^5lm8$5qsw6e`d)UACfI zmeE}9n4}b4@@6lJt_q4$%o+TXdmt2H<$W7URhfC|HnKV^Ri%2jDUZvETQYI@mAg}^ zDkoo6-iNBZkgh7F6WX!e)~QvY0E(!}T9v12G7qblcvms?VkYM?Ii0K~>5<;!HPS~B z^z%L@kMiuQOLBVrlkW%rtz%VlIpCsYmv^FXrBW&#p74^pJLKmKUX%{cYmVMFj%{9Z z$#+W1Jx+ZinW*Ri7x73y)xb3y(Af5#ryZfbmFuM_ZroFfI_9k2JRGCqR>_u%J7l&} zamO@u>}{#I{b)jdaZ)O7a>|H%q>S67*-+en4AbbRU>b#{G3Su2mhSOBVC?4ZJ>(#X zP9~}nk9OI3CuqDzG4C@jsrnBg6uQzth!>(5#hUGBiBGQ?cdoa@qj=Q@F*=6h-RQ}2 zyu1tA};&zVr)hkkjkEYFo9^~ygiMLmG!xe~SMcJ@S;njU7UmFG&! zOTfWFnNf$}SD?yY3RS*o9DBT9@1DnaN;TbO^ZT1fI~}qZ=r%p$3>hP*`E*K~yR^CC z)hdLdrX-16cTGY5NFtMjX3#^)qGtb#bK8-Yw8Ujty!DWDD8DNRa&)$ib)9ZLG^>)PbF^Vg= zM^<+vYKUvPAgH|VowkfsyA!HDDqmh@2nC5ulM$=4yN^6^+u7H!sE5dNbc1nIsQc=XlPxu4sToVnc(1e#$7UOjq#0wa zpH}_47u@5|*4yo_P>ocquZkLVYNUC*f|L>zDUH(J?LT=nm65LlsXT=m-!k<9Zs!`( zQuJ6|s<=tJHF%L(hNo5Xx8tia)O%5mMWb?hnMNTa2-VQsG5|)nXs2FTm0Nves~>sC zqr6Eq8fHQQU@}$n=WxP$Im`iBC7HSo_2~o0i{`485k^(hl`}R-&Y)<^nR}1Nbcc6t zsjFvHhOV^0hADpx#C1PlI>Cws^hEw&qKc|Npj*TtJ=;TAxdu?G%C#twB;N(d7O2I1yub353N8Zi8 zhP{bbK$c=9BB;ZCEY&LfD1LH9+0J^4l%QA|hsnB-M6BN!AHat-z@=356(8scK)8j7Srr9D?;Mi0~@sxeUJ~^-|1AF`Ef7 z`!mSNPXq>FR1l04qtWHAjXs;$`#|II;bbisq7=AN;ATSL{sO}Cqk+IVUDVfg*pcaW z^_J^(o2DHK+htZGgEH*F@C<%`Ew8YpkcXgwF1a?!nl{5WbUfGVr;*S7r1rzw14vhF z@%H3U_v@Bx?jLx8bFIc|(ZU9Fi`vJy>PZ}Y$f*(|@?M5-0c)RStE5p-`xKsyDPp&8 zvo@6-6u$etV{}qE)LwN1|6gxDvT&t#sdlMCx9TAjJmLh+hm{7jC`{Ng+J+alPOGv@ zksE}!WAM5%c!tX*-ym>qg8HQ39>1PZ+`|F>ng>kxPAVS8$t5*qavR=;`A=V^T6!q`z^yA(b{aqF`N5=k0cKMTS4f~h~TT^OfTdVSDEB| zs+~txMI7S~0ORY!U`&Lk7u58EZd`ZM+}TE5wC>IVmm*(s?~}AS#0QvOkUtCl``LuD z22%z6iGE9{sE?(e~JWBjR z&O6jNIdpqdB7(jHYkb!B-IxO9Mllm}t%EdIsO6~yj?2De_pFtm3HH+`Vs91ot|h^8 zEgsgiUZ&$0p@w+13S}*V6tS$;$lC=hT#bNaxgLGigXBm?BVRT3eG9erOmrU!U)Sxf z(+I3bWJX0YM&5-b-Rf`IiiR|*H0?zrHCsP zSm;`w*)}RP%9h(*EZ{GZ2Rsuw+qkGU>U_gBtIM( z6+x8*vXR9}j?OkHYKd;RF@WgCi%4V`27(ZL4r)K$A|pedF`AaelNCj!r^?@eC4PW& z(rtXSkm56oy8%9oAN-QSL%kqU=|vCyvugOpC9rA30~0QXj!L(U77A}2xpUmBIj8&n zdTrfm8Yk?)Yqu&9Zl*VjY=PCjg{9%%l#TW6oT;WhBa0u?kz_1q(kZ-$qF2MwMM8p;UK_Ir;pP4sOiE`&gc$DL~y#wTK;om;K4K8Jg zwq(5v3XX!>C-GGCa*{DOp+7I^c^@>lV>Ck0Ds4%zp>l08(SH``tAW$Xo-1L`fS;uVn*{}b!i(uAOlzUWwj8sK z3%w&FV0CP6krMoWi07D7xS(IWP3_91OY_BL>deiaBK$UN%Vw+K=N2&~@Q8Y})fglQ zhTSpH%7DAT#ny=EExd;=2C#GT4eK0qii^p8Eb#?piB0dIyDNgJ?(G^!x@l<*j)zvs zVLrzFiL=5!e+>+O7#KqMxNn?Uh~PWIc5;gB@iuKET(;C=TC)NU)oe}$hppdayt<8J zxULf8j{5O4i52Bxr(?B=N~@1~UPtAqs$##*3P*h!;`YicabtDlOE{)?%2u7zj%V*X zdgmax@t9R1q!XLGXhodyDld6)5>%g=Rf(fg@DiAn?%tl^MC_qi)Y)`qlBg)X;6&({RAmiGtAWCFbwJ@dAO5O>BXb@0i>~{Af zY%`0(MR$N{00q%U(TJm2m&&u-f|iWff9VHuOv2*zwxZyEeTcIGwO7vL!1&BN0;QOW%b1$H*Q-^8I3 zruCa4AY;&Avn!=8N=+W(%hnK|6q*6EX+Xv<8)E3N^&8i@*Ic-*W*sWZ z`$%UbWD%fJ*|EX@KkG=v8i}e*!vT zBWBOBJE-$;gg|p;BbiO9{e5V+s-oS}QQ|o#JS=Kiv)eWtlp7kWF))G7mCu6Dd3`>qE>k0%*>Y>& zM$peeTY(GtyfYXd9^1^*;aXJ#HAL#-0>TXNb>$AvMx%7JanRpiAqTuqSJ|ee&nAYx6?JbR1F&eZi2okZ>5ANQL(K z*yrdVW7(d#+zM>Z1a|MoXzR*o83omPke(hKN$ytc{ceER!bQ}xSM~RYftXsj($SBZ zzeZixa2mXZisgxFS-Xt`{m6J)6ZB$5Q2B0G2zI-V>0D44Kw-DY^9L0^QJbla;;zUV zFt(6T7+Og+^cCs_R0eA$=!urY)xyc;Cjk_dKXjw@4;wxtXf$bb1SFdBNrj@suN#Iq zoH&-=LPBQ8^=vDse^Eo>P1S+>A&j=7EK3G>sWbs#tb=DEIE|`)r6{&5hEdfB5{7ET zm4Cqec@y0AhS4O&UuCsuP{SwirCNWGI1LopTxqn}vU_SZLB$}mT{>)iltQ(2k}5$s2w*LN-==TWr~0#4yPX=gaL+d8%85a!l8 zeHtaOQg|=|Dc9t-MR+1mAD%8H)`0rJ(13&C=@Zv{s)gf1Vm6vv7MOh@jPy+!H-v)t z#6w8?NGNz}#SLs8tF~jX)s_i6jHa1lL7QqVD23TvCBd`wK&mm<1t~4d(!r@7o4=H#CEU7hGPPK2LUt{e^aT@X2*T%-G$#Dd{wc^>>JyQ0o}Z-jQh>SLoZppP26` z2>Jl0brR>$E-AYbg=x}i_T80wj3HoMDjdURnn+3Z48yHaehv{i=!n)hUAK6CqEd?& z4c;O<`+tFkxvglJz8Ll%MicZW2gcvS^en8i3^?}f&@F{H)|sZSbcJ_?T2;HLDY);4ellJboKPTuvWCdej>5OzfRxHO1puV`KBw)43*Bk{ItKbVsgU9IY88tHy}pt_0Kyr`GRdP8Ss6P;8lqp-~}Mb^7dBYLT8Od^w%@{RfzIC}UxJ z3ZrZo9@?vVx+alksT_I!fsoxz8Az?A+9eHNBVY9spki?_aHDk zK)rBV$EPqyrpz(9b+pmo6CsSc)iCBddgBl^j>21E32;z9VYz{*BbPUhbHZejxU=Pb z7&AxoQBT?v?{OiYR(zK5Tv`pYgOEVDn40!+rnfI=I8tBw6OUwCt|z50qnv&dVX0tQ z+Kr(vBlcj$DKyY}&plB7Fn zL4z?VRZ`}724`w+;Zmd%{9sa=O&>cl2p5jShTJ}4XWBb@t7~j`JE4zh5k6zpW**g* zS{S!;rbv>+Ej#;R%;Y>0*i5jG<34R&{; zZ^z)DrMSJ6Tb(9uz%#?{1JDs(|{)!f@#vv9$0P+Vzs388iiio-U}D;YW}q@?*I z3JcWpSoDkxAQh-^LY2S6FDhUY{?S&;I3eb$!hKOAD3@W)9T;;cY()Vpv=TiKE;?s|R24OckT0Yfaz+ZF8ape6`l@c&EH`N|5MtnN_2*my@qTO4#f;iNXSvldr-F z1!!&9md#d;h8Yy7$2_BPbUD!qDe=59kSHu#_aRdkr0R{P``p_#j&MlQ8XOR<@@0JS z2l2(N?rzI$EO$&qkf@g7uY36uHo>YYu_BdVVSFS6+)M~OFMq}S#} z;u`!0mbdI8>s$oi%0Qy@kH-MReLUO+JRBXA6mNMnIsU8o;`iZ;Leg2?)351`KzraG zfGu4iG&kyVTQ_nVJrQy|g&A~cr{V>`&K$fqU|vsQpj>>KScbKyx+WY7JclG}r4nBm z!>UnQOUkM(FFUA-;b{?IQ<5@yv$9Q;&NxCMp}a);5}EJ2~`VJzs|1%@T-_3 z5zaUyrBl^>awIGT!K#<5!fYVl+TQcDBiDliPOBut={Z+|3ApN)iI@t0f-e_mnib?J`vbNi-1de1ysgdP`pJQcedcJ?_h{mO`tZ1V$9v`&f$$SPL9Uc!w9JTd+M& zp;FuIIyO}u$qu3<7OlW|s<9Sif60_rszH>3%KA;ROvln%v*<`r9i0>;!qB^!LWIoa zo`@)ojYDu|K($laP%1dzj*f6emnRDLOasVQ!6CmyZKSC*1$t~hk?5G&+I}bwJ%veP zAuzLrOM+X_?5{Ld62?l1%B&kJArhgn5)m0Sh-xYoY{FVegCxURnR;*%)`|*F4r^uV z0ZLda3P8TKqDoV3>hb8Y0nMB5N0yw?^u45v-03Yt{r8dIg;*@5i$yx*<@Sw+iG5U8f7qV` z?2jg3KPh$5@U^POtc%i*5m=#gu_!gssG2DK7?BBhsfWg)hthZ4BZ;x7s-?_Dd2OW@4CV0Cb#g|^r)08J(#cY`1;`xhQIbL?{H9i2B~Ni? z6$ILk(C(YfpGlDg(4`z&o^bvf;O|H9Z?1gsJ1a8ln_jS^U6h!+_biC;<~zBFT;nH# z4yBJPZ`hv8iG2gahCN&2rw=M$$N#<;Pa_B7NsQmbM=!=lywd){ycz_Uv+jpNOBC-0 z5kirNFck)X`?_XlxJ$ovB0ttRmT*CyNOznOnp^3b0afx~FYN;8daH`f$cdJHoJ=sW4xOUwPXR zwV25}0qScMfym(3JVS`SBau=k#e_IBXY_es!OKvFljVhI&}vf&dlmJTS8W))sJTpP z6Qvi>`dtlzeG5q49R$`sBk}4Ee2C&}1_CjKf!jgFhXzhm4GCi9bHM85{b1jAPHq_; z+X#z0_y~D`ydNIsTj!xpdtxbIOpsVl1+FT;iQoK>{+vo`byVqHA7ez zBP!!pz`i$!VP9G=8UXNua`AQZAl&*@fWr%X$)o3n(YC|xqP%+f;)icSfSm|{*9;wZm$YgjEY8!~c{5%FG-v5??YqDO8tA3fC_lw`G!LPoFj-!el| zQ;8T=&h@A1cWcPzwVb6dRbo?#+E@-C(dIL61UtUIKRYH(M8#2(c>qz`(Qr@jELX=J z#Bdzsm=j&iaU65XMGNw|23a)PY?G1_KkJZ9f=(7^c9<#`ai~R%T|}EdqMUhS%2`XGhT!^=qBLbKkAm=I(-_|Ea_x|depc^ zAbTlnFGQDwL@&ddj8TQxfRj@#@uC6-=6DeFT=J)Jv_P7G->fVoL5W`x^#lcpsDjMI zfbkU|@>0kPfx&c9qrDF%loOkaQH~ZQ(MgAdRow6JY5ignFM`^O;0OhhImW9gk2g`z> zSKhrPmtOiHRyIe}K|1YnF%pYG_4?z0nHGYZ8dwv{wZk^48MZ~vp2oe$C>JNbIR77m C449Mv literal 0 HcmV?d00001 diff --git a/.packageguard/config.json b/.packageguard/config.json new file mode 100644 index 0000000000..e88cc9e6b1 --- /dev/null +++ b/.packageguard/config.json @@ -0,0 +1,18 @@ +{ + "Settings": { + "Allow": { + "Licenses": [ + "MIT", + "Apache-2.0", + "BSD-3-Clause", + "BSD-2-Clause", + "Microsoft .NET Library License", + "MS-PL" + ], + "Packages": [ + "NETStandard.Library", + "NUnit" + ] + } + } +} diff --git a/Build/Build.cs b/Build/Build.cs index f8cbf75bf0..87d8bb32de 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -53,6 +53,10 @@ class Build : NukeBuild [Secret] readonly string NuGetApiKey; + [Parameter("The key to use for scanning packages on GitHub")] + [Secret] + readonly string GitHubApiKey; + [Solution(GenerateProjects = true)] readonly Solution Solution; @@ -63,6 +67,10 @@ class Build : NukeBuild [Required] [GitRepository] readonly GitRepository GitRepository; + + [NuGetPackage("PackageGuard", "PackageGuard.dll")] + Tool PackageGuard; + AbsolutePath ArtifactsDirectory => RootDirectory / "Artifacts"; AbsolutePath TestResultsDirectory => RootDirectory / "TestResults"; @@ -314,9 +322,18 @@ from framework in frameworks .DependsOn(VSTestFrameworks) .DependsOn(TestingPlatformFrameworks); + Target ScanPackages => _ => _ + .DependsOn(Restore) + .Executes(() => + { + Environment.SetEnvironmentVariable("GITHUB_API_KEY", GitHubApiKey); + PackageGuard($"--config-path={RootDirectory / ".packageguard" / "config.json"} --use-caching {RootDirectory}"); + }); + Target Pack => _ => _ .DependsOn(ApiChecks) .DependsOn(TestFrameworks) + .DependsOn(ScanPackages) .DependsOn(UnitTests) .DependsOn(CodeCoverage) .OnlyWhenDynamic(() => RunAllTargets || HasSourceChanges) diff --git a/Build/_build.csproj b/Build/_build.csproj index e66f168f8c..0be94f0822 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -13,6 +13,7 @@ + From 91906bd211bbabb3c8f73527da21886db0519caf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 16:03:30 +0000 Subject: [PATCH 657/845] Bump cspell from 9.1.5 to 9.2.0 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 9.1.5 to 9.2.0. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.2.0/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.2.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 287 ++++++++++++++++++++-------------------------- package.json | 2 +- 2 files changed, 127 insertions(+), 162 deletions(-) diff --git a/package-lock.json b/package-lock.json index 440e49733e..73fb0159ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.1.5" + "cspell": "^9.2.0" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.1.5.tgz", - "integrity": "sha512-CdaWYdxnXBFRWAga2qhB/WVO4oCxgSeV1hosvnFCBxrFUyG5KuqYRJdYgCQcITs6dpA3IdNNa7+zWX8JvxnH+A==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.2.0.tgz", + "integrity": "sha512-e4qb78SQWqHkRw47W8qFJ3RPijhSLkADF+T0oH8xl3r/golq1RGp2/KrWOqGRRofUSTiIKYqaMX7mbAyFnOxyA==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.1", @@ -31,9 +31,9 @@ "@cspell/dict-docker": "^1.1.15", "@cspell/dict-dotnet": "^5.0.10", "@cspell/dict-elixir": "^4.0.8", - "@cspell/dict-en_us": "^4.4.14", + "@cspell/dict-en_us": "^4.4.15", "@cspell/dict-en-common-misspellings": "^2.1.3", - "@cspell/dict-en-gb-mit": "^3.1.4", + "@cspell/dict-en-gb-mit": "^3.1.5", "@cspell/dict-filetypes": "^3.0.13", "@cspell/dict-flutter": "^1.1.1", "@cspell/dict-fonts": "^4.0.5", @@ -57,7 +57,7 @@ "@cspell/dict-markdown": "^2.0.12", "@cspell/dict-monkeyc": "^1.0.11", "@cspell/dict-node": "^5.0.8", - "@cspell/dict-npm": "^5.2.11", + "@cspell/dict-npm": "^5.2.12", "@cspell/dict-php": "^4.0.15", "@cspell/dict-powershell": "^5.0.15", "@cspell/dict-public-licenses": "^2.0.14", @@ -80,30 +80,30 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.1.5.tgz", - "integrity": "sha512-tnapaKwxlHa7e5kuy0quJjW0oZlqetTbbsmYlayavm4PEVhuuNEp+skj4t957aRMGSq76t8Kgl7vS5Qp41ToMw==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.2.0.tgz", + "integrity": "sha512-qHdkW8eyknCSDEsqCG8OHBMal03LQf21H2LVWhtwszEQ4BQRKcWctc+VIgkO69F/jLaN2wi/yhhMufXWHAEzIg==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.1.5" + "@cspell/cspell-types": "9.2.0" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-pipe": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.1.5.tgz", - "integrity": "sha512-6zmRfbqTHpYcI/n5uoerQVMqY31lnhA34BHU97uZn6kaW5rXTmQLze/WKmlrs+LAFfDL6MHIOLBJAusZw5Bb5g==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.2.0.tgz", + "integrity": "sha512-RO3adcsr7Ek+4511nyEOWDhOYYU1ogRs1Mo5xx3kDIdcKAJzhFdGry35T2wqft4dPASLCXcemBrhoS+hdQ+z+Q==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.1.5.tgz", - "integrity": "sha512-xZdTdcOcRoShrmA7S3tX5s8UmxFNaef5xdv8TABDjnTr6oPLBsZ5S3kPBZ8T+xlkj3MUB593SIkhD/0G74vLpw==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.2.0.tgz", + "integrity": "sha512-0Xvwq0iezfO71Alw+DjsGxacAzydqOAxdXnY4JknHuxt2l8GTSMjRwj65QAflv3PN6h1QoRZEeWdiKtusceWAw==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" @@ -113,18 +113,18 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.1.5.tgz", - "integrity": "sha512-mAXtwYw5Xobn8uicZjblI+8SPscKHK3eDGm7hnYeThb/kzS83uQog0+8LbSh+YiXDrAqzXn73kXMHg1D+EvMpQ==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.2.0.tgz", + "integrity": "sha512-ZDvcOTFk3cCVW+OjlkljeP7aSuV8tIguVn+GMco1/A+961hsEP20hngK9zJtyfpXqyvJKtvCVlyzS+z8VRrZGg==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.1.5.tgz", - "integrity": "sha512-SPX9vHhqCtPE0wayvwmczax8X0oAXA3sBFIW31CoSyiu4lJ5sfKM4ZaoL25Wu4bW6GlYhaW4+diemmTdLHquag==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.2.0.tgz", + "integrity": "sha512-hL4ltFwiARpFxlfXt4GiTWQxIFyZp4wrlp7dozZbitYO6QlYc5fwQ8jBc5zFUqknuH4gx/sCMLNXhAv3enNGZQ==", "license": "MIT", "engines": { "node": ">=20" @@ -143,9 +143,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-aws": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.12.tgz", - "integrity": "sha512-k1F48eYlX+LsCK2QjqpfHBrjNwNwRyut/XsGumyhUXZsm+j9NVuxQaFCjiEwXi81KE0YE3GBVdwSjqhuUOkpnQ==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.13.tgz", + "integrity": "sha512-i/9wTGC02EJn740F3CuiGM5qI6kbDr5xPGXUoCQsScr0nWNBljscO7Ko8ZrahXg1uBj3+A1WWxqceh1fqF52Ng==", "license": "MIT" }, "node_modules/@cspell/dict-bash": { @@ -206,9 +206,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-docker": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.15.tgz", - "integrity": "sha512-wYthMAbEbqDBr9P90VC9aT3zjErrJbUtIr91pDmse7Y5WUvQtAwFhiJHgmNrtx2fZ2idII0eYvpMqoEO+FYFxw==", + "version": "1.1.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.16.tgz", + "integrity": "sha512-UiVQ5RmCg6j0qGIxrBnai3pIB+aYKL3zaJGvXk1O/ertTKJif9RZikKXCEgqhaCYMweM4fuLqWSVmw3hU164Iw==", "license": "MIT" }, "node_modules/@cspell/dict-dotnet": { @@ -224,9 +224,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.4.15", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.15.tgz", - "integrity": "sha512-mhWaLui5aq0pgM4oIqAJNbOW/wQG3epe4nu22eqYTLQN+ztdzyn7aFpE+9yTtZTNvldK0xtN7jgk2mtHZ9w+1A==", + "version": "4.4.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.16.tgz", + "integrity": "sha512-/R47sUbUmba2dG/0LZyE6P6gX/DRF1sCcYNQNWyPk/KeidQRNZG+FH9U0KRvX42/2ZzMge6ebXH3WAJ52w0Vqw==", "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { @@ -236,9 +236,9 @@ "license": "CC BY-SA 4.0" }, "node_modules/@cspell/dict-en-gb-mit": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.5.tgz", - "integrity": "sha512-ovJScYOzSeik0cmr2L379VDWXaFD/FMlC6yXz1X3soGPheGkjVSgI3HICAv7Lk+knf906ifhAcEIrbTPKq9EnQ==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.6.tgz", + "integrity": "sha512-3JJGxuPhDK5rMDYPzJYAdjjsBddEyV54rXfUQpOCl7c7weMhNDWfC2q4h3cKNDj7Isud1q2RM+DlSxQWf40OTw==", "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { @@ -449,9 +449,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.4.tgz", - "integrity": "sha512-zeinnVFfha+Snh8hMk4hRJTYWNLcRNaHRSvMMVe1DU8oljb1agfq6ouBt/uypIzwgGgAopPz9ArGyc/gVn9y8w==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.5.tgz", + "integrity": "sha512-MX5beBP3pLmIM0mjqfrHbie3EEfyLWZ8ZqW56jcLuRlLoDcfC0FZsr66NCARgCgEwsWiidHFe87+7fFsnwqY6A==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -491,12 +491,12 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.1.5.tgz", - "integrity": "sha512-vf6mSD9XW3fvl/uXShiZJ58f+FV6uoOPoFV0+xyg78h80bpXOagJeAd/vy0YcGcP/kcAcgRK0q22wCeKkGbeOA==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.2.0.tgz", + "integrity": "sha512-2/k4LR8CQqbgIPQGELbCdt9xgg9+aQ7pMwOtllKvnFYBtwNiwqcZjlzAam2gtvD5DghKX2qrcSHG5A7YP5cX9A==", "license": "MIT", "dependencies": { - "@cspell/url": "9.1.5", + "@cspell/url": "9.2.0", "import-meta-resolve": "^4.1.0" }, "engines": { @@ -504,27 +504,27 @@ } }, "node_modules/@cspell/filetypes": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.1.5.tgz", - "integrity": "sha512-Rhy+jBQwLKP6QnW2hIUYZiJ7TfJpTTW/gMfXJYf38BMIKkDlSx1bJV0j6VTcQF3EdqY6f5HmY48uDzNB87ygQQ==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.2.0.tgz", + "integrity": "sha512-6wmCa3ZyI647H7F4w6kb9PCJ703JKSgFTB8EERTdIoGySbgVp5+qMIIoZ//wELukdjgcufcFZ5pBrhRDRsemRA==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/strong-weak-map": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.1.5.tgz", - "integrity": "sha512-/IvDGDZAGk41Gm6i/YDpu7Cn47Ap6c+ZXHRb5/BdzK7oomSfeDA77YBTMJrbwSQQEt/NDY+5LXxmB161xIQxSw==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.2.0.tgz", + "integrity": "sha512-5mpIMiIOCu4cBqy1oCTXISgJuOCQ6R/e38AkvnYWfmMIx7fCdx8n+mF52wX9m61Ng28Sq8VL253xybsWcCxHug==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.1.5.tgz", - "integrity": "sha512-2AxwDCf4fwXF558Qf4fHUAreVUvEaRhWagkX3uO6PES+54/uNmLDmjL3Xl6R+GpGGrIeRrBGtc/nqAeamK9g+g==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.2.0.tgz", + "integrity": "sha512-plB0wwdAESqBl4xDAT2db2/K1FZHJXfYlJTiV6pkn0XffTGyg4UGLaSCm15NzUoPxdSmzqj5jQb7y+mB9kFK8g==", "license": "MIT", "engines": { "node": ">=20" @@ -619,27 +619,27 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.1.5.tgz", - "integrity": "sha512-AlFoGplH1YyRoCFHg2K0auS8vDna4yJjUiuP2mVZn82MaEKJQ4tMgnvUMdP+HtPP1lFlQ0iCvFr6+VVqCJVEDg==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.2.0.tgz", + "integrity": "sha512-AKzaFMem2jRcGpAY2spKP0z15jpZeX1WTDNHCDsB8/YvnhnOfWXc0S5AF+4sfU1cQgHWYGFOolMuTri0ZQdV+Q==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "9.1.5", - "@cspell/cspell-pipe": "9.1.5", - "@cspell/cspell-types": "9.1.5", - "@cspell/dynamic-import": "9.1.5", - "@cspell/url": "9.1.5", + "@cspell/cspell-json-reporter": "9.2.0", + "@cspell/cspell-pipe": "9.2.0", + "@cspell/cspell-types": "9.2.0", + "@cspell/dynamic-import": "9.2.0", + "@cspell/url": "9.2.0", "chalk": "^5.4.1", "chalk-template": "^1.1.0", "commander": "^14.0.0", - "cspell-config-lib": "9.1.5", - "cspell-dictionary": "9.1.5", - "cspell-gitignore": "9.1.5", - "cspell-glob": "9.1.5", - "cspell-io": "9.1.5", - "cspell-lib": "9.1.5", + "cspell-config-lib": "9.2.0", + "cspell-dictionary": "9.2.0", + "cspell-gitignore": "9.2.0", + "cspell-glob": "9.2.0", + "cspell-io": "9.2.0", + "cspell-lib": "9.2.0", "fast-json-stable-stringify": "^2.1.0", - "file-entry-cache": "^9.1.0", + "flatted": "^3.3.3", "semver": "^7.7.2", "tinyglobby": "^0.2.14" }, @@ -655,12 +655,12 @@ } }, "node_modules/cspell-config-lib": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.1.5.tgz", - "integrity": "sha512-VE3tsr2y+FwTENoAPFqzx8xE/+xTkllW3/i0HDRai5Kv8o35+ilTozY476bOI7fj445wNqPR8JstEdV314fdGA==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.2.0.tgz", + "integrity": "sha512-Yc8+hT+uIWWCi6WMhOL6HDYbBCP2qig1tgKGThHVeOx6GviieV10TZ5kQ+P7ONgoqw2nmm7uXIC19dGYx3DblQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.1.5", + "@cspell/cspell-types": "9.2.0", "comment-json": "^4.2.5", "smol-toml": "^1.4.1", "yaml": "^2.8.0" @@ -670,14 +670,14 @@ } }, "node_modules/cspell-dictionary": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.1.5.tgz", - "integrity": "sha512-UpMFtKs9O028yIxea/svTyUPPgNzlVdZXsht5O47nDuK+pVfZu+ngJOGSwmyoafQqd25jY00WRFXhQ5h503u1g==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.2.0.tgz", + "integrity": "sha512-lV4VtjsDtxu8LyCcb6DY7Br4e/Aw1xfR8QvjYhHaJ8t03xry9STey5Rkfp+lz+hlVevNcn3lfCaacGuXyD+lLg==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.1.5", - "@cspell/cspell-types": "9.1.5", - "cspell-trie-lib": "9.1.5", + "@cspell/cspell-pipe": "9.2.0", + "@cspell/cspell-types": "9.2.0", + "cspell-trie-lib": "9.2.0", "fast-equals": "^5.2.2" }, "engines": { @@ -685,14 +685,14 @@ } }, "node_modules/cspell-gitignore": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.1.5.tgz", - "integrity": "sha512-zTLVv0xhuMKxCTdy1M68MuOYvDD/6IKLg8aL+06kO2TM3tQR91mJVSrazT9c+AmmpstOhzcVGmXf6vBNNDUa0Q==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.2.0.tgz", + "integrity": "sha512-gXDQZ7czTPwmEg1qtsUIjVEFm9IfgTO8rA02O8eYIveqjFixbSV3fIYOgoxZSZYxjt3O44m8+/zAFC1RE4CM/Q==", "license": "MIT", "dependencies": { - "@cspell/url": "9.1.5", - "cspell-glob": "9.1.5", - "cspell-io": "9.1.5" + "@cspell/url": "9.2.0", + "cspell-glob": "9.2.0", + "cspell-io": "9.2.0" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -702,26 +702,26 @@ } }, "node_modules/cspell-glob": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.1.5.tgz", - "integrity": "sha512-aMlUCSLcxVL7BdFAlxHHCvA/R35Jr457t4XJiJOoUCupybr5cBPvn8PNpEllBKhG60n6F/QN2uIt+r1tCJbAaQ==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.2.0.tgz", + "integrity": "sha512-viycZDyegzW2AKPFqvX5RveqTrB0sKgexlCu2A8z8eumpYYor5sD1NP05VDOqkAF4hDuiGqkHn6iNo0L1wNgLw==", "license": "MIT", "dependencies": { - "@cspell/url": "9.1.5", - "picomatch": "^4.0.2" + "@cspell/url": "9.2.0", + "picomatch": "^4.0.3" }, "engines": { "node": ">=20" } }, "node_modules/cspell-grammar": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.1.5.tgz", - "integrity": "sha512-TSqlFZk2thBghPSEKb1DeLoLVxlko/KBrg7siCaJV8aBi0Juve48f4+rIfSW9L7Nd5Y7VpuYxI0iriP4LTE+Dw==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.2.0.tgz", + "integrity": "sha512-qthAmWcNHpYAmufy7YWVg9xwrYANkVlI40bgC2uGd8EnKssm/qOPhqXXNS+kLf+q0NmJM5nMgRLhCC23xSp3JA==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.1.5", - "@cspell/cspell-types": "9.1.5" + "@cspell/cspell-pipe": "9.2.0", + "@cspell/cspell-types": "9.2.0" }, "bin": { "cspell-grammar": "bin.mjs" @@ -731,40 +731,40 @@ } }, "node_modules/cspell-io": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.1.5.tgz", - "integrity": "sha512-i4bw5QDZp1yoxii+bmD/V6eFGIX5IzGwROko/6X84JHjtJGItiiA3kLfO69fZuXhzuzn9GjWRhSVX6wHafRAtQ==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.2.0.tgz", + "integrity": "sha512-oxKiqFLcz629FmOId8UpdDznpMvCgpuktg4nkD2G9pYpRh+fRLZpP4QtZPyvJqvpUIzFhIOznMeHjsiBYHOZUA==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "9.1.5", - "@cspell/url": "9.1.5" + "@cspell/cspell-service-bus": "9.2.0", + "@cspell/url": "9.2.0" }, "engines": { "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.1.5.tgz", - "integrity": "sha512-vxHPePzJRVFMN6NfKlCeekH11OZrxG7yW06BJ312tzsK/xovQ6Y+Rv2w2WC9h5TKHhPN2vP0aDPls/5ASH9PDA==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.2.0.tgz", + "integrity": "sha512-RnhDIsETw6Ex0UaK3PFoJ2FwWMWfJPtdpNpv1qgmJwoGD4CzwtIqPOLtZ24zqdCP8ZnNTF/lwV/9rZVqifYjsw==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.1.5", - "@cspell/cspell-pipe": "9.1.5", - "@cspell/cspell-resolver": "9.1.5", - "@cspell/cspell-types": "9.1.5", - "@cspell/dynamic-import": "9.1.5", - "@cspell/filetypes": "9.1.5", - "@cspell/strong-weak-map": "9.1.5", - "@cspell/url": "9.1.5", + "@cspell/cspell-bundled-dicts": "9.2.0", + "@cspell/cspell-pipe": "9.2.0", + "@cspell/cspell-resolver": "9.2.0", + "@cspell/cspell-types": "9.2.0", + "@cspell/dynamic-import": "9.2.0", + "@cspell/filetypes": "9.2.0", + "@cspell/strong-weak-map": "9.2.0", + "@cspell/url": "9.2.0", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "9.1.5", - "cspell-dictionary": "9.1.5", - "cspell-glob": "9.1.5", - "cspell-grammar": "9.1.5", - "cspell-io": "9.1.5", - "cspell-trie-lib": "9.1.5", + "cspell-config-lib": "9.2.0", + "cspell-dictionary": "9.2.0", + "cspell-glob": "9.2.0", + "cspell-grammar": "9.2.0", + "cspell-io": "9.2.0", + "cspell-trie-lib": "9.2.0", "env-paths": "^3.0.0", "fast-equals": "^5.2.2", "gensequence": "^7.0.0", @@ -779,13 +779,13 @@ } }, "node_modules/cspell-trie-lib": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.1.5.tgz", - "integrity": "sha512-wDP7wUH54vVrdDCkpd6W0H3DkWbYhYzm6yDGqi/aN/Z0q/ZR2tBByEY4IjYeJ6VNxhzJZq4+2xYZQaQkZWJgwQ==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.2.0.tgz", + "integrity": "sha512-6GHL1KvLQzcPBSNY6QWOabq8YwRJAnNKamA0O/tRKy+11Hy99ysD4xvfu3kKYPAcobp5ZykX4nudHxy8yrEvng==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.1.5", - "@cspell/cspell-types": "9.1.5", + "@cspell/cspell-pipe": "9.2.0", + "@cspell/cspell-types": "9.2.0", "gensequence": "^7.0.0" }, "engines": { @@ -846,33 +846,11 @@ } } }, - "node_modules/file-entry-cache": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-9.1.0.tgz", - "integrity": "sha512-/pqPFG+FdxWQj+/WSuzXSDaNzxgTLr/OrR1QuqfEZzDakpdYE70PwUxL7BPUa8hpjbvY1+qvCl8k+8Tq34xJgg==", - "dependencies": { - "flat-cache": "^5.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/flat-cache": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-5.0.0.tgz", - "integrity": "sha512-JrqFmyUl2PnPi1OvLyTVHnQvwQ0S+e6lGSwu8OkAZlSaNIZciTY2H/cOOROxsBA1m/LZNHDsqAgDZt6akWcjsQ==", - "dependencies": { - "flatted": "^3.3.1", - "keyv": "^4.5.4" - }, - "engines": { - "node": ">=18" - } - }, "node_modules/flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==" + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "license": "ISC" }, "node_modules/gensequence": { "version": "7.0.0", @@ -963,19 +941,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" - }, - "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dependencies": { - "json-buffer": "3.0.1" - } - }, "node_modules/parent-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz", @@ -989,9 +954,9 @@ } }, "node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", "engines": { "node": ">=12" diff --git a/package.json b/package.json index 40c3d4e126..de186d8a6a 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.1.5" + "cspell": "^9.2.0" } } From 56fa7c811deb82956e2c40a8a504b788424ea820 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 20 Jul 2025 10:45:13 +0200 Subject: [PATCH 658/845] Add inline assertions using Value.ThatMatches and Value.ThatSatisfies --- .../Equivalency/EquivalencyPlan.cs | 2 + .../Inlining/ActionBasedInlineAssertion.cs | 33 ++++ .../Inlining/ConditionBasedInlineAssertion.cs | 30 +++ .../Inlining/IInlineEquivalencyAssertion.cs | 22 +++ .../Inlining/InlineEquivalencyStep.cs | 33 ++++ Src/FluentAssertions/Value.cs | 33 ++++ .../FluentAssertions/net47.verified.txt | 17 ++ .../FluentAssertions/net6.0.verified.txt | 17 ++ .../netstandard2.0.verified.txt | 17 ++ .../netstandard2.1.verified.txt | 17 ++ .../InlineAssertionsSpecs.cs | 186 ++++++++++++++++++ docs/_pages/objectgraphs.md | 30 ++- docs/_pages/releases.md | 6 + 13 files changed, 442 insertions(+), 1 deletion(-) create mode 100644 Src/FluentAssertions/Equivalency/Inlining/ActionBasedInlineAssertion.cs create mode 100644 Src/FluentAssertions/Equivalency/Inlining/ConditionBasedInlineAssertion.cs create mode 100644 Src/FluentAssertions/Equivalency/Inlining/IInlineEquivalencyAssertion.cs create mode 100644 Src/FluentAssertions/Equivalency/Inlining/InlineEquivalencyStep.cs create mode 100644 Src/FluentAssertions/Value.cs create mode 100644 Tests/FluentAssertions.Equivalency.Specs/InlineAssertionsSpecs.cs diff --git a/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs b/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs index 9e3f22a58a..595912c31e 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using FluentAssertions.Equivalency.Inlining; using FluentAssertions.Equivalency.Steps; #endregion @@ -143,6 +144,7 @@ private static List GetDefaultSteps() new RunAllUserStepsEquivalencyStep(), new AutoConversionStep(), new TypeEquivalencyStep(), + new InlineEquivalencyStep(), new ReferenceEqualityEquivalencyStep(), new GenericDictionaryEquivalencyStep(), new XDocumentEquivalencyStep(), diff --git a/Src/FluentAssertions/Equivalency/Inlining/ActionBasedInlineAssertion.cs b/Src/FluentAssertions/Equivalency/Inlining/ActionBasedInlineAssertion.cs new file mode 100644 index 0000000000..70a3130999 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Inlining/ActionBasedInlineAssertion.cs @@ -0,0 +1,33 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using FluentAssertions.Execution; + +namespace FluentAssertions.Equivalency.Inlining; + +/// +/// Represents an inline equivalency assertion, which is implemented using an action. This class +/// enables customized assertion logic to be injected during equivalency validation, typically using one +/// of the assertion APIs provided by Fluent Assertions. +/// +/// The expected type of the subject to which the assertion is applied. +[SuppressMessage("Usage", "CA2208:Instantiate argument exceptions correctly")] +internal class ActionBasedInlineAssertion(Action assertion) : IInlineEquivalencyAssertion +{ + /// + public void Execute(AssertionChain assertionChain, Comparands comparands) + { + if (assertion is null) + { + throw new ArgumentNullException(nameof(assertion), "An assertion clause is required"); + } + + assertionChain + .ForCondition(comparands.Subject is T) + .FailWith("Expected {context:subject} to be of type {0}, but found {1}.", typeof(T), comparands.Subject?.GetType()); + + if (assertionChain.Succeeded) + { + assertion((T)comparands.Subject); + } + } +} diff --git a/Src/FluentAssertions/Equivalency/Inlining/ConditionBasedInlineAssertion.cs b/Src/FluentAssertions/Equivalency/Inlining/ConditionBasedInlineAssertion.cs new file mode 100644 index 0000000000..a6fdbfcde5 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Inlining/ConditionBasedInlineAssertion.cs @@ -0,0 +1,30 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; +using FluentAssertions.Execution; + +namespace FluentAssertions.Equivalency.Inlining; + +/// +/// Represents a condition-based inline equivalency assertion that evaluates a specified condition against a subject during object equivalency checks. +/// +/// The expected type of the subject being asserted. +[SuppressMessage("Usage", "CA2208:Instantiate argument exceptions correctly")] +internal class ConditionBasedInlineAssertion(Expression> condition) : IInlineEquivalencyAssertion +{ + /// + public void Execute(AssertionChain assertionChain, Comparands comparands) + { + if (condition is null) + { + throw new ArgumentNullException(nameof(condition), "A boolean condition is required"); + } + + assertionChain + .ForCondition(comparands.Subject is T) + .FailWith("Expected {context:subject} to be of type {0}, but found {1}.", typeof(T), comparands.Subject?.GetType()) + .Then + .ForCondition(condition.Compile()((T)comparands.Subject)) + .FailWith("Expected {context:subject} to meet condition {0}, but it did not.", condition); + } +} diff --git a/Src/FluentAssertions/Equivalency/Inlining/IInlineEquivalencyAssertion.cs b/Src/FluentAssertions/Equivalency/Inlining/IInlineEquivalencyAssertion.cs new file mode 100644 index 0000000000..03858b8ba3 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Inlining/IInlineEquivalencyAssertion.cs @@ -0,0 +1,22 @@ +using FluentAssertions.Execution; + +namespace FluentAssertions.Equivalency.Inlining; + +/// +/// Defines an interface for inline equivalency assertions, which are used to compare objects +/// during the equivalency validation process with specific conditions or custom logic. +/// +public interface IInlineEquivalencyAssertion +{ + /// + /// Executes the inline equivalency assertion process on the specified comparands + /// using a provided assertion chain. This method is utilized to perform a + /// customized comparison between objects during equivalency validation. + /// + /// An instance + /// used to track and assert conditions during the equivalency assertion process. + /// This enables the chaining of multiple assertions with contextual explanations. + /// A instance + /// that holds the pair of objects being compared, as well as their associated contextual metadata. + void Execute(AssertionChain assertionChain, Comparands comparands); +} diff --git a/Src/FluentAssertions/Equivalency/Inlining/InlineEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Inlining/InlineEquivalencyStep.cs new file mode 100644 index 0000000000..b4c5b62f97 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Inlining/InlineEquivalencyStep.cs @@ -0,0 +1,33 @@ +using FluentAssertions.Execution; + +namespace FluentAssertions.Equivalency.Inlining; + +/// +/// An implementation of that enables inline equivalency assertions. +/// +/// +/// This step checks if the `Expectation` in the provided +/// implements the interface. If so, it delegates +/// the equivalency comparison to the specified inline equivalency assertion logic. +/// Otherwise, it signals the equivalency process to continue with the next step in the chain. +/// This step allows users to define custom equivalency behaviors inline during assertion +/// execution. +/// +public class InlineEquivalencyStep : IEquivalencyStep +{ + /// + public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, + IValidateChildNodeEquivalency valueChildNodes) + { + if (comparands.Expectation is IInlineEquivalencyAssertion equivalencyAssertion) + { + var assertionChain = AssertionChain.GetOrCreate().For(context); + + equivalencyAssertion.Execute(assertionChain, comparands); + + return EquivalencyResult.EquivalencyProven; + } + + return EquivalencyResult.ContinueWithNext; + } +} diff --git a/Src/FluentAssertions/Value.cs b/Src/FluentAssertions/Value.cs new file mode 100644 index 0000000000..a9d61b128e --- /dev/null +++ b/Src/FluentAssertions/Value.cs @@ -0,0 +1,33 @@ +using System; +using System.Linq.Expressions; +using FluentAssertions.Equivalency.Inlining; + +namespace FluentAssertions; + +/// +/// Provides a fluent API for defining inline assertions. +/// +public static class Value +{ + /// + /// Builds an inline assertion that expects the subject-under-test to match the specified condition. + /// + /// The type of the subject-under-test. + /// A boolean condition to match. + public static IInlineEquivalencyAssertion ThatMatches(Expression> condition) + { + return new ConditionBasedInlineAssertion(condition); + } + + /// + /// Builds an inline assertion that executes the specific assertion operation on the subject-under-test. + /// + /// The type of the subject-under-test. + /// + /// The assertion operation to execute, typically using one of the assertion APIs Fluent Assertions provides. + /// + public static IInlineEquivalencyAssertion ThatSatisfies(Action assertion) + { + return new ActionBasedInlineAssertion(assertion); + } +} diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 55857f91e6..f17e073d0d 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -359,6 +359,11 @@ namespace FluentAssertions public static FluentAssertions.Types.TypeSelector Types(this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.TypeSelector Types(this System.Type type) { } } + public static class Value + { + public static FluentAssertions.Equivalency.Inlining.IInlineEquivalencyAssertion ThatMatches(System.Linq.Expressions.Expression> condition) { } + public static FluentAssertions.Equivalency.Inlining.IInlineEquivalencyAssertion ThatSatisfies(System.Action assertion) { } + } public static class XmlAssertionExtensions { public static FluentAssertions.Xml.XmlElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlElement actualValue) { } @@ -972,6 +977,18 @@ namespace FluentAssertions.Equivalency public static bool WhichSetterHas(this FluentAssertions.Equivalency.IMemberInfo memberInfo, FluentAssertions.Common.CSharpAccessModifier accessModifier) { } } } +namespace FluentAssertions.Equivalency.Inlining +{ + public interface IInlineEquivalencyAssertion + { + void Execute(FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Equivalency.Comparands comparands); + } + public class InlineEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep + { + public InlineEquivalencyStep() { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + } +} namespace FluentAssertions.Equivalency.Steps { public class AssertionRuleEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 1e08d9a6ee..f11ccf166d 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -372,6 +372,11 @@ namespace FluentAssertions public static FluentAssertions.Types.TypeSelector Types(this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.TypeSelector Types(this System.Type type) { } } + public static class Value + { + public static FluentAssertions.Equivalency.Inlining.IInlineEquivalencyAssertion ThatMatches(System.Linq.Expressions.Expression> condition) { } + public static FluentAssertions.Equivalency.Inlining.IInlineEquivalencyAssertion ThatSatisfies(System.Action assertion) { } + } public static class XmlAssertionExtensions { public static FluentAssertions.Xml.XmlElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlElement actualValue) { } @@ -985,6 +990,18 @@ namespace FluentAssertions.Equivalency public static bool WhichSetterHas(this FluentAssertions.Equivalency.IMemberInfo memberInfo, FluentAssertions.Common.CSharpAccessModifier accessModifier) { } } } +namespace FluentAssertions.Equivalency.Inlining +{ + public interface IInlineEquivalencyAssertion + { + void Execute(FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Equivalency.Comparands comparands); + } + public class InlineEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep + { + public InlineEquivalencyStep() { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + } +} namespace FluentAssertions.Equivalency.Steps { public class AssertionRuleEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index b7394b1037..1d04bb8cda 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -351,6 +351,11 @@ namespace FluentAssertions public static FluentAssertions.Types.TypeSelector Types(this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.TypeSelector Types(this System.Type type) { } } + public static class Value + { + public static FluentAssertions.Equivalency.Inlining.IInlineEquivalencyAssertion ThatMatches(System.Linq.Expressions.Expression> condition) { } + public static FluentAssertions.Equivalency.Inlining.IInlineEquivalencyAssertion ThatSatisfies(System.Action assertion) { } + } public static class XmlAssertionExtensions { public static FluentAssertions.Xml.XmlElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlElement actualValue) { } @@ -964,6 +969,18 @@ namespace FluentAssertions.Equivalency public static bool WhichSetterHas(this FluentAssertions.Equivalency.IMemberInfo memberInfo, FluentAssertions.Common.CSharpAccessModifier accessModifier) { } } } +namespace FluentAssertions.Equivalency.Inlining +{ + public interface IInlineEquivalencyAssertion + { + void Execute(FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Equivalency.Comparands comparands); + } + public class InlineEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep + { + public InlineEquivalencyStep() { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + } +} namespace FluentAssertions.Equivalency.Steps { public class AssertionRuleEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index f5cc40c438..4ad74779cf 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -359,6 +359,11 @@ namespace FluentAssertions public static FluentAssertions.Types.TypeSelector Types(this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.TypeSelector Types(this System.Type type) { } } + public static class Value + { + public static FluentAssertions.Equivalency.Inlining.IInlineEquivalencyAssertion ThatMatches(System.Linq.Expressions.Expression> condition) { } + public static FluentAssertions.Equivalency.Inlining.IInlineEquivalencyAssertion ThatSatisfies(System.Action assertion) { } + } public static class XmlAssertionExtensions { public static FluentAssertions.Xml.XmlElementAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Xml.XmlElement actualValue) { } @@ -972,6 +977,18 @@ namespace FluentAssertions.Equivalency public static bool WhichSetterHas(this FluentAssertions.Equivalency.IMemberInfo memberInfo, FluentAssertions.Common.CSharpAccessModifier accessModifier) { } } } +namespace FluentAssertions.Equivalency.Inlining +{ + public interface IInlineEquivalencyAssertion + { + void Execute(FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Equivalency.Comparands comparands); + } + public class InlineEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep + { + public InlineEquivalencyStep() { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + } +} namespace FluentAssertions.Equivalency.Steps { public class AssertionRuleEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep diff --git a/Tests/FluentAssertions.Equivalency.Specs/InlineAssertionsSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/InlineAssertionsSpecs.cs new file mode 100644 index 0000000000..39e906e7c8 --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/InlineAssertionsSpecs.cs @@ -0,0 +1,186 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Equivalency.Specs; + +public class InlineAssertionsSpecs +{ + [Fact] + public void The_inline_condition_must_be_met() + { + // Arrange + var actual = new + { + Name = "John", + Age = 30 + }; + + var expectation = new + { + Name = "John", + Age = Value.ThatMatches(age => age < 30) + }; + + // Act + var act = () => actual.Should().BeEquivalentTo(expectation); + + // Assert + act.Should().Throw().WithMessage("*actual.Age*meet condition*(age < 30)*"); + } + + [Fact] + public void The_type_of_the_condition_must_be_met_too() + { + // Arrange + var actual = new + { + Name = "John", + Age = 30 + }; + + var expectation = new + { + Name = "John", + Age = Value.ThatMatches(s => s.Length > 0) + }; + + // Act + var act = () => actual.Should().BeEquivalentTo(expectation); + + // Assert + act.Should().Throw().WithMessage("*actual.Age*type*String*found*Int32*"); + } + + [Fact] + public void Succeeds_for_a_matching_condition() + { + // Arrange + var actual = new + { + Name = "John", + Age = 30 + }; + + var expectation = new + { + Name = "John", + Age = Value.ThatMatches(age => age < 40) + }; + + // Act / Assert + actual.Should().BeEquivalentTo(expectation); + } + + [Fact] + public void A_condition_expression_is_required() + { + // Arrange + var actual = new + { + Name = "John", + Age = 30 + }; + + var expectation = new + { + Name = "John", + Age = Value.ThatMatches(null) + }; + + // Act + var act = () => actual.Should().BeEquivalentTo(expectation); + + // Assert + act.Should().Throw().WithMessage("*condition*required*"); + } + + [Fact] + public void The_inline_assertion_must_be_met() + { + // Arrange + var actual = new + { + Name = "John", + Age = 30 + }; + + var expectation = new + { + Name = "John", + Age = Value.ThatSatisfies(age => age.Should().BeLessThan(30)) + }; + + // Act + var act = () => actual.Should().BeEquivalentTo(expectation); + + // Assert + act.Should().Throw().WithMessage("*age to be less than 30*found 30*"); + } + + [Fact] + public void Succeeds_for_a_matching_assertion() + { + // Arrange + var actual = new + { + Name = "John", + Age = 30 + }; + + var expectation = new + { + Name = "John", + Age = Value.ThatSatisfies(age => age.Should().BeGreaterThan(20)) + }; + + // Act / Assert + actual.Should().BeEquivalentTo(expectation); + } + + [Fact] + public void An_assertion_action_is_required() + { + // Arrange + var actual = new + { + Name = "John", + Age = 30 + }; + + var expectation = new + { + Name = "John", + Age = Value.ThatSatisfies(null) + }; + + // Act + var act = () => actual.Should().BeEquivalentTo(expectation); + + // Assert + act.Should().Throw().WithMessage("*assertion*required*"); + } + + [Fact] + public void The_type_expected_by_the_assertion_must_be_met_too() + { + // Arrange + var actual = new + { + Name = "John", + Age = 30 + }; + + var expectation = new + { + Name = "John", + Age = Value.ThatSatisfies(s => s.Should().BeNullOrEmpty()) + }; + + // Act + var act = () => actual.Should().BeEquivalentTo(expectation); + + // Assert + act.Should().Throw().WithMessage("*actual.Age*type*String*found*Int32*"); + } +} diff --git a/docs/_pages/objectgraphs.md b/docs/_pages/objectgraphs.md index 08622eaeab..3e093882a2 100644 --- a/docs/_pages/objectgraphs.md +++ b/docs/_pages/objectgraphs.md @@ -314,7 +314,7 @@ derived.Should().BeEquivalentTo(original, options => options .ExcludingNonBrowsableMembers()); ``` -### Equivalency Comparison Behavior +### Custom assertions In addition to influencing the members that are including in the comparison, you can also override the actual assertion operation that is executed on a particular member. @@ -332,6 +332,34 @@ orderDto.Should().BeEquivalentTo(order, options => options .WhenTypeIs()); ``` +### Inline assertions + +The `Using`/`When` construct is one way to customize the assertion logic, but often does not feel very "fluent". Instead, `Value.ThatMatches` and `Value.ThatSatisfies` provides a much more flexible syntax for inline assertions. Considering the following subject: + +```csharp +var actual = new +{ + Name = "John", + Age = 30 +}; +``` + +To ensure that `Age` is less than 40, you can use either one of the following constructs. + +```csharp +actual.Should().BeEquivalentTo(new +{ + Name = "John", + Age = Value.ThatMatches(age => age < 40) +}); + +actual.Should().BeEquivalentTo(new +{ + Name = "John", + Age = Value.ThatSatisfies(age => age.Should().BeLessThan(40)) +}); +``` + ### Enums By default, `Should().BeEquivalentTo()` compares `Enum` members by the enum's underlying numeric value. diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 5f1565fb92..c63a9fc211 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,6 +7,12 @@ sidebar: nav: "sidebar" --- +## 8.6.0 + +## What's new + +* Add `Value.ThatMatches` and `Value.ThatSatifies` to build inline assertions when using `BeEquivalentTo` - [#3076](https://github.com/fluentassertions/fluentassertions/pull/3076) + ## 8.5.0 ## What's new From 460105077eecfbf7ea4dcc784ba6e8d5a6c8400b Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 17:48:07 +0200 Subject: [PATCH 659/845] Remove dependencies on Bogus It's a great library, but we no longer need it. UsersOfGetClosedGenericInterfaces was added based on a lengthly discussion in https://github.com/fluentassertions/fluentassertions/pull/1419#discussion_r549160033 https://github.com/fluentassertions/fluentassertions/pull/1419#discussion_r550897010 LargeDataTableEquivalencyBenchmarks was moved to `fluentassertions.datasets` --- Tests/Benchmarks/Benchmarks.csproj | 1 - .../UsersOfGetClosedGenericInterfaces.cs | 179 ------------------ .../Exceptions/OuterExceptionSpecs.cs | 5 +- .../FluentAssertions.Specs.csproj | 1 - 4 files changed, 2 insertions(+), 184 deletions(-) delete mode 100644 Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index c3908f41e9..0846be0c90 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -10,7 +10,6 @@ - diff --git a/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs b/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs deleted file mode 100644 index 33762a05cb..0000000000 --- a/Tests/Benchmarks/UsersOfGetClosedGenericInterfaces.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Engines; -using Bogus; -using FluentAssertions.Equivalency; -using FluentAssertions.Equivalency.Steps; -using FluentAssertions.Equivalency.Tracing; -using FluentAssertions.Equivalency.Typing; -using FluentAssertions.Execution; - -namespace Benchmarks; - -[SimpleJob(RunStrategy.Throughput, warmupCount: 3, iterationCount: 20)] -public class UsersOfGetClosedGenericInterfaces -{ - private const int ValueCount = 100_000; - - private object[] values; - - private GenericDictionaryEquivalencyStep dictionaryStep; - private GenericEnumerableEquivalencyStep enumerableStep; - - private IEquivalencyValidationContext context; - - private class Context : IEquivalencyValidationContext - { - public INode CurrentNode { get; } - public Reason Reason { get; } - public Tracer Tracer { get; } - public IEquivalencyOptions Options { get; internal set; } - public bool IsCyclicReference(object expectation) => throw new NotImplementedException(); - - public IEquivalencyValidationContext AsNestedMember(IMember expectationMember) => throw new NotImplementedException(); - - public IEquivalencyValidationContext AsCollectionItem(string index) => throw new NotImplementedException(); - - public IEquivalencyValidationContext AsDictionaryItem(TKey key) => - throw new NotImplementedException(); - - public IEquivalencyValidationContext Clone() => throw new NotImplementedException(); - } - - private class Config : IEquivalencyOptions - { - public IEnumerable SelectionRules => throw new NotImplementedException(); - - public IEnumerable MatchingRules => throw new NotImplementedException(); - - /// - public IEnumerable TypingRules => throw new NotImplementedException(); - - public bool IsRecursive => throw new NotImplementedException(); - - public bool AllowInfiniteRecursion => throw new NotImplementedException(); - - public CyclicReferenceHandling CyclicReferenceHandling => throw new NotImplementedException(); - - public OrderingRuleCollection OrderingRules => throw new NotImplementedException(); - - public ConversionSelector ConversionSelector => throw new NotImplementedException(); - - public EnumEquivalencyHandling EnumEquivalencyHandling => throw new NotImplementedException(); - - public IEnumerable UserEquivalencySteps => throw new NotImplementedException(); - - public bool UseRuntimeTyping => false; - - public MemberVisibility IncludedProperties => throw new NotImplementedException(); - - public MemberVisibility IncludedFields => throw new NotImplementedException(); - - public bool IgnoreNonBrowsableOnSubject => throw new NotImplementedException(); - - public bool ExcludeNonBrowsableOnExpectation => throw new NotImplementedException(); - - public bool? CompareRecordsByValue => throw new NotImplementedException(); - - public ITraceWriter TraceWriter => throw new NotImplementedException(); - - public EqualityStrategy GetEqualityStrategy(Type type) => throw new NotImplementedException(); - - public bool IgnoreLeadingWhitespace => throw new NotImplementedException(); - - public bool IgnoreTrailingWhitespace => throw new NotImplementedException(); - - public bool IgnoreCase => throw new NotImplementedException(); - - public bool IgnoreNewlineStyle => throw new NotImplementedException(); - } - - [Params(typeof(DBNull), typeof(bool), typeof(char), typeof(sbyte), typeof(byte), typeof(short), typeof(ushort), - typeof(int), typeof(long), typeof(ulong), typeof(float), typeof(double), typeof(decimal), typeof(DateTime), - typeof(string), typeof(TimeSpan), typeof(Guid), typeof(Dictionary), typeof(IEnumerable))] - public Type DataType { get; set; } - - [GlobalSetup] - [SuppressMessage("Style", "IDE0055:Fix formatting", Justification = "Big long list of one-liners")] - public void GlobalSetup() - { - dictionaryStep = new GenericDictionaryEquivalencyStep(); - enumerableStep = new GenericEnumerableEquivalencyStep(); - - var faker = new Faker - { - Random = new Randomizer(localSeed: 1) - }; - - values = Enumerable.Range(0, ValueCount).Select(_ => CreateValue(faker)).ToArray(); - - context = new Context - { - Options = new Config() - }; - } - - private object CreateValue(Faker faker) => Type.GetTypeCode(DataType) switch - { - TypeCode.DBNull => DBNull.Value, - TypeCode.Boolean => faker.Random.Bool(), - TypeCode.Char => faker.Lorem.Letter().Single(), - TypeCode.SByte => faker.Random.SByte(), - TypeCode.Byte => faker.Random.Byte(), - TypeCode.Int16 => faker.Random.Short(), - TypeCode.UInt16 => faker.Random.UShort(), - TypeCode.Int32 => faker.Random.Int(), - TypeCode.UInt32 => faker.Random.UInt(), - TypeCode.Int64 => faker.Random.Long(), - TypeCode.UInt64 => faker.Random.ULong(), - TypeCode.Single => faker.Random.Float(), - TypeCode.Double => faker.Random.Double(), - TypeCode.Decimal => faker.Random.Decimal(), - TypeCode.DateTime => faker.Date.Between(DateTime.UtcNow.AddDays(-30), DateTime.UtcNow.AddDays(+30)), - TypeCode.String => faker.Lorem.Lines(1), - _ => CustomValue(faker), - }; - - private object CustomValue(Faker faker) - { - if (DataType == typeof(TimeSpan)) - { - return faker.Date.Future() - faker.Date.Future(); - } - else if (DataType == typeof(Guid)) - { - return faker.Random.Guid(); - } - else if (DataType == typeof(Dictionary)) - { - return new Dictionary { { faker.Random.Int(), faker.Random.Int() } }; - } - else if (DataType == typeof(IEnumerable)) - { - return new[] { faker.Random.Int(), faker.Random.Int() }; - } - - throw new Exception("Unable to populate data of type " + DataType); - } - - [Benchmark] - public void GenericDictionaryEquivalencyStep_CanHandle() - { - for (int i = 0; i < values.Length; i++) - { - dictionaryStep.Handle(new Comparands(values[i], values[0], typeof(object)), context, null); - } - } - - [Benchmark] - public void GenericEnumerableEquivalencyStep_CanHandle() - { - for (int i = 0; i < values.Length; i++) - { - enumerableStep.Handle(new Comparands(values[i], values[0], typeof(object)), context, null); - } - } -} diff --git a/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs index 09af399d21..d8922be2f0 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs @@ -1,6 +1,5 @@ using System; using System.Diagnostics.CodeAnalysis; -using Bogus; using Xunit; using Xunit.Sdk; @@ -54,7 +53,7 @@ public void Long_exception_messages_are_rendered_over_multiple_lines() testSubject .Invoking(x => x.Do()) .Should().Throw() - .WithMessage(new Faker().Random.String2(101)); + .WithMessage(new string('#', 101)); throw new XunitException("This point should not be reached"); } @@ -128,7 +127,7 @@ public void Short_exception_messages_are_rendered_on_a_single_line() testSubject .Invoking(x => x.Do()) .Should().Throw() - .WithMessage(new Faker().Random.String2(50)); + .WithMessage(new string('#', 50)); throw new XunitException("This point should not be reached"); } diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index f67a676849..11621b6458 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -25,7 +25,6 @@ - From 3abd7dfb5afc00d1f1e8f75be0f22c1255ff6f29 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 17:57:23 +0200 Subject: [PATCH 660/845] Meziantou.Analyzer 2.0.203 -> 2.0.212 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 106b8b8cbb..9a26ede2b3 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From a38d0e4b7db86b50520529c0125fc347efc26fa8 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 17:58:40 +0200 Subject: [PATCH 661/845] Roslynator.Analyzers 4.13.1 -> 4.14.0 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 9a26ede2b3..320a81a190 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From ec4ba0ff85d469d194bd717cd517fe7681ce0555 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 18:00:30 +0200 Subject: [PATCH 662/845] Verify.Xunit 30.4.0 -> 30.6.1 --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index dc71966bfb..93ba8d3088 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 43e95d49fa14594f00b467f344928cf08a6fc711 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 18:02:34 +0200 Subject: [PATCH 663/845] xunit.runner.visualstudio 3.1.1 -> 3.1.3 --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 93ba8d3088..aeee8cead6 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -7,7 +7,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj index 9653a90fcf..949742d997 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -10,6 +10,6 @@ - + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index 074b8a07ae..f8766dc998 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -10,6 +10,6 @@ - + From eafe2287b907087acf394f2199d96bdfe30f0820 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 18:04:48 +0200 Subject: [PATCH 664/845] TUnit 0.25.21 -> 0.53.0 --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 45fd4ab73e..868f052145 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -11,7 +11,7 @@ - + From 458781f1388313ce2952278c05634428d534d454 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 18:09:20 +0200 Subject: [PATCH 665/845] MSTest 3.9.3 -> 3.10.1 --- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 4 ++-- Tests/UWP.Specs/UWP.Specs.csproj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 6413c5f75d..9cb7084350 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/Tests/UWP.Specs/UWP.Specs.csproj b/Tests/UWP.Specs/UWP.Specs.csproj index bacf21fc14..6098410f45 100644 --- a/Tests/UWP.Specs/UWP.Specs.csproj +++ b/Tests/UWP.Specs/UWP.Specs.csproj @@ -88,10 +88,10 @@ 6.2.14 - 3.9.3 + 3.10.1 - 3.9.3 + 3.10.1 4.7.0 From a84ba2507f9380c2245290b5923d8a336dd20780 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 18:10:22 +0200 Subject: [PATCH 666/845] Microsoft.Testing.Extensions.CodeCoverage 17.14.1 -> 17.14.2 --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 868f052145..f574588dbe 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -13,7 +13,7 @@ - + From b15977be69d8a1d1e8429b79cee0f3d058c9345c Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 18:11:03 +0200 Subject: [PATCH 667/845] Microsoft.Testing.Extensions.TrxReport 1.5.3 -> 1.8.1 --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index f574588dbe..526a18a6b2 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -12,7 +12,7 @@ - + From c52bff3225c2eb8c103b763541d873c325904c09 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 18:12:26 +0200 Subject: [PATCH 668/845] ReportGenerator 5.4.8 -> 5.4.12 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 0be94f0822..9fa49f3e3b 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -11,7 +11,7 @@ - + From 9aa56700973906cfc57d39cd98ac7253902873d9 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 18:13:07 +0200 Subject: [PATCH 669/845] PackageGuard 1.4.1 -> 1.5.0 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 9fa49f3e3b..31d8d810a2 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -13,7 +13,7 @@ - + From dac5c1fa25eada665296a862bca95b94cb0cd4e5 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 18:14:25 +0200 Subject: [PATCH 670/845] xunit.v3 2.0.3 -> 3.0.0 --- Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj index 949742d997..30e33cab53 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -9,7 +9,7 @@ - + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index f8766dc998..9381d9f200 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -9,7 +9,7 @@ - + From e8a40fb9a5b1c92574c424272ed11ef636830028 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 15:06:38 +0200 Subject: [PATCH 671/845] Handle ThatMatches wrapped in AssertionScope --- .../Inlining/ConditionBasedInlineAssertion.cs | 3 ++- .../InlineAssertionsSpecs.cs | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Inlining/ConditionBasedInlineAssertion.cs b/Src/FluentAssertions/Equivalency/Inlining/ConditionBasedInlineAssertion.cs index a6fdbfcde5..ee66634bdc 100644 --- a/Src/FluentAssertions/Equivalency/Inlining/ConditionBasedInlineAssertion.cs +++ b/Src/FluentAssertions/Equivalency/Inlining/ConditionBasedInlineAssertion.cs @@ -24,7 +24,8 @@ public void Execute(AssertionChain assertionChain, Comparands comparands) .ForCondition(comparands.Subject is T) .FailWith("Expected {context:subject} to be of type {0}, but found {1}.", typeof(T), comparands.Subject?.GetType()) .Then - .ForCondition(condition.Compile()((T)comparands.Subject)) + .Given(() => (T)comparands.Subject) + .ForCondition(subject => condition.Compile()(subject)) .FailWith("Expected {context:subject} to meet condition {0}, but it did not.", condition); } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/InlineAssertionsSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/InlineAssertionsSpecs.cs index 39e906e7c8..d360eee369 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/InlineAssertionsSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/InlineAssertionsSpecs.cs @@ -46,7 +46,11 @@ public void The_type_of_the_condition_must_be_met_too() }; // Act - var act = () => actual.Should().BeEquivalentTo(expectation); + var act = () => + { + using var _ = new AssertionScope(); + actual.Should().BeEquivalentTo(expectation); + }; // Assert act.Should().Throw().WithMessage("*actual.Age*type*String*found*Int32*"); @@ -178,7 +182,11 @@ public void The_type_expected_by_the_assertion_must_be_met_too() }; // Act - var act = () => actual.Should().BeEquivalentTo(expectation); + var act = () => + { + using var _ = new AssertionScope(); + actual.Should().BeEquivalentTo(expectation); + }; // Assert act.Should().Throw().WithMessage("*actual.Age*type*String*found*Int32*"); From 059085bf5822803c2b529a6d5f86d82d30394154 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 15:08:56 +0200 Subject: [PATCH 672/845] null check delegates in static factory methods --- .../Inlining/ActionBasedInlineAssertion.cs | 7 ---- .../Inlining/ConditionBasedInlineAssertion.cs | 7 ---- Src/FluentAssertions/Value.cs | 3 ++ .../InlineAssertionsSpecs.cs | 35 +++++++++++-------- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Inlining/ActionBasedInlineAssertion.cs b/Src/FluentAssertions/Equivalency/Inlining/ActionBasedInlineAssertion.cs index 70a3130999..d314e64b53 100644 --- a/Src/FluentAssertions/Equivalency/Inlining/ActionBasedInlineAssertion.cs +++ b/Src/FluentAssertions/Equivalency/Inlining/ActionBasedInlineAssertion.cs @@ -1,5 +1,4 @@ using System; -using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Inlining; @@ -10,17 +9,11 @@ namespace FluentAssertions.Equivalency.Inlining; /// of the assertion APIs provided by Fluent Assertions. /// /// The expected type of the subject to which the assertion is applied. -[SuppressMessage("Usage", "CA2208:Instantiate argument exceptions correctly")] internal class ActionBasedInlineAssertion(Action assertion) : IInlineEquivalencyAssertion { /// public void Execute(AssertionChain assertionChain, Comparands comparands) { - if (assertion is null) - { - throw new ArgumentNullException(nameof(assertion), "An assertion clause is required"); - } - assertionChain .ForCondition(comparands.Subject is T) .FailWith("Expected {context:subject} to be of type {0}, but found {1}.", typeof(T), comparands.Subject?.GetType()); diff --git a/Src/FluentAssertions/Equivalency/Inlining/ConditionBasedInlineAssertion.cs b/Src/FluentAssertions/Equivalency/Inlining/ConditionBasedInlineAssertion.cs index ee66634bdc..eef612dbbd 100644 --- a/Src/FluentAssertions/Equivalency/Inlining/ConditionBasedInlineAssertion.cs +++ b/Src/FluentAssertions/Equivalency/Inlining/ConditionBasedInlineAssertion.cs @@ -1,5 +1,4 @@ using System; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using FluentAssertions.Execution; @@ -9,17 +8,11 @@ namespace FluentAssertions.Equivalency.Inlining; /// Represents a condition-based inline equivalency assertion that evaluates a specified condition against a subject during object equivalency checks. /// /// The expected type of the subject being asserted. -[SuppressMessage("Usage", "CA2208:Instantiate argument exceptions correctly")] internal class ConditionBasedInlineAssertion(Expression> condition) : IInlineEquivalencyAssertion { /// public void Execute(AssertionChain assertionChain, Comparands comparands) { - if (condition is null) - { - throw new ArgumentNullException(nameof(condition), "A boolean condition is required"); - } - assertionChain .ForCondition(comparands.Subject is T) .FailWith("Expected {context:subject} to be of type {0}, but found {1}.", typeof(T), comparands.Subject?.GetType()) diff --git a/Src/FluentAssertions/Value.cs b/Src/FluentAssertions/Value.cs index a9d61b128e..c5071cb0b6 100644 --- a/Src/FluentAssertions/Value.cs +++ b/Src/FluentAssertions/Value.cs @@ -1,5 +1,6 @@ using System; using System.Linq.Expressions; +using FluentAssertions.Common; using FluentAssertions.Equivalency.Inlining; namespace FluentAssertions; @@ -16,6 +17,7 @@ public static class Value /// A boolean condition to match. public static IInlineEquivalencyAssertion ThatMatches(Expression> condition) { + Guard.ThrowIfArgumentIsNull(condition); return new ConditionBasedInlineAssertion(condition); } @@ -28,6 +30,7 @@ public static IInlineEquivalencyAssertion ThatMatches(Expression public static IInlineEquivalencyAssertion ThatSatisfies(Action assertion) { + Guard.ThrowIfArgumentIsNull(assertion); return new ActionBasedInlineAssertion(assertion); } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/InlineAssertionsSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/InlineAssertionsSpecs.cs index d360eee369..31148ce28b 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/InlineAssertionsSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/InlineAssertionsSpecs.cs @@ -1,4 +1,5 @@ using System; +using FluentAssertions.Execution; using Xunit; using Xunit.Sdk; @@ -86,17 +87,20 @@ public void A_condition_expression_is_required() Age = 30 }; - var expectation = new + // Act + var act = () => { - Name = "John", - Age = Value.ThatMatches(null) - }; + var expectation = new + { + Name = "John", + Age = Value.ThatMatches(null) + }; - // Act - var act = () => actual.Should().BeEquivalentTo(expectation); + actual.Should().BeEquivalentTo(expectation); + }; // Assert - act.Should().Throw().WithMessage("*condition*required*"); + act.Should().Throw().WithParameterName("condition"); } [Fact] @@ -152,17 +156,20 @@ public void An_assertion_action_is_required() Age = 30 }; - var expectation = new + // Act + var act = () => { - Name = "John", - Age = Value.ThatSatisfies(null) - }; + var expectation = new + { + Name = "John", + Age = Value.ThatSatisfies(null) + }; - // Act - var act = () => actual.Should().BeEquivalentTo(expectation); + actual.Should().BeEquivalentTo(expectation); + }; // Assert - act.Should().Throw().WithMessage("*assertion*required*"); + act.Should().Throw().WithParameterName("assertion"); } [Fact] From 734affab661f9de5b52033be9b645a22cf5a752a Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 14:15:31 +0200 Subject: [PATCH 673/845] Uppercase Boolean https://english.stackexchange.com/questions/4481/should-the-word-boolean-be-capitalized --- .../Formatting/PredicateLambdaExpressionValueFormatter.cs | 2 +- .../Primitives/NullableBooleanAssertions.cs | 8 ++++---- Src/FluentAssertions/Value.cs | 2 +- docs/_pages/booleans.md | 2 +- docs/_pages/releases.md | 4 ++-- docs/_pages/upgradingtov6.md | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs b/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs index ecd921b3b4..c071948942 100644 --- a/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs @@ -7,7 +7,7 @@ namespace FluentAssertions.Formatting; /// /// The is responsible for formatting -/// boolean lambda expressions. +/// Boolean lambda expressions. /// public class PredicateLambdaExpressionValueFormatter : IValueFormatter { diff --git a/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs b/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs index de72180353..c20c11af84 100644 --- a/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs @@ -34,7 +34,7 @@ public NullableBooleanAssertions(bool? value, AssertionChain assertionChain) } /// - /// Asserts that a nullable boolean value is not . + /// Asserts that a nullable Boolean value is not . /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -54,7 +54,7 @@ public AndConstraint HaveValue([StringSyntax("CompositeFormat")] st } /// - /// Asserts that a nullable boolean value is not . + /// Asserts that a nullable Boolean value is not . /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -69,7 +69,7 @@ public AndConstraint NotBeNull([StringSyntax("CompositeFormat")] st } /// - /// Asserts that a nullable boolean value is . + /// Asserts that a nullable Boolean value is . /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -89,7 +89,7 @@ public AndConstraint NotHaveValue([StringSyntax("CompositeFormat")] } /// - /// Asserts that a nullable boolean value is . + /// Asserts that a nullable Boolean value is . /// /// /// A formatted phrase as is supported by explaining why the assertion diff --git a/Src/FluentAssertions/Value.cs b/Src/FluentAssertions/Value.cs index c5071cb0b6..a07827ceff 100644 --- a/Src/FluentAssertions/Value.cs +++ b/Src/FluentAssertions/Value.cs @@ -14,7 +14,7 @@ public static class Value /// Builds an inline assertion that expects the subject-under-test to match the specified condition. /// /// The type of the subject-under-test. - /// A boolean condition to match. + /// A Boolean condition to match. public static IInlineEquivalencyAssertion ThatMatches(Expression> condition) { Guard.ThrowIfArgumentIsNull(condition); diff --git a/docs/_pages/booleans.md b/docs/_pages/booleans.md index 9adff0f6ae..165dd761f5 100644 --- a/docs/_pages/booleans.md +++ b/docs/_pages/booleans.md @@ -17,7 +17,7 @@ theBoolean.Should().Be(otherBoolean); theBoolean.Should().NotBe(false); ``` -Obviously the above assertions also work for nullable booleans, but if you really want to be make sure a boolean is either `true` or `false` and not `null`, you can use these methods. +Obviously the above assertions also work for nullable Booleans, but if you really want to be make sure a Boolean is either `true` or `false` and not `null`, you can use these methods. ```csharp theBoolean.Should().NotBeFalse(); diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index c63a9fc211..88a8510ae6 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -320,7 +320,7 @@ Version 7 will remain fully open-source indefinitely and receive bugfixes and ot * Annotated `[Not]MatchRegex(string)` with `[StringSyntax("Regex")]` which IDEs can use to colorize the regular expression argument - [#1816](https://github.com/fluentassertions/fluentassertions/pull/1816) * Added support for .NET6 `DateOnly` struct - [#1844](https://github.com/fluentassertions/fluentassertions/pull/1844) * Added support for .NET6 `TimeOnly` struct - [#1848](https://github.com/fluentassertions/fluentassertions/pull/1848) -* Added `NotBe` for nullable boolean values - [#1865](https://github.com/fluentassertions/fluentassertions/pull/1865) +* Added `NotBe` for nullable Boolean values - [#1865](https://github.com/fluentassertions/fluentassertions/pull/1865) * Added a new overload to `MatchRegex()` to assert on the number of regex matches - [#1869](https://github.com/fluentassertions/fluentassertions/pull/1869) * Added difference to numeric assertion failure messages - [#1859](https://github.com/fluentassertions/fluentassertions/pull/1859) @@ -418,7 +418,7 @@ Version 7 will remain fully open-source indefinitely and receive bugfixes and ot * Added `NotBeWritable` to `PropertyInfoSelectorAssertions` to be able to assert that properties are not writable - [#1269](https://github.com/fluentassertions/fluentassertions/pull/1269). * Added extension to assert `TaskCompletionSource` - [#1267](https://github.com/fluentassertions/fluentassertions/pull/1267). * Added the ability to pass an `IEqualityComparer` through `BeEquivalentTo(x => x.Using())` - [#1284](https://github.com/fluentassertions/fluentassertions/pull/1284). -* Added `NotBe` to `BooleanAssertions` to be able to assert that a boolean is not the expected value - [#1290](https://github.com/fluentassertions/fluentassertions/pull/1290). +* Added `NotBe` to `BooleanAssertions` to be able to assert that a Boolean is not the expected value - [#1290](https://github.com/fluentassertions/fluentassertions/pull/1290). * Make `DefaultValueFormatter` and `EnumerableValueFormatter` suitable for inheritance - [#1295](https://github.com/fluentassertions/fluentassertions/pull/1295). * Added support for dictionary assertions on `IReadOnlyDictionary` - [#1298](https://github.com/fluentassertions/fluentassertions/pull/1298). * `GenericAsyncFunctionAssertions` now has `AndWhichConstraint` overloads for `NotThrow[Async]` and `NotThrowAfter[Async]` - [#1289](https://github.com/fluentassertions/fluentassertions/pull/1289). diff --git a/docs/_pages/upgradingtov6.md b/docs/_pages/upgradingtov6.md index a99409b082..d3edd9593f 100644 --- a/docs/_pages/upgradingtov6.md +++ b/docs/_pages/upgradingtov6.md @@ -71,7 +71,7 @@ Previously, formatting an enum would simply be a call to `ToString()`, but to pr ## IEquivalencyStep -In v6, we applied some major refactoring to the equivalency validator, of which most of it is internal and therefore won't be visible to consumers of the library. But one thing that does, is that we split off the subject and expectation from the `IEquivalencyValidationContext` and move them into their own type called `Comparands`. Since this affected the `IEquivalencyStep` and we already had some ideas to simplify that abstraction, we removed the `CanHandle` method and replaced the boolean return value of `Handle` with a more self-describing `EquivalencyResult`. The consequence of this is that `Handle` must first check whether the comparands are applicable to the step and bail out with `EquivalencyResult.ContinueWithNext` if that isn't the case. There's a convenience base-class called `EquivalencyStep` that remove some of that burden for you. Check out `DictionaryEquivalencyStep` for an example of that. Also, the [extensibility section](extensibility/#equivalency-assertion-step-by-step) has been updated to reflect the new signatures and types. +In v6, we applied some major refactoring to the equivalency validator, of which most of it is internal and therefore won't be visible to consumers of the library. But one thing that does, is that we split off the subject and expectation from the `IEquivalencyValidationContext` and move them into their own type called `Comparands`. Since this affected the `IEquivalencyStep` and we already had some ideas to simplify that abstraction, we removed the `CanHandle` method and replaced the Boolean return value of `Handle` with a more self-describing `EquivalencyResult`. The consequence of this is that `Handle` must first check whether the comparands are applicable to the step and bail out with `EquivalencyResult.ContinueWithNext` if that isn't the case. There's a convenience base-class called `EquivalencyStep` that remove some of that burden for you. Check out `DictionaryEquivalencyStep` for an example of that. Also, the [extensibility section](extensibility/#equivalency-assertion-step-by-step) has been updated to reflect the new signatures and types. ## Using From db1e2bf1d4c1f95f643f6f74403d64f1945c1c15 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 14:18:04 +0200 Subject: [PATCH 674/845] Fix indentation in release notes --- docs/_pages/releases.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 88a8510ae6..5830970729 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -9,47 +9,47 @@ sidebar: ## 8.6.0 -## What's new +### What's new * Add `Value.ThatMatches` and `Value.ThatSatifies` to build inline assertions when using `BeEquivalentTo` - [#3076](https://github.com/fluentassertions/fluentassertions/pull/3076) ## 8.5.0 -## What's new +### What's new * Add `WithStrictTyping` and `WithStrictTypingFor` to `BeEquivalentTo` to ensure types also match - [#3066](https://github.com/fluentassertions/fluentassertions/pull/3066) -## Fixes +### Fixes * Ensured `WithTracing` is safe when used with `BeEquivalentTo` globally - [#3067](https://github.com/fluentassertions/fluentassertions/pull/3067) ## 8.4.0 -## Enhancements +### Enhancements * Added `ExcludingMembersNamed` to `BeEquivalentTo` to exclude fields and properties anywhere in the graph - [#3062](https://github.com/fluentassertions/fluentassertions/pull/3062) * Added `Should().Throw()`, `ThrowAsync()` and `ThrowWithinAsync()` flavors that don’t require a specific exception type - [#3059](https://github.com/fluentassertions/fluentassertions/pull/3059) ## 8.3.0 -## Enhancements +### Enhancements * Clarify the date/time type when comparing non-compatible dates and times in `BeEquivalentTo` - [#3049](https://github.com/fluentassertions/fluentassertions/pull/3049) * Improve the rendering of exception messages when using `WithMessage` for better readability - [#3039](https://github.com/fluentassertions/fluentassertions/pull/3039) ## 8.2.0 -## Fixes +### Fixes * Fixed a regression from 8.1.0 where a `NullReferenceException` was thrown during subject identification - [#3036](https://github.com/fluentassertions/fluentassertions/pull/3036) -## Enhancements +### Enhancements * Better support for rendering multi-dimensional arrays in failure messages - [#3009](https://github.com/fluentassertions/fluentassertions/pull/3009) ## 8.1.1 -## Fixes +### Fixes * Fix a formatting exception when {} is used as a dictionary key - [#3008](https://github.com/fluentassertions/fluentassertions/pull/3008) * Removed the PowerShell script that opens the website because it misbehaves - [#3030](https://github.com/fluentassertions/fluentassertions/pull/3030) @@ -61,7 +61,7 @@ sidebar: * All `Should()` methods on reference types are now annotated with the `[NotNull]` attribute for a better Fluent Assertions experience when nullable reference types are enabled - [#2987](https://github.com/fluentassertions/fluentassertions/pull/2987) * Provide a toggle to suppress the soft warning that commercial use requires a paid license - [#2984](https://github.com/fluentassertions/fluentassertions/pull/2984) -## Fixes +### Fixes * Fixed a regression in which `CompleteWithinAsync` treated a canceled task as an exception - [#2853](https://github.com/fluentassertions/fluentassertions/pull/2853) From 3c1a442c4845a73a89a6b084f92db7edfa3e9ca4 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 9 Aug 2025 14:34:12 +0200 Subject: [PATCH 675/845] Fix typo in comment --- .../Equivalency/Steps/AssertionRuleEquivalencyStep.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs index 5911ff619d..cb6d2fcc03 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs @@ -89,7 +89,7 @@ private bool ExecuteAssertion(Comparands comparands, IEquivalencyValidationConte return false; } - // Caller identitification should not get confused about invoking a Should within the assertion action + // Caller identification should not get confused about invoking a Should within the assertion action string callerIdentifier = context.CurrentNode.Subject.ToString(); assertionChain.OverrideCallerIdentifier(() => callerIdentifier); assertionChain.ReuseOnce(); From 6f4d2245024329fc98ff9ede4450cbdcc93b51cf Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Thu, 14 Aug 2025 13:44:07 +0200 Subject: [PATCH 676/845] Address a bunch of Qodana issues --- Tests/FluentAssertions.Equivalency.Specs/TestTypes.cs | 1 + .../CultureAwareTesting/CulturedFactAttribute.cs | 1 + .../CultureAwareTesting/CulturedTheoryAttribute.cs | 1 + Tests/FluentAssertions.Specs/Types/MethodInfoAssertionSpecs.cs | 1 + .../Types/TypeAssertionSpecs.HaveDefaultConstructor.cs | 1 + Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.cs | 1 + 6 files changed, 6 insertions(+) diff --git a/Tests/FluentAssertions.Equivalency.Specs/TestTypes.cs b/Tests/FluentAssertions.Equivalency.Specs/TestTypes.cs index 06034c13f8..2b42827e78 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/TestTypes.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/TestTypes.cs @@ -171,6 +171,7 @@ internal class ClassWithCctorAndNonDefaultConstructor // ReSharper disable once EmptyConstructor static ClassWithCctorAndNonDefaultConstructor() { } + // ReSharper disable once UnusedParameter.Local public ClassWithCctorAndNonDefaultConstructor(int _) { } } diff --git a/Tests/FluentAssertions.Specs/CultureAwareTesting/CulturedFactAttribute.cs b/Tests/FluentAssertions.Specs/CultureAwareTesting/CulturedFactAttribute.cs index c9a63b63db..6a4f16789e 100644 --- a/Tests/FluentAssertions.Specs/CultureAwareTesting/CulturedFactAttribute.cs +++ b/Tests/FluentAssertions.Specs/CultureAwareTesting/CulturedFactAttribute.cs @@ -7,6 +7,7 @@ namespace FluentAssertions.Specs.CultureAwareTesting; public sealed class CulturedFactAttribute : FactAttribute { #pragma warning disable CA1019 // Define accessors for attribute arguments + // ReSharper disable once UnusedParameter.Local public CulturedFactAttribute(params string[] _) { } #pragma warning restore CA1019 // Define accessors for attribute arguments } diff --git a/Tests/FluentAssertions.Specs/CultureAwareTesting/CulturedTheoryAttribute.cs b/Tests/FluentAssertions.Specs/CultureAwareTesting/CulturedTheoryAttribute.cs index 5620288f72..ea5f0c1ea5 100644 --- a/Tests/FluentAssertions.Specs/CultureAwareTesting/CulturedTheoryAttribute.cs +++ b/Tests/FluentAssertions.Specs/CultureAwareTesting/CulturedTheoryAttribute.cs @@ -8,6 +8,7 @@ namespace FluentAssertions.Specs.CultureAwareTesting; public sealed class CulturedTheoryAttribute : TheoryAttribute { #pragma warning disable CA1019 // Define accessors for attribute arguments + // ReSharper disable once UnusedParameter.Local public CulturedTheoryAttribute(params string[] _) { } #pragma warning restore CA1019 // Define accessors for attribute arguments } diff --git a/Tests/FluentAssertions.Specs/Types/MethodInfoAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Types/MethodInfoAssertionSpecs.cs index 2fc1b4af3b..9a7020d52f 100644 --- a/Tests/FluentAssertions.Specs/Types/MethodInfoAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/MethodInfoAssertionSpecs.cs @@ -730,6 +730,7 @@ internal class ClassWithMethodWithImplementationAttribute [MethodImpl(MethodImplOptions.NoOptimization)] public ClassWithMethodWithImplementationAttribute() { } + // ReSharper disable once UnusedParameter.Local public ClassWithMethodWithImplementationAttribute(string _) { } [MethodImpl(MethodImplOptions.NoInlining)] diff --git a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveDefaultConstructor.cs b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveDefaultConstructor.cs index 14a7a5a8d8..951bd5cb99 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveDefaultConstructor.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.HaveDefaultConstructor.cs @@ -185,6 +185,7 @@ internal class ClassWithCctor; internal class ClassWithCctorAndNonDefaultConstructor { + // ReSharper disable once UnusedParameter.Local public ClassWithCctorAndNonDefaultConstructor(int _) { } } } diff --git a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.cs index ac0d89b03f..a6c4791b13 100644 --- a/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Types/TypeAssertionSpecs.cs @@ -49,6 +49,7 @@ public class ClassWithMembers { protected internal ClassWithMembers() { } + // ReSharper disable once UnusedParameter.Local private ClassWithMembers(string _) { } protected string PrivateWriteProtectedReadProperty { get => null; private set { } } From 8f436d8b43f01967fab270257194ccb1d9897ae2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 22:38:01 +0000 Subject: [PATCH 677/845] Bump actions/checkout from 4 to 5 Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 4 ++-- .github/workflows/code_quality.yml | 2 +- .github/workflows/codeql.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58084ca2ab..a31dcd1165 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: DOTNET_NOLOGO: true steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 @@ -67,7 +67,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index 301d4fdb4e..10540db04c 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -13,7 +13,7 @@ jobs: name: Qodana Scan runs-on: windows-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 552c62131d..68e4e4a202 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -32,7 +32,7 @@ jobs: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From 86dd68f6114d99c702f53a2e0d6562087ce57f30 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 22:38:19 +0000 Subject: [PATCH 678/845] Bump JetBrains/qodana-action from 2025.1 to 2025.2 Bumps [JetBrains/qodana-action](https://github.com/jetbrains/qodana-action) from 2025.1 to 2025.2. - [Release notes](https://github.com/jetbrains/qodana-action/releases) - [Commits](https://github.com/jetbrains/qodana-action/compare/v2025.1...v2025.2) --- updated-dependencies: - dependency-name: JetBrains/qodana-action dependency-version: '2025.2' dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index 301d4fdb4e..9efaea0dfa 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2025.1 + uses: JetBrains/qodana-action@v2025.2 with: upload-result: ${{ github.ref_name == 'main' || github.ref_name == 'develop' }} args: --baseline,qodana.sarif.json,--ide,QDNET From 0b33b9c7d7e74a688226e68cacba3d66a696ee80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 00:48:41 +0000 Subject: [PATCH 679/845] Bump actions/download-artifact from 4 to 5 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a31dcd1165..6c7ca483ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,7 +101,7 @@ jobs: steps: - name: Download Artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: path: artifacts From ef0f48b637406d1e34c7473fdd08ed930b468b90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 01:18:58 +0000 Subject: [PATCH 680/845] Bump cspell from 9.2.0 to 9.2.1 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 9.2.0 to 9.2.1. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.2.1/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.2.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 305 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 154 insertions(+), 153 deletions(-) diff --git a/package-lock.json b/package-lock.json index 73fb0159ee..b64663926a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,33 +7,33 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.2.0" + "cspell": "^9.2.1" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.2.0.tgz", - "integrity": "sha512-e4qb78SQWqHkRw47W8qFJ3RPijhSLkADF+T0oH8xl3r/golq1RGp2/KrWOqGRRofUSTiIKYqaMX7mbAyFnOxyA==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.2.1.tgz", + "integrity": "sha512-85gHoZh3rgZ/EqrHIr1/I4OLO53fWNp6JZCqCdgaT7e3sMDaOOG6HoSxCvOnVspXNIf/1ZbfTCDMx9x79Xq0AQ==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.1", "@cspell/dict-al": "^1.1.1", - "@cspell/dict-aws": "^4.0.12", + "@cspell/dict-aws": "^4.0.15", "@cspell/dict-bash": "^4.2.1", - "@cspell/dict-companies": "^3.2.2", - "@cspell/dict-cpp": "^6.0.9", + "@cspell/dict-companies": "^3.2.5", + "@cspell/dict-cpp": "^6.0.12", "@cspell/dict-cryptocurrencies": "^5.0.5", "@cspell/dict-csharp": "^4.0.7", "@cspell/dict-css": "^4.0.18", "@cspell/dict-dart": "^2.3.1", "@cspell/dict-data-science": "^2.0.9", "@cspell/dict-django": "^4.1.5", - "@cspell/dict-docker": "^1.1.15", + "@cspell/dict-docker": "^1.1.16", "@cspell/dict-dotnet": "^5.0.10", "@cspell/dict-elixir": "^4.0.8", - "@cspell/dict-en_us": "^4.4.15", - "@cspell/dict-en-common-misspellings": "^2.1.3", - "@cspell/dict-en-gb-mit": "^3.1.5", + "@cspell/dict-en_us": "^4.4.18", + "@cspell/dict-en-common-misspellings": "^2.1.5", + "@cspell/dict-en-gb-mit": "^3.1.8", "@cspell/dict-filetypes": "^3.0.13", "@cspell/dict-flutter": "^1.1.1", "@cspell/dict-fonts": "^4.0.5", @@ -57,17 +57,17 @@ "@cspell/dict-markdown": "^2.0.12", "@cspell/dict-monkeyc": "^1.0.11", "@cspell/dict-node": "^5.0.8", - "@cspell/dict-npm": "^5.2.12", + "@cspell/dict-npm": "^5.2.15", "@cspell/dict-php": "^4.0.15", "@cspell/dict-powershell": "^5.0.15", - "@cspell/dict-public-licenses": "^2.0.14", + "@cspell/dict-public-licenses": "^2.0.15", "@cspell/dict-python": "^4.2.19", "@cspell/dict-r": "^2.1.1", "@cspell/dict-ruby": "^5.0.9", "@cspell/dict-rust": "^4.0.12", "@cspell/dict-scala": "^5.0.8", "@cspell/dict-shell": "^1.1.1", - "@cspell/dict-software-terms": "^5.1.4", + "@cspell/dict-software-terms": "^5.1.7", "@cspell/dict-sql": "^2.2.1", "@cspell/dict-svelte": "^1.0.7", "@cspell/dict-swift": "^2.0.6", @@ -80,30 +80,30 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.2.0.tgz", - "integrity": "sha512-qHdkW8eyknCSDEsqCG8OHBMal03LQf21H2LVWhtwszEQ4BQRKcWctc+VIgkO69F/jLaN2wi/yhhMufXWHAEzIg==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.2.1.tgz", + "integrity": "sha512-LiiIWzLP9h2etKn0ap6g2+HrgOGcFEF/hp5D8ytmSL5sMxDcV13RrmJCEMTh1axGyW0SjQEFjPnYzNpCL1JjGA==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.2.0" + "@cspell/cspell-types": "9.2.1" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-pipe": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.2.0.tgz", - "integrity": "sha512-RO3adcsr7Ek+4511nyEOWDhOYYU1ogRs1Mo5xx3kDIdcKAJzhFdGry35T2wqft4dPASLCXcemBrhoS+hdQ+z+Q==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.2.1.tgz", + "integrity": "sha512-2N1H63If5cezLqKToY/YSXon4m4REg/CVTFZr040wlHRbbQMh5EF3c7tEC/ue3iKAQR4sm52ihfqo1n4X6kz+g==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.2.0.tgz", - "integrity": "sha512-0Xvwq0iezfO71Alw+DjsGxacAzydqOAxdXnY4JknHuxt2l8GTSMjRwj65QAflv3PN6h1QoRZEeWdiKtusceWAw==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.2.1.tgz", + "integrity": "sha512-fRPQ6GWU5eyh8LN1TZblc7t24TlGhJprdjJkfZ+HjQo+6ivdeBPT7pC7pew6vuMBQPS1oHBR36hE0ZnJqqkCeg==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" @@ -113,18 +113,18 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.2.0.tgz", - "integrity": "sha512-ZDvcOTFk3cCVW+OjlkljeP7aSuV8tIguVn+GMco1/A+961hsEP20hngK9zJtyfpXqyvJKtvCVlyzS+z8VRrZGg==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.2.1.tgz", + "integrity": "sha512-k4M6bqdvWbcGSbcfLD7Lf4coZVObsISDW+sm/VaWp9aZ7/uwiz1IuGUxL9WO4JIdr9CFEf7Ivmvd2txZpVOCIA==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.2.0.tgz", - "integrity": "sha512-hL4ltFwiARpFxlfXt4GiTWQxIFyZp4wrlp7dozZbitYO6QlYc5fwQ8jBc5zFUqknuH4gx/sCMLNXhAv3enNGZQ==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.2.1.tgz", + "integrity": "sha512-FQHgQYdTHkcpxT0u1ddLIg5Cc5ePVDcLg9+b5Wgaubmc5I0tLotgYj8c/mvStWuKsuZIs6sUopjJrE91wk6Onw==", "license": "MIT", "engines": { "node": ">=20" @@ -143,9 +143,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-aws": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.13.tgz", - "integrity": "sha512-i/9wTGC02EJn740F3CuiGM5qI6kbDr5xPGXUoCQsScr0nWNBljscO7Ko8ZrahXg1uBj3+A1WWxqceh1fqF52Ng==", + "version": "4.0.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.15.tgz", + "integrity": "sha512-aPY7VVR5Os4rz36EaqXBAEy14wR4Rqv+leCJ2Ug/Gd0IglJpM30LalF3e2eJChnjje3vWoEC0Rz3+e5gpZG+Kg==", "license": "MIT" }, "node_modules/@cspell/dict-bash": { @@ -158,15 +158,15 @@ } }, "node_modules/@cspell/dict-companies": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.2.2.tgz", - "integrity": "sha512-iIuEBPfWzSQugIOn+OKOVsdfE9UloON5SKl57TbvC//D5mgIwPAMZGYT69yv20cjc5E6oMu353hCV3WFy9XO9A==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.2.5.tgz", + "integrity": "sha512-H51R0w7c6RwJJPqH7Gs65tzP6ouZsYDEHmmol6MIIk0kQaOIBuFP2B3vIxHLUr2EPRVFZsMW8Ni7NmVyaQlwsg==", "license": "MIT" }, "node_modules/@cspell/dict-cpp": { - "version": "6.0.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.9.tgz", - "integrity": "sha512-Xdq9MwGh0D5rsnbOqFW24NIClXXRhN11KJdySMibpcqYGeomxB2ODFBuhj1H7azO7kVGkGH0Okm4yQ2TRzBx0g==", + "version": "6.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.12.tgz", + "integrity": "sha512-N4NsCTttVpMqQEYbf0VQwCj6np+pJESov0WieCN7R/0aByz4+MXEiDieWWisaiVi8LbKzs1mEj4ZTw5K/6O2UQ==", "license": "MIT" }, "node_modules/@cspell/dict-cryptocurrencies": { @@ -224,21 +224,21 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.4.16", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.16.tgz", - "integrity": "sha512-/R47sUbUmba2dG/0LZyE6P6gX/DRF1sCcYNQNWyPk/KeidQRNZG+FH9U0KRvX42/2ZzMge6ebXH3WAJ52w0Vqw==", + "version": "4.4.18", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.18.tgz", + "integrity": "sha512-6Le961Q0AIfVp3nKuSJJD/9NfnTYA1N/MLAaeWKCABEvhzhopeyGrykwejd0SA4m64WBUNEfSlsgselYWoDSjQ==", "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.3.tgz", - "integrity": "sha512-v1I97Hr1OrK+mwHsVzbY4vsPxx6mA5quhxzanF6XuRofz00wH4HPz8Q3llzRHxka5Wl/59gyan04UkUrvP4gdA==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.5.tgz", + "integrity": "sha512-hlRDSjul7wGTDXeLBADoyTGIZjWWZn6/SP+pt0lG3PRtqF0MWH/QEDgUkS+Yev7ZhHCHVLvwBZtDxOd1uw06Tw==", "license": "CC BY-SA 4.0" }, "node_modules/@cspell/dict-en-gb-mit": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.6.tgz", - "integrity": "sha512-3JJGxuPhDK5rMDYPzJYAdjjsBddEyV54rXfUQpOCl7c7weMhNDWfC2q4h3cKNDj7Isud1q2RM+DlSxQWf40OTw==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.8.tgz", + "integrity": "sha512-wrZDRl6TKd1wReepGDPuT1JNbnRjHLvtAVrozp0DUkFlcDgnrB+YSd/Ne4aKnkXl5qpyVQ2GG7a4Z7INKCX+fw==", "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { @@ -386,9 +386,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.12.tgz", - "integrity": "sha512-f5xcEl6+JZCFvDCOKJJuKv1ZMOzq9sBg/7y/iuqkBOgjeGDdB+PSrOJWk2jqu3PzXjjX39KJkt7mRUzv8Mrh1g==", + "version": "5.2.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.15.tgz", + "integrity": "sha512-kb9oX/N5FUlJYoqc5G+tIP/0SolteFMz2VhOVKG2qiXUS/1AybVTjUEo4gZ4uEveUhLzUDcfpZbn40EoUVBVrg==", "license": "MIT" }, "node_modules/@cspell/dict-php": { @@ -404,9 +404,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-public-licenses": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.14.tgz", - "integrity": "sha512-8NhNzQWALF6+NlLeKZKilSHbeW9MWeiD+NcrjehMAcovKFbsn8smmQG/bVxw+Ymtd6WEgNpLgswAqNsbSQQ4og==", + "version": "2.0.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.15.tgz", + "integrity": "sha512-cJEOs901H13Pfy0fl4dCD1U+xpWIMaEPq8MeYU83FfDZvellAuSo4GqWCripfIqlhns/L6+UZEIJSOZnjgy7Wg==", "license": "MIT" }, "node_modules/@cspell/dict-python": { @@ -449,9 +449,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.5.tgz", - "integrity": "sha512-MX5beBP3pLmIM0mjqfrHbie3EEfyLWZ8ZqW56jcLuRlLoDcfC0FZsr66NCARgCgEwsWiidHFe87+7fFsnwqY6A==", + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.7.tgz", + "integrity": "sha512-CfNFQCVx8R/D8RfFdFTwSjDvXcSXY0tO+VN2N6TEbNTL1GCmqyzhwm4YI+ZbO3MUmMAMjwu9jZyoLk5BaJkXcg==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -491,40 +491,40 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.2.0.tgz", - "integrity": "sha512-2/k4LR8CQqbgIPQGELbCdt9xgg9+aQ7pMwOtllKvnFYBtwNiwqcZjlzAam2gtvD5DghKX2qrcSHG5A7YP5cX9A==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.2.1.tgz", + "integrity": "sha512-izYQbk7ck0ffNA1gf7Gi3PkUEjj+crbYeyNK1hxHx5A+GuR416ozs0aEyp995KI2v9HZlXscOj3SC3wrWzHZeA==", "license": "MIT", "dependencies": { - "@cspell/url": "9.2.0", - "import-meta-resolve": "^4.1.0" + "@cspell/url": "9.2.1", + "import-meta-resolve": "^4.2.0" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/filetypes": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.2.0.tgz", - "integrity": "sha512-6wmCa3ZyI647H7F4w6kb9PCJ703JKSgFTB8EERTdIoGySbgVp5+qMIIoZ//wELukdjgcufcFZ5pBrhRDRsemRA==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.2.1.tgz", + "integrity": "sha512-Dy1y1pQ+7hi2gPs+jERczVkACtYbUHcLodXDrzpipoxgOtVxMcyZuo+84WYHImfu0gtM0wU2uLObaVgMSTnytw==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/strong-weak-map": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.2.0.tgz", - "integrity": "sha512-5mpIMiIOCu4cBqy1oCTXISgJuOCQ6R/e38AkvnYWfmMIx7fCdx8n+mF52wX9m61Ng28Sq8VL253xybsWcCxHug==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.2.1.tgz", + "integrity": "sha512-1HsQWZexvJSjDocVnbeAWjjgqWE/0op/txxzDPvDqI2sE6pY0oO4Cinj2I8z+IP+m6/E6yjPxdb23ydbQbPpJQ==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.2.0.tgz", - "integrity": "sha512-plB0wwdAESqBl4xDAT2db2/K1FZHJXfYlJTiV6pkn0XffTGyg4UGLaSCm15NzUoPxdSmzqj5jQb7y+mB9kFK8g==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.2.1.tgz", + "integrity": "sha512-9EHCoGKtisPNsEdBQ28tKxKeBmiVS3D4j+AN8Yjr+Dmtu+YACKGWiMOddNZG2VejQNIdFx7FwzU00BGX68ELhA==", "license": "MIT", "engines": { "node": ">=20" @@ -546,9 +546,10 @@ } }, "node_modules/chalk": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", - "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.0.tgz", + "integrity": "sha512-46QrSQFyVSEyYAgQ22hQ+zDa60YHA4fBstHmtSApj1Y5vKtG27fWowW03jCk5KcbXEWPZUIR894aARCA/G1kfQ==", + "license": "MIT", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -619,25 +620,25 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.2.0.tgz", - "integrity": "sha512-AKzaFMem2jRcGpAY2spKP0z15jpZeX1WTDNHCDsB8/YvnhnOfWXc0S5AF+4sfU1cQgHWYGFOolMuTri0ZQdV+Q==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.2.1.tgz", + "integrity": "sha512-PoKGKE9Tl87Sn/jwO4jvH7nTqe5Xrsz2DeJT5CkulY7SoL2fmsAqfbImQOFS2S0s36qD98t6VO+Ig2elEEcHew==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "9.2.0", - "@cspell/cspell-pipe": "9.2.0", - "@cspell/cspell-types": "9.2.0", - "@cspell/dynamic-import": "9.2.0", - "@cspell/url": "9.2.0", - "chalk": "^5.4.1", + "@cspell/cspell-json-reporter": "9.2.1", + "@cspell/cspell-pipe": "9.2.1", + "@cspell/cspell-types": "9.2.1", + "@cspell/dynamic-import": "9.2.1", + "@cspell/url": "9.2.1", + "chalk": "^5.6.0", "chalk-template": "^1.1.0", "commander": "^14.0.0", - "cspell-config-lib": "9.2.0", - "cspell-dictionary": "9.2.0", - "cspell-gitignore": "9.2.0", - "cspell-glob": "9.2.0", - "cspell-io": "9.2.0", - "cspell-lib": "9.2.0", + "cspell-config-lib": "9.2.1", + "cspell-dictionary": "9.2.1", + "cspell-gitignore": "9.2.1", + "cspell-glob": "9.2.1", + "cspell-io": "9.2.1", + "cspell-lib": "9.2.1", "fast-json-stable-stringify": "^2.1.0", "flatted": "^3.3.3", "semver": "^7.7.2", @@ -655,29 +656,29 @@ } }, "node_modules/cspell-config-lib": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.2.0.tgz", - "integrity": "sha512-Yc8+hT+uIWWCi6WMhOL6HDYbBCP2qig1tgKGThHVeOx6GviieV10TZ5kQ+P7ONgoqw2nmm7uXIC19dGYx3DblQ==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.2.1.tgz", + "integrity": "sha512-qqhaWW+0Ilc7493lXAlXjziCyeEmQbmPMc1XSJw2EWZmzb+hDvLdFGHoX18QU67yzBtu5hgQsJDEDZKvVDTsRA==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.2.0", + "@cspell/cspell-types": "9.2.1", "comment-json": "^4.2.5", - "smol-toml": "^1.4.1", - "yaml": "^2.8.0" + "smol-toml": "^1.4.2", + "yaml": "^2.8.1" }, "engines": { "node": ">=20" } }, "node_modules/cspell-dictionary": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.2.0.tgz", - "integrity": "sha512-lV4VtjsDtxu8LyCcb6DY7Br4e/Aw1xfR8QvjYhHaJ8t03xry9STey5Rkfp+lz+hlVevNcn3lfCaacGuXyD+lLg==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.2.1.tgz", + "integrity": "sha512-0hQVFySPsoJ0fONmDPwCWGSG6SGj4ERolWdx4t42fzg5zMs+VYGXpQW4BJneQ5Tfxy98Wx8kPhmh/9E8uYzLTw==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.2.0", - "@cspell/cspell-types": "9.2.0", - "cspell-trie-lib": "9.2.0", + "@cspell/cspell-pipe": "9.2.1", + "@cspell/cspell-types": "9.2.1", + "cspell-trie-lib": "9.2.1", "fast-equals": "^5.2.2" }, "engines": { @@ -685,14 +686,14 @@ } }, "node_modules/cspell-gitignore": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.2.0.tgz", - "integrity": "sha512-gXDQZ7czTPwmEg1qtsUIjVEFm9IfgTO8rA02O8eYIveqjFixbSV3fIYOgoxZSZYxjt3O44m8+/zAFC1RE4CM/Q==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.2.1.tgz", + "integrity": "sha512-WPnDh03gXZoSqVyXq4L7t9ljx6lTDvkiSRUudb125egEK5e9s04csrQpLI3Yxcnc1wQA2nzDr5rX9XQVvCHf7g==", "license": "MIT", "dependencies": { - "@cspell/url": "9.2.0", - "cspell-glob": "9.2.0", - "cspell-io": "9.2.0" + "@cspell/url": "9.2.1", + "cspell-glob": "9.2.1", + "cspell-io": "9.2.1" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -702,12 +703,12 @@ } }, "node_modules/cspell-glob": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.2.0.tgz", - "integrity": "sha512-viycZDyegzW2AKPFqvX5RveqTrB0sKgexlCu2A8z8eumpYYor5sD1NP05VDOqkAF4hDuiGqkHn6iNo0L1wNgLw==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.2.1.tgz", + "integrity": "sha512-CrT/6ld3rXhB36yWFjrx1SrMQzwDrGOLr+wYEnrWI719/LTYWWCiMFW7H+qhsJDTsR+ku8+OAmfRNBDXvh9mnQ==", "license": "MIT", "dependencies": { - "@cspell/url": "9.2.0", + "@cspell/url": "9.2.1", "picomatch": "^4.0.3" }, "engines": { @@ -715,13 +716,13 @@ } }, "node_modules/cspell-grammar": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.2.0.tgz", - "integrity": "sha512-qthAmWcNHpYAmufy7YWVg9xwrYANkVlI40bgC2uGd8EnKssm/qOPhqXXNS+kLf+q0NmJM5nMgRLhCC23xSp3JA==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.2.1.tgz", + "integrity": "sha512-10RGFG7ZTQPdwyW2vJyfmC1t8813y8QYRlVZ8jRHWzer9NV8QWrGnL83F+gTPXiKR/lqiW8WHmFlXR4/YMV+JQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.2.0", - "@cspell/cspell-types": "9.2.0" + "@cspell/cspell-pipe": "9.2.1", + "@cspell/cspell-types": "9.2.1" }, "bin": { "cspell-grammar": "bin.mjs" @@ -731,40 +732,40 @@ } }, "node_modules/cspell-io": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.2.0.tgz", - "integrity": "sha512-oxKiqFLcz629FmOId8UpdDznpMvCgpuktg4nkD2G9pYpRh+fRLZpP4QtZPyvJqvpUIzFhIOznMeHjsiBYHOZUA==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.2.1.tgz", + "integrity": "sha512-v9uWXtRzB+RF/Mzg5qMzpb8/yt+1bwtTt2rZftkLDLrx5ybVvy6rhRQK05gFWHmWVtWEe0P/pIxaG2Vz92C8Ag==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "9.2.0", - "@cspell/url": "9.2.0" + "@cspell/cspell-service-bus": "9.2.1", + "@cspell/url": "9.2.1" }, "engines": { "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.2.0.tgz", - "integrity": "sha512-RnhDIsETw6Ex0UaK3PFoJ2FwWMWfJPtdpNpv1qgmJwoGD4CzwtIqPOLtZ24zqdCP8ZnNTF/lwV/9rZVqifYjsw==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.2.1.tgz", + "integrity": "sha512-KeB6NHcO0g1knWa7sIuDippC3gian0rC48cvO0B0B0QwhOxNxWVp8cSmkycXjk4ijBZNa++IwFjeK/iEqMdahQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.2.0", - "@cspell/cspell-pipe": "9.2.0", - "@cspell/cspell-resolver": "9.2.0", - "@cspell/cspell-types": "9.2.0", - "@cspell/dynamic-import": "9.2.0", - "@cspell/filetypes": "9.2.0", - "@cspell/strong-weak-map": "9.2.0", - "@cspell/url": "9.2.0", + "@cspell/cspell-bundled-dicts": "9.2.1", + "@cspell/cspell-pipe": "9.2.1", + "@cspell/cspell-resolver": "9.2.1", + "@cspell/cspell-types": "9.2.1", + "@cspell/dynamic-import": "9.2.1", + "@cspell/filetypes": "9.2.1", + "@cspell/strong-weak-map": "9.2.1", + "@cspell/url": "9.2.1", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "9.2.0", - "cspell-dictionary": "9.2.0", - "cspell-glob": "9.2.0", - "cspell-grammar": "9.2.0", - "cspell-io": "9.2.0", - "cspell-trie-lib": "9.2.0", + "cspell-config-lib": "9.2.1", + "cspell-dictionary": "9.2.1", + "cspell-glob": "9.2.1", + "cspell-grammar": "9.2.1", + "cspell-io": "9.2.1", + "cspell-trie-lib": "9.2.1", "env-paths": "^3.0.0", "fast-equals": "^5.2.2", "gensequence": "^7.0.0", @@ -779,13 +780,13 @@ } }, "node_modules/cspell-trie-lib": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.2.0.tgz", - "integrity": "sha512-6GHL1KvLQzcPBSNY6QWOabq8YwRJAnNKamA0O/tRKy+11Hy99ysD4xvfu3kKYPAcobp5ZykX4nudHxy8yrEvng==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.2.1.tgz", + "integrity": "sha512-qOtbL+/tUzGFHH0Uq2wi7sdB9iTy66QNx85P7DKeRdX9ZH53uQd7qC4nEk+/JPclx1EgXX26svxr0jTGISJhLw==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.2.0", - "@cspell/cspell-types": "9.2.0", + "@cspell/cspell-pipe": "9.2.1", + "@cspell/cspell-types": "9.2.1", "gensequence": "^7.0.0" }, "engines": { @@ -923,9 +924,9 @@ } }, "node_modules/import-meta-resolve": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", - "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz", + "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==", "license": "MIT", "funding": { "type": "github", @@ -996,9 +997,9 @@ } }, "node_modules/smol-toml": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.4.1.tgz", - "integrity": "sha512-CxdwHXyYTONGHThDbq5XdwbFsuY4wlClRGejfE2NtwUtiHYsP1QtNsHb/hnj31jKYSchztJsaA8pSQoVzkfCFg==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.4.2.tgz", + "integrity": "sha512-rInDH6lCNiEyn3+hH8KVGFdbjc099j47+OSgbMrfDYX1CmXLfdKd7qi6IfcWj2wFxvSVkuI46M+wPGYfEOEj6g==", "license": "BSD-3-Clause", "engines": { "node": ">= 18" @@ -1048,9 +1049,9 @@ } }, "node_modules/yaml": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", - "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", "license": "ISC", "bin": { "yaml": "bin.mjs" diff --git a/package.json b/package.json index de186d8a6a..81df088113 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.2.0" + "cspell": "^9.2.1" } } From 354726b44d522a2af6bff33e5f18d12a0900609f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 14:10:47 +0000 Subject: [PATCH 681/845] Bump actions/setup-dotnet from 4 to 5 Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 4 to 5. - [Release notes](https://github.com/actions/setup-dotnet/releases) - [Commits](https://github.com/actions/setup-dotnet/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-dotnet dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 4 ++-- .github/workflows/codeql.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c7ca483ac..e97fb5f22f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: fetch-depth: 0 - name: Setup .NET SDKs - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: dotnet-version: | 6.0.x @@ -72,7 +72,7 @@ jobs: fetch-depth: 0 - name: Setup .NET SDKs - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: dotnet-version: | 6.0.x diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 68e4e4a202..ac55636fe2 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Setup .NET SDKs - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: dotnet-version: | 9.0.x From 1f3a728bf6d48db3534d974eb3f7d3c5a09657f6 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 17 Aug 2025 19:38:53 +0200 Subject: [PATCH 682/845] Add lock file for nuget packages --- Build/Build.cs | 1 + Build/packages.lock.json | 1160 +++++++++++++++++ Directory.Build.props | 2 + Src/FluentAssertions/packages.lock.json | 165 +++ Tests/Approval.Tests/packages.lock.json | 197 +++ Tests/AssemblyA/packages.lock.json | 24 + Tests/AssemblyB/packages.lock.json | 21 + Tests/Benchmarks/packages.lock.json | 673 ++++++++++ Tests/ExampleExtensions/packages.lock.json | 40 + Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 + Tests/FSharp.Specs/packages.lock.json | 159 +++ .../packages.lock.json | 425 ++++++ .../packages.lock.json | 389 ++++++ .../FluentAssertions.Specs/packages.lock.json | 462 +++++++ .../MSTestV2.Specs/packages.lock.json | 180 +++ .../MSpec.Specs/packages.lock.json | 1037 +++++++++++++++ .../NUnit3.Specs/packages.lock.json | 183 +++ .../NUnit4.Specs/packages.lock.json | 167 +++ .../TUnit.Specs/packages.lock.json | 151 +++ .../XUnit2.Specs/packages.lock.json | 269 ++++ .../XUnit3.Specs/packages.lock.json | 352 +++++ .../XUnit3Core.Specs/packages.lock.json | 284 ++++ Tests/VB.Specs/packages.lock.json | 153 +++ 23 files changed, 6496 insertions(+) create mode 100644 Build/packages.lock.json create mode 100644 Src/FluentAssertions/packages.lock.json create mode 100644 Tests/Approval.Tests/packages.lock.json create mode 100644 Tests/AssemblyA/packages.lock.json create mode 100644 Tests/AssemblyB/packages.lock.json create mode 100644 Tests/Benchmarks/packages.lock.json create mode 100644 Tests/ExampleExtensions/packages.lock.json create mode 100644 Tests/FSharp.Specs/packages.lock.json create mode 100644 Tests/FluentAssertions.Equivalency.Specs/packages.lock.json create mode 100644 Tests/FluentAssertions.Extensibility.Specs/packages.lock.json create mode 100644 Tests/FluentAssertions.Specs/packages.lock.json create mode 100644 Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json create mode 100644 Tests/TestFrameworks/MSpec.Specs/packages.lock.json create mode 100644 Tests/TestFrameworks/NUnit3.Specs/packages.lock.json create mode 100644 Tests/TestFrameworks/NUnit4.Specs/packages.lock.json create mode 100644 Tests/TestFrameworks/TUnit.Specs/packages.lock.json create mode 100644 Tests/TestFrameworks/XUnit2.Specs/packages.lock.json create mode 100644 Tests/TestFrameworks/XUnit3.Specs/packages.lock.json create mode 100644 Tests/TestFrameworks/XUnit3Core.Specs/packages.lock.json create mode 100644 Tests/VB.Specs/packages.lock.json diff --git a/Build/Build.cs b/Build/Build.cs index 87d8bb32de..58e5213a9a 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -113,6 +113,7 @@ class Build : NukeBuild DotNetRestore(s => s .SetProjectFile(Solution) .EnableNoCache() + .SetContinuousIntegrationBuild(IsServerBuild) .SetConfigFile(RootDirectory / "nuget.config")); }); diff --git a/Build/packages.lock.json b/Build/packages.lock.json new file mode 100644 index 0000000000..f15421e24f --- /dev/null +++ b/Build/packages.lock.json @@ -0,0 +1,1160 @@ +{ + "version": 1, + "dependencies": { + "net9.0": { + "LibGit2Sharp": { + "type": "Direct", + "requested": "[0.31.0, )", + "resolved": "0.31.0", + "contentHash": "b3+UfV7LjKMjAHWwl7VawejiOv2gJIC6dTCA/S0puLTHACAA/Oeb5JJmWUQMeyH/T/WR/LaIK8bk2RbdFnrZvg==", + "dependencies": { + "LibGit2Sharp.NativeBinaries": "[2.0.323]" + } + }, + "Nuke.Common": { + "type": "Direct", + "requested": "[9.0.4, )", + "resolved": "9.0.4", + "contentHash": "/fsQTMbasNsr6uGZCGfyad3OQaBpuuiktb+0yyE81BtxfPgtJNRn71pjH9uHlQc1gk966wcMZLicDf4No03x4A==", + "dependencies": { + "Azure.Identity": "1.13.1", + "Azure.Security.KeyVault.Certificates": "4.7.0", + "Azure.Security.KeyVault.Keys": "4.7.0", + "Azure.Security.KeyVault.Secrets": "4.7.0", + "Nuke.Build": "9.0.4", + "Nuke.Build.Shared": "9.0.4", + "Nuke.ProjectModel": "9.0.4", + "Nuke.SolutionModel": "9.0.4", + "Nuke.Tooling": "9.0.4", + "Nuke.Utilities": "9.0.4", + "Nuke.Utilities.IO.Compression": "9.0.4", + "Nuke.Utilities.IO.Globbing": "9.0.4", + "Nuke.Utilities.Net": "9.0.4", + "Nuke.Utilities.Text.Json": "9.0.4", + "Octokit": "13.0.1" + } + }, + "Nuke.Components": { + "type": "Direct", + "requested": "[9.0.4, )", + "resolved": "9.0.4", + "contentHash": "MnAeZYUCKNqfko7CaKWoubYhgYCQhdjUuAb4K88aqOPq8Sgxb0BLSwSmyZslBzoLttLOQinuvv0EHJMS8c0mkA==", + "dependencies": { + "Nuke.Common": "9.0.4" + } + }, + "SharpCompress": { + "type": "Direct", + "requested": "[0.40.0, )", + "resolved": "0.40.0", + "contentHash": "yP/aFX1jqGikVF7u2f05VEaWN4aCaKNLxSas82UgA2GGVECxq/BcqZx3STHCJ78qilo1azEOk1XpBglIuGMb7w==", + "dependencies": { + "System.Buffers": "4.6.0", + "ZstdSharp.Port": "0.8.5" + } + }, + "System.Formats.Asn1": { + "type": "Direct", + "requested": "[9.0.1, )", + "resolved": "9.0.1", + "contentHash": "efRn3TXUx2aWG4yOjD5jxTYlPy4Pz/8fiwYBtIpVb/+ySsNA9PFWFd3M3MdcRx1XjpYtj5QSXGm8XnGCeh7dSA==" + }, + "Azure.Core": { + "type": "Transitive", + "resolved": "1.44.1", + "contentHash": "YyznXLQZCregzHvioip07/BkzjuWNXogJEVz9T5W6TwjNr17ax41YGzYMptlo2G10oLCuVPoyva62y0SIRDixg==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "System.ClientModel": "1.1.0", + "System.Diagnostics.DiagnosticSource": "6.0.1", + "System.Memory.Data": "6.0.0", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "6.0.0", + "System.Text.Json": "6.0.10", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Azure.Identity": { + "type": "Transitive", + "resolved": "1.13.1", + "contentHash": "4eeK9XztjTmvA4WN+qAvlUCSxSv45+LqTMeC8XT2giGGZHKthTMU2IuXcHjAOf5VLH3wE3Bo6EwhIcJxVB8RmQ==", + "dependencies": { + "Azure.Core": "1.44.1", + "Microsoft.Identity.Client": "4.66.1", + "Microsoft.Identity.Client.Extensions.Msal": "4.66.1", + "System.Memory": "4.5.5", + "System.Text.Json": "6.0.10", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Azure.Security.KeyVault.Certificates": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "FcoGTI/6i8nKZhwI0HrYnVWOQk9LhnP+9T3adFAGvU8i3XPc3KKJ93VGER8L+Ygez2bpyGsWj4fRjsYv2211PQ==", + "dependencies": { + "Azure.Core": "1.44.1", + "System.Memory": "4.5.5", + "System.Text.Json": "6.0.10", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Azure.Security.KeyVault.Keys": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "1JOyCLvSfYVtxVV6dmA4YP4kJd+u+PE41M27U1po8XlglRcW3YZhet/O90fkEbpmiuNka1XjM2qrT9A++izloQ==", + "dependencies": { + "Azure.Core": "1.44.1", + "System.Memory": "4.5.5", + "System.Text.Json": "6.0.10", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Azure.Security.KeyVault.Secrets": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "uOPCojkm41V4dKTORyGzl3/f/lriKpxSQ43fWDn4StRJBVmbF1F/DNWJhwm207kCnqgE/W9+tskJSimIKHCZkw==", + "dependencies": { + "Azure.Core": "1.44.1", + "System.Memory": "4.5.5", + "System.Text.Json": "6.0.10", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Glob": { + "type": "Transitive", + "resolved": "1.1.9", + "contentHash": "AfK5+ECWYTP7G3AAdnU8IfVj+QpGjrh9GC2mpdcJzCvtQ4pnerAGwHsxJ9D4/RnhDUz2DSzd951O/lQjQby2Sw==" + }, + "JetBrains.Annotations": { + "type": "Transitive", + "resolved": "2024.3.0", + "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" + }, + "LibGit2Sharp.NativeBinaries": { + "type": "Transitive", + "resolved": "2.0.323", + "contentHash": "Kg+fJGWhGj5qRXG0Ilj4ddhuodGXZg57yhfX6OVUDR0M2DKg/UR42/d74+qv5l1qotc1qJilo/ho7xQnULP6yA==" + }, + "Microsoft.ApplicationInsights": { + "type": "Transitive", + "resolved": "2.22.0", + "contentHash": "3AOM9bZtku7RQwHyMEY3tQMrHIgjcfRDa6YQpd/QG2LDGvMydSlL9Di+8LLMt7J2RDdfJ7/2jdYv6yHcMJAnNw==", + "dependencies": { + "System.Diagnostics.DiagnosticSource": "5.0.0" + } + }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==" + }, + "Microsoft.Build": { + "type": "Transitive", + "resolved": "17.12.6", + "contentHash": "Gz8VteydDNLOhm0vov0dSeQb43ibQ4EnWoc2UtjUd7F3MNFo12o/3XLvVFoZ9b8UXBX6EzraL8XLCy93QTnnIA==", + "dependencies": { + "Microsoft.Build.Framework": "17.12.6", + "Microsoft.NET.StringTools": "17.12.6", + "System.Collections.Immutable": "8.0.0", + "System.Configuration.ConfigurationManager": "8.0.0", + "System.Reflection.Metadata": "8.0.0", + "System.Reflection.MetadataLoadContext": "8.0.0" + } + }, + "Microsoft.Build.Framework": { + "type": "Transitive", + "resolved": "17.12.6", + "contentHash": "jleteC0seumLGTmTVwob97lcwPj/dfgzL/V3g/VVcMZgo2Ic7jzdy8AYpByPDh8e3uRq0SjCl6HOFCjhy5GzRQ==" + }, + "Microsoft.Build.Locator": { + "type": "Transitive", + "resolved": "1.7.8", + "contentHash": "sPy10x527Ph16S2u0yGME4S6ohBKJ69WfjeGG/bvELYeZVmJdKjxgnlL8cJJJLGV/cZIRqSfB12UDB8ICakOog==" + }, + "Microsoft.Build.Tasks.Core": { + "type": "Transitive", + "resolved": "17.12.6", + "contentHash": "ENxyDD/Bp3aa5V1Og6sCKBL26gEuDsP9MtUbnzNO3mhiLHmb/WiRcmtIAXamCefPsIdy+X7pzLHyJVE9vjvz8g==", + "dependencies": { + "Microsoft.Build.Framework": "17.12.6", + "Microsoft.Build.Utilities.Core": "17.12.6", + "Microsoft.NET.StringTools": "17.12.6", + "System.CodeDom": "8.0.0", + "System.Collections.Immutable": "8.0.0", + "System.Configuration.ConfigurationManager": "8.0.0", + "System.Formats.Asn1": "8.0.1", + "System.Resources.Extensions": "8.0.0", + "System.Security.Cryptography.Pkcs": "8.0.0", + "System.Security.Cryptography.Xml": "8.0.0" + } + }, + "Microsoft.Build.Utilities.Core": { + "type": "Transitive", + "resolved": "17.12.6", + "contentHash": "pU3GnHcXp8VRMGKxdJCq+tixfhFn+QwEbpqmZmc/nqFHFyuhlGwjonWZMIWcwuCv/8EHgxoOttFvna1vrN+RrA==", + "dependencies": { + "Microsoft.Build.Framework": "17.12.6", + "Microsoft.NET.StringTools": "17.12.6", + "System.Collections.Immutable": "8.0.0", + "System.Configuration.ConfigurationManager": "8.0.0" + } + }, + "Microsoft.Extensions.DependencyModel": { + "type": "Transitive", + "resolved": "9.0.0", + "contentHash": "saxr2XzwgDU77LaQfYFXmddEDRUKHF4DaGMZkNB3qjdVSZlax3//dGJagJkKrGMIPNZs2jVFXITyCCR6UHJNdA==" + }, + "Microsoft.Identity.Client": { + "type": "Transitive", + "resolved": "4.66.1", + "contentHash": "mE+m3pZ7zSKocSubKXxwZcUrCzLflC86IdLxrVjS8tialy0b1L+aECBqRBC/ykcPlB4y7skg49TaTiA+O2UfDw==", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "6.35.0", + "System.Diagnostics.DiagnosticSource": "6.0.1" + } + }, + "Microsoft.Identity.Client.Extensions.Msal": { + "type": "Transitive", + "resolved": "4.66.1", + "contentHash": "osgt1J9Rve3LO7wXqpWoFx9UFjl0oeqoUMK/xEru7dvafQ28RgV1A17CoCGCCRSUbgDQ4Arg5FgGK2lQ3lXR4A==", + "dependencies": { + "Microsoft.Identity.Client": "4.66.1", + "System.Security.Cryptography.ProtectedData": "4.5.0" + } + }, + "Microsoft.IdentityModel.Abstractions": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "xuR8E4Rd96M41CnUSCiOJ2DBh+z+zQSmyrYHdYhD6K4fXBcQGVnRCFQ0efROUYpP+p0zC1BLKr0JRpVuujTZSg==" + }, + "Microsoft.NET.StringTools": { + "type": "Transitive", + "resolved": "17.12.6", + "contentHash": "w8Ehofqte5bJoR+Fa3f6JwkwFEkGtXxqvQHGOVOSHDzgNVySvL5FSNhavbQSZ864el9c3rjdLPLAtBW8dq6fmg==" + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==" + }, + "Microsoft.NETCore.Targets": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" + }, + "Namotion.Reflection": { + "type": "Transitive", + "resolved": "3.2.0", + "contentHash": "YfGjDPzMEs3vRMI4CMkJwOg75SV5JEDV72kMccD2GCo++TfgOYb5ZTpABYq3dUQqFtnAPpqMKM+deLlrUwnN1g==" + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.3", + "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" + }, + "NJsonSchema": { + "type": "Transitive", + "resolved": "11.1.0", + "contentHash": "H7QO+bM/2uzF81mVyy4U8ha4MXS9eOX06rTvBgJKquzIuLUGuiOTc4nknkCFKW7mr+xnWgzY7Spevz5ZEK8fGg==", + "dependencies": { + "NJsonSchema.Annotations": "11.1.0", + "Namotion.Reflection": "3.2.0", + "Newtonsoft.Json": "13.0.3" + } + }, + "NJsonSchema.Annotations": { + "type": "Transitive", + "resolved": "11.1.0", + "contentHash": "2gU72pKhMLrQt7TjHv+nrb8CxxgUaBk2SD/CaB5f00SxuWdOT4YVQaGy+jTVx+8IgQit+9WWMvBWU9f6U2HNiQ==" + }, + "NJsonSchema.NewtonsoftJson": { + "type": "Transitive", + "resolved": "11.1.0", + "contentHash": "7eC9PNAqHt2RU1CWz4xzZsBdTWCOVH1dpytV2UF5vifi8gOOEAftPdTRUw9O0txNTY65AQUvHU0+P7yuCGWo/g==", + "dependencies": { + "NJsonSchema": "11.1.0", + "Newtonsoft.Json": "13.0.3" + } + }, + "NuGet.Common": { + "type": "Transitive", + "resolved": "6.12.1", + "contentHash": "nk8nTdhQl4x2VaAQUvefI7DDYAuBDlE+OZZRffm50Qx5dUAEq8wkc5JIqrN2lTEohObHPI/SXyG2UFdMQkrdyg==", + "dependencies": { + "NuGet.Frameworks": "6.12.1" + } + }, + "NuGet.Configuration": { + "type": "Transitive", + "resolved": "6.12.1", + "contentHash": "IRwlY1379ZgJ0oEJvjD+lDuOhJ5S1fsU5n/bEC5/i0+N9bo2WIMDAdaQ/qIdyK/gMJ/YWS+++GSX6rN7luqEvg==", + "dependencies": { + "NuGet.Common": "6.12.1", + "System.Security.Cryptography.ProtectedData": "4.4.0" + } + }, + "NuGet.Frameworks": { + "type": "Transitive", + "resolved": "6.12.1", + "contentHash": "kPaRD5RJC0ByUg+yGX6bDz5XHMI7OYmQwP8kbtef+vZ+csj/VDb5Bwas4ChxwhoAbI8lEvwP5/3aViQPpgNBow==" + }, + "NuGet.Packaging": { + "type": "Transitive", + "resolved": "6.12.1", + "contentHash": "6s5NO3VNX6fIx6GwuWZtIsal9W1xkelYd3Vg2KUAg1zGqnKC3wB5IZlombvVGVGcwyl/A+iDvpUwSvgeDoB3wA==", + "dependencies": { + "Newtonsoft.Json": "13.0.3", + "NuGet.Configuration": "6.12.1", + "NuGet.Versioning": "6.12.1", + "System.Formats.Asn1": "8.0.1", + "System.Security.Cryptography.Pkcs": "6.0.4" + } + }, + "NuGet.Versioning": { + "type": "Transitive", + "resolved": "6.12.1", + "contentHash": "fJ6rFYANDnohFsdpaY79FvrJxI6murmoOxXz6nZlf819F48+IBKMnAIg3oIBRtZq5y498ObMtKnro5IitvizUg==" + }, + "Nuke.Build": { + "type": "Transitive", + "resolved": "9.0.4", + "contentHash": "qqVzABgBcIZVfM+fPPxJz3+aE5wwiKiL3AqeV9qjQnC89998c/PMWInZcGAR9w3Nvli6TgPzuPOfRF3GWwuDFg==", + "dependencies": { + "Microsoft.ApplicationInsights": "2.22.0", + "Microsoft.Extensions.DependencyModel": "9.0.0", + "NJsonSchema": "11.1.0", + "NJsonSchema.NewtonsoftJson": "11.1.0", + "Nuke.Build.Shared": "9.0.4", + "Nuke.ProjectModel": "9.0.4", + "Nuke.SolutionModel": "9.0.4", + "Nuke.Tooling": "9.0.4", + "Nuke.Utilities": "9.0.4", + "Nuke.Utilities.IO.Globbing": "9.0.4", + "Nuke.Utilities.Net": "9.0.4", + "Nuke.Utilities.Text.Json": "9.0.4", + "Nuke.Utilities.Text.Yaml": "9.0.4", + "Serilog.Formatting.Compact": "3.0.0", + "Serilog.Formatting.Compact.Reader": "4.0.0", + "Serilog.Sinks.Console": "6.0.0", + "Serilog.Sinks.File": "6.0.0" + } + }, + "Nuke.Build.Shared": { + "type": "Transitive", + "resolved": "9.0.4", + "contentHash": "RwEKFqMxJ/0E0ubg8MnnbxkcYhGNUhEn7o0btjxWhZXpevG35MBdyMArnIi2q+fFxe/qvFNVIzcpt7FV62ZG3A==", + "dependencies": { + "Nuke.Utilities": "9.0.4", + "System.Text.Json": "8.0.5" + } + }, + "Nuke.ProjectModel": { + "type": "Transitive", + "resolved": "9.0.4", + "contentHash": "875MtBQJ3U6OSEPzHTbcnrCd5+JTEQ3Qr9c+DDqlW+klJhlLPUXkZQF/qh+V1mwcXa62zQmd+Q1JcV5ysJxvJA==", + "dependencies": { + "Microsoft.Build": "17.12.6", + "Microsoft.Build.Framework": "17.12.6", + "Microsoft.Build.Locator": "1.7.8", + "Microsoft.Build.Tasks.Core": "17.12.6", + "Microsoft.Build.Utilities.Core": "17.12.6", + "Nuke.SolutionModel": "9.0.4", + "Nuke.Tooling": "9.0.4", + "Nuke.Utilities": "9.0.4" + } + }, + "Nuke.SolutionModel": { + "type": "Transitive", + "resolved": "9.0.4", + "contentHash": "Xb5Mf1fN/FSiST2SltKGfDbQSsDhchbHvRvd/KsqazId/HhQO9YRHBMIWJExV1PrI9PsFqjYnM5CbRJtPNP//A==", + "dependencies": { + "Nuke.Utilities": "9.0.4" + } + }, + "Nuke.Tooling": { + "type": "Transitive", + "resolved": "9.0.4", + "contentHash": "webikFwIKyW16Y3Hdm6a4h5n+KHl3w654WY3rqA+OijK5F6ehsNXUGrnrMdKHa90wdBoDiwuYb7rFspr5c0e/w==", + "dependencies": { + "Newtonsoft.Json": "13.0.3", + "NuGet.Packaging": "6.12.1", + "Nuke.Utilities": "9.0.4", + "Nuke.Utilities.Text.Json": "9.0.4", + "Serilog": "4.2.0" + } + }, + "Nuke.Utilities": { + "type": "Transitive", + "resolved": "9.0.4", + "contentHash": "KUaLNxcnjmT0zkEPkENvPiZpnu4FOi95zSJoiE1sNIoD3IWffxhIgy1gziBjDywsAm6u4EaHe7/GnwgZIwTQjw==", + "dependencies": { + "JetBrains.Annotations": "2024.3.0" + } + }, + "Nuke.Utilities.IO.Compression": { + "type": "Transitive", + "resolved": "9.0.4", + "contentHash": "KRxCkDuWLQh69n40H0ORIMdzhfdPiSJmpYp+jxiQ4ZyaByuMrpIr3YVGLzDJT+7ErxhLAcfEwLAMkt9gFkTF9g==", + "dependencies": { + "Nuke.Utilities": "9.0.4", + "SharpZipLib": "1.4.2" + } + }, + "Nuke.Utilities.IO.Globbing": { + "type": "Transitive", + "resolved": "9.0.4", + "contentHash": "eJK2qX/97Clx8mXRBg+GnI8hmd1HFTvACaujrnCElKMt/kJZdjdy4eaAutekvciidywXBj0J9OSObDHXts/q+w==", + "dependencies": { + "Glob": "1.1.9", + "Nuke.Utilities": "9.0.4" + } + }, + "Nuke.Utilities.Net": { + "type": "Transitive", + "resolved": "9.0.4", + "contentHash": "UtHziv6iI3M2oaeRONQREAtVJbjCmR0fV2QaWRVQX+oC09R3mTJ/JWEBIE/QUq53OYQr9GWwIsA/Wz7v39AYKg==", + "dependencies": { + "Newtonsoft.Json": "13.0.3", + "Nuke.Utilities": "9.0.4", + "System.Net.Http": "4.3.4" + } + }, + "Nuke.Utilities.Text.Json": { + "type": "Transitive", + "resolved": "9.0.4", + "contentHash": "Cf+q4M1oaR254dapSR811PUC0t12mqIAUmCk2jwGHEtW/QRoEHYl9/L5lYzVEd62Tig9TuvBMiZmWnNyE9CmgA==", + "dependencies": { + "Newtonsoft.Json": "13.0.3", + "Nuke.Utilities": "9.0.4" + } + }, + "Nuke.Utilities.Text.Yaml": { + "type": "Transitive", + "resolved": "9.0.4", + "contentHash": "/bRdrdXTa7R1ue/+POqdEQDFrwjbYETmQFla4/Ti3ucvsPPjd8ywNTi0Q1gJb63GlncEKYFKLW3dCzs+7SvxLA==", + "dependencies": { + "Nuke.Utilities": "9.0.4", + "YamlDotNet": "16.3.0" + } + }, + "Octokit": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "tjXTa2FXzbd3n17VWpi8UXe05EIJqHcWJW8C2kukftIve00duWiZL8x4i1vlZQ0zQ4RbRANbRc7J5K7Co/1spQ==" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": { + "type": "Transitive", + "resolved": "4.3.2", + "contentHash": "7VSGO0URRKoMEAq0Sc9cRz8mb6zbyx/BZDEWhgPdzzpmFhkam3fJ1DAGWFXBI4nGlma+uPKpfuMQP5LXRnOH5g==" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": { + "type": "Transitive", + "resolved": "4.3.2", + "contentHash": "0oAaTAm6e2oVH+/Zttt0cuhGaePQYKII1dY8iaqP7CvOpVKgLybKRFvQjXR2LtxXOXTVPNv14j0ot8uV+HrUmw==" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": { + "type": "Transitive", + "resolved": "4.3.2", + "contentHash": "G24ibsCNi5Kbz0oXWynBoRgtGvsw5ZSVEWjv13/KiCAM8C6wz9zzcCniMeQFIkJ2tasjo2kXlvlBZhplL51kGg==" + }, + "runtime.native.System": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0" + } + }, + "runtime.native.System.Net.Http": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0" + } + }, + "runtime.native.System.Security.Cryptography.Apple": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl": { + "type": "Transitive", + "resolved": "4.3.2", + "contentHash": "QR1OwtwehHxSeQvZKXe+iSd+d3XZNkEcuWMFYa2i0aG1l+lR739HPicKMlTbJst3spmeekDVBUS7SeS26s4U/g==", + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": { + "type": "Transitive", + "resolved": "4.3.2", + "contentHash": "I+GNKGg2xCHueRd1m9PzeEW7WLbNNLznmTuEi8/vZX71HudUbx1UTwlGkiwMri7JLl8hGaIAWnA/GONhu+LOyQ==" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": { + "type": "Transitive", + "resolved": "4.3.2", + "contentHash": "1Z3TAq1ytS1IBRtPXJvEUZdVsfWfeNEhBkbiOCGEl9wwAfsjP2lz3ZFDx5tq8p60/EqbS0HItG5piHuB71RjoA==" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": { + "type": "Transitive", + "resolved": "4.3.2", + "contentHash": "6mU/cVmmHtQiDXhnzUImxIcDL48GbTk+TsptXyJA+MIOG9LRjPoAQC/qBFB7X+UNyK86bmvGwC8t+M66wsYC8w==" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": { + "type": "Transitive", + "resolved": "4.3.2", + "contentHash": "vjwG0GGcTW/PPg6KVud8F9GLWYuAV1rrw1BKAqY0oh4jcUqg15oYF1+qkGR2x2ZHM4DQnWKQ7cJgYbfncz/lYg==" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": { + "type": "Transitive", + "resolved": "4.3.2", + "contentHash": "7KMFpTkHC/zoExs+PwP8jDCWcrK9H6L7soowT80CUx3e+nxP/AFnq0AQAW5W76z2WYbLAYCRyPfwYFG6zkvQRw==" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": { + "type": "Transitive", + "resolved": "4.3.2", + "contentHash": "xrlmRCnKZJLHxyyLIqkZjNXqgxnKdZxfItrPkjI+6pkRo5lHX8YvSZlWrSI5AVwLMi4HbNWP7064hcAWeZKp5w==" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": { + "type": "Transitive", + "resolved": "4.3.2", + "contentHash": "leXiwfiIkW7Gmn7cgnNcdtNAU70SjmKW3jxGj1iKHOvdn0zRWsgv/l2OJUO5zdGdiv2VRFnAsxxhDgMzofPdWg==" + }, + "Serilog": { + "type": "Transitive", + "resolved": "4.2.0", + "contentHash": "gmoWVOvKgbME8TYR+gwMf7osROiWAURterc6Rt2dQyX7wtjZYpqFiA/pY6ztjGQKKV62GGCyOcmtP1UKMHgSmA==" + }, + "Serilog.Formatting.Compact": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "wQsv14w9cqlfB5FX2MZpNsTawckN4a8dryuNGbebB/3Nh1pXnROHZov3swtu3Nj5oNG7Ba+xdu7Et/ulAUPanQ==", + "dependencies": { + "Serilog": "4.0.0" + } + }, + "Serilog.Formatting.Compact.Reader": { + "type": "Transitive", + "resolved": "4.0.0", + "contentHash": "E1gvPAx0AsQhlyzGwgcVnGe5QrdkSugwKh+6V/FUSdTMVKKPSiO6Ff5iosjBMNBvq244Zys7BhTfFmgCE0KUyQ==", + "dependencies": { + "Newtonsoft.Json": "13.0.3", + "Serilog": "4.0.0" + } + }, + "Serilog.Sinks.Console": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "fQGWqVMClCP2yEyTXPIinSr5c+CBGUvBybPxjAGcf7ctDhadFhrQw03Mv8rJ07/wR5PDfFjewf2LimvXCDzpbA==", + "dependencies": { + "Serilog": "4.0.0" + } + }, + "Serilog.Sinks.File": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "lxjg89Y8gJMmFxVkbZ+qDgjl+T4yC5F7WSLTvA+5q0R04tfKVLRL/EHpYoJ/MEQd2EeCKDuylBIVnAYMotmh2A==", + "dependencies": { + "Serilog": "4.0.0" + } + }, + "SharpZipLib": { + "type": "Transitive", + "resolved": "1.4.2", + "contentHash": "yjj+3zgz8zgXpiiC3ZdF/iyTBbz2fFvMxZFEBPUcwZjIvXOf37Ylm+K58hqMfIBt5JgU/Z2uoUS67JmTLe973A==" + }, + "System.Buffers": { + "type": "Transitive", + "resolved": "4.6.0", + "contentHash": "lN6tZi7Q46zFzAbRYXTIvfXcyvQQgxnY7Xm6C6xQ9784dEL1amjM6S6Iw4ZpsvesAKnRVsM4scrDQaDqSClkjA==" + }, + "System.ClientModel": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "UocOlCkxLZrG2CKMAAImPcldJTxeesHnHGHwhJ0pNlZEvEXcWKuQvVOER2/NiOkJGRJk978SNdw3j6/7O9H1lg==", + "dependencies": { + "System.Memory.Data": "1.0.2", + "System.Text.Json": "6.0.9" + } + }, + "System.CodeDom": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "WTlRjL6KWIMr/pAaq3rYqh0TJlzpouaQ/W1eelssHgtlwHAH25jXTkUphTYx9HaIIf7XA6qs/0+YhtLEQRkJ+Q==" + }, + "System.Collections": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==" + }, + "System.Configuration.ConfigurationManager": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "JlYi9XVvIREURRUlGMr1F6vOFLk7YSY4p1vHo4kX3tQ0AGrjqlRWHDi66ImHhy6qwXBG3BJ6Y1QlYQ+Qz6Xgww==", + "dependencies": { + "System.Diagnostics.EventLog": "8.0.0", + "System.Security.Cryptography.ProtectedData": "8.0.0" + } + }, + "System.Diagnostics.Debug": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "6.0.1", + "contentHash": "KiLYDu2k2J82Q9BJpWiuQqCkFjRBWVq4jDzKKWawVi9KWzyD0XG3cmfX0vqTQlL14Wi9EufJrbL0+KCLTbqWiQ==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Diagnostics.EventLog": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A==" + }, + "System.Diagnostics.Tracing": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Linq": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + } + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.5", + "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==" + }, + "System.Memory.Data": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "ntFHArH3I4Lpjf5m4DCXQHJuGwWPNVJPaAvM95Jy/u+2Yzt2ryiyIN04LAogkjP9DeRcEOiviAjQotfmPq/FrQ==", + "dependencies": { + "System.Text.Json": "6.0.0" + } + }, + "System.Net.Http": { + "type": "Transitive", + "resolved": "4.3.4", + "contentHash": "aOa2d51SEbmM+H+Csw7yJOuNZoHkrP2XnAurye5HWYgGVVU54YZDvsLUYRv6h18X3sPnjNCANmN7ZhIPiqMcjA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.DiagnosticSource": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.Net.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" + } + }, + "System.Net.Primitives": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "qOu+hDwFwoZPbzPvwut2qATe3ygjeQBDQj91xlsaqGFQUI5i4ZnZb8yyQuLGpDGivEPIt8EJkd1BVzVoP31FXA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Numerics.Vectors": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + }, + "System.Reflection": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==", + "dependencies": { + "System.Collections.Immutable": "8.0.0" + } + }, + "System.Reflection.MetadataLoadContext": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "SZxrQ4sQYnIcdwiO3G/lHZopbPYQ2lW0ioT4JezgccWUrKaKbHLJbAGZaDfkYjWcta1pWssAo3MOXLsR0ie4tQ==", + "dependencies": { + "System.Collections.Immutable": "8.0.0", + "System.Reflection.Metadata": "8.0.0" + } + }, + "System.Reflection.Primitives": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Resources.Extensions": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "psnQ6GRQOvt+evda5C4nD5EuV49mz2Tv0DD2JDVDEbE/TKoMukxSkGJcsBJ0pajpPuFRr67syFYlkJ4Wj6A5Zw==" + }, + "System.Resources.ResourceManager": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0" + } + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Runtime.Extensions": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + } + }, + "System.Security.Cryptography.Algorithms": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Cng": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.OpenSsl": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Pkcs": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "ULmp3xoOwNYjOYp4JZ2NK/6NdTgiN1GQXzVVN1njQ7LOZ0d0B9vyMnhyqbIi9Qw4JXj1JgCsitkTShboHRx7Eg==", + "dependencies": { + "System.Formats.Asn1": "8.0.0" + } + }, + "System.Security.Cryptography.Primitives": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Security.Cryptography.ProtectedData": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==" + }, + "System.Security.Cryptography.X509Certificates": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Xml": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "HQSFbakswZ1OXFz2Bt3AJlC6ENDqWeVpgqhf213xqQUMDifzydOHIKVb1RV4prayobvR3ETIScMaQdDF2hwGZA==", + "dependencies": { + "System.Security.Cryptography.Pkcs": "8.0.0" + } + }, + "System.Text.Encoding": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encodings.Web": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Text.Json": { + "type": "Transitive", + "resolved": "8.0.5", + "contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg==" + }, + "System.Threading": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Threading.Tasks": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==" + }, + "YamlDotNet": { + "type": "Transitive", + "resolved": "16.3.0", + "contentHash": "SgMOdxbz8X65z8hraIs6hOEdnkH6hESTAIUa7viEngHOYaH+6q5XJmwr1+yb9vJpNQ19hCQY69xbFsLtXpobQA==" + }, + "ZstdSharp.Port": { + "type": "Transitive", + "resolved": "0.8.5", + "contentHash": "TR4j17WeVSEb3ncgL2NqlXEqcy04I+Kk9CaebNDplUeL8XOgjkZ7fP4Wg4grBdPLIqsV86p2QaXTkZoRMVOsew==" + } + } + } +} \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 320a81a190..8829ec6d3b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,6 +3,8 @@ 13.0 false true + true + true diff --git a/Src/FluentAssertions/packages.lock.json b/Src/FluentAssertions/packages.lock.json new file mode 100644 index 0000000000..7bee92eba3 --- /dev/null +++ b/Src/FluentAssertions/packages.lock.json @@ -0,0 +1,165 @@ +{ + "version": 1, + "dependencies": { + ".NETFramework,Version=v4.7": { + "JetBrains.Annotations": { + "type": "Direct", + "requested": "[2024.3.0, )", + "resolved": "2024.3.0", + "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" + }, + "PolySharp": { + "type": "Direct", + "requested": "[1.15.0, )", + "resolved": "1.15.0", + "contentHash": "FbU0El+EEjdpuIX4iDbeS7ki1uzpJPx8vbqOzEtqnl1GZeAGJfq+jCbxeJL2y0EPnUNk8dRnnqR2xnYXg9Tf+g==" + }, + "Reflectify": { + "type": "Direct", + "requested": "[1.6.0, )", + "resolved": "1.6.0", + "contentHash": "49yzx5GWHID011rGvMmcYTN+MTsfEwCVFMsTPwicjeBS3/gEj2xyB4IuFbPXDdOiw1N9n3AUhaNt3oMBHzAZIQ==" + }, + "System.Threading.Tasks.Extensions": { + "type": "Direct", + "requested": "[4.5.4, )", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" + } + }, + ".NETStandard,Version=v2.0": { + "JetBrains.Annotations": { + "type": "Direct", + "requested": "[2024.3.0, )", + "resolved": "2024.3.0", + "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" + }, + "NETStandard.Library": { + "type": "Direct", + "requested": "[2.0.3, )", + "resolved": "2.0.3", + "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "PolySharp": { + "type": "Direct", + "requested": "[1.15.0, )", + "resolved": "1.15.0", + "contentHash": "FbU0El+EEjdpuIX4iDbeS7ki1uzpJPx8vbqOzEtqnl1GZeAGJfq+jCbxeJL2y0EPnUNk8dRnnqR2xnYXg9Tf+g==" + }, + "Reflectify": { + "type": "Direct", + "requested": "[1.6.0, )", + "resolved": "1.6.0", + "contentHash": "49yzx5GWHID011rGvMmcYTN+MTsfEwCVFMsTPwicjeBS3/gEj2xyB4IuFbPXDdOiw1N9n3AUhaNt3oMBHzAZIQ==" + }, + "System.Threading.Tasks.Extensions": { + "type": "Direct", + "requested": "[4.5.4, )", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" + } + }, + ".NETStandard,Version=v2.1": { + "JetBrains.Annotations": { + "type": "Direct", + "requested": "[2024.3.0, )", + "resolved": "2024.3.0", + "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" + }, + "PolySharp": { + "type": "Direct", + "requested": "[1.15.0, )", + "resolved": "1.15.0", + "contentHash": "FbU0El+EEjdpuIX4iDbeS7ki1uzpJPx8vbqOzEtqnl1GZeAGJfq+jCbxeJL2y0EPnUNk8dRnnqR2xnYXg9Tf+g==" + }, + "Reflectify": { + "type": "Direct", + "requested": "[1.6.0, )", + "resolved": "1.6.0", + "contentHash": "49yzx5GWHID011rGvMmcYTN+MTsfEwCVFMsTPwicjeBS3/gEj2xyB4IuFbPXDdOiw1N9n3AUhaNt3oMBHzAZIQ==" + } + }, + "net6.0": { + "CSharpGuidelinesAnalyzer": { + "type": "Direct", + "requested": "[3.8.5, )", + "resolved": "3.8.5", + "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" + }, + "JetBrains.Annotations": { + "type": "Direct", + "requested": "[2024.3.0, )", + "resolved": "2024.3.0", + "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" + }, + "Meziantou.Analyzer": { + "type": "Direct", + "requested": "[2.0.212, )", + "resolved": "2.0.212", + "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" + }, + "PolySharp": { + "type": "Direct", + "requested": "[1.15.0, )", + "resolved": "1.15.0", + "contentHash": "FbU0El+EEjdpuIX4iDbeS7ki1uzpJPx8vbqOzEtqnl1GZeAGJfq+jCbxeJL2y0EPnUNk8dRnnqR2xnYXg9Tf+g==" + }, + "Reflectify": { + "type": "Direct", + "requested": "[1.6.0, )", + "resolved": "1.6.0", + "contentHash": "49yzx5GWHID011rGvMmcYTN+MTsfEwCVFMsTPwicjeBS3/gEj2xyB4IuFbPXDdOiw1N9n3AUhaNt3oMBHzAZIQ==" + }, + "Roslynator.Analyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" + }, + "StyleCop.Analyzers": { + "type": "Direct", + "requested": "[1.2.0-beta.556, )", + "resolved": "1.2.0-beta.556", + "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", + "dependencies": { + "StyleCop.Analyzers.Unstable": "1.2.0.556" + } + }, + "StyleCop.Analyzers.Unstable": { + "type": "Transitive", + "resolved": "1.2.0.556", + "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" + } + } + } +} \ No newline at end of file diff --git a/Tests/Approval.Tests/packages.lock.json b/Tests/Approval.Tests/packages.lock.json new file mode 100644 index 0000000000..f217dd0db6 --- /dev/null +++ b/Tests/Approval.Tests/packages.lock.json @@ -0,0 +1,197 @@ +{ + "version": 1, + "dependencies": { + "net8.0": { + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0", + "Microsoft.TestPlatform.TestHost": "17.13.0" + } + }, + "PublicApiGenerator": { + "type": "Direct", + "requested": "[11.4.6, )", + "resolved": "11.4.6", + "contentHash": "dg+b2XIWu2n+ifCo91UHrFAXJvpAHTU4GlNbPUewDqAmiGFo1wV0DSdJiC++HMWtHfcCYBIwRkT2Fhi9vv3new==", + "dependencies": { + "Mono.Cecil": "0.11.6", + "System.CodeDom": "6.0.0" + } + }, + "Verify.DiffPlex": { + "type": "Direct", + "requested": "[3.1.2, )", + "resolved": "3.1.2", + "contentHash": "ySaQ+MffcDfGWzBXB9UHppEGBqzl0L+2CxZcT04xQ3gugsN5AAjBPHkt75Ca61PlAeZCyty/p/Q9ZwaQjNOoTg==", + "dependencies": { + "DiffPlex": "1.7.2", + "Verify": "27.0.0" + } + }, + "Verify.Xunit": { + "type": "Direct", + "requested": "[30.6.1, )", + "resolved": "30.6.1", + "contentHash": "hsR/sOrWHrQYT3Dvz62vKNsws0UU2AZwB+K61j6JA7NOFtPMcZ6EWxssxQnWGQLu8q5edotkNwxP8BOUKgxI2w==", + "dependencies": { + "Argon": "0.30.1", + "DiffEngine": "16.2.3", + "SimpleInfoName": "3.1.2", + "Verify": "30.6.1", + "xunit.abstractions": "2.0.3", + "xunit.extensibility.execution": "2.9.3" + } + }, + "xunit": { + "type": "Direct", + "requested": "[2.9.3, )", + "resolved": "2.9.3", + "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", + "dependencies": { + "xunit.analyzers": "1.18.0", + "xunit.assert": "2.9.3", + "xunit.core": "[2.9.3]" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[3.1.3, )", + "resolved": "3.1.3", + "contentHash": "go7e81n/UI3LeNqoJIJ3thkS4JfJtiQnDbAxLh09JkJqoHthnfbLS5p68s4/Bm12B9umkoYSB5SaDr68hZNleg==" + }, + "Argon": { + "type": "Transitive", + "resolved": "0.30.1", + "contentHash": "kjKnBzxJ1Xp4Sh9B7inrP1YjefXH4X8hV4/J5EoDKloog09Kp4KUVoJS8xxYfUbUzJ+Xe5PKZm3hj5pi4ZuCZw==" + }, + "DiffEngine": { + "type": "Transitive", + "resolved": "16.2.3", + "contentHash": "QWnG0MR3//Ss0G0N9mIfe1HLOrOIRZqau0AOiLt9Gm53ZQf/TLvzoccTkczEW5ACkbhRY5m+p+W7bzFVln2GDw==", + "dependencies": { + "EmptyFiles": "8.10.1", + "System.Management": "8.0.0" + } + }, + "DiffPlex": { + "type": "Transitive", + "resolved": "1.7.2", + "contentHash": "qJEjdxEDBWSFZGB8paBB9HDeJXHGlHlOXeGX3kbTuXWuOsgv2iSAEOOzo5V1/B39Vcxr9IVVrNKewRcX+rsn4g==" + }, + "EmptyFiles": { + "type": "Transitive", + "resolved": "8.10.1", + "contentHash": "vhLPAqdKuo2qjVkrJbCyacGXO9XTha7G1R5amw44m877FDR/gqFjCfdncj8VyHAC6eNqrCXgYTbHJGO5+l3TJg==" + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "Mono.Cecil": { + "type": "Transitive", + "resolved": "0.11.6", + "contentHash": "f33RkDtZO8VlGXCtmQIviOtxgnUdym9xx/b1p9h91CRGOsJFxCFOFK1FDbVt1OCf1aWwYejUFa2MOQyFWTFjbA==" + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + }, + "SimpleInfoName": { + "type": "Transitive", + "resolved": "3.1.2", + "contentHash": "/OoEZQxSW6DeTJ9nfrg8BLCOCWpxBiWHV4NkG3t+Xpe8tvzm7yCwKwxkhpauMl3fg9OjlIjJMKX61H6VavLkrw==" + }, + "System.CodeDom": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "WTlRjL6KWIMr/pAaq3rYqh0TJlzpouaQ/W1eelssHgtlwHAH25jXTkUphTYx9HaIIf7XA6qs/0+YhtLEQRkJ+Q==" + }, + "System.Management": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "jrK22i5LRzxZCfGb+tGmke2VH7oE0DvcDlJ1HAKYU8cPmD8XnpUT0bYn2Gy98GEhGjtfbR/sxKTVb+dE770pfA==", + "dependencies": { + "System.CodeDom": "8.0.0" + } + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "Verify": { + "type": "Transitive", + "resolved": "30.6.1", + "contentHash": "CaAYyNjKxM1sygsrEPPNZ7LHasV4/wPugdTNTXagpxQVsR/tz9/J/tgRqkxWXTntTEyxqqxZvdc3t46tmVK7ig==", + "dependencies": { + "Argon": "0.30.1", + "DiffEngine": "16.2.3", + "SimpleInfoName": "3.1.2" + } + }, + "xunit.abstractions": { + "type": "Transitive", + "resolved": "2.0.3", + "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.18.0", + "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" + }, + "xunit.assert": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" + }, + "xunit.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]", + "xunit.extensibility.execution": "[2.9.3]" + } + }, + "xunit.extensibility.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", + "dependencies": { + "xunit.abstractions": "2.0.3" + } + }, + "xunit.extensibility.execution": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/AssemblyA/packages.lock.json b/Tests/AssemblyA/packages.lock.json new file mode 100644 index 0000000000..8b52531bde --- /dev/null +++ b/Tests/AssemblyA/packages.lock.json @@ -0,0 +1,24 @@ +{ + "version": 1, + "dependencies": { + ".NETStandard,Version=v2.0": { + "NETStandard.Library": { + "type": "Direct", + "requested": "[2.0.3, )", + "resolved": "2.0.3", + "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + }, + "assemblyb": { + "type": "Project" + } + } + } +} \ No newline at end of file diff --git a/Tests/AssemblyB/packages.lock.json b/Tests/AssemblyB/packages.lock.json new file mode 100644 index 0000000000..b7e843ee28 --- /dev/null +++ b/Tests/AssemblyB/packages.lock.json @@ -0,0 +1,21 @@ +{ + "version": 1, + "dependencies": { + ".NETStandard,Version=v2.0": { + "NETStandard.Library": { + "type": "Direct", + "requested": "[2.0.3, )", + "resolved": "2.0.3", + "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + } + } + } +} \ No newline at end of file diff --git a/Tests/Benchmarks/packages.lock.json b/Tests/Benchmarks/packages.lock.json new file mode 100644 index 0000000000..ac649aba0e --- /dev/null +++ b/Tests/Benchmarks/packages.lock.json @@ -0,0 +1,673 @@ +{ + "version": 1, + "dependencies": { + ".NETFramework,Version=v4.7.2": { + "BenchmarkDotNet": { + "type": "Direct", + "requested": "[0.15.2, )", + "resolved": "0.15.2", + "contentHash": "5vl4nQFUGTKgOVE5LNoLpv/X/wFQ7wE5yiaJAXCpzgNtUADtfEwbuufKI4o5E2De0VTXNEeom5Hnv8S8vuBZtg==", + "dependencies": { + "BenchmarkDotNet.Annotations": "0.15.2", + "CommandLineParser": "2.9.1", + "Gee.External.Capstone": "2.3.0", + "Iced": "1.21.0", + "Microsoft.CodeAnalysis.CSharp": "4.14.0", + "Microsoft.Diagnostics.Runtime": "3.1.512801", + "Microsoft.Diagnostics.Tracing.TraceEvent": "3.1.21", + "Microsoft.DotNet.PlatformAbstractions": "3.1.6", + "Microsoft.Win32.Registry": "5.0.0", + "Perfolizer": "[0.5.3]", + "System.Management": "9.0.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Emit": "4.7.0", + "System.Reflection.Emit.Lightweight": "4.7.0", + "System.Threading.Tasks.Extensions": "4.6.3" + } + }, + "System.Reflection.Metadata": { + "type": "Direct", + "requested": "[9.0.2, )", + "resolved": "9.0.2", + "contentHash": "O8jVwZjj9gd4bmqRP1wpe8myBwQ/a99fn2f6hMfBkgXTTOUQQuDcK0zNgyOAqPX+nPFufQUCl7XxrZxaMtZ/xg==", + "dependencies": { + "System.Collections.Immutable": "9.0.2", + "System.Memory": "4.5.5" + } + }, + "BenchmarkDotNet.Annotations": { + "type": "Transitive", + "resolved": "0.15.2", + "contentHash": "a7rVlVmXQRrp3J+HF/FtjwiFcshU6BAuv6U1xtAbqCUYepOEnNGaPeOFvy4It17QZwwofm6U/GAfW3JrFMXszg==" + }, + "CommandLineParser": { + "type": "Transitive", + "resolved": "2.9.1", + "contentHash": "OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==" + }, + "Gee.External.Capstone": { + "type": "Transitive", + "resolved": "2.3.0", + "contentHash": "2ap/rYmjtzCOT8hxrnEW/QeiOt+paD8iRrIcdKX0cxVwWLFa1e+JDBNeECakmccXrSFeBQuu5AV8SNkipFMMMw==" + }, + "Iced": { + "type": "Transitive", + "resolved": "1.21.0", + "contentHash": "dv5+81Q1TBQvVMSOOOmRcjJmvWcX3BZPZsIq31+RLc5cNft0IHAyNlkdb7ZarOWG913PyBoFDsDXoCIlKmLclg==" + }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "3WA9q9yVqJp222P3x1wYIGDAkpjAku0TMUaaQV22g6L67AI0LdOIrVS7Ht2vJfLHGSPVuqN94vIr15qn+HEkHw==", + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.CodeAnalysis.Analyzers": { + "type": "Transitive", + "resolved": "3.11.0", + "contentHash": "v/EW3UE8/lbEYHoC2Qq7AR/DnmvpgdtAMndfQNmpuIMx/Mto8L5JnuCfdBYtgvalQOtfNCnxFejxuRrryvUTsg==" + }, + "Microsoft.CodeAnalysis.Common": { + "type": "Transitive", + "resolved": "4.14.0", + "contentHash": "PC3tuwZYnC+idaPuoC/AZpEdwrtX7qFpmnrfQkgobGIWiYmGi5MCRtl5mx6QrfMGQpK78X2lfIEoZDLg/qnuHg==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.11.0", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "9.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "9.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encoding.CodePages": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.CodeAnalysis.CSharp": { + "type": "Transitive", + "resolved": "4.14.0", + "contentHash": "568a6wcTivauIhbeWcCwfWwIn7UV7MeHEBvFB2uzGIpM2OhJ4eM/FZ8KS0yhPoNxnSpjGzz7x7CIjTxhslojQA==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.11.0", + "Microsoft.CodeAnalysis.Common": "[4.14.0]", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "9.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "9.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encoding.CodePages": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.Diagnostics.NETCore.Client": { + "type": "Transitive", + "resolved": "0.2.510501", + "contentHash": "juoqJYMDs+lRrrZyOkXXMImJHneCF23cuvO4waFRd2Ds7j+ZuGIPbJm0Y/zz34BdeaGiiwGWraMUlln05W1PCQ==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "System.Buffers": "4.5.1" + } + }, + "Microsoft.Diagnostics.Runtime": { + "type": "Transitive", + "resolved": "3.1.512801", + "contentHash": "0lMUDr2oxNZa28D6NH5BuSQEe5T9tZziIkvkD44YkkCGQXPJqvFjLq5ZQq1hYLl3RjQJrY+hR0jFgap+EWPDTw==", + "dependencies": { + "Microsoft.Diagnostics.NETCore.Client": "0.2.410101", + "System.Collections.Immutable": "6.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "Microsoft.Diagnostics.Tracing.TraceEvent": { + "type": "Transitive", + "resolved": "3.1.21", + "contentHash": "/OrJFKaojSR6TkUKtwh8/qA9XWNtxLrXMqvEb89dBSKCWjaGVTbKMYodIUgF5deCEtmd6GXuRerciXGl5bhZ7Q==", + "dependencies": { + "Microsoft.Diagnostics.NETCore.Client": "0.2.510501", + "Microsoft.Win32.Registry": "5.0.0", + "System.Collections.Immutable": "8.0.0", + "System.Reflection.Metadata": "8.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Json": "8.0.5" + } + }, + "Microsoft.DotNet.PlatformAbstractions": { + "type": "Transitive", + "resolved": "3.1.6", + "contentHash": "jek4XYaQ/PGUwDKKhwR8K47Uh1189PFzMeLqO83mXrXQVIpARZCcfuDedH50YDTepBkfijCZN5U/vZi++erxtg==", + "dependencies": { + "System.Runtime.InteropServices.RuntimeInformation": "4.0.0" + } + }, + "Microsoft.Extensions.DependencyInjection": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.Extensions.Logging": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "eIbyj40QDg1NDz0HBW0S5f3wrLVnKWnDJ/JtZ+yJDFnDj90VoPuoPmFkeaXrtu+0cKm5GRAwoDf+dBWXK0TUdg==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.Extensions.DependencyInjection": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "System.Diagnostics.DiagnosticSource": "6.0.0", + "System.ValueTuple": "4.5.0" + } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + } + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "dzXN0+V1AyjOe2xcJ86Qbo233KHuLEY0njf/P2Kw8SfJU+d45HNS2ctJdnEnrWbM9Ye2eFgaC5Mj9otRMU6IsQ==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==", + "dependencies": { + "System.Memory": "4.5.4", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "Microsoft.Win32.Registry": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "Perfolizer": { + "type": "Transitive", + "resolved": "0.5.3", + "contentHash": "EhHo0s4y+tHJKhZHgQvPgFWhAhnQpHHuFzutRzfqfv5z763wvhzXh849ZtpVePQNxXWoFafh1Ta2tZgnSIVsYQ==", + "dependencies": { + "System.Memory": "4.5.5" + } + }, + "System.Buffers": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + }, + "System.CodeDom": { + "type": "Transitive", + "resolved": "9.0.5", + "contentHash": "cuzLM2MWutf9ZBEMPYYfd0DXwYdvntp7VCT6a/wvbKCa2ZuvGmW74xi+YBa2mrfEieAXqM4TNKlMmSnfAfpUoQ==" + }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "9.0.2", + "contentHash": "QKh9+kczG7TQbQZ6tF2S6bK9B8ewHXEkYmMP2iqefzwJEfEkiflheAX6VEaPLJ6Tq9RoKuQ5R3qPYla6wJ6Opg==", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "frQDfv0rl209cKm1lnwTgFPzNigy2EKk1BS3uAvHvlBVKe5cymGyHO+Sj+NLv5VF/AhHsqPIUUwya5oV4CHMUw==", + "dependencies": { + "System.Memory": "4.5.4", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Management": { + "type": "Transitive", + "resolved": "9.0.5", + "contentHash": "n6o9PZm9p25+zAzC3/48K0oHnaPKTInRrxqFq1fi/5TPbMLjuoCm/h//mS3cUmSy+9AO1Z+qsC/Ilt/ZFatv5Q==", + "dependencies": { + "System.CodeDom": "9.0.5" + } + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.5", + "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "System.Numerics.Vectors": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + }, + "System.Reflection.Emit": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "VR4kk8XLKebQ4MZuKuIni/7oh+QGFmZW3qORd1GvBq/8026OpW501SzT/oypwiQl4TvT8ErnReh/NzY9u+C6wQ==" + }, + "System.Reflection.Emit.Lightweight": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "a4OLB4IITxAXJeV74MDx49Oq2+PsF6Sml54XAFv+2RyWwtDBcabzoxiiJRhdhx+gaohLh4hEGCLQyBozXoQPqA==" + }, + "System.Reflection.TypeExtensions": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "VybpaOQQhqE6siHppMktjfGBw1GCwvCqiufqmP8F1nj7fTUNtW35LOEt3UZTEsECfo+ELAl/9o9nJx3U91i7vA==" + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.1.2", + "contentHash": "2hBr6zdbIBTDE3EhK7NSVNdX58uTK6iHW/P/Axmm9sl1xoGSLqDvMtpecn226TNwHByFokYwJmt/aQQNlO5CRw==" + }, + "System.Runtime.InteropServices.RuntimeInformation": { + "type": "Transitive", + "resolved": "4.0.0", + "contentHash": "hWPhJxc453RCa8Z29O91EmfGeZIHX1ZH2A8L6lYQVSaKzku2DfArSfMEb1/MYYzPQRJZeu0c9dmYeJKxW5Fgng==" + }, + "System.Security.AccessControl": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "dependencies": { + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + }, + "System.Text.Encoding.CodePages": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ==", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Text.Encodings.Web": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Text.Json": { + "type": "Transitive", + "resolved": "8.0.5", + "contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "8.0.0", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "8.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + } + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.6.3", + "contentHash": "7sCiwilJLYbTZELaKnc7RecBBXWXA+xMLQWZKWawBxYjp6DBlSE3v9/UcvKBvr1vv2tTOhipiogM8rRmxlhrVA==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.1.2" + } + }, + "System.ValueTuple": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ==" + }, + "fluentassertions": { + "type": "Project", + "dependencies": { + "System.Threading.Tasks.Extensions": "[4.5.4, )" + } + } + }, + ".NETFramework,Version=v4.7.2/win-x86": { + "Gee.External.Capstone": { + "type": "Transitive", + "resolved": "2.3.0", + "contentHash": "2ap/rYmjtzCOT8hxrnEW/QeiOt+paD8iRrIcdKX0cxVwWLFa1e+JDBNeECakmccXrSFeBQuu5AV8SNkipFMMMw==" + }, + "Microsoft.Win32.Registry": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Runtime.InteropServices.RuntimeInformation": { + "type": "Transitive", + "resolved": "4.0.0", + "contentHash": "hWPhJxc453RCa8Z29O91EmfGeZIHX1ZH2A8L6lYQVSaKzku2DfArSfMEb1/MYYzPQRJZeu0c9dmYeJKxW5Fgng==" + }, + "System.Security.AccessControl": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "dependencies": { + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + } + }, + "net8.0": { + "BenchmarkDotNet": { + "type": "Direct", + "requested": "[0.15.2, )", + "resolved": "0.15.2", + "contentHash": "5vl4nQFUGTKgOVE5LNoLpv/X/wFQ7wE5yiaJAXCpzgNtUADtfEwbuufKI4o5E2De0VTXNEeom5Hnv8S8vuBZtg==", + "dependencies": { + "BenchmarkDotNet.Annotations": "0.15.2", + "CommandLineParser": "2.9.1", + "Gee.External.Capstone": "2.3.0", + "Iced": "1.21.0", + "Microsoft.CodeAnalysis.CSharp": "4.14.0", + "Microsoft.Diagnostics.Runtime": "3.1.512801", + "Microsoft.Diagnostics.Tracing.TraceEvent": "3.1.21", + "Microsoft.DotNet.PlatformAbstractions": "3.1.6", + "Perfolizer": "[0.5.3]", + "System.Management": "9.0.5" + } + }, + "BenchmarkDotNet.Annotations": { + "type": "Transitive", + "resolved": "0.15.2", + "contentHash": "a7rVlVmXQRrp3J+HF/FtjwiFcshU6BAuv6U1xtAbqCUYepOEnNGaPeOFvy4It17QZwwofm6U/GAfW3JrFMXszg==" + }, + "CommandLineParser": { + "type": "Transitive", + "resolved": "2.9.1", + "contentHash": "OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==" + }, + "Gee.External.Capstone": { + "type": "Transitive", + "resolved": "2.3.0", + "contentHash": "2ap/rYmjtzCOT8hxrnEW/QeiOt+paD8iRrIcdKX0cxVwWLFa1e+JDBNeECakmccXrSFeBQuu5AV8SNkipFMMMw==" + }, + "Iced": { + "type": "Transitive", + "resolved": "1.21.0", + "contentHash": "dv5+81Q1TBQvVMSOOOmRcjJmvWcX3BZPZsIq31+RLc5cNft0IHAyNlkdb7ZarOWG913PyBoFDsDXoCIlKmLclg==" + }, + "Microsoft.CodeAnalysis.Analyzers": { + "type": "Transitive", + "resolved": "3.11.0", + "contentHash": "v/EW3UE8/lbEYHoC2Qq7AR/DnmvpgdtAMndfQNmpuIMx/Mto8L5JnuCfdBYtgvalQOtfNCnxFejxuRrryvUTsg==" + }, + "Microsoft.CodeAnalysis.Common": { + "type": "Transitive", + "resolved": "4.14.0", + "contentHash": "PC3tuwZYnC+idaPuoC/AZpEdwrtX7qFpmnrfQkgobGIWiYmGi5MCRtl5mx6QrfMGQpK78X2lfIEoZDLg/qnuHg==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.11.0", + "System.Collections.Immutable": "9.0.0", + "System.Reflection.Metadata": "9.0.0" + } + }, + "Microsoft.CodeAnalysis.CSharp": { + "type": "Transitive", + "resolved": "4.14.0", + "contentHash": "568a6wcTivauIhbeWcCwfWwIn7UV7MeHEBvFB2uzGIpM2OhJ4eM/FZ8KS0yhPoNxnSpjGzz7x7CIjTxhslojQA==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.11.0", + "Microsoft.CodeAnalysis.Common": "[4.14.0]", + "System.Collections.Immutable": "9.0.0", + "System.Reflection.Metadata": "9.0.0" + } + }, + "Microsoft.Diagnostics.NETCore.Client": { + "type": "Transitive", + "resolved": "0.2.510501", + "contentHash": "juoqJYMDs+lRrrZyOkXXMImJHneCF23cuvO4waFRd2Ds7j+ZuGIPbJm0Y/zz34BdeaGiiwGWraMUlln05W1PCQ==", + "dependencies": { + "Microsoft.Extensions.Logging": "6.0.0" + } + }, + "Microsoft.Diagnostics.Runtime": { + "type": "Transitive", + "resolved": "3.1.512801", + "contentHash": "0lMUDr2oxNZa28D6NH5BuSQEe5T9tZziIkvkD44YkkCGQXPJqvFjLq5ZQq1hYLl3RjQJrY+hR0jFgap+EWPDTw==", + "dependencies": { + "Microsoft.Diagnostics.NETCore.Client": "0.2.410101" + } + }, + "Microsoft.Diagnostics.Tracing.TraceEvent": { + "type": "Transitive", + "resolved": "3.1.21", + "contentHash": "/OrJFKaojSR6TkUKtwh8/qA9XWNtxLrXMqvEb89dBSKCWjaGVTbKMYodIUgF5deCEtmd6GXuRerciXGl5bhZ7Q==", + "dependencies": { + "Microsoft.Diagnostics.NETCore.Client": "0.2.510501", + "Microsoft.Win32.Registry": "5.0.0", + "System.Collections.Immutable": "8.0.0", + "System.Reflection.Metadata": "8.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Json": "8.0.5" + } + }, + "Microsoft.DotNet.PlatformAbstractions": { + "type": "Transitive", + "resolved": "3.1.6", + "contentHash": "jek4XYaQ/PGUwDKKhwR8K47Uh1189PFzMeLqO83mXrXQVIpARZCcfuDedH50YDTepBkfijCZN5U/vZi++erxtg==" + }, + "Microsoft.Extensions.DependencyInjection": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg==" + }, + "Microsoft.Extensions.Logging": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "eIbyj40QDg1NDz0HBW0S5f3wrLVnKWnDJ/JtZ+yJDFnDj90VoPuoPmFkeaXrtu+0cKm5GRAwoDf+dBWXK0TUdg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "System.Diagnostics.DiagnosticSource": "6.0.0" + } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "dzXN0+V1AyjOe2xcJ86Qbo233KHuLEY0njf/P2Kw8SfJU+d45HNS2ctJdnEnrWbM9Ye2eFgaC5Mj9otRMU6IsQ==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==" + }, + "Microsoft.Win32.Registry": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "Perfolizer": { + "type": "Transitive", + "resolved": "0.5.3", + "contentHash": "EhHo0s4y+tHJKhZHgQvPgFWhAhnQpHHuFzutRzfqfv5z763wvhzXh849ZtpVePQNxXWoFafh1Ta2tZgnSIVsYQ==" + }, + "System.CodeDom": { + "type": "Transitive", + "resolved": "9.0.5", + "contentHash": "cuzLM2MWutf9ZBEMPYYfd0DXwYdvntp7VCT6a/wvbKCa2ZuvGmW74xi+YBa2mrfEieAXqM4TNKlMmSnfAfpUoQ==" + }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "9.0.0", + "contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==" + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "frQDfv0rl209cKm1lnwTgFPzNigy2EKk1BS3uAvHvlBVKe5cymGyHO+Sj+NLv5VF/AhHsqPIUUwya5oV4CHMUw==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Management": { + "type": "Transitive", + "resolved": "9.0.5", + "contentHash": "n6o9PZm9p25+zAzC3/48K0oHnaPKTInRrxqFq1fi/5TPbMLjuoCm/h//mS3cUmSy+9AO1Z+qsC/Ilt/ZFatv5Q==", + "dependencies": { + "System.CodeDom": "9.0.5" + } + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "9.0.0", + "contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==", + "dependencies": { + "System.Collections.Immutable": "9.0.0" + } + }, + "System.Reflection.TypeExtensions": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "VybpaOQQhqE6siHppMktjfGBw1GCwvCqiufqmP8F1nj7fTUNtW35LOEt3UZTEsECfo+ELAl/9o9nJx3U91i7vA==" + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Security.AccessControl": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + }, + "System.Text.Json": { + "type": "Transitive", + "resolved": "8.0.5", + "contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg==" + }, + "fluentassertions": { + "type": "Project" + } + }, + "net8.0/win-x86": { + "Gee.External.Capstone": { + "type": "Transitive", + "resolved": "2.3.0", + "contentHash": "2ap/rYmjtzCOT8hxrnEW/QeiOt+paD8iRrIcdKX0cxVwWLFa1e+JDBNeECakmccXrSFeBQuu5AV8SNkipFMMMw==" + }, + "Microsoft.Win32.Registry": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Management": { + "type": "Transitive", + "resolved": "9.0.5", + "contentHash": "n6o9PZm9p25+zAzC3/48K0oHnaPKTInRrxqFq1fi/5TPbMLjuoCm/h//mS3cUmSy+9AO1Z+qsC/Ilt/ZFatv5Q==", + "dependencies": { + "System.CodeDom": "9.0.5" + } + }, + "System.Security.AccessControl": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + } + } + } +} \ No newline at end of file diff --git a/Tests/ExampleExtensions/packages.lock.json b/Tests/ExampleExtensions/packages.lock.json new file mode 100644 index 0000000000..0e60912930 --- /dev/null +++ b/Tests/ExampleExtensions/packages.lock.json @@ -0,0 +1,40 @@ +{ + "version": 1, + "dependencies": { + ".NETStandard,Version=v2.0": { + "NETStandard.Library": { + "type": "Direct", + "requested": "[2.0.3, )", + "resolved": "2.0.3", + "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "fluentassertions": { + "type": "Project", + "dependencies": { + "System.Threading.Tasks.Extensions": "[4.5.4, )" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 4b17da6c53..529597fa17 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -3,6 +3,7 @@ net6.0 6.0 + true @@ -10,6 +11,7 @@ + diff --git a/Tests/FSharp.Specs/packages.lock.json b/Tests/FSharp.Specs/packages.lock.json new file mode 100644 index 0000000000..3ee294fb4a --- /dev/null +++ b/Tests/FSharp.Specs/packages.lock.json @@ -0,0 +1,159 @@ +{ + "version": 1, + "dependencies": { + "net6.0": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "CSharpGuidelinesAnalyzer": { + "type": "Direct", + "requested": "[3.8.5, )", + "resolved": "3.8.5", + "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" + }, + "FSharp.Core": { + "type": "Direct", + "requested": "[9.0.303, )", + "resolved": "9.0.303", + "contentHash": "6JlV8aD8qQvcmfoe/PMOxCHXc0uX4lR23u0fAyQtnVQxYULLoTZgwgZHSnRcuUHOvS3wULFWcwdnP1iwslH60g==" + }, + "Meziantou.Analyzer": { + "type": "Direct", + "requested": "[2.0.212, )", + "resolved": "2.0.212", + "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0", + "Microsoft.TestPlatform.TestHost": "17.13.0" + } + }, + "Roslynator.Analyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" + }, + "StyleCop.Analyzers": { + "type": "Direct", + "requested": "[1.2.0-beta.556, )", + "resolved": "1.2.0-beta.556", + "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", + "dependencies": { + "StyleCop.Analyzers.Unstable": "1.2.0.556" + } + }, + "xunit": { + "type": "Direct", + "requested": "[2.9.3, )", + "resolved": "2.9.3", + "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", + "dependencies": { + "xunit.analyzers": "1.18.0", + "xunit.assert": "2.9.3", + "xunit.core": "[2.9.3]" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[3.0.0, )", + "resolved": "3.0.0", + "contentHash": "HggUqjQJe8PtDxcP25Q+CnR6Lz4oX3GElhD9V4oU2+75x9HI6A6sxbfKGS4UwU4t4yJaS9fBmAuriz8bQApNjw==" + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + }, + "StyleCop.Analyzers.Unstable": { + "type": "Transitive", + "resolved": "1.2.0.556", + "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "xunit.abstractions": { + "type": "Transitive", + "resolved": "2.0.3", + "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.18.0", + "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" + }, + "xunit.assert": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" + }, + "xunit.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]", + "xunit.extensibility.execution": "[2.9.3]" + } + }, + "xunit.extensibility.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", + "dependencies": { + "xunit.abstractions": "2.0.3" + } + }, + "xunit.extensibility.execution": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]" + } + }, + "fluentassertions": { + "type": "Project" + } + } + } +} \ No newline at end of file diff --git a/Tests/FluentAssertions.Equivalency.Specs/packages.lock.json b/Tests/FluentAssertions.Equivalency.Specs/packages.lock.json new file mode 100644 index 0000000000..c859c0ed30 --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/packages.lock.json @@ -0,0 +1,425 @@ +{ + "version": 1, + "dependencies": { + ".NETFramework,Version=v4.7": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "JetBrains.Annotations": { + "type": "Direct", + "requested": "[2024.3.0, )", + "resolved": "2024.3.0", + "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" + }, + "Newtonsoft.Json": { + "type": "Direct", + "requested": "[13.0.3, )", + "resolved": "13.0.3", + "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" + }, + "System.Collections.Immutable": { + "type": "Direct", + "requested": "[1.5.0, 1.5.0]", + "resolved": "1.5.0", + "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" + }, + "xunit": { + "type": "Direct", + "requested": "[2.9.3, )", + "resolved": "2.9.3", + "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", + "dependencies": { + "xunit.analyzers": "1.18.0", + "xunit.assert": "2.9.3", + "xunit.core": "[2.9.3]" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[2.8.2, )", + "resolved": "2.8.2", + "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.10.0" + } + }, + "Xunit.StaFact": { + "type": "Direct", + "requested": "[1.2.69, )", + "resolved": "1.2.69", + "contentHash": "DQl0Fzz+6jIoShxBK8jQkoh8Fy6AQ++ldJuFRjiLHVbazisMhHHDTGMPyAmB0Eups9tBCJ9GgFvHmalRR9UfXQ==", + "dependencies": { + "xunit.extensibility.execution": "2.4.2" + } + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.10.0", + "contentHash": "KkwhjQevuDj0aBRoPLY6OLAhGqbPUEBuKLbaCs0kUVw29qiOYncdORd4mLVJbn9vGZ7/iFGQ/+AoJl0Tu5Umdg==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==", + "dependencies": { + "System.Collections.Immutable": "1.5.0" + } + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "xunit.abstractions": { + "type": "Transitive", + "resolved": "2.0.3", + "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.18.0", + "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" + }, + "xunit.assert": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" + }, + "xunit.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]", + "xunit.extensibility.execution": "[2.9.3]" + } + }, + "xunit.extensibility.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", + "dependencies": { + "xunit.abstractions": "2.0.3" + } + }, + "xunit.extensibility.execution": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]" + } + }, + "fluentassertions": { + "type": "Project", + "dependencies": { + "System.Threading.Tasks.Extensions": "[4.5.4, )" + } + } + }, + "net6.0": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "CSharpGuidelinesAnalyzer": { + "type": "Direct", + "requested": "[3.8.5, )", + "resolved": "3.8.5", + "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" + }, + "JetBrains.Annotations": { + "type": "Direct", + "requested": "[2024.3.0, )", + "resolved": "2024.3.0", + "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" + }, + "Meziantou.Analyzer": { + "type": "Direct", + "requested": "[2.0.212, )", + "resolved": "2.0.212", + "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0", + "Microsoft.TestPlatform.TestHost": "17.13.0" + } + }, + "Newtonsoft.Json": { + "type": "Direct", + "requested": "[13.0.3, )", + "resolved": "13.0.3", + "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" + }, + "Roslynator.Analyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" + }, + "StyleCop.Analyzers": { + "type": "Direct", + "requested": "[1.2.0-beta.556, )", + "resolved": "1.2.0-beta.556", + "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", + "dependencies": { + "StyleCop.Analyzers.Unstable": "1.2.0.556" + } + }, + "xunit": { + "type": "Direct", + "requested": "[2.9.3, )", + "resolved": "2.9.3", + "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", + "dependencies": { + "xunit.analyzers": "1.18.0", + "xunit.assert": "2.9.3", + "xunit.core": "[2.9.3]" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[2.8.2, )", + "resolved": "2.8.2", + "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" + }, + "Xunit.StaFact": { + "type": "Direct", + "requested": "[1.2.69, )", + "resolved": "1.2.69", + "contentHash": "DQl0Fzz+6jIoShxBK8jQkoh8Fy6AQ++ldJuFRjiLHVbazisMhHHDTGMPyAmB0Eups9tBCJ9GgFvHmalRR9UfXQ==", + "dependencies": { + "xunit.extensibility.execution": "2.4.2" + } + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "StyleCop.Analyzers.Unstable": { + "type": "Transitive", + "resolved": "1.2.0.556", + "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "xunit.abstractions": { + "type": "Transitive", + "resolved": "2.0.3", + "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.18.0", + "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" + }, + "xunit.assert": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" + }, + "xunit.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]", + "xunit.extensibility.execution": "[2.9.3]" + } + }, + "xunit.extensibility.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", + "dependencies": { + "xunit.abstractions": "2.0.3" + } + }, + "xunit.extensibility.execution": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]" + } + }, + "fluentassertions": { + "type": "Project" + } + }, + "net8.0": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "JetBrains.Annotations": { + "type": "Direct", + "requested": "[2024.3.0, )", + "resolved": "2024.3.0", + "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0", + "Microsoft.TestPlatform.TestHost": "17.13.0" + } + }, + "Newtonsoft.Json": { + "type": "Direct", + "requested": "[13.0.3, )", + "resolved": "13.0.3", + "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" + }, + "xunit": { + "type": "Direct", + "requested": "[2.9.3, )", + "resolved": "2.9.3", + "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", + "dependencies": { + "xunit.analyzers": "1.18.0", + "xunit.assert": "2.9.3", + "xunit.core": "[2.9.3]" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[2.8.2, )", + "resolved": "2.8.2", + "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" + }, + "Xunit.StaFact": { + "type": "Direct", + "requested": "[1.2.69, )", + "resolved": "1.2.69", + "contentHash": "DQl0Fzz+6jIoShxBK8jQkoh8Fy6AQ++ldJuFRjiLHVbazisMhHHDTGMPyAmB0Eups9tBCJ9GgFvHmalRR9UfXQ==", + "dependencies": { + "xunit.extensibility.execution": "2.4.2" + } + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "xunit.abstractions": { + "type": "Transitive", + "resolved": "2.0.3", + "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.18.0", + "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" + }, + "xunit.assert": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" + }, + "xunit.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]", + "xunit.extensibility.execution": "[2.9.3]" + } + }, + "xunit.extensibility.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", + "dependencies": { + "xunit.abstractions": "2.0.3" + } + }, + "xunit.extensibility.execution": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]" + } + }, + "fluentassertions": { + "type": "Project" + } + } + } +} \ No newline at end of file diff --git a/Tests/FluentAssertions.Extensibility.Specs/packages.lock.json b/Tests/FluentAssertions.Extensibility.Specs/packages.lock.json new file mode 100644 index 0000000000..86f5a6c298 --- /dev/null +++ b/Tests/FluentAssertions.Extensibility.Specs/packages.lock.json @@ -0,0 +1,389 @@ +{ + "version": 1, + "dependencies": { + ".NETFramework,Version=v4.7": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "PolySharp": { + "type": "Direct", + "requested": "[1.15.0, )", + "resolved": "1.15.0", + "contentHash": "FbU0El+EEjdpuIX4iDbeS7ki1uzpJPx8vbqOzEtqnl1GZeAGJfq+jCbxeJL2y0EPnUNk8dRnnqR2xnYXg9Tf+g==" + }, + "xunit": { + "type": "Direct", + "requested": "[2.9.3, )", + "resolved": "2.9.3", + "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", + "dependencies": { + "xunit.analyzers": "1.18.0", + "xunit.assert": "2.9.3", + "xunit.core": "[2.9.3]" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[2.8.2, )", + "resolved": "2.8.2", + "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.10.0" + } + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.10.0", + "contentHash": "KkwhjQevuDj0aBRoPLY6OLAhGqbPUEBuKLbaCs0kUVw29qiOYncdORd4mLVJbn9vGZ7/iFGQ/+AoJl0Tu5Umdg==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==", + "dependencies": { + "System.Collections.Immutable": "1.5.0" + } + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "xunit.abstractions": { + "type": "Transitive", + "resolved": "2.0.3", + "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.18.0", + "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" + }, + "xunit.assert": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" + }, + "xunit.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]", + "xunit.extensibility.execution": "[2.9.3]" + } + }, + "xunit.extensibility.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", + "dependencies": { + "xunit.abstractions": "2.0.3" + } + }, + "xunit.extensibility.execution": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]" + } + }, + "fluentassertions": { + "type": "Project", + "dependencies": { + "System.Threading.Tasks.Extensions": "[4.5.4, )" + } + } + }, + "net6.0": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "CSharpGuidelinesAnalyzer": { + "type": "Direct", + "requested": "[3.8.5, )", + "resolved": "3.8.5", + "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" + }, + "Meziantou.Analyzer": { + "type": "Direct", + "requested": "[2.0.212, )", + "resolved": "2.0.212", + "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0", + "Microsoft.TestPlatform.TestHost": "17.13.0" + } + }, + "PolySharp": { + "type": "Direct", + "requested": "[1.15.0, )", + "resolved": "1.15.0", + "contentHash": "FbU0El+EEjdpuIX4iDbeS7ki1uzpJPx8vbqOzEtqnl1GZeAGJfq+jCbxeJL2y0EPnUNk8dRnnqR2xnYXg9Tf+g==" + }, + "Roslynator.Analyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" + }, + "StyleCop.Analyzers": { + "type": "Direct", + "requested": "[1.2.0-beta.556, )", + "resolved": "1.2.0-beta.556", + "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", + "dependencies": { + "StyleCop.Analyzers.Unstable": "1.2.0.556" + } + }, + "xunit": { + "type": "Direct", + "requested": "[2.9.3, )", + "resolved": "2.9.3", + "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", + "dependencies": { + "xunit.analyzers": "1.18.0", + "xunit.assert": "2.9.3", + "xunit.core": "[2.9.3]" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[2.8.2, )", + "resolved": "2.8.2", + "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + }, + "StyleCop.Analyzers.Unstable": { + "type": "Transitive", + "resolved": "1.2.0.556", + "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "xunit.abstractions": { + "type": "Transitive", + "resolved": "2.0.3", + "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.18.0", + "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" + }, + "xunit.assert": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" + }, + "xunit.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]", + "xunit.extensibility.execution": "[2.9.3]" + } + }, + "xunit.extensibility.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", + "dependencies": { + "xunit.abstractions": "2.0.3" + } + }, + "xunit.extensibility.execution": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]" + } + }, + "fluentassertions": { + "type": "Project" + } + }, + "net8.0": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0", + "Microsoft.TestPlatform.TestHost": "17.13.0" + } + }, + "PolySharp": { + "type": "Direct", + "requested": "[1.15.0, )", + "resolved": "1.15.0", + "contentHash": "FbU0El+EEjdpuIX4iDbeS7ki1uzpJPx8vbqOzEtqnl1GZeAGJfq+jCbxeJL2y0EPnUNk8dRnnqR2xnYXg9Tf+g==" + }, + "xunit": { + "type": "Direct", + "requested": "[2.9.3, )", + "resolved": "2.9.3", + "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", + "dependencies": { + "xunit.analyzers": "1.18.0", + "xunit.assert": "2.9.3", + "xunit.core": "[2.9.3]" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[2.8.2, )", + "resolved": "2.8.2", + "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "xunit.abstractions": { + "type": "Transitive", + "resolved": "2.0.3", + "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.18.0", + "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" + }, + "xunit.assert": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" + }, + "xunit.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]", + "xunit.extensibility.execution": "[2.9.3]" + } + }, + "xunit.extensibility.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", + "dependencies": { + "xunit.abstractions": "2.0.3" + } + }, + "xunit.extensibility.execution": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]" + } + }, + "fluentassertions": { + "type": "Project" + } + } + } +} \ No newline at end of file diff --git a/Tests/FluentAssertions.Specs/packages.lock.json b/Tests/FluentAssertions.Specs/packages.lock.json new file mode 100644 index 0000000000..90f39f6bd2 --- /dev/null +++ b/Tests/FluentAssertions.Specs/packages.lock.json @@ -0,0 +1,462 @@ +{ + "version": 1, + "dependencies": { + ".NETFramework,Version=v4.7": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "JetBrains.Annotations": { + "type": "Direct", + "requested": "[2024.3.0, )", + "resolved": "2024.3.0", + "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" + }, + "System.Collections.Immutable": { + "type": "Direct", + "requested": "[1.5.0, 1.5.0]", + "resolved": "1.5.0", + "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" + }, + "xunit": { + "type": "Direct", + "requested": "[2.9.3, )", + "resolved": "2.9.3", + "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", + "dependencies": { + "xunit.analyzers": "1.18.0", + "xunit.assert": "2.9.3", + "xunit.core": "[2.9.3]" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[2.8.2, )", + "resolved": "2.8.2", + "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.10.0" + } + }, + "Xunit.StaFact": { + "type": "Direct", + "requested": "[1.2.69, )", + "resolved": "1.2.69", + "contentHash": "DQl0Fzz+6jIoShxBK8jQkoh8Fy6AQ++ldJuFRjiLHVbazisMhHHDTGMPyAmB0Eups9tBCJ9GgFvHmalRR9UfXQ==", + "dependencies": { + "xunit.extensibility.execution": "2.4.2" + } + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.10.0", + "contentHash": "KkwhjQevuDj0aBRoPLY6OLAhGqbPUEBuKLbaCs0kUVw29qiOYncdORd4mLVJbn9vGZ7/iFGQ/+AoJl0Tu5Umdg==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==", + "dependencies": { + "System.Collections.Immutable": "1.5.0" + } + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "xunit.abstractions": { + "type": "Transitive", + "resolved": "2.0.3", + "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.18.0", + "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" + }, + "xunit.assert": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" + }, + "xunit.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]", + "xunit.extensibility.execution": "[2.9.3]" + } + }, + "xunit.extensibility.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", + "dependencies": { + "xunit.abstractions": "2.0.3" + } + }, + "xunit.extensibility.execution": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]" + } + }, + "assemblya": { + "type": "Project", + "dependencies": { + "AssemblyB": "[1.0.0, )" + } + }, + "assemblyb": { + "type": "Project" + }, + "exampleextensions": { + "type": "Project", + "dependencies": { + "FluentAssertions": "[1.0.0, )" + } + }, + "fluentassertions": { + "type": "Project", + "dependencies": { + "System.Threading.Tasks.Extensions": "[4.5.4, )" + } + } + }, + "net6.0": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "CSharpGuidelinesAnalyzer": { + "type": "Direct", + "requested": "[3.8.5, )", + "resolved": "3.8.5", + "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" + }, + "JetBrains.Annotations": { + "type": "Direct", + "requested": "[2024.3.0, )", + "resolved": "2024.3.0", + "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" + }, + "Meziantou.Analyzer": { + "type": "Direct", + "requested": "[2.0.212, )", + "resolved": "2.0.212", + "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0", + "Microsoft.TestPlatform.TestHost": "17.13.0" + } + }, + "Roslynator.Analyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" + }, + "StyleCop.Analyzers": { + "type": "Direct", + "requested": "[1.2.0-beta.556, )", + "resolved": "1.2.0-beta.556", + "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", + "dependencies": { + "StyleCop.Analyzers.Unstable": "1.2.0.556" + } + }, + "xunit": { + "type": "Direct", + "requested": "[2.9.3, )", + "resolved": "2.9.3", + "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", + "dependencies": { + "xunit.analyzers": "1.18.0", + "xunit.assert": "2.9.3", + "xunit.core": "[2.9.3]" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[2.8.2, )", + "resolved": "2.8.2", + "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" + }, + "Xunit.StaFact": { + "type": "Direct", + "requested": "[1.2.69, )", + "resolved": "1.2.69", + "contentHash": "DQl0Fzz+6jIoShxBK8jQkoh8Fy6AQ++ldJuFRjiLHVbazisMhHHDTGMPyAmB0Eups9tBCJ9GgFvHmalRR9UfXQ==", + "dependencies": { + "xunit.extensibility.execution": "2.4.2" + } + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + }, + "StyleCop.Analyzers.Unstable": { + "type": "Transitive", + "resolved": "1.2.0.556", + "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "xunit.abstractions": { + "type": "Transitive", + "resolved": "2.0.3", + "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.18.0", + "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" + }, + "xunit.assert": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" + }, + "xunit.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]", + "xunit.extensibility.execution": "[2.9.3]" + } + }, + "xunit.extensibility.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", + "dependencies": { + "xunit.abstractions": "2.0.3" + } + }, + "xunit.extensibility.execution": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]" + } + }, + "assemblya": { + "type": "Project", + "dependencies": { + "AssemblyB": "[1.0.0, )" + } + }, + "assemblyb": { + "type": "Project" + }, + "exampleextensions": { + "type": "Project", + "dependencies": { + "FluentAssertions": "[1.0.0, )" + } + }, + "fluentassertions": { + "type": "Project" + } + }, + "net8.0": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "JetBrains.Annotations": { + "type": "Direct", + "requested": "[2024.3.0, )", + "resolved": "2024.3.0", + "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0", + "Microsoft.TestPlatform.TestHost": "17.13.0" + } + }, + "xunit": { + "type": "Direct", + "requested": "[2.9.3, )", + "resolved": "2.9.3", + "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", + "dependencies": { + "xunit.analyzers": "1.18.0", + "xunit.assert": "2.9.3", + "xunit.core": "[2.9.3]" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[2.8.2, )", + "resolved": "2.8.2", + "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" + }, + "Xunit.StaFact": { + "type": "Direct", + "requested": "[1.2.69, )", + "resolved": "1.2.69", + "contentHash": "DQl0Fzz+6jIoShxBK8jQkoh8Fy6AQ++ldJuFRjiLHVbazisMhHHDTGMPyAmB0Eups9tBCJ9GgFvHmalRR9UfXQ==", + "dependencies": { + "xunit.extensibility.execution": "2.4.2" + } + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "xunit.abstractions": { + "type": "Transitive", + "resolved": "2.0.3", + "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.18.0", + "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" + }, + "xunit.assert": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" + }, + "xunit.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]", + "xunit.extensibility.execution": "[2.9.3]" + } + }, + "xunit.extensibility.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", + "dependencies": { + "xunit.abstractions": "2.0.3" + } + }, + "xunit.extensibility.execution": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]" + } + }, + "assemblya": { + "type": "Project", + "dependencies": { + "AssemblyB": "[1.0.0, )" + } + }, + "assemblyb": { + "type": "Project" + }, + "exampleextensions": { + "type": "Project", + "dependencies": { + "FluentAssertions": "[1.0.0, )" + } + }, + "fluentassertions": { + "type": "Project" + } + } + } +} \ No newline at end of file diff --git a/Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json b/Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json new file mode 100644 index 0000000000..7461446d43 --- /dev/null +++ b/Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json @@ -0,0 +1,180 @@ +{ + "version": 1, + "dependencies": { + "net6.0": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "CSharpGuidelinesAnalyzer": { + "type": "Direct", + "requested": "[3.8.5, )", + "resolved": "3.8.5", + "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" + }, + "Meziantou.Analyzer": { + "type": "Direct", + "requested": "[2.0.212, )", + "resolved": "2.0.212", + "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0", + "Microsoft.TestPlatform.TestHost": "17.13.0" + } + }, + "MSTest.TestAdapter": { + "type": "Direct", + "requested": "[3.10.1, )", + "resolved": "3.10.1", + "contentHash": "5kEgI2extjbTssFL/91P5AorZmplclthPTNEj0j60K/kwKnHba0fmdH+btMUOJSAm/XZI/AE7xz/SjGhruEayw==", + "dependencies": { + "Microsoft.Testing.Extensions.VSTestBridge": "1.8.1", + "Microsoft.Testing.Platform.MSBuild": "1.8.1" + } + }, + "MSTest.TestFramework": { + "type": "Direct", + "requested": "[3.10.1, )", + "resolved": "3.10.1", + "contentHash": "G+OBqUGOSxo+2rv+mTK+nOK0rESYUjJNhU+GsPnqEqGQdd5u8wGzs2TpoY1CLavaEzUsw0cHALl+j52QpvGMBA==", + "dependencies": { + "MSTest.Analyzers": "3.10.1" + } + }, + "Roslynator.Analyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" + }, + "StyleCop.Analyzers": { + "type": "Direct", + "requested": "[1.2.0-beta.556, )", + "resolved": "1.2.0-beta.556", + "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", + "dependencies": { + "StyleCop.Analyzers.Unstable": "1.2.0.556" + } + }, + "Microsoft.ApplicationInsights": { + "type": "Transitive", + "resolved": "2.23.0", + "contentHash": "nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==", + "dependencies": { + "System.Diagnostics.DiagnosticSource": "5.0.0" + } + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.Testing.Extensions.Telemetry": { + "type": "Transitive", + "resolved": "1.8.1", + "contentHash": "+z3bCmE5pNTlKDoib00AdkYOOra2xhrwFbuzsnu+THuEGJR+E/u+b5XSTdkVq8SHgtkDFqAh5lFgipUGQCi5ig==", + "dependencies": { + "Microsoft.ApplicationInsights": "2.23.0", + "Microsoft.Testing.Platform": "1.8.1" + } + }, + "Microsoft.Testing.Extensions.TrxReport.Abstractions": { + "type": "Transitive", + "resolved": "1.8.1", + "contentHash": "Z7JGDf/hA89BMhDdQG6351ItKUC5V2ISBRLw0PozL+OuWqbzrXiVbGm/YJXMj2Z4KCqIBT2K+GEC07rpNQv7ew==", + "dependencies": { + "Microsoft.Testing.Platform": "1.8.1" + } + }, + "Microsoft.Testing.Extensions.VSTestBridge": { + "type": "Transitive", + "resolved": "1.8.1", + "contentHash": "2lu9NqH0YGtkhGvgeDrR9R5u97PlT5/E3Ix5l3McxnUU/e7yGK3UJOt/ukKWoQsppsJDAOW2CTrqgYTnFPR0Pw==", + "dependencies": { + "Microsoft.TestPlatform.AdapterUtilities": "17.13.0", + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Microsoft.Testing.Extensions.Telemetry": "1.8.1", + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.1", + "Microsoft.Testing.Platform": "1.8.1" + } + }, + "Microsoft.Testing.Platform": { + "type": "Transitive", + "resolved": "1.8.1", + "contentHash": "Nb2F/2nZBn7+81HRmICCrJXjpCQny+cG2l/rW81mApHKbf+nDeydo44PYFwGMYz2ZuNnIWB96qvI5Uy4l69ceQ==" + }, + "Microsoft.Testing.Platform.MSBuild": { + "type": "Transitive", + "resolved": "1.8.1", + "contentHash": "khxIgxLPgsnq6R0bVh7z7QBzUCjlj+pFkYmHVPzSbzxRdF0xijqRZW8K/z2Ai0XoY1Qp2b7Tf4zEeOoXrpZeaw==", + "dependencies": { + "Microsoft.Testing.Platform": "1.8.1" + } + }, + "Microsoft.TestPlatform.AdapterUtilities": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bFZ3uAhosdXjyXKURDQy37fPosCJQwedB5DG/SzsXL1QXsrfsIYty2kQMqCRRUqm8sBZBRHWRp4BT9SmpWXcKQ==" + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "MSTest.Analyzers": { + "type": "Transitive", + "resolved": "3.10.1", + "contentHash": "OcXiLNIXsJ9J/zlgvjnwnQ9tRH7zGzYVvbtS+w/YPSwlpEr0455p69yjTWQ8jNHqK7wn9JatOhtPPRfhYK0Y6w==" + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + }, + "StyleCop.Analyzers.Unstable": { + "type": "Transitive", + "resolved": "1.2.0.556", + "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "fluentassertions": { + "type": "Project" + } + } + } +} \ No newline at end of file diff --git a/Tests/TestFrameworks/MSpec.Specs/packages.lock.json b/Tests/TestFrameworks/MSpec.Specs/packages.lock.json new file mode 100644 index 0000000000..a38ff834f4 --- /dev/null +++ b/Tests/TestFrameworks/MSpec.Specs/packages.lock.json @@ -0,0 +1,1037 @@ +{ + "version": 1, + "dependencies": { + "net6.0": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "CSharpGuidelinesAnalyzer": { + "type": "Direct", + "requested": "[3.8.5, )", + "resolved": "3.8.5", + "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" + }, + "Machine.Specifications": { + "type": "Direct", + "requested": "[1.1.3, )", + "resolved": "1.1.3", + "contentHash": "m2rn8iZUwf5AF6WJgqkWOuvZ52HfvXyw3QLN/rNyWAOyjGgeGhNdsNbwnm9QanD68KpUeijtGkRQn+d07J4xLQ==", + "dependencies": { + "NETStandard.Library": "1.6.0", + "System.Diagnostics.TextWriterTraceListener": "4.0.0", + "System.Diagnostics.TraceSource": "4.0.0", + "System.Reflection": "4.1.0", + "System.Reflection.Extensions": "4.0.1", + "System.Reflection.TypeExtensions": "4.1.0", + "System.Threading.ThreadPool": "4.3.0", + "System.Xml.XPath": "4.0.1", + "System.Xml.XPath.XDocument": "4.0.1" + } + }, + "Machine.Specifications.Runner.VisualStudio": { + "type": "Direct", + "requested": "[2.10.2, )", + "resolved": "2.10.2", + "contentHash": "LU8yUTBiYqMvVCAaE3aJ1lVm1BjDpibcdTRFsUhZqyhw+9qkaZCTr5YpH6xAMyTvWbV431ftBHTZnNK6BxzVmw==", + "dependencies": { + "Mono.Cecil": "[0.10.0, 0.11.0)" + } + }, + "Meziantou.Analyzer": { + "type": "Direct", + "requested": "[2.0.212, )", + "resolved": "2.0.212", + "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0", + "Microsoft.TestPlatform.TestHost": "17.13.0" + } + }, + "Roslynator.Analyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" + }, + "StyleCop.Analyzers": { + "type": "Direct", + "requested": "[1.2.0-beta.556, )", + "resolved": "1.2.0-beta.556", + "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", + "dependencies": { + "StyleCop.Analyzers.Unstable": "1.2.0.556" + } + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + }, + "Microsoft.NETCore.Targets": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "Microsoft.Win32.Primitives": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "fQnBHO9DgcmkC9dYSJoBqo6sH1VJwJprUHh8F3hbcRlxiQiBUuTntdk8tUwV490OqC2kQUrinGwZyQHTieuXRA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "Mono.Cecil": { + "type": "Transitive", + "resolved": "0.10.0", + "contentHash": "nHSF7wvyZRPAGXl49zgULPFubXHpsXlOH9RXFRUKb0TX0/tKkKljci6yBszVNI09PIDNQ8IP9WJTYvmBkMbbHw==", + "dependencies": { + "System.Collections": "4.0.11", + "System.IO.FileSystem": "4.0.1", + "System.IO.FileSystem.Primitives": "4.0.1", + "System.Reflection": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Security.Cryptography.Algorithms": "4.2.0", + "System.Security.Cryptography.Csp": "4.0.0", + "System.Threading": "4.0.11" + } + }, + "NETStandard.Library": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "ypsCvIdCZ4IoYASJHt6tF2fMo7N30NLgV1EbmC+snO490OMl9FvVxmumw14rhReWU3j3g7BYudG6YCrchwHJlA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.Win32.Primitives": "4.0.1", + "System.AppContext": "4.1.0", + "System.Collections": "4.0.11", + "System.Collections.Concurrent": "4.0.12", + "System.Console": "4.0.0", + "System.Diagnostics.Debug": "4.0.11", + "System.Diagnostics.Tools": "4.0.1", + "System.Diagnostics.Tracing": "4.1.0", + "System.Globalization": "4.0.11", + "System.Globalization.Calendars": "4.0.1", + "System.IO": "4.1.0", + "System.IO.Compression": "4.1.0", + "System.IO.Compression.ZipFile": "4.0.1", + "System.IO.FileSystem": "4.0.1", + "System.IO.FileSystem.Primitives": "4.0.1", + "System.Linq": "4.1.0", + "System.Linq.Expressions": "4.1.0", + "System.Net.Http": "4.1.0", + "System.Net.Primitives": "4.0.11", + "System.Net.Sockets": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection": "4.1.0", + "System.Reflection.Extensions": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Handles": "4.0.1", + "System.Runtime.InteropServices": "4.1.0", + "System.Runtime.InteropServices.RuntimeInformation": "4.0.0", + "System.Runtime.Numerics": "4.0.1", + "System.Security.Cryptography.Algorithms": "4.2.0", + "System.Security.Cryptography.Encoding": "4.0.0", + "System.Security.Cryptography.Primitives": "4.0.0", + "System.Security.Cryptography.X509Certificates": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Text.Encoding.Extensions": "4.0.11", + "System.Text.RegularExpressions": "4.1.0", + "System.Threading": "4.0.11", + "System.Threading.Tasks": "4.0.11", + "System.Threading.Timer": "4.0.1", + "System.Xml.ReaderWriter": "4.0.11", + "System.Xml.XDocument": "4.0.11" + } + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + }, + "runtime.native.System": { + "type": "Transitive", + "resolved": "4.0.0", + "contentHash": "QfS/nQI7k/BLgmLrw7qm7YBoULEvgWnPI+cYsbfCVFTW8Aj+i8JhccxcFMu1RWms0YZzF+UHguNBK4Qn89e2Sg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1" + } + }, + "runtime.native.System.IO.Compression": { + "type": "Transitive", + "resolved": "4.1.0", + "contentHash": "Ob7nvnJBox1aaB222zSVZSkf4WrebPG4qFscfK7vmD7P7NxoSxACQLtO7ytWpqXDn2wcd/+45+EAZ7xjaPip8A==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1" + } + }, + "runtime.native.System.Net.Http": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "Nh0UPZx2Vifh8r+J+H2jxifZUD3sBrmolgiFWJd2yiNrxO0xTa6bAw3YwRn1VOiSen/tUXMS31ttNItCZ6lKuA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1" + } + }, + "runtime.native.System.Security.Cryptography": { + "type": "Transitive", + "resolved": "4.0.0", + "contentHash": "2CQK0jmO6Eu7ZeMgD+LOFbNJSXHFVQbCJJkEyEwowh1SCgYnrn9W9RykMfpeeVGw7h4IBvYikzpGUlmZTUafJw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1" + } + }, + "StyleCop.Analyzers.Unstable": { + "type": "Transitive", + "resolved": "1.2.0.556", + "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" + }, + "System.AppContext": { + "type": "Transitive", + "resolved": "4.1.0", + "contentHash": "3QjO4jNV7PdKkmQAVp9atA+usVnKRwI3Kx1nMwJ93T0LcQfx7pKAYk0nKz5wn1oP5iqlhZuy6RXOFdhr7rDwow==", + "dependencies": { + "System.Runtime": "4.1.0" + } + }, + "System.Buffers": { + "type": "Transitive", + "resolved": "4.0.0", + "contentHash": "msXumHfjjURSkvxUjYuq4N2ghHoRi2VpXcKMA7gK6ujQfU3vGpl+B6ld0ATRg+FZFpRyA6PgEPA+VlIkTeNf2w==", + "dependencies": { + "System.Diagnostics.Debug": "4.0.11", + "System.Diagnostics.Tracing": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Collections": { + "type": "Transitive", + "resolved": "4.0.11", + "contentHash": "YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Collections.Concurrent": { + "type": "Transitive", + "resolved": "4.0.12", + "contentHash": "2gBcbb3drMLgxlI0fBfxMA31ec6AEyYCHygGse4vxceJan8mRIWeKJ24BFzN7+bi/NFTgdIgufzb94LWO5EERQ==", + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Diagnostics.Tracing": "4.1.0", + "System.Globalization": "4.0.11", + "System.Reflection": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Console": { + "type": "Transitive", + "resolved": "4.0.0", + "contentHash": "qSKUSOIiYA/a0g5XXdxFcUFmv1hNICBD7QZ0QhGYVipPIhvpiydY8VZqr1thmCXvmn8aipMg64zuanB4eotK9A==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.IO": "4.1.0", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11" + } + }, + "System.Diagnostics.Debug": { + "type": "Transitive", + "resolved": "4.0.11", + "contentHash": "w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "4.0.0", + "contentHash": "YKglnq4BMTJxfcr6nuT08g+yJ0UxdePIHxosiLuljuHIUR6t4KhFsyaHOaOc1Ofqp0PUvJ0EmcgiEz6T7vEx3w==", + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Tracing": "4.1.0", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Diagnostics.TextWriterTraceListener": { + "type": "Transitive", + "resolved": "4.0.0", + "contentHash": "w36Dr8yKy8xP150qPANe7Td+/zOI3G62ImRcHDIEW+oUXUuTKZHd4DHmqRx5+x8RXd85v3tXd1uhNTfsr+yxjA==", + "dependencies": { + "System.Diagnostics.TraceSource": "4.0.0", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Diagnostics.Tools": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Diagnostics.TraceSource": { + "type": "Transitive", + "resolved": "4.0.0", + "contentHash": "6WVCczFZKXwpWpzd/iJkYnsmWTSFFiU24Xx/YdHXBcu+nFI/ehTgeqdJQFbtRPzbrO3KtRNjvkhtj4t5/WwWsA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11", + "runtime.native.System": "4.0.0" + } + }, + "System.Diagnostics.Tracing": { + "type": "Transitive", + "resolved": "4.1.0", + "contentHash": "vDN1PoMZCkkdNjvZLql592oYJZgS7URcJzJ7bxeBgGtx5UtR5leNm49VmfHGqIffX4FKacHbI3H6UyNSHQknBg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Globalization": { + "type": "Transitive", + "resolved": "4.0.11", + "contentHash": "B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Globalization.Calendars": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "L1c6IqeQ88vuzC1P81JeHmHA8mxq8a18NUBNXnIY/BVb+TCyAaGIFbhpZt60h9FJNmisymoQkHEFSE9Vslja1Q==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Globalization": "4.0.11", + "System.Runtime": "4.1.0" + } + }, + "System.Globalization.Extensions": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "KKo23iKeOaIg61SSXwjANN7QYDr/3op3OWGGzDzz7mypx0Za0fZSeG0l6cco8Ntp8YMYkIQcAqlk8yhm5/Uhcg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "System.Globalization": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.InteropServices": "4.1.0" + } + }, + "System.IO": { + "type": "Transitive", + "resolved": "4.1.0", + "contentHash": "3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.IO.Compression": { + "type": "Transitive", + "resolved": "4.1.0", + "contentHash": "TjnBS6eztThSzeSib+WyVbLzEdLKUcEHN69VtS3u8aAsSc18FU6xCZlNWWsEd8SKcXAE+y1sOu7VbU8sUeM0sg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.IO": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Handles": "4.0.1", + "System.Runtime.InteropServices": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Threading": "4.0.11", + "System.Threading.Tasks": "4.0.11", + "runtime.native.System": "4.0.0", + "runtime.native.System.IO.Compression": "4.1.0" + } + }, + "System.IO.Compression.ZipFile": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "hBQYJzfTbQURF10nLhd+az2NHxsU6MU7AB8RUf4IolBP5lOAm4Luho851xl+CqslmhI5ZH/el8BlngEk4lBkaQ==", + "dependencies": { + "System.Buffers": "4.0.0", + "System.IO": "4.1.0", + "System.IO.Compression": "4.1.0", + "System.IO.FileSystem": "4.0.1", + "System.IO.FileSystem.Primitives": "4.0.1", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Text.Encoding": "4.0.11" + } + }, + "System.IO.FileSystem": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "IBErlVq5jOggAD69bg1t0pJcHaDbJbWNUZTPI96fkYWzwYbN6D9wRHMULLDd9dHsl7C2YsxXL31LMfPI1SWt8w==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.IO": "4.1.0", + "System.IO.FileSystem.Primitives": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Handles": "4.0.1", + "System.Text.Encoding": "4.0.11", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.IO.FileSystem.Primitives": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "kWkKD203JJKxJeE74p8aF8y4Qc9r9WQx4C0cHzHPrY3fv/L/IhWnyCHaFJ3H1QPOH6A93whlQ2vG5nHlBDvzWQ==", + "dependencies": { + "System.Runtime": "4.1.0" + } + }, + "System.Linq": { + "type": "Transitive", + "resolved": "4.1.0", + "contentHash": "bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==", + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0" + } + }, + "System.Linq.Expressions": { + "type": "Transitive", + "resolved": "4.1.0", + "contentHash": "I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==", + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.Linq": "4.1.0", + "System.ObjectModel": "4.0.12", + "System.Reflection": "4.1.0", + "System.Reflection.Emit": "4.0.1", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Emit.Lightweight": "4.0.1", + "System.Reflection.Extensions": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Reflection.TypeExtensions": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Net.Http": { + "type": "Transitive", + "resolved": "4.1.0", + "contentHash": "ULq9g3SOPVuupt+Y3U+A37coXzdNisB1neFCSKzBwo182u0RDddKJF8I5+HfyXqK6OhJPgeoAwWXrbiUXuRDsg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Diagnostics.DiagnosticSource": "4.0.0", + "System.Diagnostics.Tracing": "4.1.0", + "System.Globalization": "4.0.11", + "System.Globalization.Extensions": "4.0.1", + "System.IO": "4.1.0", + "System.IO.FileSystem": "4.0.1", + "System.Net.Primitives": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Handles": "4.0.1", + "System.Runtime.InteropServices": "4.1.0", + "System.Security.Cryptography.Algorithms": "4.2.0", + "System.Security.Cryptography.Encoding": "4.0.0", + "System.Security.Cryptography.OpenSsl": "4.0.0", + "System.Security.Cryptography.Primitives": "4.0.0", + "System.Security.Cryptography.X509Certificates": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Threading": "4.0.11", + "System.Threading.Tasks": "4.0.11", + "runtime.native.System": "4.0.0", + "runtime.native.System.Net.Http": "4.0.1", + "runtime.native.System.Security.Cryptography": "4.0.0" + } + }, + "System.Net.Primitives": { + "type": "Transitive", + "resolved": "4.0.11", + "contentHash": "hVvfl4405DRjA2408luZekbPhplJK03j2Y2lSfMlny7GHXlkByw1iLnc9mgKW0GdQn73vvMcWrWewAhylXA4Nw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Handles": "4.0.1" + } + }, + "System.Net.Sockets": { + "type": "Transitive", + "resolved": "4.1.0", + "contentHash": "xAz0N3dAV/aR/9g8r0Y5oEqU1JRsz29F5EGb/WVHmX3jVSLqi2/92M5hTad2aNWovruXrJpJtgZ9fccPMG9uSw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.IO": "4.1.0", + "System.Net.Primitives": "4.0.11", + "System.Runtime": "4.1.0", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.ObjectModel": { + "type": "Transitive", + "resolved": "4.0.12", + "contentHash": "tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==", + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Reflection": { + "type": "Transitive", + "resolved": "4.1.0", + "contentHash": "JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.IO": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==", + "dependencies": { + "System.IO": "4.1.0", + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.ILGeneration": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==", + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Emit.Lightweight": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==", + "dependencies": { + "System.Reflection": "4.1.0", + "System.Reflection.Emit.ILGeneration": "4.0.1", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Extensions": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "System.Reflection.Primitives": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Reflection.TypeExtensions": { + "type": "Transitive", + "resolved": "4.1.0", + "contentHash": "tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==", + "dependencies": { + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Resources.ResourceManager": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Globalization": "4.0.11", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0" + } + }, + "System.Runtime.Extensions": { + "type": "Transitive", + "resolved": "4.1.0", + "contentHash": "CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Runtime.Handles": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices": { + "type": "Transitive", + "resolved": "4.1.0", + "contentHash": "16eu3kjHS633yYdkjwShDHZLRNMKVi/s0bY8ODiqJ2RfMhDMAwxZaUaWVnZ2P71kr/or+X9o/xFWtNqz8ivieQ==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Reflection": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Handles": "4.0.1" + } + }, + "System.Runtime.InteropServices.RuntimeInformation": { + "type": "Transitive", + "resolved": "4.0.0", + "contentHash": "hWPhJxc453RCa8Z29O91EmfGeZIHX1ZH2A8L6lYQVSaKzku2DfArSfMEb1/MYYzPQRJZeu0c9dmYeJKxW5Fgng==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "System.Reflection": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.InteropServices": "4.1.0", + "System.Threading": "4.0.11", + "runtime.native.System": "4.0.0" + } + }, + "System.Runtime.Numerics": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "+XbKFuzdmLP3d1o9pdHu2nxjNr2OEPqGzKeegPLCUMM71a0t50A/rOcIRmGs9wR7a8KuHX6hYs/7/TymIGLNqg==", + "dependencies": { + "System.Globalization": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0" + } + }, + "System.Security.Cryptography.Algorithms": { + "type": "Transitive", + "resolved": "4.2.0", + "contentHash": "8JQFxbLVdrtIOKMDN38Fn0GWnqYZw/oMlwOUG/qz1jqChvyZlnUmu+0s7wLx7JYua/nAXoESpHA3iw11QFWhXg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "System.Collections": "4.0.11", + "System.IO": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Handles": "4.0.1", + "System.Runtime.InteropServices": "4.1.0", + "System.Runtime.Numerics": "4.0.1", + "System.Security.Cryptography.Encoding": "4.0.0", + "System.Security.Cryptography.Primitives": "4.0.0", + "System.Text.Encoding": "4.0.11", + "runtime.native.System.Security.Cryptography": "4.0.0" + } + }, + "System.Security.Cryptography.Cng": { + "type": "Transitive", + "resolved": "4.2.0", + "contentHash": "cUJ2h+ZvONDe28Szw3st5dOHdjndhJzQ2WObDEXAWRPEQBtVItVoxbXM/OEsTthl3cNn2dk2k0I3y45igCQcLw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "System.IO": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Handles": "4.0.1", + "System.Runtime.InteropServices": "4.1.0", + "System.Security.Cryptography.Algorithms": "4.2.0", + "System.Security.Cryptography.Encoding": "4.0.0", + "System.Security.Cryptography.Primitives": "4.0.0", + "System.Text.Encoding": "4.0.11" + } + }, + "System.Security.Cryptography.Csp": { + "type": "Transitive", + "resolved": "4.0.0", + "contentHash": "/i1Usuo4PgAqgbPNC0NjbO3jPW//BoBlTpcWFD1EHVbidH21y4c1ap5bbEMSGAXjAShhMH4abi/K8fILrnu4BQ==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "System.IO": "4.1.0", + "System.Reflection": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Handles": "4.0.1", + "System.Runtime.InteropServices": "4.1.0", + "System.Security.Cryptography.Algorithms": "4.2.0", + "System.Security.Cryptography.Encoding": "4.0.0", + "System.Security.Cryptography.Primitives": "4.0.0", + "System.Text.Encoding": "4.0.11", + "System.Threading": "4.0.11" + } + }, + "System.Security.Cryptography.Encoding": { + "type": "Transitive", + "resolved": "4.0.0", + "contentHash": "FbKgE5MbxSQMPcSVRgwM6bXN3GtyAh04NkV8E5zKCBE26X0vYW0UtTa2FIgkH33WVqBVxRgxljlVYumWtU+HcQ==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "System.Collections": "4.0.11", + "System.Collections.Concurrent": "4.0.12", + "System.Linq": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Handles": "4.0.1", + "System.Runtime.InteropServices": "4.1.0", + "System.Security.Cryptography.Primitives": "4.0.0", + "System.Text.Encoding": "4.0.11", + "runtime.native.System.Security.Cryptography": "4.0.0" + } + }, + "System.Security.Cryptography.OpenSsl": { + "type": "Transitive", + "resolved": "4.0.0", + "contentHash": "HUG/zNUJwEiLkoURDixzkzZdB5yGA5pQhDP93ArOpDPQMteURIGERRNzzoJlmTreLBWr5lkFSjjMSk8ySEpQMw==", + "dependencies": { + "System.Collections": "4.0.11", + "System.IO": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Handles": "4.0.1", + "System.Runtime.InteropServices": "4.1.0", + "System.Runtime.Numerics": "4.0.1", + "System.Security.Cryptography.Algorithms": "4.2.0", + "System.Security.Cryptography.Encoding": "4.0.0", + "System.Security.Cryptography.Primitives": "4.0.0", + "System.Text.Encoding": "4.0.11", + "runtime.native.System.Security.Cryptography": "4.0.0" + } + }, + "System.Security.Cryptography.Primitives": { + "type": "Transitive", + "resolved": "4.0.0", + "contentHash": "Wkd7QryWYjkQclX0bngpntW5HSlMzeJU24UaLJQ7YTfI8ydAVAaU2J+HXLLABOVJlKTVvAeL0Aj39VeTe7L+oA==", + "dependencies": { + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Threading": "4.0.11", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Security.Cryptography.X509Certificates": { + "type": "Transitive", + "resolved": "4.1.0", + "contentHash": "4HEfsQIKAhA1+ApNn729Gi09zh+lYWwyIuViihoMDWp1vQnEkL2ct7mAbhBlLYm+x/L4Rr/pyGge1lIY635e0w==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.Globalization.Calendars": "4.0.1", + "System.IO": "4.1.0", + "System.IO.FileSystem": "4.0.1", + "System.IO.FileSystem.Primitives": "4.0.1", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.Handles": "4.0.1", + "System.Runtime.InteropServices": "4.1.0", + "System.Runtime.Numerics": "4.0.1", + "System.Security.Cryptography.Algorithms": "4.2.0", + "System.Security.Cryptography.Cng": "4.2.0", + "System.Security.Cryptography.Csp": "4.0.0", + "System.Security.Cryptography.Encoding": "4.0.0", + "System.Security.Cryptography.OpenSsl": "4.0.0", + "System.Security.Cryptography.Primitives": "4.0.0", + "System.Text.Encoding": "4.0.11", + "System.Threading": "4.0.11", + "runtime.native.System": "4.0.0", + "runtime.native.System.Net.Http": "4.0.1", + "runtime.native.System.Security.Cryptography": "4.0.0" + } + }, + "System.Text.Encoding": { + "type": "Transitive", + "resolved": "4.0.11", + "contentHash": "U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Text.Encoding.Extensions": { + "type": "Transitive", + "resolved": "4.0.11", + "contentHash": "jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11" + } + }, + "System.Text.RegularExpressions": { + "type": "Transitive", + "resolved": "4.1.0", + "contentHash": "i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==", + "dependencies": { + "System.Collections": "4.0.11", + "System.Globalization": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11" + } + }, + "System.Threading": { + "type": "Transitive", + "resolved": "4.0.11", + "contentHash": "N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==", + "dependencies": { + "System.Runtime": "4.1.0", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Threading.Tasks": { + "type": "Transitive", + "resolved": "4.0.11", + "contentHash": "k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.0.0", + "contentHash": "pH4FZDsZQ/WmgJtN4LWYmRdJAEeVkyriSwrv2Teoe5FOU0Yxlb6II6GL8dBPOfRmutHGATduj3ooMt7dJ2+i+w==", + "dependencies": { + "System.Collections": "4.0.11", + "System.Runtime": "4.1.0", + "System.Threading.Tasks": "4.0.11" + } + }, + "System.Threading.ThreadPool": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", + "dependencies": { + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Threading.Timer": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "saGfUV8uqVW6LeURiqxcGhZ24PzuRNaUBtbhVeuUAvky1naH395A/1nY0P2bWvrw/BreRtIB/EzTDkGBpqCwEw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" + } + }, + "System.Xml.ReaderWriter": { + "type": "Transitive", + "resolved": "4.0.11", + "contentHash": "ZIiLPsf67YZ9zgr31vzrFaYQqxRPX9cVHjtPSnmx4eN6lbS/yEyYNr2vs1doGDEscF0tjCZFsk9yUg1sC9e8tg==", + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.IO.FileSystem": "4.0.1", + "System.IO.FileSystem.Primitives": "4.0.1", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Runtime.InteropServices": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Text.Encoding.Extensions": "4.0.11", + "System.Text.RegularExpressions": "4.1.0", + "System.Threading.Tasks": "4.0.11", + "System.Threading.Tasks.Extensions": "4.0.0" + } + }, + "System.Xml.XDocument": { + "type": "Transitive", + "resolved": "4.0.11", + "contentHash": "Mk2mKmPi0nWaoiYeotq1dgeNK1fqWh61+EK+w4Wu8SWuTYLzpUnschb59bJtGywaPq7SmTuPf44wrXRwbIrukg==", + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Diagnostics.Tools": "4.0.1", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.Reflection": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Threading": "4.0.11", + "System.Xml.ReaderWriter": "4.0.11" + } + }, + "System.Xml.XPath": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "UWd1H+1IJ9Wlq5nognZ/XJdyj8qPE4XufBUkAW59ijsCPjZkZe0MUzKKJFBr+ZWBe5Wq1u1d5f2CYgE93uH7DA==", + "dependencies": { + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Globalization": "4.0.11", + "System.IO": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11", + "System.Xml.ReaderWriter": "4.0.11" + } + }, + "System.Xml.XPath.XDocument": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "FLhdYJx4331oGovQypQ8JIw2kEmNzCsjVOVYY/16kZTUoquZG85oVn7yUhBE2OZt1yGPSXAL0HTEfzjlbNpM7Q==", + "dependencies": { + "System.Diagnostics.Debug": "4.0.11", + "System.Linq": "4.1.0", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0", + "System.Threading": "4.0.11", + "System.Xml.ReaderWriter": "4.0.11", + "System.Xml.XDocument": "4.0.11", + "System.Xml.XPath": "4.0.1" + } + }, + "fluentassertions": { + "type": "Project" + } + } + } +} \ No newline at end of file diff --git a/Tests/TestFrameworks/NUnit3.Specs/packages.lock.json b/Tests/TestFrameworks/NUnit3.Specs/packages.lock.json new file mode 100644 index 0000000000..d328997250 --- /dev/null +++ b/Tests/TestFrameworks/NUnit3.Specs/packages.lock.json @@ -0,0 +1,183 @@ +{ + "version": 1, + "dependencies": { + "net6.0": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "CSharpGuidelinesAnalyzer": { + "type": "Direct", + "requested": "[3.8.5, )", + "resolved": "3.8.5", + "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" + }, + "Meziantou.Analyzer": { + "type": "Direct", + "requested": "[2.0.212, )", + "resolved": "2.0.212", + "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0", + "Microsoft.TestPlatform.TestHost": "17.13.0" + } + }, + "NUnit": { + "type": "Direct", + "requested": "[3.14.0, 4.0.0)", + "resolved": "3.14.0", + "contentHash": "R7iPwD7kbOaP3o2zldWJbWeMQAvDKD0uld27QvA3PAALl1unl7x0v2J7eGiJOYjimV/BuGT4VJmr45RjS7z4LA==", + "dependencies": { + "NETStandard.Library": "2.0.0" + } + }, + "NUnit3TestAdapter": { + "type": "Direct", + "requested": "[5.0.0, )", + "resolved": "5.0.0", + "contentHash": "sy4cLoUAdE6TDM4wNX5gmNCyhMev5wUz4cA6ZRf/aON9vf9t4xTVGLj/4huhDKcS4dFfmVVcgcP70yC7WC9kKg==", + "dependencies": { + "Microsoft.Testing.Extensions.VSTestBridge": "1.5.3", + "Microsoft.Testing.Platform.MSBuild": "1.5.3" + } + }, + "Roslynator.Analyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" + }, + "StyleCop.Analyzers": { + "type": "Direct", + "requested": "[1.2.0-beta.556, )", + "resolved": "1.2.0-beta.556", + "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", + "dependencies": { + "StyleCop.Analyzers.Unstable": "1.2.0.556" + } + }, + "Microsoft.ApplicationInsights": { + "type": "Transitive", + "resolved": "2.22.0", + "contentHash": "3AOM9bZtku7RQwHyMEY3tQMrHIgjcfRDa6YQpd/QG2LDGvMydSlL9Di+8LLMt7J2RDdfJ7/2jdYv6yHcMJAnNw==", + "dependencies": { + "System.Diagnostics.DiagnosticSource": "5.0.0" + } + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + }, + "Microsoft.Testing.Extensions.Telemetry": { + "type": "Transitive", + "resolved": "1.5.3", + "contentHash": "U9pGd5DQuX1PfkrdFI+xH34JGgQ2nes5QAwIITTk+MQfLvRITqsZjJeHTjpGWh33D/0q1l7aA8/LQHR7UuCgLQ==", + "dependencies": { + "Microsoft.ApplicationInsights": "2.22.0", + "Microsoft.Testing.Platform": "1.5.3" + } + }, + "Microsoft.Testing.Extensions.TrxReport.Abstractions": { + "type": "Transitive", + "resolved": "1.5.3", + "contentHash": "h34zKNpGyni66VH738mRHeXSnf3klSShUdavUWNhSfWICUUi5aXeI0LBvoX/ad93N0+9xBDU3Fyi6WfxrwKQGw==", + "dependencies": { + "Microsoft.Testing.Platform": "1.5.3" + } + }, + "Microsoft.Testing.Extensions.VSTestBridge": { + "type": "Transitive", + "resolved": "1.5.3", + "contentHash": "cJD67YfDT98wEWyazKVD/yPVW6+H1usXeuselCnRes7JZBTIYWtrCchcOzOahnmajT79eDKqt9sta7DXwTDU4Q==", + "dependencies": { + "Microsoft.ApplicationInsights": "2.22.0", + "Microsoft.TestPlatform.ObjectModel": "17.12.0", + "Microsoft.Testing.Extensions.Telemetry": "1.5.3", + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.5.3", + "Microsoft.Testing.Platform": "1.5.3" + } + }, + "Microsoft.Testing.Platform": { + "type": "Transitive", + "resolved": "1.5.3", + "contentHash": "WqJydnJ99dEKtquR9HwINz104ehWJKTXbQQrydGatlLRw14bmsx0pa8+E6KUXMYXZAimN0swWlDmcJGjjW4TIg==" + }, + "Microsoft.Testing.Platform.MSBuild": { + "type": "Transitive", + "resolved": "1.5.3", + "contentHash": "bOtpRMSPeT5YLQo+NNY8EtdNTphAUcmALjW4ABU7P0rb6yR2XAZau3TzNieLmR3lRuwudguWzzBhgcLRXwZh0A==", + "dependencies": { + "Microsoft.Testing.Platform": "1.5.3" + } + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "NETStandard.Library": { + "type": "Transitive", + "resolved": "2.0.0", + "contentHash": "7jnbRU+L08FXKMxqUflxEXtVymWvNOrS8yHgu9s6EM8Anr6T/wIX4nZ08j/u3Asz+tCufp3YVwFSEvFTPYmBPA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + }, + "StyleCop.Analyzers.Unstable": { + "type": "Transitive", + "resolved": "1.2.0.556", + "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "fluentassertions": { + "type": "Project" + } + } + } +} \ No newline at end of file diff --git a/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json b/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json new file mode 100644 index 0000000000..3dc4536a07 --- /dev/null +++ b/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json @@ -0,0 +1,167 @@ +{ + "version": 1, + "dependencies": { + "net6.0": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "CSharpGuidelinesAnalyzer": { + "type": "Direct", + "requested": "[3.8.5, )", + "resolved": "3.8.5", + "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" + }, + "Meziantou.Analyzer": { + "type": "Direct", + "requested": "[2.0.212, )", + "resolved": "2.0.212", + "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0", + "Microsoft.TestPlatform.TestHost": "17.13.0" + } + }, + "NUnit": { + "type": "Direct", + "requested": "[4.3.2, )", + "resolved": "4.3.2", + "contentHash": "puVXayXNmEu7MFQSUswGmUjOy3M3baprMbkLl5PAutpeDoGTr+jPv33qAYsqxywi2wJCq8l/O3EhHoLulPE1iQ==" + }, + "NUnit3TestAdapter": { + "type": "Direct", + "requested": "[5.0.0, )", + "resolved": "5.0.0", + "contentHash": "sy4cLoUAdE6TDM4wNX5gmNCyhMev5wUz4cA6ZRf/aON9vf9t4xTVGLj/4huhDKcS4dFfmVVcgcP70yC7WC9kKg==", + "dependencies": { + "Microsoft.Testing.Extensions.VSTestBridge": "1.5.3", + "Microsoft.Testing.Platform.MSBuild": "1.5.3" + } + }, + "Roslynator.Analyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" + }, + "StyleCop.Analyzers": { + "type": "Direct", + "requested": "[1.2.0-beta.556, )", + "resolved": "1.2.0-beta.556", + "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", + "dependencies": { + "StyleCop.Analyzers.Unstable": "1.2.0.556" + } + }, + "Microsoft.ApplicationInsights": { + "type": "Transitive", + "resolved": "2.22.0", + "contentHash": "3AOM9bZtku7RQwHyMEY3tQMrHIgjcfRDa6YQpd/QG2LDGvMydSlL9Di+8LLMt7J2RDdfJ7/2jdYv6yHcMJAnNw==", + "dependencies": { + "System.Diagnostics.DiagnosticSource": "5.0.0" + } + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.Testing.Extensions.Telemetry": { + "type": "Transitive", + "resolved": "1.5.3", + "contentHash": "U9pGd5DQuX1PfkrdFI+xH34JGgQ2nes5QAwIITTk+MQfLvRITqsZjJeHTjpGWh33D/0q1l7aA8/LQHR7UuCgLQ==", + "dependencies": { + "Microsoft.ApplicationInsights": "2.22.0", + "Microsoft.Testing.Platform": "1.5.3" + } + }, + "Microsoft.Testing.Extensions.TrxReport.Abstractions": { + "type": "Transitive", + "resolved": "1.5.3", + "contentHash": "h34zKNpGyni66VH738mRHeXSnf3klSShUdavUWNhSfWICUUi5aXeI0LBvoX/ad93N0+9xBDU3Fyi6WfxrwKQGw==", + "dependencies": { + "Microsoft.Testing.Platform": "1.5.3" + } + }, + "Microsoft.Testing.Extensions.VSTestBridge": { + "type": "Transitive", + "resolved": "1.5.3", + "contentHash": "cJD67YfDT98wEWyazKVD/yPVW6+H1usXeuselCnRes7JZBTIYWtrCchcOzOahnmajT79eDKqt9sta7DXwTDU4Q==", + "dependencies": { + "Microsoft.ApplicationInsights": "2.22.0", + "Microsoft.TestPlatform.ObjectModel": "17.12.0", + "Microsoft.Testing.Extensions.Telemetry": "1.5.3", + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.5.3", + "Microsoft.Testing.Platform": "1.5.3" + } + }, + "Microsoft.Testing.Platform": { + "type": "Transitive", + "resolved": "1.5.3", + "contentHash": "WqJydnJ99dEKtquR9HwINz104ehWJKTXbQQrydGatlLRw14bmsx0pa8+E6KUXMYXZAimN0swWlDmcJGjjW4TIg==" + }, + "Microsoft.Testing.Platform.MSBuild": { + "type": "Transitive", + "resolved": "1.5.3", + "contentHash": "bOtpRMSPeT5YLQo+NNY8EtdNTphAUcmALjW4ABU7P0rb6yR2XAZau3TzNieLmR3lRuwudguWzzBhgcLRXwZh0A==", + "dependencies": { + "Microsoft.Testing.Platform": "1.5.3" + } + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + }, + "StyleCop.Analyzers.Unstable": { + "type": "Transitive", + "resolved": "1.2.0.556", + "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "fluentassertions": { + "type": "Project" + } + } + } +} \ No newline at end of file diff --git a/Tests/TestFrameworks/TUnit.Specs/packages.lock.json b/Tests/TestFrameworks/TUnit.Specs/packages.lock.json new file mode 100644 index 0000000000..261bbabea2 --- /dev/null +++ b/Tests/TestFrameworks/TUnit.Specs/packages.lock.json @@ -0,0 +1,151 @@ +{ + "version": 1, + "dependencies": { + "net8.0": { + "Microsoft.Testing.Extensions.CodeCoverage": { + "type": "Direct", + "requested": "[17.14.2, )", + "resolved": "17.14.2", + "contentHash": "lCz1/FMGM8yf4UZh+yJL6ETvH78e7/NblWbK2/Lb6z02iiOtExea3hBQKX+vrq6vBo2o6ZCiYceOGq0t07PLkQ==", + "dependencies": { + "Microsoft.DiaSymReader": "2.0.0", + "Microsoft.Extensions.DependencyModel": "6.0.2", + "Microsoft.Testing.Platform": "1.6.2", + "System.Reflection.Metadata": "8.0.0" + } + }, + "Microsoft.Testing.Extensions.TrxReport": { + "type": "Direct", + "requested": "[1.8.1, )", + "resolved": "1.8.1", + "contentHash": "SMR4fCIHtCG7PbIVNZC4R33TpgyvCx3YBKzEhQKedwq9bw4QE9eMok+a7ectvPA3Ga4qvcTeP1pkoeq4GjGTrQ==", + "dependencies": { + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.1", + "Microsoft.Testing.Platform": "1.8.1" + } + }, + "TUnit": { + "type": "Direct", + "requested": "[0.53.0, )", + "resolved": "0.53.0", + "contentHash": "oWg00scFEEVfhvOoM0mZm+qwtINz+3QNcXWBvVrLVnXe+j8N2C0bWzyMNkizFINsGPMfTPWhmLmRswee6E+xIw==", + "dependencies": { + "TUnit.Assertions": "0.53.0", + "TUnit.Engine": "0.53.0" + } + }, + "EnumerableAsyncProcessor": { + "type": "Transitive", + "resolved": "3.0.2", + "contentHash": "7ClJUPySgaD7+MOQ5MvjX8UlSvY9a05fDGnloTgN5S1D9M25jFYon5Gtpw3kLIXfk0Xj+i0Jg7dpgPtDiadBuw==" + }, + "Microsoft.DiaSymReader": { + "type": "Transitive", + "resolved": "2.0.0", + "contentHash": "QcZrCETsBJqy/vQpFtJc+jSXQ0K5sucQ6NUFbTNVHD4vfZZOwjZ/3sBzczkC4DityhD3AVO/+K/+9ioLs1AgRA==" + }, + "Microsoft.Extensions.DependencyModel": { + "type": "Transitive", + "resolved": "6.0.2", + "contentHash": "HS5YsudCGSVoCVdsYJ5FAO9vx0z04qSAXgVzpDJSQ1/w/X9q8hrQVGU2p+Yfui+2KcXLL+Zjc0SX3yJWtBmYiw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "6.0.1", + "System.Text.Json": "6.0.11" + } + }, + "Microsoft.Testing.Extensions.TrxReport.Abstractions": { + "type": "Transitive", + "resolved": "1.8.1", + "contentHash": "Z7JGDf/hA89BMhDdQG6351ItKUC5V2ISBRLw0PozL+OuWqbzrXiVbGm/YJXMj2Z4KCqIBT2K+GEC07rpNQv7ew==", + "dependencies": { + "Microsoft.Testing.Platform": "1.8.1" + } + }, + "Microsoft.Testing.Platform": { + "type": "Transitive", + "resolved": "1.8.1", + "contentHash": "Nb2F/2nZBn7+81HRmICCrJXjpCQny+cG2l/rW81mApHKbf+nDeydo44PYFwGMYz2ZuNnIWB96qvI5Uy4l69ceQ==" + }, + "Microsoft.Testing.Platform.MSBuild": { + "type": "Transitive", + "resolved": "1.4.3", + "contentHash": "1gGqgHtiZ6tZn/6Tby+qlKpNe5Ye/5LnxlSsyl4XMZ4m4V+Cu1K1m+gD1zxoxHIvLjgX8mCnQRK95MGBBFuumw==", + "dependencies": { + "Microsoft.Testing.Platform": "1.4.3" + } + }, + "System.Buffers": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==" + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==", + "dependencies": { + "System.Collections.Immutable": "8.0.0" + } + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Text.Encodings.Web": { + "type": "Transitive", + "resolved": "6.0.1", + "contentHash": "E5M5AE2OUTlCrf4omZvzzziUJO9CofBl+lXHaN5IKePPJvHqYFYYpaDPgCpR4VwaFbEebfnjOxxEBtPtsqAxpQ==" + }, + "System.Text.Json": { + "type": "Transitive", + "resolved": "6.0.11", + "contentHash": "xqC1HIbJMBFhrpYs76oYP+NAskNVjc6v73HqLal7ECRDPIp4oRU5pPavkD//vNactCn9DA2aaald/I5N+uZ5/g==" + }, + "System.Threading.Channels": { + "type": "Transitive", + "resolved": "9.0.0", + "contentHash": "hzACdIf1C+4Dqos5ijV404b94+LqfIC8nfS3mNpCDFWowb1N3PNfJPopneq32ahWlDeyaPZJqjBk76YFR69Rpg==" + }, + "TUnit.Assertions": { + "type": "Transitive", + "resolved": "0.53.0", + "contentHash": "8Hi7PqB77SAwZbvcv+TyRk7hmIART1maTGW8/N0ZT47aVzCYEiUDrcru4Hgj7xxrR8ueVT/KuG/FzOwHO1wvkQ==" + }, + "TUnit.Core": { + "type": "Transitive", + "resolved": "0.53.0", + "contentHash": "NpNQg38dK2JMt+dixIfTdvqS/yKtZaHqEegoW5OSmilo6+Z0ta4bLtlT9gH11niQNefKCN9HjUGXUlJeu+d7xw==" + }, + "TUnit.Engine": { + "type": "Transitive", + "resolved": "0.53.0", + "contentHash": "U/RMNhLdI89TdEJ+GEJK///kjVgLopqBJ/vw5DCB0DZGEX5mIXV6ZwlpiZhlR8nj9SzvHSaTCquJmqWWcQ2qEQ==", + "dependencies": { + "EnumerableAsyncProcessor": "3.0.2", + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.1", + "Microsoft.Testing.Platform": "1.8.1", + "Microsoft.Testing.Platform.MSBuild": "1.4.3", + "System.Threading.Channels": "9.0.0", + "TUnit.Core": "0.53.0" + } + }, + "fluentassertions": { + "type": "Project" + } + } + } +} \ No newline at end of file diff --git a/Tests/TestFrameworks/XUnit2.Specs/packages.lock.json b/Tests/TestFrameworks/XUnit2.Specs/packages.lock.json new file mode 100644 index 0000000000..b3df3447bc --- /dev/null +++ b/Tests/TestFrameworks/XUnit2.Specs/packages.lock.json @@ -0,0 +1,269 @@ +{ + "version": 1, + "dependencies": { + ".NETFramework,Version=v4.7": { + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0" + } + }, + "xunit": { + "type": "Direct", + "requested": "[2.9.3, )", + "resolved": "2.9.3", + "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", + "dependencies": { + "xunit.analyzers": "1.18.0", + "xunit.assert": "2.9.3", + "xunit.core": "[2.9.3]" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[2.8.2, )", + "resolved": "2.8.2", + "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.10.0" + } + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.10.0", + "contentHash": "KkwhjQevuDj0aBRoPLY6OLAhGqbPUEBuKLbaCs0kUVw29qiOYncdORd4mLVJbn9vGZ7/iFGQ/+AoJl0Tu5Umdg==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==", + "dependencies": { + "System.Collections.Immutable": "1.5.0" + } + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "xunit.abstractions": { + "type": "Transitive", + "resolved": "2.0.3", + "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.18.0", + "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" + }, + "xunit.assert": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" + }, + "xunit.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]", + "xunit.extensibility.execution": "[2.9.3]" + } + }, + "xunit.extensibility.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", + "dependencies": { + "xunit.abstractions": "2.0.3" + } + }, + "xunit.extensibility.execution": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]" + } + }, + "fluentassertions": { + "type": "Project", + "dependencies": { + "System.Threading.Tasks.Extensions": "[4.5.4, )" + } + } + }, + "net6.0": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "CSharpGuidelinesAnalyzer": { + "type": "Direct", + "requested": "[3.8.5, )", + "resolved": "3.8.5", + "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" + }, + "Meziantou.Analyzer": { + "type": "Direct", + "requested": "[2.0.212, )", + "resolved": "2.0.212", + "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0", + "Microsoft.TestPlatform.TestHost": "17.13.0" + } + }, + "Roslynator.Analyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" + }, + "StyleCop.Analyzers": { + "type": "Direct", + "requested": "[1.2.0-beta.556, )", + "resolved": "1.2.0-beta.556", + "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", + "dependencies": { + "StyleCop.Analyzers.Unstable": "1.2.0.556" + } + }, + "xunit": { + "type": "Direct", + "requested": "[2.9.3, )", + "resolved": "2.9.3", + "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", + "dependencies": { + "xunit.analyzers": "1.18.0", + "xunit.assert": "2.9.3", + "xunit.core": "[2.9.3]" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[2.8.2, )", + "resolved": "2.8.2", + "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + }, + "StyleCop.Analyzers.Unstable": { + "type": "Transitive", + "resolved": "1.2.0.556", + "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "xunit.abstractions": { + "type": "Transitive", + "resolved": "2.0.3", + "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.18.0", + "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" + }, + "xunit.assert": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" + }, + "xunit.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]", + "xunit.extensibility.execution": "[2.9.3]" + } + }, + "xunit.extensibility.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", + "dependencies": { + "xunit.abstractions": "2.0.3" + } + }, + "xunit.extensibility.execution": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]" + } + }, + "fluentassertions": { + "type": "Project" + } + } + } +} \ No newline at end of file diff --git a/Tests/TestFrameworks/XUnit3.Specs/packages.lock.json b/Tests/TestFrameworks/XUnit3.Specs/packages.lock.json new file mode 100644 index 0000000000..d86030a286 --- /dev/null +++ b/Tests/TestFrameworks/XUnit3.Specs/packages.lock.json @@ -0,0 +1,352 @@ +{ + "version": 1, + "dependencies": { + ".NETFramework,Version=v4.7.2": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[3.1.3, )", + "resolved": "3.1.3", + "contentHash": "go7e81n/UI3LeNqoJIJ3thkS4JfJtiQnDbAxLh09JkJqoHthnfbLS5p68s4/Bm12B9umkoYSB5SaDr68hZNleg==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0" + } + }, + "xunit.v3": { + "type": "Direct", + "requested": "[3.0.0, )", + "resolved": "3.0.0", + "contentHash": "IzPThK1+JjkBJzMWrWtMZY7FtYagnpg3cBwR/8XJE5mK6JPwz5nz/auQ9Ln02DZCK3O3E1kHyMC1f490/6g6dQ==", + "dependencies": { + "xunit.analyzers": "1.23.0", + "xunit.v3.assert": "[3.0.0]", + "xunit.v3.core": "[3.0.0]" + } + }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==", + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.Testing.Extensions.TrxReport.Abstractions": { + "type": "Transitive", + "resolved": "1.7.3", + "contentHash": "dDEETHbX5JQBMIFgBPkX/FmCU4DRQSG+k58QUtz7zTdnEZDafPKH6YHSMoHY3blDiZV/vcSol35Ux3WC7wU+9Q==", + "dependencies": { + "Microsoft.Testing.Platform": "1.7.3" + } + }, + "Microsoft.Testing.Platform": { + "type": "Transitive", + "resolved": "1.7.3", + "contentHash": "cI6u+CPxv3+07cbSwJVKOfxFrecbjfZnid1fe8EMhyPY4qmsSNnm+hN+GIy8u4JIlrADfrskDiwnScjRzVzJNw==" + }, + "Microsoft.Testing.Platform.MSBuild": { + "type": "Transitive", + "resolved": "1.7.3", + "contentHash": "tSIKXv7tLLYDjfodqLuTigsmOVcYj0CDC1rYeac5MTgHjbYV8IfmYh4FprBt/xE1zW8phkCYP766F9ayo560jA==", + "dependencies": { + "Microsoft.Testing.Platform": "1.7.3" + } + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "System.Buffers": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "l4zZJ1WU2hqpQQHXz1rvC3etVZN+2DLmQMO79FhOTZHMn8tDRr+WU287sbomD0BETlmKDn0ygUgVy9k5xkkJdA==", + "dependencies": { + "System.Memory": "4.5.4", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.5", + "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "System.Numerics.Vectors": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==", + "dependencies": { + "System.Collections.Immutable": "1.5.0" + } + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.23.0", + "contentHash": "WCkO1FPTWoESLhghoXA881CulRYpve0UrXLsL5aYcLQd9SlD+oADb16NAP+SE5o3w0FM2MzGTklBwY8yUfj0ng==" + }, + "xunit.v3.assert": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "tlEmAE8uQ9fOhbNyg7sLJiYhekeD4LFRDJRZrv3mdnvJv7kfb2Z1OmJcsMHF+/N/QE/vTtwqRItiPJZGpOw/EQ==", + "dependencies": { + "System.Collections.Immutable": "6.0.0", + "System.Memory": "4.5.5" + } + }, + "xunit.v3.common": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "8bPJb2N2kYWSa9c9pkUtQmzWc2+0wKxWo9NIgUev6DX+TkXjdBUh6zY0LPVIdSGxsl3swjn4+gEpj5QjrzZiQw==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0" + } + }, + "xunit.v3.core": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "c71CPzXXTbnmr3iz2dmo4OniOWNM+30DtWQxpepKVjLIFRYimP+ahn/pjPHSmDqL2xl2tewosLNFodyijcnBLQ==", + "dependencies": { + "Microsoft.Testing.Platform.MSBuild": "1.7.3", + "xunit.v3.extensibility.core": "[3.0.0]", + "xunit.v3.runner.inproc.console": "[3.0.0]" + } + }, + "xunit.v3.extensibility.core": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "bzYmxPXtuLDwueg5gqB4/JlCShqHO/weZVgsOxgvMSw4ulyKFqv78JpUE1+aluJWitrfeaL6P8mfPV6zLQS49w==", + "dependencies": { + "xunit.v3.common": "[3.0.0]" + } + }, + "xunit.v3.runner.common": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "GIk0y3T/siVtU2rwbPPC/PFANHlAbknwWmxNOPqyz+NviFTKY3sILeHeotQff4MT+Rk0tjPGNAwCtzp9fRPLpQ==", + "dependencies": { + "xunit.v3.common": "[3.0.0]" + } + }, + "xunit.v3.runner.inproc.console": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "V0ZxjXFRVDoscU4SfVFvHVzqhGbevBitl7Yn3Vn6s+NqFmwP4tY6/o3ZU9skAQ1bgtfNUEYfrwYTzzoeQFbNQw==", + "dependencies": { + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.7.3", + "Microsoft.Testing.Platform": "1.7.3", + "xunit.v3.extensibility.core": "[3.0.0]", + "xunit.v3.runner.common": "[3.0.0]" + } + }, + "fluentassertions": { + "type": "Project", + "dependencies": { + "System.Threading.Tasks.Extensions": "[4.5.4, )" + } + } + }, + ".NETFramework,Version=v4.7.2/win-x86": {}, + "net8.0": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0", + "Microsoft.TestPlatform.TestHost": "17.13.0" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[3.1.3, )", + "resolved": "3.1.3", + "contentHash": "go7e81n/UI3LeNqoJIJ3thkS4JfJtiQnDbAxLh09JkJqoHthnfbLS5p68s4/Bm12B9umkoYSB5SaDr68hZNleg==" + }, + "xunit.v3": { + "type": "Direct", + "requested": "[3.0.0, )", + "resolved": "3.0.0", + "contentHash": "IzPThK1+JjkBJzMWrWtMZY7FtYagnpg3cBwR/8XJE5mK6JPwz5nz/auQ9Ln02DZCK3O3E1kHyMC1f490/6g6dQ==", + "dependencies": { + "xunit.analyzers": "1.23.0", + "xunit.v3.assert": "[3.0.0]", + "xunit.v3.core": "[3.0.0]" + } + }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==" + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.Testing.Extensions.TrxReport.Abstractions": { + "type": "Transitive", + "resolved": "1.7.3", + "contentHash": "dDEETHbX5JQBMIFgBPkX/FmCU4DRQSG+k58QUtz7zTdnEZDafPKH6YHSMoHY3blDiZV/vcSol35Ux3WC7wU+9Q==", + "dependencies": { + "Microsoft.Testing.Platform": "1.7.3" + } + }, + "Microsoft.Testing.Platform": { + "type": "Transitive", + "resolved": "1.7.3", + "contentHash": "cI6u+CPxv3+07cbSwJVKOfxFrecbjfZnid1fe8EMhyPY4qmsSNnm+hN+GIy8u4JIlrADfrskDiwnScjRzVzJNw==" + }, + "Microsoft.Testing.Platform.MSBuild": { + "type": "Transitive", + "resolved": "1.7.3", + "contentHash": "tSIKXv7tLLYDjfodqLuTigsmOVcYj0CDC1rYeac5MTgHjbYV8IfmYh4FprBt/xE1zW8phkCYP766F9ayo560jA==", + "dependencies": { + "Microsoft.Testing.Platform": "1.7.3" + } + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.23.0", + "contentHash": "WCkO1FPTWoESLhghoXA881CulRYpve0UrXLsL5aYcLQd9SlD+oADb16NAP+SE5o3w0FM2MzGTklBwY8yUfj0ng==" + }, + "xunit.v3.assert": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "tlEmAE8uQ9fOhbNyg7sLJiYhekeD4LFRDJRZrv3mdnvJv7kfb2Z1OmJcsMHF+/N/QE/vTtwqRItiPJZGpOw/EQ==" + }, + "xunit.v3.common": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "8bPJb2N2kYWSa9c9pkUtQmzWc2+0wKxWo9NIgUev6DX+TkXjdBUh6zY0LPVIdSGxsl3swjn4+gEpj5QjrzZiQw==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0" + } + }, + "xunit.v3.core": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "c71CPzXXTbnmr3iz2dmo4OniOWNM+30DtWQxpepKVjLIFRYimP+ahn/pjPHSmDqL2xl2tewosLNFodyijcnBLQ==", + "dependencies": { + "Microsoft.Testing.Platform.MSBuild": "1.7.3", + "xunit.v3.extensibility.core": "[3.0.0]", + "xunit.v3.runner.inproc.console": "[3.0.0]" + } + }, + "xunit.v3.extensibility.core": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "bzYmxPXtuLDwueg5gqB4/JlCShqHO/weZVgsOxgvMSw4ulyKFqv78JpUE1+aluJWitrfeaL6P8mfPV6zLQS49w==", + "dependencies": { + "xunit.v3.common": "[3.0.0]" + } + }, + "xunit.v3.runner.common": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "GIk0y3T/siVtU2rwbPPC/PFANHlAbknwWmxNOPqyz+NviFTKY3sILeHeotQff4MT+Rk0tjPGNAwCtzp9fRPLpQ==", + "dependencies": { + "xunit.v3.common": "[3.0.0]" + } + }, + "xunit.v3.runner.inproc.console": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "V0ZxjXFRVDoscU4SfVFvHVzqhGbevBitl7Yn3Vn6s+NqFmwP4tY6/o3ZU9skAQ1bgtfNUEYfrwYTzzoeQFbNQw==", + "dependencies": { + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.7.3", + "Microsoft.Testing.Platform": "1.7.3", + "xunit.v3.extensibility.core": "[3.0.0]", + "xunit.v3.runner.common": "[3.0.0]" + } + }, + "fluentassertions": { + "type": "Project" + } + }, + "net8.0/win-x86": {} + } +} \ No newline at end of file diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/packages.lock.json b/Tests/TestFrameworks/XUnit3Core.Specs/packages.lock.json new file mode 100644 index 0000000000..c3ba3749af --- /dev/null +++ b/Tests/TestFrameworks/XUnit3Core.Specs/packages.lock.json @@ -0,0 +1,284 @@ +{ + "version": 1, + "dependencies": { + ".NETFramework,Version=v4.7.2": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[3.1.3, )", + "resolved": "3.1.3", + "contentHash": "go7e81n/UI3LeNqoJIJ3thkS4JfJtiQnDbAxLh09JkJqoHthnfbLS5p68s4/Bm12B9umkoYSB5SaDr68hZNleg==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0" + } + }, + "xunit.v3.core": { + "type": "Direct", + "requested": "[3.0.0, )", + "resolved": "3.0.0", + "contentHash": "c71CPzXXTbnmr3iz2dmo4OniOWNM+30DtWQxpepKVjLIFRYimP+ahn/pjPHSmDqL2xl2tewosLNFodyijcnBLQ==", + "dependencies": { + "Microsoft.Testing.Platform.MSBuild": "1.7.3", + "xunit.v3.extensibility.core": "[3.0.0]", + "xunit.v3.runner.inproc.console": "[3.0.0]" + } + }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==", + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.Testing.Extensions.TrxReport.Abstractions": { + "type": "Transitive", + "resolved": "1.7.3", + "contentHash": "dDEETHbX5JQBMIFgBPkX/FmCU4DRQSG+k58QUtz7zTdnEZDafPKH6YHSMoHY3blDiZV/vcSol35Ux3WC7wU+9Q==", + "dependencies": { + "Microsoft.Testing.Platform": "1.7.3" + } + }, + "Microsoft.Testing.Platform": { + "type": "Transitive", + "resolved": "1.7.3", + "contentHash": "cI6u+CPxv3+07cbSwJVKOfxFrecbjfZnid1fe8EMhyPY4qmsSNnm+hN+GIy8u4JIlrADfrskDiwnScjRzVzJNw==" + }, + "Microsoft.Testing.Platform.MSBuild": { + "type": "Transitive", + "resolved": "1.7.3", + "contentHash": "tSIKXv7tLLYDjfodqLuTigsmOVcYj0CDC1rYeac5MTgHjbYV8IfmYh4FprBt/xE1zW8phkCYP766F9ayo560jA==", + "dependencies": { + "Microsoft.Testing.Platform": "1.7.3" + } + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "1.5.0", + "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==", + "dependencies": { + "System.Collections.Immutable": "1.5.0" + } + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "xunit.v3.common": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "8bPJb2N2kYWSa9c9pkUtQmzWc2+0wKxWo9NIgUev6DX+TkXjdBUh6zY0LPVIdSGxsl3swjn4+gEpj5QjrzZiQw==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0" + } + }, + "xunit.v3.extensibility.core": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "bzYmxPXtuLDwueg5gqB4/JlCShqHO/weZVgsOxgvMSw4ulyKFqv78JpUE1+aluJWitrfeaL6P8mfPV6zLQS49w==", + "dependencies": { + "xunit.v3.common": "[3.0.0]" + } + }, + "xunit.v3.runner.common": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "GIk0y3T/siVtU2rwbPPC/PFANHlAbknwWmxNOPqyz+NviFTKY3sILeHeotQff4MT+Rk0tjPGNAwCtzp9fRPLpQ==", + "dependencies": { + "xunit.v3.common": "[3.0.0]" + } + }, + "xunit.v3.runner.inproc.console": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "V0ZxjXFRVDoscU4SfVFvHVzqhGbevBitl7Yn3Vn6s+NqFmwP4tY6/o3ZU9skAQ1bgtfNUEYfrwYTzzoeQFbNQw==", + "dependencies": { + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.7.3", + "Microsoft.Testing.Platform": "1.7.3", + "xunit.v3.extensibility.core": "[3.0.0]", + "xunit.v3.runner.common": "[3.0.0]" + } + }, + "fluentassertions": { + "type": "Project", + "dependencies": { + "System.Threading.Tasks.Extensions": "[4.5.4, )" + } + } + }, + ".NETFramework,Version=v4.7.2/win-x86": {}, + "net8.0": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0", + "Microsoft.TestPlatform.TestHost": "17.13.0" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[3.1.3, )", + "resolved": "3.1.3", + "contentHash": "go7e81n/UI3LeNqoJIJ3thkS4JfJtiQnDbAxLh09JkJqoHthnfbLS5p68s4/Bm12B9umkoYSB5SaDr68hZNleg==" + }, + "xunit.v3.core": { + "type": "Direct", + "requested": "[3.0.0, )", + "resolved": "3.0.0", + "contentHash": "c71CPzXXTbnmr3iz2dmo4OniOWNM+30DtWQxpepKVjLIFRYimP+ahn/pjPHSmDqL2xl2tewosLNFodyijcnBLQ==", + "dependencies": { + "Microsoft.Testing.Platform.MSBuild": "1.7.3", + "xunit.v3.extensibility.core": "[3.0.0]", + "xunit.v3.runner.inproc.console": "[3.0.0]" + } + }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==" + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.Testing.Extensions.TrxReport.Abstractions": { + "type": "Transitive", + "resolved": "1.7.3", + "contentHash": "dDEETHbX5JQBMIFgBPkX/FmCU4DRQSG+k58QUtz7zTdnEZDafPKH6YHSMoHY3blDiZV/vcSol35Ux3WC7wU+9Q==", + "dependencies": { + "Microsoft.Testing.Platform": "1.7.3" + } + }, + "Microsoft.Testing.Platform": { + "type": "Transitive", + "resolved": "1.7.3", + "contentHash": "cI6u+CPxv3+07cbSwJVKOfxFrecbjfZnid1fe8EMhyPY4qmsSNnm+hN+GIy8u4JIlrADfrskDiwnScjRzVzJNw==" + }, + "Microsoft.Testing.Platform.MSBuild": { + "type": "Transitive", + "resolved": "1.7.3", + "contentHash": "tSIKXv7tLLYDjfodqLuTigsmOVcYj0CDC1rYeac5MTgHjbYV8IfmYh4FprBt/xE1zW8phkCYP766F9ayo560jA==", + "dependencies": { + "Microsoft.Testing.Platform": "1.7.3" + } + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "xunit.v3.common": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "8bPJb2N2kYWSa9c9pkUtQmzWc2+0wKxWo9NIgUev6DX+TkXjdBUh6zY0LPVIdSGxsl3swjn4+gEpj5QjrzZiQw==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0" + } + }, + "xunit.v3.extensibility.core": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "bzYmxPXtuLDwueg5gqB4/JlCShqHO/weZVgsOxgvMSw4ulyKFqv78JpUE1+aluJWitrfeaL6P8mfPV6zLQS49w==", + "dependencies": { + "xunit.v3.common": "[3.0.0]" + } + }, + "xunit.v3.runner.common": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "GIk0y3T/siVtU2rwbPPC/PFANHlAbknwWmxNOPqyz+NviFTKY3sILeHeotQff4MT+Rk0tjPGNAwCtzp9fRPLpQ==", + "dependencies": { + "xunit.v3.common": "[3.0.0]" + } + }, + "xunit.v3.runner.inproc.console": { + "type": "Transitive", + "resolved": "3.0.0", + "contentHash": "V0ZxjXFRVDoscU4SfVFvHVzqhGbevBitl7Yn3Vn6s+NqFmwP4tY6/o3ZU9skAQ1bgtfNUEYfrwYTzzoeQFbNQw==", + "dependencies": { + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.7.3", + "Microsoft.Testing.Platform": "1.7.3", + "xunit.v3.extensibility.core": "[3.0.0]", + "xunit.v3.runner.common": "[3.0.0]" + } + }, + "fluentassertions": { + "type": "Project" + } + }, + "net8.0/win-x86": {} + } +} \ No newline at end of file diff --git a/Tests/VB.Specs/packages.lock.json b/Tests/VB.Specs/packages.lock.json new file mode 100644 index 0000000000..149feabf17 --- /dev/null +++ b/Tests/VB.Specs/packages.lock.json @@ -0,0 +1,153 @@ +{ + "version": 1, + "dependencies": { + "net6.0": { + "coverlet.collector": { + "type": "Direct", + "requested": "[6.0.4, )", + "resolved": "6.0.4", + "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" + }, + "CSharpGuidelinesAnalyzer": { + "type": "Direct", + "requested": "[3.8.5, )", + "resolved": "3.8.5", + "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" + }, + "Meziantou.Analyzer": { + "type": "Direct", + "requested": "[2.0.212, )", + "resolved": "2.0.212", + "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" + }, + "Microsoft.NET.Test.Sdk": { + "type": "Direct", + "requested": "[17.13.0, )", + "resolved": "17.13.0", + "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", + "dependencies": { + "Microsoft.CodeCoverage": "17.13.0", + "Microsoft.TestPlatform.TestHost": "17.13.0" + } + }, + "Roslynator.Analyzers": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" + }, + "StyleCop.Analyzers": { + "type": "Direct", + "requested": "[1.2.0-beta.556, )", + "resolved": "1.2.0-beta.556", + "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", + "dependencies": { + "StyleCop.Analyzers.Unstable": "1.2.0.556" + } + }, + "xunit": { + "type": "Direct", + "requested": "[2.9.3, )", + "resolved": "2.9.3", + "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", + "dependencies": { + "xunit.analyzers": "1.18.0", + "xunit.assert": "2.9.3", + "xunit.core": "[2.9.3]" + } + }, + "xunit.runner.visualstudio": { + "type": "Direct", + "requested": "[3.0.0, )", + "resolved": "3.0.0", + "contentHash": "HggUqjQJe8PtDxcP25Q+CnR6Lz4oX3GElhD9V4oU2+75x9HI6A6sxbfKGS4UwU4t4yJaS9fBmAuriz8bQApNjw==" + }, + "Microsoft.CodeCoverage": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" + }, + "Microsoft.TestPlatform.ObjectModel": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } + }, + "Microsoft.TestPlatform.TestHost": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + }, + "StyleCop.Analyzers.Unstable": { + "type": "Transitive", + "resolved": "1.2.0.556", + "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" + }, + "xunit.abstractions": { + "type": "Transitive", + "resolved": "2.0.3", + "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" + }, + "xunit.analyzers": { + "type": "Transitive", + "resolved": "1.18.0", + "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" + }, + "xunit.assert": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" + }, + "xunit.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]", + "xunit.extensibility.execution": "[2.9.3]" + } + }, + "xunit.extensibility.core": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", + "dependencies": { + "xunit.abstractions": "2.0.3" + } + }, + "xunit.extensibility.execution": { + "type": "Transitive", + "resolved": "2.9.3", + "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", + "dependencies": { + "xunit.extensibility.core": "[2.9.3]" + } + }, + "fluentassertions": { + "type": "Project" + } + } + } +} \ No newline at end of file From c670e93566dccf702fb965655fc5d7ed635d10ba Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Sep 2025 14:25:30 +0200 Subject: [PATCH 683/845] Set DisableImplicitNuGetFallbackFolder Suggestion from https://github.com/NuGet/Home/issues/7921#issuecomment-478152479 --- Directory.Build.props | 1 + 1 file changed, 1 insertion(+) diff --git a/Directory.Build.props b/Directory.Build.props index 8829ec6d3b..69a60595ae 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,6 +5,7 @@ true true true + true From 786c0fef528e87cc9346a98c4359d3c64f5861ae Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Sep 2025 17:04:43 +0200 Subject: [PATCH 684/845] PackageGuard 1.5.0 -> 1.6.1 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 31d8d810a2..c6e86b2397 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -13,7 +13,7 @@ - + From 0743d95e7ce91b6508210ae4898e4328d91ab1ab Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Sep 2025 17:07:33 +0200 Subject: [PATCH 685/845] GitVersion.Tool 6.3.0 -> 6.4.0 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index c6e86b2397..b3e3743166 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -10,7 +10,7 @@ 1 - + From 3634b6a0b04ba51dacf9bcc2c507316528b7235a Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Sep 2025 17:08:00 +0200 Subject: [PATCH 686/845] ReportGenerator 5.4.12 -> 5.4.13 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index b3e3743166..f6891e6651 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -11,7 +11,7 @@ - + From 2ad815087b90ca8b77ed39b28465ecc1b3c13a12 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Sep 2025 17:13:17 +0200 Subject: [PATCH 687/845] MSTest 3.10.1 -> 3.10.4 --- .../MSTestV2.Specs/MSTestV2.Specs.csproj | 4 +- .../MSTestV2.Specs/packages.lock.json | 54 +++++++++---------- Tests/UWP.Specs/UWP.Specs.csproj | 4 +- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index 9cb7084350..c0c4b31b65 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json b/Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json index 7461446d43..b9af86a6f0 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json +++ b/Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json @@ -38,21 +38,21 @@ }, "MSTest.TestAdapter": { "type": "Direct", - "requested": "[3.10.1, )", - "resolved": "3.10.1", - "contentHash": "5kEgI2extjbTssFL/91P5AorZmplclthPTNEj0j60K/kwKnHba0fmdH+btMUOJSAm/XZI/AE7xz/SjGhruEayw==", + "requested": "[3.10.4, )", + "resolved": "3.10.4", + "contentHash": "Gnoegnprezaqlx+X0T+bkOJsVzS9kKerfIeiLrw0nEEtu3tvT5hoEnv4uCqy+OfV3EdLqk1aJyNI3S30RbGXgw==", "dependencies": { - "Microsoft.Testing.Extensions.VSTestBridge": "1.8.1", - "Microsoft.Testing.Platform.MSBuild": "1.8.1" + "Microsoft.Testing.Extensions.VSTestBridge": "1.8.4", + "Microsoft.Testing.Platform.MSBuild": "1.8.4" } }, "MSTest.TestFramework": { "type": "Direct", - "requested": "[3.10.1, )", - "resolved": "3.10.1", - "contentHash": "G+OBqUGOSxo+2rv+mTK+nOK0rESYUjJNhU+GsPnqEqGQdd5u8wGzs2TpoY1CLavaEzUsw0cHALl+j52QpvGMBA==", + "requested": "[3.10.4, )", + "resolved": "3.10.4", + "contentHash": "i6P4/1d2Nc4O5eOcTfvjqc/psgNNuyfMPNNU3cTvQe56bznykTZ1X88eB8JmYa+V3UiTTBKXyDP9yUb8oezLoQ==", "dependencies": { - "MSTest.Analyzers": "3.10.1" + "MSTest.Analyzers": "3.10.4" } }, "Roslynator.Analyzers": { @@ -85,44 +85,44 @@ }, "Microsoft.Testing.Extensions.Telemetry": { "type": "Transitive", - "resolved": "1.8.1", - "contentHash": "+z3bCmE5pNTlKDoib00AdkYOOra2xhrwFbuzsnu+THuEGJR+E/u+b5XSTdkVq8SHgtkDFqAh5lFgipUGQCi5ig==", + "resolved": "1.8.4", + "contentHash": "NbwjZtoXLcmPH/qtCSU3x+jQ4xBw+Ia8FVA9m4Tlvk1qtk/4LYUN7hZyA2/xVPgSPerYJoYqLy1mDG+DWfR2Ew==", "dependencies": { "Microsoft.ApplicationInsights": "2.23.0", - "Microsoft.Testing.Platform": "1.8.1" + "Microsoft.Testing.Platform": "1.8.4" } }, "Microsoft.Testing.Extensions.TrxReport.Abstractions": { "type": "Transitive", - "resolved": "1.8.1", - "contentHash": "Z7JGDf/hA89BMhDdQG6351ItKUC5V2ISBRLw0PozL+OuWqbzrXiVbGm/YJXMj2Z4KCqIBT2K+GEC07rpNQv7ew==", + "resolved": "1.8.4", + "contentHash": "jDGV5d9K5zeQG6I5ZHZrrXd0sO9up/XLpb5qI5W+FPGJx5JXx5yEiwkw0MIEykH9ydeMASPOmjbY/7jS++gYwA==", "dependencies": { - "Microsoft.Testing.Platform": "1.8.1" + "Microsoft.Testing.Platform": "1.8.4" } }, "Microsoft.Testing.Extensions.VSTestBridge": { "type": "Transitive", - "resolved": "1.8.1", - "contentHash": "2lu9NqH0YGtkhGvgeDrR9R5u97PlT5/E3Ix5l3McxnUU/e7yGK3UJOt/ukKWoQsppsJDAOW2CTrqgYTnFPR0Pw==", + "resolved": "1.8.4", + "contentHash": "t4ZgIrdURpF96XTyw3HLSwlYb22x/tpxcCMipcIYFV6QgCtmPQrVNVrPLNazNkJF8egXqumtC2hnDca+0KdRQQ==", "dependencies": { "Microsoft.TestPlatform.AdapterUtilities": "17.13.0", "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Microsoft.Testing.Extensions.Telemetry": "1.8.1", - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.1", - "Microsoft.Testing.Platform": "1.8.1" + "Microsoft.Testing.Extensions.Telemetry": "1.8.4", + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.4", + "Microsoft.Testing.Platform": "1.8.4" } }, "Microsoft.Testing.Platform": { "type": "Transitive", - "resolved": "1.8.1", - "contentHash": "Nb2F/2nZBn7+81HRmICCrJXjpCQny+cG2l/rW81mApHKbf+nDeydo44PYFwGMYz2ZuNnIWB96qvI5Uy4l69ceQ==" + "resolved": "1.8.4", + "contentHash": "MpYE6A13G9zLZjkDmy2Fm/R0MRkjBR75P0F8B1yLaUshaATixPlk2S2OE6u/rlqtqMkbEyM7F6wxc332gZpBpA==" }, "Microsoft.Testing.Platform.MSBuild": { "type": "Transitive", - "resolved": "1.8.1", - "contentHash": "khxIgxLPgsnq6R0bVh7z7QBzUCjlj+pFkYmHVPzSbzxRdF0xijqRZW8K/z2Ai0XoY1Qp2b7Tf4zEeOoXrpZeaw==", + "resolved": "1.8.4", + "contentHash": "RnS7G0eXAopdIf/XPGFNW8HUwZxRq5iGX34rVYhyDUbLS7sF513yosd4P50GtjBKqOay4qb+WHYr4NkWjtUWzQ==", "dependencies": { - "Microsoft.Testing.Platform": "1.8.1" + "Microsoft.Testing.Platform": "1.8.4" } }, "Microsoft.TestPlatform.AdapterUtilities": { @@ -149,8 +149,8 @@ }, "MSTest.Analyzers": { "type": "Transitive", - "resolved": "3.10.1", - "contentHash": "OcXiLNIXsJ9J/zlgvjnwnQ9tRH7zGzYVvbtS+w/YPSwlpEr0455p69yjTWQ8jNHqK7wn9JatOhtPPRfhYK0Y6w==" + "resolved": "3.10.4", + "contentHash": "a3IHTsbd+iS0pZUI7KC6nCCQgTOhjPyqDwPOtKLGCwjRifQ9N4K40qTqCaQlPOxwKaIxVwDLRYFvdY9NTDVi0w==" }, "Newtonsoft.Json": { "type": "Transitive", diff --git a/Tests/UWP.Specs/UWP.Specs.csproj b/Tests/UWP.Specs/UWP.Specs.csproj index 6098410f45..3dd53810ee 100644 --- a/Tests/UWP.Specs/UWP.Specs.csproj +++ b/Tests/UWP.Specs/UWP.Specs.csproj @@ -88,10 +88,10 @@ 6.2.14 - 3.10.1 + 3.10.4 - 3.10.1 + 3.10.4 4.7.0 From e9f1f6ac8fc8a0ba978c25eb4186adf74f46ccfe Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Sep 2025 17:14:01 +0200 Subject: [PATCH 688/845] TUnit 0.53.0 -> 0.57.65 --- .../TUnit.Specs/TUnit.Specs.csproj | 2 +- .../TUnit.Specs/packages.lock.json | 44 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 526a18a6b2..1e848686f6 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -11,7 +11,7 @@ - + diff --git a/Tests/TestFrameworks/TUnit.Specs/packages.lock.json b/Tests/TestFrameworks/TUnit.Specs/packages.lock.json index 261bbabea2..9ee7b25638 100644 --- a/Tests/TestFrameworks/TUnit.Specs/packages.lock.json +++ b/Tests/TestFrameworks/TUnit.Specs/packages.lock.json @@ -26,18 +26,18 @@ }, "TUnit": { "type": "Direct", - "requested": "[0.53.0, )", - "resolved": "0.53.0", - "contentHash": "oWg00scFEEVfhvOoM0mZm+qwtINz+3QNcXWBvVrLVnXe+j8N2C0bWzyMNkizFINsGPMfTPWhmLmRswee6E+xIw==", + "requested": "[0.57.65, )", + "resolved": "0.57.65", + "contentHash": "iGF7xXXH+KwK7Ue/N1ZeiOGG2B21qCGH4zTDIcOoMMFT+/XiDkHdq7QrO2ON8j7x8wAxYTQzOHV5dD2Pz+jPDg==", "dependencies": { - "TUnit.Assertions": "0.53.0", - "TUnit.Engine": "0.53.0" + "TUnit.Assertions": "0.57.65", + "TUnit.Engine": "0.57.65" } }, "EnumerableAsyncProcessor": { "type": "Transitive", - "resolved": "3.0.2", - "contentHash": "7ClJUPySgaD7+MOQ5MvjX8UlSvY9a05fDGnloTgN5S1D9M25jFYon5Gtpw3kLIXfk0Xj+i0Jg7dpgPtDiadBuw==" + "resolved": "3.8.4", + "contentHash": "KlbpupRCz3Kf+P7gsiDvFXJ980i/9lfihMZFmmxIk0Gf6mopEjy74OTJZmdaKDQpE29eQDBnMZB5khyW3eugrg==" }, "Microsoft.DiaSymReader": { "type": "Transitive", @@ -58,16 +58,16 @@ }, "Microsoft.Testing.Extensions.TrxReport.Abstractions": { "type": "Transitive", - "resolved": "1.8.1", - "contentHash": "Z7JGDf/hA89BMhDdQG6351ItKUC5V2ISBRLw0PozL+OuWqbzrXiVbGm/YJXMj2Z4KCqIBT2K+GEC07rpNQv7ew==", + "resolved": "1.8.4", + "contentHash": "jDGV5d9K5zeQG6I5ZHZrrXd0sO9up/XLpb5qI5W+FPGJx5JXx5yEiwkw0MIEykH9ydeMASPOmjbY/7jS++gYwA==", "dependencies": { - "Microsoft.Testing.Platform": "1.8.1" + "Microsoft.Testing.Platform": "1.8.4" } }, "Microsoft.Testing.Platform": { "type": "Transitive", - "resolved": "1.8.1", - "contentHash": "Nb2F/2nZBn7+81HRmICCrJXjpCQny+cG2l/rW81mApHKbf+nDeydo44PYFwGMYz2ZuNnIWB96qvI5Uy4l69ceQ==" + "resolved": "1.8.4", + "contentHash": "MpYE6A13G9zLZjkDmy2Fm/R0MRkjBR75P0F8B1yLaUshaATixPlk2S2OE6u/rlqtqMkbEyM7F6wxc332gZpBpA==" }, "Microsoft.Testing.Platform.MSBuild": { "type": "Transitive", @@ -122,25 +122,25 @@ }, "TUnit.Assertions": { "type": "Transitive", - "resolved": "0.53.0", - "contentHash": "8Hi7PqB77SAwZbvcv+TyRk7hmIART1maTGW8/N0ZT47aVzCYEiUDrcru4Hgj7xxrR8ueVT/KuG/FzOwHO1wvkQ==" + "resolved": "0.57.65", + "contentHash": "2wIWM/DgR0sSkQrnrnEoewWOPhObIpHv7z714+Vw9B+rRwNyNWOEcIcH6W35dGhv9AW+BHNaxoPE3/bC+GfEKQ==" }, "TUnit.Core": { "type": "Transitive", - "resolved": "0.53.0", - "contentHash": "NpNQg38dK2JMt+dixIfTdvqS/yKtZaHqEegoW5OSmilo6+Z0ta4bLtlT9gH11niQNefKCN9HjUGXUlJeu+d7xw==" + "resolved": "0.57.65", + "contentHash": "hDuW+M94NiQBJUyvS9OjUy5q9cGs5AlVyel6Du2n01k9OsD3jt79OUi88m37MpCF1VQaMX50ny8n6N55r8KCJg==" }, "TUnit.Engine": { "type": "Transitive", - "resolved": "0.53.0", - "contentHash": "U/RMNhLdI89TdEJ+GEJK///kjVgLopqBJ/vw5DCB0DZGEX5mIXV6ZwlpiZhlR8nj9SzvHSaTCquJmqWWcQ2qEQ==", + "resolved": "0.57.65", + "contentHash": "aOBJWQmGOK8cOpKw3EGRtdekhYks6f4Js4ZPWyRiht1IrT/JenvJBfZdsR2w8Sib+iPMOnH+q6GDOWa8Sctq+w==", "dependencies": { - "EnumerableAsyncProcessor": "3.0.2", - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.1", - "Microsoft.Testing.Platform": "1.8.1", + "EnumerableAsyncProcessor": "3.8.4", + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.4", + "Microsoft.Testing.Platform": "1.8.4", "Microsoft.Testing.Platform.MSBuild": "1.4.3", "System.Threading.Channels": "9.0.0", - "TUnit.Core": "0.53.0" + "TUnit.Core": "0.57.65" } }, "fluentassertions": { From cc56c9230359e37c3802b7981c9383f28b1bb63c Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Sep 2025 17:15:32 +0200 Subject: [PATCH 689/845] xunit.v3 3.0.0 -> 3.0.1 --- .../XUnit3.Specs/XUnit3.Specs.csproj | 2 +- .../XUnit3.Specs/packages.lock.json | 251 ++++++++++++------ .../XUnit3Core.Specs/XUnit3Core.Specs.csproj | 2 +- .../XUnit3Core.Specs/packages.lock.json | 215 +++++++++++---- 4 files changed, 334 insertions(+), 136 deletions(-) diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj index 30e33cab53..5042515432 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -9,7 +9,7 @@ - + diff --git a/Tests/TestFrameworks/XUnit3.Specs/packages.lock.json b/Tests/TestFrameworks/XUnit3.Specs/packages.lock.json index d86030a286..5db020f58d 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/packages.lock.json +++ b/Tests/TestFrameworks/XUnit3.Specs/packages.lock.json @@ -28,13 +28,13 @@ }, "xunit.v3": { "type": "Direct", - "requested": "[3.0.0, )", - "resolved": "3.0.0", - "contentHash": "IzPThK1+JjkBJzMWrWtMZY7FtYagnpg3cBwR/8XJE5mK6JPwz5nz/auQ9Ln02DZCK3O3E1kHyMC1f490/6g6dQ==", + "requested": "[3.0.1, )", + "resolved": "3.0.1", + "contentHash": "8AZKk/iiZAzRhNNq8yB8gcNpA+exGMGi3oodWnn0eI7vCwuuuAxnF6ANQC+q7z6FJoOyjiJnnBhS5YMoPPILjg==", "dependencies": { - "xunit.analyzers": "1.23.0", - "xunit.v3.assert": "[3.0.0]", - "xunit.v3.core": "[3.0.0]" + "xunit.analyzers": "1.24.0", + "xunit.v3.assert": "[3.0.1]", + "xunit.v3.core": "[3.0.1]" } }, "Microsoft.Bcl.AsyncInterfaces": { @@ -52,23 +52,23 @@ }, "Microsoft.Testing.Extensions.TrxReport.Abstractions": { "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "dDEETHbX5JQBMIFgBPkX/FmCU4DRQSG+k58QUtz7zTdnEZDafPKH6YHSMoHY3blDiZV/vcSol35Ux3WC7wU+9Q==", + "resolved": "1.8.2", + "contentHash": "QPaJgSfN0APwB6OtJO9jOGETv62d94fsDwLKh+Yu6vAFIP8wfml2CFLzaOlBIkbYFb8kG0s0Bd/VPLQrhCL3lg==", "dependencies": { - "Microsoft.Testing.Platform": "1.7.3" + "Microsoft.Testing.Platform": "1.8.2" } }, "Microsoft.Testing.Platform": { "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "cI6u+CPxv3+07cbSwJVKOfxFrecbjfZnid1fe8EMhyPY4qmsSNnm+hN+GIy8u4JIlrADfrskDiwnScjRzVzJNw==" + "resolved": "1.8.2", + "contentHash": "KTr/LYPhgT3IEzElGEEHldNJec0QMTouDhtwDmW+PAPAEzSKJQHtPaNA3pf0IL7ISmoKtuxxHV2v1Cq9xmelzQ==" }, "Microsoft.Testing.Platform.MSBuild": { "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "tSIKXv7tLLYDjfodqLuTigsmOVcYj0CDC1rYeac5MTgHjbYV8IfmYh4FprBt/xE1zW8phkCYP766F9ayo560jA==", + "resolved": "1.8.2", + "contentHash": "xL7h/wZR6NpzZrFqUMwE6Sa9i7jEPmxPHl11EG9iG1Szh3IHvhJkbmlKG74pm9YLnEysjVYFuA+ExBHxqQp8fg==", "dependencies": { - "Microsoft.Testing.Platform": "1.7.3" + "Microsoft.Testing.Platform": "1.8.2" } }, "Microsoft.TestPlatform.ObjectModel": { @@ -79,6 +79,15 @@ "System.Reflection.Metadata": "1.6.0" } }, + "Microsoft.Win32.Registry": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, "System.Buffers": { "type": "Transitive", "resolved": "4.5.1", @@ -121,6 +130,19 @@ "resolved": "6.0.0", "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" }, + "System.Security.AccessControl": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "dependencies": { + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + }, "System.Threading.Tasks.Extensions": { "type": "Transitive", "resolved": "4.5.4", @@ -131,13 +153,13 @@ }, "xunit.analyzers": { "type": "Transitive", - "resolved": "1.23.0", - "contentHash": "WCkO1FPTWoESLhghoXA881CulRYpve0UrXLsL5aYcLQd9SlD+oADb16NAP+SE5o3w0FM2MzGTklBwY8yUfj0ng==" + "resolved": "1.24.0", + "contentHash": "kxaoMFFZcQ+mJudaKKlt3gCqV6M6Gjbka0NEs8JFDrxn52O7w5OOnYfSYVfqusk8p7pxrGdjgaQHlGINsNZHAQ==" }, "xunit.v3.assert": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "tlEmAE8uQ9fOhbNyg7sLJiYhekeD4LFRDJRZrv3mdnvJv7kfb2Z1OmJcsMHF+/N/QE/vTtwqRItiPJZGpOw/EQ==", + "resolved": "3.0.1", + "contentHash": "3h6AbEcfEsFn9RLjlG5yCTqEjgDHwMXRkNEhpGjAWMM68uHKWeItPbqzWj8P260gDT9NxPFfZRf3huYNnOlLRA==", "dependencies": { "System.Collections.Immutable": "6.0.0", "System.Memory": "4.5.5" @@ -145,47 +167,48 @@ }, "xunit.v3.common": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "8bPJb2N2kYWSa9c9pkUtQmzWc2+0wKxWo9NIgUev6DX+TkXjdBUh6zY0LPVIdSGxsl3swjn4+gEpj5QjrzZiQw==", + "resolved": "3.0.1", + "contentHash": "tL/lcgOHhPw4eb7Vx2WM97JFxW1WM9E0XNTra8UFQWdO9xtR7IXhVIZ6V4uXz5aApZ1FvdrrklImh+xneyrXmw==", "dependencies": { "Microsoft.Bcl.AsyncInterfaces": "6.0.0" } }, "xunit.v3.core": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "c71CPzXXTbnmr3iz2dmo4OniOWNM+30DtWQxpepKVjLIFRYimP+ahn/pjPHSmDqL2xl2tewosLNFodyijcnBLQ==", + "resolved": "3.0.1", + "contentHash": "Gm6+sQi0LDIqEaWeB2ML0Hy9maYyr3JmptEylXcWpDn3MaUAcxkshZa1Jq60YrqHGG1gVoyCBHYJRd2pEjRs2A==", "dependencies": { - "Microsoft.Testing.Platform.MSBuild": "1.7.3", - "xunit.v3.extensibility.core": "[3.0.0]", - "xunit.v3.runner.inproc.console": "[3.0.0]" + "Microsoft.Testing.Platform.MSBuild": "1.8.2", + "xunit.v3.extensibility.core": "[3.0.1]", + "xunit.v3.runner.inproc.console": "[3.0.1]" } }, "xunit.v3.extensibility.core": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "bzYmxPXtuLDwueg5gqB4/JlCShqHO/weZVgsOxgvMSw4ulyKFqv78JpUE1+aluJWitrfeaL6P8mfPV6zLQS49w==", + "resolved": "3.0.1", + "contentHash": "rud2rEHLGkPGeKc+O9OiUVWhLh8enjHYrlMlSgPfGQmUaLzGDoT7IjJcbyyDFJm8jEbWC2iOe6evqyw0ZfZWcA==", "dependencies": { - "xunit.v3.common": "[3.0.0]" + "xunit.v3.common": "[3.0.1]" } }, "xunit.v3.runner.common": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "GIk0y3T/siVtU2rwbPPC/PFANHlAbknwWmxNOPqyz+NviFTKY3sILeHeotQff4MT+Rk0tjPGNAwCtzp9fRPLpQ==", + "resolved": "3.0.1", + "contentHash": "r3jg64kY+8rGwG4IBq1+ELDlXvolcgvf707+Un8AeC6tmVsymOt6H00Kiptf3iPqjsnE3WsFJROI5XowdrbmAQ==", "dependencies": { - "xunit.v3.common": "[3.0.0]" + "Microsoft.Win32.Registry": "[5.0.0]", + "xunit.v3.common": "[3.0.1]" } }, "xunit.v3.runner.inproc.console": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "V0ZxjXFRVDoscU4SfVFvHVzqhGbevBitl7Yn3Vn6s+NqFmwP4tY6/o3ZU9skAQ1bgtfNUEYfrwYTzzoeQFbNQw==", + "resolved": "3.0.1", + "contentHash": "eV9DTPLuMmzQwMTPAkSHijBQUVLu6IoA1+/PkmtMFbU+EqA0EDriZ266EhlRBk7v+ymP8hliSQW/bGXJQEOBFw==", "dependencies": { - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.7.3", - "Microsoft.Testing.Platform": "1.7.3", - "xunit.v3.extensibility.core": "[3.0.0]", - "xunit.v3.runner.common": "[3.0.0]" + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.2", + "Microsoft.Testing.Platform": "1.8.2", + "xunit.v3.extensibility.core": "[3.0.1]", + "xunit.v3.runner.common": "[3.0.1]" } }, "fluentassertions": { @@ -195,7 +218,30 @@ } } }, - ".NETFramework,Version=v4.7.2/win-x86": {}, + ".NETFramework,Version=v4.7.2/win-x86": { + "Microsoft.Win32.Registry": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.AccessControl": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "dependencies": { + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + } + }, "net8.0": { "coverlet.collector": { "type": "Direct", @@ -221,13 +267,13 @@ }, "xunit.v3": { "type": "Direct", - "requested": "[3.0.0, )", - "resolved": "3.0.0", - "contentHash": "IzPThK1+JjkBJzMWrWtMZY7FtYagnpg3cBwR/8XJE5mK6JPwz5nz/auQ9Ln02DZCK3O3E1kHyMC1f490/6g6dQ==", + "requested": "[3.0.1, )", + "resolved": "3.0.1", + "contentHash": "8AZKk/iiZAzRhNNq8yB8gcNpA+exGMGi3oodWnn0eI7vCwuuuAxnF6ANQC+q7z6FJoOyjiJnnBhS5YMoPPILjg==", "dependencies": { - "xunit.analyzers": "1.23.0", - "xunit.v3.assert": "[3.0.0]", - "xunit.v3.core": "[3.0.0]" + "xunit.analyzers": "1.24.0", + "xunit.v3.assert": "[3.0.1]", + "xunit.v3.core": "[3.0.1]" } }, "Microsoft.Bcl.AsyncInterfaces": { @@ -240,25 +286,30 @@ "resolved": "17.13.0", "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==" + }, "Microsoft.Testing.Extensions.TrxReport.Abstractions": { "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "dDEETHbX5JQBMIFgBPkX/FmCU4DRQSG+k58QUtz7zTdnEZDafPKH6YHSMoHY3blDiZV/vcSol35Ux3WC7wU+9Q==", + "resolved": "1.8.2", + "contentHash": "QPaJgSfN0APwB6OtJO9jOGETv62d94fsDwLKh+Yu6vAFIP8wfml2CFLzaOlBIkbYFb8kG0s0Bd/VPLQrhCL3lg==", "dependencies": { - "Microsoft.Testing.Platform": "1.7.3" + "Microsoft.Testing.Platform": "1.8.2" } }, "Microsoft.Testing.Platform": { "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "cI6u+CPxv3+07cbSwJVKOfxFrecbjfZnid1fe8EMhyPY4qmsSNnm+hN+GIy8u4JIlrADfrskDiwnScjRzVzJNw==" + "resolved": "1.8.2", + "contentHash": "KTr/LYPhgT3IEzElGEEHldNJec0QMTouDhtwDmW+PAPAEzSKJQHtPaNA3pf0IL7ISmoKtuxxHV2v1Cq9xmelzQ==" }, "Microsoft.Testing.Platform.MSBuild": { "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "tSIKXv7tLLYDjfodqLuTigsmOVcYj0CDC1rYeac5MTgHjbYV8IfmYh4FprBt/xE1zW8phkCYP766F9ayo560jA==", + "resolved": "1.8.2", + "contentHash": "xL7h/wZR6NpzZrFqUMwE6Sa9i7jEPmxPHl11EG9iG1Szh3IHvhJkbmlKG74pm9YLnEysjVYFuA+ExBHxqQp8fg==", "dependencies": { - "Microsoft.Testing.Platform": "1.7.3" + "Microsoft.Testing.Platform": "1.8.2" } }, "Microsoft.TestPlatform.ObjectModel": { @@ -278,6 +329,15 @@ "Newtonsoft.Json": "13.0.1" } }, + "Microsoft.Win32.Registry": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, "Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.1", @@ -288,65 +348,104 @@ "resolved": "1.6.0", "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" }, + "System.Security.AccessControl": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + }, "xunit.analyzers": { "type": "Transitive", - "resolved": "1.23.0", - "contentHash": "WCkO1FPTWoESLhghoXA881CulRYpve0UrXLsL5aYcLQd9SlD+oADb16NAP+SE5o3w0FM2MzGTklBwY8yUfj0ng==" + "resolved": "1.24.0", + "contentHash": "kxaoMFFZcQ+mJudaKKlt3gCqV6M6Gjbka0NEs8JFDrxn52O7w5OOnYfSYVfqusk8p7pxrGdjgaQHlGINsNZHAQ==" }, "xunit.v3.assert": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "tlEmAE8uQ9fOhbNyg7sLJiYhekeD4LFRDJRZrv3mdnvJv7kfb2Z1OmJcsMHF+/N/QE/vTtwqRItiPJZGpOw/EQ==" + "resolved": "3.0.1", + "contentHash": "3h6AbEcfEsFn9RLjlG5yCTqEjgDHwMXRkNEhpGjAWMM68uHKWeItPbqzWj8P260gDT9NxPFfZRf3huYNnOlLRA==" }, "xunit.v3.common": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "8bPJb2N2kYWSa9c9pkUtQmzWc2+0wKxWo9NIgUev6DX+TkXjdBUh6zY0LPVIdSGxsl3swjn4+gEpj5QjrzZiQw==", + "resolved": "3.0.1", + "contentHash": "tL/lcgOHhPw4eb7Vx2WM97JFxW1WM9E0XNTra8UFQWdO9xtR7IXhVIZ6V4uXz5aApZ1FvdrrklImh+xneyrXmw==", "dependencies": { "Microsoft.Bcl.AsyncInterfaces": "6.0.0" } }, "xunit.v3.core": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "c71CPzXXTbnmr3iz2dmo4OniOWNM+30DtWQxpepKVjLIFRYimP+ahn/pjPHSmDqL2xl2tewosLNFodyijcnBLQ==", + "resolved": "3.0.1", + "contentHash": "Gm6+sQi0LDIqEaWeB2ML0Hy9maYyr3JmptEylXcWpDn3MaUAcxkshZa1Jq60YrqHGG1gVoyCBHYJRd2pEjRs2A==", "dependencies": { - "Microsoft.Testing.Platform.MSBuild": "1.7.3", - "xunit.v3.extensibility.core": "[3.0.0]", - "xunit.v3.runner.inproc.console": "[3.0.0]" + "Microsoft.Testing.Platform.MSBuild": "1.8.2", + "xunit.v3.extensibility.core": "[3.0.1]", + "xunit.v3.runner.inproc.console": "[3.0.1]" } }, "xunit.v3.extensibility.core": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "bzYmxPXtuLDwueg5gqB4/JlCShqHO/weZVgsOxgvMSw4ulyKFqv78JpUE1+aluJWitrfeaL6P8mfPV6zLQS49w==", + "resolved": "3.0.1", + "contentHash": "rud2rEHLGkPGeKc+O9OiUVWhLh8enjHYrlMlSgPfGQmUaLzGDoT7IjJcbyyDFJm8jEbWC2iOe6evqyw0ZfZWcA==", "dependencies": { - "xunit.v3.common": "[3.0.0]" + "xunit.v3.common": "[3.0.1]" } }, "xunit.v3.runner.common": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "GIk0y3T/siVtU2rwbPPC/PFANHlAbknwWmxNOPqyz+NviFTKY3sILeHeotQff4MT+Rk0tjPGNAwCtzp9fRPLpQ==", + "resolved": "3.0.1", + "contentHash": "r3jg64kY+8rGwG4IBq1+ELDlXvolcgvf707+Un8AeC6tmVsymOt6H00Kiptf3iPqjsnE3WsFJROI5XowdrbmAQ==", "dependencies": { - "xunit.v3.common": "[3.0.0]" + "Microsoft.Win32.Registry": "[5.0.0]", + "xunit.v3.common": "[3.0.1]" } }, "xunit.v3.runner.inproc.console": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "V0ZxjXFRVDoscU4SfVFvHVzqhGbevBitl7Yn3Vn6s+NqFmwP4tY6/o3ZU9skAQ1bgtfNUEYfrwYTzzoeQFbNQw==", + "resolved": "3.0.1", + "contentHash": "eV9DTPLuMmzQwMTPAkSHijBQUVLu6IoA1+/PkmtMFbU+EqA0EDriZ266EhlRBk7v+ymP8hliSQW/bGXJQEOBFw==", "dependencies": { - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.7.3", - "Microsoft.Testing.Platform": "1.7.3", - "xunit.v3.extensibility.core": "[3.0.0]", - "xunit.v3.runner.common": "[3.0.0]" + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.2", + "Microsoft.Testing.Platform": "1.8.2", + "xunit.v3.extensibility.core": "[3.0.1]", + "xunit.v3.runner.common": "[3.0.1]" } }, "fluentassertions": { "type": "Project" } }, - "net8.0/win-x86": {} + "net8.0/win-x86": { + "Microsoft.Win32.Registry": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.AccessControl": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + } + } } } \ No newline at end of file diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index 9381d9f200..4069c92ed4 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -9,7 +9,7 @@ - + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/packages.lock.json b/Tests/TestFrameworks/XUnit3Core.Specs/packages.lock.json index c3ba3749af..3d6c131b26 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/packages.lock.json +++ b/Tests/TestFrameworks/XUnit3Core.Specs/packages.lock.json @@ -28,13 +28,13 @@ }, "xunit.v3.core": { "type": "Direct", - "requested": "[3.0.0, )", - "resolved": "3.0.0", - "contentHash": "c71CPzXXTbnmr3iz2dmo4OniOWNM+30DtWQxpepKVjLIFRYimP+ahn/pjPHSmDqL2xl2tewosLNFodyijcnBLQ==", + "requested": "[3.0.1, )", + "resolved": "3.0.1", + "contentHash": "Gm6+sQi0LDIqEaWeB2ML0Hy9maYyr3JmptEylXcWpDn3MaUAcxkshZa1Jq60YrqHGG1gVoyCBHYJRd2pEjRs2A==", "dependencies": { - "Microsoft.Testing.Platform.MSBuild": "1.7.3", - "xunit.v3.extensibility.core": "[3.0.0]", - "xunit.v3.runner.inproc.console": "[3.0.0]" + "Microsoft.Testing.Platform.MSBuild": "1.8.2", + "xunit.v3.extensibility.core": "[3.0.1]", + "xunit.v3.runner.inproc.console": "[3.0.1]" } }, "Microsoft.Bcl.AsyncInterfaces": { @@ -52,23 +52,23 @@ }, "Microsoft.Testing.Extensions.TrxReport.Abstractions": { "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "dDEETHbX5JQBMIFgBPkX/FmCU4DRQSG+k58QUtz7zTdnEZDafPKH6YHSMoHY3blDiZV/vcSol35Ux3WC7wU+9Q==", + "resolved": "1.8.2", + "contentHash": "QPaJgSfN0APwB6OtJO9jOGETv62d94fsDwLKh+Yu6vAFIP8wfml2CFLzaOlBIkbYFb8kG0s0Bd/VPLQrhCL3lg==", "dependencies": { - "Microsoft.Testing.Platform": "1.7.3" + "Microsoft.Testing.Platform": "1.8.2" } }, "Microsoft.Testing.Platform": { "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "cI6u+CPxv3+07cbSwJVKOfxFrecbjfZnid1fe8EMhyPY4qmsSNnm+hN+GIy8u4JIlrADfrskDiwnScjRzVzJNw==" + "resolved": "1.8.2", + "contentHash": "KTr/LYPhgT3IEzElGEEHldNJec0QMTouDhtwDmW+PAPAEzSKJQHtPaNA3pf0IL7ISmoKtuxxHV2v1Cq9xmelzQ==" }, "Microsoft.Testing.Platform.MSBuild": { "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "tSIKXv7tLLYDjfodqLuTigsmOVcYj0CDC1rYeac5MTgHjbYV8IfmYh4FprBt/xE1zW8phkCYP766F9ayo560jA==", + "resolved": "1.8.2", + "contentHash": "xL7h/wZR6NpzZrFqUMwE6Sa9i7jEPmxPHl11EG9iG1Szh3IHvhJkbmlKG74pm9YLnEysjVYFuA+ExBHxqQp8fg==", "dependencies": { - "Microsoft.Testing.Platform": "1.7.3" + "Microsoft.Testing.Platform": "1.8.2" } }, "Microsoft.TestPlatform.ObjectModel": { @@ -79,6 +79,15 @@ "System.Reflection.Metadata": "1.6.0" } }, + "Microsoft.Win32.Registry": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, "System.Collections.Immutable": { "type": "Transitive", "resolved": "1.5.0", @@ -97,6 +106,19 @@ "resolved": "4.5.3", "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, + "System.Security.AccessControl": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "dependencies": { + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + }, "System.Threading.Tasks.Extensions": { "type": "Transitive", "resolved": "4.5.4", @@ -107,37 +129,38 @@ }, "xunit.v3.common": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "8bPJb2N2kYWSa9c9pkUtQmzWc2+0wKxWo9NIgUev6DX+TkXjdBUh6zY0LPVIdSGxsl3swjn4+gEpj5QjrzZiQw==", + "resolved": "3.0.1", + "contentHash": "tL/lcgOHhPw4eb7Vx2WM97JFxW1WM9E0XNTra8UFQWdO9xtR7IXhVIZ6V4uXz5aApZ1FvdrrklImh+xneyrXmw==", "dependencies": { "Microsoft.Bcl.AsyncInterfaces": "6.0.0" } }, "xunit.v3.extensibility.core": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "bzYmxPXtuLDwueg5gqB4/JlCShqHO/weZVgsOxgvMSw4ulyKFqv78JpUE1+aluJWitrfeaL6P8mfPV6zLQS49w==", + "resolved": "3.0.1", + "contentHash": "rud2rEHLGkPGeKc+O9OiUVWhLh8enjHYrlMlSgPfGQmUaLzGDoT7IjJcbyyDFJm8jEbWC2iOe6evqyw0ZfZWcA==", "dependencies": { - "xunit.v3.common": "[3.0.0]" + "xunit.v3.common": "[3.0.1]" } }, "xunit.v3.runner.common": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "GIk0y3T/siVtU2rwbPPC/PFANHlAbknwWmxNOPqyz+NviFTKY3sILeHeotQff4MT+Rk0tjPGNAwCtzp9fRPLpQ==", + "resolved": "3.0.1", + "contentHash": "r3jg64kY+8rGwG4IBq1+ELDlXvolcgvf707+Un8AeC6tmVsymOt6H00Kiptf3iPqjsnE3WsFJROI5XowdrbmAQ==", "dependencies": { - "xunit.v3.common": "[3.0.0]" + "Microsoft.Win32.Registry": "[5.0.0]", + "xunit.v3.common": "[3.0.1]" } }, "xunit.v3.runner.inproc.console": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "V0ZxjXFRVDoscU4SfVFvHVzqhGbevBitl7Yn3Vn6s+NqFmwP4tY6/o3ZU9skAQ1bgtfNUEYfrwYTzzoeQFbNQw==", + "resolved": "3.0.1", + "contentHash": "eV9DTPLuMmzQwMTPAkSHijBQUVLu6IoA1+/PkmtMFbU+EqA0EDriZ266EhlRBk7v+ymP8hliSQW/bGXJQEOBFw==", "dependencies": { - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.7.3", - "Microsoft.Testing.Platform": "1.7.3", - "xunit.v3.extensibility.core": "[3.0.0]", - "xunit.v3.runner.common": "[3.0.0]" + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.2", + "Microsoft.Testing.Platform": "1.8.2", + "xunit.v3.extensibility.core": "[3.0.1]", + "xunit.v3.runner.common": "[3.0.1]" } }, "fluentassertions": { @@ -147,7 +170,30 @@ } } }, - ".NETFramework,Version=v4.7.2/win-x86": {}, + ".NETFramework,Version=v4.7.2/win-x86": { + "Microsoft.Win32.Registry": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.AccessControl": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "dependencies": { + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + } + }, "net8.0": { "coverlet.collector": { "type": "Direct", @@ -173,13 +219,13 @@ }, "xunit.v3.core": { "type": "Direct", - "requested": "[3.0.0, )", - "resolved": "3.0.0", - "contentHash": "c71CPzXXTbnmr3iz2dmo4OniOWNM+30DtWQxpepKVjLIFRYimP+ahn/pjPHSmDqL2xl2tewosLNFodyijcnBLQ==", + "requested": "[3.0.1, )", + "resolved": "3.0.1", + "contentHash": "Gm6+sQi0LDIqEaWeB2ML0Hy9maYyr3JmptEylXcWpDn3MaUAcxkshZa1Jq60YrqHGG1gVoyCBHYJRd2pEjRs2A==", "dependencies": { - "Microsoft.Testing.Platform.MSBuild": "1.7.3", - "xunit.v3.extensibility.core": "[3.0.0]", - "xunit.v3.runner.inproc.console": "[3.0.0]" + "Microsoft.Testing.Platform.MSBuild": "1.8.2", + "xunit.v3.extensibility.core": "[3.0.1]", + "xunit.v3.runner.inproc.console": "[3.0.1]" } }, "Microsoft.Bcl.AsyncInterfaces": { @@ -192,25 +238,30 @@ "resolved": "17.13.0", "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==" + }, "Microsoft.Testing.Extensions.TrxReport.Abstractions": { "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "dDEETHbX5JQBMIFgBPkX/FmCU4DRQSG+k58QUtz7zTdnEZDafPKH6YHSMoHY3blDiZV/vcSol35Ux3WC7wU+9Q==", + "resolved": "1.8.2", + "contentHash": "QPaJgSfN0APwB6OtJO9jOGETv62d94fsDwLKh+Yu6vAFIP8wfml2CFLzaOlBIkbYFb8kG0s0Bd/VPLQrhCL3lg==", "dependencies": { - "Microsoft.Testing.Platform": "1.7.3" + "Microsoft.Testing.Platform": "1.8.2" } }, "Microsoft.Testing.Platform": { "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "cI6u+CPxv3+07cbSwJVKOfxFrecbjfZnid1fe8EMhyPY4qmsSNnm+hN+GIy8u4JIlrADfrskDiwnScjRzVzJNw==" + "resolved": "1.8.2", + "contentHash": "KTr/LYPhgT3IEzElGEEHldNJec0QMTouDhtwDmW+PAPAEzSKJQHtPaNA3pf0IL7ISmoKtuxxHV2v1Cq9xmelzQ==" }, "Microsoft.Testing.Platform.MSBuild": { "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "tSIKXv7tLLYDjfodqLuTigsmOVcYj0CDC1rYeac5MTgHjbYV8IfmYh4FprBt/xE1zW8phkCYP766F9ayo560jA==", + "resolved": "1.8.2", + "contentHash": "xL7h/wZR6NpzZrFqUMwE6Sa9i7jEPmxPHl11EG9iG1Szh3IHvhJkbmlKG74pm9YLnEysjVYFuA+ExBHxqQp8fg==", "dependencies": { - "Microsoft.Testing.Platform": "1.7.3" + "Microsoft.Testing.Platform": "1.8.2" } }, "Microsoft.TestPlatform.ObjectModel": { @@ -230,6 +281,15 @@ "Newtonsoft.Json": "13.0.1" } }, + "Microsoft.Win32.Registry": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, "Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.1", @@ -240,45 +300,84 @@ "resolved": "1.6.0", "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" }, + "System.Security.AccessControl": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + }, "xunit.v3.common": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "8bPJb2N2kYWSa9c9pkUtQmzWc2+0wKxWo9NIgUev6DX+TkXjdBUh6zY0LPVIdSGxsl3swjn4+gEpj5QjrzZiQw==", + "resolved": "3.0.1", + "contentHash": "tL/lcgOHhPw4eb7Vx2WM97JFxW1WM9E0XNTra8UFQWdO9xtR7IXhVIZ6V4uXz5aApZ1FvdrrklImh+xneyrXmw==", "dependencies": { "Microsoft.Bcl.AsyncInterfaces": "6.0.0" } }, "xunit.v3.extensibility.core": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "bzYmxPXtuLDwueg5gqB4/JlCShqHO/weZVgsOxgvMSw4ulyKFqv78JpUE1+aluJWitrfeaL6P8mfPV6zLQS49w==", + "resolved": "3.0.1", + "contentHash": "rud2rEHLGkPGeKc+O9OiUVWhLh8enjHYrlMlSgPfGQmUaLzGDoT7IjJcbyyDFJm8jEbWC2iOe6evqyw0ZfZWcA==", "dependencies": { - "xunit.v3.common": "[3.0.0]" + "xunit.v3.common": "[3.0.1]" } }, "xunit.v3.runner.common": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "GIk0y3T/siVtU2rwbPPC/PFANHlAbknwWmxNOPqyz+NviFTKY3sILeHeotQff4MT+Rk0tjPGNAwCtzp9fRPLpQ==", + "resolved": "3.0.1", + "contentHash": "r3jg64kY+8rGwG4IBq1+ELDlXvolcgvf707+Un8AeC6tmVsymOt6H00Kiptf3iPqjsnE3WsFJROI5XowdrbmAQ==", "dependencies": { - "xunit.v3.common": "[3.0.0]" + "Microsoft.Win32.Registry": "[5.0.0]", + "xunit.v3.common": "[3.0.1]" } }, "xunit.v3.runner.inproc.console": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "V0ZxjXFRVDoscU4SfVFvHVzqhGbevBitl7Yn3Vn6s+NqFmwP4tY6/o3ZU9skAQ1bgtfNUEYfrwYTzzoeQFbNQw==", + "resolved": "3.0.1", + "contentHash": "eV9DTPLuMmzQwMTPAkSHijBQUVLu6IoA1+/PkmtMFbU+EqA0EDriZ266EhlRBk7v+ymP8hliSQW/bGXJQEOBFw==", "dependencies": { - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.7.3", - "Microsoft.Testing.Platform": "1.7.3", - "xunit.v3.extensibility.core": "[3.0.0]", - "xunit.v3.runner.common": "[3.0.0]" + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.2", + "Microsoft.Testing.Platform": "1.8.2", + "xunit.v3.extensibility.core": "[3.0.1]", + "xunit.v3.runner.common": "[3.0.1]" } }, "fluentassertions": { "type": "Project" } }, - "net8.0/win-x86": {} + "net8.0/win-x86": { + "Microsoft.Win32.Registry": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.AccessControl": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + } + } } } \ No newline at end of file From 7e232b50902cb8fc3f0f61c0bc3a3a60e38f5e90 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Sep 2025 17:17:10 +0200 Subject: [PATCH 690/845] xunit.runner.visualstudio 3.1.3 -> 3.1.4 --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/Approval.Tests/packages.lock.json | 6 +++--- .../TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3.Specs/packages.lock.json | 12 ++++++------ .../XUnit3Core.Specs/XUnit3Core.Specs.csproj | 2 +- .../XUnit3Core.Specs/packages.lock.json | 12 ++++++------ 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index aeee8cead6..e8e9556946 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -7,7 +7,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/Approval.Tests/packages.lock.json b/Tests/Approval.Tests/packages.lock.json index f217dd0db6..49ca839cb4 100644 --- a/Tests/Approval.Tests/packages.lock.json +++ b/Tests/Approval.Tests/packages.lock.json @@ -59,9 +59,9 @@ }, "xunit.runner.visualstudio": { "type": "Direct", - "requested": "[3.1.3, )", - "resolved": "3.1.3", - "contentHash": "go7e81n/UI3LeNqoJIJ3thkS4JfJtiQnDbAxLh09JkJqoHthnfbLS5p68s4/Bm12B9umkoYSB5SaDr68hZNleg==" + "requested": "[3.1.4, )", + "resolved": "3.1.4", + "contentHash": "5mj99LvCqrq3CNi06xYdyIAXOEh+5b33F2nErCzI5zWiDdLHXiPXEWFSUAF8zlIv0ZWqjZNCwHTQeAPYbF3pCg==" }, "Argon": { "type": "Transitive", diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj index 5042515432..4459530fcf 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -10,6 +10,6 @@ - + diff --git a/Tests/TestFrameworks/XUnit3.Specs/packages.lock.json b/Tests/TestFrameworks/XUnit3.Specs/packages.lock.json index 5db020f58d..b92b00af8c 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/packages.lock.json +++ b/Tests/TestFrameworks/XUnit3.Specs/packages.lock.json @@ -19,9 +19,9 @@ }, "xunit.runner.visualstudio": { "type": "Direct", - "requested": "[3.1.3, )", - "resolved": "3.1.3", - "contentHash": "go7e81n/UI3LeNqoJIJ3thkS4JfJtiQnDbAxLh09JkJqoHthnfbLS5p68s4/Bm12B9umkoYSB5SaDr68hZNleg==", + "requested": "[3.1.4, )", + "resolved": "3.1.4", + "contentHash": "5mj99LvCqrq3CNi06xYdyIAXOEh+5b33F2nErCzI5zWiDdLHXiPXEWFSUAF8zlIv0ZWqjZNCwHTQeAPYbF3pCg==", "dependencies": { "Microsoft.TestPlatform.ObjectModel": "17.13.0" } @@ -261,9 +261,9 @@ }, "xunit.runner.visualstudio": { "type": "Direct", - "requested": "[3.1.3, )", - "resolved": "3.1.3", - "contentHash": "go7e81n/UI3LeNqoJIJ3thkS4JfJtiQnDbAxLh09JkJqoHthnfbLS5p68s4/Bm12B9umkoYSB5SaDr68hZNleg==" + "requested": "[3.1.4, )", + "resolved": "3.1.4", + "contentHash": "5mj99LvCqrq3CNi06xYdyIAXOEh+5b33F2nErCzI5zWiDdLHXiPXEWFSUAF8zlIv0ZWqjZNCwHTQeAPYbF3pCg==" }, "xunit.v3": { "type": "Direct", diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index 4069c92ed4..1458da7a3a 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -10,6 +10,6 @@ - + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/packages.lock.json b/Tests/TestFrameworks/XUnit3Core.Specs/packages.lock.json index 3d6c131b26..a19cb2dec4 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/packages.lock.json +++ b/Tests/TestFrameworks/XUnit3Core.Specs/packages.lock.json @@ -19,9 +19,9 @@ }, "xunit.runner.visualstudio": { "type": "Direct", - "requested": "[3.1.3, )", - "resolved": "3.1.3", - "contentHash": "go7e81n/UI3LeNqoJIJ3thkS4JfJtiQnDbAxLh09JkJqoHthnfbLS5p68s4/Bm12B9umkoYSB5SaDr68hZNleg==", + "requested": "[3.1.4, )", + "resolved": "3.1.4", + "contentHash": "5mj99LvCqrq3CNi06xYdyIAXOEh+5b33F2nErCzI5zWiDdLHXiPXEWFSUAF8zlIv0ZWqjZNCwHTQeAPYbF3pCg==", "dependencies": { "Microsoft.TestPlatform.ObjectModel": "17.13.0" } @@ -213,9 +213,9 @@ }, "xunit.runner.visualstudio": { "type": "Direct", - "requested": "[3.1.3, )", - "resolved": "3.1.3", - "contentHash": "go7e81n/UI3LeNqoJIJ3thkS4JfJtiQnDbAxLh09JkJqoHthnfbLS5p68s4/Bm12B9umkoYSB5SaDr68hZNleg==" + "requested": "[3.1.4, )", + "resolved": "3.1.4", + "contentHash": "5mj99LvCqrq3CNi06xYdyIAXOEh+5b33F2nErCzI5zWiDdLHXiPXEWFSUAF8zlIv0ZWqjZNCwHTQeAPYbF3pCg==" }, "xunit.v3.core": { "type": "Direct", From d3ad1086fb57c756bc2c81b7ac46f77755b142ce Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Sep 2025 17:19:47 +0200 Subject: [PATCH 691/845] Microsoft.Testing.Extensions.TrxReport 1.8.1 -> 1.8.4 --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- Tests/TestFrameworks/TUnit.Specs/packages.lock.json | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 1e848686f6..8ca10b1e23 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -12,7 +12,7 @@ - + diff --git a/Tests/TestFrameworks/TUnit.Specs/packages.lock.json b/Tests/TestFrameworks/TUnit.Specs/packages.lock.json index 9ee7b25638..a0b43aaba5 100644 --- a/Tests/TestFrameworks/TUnit.Specs/packages.lock.json +++ b/Tests/TestFrameworks/TUnit.Specs/packages.lock.json @@ -16,12 +16,12 @@ }, "Microsoft.Testing.Extensions.TrxReport": { "type": "Direct", - "requested": "[1.8.1, )", - "resolved": "1.8.1", - "contentHash": "SMR4fCIHtCG7PbIVNZC4R33TpgyvCx3YBKzEhQKedwq9bw4QE9eMok+a7ectvPA3Ga4qvcTeP1pkoeq4GjGTrQ==", + "requested": "[1.8.4, )", + "resolved": "1.8.4", + "contentHash": "nJvqkyczCMhYWDJAOEkfqaOXUj9w8aDAF5D5el31hqjtJqPFPeBm7ZU1yKoDKC4/hVQ0WXUTs5Y6YfJwgdlf0A==", "dependencies": { - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.1", - "Microsoft.Testing.Platform": "1.8.1" + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.4", + "Microsoft.Testing.Platform": "1.8.4" } }, "TUnit": { From 7aeaa0608019ad24b3b79527bb478f60e206fc21 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Sep 2025 17:22:53 +0200 Subject: [PATCH 692/845] NUnit 4.3.2 -> 4.4.0 --- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit4.Specs/packages.lock.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index fe9dc463b6..5796d7bb85 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json b/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json index 3dc4536a07..bf8890c080 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json +++ b/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json @@ -38,9 +38,9 @@ }, "NUnit": { "type": "Direct", - "requested": "[4.3.2, )", - "resolved": "4.3.2", - "contentHash": "puVXayXNmEu7MFQSUswGmUjOy3M3baprMbkLl5PAutpeDoGTr+jPv33qAYsqxywi2wJCq8l/O3EhHoLulPE1iQ==" + "requested": "[4.4.0, )", + "resolved": "4.4.0", + "contentHash": "7IWJcT9xWNhG9dEGdgAWdH6maCE0eVbeVnizvXACKbAyxbjoJ9+WaEb8qsCTJi3hsb18AJBtoqvWa3G7YYUQfw==" }, "NUnit3TestAdapter": { "type": "Direct", From 8a6907875fe73a35e91777a0df25dd603adece96 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Sep 2025 17:23:29 +0200 Subject: [PATCH 693/845] NUnit3TestAdapter 5.0.0 -> 5.1.0 --- .../NUnit3.Specs/NUnit3.Specs.csproj | 2 +- .../NUnit3.Specs/packages.lock.json | 57 ++++++++++--------- .../NUnit4.Specs/NUnit4.Specs.csproj | 2 +- .../NUnit4.Specs/packages.lock.json | 57 ++++++++++--------- 4 files changed, 64 insertions(+), 54 deletions(-) diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index abae2907ef..37882581c8 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -13,7 +13,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/NUnit3.Specs/packages.lock.json b/Tests/TestFrameworks/NUnit3.Specs/packages.lock.json index d328997250..bfb16122ca 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/packages.lock.json +++ b/Tests/TestFrameworks/NUnit3.Specs/packages.lock.json @@ -47,12 +47,12 @@ }, "NUnit3TestAdapter": { "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "sy4cLoUAdE6TDM4wNX5gmNCyhMev5wUz4cA6ZRf/aON9vf9t4xTVGLj/4huhDKcS4dFfmVVcgcP70yC7WC9kKg==", + "requested": "[5.1.0, )", + "resolved": "5.1.0", + "contentHash": "Q5jgS+WMzXPLKPBvVjXU0R8R75nCPNZPbDAzNxrFnHU9y9K6q+9xXJzgj0HAMr2+ib+2/R1gCYeN1F27rcrgFw==", "dependencies": { - "Microsoft.Testing.Extensions.VSTestBridge": "1.5.3", - "Microsoft.Testing.Platform.MSBuild": "1.5.3" + "Microsoft.Testing.Extensions.VSTestBridge": "1.7.3", + "Microsoft.Testing.Platform.MSBuild": "1.7.3" } }, "Roslynator.Analyzers": { @@ -72,8 +72,8 @@ }, "Microsoft.ApplicationInsights": { "type": "Transitive", - "resolved": "2.22.0", - "contentHash": "3AOM9bZtku7RQwHyMEY3tQMrHIgjcfRDa6YQpd/QG2LDGvMydSlL9Di+8LLMt7J2RDdfJ7/2jdYv6yHcMJAnNw==", + "resolved": "2.23.0", + "contentHash": "nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==", "dependencies": { "System.Diagnostics.DiagnosticSource": "5.0.0" } @@ -90,46 +90,51 @@ }, "Microsoft.Testing.Extensions.Telemetry": { "type": "Transitive", - "resolved": "1.5.3", - "contentHash": "U9pGd5DQuX1PfkrdFI+xH34JGgQ2nes5QAwIITTk+MQfLvRITqsZjJeHTjpGWh33D/0q1l7aA8/LQHR7UuCgLQ==", + "resolved": "1.7.3", + "contentHash": "udSTexALlmp01a6a4fNzzpcUyUZOUbVZRRdHotCcnM1pCl3G1wqRWJlD9B6vDaIw29tYBPv7iA+YbVvq61RonA==", "dependencies": { - "Microsoft.ApplicationInsights": "2.22.0", - "Microsoft.Testing.Platform": "1.5.3" + "Microsoft.ApplicationInsights": "2.23.0", + "Microsoft.Testing.Platform": "1.7.3" } }, "Microsoft.Testing.Extensions.TrxReport.Abstractions": { "type": "Transitive", - "resolved": "1.5.3", - "contentHash": "h34zKNpGyni66VH738mRHeXSnf3klSShUdavUWNhSfWICUUi5aXeI0LBvoX/ad93N0+9xBDU3Fyi6WfxrwKQGw==", + "resolved": "1.7.3", + "contentHash": "dDEETHbX5JQBMIFgBPkX/FmCU4DRQSG+k58QUtz7zTdnEZDafPKH6YHSMoHY3blDiZV/vcSol35Ux3WC7wU+9Q==", "dependencies": { - "Microsoft.Testing.Platform": "1.5.3" + "Microsoft.Testing.Platform": "1.7.3" } }, "Microsoft.Testing.Extensions.VSTestBridge": { "type": "Transitive", - "resolved": "1.5.3", - "contentHash": "cJD67YfDT98wEWyazKVD/yPVW6+H1usXeuselCnRes7JZBTIYWtrCchcOzOahnmajT79eDKqt9sta7DXwTDU4Q==", + "resolved": "1.7.3", + "contentHash": "iLD8UlqQis9eVmgKxuqEUBm1Tzmsqj6xluj8xe6/scM+PQ84eDX2oqi0rra2N0JLli5LxloTb0iWYN5y4+kn1A==", "dependencies": { - "Microsoft.ApplicationInsights": "2.22.0", - "Microsoft.TestPlatform.ObjectModel": "17.12.0", - "Microsoft.Testing.Extensions.Telemetry": "1.5.3", - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.5.3", - "Microsoft.Testing.Platform": "1.5.3" + "Microsoft.TestPlatform.AdapterUtilities": "17.13.0", + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Microsoft.Testing.Extensions.Telemetry": "1.7.3", + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.7.3", + "Microsoft.Testing.Platform": "1.7.3" } }, "Microsoft.Testing.Platform": { "type": "Transitive", - "resolved": "1.5.3", - "contentHash": "WqJydnJ99dEKtquR9HwINz104ehWJKTXbQQrydGatlLRw14bmsx0pa8+E6KUXMYXZAimN0swWlDmcJGjjW4TIg==" + "resolved": "1.7.3", + "contentHash": "cI6u+CPxv3+07cbSwJVKOfxFrecbjfZnid1fe8EMhyPY4qmsSNnm+hN+GIy8u4JIlrADfrskDiwnScjRzVzJNw==" }, "Microsoft.Testing.Platform.MSBuild": { "type": "Transitive", - "resolved": "1.5.3", - "contentHash": "bOtpRMSPeT5YLQo+NNY8EtdNTphAUcmALjW4ABU7P0rb6yR2XAZau3TzNieLmR3lRuwudguWzzBhgcLRXwZh0A==", + "resolved": "1.7.3", + "contentHash": "tSIKXv7tLLYDjfodqLuTigsmOVcYj0CDC1rYeac5MTgHjbYV8IfmYh4FprBt/xE1zW8phkCYP766F9ayo560jA==", "dependencies": { - "Microsoft.Testing.Platform": "1.5.3" + "Microsoft.Testing.Platform": "1.7.3" } }, + "Microsoft.TestPlatform.AdapterUtilities": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bFZ3uAhosdXjyXKURDQy37fPosCJQwedB5DG/SzsXL1QXsrfsIYty2kQMqCRRUqm8sBZBRHWRp4BT9SmpWXcKQ==" + }, "Microsoft.TestPlatform.ObjectModel": { "type": "Transitive", "resolved": "17.13.0", diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index 5796d7bb85..80dae3cc6e 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -13,7 +13,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json b/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json index bf8890c080..7aa205a32e 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json +++ b/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json @@ -44,12 +44,12 @@ }, "NUnit3TestAdapter": { "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "sy4cLoUAdE6TDM4wNX5gmNCyhMev5wUz4cA6ZRf/aON9vf9t4xTVGLj/4huhDKcS4dFfmVVcgcP70yC7WC9kKg==", + "requested": "[5.1.0, )", + "resolved": "5.1.0", + "contentHash": "Q5jgS+WMzXPLKPBvVjXU0R8R75nCPNZPbDAzNxrFnHU9y9K6q+9xXJzgj0HAMr2+ib+2/R1gCYeN1F27rcrgFw==", "dependencies": { - "Microsoft.Testing.Extensions.VSTestBridge": "1.5.3", - "Microsoft.Testing.Platform.MSBuild": "1.5.3" + "Microsoft.Testing.Extensions.VSTestBridge": "1.7.3", + "Microsoft.Testing.Platform.MSBuild": "1.7.3" } }, "Roslynator.Analyzers": { @@ -69,8 +69,8 @@ }, "Microsoft.ApplicationInsights": { "type": "Transitive", - "resolved": "2.22.0", - "contentHash": "3AOM9bZtku7RQwHyMEY3tQMrHIgjcfRDa6YQpd/QG2LDGvMydSlL9Di+8LLMt7J2RDdfJ7/2jdYv6yHcMJAnNw==", + "resolved": "2.23.0", + "contentHash": "nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==", "dependencies": { "System.Diagnostics.DiagnosticSource": "5.0.0" } @@ -82,46 +82,51 @@ }, "Microsoft.Testing.Extensions.Telemetry": { "type": "Transitive", - "resolved": "1.5.3", - "contentHash": "U9pGd5DQuX1PfkrdFI+xH34JGgQ2nes5QAwIITTk+MQfLvRITqsZjJeHTjpGWh33D/0q1l7aA8/LQHR7UuCgLQ==", + "resolved": "1.7.3", + "contentHash": "udSTexALlmp01a6a4fNzzpcUyUZOUbVZRRdHotCcnM1pCl3G1wqRWJlD9B6vDaIw29tYBPv7iA+YbVvq61RonA==", "dependencies": { - "Microsoft.ApplicationInsights": "2.22.0", - "Microsoft.Testing.Platform": "1.5.3" + "Microsoft.ApplicationInsights": "2.23.0", + "Microsoft.Testing.Platform": "1.7.3" } }, "Microsoft.Testing.Extensions.TrxReport.Abstractions": { "type": "Transitive", - "resolved": "1.5.3", - "contentHash": "h34zKNpGyni66VH738mRHeXSnf3klSShUdavUWNhSfWICUUi5aXeI0LBvoX/ad93N0+9xBDU3Fyi6WfxrwKQGw==", + "resolved": "1.7.3", + "contentHash": "dDEETHbX5JQBMIFgBPkX/FmCU4DRQSG+k58QUtz7zTdnEZDafPKH6YHSMoHY3blDiZV/vcSol35Ux3WC7wU+9Q==", "dependencies": { - "Microsoft.Testing.Platform": "1.5.3" + "Microsoft.Testing.Platform": "1.7.3" } }, "Microsoft.Testing.Extensions.VSTestBridge": { "type": "Transitive", - "resolved": "1.5.3", - "contentHash": "cJD67YfDT98wEWyazKVD/yPVW6+H1usXeuselCnRes7JZBTIYWtrCchcOzOahnmajT79eDKqt9sta7DXwTDU4Q==", + "resolved": "1.7.3", + "contentHash": "iLD8UlqQis9eVmgKxuqEUBm1Tzmsqj6xluj8xe6/scM+PQ84eDX2oqi0rra2N0JLli5LxloTb0iWYN5y4+kn1A==", "dependencies": { - "Microsoft.ApplicationInsights": "2.22.0", - "Microsoft.TestPlatform.ObjectModel": "17.12.0", - "Microsoft.Testing.Extensions.Telemetry": "1.5.3", - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.5.3", - "Microsoft.Testing.Platform": "1.5.3" + "Microsoft.TestPlatform.AdapterUtilities": "17.13.0", + "Microsoft.TestPlatform.ObjectModel": "17.13.0", + "Microsoft.Testing.Extensions.Telemetry": "1.7.3", + "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.7.3", + "Microsoft.Testing.Platform": "1.7.3" } }, "Microsoft.Testing.Platform": { "type": "Transitive", - "resolved": "1.5.3", - "contentHash": "WqJydnJ99dEKtquR9HwINz104ehWJKTXbQQrydGatlLRw14bmsx0pa8+E6KUXMYXZAimN0swWlDmcJGjjW4TIg==" + "resolved": "1.7.3", + "contentHash": "cI6u+CPxv3+07cbSwJVKOfxFrecbjfZnid1fe8EMhyPY4qmsSNnm+hN+GIy8u4JIlrADfrskDiwnScjRzVzJNw==" }, "Microsoft.Testing.Platform.MSBuild": { "type": "Transitive", - "resolved": "1.5.3", - "contentHash": "bOtpRMSPeT5YLQo+NNY8EtdNTphAUcmALjW4ABU7P0rb6yR2XAZau3TzNieLmR3lRuwudguWzzBhgcLRXwZh0A==", + "resolved": "1.7.3", + "contentHash": "tSIKXv7tLLYDjfodqLuTigsmOVcYj0CDC1rYeac5MTgHjbYV8IfmYh4FprBt/xE1zW8phkCYP766F9ayo560jA==", "dependencies": { - "Microsoft.Testing.Platform": "1.5.3" + "Microsoft.Testing.Platform": "1.7.3" } }, + "Microsoft.TestPlatform.AdapterUtilities": { + "type": "Transitive", + "resolved": "17.13.0", + "contentHash": "bFZ3uAhosdXjyXKURDQy37fPosCJQwedB5DG/SzsXL1QXsrfsIYty2kQMqCRRUqm8sBZBRHWRp4BT9SmpWXcKQ==" + }, "Microsoft.TestPlatform.ObjectModel": { "type": "Transitive", "resolved": "17.13.0", From 38068a042daa4b55c1704d70c5e79b1c14990b51 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Sep 2025 17:25:55 +0200 Subject: [PATCH 694/845] Meziantou.Analyzer 2.0.212 -> 2.0.219 --- Directory.Build.props | 2 +- Src/FluentAssertions/packages.lock.json | 6 +++--- Tests/FSharp.Specs/packages.lock.json | 6 +++--- Tests/FluentAssertions.Equivalency.Specs/packages.lock.json | 6 +++--- .../FluentAssertions.Extensibility.Specs/packages.lock.json | 6 +++--- Tests/FluentAssertions.Specs/packages.lock.json | 6 +++--- Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json | 6 +++--- Tests/TestFrameworks/MSpec.Specs/packages.lock.json | 6 +++--- Tests/TestFrameworks/NUnit3.Specs/packages.lock.json | 6 +++--- Tests/TestFrameworks/NUnit4.Specs/packages.lock.json | 6 +++--- Tests/TestFrameworks/XUnit2.Specs/packages.lock.json | 6 +++--- Tests/VB.Specs/packages.lock.json | 6 +++--- 12 files changed, 34 insertions(+), 34 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 69a60595ae..36579391e9 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -37,7 +37,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Src/FluentAssertions/packages.lock.json b/Src/FluentAssertions/packages.lock.json index 7bee92eba3..1ba041062d 100644 --- a/Src/FluentAssertions/packages.lock.json +++ b/Src/FluentAssertions/packages.lock.json @@ -118,9 +118,9 @@ }, "Meziantou.Analyzer": { "type": "Direct", - "requested": "[2.0.212, )", - "resolved": "2.0.212", - "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + "requested": "[2.0.219, )", + "resolved": "2.0.219", + "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" }, "Microsoft.CodeAnalysis.BannedApiAnalyzers": { "type": "Direct", diff --git a/Tests/FSharp.Specs/packages.lock.json b/Tests/FSharp.Specs/packages.lock.json index 3ee294fb4a..6f79c0c18f 100644 --- a/Tests/FSharp.Specs/packages.lock.json +++ b/Tests/FSharp.Specs/packages.lock.json @@ -22,9 +22,9 @@ }, "Meziantou.Analyzer": { "type": "Direct", - "requested": "[2.0.212, )", - "resolved": "2.0.212", - "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + "requested": "[2.0.219, )", + "resolved": "2.0.219", + "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" }, "Microsoft.CodeAnalysis.BannedApiAnalyzers": { "type": "Direct", diff --git a/Tests/FluentAssertions.Equivalency.Specs/packages.lock.json b/Tests/FluentAssertions.Equivalency.Specs/packages.lock.json index c859c0ed30..3b4e633db6 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/packages.lock.json +++ b/Tests/FluentAssertions.Equivalency.Specs/packages.lock.json @@ -152,9 +152,9 @@ }, "Meziantou.Analyzer": { "type": "Direct", - "requested": "[2.0.212, )", - "resolved": "2.0.212", - "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + "requested": "[2.0.219, )", + "resolved": "2.0.219", + "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" }, "Microsoft.CodeAnalysis.BannedApiAnalyzers": { "type": "Direct", diff --git a/Tests/FluentAssertions.Extensibility.Specs/packages.lock.json b/Tests/FluentAssertions.Extensibility.Specs/packages.lock.json index 86f5a6c298..f7e54f6bbe 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/packages.lock.json +++ b/Tests/FluentAssertions.Extensibility.Specs/packages.lock.json @@ -130,9 +130,9 @@ }, "Meziantou.Analyzer": { "type": "Direct", - "requested": "[2.0.212, )", - "resolved": "2.0.212", - "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + "requested": "[2.0.219, )", + "resolved": "2.0.219", + "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" }, "Microsoft.CodeAnalysis.BannedApiAnalyzers": { "type": "Direct", diff --git a/Tests/FluentAssertions.Specs/packages.lock.json b/Tests/FluentAssertions.Specs/packages.lock.json index 90f39f6bd2..1989f648c3 100644 --- a/Tests/FluentAssertions.Specs/packages.lock.json +++ b/Tests/FluentAssertions.Specs/packages.lock.json @@ -161,9 +161,9 @@ }, "Meziantou.Analyzer": { "type": "Direct", - "requested": "[2.0.212, )", - "resolved": "2.0.212", - "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + "requested": "[2.0.219, )", + "resolved": "2.0.219", + "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" }, "Microsoft.CodeAnalysis.BannedApiAnalyzers": { "type": "Direct", diff --git a/Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json b/Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json index b9af86a6f0..db53b4a90e 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json +++ b/Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json @@ -16,9 +16,9 @@ }, "Meziantou.Analyzer": { "type": "Direct", - "requested": "[2.0.212, )", - "resolved": "2.0.212", - "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + "requested": "[2.0.219, )", + "resolved": "2.0.219", + "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" }, "Microsoft.CodeAnalysis.BannedApiAnalyzers": { "type": "Direct", diff --git a/Tests/TestFrameworks/MSpec.Specs/packages.lock.json b/Tests/TestFrameworks/MSpec.Specs/packages.lock.json index a38ff834f4..071ebc5719 100644 --- a/Tests/TestFrameworks/MSpec.Specs/packages.lock.json +++ b/Tests/TestFrameworks/MSpec.Specs/packages.lock.json @@ -42,9 +42,9 @@ }, "Meziantou.Analyzer": { "type": "Direct", - "requested": "[2.0.212, )", - "resolved": "2.0.212", - "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + "requested": "[2.0.219, )", + "resolved": "2.0.219", + "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" }, "Microsoft.CodeAnalysis.BannedApiAnalyzers": { "type": "Direct", diff --git a/Tests/TestFrameworks/NUnit3.Specs/packages.lock.json b/Tests/TestFrameworks/NUnit3.Specs/packages.lock.json index bfb16122ca..cbbf066f1f 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/packages.lock.json +++ b/Tests/TestFrameworks/NUnit3.Specs/packages.lock.json @@ -16,9 +16,9 @@ }, "Meziantou.Analyzer": { "type": "Direct", - "requested": "[2.0.212, )", - "resolved": "2.0.212", - "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + "requested": "[2.0.219, )", + "resolved": "2.0.219", + "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" }, "Microsoft.CodeAnalysis.BannedApiAnalyzers": { "type": "Direct", diff --git a/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json b/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json index 7aa205a32e..40a0759195 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json +++ b/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json @@ -16,9 +16,9 @@ }, "Meziantou.Analyzer": { "type": "Direct", - "requested": "[2.0.212, )", - "resolved": "2.0.212", - "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + "requested": "[2.0.219, )", + "resolved": "2.0.219", + "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" }, "Microsoft.CodeAnalysis.BannedApiAnalyzers": { "type": "Direct", diff --git a/Tests/TestFrameworks/XUnit2.Specs/packages.lock.json b/Tests/TestFrameworks/XUnit2.Specs/packages.lock.json index b3df3447bc..9a3e6251a0 100644 --- a/Tests/TestFrameworks/XUnit2.Specs/packages.lock.json +++ b/Tests/TestFrameworks/XUnit2.Specs/packages.lock.json @@ -132,9 +132,9 @@ }, "Meziantou.Analyzer": { "type": "Direct", - "requested": "[2.0.212, )", - "resolved": "2.0.212", - "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + "requested": "[2.0.219, )", + "resolved": "2.0.219", + "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" }, "Microsoft.CodeAnalysis.BannedApiAnalyzers": { "type": "Direct", diff --git a/Tests/VB.Specs/packages.lock.json b/Tests/VB.Specs/packages.lock.json index 149feabf17..b33310bcde 100644 --- a/Tests/VB.Specs/packages.lock.json +++ b/Tests/VB.Specs/packages.lock.json @@ -16,9 +16,9 @@ }, "Meziantou.Analyzer": { "type": "Direct", - "requested": "[2.0.212, )", - "resolved": "2.0.212", - "contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ==" + "requested": "[2.0.219, )", + "resolved": "2.0.219", + "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" }, "Microsoft.CodeAnalysis.BannedApiAnalyzers": { "type": "Direct", From 717a7aff0067c7640759ead840012f9d6e49c45b Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Sep 2025 17:36:17 +0200 Subject: [PATCH 695/845] Verify.Xunit 30.6.1 -> 30.13.0 --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/Approval.Tests/packages.lock.json | 34 +++++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index e8e9556946..ac8f84b5c2 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/Tests/Approval.Tests/packages.lock.json b/Tests/Approval.Tests/packages.lock.json index 49ca839cb4..527874d1a3 100644 --- a/Tests/Approval.Tests/packages.lock.json +++ b/Tests/Approval.Tests/packages.lock.json @@ -34,14 +34,14 @@ }, "Verify.Xunit": { "type": "Direct", - "requested": "[30.6.1, )", - "resolved": "30.6.1", - "contentHash": "hsR/sOrWHrQYT3Dvz62vKNsws0UU2AZwB+K61j6JA7NOFtPMcZ6EWxssxQnWGQLu8q5edotkNwxP8BOUKgxI2w==", + "requested": "[30.13.0, )", + "resolved": "30.13.0", + "contentHash": "T85+/ylDUCAGxos12GSKpHgBiygTr7T4JL5Io3JdluKAksUol0ExCqQtM2svZwVyhDagX7Z5uazmPQ+dhgyGNA==", "dependencies": { - "Argon": "0.30.1", - "DiffEngine": "16.2.3", + "Argon": "0.32.0", + "DiffEngine": "16.4.1", "SimpleInfoName": "3.1.2", - "Verify": "30.6.1", + "Verify": "30.13.0", "xunit.abstractions": "2.0.3", "xunit.extensibility.execution": "2.9.3" } @@ -65,15 +65,15 @@ }, "Argon": { "type": "Transitive", - "resolved": "0.30.1", - "contentHash": "kjKnBzxJ1Xp4Sh9B7inrP1YjefXH4X8hV4/J5EoDKloog09Kp4KUVoJS8xxYfUbUzJ+Xe5PKZm3hj5pi4ZuCZw==" + "resolved": "0.32.0", + "contentHash": "sW2tLL6cllHx5Q305AkXmGN4gWSGk8Ij2xH6kje1dy5k0Ef3V9g/qE6Y0GH5du515k3coiR9PY8EvZ5SIl9jOw==" }, "DiffEngine": { "type": "Transitive", - "resolved": "16.2.3", - "contentHash": "QWnG0MR3//Ss0G0N9mIfe1HLOrOIRZqau0AOiLt9Gm53ZQf/TLvzoccTkczEW5ACkbhRY5m+p+W7bzFVln2GDw==", + "resolved": "16.4.1", + "contentHash": "egBnx/LylDupk1F/mBuhfFcpLtn/ioE7CMp0E1ROsWr2ETbqnrvGUXngMDZtRuZMbmLJIDxcOfK8AdA4p8lZhA==", "dependencies": { - "EmptyFiles": "8.10.1", + "EmptyFiles": "8.12.1", "System.Management": "8.0.0" } }, @@ -84,8 +84,8 @@ }, "EmptyFiles": { "type": "Transitive", - "resolved": "8.10.1", - "contentHash": "vhLPAqdKuo2qjVkrJbCyacGXO9XTha7G1R5amw44m877FDR/gqFjCfdncj8VyHAC6eNqrCXgYTbHJGO5+l3TJg==" + "resolved": "8.12.1", + "contentHash": "CH/UPtYC0oQ3aC8czpCI1qLgbe8FuOfNv4tRXWTMoDfHcngUgVzQcjWIVeiLzBZpessWmfRANY4XYXeX3fHYGQ==" }, "Microsoft.CodeCoverage": { "type": "Transitive", @@ -144,11 +144,11 @@ }, "Verify": { "type": "Transitive", - "resolved": "30.6.1", - "contentHash": "CaAYyNjKxM1sygsrEPPNZ7LHasV4/wPugdTNTXagpxQVsR/tz9/J/tgRqkxWXTntTEyxqqxZvdc3t46tmVK7ig==", + "resolved": "30.13.0", + "contentHash": "0jl/QBoo5xIL4LYd5g46R+b1oE2ZSiOCe5AXfbBz1w4kP8jJPv4LWYxq62L5Op60K4pGC4b13Y1yc3cq7GFXng==", "dependencies": { - "Argon": "0.30.1", - "DiffEngine": "16.2.3", + "Argon": "0.32.0", + "DiffEngine": "16.4.1", "SimpleInfoName": "3.1.2" } }, From cac37c290445694d1debcbde282fed5850cccc09 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Sep 2025 20:27:31 +0200 Subject: [PATCH 696/845] Revert package locking --- Build/Build.cs | 1 - Build/packages.lock.json | 1160 ----------------- Directory.Build.props | 3 - Src/FluentAssertions/packages.lock.json | 165 --- Tests/Approval.Tests/packages.lock.json | 197 --- Tests/AssemblyA/packages.lock.json | 24 - Tests/AssemblyB/packages.lock.json | 21 - Tests/Benchmarks/packages.lock.json | 673 ---------- Tests/ExampleExtensions/packages.lock.json | 40 - Tests/FSharp.Specs/packages.lock.json | 159 --- .../packages.lock.json | 425 ------ .../packages.lock.json | 389 ------ .../FluentAssertions.Specs/packages.lock.json | 462 ------- .../MSTestV2.Specs/packages.lock.json | 180 --- .../MSpec.Specs/packages.lock.json | 1037 --------------- .../NUnit3.Specs/packages.lock.json | 188 --- .../NUnit4.Specs/packages.lock.json | 172 --- .../TUnit.Specs/packages.lock.json | 151 --- .../XUnit2.Specs/packages.lock.json | 269 ---- .../XUnit3.Specs/packages.lock.json | 451 ------- .../XUnit3Core.Specs/packages.lock.json | 383 ------ Tests/VB.Specs/packages.lock.json | 153 --- 22 files changed, 6703 deletions(-) delete mode 100644 Build/packages.lock.json delete mode 100644 Src/FluentAssertions/packages.lock.json delete mode 100644 Tests/Approval.Tests/packages.lock.json delete mode 100644 Tests/AssemblyA/packages.lock.json delete mode 100644 Tests/AssemblyB/packages.lock.json delete mode 100644 Tests/Benchmarks/packages.lock.json delete mode 100644 Tests/ExampleExtensions/packages.lock.json delete mode 100644 Tests/FSharp.Specs/packages.lock.json delete mode 100644 Tests/FluentAssertions.Equivalency.Specs/packages.lock.json delete mode 100644 Tests/FluentAssertions.Extensibility.Specs/packages.lock.json delete mode 100644 Tests/FluentAssertions.Specs/packages.lock.json delete mode 100644 Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json delete mode 100644 Tests/TestFrameworks/MSpec.Specs/packages.lock.json delete mode 100644 Tests/TestFrameworks/NUnit3.Specs/packages.lock.json delete mode 100644 Tests/TestFrameworks/NUnit4.Specs/packages.lock.json delete mode 100644 Tests/TestFrameworks/TUnit.Specs/packages.lock.json delete mode 100644 Tests/TestFrameworks/XUnit2.Specs/packages.lock.json delete mode 100644 Tests/TestFrameworks/XUnit3.Specs/packages.lock.json delete mode 100644 Tests/TestFrameworks/XUnit3Core.Specs/packages.lock.json delete mode 100644 Tests/VB.Specs/packages.lock.json diff --git a/Build/Build.cs b/Build/Build.cs index 58e5213a9a..87d8bb32de 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -113,7 +113,6 @@ class Build : NukeBuild DotNetRestore(s => s .SetProjectFile(Solution) .EnableNoCache() - .SetContinuousIntegrationBuild(IsServerBuild) .SetConfigFile(RootDirectory / "nuget.config")); }); diff --git a/Build/packages.lock.json b/Build/packages.lock.json deleted file mode 100644 index f15421e24f..0000000000 --- a/Build/packages.lock.json +++ /dev/null @@ -1,1160 +0,0 @@ -{ - "version": 1, - "dependencies": { - "net9.0": { - "LibGit2Sharp": { - "type": "Direct", - "requested": "[0.31.0, )", - "resolved": "0.31.0", - "contentHash": "b3+UfV7LjKMjAHWwl7VawejiOv2gJIC6dTCA/S0puLTHACAA/Oeb5JJmWUQMeyH/T/WR/LaIK8bk2RbdFnrZvg==", - "dependencies": { - "LibGit2Sharp.NativeBinaries": "[2.0.323]" - } - }, - "Nuke.Common": { - "type": "Direct", - "requested": "[9.0.4, )", - "resolved": "9.0.4", - "contentHash": "/fsQTMbasNsr6uGZCGfyad3OQaBpuuiktb+0yyE81BtxfPgtJNRn71pjH9uHlQc1gk966wcMZLicDf4No03x4A==", - "dependencies": { - "Azure.Identity": "1.13.1", - "Azure.Security.KeyVault.Certificates": "4.7.0", - "Azure.Security.KeyVault.Keys": "4.7.0", - "Azure.Security.KeyVault.Secrets": "4.7.0", - "Nuke.Build": "9.0.4", - "Nuke.Build.Shared": "9.0.4", - "Nuke.ProjectModel": "9.0.4", - "Nuke.SolutionModel": "9.0.4", - "Nuke.Tooling": "9.0.4", - "Nuke.Utilities": "9.0.4", - "Nuke.Utilities.IO.Compression": "9.0.4", - "Nuke.Utilities.IO.Globbing": "9.0.4", - "Nuke.Utilities.Net": "9.0.4", - "Nuke.Utilities.Text.Json": "9.0.4", - "Octokit": "13.0.1" - } - }, - "Nuke.Components": { - "type": "Direct", - "requested": "[9.0.4, )", - "resolved": "9.0.4", - "contentHash": "MnAeZYUCKNqfko7CaKWoubYhgYCQhdjUuAb4K88aqOPq8Sgxb0BLSwSmyZslBzoLttLOQinuvv0EHJMS8c0mkA==", - "dependencies": { - "Nuke.Common": "9.0.4" - } - }, - "SharpCompress": { - "type": "Direct", - "requested": "[0.40.0, )", - "resolved": "0.40.0", - "contentHash": "yP/aFX1jqGikVF7u2f05VEaWN4aCaKNLxSas82UgA2GGVECxq/BcqZx3STHCJ78qilo1azEOk1XpBglIuGMb7w==", - "dependencies": { - "System.Buffers": "4.6.0", - "ZstdSharp.Port": "0.8.5" - } - }, - "System.Formats.Asn1": { - "type": "Direct", - "requested": "[9.0.1, )", - "resolved": "9.0.1", - "contentHash": "efRn3TXUx2aWG4yOjD5jxTYlPy4Pz/8fiwYBtIpVb/+ySsNA9PFWFd3M3MdcRx1XjpYtj5QSXGm8XnGCeh7dSA==" - }, - "Azure.Core": { - "type": "Transitive", - "resolved": "1.44.1", - "contentHash": "YyznXLQZCregzHvioip07/BkzjuWNXogJEVz9T5W6TwjNr17ax41YGzYMptlo2G10oLCuVPoyva62y0SIRDixg==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "6.0.0", - "System.ClientModel": "1.1.0", - "System.Diagnostics.DiagnosticSource": "6.0.1", - "System.Memory.Data": "6.0.0", - "System.Numerics.Vectors": "4.5.0", - "System.Text.Encodings.Web": "6.0.0", - "System.Text.Json": "6.0.10", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Azure.Identity": { - "type": "Transitive", - "resolved": "1.13.1", - "contentHash": "4eeK9XztjTmvA4WN+qAvlUCSxSv45+LqTMeC8XT2giGGZHKthTMU2IuXcHjAOf5VLH3wE3Bo6EwhIcJxVB8RmQ==", - "dependencies": { - "Azure.Core": "1.44.1", - "Microsoft.Identity.Client": "4.66.1", - "Microsoft.Identity.Client.Extensions.Msal": "4.66.1", - "System.Memory": "4.5.5", - "System.Text.Json": "6.0.10", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Azure.Security.KeyVault.Certificates": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "FcoGTI/6i8nKZhwI0HrYnVWOQk9LhnP+9T3adFAGvU8i3XPc3KKJ93VGER8L+Ygez2bpyGsWj4fRjsYv2211PQ==", - "dependencies": { - "Azure.Core": "1.44.1", - "System.Memory": "4.5.5", - "System.Text.Json": "6.0.10", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Azure.Security.KeyVault.Keys": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "1JOyCLvSfYVtxVV6dmA4YP4kJd+u+PE41M27U1po8XlglRcW3YZhet/O90fkEbpmiuNka1XjM2qrT9A++izloQ==", - "dependencies": { - "Azure.Core": "1.44.1", - "System.Memory": "4.5.5", - "System.Text.Json": "6.0.10", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Azure.Security.KeyVault.Secrets": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "uOPCojkm41V4dKTORyGzl3/f/lriKpxSQ43fWDn4StRJBVmbF1F/DNWJhwm207kCnqgE/W9+tskJSimIKHCZkw==", - "dependencies": { - "Azure.Core": "1.44.1", - "System.Memory": "4.5.5", - "System.Text.Json": "6.0.10", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Glob": { - "type": "Transitive", - "resolved": "1.1.9", - "contentHash": "AfK5+ECWYTP7G3AAdnU8IfVj+QpGjrh9GC2mpdcJzCvtQ4pnerAGwHsxJ9D4/RnhDUz2DSzd951O/lQjQby2Sw==" - }, - "JetBrains.Annotations": { - "type": "Transitive", - "resolved": "2024.3.0", - "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" - }, - "LibGit2Sharp.NativeBinaries": { - "type": "Transitive", - "resolved": "2.0.323", - "contentHash": "Kg+fJGWhGj5qRXG0Ilj4ddhuodGXZg57yhfX6OVUDR0M2DKg/UR42/d74+qv5l1qotc1qJilo/ho7xQnULP6yA==" - }, - "Microsoft.ApplicationInsights": { - "type": "Transitive", - "resolved": "2.22.0", - "contentHash": "3AOM9bZtku7RQwHyMEY3tQMrHIgjcfRDa6YQpd/QG2LDGvMydSlL9Di+8LLMt7J2RDdfJ7/2jdYv6yHcMJAnNw==", - "dependencies": { - "System.Diagnostics.DiagnosticSource": "5.0.0" - } - }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==" - }, - "Microsoft.Build": { - "type": "Transitive", - "resolved": "17.12.6", - "contentHash": "Gz8VteydDNLOhm0vov0dSeQb43ibQ4EnWoc2UtjUd7F3MNFo12o/3XLvVFoZ9b8UXBX6EzraL8XLCy93QTnnIA==", - "dependencies": { - "Microsoft.Build.Framework": "17.12.6", - "Microsoft.NET.StringTools": "17.12.6", - "System.Collections.Immutable": "8.0.0", - "System.Configuration.ConfigurationManager": "8.0.0", - "System.Reflection.Metadata": "8.0.0", - "System.Reflection.MetadataLoadContext": "8.0.0" - } - }, - "Microsoft.Build.Framework": { - "type": "Transitive", - "resolved": "17.12.6", - "contentHash": "jleteC0seumLGTmTVwob97lcwPj/dfgzL/V3g/VVcMZgo2Ic7jzdy8AYpByPDh8e3uRq0SjCl6HOFCjhy5GzRQ==" - }, - "Microsoft.Build.Locator": { - "type": "Transitive", - "resolved": "1.7.8", - "contentHash": "sPy10x527Ph16S2u0yGME4S6ohBKJ69WfjeGG/bvELYeZVmJdKjxgnlL8cJJJLGV/cZIRqSfB12UDB8ICakOog==" - }, - "Microsoft.Build.Tasks.Core": { - "type": "Transitive", - "resolved": "17.12.6", - "contentHash": "ENxyDD/Bp3aa5V1Og6sCKBL26gEuDsP9MtUbnzNO3mhiLHmb/WiRcmtIAXamCefPsIdy+X7pzLHyJVE9vjvz8g==", - "dependencies": { - "Microsoft.Build.Framework": "17.12.6", - "Microsoft.Build.Utilities.Core": "17.12.6", - "Microsoft.NET.StringTools": "17.12.6", - "System.CodeDom": "8.0.0", - "System.Collections.Immutable": "8.0.0", - "System.Configuration.ConfigurationManager": "8.0.0", - "System.Formats.Asn1": "8.0.1", - "System.Resources.Extensions": "8.0.0", - "System.Security.Cryptography.Pkcs": "8.0.0", - "System.Security.Cryptography.Xml": "8.0.0" - } - }, - "Microsoft.Build.Utilities.Core": { - "type": "Transitive", - "resolved": "17.12.6", - "contentHash": "pU3GnHcXp8VRMGKxdJCq+tixfhFn+QwEbpqmZmc/nqFHFyuhlGwjonWZMIWcwuCv/8EHgxoOttFvna1vrN+RrA==", - "dependencies": { - "Microsoft.Build.Framework": "17.12.6", - "Microsoft.NET.StringTools": "17.12.6", - "System.Collections.Immutable": "8.0.0", - "System.Configuration.ConfigurationManager": "8.0.0" - } - }, - "Microsoft.Extensions.DependencyModel": { - "type": "Transitive", - "resolved": "9.0.0", - "contentHash": "saxr2XzwgDU77LaQfYFXmddEDRUKHF4DaGMZkNB3qjdVSZlax3//dGJagJkKrGMIPNZs2jVFXITyCCR6UHJNdA==" - }, - "Microsoft.Identity.Client": { - "type": "Transitive", - "resolved": "4.66.1", - "contentHash": "mE+m3pZ7zSKocSubKXxwZcUrCzLflC86IdLxrVjS8tialy0b1L+aECBqRBC/ykcPlB4y7skg49TaTiA+O2UfDw==", - "dependencies": { - "Microsoft.IdentityModel.Abstractions": "6.35.0", - "System.Diagnostics.DiagnosticSource": "6.0.1" - } - }, - "Microsoft.Identity.Client.Extensions.Msal": { - "type": "Transitive", - "resolved": "4.66.1", - "contentHash": "osgt1J9Rve3LO7wXqpWoFx9UFjl0oeqoUMK/xEru7dvafQ28RgV1A17CoCGCCRSUbgDQ4Arg5FgGK2lQ3lXR4A==", - "dependencies": { - "Microsoft.Identity.Client": "4.66.1", - "System.Security.Cryptography.ProtectedData": "4.5.0" - } - }, - "Microsoft.IdentityModel.Abstractions": { - "type": "Transitive", - "resolved": "6.35.0", - "contentHash": "xuR8E4Rd96M41CnUSCiOJ2DBh+z+zQSmyrYHdYhD6K4fXBcQGVnRCFQ0efROUYpP+p0zC1BLKr0JRpVuujTZSg==" - }, - "Microsoft.NET.StringTools": { - "type": "Transitive", - "resolved": "17.12.6", - "contentHash": "w8Ehofqte5bJoR+Fa3f6JwkwFEkGtXxqvQHGOVOSHDzgNVySvL5FSNhavbQSZ864el9c3rjdLPLAtBW8dq6fmg==" - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==" - }, - "Microsoft.NETCore.Targets": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" - }, - "Namotion.Reflection": { - "type": "Transitive", - "resolved": "3.2.0", - "contentHash": "YfGjDPzMEs3vRMI4CMkJwOg75SV5JEDV72kMccD2GCo++TfgOYb5ZTpABYq3dUQqFtnAPpqMKM+deLlrUwnN1g==" - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.3", - "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" - }, - "NJsonSchema": { - "type": "Transitive", - "resolved": "11.1.0", - "contentHash": "H7QO+bM/2uzF81mVyy4U8ha4MXS9eOX06rTvBgJKquzIuLUGuiOTc4nknkCFKW7mr+xnWgzY7Spevz5ZEK8fGg==", - "dependencies": { - "NJsonSchema.Annotations": "11.1.0", - "Namotion.Reflection": "3.2.0", - "Newtonsoft.Json": "13.0.3" - } - }, - "NJsonSchema.Annotations": { - "type": "Transitive", - "resolved": "11.1.0", - "contentHash": "2gU72pKhMLrQt7TjHv+nrb8CxxgUaBk2SD/CaB5f00SxuWdOT4YVQaGy+jTVx+8IgQit+9WWMvBWU9f6U2HNiQ==" - }, - "NJsonSchema.NewtonsoftJson": { - "type": "Transitive", - "resolved": "11.1.0", - "contentHash": "7eC9PNAqHt2RU1CWz4xzZsBdTWCOVH1dpytV2UF5vifi8gOOEAftPdTRUw9O0txNTY65AQUvHU0+P7yuCGWo/g==", - "dependencies": { - "NJsonSchema": "11.1.0", - "Newtonsoft.Json": "13.0.3" - } - }, - "NuGet.Common": { - "type": "Transitive", - "resolved": "6.12.1", - "contentHash": "nk8nTdhQl4x2VaAQUvefI7DDYAuBDlE+OZZRffm50Qx5dUAEq8wkc5JIqrN2lTEohObHPI/SXyG2UFdMQkrdyg==", - "dependencies": { - "NuGet.Frameworks": "6.12.1" - } - }, - "NuGet.Configuration": { - "type": "Transitive", - "resolved": "6.12.1", - "contentHash": "IRwlY1379ZgJ0oEJvjD+lDuOhJ5S1fsU5n/bEC5/i0+N9bo2WIMDAdaQ/qIdyK/gMJ/YWS+++GSX6rN7luqEvg==", - "dependencies": { - "NuGet.Common": "6.12.1", - "System.Security.Cryptography.ProtectedData": "4.4.0" - } - }, - "NuGet.Frameworks": { - "type": "Transitive", - "resolved": "6.12.1", - "contentHash": "kPaRD5RJC0ByUg+yGX6bDz5XHMI7OYmQwP8kbtef+vZ+csj/VDb5Bwas4ChxwhoAbI8lEvwP5/3aViQPpgNBow==" - }, - "NuGet.Packaging": { - "type": "Transitive", - "resolved": "6.12.1", - "contentHash": "6s5NO3VNX6fIx6GwuWZtIsal9W1xkelYd3Vg2KUAg1zGqnKC3wB5IZlombvVGVGcwyl/A+iDvpUwSvgeDoB3wA==", - "dependencies": { - "Newtonsoft.Json": "13.0.3", - "NuGet.Configuration": "6.12.1", - "NuGet.Versioning": "6.12.1", - "System.Formats.Asn1": "8.0.1", - "System.Security.Cryptography.Pkcs": "6.0.4" - } - }, - "NuGet.Versioning": { - "type": "Transitive", - "resolved": "6.12.1", - "contentHash": "fJ6rFYANDnohFsdpaY79FvrJxI6murmoOxXz6nZlf819F48+IBKMnAIg3oIBRtZq5y498ObMtKnro5IitvizUg==" - }, - "Nuke.Build": { - "type": "Transitive", - "resolved": "9.0.4", - "contentHash": "qqVzABgBcIZVfM+fPPxJz3+aE5wwiKiL3AqeV9qjQnC89998c/PMWInZcGAR9w3Nvli6TgPzuPOfRF3GWwuDFg==", - "dependencies": { - "Microsoft.ApplicationInsights": "2.22.0", - "Microsoft.Extensions.DependencyModel": "9.0.0", - "NJsonSchema": "11.1.0", - "NJsonSchema.NewtonsoftJson": "11.1.0", - "Nuke.Build.Shared": "9.0.4", - "Nuke.ProjectModel": "9.0.4", - "Nuke.SolutionModel": "9.0.4", - "Nuke.Tooling": "9.0.4", - "Nuke.Utilities": "9.0.4", - "Nuke.Utilities.IO.Globbing": "9.0.4", - "Nuke.Utilities.Net": "9.0.4", - "Nuke.Utilities.Text.Json": "9.0.4", - "Nuke.Utilities.Text.Yaml": "9.0.4", - "Serilog.Formatting.Compact": "3.0.0", - "Serilog.Formatting.Compact.Reader": "4.0.0", - "Serilog.Sinks.Console": "6.0.0", - "Serilog.Sinks.File": "6.0.0" - } - }, - "Nuke.Build.Shared": { - "type": "Transitive", - "resolved": "9.0.4", - "contentHash": "RwEKFqMxJ/0E0ubg8MnnbxkcYhGNUhEn7o0btjxWhZXpevG35MBdyMArnIi2q+fFxe/qvFNVIzcpt7FV62ZG3A==", - "dependencies": { - "Nuke.Utilities": "9.0.4", - "System.Text.Json": "8.0.5" - } - }, - "Nuke.ProjectModel": { - "type": "Transitive", - "resolved": "9.0.4", - "contentHash": "875MtBQJ3U6OSEPzHTbcnrCd5+JTEQ3Qr9c+DDqlW+klJhlLPUXkZQF/qh+V1mwcXa62zQmd+Q1JcV5ysJxvJA==", - "dependencies": { - "Microsoft.Build": "17.12.6", - "Microsoft.Build.Framework": "17.12.6", - "Microsoft.Build.Locator": "1.7.8", - "Microsoft.Build.Tasks.Core": "17.12.6", - "Microsoft.Build.Utilities.Core": "17.12.6", - "Nuke.SolutionModel": "9.0.4", - "Nuke.Tooling": "9.0.4", - "Nuke.Utilities": "9.0.4" - } - }, - "Nuke.SolutionModel": { - "type": "Transitive", - "resolved": "9.0.4", - "contentHash": "Xb5Mf1fN/FSiST2SltKGfDbQSsDhchbHvRvd/KsqazId/HhQO9YRHBMIWJExV1PrI9PsFqjYnM5CbRJtPNP//A==", - "dependencies": { - "Nuke.Utilities": "9.0.4" - } - }, - "Nuke.Tooling": { - "type": "Transitive", - "resolved": "9.0.4", - "contentHash": "webikFwIKyW16Y3Hdm6a4h5n+KHl3w654WY3rqA+OijK5F6ehsNXUGrnrMdKHa90wdBoDiwuYb7rFspr5c0e/w==", - "dependencies": { - "Newtonsoft.Json": "13.0.3", - "NuGet.Packaging": "6.12.1", - "Nuke.Utilities": "9.0.4", - "Nuke.Utilities.Text.Json": "9.0.4", - "Serilog": "4.2.0" - } - }, - "Nuke.Utilities": { - "type": "Transitive", - "resolved": "9.0.4", - "contentHash": "KUaLNxcnjmT0zkEPkENvPiZpnu4FOi95zSJoiE1sNIoD3IWffxhIgy1gziBjDywsAm6u4EaHe7/GnwgZIwTQjw==", - "dependencies": { - "JetBrains.Annotations": "2024.3.0" - } - }, - "Nuke.Utilities.IO.Compression": { - "type": "Transitive", - "resolved": "9.0.4", - "contentHash": "KRxCkDuWLQh69n40H0ORIMdzhfdPiSJmpYp+jxiQ4ZyaByuMrpIr3YVGLzDJT+7ErxhLAcfEwLAMkt9gFkTF9g==", - "dependencies": { - "Nuke.Utilities": "9.0.4", - "SharpZipLib": "1.4.2" - } - }, - "Nuke.Utilities.IO.Globbing": { - "type": "Transitive", - "resolved": "9.0.4", - "contentHash": "eJK2qX/97Clx8mXRBg+GnI8hmd1HFTvACaujrnCElKMt/kJZdjdy4eaAutekvciidywXBj0J9OSObDHXts/q+w==", - "dependencies": { - "Glob": "1.1.9", - "Nuke.Utilities": "9.0.4" - } - }, - "Nuke.Utilities.Net": { - "type": "Transitive", - "resolved": "9.0.4", - "contentHash": "UtHziv6iI3M2oaeRONQREAtVJbjCmR0fV2QaWRVQX+oC09R3mTJ/JWEBIE/QUq53OYQr9GWwIsA/Wz7v39AYKg==", - "dependencies": { - "Newtonsoft.Json": "13.0.3", - "Nuke.Utilities": "9.0.4", - "System.Net.Http": "4.3.4" - } - }, - "Nuke.Utilities.Text.Json": { - "type": "Transitive", - "resolved": "9.0.4", - "contentHash": "Cf+q4M1oaR254dapSR811PUC0t12mqIAUmCk2jwGHEtW/QRoEHYl9/L5lYzVEd62Tig9TuvBMiZmWnNyE9CmgA==", - "dependencies": { - "Newtonsoft.Json": "13.0.3", - "Nuke.Utilities": "9.0.4" - } - }, - "Nuke.Utilities.Text.Yaml": { - "type": "Transitive", - "resolved": "9.0.4", - "contentHash": "/bRdrdXTa7R1ue/+POqdEQDFrwjbYETmQFla4/Ti3ucvsPPjd8ywNTi0Q1gJb63GlncEKYFKLW3dCzs+7SvxLA==", - "dependencies": { - "Nuke.Utilities": "9.0.4", - "YamlDotNet": "16.3.0" - } - }, - "Octokit": { - "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "tjXTa2FXzbd3n17VWpi8UXe05EIJqHcWJW8C2kukftIve00duWiZL8x4i1vlZQ0zQ4RbRANbRc7J5K7Co/1spQ==" - }, - "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "7VSGO0URRKoMEAq0Sc9cRz8mb6zbyx/BZDEWhgPdzzpmFhkam3fJ1DAGWFXBI4nGlma+uPKpfuMQP5LXRnOH5g==" - }, - "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "0oAaTAm6e2oVH+/Zttt0cuhGaePQYKII1dY8iaqP7CvOpVKgLybKRFvQjXR2LtxXOXTVPNv14j0ot8uV+HrUmw==" - }, - "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "G24ibsCNi5Kbz0oXWynBoRgtGvsw5ZSVEWjv13/KiCAM8C6wz9zzcCniMeQFIkJ2tasjo2kXlvlBZhplL51kGg==" - }, - "runtime.native.System": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - } - }, - "runtime.native.System.Net.Http": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - } - }, - "runtime.native.System.Security.Cryptography.Apple": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", - "dependencies": { - "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" - } - }, - "runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "QR1OwtwehHxSeQvZKXe+iSd+d3XZNkEcuWMFYa2i0aG1l+lR739HPicKMlTbJst3spmeekDVBUS7SeS26s4U/g==", - "dependencies": { - "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" - } - }, - "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "I+GNKGg2xCHueRd1m9PzeEW7WLbNNLznmTuEi8/vZX71HudUbx1UTwlGkiwMri7JLl8hGaIAWnA/GONhu+LOyQ==" - }, - "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "1Z3TAq1ytS1IBRtPXJvEUZdVsfWfeNEhBkbiOCGEl9wwAfsjP2lz3ZFDx5tq8p60/EqbS0HItG5piHuB71RjoA==" - }, - "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==" - }, - "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "6mU/cVmmHtQiDXhnzUImxIcDL48GbTk+TsptXyJA+MIOG9LRjPoAQC/qBFB7X+UNyK86bmvGwC8t+M66wsYC8w==" - }, - "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "vjwG0GGcTW/PPg6KVud8F9GLWYuAV1rrw1BKAqY0oh4jcUqg15oYF1+qkGR2x2ZHM4DQnWKQ7cJgYbfncz/lYg==" - }, - "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "7KMFpTkHC/zoExs+PwP8jDCWcrK9H6L7soowT80CUx3e+nxP/AFnq0AQAW5W76z2WYbLAYCRyPfwYFG6zkvQRw==" - }, - "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "xrlmRCnKZJLHxyyLIqkZjNXqgxnKdZxfItrPkjI+6pkRo5lHX8YvSZlWrSI5AVwLMi4HbNWP7064hcAWeZKp5w==" - }, - "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "leXiwfiIkW7Gmn7cgnNcdtNAU70SjmKW3jxGj1iKHOvdn0zRWsgv/l2OJUO5zdGdiv2VRFnAsxxhDgMzofPdWg==" - }, - "Serilog": { - "type": "Transitive", - "resolved": "4.2.0", - "contentHash": "gmoWVOvKgbME8TYR+gwMf7osROiWAURterc6Rt2dQyX7wtjZYpqFiA/pY6ztjGQKKV62GGCyOcmtP1UKMHgSmA==" - }, - "Serilog.Formatting.Compact": { - "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "wQsv14w9cqlfB5FX2MZpNsTawckN4a8dryuNGbebB/3Nh1pXnROHZov3swtu3Nj5oNG7Ba+xdu7Et/ulAUPanQ==", - "dependencies": { - "Serilog": "4.0.0" - } - }, - "Serilog.Formatting.Compact.Reader": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "E1gvPAx0AsQhlyzGwgcVnGe5QrdkSugwKh+6V/FUSdTMVKKPSiO6Ff5iosjBMNBvq244Zys7BhTfFmgCE0KUyQ==", - "dependencies": { - "Newtonsoft.Json": "13.0.3", - "Serilog": "4.0.0" - } - }, - "Serilog.Sinks.Console": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "fQGWqVMClCP2yEyTXPIinSr5c+CBGUvBybPxjAGcf7ctDhadFhrQw03Mv8rJ07/wR5PDfFjewf2LimvXCDzpbA==", - "dependencies": { - "Serilog": "4.0.0" - } - }, - "Serilog.Sinks.File": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "lxjg89Y8gJMmFxVkbZ+qDgjl+T4yC5F7WSLTvA+5q0R04tfKVLRL/EHpYoJ/MEQd2EeCKDuylBIVnAYMotmh2A==", - "dependencies": { - "Serilog": "4.0.0" - } - }, - "SharpZipLib": { - "type": "Transitive", - "resolved": "1.4.2", - "contentHash": "yjj+3zgz8zgXpiiC3ZdF/iyTBbz2fFvMxZFEBPUcwZjIvXOf37Ylm+K58hqMfIBt5JgU/Z2uoUS67JmTLe973A==" - }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.6.0", - "contentHash": "lN6tZi7Q46zFzAbRYXTIvfXcyvQQgxnY7Xm6C6xQ9784dEL1amjM6S6Iw4ZpsvesAKnRVsM4scrDQaDqSClkjA==" - }, - "System.ClientModel": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "UocOlCkxLZrG2CKMAAImPcldJTxeesHnHGHwhJ0pNlZEvEXcWKuQvVOER2/NiOkJGRJk978SNdw3j6/7O9H1lg==", - "dependencies": { - "System.Memory.Data": "1.0.2", - "System.Text.Json": "6.0.9" - } - }, - "System.CodeDom": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "WTlRjL6KWIMr/pAaq3rYqh0TJlzpouaQ/W1eelssHgtlwHAH25jXTkUphTYx9HaIIf7XA6qs/0+YhtLEQRkJ+Q==" - }, - "System.Collections": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Collections.Concurrent": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Globalization": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } - }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==" - }, - "System.Configuration.ConfigurationManager": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "JlYi9XVvIREURRUlGMr1F6vOFLk7YSY4p1vHo4kX3tQ0AGrjqlRWHDi66ImHhy6qwXBG3BJ6Y1QlYQ+Qz6Xgww==", - "dependencies": { - "System.Diagnostics.EventLog": "8.0.0", - "System.Security.Cryptography.ProtectedData": "8.0.0" - } - }, - "System.Diagnostics.Debug": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Diagnostics.DiagnosticSource": { - "type": "Transitive", - "resolved": "6.0.1", - "contentHash": "KiLYDu2k2J82Q9BJpWiuQqCkFjRBWVq4jDzKKWawVi9KWzyD0XG3cmfX0vqTQlL14Wi9EufJrbL0+KCLTbqWiQ==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Diagnostics.EventLog": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A==" - }, - "System.Diagnostics.Tracing": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Globalization": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Globalization.Calendars": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Globalization": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Globalization.Extensions": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Globalization": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.InteropServices": "4.3.0" - } - }, - "System.IO": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } - }, - "System.IO.FileSystem": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.IO": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } - }, - "System.IO.FileSystem.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", - "dependencies": { - "System.Runtime": "4.3.0" - } - }, - "System.Linq": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.5", - "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==" - }, - "System.Memory.Data": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "ntFHArH3I4Lpjf5m4DCXQHJuGwWPNVJPaAvM95Jy/u+2Yzt2ryiyIN04LAogkjP9DeRcEOiviAjQotfmPq/FrQ==", - "dependencies": { - "System.Text.Json": "6.0.0" - } - }, - "System.Net.Http": { - "type": "Transitive", - "resolved": "4.3.4", - "contentHash": "aOa2d51SEbmM+H+Csw7yJOuNZoHkrP2XnAurye5HWYgGVVU54YZDvsLUYRv6h18X3sPnjNCANmN7ZhIPiqMcjA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.1", - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.DiagnosticSource": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Globalization": "4.3.0", - "System.Globalization.Extensions": "4.3.0", - "System.IO": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.Net.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.OpenSsl": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Security.Cryptography.X509Certificates": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "runtime.native.System": "4.3.0", - "runtime.native.System.Net.Http": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" - } - }, - "System.Net.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "qOu+hDwFwoZPbzPvwut2qATe3ygjeQBDQj91xlsaqGFQUI5i4ZnZb8yyQuLGpDGivEPIt8EJkd1BVzVoP31FXA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0" - } - }, - "System.Numerics.Vectors": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" - }, - "System.Reflection": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.IO": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==", - "dependencies": { - "System.Collections.Immutable": "8.0.0" - } - }, - "System.Reflection.MetadataLoadContext": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "SZxrQ4sQYnIcdwiO3G/lHZopbPYQ2lW0ioT4JezgccWUrKaKbHLJbAGZaDfkYjWcta1pWssAo3MOXLsR0ie4tQ==", - "dependencies": { - "System.Collections.Immutable": "8.0.0", - "System.Reflection.Metadata": "8.0.0" - } - }, - "System.Reflection.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Resources.Extensions": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "psnQ6GRQOvt+evda5C4nD5EuV49mz2Tv0DD2JDVDEbE/TKoMukxSkGJcsBJ0pajpPuFRr67syFYlkJ4Wj6A5Zw==" - }, - "System.Resources.ResourceManager": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Globalization": "4.3.0", - "System.Reflection": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Runtime": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" - }, - "System.Runtime.Extensions": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Runtime.Handles": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Runtime.InteropServices": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Reflection": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0" - } - }, - "System.Runtime.Numerics": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", - "dependencies": { - "System.Globalization": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0" - } - }, - "System.Security.Cryptography.Algorithms": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.Numerics": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "runtime.native.System.Security.Cryptography.Apple": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" - } - }, - "System.Security.Cryptography.Cng": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0" - } - }, - "System.Security.Cryptography.Csp": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.IO": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0" - } - }, - "System.Security.Cryptography.Encoding": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.Collections.Concurrent": "4.3.0", - "System.Linq": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" - } - }, - "System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", - "dependencies": { - "System.Collections": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.Numerics": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" - } - }, - "System.Security.Cryptography.Pkcs": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "ULmp3xoOwNYjOYp4JZ2NK/6NdTgiN1GQXzVVN1njQ7LOZ0d0B9vyMnhyqbIi9Qw4JXj1JgCsitkTShboHRx7Eg==", - "dependencies": { - "System.Formats.Asn1": "8.0.0" - } - }, - "System.Security.Cryptography.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", - "dependencies": { - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } - }, - "System.Security.Cryptography.ProtectedData": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==" - }, - "System.Security.Cryptography.X509Certificates": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.Globalization.Calendars": "4.3.0", - "System.IO": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.Numerics": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Cng": "4.3.0", - "System.Security.Cryptography.Csp": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.OpenSsl": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "runtime.native.System": "4.3.0", - "runtime.native.System.Net.Http": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" - } - }, - "System.Security.Cryptography.Xml": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "HQSFbakswZ1OXFz2Bt3AJlC6ENDqWeVpgqhf213xqQUMDifzydOHIKVb1RV4prayobvR3ETIScMaQdDF2hwGZA==", - "dependencies": { - "System.Security.Cryptography.Pkcs": "8.0.0" - } - }, - "System.Text.Encoding": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "8.0.5", - "contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg==" - }, - "System.Threading": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", - "dependencies": { - "System.Runtime": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } - }, - "System.Threading.Tasks": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==" - }, - "YamlDotNet": { - "type": "Transitive", - "resolved": "16.3.0", - "contentHash": "SgMOdxbz8X65z8hraIs6hOEdnkH6hESTAIUa7viEngHOYaH+6q5XJmwr1+yb9vJpNQ19hCQY69xbFsLtXpobQA==" - }, - "ZstdSharp.Port": { - "type": "Transitive", - "resolved": "0.8.5", - "contentHash": "TR4j17WeVSEb3ncgL2NqlXEqcy04I+Kk9CaebNDplUeL8XOgjkZ7fP4Wg4grBdPLIqsV86p2QaXTkZoRMVOsew==" - } - } - } -} \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 36579391e9..79f0d8f4e9 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,9 +3,6 @@ 13.0 false true - true - true - true diff --git a/Src/FluentAssertions/packages.lock.json b/Src/FluentAssertions/packages.lock.json deleted file mode 100644 index 1ba041062d..0000000000 --- a/Src/FluentAssertions/packages.lock.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "version": 1, - "dependencies": { - ".NETFramework,Version=v4.7": { - "JetBrains.Annotations": { - "type": "Direct", - "requested": "[2024.3.0, )", - "resolved": "2024.3.0", - "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" - }, - "PolySharp": { - "type": "Direct", - "requested": "[1.15.0, )", - "resolved": "1.15.0", - "contentHash": "FbU0El+EEjdpuIX4iDbeS7ki1uzpJPx8vbqOzEtqnl1GZeAGJfq+jCbxeJL2y0EPnUNk8dRnnqR2xnYXg9Tf+g==" - }, - "Reflectify": { - "type": "Direct", - "requested": "[1.6.0, )", - "resolved": "1.6.0", - "contentHash": "49yzx5GWHID011rGvMmcYTN+MTsfEwCVFMsTPwicjeBS3/gEj2xyB4IuFbPXDdOiw1N9n3AUhaNt3oMBHzAZIQ==" - }, - "System.Threading.Tasks.Extensions": { - "type": "Direct", - "requested": "[4.5.4, )", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" - } - }, - ".NETStandard,Version=v2.0": { - "JetBrains.Annotations": { - "type": "Direct", - "requested": "[2024.3.0, )", - "resolved": "2024.3.0", - "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" - }, - "NETStandard.Library": { - "type": "Direct", - "requested": "[2.0.3, )", - "resolved": "2.0.3", - "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0" - } - }, - "PolySharp": { - "type": "Direct", - "requested": "[1.15.0, )", - "resolved": "1.15.0", - "contentHash": "FbU0El+EEjdpuIX4iDbeS7ki1uzpJPx8vbqOzEtqnl1GZeAGJfq+jCbxeJL2y0EPnUNk8dRnnqR2xnYXg9Tf+g==" - }, - "Reflectify": { - "type": "Direct", - "requested": "[1.6.0, )", - "resolved": "1.6.0", - "contentHash": "49yzx5GWHID011rGvMmcYTN+MTsfEwCVFMsTPwicjeBS3/gEj2xyB4IuFbPXDdOiw1N9n3AUhaNt3oMBHzAZIQ==" - }, - "System.Threading.Tasks.Extensions": { - "type": "Direct", - "requested": "[4.5.4, )", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" - } - }, - ".NETStandard,Version=v2.1": { - "JetBrains.Annotations": { - "type": "Direct", - "requested": "[2024.3.0, )", - "resolved": "2024.3.0", - "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" - }, - "PolySharp": { - "type": "Direct", - "requested": "[1.15.0, )", - "resolved": "1.15.0", - "contentHash": "FbU0El+EEjdpuIX4iDbeS7ki1uzpJPx8vbqOzEtqnl1GZeAGJfq+jCbxeJL2y0EPnUNk8dRnnqR2xnYXg9Tf+g==" - }, - "Reflectify": { - "type": "Direct", - "requested": "[1.6.0, )", - "resolved": "1.6.0", - "contentHash": "49yzx5GWHID011rGvMmcYTN+MTsfEwCVFMsTPwicjeBS3/gEj2xyB4IuFbPXDdOiw1N9n3AUhaNt3oMBHzAZIQ==" - } - }, - "net6.0": { - "CSharpGuidelinesAnalyzer": { - "type": "Direct", - "requested": "[3.8.5, )", - "resolved": "3.8.5", - "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" - }, - "JetBrains.Annotations": { - "type": "Direct", - "requested": "[2024.3.0, )", - "resolved": "2024.3.0", - "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" - }, - "Meziantou.Analyzer": { - "type": "Direct", - "requested": "[2.0.219, )", - "resolved": "2.0.219", - "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" - }, - "Microsoft.CodeAnalysis.BannedApiAnalyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" - }, - "PolySharp": { - "type": "Direct", - "requested": "[1.15.0, )", - "resolved": "1.15.0", - "contentHash": "FbU0El+EEjdpuIX4iDbeS7ki1uzpJPx8vbqOzEtqnl1GZeAGJfq+jCbxeJL2y0EPnUNk8dRnnqR2xnYXg9Tf+g==" - }, - "Reflectify": { - "type": "Direct", - "requested": "[1.6.0, )", - "resolved": "1.6.0", - "contentHash": "49yzx5GWHID011rGvMmcYTN+MTsfEwCVFMsTPwicjeBS3/gEj2xyB4IuFbPXDdOiw1N9n3AUhaNt3oMBHzAZIQ==" - }, - "Roslynator.Analyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" - }, - "StyleCop.Analyzers": { - "type": "Direct", - "requested": "[1.2.0-beta.556, )", - "resolved": "1.2.0-beta.556", - "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", - "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.556" - } - }, - "StyleCop.Analyzers.Unstable": { - "type": "Transitive", - "resolved": "1.2.0.556", - "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" - } - } - } -} \ No newline at end of file diff --git a/Tests/Approval.Tests/packages.lock.json b/Tests/Approval.Tests/packages.lock.json deleted file mode 100644 index 527874d1a3..0000000000 --- a/Tests/Approval.Tests/packages.lock.json +++ /dev/null @@ -1,197 +0,0 @@ -{ - "version": 1, - "dependencies": { - "net8.0": { - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0", - "Microsoft.TestPlatform.TestHost": "17.13.0" - } - }, - "PublicApiGenerator": { - "type": "Direct", - "requested": "[11.4.6, )", - "resolved": "11.4.6", - "contentHash": "dg+b2XIWu2n+ifCo91UHrFAXJvpAHTU4GlNbPUewDqAmiGFo1wV0DSdJiC++HMWtHfcCYBIwRkT2Fhi9vv3new==", - "dependencies": { - "Mono.Cecil": "0.11.6", - "System.CodeDom": "6.0.0" - } - }, - "Verify.DiffPlex": { - "type": "Direct", - "requested": "[3.1.2, )", - "resolved": "3.1.2", - "contentHash": "ySaQ+MffcDfGWzBXB9UHppEGBqzl0L+2CxZcT04xQ3gugsN5AAjBPHkt75Ca61PlAeZCyty/p/Q9ZwaQjNOoTg==", - "dependencies": { - "DiffPlex": "1.7.2", - "Verify": "27.0.0" - } - }, - "Verify.Xunit": { - "type": "Direct", - "requested": "[30.13.0, )", - "resolved": "30.13.0", - "contentHash": "T85+/ylDUCAGxos12GSKpHgBiygTr7T4JL5Io3JdluKAksUol0ExCqQtM2svZwVyhDagX7Z5uazmPQ+dhgyGNA==", - "dependencies": { - "Argon": "0.32.0", - "DiffEngine": "16.4.1", - "SimpleInfoName": "3.1.2", - "Verify": "30.13.0", - "xunit.abstractions": "2.0.3", - "xunit.extensibility.execution": "2.9.3" - } - }, - "xunit": { - "type": "Direct", - "requested": "[2.9.3, )", - "resolved": "2.9.3", - "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", - "dependencies": { - "xunit.analyzers": "1.18.0", - "xunit.assert": "2.9.3", - "xunit.core": "[2.9.3]" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[3.1.4, )", - "resolved": "3.1.4", - "contentHash": "5mj99LvCqrq3CNi06xYdyIAXOEh+5b33F2nErCzI5zWiDdLHXiPXEWFSUAF8zlIv0ZWqjZNCwHTQeAPYbF3pCg==" - }, - "Argon": { - "type": "Transitive", - "resolved": "0.32.0", - "contentHash": "sW2tLL6cllHx5Q305AkXmGN4gWSGk8Ij2xH6kje1dy5k0Ef3V9g/qE6Y0GH5du515k3coiR9PY8EvZ5SIl9jOw==" - }, - "DiffEngine": { - "type": "Transitive", - "resolved": "16.4.1", - "contentHash": "egBnx/LylDupk1F/mBuhfFcpLtn/ioE7CMp0E1ROsWr2ETbqnrvGUXngMDZtRuZMbmLJIDxcOfK8AdA4p8lZhA==", - "dependencies": { - "EmptyFiles": "8.12.1", - "System.Management": "8.0.0" - } - }, - "DiffPlex": { - "type": "Transitive", - "resolved": "1.7.2", - "contentHash": "qJEjdxEDBWSFZGB8paBB9HDeJXHGlHlOXeGX3kbTuXWuOsgv2iSAEOOzo5V1/B39Vcxr9IVVrNKewRcX+rsn4g==" - }, - "EmptyFiles": { - "type": "Transitive", - "resolved": "8.12.1", - "contentHash": "CH/UPtYC0oQ3aC8czpCI1qLgbe8FuOfNv4tRXWTMoDfHcngUgVzQcjWIVeiLzBZpessWmfRANY4XYXeX3fHYGQ==" - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Newtonsoft.Json": "13.0.1" - } - }, - "Mono.Cecil": { - "type": "Transitive", - "resolved": "0.11.6", - "contentHash": "f33RkDtZO8VlGXCtmQIviOtxgnUdym9xx/b1p9h91CRGOsJFxCFOFK1FDbVt1OCf1aWwYejUFa2MOQyFWTFjbA==" - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" - }, - "SimpleInfoName": { - "type": "Transitive", - "resolved": "3.1.2", - "contentHash": "/OoEZQxSW6DeTJ9nfrg8BLCOCWpxBiWHV4NkG3t+Xpe8tvzm7yCwKwxkhpauMl3fg9OjlIjJMKX61H6VavLkrw==" - }, - "System.CodeDom": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "WTlRjL6KWIMr/pAaq3rYqh0TJlzpouaQ/W1eelssHgtlwHAH25jXTkUphTYx9HaIIf7XA6qs/0+YhtLEQRkJ+Q==" - }, - "System.Management": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "jrK22i5LRzxZCfGb+tGmke2VH7oE0DvcDlJ1HAKYU8cPmD8XnpUT0bYn2Gy98GEhGjtfbR/sxKTVb+dE770pfA==", - "dependencies": { - "System.CodeDom": "8.0.0" - } - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "Verify": { - "type": "Transitive", - "resolved": "30.13.0", - "contentHash": "0jl/QBoo5xIL4LYd5g46R+b1oE2ZSiOCe5AXfbBz1w4kP8jJPv4LWYxq62L5Op60K4pGC4b13Y1yc3cq7GFXng==", - "dependencies": { - "Argon": "0.32.0", - "DiffEngine": "16.4.1", - "SimpleInfoName": "3.1.2" - } - }, - "xunit.abstractions": { - "type": "Transitive", - "resolved": "2.0.3", - "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" - }, - "xunit.analyzers": { - "type": "Transitive", - "resolved": "1.18.0", - "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" - }, - "xunit.assert": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" - }, - "xunit.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]", - "xunit.extensibility.execution": "[2.9.3]" - } - }, - "xunit.extensibility.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", - "dependencies": { - "xunit.abstractions": "2.0.3" - } - }, - "xunit.extensibility.execution": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]" - } - } - } - } -} \ No newline at end of file diff --git a/Tests/AssemblyA/packages.lock.json b/Tests/AssemblyA/packages.lock.json deleted file mode 100644 index 8b52531bde..0000000000 --- a/Tests/AssemblyA/packages.lock.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": 1, - "dependencies": { - ".NETStandard,Version=v2.0": { - "NETStandard.Library": { - "type": "Direct", - "requested": "[2.0.3, )", - "resolved": "2.0.3", - "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0" - } - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" - }, - "assemblyb": { - "type": "Project" - } - } - } -} \ No newline at end of file diff --git a/Tests/AssemblyB/packages.lock.json b/Tests/AssemblyB/packages.lock.json deleted file mode 100644 index b7e843ee28..0000000000 --- a/Tests/AssemblyB/packages.lock.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "dependencies": { - ".NETStandard,Version=v2.0": { - "NETStandard.Library": { - "type": "Direct", - "requested": "[2.0.3, )", - "resolved": "2.0.3", - "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0" - } - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" - } - } - } -} \ No newline at end of file diff --git a/Tests/Benchmarks/packages.lock.json b/Tests/Benchmarks/packages.lock.json deleted file mode 100644 index ac649aba0e..0000000000 --- a/Tests/Benchmarks/packages.lock.json +++ /dev/null @@ -1,673 +0,0 @@ -{ - "version": 1, - "dependencies": { - ".NETFramework,Version=v4.7.2": { - "BenchmarkDotNet": { - "type": "Direct", - "requested": "[0.15.2, )", - "resolved": "0.15.2", - "contentHash": "5vl4nQFUGTKgOVE5LNoLpv/X/wFQ7wE5yiaJAXCpzgNtUADtfEwbuufKI4o5E2De0VTXNEeom5Hnv8S8vuBZtg==", - "dependencies": { - "BenchmarkDotNet.Annotations": "0.15.2", - "CommandLineParser": "2.9.1", - "Gee.External.Capstone": "2.3.0", - "Iced": "1.21.0", - "Microsoft.CodeAnalysis.CSharp": "4.14.0", - "Microsoft.Diagnostics.Runtime": "3.1.512801", - "Microsoft.Diagnostics.Tracing.TraceEvent": "3.1.21", - "Microsoft.DotNet.PlatformAbstractions": "3.1.6", - "Microsoft.Win32.Registry": "5.0.0", - "Perfolizer": "[0.5.3]", - "System.Management": "9.0.5", - "System.Numerics.Vectors": "4.5.0", - "System.Reflection.Emit": "4.7.0", - "System.Reflection.Emit.Lightweight": "4.7.0", - "System.Threading.Tasks.Extensions": "4.6.3" - } - }, - "System.Reflection.Metadata": { - "type": "Direct", - "requested": "[9.0.2, )", - "resolved": "9.0.2", - "contentHash": "O8jVwZjj9gd4bmqRP1wpe8myBwQ/a99fn2f6hMfBkgXTTOUQQuDcK0zNgyOAqPX+nPFufQUCl7XxrZxaMtZ/xg==", - "dependencies": { - "System.Collections.Immutable": "9.0.2", - "System.Memory": "4.5.5" - } - }, - "BenchmarkDotNet.Annotations": { - "type": "Transitive", - "resolved": "0.15.2", - "contentHash": "a7rVlVmXQRrp3J+HF/FtjwiFcshU6BAuv6U1xtAbqCUYepOEnNGaPeOFvy4It17QZwwofm6U/GAfW3JrFMXszg==" - }, - "CommandLineParser": { - "type": "Transitive", - "resolved": "2.9.1", - "contentHash": "OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==" - }, - "Gee.External.Capstone": { - "type": "Transitive", - "resolved": "2.3.0", - "contentHash": "2ap/rYmjtzCOT8hxrnEW/QeiOt+paD8iRrIcdKX0cxVwWLFa1e+JDBNeECakmccXrSFeBQuu5AV8SNkipFMMMw==" - }, - "Iced": { - "type": "Transitive", - "resolved": "1.21.0", - "contentHash": "dv5+81Q1TBQvVMSOOOmRcjJmvWcX3BZPZsIq31+RLc5cNft0IHAyNlkdb7ZarOWG913PyBoFDsDXoCIlKmLclg==" - }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "3WA9q9yVqJp222P3x1wYIGDAkpjAku0TMUaaQV22g6L67AI0LdOIrVS7Ht2vJfLHGSPVuqN94vIr15qn+HEkHw==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Microsoft.CodeAnalysis.Analyzers": { - "type": "Transitive", - "resolved": "3.11.0", - "contentHash": "v/EW3UE8/lbEYHoC2Qq7AR/DnmvpgdtAMndfQNmpuIMx/Mto8L5JnuCfdBYtgvalQOtfNCnxFejxuRrryvUTsg==" - }, - "Microsoft.CodeAnalysis.Common": { - "type": "Transitive", - "resolved": "4.14.0", - "contentHash": "PC3tuwZYnC+idaPuoC/AZpEdwrtX7qFpmnrfQkgobGIWiYmGi5MCRtl5mx6QrfMGQpK78X2lfIEoZDLg/qnuHg==", - "dependencies": { - "Microsoft.CodeAnalysis.Analyzers": "3.11.0", - "System.Buffers": "4.5.1", - "System.Collections.Immutable": "9.0.0", - "System.Memory": "4.5.5", - "System.Numerics.Vectors": "4.5.0", - "System.Reflection.Metadata": "9.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encoding.CodePages": "7.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Microsoft.CodeAnalysis.CSharp": { - "type": "Transitive", - "resolved": "4.14.0", - "contentHash": "568a6wcTivauIhbeWcCwfWwIn7UV7MeHEBvFB2uzGIpM2OhJ4eM/FZ8KS0yhPoNxnSpjGzz7x7CIjTxhslojQA==", - "dependencies": { - "Microsoft.CodeAnalysis.Analyzers": "3.11.0", - "Microsoft.CodeAnalysis.Common": "[4.14.0]", - "System.Buffers": "4.5.1", - "System.Collections.Immutable": "9.0.0", - "System.Memory": "4.5.5", - "System.Numerics.Vectors": "4.5.0", - "System.Reflection.Metadata": "9.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encoding.CodePages": "7.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Microsoft.Diagnostics.NETCore.Client": { - "type": "Transitive", - "resolved": "0.2.510501", - "contentHash": "juoqJYMDs+lRrrZyOkXXMImJHneCF23cuvO4waFRd2Ds7j+ZuGIPbJm0Y/zz34BdeaGiiwGWraMUlln05W1PCQ==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "6.0.0", - "Microsoft.Extensions.Logging": "6.0.0", - "System.Buffers": "4.5.1" - } - }, - "Microsoft.Diagnostics.Runtime": { - "type": "Transitive", - "resolved": "3.1.512801", - "contentHash": "0lMUDr2oxNZa28D6NH5BuSQEe5T9tZziIkvkD44YkkCGQXPJqvFjLq5ZQq1hYLl3RjQJrY+hR0jFgap+EWPDTw==", - "dependencies": { - "Microsoft.Diagnostics.NETCore.Client": "0.2.410101", - "System.Collections.Immutable": "6.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "Microsoft.Diagnostics.Tracing.TraceEvent": { - "type": "Transitive", - "resolved": "3.1.21", - "contentHash": "/OrJFKaojSR6TkUKtwh8/qA9XWNtxLrXMqvEb89dBSKCWjaGVTbKMYodIUgF5deCEtmd6GXuRerciXGl5bhZ7Q==", - "dependencies": { - "Microsoft.Diagnostics.NETCore.Client": "0.2.510501", - "Microsoft.Win32.Registry": "5.0.0", - "System.Collections.Immutable": "8.0.0", - "System.Reflection.Metadata": "8.0.0", - "System.Reflection.TypeExtensions": "4.7.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Json": "8.0.5" - } - }, - "Microsoft.DotNet.PlatformAbstractions": { - "type": "Transitive", - "resolved": "3.1.6", - "contentHash": "jek4XYaQ/PGUwDKKhwR8K47Uh1189PFzMeLqO83mXrXQVIpARZCcfuDedH50YDTepBkfijCZN5U/vZi++erxtg==", - "dependencies": { - "System.Runtime.InteropServices.RuntimeInformation": "4.0.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "6.0.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "6.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Microsoft.Extensions.Logging": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "eIbyj40QDg1NDz0HBW0S5f3wrLVnKWnDJ/JtZ+yJDFnDj90VoPuoPmFkeaXrtu+0cKm5GRAwoDf+dBWXK0TUdg==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "6.0.0", - "Microsoft.Extensions.DependencyInjection": "6.0.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.0", - "Microsoft.Extensions.Options": "6.0.0", - "System.Diagnostics.DiagnosticSource": "6.0.0", - "System.ValueTuple": "4.5.0" - } - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.4" - } - }, - "Microsoft.Extensions.Options": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "dzXN0+V1AyjOe2xcJ86Qbo233KHuLEY0njf/P2Kw8SfJU+d45HNS2ctJdnEnrWbM9Ye2eFgaC5Mj9otRMU6IsQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "Microsoft.Extensions.Primitives": "6.0.0" - } - }, - "Microsoft.Extensions.Primitives": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==", - "dependencies": { - "System.Memory": "4.5.4", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "Perfolizer": { - "type": "Transitive", - "resolved": "0.5.3", - "contentHash": "EhHo0s4y+tHJKhZHgQvPgFWhAhnQpHHuFzutRzfqfv5z763wvhzXh849ZtpVePQNxXWoFafh1Ta2tZgnSIVsYQ==", - "dependencies": { - "System.Memory": "4.5.5" - } - }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" - }, - "System.CodeDom": { - "type": "Transitive", - "resolved": "9.0.5", - "contentHash": "cuzLM2MWutf9ZBEMPYYfd0DXwYdvntp7VCT6a/wvbKCa2ZuvGmW74xi+YBa2mrfEieAXqM4TNKlMmSnfAfpUoQ==" - }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "9.0.2", - "contentHash": "QKh9+kczG7TQbQZ6tF2S6bK9B8ewHXEkYmMP2iqefzwJEfEkiflheAX6VEaPLJ6Tq9RoKuQ5R3qPYla6wJ6Opg==", - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Diagnostics.DiagnosticSource": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "frQDfv0rl209cKm1lnwTgFPzNigy2EKk1BS3uAvHvlBVKe5cymGyHO+Sj+NLv5VF/AhHsqPIUUwya5oV4CHMUw==", - "dependencies": { - "System.Memory": "4.5.4", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Management": { - "type": "Transitive", - "resolved": "9.0.5", - "contentHash": "n6o9PZm9p25+zAzC3/48K0oHnaPKTInRrxqFq1fi/5TPbMLjuoCm/h//mS3cUmSy+9AO1Z+qsC/Ilt/ZFatv5Q==", - "dependencies": { - "System.CodeDom": "9.0.5" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.5", - "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "System.Numerics.Vectors": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" - }, - "System.Reflection.Emit": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "VR4kk8XLKebQ4MZuKuIni/7oh+QGFmZW3qORd1GvBq/8026OpW501SzT/oypwiQl4TvT8ErnReh/NzY9u+C6wQ==" - }, - "System.Reflection.Emit.Lightweight": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "a4OLB4IITxAXJeV74MDx49Oq2+PsF6Sml54XAFv+2RyWwtDBcabzoxiiJRhdhx+gaohLh4hEGCLQyBozXoQPqA==" - }, - "System.Reflection.TypeExtensions": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "VybpaOQQhqE6siHppMktjfGBw1GCwvCqiufqmP8F1nj7fTUNtW35LOEt3UZTEsECfo+ELAl/9o9nJx3U91i7vA==" - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "6.1.2", - "contentHash": "2hBr6zdbIBTDE3EhK7NSVNdX58uTK6iHW/P/Axmm9sl1xoGSLqDvMtpecn226TNwHByFokYwJmt/aQQNlO5CRw==" - }, - "System.Runtime.InteropServices.RuntimeInformation": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "hWPhJxc453RCa8Z29O91EmfGeZIHX1ZH2A8L6lYQVSaKzku2DfArSfMEb1/MYYzPQRJZeu0c9dmYeJKxW5Fgng==" - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", - "dependencies": { - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" - }, - "System.Text.Encoding.CodePages": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ==", - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "8.0.5", - "contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "8.0.0", - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encodings.Web": "8.0.0", - "System.Threading.Tasks.Extensions": "4.5.4", - "System.ValueTuple": "4.5.0" - } - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.6.3", - "contentHash": "7sCiwilJLYbTZELaKnc7RecBBXWXA+xMLQWZKWawBxYjp6DBlSE3v9/UcvKBvr1vv2tTOhipiogM8rRmxlhrVA==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.1.2" - } - }, - "System.ValueTuple": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ==" - }, - "fluentassertions": { - "type": "Project", - "dependencies": { - "System.Threading.Tasks.Extensions": "[4.5.4, )" - } - } - }, - ".NETFramework,Version=v4.7.2/win-x86": { - "Gee.External.Capstone": { - "type": "Transitive", - "resolved": "2.3.0", - "contentHash": "2ap/rYmjtzCOT8hxrnEW/QeiOt+paD8iRrIcdKX0cxVwWLFa1e+JDBNeECakmccXrSFeBQuu5AV8SNkipFMMMw==" - }, - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Runtime.InteropServices.RuntimeInformation": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "hWPhJxc453RCa8Z29O91EmfGeZIHX1ZH2A8L6lYQVSaKzku2DfArSfMEb1/MYYzPQRJZeu0c9dmYeJKxW5Fgng==" - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", - "dependencies": { - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" - } - }, - "net8.0": { - "BenchmarkDotNet": { - "type": "Direct", - "requested": "[0.15.2, )", - "resolved": "0.15.2", - "contentHash": "5vl4nQFUGTKgOVE5LNoLpv/X/wFQ7wE5yiaJAXCpzgNtUADtfEwbuufKI4o5E2De0VTXNEeom5Hnv8S8vuBZtg==", - "dependencies": { - "BenchmarkDotNet.Annotations": "0.15.2", - "CommandLineParser": "2.9.1", - "Gee.External.Capstone": "2.3.0", - "Iced": "1.21.0", - "Microsoft.CodeAnalysis.CSharp": "4.14.0", - "Microsoft.Diagnostics.Runtime": "3.1.512801", - "Microsoft.Diagnostics.Tracing.TraceEvent": "3.1.21", - "Microsoft.DotNet.PlatformAbstractions": "3.1.6", - "Perfolizer": "[0.5.3]", - "System.Management": "9.0.5" - } - }, - "BenchmarkDotNet.Annotations": { - "type": "Transitive", - "resolved": "0.15.2", - "contentHash": "a7rVlVmXQRrp3J+HF/FtjwiFcshU6BAuv6U1xtAbqCUYepOEnNGaPeOFvy4It17QZwwofm6U/GAfW3JrFMXszg==" - }, - "CommandLineParser": { - "type": "Transitive", - "resolved": "2.9.1", - "contentHash": "OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==" - }, - "Gee.External.Capstone": { - "type": "Transitive", - "resolved": "2.3.0", - "contentHash": "2ap/rYmjtzCOT8hxrnEW/QeiOt+paD8iRrIcdKX0cxVwWLFa1e+JDBNeECakmccXrSFeBQuu5AV8SNkipFMMMw==" - }, - "Iced": { - "type": "Transitive", - "resolved": "1.21.0", - "contentHash": "dv5+81Q1TBQvVMSOOOmRcjJmvWcX3BZPZsIq31+RLc5cNft0IHAyNlkdb7ZarOWG913PyBoFDsDXoCIlKmLclg==" - }, - "Microsoft.CodeAnalysis.Analyzers": { - "type": "Transitive", - "resolved": "3.11.0", - "contentHash": "v/EW3UE8/lbEYHoC2Qq7AR/DnmvpgdtAMndfQNmpuIMx/Mto8L5JnuCfdBYtgvalQOtfNCnxFejxuRrryvUTsg==" - }, - "Microsoft.CodeAnalysis.Common": { - "type": "Transitive", - "resolved": "4.14.0", - "contentHash": "PC3tuwZYnC+idaPuoC/AZpEdwrtX7qFpmnrfQkgobGIWiYmGi5MCRtl5mx6QrfMGQpK78X2lfIEoZDLg/qnuHg==", - "dependencies": { - "Microsoft.CodeAnalysis.Analyzers": "3.11.0", - "System.Collections.Immutable": "9.0.0", - "System.Reflection.Metadata": "9.0.0" - } - }, - "Microsoft.CodeAnalysis.CSharp": { - "type": "Transitive", - "resolved": "4.14.0", - "contentHash": "568a6wcTivauIhbeWcCwfWwIn7UV7MeHEBvFB2uzGIpM2OhJ4eM/FZ8KS0yhPoNxnSpjGzz7x7CIjTxhslojQA==", - "dependencies": { - "Microsoft.CodeAnalysis.Analyzers": "3.11.0", - "Microsoft.CodeAnalysis.Common": "[4.14.0]", - "System.Collections.Immutable": "9.0.0", - "System.Reflection.Metadata": "9.0.0" - } - }, - "Microsoft.Diagnostics.NETCore.Client": { - "type": "Transitive", - "resolved": "0.2.510501", - "contentHash": "juoqJYMDs+lRrrZyOkXXMImJHneCF23cuvO4waFRd2Ds7j+ZuGIPbJm0Y/zz34BdeaGiiwGWraMUlln05W1PCQ==", - "dependencies": { - "Microsoft.Extensions.Logging": "6.0.0" - } - }, - "Microsoft.Diagnostics.Runtime": { - "type": "Transitive", - "resolved": "3.1.512801", - "contentHash": "0lMUDr2oxNZa28D6NH5BuSQEe5T9tZziIkvkD44YkkCGQXPJqvFjLq5ZQq1hYLl3RjQJrY+hR0jFgap+EWPDTw==", - "dependencies": { - "Microsoft.Diagnostics.NETCore.Client": "0.2.410101" - } - }, - "Microsoft.Diagnostics.Tracing.TraceEvent": { - "type": "Transitive", - "resolved": "3.1.21", - "contentHash": "/OrJFKaojSR6TkUKtwh8/qA9XWNtxLrXMqvEb89dBSKCWjaGVTbKMYodIUgF5deCEtmd6GXuRerciXGl5bhZ7Q==", - "dependencies": { - "Microsoft.Diagnostics.NETCore.Client": "0.2.510501", - "Microsoft.Win32.Registry": "5.0.0", - "System.Collections.Immutable": "8.0.0", - "System.Reflection.Metadata": "8.0.0", - "System.Reflection.TypeExtensions": "4.7.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Json": "8.0.5" - } - }, - "Microsoft.DotNet.PlatformAbstractions": { - "type": "Transitive", - "resolved": "3.1.6", - "contentHash": "jek4XYaQ/PGUwDKKhwR8K47Uh1189PFzMeLqO83mXrXQVIpARZCcfuDedH50YDTepBkfijCZN5U/vZi++erxtg==" - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg==" - }, - "Microsoft.Extensions.Logging": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "eIbyj40QDg1NDz0HBW0S5f3wrLVnKWnDJ/JtZ+yJDFnDj90VoPuoPmFkeaXrtu+0cKm5GRAwoDf+dBWXK0TUdg==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection": "6.0.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.0", - "Microsoft.Extensions.Options": "6.0.0", - "System.Diagnostics.DiagnosticSource": "6.0.0" - } - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA==" - }, - "Microsoft.Extensions.Options": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "dzXN0+V1AyjOe2xcJ86Qbo233KHuLEY0njf/P2Kw8SfJU+d45HNS2ctJdnEnrWbM9Ye2eFgaC5Mj9otRMU6IsQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "Microsoft.Extensions.Primitives": "6.0.0" - } - }, - "Microsoft.Extensions.Primitives": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==" - }, - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "Perfolizer": { - "type": "Transitive", - "resolved": "0.5.3", - "contentHash": "EhHo0s4y+tHJKhZHgQvPgFWhAhnQpHHuFzutRzfqfv5z763wvhzXh849ZtpVePQNxXWoFafh1Ta2tZgnSIVsYQ==" - }, - "System.CodeDom": { - "type": "Transitive", - "resolved": "9.0.5", - "contentHash": "cuzLM2MWutf9ZBEMPYYfd0DXwYdvntp7VCT6a/wvbKCa2ZuvGmW74xi+YBa2mrfEieAXqM4TNKlMmSnfAfpUoQ==" - }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "9.0.0", - "contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==" - }, - "System.Diagnostics.DiagnosticSource": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "frQDfv0rl209cKm1lnwTgFPzNigy2EKk1BS3uAvHvlBVKe5cymGyHO+Sj+NLv5VF/AhHsqPIUUwya5oV4CHMUw==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Management": { - "type": "Transitive", - "resolved": "9.0.5", - "contentHash": "n6o9PZm9p25+zAzC3/48K0oHnaPKTInRrxqFq1fi/5TPbMLjuoCm/h//mS3cUmSy+9AO1Z+qsC/Ilt/ZFatv5Q==", - "dependencies": { - "System.CodeDom": "9.0.5" - } - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "9.0.0", - "contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==", - "dependencies": { - "System.Collections.Immutable": "9.0.0" - } - }, - "System.Reflection.TypeExtensions": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "VybpaOQQhqE6siHppMktjfGBw1GCwvCqiufqmP8F1nj7fTUNtW35LOEt3UZTEsECfo+ELAl/9o9nJx3U91i7vA==" - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" - }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "8.0.5", - "contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg==" - }, - "fluentassertions": { - "type": "Project" - } - }, - "net8.0/win-x86": { - "Gee.External.Capstone": { - "type": "Transitive", - "resolved": "2.3.0", - "contentHash": "2ap/rYmjtzCOT8hxrnEW/QeiOt+paD8iRrIcdKX0cxVwWLFa1e+JDBNeECakmccXrSFeBQuu5AV8SNkipFMMMw==" - }, - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Management": { - "type": "Transitive", - "resolved": "9.0.5", - "contentHash": "n6o9PZm9p25+zAzC3/48K0oHnaPKTInRrxqFq1fi/5TPbMLjuoCm/h//mS3cUmSy+9AO1Z+qsC/Ilt/ZFatv5Q==", - "dependencies": { - "System.CodeDom": "9.0.5" - } - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" - } - } - } -} \ No newline at end of file diff --git a/Tests/ExampleExtensions/packages.lock.json b/Tests/ExampleExtensions/packages.lock.json deleted file mode 100644 index 0e60912930..0000000000 --- a/Tests/ExampleExtensions/packages.lock.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "version": 1, - "dependencies": { - ".NETStandard,Version=v2.0": { - "NETStandard.Library": { - "type": "Direct", - "requested": "[2.0.3, )", - "resolved": "2.0.3", - "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0" - } - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "fluentassertions": { - "type": "Project", - "dependencies": { - "System.Threading.Tasks.Extensions": "[4.5.4, )" - } - } - } - } -} \ No newline at end of file diff --git a/Tests/FSharp.Specs/packages.lock.json b/Tests/FSharp.Specs/packages.lock.json deleted file mode 100644 index 6f79c0c18f..0000000000 --- a/Tests/FSharp.Specs/packages.lock.json +++ /dev/null @@ -1,159 +0,0 @@ -{ - "version": 1, - "dependencies": { - "net6.0": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "CSharpGuidelinesAnalyzer": { - "type": "Direct", - "requested": "[3.8.5, )", - "resolved": "3.8.5", - "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" - }, - "FSharp.Core": { - "type": "Direct", - "requested": "[9.0.303, )", - "resolved": "9.0.303", - "contentHash": "6JlV8aD8qQvcmfoe/PMOxCHXc0uX4lR23u0fAyQtnVQxYULLoTZgwgZHSnRcuUHOvS3wULFWcwdnP1iwslH60g==" - }, - "Meziantou.Analyzer": { - "type": "Direct", - "requested": "[2.0.219, )", - "resolved": "2.0.219", - "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" - }, - "Microsoft.CodeAnalysis.BannedApiAnalyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0", - "Microsoft.TestPlatform.TestHost": "17.13.0" - } - }, - "Roslynator.Analyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" - }, - "StyleCop.Analyzers": { - "type": "Direct", - "requested": "[1.2.0-beta.556, )", - "resolved": "1.2.0-beta.556", - "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", - "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.556" - } - }, - "xunit": { - "type": "Direct", - "requested": "[2.9.3, )", - "resolved": "2.9.3", - "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", - "dependencies": { - "xunit.analyzers": "1.18.0", - "xunit.assert": "2.9.3", - "xunit.core": "[2.9.3]" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[3.0.0, )", - "resolved": "3.0.0", - "contentHash": "HggUqjQJe8PtDxcP25Q+CnR6Lz4oX3GElhD9V4oU2+75x9HI6A6sxbfKGS4UwU4t4yJaS9fBmAuriz8bQApNjw==" - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Newtonsoft.Json": "13.0.1" - } - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" - }, - "StyleCop.Analyzers.Unstable": { - "type": "Transitive", - "resolved": "1.2.0.556", - "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "xunit.abstractions": { - "type": "Transitive", - "resolved": "2.0.3", - "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" - }, - "xunit.analyzers": { - "type": "Transitive", - "resolved": "1.18.0", - "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" - }, - "xunit.assert": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" - }, - "xunit.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]", - "xunit.extensibility.execution": "[2.9.3]" - } - }, - "xunit.extensibility.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", - "dependencies": { - "xunit.abstractions": "2.0.3" - } - }, - "xunit.extensibility.execution": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]" - } - }, - "fluentassertions": { - "type": "Project" - } - } - } -} \ No newline at end of file diff --git a/Tests/FluentAssertions.Equivalency.Specs/packages.lock.json b/Tests/FluentAssertions.Equivalency.Specs/packages.lock.json deleted file mode 100644 index 3b4e633db6..0000000000 --- a/Tests/FluentAssertions.Equivalency.Specs/packages.lock.json +++ /dev/null @@ -1,425 +0,0 @@ -{ - "version": 1, - "dependencies": { - ".NETFramework,Version=v4.7": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "JetBrains.Annotations": { - "type": "Direct", - "requested": "[2024.3.0, )", - "resolved": "2024.3.0", - "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" - }, - "Newtonsoft.Json": { - "type": "Direct", - "requested": "[13.0.3, )", - "resolved": "13.0.3", - "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" - }, - "System.Collections.Immutable": { - "type": "Direct", - "requested": "[1.5.0, 1.5.0]", - "resolved": "1.5.0", - "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" - }, - "xunit": { - "type": "Direct", - "requested": "[2.9.3, )", - "resolved": "2.9.3", - "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", - "dependencies": { - "xunit.analyzers": "1.18.0", - "xunit.assert": "2.9.3", - "xunit.core": "[2.9.3]" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[2.8.2, )", - "resolved": "2.8.2", - "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.10.0" - } - }, - "Xunit.StaFact": { - "type": "Direct", - "requested": "[1.2.69, )", - "resolved": "1.2.69", - "contentHash": "DQl0Fzz+6jIoShxBK8jQkoh8Fy6AQ++ldJuFRjiLHVbazisMhHHDTGMPyAmB0Eups9tBCJ9GgFvHmalRR9UfXQ==", - "dependencies": { - "xunit.extensibility.execution": "2.4.2" - } - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.10.0", - "contentHash": "KkwhjQevuDj0aBRoPLY6OLAhGqbPUEBuKLbaCs0kUVw29qiOYncdORd4mLVJbn9vGZ7/iFGQ/+AoJl0Tu5Umdg==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==", - "dependencies": { - "System.Collections.Immutable": "1.5.0" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "xunit.abstractions": { - "type": "Transitive", - "resolved": "2.0.3", - "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" - }, - "xunit.analyzers": { - "type": "Transitive", - "resolved": "1.18.0", - "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" - }, - "xunit.assert": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" - }, - "xunit.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]", - "xunit.extensibility.execution": "[2.9.3]" - } - }, - "xunit.extensibility.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", - "dependencies": { - "xunit.abstractions": "2.0.3" - } - }, - "xunit.extensibility.execution": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]" - } - }, - "fluentassertions": { - "type": "Project", - "dependencies": { - "System.Threading.Tasks.Extensions": "[4.5.4, )" - } - } - }, - "net6.0": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "CSharpGuidelinesAnalyzer": { - "type": "Direct", - "requested": "[3.8.5, )", - "resolved": "3.8.5", - "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" - }, - "JetBrains.Annotations": { - "type": "Direct", - "requested": "[2024.3.0, )", - "resolved": "2024.3.0", - "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" - }, - "Meziantou.Analyzer": { - "type": "Direct", - "requested": "[2.0.219, )", - "resolved": "2.0.219", - "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" - }, - "Microsoft.CodeAnalysis.BannedApiAnalyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0", - "Microsoft.TestPlatform.TestHost": "17.13.0" - } - }, - "Newtonsoft.Json": { - "type": "Direct", - "requested": "[13.0.3, )", - "resolved": "13.0.3", - "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" - }, - "Roslynator.Analyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" - }, - "StyleCop.Analyzers": { - "type": "Direct", - "requested": "[1.2.0-beta.556, )", - "resolved": "1.2.0-beta.556", - "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", - "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.556" - } - }, - "xunit": { - "type": "Direct", - "requested": "[2.9.3, )", - "resolved": "2.9.3", - "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", - "dependencies": { - "xunit.analyzers": "1.18.0", - "xunit.assert": "2.9.3", - "xunit.core": "[2.9.3]" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[2.8.2, )", - "resolved": "2.8.2", - "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" - }, - "Xunit.StaFact": { - "type": "Direct", - "requested": "[1.2.69, )", - "resolved": "1.2.69", - "contentHash": "DQl0Fzz+6jIoShxBK8jQkoh8Fy6AQ++ldJuFRjiLHVbazisMhHHDTGMPyAmB0Eups9tBCJ9GgFvHmalRR9UfXQ==", - "dependencies": { - "xunit.extensibility.execution": "2.4.2" - } - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Newtonsoft.Json": "13.0.1" - } - }, - "StyleCop.Analyzers.Unstable": { - "type": "Transitive", - "resolved": "1.2.0.556", - "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "xunit.abstractions": { - "type": "Transitive", - "resolved": "2.0.3", - "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" - }, - "xunit.analyzers": { - "type": "Transitive", - "resolved": "1.18.0", - "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" - }, - "xunit.assert": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" - }, - "xunit.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]", - "xunit.extensibility.execution": "[2.9.3]" - } - }, - "xunit.extensibility.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", - "dependencies": { - "xunit.abstractions": "2.0.3" - } - }, - "xunit.extensibility.execution": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]" - } - }, - "fluentassertions": { - "type": "Project" - } - }, - "net8.0": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "JetBrains.Annotations": { - "type": "Direct", - "requested": "[2024.3.0, )", - "resolved": "2024.3.0", - "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0", - "Microsoft.TestPlatform.TestHost": "17.13.0" - } - }, - "Newtonsoft.Json": { - "type": "Direct", - "requested": "[13.0.3, )", - "resolved": "13.0.3", - "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" - }, - "xunit": { - "type": "Direct", - "requested": "[2.9.3, )", - "resolved": "2.9.3", - "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", - "dependencies": { - "xunit.analyzers": "1.18.0", - "xunit.assert": "2.9.3", - "xunit.core": "[2.9.3]" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[2.8.2, )", - "resolved": "2.8.2", - "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" - }, - "Xunit.StaFact": { - "type": "Direct", - "requested": "[1.2.69, )", - "resolved": "1.2.69", - "contentHash": "DQl0Fzz+6jIoShxBK8jQkoh8Fy6AQ++ldJuFRjiLHVbazisMhHHDTGMPyAmB0Eups9tBCJ9GgFvHmalRR9UfXQ==", - "dependencies": { - "xunit.extensibility.execution": "2.4.2" - } - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Newtonsoft.Json": "13.0.1" - } - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "xunit.abstractions": { - "type": "Transitive", - "resolved": "2.0.3", - "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" - }, - "xunit.analyzers": { - "type": "Transitive", - "resolved": "1.18.0", - "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" - }, - "xunit.assert": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" - }, - "xunit.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]", - "xunit.extensibility.execution": "[2.9.3]" - } - }, - "xunit.extensibility.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", - "dependencies": { - "xunit.abstractions": "2.0.3" - } - }, - "xunit.extensibility.execution": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]" - } - }, - "fluentassertions": { - "type": "Project" - } - } - } -} \ No newline at end of file diff --git a/Tests/FluentAssertions.Extensibility.Specs/packages.lock.json b/Tests/FluentAssertions.Extensibility.Specs/packages.lock.json deleted file mode 100644 index f7e54f6bbe..0000000000 --- a/Tests/FluentAssertions.Extensibility.Specs/packages.lock.json +++ /dev/null @@ -1,389 +0,0 @@ -{ - "version": 1, - "dependencies": { - ".NETFramework,Version=v4.7": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "PolySharp": { - "type": "Direct", - "requested": "[1.15.0, )", - "resolved": "1.15.0", - "contentHash": "FbU0El+EEjdpuIX4iDbeS7ki1uzpJPx8vbqOzEtqnl1GZeAGJfq+jCbxeJL2y0EPnUNk8dRnnqR2xnYXg9Tf+g==" - }, - "xunit": { - "type": "Direct", - "requested": "[2.9.3, )", - "resolved": "2.9.3", - "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", - "dependencies": { - "xunit.analyzers": "1.18.0", - "xunit.assert": "2.9.3", - "xunit.core": "[2.9.3]" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[2.8.2, )", - "resolved": "2.8.2", - "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.10.0" - } - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.10.0", - "contentHash": "KkwhjQevuDj0aBRoPLY6OLAhGqbPUEBuKLbaCs0kUVw29qiOYncdORd4mLVJbn9vGZ7/iFGQ/+AoJl0Tu5Umdg==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "1.5.0", - "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==", - "dependencies": { - "System.Collections.Immutable": "1.5.0" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "xunit.abstractions": { - "type": "Transitive", - "resolved": "2.0.3", - "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" - }, - "xunit.analyzers": { - "type": "Transitive", - "resolved": "1.18.0", - "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" - }, - "xunit.assert": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" - }, - "xunit.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]", - "xunit.extensibility.execution": "[2.9.3]" - } - }, - "xunit.extensibility.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", - "dependencies": { - "xunit.abstractions": "2.0.3" - } - }, - "xunit.extensibility.execution": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]" - } - }, - "fluentassertions": { - "type": "Project", - "dependencies": { - "System.Threading.Tasks.Extensions": "[4.5.4, )" - } - } - }, - "net6.0": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "CSharpGuidelinesAnalyzer": { - "type": "Direct", - "requested": "[3.8.5, )", - "resolved": "3.8.5", - "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" - }, - "Meziantou.Analyzer": { - "type": "Direct", - "requested": "[2.0.219, )", - "resolved": "2.0.219", - "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" - }, - "Microsoft.CodeAnalysis.BannedApiAnalyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0", - "Microsoft.TestPlatform.TestHost": "17.13.0" - } - }, - "PolySharp": { - "type": "Direct", - "requested": "[1.15.0, )", - "resolved": "1.15.0", - "contentHash": "FbU0El+EEjdpuIX4iDbeS7ki1uzpJPx8vbqOzEtqnl1GZeAGJfq+jCbxeJL2y0EPnUNk8dRnnqR2xnYXg9Tf+g==" - }, - "Roslynator.Analyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" - }, - "StyleCop.Analyzers": { - "type": "Direct", - "requested": "[1.2.0-beta.556, )", - "resolved": "1.2.0-beta.556", - "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", - "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.556" - } - }, - "xunit": { - "type": "Direct", - "requested": "[2.9.3, )", - "resolved": "2.9.3", - "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", - "dependencies": { - "xunit.analyzers": "1.18.0", - "xunit.assert": "2.9.3", - "xunit.core": "[2.9.3]" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[2.8.2, )", - "resolved": "2.8.2", - "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Newtonsoft.Json": "13.0.1" - } - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" - }, - "StyleCop.Analyzers.Unstable": { - "type": "Transitive", - "resolved": "1.2.0.556", - "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "xunit.abstractions": { - "type": "Transitive", - "resolved": "2.0.3", - "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" - }, - "xunit.analyzers": { - "type": "Transitive", - "resolved": "1.18.0", - "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" - }, - "xunit.assert": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" - }, - "xunit.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]", - "xunit.extensibility.execution": "[2.9.3]" - } - }, - "xunit.extensibility.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", - "dependencies": { - "xunit.abstractions": "2.0.3" - } - }, - "xunit.extensibility.execution": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]" - } - }, - "fluentassertions": { - "type": "Project" - } - }, - "net8.0": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0", - "Microsoft.TestPlatform.TestHost": "17.13.0" - } - }, - "PolySharp": { - "type": "Direct", - "requested": "[1.15.0, )", - "resolved": "1.15.0", - "contentHash": "FbU0El+EEjdpuIX4iDbeS7ki1uzpJPx8vbqOzEtqnl1GZeAGJfq+jCbxeJL2y0EPnUNk8dRnnqR2xnYXg9Tf+g==" - }, - "xunit": { - "type": "Direct", - "requested": "[2.9.3, )", - "resolved": "2.9.3", - "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", - "dependencies": { - "xunit.analyzers": "1.18.0", - "xunit.assert": "2.9.3", - "xunit.core": "[2.9.3]" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[2.8.2, )", - "resolved": "2.8.2", - "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Newtonsoft.Json": "13.0.1" - } - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "xunit.abstractions": { - "type": "Transitive", - "resolved": "2.0.3", - "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" - }, - "xunit.analyzers": { - "type": "Transitive", - "resolved": "1.18.0", - "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" - }, - "xunit.assert": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" - }, - "xunit.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]", - "xunit.extensibility.execution": "[2.9.3]" - } - }, - "xunit.extensibility.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", - "dependencies": { - "xunit.abstractions": "2.0.3" - } - }, - "xunit.extensibility.execution": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]" - } - }, - "fluentassertions": { - "type": "Project" - } - } - } -} \ No newline at end of file diff --git a/Tests/FluentAssertions.Specs/packages.lock.json b/Tests/FluentAssertions.Specs/packages.lock.json deleted file mode 100644 index 1989f648c3..0000000000 --- a/Tests/FluentAssertions.Specs/packages.lock.json +++ /dev/null @@ -1,462 +0,0 @@ -{ - "version": 1, - "dependencies": { - ".NETFramework,Version=v4.7": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "JetBrains.Annotations": { - "type": "Direct", - "requested": "[2024.3.0, )", - "resolved": "2024.3.0", - "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" - }, - "System.Collections.Immutable": { - "type": "Direct", - "requested": "[1.5.0, 1.5.0]", - "resolved": "1.5.0", - "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" - }, - "xunit": { - "type": "Direct", - "requested": "[2.9.3, )", - "resolved": "2.9.3", - "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", - "dependencies": { - "xunit.analyzers": "1.18.0", - "xunit.assert": "2.9.3", - "xunit.core": "[2.9.3]" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[2.8.2, )", - "resolved": "2.8.2", - "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.10.0" - } - }, - "Xunit.StaFact": { - "type": "Direct", - "requested": "[1.2.69, )", - "resolved": "1.2.69", - "contentHash": "DQl0Fzz+6jIoShxBK8jQkoh8Fy6AQ++ldJuFRjiLHVbazisMhHHDTGMPyAmB0Eups9tBCJ9GgFvHmalRR9UfXQ==", - "dependencies": { - "xunit.extensibility.execution": "2.4.2" - } - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.10.0", - "contentHash": "KkwhjQevuDj0aBRoPLY6OLAhGqbPUEBuKLbaCs0kUVw29qiOYncdORd4mLVJbn9vGZ7/iFGQ/+AoJl0Tu5Umdg==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==", - "dependencies": { - "System.Collections.Immutable": "1.5.0" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "xunit.abstractions": { - "type": "Transitive", - "resolved": "2.0.3", - "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" - }, - "xunit.analyzers": { - "type": "Transitive", - "resolved": "1.18.0", - "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" - }, - "xunit.assert": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" - }, - "xunit.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]", - "xunit.extensibility.execution": "[2.9.3]" - } - }, - "xunit.extensibility.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", - "dependencies": { - "xunit.abstractions": "2.0.3" - } - }, - "xunit.extensibility.execution": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]" - } - }, - "assemblya": { - "type": "Project", - "dependencies": { - "AssemblyB": "[1.0.0, )" - } - }, - "assemblyb": { - "type": "Project" - }, - "exampleextensions": { - "type": "Project", - "dependencies": { - "FluentAssertions": "[1.0.0, )" - } - }, - "fluentassertions": { - "type": "Project", - "dependencies": { - "System.Threading.Tasks.Extensions": "[4.5.4, )" - } - } - }, - "net6.0": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "CSharpGuidelinesAnalyzer": { - "type": "Direct", - "requested": "[3.8.5, )", - "resolved": "3.8.5", - "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" - }, - "JetBrains.Annotations": { - "type": "Direct", - "requested": "[2024.3.0, )", - "resolved": "2024.3.0", - "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" - }, - "Meziantou.Analyzer": { - "type": "Direct", - "requested": "[2.0.219, )", - "resolved": "2.0.219", - "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" - }, - "Microsoft.CodeAnalysis.BannedApiAnalyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0", - "Microsoft.TestPlatform.TestHost": "17.13.0" - } - }, - "Roslynator.Analyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" - }, - "StyleCop.Analyzers": { - "type": "Direct", - "requested": "[1.2.0-beta.556, )", - "resolved": "1.2.0-beta.556", - "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", - "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.556" - } - }, - "xunit": { - "type": "Direct", - "requested": "[2.9.3, )", - "resolved": "2.9.3", - "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", - "dependencies": { - "xunit.analyzers": "1.18.0", - "xunit.assert": "2.9.3", - "xunit.core": "[2.9.3]" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[2.8.2, )", - "resolved": "2.8.2", - "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" - }, - "Xunit.StaFact": { - "type": "Direct", - "requested": "[1.2.69, )", - "resolved": "1.2.69", - "contentHash": "DQl0Fzz+6jIoShxBK8jQkoh8Fy6AQ++ldJuFRjiLHVbazisMhHHDTGMPyAmB0Eups9tBCJ9GgFvHmalRR9UfXQ==", - "dependencies": { - "xunit.extensibility.execution": "2.4.2" - } - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Newtonsoft.Json": "13.0.1" - } - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" - }, - "StyleCop.Analyzers.Unstable": { - "type": "Transitive", - "resolved": "1.2.0.556", - "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "xunit.abstractions": { - "type": "Transitive", - "resolved": "2.0.3", - "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" - }, - "xunit.analyzers": { - "type": "Transitive", - "resolved": "1.18.0", - "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" - }, - "xunit.assert": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" - }, - "xunit.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]", - "xunit.extensibility.execution": "[2.9.3]" - } - }, - "xunit.extensibility.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", - "dependencies": { - "xunit.abstractions": "2.0.3" - } - }, - "xunit.extensibility.execution": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]" - } - }, - "assemblya": { - "type": "Project", - "dependencies": { - "AssemblyB": "[1.0.0, )" - } - }, - "assemblyb": { - "type": "Project" - }, - "exampleextensions": { - "type": "Project", - "dependencies": { - "FluentAssertions": "[1.0.0, )" - } - }, - "fluentassertions": { - "type": "Project" - } - }, - "net8.0": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "JetBrains.Annotations": { - "type": "Direct", - "requested": "[2024.3.0, )", - "resolved": "2024.3.0", - "contentHash": "ox5pkeLQXjvJdyAB4b2sBYAlqZGLh3PjSnP1bQNVx72ONuTJ9+34/+Rq91Fc0dG29XG9RgZur9+NcP4riihTug==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0", - "Microsoft.TestPlatform.TestHost": "17.13.0" - } - }, - "xunit": { - "type": "Direct", - "requested": "[2.9.3, )", - "resolved": "2.9.3", - "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", - "dependencies": { - "xunit.analyzers": "1.18.0", - "xunit.assert": "2.9.3", - "xunit.core": "[2.9.3]" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[2.8.2, )", - "resolved": "2.8.2", - "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" - }, - "Xunit.StaFact": { - "type": "Direct", - "requested": "[1.2.69, )", - "resolved": "1.2.69", - "contentHash": "DQl0Fzz+6jIoShxBK8jQkoh8Fy6AQ++ldJuFRjiLHVbazisMhHHDTGMPyAmB0Eups9tBCJ9GgFvHmalRR9UfXQ==", - "dependencies": { - "xunit.extensibility.execution": "2.4.2" - } - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Newtonsoft.Json": "13.0.1" - } - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "xunit.abstractions": { - "type": "Transitive", - "resolved": "2.0.3", - "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" - }, - "xunit.analyzers": { - "type": "Transitive", - "resolved": "1.18.0", - "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" - }, - "xunit.assert": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" - }, - "xunit.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]", - "xunit.extensibility.execution": "[2.9.3]" - } - }, - "xunit.extensibility.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", - "dependencies": { - "xunit.abstractions": "2.0.3" - } - }, - "xunit.extensibility.execution": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]" - } - }, - "assemblya": { - "type": "Project", - "dependencies": { - "AssemblyB": "[1.0.0, )" - } - }, - "assemblyb": { - "type": "Project" - }, - "exampleextensions": { - "type": "Project", - "dependencies": { - "FluentAssertions": "[1.0.0, )" - } - }, - "fluentassertions": { - "type": "Project" - } - } - } -} \ No newline at end of file diff --git a/Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json b/Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json deleted file mode 100644 index db53b4a90e..0000000000 --- a/Tests/TestFrameworks/MSTestV2.Specs/packages.lock.json +++ /dev/null @@ -1,180 +0,0 @@ -{ - "version": 1, - "dependencies": { - "net6.0": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "CSharpGuidelinesAnalyzer": { - "type": "Direct", - "requested": "[3.8.5, )", - "resolved": "3.8.5", - "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" - }, - "Meziantou.Analyzer": { - "type": "Direct", - "requested": "[2.0.219, )", - "resolved": "2.0.219", - "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" - }, - "Microsoft.CodeAnalysis.BannedApiAnalyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0", - "Microsoft.TestPlatform.TestHost": "17.13.0" - } - }, - "MSTest.TestAdapter": { - "type": "Direct", - "requested": "[3.10.4, )", - "resolved": "3.10.4", - "contentHash": "Gnoegnprezaqlx+X0T+bkOJsVzS9kKerfIeiLrw0nEEtu3tvT5hoEnv4uCqy+OfV3EdLqk1aJyNI3S30RbGXgw==", - "dependencies": { - "Microsoft.Testing.Extensions.VSTestBridge": "1.8.4", - "Microsoft.Testing.Platform.MSBuild": "1.8.4" - } - }, - "MSTest.TestFramework": { - "type": "Direct", - "requested": "[3.10.4, )", - "resolved": "3.10.4", - "contentHash": "i6P4/1d2Nc4O5eOcTfvjqc/psgNNuyfMPNNU3cTvQe56bznykTZ1X88eB8JmYa+V3UiTTBKXyDP9yUb8oezLoQ==", - "dependencies": { - "MSTest.Analyzers": "3.10.4" - } - }, - "Roslynator.Analyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" - }, - "StyleCop.Analyzers": { - "type": "Direct", - "requested": "[1.2.0-beta.556, )", - "resolved": "1.2.0-beta.556", - "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", - "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.556" - } - }, - "Microsoft.ApplicationInsights": { - "type": "Transitive", - "resolved": "2.23.0", - "contentHash": "nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==", - "dependencies": { - "System.Diagnostics.DiagnosticSource": "5.0.0" - } - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.Testing.Extensions.Telemetry": { - "type": "Transitive", - "resolved": "1.8.4", - "contentHash": "NbwjZtoXLcmPH/qtCSU3x+jQ4xBw+Ia8FVA9m4Tlvk1qtk/4LYUN7hZyA2/xVPgSPerYJoYqLy1mDG+DWfR2Ew==", - "dependencies": { - "Microsoft.ApplicationInsights": "2.23.0", - "Microsoft.Testing.Platform": "1.8.4" - } - }, - "Microsoft.Testing.Extensions.TrxReport.Abstractions": { - "type": "Transitive", - "resolved": "1.8.4", - "contentHash": "jDGV5d9K5zeQG6I5ZHZrrXd0sO9up/XLpb5qI5W+FPGJx5JXx5yEiwkw0MIEykH9ydeMASPOmjbY/7jS++gYwA==", - "dependencies": { - "Microsoft.Testing.Platform": "1.8.4" - } - }, - "Microsoft.Testing.Extensions.VSTestBridge": { - "type": "Transitive", - "resolved": "1.8.4", - "contentHash": "t4ZgIrdURpF96XTyw3HLSwlYb22x/tpxcCMipcIYFV6QgCtmPQrVNVrPLNazNkJF8egXqumtC2hnDca+0KdRQQ==", - "dependencies": { - "Microsoft.TestPlatform.AdapterUtilities": "17.13.0", - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Microsoft.Testing.Extensions.Telemetry": "1.8.4", - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.4", - "Microsoft.Testing.Platform": "1.8.4" - } - }, - "Microsoft.Testing.Platform": { - "type": "Transitive", - "resolved": "1.8.4", - "contentHash": "MpYE6A13G9zLZjkDmy2Fm/R0MRkjBR75P0F8B1yLaUshaATixPlk2S2OE6u/rlqtqMkbEyM7F6wxc332gZpBpA==" - }, - "Microsoft.Testing.Platform.MSBuild": { - "type": "Transitive", - "resolved": "1.8.4", - "contentHash": "RnS7G0eXAopdIf/XPGFNW8HUwZxRq5iGX34rVYhyDUbLS7sF513yosd4P50GtjBKqOay4qb+WHYr4NkWjtUWzQ==", - "dependencies": { - "Microsoft.Testing.Platform": "1.8.4" - } - }, - "Microsoft.TestPlatform.AdapterUtilities": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bFZ3uAhosdXjyXKURDQy37fPosCJQwedB5DG/SzsXL1QXsrfsIYty2kQMqCRRUqm8sBZBRHWRp4BT9SmpWXcKQ==" - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Newtonsoft.Json": "13.0.1" - } - }, - "MSTest.Analyzers": { - "type": "Transitive", - "resolved": "3.10.4", - "contentHash": "a3IHTsbd+iS0pZUI7KC6nCCQgTOhjPyqDwPOtKLGCwjRifQ9N4K40qTqCaQlPOxwKaIxVwDLRYFvdY9NTDVi0w==" - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" - }, - "StyleCop.Analyzers.Unstable": { - "type": "Transitive", - "resolved": "1.2.0.556", - "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" - }, - "System.Diagnostics.DiagnosticSource": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "fluentassertions": { - "type": "Project" - } - } - } -} \ No newline at end of file diff --git a/Tests/TestFrameworks/MSpec.Specs/packages.lock.json b/Tests/TestFrameworks/MSpec.Specs/packages.lock.json deleted file mode 100644 index 071ebc5719..0000000000 --- a/Tests/TestFrameworks/MSpec.Specs/packages.lock.json +++ /dev/null @@ -1,1037 +0,0 @@ -{ - "version": 1, - "dependencies": { - "net6.0": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "CSharpGuidelinesAnalyzer": { - "type": "Direct", - "requested": "[3.8.5, )", - "resolved": "3.8.5", - "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" - }, - "Machine.Specifications": { - "type": "Direct", - "requested": "[1.1.3, )", - "resolved": "1.1.3", - "contentHash": "m2rn8iZUwf5AF6WJgqkWOuvZ52HfvXyw3QLN/rNyWAOyjGgeGhNdsNbwnm9QanD68KpUeijtGkRQn+d07J4xLQ==", - "dependencies": { - "NETStandard.Library": "1.6.0", - "System.Diagnostics.TextWriterTraceListener": "4.0.0", - "System.Diagnostics.TraceSource": "4.0.0", - "System.Reflection": "4.1.0", - "System.Reflection.Extensions": "4.0.1", - "System.Reflection.TypeExtensions": "4.1.0", - "System.Threading.ThreadPool": "4.3.0", - "System.Xml.XPath": "4.0.1", - "System.Xml.XPath.XDocument": "4.0.1" - } - }, - "Machine.Specifications.Runner.VisualStudio": { - "type": "Direct", - "requested": "[2.10.2, )", - "resolved": "2.10.2", - "contentHash": "LU8yUTBiYqMvVCAaE3aJ1lVm1BjDpibcdTRFsUhZqyhw+9qkaZCTr5YpH6xAMyTvWbV431ftBHTZnNK6BxzVmw==", - "dependencies": { - "Mono.Cecil": "[0.10.0, 0.11.0)" - } - }, - "Meziantou.Analyzer": { - "type": "Direct", - "requested": "[2.0.219, )", - "resolved": "2.0.219", - "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" - }, - "Microsoft.CodeAnalysis.BannedApiAnalyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0", - "Microsoft.TestPlatform.TestHost": "17.13.0" - } - }, - "Roslynator.Analyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" - }, - "StyleCop.Analyzers": { - "type": "Direct", - "requested": "[1.2.0-beta.556, )", - "resolved": "1.2.0-beta.556", - "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", - "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.556" - } - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" - }, - "Microsoft.NETCore.Targets": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Newtonsoft.Json": "13.0.1" - } - }, - "Microsoft.Win32.Primitives": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "fQnBHO9DgcmkC9dYSJoBqo6sH1VJwJprUHh8F3hbcRlxiQiBUuTntdk8tUwV490OqC2kQUrinGwZyQHTieuXRA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "Mono.Cecil": { - "type": "Transitive", - "resolved": "0.10.0", - "contentHash": "nHSF7wvyZRPAGXl49zgULPFubXHpsXlOH9RXFRUKb0TX0/tKkKljci6yBszVNI09PIDNQ8IP9WJTYvmBkMbbHw==", - "dependencies": { - "System.Collections": "4.0.11", - "System.IO.FileSystem": "4.0.1", - "System.IO.FileSystem.Primitives": "4.0.1", - "System.Reflection": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Security.Cryptography.Algorithms": "4.2.0", - "System.Security.Cryptography.Csp": "4.0.0", - "System.Threading": "4.0.11" - } - }, - "NETStandard.Library": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "ypsCvIdCZ4IoYASJHt6tF2fMo7N30NLgV1EbmC+snO490OMl9FvVxmumw14rhReWU3j3g7BYudG6YCrchwHJlA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.Win32.Primitives": "4.0.1", - "System.AppContext": "4.1.0", - "System.Collections": "4.0.11", - "System.Collections.Concurrent": "4.0.12", - "System.Console": "4.0.0", - "System.Diagnostics.Debug": "4.0.11", - "System.Diagnostics.Tools": "4.0.1", - "System.Diagnostics.Tracing": "4.1.0", - "System.Globalization": "4.0.11", - "System.Globalization.Calendars": "4.0.1", - "System.IO": "4.1.0", - "System.IO.Compression": "4.1.0", - "System.IO.Compression.ZipFile": "4.0.1", - "System.IO.FileSystem": "4.0.1", - "System.IO.FileSystem.Primitives": "4.0.1", - "System.Linq": "4.1.0", - "System.Linq.Expressions": "4.1.0", - "System.Net.Http": "4.1.0", - "System.Net.Primitives": "4.0.11", - "System.Net.Sockets": "4.1.0", - "System.ObjectModel": "4.0.12", - "System.Reflection": "4.1.0", - "System.Reflection.Extensions": "4.0.1", - "System.Reflection.Primitives": "4.0.1", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Runtime.Handles": "4.0.1", - "System.Runtime.InteropServices": "4.1.0", - "System.Runtime.InteropServices.RuntimeInformation": "4.0.0", - "System.Runtime.Numerics": "4.0.1", - "System.Security.Cryptography.Algorithms": "4.2.0", - "System.Security.Cryptography.Encoding": "4.0.0", - "System.Security.Cryptography.Primitives": "4.0.0", - "System.Security.Cryptography.X509Certificates": "4.1.0", - "System.Text.Encoding": "4.0.11", - "System.Text.Encoding.Extensions": "4.0.11", - "System.Text.RegularExpressions": "4.1.0", - "System.Threading": "4.0.11", - "System.Threading.Tasks": "4.0.11", - "System.Threading.Timer": "4.0.1", - "System.Xml.ReaderWriter": "4.0.11", - "System.Xml.XDocument": "4.0.11" - } - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" - }, - "runtime.native.System": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "QfS/nQI7k/BLgmLrw7qm7YBoULEvgWnPI+cYsbfCVFTW8Aj+i8JhccxcFMu1RWms0YZzF+UHguNBK4Qn89e2Sg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1" - } - }, - "runtime.native.System.IO.Compression": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "Ob7nvnJBox1aaB222zSVZSkf4WrebPG4qFscfK7vmD7P7NxoSxACQLtO7ytWpqXDn2wcd/+45+EAZ7xjaPip8A==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1" - } - }, - "runtime.native.System.Net.Http": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "Nh0UPZx2Vifh8r+J+H2jxifZUD3sBrmolgiFWJd2yiNrxO0xTa6bAw3YwRn1VOiSen/tUXMS31ttNItCZ6lKuA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1" - } - }, - "runtime.native.System.Security.Cryptography": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "2CQK0jmO6Eu7ZeMgD+LOFbNJSXHFVQbCJJkEyEwowh1SCgYnrn9W9RykMfpeeVGw7h4IBvYikzpGUlmZTUafJw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1" - } - }, - "StyleCop.Analyzers.Unstable": { - "type": "Transitive", - "resolved": "1.2.0.556", - "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" - }, - "System.AppContext": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "3QjO4jNV7PdKkmQAVp9atA+usVnKRwI3Kx1nMwJ93T0LcQfx7pKAYk0nKz5wn1oP5iqlhZuy6RXOFdhr7rDwow==", - "dependencies": { - "System.Runtime": "4.1.0" - } - }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "msXumHfjjURSkvxUjYuq4N2ghHoRi2VpXcKMA7gK6ujQfU3vGpl+B6ld0ATRg+FZFpRyA6PgEPA+VlIkTeNf2w==", - "dependencies": { - "System.Diagnostics.Debug": "4.0.11", - "System.Diagnostics.Tracing": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Threading": "4.0.11" - } - }, - "System.Collections": { - "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Collections.Concurrent": { - "type": "Transitive", - "resolved": "4.0.12", - "contentHash": "2gBcbb3drMLgxlI0fBfxMA31ec6AEyYCHygGse4vxceJan8mRIWeKJ24BFzN7+bi/NFTgdIgufzb94LWO5EERQ==", - "dependencies": { - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.Diagnostics.Tracing": "4.1.0", - "System.Globalization": "4.0.11", - "System.Reflection": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Threading": "4.0.11", - "System.Threading.Tasks": "4.0.11" - } - }, - "System.Console": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "qSKUSOIiYA/a0g5XXdxFcUFmv1hNICBD7QZ0QhGYVipPIhvpiydY8VZqr1thmCXvmn8aipMg64zuanB4eotK9A==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.IO": "4.1.0", - "System.Runtime": "4.1.0", - "System.Text.Encoding": "4.0.11" - } - }, - "System.Diagnostics.Debug": { - "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Diagnostics.DiagnosticSource": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "YKglnq4BMTJxfcr6nuT08g+yJ0UxdePIHxosiLuljuHIUR6t4KhFsyaHOaOc1Ofqp0PUvJ0EmcgiEz6T7vEx3w==", - "dependencies": { - "System.Collections": "4.0.11", - "System.Diagnostics.Tracing": "4.1.0", - "System.Reflection": "4.1.0", - "System.Runtime": "4.1.0", - "System.Threading": "4.0.11" - } - }, - "System.Diagnostics.TextWriterTraceListener": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "w36Dr8yKy8xP150qPANe7Td+/zOI3G62ImRcHDIEW+oUXUuTKZHd4DHmqRx5+x8RXd85v3tXd1uhNTfsr+yxjA==", - "dependencies": { - "System.Diagnostics.TraceSource": "4.0.0", - "System.Globalization": "4.0.11", - "System.IO": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Threading": "4.0.11" - } - }, - "System.Diagnostics.Tools": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "xBfJ8pnd4C17dWaC9FM6aShzbJcRNMChUMD42I6772KGGrqaFdumwhn9OdM68erj1ueNo3xdQ1EwiFjK5k8p0g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Diagnostics.TraceSource": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "6WVCczFZKXwpWpzd/iJkYnsmWTSFFiU24Xx/YdHXBcu+nFI/ehTgeqdJQFbtRPzbrO3KtRNjvkhtj4t5/WwWsA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.Globalization": "4.0.11", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Threading": "4.0.11", - "runtime.native.System": "4.0.0" - } - }, - "System.Diagnostics.Tracing": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "vDN1PoMZCkkdNjvZLql592oYJZgS7URcJzJ7bxeBgGtx5UtR5leNm49VmfHGqIffX4FKacHbI3H6UyNSHQknBg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Globalization": { - "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Globalization.Calendars": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "L1c6IqeQ88vuzC1P81JeHmHA8mxq8a18NUBNXnIY/BVb+TCyAaGIFbhpZt60h9FJNmisymoQkHEFSE9Vslja1Q==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Globalization": "4.0.11", - "System.Runtime": "4.1.0" - } - }, - "System.Globalization.Extensions": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "KKo23iKeOaIg61SSXwjANN7QYDr/3op3OWGGzDzz7mypx0Za0fZSeG0l6cco8Ntp8YMYkIQcAqlk8yhm5/Uhcg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "System.Globalization": "4.0.11", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Runtime.InteropServices": "4.1.0" - } - }, - "System.IO": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0", - "System.Text.Encoding": "4.0.11", - "System.Threading.Tasks": "4.0.11" - } - }, - "System.IO.Compression": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "TjnBS6eztThSzeSib+WyVbLzEdLKUcEHN69VtS3u8aAsSc18FU6xCZlNWWsEd8SKcXAE+y1sOu7VbU8sUeM0sg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.IO": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Runtime.Handles": "4.0.1", - "System.Runtime.InteropServices": "4.1.0", - "System.Text.Encoding": "4.0.11", - "System.Threading": "4.0.11", - "System.Threading.Tasks": "4.0.11", - "runtime.native.System": "4.0.0", - "runtime.native.System.IO.Compression": "4.1.0" - } - }, - "System.IO.Compression.ZipFile": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "hBQYJzfTbQURF10nLhd+az2NHxsU6MU7AB8RUf4IolBP5lOAm4Luho851xl+CqslmhI5ZH/el8BlngEk4lBkaQ==", - "dependencies": { - "System.Buffers": "4.0.0", - "System.IO": "4.1.0", - "System.IO.Compression": "4.1.0", - "System.IO.FileSystem": "4.0.1", - "System.IO.FileSystem.Primitives": "4.0.1", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Text.Encoding": "4.0.11" - } - }, - "System.IO.FileSystem": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "IBErlVq5jOggAD69bg1t0pJcHaDbJbWNUZTPI96fkYWzwYbN6D9wRHMULLDd9dHsl7C2YsxXL31LMfPI1SWt8w==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.IO": "4.1.0", - "System.IO.FileSystem.Primitives": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Handles": "4.0.1", - "System.Text.Encoding": "4.0.11", - "System.Threading.Tasks": "4.0.11" - } - }, - "System.IO.FileSystem.Primitives": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "kWkKD203JJKxJeE74p8aF8y4Qc9r9WQx4C0cHzHPrY3fv/L/IhWnyCHaFJ3H1QPOH6A93whlQ2vG5nHlBDvzWQ==", - "dependencies": { - "System.Runtime": "4.1.0" - } - }, - "System.Linq": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==", - "dependencies": { - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0" - } - }, - "System.Linq.Expressions": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "I+y02iqkgmCAyfbqOmSDOgqdZQ5tTj80Akm5BPSS8EeB0VGWdy6X1KCoYe8Pk6pwDoAKZUOdLVxnTJcExiv5zw==", - "dependencies": { - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.Globalization": "4.0.11", - "System.IO": "4.1.0", - "System.Linq": "4.1.0", - "System.ObjectModel": "4.0.12", - "System.Reflection": "4.1.0", - "System.Reflection.Emit": "4.0.1", - "System.Reflection.Emit.ILGeneration": "4.0.1", - "System.Reflection.Emit.Lightweight": "4.0.1", - "System.Reflection.Extensions": "4.0.1", - "System.Reflection.Primitives": "4.0.1", - "System.Reflection.TypeExtensions": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Threading": "4.0.11" - } - }, - "System.Net.Http": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "ULq9g3SOPVuupt+Y3U+A37coXzdNisB1neFCSKzBwo182u0RDddKJF8I5+HfyXqK6OhJPgeoAwWXrbiUXuRDsg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.Diagnostics.DiagnosticSource": "4.0.0", - "System.Diagnostics.Tracing": "4.1.0", - "System.Globalization": "4.0.11", - "System.Globalization.Extensions": "4.0.1", - "System.IO": "4.1.0", - "System.IO.FileSystem": "4.0.1", - "System.Net.Primitives": "4.0.11", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Runtime.Handles": "4.0.1", - "System.Runtime.InteropServices": "4.1.0", - "System.Security.Cryptography.Algorithms": "4.2.0", - "System.Security.Cryptography.Encoding": "4.0.0", - "System.Security.Cryptography.OpenSsl": "4.0.0", - "System.Security.Cryptography.Primitives": "4.0.0", - "System.Security.Cryptography.X509Certificates": "4.1.0", - "System.Text.Encoding": "4.0.11", - "System.Threading": "4.0.11", - "System.Threading.Tasks": "4.0.11", - "runtime.native.System": "4.0.0", - "runtime.native.System.Net.Http": "4.0.1", - "runtime.native.System.Security.Cryptography": "4.0.0" - } - }, - "System.Net.Primitives": { - "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "hVvfl4405DRjA2408luZekbPhplJK03j2Y2lSfMlny7GHXlkByw1iLnc9mgKW0GdQn73vvMcWrWewAhylXA4Nw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Handles": "4.0.1" - } - }, - "System.Net.Sockets": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "xAz0N3dAV/aR/9g8r0Y5oEqU1JRsz29F5EGb/WVHmX3jVSLqi2/92M5hTad2aNWovruXrJpJtgZ9fccPMG9uSw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.IO": "4.1.0", - "System.Net.Primitives": "4.0.11", - "System.Runtime": "4.1.0", - "System.Threading.Tasks": "4.0.11" - } - }, - "System.ObjectModel": { - "type": "Transitive", - "resolved": "4.0.12", - "contentHash": "tAgJM1xt3ytyMoW4qn4wIqgJYm7L7TShRZG4+Q4Qsi2PCcj96pXN7nRywS9KkB3p/xDUjc2HSwP9SROyPYDYKQ==", - "dependencies": { - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Threading": "4.0.11" - } - }, - "System.Reflection": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.IO": "4.1.0", - "System.Reflection.Primitives": "4.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Reflection.Emit": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==", - "dependencies": { - "System.IO": "4.1.0", - "System.Reflection": "4.1.0", - "System.Reflection.Emit.ILGeneration": "4.0.1", - "System.Reflection.Primitives": "4.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Reflection.Emit.ILGeneration": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "Ov6dU8Bu15Bc7zuqttgHF12J5lwSWyTf1S+FJouUXVMSqImLZzYaQ+vRr1rQ0OZ0HqsrwWl4dsKHELckQkVpgA==", - "dependencies": { - "System.Reflection": "4.1.0", - "System.Reflection.Primitives": "4.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Reflection.Emit.Lightweight": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==", - "dependencies": { - "System.Reflection": "4.1.0", - "System.Reflection.Emit.ILGeneration": "4.0.1", - "System.Reflection.Primitives": "4.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Reflection.Extensions": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "GYrtRsZcMuHF3sbmRHfMYpvxZoIN2bQGrYGerUiWLEkqdEUQZhH3TRSaC/oI4wO0II1RKBPlpIa1TOMxIcOOzQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Reflection": "4.1.0", - "System.Runtime": "4.1.0" - } - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "System.Reflection.Primitives": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Reflection.TypeExtensions": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "tsQ/ptQ3H5FYfON8lL4MxRk/8kFyE0A+tGPXmVP967cT/gzLHYxIejIYSxp4JmIeFHVP78g/F2FE1mUUTbDtrg==", - "dependencies": { - "System.Reflection": "4.1.0", - "System.Runtime": "4.1.0" - } - }, - "System.Resources.ResourceManager": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Globalization": "4.0.11", - "System.Reflection": "4.1.0", - "System.Runtime": "4.1.0" - } - }, - "System.Runtime": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - } - }, - "System.Runtime.Extensions": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Runtime.Handles": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Runtime.InteropServices": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "16eu3kjHS633yYdkjwShDHZLRNMKVi/s0bY8ODiqJ2RfMhDMAwxZaUaWVnZ2P71kr/or+X9o/xFWtNqz8ivieQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Reflection": "4.1.0", - "System.Reflection.Primitives": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Handles": "4.0.1" - } - }, - "System.Runtime.InteropServices.RuntimeInformation": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "hWPhJxc453RCa8Z29O91EmfGeZIHX1ZH2A8L6lYQVSaKzku2DfArSfMEb1/MYYzPQRJZeu0c9dmYeJKxW5Fgng==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "System.Reflection": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.InteropServices": "4.1.0", - "System.Threading": "4.0.11", - "runtime.native.System": "4.0.0" - } - }, - "System.Runtime.Numerics": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "+XbKFuzdmLP3d1o9pdHu2nxjNr2OEPqGzKeegPLCUMM71a0t50A/rOcIRmGs9wR7a8KuHX6hYs/7/TymIGLNqg==", - "dependencies": { - "System.Globalization": "4.0.11", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0" - } - }, - "System.Security.Cryptography.Algorithms": { - "type": "Transitive", - "resolved": "4.2.0", - "contentHash": "8JQFxbLVdrtIOKMDN38Fn0GWnqYZw/oMlwOUG/qz1jqChvyZlnUmu+0s7wLx7JYua/nAXoESpHA3iw11QFWhXg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "System.Collections": "4.0.11", - "System.IO": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Runtime.Handles": "4.0.1", - "System.Runtime.InteropServices": "4.1.0", - "System.Runtime.Numerics": "4.0.1", - "System.Security.Cryptography.Encoding": "4.0.0", - "System.Security.Cryptography.Primitives": "4.0.0", - "System.Text.Encoding": "4.0.11", - "runtime.native.System.Security.Cryptography": "4.0.0" - } - }, - "System.Security.Cryptography.Cng": { - "type": "Transitive", - "resolved": "4.2.0", - "contentHash": "cUJ2h+ZvONDe28Szw3st5dOHdjndhJzQ2WObDEXAWRPEQBtVItVoxbXM/OEsTthl3cNn2dk2k0I3y45igCQcLw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "System.IO": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Runtime.Handles": "4.0.1", - "System.Runtime.InteropServices": "4.1.0", - "System.Security.Cryptography.Algorithms": "4.2.0", - "System.Security.Cryptography.Encoding": "4.0.0", - "System.Security.Cryptography.Primitives": "4.0.0", - "System.Text.Encoding": "4.0.11" - } - }, - "System.Security.Cryptography.Csp": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "/i1Usuo4PgAqgbPNC0NjbO3jPW//BoBlTpcWFD1EHVbidH21y4c1ap5bbEMSGAXjAShhMH4abi/K8fILrnu4BQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "System.IO": "4.1.0", - "System.Reflection": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Runtime.Handles": "4.0.1", - "System.Runtime.InteropServices": "4.1.0", - "System.Security.Cryptography.Algorithms": "4.2.0", - "System.Security.Cryptography.Encoding": "4.0.0", - "System.Security.Cryptography.Primitives": "4.0.0", - "System.Text.Encoding": "4.0.11", - "System.Threading": "4.0.11" - } - }, - "System.Security.Cryptography.Encoding": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "FbKgE5MbxSQMPcSVRgwM6bXN3GtyAh04NkV8E5zKCBE26X0vYW0UtTa2FIgkH33WVqBVxRgxljlVYumWtU+HcQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "System.Collections": "4.0.11", - "System.Collections.Concurrent": "4.0.12", - "System.Linq": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Runtime.Handles": "4.0.1", - "System.Runtime.InteropServices": "4.1.0", - "System.Security.Cryptography.Primitives": "4.0.0", - "System.Text.Encoding": "4.0.11", - "runtime.native.System.Security.Cryptography": "4.0.0" - } - }, - "System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "HUG/zNUJwEiLkoURDixzkzZdB5yGA5pQhDP93ArOpDPQMteURIGERRNzzoJlmTreLBWr5lkFSjjMSk8ySEpQMw==", - "dependencies": { - "System.Collections": "4.0.11", - "System.IO": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Runtime.Handles": "4.0.1", - "System.Runtime.InteropServices": "4.1.0", - "System.Runtime.Numerics": "4.0.1", - "System.Security.Cryptography.Algorithms": "4.2.0", - "System.Security.Cryptography.Encoding": "4.0.0", - "System.Security.Cryptography.Primitives": "4.0.0", - "System.Text.Encoding": "4.0.11", - "runtime.native.System.Security.Cryptography": "4.0.0" - } - }, - "System.Security.Cryptography.Primitives": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "Wkd7QryWYjkQclX0bngpntW5HSlMzeJU24UaLJQ7YTfI8ydAVAaU2J+HXLLABOVJlKTVvAeL0Aj39VeTe7L+oA==", - "dependencies": { - "System.Diagnostics.Debug": "4.0.11", - "System.Globalization": "4.0.11", - "System.IO": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Threading": "4.0.11", - "System.Threading.Tasks": "4.0.11" - } - }, - "System.Security.Cryptography.X509Certificates": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "4HEfsQIKAhA1+ApNn729Gi09zh+lYWwyIuViihoMDWp1vQnEkL2ct7mAbhBlLYm+x/L4Rr/pyGge1lIY635e0w==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.Globalization": "4.0.11", - "System.Globalization.Calendars": "4.0.1", - "System.IO": "4.1.0", - "System.IO.FileSystem": "4.0.1", - "System.IO.FileSystem.Primitives": "4.0.1", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Runtime.Handles": "4.0.1", - "System.Runtime.InteropServices": "4.1.0", - "System.Runtime.Numerics": "4.0.1", - "System.Security.Cryptography.Algorithms": "4.2.0", - "System.Security.Cryptography.Cng": "4.2.0", - "System.Security.Cryptography.Csp": "4.0.0", - "System.Security.Cryptography.Encoding": "4.0.0", - "System.Security.Cryptography.OpenSsl": "4.0.0", - "System.Security.Cryptography.Primitives": "4.0.0", - "System.Text.Encoding": "4.0.11", - "System.Threading": "4.0.11", - "runtime.native.System": "4.0.0", - "runtime.native.System.Net.Http": "4.0.1", - "runtime.native.System.Security.Cryptography": "4.0.0" - } - }, - "System.Text.Encoding": { - "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Text.Encoding.Extensions": { - "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0", - "System.Text.Encoding": "4.0.11" - } - }, - "System.Text.RegularExpressions": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "i88YCXpRTjCnoSQZtdlHkAOx4KNNik4hMy83n0+Ftlb7jvV6ZiZWMpnEZHhjBp6hQVh8gWd/iKNPzlPF7iyA2g==", - "dependencies": { - "System.Collections": "4.0.11", - "System.Globalization": "4.0.11", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Threading": "4.0.11" - } - }, - "System.Threading": { - "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==", - "dependencies": { - "System.Runtime": "4.1.0", - "System.Threading.Tasks": "4.0.11" - } - }, - "System.Threading.Tasks": { - "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "pH4FZDsZQ/WmgJtN4LWYmRdJAEeVkyriSwrv2Teoe5FOU0Yxlb6II6GL8dBPOfRmutHGATduj3ooMt7dJ2+i+w==", - "dependencies": { - "System.Collections": "4.0.11", - "System.Runtime": "4.1.0", - "System.Threading.Tasks": "4.0.11" - } - }, - "System.Threading.ThreadPool": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", - "dependencies": { - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0" - } - }, - "System.Threading.Timer": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "saGfUV8uqVW6LeURiqxcGhZ24PzuRNaUBtbhVeuUAvky1naH395A/1nY0P2bWvrw/BreRtIB/EzTDkGBpqCwEw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Xml.ReaderWriter": { - "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "ZIiLPsf67YZ9zgr31vzrFaYQqxRPX9cVHjtPSnmx4eN6lbS/yEyYNr2vs1doGDEscF0tjCZFsk9yUg1sC9e8tg==", - "dependencies": { - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.Globalization": "4.0.11", - "System.IO": "4.1.0", - "System.IO.FileSystem": "4.0.1", - "System.IO.FileSystem.Primitives": "4.0.1", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Runtime.InteropServices": "4.1.0", - "System.Text.Encoding": "4.0.11", - "System.Text.Encoding.Extensions": "4.0.11", - "System.Text.RegularExpressions": "4.1.0", - "System.Threading.Tasks": "4.0.11", - "System.Threading.Tasks.Extensions": "4.0.0" - } - }, - "System.Xml.XDocument": { - "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "Mk2mKmPi0nWaoiYeotq1dgeNK1fqWh61+EK+w4Wu8SWuTYLzpUnschb59bJtGywaPq7SmTuPf44wrXRwbIrukg==", - "dependencies": { - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.Diagnostics.Tools": "4.0.1", - "System.Globalization": "4.0.11", - "System.IO": "4.1.0", - "System.Reflection": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Text.Encoding": "4.0.11", - "System.Threading": "4.0.11", - "System.Xml.ReaderWriter": "4.0.11" - } - }, - "System.Xml.XPath": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "UWd1H+1IJ9Wlq5nognZ/XJdyj8qPE4XufBUkAW59ijsCPjZkZe0MUzKKJFBr+ZWBe5Wq1u1d5f2CYgE93uH7DA==", - "dependencies": { - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.Globalization": "4.0.11", - "System.IO": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Threading": "4.0.11", - "System.Xml.ReaderWriter": "4.0.11" - } - }, - "System.Xml.XPath.XDocument": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "FLhdYJx4331oGovQypQ8JIw2kEmNzCsjVOVYY/16kZTUoquZG85oVn7yUhBE2OZt1yGPSXAL0HTEfzjlbNpM7Q==", - "dependencies": { - "System.Diagnostics.Debug": "4.0.11", - "System.Linq": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Threading": "4.0.11", - "System.Xml.ReaderWriter": "4.0.11", - "System.Xml.XDocument": "4.0.11", - "System.Xml.XPath": "4.0.1" - } - }, - "fluentassertions": { - "type": "Project" - } - } - } -} \ No newline at end of file diff --git a/Tests/TestFrameworks/NUnit3.Specs/packages.lock.json b/Tests/TestFrameworks/NUnit3.Specs/packages.lock.json deleted file mode 100644 index cbbf066f1f..0000000000 --- a/Tests/TestFrameworks/NUnit3.Specs/packages.lock.json +++ /dev/null @@ -1,188 +0,0 @@ -{ - "version": 1, - "dependencies": { - "net6.0": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "CSharpGuidelinesAnalyzer": { - "type": "Direct", - "requested": "[3.8.5, )", - "resolved": "3.8.5", - "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" - }, - "Meziantou.Analyzer": { - "type": "Direct", - "requested": "[2.0.219, )", - "resolved": "2.0.219", - "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" - }, - "Microsoft.CodeAnalysis.BannedApiAnalyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0", - "Microsoft.TestPlatform.TestHost": "17.13.0" - } - }, - "NUnit": { - "type": "Direct", - "requested": "[3.14.0, 4.0.0)", - "resolved": "3.14.0", - "contentHash": "R7iPwD7kbOaP3o2zldWJbWeMQAvDKD0uld27QvA3PAALl1unl7x0v2J7eGiJOYjimV/BuGT4VJmr45RjS7z4LA==", - "dependencies": { - "NETStandard.Library": "2.0.0" - } - }, - "NUnit3TestAdapter": { - "type": "Direct", - "requested": "[5.1.0, )", - "resolved": "5.1.0", - "contentHash": "Q5jgS+WMzXPLKPBvVjXU0R8R75nCPNZPbDAzNxrFnHU9y9K6q+9xXJzgj0HAMr2+ib+2/R1gCYeN1F27rcrgFw==", - "dependencies": { - "Microsoft.Testing.Extensions.VSTestBridge": "1.7.3", - "Microsoft.Testing.Platform.MSBuild": "1.7.3" - } - }, - "Roslynator.Analyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" - }, - "StyleCop.Analyzers": { - "type": "Direct", - "requested": "[1.2.0-beta.556, )", - "resolved": "1.2.0-beta.556", - "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", - "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.556" - } - }, - "Microsoft.ApplicationInsights": { - "type": "Transitive", - "resolved": "2.23.0", - "contentHash": "nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==", - "dependencies": { - "System.Diagnostics.DiagnosticSource": "5.0.0" - } - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" - }, - "Microsoft.Testing.Extensions.Telemetry": { - "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "udSTexALlmp01a6a4fNzzpcUyUZOUbVZRRdHotCcnM1pCl3G1wqRWJlD9B6vDaIw29tYBPv7iA+YbVvq61RonA==", - "dependencies": { - "Microsoft.ApplicationInsights": "2.23.0", - "Microsoft.Testing.Platform": "1.7.3" - } - }, - "Microsoft.Testing.Extensions.TrxReport.Abstractions": { - "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "dDEETHbX5JQBMIFgBPkX/FmCU4DRQSG+k58QUtz7zTdnEZDafPKH6YHSMoHY3blDiZV/vcSol35Ux3WC7wU+9Q==", - "dependencies": { - "Microsoft.Testing.Platform": "1.7.3" - } - }, - "Microsoft.Testing.Extensions.VSTestBridge": { - "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "iLD8UlqQis9eVmgKxuqEUBm1Tzmsqj6xluj8xe6/scM+PQ84eDX2oqi0rra2N0JLli5LxloTb0iWYN5y4+kn1A==", - "dependencies": { - "Microsoft.TestPlatform.AdapterUtilities": "17.13.0", - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Microsoft.Testing.Extensions.Telemetry": "1.7.3", - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.7.3", - "Microsoft.Testing.Platform": "1.7.3" - } - }, - "Microsoft.Testing.Platform": { - "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "cI6u+CPxv3+07cbSwJVKOfxFrecbjfZnid1fe8EMhyPY4qmsSNnm+hN+GIy8u4JIlrADfrskDiwnScjRzVzJNw==" - }, - "Microsoft.Testing.Platform.MSBuild": { - "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "tSIKXv7tLLYDjfodqLuTigsmOVcYj0CDC1rYeac5MTgHjbYV8IfmYh4FprBt/xE1zW8phkCYP766F9ayo560jA==", - "dependencies": { - "Microsoft.Testing.Platform": "1.7.3" - } - }, - "Microsoft.TestPlatform.AdapterUtilities": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bFZ3uAhosdXjyXKURDQy37fPosCJQwedB5DG/SzsXL1QXsrfsIYty2kQMqCRRUqm8sBZBRHWRp4BT9SmpWXcKQ==" - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Newtonsoft.Json": "13.0.1" - } - }, - "NETStandard.Library": { - "type": "Transitive", - "resolved": "2.0.0", - "contentHash": "7jnbRU+L08FXKMxqUflxEXtVymWvNOrS8yHgu9s6EM8Anr6T/wIX4nZ08j/u3Asz+tCufp3YVwFSEvFTPYmBPA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0" - } - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" - }, - "StyleCop.Analyzers.Unstable": { - "type": "Transitive", - "resolved": "1.2.0.556", - "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" - }, - "System.Diagnostics.DiagnosticSource": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "fluentassertions": { - "type": "Project" - } - } - } -} \ No newline at end of file diff --git a/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json b/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json deleted file mode 100644 index 40a0759195..0000000000 --- a/Tests/TestFrameworks/NUnit4.Specs/packages.lock.json +++ /dev/null @@ -1,172 +0,0 @@ -{ - "version": 1, - "dependencies": { - "net6.0": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "CSharpGuidelinesAnalyzer": { - "type": "Direct", - "requested": "[3.8.5, )", - "resolved": "3.8.5", - "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" - }, - "Meziantou.Analyzer": { - "type": "Direct", - "requested": "[2.0.219, )", - "resolved": "2.0.219", - "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" - }, - "Microsoft.CodeAnalysis.BannedApiAnalyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0", - "Microsoft.TestPlatform.TestHost": "17.13.0" - } - }, - "NUnit": { - "type": "Direct", - "requested": "[4.4.0, )", - "resolved": "4.4.0", - "contentHash": "7IWJcT9xWNhG9dEGdgAWdH6maCE0eVbeVnizvXACKbAyxbjoJ9+WaEb8qsCTJi3hsb18AJBtoqvWa3G7YYUQfw==" - }, - "NUnit3TestAdapter": { - "type": "Direct", - "requested": "[5.1.0, )", - "resolved": "5.1.0", - "contentHash": "Q5jgS+WMzXPLKPBvVjXU0R8R75nCPNZPbDAzNxrFnHU9y9K6q+9xXJzgj0HAMr2+ib+2/R1gCYeN1F27rcrgFw==", - "dependencies": { - "Microsoft.Testing.Extensions.VSTestBridge": "1.7.3", - "Microsoft.Testing.Platform.MSBuild": "1.7.3" - } - }, - "Roslynator.Analyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" - }, - "StyleCop.Analyzers": { - "type": "Direct", - "requested": "[1.2.0-beta.556, )", - "resolved": "1.2.0-beta.556", - "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", - "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.556" - } - }, - "Microsoft.ApplicationInsights": { - "type": "Transitive", - "resolved": "2.23.0", - "contentHash": "nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw==", - "dependencies": { - "System.Diagnostics.DiagnosticSource": "5.0.0" - } - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.Testing.Extensions.Telemetry": { - "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "udSTexALlmp01a6a4fNzzpcUyUZOUbVZRRdHotCcnM1pCl3G1wqRWJlD9B6vDaIw29tYBPv7iA+YbVvq61RonA==", - "dependencies": { - "Microsoft.ApplicationInsights": "2.23.0", - "Microsoft.Testing.Platform": "1.7.3" - } - }, - "Microsoft.Testing.Extensions.TrxReport.Abstractions": { - "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "dDEETHbX5JQBMIFgBPkX/FmCU4DRQSG+k58QUtz7zTdnEZDafPKH6YHSMoHY3blDiZV/vcSol35Ux3WC7wU+9Q==", - "dependencies": { - "Microsoft.Testing.Platform": "1.7.3" - } - }, - "Microsoft.Testing.Extensions.VSTestBridge": { - "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "iLD8UlqQis9eVmgKxuqEUBm1Tzmsqj6xluj8xe6/scM+PQ84eDX2oqi0rra2N0JLli5LxloTb0iWYN5y4+kn1A==", - "dependencies": { - "Microsoft.TestPlatform.AdapterUtilities": "17.13.0", - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Microsoft.Testing.Extensions.Telemetry": "1.7.3", - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.7.3", - "Microsoft.Testing.Platform": "1.7.3" - } - }, - "Microsoft.Testing.Platform": { - "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "cI6u+CPxv3+07cbSwJVKOfxFrecbjfZnid1fe8EMhyPY4qmsSNnm+hN+GIy8u4JIlrADfrskDiwnScjRzVzJNw==" - }, - "Microsoft.Testing.Platform.MSBuild": { - "type": "Transitive", - "resolved": "1.7.3", - "contentHash": "tSIKXv7tLLYDjfodqLuTigsmOVcYj0CDC1rYeac5MTgHjbYV8IfmYh4FprBt/xE1zW8phkCYP766F9ayo560jA==", - "dependencies": { - "Microsoft.Testing.Platform": "1.7.3" - } - }, - "Microsoft.TestPlatform.AdapterUtilities": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bFZ3uAhosdXjyXKURDQy37fPosCJQwedB5DG/SzsXL1QXsrfsIYty2kQMqCRRUqm8sBZBRHWRp4BT9SmpWXcKQ==" - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Newtonsoft.Json": "13.0.1" - } - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" - }, - "StyleCop.Analyzers.Unstable": { - "type": "Transitive", - "resolved": "1.2.0.556", - "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" - }, - "System.Diagnostics.DiagnosticSource": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "fluentassertions": { - "type": "Project" - } - } - } -} \ No newline at end of file diff --git a/Tests/TestFrameworks/TUnit.Specs/packages.lock.json b/Tests/TestFrameworks/TUnit.Specs/packages.lock.json deleted file mode 100644 index a0b43aaba5..0000000000 --- a/Tests/TestFrameworks/TUnit.Specs/packages.lock.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "version": 1, - "dependencies": { - "net8.0": { - "Microsoft.Testing.Extensions.CodeCoverage": { - "type": "Direct", - "requested": "[17.14.2, )", - "resolved": "17.14.2", - "contentHash": "lCz1/FMGM8yf4UZh+yJL6ETvH78e7/NblWbK2/Lb6z02iiOtExea3hBQKX+vrq6vBo2o6ZCiYceOGq0t07PLkQ==", - "dependencies": { - "Microsoft.DiaSymReader": "2.0.0", - "Microsoft.Extensions.DependencyModel": "6.0.2", - "Microsoft.Testing.Platform": "1.6.2", - "System.Reflection.Metadata": "8.0.0" - } - }, - "Microsoft.Testing.Extensions.TrxReport": { - "type": "Direct", - "requested": "[1.8.4, )", - "resolved": "1.8.4", - "contentHash": "nJvqkyczCMhYWDJAOEkfqaOXUj9w8aDAF5D5el31hqjtJqPFPeBm7ZU1yKoDKC4/hVQ0WXUTs5Y6YfJwgdlf0A==", - "dependencies": { - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.4", - "Microsoft.Testing.Platform": "1.8.4" - } - }, - "TUnit": { - "type": "Direct", - "requested": "[0.57.65, )", - "resolved": "0.57.65", - "contentHash": "iGF7xXXH+KwK7Ue/N1ZeiOGG2B21qCGH4zTDIcOoMMFT+/XiDkHdq7QrO2ON8j7x8wAxYTQzOHV5dD2Pz+jPDg==", - "dependencies": { - "TUnit.Assertions": "0.57.65", - "TUnit.Engine": "0.57.65" - } - }, - "EnumerableAsyncProcessor": { - "type": "Transitive", - "resolved": "3.8.4", - "contentHash": "KlbpupRCz3Kf+P7gsiDvFXJ980i/9lfihMZFmmxIk0Gf6mopEjy74OTJZmdaKDQpE29eQDBnMZB5khyW3eugrg==" - }, - "Microsoft.DiaSymReader": { - "type": "Transitive", - "resolved": "2.0.0", - "contentHash": "QcZrCETsBJqy/vQpFtJc+jSXQ0K5sucQ6NUFbTNVHD4vfZZOwjZ/3sBzczkC4DityhD3AVO/+K/+9ioLs1AgRA==" - }, - "Microsoft.Extensions.DependencyModel": { - "type": "Transitive", - "resolved": "6.0.2", - "contentHash": "HS5YsudCGSVoCVdsYJ5FAO9vx0z04qSAXgVzpDJSQ1/w/X9q8hrQVGU2p+Yfui+2KcXLL+Zjc0SX3yJWtBmYiw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.4", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encodings.Web": "6.0.1", - "System.Text.Json": "6.0.11" - } - }, - "Microsoft.Testing.Extensions.TrxReport.Abstractions": { - "type": "Transitive", - "resolved": "1.8.4", - "contentHash": "jDGV5d9K5zeQG6I5ZHZrrXd0sO9up/XLpb5qI5W+FPGJx5JXx5yEiwkw0MIEykH9ydeMASPOmjbY/7jS++gYwA==", - "dependencies": { - "Microsoft.Testing.Platform": "1.8.4" - } - }, - "Microsoft.Testing.Platform": { - "type": "Transitive", - "resolved": "1.8.4", - "contentHash": "MpYE6A13G9zLZjkDmy2Fm/R0MRkjBR75P0F8B1yLaUshaATixPlk2S2OE6u/rlqtqMkbEyM7F6wxc332gZpBpA==" - }, - "Microsoft.Testing.Platform.MSBuild": { - "type": "Transitive", - "resolved": "1.4.3", - "contentHash": "1gGqgHtiZ6tZn/6Tby+qlKpNe5Ye/5LnxlSsyl4XMZ4m4V+Cu1K1m+gD1zxoxHIvLjgX8mCnQRK95MGBBFuumw==", - "dependencies": { - "Microsoft.Testing.Platform": "1.4.3" - } - }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" - }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==" - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==", - "dependencies": { - "System.Collections.Immutable": "8.0.0" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "6.0.1", - "contentHash": "E5M5AE2OUTlCrf4omZvzzziUJO9CofBl+lXHaN5IKePPJvHqYFYYpaDPgCpR4VwaFbEebfnjOxxEBtPtsqAxpQ==" - }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "6.0.11", - "contentHash": "xqC1HIbJMBFhrpYs76oYP+NAskNVjc6v73HqLal7ECRDPIp4oRU5pPavkD//vNactCn9DA2aaald/I5N+uZ5/g==" - }, - "System.Threading.Channels": { - "type": "Transitive", - "resolved": "9.0.0", - "contentHash": "hzACdIf1C+4Dqos5ijV404b94+LqfIC8nfS3mNpCDFWowb1N3PNfJPopneq32ahWlDeyaPZJqjBk76YFR69Rpg==" - }, - "TUnit.Assertions": { - "type": "Transitive", - "resolved": "0.57.65", - "contentHash": "2wIWM/DgR0sSkQrnrnEoewWOPhObIpHv7z714+Vw9B+rRwNyNWOEcIcH6W35dGhv9AW+BHNaxoPE3/bC+GfEKQ==" - }, - "TUnit.Core": { - "type": "Transitive", - "resolved": "0.57.65", - "contentHash": "hDuW+M94NiQBJUyvS9OjUy5q9cGs5AlVyel6Du2n01k9OsD3jt79OUi88m37MpCF1VQaMX50ny8n6N55r8KCJg==" - }, - "TUnit.Engine": { - "type": "Transitive", - "resolved": "0.57.65", - "contentHash": "aOBJWQmGOK8cOpKw3EGRtdekhYks6f4Js4ZPWyRiht1IrT/JenvJBfZdsR2w8Sib+iPMOnH+q6GDOWa8Sctq+w==", - "dependencies": { - "EnumerableAsyncProcessor": "3.8.4", - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.4", - "Microsoft.Testing.Platform": "1.8.4", - "Microsoft.Testing.Platform.MSBuild": "1.4.3", - "System.Threading.Channels": "9.0.0", - "TUnit.Core": "0.57.65" - } - }, - "fluentassertions": { - "type": "Project" - } - } - } -} \ No newline at end of file diff --git a/Tests/TestFrameworks/XUnit2.Specs/packages.lock.json b/Tests/TestFrameworks/XUnit2.Specs/packages.lock.json deleted file mode 100644 index 9a3e6251a0..0000000000 --- a/Tests/TestFrameworks/XUnit2.Specs/packages.lock.json +++ /dev/null @@ -1,269 +0,0 @@ -{ - "version": 1, - "dependencies": { - ".NETFramework,Version=v4.7": { - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0" - } - }, - "xunit": { - "type": "Direct", - "requested": "[2.9.3, )", - "resolved": "2.9.3", - "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", - "dependencies": { - "xunit.analyzers": "1.18.0", - "xunit.assert": "2.9.3", - "xunit.core": "[2.9.3]" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[2.8.2, )", - "resolved": "2.8.2", - "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.10.0" - } - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.10.0", - "contentHash": "KkwhjQevuDj0aBRoPLY6OLAhGqbPUEBuKLbaCs0kUVw29qiOYncdORd4mLVJbn9vGZ7/iFGQ/+AoJl0Tu5Umdg==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "1.5.0", - "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==", - "dependencies": { - "System.Collections.Immutable": "1.5.0" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "xunit.abstractions": { - "type": "Transitive", - "resolved": "2.0.3", - "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" - }, - "xunit.analyzers": { - "type": "Transitive", - "resolved": "1.18.0", - "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" - }, - "xunit.assert": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" - }, - "xunit.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]", - "xunit.extensibility.execution": "[2.9.3]" - } - }, - "xunit.extensibility.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", - "dependencies": { - "xunit.abstractions": "2.0.3" - } - }, - "xunit.extensibility.execution": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]" - } - }, - "fluentassertions": { - "type": "Project", - "dependencies": { - "System.Threading.Tasks.Extensions": "[4.5.4, )" - } - } - }, - "net6.0": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "CSharpGuidelinesAnalyzer": { - "type": "Direct", - "requested": "[3.8.5, )", - "resolved": "3.8.5", - "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" - }, - "Meziantou.Analyzer": { - "type": "Direct", - "requested": "[2.0.219, )", - "resolved": "2.0.219", - "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" - }, - "Microsoft.CodeAnalysis.BannedApiAnalyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0", - "Microsoft.TestPlatform.TestHost": "17.13.0" - } - }, - "Roslynator.Analyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" - }, - "StyleCop.Analyzers": { - "type": "Direct", - "requested": "[1.2.0-beta.556, )", - "resolved": "1.2.0-beta.556", - "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", - "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.556" - } - }, - "xunit": { - "type": "Direct", - "requested": "[2.9.3, )", - "resolved": "2.9.3", - "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", - "dependencies": { - "xunit.analyzers": "1.18.0", - "xunit.assert": "2.9.3", - "xunit.core": "[2.9.3]" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[2.8.2, )", - "resolved": "2.8.2", - "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Newtonsoft.Json": "13.0.1" - } - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" - }, - "StyleCop.Analyzers.Unstable": { - "type": "Transitive", - "resolved": "1.2.0.556", - "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "xunit.abstractions": { - "type": "Transitive", - "resolved": "2.0.3", - "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" - }, - "xunit.analyzers": { - "type": "Transitive", - "resolved": "1.18.0", - "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" - }, - "xunit.assert": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" - }, - "xunit.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]", - "xunit.extensibility.execution": "[2.9.3]" - } - }, - "xunit.extensibility.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", - "dependencies": { - "xunit.abstractions": "2.0.3" - } - }, - "xunit.extensibility.execution": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]" - } - }, - "fluentassertions": { - "type": "Project" - } - } - } -} \ No newline at end of file diff --git a/Tests/TestFrameworks/XUnit3.Specs/packages.lock.json b/Tests/TestFrameworks/XUnit3.Specs/packages.lock.json deleted file mode 100644 index b92b00af8c..0000000000 --- a/Tests/TestFrameworks/XUnit3.Specs/packages.lock.json +++ /dev/null @@ -1,451 +0,0 @@ -{ - "version": 1, - "dependencies": { - ".NETFramework,Version=v4.7.2": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[3.1.4, )", - "resolved": "3.1.4", - "contentHash": "5mj99LvCqrq3CNi06xYdyIAXOEh+5b33F2nErCzI5zWiDdLHXiPXEWFSUAF8zlIv0ZWqjZNCwHTQeAPYbF3pCg==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0" - } - }, - "xunit.v3": { - "type": "Direct", - "requested": "[3.0.1, )", - "resolved": "3.0.1", - "contentHash": "8AZKk/iiZAzRhNNq8yB8gcNpA+exGMGi3oodWnn0eI7vCwuuuAxnF6ANQC+q7z6FJoOyjiJnnBhS5YMoPPILjg==", - "dependencies": { - "xunit.analyzers": "1.24.0", - "xunit.v3.assert": "[3.0.1]", - "xunit.v3.core": "[3.0.1]" - } - }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.Testing.Extensions.TrxReport.Abstractions": { - "type": "Transitive", - "resolved": "1.8.2", - "contentHash": "QPaJgSfN0APwB6OtJO9jOGETv62d94fsDwLKh+Yu6vAFIP8wfml2CFLzaOlBIkbYFb8kG0s0Bd/VPLQrhCL3lg==", - "dependencies": { - "Microsoft.Testing.Platform": "1.8.2" - } - }, - "Microsoft.Testing.Platform": { - "type": "Transitive", - "resolved": "1.8.2", - "contentHash": "KTr/LYPhgT3IEzElGEEHldNJec0QMTouDhtwDmW+PAPAEzSKJQHtPaNA3pf0IL7ISmoKtuxxHV2v1Cq9xmelzQ==" - }, - "Microsoft.Testing.Platform.MSBuild": { - "type": "Transitive", - "resolved": "1.8.2", - "contentHash": "xL7h/wZR6NpzZrFqUMwE6Sa9i7jEPmxPHl11EG9iG1Szh3IHvhJkbmlKG74pm9YLnEysjVYFuA+ExBHxqQp8fg==", - "dependencies": { - "Microsoft.Testing.Platform": "1.8.2" - } - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" - }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "l4zZJ1WU2hqpQQHXz1rvC3etVZN+2DLmQMO79FhOTZHMn8tDRr+WU287sbomD0BETlmKDn0ygUgVy9k5xkkJdA==", - "dependencies": { - "System.Memory": "4.5.4", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.5", - "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "System.Numerics.Vectors": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==", - "dependencies": { - "System.Collections.Immutable": "1.5.0" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", - "dependencies": { - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "xunit.analyzers": { - "type": "Transitive", - "resolved": "1.24.0", - "contentHash": "kxaoMFFZcQ+mJudaKKlt3gCqV6M6Gjbka0NEs8JFDrxn52O7w5OOnYfSYVfqusk8p7pxrGdjgaQHlGINsNZHAQ==" - }, - "xunit.v3.assert": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "3h6AbEcfEsFn9RLjlG5yCTqEjgDHwMXRkNEhpGjAWMM68uHKWeItPbqzWj8P260gDT9NxPFfZRf3huYNnOlLRA==", - "dependencies": { - "System.Collections.Immutable": "6.0.0", - "System.Memory": "4.5.5" - } - }, - "xunit.v3.common": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "tL/lcgOHhPw4eb7Vx2WM97JFxW1WM9E0XNTra8UFQWdO9xtR7IXhVIZ6V4uXz5aApZ1FvdrrklImh+xneyrXmw==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "6.0.0" - } - }, - "xunit.v3.core": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "Gm6+sQi0LDIqEaWeB2ML0Hy9maYyr3JmptEylXcWpDn3MaUAcxkshZa1Jq60YrqHGG1gVoyCBHYJRd2pEjRs2A==", - "dependencies": { - "Microsoft.Testing.Platform.MSBuild": "1.8.2", - "xunit.v3.extensibility.core": "[3.0.1]", - "xunit.v3.runner.inproc.console": "[3.0.1]" - } - }, - "xunit.v3.extensibility.core": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "rud2rEHLGkPGeKc+O9OiUVWhLh8enjHYrlMlSgPfGQmUaLzGDoT7IjJcbyyDFJm8jEbWC2iOe6evqyw0ZfZWcA==", - "dependencies": { - "xunit.v3.common": "[3.0.1]" - } - }, - "xunit.v3.runner.common": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "r3jg64kY+8rGwG4IBq1+ELDlXvolcgvf707+Un8AeC6tmVsymOt6H00Kiptf3iPqjsnE3WsFJROI5XowdrbmAQ==", - "dependencies": { - "Microsoft.Win32.Registry": "[5.0.0]", - "xunit.v3.common": "[3.0.1]" - } - }, - "xunit.v3.runner.inproc.console": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "eV9DTPLuMmzQwMTPAkSHijBQUVLu6IoA1+/PkmtMFbU+EqA0EDriZ266EhlRBk7v+ymP8hliSQW/bGXJQEOBFw==", - "dependencies": { - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.2", - "Microsoft.Testing.Platform": "1.8.2", - "xunit.v3.extensibility.core": "[3.0.1]", - "xunit.v3.runner.common": "[3.0.1]" - } - }, - "fluentassertions": { - "type": "Project", - "dependencies": { - "System.Threading.Tasks.Extensions": "[4.5.4, )" - } - } - }, - ".NETFramework,Version=v4.7.2/win-x86": { - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", - "dependencies": { - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" - } - }, - "net8.0": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0", - "Microsoft.TestPlatform.TestHost": "17.13.0" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[3.1.4, )", - "resolved": "3.1.4", - "contentHash": "5mj99LvCqrq3CNi06xYdyIAXOEh+5b33F2nErCzI5zWiDdLHXiPXEWFSUAF8zlIv0ZWqjZNCwHTQeAPYbF3pCg==" - }, - "xunit.v3": { - "type": "Direct", - "requested": "[3.0.1, )", - "resolved": "3.0.1", - "contentHash": "8AZKk/iiZAzRhNNq8yB8gcNpA+exGMGi3oodWnn0eI7vCwuuuAxnF6ANQC+q7z6FJoOyjiJnnBhS5YMoPPILjg==", - "dependencies": { - "xunit.analyzers": "1.24.0", - "xunit.v3.assert": "[3.0.1]", - "xunit.v3.core": "[3.0.1]" - } - }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==" - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==" - }, - "Microsoft.Testing.Extensions.TrxReport.Abstractions": { - "type": "Transitive", - "resolved": "1.8.2", - "contentHash": "QPaJgSfN0APwB6OtJO9jOGETv62d94fsDwLKh+Yu6vAFIP8wfml2CFLzaOlBIkbYFb8kG0s0Bd/VPLQrhCL3lg==", - "dependencies": { - "Microsoft.Testing.Platform": "1.8.2" - } - }, - "Microsoft.Testing.Platform": { - "type": "Transitive", - "resolved": "1.8.2", - "contentHash": "KTr/LYPhgT3IEzElGEEHldNJec0QMTouDhtwDmW+PAPAEzSKJQHtPaNA3pf0IL7ISmoKtuxxHV2v1Cq9xmelzQ==" - }, - "Microsoft.Testing.Platform.MSBuild": { - "type": "Transitive", - "resolved": "1.8.2", - "contentHash": "xL7h/wZR6NpzZrFqUMwE6Sa9i7jEPmxPHl11EG9iG1Szh3IHvhJkbmlKG74pm9YLnEysjVYFuA+ExBHxqQp8fg==", - "dependencies": { - "Microsoft.Testing.Platform": "1.8.2" - } - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Newtonsoft.Json": "13.0.1" - } - }, - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" - }, - "xunit.analyzers": { - "type": "Transitive", - "resolved": "1.24.0", - "contentHash": "kxaoMFFZcQ+mJudaKKlt3gCqV6M6Gjbka0NEs8JFDrxn52O7w5OOnYfSYVfqusk8p7pxrGdjgaQHlGINsNZHAQ==" - }, - "xunit.v3.assert": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "3h6AbEcfEsFn9RLjlG5yCTqEjgDHwMXRkNEhpGjAWMM68uHKWeItPbqzWj8P260gDT9NxPFfZRf3huYNnOlLRA==" - }, - "xunit.v3.common": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "tL/lcgOHhPw4eb7Vx2WM97JFxW1WM9E0XNTra8UFQWdO9xtR7IXhVIZ6V4uXz5aApZ1FvdrrklImh+xneyrXmw==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "6.0.0" - } - }, - "xunit.v3.core": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "Gm6+sQi0LDIqEaWeB2ML0Hy9maYyr3JmptEylXcWpDn3MaUAcxkshZa1Jq60YrqHGG1gVoyCBHYJRd2pEjRs2A==", - "dependencies": { - "Microsoft.Testing.Platform.MSBuild": "1.8.2", - "xunit.v3.extensibility.core": "[3.0.1]", - "xunit.v3.runner.inproc.console": "[3.0.1]" - } - }, - "xunit.v3.extensibility.core": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "rud2rEHLGkPGeKc+O9OiUVWhLh8enjHYrlMlSgPfGQmUaLzGDoT7IjJcbyyDFJm8jEbWC2iOe6evqyw0ZfZWcA==", - "dependencies": { - "xunit.v3.common": "[3.0.1]" - } - }, - "xunit.v3.runner.common": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "r3jg64kY+8rGwG4IBq1+ELDlXvolcgvf707+Un8AeC6tmVsymOt6H00Kiptf3iPqjsnE3WsFJROI5XowdrbmAQ==", - "dependencies": { - "Microsoft.Win32.Registry": "[5.0.0]", - "xunit.v3.common": "[3.0.1]" - } - }, - "xunit.v3.runner.inproc.console": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "eV9DTPLuMmzQwMTPAkSHijBQUVLu6IoA1+/PkmtMFbU+EqA0EDriZ266EhlRBk7v+ymP8hliSQW/bGXJQEOBFw==", - "dependencies": { - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.2", - "Microsoft.Testing.Platform": "1.8.2", - "xunit.v3.extensibility.core": "[3.0.1]", - "xunit.v3.runner.common": "[3.0.1]" - } - }, - "fluentassertions": { - "type": "Project" - } - }, - "net8.0/win-x86": { - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" - } - } - } -} \ No newline at end of file diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/packages.lock.json b/Tests/TestFrameworks/XUnit3Core.Specs/packages.lock.json deleted file mode 100644 index a19cb2dec4..0000000000 --- a/Tests/TestFrameworks/XUnit3Core.Specs/packages.lock.json +++ /dev/null @@ -1,383 +0,0 @@ -{ - "version": 1, - "dependencies": { - ".NETFramework,Version=v4.7.2": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[3.1.4, )", - "resolved": "3.1.4", - "contentHash": "5mj99LvCqrq3CNi06xYdyIAXOEh+5b33F2nErCzI5zWiDdLHXiPXEWFSUAF8zlIv0ZWqjZNCwHTQeAPYbF3pCg==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0" - } - }, - "xunit.v3.core": { - "type": "Direct", - "requested": "[3.0.1, )", - "resolved": "3.0.1", - "contentHash": "Gm6+sQi0LDIqEaWeB2ML0Hy9maYyr3JmptEylXcWpDn3MaUAcxkshZa1Jq60YrqHGG1gVoyCBHYJRd2pEjRs2A==", - "dependencies": { - "Microsoft.Testing.Platform.MSBuild": "1.8.2", - "xunit.v3.extensibility.core": "[3.0.1]", - "xunit.v3.runner.inproc.console": "[3.0.1]" - } - }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.Testing.Extensions.TrxReport.Abstractions": { - "type": "Transitive", - "resolved": "1.8.2", - "contentHash": "QPaJgSfN0APwB6OtJO9jOGETv62d94fsDwLKh+Yu6vAFIP8wfml2CFLzaOlBIkbYFb8kG0s0Bd/VPLQrhCL3lg==", - "dependencies": { - "Microsoft.Testing.Platform": "1.8.2" - } - }, - "Microsoft.Testing.Platform": { - "type": "Transitive", - "resolved": "1.8.2", - "contentHash": "KTr/LYPhgT3IEzElGEEHldNJec0QMTouDhtwDmW+PAPAEzSKJQHtPaNA3pf0IL7ISmoKtuxxHV2v1Cq9xmelzQ==" - }, - "Microsoft.Testing.Platform.MSBuild": { - "type": "Transitive", - "resolved": "1.8.2", - "contentHash": "xL7h/wZR6NpzZrFqUMwE6Sa9i7jEPmxPHl11EG9iG1Szh3IHvhJkbmlKG74pm9YLnEysjVYFuA+ExBHxqQp8fg==", - "dependencies": { - "Microsoft.Testing.Platform": "1.8.2" - } - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "1.5.0", - "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==", - "dependencies": { - "System.Collections.Immutable": "1.5.0" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", - "dependencies": { - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "xunit.v3.common": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "tL/lcgOHhPw4eb7Vx2WM97JFxW1WM9E0XNTra8UFQWdO9xtR7IXhVIZ6V4uXz5aApZ1FvdrrklImh+xneyrXmw==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "6.0.0" - } - }, - "xunit.v3.extensibility.core": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "rud2rEHLGkPGeKc+O9OiUVWhLh8enjHYrlMlSgPfGQmUaLzGDoT7IjJcbyyDFJm8jEbWC2iOe6evqyw0ZfZWcA==", - "dependencies": { - "xunit.v3.common": "[3.0.1]" - } - }, - "xunit.v3.runner.common": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "r3jg64kY+8rGwG4IBq1+ELDlXvolcgvf707+Un8AeC6tmVsymOt6H00Kiptf3iPqjsnE3WsFJROI5XowdrbmAQ==", - "dependencies": { - "Microsoft.Win32.Registry": "[5.0.0]", - "xunit.v3.common": "[3.0.1]" - } - }, - "xunit.v3.runner.inproc.console": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "eV9DTPLuMmzQwMTPAkSHijBQUVLu6IoA1+/PkmtMFbU+EqA0EDriZ266EhlRBk7v+ymP8hliSQW/bGXJQEOBFw==", - "dependencies": { - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.2", - "Microsoft.Testing.Platform": "1.8.2", - "xunit.v3.extensibility.core": "[3.0.1]", - "xunit.v3.runner.common": "[3.0.1]" - } - }, - "fluentassertions": { - "type": "Project", - "dependencies": { - "System.Threading.Tasks.Extensions": "[4.5.4, )" - } - } - }, - ".NETFramework,Version=v4.7.2/win-x86": { - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", - "dependencies": { - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" - } - }, - "net8.0": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0", - "Microsoft.TestPlatform.TestHost": "17.13.0" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[3.1.4, )", - "resolved": "3.1.4", - "contentHash": "5mj99LvCqrq3CNi06xYdyIAXOEh+5b33F2nErCzI5zWiDdLHXiPXEWFSUAF8zlIv0ZWqjZNCwHTQeAPYbF3pCg==" - }, - "xunit.v3.core": { - "type": "Direct", - "requested": "[3.0.1, )", - "resolved": "3.0.1", - "contentHash": "Gm6+sQi0LDIqEaWeB2ML0Hy9maYyr3JmptEylXcWpDn3MaUAcxkshZa1Jq60YrqHGG1gVoyCBHYJRd2pEjRs2A==", - "dependencies": { - "Microsoft.Testing.Platform.MSBuild": "1.8.2", - "xunit.v3.extensibility.core": "[3.0.1]", - "xunit.v3.runner.inproc.console": "[3.0.1]" - } - }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==" - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==" - }, - "Microsoft.Testing.Extensions.TrxReport.Abstractions": { - "type": "Transitive", - "resolved": "1.8.2", - "contentHash": "QPaJgSfN0APwB6OtJO9jOGETv62d94fsDwLKh+Yu6vAFIP8wfml2CFLzaOlBIkbYFb8kG0s0Bd/VPLQrhCL3lg==", - "dependencies": { - "Microsoft.Testing.Platform": "1.8.2" - } - }, - "Microsoft.Testing.Platform": { - "type": "Transitive", - "resolved": "1.8.2", - "contentHash": "KTr/LYPhgT3IEzElGEEHldNJec0QMTouDhtwDmW+PAPAEzSKJQHtPaNA3pf0IL7ISmoKtuxxHV2v1Cq9xmelzQ==" - }, - "Microsoft.Testing.Platform.MSBuild": { - "type": "Transitive", - "resolved": "1.8.2", - "contentHash": "xL7h/wZR6NpzZrFqUMwE6Sa9i7jEPmxPHl11EG9iG1Szh3IHvhJkbmlKG74pm9YLnEysjVYFuA+ExBHxqQp8fg==", - "dependencies": { - "Microsoft.Testing.Platform": "1.8.2" - } - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Newtonsoft.Json": "13.0.1" - } - }, - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" - }, - "xunit.v3.common": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "tL/lcgOHhPw4eb7Vx2WM97JFxW1WM9E0XNTra8UFQWdO9xtR7IXhVIZ6V4uXz5aApZ1FvdrrklImh+xneyrXmw==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "6.0.0" - } - }, - "xunit.v3.extensibility.core": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "rud2rEHLGkPGeKc+O9OiUVWhLh8enjHYrlMlSgPfGQmUaLzGDoT7IjJcbyyDFJm8jEbWC2iOe6evqyw0ZfZWcA==", - "dependencies": { - "xunit.v3.common": "[3.0.1]" - } - }, - "xunit.v3.runner.common": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "r3jg64kY+8rGwG4IBq1+ELDlXvolcgvf707+Un8AeC6tmVsymOt6H00Kiptf3iPqjsnE3WsFJROI5XowdrbmAQ==", - "dependencies": { - "Microsoft.Win32.Registry": "[5.0.0]", - "xunit.v3.common": "[3.0.1]" - } - }, - "xunit.v3.runner.inproc.console": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "eV9DTPLuMmzQwMTPAkSHijBQUVLu6IoA1+/PkmtMFbU+EqA0EDriZ266EhlRBk7v+ymP8hliSQW/bGXJQEOBFw==", - "dependencies": { - "Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.8.2", - "Microsoft.Testing.Platform": "1.8.2", - "xunit.v3.extensibility.core": "[3.0.1]", - "xunit.v3.runner.common": "[3.0.1]" - } - }, - "fluentassertions": { - "type": "Project" - } - }, - "net8.0/win-x86": { - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" - } - } - } -} \ No newline at end of file diff --git a/Tests/VB.Specs/packages.lock.json b/Tests/VB.Specs/packages.lock.json deleted file mode 100644 index b33310bcde..0000000000 --- a/Tests/VB.Specs/packages.lock.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "version": 1, - "dependencies": { - "net6.0": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "lkhqpF8Pu2Y7IiN7OntbsTtdbpR1syMsm2F3IgX6ootA4ffRqWL5jF7XipHuZQTdVuWG/gVAAcf8mjk8Tz0xPg==" - }, - "CSharpGuidelinesAnalyzer": { - "type": "Direct", - "requested": "[3.8.5, )", - "resolved": "3.8.5", - "contentHash": "B6wCJI2akqID1NowxX+5NAvokUoZBSbXANHREwSfLrrvtaZVuMIG33855hVJXVO8gSuo/b/Wr5H9xxWf75cV7A==" - }, - "Meziantou.Analyzer": { - "type": "Direct", - "requested": "[2.0.219, )", - "resolved": "2.0.219", - "contentHash": "vknqxTO59DkRmsuyA3GoQ8zLODHTVrt2enVozcRLY22D3LRJm3qRNYIkpFl1lfejOsahrMwObtYzKLmWf7/XTQ==" - }, - "Microsoft.CodeAnalysis.BannedApiAnalyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "gSWJlDWwmDhtbrEJGiHqvEjz9KthIiFD0qYB8zZ6a7z+xpMSPEtM9yTYELSa58iFWYlzSRqP9FXO6KoT3+ZMtg==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.13.0, )", - "resolved": "17.13.0", - "contentHash": "W19wCPizaIC9Zh47w8wWI/yxuqR7/dtABwOrc8r2jX/8mUNxM2vw4fXDh+DJTeogxV+KzKwg5jNNGQVwf3LXyA==", - "dependencies": { - "Microsoft.CodeCoverage": "17.13.0", - "Microsoft.TestPlatform.TestHost": "17.13.0" - } - }, - "Roslynator.Analyzers": { - "type": "Direct", - "requested": "[4.14.0, )", - "resolved": "4.14.0", - "contentHash": "AEWQMrb1rcmjv9FGzrwYSBb4INhDhsauS+wwTumG0wq8N1Il+CIQHqUZJ7bt0zYJEA1qXSqgpg8Fgwc88WrR/Q==" - }, - "StyleCop.Analyzers": { - "type": "Direct", - "requested": "[1.2.0-beta.556, )", - "resolved": "1.2.0-beta.556", - "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", - "dependencies": { - "StyleCop.Analyzers.Unstable": "1.2.0.556" - } - }, - "xunit": { - "type": "Direct", - "requested": "[2.9.3, )", - "resolved": "2.9.3", - "contentHash": "TlXQBinK35LpOPKHAqbLY4xlEen9TBafjs0V5KnA4wZsoQLQJiirCR4CbIXvOH8NzkW4YeJKP5P/Bnrodm0h9Q==", - "dependencies": { - "xunit.analyzers": "1.18.0", - "xunit.assert": "2.9.3", - "xunit.core": "[2.9.3]" - } - }, - "xunit.runner.visualstudio": { - "type": "Direct", - "requested": "[3.0.0, )", - "resolved": "3.0.0", - "contentHash": "HggUqjQJe8PtDxcP25Q+CnR6Lz4oX3GElhD9V4oU2+75x9HI6A6sxbfKGS4UwU4t4yJaS9fBmAuriz8bQApNjw==" - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9LIUy0y+DvUmEPtbRDw6Bay3rzwqFV8P4efTrK4CZhQle3M/QwLPjISghfcolmEGAPWxuJi6m98ZEfk4VR4Lfg==" - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "bt0E0Dx+iqW97o4A59RCmUmz/5NarJ7LRL+jXbSHod72ibL5XdNm1Ke+UO5tFhBG4VwHLcSjqq9BUSblGNWamw==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.13.0", - "contentHash": "9GGw08Dc3AXspjekdyTdZ/wYWFlxbgcF0s7BKxzVX+hzAwpifDOdxM+ceVaaJSQOwqt3jtuNlHn3XTpKUS9x9Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.13.0", - "Newtonsoft.Json": "13.0.1" - } - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" - }, - "StyleCop.Analyzers.Unstable": { - "type": "Transitive", - "resolved": "1.2.0.556", - "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "xunit.abstractions": { - "type": "Transitive", - "resolved": "2.0.3", - "contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==" - }, - "xunit.analyzers": { - "type": "Transitive", - "resolved": "1.18.0", - "contentHash": "OtFMHN8yqIcYP9wcVIgJrq01AfTxijjAqVDy/WeQVSyrDC1RzBWeQPztL49DN2syXRah8TYnfvk035s7L95EZQ==" - }, - "xunit.assert": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "/Kq28fCE7MjOV42YLVRAJzRF0WmEqsmflm0cfpMjGtzQ2lR5mYVj1/i0Y8uDAOLczkL3/jArrwehfMD0YogMAA==" - }, - "xunit.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "BiAEvqGvyme19wE0wTKdADH+NloYqikiU0mcnmiNyXaF9HyHmE6sr/3DC5vnBkgsWaE6yPyWszKSPSApWdRVeQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]", - "xunit.extensibility.execution": "[2.9.3]" - } - }, - "xunit.extensibility.core": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==", - "dependencies": { - "xunit.abstractions": "2.0.3" - } - }, - "xunit.extensibility.execution": { - "type": "Transitive", - "resolved": "2.9.3", - "contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==", - "dependencies": { - "xunit.extensibility.core": "[2.9.3]" - } - }, - "fluentassertions": { - "type": "Project" - } - } - } -} \ No newline at end of file From c84625dd87f7cb92702de2e518bab6bcdfb3be12 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sat, 20 Sep 2025 09:10:31 +0200 Subject: [PATCH 697/845] Clean-up tests related to exceptions --- .../Exceptions/ExceptionAssertionSpecs.cs | 80 ------------------- .../Exceptions/InnerExceptionSpecs.cs | 26 +++--- .../Exceptions/InvokingActionSpecs.cs | 8 +- .../Exceptions/InvokingFunctionSpecs.cs | 10 +-- .../Exceptions/MiscellaneousExceptionSpecs.cs | 36 ++++++--- .../Exceptions/NotThrowSpecs.cs | 18 ++--- .../Exceptions/OuterExceptionSpecs.cs | 66 +++++++-------- .../Exceptions/ThrowAssertionsSpecs.cs | 30 +++---- 8 files changed, 102 insertions(+), 172 deletions(-) diff --git a/Tests/FluentAssertions.Specs/Exceptions/ExceptionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/ExceptionAssertionSpecs.cs index ed8b09b890..d117ad5c45 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/ExceptionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/ExceptionAssertionSpecs.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using Xunit; using Xunit.Sdk; @@ -150,82 +149,3 @@ public void ThrowExactly_when_subject_throws_expected_exception_it_should_not_do act.Should().ThrowExactly(); } } - -public class SomeTestClass -{ - internal const string ExceptionMessage = "someMessage"; - - public IList Strings = new List(); - - public void Throw() - { - throw new ArgumentException(ExceptionMessage); - } -} - -public abstract class Does -{ - public abstract void Do(); - - public abstract void Do(string someParam); - - public abstract int Return(); - - public static Does Throw(TException exception) - where TException : Exception - { - return new DoesThrow(exception); - } - - public static Does Throw() - where TException : Exception, new() - { - return Throw(new TException()); - } - - public static Does NotThrow() => new DoesNotThrow(); - - private class DoesThrow : Does - where TException : Exception - { - private readonly TException exception; - - public DoesThrow(TException exception) - { - this.exception = exception; - } - - public override void Do() => throw exception; - - public override void Do(string someParam) => throw exception; - - public override int Return() => throw exception; - } - - private class DoesNotThrow : Does - { - public override void Do() { } - - public override void Do(string someParam) { } - - public override int Return() => 42; - } -} - -internal class ExceptionWithProperties : Exception -{ - public ExceptionWithProperties(string propertyValue) - { - Property = propertyValue; - } - - public string Property { get; set; } -} - -internal class ExceptionWithEmptyToString : Exception -{ - public override string ToString() - { - return string.Empty; - } -} diff --git a/Tests/FluentAssertions.Specs/Exceptions/InnerExceptionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/InnerExceptionSpecs.cs index a39a633832..ec657ab94b 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/InnerExceptionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/InnerExceptionSpecs.cs @@ -1,4 +1,4 @@ -using System; +using System; using Xunit; using Xunit.Sdk; @@ -10,11 +10,10 @@ public class InnerExceptionSpecs public void When_subject_throws_an_exception_with_the_expected_inner_exception_it_should_not_do_anything() { // Arrange - Does testSubject = Does.Throw(new Exception("", new ArgumentException())); + Action testSubject = () => throw new Exception("", new ArgumentException()); // Act / Assert testSubject - .Invoking(x => x.Do()) .Should().Throw() .WithInnerException(); } @@ -23,11 +22,10 @@ public void When_subject_throws_an_exception_with_the_expected_inner_exception_i public void When_subject_throws_an_exception_with_the_expected_inner_base_exception_it_should_not_do_anything() { // Arrange - Does testSubject = Does.Throw(new Exception("", new ArgumentNullException())); + Action testSubject = () => throw new Exception("", new ArgumentNullException()); // Act / Assert testSubject - .Invoking(x => x.Do()) .Should().Throw() .WithInnerException(); } @@ -36,11 +34,10 @@ public void When_subject_throws_an_exception_with_the_expected_inner_base_except public void When_subject_throws_an_exception_with_the_expected_inner_exception_from_argument_it_should_not_do_anything() { // Arrange - Does testSubject = Does.Throw(new Exception("", new ArgumentException())); + Action testSubject = () => throw new Exception("", new ArgumentException()); // Act / Assert testSubject - .Invoking(x => x.Do()) .Should().Throw() .WithInnerException(typeof(ArgumentException)); } @@ -186,15 +183,14 @@ public void When_subject_throws_an_exception_with_an_unexpected_inner_exception_ // Arrange var innerException = new NullReferenceException("InnerExceptionMessage"); - Does testSubject = Does.Throw(new Exception("", innerException)); + Action testSubject = () => throw new Exception("", innerException); try { // Act testSubject - .Invoking(x => x.Do()) .Should().Throw() - .WithInnerException("because {0} should do just that", "Does.Do"); + .WithInnerException("because {0} should do just that", "the action"); throw new XunitException("This point should not be reached"); } @@ -202,7 +198,7 @@ public void When_subject_throws_an_exception_with_an_unexpected_inner_exception_ { // Assert exc.Message.Should().Match( - "Expected*ArgumentException*Does.Do should do just that*NullReferenceException*InnerExceptionMessage*"); + "Expected*ArgumentException*the action should do just that*NullReferenceException*InnerExceptionMessage*"); } } @@ -211,17 +207,17 @@ public void When_subject_throws_an_exception_without_expected_inner_exception_it { try { - Does testSubject = Does.Throw(); + Action testSubject = () => throw new Exception(); - testSubject.Invoking(x => x.Do()).Should().Throw() - .WithInnerException("because {0} should do that", "Does.Do"); + testSubject.Should().Throw() + .WithInnerException("because {0} should do that", "the action"); throw new XunitException("This point should not be reached"); } catch (XunitException ex) { ex.Message.Should().Be( - "Expected inner System.InvalidOperationException because Does.Do should do that, but the thrown exception has no inner exception."); + "Expected inner System.InvalidOperationException because the action should do that, but the thrown exception has no inner exception."); } } diff --git a/Tests/FluentAssertions.Specs/Exceptions/InvokingActionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/InvokingActionSpecs.cs index 1f2a4dca8e..7f8c973171 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/InvokingActionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/InvokingActionSpecs.cs @@ -1,4 +1,4 @@ -using System; +using System; using Xunit; namespace FluentAssertions.Specs.Exceptions; @@ -9,10 +9,10 @@ public class InvokingActionSpecs public void Invoking_on_null_is_not_allowed() { // Arrange - Does someClass = null; + Action someClass = null; // Act - Action act = () => someClass.Invoking(d => d.Do()); + Action act = () => someClass.Invoking(d => d()); // Assert act.Should().ThrowExactly() @@ -23,7 +23,7 @@ public void Invoking_on_null_is_not_allowed() public void Invoking_with_null_is_not_allowed() { // Arrange - Does someClass = Does.NotThrow(); + Action someClass = () => { }; // Act Action act = () => someClass.Invoking(null); diff --git a/Tests/FluentAssertions.Specs/Exceptions/InvokingFunctionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/InvokingFunctionSpecs.cs index 8b706ec218..54e84694d9 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/InvokingFunctionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/InvokingFunctionSpecs.cs @@ -1,4 +1,4 @@ -using System; +using System; using Xunit; namespace FluentAssertions.Specs.Exceptions; @@ -9,10 +9,10 @@ public class InvokingFunctionSpecs public void Invoking_on_null_is_not_allowed() { // Arrange - Does someClass = null; + Func someClass = null; // Act - Action act = () => someClass.Invoking(d => d.Return()); + Action act = () => someClass.Invoking(d => d()); // Assert act.Should().ThrowExactly() @@ -23,10 +23,10 @@ public void Invoking_on_null_is_not_allowed() public void Invoking_with_null_is_not_allowed() { // Arrange - Does someClass = Does.NotThrow(); + Action someClass = () => { }; // Act - Action act = () => someClass.Invoking((Func)null); + Action act = () => someClass.Invoking((Func)null); // Assert act.Should().ThrowExactly() diff --git a/Tests/FluentAssertions.Specs/Exceptions/MiscellaneousExceptionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/MiscellaneousExceptionSpecs.cs index 430fc82bb5..ebf4a2aa4e 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/MiscellaneousExceptionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/MiscellaneousExceptionSpecs.cs @@ -1,35 +1,53 @@ -using System; +using System; using System.Collections.Generic; using Xunit; using Xunit.Sdk; namespace FluentAssertions.Specs.Exceptions; +internal class ExceptionWithEmptyToString : Exception +{ + public override string ToString() + { + return string.Empty; + } +} + +internal class ExceptionWithProperties : Exception +{ + public ExceptionWithProperties(string propertyValue) + { + Property = propertyValue; + } + + public string Property { get; set; } +} + public class MiscellaneousExceptionSpecs { [Fact] public void When_getting_value_of_property_of_thrown_exception_it_should_return_value_of_property() { // Arrange - const string SomeParamNameValue = "param"; - Does target = Does.Throw(new ExceptionWithProperties(SomeParamNameValue)); + const string someParamNameValue = "param"; + Action target = () => throw new ExceptionWithProperties(someParamNameValue); // Act - Action act = target.Do; + Action act = target; // Assert - act.Should().Throw().And.Property.Should().Be(SomeParamNameValue); + act.Should().Throw().And.Property.Should().Be(someParamNameValue); } [Fact] public void When_validating_a_subject_against_multiple_conditions_it_should_support_chaining() { // Arrange - Does testSubject = Does.Throw(new InvalidOperationException("message", new ArgumentException("inner message"))); + Action testSubject = () => throw new InvalidOperationException("message", new ArgumentException("inner message")); // Act / Assert testSubject - .Invoking(x => x.Do()) + .Should().Throw() .WithInnerException() .WithMessage("inner message"); @@ -126,8 +144,8 @@ public void When_custom_condition_is_met_it_should_not_throw() public void When_two_exceptions_are_thrown_and_the_assertion_assumes_there_can_only_be_one_it_should_fail() { // Arrange - Does testSubject = Does.Throw(new AggregateException(new Exception(), new Exception())); - Action throwingMethod = testSubject.Do; + Action testSubject = () => throw new AggregateException(new Exception(), new Exception()); + Action throwingMethod = testSubject; // Act Action action = () => throwingMethod.Should().Throw().And.Message.Should(); diff --git a/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs index 04013c0a39..31ebaf51ad 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs @@ -1,4 +1,4 @@ -using System; +using System; using FluentAssertions.Execution; #if NET47 using FluentAssertions.Specs.Common; @@ -34,11 +34,11 @@ public void When_subject_is_null_when_an_exception_should_not_be_thrown_it_shoul public void When_a_specific_exception_should_not_be_thrown_but_it_was_it_should_throw() { // Arrange - Does foo = Does.Throw(new ArgumentException("An exception was forced")); + Action foo = () => throw new ArgumentException("An exception was forced"); // Act Action action = - () => foo.Invoking(f => f.Do()).Should().NotThrow("we passed valid arguments"); + () => foo.Should().NotThrow("we passed valid arguments"); // Assert action @@ -51,20 +51,20 @@ public void When_a_specific_exception_should_not_be_thrown_but_it_was_it_should_ public void When_a_specific_exception_should_not_be_thrown_but_another_was_it_should_succeed() { // Arrange - Does foo = Does.Throw(); + Action foo = () => throw new ArgumentException(); // Act / Assert - foo.Invoking(f => f.Do()).Should().NotThrow(); + foo.Should().NotThrow(); } [Fact] public void When_no_exception_should_be_thrown_but_it_was_it_should_throw() { // Arrange - Does foo = Does.Throw(new ArgumentException("An exception was forced")); + Action foo = () => throw new ArgumentException("An exception was forced"); // Act - Action action = () => foo.Invoking(f => f.Do()).Should().NotThrow("we passed valid arguments"); + Action action = () => foo.Should().NotThrow("we passed valid arguments"); // Assert action @@ -77,10 +77,10 @@ public void When_no_exception_should_be_thrown_but_it_was_it_should_throw() public void When_no_exception_should_be_thrown_and_none_was_it_should_not_throw() { // Arrange - Does foo = Does.NotThrow(); + Action foo = () => { }; // Act / Assert - foo.Invoking(f => f.Do()).Should().NotThrow(); + foo.Should().NotThrow(); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs index d8922be2f0..548460ea3f 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics.CodeAnalysis; using Xunit; using Xunit.Sdk; @@ -11,23 +11,23 @@ public class OuterExceptionSpecs public void When_subject_throws_expected_exception_with_an_expected_message_it_should_not_do_anything() { // Arrange - Does testSubject = Does.Throw(new InvalidOperationException("some message")); + Action testSubject = () => throw new InvalidOperationException("some message"); // Act / Assert - testSubject.Invoking(x => x.Do()).Should().Throw().WithMessage("some message"); + testSubject.Should().Throw().WithMessage("some message"); } [Fact] public void When_subject_throws_expected_exception_but_with_unexpected_message_it_should_throw() { // Arrange - Does testSubject = Does.Throw(new InvalidOperationException("some")); + Action testSubject = () => throw new InvalidOperationException("some"); try { // Act testSubject - .Invoking(x => x.Do()) + .Should().Throw() .WithMessage("some message"); @@ -45,13 +45,13 @@ public void When_subject_throws_expected_exception_but_with_unexpected_message_i public void Long_exception_messages_are_rendered_over_multiple_lines() { // Arrange - Does testSubject = Does.Throw(new InvalidOperationException("some")); + Action testSubject = () => throw new InvalidOperationException("some"); try { // Act testSubject - .Invoking(x => x.Do()) + .Should().Throw() .WithMessage(new string('#', 101)); @@ -80,13 +80,13 @@ does not. public void Multiline_exception_messages_are_rendered_over_multiple_lines() { // Arrange - Does testSubject = Does.Throw(new InvalidOperationException("some")); + Action testSubject = () => throw new InvalidOperationException("some"); try { // Act testSubject - .Invoking(x => x.Do()) + .Should().Throw() .WithMessage(""" line1* @@ -119,13 +119,13 @@ does not. public void Short_exception_messages_are_rendered_on_a_single_line() { // Arrange - Does testSubject = Does.Throw(new InvalidOperationException("some")); + Action testSubject = () => throw new InvalidOperationException("some"); try { // Act testSubject - .Invoking(x => x.Do()) + .Should().Throw() .WithMessage(new string('#', 50)); @@ -143,10 +143,10 @@ public void Short_exception_messages_are_rendered_on_a_single_line() public void When_subject_throws_expected_exception_with_message_starting_with_expected_message_it_should_not_throw() { // Arrange - Does testSubject = Does.Throw(new InvalidOperationException("expected message")); + Action testSubject = () => throw new InvalidOperationException("expected message"); // Act - Action action = testSubject.Do; + Action action = testSubject; // Assert action.Should().Throw() @@ -158,11 +158,10 @@ public void When_subject_throws_expected_exception_with_message_starting_with_ex public void When_subject_throws_expected_exception_with_message_that_does_not_start_with_expected_message_it_should_throw() { // Arrange - Does testSubject = Does.Throw(new InvalidOperationException("OxpectOd message")); + Action testSubject = () => throw new InvalidOperationException("OxpectOd message"); // Act Action action = () => testSubject - .Invoking(s => s.Do()) .Should().Throw() .WithMessage("Expected mes"); @@ -177,10 +176,10 @@ public void When_subject_throws_expected_exception_with_message_starting_with_expected_equivalent_message_it_should_not_throw() { // Arrange - Does testSubject = Does.Throw(new InvalidOperationException("Expected Message")); + Action testSubject = () => throw new InvalidOperationException("Expected Message"); // Act - Action action = testSubject.Do; + Action action = testSubject; // Assert action.Should().Throw() @@ -192,11 +191,10 @@ public void public void When_subject_throws_expected_exception_with_message_that_does_not_start_with_equivalent_message_it_should_throw() { // Arrange - Does testSubject = Does.Throw(new InvalidOperationException("OxpectOd message")); + Action testSubject = () => throw new InvalidOperationException("OxpectOd message"); // Act Action action = () => testSubject - .Invoking(s => s.Do()) .Should().Throw() .WithMessage("expected mes"); @@ -210,13 +208,13 @@ public void When_subject_throws_expected_exception_with_message_that_does_not_st public void When_subject_throws_some_exception_with_unexpected_message_it_should_throw_with_clear_description() { // Arrange - Does subjectThatThrows = Does.Throw(new InvalidOperationException("message1")); + Action subjectThatThrows = () => throw new InvalidOperationException("message1"); try { // Act subjectThatThrows - .Invoking(x => x.Do()) + .Should().Throw() .WithMessage("message2", "because we want to test the failure {0}", "message"); @@ -234,13 +232,13 @@ public void When_subject_throws_some_exception_with_unexpected_message_it_should public void When_subject_throws_some_exception_with_an_empty_message_it_should_throw_with_clear_description() { // Arrange - Does subjectThatThrows = Does.Throw(new InvalidOperationException("")); + Action subjectThatThrows = () => throw new InvalidOperationException(""); try { // Act subjectThatThrows - .Invoking(x => x.Do()) + .Should().Throw() .WithMessage("message2"); @@ -259,13 +257,12 @@ public void When_subject_throws_some_exception_with_message_which_contains_complete_expected_exception_and_more_it_should_throw() { // Arrange - Does subjectThatThrows = Does.Throw(new ArgumentNullException("someParam", "message2")); + Action subjectThatThrows = () => throw new ArgumentNullException("someParam", "message2"); try { // Act subjectThatThrows - .Invoking(x => x.Do("something")) .Should().Throw() .WithMessage("message2"); @@ -285,10 +282,10 @@ public void When_no_exception_was_thrown_but_one_was_expected_it_should_clearly_ try { // Arrange - Does testSubject = Does.NotThrow(); + Action testSubject = () => { }; // Act - testSubject.Invoking(x => x.Do()).Should().Throw("because {0} should do that", "Does.Do"); + testSubject.Should().Throw("because {0} should do that", "Does.Do"); throw new XunitException("This point should not be reached"); } @@ -306,13 +303,13 @@ public void When_subject_throws_another_exception_than_expected_it_should_includ // Arrange var actualException = new ArgumentException(); - Does testSubject = Does.Throw(actualException); + Action testSubject = () => throw actualException; try { // Act testSubject - .Invoking(x => x.Do()) + .Should().Throw("because {0} should throw that one", "Does.Do"); throw new XunitException("This point should not be reached"); @@ -331,13 +328,12 @@ public void When_subject_throws_another_exception_than_expected_it_should_includ public void When_subject_throws_exception_with_message_with_braces_but_a_different_message_is_expected_it_should_report_that() { // Arrange - Does subjectThatThrows = Does.Throw(new Exception("message with {}")); + Action subjectThatThrows = () => throw new Exception("message with {}"); try { // Act subjectThatThrows - .Invoking(x => x.Do("something")) .Should().Throw() .WithMessage("message without"); @@ -355,10 +351,10 @@ public void When_subject_throws_exception_with_message_with_braces_but_a_differe public void When_asserting_with_an_aggregate_exception_type_the_asserts_should_occur_against_the_aggregate_exception() { // Arrange - Does testSubject = Does.Throw(new AggregateException("Outer Message", new Exception("Inner Message"))); + Action testSubject = () => throw new AggregateException("Outer Message", new Exception("Inner Message")); // Act - Action act = testSubject.Do; + Action act = testSubject; // Assert act.Should().Throw() @@ -372,10 +368,10 @@ public void When_asserting_with_an_aggregate_exception_and_inner_exception_type_from_argument_the_asserts_should_occur_against_the_aggregate_exception() { // Arrange - Does testSubject = Does.Throw(new AggregateException("Outer Message", new Exception("Inner Message"))); + Action testSubject = () => throw new AggregateException("Outer Message", new Exception("Inner Message")); // Act - Action act = testSubject.Do; + Action act = testSubject; // Assert act.Should().Throw() diff --git a/Tests/FluentAssertions.Specs/Exceptions/ThrowAssertionsSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/ThrowAssertionsSpecs.cs index ae93bd1eb6..f514193f14 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/ThrowAssertionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/ThrowAssertionsSpecs.cs @@ -1,4 +1,4 @@ -using System; +using System; using Xunit; using Xunit.Sdk; @@ -10,40 +10,40 @@ public class ThrowAssertionsSpecs public void Succeeds_for_any_exception_thrown_by_subject() { // Arrange - Does testSubject = Does.Throw(); + Action testSubject = () => throw new InvalidOperationException(); // Act / Assert - testSubject.Invoking(x => x.Do()).Should().Throw(); + testSubject.Should().Throw(); } [Fact] public void Succeeds_for_expected_exception_thrown_by_subject() { // Arrange - Does testSubject = Does.Throw(); + Action testSubject = () => throw new InvalidOperationException(); // Act / Assert - testSubject.Invoking(x => x.Do()).Should().Throw(); + testSubject.Should().Throw(); } [Fact] public void Succeeds_for_any_exception_thrown_by_func() { // Arrange - Does testSubject = Does.Throw(); + Func testSubject = () => throw new InvalidOperationException(); // Act / Assert - testSubject.Invoking(x => x.Return()).Should().Throw(); + testSubject.Should().Throw(); } [Fact] public void Succeeds_for_expected_exception_thrown_by_func() { // Arrange - Does testSubject = Does.Throw(); + Func testSubject = () => throw new InvalidOperationException(); // Act / Assert - testSubject.Invoking(x => x.Return()).Should().Throw(); + testSubject.Should().Throw(); } [Fact] @@ -71,9 +71,9 @@ public void When_subject_does_not_throw_exception_but_one_was_expected_it_should { try { - Does testSubject = Does.NotThrow(); + Action testSubject = () => { }; - testSubject.Invoking(x => x.Do()).Should().Throw(); + testSubject.Should().Throw(); throw new XunitException("Should().Throw() did not throw"); } @@ -89,9 +89,9 @@ public void When_func_does_not_throw_exception_but_one_was_expected_it_should_th { try { - Does testSubject = Does.NotThrow(); + Func testSubject = () => 42; - testSubject.Invoking(x => x.Return()).Should().Throw(); + testSubject.Should().Throw(); throw new XunitException("Should().Throw() did not throw"); } @@ -106,10 +106,10 @@ public void When_func_does_not_throw_exception_but_one_was_expected_it_should_th public void When_func_does_not_throw_it_should_be_chainable() { // Arrange - Does testSubject = Does.NotThrow(); + Func testSubject = () => 42; // Act / Assert - testSubject.Invoking(x => x.Return()).Should().NotThrow() + testSubject.Should().NotThrow() .Which.Should().Be(42); } From ae620add07cf6666841e568fd3bf8a0733478bb5 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 14 Sep 2025 12:36:14 +0200 Subject: [PATCH 698/845] Added System.Text.Json assertion APIs and BeEquivalentTo support --- .packageguard/cache.bin | Bin 138014 -> 145643 bytes Src/FluentAssertions/AssertionExtensions.cs | 29 +- .../Equivalency/EquivalencyOptions.cs | 1 + .../Equivalency/EquivalencyPlan.cs | 5 +- .../CollectionMemberOptionsDecorator.cs | 3 + .../Equivalency/IEquivalencyOptions.cs | 5 + .../Equivalency/IMemberMatchingRule.cs | 2 +- Src/FluentAssertions/Equivalency/INode.cs | 11 +- .../Equivalency/JsonProperty.cs | 147 +++++ .../Matching/MustMatchByNameRule.cs | 49 +- .../MustMatchJsonPropertyByNameRule.cs | 32 + .../Matching/MustMatchMemberByNameRule.cs | 53 ++ .../Matching/TryMatchByNameRule.cs | 23 +- .../TryMatchJsonPropertyByNameRule.cs | 24 + .../Matching/TryMatchMemberByNameRule.cs | 30 + Src/FluentAssertions/Equivalency/Node.cs | 5 +- Src/FluentAssertions/Equivalency/Pathway.cs | 4 +- .../SelfReferenceEquivalencyOptions.cs | 14 + .../Equivalency/Steps/JsonConversionStep.cs | 61 ++ Src/FluentAssertions/Formatting/Formatter.cs | 1 + .../Formatting/JsonNodeFormatter.cs | 28 + .../Specialized/JsonNodeAssertions.cs | 488 +++++++++++++++ Tests/.editorconfig | 4 + .../FluentAssertions/net47.verified.txt | 2 + .../FluentAssertions/net6.0.verified.txt | 39 ++ .../netstandard2.0.verified.txt | 2 + .../netstandard2.1.verified.txt | 2 + .../ExampleExtensions.csproj | 4 +- .../BasicSpecs.cs | 2 +- .../JsonNodeSpecs.cs | 551 ++++++++++++++++ .../NestedPropertiesSpecs.cs | 2 +- .../SelectionRulesSpecs.cs | 2 +- .../ExtensibilitySpecs.cs | 3 +- ...luentAssertions.Extensibility.Specs.csproj | 1 + .../HttpResponseMessageAssertions.cs | 27 + .../JsonWithInlineAssertionsSpecs.cs | 88 +++ .../FluentAssertions.Specs.csproj | 1 - .../Formatting/JsonFormatterSpecs.cs | 102 +++ .../Specialized/JsonNodeSpecs.cs | 590 ++++++++++++++++++ docs/_data/navigation.yml | 8 +- docs/_pages/json.md | 49 ++ docs/_pages/objectgraphs.md | 42 ++ docs/_pages/releases.md | 6 + 43 files changed, 2463 insertions(+), 79 deletions(-) create mode 100644 Src/FluentAssertions/Equivalency/JsonProperty.cs create mode 100644 Src/FluentAssertions/Equivalency/Matching/MustMatchJsonPropertyByNameRule.cs create mode 100644 Src/FluentAssertions/Equivalency/Matching/MustMatchMemberByNameRule.cs create mode 100644 Src/FluentAssertions/Equivalency/Matching/TryMatchJsonPropertyByNameRule.cs create mode 100644 Src/FluentAssertions/Equivalency/Matching/TryMatchMemberByNameRule.cs create mode 100644 Src/FluentAssertions/Equivalency/Steps/JsonConversionStep.cs create mode 100644 Src/FluentAssertions/Formatting/JsonNodeFormatter.cs create mode 100644 Src/FluentAssertions/Specialized/JsonNodeAssertions.cs create mode 100644 Tests/FluentAssertions.Equivalency.Specs/JsonNodeSpecs.cs rename Tests/{FluentAssertions.Specs => FluentAssertions.Extensibility.Specs}/ExtensibilitySpecs.cs (97%) create mode 100644 Tests/FluentAssertions.Extensibility.Specs/HttpResponseMessageAssertions.cs create mode 100644 Tests/FluentAssertions.Extensibility.Specs/JsonWithInlineAssertionsSpecs.cs create mode 100644 Tests/FluentAssertions.Specs/Formatting/JsonFormatterSpecs.cs create mode 100644 Tests/FluentAssertions.Specs/Specialized/JsonNodeSpecs.cs create mode 100644 docs/_pages/json.md diff --git a/.packageguard/cache.bin b/.packageguard/cache.bin index 3497aa80b66af138be704484a9d82f497f0abe0d..94b0ea828e9cde356925d1e6079dd190018220aa 100644 GIT binary patch delta 1958 zcmZuxZBSHY6z;tH$;ZO7fV<0zuujPodiM)rnGgho8779HBp6XfFow@v1Pz6;@#{xc z>Vj`{YRWRD9K~70mF_e(M$?a)OktY-_`@luvK(r{VbB4F=)L#Ky}QKy^`7TE=i@!+ zeeQ>!>8Bp(;p8a1+Y0J|uFdr4x60@n{k?SJhaI%y_iDPSHa_%ATZ?K{Z|HF6mwM2I z$HiUF3oRWuXQEHW<;%%Fiq50y`Bwa=87!f}6UQv-C)h_v*XM;AFPfivY`tCc&SB8e zk)Sp-^<#b_oxZ<|o(e347XLVtDhJ@W1-fup3q2Q7QV0m|F z4FtbF2<74o*|l+U2iW=F`ruL$s1*;J5?wklfgM?pK<~e7z_CFv(!OmRUo-%l5>_M; zXE)Xc9)9b27=+cloE`N1u}>fnrS#Z;6l^$s1x)f^QFdVNRS1XySZF1Mxb7M> z$oD~ZpE$m344&DtjMd}%hj2o!K;tWH*bzmddEXs&fLs^EPA9Oi8^i-guIuk)wt(#uq`Vl zx?x{uxBm9h($WTeU;#U(X~3lNaxR=$fJ(vAYaK350PaS?PxzMwO2CVSi_j*r<_*w6 z*{j5WmTZ?r^&IhXc;*Of#yuKH#OV}>jmWYq3O0h5-nHZl1U))qlrpPi6b3Fr9MAx}Jfbs646MJX|(kS^lf zC={(mU{d11gEwcOTIJ$A{PpHbKH3RAy^q& zKL?-6dP1frE2hpv0SntX4~^I`2j^+HtV))bTgTRTeIACyrP=SXF&@eJ7r%CuB z6Um9d6STWKeZEdVj?X|EGPg5U0@%A@W8$lli2;xaJyl9zPA1vnRz;T=B=qbWQmmjX bfN6h&haQ&d!({SigyGKxe~6Dh)&Li9%pL`MZG>e2^6N-LDG!Akv# zpOy_3!IdJ}#cmSVUV??^F1gLe>9!l z!;kBVlnm}R74XL96dLTpB$bsTi`%a+i21j_7kyS5|wD}PN`bsBM!?f~^+$?z8z?%3W(zFwr0Cx#j6ZX5*dk)xJe z%Q4=xsY7=ov`loBgy^b8v}Db*C}_L&h-3dccPRrfF~fY1H*xzla^d~q@!gMdoL}z@e&GL zp@UGi7Hppc)ICCI@2|6*NR~Im|>?v@D*iIV_jDRcwD~5KU_;RvQZN(14oV+C?ig XjCN6rR<3L3MjrBM+4C?}`{nZ=_*F

@@ -358,7 +363,8 @@ public static StringCollectionAssertions Should([NotNull] this IEnumerable, TKey, TValue> Should( [NotNull] this IDictionary actualValue) { - return new GenericDictionaryAssertions, TKey, TValue>(actualValue, AssertionChain.GetOrCreate()); + return new GenericDictionaryAssertions, TKey, TValue>(actualValue, + AssertionChain.GetOrCreate()); } ///

@@ -748,7 +754,7 @@ public static TypeSelectorAssertions Should(this TypeSelector typeSelector) { Guard.ThrowIfArgumentIsNull(typeSelector); - return new TypeSelectorAssertions(AssertionChain.GetOrCreate(), typeSelector.ToArray()); + return new TypeSelectorAssertions(AssertionChain.GetOrCreate(), typeSelector.ToArray()); } /// @@ -903,6 +909,25 @@ public static TaskCompletionSourceAssertions Should(this TaskCompletionSource tc return new TaskCompletionSourceAssertions(tcs, AssertionChain.GetOrCreate()); } + /// + /// Returns an object that provides various assertion APIs that act on a . + /// + [Pure] + public static JsonNodeAssertions Should([NotNull] this JsonNode jsonNode) + { + return new JsonNodeAssertions(jsonNode, AssertionChain.GetOrCreate()); + } + + /// + /// Return an object that provides various assertion APIs that treat a + /// as a collection of s. + /// + [Pure] + public static GenericCollectionAssertions Should([NotNull] this JsonArray jsonArray) + { + return new GenericCollectionAssertions(jsonArray?.ToArray(), AssertionChain.GetOrCreate()); + } + #endif /// diff --git a/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs index 47fa0f7e6b..039a2195c1 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs @@ -190,6 +190,7 @@ public EquivalencyOptions WithMapping diff --git a/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs b/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs index 595912c31e..f81b3d48c2 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs @@ -144,8 +144,11 @@ private static List GetDefaultSteps() new RunAllUserStepsEquivalencyStep(), new AutoConversionStep(), new TypeEquivalencyStep(), - new InlineEquivalencyStep(), new ReferenceEqualityEquivalencyStep(), +#if NET6_0_OR_GREATER + new JsonConversionStep(), +#endif + new InlineEquivalencyStep(), new GenericDictionaryEquivalencyStep(), new XDocumentEquivalencyStep(), new XElementEquivalencyStep(), diff --git a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs index 4b2188150b..ae70175cd1 100644 --- a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs +++ b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs @@ -85,5 +85,8 @@ public EqualityStrategy GetEqualityStrategy(Type type) public bool IgnoreNewlineStyle => inner.IgnoreNewlineStyle; + /// + public bool IgnoreJsonPropertyCasing => inner.IgnoreJsonPropertyCasing; + public ITraceWriter TraceWriter => inner.TraceWriter; } diff --git a/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs index c9bd15afff..7e49d1b035 100644 --- a/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs @@ -121,4 +121,9 @@ public interface IEquivalencyOptions /// Enabling this option will replace all occurrences of \r\n and \r with \n in the strings before comparing them. /// bool IgnoreNewlineStyle { get; } + + /// + /// When set to true, the comparison will ignore the casing of JSON property names when comparing objects to JSON trees. + /// + bool IgnoreJsonPropertyCasing { get; } } diff --git a/Src/FluentAssertions/Equivalency/IMemberMatchingRule.cs b/Src/FluentAssertions/Equivalency/IMemberMatchingRule.cs index 4354dee1b5..ad0f0f508c 100644 --- a/Src/FluentAssertions/Equivalency/IMemberMatchingRule.cs +++ b/Src/FluentAssertions/Equivalency/IMemberMatchingRule.cs @@ -13,7 +13,7 @@ public interface IMemberMatchingRule /// during a structural equality. /// /// - /// Whether or not a match is required or optional is up to the specific rule. If no match is found and this is not an issue, + /// Whether a match is required or optional is up to the specific rule. If no match is found and this is not an issue, /// simply return . /// /// diff --git a/Src/FluentAssertions/Equivalency/INode.cs b/Src/FluentAssertions/Equivalency/INode.cs index d266ec307e..102760f49f 100644 --- a/Src/FluentAssertions/Equivalency/INode.cs +++ b/Src/FluentAssertions/Equivalency/INode.cs @@ -57,10 +57,13 @@ public interface INode bool RootIsCollection { get; } /// - /// Adjusts the current node to reflect a remapped subject member during a structural equivalency check. - /// Ensures that assertion failures report the correct subject member name when the matching process selects - /// a different member in the subject compared to the expectation. - /// + /// Overrides the display text used when rendering the failure message to use the specified member + /// + /// + /// As the description of this object is used to render the "expectation" in a the failure message, and + /// we sometimes need to remap the expectation to a different member (e.g. when a member is + /// mapped to another member with a different name), we need to adjust the description. + /// /// /// The specific member in the subject that the current node should be remapped to. /// diff --git a/Src/FluentAssertions/Equivalency/JsonProperty.cs b/Src/FluentAssertions/Equivalency/JsonProperty.cs new file mode 100644 index 0000000000..c50668f4b0 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/JsonProperty.cs @@ -0,0 +1,147 @@ +#if NET6_0_OR_GREATER +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json.Nodes; +using FluentAssertions.Common; + +namespace FluentAssertions.Equivalency; + +/// +/// Represents a JSON property in the context of equivalency assertions. This class is used to encapsulate +/// information about a specific JSON property, its parent object, and its counterpart in an expectation object +/// when performing comparisons. +/// +internal class JsonProperty(JsonNode property, JsonObject parent, INode expectationParent) : IMember +{ + // SMELL: A lot of properties are required by the IMember interface, but they are not used. In the future + // we need to change the interface that IMemberMatchingRule returns so we don't need all this. + + /// + public GetSubjectId GetSubjectId + { + get => expectationParent.GetSubjectId; + } + + /// + public Type Type + { + get => property.GetType(); + } + + /// + public Type ParentType + { + get => parent.GetType(); + } + + /// + public Pathway Subject + { + get; + set; + } + + /// + // ReSharper disable once UnassignedGetOnlyAutoProperty + public Pathway Expectation { get; } + + /// + public int Depth + { + get => 0; + } + + /// + public bool IsRoot + { + get => false; + } + + /// + public bool RootIsCollection + { + get => false; + } + + /// + public void AdjustForRemappedSubject(IMember subjectMember) + { + } + + /// + public Type DeclaringType + { + get => parent.GetType(); + } + + /// + public Type ReflectedType + { + get => parent.GetType(); + } + + /// + public object GetValue(object obj) => property; + + /// + public CSharpAccessModifier GetterAccessibility + { + get => CSharpAccessModifier.Public; + } + + /// + public CSharpAccessModifier SetterAccessibility + { + get => CSharpAccessModifier.Public; + } + + /// + public bool IsBrowsable + { + get => false; + } + + /// + /// Tries to find a JSON property on the object which name matches that + /// of the .NET member identified by . + /// + /// + /// Whether the name matching is case-sensitive or not is determined by . + /// + /// + /// An instance of if a matching property was found, or null otherwise. + /// + public static JsonProperty Find(IMember expectedMember, INode parent, object subject, StringComparison nameComparisonMode) + { + if (subject is not JsonObject jsonNode) + { + return null; + } + + JsonProperty property = null; + + // Use the name of the expectation as the name of the JSON property to look for + string propertyName = expectedMember.Expectation.Name; + + // Find the JSON property with the same name as the .NET member + KeyValuePair match = jsonNode + .AsEnumerable() + .SingleOrDefault(x => x.Key.Equals(propertyName, nameComparisonMode)); + + if (match.Key is not null) + { + // Build an IMember that represents the JSON property + property = new JsonProperty(jsonNode[match.Key], jsonNode, parent) + { + Subject = new Pathway(jsonNode.GetPath(), propertyName, pathAndName => $"JSON property {pathAndName}"), + }; + } + + return property; + } + + public override string ToString() => Subject.Description; +} + +#endif diff --git a/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs b/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs index e6f4633563..abf638afaa 100644 --- a/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs +++ b/Src/FluentAssertions/Equivalency/Matching/MustMatchByNameRule.cs @@ -1,59 +1,30 @@ -using System.Reflection; -using FluentAssertions.Common; using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Matching; /// -/// Requires the subject to have a member with the exact same name as the expectation has. +/// First tries to find a JSON property with the same name, and if that fails, falls back to a field or property with the same name. /// internal class MustMatchByNameRule : IMemberMatchingRule { - public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options, AssertionChain assertionChain) + /// + public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options, + AssertionChain assertionChain) { - IMember subjectMember = null; - - if (options.IncludedProperties != MemberVisibility.None) - { - PropertyInfo propertyInfo = subject.GetType().FindProperty( - expectedMember.Subject.Name, - options.IncludedProperties | MemberVisibility.ExplicitlyImplemented | MemberVisibility.DefaultInterfaceProperties); - - subjectMember = propertyInfo is not null && !propertyInfo.IsIndexer() ? new Property(propertyInfo, parent) : null; - } - - if (subjectMember is null && options.IncludedFields != MemberVisibility.None) - { - FieldInfo fieldInfo = subject.GetType().FindField( - expectedMember.Subject.Name, - options.IncludedFields); - - subjectMember = fieldInfo is not null ? new Field(fieldInfo, parent) : null; - } - - if (subjectMember is null) - { - assertionChain.FailWith( - "Expectation has {0} that the other object does not have.", expectedMember.Expectation.AsNonFormattable()); - } - else if (options.IgnoreNonBrowsableOnSubject && !subjectMember.IsBrowsable) - { - assertionChain.FailWith( - "Expectation has {0} that is non-browsable in the other object, and non-browsable " + - "members on the subject are ignored with the current configuration", expectedMember.Expectation.AsNonFormattable()); - } - else +#if NET6_0_OR_GREATER + if (subject is System.Text.Json.Nodes.JsonNode) { - // Everything is fine + return new MustMatchJsonPropertyByNameRule().Match(expectedMember, subject, parent, options, assertionChain); } +#endif - return subjectMember; + return new MustMatchMemberByNameRule().Match(expectedMember, subject, parent, options, assertionChain); } /// /// 2 public override string ToString() { - return "Match member by name (or throw)"; + return "Match (JSON) member by name (or throw)"; } } diff --git a/Src/FluentAssertions/Equivalency/Matching/MustMatchJsonPropertyByNameRule.cs b/Src/FluentAssertions/Equivalency/Matching/MustMatchJsonPropertyByNameRule.cs new file mode 100644 index 0000000000..2568314af2 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Matching/MustMatchJsonPropertyByNameRule.cs @@ -0,0 +1,32 @@ +#if NET6_0_OR_GREATER +using System; +using FluentAssertions.Execution; + +namespace FluentAssertions.Equivalency.Matching; + +/// +/// Defines a rule to match a member from an expected object with a member from a subject object +/// based on the existence of a JSON property with a matching name. +/// +internal class MustMatchJsonPropertyByNameRule : IMemberMatchingRule +{ + /// + public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options, + AssertionChain assertionChain) + { + StringComparison comparison = + options.IgnoreJsonPropertyCasing ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; + + JsonProperty property = JsonProperty.Find(expectedMember, parent, subject, comparison); + + if (property is null) + { + assertionChain.FailWith("Expectation has {0} that the other object does not have.", + expectedMember.Expectation.AsNonFormattable()); + } + + return property; + } +} + +#endif diff --git a/Src/FluentAssertions/Equivalency/Matching/MustMatchMemberByNameRule.cs b/Src/FluentAssertions/Equivalency/Matching/MustMatchMemberByNameRule.cs new file mode 100644 index 0000000000..72bb3d65b3 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Matching/MustMatchMemberByNameRule.cs @@ -0,0 +1,53 @@ +using System.Reflection; +using FluentAssertions.Common; +using FluentAssertions.Execution; + +namespace FluentAssertions.Equivalency.Matching; + +/// +/// Requires the subject to have a member with the exact same name as the expectation has. +/// +internal class MustMatchMemberByNameRule : IMemberMatchingRule +{ + public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options, AssertionChain assertionChain) + { + IMember subjectMember = null; + + if (options.IncludedProperties != MemberVisibility.None) + { + PropertyInfo propertyInfo = subject.GetType().FindProperty( + expectedMember.Subject.Name, + options.IncludedProperties | MemberVisibility.ExplicitlyImplemented | MemberVisibility.DefaultInterfaceProperties); + + subjectMember = propertyInfo is not null && !propertyInfo.IsIndexer() ? new Property(propertyInfo, parent) : null; + } + + if (subjectMember is null && options.IncludedFields != MemberVisibility.None) + { + FieldInfo fieldInfo = subject.GetType().FindField( + expectedMember.Subject.Name, + options.IncludedFields); + + subjectMember = fieldInfo is not null ? new Field(fieldInfo, parent) : null; + } + + if (subjectMember is null) + { + assertionChain.FailWith( + "Expectation has {0} that the other object does not have.", expectedMember.Expectation.AsNonFormattable()); + } + else if (options.IgnoreNonBrowsableOnSubject && !subjectMember.IsBrowsable) + { + assertionChain.FailWith( + "Expectation has {0} that is non-browsable in the other object, and non-browsable " + + "members on the subject are ignored with the current configuration", expectedMember.Expectation.AsNonFormattable()); + } + else + { + // Everything is fine + } + + return subjectMember; + } +} + diff --git a/Src/FluentAssertions/Equivalency/Matching/TryMatchByNameRule.cs b/Src/FluentAssertions/Equivalency/Matching/TryMatchByNameRule.cs index 19e729daaa..d75fa195b6 100644 --- a/Src/FluentAssertions/Equivalency/Matching/TryMatchByNameRule.cs +++ b/Src/FluentAssertions/Equivalency/Matching/TryMatchByNameRule.cs @@ -1,37 +1,28 @@ -using System.Reflection; -using FluentAssertions.Common; using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Matching; /// -/// Finds a member of the expectation with the exact same name, but doesn't require it. +/// First tries to find a JSON property with the same name, and if that fails, falls back to a field or property with the same name. /// internal class TryMatchByNameRule : IMemberMatchingRule { public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options, AssertionChain assertionChain) { - if (options.IncludedProperties != MemberVisibility.None) +#if NET6_0_OR_GREATER + if (subject is System.Text.Json.Nodes.JsonNode) { - PropertyInfo property = subject.GetType().FindProperty(expectedMember.Expectation.Name, - options.IncludedProperties | MemberVisibility.ExplicitlyImplemented); - - if (property is not null && !property.IsIndexer()) - { - return new Property(property, parent); - } + return new TryMatchJsonPropertyByNameRule().Match(expectedMember, subject, parent, options, assertionChain); } +#endif - FieldInfo field = subject.GetType() - .FindField(expectedMember.Expectation.Name, options.IncludedFields); - - return field is not null ? new Field(field, parent) : null; + return new TryMatchMemberByNameRule().Match(expectedMember, subject, parent, options, assertionChain); } /// /// 2 public override string ToString() { - return "Try to match member by name"; + return "Try to match (JSON) member by name"; } } diff --git a/Src/FluentAssertions/Equivalency/Matching/TryMatchJsonPropertyByNameRule.cs b/Src/FluentAssertions/Equivalency/Matching/TryMatchJsonPropertyByNameRule.cs new file mode 100644 index 0000000000..201c9016df --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Matching/TryMatchJsonPropertyByNameRule.cs @@ -0,0 +1,24 @@ +#if NET6_0_OR_GREATER +using System; +using FluentAssertions.Execution; + +namespace FluentAssertions.Equivalency.Matching; + +/// +/// A member matching rule that attempts to match a JSON property in a subject object with a corresponding +/// member in the expected object, using the provided equivalency options to determine comparison behavior. +/// +internal class TryMatchJsonPropertyByNameRule : IMemberMatchingRule +{ + /// + public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options, + AssertionChain assertionChain) + { + StringComparison comparison = + options.IgnoreJsonPropertyCasing ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; + + return JsonProperty.Find(expectedMember, parent, subject, comparison); + } +} + +#endif diff --git a/Src/FluentAssertions/Equivalency/Matching/TryMatchMemberByNameRule.cs b/Src/FluentAssertions/Equivalency/Matching/TryMatchMemberByNameRule.cs new file mode 100644 index 0000000000..cbda928c08 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Matching/TryMatchMemberByNameRule.cs @@ -0,0 +1,30 @@ +using System.Reflection; +using FluentAssertions.Common; +using FluentAssertions.Execution; + +namespace FluentAssertions.Equivalency.Matching; + +/// +/// Finds a member of the expectation with the exact same name, but doesn't require it. +/// +internal class TryMatchMemberByNameRule : IMemberMatchingRule +{ + public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyOptions options, AssertionChain assertionChain) + { + if (options.IncludedProperties != MemberVisibility.None) + { + PropertyInfo property = subject.GetType().FindProperty(expectedMember.Expectation.Name, + options.IncludedProperties | MemberVisibility.ExplicitlyImplemented); + + if (property is not null && !property.IsIndexer()) + { + return new Property(property, parent); + } + } + + FieldInfo field = subject.GetType() + .FindField(expectedMember.Expectation.Name, options.IncludedFields); + + return field is not null ? new Field(field, parent) : null; + } +} diff --git a/Src/FluentAssertions/Equivalency/Node.cs b/Src/FluentAssertions/Equivalency/Node.cs index 4f6d9d6f4e..b8b08bc94a 100644 --- a/Src/FluentAssertions/Equivalency/Node.cs +++ b/Src/FluentAssertions/Equivalency/Node.cs @@ -57,10 +57,7 @@ public bool IsRoot public void AdjustForRemappedSubject(IMember subjectMember) { - if (subject.Name != subjectMember.Subject.Name) - { - subject.Name = subjectMember.Subject.Name; - } + Subject = subjectMember.Subject; } public int Depth diff --git a/Src/FluentAssertions/Equivalency/Pathway.cs b/Src/FluentAssertions/Equivalency/Pathway.cs index d5d322f7f2..8bd3f24689 100644 --- a/Src/FluentAssertions/Equivalency/Pathway.cs +++ b/Src/FluentAssertions/Equivalency/Pathway.cs @@ -9,7 +9,7 @@ public record Pathway { public delegate string GetDescription(string pathAndName); - private readonly string path = string.Empty; + private string path = string.Empty; private string name = string.Empty; private string pathAndName; @@ -52,7 +52,7 @@ private init public string Name { get => name; - internal set + private init { name = value; pathAndName = null; diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index 1e2bb6b046..bc765110d4 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -96,6 +96,7 @@ protected SelfReferenceEquivalencyOptions(IEquivalencyOptions defaults) IgnoreTrailingWhitespace = defaults.IgnoreTrailingWhitespace; IgnoreCase = defaults.IgnoreCase; IgnoreNewlineStyle = defaults.IgnoreNewlineStyle; + IgnoreJsonPropertyCasing = defaults.IgnoreJsonPropertyCasing; ConversionSelector = defaults.ConversionSelector.Clone(); @@ -205,6 +206,8 @@ EqualityStrategy IEquivalencyOptions.GetEqualityStrategy(Type type) public bool IgnoreNewlineStyle { get; private set; } + public bool IgnoreJsonPropertyCasing { get; set; } + public ITraceWriter TraceWriter { get; private set; } /// @@ -823,6 +826,17 @@ public TSelf IgnoringNewlineStyle() return (TSelf)this; } +#if NET6_0_OR_GREATER + /// + /// Tells the comparison to ignore the casing when trying to match a property to a JSON property. + /// + public TSelf IgnoringJsonPropertyCasing() + { + IgnoreJsonPropertyCasing = true; + return (TSelf)this; + } +#endif + /// /// Returns the comparer for strings, which is either an explicitly specified comparer via or an ordinal comparer depending on . /// diff --git a/Src/FluentAssertions/Equivalency/Steps/JsonConversionStep.cs b/Src/FluentAssertions/Equivalency/Steps/JsonConversionStep.cs new file mode 100644 index 0000000000..33b113e0a5 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Steps/JsonConversionStep.cs @@ -0,0 +1,61 @@ +#if NET6_0_OR_GREATER + +using System; +using System.Globalization; +using System.Text.Json.Nodes; + +namespace FluentAssertions.Equivalency.Steps; + +public class JsonConversionStep : IEquivalencyStep +{ + /// + public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, + IValidateChildNodeEquivalency valueChildNodes) + { + if (comparands.Subject is JsonValue json) + { + if (json.TryGetValue(out int intValue)) + { + comparands.Subject = intValue; + } + else if (json.TryGetValue(out double doubleValue)) + { + comparands.Subject = doubleValue; + } + else if (json.TryGetValue(out bool boolValue)) + { + comparands.Subject = boolValue; + } + else if (json.TryGetValue(out string stringValue)) + { + string[] iso8601Formats = + { + "yyyy-MM-ddTHH:mm:ssZ", + "yyyy-MM-ddTHH:mm:ss.fffZ", + "yyyy-MM-ddTHH:mm:ss", + "yyyy-MM-ddTHH:mm:ss.fff", + "yyyy-MM-dd" + }; + + var style = stringValue.EndsWith('Z') ? DateTimeStyles.AdjustToUniversal : DateTimeStyles.AssumeLocal; + if (DateTime.TryParseExact(stringValue, iso8601Formats, CultureInfo.InvariantCulture, style, + out DateTime exactResult)) + { + comparands.Subject = exactResult; + } + else + { + comparands.Subject = stringValue; + } + } + else + { + // We don't need to do anything + } + } + + return EquivalencyResult.ContinueWithNext; + } +} + +#endif diff --git a/Src/FluentAssertions/Formatting/Formatter.cs b/Src/FluentAssertions/Formatting/Formatter.cs index 17e0e7a957..a2c4dbc150 100644 --- a/Src/FluentAssertions/Formatting/Formatter.cs +++ b/Src/FluentAssertions/Formatting/Formatter.cs @@ -36,6 +36,7 @@ public static class Formatter #if NET6_0_OR_GREATER new DateOnlyValueFormatter(), new TimeOnlyValueFormatter(), + new JsonNodeFormatter(), #endif new TimeSpanValueFormatter(), new Int32ValueFormatter(), diff --git a/Src/FluentAssertions/Formatting/JsonNodeFormatter.cs b/Src/FluentAssertions/Formatting/JsonNodeFormatter.cs new file mode 100644 index 0000000000..b57895fb09 --- /dev/null +++ b/Src/FluentAssertions/Formatting/JsonNodeFormatter.cs @@ -0,0 +1,28 @@ +#if NET6_0_OR_GREATER + +using System.Text.Json.Nodes; + +namespace FluentAssertions.Formatting; + +public class JsonNodeFormatter : IValueFormatter +{ + /// + public bool CanHandle(object value) => value is JsonNode; + + /// + public void Format(object value, FormattedObjectGraph formattedGraph, FormattingContext context, FormatChild formatChild) + { + var node = (JsonNode)value; + + if (context.UseLineBreaks) + { + formattedGraph.AddFragmentOnNewLine(node.ToString()); + } + else + { + formattedGraph.AddFragment(node.ToJsonString()); + } + } +} + +#endif diff --git a/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs b/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs new file mode 100644 index 0000000000..eee4b5e117 --- /dev/null +++ b/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs @@ -0,0 +1,488 @@ +#if NET6_0_OR_GREATER + +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Text.Json.Nodes; +using FluentAssertions.Common; +using FluentAssertions.Configuration; +using FluentAssertions.Equivalency; +using FluentAssertions.Execution; +using FluentAssertions.Primitives; + +namespace FluentAssertions.Specialized; + +public class JsonNodeAssertions : ReferenceTypeAssertions +{ + /// + public JsonNodeAssertions(JsonNode subject, AssertionChain assertionChain) + : base(subject, assertionChain) + { + } + + /// + protected override string Identifier + { + get => "JSON node"; + } + + /// + /// Asserts that the current contains a property with the specified name. + /// + /// The name of the property to look for. + /// + /// 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 AndWhichConstraint HaveProperty(string code, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .BecauseOf(because, becauseArgs) + .ForCondition(Subject is not null) + .FailWith("Cannot assert the existence of a property on a JSON node{reason}.") + .Then + .ForCondition(Subject?[code] != null) + .FailWith("Expected {context:JSON node} to have property {0}{reason}.", code); + + return new AndWhichConstraint(this, Subject?[code]); + } + + /// + /// Asserts that the current does not have a property with the specified name. + /// + /// The name of the property that should not exist. + /// + /// 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 NotHaveProperty(string code, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .BecauseOf(because, becauseArgs) + .ForCondition(Subject is not null) + .FailWith("Cannot assert the existence of a property on a JSON node{reason}.") + .Then + .ForCondition(Subject?[code] is null) + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect {context:JSON node} to have property {0}{reason}.", code); + + return new AndConstraint(this); + } + + /// + /// Asserts that the current represents a JSON array. + /// + /// + /// 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 AndWhichConstraint> BeAnArray( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(Subject is JsonArray) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:JSON node} to be an array{reason}, but {0} is not.", Subject); + + return new AndWhichConstraint>(this, (Subject as JsonArray)?.AsEnumerable()); + } + + /// + /// Asserts that the current does not represent a JSON array. + /// + /// + /// 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 NotBeAnArray( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(Subject is not JsonArray) + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect {context:JSON node} to be an array{reason}, but {0} is.", Subject); + + return new AndConstraint(this); + } + + /// + /// Asserts that the current represents a 32-bit signed integer. + /// + /// + /// 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 AndWhichConstraint BeNumeric( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(Subject is JsonValue value && value.TryGetValue(out _)) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:JSON node} to be an Int32{reason}, but {0} is not.", Subject); + + var actualValue = Subject is JsonValue jsonValue && jsonValue.TryGetValue(out var result) ? result : 0; + return new AndWhichConstraint(this, actualValue); + } + + /// + /// Asserts that the current does not represent a 32-bit signed integer. + /// + /// + /// 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 NotBeNumeric( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(!(Subject is JsonValue value && value.TryGetValue(out _))) + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect {context:JSON node} to be an Int32{reason}, but {0} is.", Subject); + + return new AndConstraint(this); + } + + /// + /// Asserts that the current represents a local . + /// + /// + /// 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 AndWhichConstraint BeLocalDate( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(Subject is JsonValue value && value.TryGetValue(out _) && !Subject.ToString().EndsWith('Z')) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:JSON node} to be a local date{reason}, but {0} is not.", Subject); + + var actualValue = Subject is JsonValue jsonValue && jsonValue.TryGetValue(out var result) ? result : default; + return new AndWhichConstraint(this, actualValue); + } + + /// + /// Asserts that the current does not represent a local . + /// + /// + /// 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 NotBeLocalDate( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(Subject is not JsonValue value || !value.TryGetValue(out _) || Subject.ToString().EndsWith('Z')) + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect {context:JSON node} to be a local date{reason}, but {0} is.", Subject); + + return new AndConstraint(this); + } + + /// + /// Asserts that the current represents a UTC . + /// + /// + /// 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 AndWhichConstraint BeUtcDate( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(Subject is JsonValue value && value.TryGetValue(out _) && Subject.ToString().EndsWith('Z')) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context} to be a UTC date{reason}, but {0} is not.", Subject); + + var actualValue = Subject is JsonValue jsonValue && jsonValue.TryGetValue(out var result) ? result : default; + return new AndWhichConstraint(this, actualValue); + } + + /// + /// Asserts that the current does not represent a UTC . + /// + /// + /// 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 NotBeUtcDate( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(Subject is not JsonValue value || !value.TryGetValue(out _) || !Subject.ToString().EndsWith('Z')) + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect {context} to be a UTC date{reason}, but {0} is.", Subject); + + return new AndConstraint(this); + } + + /// + /// Asserts that the current represents a boolean value. + /// + /// + /// 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 AndWhichConstraint BeBool( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(Subject is JsonValue value && value.TryGetValue(out bool _)) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context} to be a boolean{reason}, but {0} is not.", Subject); + + var actualValue = Subject is JsonValue jsonValue && jsonValue.TryGetValue(out var result) && result; + return new AndWhichConstraint(this, actualValue); + } + + /// + /// Asserts that the current does not represent a boolean value. + /// + /// + /// 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 NotBeBool( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(!(Subject is JsonValue value && value.TryGetValue(out _))) + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect {context:JSON node} to be a boolean{reason}, but {0} is.", Subject); + + return new AndConstraint(this); + } + + /// + /// Asserts that the current represents a string value. + /// + /// + /// 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 AndWhichConstraint BeString( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(Subject is JsonValue value && value.TryGetValue(out string _)) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:JSON node} to be a string{reason}, but {0} is not.", Subject); + + var actualValue = Subject is JsonValue jsonValue && jsonValue.TryGetValue(out var result) ? result : null; + return new AndWhichConstraint(this, actualValue); + } + + /// + /// Asserts that the current does not represent a string value. + /// + /// + /// 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 NotBeString( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + CurrentAssertionChain + .ForCondition(!(Subject is JsonValue value && value.TryGetValue(out _))) + .BecauseOf(because, becauseArgs) + .FailWith("Did not expect {context:JSON node} to be a string{reason}, but {0} is.", Subject); + + return new AndConstraint(this); + } + + /// + /// Asserts a JSON node is equivalent to a given C# object graph. + /// + /// + /// Traverses the properties of the object graph, which can contain nested objects and collections, and compares them to + /// the properties the JSON node. Two properties are considered equal when their names and values match. The comparison is + /// recursive, so nested properties and collections are compared in the same way. The comparison is driven by the expectation, so + /// if the JSON node contains extra properties, they are ignored. If the JSON node has a property that contains an ISO 8601 date (local or UTC), it can be + /// compared to a property of the expectation. + /// + /// The default global configuration can be modified through . + /// + /// The expected object graph, such as an anonymous type. + /// + /// 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 BeEquivalentTo(TExpectation expectation, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + return BeEquivalentTo(expectation, config => config, because, becauseArgs); + } + + /// + /// Asserts a JSON node is equivalent to a given C# object graph. + /// + /// + /// Traverses the properties of the object graph, which can contain nested objects and collections, and compares them to + /// the properties the JSON node. Two properties are considered equal when their names and values match. The comparison is + /// recursive, so nested properties and collections are compared in the same way. The comparison is case-sensitive, unless you use + /// . The comparison is driven by the expectation, so + /// if the JSON node contains extra properties, they are ignored. If the JSON node has a property that contains an ISO 8601 date (local or UTC), it can be + /// compared to a property of the expectation. + /// + /// The default configuration can be modified by using the many options available through the delegate. Also, + /// global options can be set through . + /// + /// The expected object graph, such as an anonymous type. + /// + /// 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 BeEquivalentTo(TExpectation expectation, + Func, EquivalencyOptions> config, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(config); + + EquivalencyOptions options = + config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); + + var context = new EquivalencyValidationContext(Node.From(() => + CurrentAssertionChain.CallerIdentifier), options) + { + Reason = new Reason(because, becauseArgs), + TraceWriter = options.TraceWriter + }; + + var comparands = new Comparands + { + Subject = Subject, + Expectation = expectation, + CompileTimeType = typeof(TExpectation), + }; + + new EquivalencyValidator().AssertEquality(comparands, context); + + return new AndConstraint(this); + } + + /// + /// Asserts a JSON node is NOT equivalent to a given C# object graph. + /// + /// + /// Traverses the properties of the object graph, which can contain nested objects and collections, and compares them to + /// the properties the JSON node. Two properties are considered equal when their names and values match. The comparison is + /// recursive, so nested properties and collections are compared in the same way. The comparison is driven by the expectation, so + /// if the JSON node contains extra properties, they are ignored. If the JSON node has a property that contains an ISO 8601 date (local or UTC), it can be + /// compared to a property of the expectation. + /// + /// The default global configuration can be modified through . + /// + /// The expected object graph, such as an anonymous type. + /// + /// 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 NotBeEquivalentTo( + TExpectation unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + return NotBeEquivalentTo(unexpected, config => config, because, becauseArgs); + } + + /// + /// Asserts a JSON node is NOT equivalent to a given C# object graph. + /// + /// + /// Traverses the properties of the object graph, which can contain nested objects and collections, and compares them to + /// the properties the JSON node. Two properties are considered equal when their names and values match. The comparison is + /// recursive, so nested properties and collections are compared in the same way. The comparison is case-sensitive, unless you use + /// . The comparison is driven by the expectation, so + /// if the JSON node contains extra properties, they are ignored. If the JSON node has a property that contains an ISO 8601 date (local or UTC), it can be + /// compared to a property of the expectation. + /// + /// The default configuration can be modified by using the many options available through the delegate. Also, + /// global options can be set through . + /// + /// The expected object graph, such as an anonymous type. + /// + /// 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 NotBeEquivalentTo( + TExpectation unexpected, + Func, EquivalencyOptions> config, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(config); + + bool hasMismatches; + + using (var scope = new AssertionScope()) + { + BeEquivalentTo(unexpected, config); + hasMismatches = scope.Discard().Length > 0; + } + + CurrentAssertionChain + .ForCondition(hasMismatches) + .BecauseOf(because, becauseArgs) + .WithDefaultIdentifier(Identifier) + .FailWith("Did not expect {context:JSON node} to be equivalent to {0}{reason}, but they are.", unexpected); + + return new AndConstraint(this); + } +} + +#endif diff --git a/Tests/.editorconfig b/Tests/.editorconfig index 24826087b3..15629ab354 100644 --- a/Tests/.editorconfig +++ b/Tests/.editorconfig @@ -188,6 +188,10 @@ resharper_expression_is_always_null_highlighting = none # ReSharper properties resharper_keep_user_linebreaks = true +# Purpose: Highlighting for classes that are never instantiated +# Reason: We have many test classes that are never instantiated directly +resharper_class_never_instantiated_global_highlighting = none + # Make class static dotnet_diagnostic.RCS1102.severity = none diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index f17e073d0d..05bc6d44f4 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -752,6 +752,7 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.EnumEquivalencyHandling EnumEquivalencyHandling { get; } bool ExcludeNonBrowsableOnExpectation { get; } bool IgnoreCase { get; } + bool IgnoreJsonPropertyCasing { get; } bool IgnoreLeadingWhitespace { get; } bool IgnoreNewlineStyle { get; } bool IgnoreNonBrowsableOnSubject { get; } @@ -896,6 +897,7 @@ namespace FluentAssertions.Equivalency public bool? CompareRecordsByValue { get; } public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } public bool IgnoreCase { get; } + public bool IgnoreJsonPropertyCasing { get; set; } public bool IgnoreLeadingWhitespace { get; } public bool IgnoreNewlineStyle { get; } public bool IgnoreTrailingWhitespace { get; } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index f11ccf166d..756c7784a3 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -88,6 +88,8 @@ namespace FluentAssertions public static FluentAssertions.Types.ConstructorInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.ConstructorInfo constructorInfo) { } public static FluentAssertions.Types.MethodInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.MethodInfo methodInfo) { } public static FluentAssertions.Types.PropertyInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.PropertyInfo propertyInfo) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Text.Json.Nodes.JsonArray jsonArray) { } + public static FluentAssertions.Specialized.JsonNodeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Text.Json.Nodes.JsonNode jsonNode) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } public static FluentAssertions.Primitives.TimeOnlyAssertions Should(this System.TimeOnly actualValue) { } public static FluentAssertions.Primitives.NullableTimeOnlyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.TimeOnly? actualValue) { } @@ -765,6 +767,7 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.EnumEquivalencyHandling EnumEquivalencyHandling { get; } bool ExcludeNonBrowsableOnExpectation { get; } bool IgnoreCase { get; } + bool IgnoreJsonPropertyCasing { get; } bool IgnoreLeadingWhitespace { get; } bool IgnoreNewlineStyle { get; } bool IgnoreNonBrowsableOnSubject { get; } @@ -909,6 +912,7 @@ namespace FluentAssertions.Equivalency public bool? CompareRecordsByValue { get; } public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } public bool IgnoreCase { get; } + public bool IgnoreJsonPropertyCasing { get; set; } public bool IgnoreLeadingWhitespace { get; } public bool IgnoreNewlineStyle { get; } public bool IgnoreTrailingWhitespace { get; } @@ -935,6 +939,7 @@ namespace FluentAssertions.Equivalency public TSelf ExcludingProperties() { } public TSelf IgnoringCase() { } public TSelf IgnoringCyclicReferences() { } + public TSelf IgnoringJsonPropertyCasing() { } public TSelf IgnoringLeadingWhitespace() { } public TSelf IgnoringNewlineStyle() { } public TSelf IgnoringNonBrowsableMembersOnSubject() { } @@ -1052,6 +1057,11 @@ namespace FluentAssertions.Equivalency.Steps public GenericEnumerableEquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + public class JsonConversionStep : FluentAssertions.Equivalency.IEquivalencyStep + { + public JsonConversionStep() { } + public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } + } public class ReferenceEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public ReferenceEqualityEquivalencyStep() { } @@ -1495,6 +1505,12 @@ namespace FluentAssertions.Formatting public bool CanHandle(object value) { } public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } } + public class JsonNodeFormatter : FluentAssertions.Formatting.IValueFormatter + { + public JsonNodeFormatter() { } + public bool CanHandle(object value) { } + public void Format(object value, FluentAssertions.Formatting.FormattedObjectGraph formattedGraph, FluentAssertions.Formatting.FormattingContext context, FluentAssertions.Formatting.FormatChild formatChild) { } + } public class MaxLinesExceededException : System.Exception { public MaxLinesExceededException() { } @@ -2325,6 +2341,29 @@ namespace FluentAssertions.Specialized System.Collections.Generic.IEnumerable OfType(System.Exception actualException) where T : System.Exception; } + public class JsonNodeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions + { + public JsonNodeAssertions(System.Text.Json.Nodes.JsonNode subject, FluentAssertions.Execution.AssertionChain assertionChain) { } + protected override string Identifier { get; } + public FluentAssertions.AndWhichConstraint> BeAnArray(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint BeBool(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.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint BeLocalDate(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint BeNumeric(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint BeString(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint BeUtcDate(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint HaveProperty(string code, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeAnArray(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeBool(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeLocalDate(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeNumeric(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeString(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeUtcDate(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveProperty(string code, string because = "", params object[] becauseArgs) { } + } public class MemberExecutionTime : FluentAssertions.Specialized.ExecutionTime { public MemberExecutionTime(T subject, System.Linq.Expressions.Expression> action, FluentAssertions.Common.StartTimer createTimer) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 1d04bb8cda..ee065b0c6e 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -744,6 +744,7 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.EnumEquivalencyHandling EnumEquivalencyHandling { get; } bool ExcludeNonBrowsableOnExpectation { get; } bool IgnoreCase { get; } + bool IgnoreJsonPropertyCasing { get; } bool IgnoreLeadingWhitespace { get; } bool IgnoreNewlineStyle { get; } bool IgnoreNonBrowsableOnSubject { get; } @@ -888,6 +889,7 @@ namespace FluentAssertions.Equivalency public bool? CompareRecordsByValue { get; } public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } public bool IgnoreCase { get; } + public bool IgnoreJsonPropertyCasing { get; set; } public bool IgnoreLeadingWhitespace { get; } public bool IgnoreNewlineStyle { get; } public bool IgnoreTrailingWhitespace { get; } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 4ad74779cf..f9e20dbb4d 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -752,6 +752,7 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.EnumEquivalencyHandling EnumEquivalencyHandling { get; } bool ExcludeNonBrowsableOnExpectation { get; } bool IgnoreCase { get; } + bool IgnoreJsonPropertyCasing { get; } bool IgnoreLeadingWhitespace { get; } bool IgnoreNewlineStyle { get; } bool IgnoreNonBrowsableOnSubject { get; } @@ -896,6 +897,7 @@ namespace FluentAssertions.Equivalency public bool? CompareRecordsByValue { get; } public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } public bool IgnoreCase { get; } + public bool IgnoreJsonPropertyCasing { get; set; } public bool IgnoreLeadingWhitespace { get; } public bool IgnoreNewlineStyle { get; } public bool IgnoreTrailingWhitespace { get; } diff --git a/Tests/ExampleExtensions/ExampleExtensions.csproj b/Tests/ExampleExtensions/ExampleExtensions.csproj index 20e21aa202..c8eedf388c 100644 --- a/Tests/ExampleExtensions/ExampleExtensions.csproj +++ b/Tests/ExampleExtensions/ExampleExtensions.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + netstandard2.0;net6.0 enable disable false @@ -9,7 +9,7 @@ ..\..\Src\FluentAssertions\FluentAssertions.snk - + diff --git a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs index bde7eee116..d643cdcb77 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs @@ -567,7 +567,7 @@ public void When_a_field_on_the_subject_matches_a_property_the_members_should_ma Action act = () => onlyAField.Should().BeEquivalentTo(onlyAProperty); // Assert - act.Should().Throw().WithMessage("Expected property onlyAField.Value*to be 101, but found 1.*"); + act.Should().Throw().WithMessage("Expected field onlyAField.Value*to be 101, but found 1.*"); } [Fact] diff --git a/Tests/FluentAssertions.Equivalency.Specs/JsonNodeSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/JsonNodeSpecs.cs new file mode 100644 index 0000000000..9900a05dd6 --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/JsonNodeSpecs.cs @@ -0,0 +1,551 @@ +#if NET6_0_OR_GREATER + +using System; +using System.Text.Json.Nodes; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Equivalency.Specs; + +public class JsonNodeSpecs +{ + [Fact] + public void Supports_numeric_properties() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "number" : 1, + "floatingpoint": 1.0 + } + """); + + // Act + var act = () => node.Should().BeEquivalentTo(new + { + number = 2, + floatingpoint = 2.0 + }); + + // Assert + act.Should().Throw().WithMessage("*$.number*2*1*$.floatingpoint*2.0*1.0*"); + } + + [Fact] + public void Supports_string_properties() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "name": "John", + "description": "A person" + } + """); + + // Act + var act = () => node.Should().BeEquivalentTo(new + { + name = "Jane", + description = "Another person" + }); + + // Assert + act.Should().Throw().WithMessage("*JSON property $.name*Jane*John*"); + } + + [Fact] + public void Supports_boolean_properties() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "isActive": true, + "isDeleted": false + } + """); + + // Act + var act = () => node.Should().BeEquivalentTo(new + { + isActive = false, + isDeleted = true + }); + + // Assert + act.Should().Throw().WithMessage("*$.isActive*False*True*$.isDeleted*True*False*"); + } + + [Fact] + public void Supports_null_properties() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "nullValue": null, + "notNull": "value" + } + """); + + // Act + var act = () => node.Should().BeEquivalentTo(new + { + nullValue = "not null", + notNull = (string)null + }); + + // Assert + act.Should().Throw() + .WithMessage("Expected JSON property $.nullValue to be*not null*but found *$.notNull to be *value*"); + } + + [Fact] + public void Supports_array_properties() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "numbers": [1, 2, 3], + "strings": ["a", "b", "c"] + } + """); + + // Act + var act = () => node.Should().BeEquivalentTo(new + { + numbers = new[] + { + 1, + 2, + 4 + }, + strings = new[] + { + "a", + "b", + "d" + } + }); + + // Assert + act.Should().Throw().WithMessage("*$.numbers[2]*4*3*$.strings[2]*d*c*"); + } + + [Fact] + public void Supports_nested_object_properties() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "person": { + "name": "John", + "age": 25 + }, + "address": { + "street": "Main St", + "city": "New York" + } + } + """); + + // Act + var act = () => node.Should().BeEquivalentTo(new + { + person = new + { + name = "Jane", + age = 30 + }, + address = new + { + street = "Second St", + city = "Boston" + } + }); + + // Assert + act.Should().Throw().WithMessage("*property $.person.name*Jane*John*"); + } + + [Fact] + public void Supports_empty_objects() + { + // Arrange + var node = JsonNode.Parse("{}"); + + // Act + var act = () => node.Should().BeEquivalentTo(new + { + }); + + // Assert + act.Should().Throw().WithMessage("*No members were found for comparison*"); + } + + [Fact] + public void Supports_empty_arrays() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "emptyArray": [] + } + """); + + // Act & Assert + node.Should().BeEquivalentTo(new + { + emptyArray = new int[0] + }); + } + + [Fact] + public void Supports_mixed_type_arrays() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "mixedArray": [1, "text", true, null] + } + """); + + // Act & Assert + node.Should().BeEquivalentTo(new + { + mixedArray = new object[] + { + 1, + "text", + true, + null + } + }); + } + + [Fact] + public void Supports_deeply_nested_structures() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "level1": { + "level2": { + "level3": { + "value": "deep" + } + } + } + } + """); + + // Act + var act = () => node.Should().BeEquivalentTo(new + { + level1 = new + { + level2 = new + { + level3 = new + { + value = "shallow" + } + } + } + }); + + // Assert + act.Should().Throw().WithMessage("*$.level1.level2.level3.value*shallow*deep*"); + } + + [Fact] + public void Can_detect_a_missing_property() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "existingProperty": "value" + } + """); + + // Act + var act = () => node.Should().BeEquivalentTo(new + { + existingProperty = "value", + missingProperty = "missing" + }); + + // Assert + act.Should().Throw().WithMessage("*missingProperty*"); + } + + [Fact] + public void Can_ignore_a_missing_property() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "existingProperty": "value" + } + """); + + // Act + var act = () => node.Should().BeEquivalentTo(new + { + existingProperty = "wrongvalue", + missingProperty = "missing" + }, options => options.ExcludingMissingMembers()); + + // Assert + act.Should().Throw().WithMessage("*existingProperty*wrongvalue*") + .Which.Message.Should().NotContain("missingProperty"); + } + + [Fact] + public void Can_interpret_an_iso_date_as_a_local_datetime() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "date": "2025-09-11T21:17:00" + } + """); + + // Act / Assert + node.Should().BeEquivalentTo(new + { + date = 11.September(2025).At(21, 17), + }); + } + + [Fact] + public void Can_interpret_an_iso_date_as_an_utc_datetime() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "date": "2025-09-11T21:17:00Z" + } + """); + + // Act / Assert + node.Should().BeEquivalentTo(new + { + date = 11.September(2025).At(21, 17).AsUtc() + }); + } + + [Fact] + public void Casing_of_properties_must_match_by_default() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "existingProperty": "value" + } + """); + + // Act / Assert + node.Should().BeEquivalentTo(new + { + existingProperty = "value", + }); + } + + [Fact] + public void Can_match_properties_even_if_the_casing_is_different() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "existingProperty": "value" + } + """); + + // Act / Assert + node.Should().BeEquivalentTo(new + { + ExistingProperty = "value", + }, options => options.IgnoringJsonPropertyCasing()); + } + + [Fact] + public void Supports_extra_properties_in_json() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "expectedProperty": "value", + "extraProperty": "extra" + } + """); + + // Act & Assert + // This should pass as extra properties are typically ignored in equivalency + node.Should().BeEquivalentTo(new + { + expectedProperty = "value" + }, options => options.IgnoringJsonPropertyCasing()); + } + + [Fact] + public void Supports_complex_mixed_scenario() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "id": 123, + "name": "Product", + "price": 99.99, + "isAvailable": true, + "tags": ["electronics", "gadget"], + "metadata": { + "createdBy": "admin", + "createdAt": null, + "settings": { + "visible": true, + "priority": 1 + } + }, + "variants": [] + } + """); + + // Act & Assert + node.Should().BeEquivalentTo(new + { + id = 123, + name = "Product", + price = 99.99, + isAvailable = true, + tags = new[] + { + "electronics", + "gadget" + }, + metadata = new + { + createdBy = "admin", + createdAt = (string)null, + settings = new + { + visible = true, + priority = 1 + } + }, + variants = new object[0] + }); + } + + [Fact] + public void Can_assert_the_inequivalence_of_complex_mixed_scenario() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "id": 123, + "name": "Product", + "price": 99.99, + "isAvailable": true, + "tags": ["electronics", "gadget"], + "metadata": { + "createdBy": "admin", + "createdAt": null, + "settings": { + "visible": true, + "priority": 1 + } + }, + "variants": [] + } + """); + + // Act + var act = () => node.Should().NotBeEquivalentTo(new + { + id = 123, + name = "Product", + price = 99.99, + isAvailable = true, + tags = new[] + { + "electronics", + "gadget" + }, + metadata = new + { + createdBy = "admin", + createdAt = (string)null, + settings = new + { + visible = true, + priority = 1 + } + }, + variants = new object[0] + }); + + // Assert + act.Should().Throw().WithMessage("Did not expect*metadata*but they are*"); + } + + [Fact] + public void An_inequivalency_assertion_can_be_case_insensitive() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "existingProperty": "value" + } + """); + + // Act + var act = () => node.Should().NotBeEquivalentTo(new + { + ExistingProperty = "value", + }, options => options.IgnoringJsonPropertyCasing()); + + // Assert + act.Should().Throw().WithMessage("Did not expect*existingProperty*"); + } + + [Fact] + public void Can_treat_a_json_array_as_a_collection() + { + // Arrange + JsonArray array = JsonNode.Parse("[1, 2, 3]")!.AsArray(); + + // Act & Assert + array.Should().NotBeEmpty(); + } + + [Fact] + public void Can_treat_a_null_json_array_as_a_collection() + { + // Arrange + JsonArray array = null; + + // Act & Assert + array.Should().BeNull(); + } +} + +#endif diff --git a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs index 971cebed16..c4ca546adb 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs @@ -123,7 +123,7 @@ public void When_not_all_the_properties_of_the_nested_objects_are_equal_it_shoul "- Compare tuples by their properties*" + "- Compare anonymous types by their properties*" + "- Compare records by their members*" + - "- Match member by name (or throw)*" + + "- Match (JSON) member by name (or throw)*" + "- Be strict about the order of items in byte arrays*" + "- Without automatic conversion.*"); } diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs index 1ad5900528..0b332ebbc3 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.cs @@ -47,7 +47,7 @@ public void Public_methods_follow_fluent_syntax() .PreferringRuntimeMemberTypes() .ThrowingOnMissingMembers() .Using(new ExtensibilitySpecs.DoEquivalencyStep(() => { })) - .Using(new MustMatchByNameRule()) + .Using(new MustMatchMemberByNameRule()) .Using(new AllFieldsSelectionRule()) .Using(new ByteArrayOrderingRule()) .Using(StringComparer.OrdinalIgnoreCase) diff --git a/Tests/FluentAssertions.Specs/ExtensibilitySpecs.cs b/Tests/FluentAssertions.Extensibility.Specs/ExtensibilitySpecs.cs similarity index 97% rename from Tests/FluentAssertions.Specs/ExtensibilitySpecs.cs rename to Tests/FluentAssertions.Extensibility.Specs/ExtensibilitySpecs.cs index 6f729948be..bb287c11cf 100644 --- a/Tests/FluentAssertions.Specs/ExtensibilitySpecs.cs +++ b/Tests/FluentAssertions.Extensibility.Specs/ExtensibilitySpecs.cs @@ -1,9 +1,8 @@ using System; using ExampleExtensions; -using Xunit; using Xunit.Sdk; -namespace FluentAssertions.Specs; +namespace FluentAssertions.Extensibility.Specs; public class ExtensibilitySpecs { diff --git a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj index 200a3b5aa8..1dba3a2c52 100644 --- a/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj +++ b/Tests/FluentAssertions.Extensibility.Specs/FluentAssertions.Extensibility.Specs.csproj @@ -30,6 +30,7 @@ + diff --git a/Tests/FluentAssertions.Extensibility.Specs/HttpResponseMessageAssertions.cs b/Tests/FluentAssertions.Extensibility.Specs/HttpResponseMessageAssertions.cs new file mode 100644 index 0000000000..02f4eaae7a --- /dev/null +++ b/Tests/FluentAssertions.Extensibility.Specs/HttpResponseMessageAssertions.cs @@ -0,0 +1,27 @@ +#if NET6_0_OR_GREATER + +using System.Net.Http; +using System.Text.Json.Nodes; +using System.Threading.Tasks; + +namespace FluentAssertions.Extensibility.Specs; + +internal static class HttpResponseMessageExtensions +{ + public static HttpResponseMessageAssertions Should(this HttpResponseMessage response) + { + return new HttpResponseMessageAssertions(response); + } +} + +internal class HttpResponseMessageAssertions(HttpResponseMessage response) +{ + public async Task BeEquivalentTo(T expectation) + { + string body = await response.Content.ReadAsStringAsync(); + + JsonNode.Parse(body).Should().BeEquivalentTo(expectation); + } +} + +#endif diff --git a/Tests/FluentAssertions.Extensibility.Specs/JsonWithInlineAssertionsSpecs.cs b/Tests/FluentAssertions.Extensibility.Specs/JsonWithInlineAssertionsSpecs.cs new file mode 100644 index 0000000000..870333e3ec --- /dev/null +++ b/Tests/FluentAssertions.Extensibility.Specs/JsonWithInlineAssertionsSpecs.cs @@ -0,0 +1,88 @@ +#if NET6_0_OR_GREATER +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; + +namespace FluentAssertions.Extensibility.Specs; + +public class JsonWithInlineAssertionsSpecs +{ + [Fact] + public async Task Can_use_inline_predicates_during_json_assertions() + { + // Arrange + string json = + """ + { + "Id": "TestPackage", + "Versions": [ + { + "Version": "1.0.0", + "Description": "Test package description", + "RepositoryUrl": "https://github.com/test/package", + "Owner": "testowner" + } + ] + } + """; + + var response = new HttpResponseMessage(HttpStatusCode.OK); + response.Content = new StringContent(json); + + // Act / Assert + await response.Should().BeEquivalentTo(new + { + Id = "TestPackage", + Versions = new[] + { + new + { + Version = "1.0.0", + Description = Value.ThatMatches(s => s.Contains("Test")), + RepositoryUrl = "https://github.com/test/package", + Owner = "testowner", + } + } + }); + } + + [Fact] + public async Task Can_use_inline_assertions_during_json_assertions() + { + // Arrange + string json = + """ + { + "Id": "TestPackage", + "Versions": [ + { + "Version": "1.0.0", + "Description": "Test package description", + "RepositoryUrl": "https://github.com/test/package", + "Owner": "testowner" + } + ] + } + """; + + var response = new HttpResponseMessage(HttpStatusCode.OK); + response.Content = new StringContent(json); + + // Act / Assert + await response.Should().BeEquivalentTo(new + { + Id = "TestPackage", + Versions = new[] + { + new + { + Version = "1.0.0", + Description = Value.ThatSatisfies(s => s.Should().Contain("description")), + RepositoryUrl = "https://github.com/test/package", + Owner = "testowner", + } + } + }); + } +} +#endif diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 11621b6458..11a0bcabd9 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -41,7 +41,6 @@ - diff --git a/Tests/FluentAssertions.Specs/Formatting/JsonFormatterSpecs.cs b/Tests/FluentAssertions.Specs/Formatting/JsonFormatterSpecs.cs new file mode 100644 index 0000000000..5a60cfc863 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Formatting/JsonFormatterSpecs.cs @@ -0,0 +1,102 @@ +#if NET6_0_OR_GREATER + +using System.Text.Json.Nodes; +using FluentAssertions.Formatting; +using Xunit; +using Formatter = FluentAssertions.Formatting.Formatter; + +namespace FluentAssertions.Specs.Formatting; + +public class JsonFormatterSpecs +{ + [Fact] + public void Can_format_a_json_node() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "id": 123, + "name": "Product", + "price": 99.99, + "isAvailable": true, + "tags": ["electronics", "gadget"], + "metadata": { + "createdBy": "admin", + "createdAt": null, + "settings": { + "visible": true, + "priority": 1 + } + }, + "variants": [] + } + """); + + // Act + string result = Formatter.ToString(node); + + // Assert + result.Should().Be( + """ + {"id":123,"name":"Product","price":99.99,"isAvailable":true,"tags":["electronics","gadget"],"metadata":{"createdBy":"admin","createdAt":null,"settings":{"visible":true,"priority":1}},"variants":[]} + """); + } + + [Fact] + public void Can_format_a_json_node_using_line_breaks() + { + // Arrange + var node = JsonNode.Parse( + """ + { + "id": 123, + "name": "Product", + "price": 99.99, + "isAvailable": true, + "tags": ["electronics", "gadget"], + "metadata": { + "createdBy": "admin", + "createdAt": null, + "settings": { + "visible": true, + "priority": 1 + } + }, + "variants": [] + } + """); + + // Act + string result = Formatter.ToString(node, new FormattingOptions + { + UseLineBreaks = true + }); + + // Assert + result.Should().Be( + """ + { + "id": 123, + "name": "Product", + "price": 99.99, + "isAvailable": true, + "tags": [ + "electronics", + "gadget" + ], + "metadata": { + "createdBy": "admin", + "createdAt": null, + "settings": { + "visible": true, + "priority": 1 + } + }, + "variants": [] + } + """); + } +} + +#endif diff --git a/Tests/FluentAssertions.Specs/Specialized/JsonNodeSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/JsonNodeSpecs.cs new file mode 100644 index 0000000000..fc6502a255 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Specialized/JsonNodeSpecs.cs @@ -0,0 +1,590 @@ +#if NET6_0_OR_GREATER + +using System.Collections.Generic; +using System.Text.Json.Nodes; +using FluentAssertions.Extensions; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Specialized; + +public class JsonNodeSpecs +{ + public class HaveProperty + { + [Fact] + public void Can_ensure_a_property_exists() + { + // Arrange + var jsonNode = JsonNode.Parse("{ \"name\": \"John\" }"); + + // Act + var act = () => jsonNode.Should().HaveProperty("code", "that is what we expect"); + + // Assert + act.Should().Throw("Expected jsonNode to have property \"code\" because that is what we expect"); + } + + [Fact] + public void Can_continue_with_the_value_of_a_property() + { + // Arrange + var jsonNode = JsonNode.Parse("{ \"name\": \"John\" }"); + + // Act + var subject = jsonNode.Should().HaveProperty("name").Which; + + // Assert + subject.ToString().Should().Be("John"); + } + + [Fact] + public void Can_ensure_a_property_does_not_exist() + { + // Arrange + var jsonNode = JsonNode.Parse("{ \"name\": \"John\" }"); + + // Act & Assert + jsonNode.Should().NotHaveProperty("code"); + } + + [Fact] + public void Fails_for_an_unexpected_property() + { + // Arrange + var jsonNode = JsonNode.Parse("{ \"name\": \"John\" }"); + + // Act + var act = () => jsonNode.Should().NotHaveProperty("name", "because we expect it not to exist"); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect jsonNode to have property \"name\" because we expect it not to exist."); + } + + [Fact] + public void Cannot_check_for_a_property_on_a_null_node() + { + // Arrange + JsonNode jsonNode = null; + + // Act + var act = () => jsonNode.Should().HaveProperty("name"); + + // Assert + act.Should().Throw() + .WithMessage("Cannot assert the existence of a property on a JSON node*"); + } + + [Fact] + public void Cannot_check_for_the_absence_of_property_on_a_null_node() + { + // Arrange + JsonNode jsonNode = null; + + // Act + var act = () => jsonNode.Should().NotHaveProperty("name"); + + // Assert + act.Should().Throw() + .WithMessage("Cannot assert the existence of a property on a JSON node*"); + } + } + + public class BeArray + { + [Fact] + public void Can_ensure_a_json_fragment_is_an_array() + { + // Arrange + var jsonNode = JsonNode.Parse("[1, 2, 3]"); + + // Act + IEnumerable items = jsonNode.Should().BeAnArray().Which; + + // Assert + items.Should().HaveCount(3); + } + + [Fact] + public void Fails_for_a_non_array_json_fragment() + { + // Arrange + var jsonNode = JsonNode.Parse("{ \"name\": \"John\" }"); + + // Act + var act = () => jsonNode.Should().BeAnArray("we expect it to be an array"); + + // Assert + act.Should().Throw() + .WithMessage("Expected jsonNode to be an array because we expect it to be an array, but* is not."); + } + + [Fact] + public void Can_ensure_json_is_not_an_array() + { + // Arrange + var jsonNode = JsonNode.Parse("{ \"name\": \"John\" }"); + + // Act & Assert + jsonNode.Should().NotBeAnArray(); + } + + [Fact] + public void Fails_for_an_unexpected_array_fragment() + { + // Arrange + var jsonNode = JsonNode.Parse("[1, 2, 3]"); + + // Act + var act = () => jsonNode.Should().NotBeAnArray("we expect it not to be an array"); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect jsonNode to be an array because we expect it not to be an array, but*1*is."); + } + + [Fact] + public void A_null_node_cannot_be_an_array() + { + // Arrange + JsonNode jsonNode = null; + + // Act + var act = () => jsonNode.Should().BeAnArray(); + + // Assert + act.Should().Throw().WithMessage("Expected jsonNode to be an array*"); + } + + [Fact] + public void A_null_node_cannot_not_be_an_array() + { + // Arrange + JsonNode jsonNode = null; + + // Act & Assert + jsonNode.Should().NotBeAnArray(); + } + } + + public class BeNumeric + { + [Fact] + public void Returns_the_integer_for_chaining_purposes() + { + // Arrange + var jsonNode = JsonNode.Parse("42"); + + // Act & Assert + jsonNode.Should().BeNumeric().Which.Should().Be(42); + } + + [Fact] + public void Includes_the_reason_for_something_other_than_a_number() + { + // Arrange + var jsonNode = JsonNode.Parse("\"not a number\""); + + // Act + var act = () => jsonNode.Should().BeNumeric("we expect an int"); + + // Assert + act.Should().Throw() + .WithMessage("Expected jsonNode to be an Int32 because we expect an int, but \"not a number\" is not."); + } + + [Fact] + public void Can_ensure_a_node_is_not_a_number() + { + // Arrange + var jsonNode = JsonNode.Parse("\"not a number\""); + + // Act & Assert + jsonNode.Should().NotBeNumeric(); + } + + [Fact] + public void Includes_a_reason_for_an_unexpected_number() + { + // Arrange + var jsonNode = JsonNode.Parse("42"); + + // Act + var act = () => jsonNode.Should().NotBeNumeric("we expect something else"); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect jsonNode to be an Int32 because we expect something else, but 42 is."); + } + + [Fact] + public void Fails_while_asserting_a_null_json_is_a_number() + { + // Arrange + JsonNode jsonNode = null; + + // Act + var act = () => jsonNode.Should().BeNumeric(); + + // Assert + act.Should().Throw().WithMessage("Expected jsonNode to be an Int32*"); + } + + [Fact] + public void A_null_node_is_not_a_number() + { + // Arrange + JsonNode jsonNode = null; + + // Act & Assert + jsonNode.Should().NotBeNumeric(); + } + } + + public class BeLocalDate + { + [Fact] + public void Can_ensure_json_is_a_local_date() + { + // Arrange + var jsonNode = JsonNode.Parse("\"2025-09-11T21:17:00\""); + + // Act & Assert + jsonNode.Should().BeLocalDate().Which.Should().Be(11.September(2025).At(21, 17).AsLocal()); + } + + [Fact] + public void Fails_for_something_that_is_not_a_date() + { + // Arrange + var jsonNode = JsonNode.Parse("\"not a date\""); + + // Act + var act = () => jsonNode.Should().BeLocalDate("we expect a local date"); + + // Assert + act.Should().Throw() + .WithMessage("Expected jsonNode to be a local date because we expect a local date, but \"not a date\" is not."); + } + + [Fact] + public void A_utc_date_is_not_a_local_date() + { + // Arrange + var jsonNode = JsonNode.Parse("\"2025-09-11T21:17:00Z\""); + + // Act + var act = () => jsonNode.Should().BeLocalDate("we don't expect UTC"); + + // Assert + act.Should().Throw() + .WithMessage("Expected jsonNode to be a local date because we don't expect UTC, but*17:00Z*is not."); + } + + [Fact] + public void A_null_node_is_not_a_local_date() + { + // Arrange + JsonNode jsonNode = null; + + // Act + var act = () => jsonNode.Should().BeLocalDate(); + + // Assert + act.Should().Throw().WithMessage("Expected jsonNode to be a local date*"); + } + + [Fact] + public void An_arbitrary_string_is_not_a_date() + { + // Arrange + var jsonNode = JsonNode.Parse("\"not a date\""); + + // Act & Assert + jsonNode.Should().NotBeLocalDate(); + } + + [Fact] + public void Fails_for_a_local_date() + { + // Arrange + var jsonNode = JsonNode.Parse("\"2025-09-11T21:17:00\""); + + // Act + var act = () => jsonNode.Should().NotBeLocalDate("we expect something else"); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect jsonNode to be a local date because we expect something else, but*21:17* is."); + } + + [Fact] + public void A_utc_date_is_not_a_local_date_as_expected() + { + // Arrange + var jsonNode = JsonNode.Parse("\"2025-09-11T21:17:00Z\""); + + // Act & Assert + jsonNode.Should().NotBeLocalDate("we expect something else"); + } + + [Fact] + public void A_null_node_is_correctly_identified_as_not_a_local_date() + { + // Arrange + JsonNode jsonNode = null; + + // Act & Assert + jsonNode.Should().NotBeLocalDate(); + } + } + + public class BeUtcDate + { + [Fact] + public void Can_ensure_json_is_a_utc_date() + { + // Arrange + var jsonNode = JsonNode.Parse("\"2025-09-11T21:17:00Z\""); + + // Act & Assert + jsonNode.Should().BeUtcDate().Which.Should().Be(11.September(2025).At(21, 17).AsUtc()); + } + + [Fact] + public void Fails_for_something_that_is_not_a_date() + { + // Arrange + var jsonNode = JsonNode.Parse("\"not a date\""); + + // Act + var act = () => jsonNode.Should().BeUtcDate("we expect that"); + + // Assert + act.Should().Throw() + .WithMessage("Expected jsonNode to be a UTC date because we expect that, but \"not a date\" is not."); + } + + [Fact] + public void A_local_date_is_not_an_utc_date() + { + // Arrange + var jsonNode = JsonNode.Parse("\"2025-09-11T21:17:00\""); + + // Act + var act = () => jsonNode.Should().BeUtcDate("we don't expect local"); + + // Assert + act.Should().Throw() + .WithMessage("Expected jsonNode to be a UTC date because we don't expect local, but*17:00*is not."); + } + + [Fact] + public void A_null_node_is_not_a_local_date() + { + // Arrange + JsonNode jsonNode = null; + + // Act + var act = () => jsonNode.Should().BeUtcDate(); + + // Assert + act.Should().Throw().WithMessage("Expected jsonNode to be a UTC date, but*null*is not."); + } + + [Fact] + public void An_arbitrary_string_is_not_a_date() + { + // Arrange + var jsonNode = JsonNode.Parse("\"not a date\""); + + // Act & Assert + jsonNode.Should().NotBeUtcDate(); + } + + [Fact] + public void Fails_for_a_utc_date() + { + // Arrange + var jsonNode = JsonNode.Parse("\"2025-09-11T21:17:00Z\""); + + // Act + var act = () => jsonNode.Should().NotBeUtcDate("we expect something else"); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect jsonNode to be a UTC date because we expect something else, but*21:17* is."); + } + + [Fact] + public void A_local_date_is_not_a_utc_date_as_expected() + { + // Arrange + var jsonNode = JsonNode.Parse("\"2025-09-11T21:17:00\""); + + // Act & Assert + jsonNode.Should().NotBeUtcDate("we expect something else"); + } + + [Fact] + public void A_null_node_is_correctly_identified_as_not_a_UTC_date() + { + // Arrange + JsonNode jsonNode = null; + + // Act & Assert + jsonNode.Should().NotBeUtcDate(); + } + } + + public class BeBool + { + [Fact] + public void Can_ensure_the_json_fragment_is_a_bool() + { + // Arrange + var jsonNode = JsonNode.Parse("true"); + + // Act & Assert + jsonNode.Should().BeBool().Which.Should().BeTrue(); + } + + [Fact] + public void Fails_for_a_json_fragment_that_is_not_a_bool() + { + // Arrange + var jsonNode = JsonNode.Parse("\"not a boolean\""); + + // Act + var act = () => jsonNode.Should().BeBool("we expect a boolean"); + + // Assert + act.Should().Throw() + .WithMessage("Expected jsonNode to be a boolean because we expect a boolean, but \"not a boolean\" is not."); + } + + [Fact] + public void Null_is_not_a_json_fragment() + { + // Arrange + JsonNode jsonNode = null; + + // Act + var act = () => jsonNode.Should().BeBool(); + + // Assert + act.Should().Throw().WithMessage("Expected jsonNode to be a boolean, but is not."); + } + + [Fact] + public void Can_ensure_json_is_not_a_bool() + { + // Arrange + var jsonNode = JsonNode.Parse("\"not a boolean\""); + + // Act & Assert + jsonNode.Should().NotBeBool(); + } + + [Fact] + public void Fails_for_a_json_fragment_is_a_bool_after_all() + { + // Arrange + var jsonNode = JsonNode.Parse("true"); + + // Act + var act = () => jsonNode.Should().NotBeBool("we are expected something else"); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect jsonNode to be a boolean because we are expected something else, but*true* is."); + } + + [Fact] + public void Null_is_not_a_bool_as_expected() + { + // Arrange + JsonNode jsonNode = null; + + // Act & Assert + jsonNode.Should().NotBeBool(); + } + } + + public class BeString + { + [Fact] + public void Can_ensure_json_is_string() + { + // Arrange + var jsonNode = JsonNode.Parse("\"Hello World\""); + + // Act & Assert + jsonNode.Should().BeString().Which.Should().Be("Hello World"); + } + + [Fact] + public void Fails_for_anything_but_a_string() + { + // Arrange + var jsonNode = JsonNode.Parse("42"); + + // Act + var act = () => jsonNode.Should().BeString("we expect a string"); + + // Assert + act.Should().Throw() + .WithMessage("Expected jsonNode to be a string because we expect a string, but 42 is not."); + } + + [Fact] + public void A_null_value_is_not_a_json_string() + { + // Arrange + JsonNode jsonNode = null; + + // Act + var act = () => jsonNode.Should().BeString(); + + // Assert + act.Should().Throw().WithMessage("Expected jsonNode to be a string*"); + } + + [Fact] + public void Can_ensure_json_is_not_string() + { + // Arrange + var jsonNode = JsonNode.Parse("42"); + + // Act & Assert + jsonNode.Should().NotBeString(); + } + + [Fact] + public void Fails_for_a_string_that_is_not_expected() + { + // Arrange + var jsonNode = JsonNode.Parse("\"Hello World\""); + + // Act + var act = () => jsonNode.Should().NotBeString("we expect something else"); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect jsonNode to be a string because we expect something else, but*Hello World*is."); + } + + [Fact] + public void A_null_value_is_not_a_string_as_expected() + { + // Arrange + JsonNode jsonNode = null; + + // Act & Assert + jsonNode.Should().NotBeString(); + } + } +} + +#endif diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index 826fa47aca..bad82fae37 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -57,8 +57,8 @@ sidebar: url: /guids - title: Enums url: /enums - - title: System.Data - url: /data + - title: JSON (System.Text.Json) + url: /json - title: Exceptions url: /exceptions - title: Object Graphs @@ -101,6 +101,10 @@ sidebar: url: /tips/#improved-assertions - title: Migrating from MSTest url: /tips/#mstest-migration + + - title: Upgrading + url: /upgradingtov6 + children: - title: Upgrading to 5.0 url: https://continuousimprover.com/2018/02/fluent-assertions-50-best-unit-test.html#upgrading-tips - title: Upgrading to 6.0 diff --git a/docs/_pages/json.md b/docs/_pages/json.md new file mode 100644 index 0000000000..ab5f78d096 --- /dev/null +++ b/docs/_pages/json.md @@ -0,0 +1,49 @@ +--- +title: JSON +permalink: /json/ +layout: single +classes: wide +sidebar: + nav: "sidebar" +--- + +For projects targeting .NET 6 or later, there's built-in support for assertions on the types `JsonNode` and `JsonArray` from the `System.Text.Json` namespace. + +```csharp +var jsonNode = JsonNode.Parse("{ \"name\": \"John\" }"); +jsonNode.Should().HaveProperty("name").Which.ToString().Should().Be("John"); +jsonNode.Should().NotHaveProperty("code"); +jsonNode.BeAnArray().Which.Should().HaveCount(3); +jsonNode.NotBeAnArray(); + +var jsonNode = JsonNode.Parse("\"Hello World\""); +jsonNode.Should().BeString().Which.Should().Be("Hello World"); +jsonNode.Should().NotBeString(); + +var jsonNode = JsonNode.Parse("42"); +jsonNode.Should().BeNumeric().Which.Should().Be(42); +jsonNode.Should().NotBeNumeric(); + +var jsonNode = JsonNode.Parse("true"); +jsonNode.Should().BeBool().Which.Should().BeTrue(); +jsonNode.Should().NotBeBool(); +``` + +Although there's no official date time type in JSON like there is for numbers and arrays, there still is the ISO 8601 standard. So Fluent Assertions recognizes those dates like this: + +```csharp +var jsonNode = JsonNode.Parse("\"2025-09-11T21:17:00\""); +jsonNode.Should().BeLocalDate().Which.Should().Be(11.September(2025).At(21, 17).AsLocal()); +jsonNode.Should().NotBeUtcDate(); + +var jsonNode = JsonNode.Parse("\"2025-09-11T21:17:00Z\""); +jsonNode.Should().BeUtcDate().Which.Should().Be(11.September(2025).At(21, 17).AsUtc()); +jsonNode.Should().NotBeLocalDate(); +``` + +JSON arrays get special treatment as well as the same assertions that are available to collections are available here as well. + +```csharp +JsonArray array = JsonNode.Parse("[1, 2, 3]")!.AsArray(); +array.Should().NotBeEmpty(); +``` \ No newline at end of file diff --git a/docs/_pages/objectgraphs.md b/docs/_pages/objectgraphs.md index 3e093882a2..e6a77eab07 100644 --- a/docs/_pages/objectgraphs.md +++ b/docs/_pages/objectgraphs.md @@ -386,6 +386,48 @@ You can also assert that all instances of `OrderDto` are structurally equal to a orderDtos.Should().AllBeEquivalentTo(singleOrder); ``` +### JSON + +For projects targeting .NET 6 or later, you can also compare a `JsonNode` from the `System.Text.Json` namespace representing a deeply nested JSON block against another object such as an anonymous type. You can even use inline assertions like `Value.ThatSatisfies()` and `Value.ThatMatches()`. + +```csharp +var node = JsonNode.Parse( + """ + { + "name": "Product", + "price": 99.99, + "isAvailable": true, + "firstIntroducedOn": "2025-09-11T21:17:00", + "tags": ["electronics", "gadget"], + "metadata": { + "settings": { + "visible": true, + "priority": 1 + } + } + } + """); + +node.Should().BeEquivalentTo(new +{ + name = "Product", + price = 99.99, + isAvailable = true, + firstIntroducedOn = 11.September(2025).At(21, 17), + tags = new[]{"electronics", "gadget"}, + metadata = new + { + settings = new + { + visible = true, + priority = Value.ThatMatches(x => x > 0) + } + }, +}); +``` + +By default, the casing of the properties of the expectation must match those of the JSON properties, but you can influence that using the `IgnoringJsonPropertyCasing()` option. Next to that, as you can see in the example above, JSON properties representing local or UTC-based ISO 8601 compliant dates and times, can be compared to a `DateTime` property. + ### Ordering Fluent Assertions will, by default, ignore the order of the items in the collections, regardless of whether the collection is at the root of the object graph or tucked away in a nested property or field. diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 5830970729..bea9a1ee19 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,6 +7,12 @@ sidebar: nav: "sidebar" --- +## 8.7.0 + +### What's new + +* Added support for `System.Text.Json.JsonNode` and `JsonArray` through new assertions as well as the `BeEquivalentTo` API - [#3094](https://github.com/fluentassertions/fluentassertions/pull/3094) + ## 8.6.0 ### What's new From 9616b477a2ccffa9914879bc12f52740a12644f5 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sat, 20 Sep 2025 19:01:44 +0200 Subject: [PATCH 699/845] Support WithoutMessage when using Should().Throw() and ThrowAsync() --- .../Equivalency/Steps/AssertionResultSet.cs | 9 +++ .../ExceptionAssertionsExtensions.cs | 24 +++++++ .../Specialized/ExceptionAssertions.cs | 58 +++++++++++++++-- .../FluentAssertions/net47.verified.txt | 3 + .../FluentAssertions/net6.0.verified.txt | 3 + .../netstandard2.0.verified.txt | 3 + .../netstandard2.1.verified.txt | 3 + ...ionSpecs.cs => AggregateExceptionSpecs.cs} | 2 +- .../Exceptions/ExceptionMessageSpecs.cs | 65 +++++++++++++++++++ .../Exceptions/OuterExceptionSpecs.cs | 20 +++--- docs/_pages/releases.md | 1 + 11 files changed, 176 insertions(+), 15 deletions(-) rename Tests/FluentAssertions.Specs/Exceptions/{ExceptionAssertionSpecs.cs => AggregateExceptionSpecs.cs} (99%) create mode 100644 Tests/FluentAssertions.Specs/Exceptions/ExceptionMessageSpecs.cs diff --git a/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs b/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs index 8bde0c02aa..c636079e68 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs @@ -37,6 +37,10 @@ public string[] GetTheFailuresForTheSetWithTheFewestFailures(object key = null) } KeyValuePair[] bestResultSets = GetBestResultSets(); + if (bestResultSets.Length == 0) + { + return []; + } KeyValuePair bestMatch = Array.Find(bestResultSets, r => r.Key.Equals(key)); @@ -50,6 +54,11 @@ public string[] GetTheFailuresForTheSetWithTheFewestFailures(object key = null) private KeyValuePair[] GetBestResultSets() { + if (set.Values.Count == 0) + { + return []; + } + int fewestFailures = set.Values.Min(r => r.Length); return set.Where(r => r.Value.Length == fewestFailures).ToArray(); } diff --git a/Src/FluentAssertions/ExceptionAssertionsExtensions.cs b/Src/FluentAssertions/ExceptionAssertionsExtensions.cs index 45de65a1a6..2de8149e47 100644 --- a/Src/FluentAssertions/ExceptionAssertionsExtensions.cs +++ b/Src/FluentAssertions/ExceptionAssertionsExtensions.cs @@ -35,6 +35,30 @@ public static async Task> WithMessage + /// Asserts that the thrown exception does NOT have a message that matches . + /// + /// The containing the thrown exception. + /// + /// The wildcard pattern with which the exception message is matched, where * and ? have special meanings. + /// + /// + /// 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 static async Task> WithoutMessage( + this Task> task, + string wildcardPattern, + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) + where TException : Exception + { + return (await task).WithoutMessage(wildcardPattern, because, becauseArgs); + } + /// /// Asserts that the exception matches a particular condition. /// diff --git a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs index b611fa08d5..3ab2fe9a0d 100644 --- a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs @@ -84,12 +84,61 @@ public virtual ExceptionAssertions WithMessage(string expectedWildca .ForCondition(Subject.Any()) .FailWith("Expected exception with message {0}{reason}, but no exception was thrown.", expectedWildcardPattern); - AssertExceptionMessage(expectedWildcardPattern, because, becauseArgs); + AssertExceptionMessage(message => + message.Should().MatchEquivalentOf(expectedWildcardPattern, because, becauseArgs)); return this; } - private void AssertExceptionMessage(string expectedWildcardPattern, string because, object[] becauseArgs) + /// + /// Asserts that the thrown exception does NOT have a message that matches . + /// + /// + /// The pattern to match against the exception message. This parameter can contain a combination of literal text and + /// wildcard (* and ?) characters, but it doesn't support regular expressions. + /// + /// + /// 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 . + /// + /// + /// can be a combination of literal and wildcard characters, + /// but it doesn't support regular expressions. The following wildcard specifiers are permitted in + /// . + /// + /// + /// Wildcard character + /// Description + /// + /// + /// * (asterisk) + /// Zero or more characters in that position. + /// + /// + /// ? (question mark) + /// Exactly one character in that position. + /// + /// + /// + public virtual ExceptionAssertions WithoutMessage(string wildcardPattern, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + assertionChain + .BecauseOf(because, becauseArgs) + .UsingLineBreaks + .ForCondition(Subject.Any()) + .FailWith("Expected exception without message matching {0}{reason}, but no exception was thrown.", wildcardPattern); + + AssertExceptionMessage(message => + message.Should().NotMatchEquivalentOf(wildcardPattern, because, becauseArgs)); + + return this; + } + + private void AssertExceptionMessage(Action messageAssertion) { var results = new AssertionResultSet(); @@ -97,11 +146,12 @@ private void AssertExceptionMessage(string expectedWildcardPattern, string becau { using (var scope = new AssertionScope()) { + // Treat every assertion within the scope as a new independent one. var chain = AssertionChain.GetOrCreate(); - chain.OverrideCallerIdentifier(() => "exception message"); + chain.OverrideCallerIdentifier(() => "the exception message"); chain.ReuseOnce(); - message.Should().MatchEquivalentOf(expectedWildcardPattern, because, becauseArgs); + messageAssertion(message); results.AddSet(message, scope.Discard()); } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 05bc6d44f4..0238240475 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -245,6 +245,8 @@ namespace FluentAssertions where TException : System.ArgumentException { } public static System.Threading.Tasks.Task> WithParameterName(this System.Threading.Tasks.Task> task, string paramName, string because = "", params object[] becauseArgs) where TException : System.ArgumentException { } + public static System.Threading.Tasks.Task> WithoutMessage(this System.Threading.Tasks.Task> task, string wildcardPattern, string because = "", params object[] becauseArgs) + where TException : System.Exception { } } public static class FluentActions { @@ -2166,6 +2168,7 @@ namespace FluentAssertions.Specialized public virtual FluentAssertions.Specialized.ExceptionAssertions WithInnerExceptionExactly(string because = "", params object[] becauseArgs) where TInnerException : System.Exception { } public virtual FluentAssertions.Specialized.ExceptionAssertions WithMessage(string expectedWildcardPattern, string because = "", params object[] becauseArgs) { } + public virtual FluentAssertions.Specialized.ExceptionAssertions WithoutMessage(string wildcardPattern, string because = "", params object[] becauseArgs) { } } public class ExecutionTime { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 756c7784a3..e4c2ff2769 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -260,6 +260,8 @@ namespace FluentAssertions where TException : System.ArgumentException { } public static System.Threading.Tasks.Task> WithParameterName(this System.Threading.Tasks.Task> task, string paramName, string because = "", params object[] becauseArgs) where TException : System.ArgumentException { } + public static System.Threading.Tasks.Task> WithoutMessage(this System.Threading.Tasks.Task> task, string wildcardPattern, string because = "", params object[] becauseArgs) + where TException : System.Exception { } } public static class FluentActions { @@ -2301,6 +2303,7 @@ namespace FluentAssertions.Specialized public virtual FluentAssertions.Specialized.ExceptionAssertions WithInnerExceptionExactly(string because = "", params object[] becauseArgs) where TInnerException : System.Exception { } public virtual FluentAssertions.Specialized.ExceptionAssertions WithMessage(string expectedWildcardPattern, string because = "", params object[] becauseArgs) { } + public virtual FluentAssertions.Specialized.ExceptionAssertions WithoutMessage(string wildcardPattern, string because = "", params object[] becauseArgs) { } } public class ExecutionTime { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index ee065b0c6e..dc3161998c 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -237,6 +237,8 @@ namespace FluentAssertions where TException : System.ArgumentException { } public static System.Threading.Tasks.Task> WithParameterName(this System.Threading.Tasks.Task> task, string paramName, string because = "", params object[] becauseArgs) where TException : System.ArgumentException { } + public static System.Threading.Tasks.Task> WithoutMessage(this System.Threading.Tasks.Task> task, string wildcardPattern, string because = "", params object[] becauseArgs) + where TException : System.Exception { } } public static class FluentActions { @@ -2110,6 +2112,7 @@ namespace FluentAssertions.Specialized public virtual FluentAssertions.Specialized.ExceptionAssertions WithInnerExceptionExactly(string because = "", params object[] becauseArgs) where TInnerException : System.Exception { } public virtual FluentAssertions.Specialized.ExceptionAssertions WithMessage(string expectedWildcardPattern, string because = "", params object[] becauseArgs) { } + public virtual FluentAssertions.Specialized.ExceptionAssertions WithoutMessage(string wildcardPattern, string because = "", params object[] becauseArgs) { } } public class ExecutionTime { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index f9e20dbb4d..7b8e2d7187 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -245,6 +245,8 @@ namespace FluentAssertions where TException : System.ArgumentException { } public static System.Threading.Tasks.Task> WithParameterName(this System.Threading.Tasks.Task> task, string paramName, string because = "", params object[] becauseArgs) where TException : System.ArgumentException { } + public static System.Threading.Tasks.Task> WithoutMessage(this System.Threading.Tasks.Task> task, string wildcardPattern, string because = "", params object[] becauseArgs) + where TException : System.Exception { } } public static class FluentActions { @@ -2166,6 +2168,7 @@ namespace FluentAssertions.Specialized public virtual FluentAssertions.Specialized.ExceptionAssertions WithInnerExceptionExactly(string because = "", params object[] becauseArgs) where TInnerException : System.Exception { } public virtual FluentAssertions.Specialized.ExceptionAssertions WithMessage(string expectedWildcardPattern, string because = "", params object[] becauseArgs) { } + public virtual FluentAssertions.Specialized.ExceptionAssertions WithoutMessage(string wildcardPattern, string because = "", params object[] becauseArgs) { } } public class ExecutionTime { diff --git a/Tests/FluentAssertions.Specs/Exceptions/ExceptionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/AggregateExceptionSpecs.cs similarity index 99% rename from Tests/FluentAssertions.Specs/Exceptions/ExceptionAssertionSpecs.cs rename to Tests/FluentAssertions.Specs/Exceptions/AggregateExceptionSpecs.cs index d117ad5c45..44f5acb9e7 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/ExceptionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/AggregateExceptionSpecs.cs @@ -4,7 +4,7 @@ namespace FluentAssertions.Specs.Exceptions; -public class ExceptionAssertionSpecs +public class AggregateExceptionSpecs { [Fact] public void When_method_throws_an_empty_AggregateException_it_should_fail() diff --git a/Tests/FluentAssertions.Specs/Exceptions/ExceptionMessageSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/ExceptionMessageSpecs.cs new file mode 100644 index 0000000000..38b5e5672e --- /dev/null +++ b/Tests/FluentAssertions.Specs/Exceptions/ExceptionMessageSpecs.cs @@ -0,0 +1,65 @@ +using System; +using System.Threading.Tasks; +using FluentAssertions.Execution; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Exceptions; + +public class ExceptionMessageSpecs +{ + [Fact] + public void Can_assert_the_exception_message_does_not_include_a_specific_string() + { + // Arrange + Action throwException = () => throw new InvalidOperationException("Something bad happened"); + + // Act + Action act = () => throwException.Should() + .Throw() + .WithoutMessage("*bad*") + .Which.Should().Be(typeof(InvalidOperationException)); + + // Assert + act.Should().Throw() + .WithMessage( + "Did not expect the exception message to match the equivalent of \"*bad*\", but \"Something bad happened\" matches."); + } + + [Fact] + public void Only_check_the_message_of_an_actual_exception() + { + // Arrange + Action dontThrowAtAll = () => { }; + + // Act + var act = () => + { + using var _ = new AssertionScope(); + + return dontThrowAtAll.Should() + .Throw() + .WithoutMessage("*bad*"); + }; + + // Assert + act.Should().Throw() + .WithMessage( + "Expected*System.InvalidOperationException*no exception*"); + } + + [Fact] + public async Task Can_assert_an_async_exception_message_does_not_include_a_specific_string() + { + // Arrange + Func throwsAsync = () => throw new AggregateException(new ArgumentException("That was wrong.")); + + // Act + var act = () => throwsAsync.Should().ThrowAsync().WithoutMessage("That was wrong."); + + // Assert + await act.Should().ThrowAsync() + .WithMessage( + "Did not expect the exception message to match the equivalent of \"*wrong*\", but \"That was wrong.\" matches."); + } +} diff --git a/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs index 548460ea3f..d5682199fe 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs @@ -37,7 +37,7 @@ public void When_subject_throws_expected_exception_but_with_unexpected_message_i { // Assert ex.Message.Should().Match( - "Expected exception message to match the equivalent of*\"some message\", but*\"some\" does not*"); + "Expected the exception message to match the equivalent of*\"some message\", but*\"some\" does not*"); } } @@ -62,7 +62,7 @@ public void Long_exception_messages_are_rendered_over_multiple_lines() // Assert ex.Message.Should().Match( """ - Expected exception message to match the equivalent of + Expected the exception message to match the equivalent of "*", @@ -100,7 +100,7 @@ public void Multiline_exception_messages_are_rendered_over_multiple_lines() // Assert ex.Message.Should().Match( """ - Expected exception message to match the equivalent of + Expected the exception message to match the equivalent of "line1* line2", @@ -135,7 +135,7 @@ public void Short_exception_messages_are_rendered_on_a_single_line() { // Assert ex.Message.Should().Match( - """Expected exception message to match the equivalent of "*", but "some" does not."""); + """Expected the exception message to match the equivalent of "*", but "some" does not."""); } } @@ -168,7 +168,7 @@ public void When_subject_throws_expected_exception_with_message_that_does_not_st // Assert action.Should().Throw() .WithMessage( - "Expected exception message to match the equivalent of*\"Expected mes*\", but*\"OxpectOd message\" does not*"); + "Expected the exception message to match the equivalent of*\"Expected mes*\", but*\"OxpectOd message\" does not*"); } [Fact] @@ -201,7 +201,7 @@ public void When_subject_throws_expected_exception_with_message_that_does_not_st // Assert action.Should().Throw() .WithMessage( - "Expected exception message to match the equivalent of*\"expected mes*\", but*\"OxpectOd message\" does not*"); + "Expected the exception message to match the equivalent of*\"expected mes*\", but*\"OxpectOd message\" does not*"); } [Fact] @@ -224,7 +224,7 @@ public void When_subject_throws_some_exception_with_unexpected_message_it_should { // Assert ex.Message.Should().Match( - "Expected exception message to match the equivalent of \"message2\" because we want to test the failure message, but \"message1\" does not*"); + "Expected the exception message to match the equivalent of \"message2\" because we want to test the failure message, but \"message1\" does not*"); } } @@ -248,7 +248,7 @@ public void When_subject_throws_some_exception_with_an_empty_message_it_should_t { // Assert ex.Message.Should().Match( - "Expected exception message to match the equivalent of \"message2\"*, but \"\"*"); + "Expected the exception message to match the equivalent of \"message2\"*, but \"\"*"); } } @@ -272,7 +272,7 @@ public void { // Assert ex.Message.Should().Match( - "Expected exception message to match the equivalent of*\"message2\",*but*message2*someParam*"); + "Expected the exception message to match the equivalent of*\"message2\",*but*message2*someParam*"); } } @@ -343,7 +343,7 @@ public void When_subject_throws_exception_with_message_with_braces_but_a_differe { // Assert ex.Message.Should().Match( - "Expected exception message to match the equivalent of*\"message without\"*, but*\"message with {}*"); + "Expected the exception message to match the equivalent of*\"message without\"*, but*\"message with {}*"); } } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index bea9a1ee19..560101540f 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -12,6 +12,7 @@ sidebar: ### What's new * Added support for `System.Text.Json.JsonNode` and `JsonArray` through new assertions as well as the `BeEquivalentTo` API - [#3094](https://github.com/fluentassertions/fluentassertions/pull/3094) +* Added `WithoutMessage` to allow asserting an exception message does not contain a wildcard pattern - [#3100](https://github.com/fluentassertions/fluentassertions/pull/3100) ## 8.6.0 From dc329974c4f45c795c7deba3db663e0572a4f7f4 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Thu, 25 Sep 2025 15:05:05 +0200 Subject: [PATCH 700/845] Update CTA label and URL for Fluent Assertions release --- docs/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/index.html b/docs/index.html index 30de4677dc..bac70d69e2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,8 +6,8 @@ overlay_color: "#373737" overlay_filter: "0.5" overlay_image: "/assets/images/FA_Partner_Logo.png" - cta_label: "Fluent Assertions 7.2 and 8.2 are out!" - cta_url: "https://fluentassertions.com/releases/#820" + cta_label: "Fluent Assertions 8.7 is out with extensive System.Text.Json support" + cta_url: "https://fluentassertions.com/releases/#870" caption: " " excerpt: 'Now an Xceed Partner! - [Learn More](https://xceed.com/fluent-assertions-faq/)
From 860f350d16cc048ee531a59641ad0826c29da344 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Fri, 26 Sep 2025 19:26:46 +0200 Subject: [PATCH 701/845] add docs for `config` parameter --- .../Specialized/JsonNodeAssertions.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs b/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs index eee4b5e117..f346175208 100644 --- a/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs +++ b/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs @@ -376,6 +376,12 @@ public AndConstraint BeEquivalentTo(TExpectati /// global options can be set through . /// /// The expected object graph, such as an anonymous type. + /// + /// A reference to the configuration object that can be used + /// to influence the way the object graphs are compared. You can also provide an alternative instance of the + /// class. The global defaults are determined by the + /// class. + /// /// /// 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. @@ -453,6 +459,12 @@ public AndConstraint NotBeEquivalentTo( /// global options can be set through . /// /// The expected object graph, such as an anonymous type. + /// + /// A reference to the configuration object that can be used + /// to influence the way the object graphs are compared. You can also provide an alternative instance of the + /// class. The global defaults are determined by the + /// class. + /// /// /// 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. From 4cc5aac5515a4fa8fd2a705778055c505ab00a86 Mon Sep 17 00:00:00 2001 From: James Skimming <647706+JSkimming@users.noreply.github.com> Date: Sun, 28 Sep 2025 08:04:46 +0100 Subject: [PATCH 702/845] Fixed ambiguity when using Should on a JsonNode derived class (#3102) (cherry picked from commit cf9a506502e738130154271a0811eb9cf181bd2c) --- Src/FluentAssertions/AssertionExtensions.cs | 24 ------ .../JsonAssertionExtensions.cs | 41 +++++++++++ .../Specialized/JsonNodeAssertions.cs | 73 ++++++++++--------- .../FluentAssertions/net6.0.verified.txt | 49 +++++++------ .../JsonNodeSpecs.cs | 30 ++++++++ docs/_pages/json.md | 2 +- docs/_pages/releases.md | 6 ++ 7 files changed, 142 insertions(+), 83 deletions(-) create mode 100644 Src/FluentAssertions/JsonAssertionExtensions.cs diff --git a/Src/FluentAssertions/AssertionExtensions.cs b/Src/FluentAssertions/AssertionExtensions.cs index b4f7cf86f4..624adec0b6 100644 --- a/Src/FluentAssertions/AssertionExtensions.cs +++ b/Src/FluentAssertions/AssertionExtensions.cs @@ -23,11 +23,6 @@ using FluentAssertions.Events; #endif -#if NET6_0_OR_GREATER -using System.Linq; -using System.Text.Json.Nodes; -#endif - namespace FluentAssertions; /// @@ -909,25 +904,6 @@ public static TaskCompletionSourceAssertions Should(this TaskCompletionSource tc return new TaskCompletionSourceAssertions(tcs, AssertionChain.GetOrCreate()); } - /// - /// Returns an object that provides various assertion APIs that act on a . - /// - [Pure] - public static JsonNodeAssertions Should([NotNull] this JsonNode jsonNode) - { - return new JsonNodeAssertions(jsonNode, AssertionChain.GetOrCreate()); - } - - /// - /// Return an object that provides various assertion APIs that treat a - /// as a collection of s. - /// - [Pure] - public static GenericCollectionAssertions Should([NotNull] this JsonArray jsonArray) - { - return new GenericCollectionAssertions(jsonArray?.ToArray(), AssertionChain.GetOrCreate()); - } - #endif /// diff --git a/Src/FluentAssertions/JsonAssertionExtensions.cs b/Src/FluentAssertions/JsonAssertionExtensions.cs new file mode 100644 index 0000000000..6fc01d88c2 --- /dev/null +++ b/Src/FluentAssertions/JsonAssertionExtensions.cs @@ -0,0 +1,41 @@ +#if NET6_0_OR_GREATER + +using System.Diagnostics; +using System.Linq; +using System.Text.Json.Nodes; +using FluentAssertions.Collections; +using FluentAssertions.Execution; +using FluentAssertions.Specialized; +using JetBrains.Annotations; +using NotNullAttribute = System.Diagnostics.CodeAnalysis.NotNullAttribute; + +namespace FluentAssertions; + +/// +/// Contains an extension method for custom assertions in unit tests related to System.Text.Json objects. +/// +[DebuggerNonUserCode] +public static class JsonAssertionExtensions +{ + /// + /// Returns an object that provides various assertion APIs that act on a . + /// + [Pure] + public static JsonNodeAssertions Should([NotNull] this T jsonNode) + where T : JsonNode + { + return new JsonNodeAssertions(jsonNode, AssertionChain.GetOrCreate()); + } + + /// + /// Return an object that provides various assertion APIs that treat a + /// as a collection of s. + /// + [Pure] + public static GenericCollectionAssertions Should([NotNull] this JsonArray jsonArray) + { + return new GenericCollectionAssertions(jsonArray?.ToArray(), AssertionChain.GetOrCreate()); + } +} + +#endif diff --git a/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs b/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs index eee4b5e117..d38d18fcaf 100644 --- a/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs +++ b/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs @@ -13,10 +13,11 @@ namespace FluentAssertions.Specialized; -public class JsonNodeAssertions : ReferenceTypeAssertions +public class JsonNodeAssertions : ReferenceTypeAssertions> + where T : JsonNode { /// - public JsonNodeAssertions(JsonNode subject, AssertionChain assertionChain) + public JsonNodeAssertions(T subject, AssertionChain assertionChain) : base(subject, assertionChain) { } @@ -38,7 +39,7 @@ protected override string Identifier /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint HaveProperty(string code, + public AndWhichConstraint, JsonNode> HaveProperty(string code, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain @@ -49,7 +50,7 @@ public AndWhichConstraint HaveProperty(string code .ForCondition(Subject?[code] != null) .FailWith("Expected {context:JSON node} to have property {0}{reason}.", code); - return new AndWhichConstraint(this, Subject?[code]); + return new AndWhichConstraint, JsonNode>(this, Subject?[code]); } /// @@ -63,7 +64,7 @@ public AndWhichConstraint HaveProperty(string code /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotHaveProperty(string code, + public AndConstraint> NotHaveProperty(string code, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain @@ -75,7 +76,7 @@ public AndConstraint NotHaveProperty(string code, .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:JSON node} to have property {0}{reason}.", code); - return new AndConstraint(this); + return new AndConstraint>(this); } /// @@ -88,7 +89,7 @@ public AndConstraint NotHaveProperty(string code, /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint> BeAnArray( + public AndWhichConstraint, IEnumerable> BeAnArray( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain @@ -96,7 +97,7 @@ public AndWhichConstraint> BeAnArray( .BecauseOf(because, becauseArgs) .FailWith("Expected {context:JSON node} to be an array{reason}, but {0} is not.", Subject); - return new AndWhichConstraint>(this, (Subject as JsonArray)?.AsEnumerable()); + return new AndWhichConstraint, IEnumerable>(this, (Subject as JsonArray)?.AsEnumerable()); } /// @@ -109,7 +110,7 @@ public AndWhichConstraint> BeAnArray( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeAnArray( + public AndConstraint> NotBeAnArray( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain @@ -117,7 +118,7 @@ public AndConstraint NotBeAnArray( .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:JSON node} to be an array{reason}, but {0} is.", Subject); - return new AndConstraint(this); + return new AndConstraint>(this); } /// @@ -130,7 +131,7 @@ public AndConstraint NotBeAnArray( /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint BeNumeric( + public AndWhichConstraint, long> BeNumeric( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain @@ -139,7 +140,7 @@ public AndWhichConstraint BeNumeric( .FailWith("Expected {context:JSON node} to be an Int32{reason}, but {0} is not.", Subject); var actualValue = Subject is JsonValue jsonValue && jsonValue.TryGetValue(out var result) ? result : 0; - return new AndWhichConstraint(this, actualValue); + return new AndWhichConstraint, long>(this, actualValue); } /// @@ -152,7 +153,7 @@ public AndWhichConstraint BeNumeric( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeNumeric( + public AndConstraint> NotBeNumeric( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain @@ -160,7 +161,7 @@ public AndConstraint NotBeNumeric( .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:JSON node} to be an Int32{reason}, but {0} is.", Subject); - return new AndConstraint(this); + return new AndConstraint>(this); } /// @@ -173,7 +174,7 @@ public AndConstraint NotBeNumeric( /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint BeLocalDate( + public AndWhichConstraint, DateTime> BeLocalDate( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain @@ -182,7 +183,7 @@ public AndWhichConstraint BeLocalDate( .FailWith("Expected {context:JSON node} to be a local date{reason}, but {0} is not.", Subject); var actualValue = Subject is JsonValue jsonValue && jsonValue.TryGetValue(out var result) ? result : default; - return new AndWhichConstraint(this, actualValue); + return new AndWhichConstraint, DateTime>(this, actualValue); } /// @@ -195,7 +196,7 @@ public AndWhichConstraint BeLocalDate( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeLocalDate( + public AndConstraint> NotBeLocalDate( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain @@ -203,7 +204,7 @@ public AndConstraint NotBeLocalDate( .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:JSON node} to be a local date{reason}, but {0} is.", Subject); - return new AndConstraint(this); + return new AndConstraint>(this); } /// @@ -216,7 +217,7 @@ public AndConstraint NotBeLocalDate( /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint BeUtcDate( + public AndWhichConstraint, DateTime> BeUtcDate( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain @@ -225,7 +226,7 @@ public AndWhichConstraint BeUtcDate( .FailWith("Expected {context} to be a UTC date{reason}, but {0} is not.", Subject); var actualValue = Subject is JsonValue jsonValue && jsonValue.TryGetValue(out var result) ? result : default; - return new AndWhichConstraint(this, actualValue); + return new AndWhichConstraint, DateTime>(this, actualValue); } /// @@ -238,7 +239,7 @@ public AndWhichConstraint BeUtcDate( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeUtcDate( + public AndConstraint> NotBeUtcDate( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain @@ -246,7 +247,7 @@ public AndConstraint NotBeUtcDate( .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context} to be a UTC date{reason}, but {0} is.", Subject); - return new AndConstraint(this); + return new AndConstraint>(this); } /// @@ -259,7 +260,7 @@ public AndConstraint NotBeUtcDate( /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint BeBool( + public AndWhichConstraint, bool> BeBool( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain @@ -268,7 +269,7 @@ public AndWhichConstraint BeBool( .FailWith("Expected {context} to be a boolean{reason}, but {0} is not.", Subject); var actualValue = Subject is JsonValue jsonValue && jsonValue.TryGetValue(out var result) && result; - return new AndWhichConstraint(this, actualValue); + return new AndWhichConstraint, bool>(this, actualValue); } /// @@ -281,7 +282,7 @@ public AndWhichConstraint BeBool( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeBool( + public AndConstraint> NotBeBool( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain @@ -289,7 +290,7 @@ public AndConstraint NotBeBool( .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:JSON node} to be a boolean{reason}, but {0} is.", Subject); - return new AndConstraint(this); + return new AndConstraint>(this); } /// @@ -302,7 +303,7 @@ public AndConstraint NotBeBool( /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint BeString( + public AndWhichConstraint, string> BeString( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain @@ -311,7 +312,7 @@ public AndWhichConstraint BeString( .FailWith("Expected {context:JSON node} to be a string{reason}, but {0} is not.", Subject); var actualValue = Subject is JsonValue jsonValue && jsonValue.TryGetValue(out var result) ? result : null; - return new AndWhichConstraint(this, actualValue); + return new AndWhichConstraint, string>(this, actualValue); } /// @@ -324,7 +325,7 @@ public AndWhichConstraint BeString( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeString( + public AndConstraint> NotBeString( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain @@ -332,7 +333,7 @@ public AndConstraint NotBeString( .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:JSON node} to be a string{reason}, but {0} is.", Subject); - return new AndConstraint(this); + return new AndConstraint>(this); } /// @@ -355,7 +356,7 @@ public AndConstraint NotBeString( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeEquivalentTo(TExpectation expectation, + public AndConstraint> BeEquivalentTo(TExpectation expectation, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { return BeEquivalentTo(expectation, config => config, because, becauseArgs); @@ -383,7 +384,7 @@ public AndConstraint BeEquivalentTo(TExpectati /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint BeEquivalentTo(TExpectation expectation, + public AndConstraint> BeEquivalentTo(TExpectation expectation, Func, EquivalencyOptions> config, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { @@ -408,7 +409,7 @@ public AndConstraint BeEquivalentTo(TExpectati new EquivalencyValidator().AssertEquality(comparands, context); - return new AndConstraint(this); + return new AndConstraint>(this); } /// @@ -431,7 +432,7 @@ public AndConstraint BeEquivalentTo(TExpectati /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeEquivalentTo( + public AndConstraint> NotBeEquivalentTo( TExpectation unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { @@ -460,7 +461,7 @@ public AndConstraint NotBeEquivalentTo( /// /// Zero or more objects to format using the placeholders in . /// - public AndConstraint NotBeEquivalentTo( + public AndConstraint> NotBeEquivalentTo( TExpectation unexpected, Func, EquivalencyOptions> config, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) @@ -481,7 +482,7 @@ public AndConstraint NotBeEquivalentTo( .WithDefaultIdentifier(Identifier) .FailWith("Did not expect {context:JSON node} to be equivalent to {0}{reason}, but they are.", unexpected); - return new AndConstraint(this); + return new AndConstraint>(this); } } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 756c7784a3..d7d57171f3 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -88,8 +88,6 @@ namespace FluentAssertions public static FluentAssertions.Types.ConstructorInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.ConstructorInfo constructorInfo) { } public static FluentAssertions.Types.MethodInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.MethodInfo methodInfo) { } public static FluentAssertions.Types.PropertyInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.PropertyInfo propertyInfo) { } - public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Text.Json.Nodes.JsonArray jsonArray) { } - public static FluentAssertions.Specialized.JsonNodeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Text.Json.Nodes.JsonNode jsonNode) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } public static FluentAssertions.Primitives.TimeOnlyAssertions Should(this System.TimeOnly actualValue) { } public static FluentAssertions.Primitives.NullableTimeOnlyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.TimeOnly? actualValue) { } @@ -270,6 +268,12 @@ namespace FluentAssertions public static System.Action Invoking(System.Action action) { } public static System.Func Invoking(System.Func func) { } } + public static class JsonAssertionExtensions + { + public static FluentAssertions.Collections.GenericCollectionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Text.Json.Nodes.JsonArray jsonArray) { } + public static FluentAssertions.Specialized.JsonNodeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this T jsonNode) + where T : System.Text.Json.Nodes.JsonNode { } + } public static class LessThan { public static FluentAssertions.OccurrenceConstraint Thrice() { } @@ -2341,28 +2345,29 @@ namespace FluentAssertions.Specialized System.Collections.Generic.IEnumerable OfType(System.Exception actualException) where T : System.Exception; } - public class JsonNodeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions + public class JsonNodeAssertions : FluentAssertions.Primitives.ReferenceTypeAssertions> + where T : System.Text.Json.Nodes.JsonNode { - public JsonNodeAssertions(System.Text.Json.Nodes.JsonNode subject, FluentAssertions.Execution.AssertionChain assertionChain) { } + public JsonNodeAssertions(T subject, FluentAssertions.Execution.AssertionChain assertionChain) { } protected override string Identifier { get; } - public FluentAssertions.AndWhichConstraint> BeAnArray(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint BeBool(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.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint BeLocalDate(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint BeNumeric(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint BeString(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint BeUtcDate(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint HaveProperty(string code, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeAnArray(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeBool(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeEquivalentTo(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeLocalDate(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeNumeric(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeString(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotBeUtcDate(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndConstraint NotHaveProperty(string code, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint, System.Collections.Generic.IEnumerable> BeAnArray(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint, bool> BeBool(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.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint, System.DateTime> BeLocalDate(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint, long> BeNumeric(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint, string> BeString(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint, System.DateTime> BeUtcDate(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint, System.Text.Json.Nodes.JsonNode> HaveProperty(string code, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint> NotBeAnArray(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint> NotBeBool(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint> NotBeEquivalentTo(TExpectation unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint> NotBeEquivalentTo(TExpectation unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint> NotBeLocalDate(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint> NotBeNumeric(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint> NotBeString(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint> NotBeUtcDate(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint> NotHaveProperty(string code, string because = "", params object[] becauseArgs) { } } public class MemberExecutionTime : FluentAssertions.Specialized.ExecutionTime { diff --git a/Tests/FluentAssertions.Equivalency.Specs/JsonNodeSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/JsonNodeSpecs.cs index 9900a05dd6..ef66283b1e 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/JsonNodeSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/JsonNodeSpecs.cs @@ -546,6 +546,36 @@ public void Can_treat_a_null_json_array_as_a_collection() // Act & Assert array.Should().BeNull(); } + + [Fact] + public void Can_assert_json_node_instances() + { + // Arrange + JsonNode jsonNode = null; + + // Act & Assert + jsonNode.Should().BeNull(); + } + + [Fact] + public void Can_assert_json_value_instances() + { + // Arrange + JsonValue jsonValue = null; + + // Act & Assert + jsonValue.Should().BeNull(); + } + + [Fact] + public void Can_assert_json_object_instances() + { + // Arrange + JsonObject jsonObject = null; + + // Act & Assert + jsonObject.Should().BeNull(); + } } #endif diff --git a/docs/_pages/json.md b/docs/_pages/json.md index ab5f78d096..c12d6d0eb4 100644 --- a/docs/_pages/json.md +++ b/docs/_pages/json.md @@ -7,7 +7,7 @@ sidebar: nav: "sidebar" --- -For projects targeting .NET 6 or later, there's built-in support for assertions on the types `JsonNode` and `JsonArray` from the `System.Text.Json` namespace. +For projects targeting .NET 6 or later, there's built-in support for assertions on the types `JsonNode` and `JsonArray` (including `JsonNode` derived classes, e.g. `JsonValue` and `JsonObject`) from the `System.Text.Json` namespace. ```csharp var jsonNode = JsonNode.Parse("{ \"name\": \"John\" }"); diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index bea9a1ee19..b8fa84612b 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,6 +7,12 @@ sidebar: nav: "sidebar" --- +## 8.7.1 + +### Fixes + +* Fixed ambiguity when using `Should()` on a `JsonNode` derived class. - [#3102](https://github.com/fluentassertions/fluentassertions/pull/3102) + ## 8.7.0 ### What's new From ac9ba6aff228232dd23b7ab27b535aa9e34e50c0 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Wed, 1 Oct 2025 21:32:10 +0200 Subject: [PATCH 703/845] Refreshed readme --- README.md | 86 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 75 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9ef506eeac..0adfe90c96 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@


- + Extension methods to fluently assert the outcome of .NET tests
@@ -14,34 +14,98 @@ Extension methods to fluently assert the outcome of .NET tests [![](https://img.shields.io/github/release/FluentAssertions/FluentAssertions.svg?label=latest%20release&color=007edf)](https://github.com/FluentAssertions/FluentAssertions/releases/latest) [![](https://img.shields.io/nuget/dt/FluentAssertions.svg?label=downloads&color=007edf&logo=nuget)](https://www.nuget.org/packages/FluentAssertions) [![](https://img.shields.io/librariesio/dependents/nuget/FluentAssertions.svg?label=dependent%20libraries)](https://libraries.io/nuget/FluentAssertions) -[![GitHub Repo stars](https://img.shields.io/github/stars/fluentassertions/fluentassertions)](https://github.com/fluentassertions/fluentassertions/stargazers) +![GitHub Repo stars](https://img.shields.io/github/stars/fluentassertions/fluentassertions?style=flat) [![GitHub contributors](https://img.shields.io/github/contributors/fluentassertions/fluentassertions)](https://github.com/fluentassertions/fluentassertions/graphs/contributors) [![GitHub last commit](https://img.shields.io/github/last-commit/fluentassertions/fluentassertions)](https://github.com/fluentassertions/fluentassertions) [![GitHub commit activity](https://img.shields.io/github/commit-activity/m/fluentassertions/fluentassertions)](https://github.com/fluentassertions/fluentassertions/graphs/commit-activity) [![open issues](https://img.shields.io/github/issues/fluentassertions/fluentassertions)](https://github.com/fluentassertions/fluentassertions/issues) ![](https://img.shields.io/badge/release%20strategy-githubflow-orange.svg) - -Fluent Assertions provides a comprehensive set of extension methods that enable developers to express the expected outcomes of TDD (Test-Driven Development) and BDD (Behavior-Driven Development) unit tests in a natural, readable style. It is compatible with .NET Standard 2.0+, .NET Framework 4.7+, and .NET 6+. +About • +Download • +How To Use • +Building • +Contributing • +Versioning • -Versions 8 and beyond are free for open-source projects and non-commercial use, but commercial use requires [a paid license](https://xceed.com/products/unit-testing/fluent-assertions/). -Check out the [license page](LICENSE) for more information. Version 7 -will remain fully open-source indefinitely and receive bugfixes and other important corrections. + +# About -Visit https://www.fluentassertions.com for [background information](https://fluentassertions.com/about/), [usage documentation](https://fluentassertions.com/introduction), an [extensibility guide](https://fluentassertions.com/extensibility/), support information and more [tips & tricks](https://fluentassertions.com/tips/). +Fluent Assertions offers a comprehensive suite of extension methods that enable developers to naturally express the expected outcomes of TDD (Test-Driven Development) or BDD (Behavior-Driven Development) unit tests. By providing a more readable and intuitive approach to writing assertions, it streamlines the testing process and improves code clarity. It supports a wide range of .NET platforms, including .NET Framework 4.7, .NET Core 2.1, 3.0, and 6, as well as .NET Standard 2.0 and 2.1, ensuring compatibility across various modern development environments. -# Xceed Partnership FAQ +# Xceed Partnership Originally authored by Dennis Doomen with Jonas Nyrup as the productive side-kick. Xceed is now an official Partner to Fluent Assertions! [Learn what this partnership means for our users](https://xceed.com/fluent-assertions-faq/). After extensive discussions with the Fluent Assertions team, we are thrilled about the future of the product and look forward to its continued growth and development. -# How do I build this? +# Download + +This library is available as a NuGet package on https://nuget.org. To install it, use the following command-line: + +`dotnet add package FluentAssertions` + +# How do I use it + +Fluent Assertions contains a tremendous amount of assertion methods that will make your unit tests easier to read and give you as much information possible upon failure. Consider this example. + +```csharp +IEnumerable numbers = new[] { 1, 2, 3 }; + +numbers.Should().OnlyContain(n => n > 0); +numbers.Should().HaveCount(4, "because we thought we put four items in the collection"); +``` + +This should give you the following failure: + +```text +Expected numbers to contain 4 item(s) because we thought we put four items in the collection, but found 3. +``` + +Visit https://www.fluentassertions.com for [background information](https://fluentassertions.com/about/), [usage documentation](https://fluentassertions.com/introduction), an [extensibility guide](https://fluentassertions.com/extensibility/), support information and more [tips & tricks](https://fluentassertions.com/tips/). + +# Building Install Visual Studio 2022 17.14+ or JetBrains Rider 2024.3 as well as the Build Tools 2022 (including the Universal Windows Platform build tools). You will also need to have .NET Framework 4.7 SDK and .NET 9.0 SDK installed. Check the [global.json](global.json) for the current minimum required version. -# What are these Approval.Tests? +You can also build, run the unit tests and package the code using the following command-line: + +`build.ps1` + +Or, if you have, the [Nuke tool installed](https://nuke.build/docs/getting-started/installation/): + +`nuke` + +Also try using `--help` to see all the available options or `--plan` to see what the scripts does. + +## What are these Approval.Tests? This is a special set of tests that use the [Verify](https://github.com/VerifyTests/Verify) project to verify whether you've introduced any breaking changes in the public API of the library. If you've verified the changes and decided they are valid, you can accept them using `AcceptApiChanges.ps1` or `AcceptApiChanges.sh`. Alternatively, you can use the [Verify Support](https://plugins.jetbrains.com/plugin/17240-verify-support) plug-in to compare the changes and accept them right from inside Rider. See also the [Contribution Guidelines](CONTRIBUTING.md). +# Contributing +Your contributions are always welcome! Please have a look at the [contribution guidelines](CONTRIBUTING.md) first. + +# Versioning +This library uses [Semantic Versioning](https://semver.org/) to give meaning to the version numbers. For the versions available, see the [tags](/releases) on this repository. + +## Credits +This library wouldn't have been possible without the following tools, packages and companies: + +* [Nuke](https://nuke.build/) - Smart automation for DevOps teams and CI/CD pipelines by [Matthias Koch](https://github.com/matkoch) +* [xUnit](https://xunit.net/) - Community-focused unit testing tool for .NET by [Brad Wilson](https://github.com/bradwilson) +* [Coverlet](https://github.com/coverlet-coverage/coverlet) - Cross platform code coverage for .NET by [Toni Solarin-Sodara](https://github.com/tonerdo) +* [GitVersion](https://gitversion.net/) - From git log to SemVer in no time +* [ReportGenerator](https://reportgenerator.io/) - Converts coverage reports by [Daniel Palme](https://github.com/danielpalme) +* [StyleCopyAnalyzer](https://github.com/DotNetAnalyzers/StyleCopAnalyzers) - StyleCop rules for .NET +* [Roslynator](https://github.com/dotnet/roslynator) - A set of code analysis tools for C# by [Josef Pihrt](https://github.com/josefpihrt) +* [CSharpCodingGuidelines](https://github.com/bkoelman/CSharpGuidelinesAnalyzer) - Roslyn analyzers by [Bart Koelman](https://github.com/bkoelman) to go with the [C# Coding Guidelines](https://csharpcodingguidelines.com/) +* [Meziantou](https://github.com/meziantou/Meziantou.Framework) - Another set of awesome Roslyn analyzers by [Gérald Barré](https://github.com/meziantou) +* [Verify](https://github.com/VerifyTests/Verify) - Snapshot testing by [Simon Cropp](https://github.com/SimonCropp) + # Powered By + +## License +Versions 8 and beyond are free for open-source projects and non-commercial use, but commercial use requires [a paid license](https://xceed.com/products/unit-testing/fluent-assertions/). +Check out the [license page](LICENSE) for more information. + +Version 7 will remain fully open-source indefinitely and receive bugfixes and other important corrections. From 3a6f8070615e317bff838fbbedd956e50b1b3b62 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 28 Sep 2025 12:56:25 +0200 Subject: [PATCH 704/845] JSON assertions did not properly handle floats, doubles and unsigned int/long --- .../Equivalency/Steps/JsonConversionStep.cs | 8 +- .../Specialized/JsonNodeAssertions.cs | 47 ++++++--- .../Specialized/JsonValueExtensions.cs | 16 +++ .../FluentAssertions/net6.0.verified.txt | 3 +- .../JsonNodeSpecs.cs | 20 +++- .../Specialized/JsonNodeSpecs.cs | 99 +++++++++++++++++-- docs/_pages/releases.md | 3 +- 7 files changed, 170 insertions(+), 26 deletions(-) create mode 100644 Src/FluentAssertions/Specialized/JsonValueExtensions.cs diff --git a/Src/FluentAssertions/Equivalency/Steps/JsonConversionStep.cs b/Src/FluentAssertions/Equivalency/Steps/JsonConversionStep.cs index 33b113e0a5..8ae2289f0f 100644 --- a/Src/FluentAssertions/Equivalency/Steps/JsonConversionStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/JsonConversionStep.cs @@ -14,9 +14,13 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon { if (comparands.Subject is JsonValue json) { - if (json.TryGetValue(out int intValue)) + if (json.TryGetValue(out long longValue)) { - comparands.Subject = intValue; + comparands.Subject = longValue; + } + else if (json.TryGetValue(out ulong ulongValue)) + { + comparands.Subject = ulongValue; } else if (json.TryGetValue(out double doubleValue)) { diff --git a/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs b/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs index d38d18fcaf..43bb4abab5 100644 --- a/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs +++ b/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs @@ -122,7 +122,7 @@ public AndConstraint> NotBeAnArray( } /// - /// Asserts that the current represents a 32-bit signed integer. + /// Asserts that the current represents a numeric value. /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -131,20 +131,43 @@ public AndConstraint> NotBeAnArray( /// /// Zero or more objects to format using the placeholders in . /// - public AndWhichConstraint, long> BeNumeric( + public AndWhichConstraint, string> BeNumeric( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain - .ForCondition(Subject is JsonValue value && value.TryGetValue(out _)) + .ForCondition(Subject is JsonValue value && value.IsNumeric()) .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:JSON node} to be an Int32{reason}, but {0} is not.", Subject); + .FailWith("Expected {context:JSON node} to be a numeric value{reason}, but {0} is not.", Subject); - var actualValue = Subject is JsonValue jsonValue && jsonValue.TryGetValue(out var result) ? result : 0; - return new AndWhichConstraint, long>(this, actualValue); + return new AndWhichConstraint, string>(this, (Subject as JsonValue)?.ToString() ?? string.Empty); } /// - /// Asserts that the current does not represent a 32-bit signed integer. + /// Asserts that the current represents a numeric value and returns + /// the actual value provided it can be converted to . + /// + /// + /// 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 AndWhichConstraint, TValue> BeNumeric( + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + TValue actualValue = default; + + CurrentAssertionChain + .ForCondition(Subject is JsonValue value && value.IsNumeric() && value.TryGetValue(out actualValue)) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:JSON node} to be a numeric value{reason}, but {0} is not.", Subject); + + return new AndWhichConstraint, TValue>(this, actualValue); + } + + /// + /// Asserts that the current does not represent a numeric value. /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -157,9 +180,9 @@ public AndConstraint> NotBeNumeric( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain - .ForCondition(!(Subject is JsonValue value && value.TryGetValue(out _))) + .ForCondition(Subject is not JsonValue value || !value.IsNumeric()) .BecauseOf(because, becauseArgs) - .FailWith("Did not expect {context:JSON node} to be an Int32{reason}, but {0} is.", Subject); + .FailWith("Did not expect {context:JSON node} to be a numeric value{reason}, but {0} is.", Subject); return new AndConstraint>(this); } @@ -200,7 +223,8 @@ public AndConstraint> NotBeLocalDate( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain - .ForCondition(Subject is not JsonValue value || !value.TryGetValue(out _) || Subject.ToString().EndsWith('Z')) + .ForCondition(Subject is not JsonValue value || !value.TryGetValue(out _) || + Subject.ToString().EndsWith('Z')) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:JSON node} to be a local date{reason}, but {0} is.", Subject); @@ -243,7 +267,8 @@ public AndConstraint> NotBeUtcDate( [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { CurrentAssertionChain - .ForCondition(Subject is not JsonValue value || !value.TryGetValue(out _) || !Subject.ToString().EndsWith('Z')) + .ForCondition(Subject is not JsonValue value || !value.TryGetValue(out _) || + !Subject.ToString().EndsWith('Z')) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context} to be a UTC date{reason}, but {0} is.", Subject); diff --git a/Src/FluentAssertions/Specialized/JsonValueExtensions.cs b/Src/FluentAssertions/Specialized/JsonValueExtensions.cs new file mode 100644 index 0000000000..551c55fba7 --- /dev/null +++ b/Src/FluentAssertions/Specialized/JsonValueExtensions.cs @@ -0,0 +1,16 @@ +#if NET6_0_OR_GREATER + +using System.Text.Json; +using System.Text.Json.Nodes; + +namespace FluentAssertions.Specialized; + +internal static class JsonValueExtensions +{ + public static bool IsNumeric(this JsonValue value) + { + return value.GetValue().ValueKind == JsonValueKind.Number; + } +} + +#endif diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index d7d57171f3..ecbbf3f829 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -2355,7 +2355,8 @@ namespace FluentAssertions.Specialized public FluentAssertions.AndConstraint> BeEquivalentTo(TExpectation expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeEquivalentTo(TExpectation expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint, System.DateTime> BeLocalDate(string because = "", params object[] becauseArgs) { } - public FluentAssertions.AndWhichConstraint, long> BeNumeric(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint, string> BeNumeric(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndWhichConstraint, TValue> BeNumeric(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint, string> BeString(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint, System.DateTime> BeUtcDate(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndWhichConstraint, System.Text.Json.Nodes.JsonNode> HaveProperty(string code, string because = "", params object[] becauseArgs) { } diff --git a/Tests/FluentAssertions.Equivalency.Specs/JsonNodeSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/JsonNodeSpecs.cs index ef66283b1e..f7dd1d3b27 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/JsonNodeSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/JsonNodeSpecs.cs @@ -17,20 +17,30 @@ public void Supports_numeric_properties() var node = JsonNode.Parse( """ { - "number" : 1, - "floatingpoint": 1.0 + "signedInt" : -2147483647, + "unsignedInt": 4294967295, + "signedLong" : -9223372036854775808, + "unsignedLong" : 18446744073709551615, + "floatingPoint": 1.0, + "largeDouble": 1.0E+20, + "money": 2.0 } """); // Act var act = () => node.Should().BeEquivalentTo(new { - number = 2, - floatingpoint = 2.0 + signedInt = int.MinValue, + unsignedInt = uint.MaxValue, + signedLong = long.MinValue, + unsignedLong = ulong.MaxValue, + floatingPoint = 1.0F, + largeDouble = 1E+20F, + money = 2.0M }); // Assert - act.Should().Throw().WithMessage("*$.number*2*1*$.floatingpoint*2.0*1.0*"); + act.Should().Throw().WithMessage("*$.signedInt to be -2147483648, but found -2147483647*"); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Specialized/JsonNodeSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/JsonNodeSpecs.cs index fc6502a255..6fe61c4e08 100644 --- a/Tests/FluentAssertions.Specs/Specialized/JsonNodeSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/JsonNodeSpecs.cs @@ -1,6 +1,7 @@ #if NET6_0_OR_GREATER using System.Collections.Generic; +using System.Globalization; using System.Text.Json.Nodes; using FluentAssertions.Extensions; using Xunit; @@ -171,13 +172,73 @@ public void A_null_node_cannot_not_be_an_array() public class BeNumeric { [Fact] - public void Returns_the_integer_for_chaining_purposes() + public void The_minimal_double_value_is_numeric() + { + // Arrange + var jsonNode = JsonNode.Parse(double.MinValue.ToString(CultureInfo.InvariantCulture)); + + // Act & Assert + jsonNode.Should().BeNumeric(); + } + + [Fact] + public void The_maximum_double_value_is_numeric() + { + // Arrange + var jsonNode = JsonNode.Parse(double.MaxValue.ToString(CultureInfo.InvariantCulture)); + + // Act & Assert + jsonNode.Should().BeNumeric(); + } + + [Fact] + public void The_minimal_long_value_is_numeric() + { + // Arrange + var jsonNode = JsonNode.Parse(long.MinValue.ToString(CultureInfo.InvariantCulture)); + + // Act & Assert + jsonNode.Should().BeNumeric(); + } + + [Fact] + public void The_maximum_long_value_is_numeric() + { + // Arrange + var jsonNode = JsonNode.Parse(long.MaxValue.ToString(CultureInfo.InvariantCulture)); + + // Act & Assert + jsonNode.Should().BeNumeric(); + } + + [Fact] + public void The_maximum_unsigned_long_value_is_numeric() + { + // Arrange + var jsonNode = JsonNode.Parse(ulong.MaxValue.ToString(CultureInfo.InvariantCulture)); + + // Act & Assert + jsonNode.Should().BeNumeric(); + } + + [Fact] + public void Can_return_the_actual_value() { // Arrange var jsonNode = JsonNode.Parse("42"); // Act & Assert - jsonNode.Should().BeNumeric().Which.Should().Be(42); + jsonNode.Should().BeNumeric().Which.Should().Be("42"); + } + + [Fact] + public void Can_return_the_actual_numeric_value_as_a_specific_type() + { + // Arrange + var jsonNode = JsonNode.Parse("42"); + + // Act & Assert + jsonNode.Should().BeNumeric().Which.Should().Be(42); } [Fact] @@ -191,11 +252,11 @@ public void Includes_the_reason_for_something_other_than_a_number() // Assert act.Should().Throw() - .WithMessage("Expected jsonNode to be an Int32 because we expect an int, but \"not a number\" is not."); + .WithMessage("Expected jsonNode to be a numeric value because we expect an int, but \"not a number\" is not."); } [Fact] - public void Can_ensure_a_node_is_not_a_number() + public void Can_ensure_a_string_is_not_a_number() { // Arrange var jsonNode = JsonNode.Parse("\"not a number\""); @@ -204,6 +265,32 @@ public void Can_ensure_a_node_is_not_a_number() jsonNode.Should().NotBeNumeric(); } + [Fact] + public void Can_ensure_a_ulong_is_a_number() + { + // Arrange + var jsonNode = JsonNode.Parse(ulong.MaxValue.ToString(CultureInfo.InvariantCulture)); + + // Act + var act = () => jsonNode.Should().NotBeNumeric(); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Can_ensure_a_double_is_a_number() + { + // Arrange + var jsonNode = JsonNode.Parse(double.MaxValue.ToString(CultureInfo.InvariantCulture)); + + // Act + var act = () => jsonNode.Should().NotBeNumeric(); + + // Assert + act.Should().Throw(); + } + [Fact] public void Includes_a_reason_for_an_unexpected_number() { @@ -215,7 +302,7 @@ public void Includes_a_reason_for_an_unexpected_number() // Assert act.Should().Throw() - .WithMessage("Did not expect jsonNode to be an Int32 because we expect something else, but 42 is."); + .WithMessage("Did not expect jsonNode to be a numeric value because we expect something else, but 42 is."); } [Fact] @@ -228,7 +315,7 @@ public void Fails_while_asserting_a_null_json_is_a_number() var act = () => jsonNode.Should().BeNumeric(); // Assert - act.Should().Throw().WithMessage("Expected jsonNode to be an Int32*"); + act.Should().Throw().WithMessage("Expected jsonNode to be a numeric value*"); } [Fact] diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index b8fa84612b..c6b0f0fba3 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -11,7 +11,8 @@ sidebar: ### Fixes -* Fixed ambiguity when using `Should()` on a `JsonNode` derived class. - [#3102](https://github.com/fluentassertions/fluentassertions/pull/3102) +* Fixed ambiguity when using `Should()` on a `JsonNode` derived class - [#3102](https://github.com/fluentassertions/fluentassertions/pull/3102) +* JSON assertions did not properly handle floats, doubles and unsigned int/long - [#3105](https://github.com/fluentassertions/fluentassertions/pull/3105) ## 8.7.0 From aaa69248d932dd5c4d00b086517e4b51f0fc938f Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Thu, 2 Oct 2025 11:30:11 +0200 Subject: [PATCH 705/845] Ensure tags on hotfix branches have priority --- GitVersion.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/GitVersion.yml b/GitVersion.yml index 25189405f0..0270a49790 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -8,3 +8,6 @@ branches: pull-request: regex: ((pull|pull\-requests|pr)[/-]|[/-](merge)) label: pr + hotfix: + prevent-increment: + when-current-commit-tagged: true \ No newline at end of file From ef38a1120229f7de9142685864f2fa7bbc9f3320 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 21 Sep 2025 20:37:17 +0200 Subject: [PATCH 706/845] Improve reporting of the differences between long strings --- .editorconfig | 7 + .packageguard/cache.bin | Bin 145643 -> 138687 bytes .../Common/StringExtensions.cs | 21 + .../CollectionMemberOptionsDecorator.cs | 3 + .../Equivalency/IEquivalencyOptions.cs | 6 + .../SelfReferenceEquivalencyOptions.cs | 20 +- .../Steps/StringEqualityEquivalencyStep.cs | 71 ++-- .../Primitives/StringAssertions.cs | 22 +- .../Primitives/StringEqualityStrategy.cs | 87 +++-- .../StringWildcardMatchingStrategy.cs | 11 +- .../FluentAssertions/net47.verified.txt | 3 + .../FluentAssertions/net6.0.verified.txt | 3 + .../netstandard2.0.verified.txt | 3 + .../netstandard2.1.verified.txt | 3 + .../BasicSpecs.cs | 364 +++++++++++++++--- .../Primitives/StringAssertionSpecs.Be.cs | 146 ++++--- .../StringAssertionSpecs.BeEquivalentTo.cs | 25 ++ docs/_pages/objectgraphs.md | 15 + docs/_pages/releases.md | 10 + 19 files changed, 640 insertions(+), 180 deletions(-) diff --git a/.editorconfig b/.editorconfig index 09ea95a062..e95e12d08e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -147,6 +147,9 @@ resharper_not_accessed_positional_property_global_highlighting = error # Do not remove redundant else blocks resharper_redundant_if_else_block_highlighting = none +# Do not remove parentheses we added ourselves +resharper_arrange_redundant_parentheses_highlighting = none + #################################################################### ## Roslyn Analyzers and Code Fixes #################################################################### @@ -300,6 +303,10 @@ dotnet_diagnostic.SA1116.severity = none # Rationale: We don't want to force this dotnet_diagnostic.SA1117.severity = none +# Purpose: The parameter spans multiple line +# Rationale: Does not understand raw strings +dotnet_diagnostic.SA1118.severity = none + # Purpose: Use string.Empty for empty string # Rationale: There is no performance difference in modern .NET versions, so no need to enforce this. dotnet_diagnostic.SA1122.severity = none diff --git a/.packageguard/cache.bin b/.packageguard/cache.bin index 94b0ea828e9cde356925d1e6079dd190018220aa..68eba45c8e0352767e4e255812243b24c3c5b02e 100644 GIT binary patch delta 1980 zcmZ`(YfzMB6!v-d!m_S=5j17dMG!$?zP+&Oq97CHjX`uqjfM%Oj1mJD(5b-+ZPc-` zaB$zLlj9|!gmt8Z*{M%+O6-p_T?`#%#vhi|RO9F{Sk@RI+q>WHax;E?-#OoJue*3bhpH~582R1eT~ziyEIea)L7>TGD23{9T^t{h6l{Wt z208Rp{WSDkU)IaB%1zYcgO%rOF;mZB6a@aLTNT6IvCBgo+;7X}HT84psCi?0j%run7bb*FLyW?Qs_XoD{pN^FWZuze={=4rw@BAm1 zpY65svbJQtv;FiW5NdoC3j@s^c{bkt-8++j1Wz8nc9l;O4xH^RjD=2V;g){`@3`&f zjUPAg(xW9jkH5)nH_uc5Ea(DverZmS59#qNq9eR4A2gv7{Ow^Q?+p66`MQShIsO{; z$6*^aO~*3Y4OE3d^FihZkodu20}c9+M%{62I_;SW9bIE69-nDY3OY~SNbtQ zN%s$mMp9egg1rAD98hzwMJNB}M>b?%2QK8x>3twZk5-92=+7BxPY`qEoWF5aO~>!R z^jRaz2G4y#$8UUVBh@sv<$rcbwH8)MYwuy6{7EuXgD&ddiMRc@`Q*-ds;FjZ7c7lB#L%<^W`bK51O*U*aw{tgn^urM7Kz4x zgTbJ7%9JVDlG7p1*q_LXMgWEcq`*mz1gsXH7AGqltI1q?-HK8{npq2XZ1JX=%AIz% zpx7+2Lh6abb96ot*4YE1fJPK}vi@anO|+Ur%63uyLgqFoZhOd<9OV2EzpC7l(!P)v zsi?1fso|k$D<*Vqhvdwb9Q^Yf7hSP2EtUJBR)<{lvyEM*T{ad!Z5)_aZ*+&C<`L8b zvC8Iw4H_{+$t_Fs*k({y3d?|pA6nuj^L%Cv@2d~3)H9zg7m`{)X7Tuu{!i$Ym=IT) zIBrWHzNBsqEQ!&%Z43=I+JHk^v_x9Gh|>LH!KOiIbYgU2m&j}-?;tX%D1*(SD+ADL zlnAeTMZv~}%}@yixGG{_7)1VrP$r$rV)3R4Rk?SgLZqedhYS}L|U94Ghj`Z10$J8uY z725s0Gl-`fYPLu$bv&d*!yKcK6B_mub-Kl4GnPiuvP@df$0+|>>(r2c}a&Yr)j|VD^u%C~DMphITB9*lBH{@(&cS10i*akjM7iZ}aUd+3Y|2 z-FtrL+;h)8=XcKg@0h;2VS+u!q1?DE z4{hDWJCE()Yd+k__x3-8=RX5WcwtwEZU$LtJ(P#P>ON!wLrm|DqYe1tzhEw(8;Tlu z{Tvyn*zpG&9ley#>s+atKb+ODzpDrb)_7VPC$PCcJuj$Co_m(MQXt*7}6qVUUSU727M z-t&?pt-NaAtNgu#>-p)=p5c?06Jhzn!D2i$3P-d+^H0nf{L%53^x8f6kKV1oWfo?{ z#t~@3Asv{JkHBO6^kg$1K6z1<@rlT>X&PP?%*TS2*mxc6IHCg+u3+$BOby4ZtX80Y z6W@{za7=jgN8a<1vHW@@60wpi545fe^lg)T-To~*1_Hf(w`t!%`(Ej8K2lbD;3haM zcT3YAA@02V4HV}lXh~ikIwX^xu~b<0ZSwbQ3-r3k-fUKeZ$U}274iIDEWHi+v!5@O zfmeCK2p{PUUy$#2;F(KM#&?c8baj#!M|OcMf>Z@{;gRt^P&a=z0v+mF0*dbvb??VL zR1=?$JMfKBuuKW@6hMuT@{yowB^qkI%OeSE5~yK@I{d8;9@TXI?0|BmKZjBnzdHuy z*t{Fee09x2d~FOI;8xxrgN?vnYcOMtA1bkB0!%uuB%?2n-H(j`8!<8gPUTl-7+>Sm z;<`Mzd3)b2x?YBOnmVao@^D{`lmFFNT=ryphrd5C;8HQJt^Pg{?$s+-G(Fhbq~#i3 z_k%Mx38@@>94vZZXlsMjT5T%sc4)TYxjpc6Y{`U0cx^lUG`>_WJq?2Z`nXPF*(*B- zpwb*iW8rSV_)=N$JiHAl2MRK1Tt_c>e6O&a>57Bblzj&9Bg3)%Hvs%dZ%$D%7j!E2J<-jUEYsyV#H~88Y3)}R> zkww_#!f3XrsU#lgsefMVJq6{L@9aCpXEps2UM)##4PA{@xz^*ubhN z`W_y7vleSISdonu$=6YJ{*%F$D)=`*#;nLQ|+k=||?ZN&)uYYsE^hJykaE*~AbHZF~F*1`~RP$`qB-mMZ zCuNzS4GVpwhD+l@uRtYJg)lyghEXLD<;j1*n|chHSb;&VlVp#`r^Pn)GxaRoo5>!C zq6E$2mnLSwf-GiE53k0XS*&DAC+L~dS(D97X>=yD*~%&S&b3jvQ)=qo+}Ry)xuvvj zRbyK&Ytq$I#i@~^k5upDks{&rNX?=VjTF?YRBM?HsMx-Q<$%L>wg6<_(vpWa?QF3{ zPRTtg50Th%*kVJ%2A@0B(DYTY95;x!(*emYi8Te7O+wc&d*g)L(sE~qJFQ`9_$UI(TNnYYE1`yMQlYHe-0G0J7T!A#cXLB zTzLtTVz`bHc5fOS4Q30eol;|N&We#n@&Km}XJY=^l`=C4dRFHx9nD*K<{A;9C)S;- z>3et-J{ObFee_NF(?x#;H(?95-GB&vC-!F>coc#&fRu7W%hzB?Q2bETS3Pa~P6z9C zcTo+ir@Z<`hwU|JJm#2w87Z%_l(UkCvd-j5V@+d-|J5k(Q`-#c+2f!P zEmr{k#lRL(7n6CYTo#n;#E=!5#ZmEvIVs5F#>!MI%u9!`ts%1F|D6iT(1u5pl8H=3J9H@@+ zf;YwsG>~ C_}m`= diff --git a/Src/FluentAssertions/Common/StringExtensions.cs b/Src/FluentAssertions/Common/StringExtensions.cs index 859f375f19..d24ab5eab2 100644 --- a/Src/FluentAssertions/Common/StringExtensions.cs +++ b/Src/FluentAssertions/Common/StringExtensions.cs @@ -157,4 +157,25 @@ public static bool IsNullOrEmpty([NotNullWhen(false)] this string value) { return string.IsNullOrEmpty(value); } + + /// + /// Converts the provided into an indented block of text, + /// with each line prefixed by four spaces and wrapped in quotation marks. + /// Lines longer than 80 characters are wrapped across multiple lines. + /// + /// The string to format as an indented block of text. + /// A string where all lines of the are indented and combined into a formatted block. + public static string RenderAsIndentedBlock(this string message) + { + string[] lines = message.Split(["\r\n", "\n", "\r"], StringSplitOptions.None); + + var wrappedLines = new List(); + + foreach (string line in lines) + { + wrappedLines.Add(line); + } + + return " \"" + string.Join(Environment.NewLine + " ", wrappedLines) + "\""; + } } diff --git a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs index ae70175cd1..445537aa1e 100644 --- a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs +++ b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs @@ -85,6 +85,9 @@ public EqualityStrategy GetEqualityStrategy(Type type) public bool IgnoreNewlineStyle => inner.IgnoreNewlineStyle; + /// + public bool IncludeFullStringsInDifference => inner.IncludeFullStringsInDifference; + /// public bool IgnoreJsonPropertyCasing => inner.IgnoreJsonPropertyCasing; diff --git a/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs index 7e49d1b035..61a77d6efe 100644 --- a/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs @@ -122,6 +122,12 @@ public interface IEquivalencyOptions /// bool IgnoreNewlineStyle { get; } + /// + /// Gets a value indicating whether the differences between string properties should + /// include the full values of the subject and expectation instead of just the fragment that differs. + /// + bool IncludeFullStringsInDifference { get; } + /// /// When set to true, the comparison will ignore the casing of JSON property names when comparing objects to JSON trees. /// diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index bc765110d4..14fea3f009 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -96,6 +96,7 @@ protected SelfReferenceEquivalencyOptions(IEquivalencyOptions defaults) IgnoreTrailingWhitespace = defaults.IgnoreTrailingWhitespace; IgnoreCase = defaults.IgnoreCase; IgnoreNewlineStyle = defaults.IgnoreNewlineStyle; + IncludeFullStringsInDifference = defaults.IncludeFullStringsInDifference; IgnoreJsonPropertyCasing = defaults.IgnoreJsonPropertyCasing; ConversionSelector = defaults.ConversionSelector.Clone(); @@ -206,6 +207,8 @@ EqualityStrategy IEquivalencyOptions.GetEqualityStrategy(Type type) public bool IgnoreNewlineStyle { get; private set; } + public bool IncludeFullStringsInDifference { get; private set; } + public bool IgnoreJsonPropertyCasing { get; set; } public ITraceWriter TraceWriter { get; private set; } @@ -288,7 +291,7 @@ public TSelf ExcludingFields() public TSelf IncludingProperties() { includedProperties = MemberVisibility.Public | MemberVisibility.ExplicitlyImplemented | - MemberVisibility.DefaultInterfaceProperties; + MemberVisibility.DefaultInterfaceProperties; return (TSelf)this; } @@ -313,7 +316,7 @@ public TSelf WithoutStrictTyping() public TSelf IncludingInternalProperties() { includedProperties = MemberVisibility.Public | MemberVisibility.Internal | MemberVisibility.ExplicitlyImplemented | - MemberVisibility.DefaultInterfaceProperties; + MemberVisibility.DefaultInterfaceProperties; return (TSelf)this; } @@ -826,6 +829,15 @@ public TSelf IgnoringNewlineStyle() return (TSelf)this; } + /// + /// Tells the comparison to include the full string values of the subject and expectation instead of just the fragment that differs. + /// + public TSelf IncludingFullStringsInDifference() + { + IncludeFullStringsInDifference = true; + return (TSelf)this; + } + #if NET6_0_OR_GREATER /// /// Tells the comparison to ignore the casing when trying to match a property to a JSON property. @@ -838,7 +850,9 @@ public TSelf IgnoringJsonPropertyCasing() #endif /// - /// Returns the comparer for strings, which is either an explicitly specified comparer via or an ordinal comparer depending on . + /// Returns the comparer for strings, which is either an explicitly specified comparer via + /// or an ordinal + /// comparer depending on . /// internal IEqualityComparer GetStringComparerOrDefault() { diff --git a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs index dc385bc0c3..80c8b32452 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs @@ -30,44 +30,48 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon string expectation = (string)comparands.Expectation; assertionChain.ReuseOnce(); - subject.Should() - .Be(expectation, CreateOptions(context.Options), context.Reason.FormattedMessage, context.Reason.Arguments); + subject.Should().Be(expectation, CreateOptions(context.Options), context.Reason.FormattedMessage, + context.Reason.Arguments); } return EquivalencyResult.EquivalencyProven; } - private static Func, EquivalencyOptions> - CreateOptions(IEquivalencyOptions existingOptions) => - o => + private static Func, EquivalencyOptions> CreateOptions( + IEquivalencyOptions existingOptions) => o => + { + if (existingOptions is EquivalencyOptions equivalencyOptions) + { + return equivalencyOptions; + } + + if (existingOptions.IgnoreLeadingWhitespace) + { + o.IgnoringLeadingWhitespace(); + } + + if (existingOptions.IgnoreTrailingWhitespace) + { + o.IgnoringTrailingWhitespace(); + } + + if (existingOptions.IgnoreCase) { - if (existingOptions is EquivalencyOptions equivalencyOptions) - { - return equivalencyOptions; - } - - if (existingOptions.IgnoreLeadingWhitespace) - { - o.IgnoringLeadingWhitespace(); - } - - if (existingOptions.IgnoreTrailingWhitespace) - { - o.IgnoringTrailingWhitespace(); - } - - if (existingOptions.IgnoreCase) - { - o.IgnoringCase(); - } - - if (existingOptions.IgnoreNewlineStyle) - { - o.IgnoringNewlineStyle(); - } - - return o; - }; + o.IgnoringCase(); + } + + if (existingOptions.IgnoreNewlineStyle) + { + o.IgnoringNewlineStyle(); + } + + if (existingOptions.IncludeFullStringsInDifference) + { + o.IncludingFullStringsInDifference(); + } + + return o; + }; private static bool ValidateAgainstNulls(AssertionChain assertionChain, Comparands comparands, INode currentNode) { @@ -79,7 +83,8 @@ private static bool ValidateAgainstNulls(AssertionChain assertionChain, Comparan if (onlyOneNull) { assertionChain.FailWith( - "Expected {0} to be {1}{reason}, but found {2}.", currentNode.Subject.Description.AsNonFormattable(), expected, subject); + "Expected {0} to be {1}{reason}, but found {2}.", currentNode.Subject.Description.AsNonFormattable(), expected, + subject); return false; } diff --git a/Src/FluentAssertions/Primitives/StringAssertions.cs b/Src/FluentAssertions/Primitives/StringAssertions.cs index 6c4a8a9833..06e0cb2ffc 100644 --- a/Src/FluentAssertions/Primitives/StringAssertions.cs +++ b/Src/FluentAssertions/Primitives/StringAssertions.cs @@ -2004,23 +2004,31 @@ private static bool HasMixedOrNoCase(string value) return !hasUpperCase && !hasLowerCase; } - internal AndConstraint Be(string expected, - Func, EquivalencyOptions> config, + /// + /// Validates that a string is equivalent to the specified string, + /// using the given to determine equivalency options. + /// + /// + /// Is used by . + /// + internal void Be(string expected, Func, EquivalencyOptions> config, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { Guard.ThrowIfArgumentIsNull(config); EquivalencyOptions options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()); - var expectation = new StringValidator(assertionChain, - new StringEqualityStrategy(options.GetStringComparerOrDefault(), "be"), - because, becauseArgs); + StringEqualityStrategy strategy = new(options.GetStringComparerOrDefault(), "be") + { + IncludeFullDetails = options.IncludeFullStringsInDifference + }; - var subject = ApplyStringSettings(Subject, options); + var expectation = new StringValidator(assertionChain, strategy, because, becauseArgs); + + string subject = ApplyStringSettings(Subject, options); expected = ApplyStringSettings(expected, options); expectation.Validate(subject, expected); - return new AndConstraint((TAssertions)this); } private static bool Contains(string actual, string expected, StringComparison comparison) diff --git a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs index 2bb4ff376f..53ccb28ef0 100644 --- a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Text; using FluentAssertions.Common; @@ -18,6 +19,12 @@ public StringEqualityStrategy(IEqualityComparer comparer, string predica this.predicateDescription = predicateDescription; } + /// + /// Gets a value indicating whether the differences between string properties should + /// include the full values of the subject and expectation instead of just the fragment that differs. + /// + public bool IncludeFullDetails { get; set; } = true; + public void AssertForEquality(AssertionChain assertionChain, string subject, string expected) { ValidateAgainstSuperfluousWhitespace(assertionChain, subject, expected); @@ -40,11 +47,13 @@ public void AssertForEquality(AssertionChain assertionChain, string subject, str { var indexOfLastNewlineBeforeMismatch = matchingString.LastIndexOf('\n'); var column = matchingString.Length - indexOfLastNewlineBeforeMismatch; - locationDescription = $"on line {lineNumber + 1} and column {column} (index {indexOfMismatch})"; + locationDescription = $"at column {column} of line {lineNumber + 1} (index {indexOfMismatch})"; } + string explanationOfMismatch = GetMismatchSegmentForLongStrings(subject, expected, indexOfMismatch); + assertionChain.FailWith( - $"{ExpectationDescription}the same string{{reason}}, but they differ {locationDescription}:{Environment.NewLine}{GetMismatchSegmentForLongStrings(subject, expected, indexOfMismatch)}."); + $"{ExpectationDescription}a match with the expectation{{reason}}, but it differs {locationDescription}:{Environment.NewLine}{explanationOfMismatch}"); } else if (ValidateAgainstLengthDifferences(assertionChain, subject, expected)) { @@ -53,7 +62,8 @@ public void AssertForEquality(AssertionChain assertionChain, string subject, str if (indexOfMismatch != -1) { assertionChain.FailWith( - $"{ExpectationDescription}{{0}}{{reason}}, but {{1}} differs near " + subject.IndexedSegmentAt(indexOfMismatch) + + $"{ExpectationDescription}{{0}}{{reason}}, but {{1}} differs near " + + subject.IndexedSegmentAt(indexOfMismatch) + ".", expected, subject); } @@ -92,7 +102,9 @@ private bool ValidateAgainstLengthDifferences(AssertionChain assertion, string s { string mismatchSegment = GetMismatchSegmentForStringsOfDifferentLengths(subject, expected); - string message = $"{ExpectationDescription}{{0}} with a length of {{1}}{{reason}}, but {{2}} has a length of {{3}}, differs near " + mismatchSegment + "."; + string message = + $"{ExpectationDescription}{{0}} with a length of {{1}}{{reason}}, but {{2}} has a length of {{3}}, differs near " + + mismatchSegment + "."; return new FailReason(message, expected, expected.Length, subject, subject.Length); }); @@ -104,7 +116,7 @@ private string GetMismatchSegmentForStringsOfDifferentLengths(string subject, st { int indexOfMismatch = subject.IndexOfFirstMismatch(expected, comparer); - // If there is no difference it means that expected starts with subject and subject is shorter than expected + // If there is no difference, it means that expected starts with subject and subject is shorter than expected if (indexOfMismatch == -1) { // Subject is shorter so we point at its last character. @@ -121,7 +133,7 @@ private string GetMismatchSegmentForStringsOfDifferentLengths(string subject, st /// Get the mismatch segment between and for long strings, /// when they differ at index . /// - private static string GetMismatchSegmentForLongStrings(string subject, string expected, int firstIndexOfMismatch) + private string GetMismatchSegmentForLongStrings(string subject, string expected, int firstIndexOfMismatch) { int trimStart = GetStartIndexOfPhraseToShowBeforeTheMismatchingIndex(subject, firstIndexOfMismatch); const string prefix = " \""; @@ -129,7 +141,7 @@ private static string GetMismatchSegmentForLongStrings(string subject, string ex const char arrowDown = '\u2193'; const char arrowUp = '\u2191'; - int whiteSpaceCountBeforeArrow = (firstIndexOfMismatch - trimStart) + prefix.Length; + int whiteSpaceCountBeforeArrow = firstIndexOfMismatch - trimStart + prefix.Length; if (trimStart > 0) { @@ -142,21 +154,45 @@ private static string GetMismatchSegmentForLongStrings(string subject, string ex var sb = new StringBuilder(); sb.Append(' ', whiteSpaceCountBeforeArrow).Append(arrowDown).AppendLine(" (actual)"); - AppendPrefixAndEscapedPhraseToShowWithEllipsisAndSuffix(sb, prefix, subject, trimStart, suffix); - AppendPrefixAndEscapedPhraseToShowWithEllipsisAndSuffix(sb, prefix, expected, trimStart, suffix); + bool wasTruncated = AppendPrefixAndEscapedPhraseToShowWithEllipsisAndSuffix(sb, prefix, subject, trimStart, suffix); + if (AppendPrefixAndEscapedPhraseToShowWithEllipsisAndSuffix(sb, prefix, expected, trimStart, suffix)) + { + wasTruncated = true; + } + sb.Append(' ', whiteSpaceCountBeforeArrow).Append(arrowUp).Append(" (expected)"); + if (IncludeFullDetails && wasTruncated) + { + sb.AppendFormat(CultureInfo.InvariantCulture, + $""" + + + Full expectation: + + {expected.RenderAsIndentedBlock().AsNonFormattable()}, + + Full subject: + + {subject.RenderAsIndentedBlock().AsNonFormattable()} + + """); + } + return sb.ToString(); } /// - /// Appends the , the escaped visible phrase decorated with ellipsis and the to the . + /// Appends the , the escaped visible phrase decorated with ellipsis + /// and the to the . /// - /// When text phrase starts at and with a calculated length omits text on start or end, an ellipsis is added. - private static void AppendPrefixAndEscapedPhraseToShowWithEllipsisAndSuffix(StringBuilder stringBuilder, + /// When text phrase starts at and with a calculated length truncates text + /// on start or end, an ellipsis is added. + /// true if the text was truncated. + private static bool AppendPrefixAndEscapedPhraseToShowWithEllipsisAndSuffix(StringBuilder stringBuilder, string prefix, string text, int indexOfStartingPhrase, string suffix) { - var subjectLength = GetLengthOfPhraseToShowOrDefaultLength(text[indexOfStartingPhrase..]); + int subjectLength = GetLengthOfPhraseToKeep(text[indexOfStartingPhrase..]); const char ellipsis = '\u2026'; stringBuilder.Append(prefix); @@ -171,12 +207,16 @@ private static void AppendPrefixAndEscapedPhraseToShowWithEllipsisAndSuffix(Stri .Replace("\r", "\\r", StringComparison.OrdinalIgnoreCase) .Replace("\n", "\\n", StringComparison.OrdinalIgnoreCase)); - if (text.Length > (indexOfStartingPhrase + subjectLength)) + bool wasTruncated = false; + + if (text.Length > indexOfStartingPhrase + subjectLength) { stringBuilder.Append(ellipsis); + wasTruncated = true; } stringBuilder.AppendLine(suffix); + return wasTruncated; } /// @@ -191,18 +231,19 @@ private static int GetStartIndexOfPhraseToShowBeforeTheMismatchingIndex(string v const int minCharactersToKeep = 5; const int maxCharactersToKeep = 15; const int lengthOfWhitespace = 1; - const int phraseLengthToCheckForWordBoundary = (maxCharactersToKeep - minCharactersToKeep) + lengthOfWhitespace; + const int phraseLengthToCheckForWordBoundary = maxCharactersToKeep - minCharactersToKeep + lengthOfWhitespace; if (indexOfFirstMismatch <= defaultCharactersToKeep) { return 0; } - var indexToStartSearchingForWordBoundary = Math.Max(indexOfFirstMismatch - (maxCharactersToKeep + lengthOfWhitespace), 0); + var indexToStartSearchingForWordBoundary = + Math.Max(indexOfFirstMismatch - (maxCharactersToKeep + lengthOfWhitespace), 0); var indexOfWordBoundary = value - .IndexOf(' ', indexToStartSearchingForWordBoundary, phraseLengthToCheckForWordBoundary) - - indexToStartSearchingForWordBoundary; + .IndexOf(' ', indexToStartSearchingForWordBoundary, phraseLengthToCheckForWordBoundary) - + indexToStartSearchingForWordBoundary; if (indexOfWordBoundary >= 0) { @@ -216,13 +257,13 @@ private static int GetStartIndexOfPhraseToShowBeforeTheMismatchingIndex(string v /// Calculates how many characters to keep in . /// /// - /// If a word end is found between 15 and 25 characters, use this word end, otherwise keep 20 characters. + /// If a word end is found to be between certain edges, keep the word. Otherwise, keep the default length. /// - private static int GetLengthOfPhraseToShowOrDefaultLength(string value) + private static int GetLengthOfPhraseToKeep(string value) { - const int defaultLength = 20; - const int minLength = 15; - const int maxLength = 25; + const int defaultLength = 80; + const int minLength = defaultLength - 5; + const int maxLength = defaultLength + 5; const int lengthOfWhitespace = 1; var indexOfWordBoundary = value diff --git a/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs b/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs index ce93197ef5..af35e3de3c 100644 --- a/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs @@ -18,8 +18,8 @@ public void AssertForEquality(AssertionChain assertionChain, string subject, str if (IsLongOrMultiline(subject) || IsLongOrMultiline(expected)) { - expected = RenderAsIndentedBlock(expected); - subject = RenderAsIndentedBlock(subject); + expected = expected.RenderAsIndentedBlock(); + subject = subject.RenderAsIndentedBlock(); assertionChain .FailWith($$""" @@ -73,13 +73,6 @@ private static string ConvertWildcardToRegEx(string wildcardExpression) + "$"; } - private static string RenderAsIndentedBlock(string message) - { - string[] lines = message.Split(["\r\n", "\n", "\r"], StringSplitOptions.None); - - return " \"" + string.Join(Environment.NewLine + " ", lines) + "\""; - } - private static bool IsLongOrMultiline(string message) { return message.Length > 80 || message.Contains(Environment.NewLine, StringComparison.Ordinal); diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 0238240475..611217d064 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -759,6 +759,7 @@ namespace FluentAssertions.Equivalency bool IgnoreNewlineStyle { get; } bool IgnoreNonBrowsableOnSubject { get; } bool IgnoreTrailingWhitespace { get; } + bool IncludeFullStringsInDifference { get; } FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } FluentAssertions.Equivalency.MemberVisibility IncludedProperties { get; } bool IsRecursive { get; } @@ -903,6 +904,7 @@ namespace FluentAssertions.Equivalency public bool IgnoreLeadingWhitespace { get; } public bool IgnoreNewlineStyle { get; } public bool IgnoreTrailingWhitespace { get; } + public bool IncludeFullStringsInDifference { get; } [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } @@ -934,6 +936,7 @@ namespace FluentAssertions.Equivalency public TSelf IncludingAllDeclaredProperties() { } public TSelf IncludingAllRuntimeProperties() { } public TSelf IncludingFields() { } + public TSelf IncludingFullStringsInDifference() { } public TSelf IncludingInternalFields() { } public TSelf IncludingInternalProperties() { } public TSelf IncludingNestedObjects() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index ec320047a5..50957e477c 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -778,6 +778,7 @@ namespace FluentAssertions.Equivalency bool IgnoreNewlineStyle { get; } bool IgnoreNonBrowsableOnSubject { get; } bool IgnoreTrailingWhitespace { get; } + bool IncludeFullStringsInDifference { get; } FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } FluentAssertions.Equivalency.MemberVisibility IncludedProperties { get; } bool IsRecursive { get; } @@ -922,6 +923,7 @@ namespace FluentAssertions.Equivalency public bool IgnoreLeadingWhitespace { get; } public bool IgnoreNewlineStyle { get; } public bool IgnoreTrailingWhitespace { get; } + public bool IncludeFullStringsInDifference { get; } [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } @@ -954,6 +956,7 @@ namespace FluentAssertions.Equivalency public TSelf IncludingAllDeclaredProperties() { } public TSelf IncludingAllRuntimeProperties() { } public TSelf IncludingFields() { } + public TSelf IncludingFullStringsInDifference() { } public TSelf IncludingInternalFields() { } public TSelf IncludingInternalProperties() { } public TSelf IncludingNestedObjects() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index dc3161998c..a878db05ef 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -751,6 +751,7 @@ namespace FluentAssertions.Equivalency bool IgnoreNewlineStyle { get; } bool IgnoreNonBrowsableOnSubject { get; } bool IgnoreTrailingWhitespace { get; } + bool IncludeFullStringsInDifference { get; } FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } FluentAssertions.Equivalency.MemberVisibility IncludedProperties { get; } bool IsRecursive { get; } @@ -895,6 +896,7 @@ namespace FluentAssertions.Equivalency public bool IgnoreLeadingWhitespace { get; } public bool IgnoreNewlineStyle { get; } public bool IgnoreTrailingWhitespace { get; } + public bool IncludeFullStringsInDifference { get; } [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } @@ -926,6 +928,7 @@ namespace FluentAssertions.Equivalency public TSelf IncludingAllDeclaredProperties() { } public TSelf IncludingAllRuntimeProperties() { } public TSelf IncludingFields() { } + public TSelf IncludingFullStringsInDifference() { } public TSelf IncludingInternalFields() { } public TSelf IncludingInternalProperties() { } public TSelf IncludingNestedObjects() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 7b8e2d7187..1b34307d2e 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -759,6 +759,7 @@ namespace FluentAssertions.Equivalency bool IgnoreNewlineStyle { get; } bool IgnoreNonBrowsableOnSubject { get; } bool IgnoreTrailingWhitespace { get; } + bool IncludeFullStringsInDifference { get; } FluentAssertions.Equivalency.MemberVisibility IncludedFields { get; } FluentAssertions.Equivalency.MemberVisibility IncludedProperties { get; } bool IsRecursive { get; } @@ -903,6 +904,7 @@ namespace FluentAssertions.Equivalency public bool IgnoreLeadingWhitespace { get; } public bool IgnoreNewlineStyle { get; } public bool IgnoreTrailingWhitespace { get; } + public bool IncludeFullStringsInDifference { get; } [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } @@ -934,6 +936,7 @@ namespace FluentAssertions.Equivalency public TSelf IncludingAllDeclaredProperties() { } public TSelf IncludingAllRuntimeProperties() { } public TSelf IncludingFields() { } + public TSelf IncludingFullStringsInDifference() { } public TSelf IncludingInternalFields() { } public TSelf IncludingInternalProperties() { } public TSelf IncludingNestedObjects() { } diff --git a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs index d643cdcb77..e68426d0a0 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs @@ -14,8 +14,13 @@ public class BasicSpecs public void A_null_configuration_is_invalid() { // Arrange - var actual = new { }; - var expectation = new { }; + var actual = new + { + }; + + var expectation = new + { + }; // Act Action act = () => actual.Should().BeEquivalentTo(expectation, config: null); @@ -29,8 +34,13 @@ public void A_null_configuration_is_invalid() public void A_null_as_the_configuration_is_not_valid_for_inequivalency_assertions() { // Arrange - var actual = new { }; - var expectation = new { }; + var actual = new + { + }; + + var expectation = new + { + }; // Act Action act = () => actual.Should().NotBeEquivalentTo(expectation, config: null); @@ -44,7 +54,9 @@ public void A_null_as_the_configuration_is_not_valid_for_inequivalency_assertion public void When_expectation_is_null_it_should_throw() { // Arrange - var subject = new { }; + var subject = new + { + }; // Act Action act = () => subject.Should().BeEquivalentTo(null); @@ -58,9 +70,15 @@ public void When_expectation_is_null_it_should_throw() public void When_comparing_nested_collection_with_a_null_value_it_should_fail_with_the_correct_message() { // Arrange - MyClass[] subject = [new MyClass { Items = ["a"] }]; + MyClass[] subject = + [ + new() + { + Items = ["a"] + } + ]; - MyClass[] expectation = [new MyClass()]; + MyClass[] expectation = [new()]; // Act Action act = () => subject.Should().BeEquivalentTo(expectation); @@ -82,7 +100,9 @@ public void When_subject_is_null_it_should_throw() SomeDto subject = null; // Act - Action act = () => subject.Should().BeEquivalentTo(new { }); + Action act = () => subject.Should().BeEquivalentTo(new + { + }); // Assert act.Should().Throw().WithMessage( @@ -137,7 +157,9 @@ public void When_subject_and_expectation_are_compared_for_non_equivalence_it_sho SomeDto subject = null; // Act - Action act = () => subject.Should().NotBeEquivalentTo(new { }) + Action act = () => subject.Should().NotBeEquivalentTo(new + { + }) .And.BeNull(); // Assert @@ -151,7 +173,9 @@ public void When_subject_and_expectation_are_compared_for_non_equivalence_with_c SomeDto subject = null; // Act - Action act = () => subject.Should().NotBeEquivalentTo(new { }, opt => opt) + Action act = () => subject.Should().NotBeEquivalentTo(new + { + }, opt => opt) .And.BeNull(); // Assert @@ -165,9 +189,15 @@ public void When_asserting_equivalence_on_a_value_type_from_system_it_should_not // DateTime is used as an example because the current implementation // would hit the recursion-depth limit if structural equivalence were attempted. - var date1 = new { Property = 1.January(2011) }; + var date1 = new + { + Property = 1.January(2011) + }; - var date2 = new { Property = 1.January(2011) }; + var date2 = new + { + Property = 1.January(2011) + }; // Act Action act = () => date1.Should().BeEquivalentTo(date2); @@ -180,9 +210,17 @@ public void When_asserting_equivalence_on_a_value_type_from_system_it_should_not public void When_an_object_hides_object_equals_it_should_be_compared_using_its_members() { // Arrange - var actual = new VirtualClassOverride { Property = "Value", OtherProperty = "Actual" }; + var actual = new VirtualClassOverride + { + Property = "Value", + OtherProperty = "Actual" + }; - var expected = new VirtualClassOverride { Property = "Value", OtherProperty = "Expected" }; + var expected = new VirtualClassOverride + { + Property = "Value", + OtherProperty = "Expected" + }; // Act Action act = () => actual.Should().BeEquivalentTo(expected); @@ -211,8 +249,23 @@ public class VirtualClassOverride : VirtualClass public void When_treating_a_value_type_in_a_collection_as_a_complex_type_it_should_compare_them_by_members() { // Arrange - ClassWithValueSemanticsOnSingleProperty[] subject = [new() { Key = "SameKey", NestedProperty = "SomeValue" }]; - ClassWithValueSemanticsOnSingleProperty[] expected = [new() { Key = "SameKey", NestedProperty = "OtherValue" }]; + ClassWithValueSemanticsOnSingleProperty[] subject = + [ + new() + { + Key = "SameKey", + NestedProperty = "SomeValue" + } + ]; + + ClassWithValueSemanticsOnSingleProperty[] expected = + [ + new() + { + Key = "SameKey", + NestedProperty = "OtherValue" + } + ]; // Act Action act = () => subject.Should().BeEquivalentTo(expected, @@ -226,9 +279,17 @@ public void When_treating_a_value_type_in_a_collection_as_a_complex_type_it_shou public void When_treating_a_value_type_as_a_complex_type_it_should_compare_them_by_members() { // Arrange - var subject = new ClassWithValueSemanticsOnSingleProperty { Key = "SameKey", NestedProperty = "SomeValue" }; + var subject = new ClassWithValueSemanticsOnSingleProperty + { + Key = "SameKey", + NestedProperty = "SomeValue" + }; - var expected = new ClassWithValueSemanticsOnSingleProperty { Key = "SameKey", NestedProperty = "OtherValue" }; + var expected = new ClassWithValueSemanticsOnSingleProperty + { + Key = "SameKey", + NestedProperty = "OtherValue" + }; // Act Action act = () => subject.Should().BeEquivalentTo(expected, @@ -242,9 +303,15 @@ public void When_treating_a_value_type_as_a_complex_type_it_should_compare_them_ public void When_treating_a_type_as_value_type_but_it_was_already_marked_as_reference_type_it_should_throw() { // Arrange - var subject = new ClassWithValueSemanticsOnSingleProperty { Key = "Don't care" }; + var subject = new ClassWithValueSemanticsOnSingleProperty + { + Key = "Don't care" + }; - var expected = new ClassWithValueSemanticsOnSingleProperty { Key = "Don't care" }; + var expected = new ClassWithValueSemanticsOnSingleProperty + { + Key = "Don't care" + }; // Act Action act = () => subject.Should().BeEquivalentTo(expected, options => options @@ -260,9 +327,15 @@ public void When_treating_a_type_as_value_type_but_it_was_already_marked_as_refe public void When_treating_a_type_as_reference_type_but_it_was_already_marked_as_value_type_it_should_throw() { // Arrange - var subject = new ClassWithValueSemanticsOnSingleProperty { Key = "Don't care" }; + var subject = new ClassWithValueSemanticsOnSingleProperty + { + Key = "Don't care" + }; - var expected = new ClassWithValueSemanticsOnSingleProperty { Key = "Don't care" }; + var expected = new ClassWithValueSemanticsOnSingleProperty + { + Key = "Don't care" + }; // Act Action act = () => subject.Should().BeEquivalentTo(expected, options => options @@ -278,9 +351,23 @@ public void When_treating_a_type_as_reference_type_but_it_was_already_marked_as_ public void When_treating_a_complex_type_in_a_collection_as_a_value_type_it_should_compare_them_by_value() { // Arrange - var subject = new[] { new { Address = IPAddress.Parse("1.2.3.4"), Word = "a" } }; - - var expected = new[] { new { Address = IPAddress.Parse("1.2.3.4"), Word = "a" } }; + var subject = new[] + { + new + { + Address = IPAddress.Parse("1.2.3.4"), + Word = "a" + } + }; + + var expected = new[] + { + new + { + Address = IPAddress.Parse("1.2.3.4"), + Word = "a" + } + }; // Act Action act = () => subject.Should().BeEquivalentTo(expected, @@ -294,9 +381,17 @@ public void When_treating_a_complex_type_in_a_collection_as_a_value_type_it_shou public void When_treating_a_complex_type_as_a_value_type_it_should_compare_them_by_value() { // Arrange - var subject = new { Address = IPAddress.Parse("1.2.3.4"), Word = "a" }; + var subject = new + { + Address = IPAddress.Parse("1.2.3.4"), + Word = "a" + }; - var expected = new { Address = IPAddress.Parse("1.2.3.4"), Word = "a" }; + var expected = new + { + Address = IPAddress.Parse("1.2.3.4"), + Word = "a" + }; // Act Action act = () => subject.Should().BeEquivalentTo(expected, @@ -408,8 +503,15 @@ public override bool Equals(object obj) => public void When_threating_any_type_as_reference_type_it_should_exclude_primitive_types() { // Arrange - var subject = new { Value = 1 }; - var expected = new { Value = 2 }; + var subject = new + { + Value = 1 + }; + + var expected = new + { + Value = 2 + }; // Act Action act = () => subject.Should().BeEquivalentTo(expected, opt => opt @@ -424,8 +526,15 @@ public void When_threating_any_type_as_reference_type_it_should_exclude_primitiv public void When_threating_an_open_type_as_reference_type_it_should_exclude_primitive_types() { // Arrange - var subject = new { Value = 1 }; - var expected = new { Value = 2 }; + var subject = new + { + Value = 1 + }; + + var expected = new + { + Value = 2 + }; // Act Action act = () => subject.Should().BeEquivalentTo(expected, opt => opt @@ -440,8 +549,15 @@ public void When_threating_an_open_type_as_reference_type_it_should_exclude_prim public void When_threating_a_primitive_type_as_a_reference_type_it_should_throw() { // Arrange - var subject = new { Value = 1 }; - var expected = new { Value = 2 }; + var subject = new + { + Value = 1 + }; + + var expected = new + { + Value = 2 + }; // Act Action act = () => subject.Should().BeEquivalentTo(expected, opt => opt @@ -456,9 +572,15 @@ public void When_threating_a_primitive_type_as_a_reference_type_it_should_throw( public void When_a_type_originates_from_the_System_namespace_it_should_be_treated_as_a_value_type() { // Arrange - var subject = new { UriBuilder = new UriBuilder("http://localhost:9001/api"), }; + var subject = new + { + UriBuilder = new UriBuilder("http://localhost:9001/api"), + }; - var expected = new { UriBuilder = new UriBuilder("https://localhost:9002/bapi"), }; + var expected = new + { + UriBuilder = new UriBuilder("https://localhost:9002/bapi"), + }; // Act Action act = () => subject.Should().BeEquivalentTo(expected); @@ -517,8 +639,15 @@ public void When_asserting_equivalence_of_ints_typed_as_objects_it_should_use_th public void When_all_field_of_the_object_are_equal_equivalency_should_pass() { // Arrange - var object1 = new ClassWithOnlyAField { Value = 1 }; - var object2 = new ClassWithOnlyAField { Value = 1 }; + var object1 = new ClassWithOnlyAField + { + Value = 1 + }; + + var object2 = new ClassWithOnlyAField + { + Value = 1 + }; // Act Action act = () => object1.Should().BeEquivalentTo(object2); @@ -531,9 +660,17 @@ public void When_all_field_of_the_object_are_equal_equivalency_should_pass() public void When_number_values_are_convertible_it_should_treat_them_as_equivalent() { // Arrange - var actual = new Dictionary { ["001"] = 1L, ["002"] = 2L }; + var actual = new Dictionary + { + ["001"] = 1L, + ["002"] = 2L + }; - var expected = new Dictionary { ["001"] = 1, ["002"] = 2 }; + var expected = new Dictionary + { + ["001"] = 1, + ["002"] = 2 + }; // Act Action act = () => actual.Should().BeEquivalentTo(expected); @@ -546,8 +683,15 @@ public void When_number_values_are_convertible_it_should_treat_them_as_equivalen public void When_all_field_of_the_object_are_not_equal_equivalency_should_fail() { // Arrange - var object1 = new ClassWithOnlyAField { Value = 1 }; - var object2 = new ClassWithOnlyAField { Value = 101 }; + var object1 = new ClassWithOnlyAField + { + Value = 1 + }; + + var object2 = new ClassWithOnlyAField + { + Value = 101 + }; // Act Action act = () => object1.Should().BeEquivalentTo(object2); @@ -560,8 +704,15 @@ public void When_all_field_of_the_object_are_not_equal_equivalency_should_fail() public void When_a_field_on_the_subject_matches_a_property_the_members_should_match_for_equivalence() { // Arrange - var onlyAField = new ClassWithOnlyAField { Value = 1 }; - var onlyAProperty = new ClassWithOnlyAProperty { Value = 101 }; + var onlyAField = new ClassWithOnlyAField + { + Value = 1 + }; + + var onlyAProperty = new ClassWithOnlyAProperty + { + Value = 101 + }; // Act Action act = () => onlyAField.Should().BeEquivalentTo(onlyAProperty); @@ -574,8 +725,15 @@ public void When_a_field_on_the_subject_matches_a_property_the_members_should_ma public void When_asserting_equivalence_including_only_fields_it_should_not_match_properties() { // Arrange - var onlyAField = new ClassWithOnlyAField { Value = 1 }; - object onlyAProperty = new ClassWithOnlyAProperty { Value = 101 }; + var onlyAField = new ClassWithOnlyAField + { + Value = 1 + }; + + object onlyAProperty = new ClassWithOnlyAProperty + { + Value = 101 + }; // Act Action act = () => onlyAProperty.Should().BeEquivalentTo(onlyAField, opts => opts.ExcludingProperties()); @@ -589,8 +747,15 @@ public void When_asserting_equivalence_including_only_fields_it_should_not_match public void When_asserting_equivalence_including_only_properties_it_should_not_match_fields() { // Arrange - var onlyAField = new ClassWithOnlyAField { Value = 1 }; - var onlyAProperty = new ClassWithOnlyAProperty { Value = 101 }; + var onlyAField = new ClassWithOnlyAField + { + Value = 1 + }; + + var onlyAProperty = new ClassWithOnlyAProperty + { + Value = 101 + }; // Act Action act = () => onlyAField.Should().BeEquivalentTo(onlyAProperty, opts => opts.IncludingAllDeclaredProperties()); @@ -604,9 +769,25 @@ public void When_asserting_equivalence_including_only_properties_it_should_not_m public void When_asserting_equivalence_of_objects_including_enumerables_it_should_print_the_failure_message_only_once() { // Arrange - var record = new { Member1 = "", Member2 = new[] { "", "" } }; - - var record2 = new { Member1 = "different", Member2 = new[] { "", "" } }; + var record = new + { + Member1 = "", + Member2 = new[] + { + "", + "" + } + }; + + var record2 = new + { + Member1 = "different", + Member2 = new[] + { + "", + "" + } + }; // Act Action act = () => record.Should().BeEquivalentTo(record2); @@ -631,10 +812,24 @@ public void When_the_graph_contains_guids_it_should_properly_format_them() { // Arrange var actual = - new[] { new { Id = Guid.NewGuid(), Name = "Name" } }; + new[] + { + new + { + Id = Guid.NewGuid(), + Name = "Name" + } + }; var expected = - new[] { new { Id = Guid.NewGuid(), Name = "Name" } }; + new[] + { + new + { + Id = Guid.NewGuid(), + Name = "Name" + } + }; // Act Action act = () => actual.Should().BeEquivalentTo(expected); @@ -658,4 +853,69 @@ private class ClassWithArraySegment { public ArraySegment Segment { get; set; } } + + public class Strings + { + [Fact] + public void By_default_only_the_differencing_fragment_is_shown() + { + // Arrange + var subject = new + { + Story = + "The streets were quiet except for the faint hum of neon signs flickering in the night. A cat darted across the" + + " alley, chasing shadows only it could see. Somewhere, a radio whispered a half-forgotten song, mixing with " + + "the distant rumble of a train. The air carried the scent of rain on warm asphalt, heavy and restless. Each " + + "step felt like moving between moments—time stretching, folding, and twisting—while the city itself seemed" + + " to wait, holding its breath for what might come next." + }; + + var expected = new + { + Story = + "The streets were quiet except for the faint hum of neon signs flicering in the night. A cat darted across" + + " the alley, chasing shadows only it could see. Somewhere, a radio whispered a half-forgotten song, mixing with " + + "the distant rumble of a train. The air carried the scent of rain on warm asphalt, heavy and restless. Each " + + "step felt like moving between moments—time stretching, folding, and twisting—while the city itself seemed" + + " to wait, holding its breath for what might come next." + }; + + // Act + var act = () => subject.Should().BeEquivalentTo(expected); + + // Assert + act.Should().Throw().WithoutMessage("*Full expectation*"); + } + + [Fact] + public void The_entire_subject_and_expectation_can_be_included_in_the_failure() + { + // Arrange + var subject = new + { + Story = + "The streets were quiet except for the faint hum of neon signs flickering in the night. A cat darted across the" + + " alley, chasing shadows only it could see. Somewhere, a radio whispered a half-forgotten song, mixing with " + + "the distant rumble of a train. The air carried the scent of rain on warm asphalt, heavy and restless. Each " + + "step felt like moving between moments—time stretching, folding, and twisting—while the city itself seemed" + + " to wait, holding its breath for what might come next." + }; + + var expected = new + { + Story = + "The streets were quiet except for the faint hum of neon signs flicering in the night. A cat darted across" + + " the alley, chasing shadows only it could see. Somewhere, a radio whispered a half-forgotten song, mixing with " + + "the distant rumble of a train. The air carried the scent of rain on warm asphalt, heavy and restless. Each " + + "step felt like moving between moments—time stretching, folding, and twisting—while the city itself seemed" + + " to wait, holding its breath for what might come next." + }; + + // Act + var act = () => subject.Should().BeEquivalentTo(expected, options => options.IncludingFullStringsInDifference()); + + // Assert + act.Should().Throw().WithMessage("*Full expectation*"); + } + } } diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.Be.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.Be.cs index 6b158cc2b3..ad21556083 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.Be.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.Be.cs @@ -167,39 +167,41 @@ public void } [Fact] - public void When_two_strings_differ_and_one_of_them_is_long_it_should_display_both_strings_on_separate_line() + public void Displays_both_strings_on_separate_lines_when_any_string_is_long() { // Act - Action act = () => "1234567890".Should().Be("0987654321"); + string myString = "123456789012345 678901234567890123456 78901234567890"; + var act = () => myString.Should().Be("0987654321"); - // Assert - act.Should().Throw().WithMessage(""" - Expected string to be the same string, but they differ at index 0: + act.Should().Throw().WithMessage( + """ + Expected myString to be a match with the expectation, but it differs at index 0: ↓ (actual) - "1234567890" + "123456789012345 678901234567890123456 78901234567890" "0987654321" - ↑ (expected). + ↑ (expected) """); } [Fact] - public void When_two_strings_differ_and_one_of_them_is_multiline_it_should_display_both_strings_on_separate_line() + public void Displays_both_strings_on_separate_lines_for_multiline_strings() { // Act Action act = () => "A\r\nB".Should().Be("A\r\nC"); // Assert - act.Should().Throw().Which.Message.Should().Be(""" - Expected string to be the same string, but they differ on line 2 and column 1 (index 3): + act.Should().Throw().Which.Message.Should().Match( + """ + Expected string to be a match with the expectation, but it differs at column 1 of line 2 (index 3): ↓ (actual) "A\r\nB" "A\r\nC" - ↑ (expected). + ↑ (expected)* """); } [Fact] - public void Use_arrows_for_text_longer_than_8_characters() + public void Renders_arrows_and_ellipsis_to_highlight_differences_in_long_strings() { const string subject = "this is a long text that differs in between two words"; const string expected = "this is a long text which differs in between two words"; @@ -208,17 +210,18 @@ public void Use_arrows_for_text_longer_than_8_characters() Action act = () => subject.Should().Be(expected, "because we use arrows now"); // Assert - act.Should().Throw().WithMessage(""" - Expected subject to be the same string because we use arrows now, but they differ at index 20: + act.Should().Throw().WithMessage( + """ + Expected subject to be a match with the expectation because we use arrows now, but it differs at index 20: ↓ (actual) - "…is a long text that…" - "…is a long text which…" - ↑ (expected). + "…is a long text that differs in between two words" + "…is a long text which differs in between two words" + ↑ (expected) """); } [Fact] - public void Only_add_ellipsis_for_long_text() + public void Only_adds_ellipsis_for_truncated_phrases() { const string subject = "this is a long text that differs"; const string expected = "this was too short"; @@ -227,19 +230,21 @@ public void Only_add_ellipsis_for_long_text() Action act = () => subject.Should().Be(expected, "because we use arrows now"); // Assert - act.Should().Throw().WithMessage(""" - Expected subject to be the same string because we use arrows now, but they differ at index 5: + act.Should().Throw().WithMessage( + """ + Expected subject to be a match with the expectation because we use arrows now, but it differs at index 5: ↓ (actual) - "this is a long text that…" + "this is a long text that differs" "this was too short" - ↑ (expected). + ↑ (expected) """); } [Theory] [InlineData("ThisIsUsedTo Check a difference after 5 characters")] [InlineData("ThisIsUsedTo CheckADifferenc e after 15 characters")] - public void Will_look_for_a_word_boundary_between_5_and_15_characters_before_the_mismatching_index_to_highlight_the_mismatch(string expected) + public void Will_look_for_a_word_boundary_between_5_and_15_characters_before_the_mismatching_index_to_highlight_the_mismatch( + string expected) { const string subject = "ThisIsUsedTo CheckADifferenceInThe WordBoundaryAlgorithm"; @@ -251,10 +256,10 @@ public void Will_look_for_a_word_boundary_between_5_and_15_characters_before_the } [Theory] - [InlineData("ThisIsUsedTo Chec k a difference after 4 characters", "\"…sedTo CheckADifferen")] - [InlineData("ThisIsUsedTo CheckADifference after 16 characters", "\"…Difference")] - public void Will_fallback_to_10_characters_if_no_word_boundary_can_be_found_before_the_mismatching_index( - string expected, string expectedMessagePart) + [InlineData("ThisIsUsedTo Chec k a difference", "\"…sedTo CheckADifferen")] + [InlineData("ThisIsUsedTo CheckADifference", "\"…Difference")] + public void Renders_the_10_preceding_characters_if_no_word_boundary_can_be_found_before_the_mismatching_index( + string expected, string expectedMessagePart) { const string subject = "ThisIsUsedTo CheckADifferenceInThe WordBoundaryAlgorithm"; @@ -268,7 +273,8 @@ public void Will_fallback_to_10_characters_if_no_word_boundary_can_be_found_befo [Theory] [InlineData("ThisLongTextIsUsedToCheckADifferenceAtTheEnd after 10 + 5 characters")] [InlineData("ThisLongTextIsUsedToCheckADifferen after 10 + 15 characters")] - public void Will_look_for_a_word_boundary_between_15_and_25_characters_after_the_mismatching_index_to_highlight_the_mismatch(string expected) + public void Looks_for_a_word_boundary_between_15_and_25_characters_after_the_mismatching_index_to_highlight_the_mismatch( + string expected) { const string subject = "ThisLongTextIsUsedToCheckADifferenceAtTheEndOfThe WordBoundaryAlgorithm"; @@ -276,7 +282,7 @@ public void Will_look_for_a_word_boundary_between_15_and_25_characters_after_the Action act = () => subject.Should().Be(expected); // Assert - act.Should().Throw().WithMessage("*AtTheEndOfThe…\"*"); + act.Should().Throw().WithMessage("*ceAtTheEndOfThe WordBoundaryAlgorithm\"*"); } [Fact] @@ -300,10 +306,10 @@ public void A_mismatch_below_index_11_includes_all_text_preceding_the_index_in_t } [Theory] - [InlineData("ThisLongTextIsUsedToCheckADifferenceAtTheEndO after 10 + 4 characters", "eAtTheEndOfThe WordB…\"")] - [InlineData("ThisLongTextIsUsedToCheckADiffere after 10 + 16 characters", "ckADifferenceAtTheEn…\"")] + [InlineData("ThisLongTextIsUsedToCheckADifferenceAtTheEndO after 10 + 4 characters", "eAtTheEndOfThe WordBoundaryAlgorithm\"")] + [InlineData("ThisLongTextIsUsedToCheckADiffere after 10 + 16 characters", "ckADifferenceAtTheEndOfThe WordBoundaryAlgorithm\"")] public void Will_fallback_to_20_characters_if_no_word_boundary_can_be_found_after_the_mismatching_index( - string expected, string expectedMessagePart) + string expected, string expectedMessagePart) { const string subject = "ThisLongTextIsUsedToCheckADifferenceAtTheEndOfThe WordBoundaryAlgorithm"; @@ -315,40 +321,74 @@ public void Will_fallback_to_20_characters_if_no_word_boundary_can_be_found_afte } [Fact] - public void Mismatches_in_multiline_text_includes_the_line_number() + public void A_mismatch_in_a_multiline_text_reports_the_line_number() { var expectedIndex = 100 + (4 * Environment.NewLine.Length); var subject = """ - @startuml - Alice -> Bob : Authentication Request - Bob --> Alice : Authentication Response + @startuml + Alice -> Bob : Authentication Request + Bob --> Alice : Authentication Response - Alice -> Bob : Another authentication Request - Alice <-- Bob : Another authentication Response - @enduml - """; + Alice -> Bob : Another authentication Request + Alice <-- Bob : Another authentication Response + @enduml + """; var expected = """ - @startuml - Alice -> Bob : Authentication Request - Bob --> Alice : Authentication Response + @startuml + Alice -> Bob : Authentication Request + Bob --> Alice : Authentication Response - Alice -> Bob : Invalid authentication Request - Alice <-- Bob : Another authentication Response - @enduml - """; + Alice -> Bob : Invalid authentication Request + Alice <-- Bob : Another authentication Response + @enduml + """; // Act Action act = () => subject.Should().Be(expected); // Assert - act.Should().Throw().WithMessage($""" - Expected subject to be the same string, but they differ on line 5 and column 16 (index {expectedIndex}): - ↓ (actual) - "…-> Bob : Another…" - "…-> Bob : Invalid…" - ↑ (expected). + act.Should().Throw().WithMessage( + $""" + Expected subject to be a match with the expectation, but it differs at column 16 of line 5 (index {expectedIndex}): + ↓ (actual) + "…-> Bob : Another authentication Request*Alice <-- Bob : Another authentication…" + "…-> Bob : Invalid authentication Request*Alice <-- Bob : Another authentication…" + ↑ (expected)* + """); + } + + [Fact] + public void Will_include_the_full_subject_and_expectation_for_long_truncated_strings() + { + var subject = """ + The streets were quiet except for the faint hum of neon signs flickering in the night. A cat darted across the alley, chasing shadows only it could see. Somewhere, a radio whispered a half-forgotten song, mixing with the distant rumble of a train. The air carried the scent of rain on warm asphalt, heavy and restless. Each step felt like moving between moments—time stretching, folding, and twisting—while the city itself seemed to wait, holding its breath for what might come next. + """; + + var expected = """ + The streets were quiet except for the faint hum of neon signs flicering in the night. A cat darted across the alley, chasing shadows only it could see. Somewhere, a radio whispered a half-forgotten song, mixing with the distant rumble of a train. The air carried the scent of rain on warm asphalt, heavy and restless. Each step felt like moving between moments—time stretching, folding, and twisting—while the city itself seemed to wait, holding its breath for what might come next. + """; + + // Act + Action act = () => subject.Should().Be(expected); + + // Assert + act.Should().Throw().WithMessage( + """ + Expected subject to be a match with the expectation, but it differs at index 66: + ↓ (actual) + "…neon signs flickering in the night. A cat darted across the alley, chasing shadows…" + "…neon signs flicering in the night. A cat darted across the alley, chasing shadows…" + ↑ (expected) + + Full expectation: + + "The streets were quiet except for the faint hum of neon signs flicering in the night. A cat darted across the alley, chasing shadows only it could see. Somewhere, a radio whispered a half-forgotten song, mixing with the distant rumble of a train. The air carried the scent of rain on warm asphalt, heavy and restless. Each step felt like moving between moments—time stretching, folding, and twisting—while the city itself seemed to wait, holding its breath for what might come next.", + + Full subject: + + "The streets were quiet except for the faint hum of neon signs flickering in the night. A cat darted across the alley, chasing shadows only it could see. Somewhere, a radio whispered a half-forgotten song, mixing with the distant rumble of a train. The air carried the scent of rain on warm asphalt, heavy and restless. Each step felt like moving between moments—time stretching, folding, and twisting—while the city itself seemed to wait, holding its breath for what might come next." """); } } diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeEquivalentTo.cs index 224ba27749..46787cf393 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeEquivalentTo.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeEquivalentTo.cs @@ -175,6 +175,31 @@ public void act.Should().Throw().WithMessage( "Expected string to be equivalent to \"abc\" because I say so, but it has unexpected whitespace at the end."); } + + [Fact] + public void The_entire_subject_and_expectation_will_be_included_in_the_failure() + { + // Arrange + var subject = + "The streets were quiet except for the faint hum of neon signs flickering in the night. A cat darted across the" + + " alley, chasing shadows only it could see. Somewhere, a radio whispered a half-forgotten song, mixing with " + + "the distant rumble of a train. The air carried the scent of rain on warm asphalt, heavy and restless. Each " + + "step felt like moving between moments—time stretching, folding, and twisting—while the city itself seemed" + + " to wait, holding its breath for what might come next."; + + var expected = + "The streets were quiet except for the faint hum of neon signs flicering in the night. A cat darted across" + + " the alley, chasing shadows only it could see. Somewhere, a radio whispered a half-forgotten song, mixing with " + + "the distant rumble of a train. The air carried the scent of rain on warm asphalt, heavy and restless. Each " + + "step felt like moving between moments—time stretching, folding, and twisting—while the city itself seemed" + + " to wait, holding its breath for what might come next."; + + // Act + var act = () => subject.Should().BeEquivalentTo(expected); + + // Assert + act.Should().Throw().WithMessage("*Full expectation*"); + } } public class NotBeEquivalentTo diff --git a/docs/_pages/objectgraphs.md b/docs/_pages/objectgraphs.md index e6a77eab07..d353d34c9b 100644 --- a/docs/_pages/objectgraphs.md +++ b/docs/_pages/objectgraphs.md @@ -360,6 +360,21 @@ actual.Should().BeEquivalentTo(new }); ``` +### Strings + +The way `BeEquivalentTo` compares strings can be influenced by the options `IgnoringLeadingWhitespace()`, `IgnoringTrailingWhitespace()`, `IgnoringCase()`, `IgnoringNewlineStyle()` like this: + +```csharp +// Arrange +string actual = "A\nB\r\nC"; +string expect = "A\r\nB\nC"; + +// Act / Assert +actual.Should().BeEquivalentTo(expect, o => o.IgnoringNewlineStyle()); +``` + +Next to that, when two long strings differ, by default the reporting will only include the relevant fragments needed to highlight the differences. If you want to see the full text of both strings, use the `IncludingFullStringsInDifference()` option. + ### Enums By default, `Should().BeEquivalentTo()` compares `Enum` members by the enum's underlying numeric value. diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 21e064a959..950b24c14c 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,6 +7,16 @@ sidebar: nav: "sidebar" --- +## 8.8.0 + +### What's new + +* Added `WithoutMessage` to allow asserting an exception message does not contain a wildcard pattern - [#3100](https://github.com/fluentassertions/fluentassertions/pull/3100) + +### Enhancements + +* Improved the way the differences are reported for long strings - [#3101](https://github.com/fluentassertions/fluentassertions/pull/3101) + ## 8.7.1 ### Fixes From 13ec4593a49c19879a4804b48029f3dabd997543 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 8 Oct 2025 10:59:29 +0200 Subject: [PATCH 707/845] Add support for MSTest4 --- Build/Build.cs | 1 + FluentAssertions.sln | 9 ++++++++ .../Configuration/TestFramework.cs | 3 ++- .../Execution/MSTestFrameworkV4.cs | 8 +++++++ .../Execution/TestFrameworkFactory.cs | 1 + Src/FluentAssertions/FluentAssertions.csproj | 4 ++-- .../FluentAssertions/net47.verified.txt | 1 + .../FluentAssertions/net6.0.verified.txt | 1 + .../netstandard2.0.verified.txt | 1 + .../netstandard2.1.verified.txt | 1 + .../MSTestV4.Specs/FrameworkSpecs.cs | 23 +++++++++++++++++++ .../MSTestV4.Specs/MSTestV4.Specs.csproj | 18 +++++++++++++++ docs/_pages/about.md | 4 ++-- docs/_pages/introduction.md | 15 +++++------- docs/_pages/releases.md | 6 +++++ docs/index.html | 2 +- 16 files changed, 83 insertions(+), 15 deletions(-) create mode 100644 Src/FluentAssertions/Execution/MSTestFrameworkV4.cs create mode 100644 Tests/TestFrameworks/MSTestV4.Specs/FrameworkSpecs.cs create mode 100644 Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj diff --git a/Build/Build.cs b/Build/Build.cs index 87d8bb32de..a089ea93b1 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -251,6 +251,7 @@ class Build : NukeBuild [ Solution.TestFrameworks.MSpec_Specs, Solution.TestFrameworks.MSTestV2_Specs, + Solution.TestFrameworks.MSTestV4_Specs, Solution.TestFrameworks.NUnit3_Specs, Solution.TestFrameworks.NUnit4_Specs, Solution.TestFrameworks.XUnit2_Specs, diff --git a/FluentAssertions.sln b/FluentAssertions.sln index 842d66c8b0..3766cd7232 100644 --- a/FluentAssertions.sln +++ b/FluentAssertions.sln @@ -63,6 +63,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnit3.Specs", "Tests\TestF EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnit3Core.Specs", "Tests\TestFrameworks\XUnit3Core.Specs\XUnit3Core.Specs.csproj", "{77BB9496-169D-43DA-BCED-7DB3ACD9179A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSTestV4.Specs", "Tests\TestFrameworks\MSTestV4.Specs\MSTestV4.Specs.csproj", "{06D5201F-65F6-AA25-8592-A78668E25B66}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution CI|Any CPU = CI|Any CPU @@ -189,6 +191,12 @@ Global {77BB9496-169D-43DA-BCED-7DB3ACD9179A}.Debug|Any CPU.Build.0 = Debug|Any CPU {77BB9496-169D-43DA-BCED-7DB3ACD9179A}.Release|Any CPU.ActiveCfg = Release|Any CPU {77BB9496-169D-43DA-BCED-7DB3ACD9179A}.Release|Any CPU.Build.0 = Release|Any CPU + {06D5201F-65F6-AA25-8592-A78668E25B66}.CI|Any CPU.ActiveCfg = Debug|Any CPU + {06D5201F-65F6-AA25-8592-A78668E25B66}.CI|Any CPU.Build.0 = Debug|Any CPU + {06D5201F-65F6-AA25-8592-A78668E25B66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {06D5201F-65F6-AA25-8592-A78668E25B66}.Debug|Any CPU.Build.0 = Debug|Any CPU + {06D5201F-65F6-AA25-8592-A78668E25B66}.Release|Any CPU.ActiveCfg = Release|Any CPU + {06D5201F-65F6-AA25-8592-A78668E25B66}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -214,6 +222,7 @@ Global {6540564E-9B6E-4E1E-8881-6F0DD0F35576} = {4D8FA213-8724-4C43-B68A-F018148D238C} {AF1479D8-519F-4C6B-9E8C-5A84A6D5549A} = {4D8FA213-8724-4C43-B68A-F018148D238C} {77BB9496-169D-43DA-BCED-7DB3ACD9179A} = {4D8FA213-8724-4C43-B68A-F018148D238C} + {06D5201F-65F6-AA25-8592-A78668E25B66} = {4D8FA213-8724-4C43-B68A-F018148D238C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {75DDA3D8-9D6F-4865-93F4-DDE11DEE8290} diff --git a/Src/FluentAssertions/Configuration/TestFramework.cs b/Src/FluentAssertions/Configuration/TestFramework.cs index 8ee15577d6..5fd7e1f605 100644 --- a/Src/FluentAssertions/Configuration/TestFramework.cs +++ b/Src/FluentAssertions/Configuration/TestFramework.cs @@ -10,5 +10,6 @@ public enum TestFramework TUnit, MsTest, NUnit, - MSpec + MSpec, + MsTest4, } diff --git a/Src/FluentAssertions/Execution/MSTestFrameworkV4.cs b/Src/FluentAssertions/Execution/MSTestFrameworkV4.cs new file mode 100644 index 0000000000..c40fcda2c3 --- /dev/null +++ b/Src/FluentAssertions/Execution/MSTestFrameworkV4.cs @@ -0,0 +1,8 @@ +namespace FluentAssertions.Execution; + +internal sealed class MSTestFrameworkV4 : LateBoundTestFramework +{ + protected override string ExceptionFullName => "Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException"; + + protected internal override string AssemblyName => "MSTest.TestFramework"; +} diff --git a/Src/FluentAssertions/Execution/TestFrameworkFactory.cs b/Src/FluentAssertions/Execution/TestFrameworkFactory.cs index 34ab089dde..ac298b9045 100644 --- a/Src/FluentAssertions/Execution/TestFrameworkFactory.cs +++ b/Src/FluentAssertions/Execution/TestFrameworkFactory.cs @@ -16,6 +16,7 @@ internal static class TestFrameworkFactory [TestFramework.MSpec] = new MSpecFramework(), [TestFramework.NUnit] = new NUnitTestFramework(), [TestFramework.MsTest] = new MSTestFrameworkV2(), + [TestFramework.MsTest4] = new MSTestFrameworkV4(), // Keep TUnitFramework and XUnitTestFramework last as they use a try/catch approach [TestFramework.TUnit] = new TUnitFramework(), diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index d4dde24256..2d853b4ddd 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -19,10 +19,10 @@ A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher. - Supports the unit test frameworks MSTest2, NUnit3, NUnit4, XUnit2, XUnit3, MSpec and TUnit. + Supports the unit test frameworks MSTest2, MSTest3, MSTest4, NUnit3, NUnit4, XUnit2, XUnit3, MSpec and TUnit. IMPORTANT: This version is free for open-source projects and non-commercial use, but commercial use requires [a paid license](https://xceed.com/products/unit-testing/fluent-assertions/). -Check out the [license page](LICENSE) for more information. + Check out the [license page](LICENSE) for more information. https://xceed.com/products/unit-testing/fluent-assertions/ https://github.com/fluentassertions/fluentassertions diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 611217d064..4069b4fd2d 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -632,6 +632,7 @@ namespace FluentAssertions.Configuration MsTest = 3, NUnit = 4, MSpec = 5, + MsTest4 = 6, } } namespace FluentAssertions.Equivalency diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 50957e477c..9bd1aa1fcd 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -651,6 +651,7 @@ namespace FluentAssertions.Configuration MsTest = 3, NUnit = 4, MSpec = 5, + MsTest4 = 6, } } namespace FluentAssertions.Equivalency diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index a878db05ef..f892ea7784 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -624,6 +624,7 @@ namespace FluentAssertions.Configuration MsTest = 3, NUnit = 4, MSpec = 5, + MsTest4 = 6, } } namespace FluentAssertions.Equivalency diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 1b34307d2e..009089efb1 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -632,6 +632,7 @@ namespace FluentAssertions.Configuration MsTest = 3, NUnit = 4, MSpec = 5, + MsTest4 = 6, } } namespace FluentAssertions.Equivalency diff --git a/Tests/TestFrameworks/MSTestV4.Specs/FrameworkSpecs.cs b/Tests/TestFrameworks/MSTestV4.Specs/FrameworkSpecs.cs new file mode 100644 index 0000000000..2256ed128b --- /dev/null +++ b/Tests/TestFrameworks/MSTestV4.Specs/FrameworkSpecs.cs @@ -0,0 +1,23 @@ +using System; +using FluentAssertions; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace MSTestV4.Specs; + +[TestClass] +public class FrameworkSpecs +{ + [TestMethod] + public void When_mstestv4_is_used_it_should_throw_mstest_exceptions_for_assertion_failures() + { + // Act + Action act = () => 0.Should().Be(1); + + // Assert + Exception exception = act.Should().Throw().Which; + + // Don't reference the exception type explicitly like this: act.Should().Throw() + // It could cause this specs project to load the assembly containing the exception (this actually happens for xUnit) + exception.GetType().FullName.Should().Be("Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException"); + } +} diff --git a/Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj b/Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj new file mode 100644 index 0000000000..b815e2e765 --- /dev/null +++ b/Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj @@ -0,0 +1,18 @@ + + + net8.0 + MSTestV4.Specs + MSTestV4.Specs + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + diff --git a/docs/_pages/about.md b/docs/_pages/about.md index 6109bf8da6..8c0b9e9e6e 100644 --- a/docs/_pages/about.md +++ b/docs/_pages/about.md @@ -50,9 +50,9 @@ Because of that Fluent Assertions supports the following minimum platforms. Fluent Assertions supports the following unit test frameworks: -* [MSTest V2](https://github.com/Microsoft/testfx) (Visual Studio 2017, Visual Studio 2019) +* [MSTest V2, V3 and V4](https://github.com/Microsoft/testfx) (Visual Studio 2017, Visual Studio 2019) * [NUnit](http://www.nunit.org/) -* [XUnit2](https://github.com/xunit/xunit/releases) +* [XUnit2 & XUnit3](https://github.com/xunit/xunit/releases) * [MSpec](https://github.com/machine/machine.specifications) * [TUnit](https://github.com/thomhurst/TUnit) diff --git a/docs/_pages/introduction.md b/docs/_pages/introduction.md index 4fcbbc3464..98c564dbfb 100644 --- a/docs/_pages/introduction.md +++ b/docs/_pages/introduction.md @@ -92,15 +92,12 @@ public static class Initializer Fluent Assertions supports a lot of different unit testing frameworks. Just add a reference to the corresponding test framework assembly to the unit test project. Fluent Assertions will automatically find the corresponding assembly and use it for throwing the framework-specific exceptions. -If, for some unknown reason, Fluent Assertions fails to find the assembly, and you're running under .NET 4.7 or a .NET 6.0 project, try specifying the framework explicitly using a configuration setting in the project’s app.config. If it cannot find any of the supported frameworks, it will fall back to using a custom `AssertionFailedException` exception class. - -```xml - - - - - - +If, for some unknown reason, Fluent Assertions fails to find the assembly, try specifying the framework explicitly using `GlobalConfiguration.TestFramework`. If it cannot find any of the supported frameworks, it will fall back to using a custom `AssertionFailedException` exception class. +See [Extensibility](extensibility.md) for where to setup `GlobalConfiguration.TestFramework`. + +```csharp +// Supported values: XUnit2, XUnit3, TUnit, MsTest, NUnit, MSpec and MsTest4 +GlobalConfiguration.TestFramework = TestFramework.NUnit; ``` Just add NuGet package "FluentAssertions" to your test project. diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 950b24c14c..37999af82b 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,6 +7,12 @@ sidebar: nav: "sidebar" --- +## 8.9.0 + +### What's new + +* Added support for MSTest 4 - [#3111](https://github.com/fluentassertions/fluentassertions/pull/3111) + ## 8.8.0 ### What's new diff --git a/docs/index.html b/docs/index.html index bac70d69e2..0e7439f753 100644 --- a/docs/index.html +++ b/docs/index.html @@ -60,7 +60,7 @@ image_path: /assets/images/checklist.svg excerpt: ' Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher. -Supports MSTest2, xUnit2, xUnit3, NUnit3, NUnit4, MSpec and TUnit. +Supports MSTest2, MSTest3, MSTest4, xUnit2, xUnit3, NUnit3, NUnit4, MSpec and TUnit. ' - title: "Great Support" image_path: /assets/images/customer-service.svg From 0e5abf52d91c1063cfe9f2076392e20d0d967d53 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 8 Oct 2025 13:18:29 +0200 Subject: [PATCH 708/845] Fix release notes --- docs/_pages/releases.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 37999af82b..d3284d99ea 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,17 +7,12 @@ sidebar: nav: "sidebar" --- -## 8.9.0 - -### What's new - -* Added support for MSTest 4 - [#3111](https://github.com/fluentassertions/fluentassertions/pull/3111) - ## 8.8.0 ### What's new * Added `WithoutMessage` to allow asserting an exception message does not contain a wildcard pattern - [#3100](https://github.com/fluentassertions/fluentassertions/pull/3100) +* Added support for MSTest 4 - [#3111](https://github.com/fluentassertions/fluentassertions/pull/3111) ### Enhancements From 0a56af759ed1074daefcafd105581e69af9424e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 14:39:27 +0000 Subject: [PATCH 709/845] Bump github/codeql-action from 3 to 4 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v3...v4) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ac55636fe2..da02270af2 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -36,7 +36,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -52,6 +52,6 @@ jobs: dotnet build FluentAssertions.sln --configuration CI --no-restore - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 with: category: "/language:${{matrix.language}}" From 9f3e1ea0c961b697b588154b140d89ce5a6ecdb5 Mon Sep 17 00:00:00 2001 From: Jonathan Gilbert Date: Tue, 14 Oct 2025 02:09:52 -0500 Subject: [PATCH 710/845] Allow customizing the equivalency behavior for BeXmlSerializable (#3107) --- .../ObjectAssertionsExtensions.cs | 77 +++++++- .../FluentAssertions/net47.verified.txt | 3 + .../FluentAssertions/net6.0.verified.txt | 3 + .../netstandard2.0.verified.txt | 3 + .../netstandard2.1.verified.txt | 3 + ...sertionSpecs.BeDataContractSerializable.cs | 51 +++++- .../ObjectAssertionSpecs.BeXmlSerializable.cs | 45 +++++ docs/_data/navigation.yml | 2 + docs/_pages/basicassertions.md | 2 + docs/_pages/releases.md | 6 + docs/_pages/serializationignoredmembers.md | 168 ++++++++++++++++++ 11 files changed, 352 insertions(+), 11 deletions(-) create mode 100644 docs/_pages/serializationignoredmembers.md diff --git a/Src/FluentAssertions/ObjectAssertionsExtensions.cs b/Src/FluentAssertions/ObjectAssertionsExtensions.cs index 319548a6ae..238cd317e2 100644 --- a/Src/FluentAssertions/ObjectAssertionsExtensions.cs +++ b/Src/FluentAssertions/ObjectAssertionsExtensions.cs @@ -28,6 +28,31 @@ public static AndConstraint BeDataContractSerializable(this Ob return BeDataContractSerializable(assertions, options => options, because, becauseArgs); } + /// + /// Asserts that an object can be serialized and deserialized using the data contract serializer and that it stills retains + /// the values of all members. + /// + /// + /// A reference to the configuration object that can be used + /// to influence the way the object graphs are compared. You can also provide an alternative instance of the + /// class. The global defaults are determined by the + /// class. + /// + /// + /// 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 . + /// + /// is . + public static AndConstraint BeDataContractSerializable(this ObjectAssertions assertions, + Func, EquivalencyOptions> options, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + return BeDataContractSerializable(assertions, options, because, becauseArgs); + } + /// /// Asserts that an object can be serialized and deserialized using the data contract serializer and that it stills retains /// the values of all members. @@ -96,13 +121,59 @@ private static object CreateCloneUsingDataContractSerializer(object subject) /// public static AndConstraint BeXmlSerializable(this ObjectAssertions assertions, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + => BeXmlSerializable(assertions, options => options, because, becauseArgs); + + /// + /// Asserts that an object can be serialized and deserialized using the XML serializer and that it stills retains + /// the values of all members. + /// + /// + /// A reference to the configuration object that can be used + /// to influence the way the object graphs are compared. You can also provide an alternative instance of the + /// class. The global defaults are determined by the + /// class. + /// + /// + /// 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 static AndConstraint BeXmlSerializable(this ObjectAssertions assertions, + Func, EquivalencyOptions> options, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + => BeXmlSerializable(assertions, options, because, becauseArgs); + + /// + /// Asserts that an object can be serialized and deserialized using the XML serializer and that it stills retains + /// the values of all members. + /// + /// + /// A reference to the configuration object that can be used + /// to influence the way the object graphs are compared. You can also provide an alternative instance of the + /// class. The global defaults are determined by the + /// class. + /// + /// + /// 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 static AndConstraint BeXmlSerializable(this ObjectAssertions assertions, + Func, EquivalencyOptions> options, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { try { - object deserializedObject = CreateCloneUsingXmlSerializer(assertions.Subject); + var deserializedObject = CreateCloneUsingXmlSerializer(assertions.Subject); + + EquivalencyOptions defaultOptions = AssertionConfiguration.Current.Equivalency.CloneDefaults() + .PreferringRuntimeMemberTypes().IncludingFields().IncludingProperties(); - deserializedObject.Should().BeEquivalentTo(assertions.Subject, - options => options.PreferringRuntimeMemberTypes().IncludingFields().IncludingProperties()); + deserializedObject.Should().BeEquivalentTo((T)assertions.Subject, _ => options(defaultOptions)); } catch (Exception exc) { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 4069b4fd2d..18b5cdd04c 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -322,8 +322,11 @@ namespace FluentAssertions public static class ObjectAssertionsExtensions { public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } } public abstract class OccurrenceConstraint { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 9bd1aa1fcd..c29f32091e 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -341,8 +341,11 @@ namespace FluentAssertions public static class ObjectAssertionsExtensions { public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } } public abstract class OccurrenceConstraint { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index f892ea7784..b52faa2341 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -314,8 +314,11 @@ namespace FluentAssertions public static class ObjectAssertionsExtensions { public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } } public abstract class OccurrenceConstraint { diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 009089efb1..fc2d857989 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -322,8 +322,11 @@ namespace FluentAssertions public static class ObjectAssertionsExtensions { public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeDataContractSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } + public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } } public abstract class OccurrenceConstraint { diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeDataContractSerializable.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeDataContractSerializable.cs index 81eab5b349..6cdee35670 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeDataContractSerializable.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeDataContractSerializable.cs @@ -62,22 +62,37 @@ public void When_an_object_is_data_contract_serializable_but_doesnt_restore_all_ } [Fact] - public void When_a_data_contract_serializable_object_doesnt_restore_an_ignored_property_it_should_succeed() + public void When_an_object_is_not_binary_serializable_and_has_ignored_properties_it_should_fail() { // Arrange - var subject = new DataContractSerializableClassNotRestoringAllProperties + var subject = new DataContractSerializableClassWithIgnoredDataMember() { - Name = "John", - BirthDay = 20.September(1973) + Name = "Deborah", + CachedSum = 602_214_076_000_000_000_000_000M, }; // Act - Action act = () => subject.Should() - .BeDataContractSerializable( - options => options.Excluding(x => x.Name)); + Action act = () => subject.Should().BeDataContractSerializable(); // Assert - act.Should().NotThrow(); + act.Should().Throw().WithMessage("*Expected property subject.CachedSum to be*"); + } + + [Fact] + public void When_an_object_is_binary_serializable_and_has_nonserialized_fields_it_should_fail() + { + // Arrange + var subject = new BinarySerializableClassWithNonSerializedMember() + { + Name = "Deborah", + CachedSum = 602_214_076_000_000_000_000_000M, + }; + + // Act + Action act = () => subject.Should().BeDataContractSerializable(options => options); + + // Assert + act.Should().Throw().WithMessage("*Expected field subject.CachedSum to be*"); } [Fact] @@ -119,6 +134,26 @@ public class DataContractSerializableClassNotRestoringAllProperties public DateTime BirthDay { get; set; } } + [DataContract] + public class DataContractSerializableClassWithIgnoredDataMember + { + [DataMember] + public string Name { get; set; } + + [IgnoreDataMember] + public decimal CachedSum { get; set; } + } + + [Serializable] + public class BinarySerializableClassWithNonSerializedMember + { + // These members need to be fields for binary serialization. + public string Name; + + [NonSerialized] + public decimal CachedSum; + } + public enum Color { Red = 1, diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs index ea773f33bf..6aef7a65e2 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs @@ -66,6 +66,23 @@ public void When_an_object_is_xml_serializable_but_doesnt_restore_all_properties act.Should().Throw() .WithMessage("*to be serializable, but serialization failed with:*Name*to be*"); } + + [Fact] + public void When_an_object_is_xml_serializable_and_has_ignored_properties_it_should_fail() + { + // Arrange + var subject = new XmlSerializableClassWithIgnoredProperties() + { + Name = "Deborah", + CachedSum = 602_214_076_000_000_000_000_000M, + }; + + // Act + Action act = () => subject.Should().BeXmlSerializable(); + + // Assert + act.Should().Throw().WithMessage("*Expected property subject.CachedSum to be*"); + } } public class XmlSerializableClass @@ -99,6 +116,34 @@ public void WriteXml(XmlWriter writer) } } + public class XmlSerializableClassWithIgnoredProperties + { + public string Name { get; set; } + + [XmlIgnore] + public decimal CachedSum { get; set; } + + public R Splonk { get; set; } = + new R() + { + A = new Q() { Flarbs = "eh" }, + B = new Q() { Flarbs = "bee" }, + }; + } + + public class R + { + public Q A { get; set; } + + public Q B { get; set; } + } + + public class Q + { + [XmlIgnore] + public string Flarbs { get; set; } + } + internal class NonPublicClass { [UsedImplicitly] diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index bad82fae37..4ad8e9de44 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -101,6 +101,8 @@ sidebar: url: /tips/#improved-assertions - title: Migrating from MSTest url: /tips/#mstest-migration + - title: Serialization & Ignored Members + url: /serializationignoredmembers - title: Upgrading url: /upgradingtov6 diff --git a/docs/_pages/basicassertions.md b/docs/_pages/basicassertions.md index 0213ec2932..1157d87b9b 100644 --- a/docs/_pages/basicassertions.md +++ b/docs/_pages/basicassertions.md @@ -110,3 +110,5 @@ We’ve also added the possibility to assert that an object can be serialized an theObject.Should().BeXmlSerializable(); theObject.Should().BeDataContractSerializable(); ``` + +See [Tips & Tricks - Serialization & Ignored Members](serializationignoredmembers.md) for additional information about the `BeXmlSerializable` and `BeDataContractSerializable` assertions and ignored members. diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index d3284d99ea..2afbc67593 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,6 +7,12 @@ sidebar: nav: "sidebar" --- +## Unreleased + +### What's new + +* New overloads of `BeXmlSerializable` and `BeDataContractSerializable` that allow `EquivalencyOptions` to be configured, allowing the use of member selection rules. - [#3107](https://github.com/fluentassertions/fluentassertions/pull/3107) + ## 8.8.0 ### What's new diff --git a/docs/_pages/serializationignoredmembers.md b/docs/_pages/serializationignoredmembers.md new file mode 100644 index 0000000000..d29d1c86b8 --- /dev/null +++ b/docs/_pages/serializationignoredmembers.md @@ -0,0 +1,168 @@ +--- +title: Serialization and Ignored Members +permalink: /serializationignoredmembers/ +layout: single +toc: true +sidebar: + nav: "sidebar" + +--- + +The `BeXmlSerializable` and `BeDataContractSerializable` assertions exist to verify that a particular instance can round-trip through serialization. This is done by serializing the object, deserializing the result, and then comparing the objects for equivalency. + +The XML serialization infrastructure supports marking fields and properties with the `[XmlIgnore]` attribute. Similarly, members in a `[DataContract]` can be marked `[IgnoreDataMember]`. With legacy binary serialization, fields can be marked `[NonSerialized]`, and the DataContract serializer will respect this when serializing classes marked `[Serializable]`. + +When members are marked in this way, the serialized form produced omits the specified members. When deserializing it, the members are not populated with anything. This is the case even if the serialized form is XML that contains elements matching ignored members. By default, Fluent Assertions will include these fields in comparisons, causing `BeXmlSerializable`/`BeDataContractSerializable` assertions to fail. + +You can specify that these members should be ignored using a custom implementation of `IMemberSelectionRule`. This can then be configured via the `EquivalencyOptions` object, using an overload that `BeXmlSerializable` or `BeDataContractSerializable` that takes a configuration functor. + +The following implementations exclude members marked with `[XmlIgnore]` (`ExcludeXmlIgnoredMembersRule`), `[IgnoreDataMember]` (`ExcludeIgnoredDataMembersRule`), and `[NonSerialized]` (`ExcludeNonSerializedFieldsRule`). If you are encountering assertion failures in `BeXmlSerializable`/`BeDataContractSerializable` assertions due to ignored members, you can include these in your project. + +- Use `ExcludeXmlIgnoredMembers` for `BeXmlSerializable` assertions. +- The DataContract serializer respects the `[NonSerialized]` attribute from legacy formatter-based serialization. For full compatibility, use both `ExcludeIgnoredDataMembersRule` and `ExcludeNonSerializedFieldsRule` with `BeDataContractSerializable` assertions. + +These rules can also be used when calling `BeEquivalentTo` on object graphs produced explicitly via serialization. + +```csharp +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Runtime.Serialization; +using System.Xml.Serialization; + +using FluentAssertions.Equivalency; + +public abstract class ExcludeByAttributeRuleBase : IMemberSelectionRule +{ + public bool IncludesMembers => false; + + private static readonly object s_cacheSync = new object(); + + private static readonly Dictionary s_typeCache = new Dictionary(); + + private static readonly Dictionary s_memberCache = new Dictionary(); + + protected virtual bool ShouldProcessType(Type type) => true; + + protected virtual bool ShouldExcludeMember(MemberInfo member) + => Attribute.IsDefined(member, typeof(TAttribute)); + + private bool GetOrComputeShouldProcessType(Type type) + { + lock (s_cacheSync) + { + if (s_typeCache.TryGetValue(type, out var cachedValue)) + return cachedValue; + + bool shouldProcessType = ShouldProcessType(type); + + s_typeCache[type] = shouldProcessType; + + return shouldProcessType; + } + } + + private bool GetOrComputeShouldExcludeMember(IMember member) + { + var memberInfo = member.DeclaringType.GetMember(member.Subject.Name); + + bool excludeMember = false; + + if (memberInfo.Length == 1) + { + lock (s_cacheSync) + { + if (!s_memberCache.TryGetValue(memberInfo[0], out excludeMember)) + { + excludeMember = ShouldExcludeMember(memberInfo[0]); + + s_memberCache[memberInfo[0]] = excludeMember; + } + } + } + + return excludeMember; + } + + public IEnumerable SelectMembers(INode currentNode, IEnumerable selectedMembers, MemberSelectionContext context) + { + return selectedMembers.Where(member => !GetOrComputeShouldProcessType(member.DeclaringType) || !GetOrComputeShouldExcludeMember(member)).ToList(); + } +} + +public class ExcludeXmlIgnoredMembersRule : ExcludeByAttributeRuleBase +{ +} + +public class ExcludeIgnoredDataMembersRule : ExcludeByAttributeRuleBase +{ + protected override bool ShouldProcessType(Type type) => !type.IsSerializable; +} + +public class ExcludeNonSerializedFieldsRule : ExcludeByAttributeRuleBase +{ + protected override bool ShouldProcessType(Type type) => type.IsSerializable; +} +``` + +Example usage: + +### XML Serialization + +```csharp +public class XmlRecord +{ + public string Name { get; } + + [XmlIgnore] + public int CachedValue { get; } +} + +XmlRecord subject = XmlGetRecord(); + +subject.Should().BeXmlSerializable(options => options + .Using(new ExcludeXmlIgnoredMembersRule())); +``` + +### DataContract + +```csharp +[DataContract] +public class Record +{ + [DataMember] + public string Name { get; } + + [IgnoreDataMember] + public int CachedValue { get; } +} + +Record subject = GetRecord(); + +subject.Should().BeDataContractSerializable(options => options + .Using(new ExcludeIgnoredDataMembersRule()) + .Using(new ExcludeNonSerializedFieldsRule())); +``` + +### BinaryFormatter (and DataContract serialization) + +```csharp +[Serializable] +public class Record +{ + // Note, these are fields. By design, BinaryFormatter only serializes fields. + public string Name; + + [NonSerialized] + public int CachedValue; +} + +Record original = GetRecord(); + +Record derived = BinaryFormatterDeserialize(BinaryFormatterSerialize(original)); // user-supplied methods + +derived.Should().BeEquivalentTo(original, options => options + .IncludingFields() + .Using(new ExcludeNonSerializedFieldsRule())); +``` From 23aa52bb9a1fbcec1ca1ee03af9f8ef3e606c532 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 15:39:20 +0000 Subject: [PATCH 711/845] Bump actions/download-artifact from 5 to 6 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e97fb5f22f..1873aa83e1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,7 +101,7 @@ jobs: steps: - name: Download Artifacts - uses: actions/download-artifact@v5 + uses: actions/download-artifact@v6 with: path: artifacts From 77ead779c27e8565fd13e54a6fc7d188bdc32b51 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 21:12:35 +0100 Subject: [PATCH 712/845] Bump cspell from 9.2.1 to 9.2.2 (#3118) Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 9.2.1 to 9.2.2. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.2.2/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.2.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 397 ++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 190 insertions(+), 209 deletions(-) diff --git a/package-lock.json b/package-lock.json index b64663926a..39e6c7024b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,34 +7,34 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.2.1" + "cspell": "^9.2.2" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.2.1.tgz", - "integrity": "sha512-85gHoZh3rgZ/EqrHIr1/I4OLO53fWNp6JZCqCdgaT7e3sMDaOOG6HoSxCvOnVspXNIf/1ZbfTCDMx9x79Xq0AQ==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.2.2.tgz", + "integrity": "sha512-W3FKgb89DwMuQEVWz0dPH9uZqC8w+ylpbtmXuevflw3SLtGPyllMvf/1T6tcqIkg3KEWoRYFxjpJWyoOjJkZGw==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.1", "@cspell/dict-al": "^1.1.1", "@cspell/dict-aws": "^4.0.15", "@cspell/dict-bash": "^4.2.1", - "@cspell/dict-companies": "^3.2.5", + "@cspell/dict-companies": "^3.2.6", "@cspell/dict-cpp": "^6.0.12", "@cspell/dict-cryptocurrencies": "^5.0.5", "@cspell/dict-csharp": "^4.0.7", "@cspell/dict-css": "^4.0.18", "@cspell/dict-dart": "^2.3.1", - "@cspell/dict-data-science": "^2.0.9", + "@cspell/dict-data-science": "^2.0.10", "@cspell/dict-django": "^4.1.5", "@cspell/dict-docker": "^1.1.16", "@cspell/dict-dotnet": "^5.0.10", "@cspell/dict-elixir": "^4.0.8", - "@cspell/dict-en_us": "^4.4.18", - "@cspell/dict-en-common-misspellings": "^2.1.5", - "@cspell/dict-en-gb-mit": "^3.1.8", - "@cspell/dict-filetypes": "^3.0.13", + "@cspell/dict-en_us": "^4.4.20", + "@cspell/dict-en-common-misspellings": "^2.1.6", + "@cspell/dict-en-gb-mit": "^3.1.10", + "@cspell/dict-filetypes": "^3.0.14", "@cspell/dict-flutter": "^1.1.1", "@cspell/dict-fonts": "^4.0.5", "@cspell/dict-fsharp": "^1.1.1", @@ -57,17 +57,17 @@ "@cspell/dict-markdown": "^2.0.12", "@cspell/dict-monkeyc": "^1.0.11", "@cspell/dict-node": "^5.0.8", - "@cspell/dict-npm": "^5.2.15", + "@cspell/dict-npm": "^5.2.18", "@cspell/dict-php": "^4.0.15", "@cspell/dict-powershell": "^5.0.15", "@cspell/dict-public-licenses": "^2.0.15", - "@cspell/dict-python": "^4.2.19", + "@cspell/dict-python": "^4.2.20", "@cspell/dict-r": "^2.1.1", "@cspell/dict-ruby": "^5.0.9", "@cspell/dict-rust": "^4.0.12", "@cspell/dict-scala": "^5.0.8", "@cspell/dict-shell": "^1.1.1", - "@cspell/dict-software-terms": "^5.1.7", + "@cspell/dict-software-terms": "^5.1.9", "@cspell/dict-sql": "^2.2.1", "@cspell/dict-svelte": "^1.0.7", "@cspell/dict-swift": "^2.0.6", @@ -80,30 +80,30 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.2.1.tgz", - "integrity": "sha512-LiiIWzLP9h2etKn0ap6g2+HrgOGcFEF/hp5D8ytmSL5sMxDcV13RrmJCEMTh1axGyW0SjQEFjPnYzNpCL1JjGA==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.2.2.tgz", + "integrity": "sha512-7nTqnnRCyQB+bTmIuBR4aRwV5JHymckmz1snCF+ItjDSvlc3qzjxldG8ao5zm34h+b/8YCvdMU9B92eHBt803w==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.2.1" + "@cspell/cspell-types": "9.2.2" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-pipe": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.2.1.tgz", - "integrity": "sha512-2N1H63If5cezLqKToY/YSXon4m4REg/CVTFZr040wlHRbbQMh5EF3c7tEC/ue3iKAQR4sm52ihfqo1n4X6kz+g==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.2.2.tgz", + "integrity": "sha512-YOdbp1uoKMkYy92qxMjoOxcqcR6LEVDus+72C4X9L8eJ2b+CBO3VaVqU16Y7OQGjYMnukYgB6eyTh8YFo9uBRw==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.2.1.tgz", - "integrity": "sha512-fRPQ6GWU5eyh8LN1TZblc7t24TlGhJprdjJkfZ+HjQo+6ivdeBPT7pC7pew6vuMBQPS1oHBR36hE0ZnJqqkCeg==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.2.2.tgz", + "integrity": "sha512-5tST2xoU8xbXihr1bdQ6pfcScQ3PkFpKKhFGClVfqS0yf/CKYURqzJlRDVjrFZsl+PT6tw/Jdt0E9Wwp1X1Qgw==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" @@ -113,18 +113,18 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.2.1.tgz", - "integrity": "sha512-k4M6bqdvWbcGSbcfLD7Lf4coZVObsISDW+sm/VaWp9aZ7/uwiz1IuGUxL9WO4JIdr9CFEf7Ivmvd2txZpVOCIA==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.2.2.tgz", + "integrity": "sha512-AxJuw/YPJkz1Ali5mA+OW9y4JiJzb2U7H4pGYq0nRB/mWwI/xtFjuWVkI+BhwrA2P6hHdifu0JdxSLqW4IYpPQ==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.2.1.tgz", - "integrity": "sha512-FQHgQYdTHkcpxT0u1ddLIg5Cc5ePVDcLg9+b5Wgaubmc5I0tLotgYj8c/mvStWuKsuZIs6sUopjJrE91wk6Onw==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.2.2.tgz", + "integrity": "sha512-/1dRFQ3sEY9Yo+f3w0A8MFJ0BOapQc1uFjlMF19c3uoD/e4PpNLpL1qXY4FeLWKDk1D9VT8SL93J+lIwEi5bvg==", "license": "MIT", "engines": { "node": ">=20" @@ -149,24 +149,24 @@ "license": "MIT" }, "node_modules/@cspell/dict-bash": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.2.1.tgz", - "integrity": "sha512-SBnzfAyEAZLI9KFS7DUG6Xc1vDFuLllY3jz0WHvmxe8/4xV3ufFE3fGxalTikc1VVeZgZmxYiABw4iGxVldYEg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.2.2.tgz", + "integrity": "sha512-kyWbwtX3TsCf5l49gGQIZkRLaB/P8g73GDRm41Zu8Mv51kjl2H7Au0TsEvHv7jzcsRLS6aUYaZv6Zsvk1fOz+Q==", "license": "MIT", "dependencies": { - "@cspell/dict-shell": "1.1.1" + "@cspell/dict-shell": "1.1.2" } }, "node_modules/@cspell/dict-companies": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.2.5.tgz", - "integrity": "sha512-H51R0w7c6RwJJPqH7Gs65tzP6ouZsYDEHmmol6MIIk0kQaOIBuFP2B3vIxHLUr2EPRVFZsMW8Ni7NmVyaQlwsg==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.2.7.tgz", + "integrity": "sha512-fEyr3LmpFKTaD0LcRhB4lfW1AmULYBqzg4gWAV0dQCv06l+TsA+JQ+3pZJbUcoaZirtgsgT3dL3RUjmGPhUH0A==", "license": "MIT" }, "node_modules/@cspell/dict-cpp": { - "version": "6.0.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.12.tgz", - "integrity": "sha512-N4NsCTttVpMqQEYbf0VQwCj6np+pJESov0WieCN7R/0aByz4+MXEiDieWWisaiVi8LbKzs1mEj4ZTw5K/6O2UQ==", + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.13.tgz", + "integrity": "sha512-EFrhN/91tPwadI9m8Rxe65//9gqv+lpZoKtrngzF4DTnw4YAfMLTpykendHps0bz46NZW84/zoY1cxeW2TEPQQ==", "license": "MIT" }, "node_modules/@cspell/dict-cryptocurrencies": { @@ -194,9 +194,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-data-science": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.9.tgz", - "integrity": "sha512-wTOFMlxv06veIwKdXUwdGxrQcK44Zqs426m6JGgHIB/GqvieZQC5n0UI+tUm5OCxuNyo4OV6mylT4cRMjtKtWQ==", + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.11.tgz", + "integrity": "sha512-Dt+83nVCcF+dQyvFSaZjCKt1H5KbsVJFtH2X7VUfmIzQu8xCnV1fUmkhBzGJ+NiFs99Oy9JA6I9EjeqExzXk7g==", "license": "MIT" }, "node_modules/@cspell/dict-django": { @@ -224,27 +224,27 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.4.18", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.18.tgz", - "integrity": "sha512-6Le961Q0AIfVp3nKuSJJD/9NfnTYA1N/MLAaeWKCABEvhzhopeyGrykwejd0SA4m64WBUNEfSlsgselYWoDSjQ==", + "version": "4.4.22", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.22.tgz", + "integrity": "sha512-i9AJ6z5kyZU5L/b+UOOp/7dfa7RxhibLXWaexSJclf7V7R+TzwCTLoOZd1wf/5PBnNGkP8xOSaflkpUbtVijFA==", "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.5.tgz", - "integrity": "sha512-hlRDSjul7wGTDXeLBADoyTGIZjWWZn6/SP+pt0lG3PRtqF0MWH/QEDgUkS+Yev7ZhHCHVLvwBZtDxOd1uw06Tw==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.7.tgz", + "integrity": "sha512-HAWSOoQ+lxdzLaTALhPofKNJdxZ7HAcTZWQNwb7cvGBiKEy182cb96U35602yBPrBsKY/vLxVs6f0E1JTeQjRQ==", "license": "CC BY-SA 4.0" }, "node_modules/@cspell/dict-en-gb-mit": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.8.tgz", - "integrity": "sha512-wrZDRl6TKd1wReepGDPuT1JNbnRjHLvtAVrozp0DUkFlcDgnrB+YSd/Ne4aKnkXl5qpyVQ2GG7a4Z7INKCX+fw==", + "version": "3.1.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.12.tgz", + "integrity": "sha512-KJaJPsTRMXN4sgKHQRMNqqxc7WWZaR5h7+WarIoLUfbEWIQM1FCJiGn2pZX9OLQVBtSnLYo1JVXK1K/Tz3HWEQ==", "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.13.tgz", - "integrity": "sha512-g6rnytIpQlMNKGJT1JKzWkC+b3xCliDKpQ3ANFSq++MnR4GaLiifaC4JkVON11Oh/UTplYOR1nY3BR4X30bswA==", + "version": "3.0.14", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.14.tgz", + "integrity": "sha512-KSXaSMYYNMLLdHEnju1DyRRH3eQWPRYRnOXpuHUdOh2jC44VgQoxyMU7oB3NAhDhZKBPCihabzECsAGFbdKfEA==", "license": "MIT" }, "node_modules/@cspell/dict-flutter": { @@ -284,9 +284,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-golang": { - "version": "6.0.23", - "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.23.tgz", - "integrity": "sha512-oXqUh/9dDwcmVlfUF5bn3fYFqbUzC46lXFQmi5emB0vYsyQXdNWsqi6/yH3uE7bdRE21nP7Yo0mR1jjFNyLamg==", + "version": "6.0.24", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.24.tgz", + "integrity": "sha512-rY7PlC3MsHozmjrZWi0HQPUl0BVCV0+mwK0rnMT7pOIXqOe4tWCYMULDIsEk4F0gbIxb5badd2dkCPDYjLnDgA==", "license": "MIT" }, "node_modules/@cspell/dict-google": { @@ -386,15 +386,15 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.15", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.15.tgz", - "integrity": "sha512-kb9oX/N5FUlJYoqc5G+tIP/0SolteFMz2VhOVKG2qiXUS/1AybVTjUEo4gZ4uEveUhLzUDcfpZbn40EoUVBVrg==", + "version": "5.2.19", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.19.tgz", + "integrity": "sha512-fg23oFvKTsGjGB6DkwCUzZrLZPwp+ItSV0UXS+n6JbcH5dj3CP6MDmdwNX6s6oaAovIFKmwFBP73GUqnjMmnpQ==", "license": "MIT" }, "node_modules/@cspell/dict-php": { - "version": "4.0.15", - "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.15.tgz", - "integrity": "sha512-iepGB2gtToMWSTvybesn4/lUp4LwXcEm0s8vasJLP76WWVkq1zYjmeS+WAIzNgsuURyZ/9mGqhS0CWMuo74ODw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.1.0.tgz", + "integrity": "sha512-dTDeabyOj7eFvn2Q4Za3uVXM2+SzeFMqX8ly2P0XTo4AzbCmI2hulFD/QIADwWmwiRrInbbf8cxwFHNIYrXl4w==", "license": "MIT" }, "node_modules/@cspell/dict-powershell": { @@ -410,12 +410,12 @@ "license": "MIT" }, "node_modules/@cspell/dict-python": { - "version": "4.2.19", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.19.tgz", - "integrity": "sha512-9S2gTlgILp1eb6OJcVZeC8/Od83N8EqBSg5WHVpx97eMMJhifOzePkE0kDYjyHMtAFznCQTUu0iQEJohNQ5B0A==", + "version": "4.2.21", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.21.tgz", + "integrity": "sha512-M9OgwXWhpZqEZqKU2psB2DFsT8q5SwEahkQeIpNIRWIErjwG7I9yYhhfvPz6s5gMCMhhb3hqcPJTnmdgqGrQyg==", "license": "MIT", "dependencies": { - "@cspell/dict-data-science": "^2.0.9" + "@cspell/dict-data-science": "^2.0.11" } }, "node_modules/@cspell/dict-r": { @@ -443,15 +443,15 @@ "license": "MIT" }, "node_modules/@cspell/dict-shell": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-shell/-/dict-shell-1.1.1.tgz", - "integrity": "sha512-T37oYxE7OV1x/1D4/13Y8JZGa1QgDCXV7AVt3HLXjn0Fe3TaNDvf5sU0fGnXKmBPqFFrHdpD3uutAQb1dlp15g==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-shell/-/dict-shell-1.1.2.tgz", + "integrity": "sha512-WqOUvnwcHK1X61wAfwyXq04cn7KYyskg90j4lLg3sGGKMW9Sq13hs91pqrjC44Q+lQLgCobrTkMDw9Wyl9nRFA==", "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.1.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.7.tgz", - "integrity": "sha512-CfNFQCVx8R/D8RfFdFTwSjDvXcSXY0tO+VN2N6TEbNTL1GCmqyzhwm4YI+ZbO3MUmMAMjwu9jZyoLk5BaJkXcg==", + "version": "5.1.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.10.tgz", + "integrity": "sha512-ffnsKiDL5acUerJ/lDiIT0y/tfO9Jk1yp8RpAl0diOUj5iQuT4hXVfgQSx7ppseXWAGN+UgTRYWiKDb1zM3lqg==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -491,12 +491,12 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.2.1.tgz", - "integrity": "sha512-izYQbk7ck0ffNA1gf7Gi3PkUEjj+crbYeyNK1hxHx5A+GuR416ozs0aEyp995KI2v9HZlXscOj3SC3wrWzHZeA==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.2.2.tgz", + "integrity": "sha512-RHQLp0iYcWuK0MGiUBA6dgEOCdI29kZTiBRVcJM/Pzvhvs8j9pzBTkMesZAJ7XOSFz2kU+skRMBsFd774dmYTA==", "license": "MIT", "dependencies": { - "@cspell/url": "9.2.1", + "@cspell/url": "9.2.2", "import-meta-resolve": "^4.2.0" }, "engines": { @@ -504,27 +504,27 @@ } }, "node_modules/@cspell/filetypes": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.2.1.tgz", - "integrity": "sha512-Dy1y1pQ+7hi2gPs+jERczVkACtYbUHcLodXDrzpipoxgOtVxMcyZuo+84WYHImfu0gtM0wU2uLObaVgMSTnytw==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.2.2.tgz", + "integrity": "sha512-oM+cqipbZ4PNxQcKP9sKOeRKBG+oM3NKO3To1FyxYxvnUG7DukW2yH6BS0/GUY7qK+oSftuq5d6DXEAl9wzbEQ==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/strong-weak-map": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.2.1.tgz", - "integrity": "sha512-1HsQWZexvJSjDocVnbeAWjjgqWE/0op/txxzDPvDqI2sE6pY0oO4Cinj2I8z+IP+m6/E6yjPxdb23ydbQbPpJQ==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.2.2.tgz", + "integrity": "sha512-Z7rd7NwHaoH/d/Ds97Rv042WS9PgpVdqgO2X0ehYZmgj2E0LIq2MTkIJMheUrSn37D0PW/suroKh6hN15pJtpQ==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.2.1.tgz", - "integrity": "sha512-9EHCoGKtisPNsEdBQ28tKxKeBmiVS3D4j+AN8Yjr+Dmtu+YACKGWiMOddNZG2VejQNIdFx7FwzU00BGX68ELhA==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.2.2.tgz", + "integrity": "sha512-gvLprhrArvLP/rnC8b766dA80EXwBbzXqb9tNDRk1esQV7d3uS1Ftk1970MRlAfLg1pG6V+3C4UrB6WOB/rMCQ==", "license": "MIT", "engines": { "node": ">=20" @@ -546,9 +546,9 @@ } }, "node_modules/chalk": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.0.tgz", - "integrity": "sha512-46QrSQFyVSEyYAgQ22hQ+zDa60YHA4fBstHmtSApj1Y5vKtG27fWowW03jCk5KcbXEWPZUIR894aARCA/G1kfQ==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", "license": "MIT", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" @@ -558,9 +558,9 @@ } }, "node_modules/chalk-template": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-1.1.0.tgz", - "integrity": "sha512-T2VJbcDuZQ0Tb2EWwSotMPJjgpy1/tGee1BTpUNsGZ/qgNjV2t7Mvu+d4600U564nbLesN1x2dPL+xii174Ekg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-1.1.2.tgz", + "integrity": "sha512-2bxTP2yUH7AJj/VAXfcA+4IcWGdQ87HwBANLt5XxGTeomo8yG0y95N1um9i5StvhT/Bl0/2cARA5v1PpPXUxUA==", "license": "MIT", "dependencies": { "chalk": "^5.2.0" @@ -589,25 +589,23 @@ } }, "node_modules/commander": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.0.tgz", - "integrity": "sha512-2uM9rYjPvyq39NwLRqaiLtWHyDC1FvryJDa2ATTVims5YAS4PupsEQsDvP14FqhFr0P49CYDugi59xaxJlTXRA==", + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.2.tgz", + "integrity": "sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/comment-json": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.5.tgz", - "integrity": "sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.4.1.tgz", + "integrity": "sha512-r1To31BQD5060QdkC+Iheai7gHwoSZobzunqkf2/kQ6xIAfJyrKNAFUwdKvkK7Qgu7pVTKQEa7ok7Ed3ycAJgg==", "license": "MIT", "dependencies": { "array-timsort": "^1.0.3", "core-util-is": "^1.0.3", - "esprima": "^4.0.1", - "has-own-prop": "^2.0.0", - "repeat-string": "^1.6.1" + "esprima": "^4.0.1" }, "engines": { "node": ">= 6" @@ -620,29 +618,29 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.2.1.tgz", - "integrity": "sha512-PoKGKE9Tl87Sn/jwO4jvH7nTqe5Xrsz2DeJT5CkulY7SoL2fmsAqfbImQOFS2S0s36qD98t6VO+Ig2elEEcHew==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.2.2.tgz", + "integrity": "sha512-D9jxXlYWIxUw4IjicxrmK83n5BzuQVZaIhsDsfRiH7iP4F71gDtKR9b+UgmXevvseN7OH4LkdyaPKzjNliGAbg==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "9.2.1", - "@cspell/cspell-pipe": "9.2.1", - "@cspell/cspell-types": "9.2.1", - "@cspell/dynamic-import": "9.2.1", - "@cspell/url": "9.2.1", - "chalk": "^5.6.0", - "chalk-template": "^1.1.0", - "commander": "^14.0.0", - "cspell-config-lib": "9.2.1", - "cspell-dictionary": "9.2.1", - "cspell-gitignore": "9.2.1", - "cspell-glob": "9.2.1", - "cspell-io": "9.2.1", - "cspell-lib": "9.2.1", + "@cspell/cspell-json-reporter": "9.2.2", + "@cspell/cspell-pipe": "9.2.2", + "@cspell/cspell-types": "9.2.2", + "@cspell/dynamic-import": "9.2.2", + "@cspell/url": "9.2.2", + "chalk": "^5.6.2", + "chalk-template": "^1.1.2", + "commander": "^14.0.1", + "cspell-config-lib": "9.2.2", + "cspell-dictionary": "9.2.2", + "cspell-gitignore": "9.2.2", + "cspell-glob": "9.2.2", + "cspell-io": "9.2.2", + "cspell-lib": "9.2.2", "fast-json-stable-stringify": "^2.1.0", "flatted": "^3.3.3", - "semver": "^7.7.2", - "tinyglobby": "^0.2.14" + "semver": "^7.7.3", + "tinyglobby": "^0.2.15" }, "bin": { "cspell": "bin.mjs", @@ -656,13 +654,13 @@ } }, "node_modules/cspell-config-lib": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.2.1.tgz", - "integrity": "sha512-qqhaWW+0Ilc7493lXAlXjziCyeEmQbmPMc1XSJw2EWZmzb+hDvLdFGHoX18QU67yzBtu5hgQsJDEDZKvVDTsRA==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.2.2.tgz", + "integrity": "sha512-Fp3jdFxb5gxcQP146TfNVmDqXKfm3xmcEUr1K829DmAFwhc7s+/pCRjhBPoGfQt6U7ugpxjkSx2gGKSbLhp7Mg==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.2.1", - "comment-json": "^4.2.5", + "@cspell/cspell-types": "9.2.2", + "comment-json": "^4.4.1", "smol-toml": "^1.4.2", "yaml": "^2.8.1" }, @@ -671,29 +669,29 @@ } }, "node_modules/cspell-dictionary": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.2.1.tgz", - "integrity": "sha512-0hQVFySPsoJ0fONmDPwCWGSG6SGj4ERolWdx4t42fzg5zMs+VYGXpQW4BJneQ5Tfxy98Wx8kPhmh/9E8uYzLTw==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.2.2.tgz", + "integrity": "sha512-lnoCFoCAaiFJi+Hz22t+tdTj76jyTA76EYFKhmf/dbj5UO6kVy8by08uFfUbbMaC9Oi09YHnI62P/e+LBx1v8Q==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.2.1", - "@cspell/cspell-types": "9.2.1", - "cspell-trie-lib": "9.2.1", - "fast-equals": "^5.2.2" + "@cspell/cspell-pipe": "9.2.2", + "@cspell/cspell-types": "9.2.2", + "cspell-trie-lib": "9.2.2", + "fast-equals": "^5.3.2" }, "engines": { "node": ">=20" } }, "node_modules/cspell-gitignore": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.2.1.tgz", - "integrity": "sha512-WPnDh03gXZoSqVyXq4L7t9ljx6lTDvkiSRUudb125egEK5e9s04csrQpLI3Yxcnc1wQA2nzDr5rX9XQVvCHf7g==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.2.2.tgz", + "integrity": "sha512-Idx3IVKTpnGoyRlkj8F/lSWtWiJpqLhXmZglTzfGWxzbik8E0aQmSyT3blbNWhZL/K1JqlTjbSiAICVMoWTkhA==", "license": "MIT", "dependencies": { - "@cspell/url": "9.2.1", - "cspell-glob": "9.2.1", - "cspell-io": "9.2.1" + "@cspell/url": "9.2.2", + "cspell-glob": "9.2.2", + "cspell-io": "9.2.2" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -703,12 +701,12 @@ } }, "node_modules/cspell-glob": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.2.1.tgz", - "integrity": "sha512-CrT/6ld3rXhB36yWFjrx1SrMQzwDrGOLr+wYEnrWI719/LTYWWCiMFW7H+qhsJDTsR+ku8+OAmfRNBDXvh9mnQ==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.2.2.tgz", + "integrity": "sha512-6mhUk4iLu5YzY9PE86ZyAjNFjM7TD8Oh4btJ7ZV+edzJjdVjFugXWyefPXCGNfuvpaJqpuoLDwMvNHJxUmLwbg==", "license": "MIT", "dependencies": { - "@cspell/url": "9.2.1", + "@cspell/url": "9.2.2", "picomatch": "^4.0.3" }, "engines": { @@ -716,13 +714,13 @@ } }, "node_modules/cspell-grammar": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.2.1.tgz", - "integrity": "sha512-10RGFG7ZTQPdwyW2vJyfmC1t8813y8QYRlVZ8jRHWzer9NV8QWrGnL83F+gTPXiKR/lqiW8WHmFlXR4/YMV+JQ==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.2.2.tgz", + "integrity": "sha512-m0aozo5gjZYL5Vm3/9D0/yLZJTsVJAP8VeRVljN4u5T7w+WY+LsnvKSZhnkOvsT3kCJDhcKEkMVkCo8d/7EcAQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.2.1", - "@cspell/cspell-types": "9.2.1" + "@cspell/cspell-pipe": "9.2.2", + "@cspell/cspell-types": "9.2.2" }, "bin": { "cspell-grammar": "bin.mjs" @@ -732,42 +730,40 @@ } }, "node_modules/cspell-io": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.2.1.tgz", - "integrity": "sha512-v9uWXtRzB+RF/Mzg5qMzpb8/yt+1bwtTt2rZftkLDLrx5ybVvy6rhRQK05gFWHmWVtWEe0P/pIxaG2Vz92C8Ag==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.2.2.tgz", + "integrity": "sha512-Rpky4woeB6/1VUCk7DtRm94A6c5XRbhcj5dUZh851EpZ0ItEz3S9+MhkX8g1sTVkDg6Hln1pu+Nbm9dFIpGkGA==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "9.2.1", - "@cspell/url": "9.2.1" + "@cspell/cspell-service-bus": "9.2.2", + "@cspell/url": "9.2.2" }, "engines": { "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.2.1.tgz", - "integrity": "sha512-KeB6NHcO0g1knWa7sIuDippC3gian0rC48cvO0B0B0QwhOxNxWVp8cSmkycXjk4ijBZNa++IwFjeK/iEqMdahQ==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.2.2.tgz", + "integrity": "sha512-ksy+5vCSZz7ECUDlLA8ZGNEcWmnzl5bMe4IEPHAMaPFY3iWNsG7dXBrae1dj/b/3HqVqOdXPdwjnGAyZciissg==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.2.1", - "@cspell/cspell-pipe": "9.2.1", - "@cspell/cspell-resolver": "9.2.1", - "@cspell/cspell-types": "9.2.1", - "@cspell/dynamic-import": "9.2.1", - "@cspell/filetypes": "9.2.1", - "@cspell/strong-weak-map": "9.2.1", - "@cspell/url": "9.2.1", + "@cspell/cspell-bundled-dicts": "9.2.2", + "@cspell/cspell-pipe": "9.2.2", + "@cspell/cspell-resolver": "9.2.2", + "@cspell/cspell-types": "9.2.2", + "@cspell/dynamic-import": "9.2.2", + "@cspell/filetypes": "9.2.2", + "@cspell/strong-weak-map": "9.2.2", + "@cspell/url": "9.2.2", "clear-module": "^4.1.2", - "comment-json": "^4.2.5", - "cspell-config-lib": "9.2.1", - "cspell-dictionary": "9.2.1", - "cspell-glob": "9.2.1", - "cspell-grammar": "9.2.1", - "cspell-io": "9.2.1", - "cspell-trie-lib": "9.2.1", + "cspell-config-lib": "9.2.2", + "cspell-dictionary": "9.2.2", + "cspell-glob": "9.2.2", + "cspell-grammar": "9.2.2", + "cspell-io": "9.2.2", + "cspell-trie-lib": "9.2.2", "env-paths": "^3.0.0", - "fast-equals": "^5.2.2", "gensequence": "^7.0.0", "import-fresh": "^3.3.1", "resolve-from": "^5.0.0", @@ -780,13 +776,13 @@ } }, "node_modules/cspell-trie-lib": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.2.1.tgz", - "integrity": "sha512-qOtbL+/tUzGFHH0Uq2wi7sdB9iTy66QNx85P7DKeRdX9ZH53uQd7qC4nEk+/JPclx1EgXX26svxr0jTGISJhLw==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.2.2.tgz", + "integrity": "sha512-84L0Or6xkfnDMmxx2BtuaqsM4LOVCgnG4ZzMMgwQJU+9nSOAHs0ULNWQTHLbsCF+FFG/siILpUkIc3z+UxjGFw==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.2.1", - "@cspell/cspell-types": "9.2.1", + "@cspell/cspell-pipe": "9.2.2", + "@cspell/cspell-types": "9.2.2", "gensequence": "^7.0.0" }, "engines": { @@ -819,9 +815,9 @@ } }, "node_modules/fast-equals": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.2.2.tgz", - "integrity": "sha512-V7/RktU11J3I36Nwq2JnZEM7tNm17eBJz+u25qdxBZeCKiX6BkVSZQjwWIr+IobgnZy+ag73tTZgZi7tr0LrBw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.3.2.tgz", + "integrity": "sha512-6rxyATwPCkaFIL3JLqw8qXqMpIZ942pTX/tbQFkRsDGblS8tNGtlUauA/+mt6RUfqn/4MoEr+WDkYoIQbibWuQ==", "license": "MIT", "engines": { "node": ">=6.0.0" @@ -834,10 +830,13 @@ "license": "MIT" }, "node_modules/fdir": { - "version": "6.4.6", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.6.tgz", - "integrity": "sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, "peerDependencies": { "picomatch": "^3 || ^4" }, @@ -877,15 +876,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/has-own-prop": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", - "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/import-fresh": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", @@ -966,15 +956,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", - "license": "MIT", - "engines": { - "node": ">=0.10" - } - }, "node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -985,9 +966,9 @@ } }, "node_modules/semver": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", - "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -1009,13 +990,13 @@ } }, "node_modules/tinyglobby": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", - "integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==", + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", "license": "MIT", "dependencies": { - "fdir": "^6.4.4", - "picomatch": "^4.0.2" + "fdir": "^6.5.0", + "picomatch": "^4.0.3" }, "engines": { "node": ">=12.0.0" diff --git a/package.json b/package.json index 81df088113..eeee52a0cc 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.2.1" + "cspell": "^9.2.2" } } From 2ff081c54077aa5e58fe944dca44edb2b453af2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 16:09:57 +0000 Subject: [PATCH 713/845] Bump actions/upload-artifact from 4 to 5 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1873aa83e1..c39b5b3852 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,7 +51,7 @@ jobs: - name: Upload artifacts if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: windows-artifacts path: | @@ -84,7 +84,7 @@ jobs: - name: Upload artifacts if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: ${{ runner.os }}-artifacts path: | From 889bc886660fba0bfc043cc503bfffa1dd3b02af Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 8 Nov 2025 20:05:37 +0100 Subject: [PATCH 714/845] Add NuGet package attestations using GitHub provenance (#3119) --- .github/workflows/build.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c39b5b3852..fc0dad7b18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,11 @@ jobs: name: "Build, Test, Analyze and Publish" runs-on: windows-latest + permissions: + id-token: write + attestations: write + contents: read + env: DOTNET_NOLOGO: true @@ -49,6 +54,19 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} file: TestResults/reports/lcov.info + - name: Check for NuGet package existence + id: check_nupkg + if: startsWith(github.ref, 'refs/tags/') + uses: andstor/file-existence-action@v3 + with: + files: "Artifacts/*.nupkg" + + - name: Attest NuGet package + uses: actions/attest-build-provenance@v2 + if: startsWith(github.ref, 'refs/tags/') && steps.check_nupkg.outputs.files_exists == 'true' + with: + subject-path: ./Artifacts/*.nupkg + - name: Upload artifacts if: always() uses: actions/upload-artifact@v5 From 2c1c0ce0f4070931220d81a8d93e712cffc772e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 16:31:40 +0000 Subject: [PATCH 715/845] Bump cspell from 9.2.2 to 9.3.0 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 9.2.2 to 9.3.0. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.3.0/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 262 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 132 insertions(+), 132 deletions(-) diff --git a/package-lock.json b/package-lock.json index 39e6c7024b..9a3f7b312b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,33 +7,33 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.2.2" + "cspell": "^9.3.0" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.2.2.tgz", - "integrity": "sha512-W3FKgb89DwMuQEVWz0dPH9uZqC8w+ylpbtmXuevflw3SLtGPyllMvf/1T6tcqIkg3KEWoRYFxjpJWyoOjJkZGw==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.3.0.tgz", + "integrity": "sha512-rf5SAdg1EmgCBIo/zFEAIjydlO+VtVLR6oUVeD4rIE7zIPrPdJb0OMUGsxfOH7uePyhcfIxPYTjneQla0e5Ljw==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.1", "@cspell/dict-al": "^1.1.1", "@cspell/dict-aws": "^4.0.15", - "@cspell/dict-bash": "^4.2.1", - "@cspell/dict-companies": "^3.2.6", - "@cspell/dict-cpp": "^6.0.12", + "@cspell/dict-bash": "^4.2.2", + "@cspell/dict-companies": "^3.2.7", + "@cspell/dict-cpp": "^6.0.14", "@cspell/dict-cryptocurrencies": "^5.0.5", "@cspell/dict-csharp": "^4.0.7", "@cspell/dict-css": "^4.0.18", "@cspell/dict-dart": "^2.3.1", - "@cspell/dict-data-science": "^2.0.10", + "@cspell/dict-data-science": "^2.0.11", "@cspell/dict-django": "^4.1.5", "@cspell/dict-docker": "^1.1.16", "@cspell/dict-dotnet": "^5.0.10", "@cspell/dict-elixir": "^4.0.8", - "@cspell/dict-en_us": "^4.4.20", - "@cspell/dict-en-common-misspellings": "^2.1.6", - "@cspell/dict-en-gb-mit": "^3.1.10", + "@cspell/dict-en_us": "^4.4.24", + "@cspell/dict-en-common-misspellings": "^2.1.8", + "@cspell/dict-en-gb-mit": "^3.1.14", "@cspell/dict-filetypes": "^3.0.14", "@cspell/dict-flutter": "^1.1.1", "@cspell/dict-fonts": "^4.0.5", @@ -41,7 +41,7 @@ "@cspell/dict-fullstack": "^3.2.7", "@cspell/dict-gaming-terms": "^1.1.2", "@cspell/dict-git": "^3.0.7", - "@cspell/dict-golang": "^6.0.23", + "@cspell/dict-golang": "^6.0.24", "@cspell/dict-google": "^1.0.9", "@cspell/dict-haskell": "^4.0.6", "@cspell/dict-html": "^4.0.12", @@ -57,17 +57,17 @@ "@cspell/dict-markdown": "^2.0.12", "@cspell/dict-monkeyc": "^1.0.11", "@cspell/dict-node": "^5.0.8", - "@cspell/dict-npm": "^5.2.18", - "@cspell/dict-php": "^4.0.15", + "@cspell/dict-npm": "^5.2.20", + "@cspell/dict-php": "^4.1.0", "@cspell/dict-powershell": "^5.0.15", "@cspell/dict-public-licenses": "^2.0.15", - "@cspell/dict-python": "^4.2.20", + "@cspell/dict-python": "^4.2.21", "@cspell/dict-r": "^2.1.1", "@cspell/dict-ruby": "^5.0.9", "@cspell/dict-rust": "^4.0.12", "@cspell/dict-scala": "^5.0.8", - "@cspell/dict-shell": "^1.1.1", - "@cspell/dict-software-terms": "^5.1.9", + "@cspell/dict-shell": "^1.1.2", + "@cspell/dict-software-terms": "^5.1.11", "@cspell/dict-sql": "^2.2.1", "@cspell/dict-svelte": "^1.0.7", "@cspell/dict-swift": "^2.0.6", @@ -80,30 +80,30 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.2.2.tgz", - "integrity": "sha512-7nTqnnRCyQB+bTmIuBR4aRwV5JHymckmz1snCF+ItjDSvlc3qzjxldG8ao5zm34h+b/8YCvdMU9B92eHBt803w==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.3.0.tgz", + "integrity": "sha512-bvpLNS73/SN3969ksipVSYDdMYsxYZqeBDkcA2yKJZ9eHRY/tHUbjTTIvyvlCLODzUiop2RFGrvDPcjyam/FoQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.2.2" + "@cspell/cspell-types": "9.3.0" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-pipe": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.2.2.tgz", - "integrity": "sha512-YOdbp1uoKMkYy92qxMjoOxcqcR6LEVDus+72C4X9L8eJ2b+CBO3VaVqU16Y7OQGjYMnukYgB6eyTh8YFo9uBRw==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.3.0.tgz", + "integrity": "sha512-LEl2TYvXnGk/D+Vjq5DBsNQuLsmn3/2QV9dxteK5e323pJRcpEosq76elzsYpVLuB3s1hp2pFQhppWk69Gx2CQ==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.2.2.tgz", - "integrity": "sha512-5tST2xoU8xbXihr1bdQ6pfcScQ3PkFpKKhFGClVfqS0yf/CKYURqzJlRDVjrFZsl+PT6tw/Jdt0E9Wwp1X1Qgw==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.3.0.tgz", + "integrity": "sha512-AOIC6xV2XuEWKy/K/CUBHQ7caavDnjb2zflP25j7fGMWpS/GIGKLPjgGQUHFbgNSSy9UY2ZGV7MVCsnD7moW5Q==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" @@ -113,18 +113,18 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.2.2.tgz", - "integrity": "sha512-AxJuw/YPJkz1Ali5mA+OW9y4JiJzb2U7H4pGYq0nRB/mWwI/xtFjuWVkI+BhwrA2P6hHdifu0JdxSLqW4IYpPQ==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.3.0.tgz", + "integrity": "sha512-e9ZfG1VJ/kbzh2LBW/TJImEWcEUuBMYSDnIYbQCsclKAWyF3g8eLGxoX7xDbZ82USo4IU2tqYmrDvPcUD8CHxg==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.2.2.tgz", - "integrity": "sha512-/1dRFQ3sEY9Yo+f3w0A8MFJ0BOapQc1uFjlMF19c3uoD/e4PpNLpL1qXY4FeLWKDk1D9VT8SL93J+lIwEi5bvg==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.3.0.tgz", + "integrity": "sha512-WN3R4nqQ7BEgS8UEoPIwNBRuSFT/8GImqXmlx7EHmzBAhevWjF3IDF+OEtokRJ95qik6a4xqJJTJgi624UxDFg==", "license": "MIT", "engines": { "node": ">=20" @@ -164,9 +164,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-cpp": { - "version": "6.0.13", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.13.tgz", - "integrity": "sha512-EFrhN/91tPwadI9m8Rxe65//9gqv+lpZoKtrngzF4DTnw4YAfMLTpykendHps0bz46NZW84/zoY1cxeW2TEPQQ==", + "version": "6.0.14", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.14.tgz", + "integrity": "sha512-dkmpSwvVfVdtoZ4mW/CK2Ep1v8mJlp6uiKpMNbSMOdJl4kq28nQS4vKNIX3B2bJa0Ha5iHHu+1mNjiLeO3g7Xg==", "license": "MIT" }, "node_modules/@cspell/dict-cryptocurrencies": { @@ -224,21 +224,21 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.4.22", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.22.tgz", - "integrity": "sha512-i9AJ6z5kyZU5L/b+UOOp/7dfa7RxhibLXWaexSJclf7V7R+TzwCTLoOZd1wf/5PBnNGkP8xOSaflkpUbtVijFA==", + "version": "4.4.24", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.24.tgz", + "integrity": "sha512-JE+/H2YicHJTneRmgH4GSI21rS+1yGZVl1jfOQgl8iHLC+yTTMtCvueNDMK94CgJACzYAoCsQB70MqiFJJfjLQ==", "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.7.tgz", - "integrity": "sha512-HAWSOoQ+lxdzLaTALhPofKNJdxZ7HAcTZWQNwb7cvGBiKEy182cb96U35602yBPrBsKY/vLxVs6f0E1JTeQjRQ==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.8.tgz", + "integrity": "sha512-vDsjRFPQGuAADAiitf82z9Mz3DcqKZi6V5hPAEIFkLLKjFVBcjUsSq59SfL59ElIFb76MtBO0BLifdEbBj+DoQ==", "license": "CC BY-SA 4.0" }, "node_modules/@cspell/dict-en-gb-mit": { - "version": "3.1.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.12.tgz", - "integrity": "sha512-KJaJPsTRMXN4sgKHQRMNqqxc7WWZaR5h7+WarIoLUfbEWIQM1FCJiGn2pZX9OLQVBtSnLYo1JVXK1K/Tz3HWEQ==", + "version": "3.1.14", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.14.tgz", + "integrity": "sha512-b+vEerlHP6rnNf30tmTJb7JZnOq4WAslYUvexOz/L3gDna9YJN3bAnwRJ3At3bdcOcMG7PTv3Pi+C73IR22lNg==", "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { @@ -386,9 +386,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.19", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.19.tgz", - "integrity": "sha512-fg23oFvKTsGjGB6DkwCUzZrLZPwp+ItSV0UXS+n6JbcH5dj3CP6MDmdwNX6s6oaAovIFKmwFBP73GUqnjMmnpQ==", + "version": "5.2.20", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.20.tgz", + "integrity": "sha512-tJRv1qEdW3f8fxK/D2huoqkSvM6ogz55hAt9RTdB7tZy57wio9Tkj+xfi2DIeOlmf6e94c6pNPZIC/o5rclMhw==", "license": "MIT" }, "node_modules/@cspell/dict-php": { @@ -449,9 +449,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.1.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.10.tgz", - "integrity": "sha512-ffnsKiDL5acUerJ/lDiIT0y/tfO9Jk1yp8RpAl0diOUj5iQuT4hXVfgQSx7ppseXWAGN+UgTRYWiKDb1zM3lqg==", + "version": "5.1.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.11.tgz", + "integrity": "sha512-xwARdlp6o81BK7uNl4qR5CmLBXuc9xWyEeEwzeAw/8SkBdYheVQO6F1Fey2iqMRDT9LAb5Znbg83pJVpLjgBjg==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -491,12 +491,12 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.2.2.tgz", - "integrity": "sha512-RHQLp0iYcWuK0MGiUBA6dgEOCdI29kZTiBRVcJM/Pzvhvs8j9pzBTkMesZAJ7XOSFz2kU+skRMBsFd774dmYTA==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.3.0.tgz", + "integrity": "sha512-c+coQC+bM1PuHX/Blg1mp2ODPZmMnWzXrZwX/JKpnY0uxcAjUrcmGjdjsV1/S/7ph9OJHvZL5KITCRBgFD1Kqg==", "license": "MIT", "dependencies": { - "@cspell/url": "9.2.2", + "@cspell/url": "9.3.0", "import-meta-resolve": "^4.2.0" }, "engines": { @@ -504,27 +504,27 @@ } }, "node_modules/@cspell/filetypes": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.2.2.tgz", - "integrity": "sha512-oM+cqipbZ4PNxQcKP9sKOeRKBG+oM3NKO3To1FyxYxvnUG7DukW2yH6BS0/GUY7qK+oSftuq5d6DXEAl9wzbEQ==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.3.0.tgz", + "integrity": "sha512-pH413zKkMd5lh40HyLNgYfTacIryxsHDhxWShyxS7M+8W9MPl+tmzIHlSEvEVcKUUe3Qpowxo6b6Xkg7taRp/A==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/strong-weak-map": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.2.2.tgz", - "integrity": "sha512-Z7rd7NwHaoH/d/Ds97Rv042WS9PgpVdqgO2X0ehYZmgj2E0LIq2MTkIJMheUrSn37D0PW/suroKh6hN15pJtpQ==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.3.0.tgz", + "integrity": "sha512-s8/QwCPWvWRXZsAzUbWzv/cgL0xjo7p+5QveThFmD3vODX3IlrC+MfnLpEWQAyTQ7CqB5bRuBVAR2cU9gpzZTA==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.2.2.tgz", - "integrity": "sha512-gvLprhrArvLP/rnC8b766dA80EXwBbzXqb9tNDRk1esQV7d3uS1Ftk1970MRlAfLg1pG6V+3C4UrB6WOB/rMCQ==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.3.0.tgz", + "integrity": "sha512-EY4Niv1apHP9RN1mMRP/AHm6xr14fhK+PXnytang6SVwX+tbAEYwwlnFjoEDO6ygPsqs5BBiQ4N7TiSlfmXfmw==", "license": "MIT", "engines": { "node": ">=20" @@ -618,25 +618,25 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.2.2.tgz", - "integrity": "sha512-D9jxXlYWIxUw4IjicxrmK83n5BzuQVZaIhsDsfRiH7iP4F71gDtKR9b+UgmXevvseN7OH4LkdyaPKzjNliGAbg==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.3.0.tgz", + "integrity": "sha512-YyXjOS3MAF6d0XggxHZtkyde6Yf0VgXkrFvR8C6jfxcnY0SJrJDKLiOppmm4ol+oWlvt1Dir1neGJW13xN+dUg==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "9.2.2", - "@cspell/cspell-pipe": "9.2.2", - "@cspell/cspell-types": "9.2.2", - "@cspell/dynamic-import": "9.2.2", - "@cspell/url": "9.2.2", + "@cspell/cspell-json-reporter": "9.3.0", + "@cspell/cspell-pipe": "9.3.0", + "@cspell/cspell-types": "9.3.0", + "@cspell/dynamic-import": "9.3.0", + "@cspell/url": "9.3.0", "chalk": "^5.6.2", "chalk-template": "^1.1.2", - "commander": "^14.0.1", - "cspell-config-lib": "9.2.2", - "cspell-dictionary": "9.2.2", - "cspell-gitignore": "9.2.2", - "cspell-glob": "9.2.2", - "cspell-io": "9.2.2", - "cspell-lib": "9.2.2", + "commander": "^14.0.2", + "cspell-config-lib": "9.3.0", + "cspell-dictionary": "9.3.0", + "cspell-gitignore": "9.3.0", + "cspell-glob": "9.3.0", + "cspell-io": "9.3.0", + "cspell-lib": "9.3.0", "fast-json-stable-stringify": "^2.1.0", "flatted": "^3.3.3", "semver": "^7.7.3", @@ -654,12 +654,12 @@ } }, "node_modules/cspell-config-lib": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.2.2.tgz", - "integrity": "sha512-Fp3jdFxb5gxcQP146TfNVmDqXKfm3xmcEUr1K829DmAFwhc7s+/pCRjhBPoGfQt6U7ugpxjkSx2gGKSbLhp7Mg==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.3.0.tgz", + "integrity": "sha512-YyKMBwRIo8Sh3D9roHWWpW9KnQCkeWOoPJkcLEA3q+UldspkqpjQ8A8bUvigLgVg4dBQosiEUdda3MUZT79Lyg==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.2.2", + "@cspell/cspell-types": "9.3.0", "comment-json": "^4.4.1", "smol-toml": "^1.4.2", "yaml": "^2.8.1" @@ -669,14 +669,14 @@ } }, "node_modules/cspell-dictionary": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.2.2.tgz", - "integrity": "sha512-lnoCFoCAaiFJi+Hz22t+tdTj76jyTA76EYFKhmf/dbj5UO6kVy8by08uFfUbbMaC9Oi09YHnI62P/e+LBx1v8Q==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.3.0.tgz", + "integrity": "sha512-+gS59D0ly/UfTDsjKavWCDTSukmQ3HO0Xy+t4+pwgkVOa8kXzhERoXxT0V3v71TJS+kFRHfsWeGekfaVB4n2ng==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.2.2", - "@cspell/cspell-types": "9.2.2", - "cspell-trie-lib": "9.2.2", + "@cspell/cspell-pipe": "9.3.0", + "@cspell/cspell-types": "9.3.0", + "cspell-trie-lib": "9.3.0", "fast-equals": "^5.3.2" }, "engines": { @@ -684,14 +684,14 @@ } }, "node_modules/cspell-gitignore": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.2.2.tgz", - "integrity": "sha512-Idx3IVKTpnGoyRlkj8F/lSWtWiJpqLhXmZglTzfGWxzbik8E0aQmSyT3blbNWhZL/K1JqlTjbSiAICVMoWTkhA==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.3.0.tgz", + "integrity": "sha512-AdI8WLKGNtTni1P+fbepDBh6u7Mv22diwtqMQoasDPeafArmQHpTp9gc8FgNnQO9tQASB7ZMjIOnLFNvmML+nw==", "license": "MIT", "dependencies": { - "@cspell/url": "9.2.2", - "cspell-glob": "9.2.2", - "cspell-io": "9.2.2" + "@cspell/url": "9.3.0", + "cspell-glob": "9.3.0", + "cspell-io": "9.3.0" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -701,12 +701,12 @@ } }, "node_modules/cspell-glob": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.2.2.tgz", - "integrity": "sha512-6mhUk4iLu5YzY9PE86ZyAjNFjM7TD8Oh4btJ7ZV+edzJjdVjFugXWyefPXCGNfuvpaJqpuoLDwMvNHJxUmLwbg==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.3.0.tgz", + "integrity": "sha512-Mp1T4Y3utyIB5dgQk+XksdmS97il8TfFI9byMUR6Mprml/I+QglXj38bHX/++DeApfFHr+5y5DgqxmRn3/wnKA==", "license": "MIT", "dependencies": { - "@cspell/url": "9.2.2", + "@cspell/url": "9.3.0", "picomatch": "^4.0.3" }, "engines": { @@ -714,13 +714,13 @@ } }, "node_modules/cspell-grammar": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.2.2.tgz", - "integrity": "sha512-m0aozo5gjZYL5Vm3/9D0/yLZJTsVJAP8VeRVljN4u5T7w+WY+LsnvKSZhnkOvsT3kCJDhcKEkMVkCo8d/7EcAQ==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.3.0.tgz", + "integrity": "sha512-X6VrCto78Xm72st+3YZ13qk5jw5sS9QOcS4x3KO41T90YoOMXbMsSH7HPaNrhqaa1rtEKk43kFQp33OLPvsI3Q==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.2.2", - "@cspell/cspell-types": "9.2.2" + "@cspell/cspell-pipe": "9.3.0", + "@cspell/cspell-types": "9.3.0" }, "bin": { "cspell-grammar": "bin.mjs" @@ -730,39 +730,39 @@ } }, "node_modules/cspell-io": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.2.2.tgz", - "integrity": "sha512-Rpky4woeB6/1VUCk7DtRm94A6c5XRbhcj5dUZh851EpZ0ItEz3S9+MhkX8g1sTVkDg6Hln1pu+Nbm9dFIpGkGA==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.3.0.tgz", + "integrity": "sha512-39Gp7asqdsrLvZ9L3BUXYX5wE6gAuvxeklguB4hjz+7i7Jhz02CcjFXDd1VhIA6tJ4hRTHWtgqaoaFv6qQF/vg==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "9.2.2", - "@cspell/url": "9.2.2" + "@cspell/cspell-service-bus": "9.3.0", + "@cspell/url": "9.3.0" }, "engines": { "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.2.2.tgz", - "integrity": "sha512-ksy+5vCSZz7ECUDlLA8ZGNEcWmnzl5bMe4IEPHAMaPFY3iWNsG7dXBrae1dj/b/3HqVqOdXPdwjnGAyZciissg==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.3.0.tgz", + "integrity": "sha512-MM71PponJHWn/tt93hYBSvBVeyivjWjaiROfQ4UlUGw7TIwysAyywH3XNYUnydaHcbjWTk7W12JbEVa8sQaBIQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.2.2", - "@cspell/cspell-pipe": "9.2.2", - "@cspell/cspell-resolver": "9.2.2", - "@cspell/cspell-types": "9.2.2", - "@cspell/dynamic-import": "9.2.2", - "@cspell/filetypes": "9.2.2", - "@cspell/strong-weak-map": "9.2.2", - "@cspell/url": "9.2.2", + "@cspell/cspell-bundled-dicts": "9.3.0", + "@cspell/cspell-pipe": "9.3.0", + "@cspell/cspell-resolver": "9.3.0", + "@cspell/cspell-types": "9.3.0", + "@cspell/dynamic-import": "9.3.0", + "@cspell/filetypes": "9.3.0", + "@cspell/strong-weak-map": "9.3.0", + "@cspell/url": "9.3.0", "clear-module": "^4.1.2", - "cspell-config-lib": "9.2.2", - "cspell-dictionary": "9.2.2", - "cspell-glob": "9.2.2", - "cspell-grammar": "9.2.2", - "cspell-io": "9.2.2", - "cspell-trie-lib": "9.2.2", + "cspell-config-lib": "9.3.0", + "cspell-dictionary": "9.3.0", + "cspell-glob": "9.3.0", + "cspell-grammar": "9.3.0", + "cspell-io": "9.3.0", + "cspell-trie-lib": "9.3.0", "env-paths": "^3.0.0", "gensequence": "^7.0.0", "import-fresh": "^3.3.1", @@ -776,13 +776,13 @@ } }, "node_modules/cspell-trie-lib": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.2.2.tgz", - "integrity": "sha512-84L0Or6xkfnDMmxx2BtuaqsM4LOVCgnG4ZzMMgwQJU+9nSOAHs0ULNWQTHLbsCF+FFG/siILpUkIc3z+UxjGFw==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.3.0.tgz", + "integrity": "sha512-/hLujE3Gp36hhgJChvp6C3uJdBo5hGOqtyal6HjNmn+K27GXRrrn1L+5RoKaDMgFao9Ks5ccca9NtjQTw1EcoA==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.2.2", - "@cspell/cspell-types": "9.2.2", + "@cspell/cspell-pipe": "9.3.0", + "@cspell/cspell-types": "9.3.0", "gensequence": "^7.0.0" }, "engines": { diff --git a/package.json b/package.json index eeee52a0cc..10e190883b 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.2.2" + "cspell": "^9.3.0" } } From 35db16874fcb191252b608298f84b75da3ea9ced Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 16:15:23 +0000 Subject: [PATCH 716/845] Bump actions/attest-build-provenance from 2 to 3 Bumps [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) from 2 to 3. - [Release notes](https://github.com/actions/attest-build-provenance/releases) - [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md) - [Commits](https://github.com/actions/attest-build-provenance/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/attest-build-provenance dependency-version: '3' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fc0dad7b18..cb9dfe130b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,7 +62,7 @@ jobs: files: "Artifacts/*.nupkg" - name: Attest NuGet package - uses: actions/attest-build-provenance@v2 + uses: actions/attest-build-provenance@v3 if: startsWith(github.ref, 'refs/tags/') && steps.check_nupkg.outputs.files_exists == 'true' with: subject-path: ./Artifacts/*.nupkg From d830a20ab422801ee616896fcc9bacaa3c8f1b0a Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 11:25:11 +0100 Subject: [PATCH 717/845] fix qodana warnings --- .../ObjectAssertionSpecs.BeDataContractSerializable.cs | 2 ++ .../Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeDataContractSerializable.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeDataContractSerializable.cs index 6cdee35670..b70400df2f 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeDataContractSerializable.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeDataContractSerializable.cs @@ -128,6 +128,7 @@ public class DataContractSerializableClass [DataContract] public class DataContractSerializableClassNotRestoringAllProperties { + [UsedImplicitly] public string Name { get; set; } [DataMember] @@ -140,6 +141,7 @@ public class DataContractSerializableClassWithIgnoredDataMember [DataMember] public string Name { get; set; } + [UsedImplicitly] [IgnoreDataMember] public decimal CachedSum { get; set; } } diff --git a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs index 6aef7a65e2..9c83a6699c 100644 --- a/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs +++ b/Tests/FluentAssertions.Specs/Primitives/ObjectAssertionSpecs.BeXmlSerializable.cs @@ -118,8 +118,10 @@ public void WriteXml(XmlWriter writer) public class XmlSerializableClassWithIgnoredProperties { + [UsedImplicitly] public string Name { get; set; } + [UsedImplicitly] [XmlIgnore] public decimal CachedSum { get; set; } @@ -133,13 +135,16 @@ public class XmlSerializableClassWithIgnoredProperties public class R { + [UsedImplicitly] public Q A { get; set; } + [UsedImplicitly] public Q B { get; set; } } public class Q { + [UsedImplicitly] [XmlIgnore] public string Flarbs { get; set; } } From 80260df8d8cbc09d61145b680e023d337b848ca9 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 12:10:38 +0100 Subject: [PATCH 718/845] TryGetValue -> ContainsKey Found by MA0160 --- Src/FluentAssertions/Events/EventMonitor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/FluentAssertions/Events/EventMonitor.cs b/Src/FluentAssertions/Events/EventMonitor.cs index 20ae36d1ea..68297406b2 100644 --- a/Src/FluentAssertions/Events/EventMonitor.cs +++ b/Src/FluentAssertions/Events/EventMonitor.cs @@ -137,7 +137,7 @@ private void DisposeSafeIfRequested(IDisposable recorder) private void AttachEventHandler(EventInfo eventInfo, Func utcNow) { - if (!recorderMap.TryGetValue(eventInfo.Name, out _)) + if (!recorderMap.ContainsKey(eventInfo.Name)) { var recorder = new EventRecorder(subject.Target, eventInfo.Name, utcNow, threadSafeSequenceGenerator); From 6113d66fff62c1f2fef107697d6d9e22c7e8ae66 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 12:11:33 +0100 Subject: [PATCH 719/845] Use concrete type Found by CA1859 --- Src/FluentAssertions/Events/EventMonitor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/FluentAssertions/Events/EventMonitor.cs b/Src/FluentAssertions/Events/EventMonitor.cs index 68297406b2..435f0a0795 100644 --- a/Src/FluentAssertions/Events/EventMonitor.cs +++ b/Src/FluentAssertions/Events/EventMonitor.cs @@ -123,7 +123,7 @@ public void Dispose() recorderMap.Clear(); } - private void DisposeSafeIfRequested(IDisposable recorder) + private void DisposeSafeIfRequested(EventRecorder recorder) { try { From a22aaaec1600dc873e0ae6daff3ed978f3eb75fc Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 12:12:28 +0100 Subject: [PATCH 720/845] BenchmarkDotNet 0.15.2 -> 0.15.6 --- Tests/Benchmarks/Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index 0846be0c90..e8e910a74a 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -9,7 +9,7 @@ - + From 6bfe03e1273debb06e793fd4365525d1b28c3b72 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 12:21:53 +0100 Subject: [PATCH 721/845] Meziantou.Analyzer 2.0.219 -> 2.0.253 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 79f0d8f4e9..7ccd647c0d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 67f7de93c967a9f29472ce5b73a12fb293a14731 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 12:22:45 +0100 Subject: [PATCH 722/845] MSTest.TestAdapter 4.0.0 -> 4.0.2 --- Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj b/Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj index b815e2e765..028bc9372e 100644 --- a/Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + From 12cb35a996125b407e20d73648f19f1646b927f8 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 12:27:56 +0100 Subject: [PATCH 723/845] MSTest.TestAdapter 3.10.4 -> 3.11.1 --- Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj | 4 ++-- Tests/UWP.Specs/UWP.Specs.csproj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj index c0c4b31b65..75894fb995 100644 --- a/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/Tests/UWP.Specs/UWP.Specs.csproj b/Tests/UWP.Specs/UWP.Specs.csproj index 3dd53810ee..4e917a7c68 100644 --- a/Tests/UWP.Specs/UWP.Specs.csproj +++ b/Tests/UWP.Specs/UWP.Specs.csproj @@ -88,10 +88,10 @@ 6.2.14 - 3.10.4 + 3.11.1 - 3.10.4 + 3.11.1 4.7.0 From 764efde29e50e15430556ecab7c5a78689b93cea Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 12:28:40 +0100 Subject: [PATCH 724/845] Newtonsoft.Json 13.0.3 -> 13.0.4 --- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 77c4b66723..560da3337e 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -26,7 +26,7 @@ - + all From b9bfb10a6a768e851996ce74fc95f1e84ec9f87f Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 12:30:43 +0100 Subject: [PATCH 725/845] NUnit3TestAdapter 5.1.0 -> 5.2.0 --- Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj index 37882581c8..e1bc90c220 100644 --- a/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj +++ b/Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj @@ -13,7 +13,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index 80dae3cc6e..7ddcd3bea5 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -13,7 +13,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 482cde747f03579688e3a0b89d0707b80c6b704a Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 12:39:32 +0100 Subject: [PATCH 726/845] TUnit 0.57.65 -> 1.1.27 The Microsoft.Testing packages are included since 0.81.0 https://github.com/thomhurst/TUnit/releases/tag/v0.81.0 --- Build/Build.cs | 2 +- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Build/Build.cs b/Build/Build.cs index a089ea93b1..46592c0d12 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -299,7 +299,7 @@ from project in projects from framework in frameworks select new { project, framework }; - DotNetTest(s => s + DotNetRun(s => s .SetConfiguration(Configuration.Debug) .SetProcessEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE", "en-US") .EnableNoBuild() diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 8ca10b1e23..bb17d04143 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -11,9 +11,7 @@ - - - + From 2d2149290daf392b269ab6c101192b3fee69fb6c Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 12:42:34 +0100 Subject: [PATCH 727/845] Roslynator.Analyzers 4.14.0 -> 4.14.1 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 7ccd647c0d..134359d970 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 5bc75dbbd70c258f9db8e482880b9e34909e281f Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 12:42:51 +0100 Subject: [PATCH 728/845] SharpCompress 0.40.0 -> 0.41.0 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index f6891e6651..3ada72c180 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -17,7 +17,7 @@ - + From b8c9eef417ff054158cf93e7bac0965f9757b5ac Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 12:44:09 +0100 Subject: [PATCH 729/845] PublicApiGenerator 11.4.6 -> 11.5.0 --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index ac8f84b5c2..7fa924c05e 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -11,7 +11,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + From 053a03be01f70d204f9185f4600ecdf01a89db10 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 12:45:49 +0100 Subject: [PATCH 730/845] Verify.Xunit 30.13.0 -> 31.7.1 --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 7fa924c05e..7af17d8b1a 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 9d3064511112d2aba68030bc6ef9fd8a412500c6 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 12:48:07 +0100 Subject: [PATCH 731/845] xunit.runner.visualstudio 3.1.4 -> 3.1.5 --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 7af17d8b1a..6e91e1e10f 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -7,7 +7,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj index 4459530fcf..ace0bd7f32 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -10,6 +10,6 @@ - + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index 1458da7a3a..8b88d5083a 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -10,6 +10,6 @@ - + From 48bf674301fd7e3742e1f8fc718cae9de3acd0a5 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 12:52:57 +0100 Subject: [PATCH 732/845] xunit.v3 3.0.1 -> 3.2.0 --- Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj index ace0bd7f32..5ab067f3d3 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -9,7 +9,7 @@ - + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index 8b88d5083a..c571821156 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -9,7 +9,7 @@ - + From 5088aadbab2dd843475bdd5a6abcabbddf8b94d6 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 12:59:47 +0100 Subject: [PATCH 733/845] GitVersion.Tool 6.4.0 -> 6.5.0 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 3ada72c180..ff5344ab4a 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -10,7 +10,7 @@ 1 - + From 03854d71e8c407cbb0f24486dc3fe241dd198da8 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 13:01:05 +0100 Subject: [PATCH 734/845] ReportGenerator 5.4.18 -> 5.5.0 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index ff5344ab4a..403138209f 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -11,7 +11,7 @@ - + From 84dac68fa0892387428a374ce61ebb8083f363b9 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 15 Nov 2025 13:08:34 +0100 Subject: [PATCH 735/845] Update VS element in solution file --- FluentAssertions.sln | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FluentAssertions.sln b/FluentAssertions.sln index 3766cd7232..5c695dc3c1 100644 --- a/FluentAssertions.sln +++ b/FluentAssertions.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.3.32505.426 +# Visual Studio Version 18 +VisualStudioVersion = 18.0.11205.157 d18.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E5A0B454-22D4-4694-99FF-D6A8B7DE7DA3}" ProjectSection(SolutionItems) = preProject From 87a68d0b31c7d7f27e4c3e059e50245b8d5ea785 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Nov 2025 15:15:03 +0000 Subject: [PATCH 736/845] Bump cspell from 9.3.0 to 9.3.2 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 9.3.0 to 9.3.2. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.3.2/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.3.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 259 ++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 134 insertions(+), 127 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9a3f7b312b..93d62490b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,18 +7,18 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.3.0" + "cspell": "^9.3.2" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.3.0.tgz", - "integrity": "sha512-rf5SAdg1EmgCBIo/zFEAIjydlO+VtVLR6oUVeD4rIE7zIPrPdJb0OMUGsxfOH7uePyhcfIxPYTjneQla0e5Ljw==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.3.2.tgz", + "integrity": "sha512-OmKzq/0FATHU671GKMzBrTyLdm25Wnziva7h4ylumVn1wnwWsXGef5bgXD7iuApqfqH9SzxsU0NtTB8m8vwEHQ==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.1", "@cspell/dict-al": "^1.1.1", - "@cspell/dict-aws": "^4.0.15", + "@cspell/dict-aws": "^4.0.16", "@cspell/dict-bash": "^4.2.2", "@cspell/dict-companies": "^3.2.7", "@cspell/dict-cpp": "^6.0.14", @@ -57,7 +57,7 @@ "@cspell/dict-markdown": "^2.0.12", "@cspell/dict-monkeyc": "^1.0.11", "@cspell/dict-node": "^5.0.8", - "@cspell/dict-npm": "^5.2.20", + "@cspell/dict-npm": "^5.2.22", "@cspell/dict-php": "^4.1.0", "@cspell/dict-powershell": "^5.0.15", "@cspell/dict-public-licenses": "^2.0.15", @@ -67,43 +67,44 @@ "@cspell/dict-rust": "^4.0.12", "@cspell/dict-scala": "^5.0.8", "@cspell/dict-shell": "^1.1.2", - "@cspell/dict-software-terms": "^5.1.11", + "@cspell/dict-software-terms": "^5.1.13", "@cspell/dict-sql": "^2.2.1", "@cspell/dict-svelte": "^1.0.7", "@cspell/dict-swift": "^2.0.6", "@cspell/dict-terraform": "^1.1.3", "@cspell/dict-typescript": "^3.2.3", - "@cspell/dict-vue": "^3.0.5" + "@cspell/dict-vue": "^3.0.5", + "@cspell/dict-zig": "^1.0.0" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.3.0.tgz", - "integrity": "sha512-bvpLNS73/SN3969ksipVSYDdMYsxYZqeBDkcA2yKJZ9eHRY/tHUbjTTIvyvlCLODzUiop2RFGrvDPcjyam/FoQ==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.3.2.tgz", + "integrity": "sha512-YRgpeHN9uY8kUlIw9q+8zJ0tRTAJMbfBTGzCq9Puah09NeMWlRMFPUkXVrkdic6NA7etboZ+zEdoZwRO9EmhiA==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.3.0" + "@cspell/cspell-types": "9.3.2" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-pipe": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.3.0.tgz", - "integrity": "sha512-LEl2TYvXnGk/D+Vjq5DBsNQuLsmn3/2QV9dxteK5e323pJRcpEosq76elzsYpVLuB3s1hp2pFQhppWk69Gx2CQ==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.3.2.tgz", + "integrity": "sha512-REF7ibG79WLEynIMUss/IRDCdYEb1nlE1rj/gt2CbPFzLa6t5MRwW2lajEvXS6/WgbMtsTVHAWi3ALqJzCwxng==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.3.0.tgz", - "integrity": "sha512-AOIC6xV2XuEWKy/K/CUBHQ7caavDnjb2zflP25j7fGMWpS/GIGKLPjgGQUHFbgNSSy9UY2ZGV7MVCsnD7moW5Q==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.3.2.tgz", + "integrity": "sha512-jLN2Aa/vxm8+IBvTd884SwPEfjxnDwIEPBT3hmqgLlKuUHQ3FMG27lsM4Ik9L2KWBXMgV/wGz4BaxfhKI41Ttw==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" @@ -113,18 +114,18 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.3.0.tgz", - "integrity": "sha512-e9ZfG1VJ/kbzh2LBW/TJImEWcEUuBMYSDnIYbQCsclKAWyF3g8eLGxoX7xDbZ82USo4IU2tqYmrDvPcUD8CHxg==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.3.2.tgz", + "integrity": "sha512-/rB8LazM0JzKL+AvZa5fEpLutmwy5QFMpzw8HJd+rDGkzb5r79hURWSRo84QArgaskUqA9XlOHSieDE9pt+WAA==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.3.0.tgz", - "integrity": "sha512-WN3R4nqQ7BEgS8UEoPIwNBRuSFT/8GImqXmlx7EHmzBAhevWjF3IDF+OEtokRJ95qik6a4xqJJTJgi624UxDFg==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.3.2.tgz", + "integrity": "sha512-l4H8bMAmdzCbXHO8y1JZiAKszrPEiuLFKWrbhCacHF0iP+PIc/yuQp7cO70m0p70vArRfih6kgGyHFaCy47CfA==", "license": "MIT", "engines": { "node": ">=20" @@ -143,9 +144,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-aws": { - "version": "4.0.15", - "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.15.tgz", - "integrity": "sha512-aPY7VVR5Os4rz36EaqXBAEy14wR4Rqv+leCJ2Ug/Gd0IglJpM30LalF3e2eJChnjje3vWoEC0Rz3+e5gpZG+Kg==", + "version": "4.0.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.16.tgz", + "integrity": "sha512-a681zShZbtTo947NvTYGLer95ZDQw1ROKvIFydak1e0OlfFCsNdtcYTupn0nbbYs53c9AO7G2DU8AcNEAnwXPA==", "license": "MIT" }, "node_modules/@cspell/dict-bash": { @@ -386,9 +387,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.20", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.20.tgz", - "integrity": "sha512-tJRv1qEdW3f8fxK/D2huoqkSvM6ogz55hAt9RTdB7tZy57wio9Tkj+xfi2DIeOlmf6e94c6pNPZIC/o5rclMhw==", + "version": "5.2.22", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.22.tgz", + "integrity": "sha512-bepGmmRv7KmxULqfw88G9wxkpIAQA96YyrfKpfg4RHnQLxpmzoRnZGtK5S9JH7Hlf5LEd1gkOF7dtCE6cek67w==", "license": "MIT" }, "node_modules/@cspell/dict-php": { @@ -449,9 +450,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.1.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.11.tgz", - "integrity": "sha512-xwARdlp6o81BK7uNl4qR5CmLBXuc9xWyEeEwzeAw/8SkBdYheVQO6F1Fey2iqMRDT9LAb5Znbg83pJVpLjgBjg==", + "version": "5.1.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.13.tgz", + "integrity": "sha512-bmWMOpqzCmmKFHM9hFC6o+GP20t2+uTuwksR3a6crHQqvNv3revzwQHorsWvSYx75xsdcvRYrAz7PqPEV/FG1g==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -490,13 +491,19 @@ "integrity": "sha512-Mqutb8jbM+kIcywuPQCCaK5qQHTdaByoEO2J9LKFy3sqAdiBogNkrplqUK0HyyRFgCfbJUgjz3N85iCMcWH0JA==", "license": "MIT" }, + "node_modules/@cspell/dict-zig": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-zig/-/dict-zig-1.0.0.tgz", + "integrity": "sha512-XibBIxBlVosU06+M6uHWkFeT0/pW5WajDRYdXG2CgHnq85b0TI/Ks0FuBJykmsgi2CAD3Qtx8UHFEtl/DSFnAQ==", + "license": "MIT" + }, "node_modules/@cspell/dynamic-import": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.3.0.tgz", - "integrity": "sha512-c+coQC+bM1PuHX/Blg1mp2ODPZmMnWzXrZwX/JKpnY0uxcAjUrcmGjdjsV1/S/7ph9OJHvZL5KITCRBgFD1Kqg==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.3.2.tgz", + "integrity": "sha512-au7FyuIHUNI2r9sO3pUBKVTeD/v7c9x/nPUStaAK1bG4rdKt4w+/jUY2IaldAraW5w29z528BboXbiV87SM1kw==", "license": "MIT", "dependencies": { - "@cspell/url": "9.3.0", + "@cspell/url": "9.3.2", "import-meta-resolve": "^4.2.0" }, "engines": { @@ -504,27 +511,27 @@ } }, "node_modules/@cspell/filetypes": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.3.0.tgz", - "integrity": "sha512-pH413zKkMd5lh40HyLNgYfTacIryxsHDhxWShyxS7M+8W9MPl+tmzIHlSEvEVcKUUe3Qpowxo6b6Xkg7taRp/A==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.3.2.tgz", + "integrity": "sha512-0bUxQlmJPRHZrRQD7adbc4lFizO8tGD/6+1cBgU3kV3+NVrpr12y4jU8twCSChhYibZyPr7bnvhkM3cQgb8RzA==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/strong-weak-map": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.3.0.tgz", - "integrity": "sha512-s8/QwCPWvWRXZsAzUbWzv/cgL0xjo7p+5QveThFmD3vODX3IlrC+MfnLpEWQAyTQ7CqB5bRuBVAR2cU9gpzZTA==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.3.2.tgz", + "integrity": "sha512-pFcmOTWCoFMRETb9PCkCmaiZiLb5i2qOZmGH/p/tFEH8kIYhMGfhaulnXwKwS+Ke6PKceQd2YL98bGmo8hL4aQ==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.3.0.tgz", - "integrity": "sha512-EY4Niv1apHP9RN1mMRP/AHm6xr14fhK+PXnytang6SVwX+tbAEYwwlnFjoEDO6ygPsqs5BBiQ4N7TiSlfmXfmw==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.3.2.tgz", + "integrity": "sha512-TobUlZl7Z7VehhNOMNAg1ABuGizieseftlG94OZJ934JptOhK8TC/1o2ldKrbDH50jyt6E7rPTMV2BW/vWuTzQ==", "license": "MIT", "engines": { "node": ">=20" @@ -618,25 +625,25 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.3.0.tgz", - "integrity": "sha512-YyXjOS3MAF6d0XggxHZtkyde6Yf0VgXkrFvR8C6jfxcnY0SJrJDKLiOppmm4ol+oWlvt1Dir1neGJW13xN+dUg==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.3.2.tgz", + "integrity": "sha512-3xFyVSTYrYa/QJzLfzsCRMkMXqOsytP8E26DuGrVMJQoLPFmbOXNNtnMu4wrtr17QVloxpvutW77U4vb2L/LDQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "9.3.0", - "@cspell/cspell-pipe": "9.3.0", - "@cspell/cspell-types": "9.3.0", - "@cspell/dynamic-import": "9.3.0", - "@cspell/url": "9.3.0", + "@cspell/cspell-json-reporter": "9.3.2", + "@cspell/cspell-pipe": "9.3.2", + "@cspell/cspell-types": "9.3.2", + "@cspell/dynamic-import": "9.3.2", + "@cspell/url": "9.3.2", "chalk": "^5.6.2", "chalk-template": "^1.1.2", "commander": "^14.0.2", - "cspell-config-lib": "9.3.0", - "cspell-dictionary": "9.3.0", - "cspell-gitignore": "9.3.0", - "cspell-glob": "9.3.0", - "cspell-io": "9.3.0", - "cspell-lib": "9.3.0", + "cspell-config-lib": "9.3.2", + "cspell-dictionary": "9.3.2", + "cspell-gitignore": "9.3.2", + "cspell-glob": "9.3.2", + "cspell-io": "9.3.2", + "cspell-lib": "9.3.2", "fast-json-stable-stringify": "^2.1.0", "flatted": "^3.3.3", "semver": "^7.7.3", @@ -654,14 +661,14 @@ } }, "node_modules/cspell-config-lib": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.3.0.tgz", - "integrity": "sha512-YyKMBwRIo8Sh3D9roHWWpW9KnQCkeWOoPJkcLEA3q+UldspkqpjQ8A8bUvigLgVg4dBQosiEUdda3MUZT79Lyg==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.3.2.tgz", + "integrity": "sha512-zXhmA4rqgWQRTVijI+g/mgiep76TvTO4d+P3CHwcqLG57BKVzoW+jkO4qDLC+Neh4b8+CcNWEIr3w16BfuEJAA==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.3.0", + "@cspell/cspell-types": "9.3.2", "comment-json": "^4.4.1", - "smol-toml": "^1.4.2", + "smol-toml": "^1.5.2", "yaml": "^2.8.1" }, "engines": { @@ -669,29 +676,29 @@ } }, "node_modules/cspell-dictionary": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.3.0.tgz", - "integrity": "sha512-+gS59D0ly/UfTDsjKavWCDTSukmQ3HO0Xy+t4+pwgkVOa8kXzhERoXxT0V3v71TJS+kFRHfsWeGekfaVB4n2ng==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.3.2.tgz", + "integrity": "sha512-E3YhOhZzZt1a+AEbFV2B3THCyZ576PDg0mDNUDrU1Y65SyIhf4DC6itfPoAb6R3FI/DI218RqWZg/FTT8lJ2gA==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.3.0", - "@cspell/cspell-types": "9.3.0", - "cspell-trie-lib": "9.3.0", - "fast-equals": "^5.3.2" + "@cspell/cspell-pipe": "9.3.2", + "@cspell/cspell-types": "9.3.2", + "cspell-trie-lib": "9.3.2", + "fast-equals": "^5.3.3" }, "engines": { "node": ">=20" } }, "node_modules/cspell-gitignore": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.3.0.tgz", - "integrity": "sha512-AdI8WLKGNtTni1P+fbepDBh6u7Mv22diwtqMQoasDPeafArmQHpTp9gc8FgNnQO9tQASB7ZMjIOnLFNvmML+nw==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.3.2.tgz", + "integrity": "sha512-G2bLR+Dfb9GX4Sdm75GfCCa9V/sQYkRbLckuCuVmJxvcDB0xfczAtb6TfAXIziF3oUI6cOB1g+PoNLWBelcK5w==", "license": "MIT", "dependencies": { - "@cspell/url": "9.3.0", - "cspell-glob": "9.3.0", - "cspell-io": "9.3.0" + "@cspell/url": "9.3.2", + "cspell-glob": "9.3.2", + "cspell-io": "9.3.2" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -701,12 +708,12 @@ } }, "node_modules/cspell-glob": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.3.0.tgz", - "integrity": "sha512-Mp1T4Y3utyIB5dgQk+XksdmS97il8TfFI9byMUR6Mprml/I+QglXj38bHX/++DeApfFHr+5y5DgqxmRn3/wnKA==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.3.2.tgz", + "integrity": "sha512-TuSupENEKyOCupOUZ3vnPxaTOghxY/rD1JIkb8e5kjzRprYVilO/rYqEk/52iLwJVd+4Npe8fNhR3KhU7u/UUg==", "license": "MIT", "dependencies": { - "@cspell/url": "9.3.0", + "@cspell/url": "9.3.2", "picomatch": "^4.0.3" }, "engines": { @@ -714,13 +721,13 @@ } }, "node_modules/cspell-grammar": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.3.0.tgz", - "integrity": "sha512-X6VrCto78Xm72st+3YZ13qk5jw5sS9QOcS4x3KO41T90YoOMXbMsSH7HPaNrhqaa1rtEKk43kFQp33OLPvsI3Q==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.3.2.tgz", + "integrity": "sha512-ysonrFu9vJvF/derDlEjUfmvLeCfNOWPh00t6Yh093AKrJFoWQiyaS/5bEN/uB5/n1sa4k3ItnWvuTp3+YuZsA==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.3.0", - "@cspell/cspell-types": "9.3.0" + "@cspell/cspell-pipe": "9.3.2", + "@cspell/cspell-types": "9.3.2" }, "bin": { "cspell-grammar": "bin.mjs" @@ -730,41 +737,41 @@ } }, "node_modules/cspell-io": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.3.0.tgz", - "integrity": "sha512-39Gp7asqdsrLvZ9L3BUXYX5wE6gAuvxeklguB4hjz+7i7Jhz02CcjFXDd1VhIA6tJ4hRTHWtgqaoaFv6qQF/vg==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.3.2.tgz", + "integrity": "sha512-ahoULCp0j12TyXXmIcdO/7x65A/2mzUQO1IkOC65OXEbNT+evt0yswSO5Nr1F6kCHDuEKc46EZWwsYAzj78pMg==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "9.3.0", - "@cspell/url": "9.3.0" + "@cspell/cspell-service-bus": "9.3.2", + "@cspell/url": "9.3.2" }, "engines": { "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.3.0.tgz", - "integrity": "sha512-MM71PponJHWn/tt93hYBSvBVeyivjWjaiROfQ4UlUGw7TIwysAyywH3XNYUnydaHcbjWTk7W12JbEVa8sQaBIQ==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.3.2.tgz", + "integrity": "sha512-kdk11kib68zNANNICuOA8h4oA9kENQUAdeX/uvT4+7eHbHHV8WSgjXm4k4o/pRIbg164UJTX/XxKb/65ftn5jw==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.3.0", - "@cspell/cspell-pipe": "9.3.0", - "@cspell/cspell-resolver": "9.3.0", - "@cspell/cspell-types": "9.3.0", - "@cspell/dynamic-import": "9.3.0", - "@cspell/filetypes": "9.3.0", - "@cspell/strong-weak-map": "9.3.0", - "@cspell/url": "9.3.0", + "@cspell/cspell-bundled-dicts": "9.3.2", + "@cspell/cspell-pipe": "9.3.2", + "@cspell/cspell-resolver": "9.3.2", + "@cspell/cspell-types": "9.3.2", + "@cspell/dynamic-import": "9.3.2", + "@cspell/filetypes": "9.3.2", + "@cspell/strong-weak-map": "9.3.2", + "@cspell/url": "9.3.2", "clear-module": "^4.1.2", - "cspell-config-lib": "9.3.0", - "cspell-dictionary": "9.3.0", - "cspell-glob": "9.3.0", - "cspell-grammar": "9.3.0", - "cspell-io": "9.3.0", - "cspell-trie-lib": "9.3.0", + "cspell-config-lib": "9.3.2", + "cspell-dictionary": "9.3.2", + "cspell-glob": "9.3.2", + "cspell-grammar": "9.3.2", + "cspell-io": "9.3.2", + "cspell-trie-lib": "9.3.2", "env-paths": "^3.0.0", - "gensequence": "^7.0.0", + "gensequence": "^8.0.8", "import-fresh": "^3.3.1", "resolve-from": "^5.0.0", "vscode-languageserver-textdocument": "^1.0.12", @@ -776,14 +783,14 @@ } }, "node_modules/cspell-trie-lib": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.3.0.tgz", - "integrity": "sha512-/hLujE3Gp36hhgJChvp6C3uJdBo5hGOqtyal6HjNmn+K27GXRrrn1L+5RoKaDMgFao9Ks5ccca9NtjQTw1EcoA==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.3.2.tgz", + "integrity": "sha512-1Af7Mq9jIccFQyJl/ZCcqQbtJwuDqpQVkk8xfs/92x4OI6gW1iTVRMtsrh0RTw1HZoR8aQD7tRRCiLPf/D+UiQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.3.0", - "@cspell/cspell-types": "9.3.0", - "gensequence": "^7.0.0" + "@cspell/cspell-pipe": "9.3.2", + "@cspell/cspell-types": "9.3.2", + "gensequence": "^8.0.8" }, "engines": { "node": ">=20" @@ -815,9 +822,9 @@ } }, "node_modules/fast-equals": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.3.2.tgz", - "integrity": "sha512-6rxyATwPCkaFIL3JLqw8qXqMpIZ942pTX/tbQFkRsDGblS8tNGtlUauA/+mt6RUfqn/4MoEr+WDkYoIQbibWuQ==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.3.3.tgz", + "integrity": "sha512-/boTcHZeIAQ2r/tL11voclBHDeP9WPxLt+tyAbVSyyXuUFyh0Tne7gJZTqGbxnvj79TjLdCXLOY7UIPhyG5MTw==", "license": "MIT", "engines": { "node": ">=6.0.0" @@ -853,12 +860,12 @@ "license": "ISC" }, "node_modules/gensequence": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/gensequence/-/gensequence-7.0.0.tgz", - "integrity": "sha512-47Frx13aZh01afHJTB3zTtKIlFI6vWY+MYCN9Qpew6i52rfKjnhCF/l1YlC8UmEMvvntZZ6z4PiCcmyuedR2aQ==", + "version": "8.0.8", + "resolved": "https://registry.npmjs.org/gensequence/-/gensequence-8.0.8.tgz", + "integrity": "sha512-omMVniXEXpdx/vKxGnPRoO2394Otlze28TyxECbFVyoSpZ9H3EO7lemjcB12OpQJzRW4e5tt/dL1rOxry6aMHg==", "license": "MIT", "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/global-directory": { @@ -978,9 +985,9 @@ } }, "node_modules/smol-toml": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.4.2.tgz", - "integrity": "sha512-rInDH6lCNiEyn3+hH8KVGFdbjc099j47+OSgbMrfDYX1CmXLfdKd7qi6IfcWj2wFxvSVkuI46M+wPGYfEOEj6g==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.5.2.tgz", + "integrity": "sha512-QlaZEqcAH3/RtNyet1IPIYPsEWAaYyXXv1Krsi+1L/QHppjX4Ifm8MQsBISz9vE8cHicIq3clogsheili5vhaQ==", "license": "BSD-3-Clause", "engines": { "node": ">= 18" diff --git a/package.json b/package.json index 10e190883b..4623516afa 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.3.0" + "cspell": "^9.3.2" } } From bc5638ac0000430a1723a0cc61d072870b1c1011 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 15:11:33 +0000 Subject: [PATCH 737/845] Bump actions/checkout from 5 to 6 Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 4 ++-- .github/workflows/code_quality.yml | 2 +- .github/workflows/codeql.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb9dfe130b..bebc7d39e6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: DOTNET_NOLOGO: true steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 @@ -85,7 +85,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index 9e5c7b0b6e..429656cdd4 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -13,7 +13,7 @@ jobs: name: Qodana Scan runs-on: windows-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index da02270af2..5fed7f6e9e 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -32,7 +32,7 @@ jobs: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From 7d04be5e838e877610adb96253230b61999eee9c Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 23 Nov 2025 12:51:04 +0100 Subject: [PATCH 738/845] Upgrade to net10 SDK --- .github/workflows/build.yml | 4 ++-- .github/workflows/codeql.yml | 2 +- Build/_build.csproj | 1 - Directory.Build.props | 4 ++-- README.md | 2 +- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- global.json | 2 +- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bebc7d39e6..d08bb5c8da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: dotnet-version: | 6.0.x 8.0.x - 9.0.x + 10.0.x - name: Cache .nuke/temp uses: actions/cache@v4 @@ -95,7 +95,7 @@ jobs: dotnet-version: | 6.0.x 8.0.x - 9.0.x + 10.0.x - name: Run NUKE run: ./build.sh UnitTests diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 5fed7f6e9e..c71f95beab 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,7 +28,7 @@ jobs: uses: actions/setup-dotnet@v5 with: dotnet-version: | - 9.0.x + 10.0.x - name: Checkout repository diff --git a/Build/_build.csproj b/Build/_build.csproj index 403138209f..65d6169ecc 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -18,6 +18,5 @@ - diff --git a/Directory.Build.props b/Directory.Build.props index 134359d970..47e23ab53b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 13.0 + 14.0 false true @@ -13,7 +13,7 @@ true - 9.0 + 10.0 All true diff --git a/README.md b/README.md index 0adfe90c96..01687af1b6 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ Expected numbers to contain 4 item(s) because we thought we put four items in th Visit https://www.fluentassertions.com for [background information](https://fluentassertions.com/about/), [usage documentation](https://fluentassertions.com/introduction), an [extensibility guide](https://fluentassertions.com/extensibility/), support information and more [tips & tricks](https://fluentassertions.com/tips/). # Building -Install Visual Studio 2022 17.14+ or JetBrains Rider 2024.3 as well as the Build Tools 2022 (including the Universal Windows Platform build tools). You will also need to have .NET Framework 4.7 SDK and .NET 9.0 SDK installed. Check the [global.json](global.json) for the current minimum required version. +Install Visual Studio 2026 18.0+ or JetBrains Rider 2025.3 as well as the Build Tools 2026 (including the Universal Windows Platform build tools). You will also need to have .NET Framework 4.7 SDK and .NET 10.0 SDK installed. Check the [global.json](global.json) for the current minimum required version. You can also build, run the unit tests and package the code using the following command-line: diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 6e91e1e10f..72d4abb5b4 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -1,7 +1,7 @@  - net8.0 + net10.0 diff --git a/global.json b/global.json index c48f9699dd..4ae80ef19e 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.300", + "version": "10.0.100", "rollForward": "latestMajor" } } From 94356c85b63f3071da5a2c2e879d37a49e022889 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 23 Nov 2025 13:12:43 +0100 Subject: [PATCH 739/845] Use field backed properties --- Src/FluentAssertions/AssertionEngine.cs | 15 +++++++-------- Src/FluentAssertions/Common/Iterator.cs | 9 ++++----- .../Configuration/GlobalConfiguration.cs | 6 ++---- .../Configuration/GlobalFormattingOptions.cs | 6 ++---- Src/FluentAssertions/Equivalency/Comparands.cs | 8 +++----- .../Equivalency/EqualityStrategyProvider.cs | 12 +++++------- Src/FluentAssertions/Equivalency/Node.cs | 13 +++++-------- Src/FluentAssertions/Equivalency/Pathway.cs | 12 +++++------- 8 files changed, 33 insertions(+), 48 deletions(-) diff --git a/Src/FluentAssertions/AssertionEngine.cs b/Src/FluentAssertions/AssertionEngine.cs index ef04504101..adc9ce86f9 100644 --- a/Src/FluentAssertions/AssertionEngine.cs +++ b/Src/FluentAssertions/AssertionEngine.cs @@ -15,7 +15,6 @@ namespace FluentAssertions; public static class AssertionEngine { private static readonly object Lockable = new(); - private static ITestFramework testFramework; private static bool isInitialized; static AssertionEngine() @@ -30,24 +29,24 @@ public static ITestFramework TestFramework { get { - if (testFramework is not null) + if (field is not null) { - return testFramework; + return field; } lock (Lockable) { #pragma warning disable CA1508 - if (testFramework is null) + if (field is null) #pragma warning restore CA1508 { - testFramework = TestFrameworkFactory.GetFramework(Configuration.TestFramework); + field = TestFrameworkFactory.GetFramework(Configuration.TestFramework); } } - return testFramework; + return field; } - set => testFramework = value; + set; } /// @@ -63,7 +62,7 @@ public static void ResetToDefaults() { isInitialized = false; Configuration = new GlobalConfiguration(); - testFramework = null; + TestFramework = null; EnsureInitialized(); } diff --git a/Src/FluentAssertions/Common/Iterator.cs b/Src/FluentAssertions/Common/Iterator.cs index efb1dc3371..697994dbb6 100644 --- a/Src/FluentAssertions/Common/Iterator.cs +++ b/Src/FluentAssertions/Common/Iterator.cs @@ -14,7 +14,6 @@ internal sealed class Iterator : IEnumerator private readonly IEnumerable enumerable; private readonly int? maxItems; private IEnumerator enumerator; - private T current; private T next; private bool hasNext; @@ -35,10 +34,10 @@ public void Reset() Index = InitialIndex; enumerator = enumerable.GetEnumerator(); - hasCurrent = false; hasNext = false; hasCompleted = false; - current = default; + Current = default; + hasCurrent = false; next = default; } @@ -59,12 +58,12 @@ public T Current throw new InvalidOperationException($"Please call {nameof(MoveNext)} first"); } - return current; + return field; } private set { - current = value; + field = value; hasCurrent = true; } } diff --git a/Src/FluentAssertions/Configuration/GlobalConfiguration.cs b/Src/FluentAssertions/Configuration/GlobalConfiguration.cs index ebe6577e69..5235e8c02d 100644 --- a/Src/FluentAssertions/Configuration/GlobalConfiguration.cs +++ b/Src/FluentAssertions/Configuration/GlobalConfiguration.cs @@ -2,8 +2,6 @@ namespace FluentAssertions.Configuration; public class GlobalConfiguration { - private TestFramework? testFramework; - /// /// Provides access to the formatting defaults for all assertions. /// @@ -22,10 +20,10 @@ public class GlobalConfiguration /// public TestFramework? TestFramework { - get => testFramework; + get; set { - testFramework = value; + field = value; AssertionEngine.TestFramework = null; } } diff --git a/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs b/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs index 4676e9c890..937ccb4f3e 100644 --- a/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs +++ b/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs @@ -6,14 +6,12 @@ namespace FluentAssertions.Configuration; public class GlobalFormattingOptions : FormattingOptions { - private string valueFormatterAssembly; - public string ValueFormatterAssembly { - get => valueFormatterAssembly; + get; set { - valueFormatterAssembly = value; + field = value; ValueFormatterDetectionMode = ValueFormatterDetectionMode.Specific; } } diff --git a/Src/FluentAssertions/Equivalency/Comparands.cs b/Src/FluentAssertions/Equivalency/Comparands.cs index 4e763acf9b..a418a3218d 100644 --- a/Src/FluentAssertions/Equivalency/Comparands.cs +++ b/Src/FluentAssertions/Equivalency/Comparands.cs @@ -6,15 +6,13 @@ namespace FluentAssertions.Equivalency; public class Comparands { - private Type compileTimeType; - public Comparands() { } public Comparands(object subject, object expectation, Type compileTimeType) { - this.compileTimeType = compileTimeType; + CompileTimeType = compileTimeType; Subject = subject; Expectation = expectation; } @@ -36,11 +34,11 @@ public Type CompileTimeType { get { - return compileTimeType != typeof(object) || Expectation is null ? compileTimeType : RuntimeType; + return field != typeof(object) || Expectation is null ? field : RuntimeType; } // SMELL: Do we really need this? Can we replace it by making Comparands generic or take a constructor parameter? - set => compileTimeType = value; + set; } /// diff --git a/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs b/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs index 1d1c62864a..86cdcda777 100644 --- a/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs +++ b/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs @@ -17,8 +17,6 @@ internal sealed class EqualityStrategyProvider [CanBeNull] private readonly Func defaultStrategy; - private bool? compareRecordsByValue; - public EqualityStrategyProvider() { } @@ -30,10 +28,10 @@ public EqualityStrategyProvider(Func defaultStrategy) public bool? CompareRecordsByValue { - get => compareRecordsByValue; + get; set { - compareRecordsByValue = value; + field = value; typeCache.Clear(); } } @@ -65,9 +63,9 @@ public EqualityStrategy GetEqualityStrategy(Type type) return EqualityStrategy.ForceEquals; } - if ((compareRecordsByValue != null || defaultStrategy is null) && typeKey.IsRecord()) + if ((CompareRecordsByValue != null || defaultStrategy is null) && typeKey.IsRecord()) { - return compareRecordsByValue is true ? EqualityStrategy.ForceEquals : EqualityStrategy.ForceMembers; + return CompareRecordsByValue is true ? EqualityStrategy.ForceEquals : EqualityStrategy.ForceMembers; } if (defaultStrategy is not null) @@ -107,7 +105,7 @@ public override string ToString() { var builder = new StringBuilder(); - if (compareRecordsByValue is true) + if (CompareRecordsByValue is true) { builder.AppendLine("- Compare records by value"); } diff --git a/Src/FluentAssertions/Equivalency/Node.cs b/Src/FluentAssertions/Equivalency/Node.cs index b8b08bc94a..3e941c5ca7 100644 --- a/Src/FluentAssertions/Equivalency/Node.cs +++ b/Src/FluentAssertions/Equivalency/Node.cs @@ -10,15 +10,12 @@ internal class Node : INode { private static readonly Regex MatchFirstIndex = new(@"^\[[0-9]+\]$"); - private GetSubjectId subjectIdProvider; - private string cachedSubjectId; - private Pathway subject; public GetSubjectId GetSubjectId { - get => () => cachedSubjectId ??= subjectIdProvider(); - protected init => subjectIdProvider = value; + get => () => cachedSubjectId ??= field(); + protected init => field = value; } public Type Type { get; protected set; } @@ -27,10 +24,10 @@ public GetSubjectId GetSubjectId public Pathway Subject { - get => subject; + get; set { - subject = value; + field = value; if (Expectation is null) { @@ -78,7 +75,7 @@ public static INode From(GetSubjectId getSubjectId) { return new Node { - subjectIdProvider = () => getSubjectId() ?? "root", + GetSubjectId = () => getSubjectId() ?? "root", Subject = new Pathway(string.Empty, string.Empty, _ => getSubjectId()), Type = typeof(T), ParentType = null, diff --git a/Src/FluentAssertions/Equivalency/Pathway.cs b/Src/FluentAssertions/Equivalency/Pathway.cs index 8bd3f24689..5eccbe4299 100644 --- a/Src/FluentAssertions/Equivalency/Pathway.cs +++ b/Src/FluentAssertions/Equivalency/Pathway.cs @@ -9,8 +9,6 @@ public record Pathway { public delegate string GetDescription(string pathAndName); - private string path = string.Empty; - private string name = string.Empty; private string pathAndName; private readonly GetDescription getDescription; @@ -38,10 +36,10 @@ public Pathway(Pathway parent, string name, GetDescription getDescription) /// public string Path { - get => path; + get; private init { - path = value; + field = value; pathAndName = null; } } @@ -51,10 +49,10 @@ private init /// public string Name { - get => name; + get => field; private init { - name = value; + field = value; pathAndName = null; } } @@ -62,7 +60,7 @@ private init /// /// Gets the path and name of the field or property separated by dots. /// - public string PathAndName => pathAndName ??= path.Combine(name); + public string PathAndName => pathAndName ??= Path.Combine(Name); /// /// Gets the display representation of this path. From 903a81835a589625ef485600ac96816f19f67bad Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 2 Dec 2025 15:01:37 +0100 Subject: [PATCH 740/845] Use compound assingment --- Src/FluentAssertions/AssertionEngine.cs | 5 +---- Src/FluentAssertions/Equivalency/Node.cs | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Src/FluentAssertions/AssertionEngine.cs b/Src/FluentAssertions/AssertionEngine.cs index adc9ce86f9..3c36472317 100644 --- a/Src/FluentAssertions/AssertionEngine.cs +++ b/Src/FluentAssertions/AssertionEngine.cs @@ -37,11 +37,8 @@ public static ITestFramework TestFramework lock (Lockable) { #pragma warning disable CA1508 - if (field is null) + field ??= TestFrameworkFactory.GetFramework(Configuration.TestFramework); #pragma warning restore CA1508 - { - field = TestFrameworkFactory.GetFramework(Configuration.TestFramework); - } } return field; diff --git a/Src/FluentAssertions/Equivalency/Node.cs b/Src/FluentAssertions/Equivalency/Node.cs index 3e941c5ca7..ecf5a1e389 100644 --- a/Src/FluentAssertions/Equivalency/Node.cs +++ b/Src/FluentAssertions/Equivalency/Node.cs @@ -28,11 +28,7 @@ public Pathway Subject set { field = value; - - if (Expectation is null) - { - Expectation = value; - } + Expectation ??= value; } } From 7e6b4a5f0c51e656f1fca10845eae5f9bf918605 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 23 Nov 2025 13:51:49 +0100 Subject: [PATCH 741/845] Migrate sln to slnx --- .github/workflows/codeql.yml | 4 +- .nuke/parameters.json | 2 +- FluentAssertions.sln | 233 ------------------ FluentAssertions.slnx | 92 +++++++ ...tings => FluentAssertions.slnx.DotSettings | 0 qodana.yaml | 2 +- 6 files changed, 96 insertions(+), 237 deletions(-) delete mode 100644 FluentAssertions.sln create mode 100644 FluentAssertions.slnx rename FluentAssertions.sln.DotSettings => FluentAssertions.slnx.DotSettings (100%) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c71f95beab..3681484b35 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -48,8 +48,8 @@ jobs: - name: Build run: | - dotnet restore FluentAssertions.sln --configfile nuget.config - dotnet build FluentAssertions.sln --configuration CI --no-restore + dotnet restore FluentAssertions.slnx --configfile nuget.config + dotnet build FluentAssertions.slnx --configuration CI --no-restore - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v4 diff --git a/.nuke/parameters.json b/.nuke/parameters.json index fc3a2420e0..9f8039c0ec 100644 --- a/.nuke/parameters.json +++ b/.nuke/parameters.json @@ -1,4 +1,4 @@ { "$schema": "./build.schema.json", - "Solution": "FluentAssertions.sln" + "Solution": "FluentAssertions.slnx" } \ No newline at end of file diff --git a/FluentAssertions.sln b/FluentAssertions.sln deleted file mode 100644 index 5c695dc3c1..0000000000 --- a/FluentAssertions.sln +++ /dev/null @@ -1,233 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 18 -VisualStudioVersion = 18.0.11205.157 d18.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E5A0B454-22D4-4694-99FF-D6A8B7DE7DA3}" - ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - Tests\Default.testsettings = Tests\Default.testsettings - Directory.Build.props = Directory.Build.props - nuget.config = nuget.config - README.md = README.md - docs\_pages\releases.md = docs\_pages\releases.md - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "Build\_build.csproj", "{364DD16C-D759-49DC-A04A-64D40205295B}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Specs", "Specs", "{963262D0-9FD5-4741-8C0E-E2F34F110EF3}" - ProjectSection(SolutionItems) = preProject - Tests\.editorconfig = Tests\.editorconfig - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssemblyA", "Tests\AssemblyA\AssemblyA.csproj", "{7144BD9D-2A5F-45B6-AC5B-E35578D03350}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssemblyB", "Tests\AssemblyB\AssemblyB.csproj", "{D9CCCAF6-FF9E-4688-9D96-645E27616AC4}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestFrameworks", "TestFrameworks", "{4D8FA213-8724-4C43-B68A-F018148D238C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XUnit2.Specs", "Tests\TestFrameworks\XUnit2.Specs\XUnit2.Specs.csproj", "{F50C8F77-3778-4432-84EC-B9B2B502E708}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{31891850-3EDC-480A-9B6C-F60540E9C90F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSTestV2.Specs", "Tests\TestFrameworks\MSTestV2.Specs\MSTestV2.Specs.csproj", "{A4E37052-5581-4E70-A9C3-FF8364B2F332}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentAssertions", "Src\FluentAssertions\FluentAssertions.csproj", "{34E3713D-C02F-4868-BBE7-47DAD2C7F03D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NUnit3.Specs", "Tests\TestFrameworks\NUnit3.Specs\NUnit3.Specs.csproj", "{C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NUnit4.Specs", "Tests\TestFrameworks\NUnit4.Specs\NUnit4.Specs.csproj", "{23891E7D-05CE-4893-AC38-A95CC9D3603E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSpec.Specs", "Tests\TestFrameworks\MSpec.Specs\MSpec.Specs.csproj", "{4F210C41-7E8E-424A-B956-FC1AA47663C9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks", "Tests\Benchmarks\Benchmarks.csproj", "{FCAFB0F1-79EA-4D49-813B-188D4BC4BE71}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Approval.Tests", "Tests\Approval.Tests\Approval.Tests.csproj", "{F5115158-A038-4D14-A04E-46E7863E40B9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentAssertions.Specs", "Tests\FluentAssertions.Specs\FluentAssertions.Specs.csproj", "{6D31FFF8-E7FD-41D2-996C-CA8DDFDAE4FD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UWP.Specs", "Tests\UWP.Specs\UWP.Specs.csproj", "{08087654-2C32-4818-95E4-45362373441D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentAssertions.Equivalency.Specs", "Tests\FluentAssertions.Equivalency.Specs\FluentAssertions.Equivalency.Specs.csproj", "{A946043D-D3F8-46A4-B485-A88412C417FE}" -EndProject -Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "VB.Specs", "Tests\VB.Specs\VB.Specs.vbproj", "{0C0211B6-D185-4518-A15A-38AC092EDC50}" -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Specs", "Tests\FSharp.Specs\FSharp.Specs.fsproj", "{0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExampleExtensions", "Tests\ExampleExtensions\ExampleExtensions.csproj", "{8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentAssertions.Extensibility.Specs", "Tests\FluentAssertions.Extensibility.Specs\FluentAssertions.Extensibility.Specs.csproj", "{450FC408-A4E2-4483-B064-2007024D6CF1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TUnit.Specs", "Tests\TestFrameworks\TUnit.Specs\TUnit.Specs.csproj", "{6540564E-9B6E-4E1E-8881-6F0DD0F35576}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnit3.Specs", "Tests\TestFrameworks\XUnit3.Specs\XUnit3.Specs.csproj", "{AF1479D8-519F-4C6B-9E8C-5A84A6D5549A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnit3Core.Specs", "Tests\TestFrameworks\XUnit3Core.Specs\XUnit3Core.Specs.csproj", "{77BB9496-169D-43DA-BCED-7DB3ACD9179A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSTestV4.Specs", "Tests\TestFrameworks\MSTestV4.Specs\MSTestV4.Specs.csproj", "{06D5201F-65F6-AA25-8592-A78668E25B66}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - CI|Any CPU = CI|Any CPU - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {364DD16C-D759-49DC-A04A-64D40205295B}.CI|Any CPU.ActiveCfg = Release|Any CPU - {364DD16C-D759-49DC-A04A-64D40205295B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {364DD16C-D759-49DC-A04A-64D40205295B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7144BD9D-2A5F-45B6-AC5B-E35578D03350}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {7144BD9D-2A5F-45B6-AC5B-E35578D03350}.CI|Any CPU.Build.0 = Debug|Any CPU - {7144BD9D-2A5F-45B6-AC5B-E35578D03350}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7144BD9D-2A5F-45B6-AC5B-E35578D03350}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7144BD9D-2A5F-45B6-AC5B-E35578D03350}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {7144BD9D-2A5F-45B6-AC5B-E35578D03350}.Release|Any CPU.Build.0 = Debug|Any CPU - {D9CCCAF6-FF9E-4688-9D96-645E27616AC4}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {D9CCCAF6-FF9E-4688-9D96-645E27616AC4}.CI|Any CPU.Build.0 = Debug|Any CPU - {D9CCCAF6-FF9E-4688-9D96-645E27616AC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D9CCCAF6-FF9E-4688-9D96-645E27616AC4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D9CCCAF6-FF9E-4688-9D96-645E27616AC4}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {D9CCCAF6-FF9E-4688-9D96-645E27616AC4}.Release|Any CPU.Build.0 = Debug|Any CPU - {F50C8F77-3778-4432-84EC-B9B2B502E708}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {F50C8F77-3778-4432-84EC-B9B2B502E708}.CI|Any CPU.Build.0 = Debug|Any CPU - {F50C8F77-3778-4432-84EC-B9B2B502E708}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F50C8F77-3778-4432-84EC-B9B2B502E708}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F50C8F77-3778-4432-84EC-B9B2B502E708}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {F50C8F77-3778-4432-84EC-B9B2B502E708}.Release|Any CPU.Build.0 = Debug|Any CPU - {A4E37052-5581-4E70-A9C3-FF8364B2F332}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {A4E37052-5581-4E70-A9C3-FF8364B2F332}.CI|Any CPU.Build.0 = Debug|Any CPU - {A4E37052-5581-4E70-A9C3-FF8364B2F332}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A4E37052-5581-4E70-A9C3-FF8364B2F332}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A4E37052-5581-4E70-A9C3-FF8364B2F332}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {A4E37052-5581-4E70-A9C3-FF8364B2F332}.Release|Any CPU.Build.0 = Debug|Any CPU - {34E3713D-C02F-4868-BBE7-47DAD2C7F03D}.CI|Any CPU.ActiveCfg = Release|Any CPU - {34E3713D-C02F-4868-BBE7-47DAD2C7F03D}.CI|Any CPU.Build.0 = Release|Any CPU - {34E3713D-C02F-4868-BBE7-47DAD2C7F03D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {34E3713D-C02F-4868-BBE7-47DAD2C7F03D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {34E3713D-C02F-4868-BBE7-47DAD2C7F03D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {34E3713D-C02F-4868-BBE7-47DAD2C7F03D}.Release|Any CPU.Build.0 = Release|Any CPU - {C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2}.CI|Any CPU.Build.0 = Debug|Any CPU - {C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2}.Release|Any CPU.Build.0 = Debug|Any CPU - {23891E7D-05CE-4893-AC38-A95CC9D3603E}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {23891E7D-05CE-4893-AC38-A95CC9D3603E}.CI|Any CPU.Build.0 = Debug|Any CPU - {23891E7D-05CE-4893-AC38-A95CC9D3603E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {23891E7D-05CE-4893-AC38-A95CC9D3603E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {23891E7D-05CE-4893-AC38-A95CC9D3603E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {23891E7D-05CE-4893-AC38-A95CC9D3603E}.Release|Any CPU.Build.0 = Release|Any CPU - {4F210C41-7E8E-424A-B956-FC1AA47663C9}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {4F210C41-7E8E-424A-B956-FC1AA47663C9}.CI|Any CPU.Build.0 = Debug|Any CPU - {4F210C41-7E8E-424A-B956-FC1AA47663C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4F210C41-7E8E-424A-B956-FC1AA47663C9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4F210C41-7E8E-424A-B956-FC1AA47663C9}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {4F210C41-7E8E-424A-B956-FC1AA47663C9}.Release|Any CPU.Build.0 = Debug|Any CPU - {FCAFB0F1-79EA-4D49-813B-188D4BC4BE71}.CI|Any CPU.ActiveCfg = Release|Any CPU - {FCAFB0F1-79EA-4D49-813B-188D4BC4BE71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FCAFB0F1-79EA-4D49-813B-188D4BC4BE71}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FCAFB0F1-79EA-4D49-813B-188D4BC4BE71}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FCAFB0F1-79EA-4D49-813B-188D4BC4BE71}.Release|Any CPU.Build.0 = Release|Any CPU - {F5115158-A038-4D14-A04E-46E7863E40B9}.CI|Any CPU.ActiveCfg = Release|Any CPU - {F5115158-A038-4D14-A04E-46E7863E40B9}.CI|Any CPU.Build.0 = Release|Any CPU - {F5115158-A038-4D14-A04E-46E7863E40B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F5115158-A038-4D14-A04E-46E7863E40B9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F5115158-A038-4D14-A04E-46E7863E40B9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F5115158-A038-4D14-A04E-46E7863E40B9}.Release|Any CPU.Build.0 = Release|Any CPU - {6D31FFF8-E7FD-41D2-996C-CA8DDFDAE4FD}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {6D31FFF8-E7FD-41D2-996C-CA8DDFDAE4FD}.CI|Any CPU.Build.0 = Debug|Any CPU - {6D31FFF8-E7FD-41D2-996C-CA8DDFDAE4FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6D31FFF8-E7FD-41D2-996C-CA8DDFDAE4FD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6D31FFF8-E7FD-41D2-996C-CA8DDFDAE4FD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6D31FFF8-E7FD-41D2-996C-CA8DDFDAE4FD}.Release|Any CPU.Build.0 = Release|Any CPU - {08087654-2C32-4818-95E4-45362373441D}.CI|Any CPU.ActiveCfg = Debug|x64 - {08087654-2C32-4818-95E4-45362373441D}.Debug|Any CPU.ActiveCfg = Debug|x64 - {08087654-2C32-4818-95E4-45362373441D}.Release|Any CPU.ActiveCfg = Release|x64 - {A946043D-D3F8-46A4-B485-A88412C417FE}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {A946043D-D3F8-46A4-B485-A88412C417FE}.CI|Any CPU.Build.0 = Debug|Any CPU - {A946043D-D3F8-46A4-B485-A88412C417FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A946043D-D3F8-46A4-B485-A88412C417FE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A946043D-D3F8-46A4-B485-A88412C417FE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A946043D-D3F8-46A4-B485-A88412C417FE}.Release|Any CPU.Build.0 = Release|Any CPU - {0C0211B6-D185-4518-A15A-38AC092EDC50}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {0C0211B6-D185-4518-A15A-38AC092EDC50}.CI|Any CPU.Build.0 = Debug|Any CPU - {0C0211B6-D185-4518-A15A-38AC092EDC50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0C0211B6-D185-4518-A15A-38AC092EDC50}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0C0211B6-D185-4518-A15A-38AC092EDC50}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0C0211B6-D185-4518-A15A-38AC092EDC50}.Release|Any CPU.Build.0 = Release|Any CPU - {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}.CI|Any CPU.Build.0 = Debug|Any CPU - {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF}.Release|Any CPU.Build.0 = Release|Any CPU - {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.CI|Any CPU.Build.0 = Debug|Any CPU - {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C}.Release|Any CPU.Build.0 = Release|Any CPU - {450FC408-A4E2-4483-B064-2007024D6CF1}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {450FC408-A4E2-4483-B064-2007024D6CF1}.CI|Any CPU.Build.0 = Debug|Any CPU - {450FC408-A4E2-4483-B064-2007024D6CF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {450FC408-A4E2-4483-B064-2007024D6CF1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {450FC408-A4E2-4483-B064-2007024D6CF1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {450FC408-A4E2-4483-B064-2007024D6CF1}.Release|Any CPU.Build.0 = Release|Any CPU - {6540564E-9B6E-4E1E-8881-6F0DD0F35576}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {6540564E-9B6E-4E1E-8881-6F0DD0F35576}.CI|Any CPU.Build.0 = Debug|Any CPU - {6540564E-9B6E-4E1E-8881-6F0DD0F35576}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6540564E-9B6E-4E1E-8881-6F0DD0F35576}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6540564E-9B6E-4E1E-8881-6F0DD0F35576}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6540564E-9B6E-4E1E-8881-6F0DD0F35576}.Release|Any CPU.Build.0 = Release|Any CPU - {AF1479D8-519F-4C6B-9E8C-5A84A6D5549A}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {AF1479D8-519F-4C6B-9E8C-5A84A6D5549A}.CI|Any CPU.Build.0 = Debug|Any CPU - {AF1479D8-519F-4C6B-9E8C-5A84A6D5549A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AF1479D8-519F-4C6B-9E8C-5A84A6D5549A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AF1479D8-519F-4C6B-9E8C-5A84A6D5549A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AF1479D8-519F-4C6B-9E8C-5A84A6D5549A}.Release|Any CPU.Build.0 = Release|Any CPU - {77BB9496-169D-43DA-BCED-7DB3ACD9179A}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {77BB9496-169D-43DA-BCED-7DB3ACD9179A}.CI|Any CPU.Build.0 = Debug|Any CPU - {77BB9496-169D-43DA-BCED-7DB3ACD9179A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {77BB9496-169D-43DA-BCED-7DB3ACD9179A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {77BB9496-169D-43DA-BCED-7DB3ACD9179A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {77BB9496-169D-43DA-BCED-7DB3ACD9179A}.Release|Any CPU.Build.0 = Release|Any CPU - {06D5201F-65F6-AA25-8592-A78668E25B66}.CI|Any CPU.ActiveCfg = Debug|Any CPU - {06D5201F-65F6-AA25-8592-A78668E25B66}.CI|Any CPU.Build.0 = Debug|Any CPU - {06D5201F-65F6-AA25-8592-A78668E25B66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {06D5201F-65F6-AA25-8592-A78668E25B66}.Debug|Any CPU.Build.0 = Debug|Any CPU - {06D5201F-65F6-AA25-8592-A78668E25B66}.Release|Any CPU.ActiveCfg = Release|Any CPU - {06D5201F-65F6-AA25-8592-A78668E25B66}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {7144BD9D-2A5F-45B6-AC5B-E35578D03350} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} - {D9CCCAF6-FF9E-4688-9D96-645E27616AC4} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} - {F50C8F77-3778-4432-84EC-B9B2B502E708} = {4D8FA213-8724-4C43-B68A-F018148D238C} - {A4E37052-5581-4E70-A9C3-FF8364B2F332} = {4D8FA213-8724-4C43-B68A-F018148D238C} - {34E3713D-C02F-4868-BBE7-47DAD2C7F03D} = {31891850-3EDC-480A-9B6C-F60540E9C90F} - {C8335EA3-C6CE-47C9-AB4F-CE37157E1EB2} = {4D8FA213-8724-4C43-B68A-F018148D238C} - {23891E7D-05CE-4893-AC38-A95CC9D3603E} = {4D8FA213-8724-4C43-B68A-F018148D238C} - {4F210C41-7E8E-424A-B956-FC1AA47663C9} = {4D8FA213-8724-4C43-B68A-F018148D238C} - {FCAFB0F1-79EA-4D49-813B-188D4BC4BE71} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} - {F5115158-A038-4D14-A04E-46E7863E40B9} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} - {6D31FFF8-E7FD-41D2-996C-CA8DDFDAE4FD} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} - {08087654-2C32-4818-95E4-45362373441D} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} - {A946043D-D3F8-46A4-B485-A88412C417FE} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} - {0C0211B6-D185-4518-A15A-38AC092EDC50} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} - {0A69DC62-CA14-44E5-BAF9-2EB2E2E2CADF} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} - {8DF4A6FE-AAD0-41E5-B2F4-34166D1B139C} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} - {450FC408-A4E2-4483-B064-2007024D6CF1} = {963262D0-9FD5-4741-8C0E-E2F34F110EF3} - {6540564E-9B6E-4E1E-8881-6F0DD0F35576} = {4D8FA213-8724-4C43-B68A-F018148D238C} - {AF1479D8-519F-4C6B-9E8C-5A84A6D5549A} = {4D8FA213-8724-4C43-B68A-F018148D238C} - {77BB9496-169D-43DA-BCED-7DB3ACD9179A} = {4D8FA213-8724-4C43-B68A-F018148D238C} - {06D5201F-65F6-AA25-8592-A78668E25B66} = {4D8FA213-8724-4C43-B68A-F018148D238C} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {75DDA3D8-9D6F-4865-93F4-DDE11DEE8290} - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = Src\FluentAssertions\FluentAssertions.csproj - EndGlobalSection -EndGlobal diff --git a/FluentAssertions.slnx b/FluentAssertions.slnx new file mode 100644 index 0000000000..ef1ac24134 --- /dev/null +++ b/FluentAssertions.slnx @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FluentAssertions.sln.DotSettings b/FluentAssertions.slnx.DotSettings similarity index 100% rename from FluentAssertions.sln.DotSettings rename to FluentAssertions.slnx.DotSettings diff --git a/qodana.yaml b/qodana.yaml index c4d518d378..d6c80a6293 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -7,7 +7,7 @@ profile: path: profile.yaml dotnet: - solution: FluentAssertions.sln + solution: FluentAssertions.slnx frameworks: "!netstandard2.0;!netstandard2.1" exclude: From 6f5fab43caaa988237ae1cd4f3e58be68070fa05 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 1 Dec 2025 16:27:49 +0100 Subject: [PATCH 742/845] Upgrade Build to use net10 --- Build/Build.cs | 4 ++-- Build/_build.csproj | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Build/Build.cs b/Build/Build.cs index 46592c0d12..3c00b8b570 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -61,7 +61,7 @@ class Build : NukeBuild readonly Solution Solution; [Required] - [GitVersion(Framework = "net9.0", NoCache = true, NoFetch = true)] + [GitVersion(Framework = "net10.0", NoCache = true, NoFetch = true)] readonly GitVersion GitVersion; [Required] @@ -228,7 +228,7 @@ class Build : NukeBuild { ReportGenerator(s => s .SetProcessToolPath(NuGetToolPathResolver.GetPackageExecutable("ReportGenerator", "ReportGenerator.dll", - framework: "net9.0")) + framework: "net10.0")) .SetTargetDirectory(TestResultsDirectory / "reports") .AddReports(TestResultsDirectory / "**/coverage.cobertura.xml") .AddReportTypes( diff --git a/Build/_build.csproj b/Build/_build.csproj index 65d6169ecc..4860af1dae 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -1,16 +1,16 @@  Exe - net9.0 + net10.0 CS0649;CS0169 ..\ ..\ - 9.0.4 + 10.1.0 1 - + From 9d9dd02209f8f29fd05e55d2f4c61a23b92238c3 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 2 Dec 2025 13:18:12 +0100 Subject: [PATCH 743/845] Fix NotSupportedException from ReduceConstantSubExpressions C# 14' "first-class spans" causes `MemoryExtensions.Contains` to be picked over `Enumerable.Contains`. `ConstantSubExpressionReductionVisitor.Visit` calls `DynamicInvoke` which then throws a `NotSupportedException` from [`RuntimeMethodInfo.ThrowNoInvokeException`](https://source.dot.net/#System.Private.CoreLib/src/libraries/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs,70) For more information see https://github.com/dotnet/runtime/issues/120251 --- ...PredicateLambdaExpressionValueFormatter.cs | 2 +- ...cateLambdaExpressionValueFormatterSpecs.cs | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs b/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs index c071948942..0180eee2c5 100644 --- a/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs @@ -42,7 +42,7 @@ private static Expression ReduceConstantSubExpressions(Expression expression) { return new ConstantSubExpressionReductionVisitor().Visit(expression); } - catch (InvalidOperationException) + catch (Exception e) when (e is InvalidOperationException or NotSupportedException) { // Fallback if we make an invalid rewrite of the expression. return expression; diff --git a/Tests/FluentAssertions.Specs/Formatting/PredicateLambdaExpressionValueFormatterSpecs.cs b/Tests/FluentAssertions.Specs/Formatting/PredicateLambdaExpressionValueFormatterSpecs.cs index f8ac7d281e..88f693d41b 100644 --- a/Tests/FluentAssertions.Specs/Formatting/PredicateLambdaExpressionValueFormatterSpecs.cs +++ b/Tests/FluentAssertions.Specs/Formatting/PredicateLambdaExpressionValueFormatterSpecs.cs @@ -95,12 +95,29 @@ public void When_condition_contains_linq_extension_method_then_extension_method_ int[] allowed = [1, 2, 3]; // Act - string result = Format(a => allowed.Contains(a)); + string result = Format(a => Enumerable.Contains(allowed, a)); // Assert result.Should().Be("value(System.Int32[]).Contains(a)"); } +#if NET6_0_OR_GREATER +#pragma warning disable RCS1196 // Do not call MemoryExtensions.Contains as extension method. This is to exercise first-class spans + [Fact] + public void Methods_using_ReadOnlySpan_can_be_formatted() + { + // Arrange + int[] allowed = [1, 2, 3]; + + // Act + string result = Format(a => MemoryExtensions.Contains(allowed, a)); + + // Assert + result.Should().Match("*.Contains(a)"); + } +#pragma warning restore RCS1196 +#endif + [Fact] public void Formatting_a_lifted_binary_operator() { From 134f8d1da51e19d22d9dc3820f0f76fc48f7b045 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 2 Dec 2025 14:40:37 +0100 Subject: [PATCH 744/845] Use `==` or `!=` when comparing Nullable against constants It generates both better IL and assembly https://sharplab.io/#v2:D4Iw9mA2AECyAMAKcUD80QEpoF4B8GuO0ALgE4CuApgNwCwAUCjLAIzISTpa4EjQBLAM6lKtRo2ZwATBzQZs+QgEJi5avSac4AZjlcFvQsOgA7MCVEagA=== --- Build/Build.cs | 2 +- Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs | 4 ++-- Src/FluentAssertions/Execution/AssertionChain.cs | 4 ++-- Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Build/Build.cs b/Build/Build.cs index 3c00b8b570..829ac29256 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -129,7 +129,7 @@ class Build : NukeBuild DotNetBuild(s => s .SetProjectFile(Solution) .SetConfiguration(Configuration) - .When(_ => GenerateBinLog is true, c => c + .When(_ => GenerateBinLog == true, c => c .SetBinaryLog(ArtifactsDirectory / $"{Solution.Core.FluentAssertions.Name}.binlog") ) .EnableNoLogo() diff --git a/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs b/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs index 86cdcda777..d4b3925a26 100644 --- a/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs +++ b/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs @@ -65,7 +65,7 @@ public EqualityStrategy GetEqualityStrategy(Type type) if ((CompareRecordsByValue != null || defaultStrategy is null) && typeKey.IsRecord()) { - return CompareRecordsByValue is true ? EqualityStrategy.ForceEquals : EqualityStrategy.ForceMembers; + return CompareRecordsByValue == true ? EqualityStrategy.ForceEquals : EqualityStrategy.ForceMembers; } if (defaultStrategy is not null) @@ -105,7 +105,7 @@ public override string ToString() { var builder = new StringBuilder(); - if (CompareRecordsByValue is true) + if (CompareRecordsByValue == true) { builder.AppendLine("- Compare records by value"); } diff --git a/Src/FluentAssertions/Execution/AssertionChain.cs b/Src/FluentAssertions/Execution/AssertionChain.cs index 7e9a3c77aa..67f437c08b 100644 --- a/Src/FluentAssertions/Execution/AssertionChain.cs +++ b/Src/FluentAssertions/Execution/AssertionChain.cs @@ -246,9 +246,9 @@ private Continuation FailWith(Func getFailureReason) { if (PreviousAssertionSucceeded) { - PreviousAssertionSucceeded = succeeded is true; + PreviousAssertionSucceeded = succeeded == true; - if (succeeded is not true) + if (succeeded != true) { string failure = getFailureReason(); diff --git a/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs b/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs index c20c11af84..6fc162b2f8 100644 --- a/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs @@ -160,7 +160,7 @@ public AndConstraint NotBe(bool? unexpected, public AndConstraint NotBeFalse([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { assertionChain - .ForCondition(Subject is not false) + .ForCondition(Subject != false) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:nullable boolean} not to be {0}{reason}, but found {1}.", false, Subject); @@ -180,7 +180,7 @@ public AndConstraint NotBeFalse([StringSyntax("CompositeFormat")] s public AndConstraint NotBeTrue([StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { assertionChain - .ForCondition(Subject is not true) + .ForCondition(Subject != true) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:nullable boolean} not to be {0}{reason}, but found {1}.", true, Subject); From c61f872e2c619a86d82d8ec5e6299ac9ca95c926 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 3 Dec 2025 19:06:09 +0100 Subject: [PATCH 745/845] Create polyfill for string.Create This resolves MA0111 suggestions https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0111.md --- .editorconfig | 4 ++++ Src/FluentAssertions/Equivalency/Comparands.cs | 4 ++-- .../Equivalency/EquivalencyValidationContext.cs | 7 +++++-- .../Equivalency/Execution/ObjectReference.cs | 4 ++-- .../Equivalency/Steps/AutoConversionStep.cs | 6 +++--- .../Steps/DictionaryEquivalencyStep.cs | 9 ++++++--- .../Steps/EnumerableEquivalencyValidator.cs | 14 +++++++++----- .../AggregateExceptionValueFormatter.cs | 4 ++-- Src/FluentAssertions/Polyfill/StringExtensions.cs | 15 +++++++++++++++ 9 files changed, 48 insertions(+), 19 deletions(-) create mode 100644 Src/FluentAssertions/Polyfill/StringExtensions.cs diff --git a/.editorconfig b/.editorconfig index e95e12d08e..09547bc855 100644 --- a/.editorconfig +++ b/.editorconfig @@ -265,6 +265,10 @@ dotnet_diagnostic.MA0006.severity = none # Rationale: See https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0009.md dotnet_diagnostic.MA0009.severity = suggestion +# Purpose: Use string.Create instead of FormattableString.Invariant +# Rationale: See https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0111.md +dotnet_diagnostic.MA0111.severity = error + # Purpose: Use an overload of 'System.ArgumentException' with the parameter name # Rationale: We don't want to force this dotnet_diagnostic.MA0015.severity = suggestion diff --git a/Src/FluentAssertions/Equivalency/Comparands.cs b/Src/FluentAssertions/Equivalency/Comparands.cs index a418a3218d..200d282322 100644 --- a/Src/FluentAssertions/Equivalency/Comparands.cs +++ b/Src/FluentAssertions/Equivalency/Comparands.cs @@ -1,6 +1,6 @@ using System; +using System.Globalization; using FluentAssertions.Common; -using static System.FormattableString; namespace FluentAssertions.Equivalency; @@ -72,6 +72,6 @@ public Type GetExpectedType(IEquivalencyOptions options) public override string ToString() { - return Invariant($"{{Subject={Subject}, Expectation={Expectation}}}"); + return string.Create(CultureInfo.InvariantCulture, $"{{Subject={Subject}, Expectation={Expectation}}}"); } } diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs index d6cee4a0cd..87478a98fa 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs @@ -1,7 +1,10 @@ +#if !NET6_0_OR_GREATER +using System; +#endif +using System.Globalization; using FluentAssertions.Equivalency.Execution; using FluentAssertions.Equivalency.Tracing; using FluentAssertions.Execution; -using static System.FormattableString; namespace FluentAssertions.Equivalency; @@ -98,6 +101,6 @@ internal void ResetTracing() public override string ToString() { - return Invariant($"{{Path=\"{CurrentNode.Subject.PathAndName}\"}}"); + return string.Create(CultureInfo.InvariantCulture, $"{{Path=\"{CurrentNode.Subject.PathAndName}\"}}"); } } diff --git a/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs b/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs index 4d68cb292d..f3910fe6d7 100644 --- a/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs +++ b/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs @@ -1,8 +1,8 @@ using System; +using System.Globalization; using System.Linq; using System.Runtime.CompilerServices; using FluentAssertions.Common; -using static System.FormattableString; namespace FluentAssertions.Equivalency.Execution; @@ -76,7 +76,7 @@ public override int GetHashCode() public override string ToString() { - return Invariant($"{{\"{path}\", {@object}}}"); + return string.Create(CultureInfo.InvariantCulture, $"{{\"{path}\", {@object}}}"); } /// diff --git a/Src/FluentAssertions/Equivalency/Steps/AutoConversionStep.cs b/Src/FluentAssertions/Equivalency/Steps/AutoConversionStep.cs index 9d45787682..aab246429f 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AutoConversionStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AutoConversionStep.cs @@ -1,7 +1,6 @@ using System; using System.Globalization; using FluentAssertions.Common; -using static System.FormattableString; namespace FluentAssertions.Equivalency.Steps; @@ -37,14 +36,15 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon if (TryChangeType(comparands.Subject, expectationType, out object convertedSubject)) { context.Tracer.WriteLine(member => - Invariant($"Converted subject {comparands.Subject} at {member.Subject} to {expectationType}")); + string.Create(CultureInfo.InvariantCulture, $"Converted subject {comparands.Subject} at {member.Subject} to {expectationType}")); comparands.Subject = convertedSubject; } else { context.Tracer.WriteLine(member => - Invariant($"Subject {comparands.Subject} at {member.Subject} could not be converted to {expectationType}")); + string.Create(CultureInfo.InvariantCulture, + $"Subject {comparands.Subject} at {member.Subject} could not be converted to {expectationType}")); } return EquivalencyResult.ContinueWithNext; diff --git a/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs index 67db86940f..edcc887fb5 100644 --- a/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs @@ -1,8 +1,11 @@ +#if !NET6_0_OR_GREATER +using System; +#endif using System.Collections; using System.Diagnostics.CodeAnalysis; +using System.Globalization; using FluentAssertions.Common; using FluentAssertions.Execution; -using static System.FormattableString; namespace FluentAssertions.Equivalency.Steps; @@ -25,14 +28,14 @@ protected override EquivalencyResult OnHandle(Comparands comparands, if (context.Options.IsRecursive) { context.Tracer.WriteLine(member => - Invariant($"Recursing into dictionary item {key} at {member.Expectation}")); + string.Create(CultureInfo.InvariantCulture, $"Recursing into dictionary item {key} at {member.Expectation}")); nestedValidator.AssertEquivalencyOf(new Comparands(subject[key], expectation[key], typeof(object)), context.AsDictionaryItem(key)); } else { context.Tracer.WriteLine(member => - Invariant( + string.Create(CultureInfo.InvariantCulture, $"Comparing dictionary item {key} at {member.Expectation} between subject and expectation")); assertionChain.WithCallerPostfix($"[{key.ToFormattedString()}]").ReuseOnce(); diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs index 11e01ebb00..b50d73f20a 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs @@ -1,9 +1,12 @@ +#if !NET6_0_OR_GREATER +using System; +#endif using System.Collections.Generic; +using System.Globalization; using System.Linq; using FluentAssertions.Equivalency.Execution; using FluentAssertions.Equivalency.Tracing; using FluentAssertions.Execution; -using static System.FormattableString; namespace FluentAssertions.Equivalency.Steps; @@ -42,14 +45,15 @@ public void Execute(object[] subject, T[] expectation) if (Recursive) { using var _ = context.Tracer.WriteBlock(member => - Invariant($"Structurally comparing {subject} and expectation {expectation} at {member.Expectation}")); + string.Create(CultureInfo.InvariantCulture, + $"Structurally comparing {subject} and expectation {expectation} at {member.Expectation}")); AssertElementGraphEquivalency(subject, expectation, context.CurrentNode); } else { using var _ = context.Tracer.WriteBlock(member => - Invariant( + string.Create(CultureInfo.InvariantCulture, $"Comparing subject {subject} and expectation {expectation} at {member.Expectation} using simple value equality")); subject.Should().BeEquivalentTo(expectation); @@ -101,7 +105,7 @@ private void AssertElementGraphEquivalencyWithStrictOrdering(object[] subject T expectation = expectations[index]; using var _ = context.Tracer.WriteBlock(member => - Invariant( + string.Create(CultureInfo.InvariantCulture, $"Strictly comparing expectation {expectation} at {member.Expectation} to item with index {index} in {subjects}")); bool succeeded = StrictlyMatchAgainst(subjects, expectation, index); @@ -128,7 +132,7 @@ private void AssertElementGraphEquivalencyWithLooseOrdering(object[] subjects T expectation = expectations[index]; using var _ = context.Tracer.WriteBlock(member => - Invariant( + string.Create(CultureInfo.InvariantCulture, $"Finding the best match of {expectation} within all items in {subjects} at {member.Expectation}[{index}]")); bool succeeded = LooselyMatchAgainst(subjects, expectation, index); diff --git a/Src/FluentAssertions/Formatting/AggregateExceptionValueFormatter.cs b/Src/FluentAssertions/Formatting/AggregateExceptionValueFormatter.cs index 5c51953044..65f3dcfb6e 100644 --- a/Src/FluentAssertions/Formatting/AggregateExceptionValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/AggregateExceptionValueFormatter.cs @@ -1,5 +1,5 @@ using System; -using static System.FormattableString; +using System.Globalization; namespace FluentAssertions.Formatting; @@ -29,7 +29,7 @@ public void Format(object value, FormattedObjectGraph formattedGraph, Formatting } else { - formattedGraph.AddLine(Invariant($"{exception.InnerExceptions.Count} (aggregated) exceptions:")); + formattedGraph.AddLine(string.Create(CultureInfo.InvariantCulture, $"{exception.InnerExceptions.Count} (aggregated) exceptions:")); foreach (Exception innerException in exception.InnerExceptions) { diff --git a/Src/FluentAssertions/Polyfill/StringExtensions.cs b/Src/FluentAssertions/Polyfill/StringExtensions.cs new file mode 100644 index 0000000000..100d7890f6 --- /dev/null +++ b/Src/FluentAssertions/Polyfill/StringExtensions.cs @@ -0,0 +1,15 @@ +#if !NET6_0_OR_GREATER +using System; +using System.Collections.Generic; + +// ReSharper disable once CheckNamespace +namespace System; + +internal static class StringExtensions +{ + extension(string) + { + public static string Create(IFormatProvider _, FormattableString formattable) => FormattableString.Invariant(formattable); + } +} +#endif From 48190e194588c6d8d2a8741372597d0dd6b50be1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 15:08:41 +0000 Subject: [PATCH 746/845] Bump cspell from 9.3.2 to 9.4.0 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 9.3.2 to 9.4.0. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.4.0/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 294 +++++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 158 insertions(+), 138 deletions(-) diff --git a/package-lock.json b/package-lock.json index 93d62490b8..38d7f24ace 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.3.2" + "cspell": "^9.4.0" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.3.2.tgz", - "integrity": "sha512-OmKzq/0FATHU671GKMzBrTyLdm25Wnziva7h4ylumVn1wnwWsXGef5bgXD7iuApqfqH9SzxsU0NtTB8m8vwEHQ==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.4.0.tgz", + "integrity": "sha512-Hm2gpMg/lRv4fKtiO2NfBiaJdFZVVb1V1a+IVhlD9qCuObLhCt60Oze2kD1dQzhbaIX756cs/eyxa5bQ5jihhQ==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.1", @@ -21,12 +21,12 @@ "@cspell/dict-aws": "^4.0.16", "@cspell/dict-bash": "^4.2.2", "@cspell/dict-companies": "^3.2.7", - "@cspell/dict-cpp": "^6.0.14", + "@cspell/dict-cpp": "^6.0.15", "@cspell/dict-cryptocurrencies": "^5.0.5", "@cspell/dict-csharp": "^4.0.7", "@cspell/dict-css": "^4.0.18", "@cspell/dict-dart": "^2.3.1", - "@cspell/dict-data-science": "^2.0.11", + "@cspell/dict-data-science": "^2.0.12", "@cspell/dict-django": "^4.1.5", "@cspell/dict-docker": "^1.1.16", "@cspell/dict-dotnet": "^5.0.10", @@ -44,7 +44,7 @@ "@cspell/dict-golang": "^6.0.24", "@cspell/dict-google": "^1.0.9", "@cspell/dict-haskell": "^4.0.6", - "@cspell/dict-html": "^4.0.12", + "@cspell/dict-html": "^4.0.13", "@cspell/dict-html-symbol-entities": "^4.0.4", "@cspell/dict-java": "^5.0.12", "@cspell/dict-julia": "^1.1.1", @@ -54,20 +54,20 @@ "@cspell/dict-lorem-ipsum": "^4.0.5", "@cspell/dict-lua": "^4.0.8", "@cspell/dict-makefile": "^1.0.5", - "@cspell/dict-markdown": "^2.0.12", + "@cspell/dict-markdown": "^2.0.13", "@cspell/dict-monkeyc": "^1.0.11", "@cspell/dict-node": "^5.0.8", - "@cspell/dict-npm": "^5.2.22", + "@cspell/dict-npm": "^5.2.25", "@cspell/dict-php": "^4.1.0", "@cspell/dict-powershell": "^5.0.15", "@cspell/dict-public-licenses": "^2.0.15", - "@cspell/dict-python": "^4.2.21", + "@cspell/dict-python": "^4.2.23", "@cspell/dict-r": "^2.1.1", "@cspell/dict-ruby": "^5.0.9", "@cspell/dict-rust": "^4.0.12", "@cspell/dict-scala": "^5.0.8", "@cspell/dict-shell": "^1.1.2", - "@cspell/dict-software-terms": "^5.1.13", + "@cspell/dict-software-terms": "^5.1.15", "@cspell/dict-sql": "^2.2.1", "@cspell/dict-svelte": "^1.0.7", "@cspell/dict-swift": "^2.0.6", @@ -81,30 +81,30 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.3.2.tgz", - "integrity": "sha512-YRgpeHN9uY8kUlIw9q+8zJ0tRTAJMbfBTGzCq9Puah09NeMWlRMFPUkXVrkdic6NA7etboZ+zEdoZwRO9EmhiA==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.4.0.tgz", + "integrity": "sha512-TpHY7t13xNhcZF9bwOfgVIhcyPDamMnxU/TBYhf4mPtXPLrZ5gBTg3UZh0/9Zn3naMjmJtngdsLvB2wai9xBlQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.3.2" + "@cspell/cspell-types": "9.4.0" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-pipe": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.3.2.tgz", - "integrity": "sha512-REF7ibG79WLEynIMUss/IRDCdYEb1nlE1rj/gt2CbPFzLa6t5MRwW2lajEvXS6/WgbMtsTVHAWi3ALqJzCwxng==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.4.0.tgz", + "integrity": "sha512-cI0sUe7SB99hJB1T6PhH/MpSrnml1kOekTCE+VH3Eb7zkVP5/mwJXs8BlufdvwBona+Cgkx6jeWlhFpxLc39Yg==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.3.2.tgz", - "integrity": "sha512-jLN2Aa/vxm8+IBvTd884SwPEfjxnDwIEPBT3hmqgLlKuUHQ3FMG27lsM4Ik9L2KWBXMgV/wGz4BaxfhKI41Ttw==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.4.0.tgz", + "integrity": "sha512-o9gbbdXlhxG2rqtGqQ7xZ8MGDDsPLbskBnTeuA++ix4Ch/HdjrBNmKReIGAEqJPfP+JGgoEKqFISHUDKAJ/ygQ==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" @@ -114,18 +114,18 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.3.2.tgz", - "integrity": "sha512-/rB8LazM0JzKL+AvZa5fEpLutmwy5QFMpzw8HJd+rDGkzb5r79hURWSRo84QArgaskUqA9XlOHSieDE9pt+WAA==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.4.0.tgz", + "integrity": "sha512-UottRlFPN6FGUfojx5HtUPZTeYXg2rf2HvO/HLh0KicirVYO16vFxTevg9MyOvw1EXSsDRz8ECANjiE7fnzBCQ==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.3.2.tgz", - "integrity": "sha512-l4H8bMAmdzCbXHO8y1JZiAKszrPEiuLFKWrbhCacHF0iP+PIc/yuQp7cO70m0p70vArRfih6kgGyHFaCy47CfA==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.4.0.tgz", + "integrity": "sha512-vSpd50OfmthBH0aRFRLA2zJFtwli3ntHA0WAOJ8tIMLUCJgF3udooRXFeX3wR8ri69C9mc3864LC4inyRC/E9w==", "license": "MIT", "engines": { "node": ">=20" @@ -165,9 +165,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-cpp": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.14.tgz", - "integrity": "sha512-dkmpSwvVfVdtoZ4mW/CK2Ep1v8mJlp6uiKpMNbSMOdJl4kq28nQS4vKNIX3B2bJa0Ha5iHHu+1mNjiLeO3g7Xg==", + "version": "6.0.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.15.tgz", + "integrity": "sha512-N7MKK3llRNoBncygvrnLaGvmjo4xzVr5FbtAc9+MFGHK6/LeSySBupr1FM72XDaVSIsmBEe7sDYCHHwlI9Jb2w==", "license": "MIT" }, "node_modules/@cspell/dict-cryptocurrencies": { @@ -186,7 +186,8 @@ "version": "4.0.18", "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.18.tgz", "integrity": "sha512-EF77RqROHL+4LhMGW5NTeKqfUd/e4OOv6EDFQ/UQQiFyWuqkEKyEz0NDILxOFxWUEVdjT2GQ2cC7t12B6pESwg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@cspell/dict-dart": { "version": "2.3.1", @@ -195,9 +196,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-data-science": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.11.tgz", - "integrity": "sha512-Dt+83nVCcF+dQyvFSaZjCKt1H5KbsVJFtH2X7VUfmIzQu8xCnV1fUmkhBzGJ+NiFs99Oy9JA6I9EjeqExzXk7g==", + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.12.tgz", + "integrity": "sha512-vI/mg6cI28IkFcpeINS7cm5M9HWemmXSTnxJiu3nmc4VAGx35SXIEyuLGBcsVzySvDablFYf4hsEpmg1XpVsUQ==", "license": "MIT" }, "node_modules/@cspell/dict-django": { @@ -303,16 +304,18 @@ "license": "MIT" }, "node_modules/@cspell/dict-html": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.12.tgz", - "integrity": "sha512-JFffQ1dDVEyJq6tCDWv0r/RqkdSnV43P2F/3jJ9rwLgdsOIXwQbXrz6QDlvQLVvNSnORH9KjDtenFTGDyzfCaA==", - "license": "MIT" + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.13.tgz", + "integrity": "sha512-vHzk2xfqQYPvoXtQtywa6ekIonPrUEwe2uftjry3UNRNl89TtzLJVSkiymKJ3WMb+W/DwKXKIb1tKzcIS8ccIg==", + "license": "MIT", + "peer": true }, "node_modules/@cspell/dict-html-symbol-entities": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.4.tgz", "integrity": "sha512-afea+0rGPDeOV9gdO06UW183Qg6wRhWVkgCFwiO3bDupAoyXRuvupbb5nUyqSTsLXIKL8u8uXQlJ9pkz07oVXw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@cspell/dict-java": { "version": "5.0.12", @@ -363,13 +366,13 @@ "license": "MIT" }, "node_modules/@cspell/dict-markdown": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.12.tgz", - "integrity": "sha512-ufwoliPijAgWkD/ivAMC+A9QD895xKiJRF/fwwknQb7kt7NozTLKFAOBtXGPJAB4UjhGBpYEJVo2elQ0FCAH9A==", + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.13.tgz", + "integrity": "sha512-rFeGikf+lVlywEp7giATUfi8myFeee6jqgbUgtdIdl/OBmRBPe5m7mKNk7yMItMZe8ICrwMxFwJy5OeTnrr6QA==", "license": "MIT", "peerDependencies": { "@cspell/dict-css": "^4.0.18", - "@cspell/dict-html": "^4.0.12", + "@cspell/dict-html": "^4.0.13", "@cspell/dict-html-symbol-entities": "^4.0.4", "@cspell/dict-typescript": "^3.2.3" } @@ -387,9 +390,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.22", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.22.tgz", - "integrity": "sha512-bepGmmRv7KmxULqfw88G9wxkpIAQA96YyrfKpfg4RHnQLxpmzoRnZGtK5S9JH7Hlf5LEd1gkOF7dtCE6cek67w==", + "version": "5.2.25", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.25.tgz", + "integrity": "sha512-jxhVxM3+ilxbum/N2ejAvVuvet1OrGeW1fD7GagAkHU/2zlzINZkJLDtXk6v1WHUjigfhiAsois3puobv/2A1A==", "license": "MIT" }, "node_modules/@cspell/dict-php": { @@ -411,12 +414,12 @@ "license": "MIT" }, "node_modules/@cspell/dict-python": { - "version": "4.2.21", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.21.tgz", - "integrity": "sha512-M9OgwXWhpZqEZqKU2psB2DFsT8q5SwEahkQeIpNIRWIErjwG7I9yYhhfvPz6s5gMCMhhb3hqcPJTnmdgqGrQyg==", + "version": "4.2.23", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.23.tgz", + "integrity": "sha512-c0C//tmG4PZWeONtTBPXa6q0ylfz3/BgEcHAR1L0BPWjNUIzTyx9J+hEIUCPYf7eAPeYjaDuTvYlg11igXXE4Q==", "license": "MIT", "dependencies": { - "@cspell/dict-data-science": "^2.0.11" + "@cspell/dict-data-science": "^2.0.12" } }, "node_modules/@cspell/dict-r": { @@ -450,9 +453,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.1.13", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.13.tgz", - "integrity": "sha512-bmWMOpqzCmmKFHM9hFC6o+GP20t2+uTuwksR3a6crHQqvNv3revzwQHorsWvSYx75xsdcvRYrAz7PqPEV/FG1g==", + "version": "5.1.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.15.tgz", + "integrity": "sha512-93VqazVvVtHuKY7seGxbfdtrnPBgZ/hZ/NmFFkBRhkRL6NavaQ6U2QsHpnlVEZN5km3DmaQy1X4ZcvNoSTK/ZQ==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -483,7 +486,8 @@ "version": "3.2.3", "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.2.3.tgz", "integrity": "sha512-zXh1wYsNljQZfWWdSPYwQhpwiuW0KPW1dSd8idjMRvSD0aSvWWHoWlrMsmZeRl4qM4QCEAjua8+cjflm41cQBg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@cspell/dict-vue": { "version": "3.0.5", @@ -498,12 +502,12 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.3.2.tgz", - "integrity": "sha512-au7FyuIHUNI2r9sO3pUBKVTeD/v7c9x/nPUStaAK1bG4rdKt4w+/jUY2IaldAraW5w29z528BboXbiV87SM1kw==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.4.0.tgz", + "integrity": "sha512-d2fjLjzrKGUIn5hWK8gMuyAh2pqXSxBqOHpU1jR3jxbrO3MilunKNijaSstv7CZn067Jpc36VfaKQodaXNZzUA==", "license": "MIT", "dependencies": { - "@cspell/url": "9.3.2", + "@cspell/url": "9.4.0", "import-meta-resolve": "^4.2.0" }, "engines": { @@ -511,32 +515,44 @@ } }, "node_modules/@cspell/filetypes": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.3.2.tgz", - "integrity": "sha512-0bUxQlmJPRHZrRQD7adbc4lFizO8tGD/6+1cBgU3kV3+NVrpr12y4jU8twCSChhYibZyPr7bnvhkM3cQgb8RzA==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.4.0.tgz", + "integrity": "sha512-RMrYHkvPF0tHVFM+T4voEhX9sfYQrd/mnNbf6+O4CWUyLCz4NQ5H9yOgEIJwEcLu4y3NESGXFef/Jn5xo0CUfg==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/strong-weak-map": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.3.2.tgz", - "integrity": "sha512-pFcmOTWCoFMRETb9PCkCmaiZiLb5i2qOZmGH/p/tFEH8kIYhMGfhaulnXwKwS+Ke6PKceQd2YL98bGmo8hL4aQ==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.4.0.tgz", + "integrity": "sha512-ui7mlXYmqElS/SmRubPBNWdkQVWgWbB6rjCurc+0owYXlnweItAMHTxC8mCWM/Au22SF1dB/JR8QBELFXLkTjQ==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.3.2.tgz", - "integrity": "sha512-TobUlZl7Z7VehhNOMNAg1ABuGizieseftlG94OZJ934JptOhK8TC/1o2ldKrbDH50jyt6E7rPTMV2BW/vWuTzQ==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.4.0.tgz", + "integrity": "sha512-nt88P6m20AaVbqMxsyPf8KqyWPaFEW2UANi0ijBxc2xTkD2KiUovxfZUYW6NMU9XBYZlovT5LztkEhst2yBcSA==", "license": "MIT", "engines": { "node": ">=20" } }, + "node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, "node_modules/array-timsort": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", @@ -625,25 +641,26 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.3.2.tgz", - "integrity": "sha512-3xFyVSTYrYa/QJzLfzsCRMkMXqOsytP8E26DuGrVMJQoLPFmbOXNNtnMu4wrtr17QVloxpvutW77U4vb2L/LDQ==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.4.0.tgz", + "integrity": "sha512-ZvXO+EY/G0/msu7jwRiVk0sXL/zB7DMJLBvjSUrK82uVbDoDxHwXxUuOz2UVnk2+J61//ldIZrjxVK8KMvaJlg==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "9.3.2", - "@cspell/cspell-pipe": "9.3.2", - "@cspell/cspell-types": "9.3.2", - "@cspell/dynamic-import": "9.3.2", - "@cspell/url": "9.3.2", + "@cspell/cspell-json-reporter": "9.4.0", + "@cspell/cspell-pipe": "9.4.0", + "@cspell/cspell-types": "9.4.0", + "@cspell/dynamic-import": "9.4.0", + "@cspell/url": "9.4.0", + "ansi-regex": "^6.2.2", "chalk": "^5.6.2", "chalk-template": "^1.1.2", "commander": "^14.0.2", - "cspell-config-lib": "9.3.2", - "cspell-dictionary": "9.3.2", - "cspell-gitignore": "9.3.2", - "cspell-glob": "9.3.2", - "cspell-io": "9.3.2", - "cspell-lib": "9.3.2", + "cspell-config-lib": "9.4.0", + "cspell-dictionary": "9.4.0", + "cspell-gitignore": "9.4.0", + "cspell-glob": "9.4.0", + "cspell-io": "9.4.0", + "cspell-lib": "9.4.0", "fast-json-stable-stringify": "^2.1.0", "flatted": "^3.3.3", "semver": "^7.7.3", @@ -661,29 +678,29 @@ } }, "node_modules/cspell-config-lib": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.3.2.tgz", - "integrity": "sha512-zXhmA4rqgWQRTVijI+g/mgiep76TvTO4d+P3CHwcqLG57BKVzoW+jkO4qDLC+Neh4b8+CcNWEIr3w16BfuEJAA==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.4.0.tgz", + "integrity": "sha512-CvQKSmK/DRIf3LpNx2sZth65pHW2AHngZqLkH3DTwnAPbiCAsE0XvCrVhvDfCNu/6uJIaa+NVHSs8GOf//DHBQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.3.2", + "@cspell/cspell-types": "9.4.0", "comment-json": "^4.4.1", "smol-toml": "^1.5.2", - "yaml": "^2.8.1" + "yaml": "^2.8.2" }, "engines": { "node": ">=20" } }, "node_modules/cspell-dictionary": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.3.2.tgz", - "integrity": "sha512-E3YhOhZzZt1a+AEbFV2B3THCyZ576PDg0mDNUDrU1Y65SyIhf4DC6itfPoAb6R3FI/DI218RqWZg/FTT8lJ2gA==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.4.0.tgz", + "integrity": "sha512-c2qscanRZChoHZFYI7KpvBMdy8i6wNwl2EflcNRrFiFOq67t9CgxLe54PafaqhrHGpBc8nElaZKciLvjj6Uscw==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.3.2", - "@cspell/cspell-types": "9.3.2", - "cspell-trie-lib": "9.3.2", + "@cspell/cspell-pipe": "9.4.0", + "@cspell/cspell-types": "9.4.0", + "cspell-trie-lib": "9.4.0", "fast-equals": "^5.3.3" }, "engines": { @@ -691,14 +708,14 @@ } }, "node_modules/cspell-gitignore": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.3.2.tgz", - "integrity": "sha512-G2bLR+Dfb9GX4Sdm75GfCCa9V/sQYkRbLckuCuVmJxvcDB0xfczAtb6TfAXIziF3oUI6cOB1g+PoNLWBelcK5w==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.4.0.tgz", + "integrity": "sha512-HMrzLmJBUMSpaMMkltlTAz/aVOrHxixyhKfg5WbFCJ5JYZO6Qu3/JU3wRoOFoud9449wRjLkvrGmbbL2+vO6Lw==", "license": "MIT", "dependencies": { - "@cspell/url": "9.3.2", - "cspell-glob": "9.3.2", - "cspell-io": "9.3.2" + "@cspell/url": "9.4.0", + "cspell-glob": "9.4.0", + "cspell-io": "9.4.0" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -708,12 +725,12 @@ } }, "node_modules/cspell-glob": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.3.2.tgz", - "integrity": "sha512-TuSupENEKyOCupOUZ3vnPxaTOghxY/rD1JIkb8e5kjzRprYVilO/rYqEk/52iLwJVd+4Npe8fNhR3KhU7u/UUg==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.4.0.tgz", + "integrity": "sha512-Q87Suj9oXrhoKck15qWorCizBjMNxG/k3NjnhKIAMrF+PdUa1Mpl0MOD+hqV1Wvwh1UHcIMYCP3bR3XpBbNx+Q==", "license": "MIT", "dependencies": { - "@cspell/url": "9.3.2", + "@cspell/url": "9.4.0", "picomatch": "^4.0.3" }, "engines": { @@ -721,13 +738,13 @@ } }, "node_modules/cspell-grammar": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.3.2.tgz", - "integrity": "sha512-ysonrFu9vJvF/derDlEjUfmvLeCfNOWPh00t6Yh093AKrJFoWQiyaS/5bEN/uB5/n1sa4k3ItnWvuTp3+YuZsA==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.4.0.tgz", + "integrity": "sha512-ie7OQ4Neflo+61bMzoLR7GtlZfMBAm2KL1U4iNqh15wUE5fDbvXeN15H5lu+gcO8BwYvC5wxZknw1x62/J8+3Q==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.3.2", - "@cspell/cspell-types": "9.3.2" + "@cspell/cspell-pipe": "9.4.0", + "@cspell/cspell-types": "9.4.0" }, "bin": { "cspell-grammar": "bin.mjs" @@ -737,39 +754,39 @@ } }, "node_modules/cspell-io": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.3.2.tgz", - "integrity": "sha512-ahoULCp0j12TyXXmIcdO/7x65A/2mzUQO1IkOC65OXEbNT+evt0yswSO5Nr1F6kCHDuEKc46EZWwsYAzj78pMg==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.4.0.tgz", + "integrity": "sha512-8w30dqlO54H9w6WGlvZhHI5kytVbF3bYPqKJAZLWKEO36L2mdpf6/abx/FA4yVLJ56wmH1x0N0ZK32wNRl5C6A==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "9.3.2", - "@cspell/url": "9.3.2" + "@cspell/cspell-service-bus": "9.4.0", + "@cspell/url": "9.4.0" }, "engines": { "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.3.2.tgz", - "integrity": "sha512-kdk11kib68zNANNICuOA8h4oA9kENQUAdeX/uvT4+7eHbHHV8WSgjXm4k4o/pRIbg164UJTX/XxKb/65ftn5jw==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.4.0.tgz", + "integrity": "sha512-ajjioE59IEDNUPawfaBpiMfGC32iKPkuYd4T9ftguuef8VvyKRifniiUi1nxwGgAhzSfxHvWs7qdT+29Pp5TMQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.3.2", - "@cspell/cspell-pipe": "9.3.2", - "@cspell/cspell-resolver": "9.3.2", - "@cspell/cspell-types": "9.3.2", - "@cspell/dynamic-import": "9.3.2", - "@cspell/filetypes": "9.3.2", - "@cspell/strong-weak-map": "9.3.2", - "@cspell/url": "9.3.2", + "@cspell/cspell-bundled-dicts": "9.4.0", + "@cspell/cspell-pipe": "9.4.0", + "@cspell/cspell-resolver": "9.4.0", + "@cspell/cspell-types": "9.4.0", + "@cspell/dynamic-import": "9.4.0", + "@cspell/filetypes": "9.4.0", + "@cspell/strong-weak-map": "9.4.0", + "@cspell/url": "9.4.0", "clear-module": "^4.1.2", - "cspell-config-lib": "9.3.2", - "cspell-dictionary": "9.3.2", - "cspell-glob": "9.3.2", - "cspell-grammar": "9.3.2", - "cspell-io": "9.3.2", - "cspell-trie-lib": "9.3.2", + "cspell-config-lib": "9.4.0", + "cspell-dictionary": "9.4.0", + "cspell-glob": "9.4.0", + "cspell-grammar": "9.4.0", + "cspell-io": "9.4.0", + "cspell-trie-lib": "9.4.0", "env-paths": "^3.0.0", "gensequence": "^8.0.8", "import-fresh": "^3.3.1", @@ -783,13 +800,13 @@ } }, "node_modules/cspell-trie-lib": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.3.2.tgz", - "integrity": "sha512-1Af7Mq9jIccFQyJl/ZCcqQbtJwuDqpQVkk8xfs/92x4OI6gW1iTVRMtsrh0RTw1HZoR8aQD7tRRCiLPf/D+UiQ==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.4.0.tgz", + "integrity": "sha512-bySJTm8XDiJAoC1MDo4lE/KpSNxydo13ZETC8TF7Hb3rbWI1c6o5eZ4+i/tkG3M94OvKV91+MeAvoMCe7GGgAw==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.3.2", - "@cspell/cspell-types": "9.3.2", + "@cspell/cspell-pipe": "9.4.0", + "@cspell/cspell-types": "9.4.0", "gensequence": "^8.0.8" }, "engines": { @@ -1037,15 +1054,18 @@ } }, "node_modules/yaml": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", - "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", + "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", "license": "ISC", "bin": { "yaml": "bin.mjs" }, "engines": { "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" } } } diff --git a/package.json b/package.json index 4623516afa..a172e3703a 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.3.2" + "cspell": "^9.4.0" } } From b19d840c603f8c5a4587370e14f344fc21cbe023 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 14 Dec 2025 21:06:47 +0100 Subject: [PATCH 747/845] Also mention the global configuration options in the docs. --- docs/_pages/upgradingtov8.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/_pages/upgradingtov8.md b/docs/_pages/upgradingtov8.md index 323a81ede1..685b49f294 100644 --- a/docs/_pages/upgradingtov8.md +++ b/docs/_pages/upgradingtov8.md @@ -151,6 +151,14 @@ Notice the last argument to the `AndWhichConstraint` constructor. If you need to do so, please refer to [FluentAssertions.Web](https://github.com/adrianiftode/FluentAssertions.Web) which offers a bunch of extensions on the HTTP specific types. +## AssertionOptions has become AssertionConfiguration +Since the various configurations options in versions before v8 had become a bit messy, we consolidated all of those under the `AssertionConfiguration.Current` construct. For example, to the set the global equivalency behavior, you can use something like + +```csharp +AssertionConfiguration.Current.Equivalency.Modify(options => options. + ComparingByValue()); +``` + ## Other breaking changes Check out the [release notes](releases.md) for other changes that might affect the upgrade to v8. From e830ef71a4b3d353fa90e2bb616371dde4a88b97 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 15:08:07 +0000 Subject: [PATCH 748/845] Bump actions/cache from 4 to 5 Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/cache dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d08bb5c8da..e16f3b1d8c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: 10.0.x - name: Cache .nuke/temp - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: | .nuke/temp From 45ea64fae29f864e7d099fce71bde815695322d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 15:08:03 +0000 Subject: [PATCH 749/845] Bump actions/upload-artifact from 5 to 6 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e16f3b1d8c..ad7ee6c2fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,7 +69,7 @@ jobs: - name: Upload artifacts if: always() - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: windows-artifacts path: | @@ -102,7 +102,7 @@ jobs: - name: Upload artifacts if: always() - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: ${{ runner.os }}-artifacts path: | From 55508046f86601b5fcb44849aeb4ffbf5104a019 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 15:07:58 +0000 Subject: [PATCH 750/845] Bump actions/download-artifact from 6 to 7 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6 to 7. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad7ee6c2fe..77c00d8901 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -119,7 +119,7 @@ jobs: steps: - name: Download Artifacts - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 with: path: artifacts From 2b53ee25aecdf7e1fb08e0948556fbeebf21f7be Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Dec 2025 17:33:21 +0100 Subject: [PATCH 751/845] Use Guard.ThrowIfArgumentIsNull --- .../Equivalency/Steps/EqualityComparerEquivalencyStep.cs | 5 +++-- Src/FluentAssertions/Execution/AssertionScope.cs | 4 ++-- Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs | 6 ++++-- Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs | 3 ++- .../Specialized/TaskCompletionSourceAssertionsBase.cs | 3 ++- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs index 6bd954d16b..1330b54089 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs @@ -1,5 +1,5 @@ -using System; using System.Collections.Generic; +using FluentAssertions.Common; using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Steps; @@ -10,7 +10,8 @@ public class EqualityComparerEquivalencyStep : IEquivalencyStep public EqualityComparerEquivalencyStep(IEqualityComparer comparer) { - this.comparer = comparer ?? throw new ArgumentNullException(nameof(comparer)); + Guard.ThrowIfArgumentIsNull(comparer); + this.comparer = comparer; } public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, diff --git a/Src/FluentAssertions/Execution/AssertionScope.cs b/Src/FluentAssertions/Execution/AssertionScope.cs index 53c56c0c79..b2b4dbf604 100644 --- a/Src/FluentAssertions/Execution/AssertionScope.cs +++ b/Src/FluentAssertions/Execution/AssertionScope.cs @@ -69,11 +69,11 @@ public AssertionScope(Func name) /// is . private AssertionScope(Func name, IAssertionStrategy assertionStrategy) { + Guard.ThrowIfArgumentIsNull(assertionStrategy); parent = CurrentScope.Value; CurrentScope.Value = this; - this.assertionStrategy = assertionStrategy - ?? throw new ArgumentNullException(nameof(assertionStrategy)); + this.assertionStrategy = assertionStrategy; if (parent is not null) { diff --git a/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs b/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs index fe662c0424..8a79abd9af 100644 --- a/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs +++ b/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs @@ -26,9 +26,11 @@ private protected DelegateAssertionsBase(TDelegate @delegate, IExtractExceptions IClock clock) : base(@delegate, assertionChain) { + Guard.ThrowIfArgumentIsNull(extractor); + Guard.ThrowIfArgumentIsNull(clock); this.assertionChain = assertionChain; - Extractor = extractor ?? throw new ArgumentNullException(nameof(extractor)); - Clock = clock ?? throw new ArgumentNullException(nameof(clock)); + Extractor = extractor; + Clock = clock; } private protected IClock Clock { get; } diff --git a/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs b/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs index b87cd19fc3..327fba2433 100644 --- a/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs @@ -21,7 +21,8 @@ public class ExecutionTimeAssertions /// The execution on which time must be asserted. public ExecutionTimeAssertions(ExecutionTime executionTime, AssertionChain assertionChain) { - execution = executionTime ?? throw new ArgumentNullException(nameof(executionTime)); + Guard.ThrowIfArgumentIsNull(executionTime); + execution = executionTime; this.assertionChain = assertionChain; } diff --git a/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertionsBase.cs b/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertionsBase.cs index 7cb21a8c39..e1e69ea94a 100644 --- a/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertionsBase.cs +++ b/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertionsBase.cs @@ -14,7 +14,8 @@ public class TaskCompletionSourceAssertionsBase { protected TaskCompletionSourceAssertionsBase(IClock clock) { - Clock = clock ?? throw new ArgumentNullException(nameof(clock)); + Guard.ThrowIfArgumentIsNull(clock); + Clock = clock; } private protected IClock Clock { get; } From be9d55cdf10a08892a7febd7f16b21851dce997d Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Dec 2025 17:54:30 +0100 Subject: [PATCH 752/845] Simplify range checks --- Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs | 3 +-- Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs index 83d27c8ad0..ffe944f88c 100644 --- a/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs @@ -263,8 +263,7 @@ public AndConstraint NotBeExactly(DateTimeOffset? unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { assertionChain - .ForCondition(!((Subject == null && unexpected == null) || - (Subject != null && unexpected != null && Subject.Value.EqualsExact(unexpected.Value)))) + .ForCondition(!(Subject.HasValue == unexpected.HasValue && Subject.GetValueOrDefault().EqualsExact(unexpected.GetValueOrDefault()))) .BecauseOf(because, becauseArgs) .FailWith("Did not expect {context:the date and time} to be exactly {0}{reason}, but it was.", unexpected); diff --git a/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs b/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs index 634feee5a7..8441b5e06c 100644 --- a/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs +++ b/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs @@ -249,7 +249,7 @@ public AndConstraint BeCloseTo(TimeSpan nearbyTime, TimeSpan precis TimeSpan maximumValue = nearbyTime + precision; assertionChain - .ForCondition(Subject >= minimumValue && Subject.Value <= maximumValue) + .ForCondition(Subject >= minimumValue && Subject <= maximumValue) .BecauseOf(because, becauseArgs) .FailWith("Expected {context:time} to be within {0} from {1}{reason}, but found {2}.", precision, From 8377cf81175fbc6b4c047073b414a4886d3dab0f Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Dec 2025 17:57:17 +0100 Subject: [PATCH 753/845] Simplify IsBrowsable Avoids a call to Nullable.Value https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA+ABADAAgwRgDoBhCAWwAcIA7GagFwFkIATGAGwG4BYAKGzxEASjABm7GGHoBLGj159pDGFGoBDdngBMOAApQIFFfQCefAN58c1nBSjSAbmvowcsNSxrsTeg0aimAJLUohC2fsYmwaHyNuGOzq7AEBDsAPw40gDOAEIGAO5ZasASnNZ8VjYYAMw4yak4gbkFRSUwldaWvHFxAOYw9B09XT2jmc0QhcUSOGlpALxDYz12hpHREIQA4gPEAK5Z9OQAgvT09sB7LgA8AKIs0kdQeZOtEqfn0pcuAHwAFABKcY4agQeg4cw4ADK9ESIBw90e0BeUzaMMShAAcjAHCocABfeRLMYYADs4xRbxghAAaho9jBYmN8UMWd0bEManUUpompTpjBsfkcPMfsTrNl+W1ZgtwmsAlEQpsdvR9ocTmcLlcYHcHk8pe9NV9tf8gdkQWCIdDYS54Yj9S0BeiXFicXjCXw2UA=== --- Src/FluentAssertions/Equivalency/Property.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Property.cs b/Src/FluentAssertions/Equivalency/Property.cs index 33cce0a884..09a8b106e8 100644 --- a/Src/FluentAssertions/Equivalency/Property.cs +++ b/Src/FluentAssertions/Equivalency/Property.cs @@ -45,14 +45,6 @@ public object GetValue(object obj) public CSharpAccessModifier SetterAccessibility => propertyInfo.GetSetMethod(nonPublic: true).GetCSharpAccessModifier(); - public bool IsBrowsable - { - get - { - isBrowsable ??= - propertyInfo.GetCustomAttribute() is not { State: EditorBrowsableState.Never }; - - return isBrowsable.Value; - } - } + public bool IsBrowsable => + isBrowsable ??= propertyInfo.GetCustomAttribute() is not { State: EditorBrowsableState.Never }; } From 83691a82434ba068efd6d594a85bfa73ee9c38b7 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 17 Dec 2025 10:44:22 +0100 Subject: [PATCH 754/845] Restrict mutability --- Src/FluentAssertions/Equivalency/Field.cs | 2 +- Src/FluentAssertions/Equivalency/INode.cs | 2 +- Src/FluentAssertions/Equivalency/Node.cs | 8 ++++---- .../Equivalency/Steps/EnumerableEquivalencyValidator.cs | 5 ++--- Src/FluentAssertions/Primitives/StringEqualityStrategy.cs | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Field.cs b/Src/FluentAssertions/Equivalency/Field.cs index fc3d00a2fd..e8d440985f 100644 --- a/Src/FluentAssertions/Equivalency/Field.cs +++ b/Src/FluentAssertions/Equivalency/Field.cs @@ -33,7 +33,7 @@ public object GetValue(object obj) return fieldInfo.GetValue(obj); } - public Type DeclaringType { get; set; } + public Type DeclaringType { get; } public CSharpAccessModifier GetterAccessibility => fieldInfo.GetCSharpAccessModifier(); diff --git a/Src/FluentAssertions/Equivalency/INode.cs b/Src/FluentAssertions/Equivalency/INode.cs index 102760f49f..9434efdee3 100644 --- a/Src/FluentAssertions/Equivalency/INode.cs +++ b/Src/FluentAssertions/Equivalency/INode.cs @@ -30,7 +30,7 @@ public interface INode /// /// Gets the path from the root of the subject upto and including the current node. /// - Pathway Subject { get; internal set; } + Pathway Subject { get; } /// /// Gets the path from the root of the expectation upto and including the current node. diff --git a/Src/FluentAssertions/Equivalency/Node.cs b/Src/FluentAssertions/Equivalency/Node.cs index ecf5a1e389..d269b75a50 100644 --- a/Src/FluentAssertions/Equivalency/Node.cs +++ b/Src/FluentAssertions/Equivalency/Node.cs @@ -18,14 +18,14 @@ public GetSubjectId GetSubjectId protected init => field = value; } - public Type Type { get; protected set; } + public Type Type { get; init; } - public Type ParentType { get; protected set; } + public Type ParentType { get; init; } public Pathway Subject { get; - set + protected set { field = value; Expectation ??= value; @@ -46,7 +46,7 @@ public bool IsRoot private bool IsFirstIndex => MatchFirstIndex.IsMatch(Subject.PathAndName); - public bool RootIsCollection { get; protected set; } + public bool RootIsCollection { get; init; } public void AdjustForRemappedSubject(IMember subjectMember) { diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs index b50d73f20a..05b7b47631 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs @@ -31,12 +31,11 @@ public EnumerableEquivalencyValidator(AssertionChain assertionChain, IValidateCh this.assertionChain = assertionChain; this.parent = parent; this.context = context; - Recursive = false; } - public bool Recursive { get; init; } + public required bool Recursive { get; init; } - public OrderingRuleCollection OrderingRules { get; init; } + public required OrderingRuleCollection OrderingRules { get; init; } public void Execute(object[] subject, T[] expectation) { diff --git a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs index 53ccb28ef0..b7c23f0293 100644 --- a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs @@ -23,7 +23,7 @@ public StringEqualityStrategy(IEqualityComparer comparer, string predica /// Gets a value indicating whether the differences between string properties should /// include the full values of the subject and expectation instead of just the fragment that differs. /// - public bool IncludeFullDetails { get; set; } = true; + public bool IncludeFullDetails { get; init; } = true; public void AssertForEquality(AssertionChain assertionChain, string subject, string expected) { From 3e2db170953b47580404e3b1dc2a2d50103aa37e Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Dec 2025 17:58:51 +0100 Subject: [PATCH 755/845] Whitespace --- Src/FluentAssertions/Equivalency/Field.cs | 2 +- Src/FluentAssertions/Equivalency/Property.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Field.cs b/Src/FluentAssertions/Equivalency/Field.cs index e8d440985f..1aa33d79e4 100644 --- a/Src/FluentAssertions/Equivalency/Field.cs +++ b/Src/FluentAssertions/Equivalency/Field.cs @@ -18,7 +18,7 @@ public Field(FieldInfo fieldInfo, INode parent) this.fieldInfo = fieldInfo; DeclaringType = fieldInfo.DeclaringType; ReflectedType = fieldInfo.ReflectedType; - Subject = new Pathway(parent.Subject.PathAndName, fieldInfo.Name, pathAndName => $"field {parent.GetSubjectId().Combine(pathAndName)}"); + Subject = new Pathway(parent.Subject.PathAndName, fieldInfo.Name, pathAndName => $"field {parent.GetSubjectId().Combine(pathAndName)}"); Expectation = new Pathway(parent.Expectation.PathAndName, fieldInfo.Name, pathAndName => $"field {pathAndName}"); GetSubjectId = parent.GetSubjectId; Type = fieldInfo.FieldType; diff --git a/Src/FluentAssertions/Equivalency/Property.cs b/Src/FluentAssertions/Equivalency/Property.cs index 09a8b106e8..4655f8905c 100644 --- a/Src/FluentAssertions/Equivalency/Property.cs +++ b/Src/FluentAssertions/Equivalency/Property.cs @@ -24,7 +24,7 @@ public Property(Type reflectedType, PropertyInfo propertyInfo, INode parent) ReflectedType = reflectedType; this.propertyInfo = propertyInfo; DeclaringType = propertyInfo.DeclaringType; - Subject = new Pathway(parent.Subject.PathAndName, propertyInfo.Name, pathAndName => $"property {parent.GetSubjectId().Combine(pathAndName)}"); + Subject = new Pathway(parent.Subject.PathAndName, propertyInfo.Name, pathAndName => $"property {parent.GetSubjectId().Combine(pathAndName)}"); Expectation = new Pathway(parent.Expectation.PathAndName, propertyInfo.Name, pathAndName => $"property {pathAndName}"); Type = propertyInfo.PropertyType; ParentType = propertyInfo.DeclaringType; From 3cb5b698fdfc4f3d8ec29c9584ded33caee70773 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 16 Dec 2025 18:19:50 +0100 Subject: [PATCH 756/845] Simplify marker class --- .../Equivalency/Tracing/InternalTraceWriter.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Tracing/InternalTraceWriter.cs b/Src/FluentAssertions/Equivalency/Tracing/InternalTraceWriter.cs index 1df987b6ae..6c3b2d8b51 100644 --- a/Src/FluentAssertions/Equivalency/Tracing/InternalTraceWriter.cs +++ b/Src/FluentAssertions/Equivalency/Tracing/InternalTraceWriter.cs @@ -1,5 +1,3 @@ namespace FluentAssertions.Equivalency.Tracing; -internal sealed class InternalTraceWriter : StringBuilderTraceWriter -{ -} +internal sealed class InternalTraceWriter : StringBuilderTraceWriter; From 5ef1bfaf19b8d95549a723beb77a53933ed9c9d1 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 17 Dec 2025 11:31:42 +0100 Subject: [PATCH 757/845] BenchmarkDotNet 0.15.6 -> 0.15.8 --- Tests/Benchmarks/Benchmarks.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Benchmarks/Benchmarks.csproj b/Tests/Benchmarks/Benchmarks.csproj index e8e910a74a..6e0c1bccfb 100644 --- a/Tests/Benchmarks/Benchmarks.csproj +++ b/Tests/Benchmarks/Benchmarks.csproj @@ -1,4 +1,4 @@ - + net472;net8.0 True @@ -9,7 +9,7 @@ - + From 2e71d4b7e4277cdf808b8d67bffb941b1edd327c Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 17 Dec 2025 11:32:24 +0100 Subject: [PATCH 758/845] Meziantou.Analyzer 2.0.253 -> 2.0.260 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 47e23ab53b..7df86eda47 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 92b55299b7b7125201f16e78c639649a187c93e6 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 17 Dec 2025 11:37:37 +0100 Subject: [PATCH 759/845] PublicApiGenerator 11.5.0 -> 11.5.4 --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 72d4abb5b4..abcd166f22 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -11,7 +11,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + From 19b21a935739ddfd005b96939acb11cdfd49febb Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 17 Dec 2025 11:38:11 +0100 Subject: [PATCH 760/845] Roslynator.Analyzers 4.14.1 -> 4.15.0 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 7df86eda47..eb3303cc88 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From f40ad201947f043f83ba3843e98df0b4d7a09fea Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 17 Dec 2025 11:38:47 +0100 Subject: [PATCH 761/845] SharpCompress 0.41.0 -> 0.42.1 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 4860af1dae..91e102a790 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -17,6 +17,6 @@ - + From 07ded902b1e8d38b72ee041cf898f9457d29065a Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 17 Dec 2025 11:40:24 +0100 Subject: [PATCH 762/845] xunit.v3 3.2.0 -> 3.2.1 --- Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj index 5ab067f3d3..88097f9f53 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -9,7 +9,7 @@ - + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index c571821156..cf8470a62a 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -9,7 +9,7 @@ - + From 257ee2158bec4cfe42f421568e7052d74ecb7fc6 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 17 Dec 2025 11:41:35 +0100 Subject: [PATCH 763/845] TUnit 1.1.27 -> 1.5.60 --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index bb17d04143..3dd7c50b35 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -11,7 +11,7 @@ - + From a980fcc665bdabc0870bb9b9ee16d8c83031437f Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 17 Dec 2025 11:42:13 +0100 Subject: [PATCH 764/845] Verify.Xunit 31.7.1 -> 31.8.0 --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index abcd166f22..59464305e9 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -13,7 +13,7 @@ - + From 2078e605ed869119504692d9919eafddebdeac67 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 17 Dec 2025 11:47:11 +0100 Subject: [PATCH 765/845] ReportGenerator 5.5.0 -> 5.5.1 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 91e102a790..a1e6784b97 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -11,7 +11,7 @@ - + From b78418190e824945a83612e412f75d5469241610 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Wed, 17 Dec 2025 11:28:50 +0100 Subject: [PATCH 766/845] Suppress `UnassignedGetOnlyAutoProperty` for `Node.GetHashCode` The analyzer is correct that `GetHashCode()` shouldn't use mutable members. See https://www.jetbrains.com/help/rider/NonReadonlyMemberInGetHashCode.html for more details. For `Node` however, we only use `GetHashCode()` when calling `Union()` in `AllPropertiesSelectionRule` and `AllFieldsSelectionRule`. So we should be safe. --- Src/FluentAssertions/Equivalency/Node.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Src/FluentAssertions/Equivalency/Node.cs b/Src/FluentAssertions/Equivalency/Node.cs index d269b75a50..896993c5a2 100644 --- a/Src/FluentAssertions/Equivalency/Node.cs +++ b/Src/FluentAssertions/Equivalency/Node.cs @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text.RegularExpressions; using FluentAssertions.Common; @@ -135,6 +136,7 @@ public override bool Equals(object obj) private bool Equals(Node other) => (Type, Subject.Name, Subject.Path) == (other.Type, other.Subject.Name, other.Subject.Path); + [SuppressMessage("ReSharper", "UnassignedGetOnlyAutoProperty")] public override int GetHashCode() { unchecked From de3df8f1bf1c375c549e94d6cde085f74a9820f3 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Thu, 18 Dec 2025 09:08:42 +0100 Subject: [PATCH 767/845] Use `NonReadonlyMemberInGetHashCode` I used the wrong suppression in #3138 --- Src/FluentAssertions/Equivalency/Node.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/FluentAssertions/Equivalency/Node.cs b/Src/FluentAssertions/Equivalency/Node.cs index 896993c5a2..0bcad601a2 100644 --- a/Src/FluentAssertions/Equivalency/Node.cs +++ b/Src/FluentAssertions/Equivalency/Node.cs @@ -136,7 +136,7 @@ public override bool Equals(object obj) private bool Equals(Node other) => (Type, Subject.Name, Subject.Path) == (other.Type, other.Subject.Name, other.Subject.Path); - [SuppressMessage("ReSharper", "UnassignedGetOnlyAutoProperty")] + [SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")] public override int GetHashCode() { unchecked From 4b47f5144a017e8e99d2b15299e71f140753a130 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Dec 2025 15:06:10 +0000 Subject: [PATCH 768/845] Bump JetBrains/qodana-action from 2025.2 to 2025.3 Bumps [JetBrains/qodana-action](https://github.com/jetbrains/qodana-action) from 2025.2 to 2025.3. - [Release notes](https://github.com/jetbrains/qodana-action/releases) - [Commits](https://github.com/jetbrains/qodana-action/compare/v2025.2...v2025.3) --- updated-dependencies: - dependency-name: JetBrains/qodana-action dependency-version: '2025.3' dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index 429656cdd4..02898b7683 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2025.2 + uses: JetBrains/qodana-action@v2025.3 with: upload-result: ${{ github.ref_name == 'main' || github.ref_name == 'develop' }} args: --baseline,qodana.sarif.json,--ide,QDNET From a0ac10287ec3165f17cf1c62b58338ab99dcd2e8 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 22 Dec 2025 16:42:52 +0100 Subject: [PATCH 769/845] Use compiler-generated `paramName` parameter --- Src/FluentAssertions/AssertionExtensions.cs | 2 +- .../Xml/XDocumentAssertions.cs | 20 ++++++------- .../Xml/XElementAssertions.cs | 28 +++++++++---------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Src/FluentAssertions/AssertionExtensions.cs b/Src/FluentAssertions/AssertionExtensions.cs index 624adec0b6..34583ce90a 100644 --- a/Src/FluentAssertions/AssertionExtensions.cs +++ b/Src/FluentAssertions/AssertionExtensions.cs @@ -884,7 +884,7 @@ public static IMonitor Monitor(this T eventSource) /// is . public static IMonitor Monitor(this T eventSource, Action configureOptions) { - Guard.ThrowIfArgumentIsNull(configureOptions, nameof(configureOptions)); + Guard.ThrowIfArgumentIsNull(configureOptions); var options = new EventMonitorOptions(); configureOptions(options); diff --git a/Src/FluentAssertions/Xml/XDocumentAssertions.cs b/Src/FluentAssertions/Xml/XDocumentAssertions.cs index e3ce0a033d..235a997d5e 100644 --- a/Src/FluentAssertions/Xml/XDocumentAssertions.cs +++ b/Src/FluentAssertions/Xml/XDocumentAssertions.cs @@ -364,7 +364,7 @@ public AndWhichConstraint> HaveElemen public AndConstraint NotHaveElement(string unexpectedElement, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Guard.ThrowIfArgumentIsNull(unexpectedElement, nameof(unexpectedElement)); + Guard.ThrowIfArgumentIsNull(unexpectedElement); return NotHaveElement(XNamespace.None + unexpectedElement, because, becauseArgs); } @@ -385,7 +385,7 @@ public AndConstraint NotHaveElement(string unexpectedElemen public AndConstraint NotHaveElement(XName unexpectedElement, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Guard.ThrowIfArgumentIsNull(unexpectedElement, nameof(unexpectedElement)); + Guard.ThrowIfArgumentIsNull(unexpectedElement); assertionChain .BecauseOf(because, becauseArgs) @@ -420,8 +420,8 @@ public AndConstraint NotHaveElement(XName unexpectedElement public AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Guard.ThrowIfArgumentIsNull(expectedElement, nameof(expectedElement)); - Guard.ThrowIfArgumentIsNull(expectedValue, nameof(expectedValue)); + Guard.ThrowIfArgumentIsNull(expectedElement); + Guard.ThrowIfArgumentIsNull(expectedValue); return HaveElementWithValue(XNamespace.None + expectedElement, expectedValue, because, becauseArgs); } @@ -446,8 +446,8 @@ public AndWhichConstraint HaveElementWithValue(st public AndWhichConstraint HaveElementWithValue(XName expectedElement, string expectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Guard.ThrowIfArgumentIsNull(expectedElement, nameof(expectedElement)); - Guard.ThrowIfArgumentIsNull(expectedValue, nameof(expectedValue)); + Guard.ThrowIfArgumentIsNull(expectedElement); + Guard.ThrowIfArgumentIsNull(expectedValue); IEnumerable xElements = []; @@ -495,8 +495,8 @@ public AndWhichConstraint HaveElementWithValue(XN public AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Guard.ThrowIfArgumentIsNull(unexpectedElement, nameof(unexpectedElement)); - Guard.ThrowIfArgumentIsNull(unexpectedValue, nameof(unexpectedValue)); + Guard.ThrowIfArgumentIsNull(unexpectedElement); + Guard.ThrowIfArgumentIsNull(unexpectedValue); return NotHaveElementWithValue(XNamespace.None + unexpectedElement, unexpectedValue, because, becauseArgs); } @@ -521,8 +521,8 @@ public AndConstraint NotHaveElementWithValue(string unexpec public AndConstraint NotHaveElementWithValue(XName unexpectedElement, string unexpectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Guard.ThrowIfArgumentIsNull(unexpectedElement, nameof(unexpectedElement)); - Guard.ThrowIfArgumentIsNull(unexpectedValue, nameof(unexpectedValue)); + Guard.ThrowIfArgumentIsNull(unexpectedElement); + Guard.ThrowIfArgumentIsNull(unexpectedValue); assertionChain .BecauseOf(because, becauseArgs) diff --git a/Src/FluentAssertions/Xml/XElementAssertions.cs b/Src/FluentAssertions/Xml/XElementAssertions.cs index 5570c5f2ef..659e398d98 100644 --- a/Src/FluentAssertions/Xml/XElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XElementAssertions.cs @@ -367,8 +367,8 @@ public AndConstraint HaveAttributeWithValue(XName expectedNa public AndConstraint NotHaveAttributeWithValue(string unexpectedName, string unexpectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Guard.ThrowIfArgumentIsNullOrEmpty(unexpectedName, nameof(unexpectedName)); - Guard.ThrowIfArgumentIsNull(unexpectedValue, nameof(unexpectedValue)); + Guard.ThrowIfArgumentIsNullOrEmpty(unexpectedName); + Guard.ThrowIfArgumentIsNull(unexpectedValue); return NotHaveAttributeWithValue(XNamespace.None + unexpectedName, unexpectedValue, because, becauseArgs); } @@ -390,8 +390,8 @@ public AndConstraint NotHaveAttributeWithValue(string unexpe public AndConstraint NotHaveAttributeWithValue(XName unexpectedName, string unexpectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Guard.ThrowIfArgumentIsNull(unexpectedName, nameof(unexpectedName)); - Guard.ThrowIfArgumentIsNull(unexpectedValue, nameof(unexpectedValue)); + Guard.ThrowIfArgumentIsNull(unexpectedName); + Guard.ThrowIfArgumentIsNull(unexpectedValue); string unexpectedText = unexpectedName.ToString(); @@ -574,7 +574,7 @@ public AndWhichConstraint> HaveElement public AndConstraint NotHaveElement(string unexpectedElement, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Guard.ThrowIfArgumentIsNull(unexpectedElement, nameof(unexpectedElement)); + Guard.ThrowIfArgumentIsNull(unexpectedElement); return NotHaveElement(XNamespace.None + unexpectedElement, because, becauseArgs); } @@ -595,7 +595,7 @@ public AndConstraint NotHaveElement(string unexpectedElement public AndConstraint NotHaveElement(XName unexpectedElement, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Guard.ThrowIfArgumentIsNull(unexpectedElement, nameof(unexpectedElement)); + Guard.ThrowIfArgumentIsNull(unexpectedElement); assertionChain .ForCondition(Subject is not null) @@ -636,8 +636,8 @@ public AndConstraint NotHaveElement(XName unexpectedElement, public AndWhichConstraint HaveElementWithValue(string expectedElement, string expectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Guard.ThrowIfArgumentIsNull(expectedElement, nameof(expectedElement)); - Guard.ThrowIfArgumentIsNull(expectedValue, nameof(expectedValue)); + Guard.ThrowIfArgumentIsNull(expectedElement); + Guard.ThrowIfArgumentIsNull(expectedValue); return HaveElementWithValue(XNamespace.None + expectedElement, expectedValue, because, becauseArgs); } @@ -662,8 +662,8 @@ public AndWhichConstraint HaveElementWithValue(str public AndWhichConstraint HaveElementWithValue(XName expectedElement, string expectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Guard.ThrowIfArgumentIsNull(expectedElement, nameof(expectedElement)); - Guard.ThrowIfArgumentIsNull(expectedValue, nameof(expectedValue)); + Guard.ThrowIfArgumentIsNull(expectedElement); + Guard.ThrowIfArgumentIsNull(expectedValue); IEnumerable xElements = []; @@ -713,8 +713,8 @@ public AndWhichConstraint HaveElementWithValue(XNa public AndConstraint NotHaveElementWithValue(string unexpectedElement, string unexpectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Guard.ThrowIfArgumentIsNull(unexpectedElement, nameof(unexpectedElement)); - Guard.ThrowIfArgumentIsNull(unexpectedValue, nameof(unexpectedValue)); + Guard.ThrowIfArgumentIsNull(unexpectedElement); + Guard.ThrowIfArgumentIsNull(unexpectedValue); return NotHaveElementWithValue(XNamespace.None + unexpectedElement, unexpectedValue, because, becauseArgs); } @@ -739,8 +739,8 @@ public AndConstraint NotHaveElementWithValue(string unexpect public AndConstraint NotHaveElementWithValue(XName unexpectedElement, string unexpectedValue, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { - Guard.ThrowIfArgumentIsNull(unexpectedElement, nameof(unexpectedElement)); - Guard.ThrowIfArgumentIsNull(unexpectedValue, nameof(unexpectedValue)); + Guard.ThrowIfArgumentIsNull(unexpectedElement); + Guard.ThrowIfArgumentIsNull(unexpectedValue); assertionChain .WithExpectation("Did not expect {context:subject} to have an element {0} with value {1}{reason}, ", From 612fd8815dae39b04fe7b672f566f2b8b264e4c2 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 22 Dec 2025 18:28:16 +0100 Subject: [PATCH 770/845] Remove disabled CA1859 Fixed in https://github.com/dotnet/roslyn-analyzers/pull/6709 --- .../Configuration/EquivalencyOptionsSpecs.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs b/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs index 4e896783cf..6db81886f3 100644 --- a/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs @@ -30,9 +30,7 @@ public void When_concurrently_getting_equality_strategy_it_should_not_throw() // Arrange / Act var action = () => { -#pragma warning disable CA1859 // https://github.com/dotnet/roslyn-analyzers/issues/6704 IEquivalencyOptions equivalencyOptions = new EquivalencyOptions(); -#pragma warning restore CA1859 return () => Parallel.For(0, 10_000, new ParallelOptions { MaxDegreeOfParallelism = 8 }, _ => equivalencyOptions.GetEqualityStrategy(typeof(IEnumerable)) From d73f064c781e7c11f36de439e3db55a4908b0826 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 22 Dec 2025 18:35:20 +0100 Subject: [PATCH 771/845] Fix `When_concurrently_getting_equality_strategy_it_should_not_throw` I incorrectly rewrote the test in 5f7a74008d94647c79d3b6660d8ce8f4dff4d64e --- .../Configuration/EquivalencyOptionsSpecs.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs b/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs index 6db81886f3..3c6ee841df 100644 --- a/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Configuration/EquivalencyOptionsSpecs.cs @@ -28,14 +28,11 @@ public void When_injecting_a_null_configurer_it_should_throw() public void When_concurrently_getting_equality_strategy_it_should_not_throw() { // Arrange / Act - var action = () => - { - IEquivalencyOptions equivalencyOptions = new EquivalencyOptions(); + IEquivalencyOptions equivalencyOptions = new EquivalencyOptions(); - return () => Parallel.For(0, 10_000, new ParallelOptions { MaxDegreeOfParallelism = 8 }, - _ => equivalencyOptions.GetEqualityStrategy(typeof(IEnumerable)) - ); - }; + var action = () => Parallel.For(0, 10_000, new ParallelOptions { MaxDegreeOfParallelism = 8 }, + _ => equivalencyOptions.GetEqualityStrategy(typeof(IEnumerable)) + ); // Assert action.Should().NotThrow(); From dc2445b05f292cbf14f5be00f4e3b75943de916a Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 09:11:18 +0100 Subject: [PATCH 772/845] Add Excluding by type with inheritance support (#3115) --- .packageguard/cache.bin | Bin 138687 -> 131545 bytes .../ExcludeMemberByTypeSelectionRule.cs | 69 +++ .../SelfReferenceEquivalencyOptions.cs | 52 ++ .../FluentAssertions/net47.verified.txt | 2 + .../FluentAssertions/net6.0.verified.txt | 2 + .../netstandard2.0.verified.txt | 2 + .../netstandard2.1.verified.txt | 2 + .../SelectionRulesSpecs.ExcludingByType.cs | 537 ++++++++++++++++++ docs/_pages/objectgraphs.md | 23 + docs/_pages/releases.md | 1 + package-lock.json | 12 +- 11 files changed, 694 insertions(+), 8 deletions(-) create mode 100644 Src/FluentAssertions/Equivalency/Selection/ExcludeMemberByTypeSelectionRule.cs create mode 100644 Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.ExcludingByType.cs diff --git a/.packageguard/cache.bin b/.packageguard/cache.bin index 68eba45c8e0352767e4e255812243b24c3c5b02e..8907a098efd845e3e19c2fa757b0f8c6ace74115 100644 GIT binary patch delta 6807 zcmb_hd32Ojmgjy|l~j^SRhA+vsE@#xri8Y4XeDv->5Usa_RWYO+F zsC?hMzq`Eq?)E-jdqw^JR<&|2j2SbyFLpO56=TMXLGwpV*m-yz4gWXT@$vp?gCE4d zDba-GkWCldkc5wDO0Xs+fhI186l~FH@%`Z%JoW0SUEKwP1*v5~|Nb0IL}zXt)fB_v z;6D|6RfF^E|4|zJ$$}CU+tCdYB`<|~I@J%YY)~`(^CHk;X?GWGS_gB)^0i$LWa6>^nt)$8mwvY_ z>Rk`L^p|%b86W)7EV374NcS{Sw)JTHnZT z+jcl8(+vlxW+7Pd;$scUxS*?I-dZHwg%5tS!S6EH?`C1{KrNb%We?^KOpZccU*0uKsq^s^@<38<3Cr2HV4B4c7l_1_XITAmH_X zxbOqm=*x$o5Dy*sIcRC)E?5}pt#FNZX8rV|FTmeSR4HKIul9$W88|o`KH9;AO6pdD z7W0m`(Ux7%cyr4md^I@zD2x5&N%~t_x#o0VP~7F01Cb_t_vuHoaLIx1ar%6s*RZ0n z6feB7^9P(J2SGL-c()Ln-liYUe&9Pit~dn6Id@3_Ws( zc)aI-pT1M*;FVoB9F%`6)!z<4>_G3`_}=kb7MyE1l2L}ormFEBZH&*Ng5OCHL-|*r z{Z?h_n$H#o$>V6@(=ZE<9$HLK=%E=mFE`Pn2Dt3oPzpbT2x6O0IT5xdM65OYxR7g9 zk!y794Cs81-wnGW1vJwOA2Ol127V*S4S{ylh3S@Cj<4cJ@awoJd2EXgJAal)zkdnt zqjQa*j0CXNI$ygDwnXW}lRwX;uNT0ANVtz1%=uUvR|#t0{`(+4GBs-yED}5F-w!}+qMU4?#6uw{B5NFCBUkQT^yk7j7`B8)upNmgN4-&6j@Lkml=4or#yro#J9|Ti_N#N`Q3K!YG-?g zVSZ=3+v#zx^cq?^J$?4BCU4)0PN$*C+12OmboSUBZcnGj>*#3@+qlV4X{JYpz%u3g zOEH=a%#QZ5t*W=#6f^AyNU!r7W9;`#_5>8WLW+D)FdJ8-|Z>K@sG&`@gW%XY=cV1WUE4mx%xtF2q6Sfz89vUPoENo`svuaqETPE z8MSAuK3t#bO}4axdb?mEE$V?p8tMkMUkqLEhK``b^k;D27Bx*+1@ScW9%O}VG+}qI zFfpD^x*&mux*%RX-?_rkWi*@cZ2iMxZoIfyP4iq}mZe!~iwjznVncXVvsEMv2e%sQ zbK_B)kttP8!HdpvArWV1>Qu&Z1FwjP8_94B;+lignUEJjsKO_*%2}kj9G$&>-k9uc z|AJsWlD#ox@syxf<1r&A())Y!iaCC*v=qUD-{hr9<+6>mXDMXki~09(m_K`Z7XO~# z@%Om7;HrWH7oBEn@?4Lzr>VWe(QP-HInQ|Ye9-}1Q8YnD3>3|m|DG>;NBkA%Wx->G z2{<%9H9$Bpnz#*ps~v{Oa4~USip1SyP{qp>_AM`ooo%kj!R$$yp|fTJXY;@wi$LSr zNr}n`Z0Y3GXspv*g_|bFM&im0>Cw1nPg`-bK^KY3o|K3)jGAa{Q2$P2g#I$DHzh`4 z{mvG~{=%e<6y9LgCya(Vhl?$tLhMSj(CO^z>{%7*g+@zSlw_`DRj8|qQ$+%QY%SJ= zNi|c_N*tyINko#VejHwEC;>Ajm+5KeIVizLZQ6u7XAf66hq00aj=O1vO zu*f!n+d_lQ#=k;t!Z;0P#Oko7aVpEGZK+7^u)AG#&Tg06;qe$vhH??Hd(pli8(&^H zUcm)G4%0KsVlk~*8|V#3n&r#KT+>useXCi+OXJIB{A>4*4alMb+_+4a+~8imG7QLml9T?-GF^-y z83T%^$~DV8YU#QMG_vLF3Q^grdMj9LcW-N$G58Ztjv}brwnmMA@aO}&xz_RYp~F`m zDpWDTP)VEG!9tsN@CA5iR${zub-TwX6VRUi4Bb~CW79EVyWWq-bq7OmjNhIZ69yN9 z7cHrWbZq@;ys&`wZ-=SawmnVtV-Aj>E5%Hs#s!$guH4vY!M&J@%Tl(IW`v8JZFdT7 z_!E>!6;?X*Czz|Puo}BM+Z{a~hkR`ipDw=NotB=t$Rk42IVi)FvQ!aRwTb4xLMBcB z6go45M_21!!0c6PA(8(iZvmwD)AOyv`KeHDL19=Ncs$Ryg{NboeriSD3l5)K0QIbp`Yqehx;4M2%0wT=Bhv zYA!9435nfpRj6I*j-+STWGok@2PK~MCQG=6ojH!D*6_ZZ=p@~K9`WY z=Dz zji(C6-Fw4VDLSi_`h=l%0Ti3MGVqvw1@6^FeGjUBTrfR6Q%r+r zhbIBO0WgU>CtnA`gGeOHO~i?q5!qv+K=#}Wx8N!iiP+-GW2NV>LMm8%uU&khId8imZ!u*CAhKB{KXg<(H{FPZgnQ#ykW^jPS%(qsqA;=Yv zh!059(pIG@M=R1_{oL{=3GS9{W@v4#wdSU+m6qn7`_0TZFSOVGHTS#ceeSvEo^$4- zm5L*;EBs2KM-Nn%LV}M@*Ki9G*yX#Tv7i)`^v!YtSK)t4VU(XvCulIM42DB0E-r)7 zkSfB)8etsmFeA*u>(e2aT^c=*6U%Xk2@)ZLwW?O(-%T(JGVs)V7=*)2pv2;G$mHm0 z5^5M;DhGc%{=)e%#fD#OV|up0$uunRK|`V0P+6hY2^qNF3|$V^n<^lzRmK4PSYlE( zYfXEQ75nH}wP_&}24>-lmGH1-ns22KJHNI!Xz^4%=vZfN0Ly+hnm#{W27h7A2@2Uz zZH6|3y&o=x*KXaq<=>-64^4)k(F*Bo@dYhsfE|y6zaQVjD|=uS z3JDN|eHTG8vIUUnNrki4fJ7$4JqsW}t`<3ZP|Lm~anX3H8p17${d)nnS3^HfZY=v+ z7MCx>?1iB0Rtf(nV1OqXZVGl)qW2S^>Rt(as{nM^a~Fir$!f535k$%+m}VPF@k$G{ z;DG@UhWnO-B2pMxT4FF(UMHR9sjMz`GLByb{e87U3eG=9f${t*h$3h4Kpwst zW>BRAeHl-`xa}@N?D)p$cF*s!@R0_24O^1N$Kn#X-7soLxmJU$2vA> zao<`VHn#8i$`$xY1H|Lxwa`oHj!PlRal>RDsI#AiaCcM$fH?8)zgYu{o@FMZC;K@y z5bZ&;w2VAK_#vMB&Fi{V<-|H~RleLn8DU*5C_Q*@|Co4xTnpizyzA>A!UH$?X-Ey_ z?s~{%DlIY2@l+kxLzD-}#CT$VX+4FehijVap+B2=kP?CD?QdivS}-20=a<9-`5gxR zJQ!2V+bKR_5adNc=EizZh?bHn!I<9wGIxEl+;Q1(2Xoa%uL#HteNK*{D`0@Y_ z_cS4O6U4|;$yN>KZ-V=LX(`^*utrcPSSj+xQskMdjFly224S}0u@b#e$Q)9gt`pes zmMHeZjz~8CgD@h~viU9di&v}nK_bg_AuBS>HktK;HuZPX>F!L21<9141~*5uxd~%L z4Oq>~3Re2uAZbH(l2p>LzRfXg_l_vJkW*e>YG4HklSFh`J3&(&P%nG>y-eTLzR;mPzPDuHMW4kSB`X3?naE_P4n9~To=oU3MK?Ir_ zK||}7Mrg4NRz2^7BR0c8%$W(1xMVX7L!TX#vMKGyVciyp!ipwHrZhi%Caqs-f_rHV zJ1EoBlP_Z2=bJ)Fol;9`NU`2rKGIZHZZ=d@s3~pZ!j^cbVJVTluz3fl*iX9xrATKJt>Q+YFw$f!tTLPF(RKoZt|^%C zSAUjJl)%&xdXZP=2e47(b#gH%a6~h`Xk2LY5^~h=UEq(c&2SghbL5EaY~-H45;t5Z zhYZrQRSr|xh`^Pc3EO^Nh0n;TK&ow_E6W+}Z-J2x@|qYM)c+x~zL4^`lUMz7RDk7F z7&R{G4Nb?WIN>^kj5e9e^pzC?$KVN$XD}AhnkF%zgpeX716Frf#WGu!tiuxN+&uG2 zob*xuxr(hkYF%O~`T_K|hvxErcJS zuyH2@*@9*}`|6EE%9=VUYu3M+z|L+7ki@X_pQ+f}QKe#S;>nh^?NqVAV*yw@7+gqd zV%E4H+Dkhjjk}o@Ulot5C*~@t{yMo60)5o>L$jTF80M!zghTo^y!1T8I}S*|F}tYT zvEzSoTbM7KJ#E#tO{V)j`w>(Kls{TM=?dNST z2;SIbkMz87>Pv=wpp@s&E39z%Y*A-_R()D>S1qf3Nn{(154=ELAp<3<45Stli-}7?aN^rC8>btLVx8EbCejZY~Bj zrWn8v_Y_horJ7CMfZq<-!U}pE_OrAynBo*oF_2_JA3zh${JU0 z!2PUT7iZa)83Q6C<6K*dw{^-WmR2}{{cF0YtC*76QuSWEdINGe3EP%g;Ht-hZpovj z+svhokrfogvCniJe}F^Yz5D1yyp=vRagx-Vx+rc5&Km@*j^3N!N`#&NfMiyi8^q3y zo`<(CQ0`gQuP?JX=X-WCuh@aHKr+Ya!`rKK1b(wBOh38mjzm1NT#ObYD`=Wk((Cse z)cb#kI-3O-Epu|PdktrP2F+s3*Tf{Vq>}tQTE)iuV(?~B-U_JlE?F03OAZg<6; z^4^(0*Qw2I4hN0jQCuskmi!_npMJ1Ms(1e)qK)P0Mb*C&v;We{Ux``1qV88>o?NS7 z=T_JMO6;*~>Tz$Ed$8NAIJtH`J;>`LMzhN!6IjTsLs;8M^^;@x5W`13f#Rq~@eviU z1F-HqB;tV%YGpM-hLDOmT` z-hi5yRhGt&mwU@0?aIB-9dBF`d-nAAmhI;c$uZ~%Bw_vIG|Ab1l#iyUp-RJ?5MUT^ z6dt2?pzJ6-h$BLvo^NO^Q!WJi;j}xKwvNRw|c7tzS!34_^Dn5GD6LMjbu zQk4>jB&2Pm_X;0>3(^|8z{mziPjIh}sE$%uqkZ9~uP8}OJ5=IXS1Vw5IKFe3CQ`gF z5GPWJuR#?5Vw1ufS>L5H>pk%h=*K2yNW)I+ghZH@%|d62ZzA59Lr2aL7tI3n!E-5; zjpkmU@Y7Lz+vAEa^;h6IZ2kuB!LY}m3_}LcDD~BrEZnY#3bE+0Qu(&cxBhd*##Xv5 zElm{Q)FutYX{`_&kfJUvDWtyG;C!Zkb1LWM!w@Ug*Zl!UETiF~=>*B>^ECu1U8k=) zW@t)dmxuSXT{40P%V_|s6SSfYY;#f^%by&8*S`j(RbNbvnpi~Op1sh=M>7;p?1gcG znxX#>g^wP9Oqq8I$)t`?Od)(R={s7%JcA%gnH&g(GFk$|%> z?;?z}HkHs!79ThWF?3rE2O*n&P9;E-t@=E0m?}ks6%whzcK)T&W`!WWftuH$iAM;E zcs^@vy;MQnb(!h^dq}QZa86^`LogfLyM&ZHRibzYZg$ z`LwuiYxT7pHP}z2bRY^is11e?mxtTve-E8?UmMH>R=z@EJv($j9xNu|o07 zA0WhuI+XL_`YWN~b)P;qK*Kja8P0t?_ahy;jd|ivlo})oTz`{7(grzs6NWn=*dQ9uy<50I0dX8-^I diff --git a/Src/FluentAssertions/Equivalency/Selection/ExcludeMemberByTypeSelectionRule.cs b/Src/FluentAssertions/Equivalency/Selection/ExcludeMemberByTypeSelectionRule.cs new file mode 100644 index 0000000000..adade7e849 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Selection/ExcludeMemberByTypeSelectionRule.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using FluentAssertions.Common; + +namespace FluentAssertions.Equivalency.Selection; + +/// +/// Selection rule that removes members of a particular type from the structural comparison. +/// +internal class ExcludeMemberByTypeSelectionRule : IMemberSelectionRule +{ + private readonly Type targetType; + + public ExcludeMemberByTypeSelectionRule(Type targetType) + { + Guard.ThrowIfArgumentIsNull(targetType); + this.targetType = targetType; + } + + public bool IncludesMembers => false; + + public IEnumerable SelectMembers(INode currentNode, IEnumerable selectedMembers, + MemberSelectionContext context) + { + return selectedMembers.Where(p => !ShouldExclude(p.Type)).ToArray(); + } + + private bool ShouldExclude(Type memberType) + { + if (targetType.IsGenericTypeDefinition) + { + // Check if memberType derives from the target open generic type + // e.g., class Derived : OpenGeneric or class Derived : OpenGeneric + Type baseType = memberType; + do + { + if (baseType.IsGenericType && baseType.GetGenericTypeDefinition() == targetType) + { + return true; + } + + baseType = baseType.BaseType; + } + while (baseType is not null); + + return false; + } + + return targetType.IsAssignableFrom(memberType); + } + + /// + /// 2 + public override string ToString() + { + if (targetType.IsGenericTypeDefinition) + { + return $"Exclude members whose type derives from/is a closed generic type of {targetType}"; + } + + if (targetType.IsSealed) + { + return $"Exclude members of type {targetType}"; + } + + return $"Exclude members whose type is/derives from {targetType}"; + } +} diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index 14fea3f009..3d323e6aa5 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -408,6 +408,58 @@ public TSelf Excluding(Expression> predicate) return (TSelf)this; } + /// + /// Excludes all members whose type is or derives from from the structural equality check. + /// + /// + /// The type of members to exclude. All members whose type is or derives from this type will be excluded. + /// For sealed types, only exact type matches are excluded. For open generic types, use the overload. + /// + /// + /// + /// For non-sealed types, this excludes members of the specified type and all derived types. + /// For example, Excluding<BaseClass>() will exclude members of type BaseClass and DerivedClass. + /// + /// + /// For sealed types (like ), only exact type matches are excluded. + /// + /// + public TSelf Excluding() + { + return Excluding(typeof(TMember)); + } + + /// + /// Excludes all members whose type is or derives from the specified from the structural equality check. + /// + /// + /// The type of members to exclude. All members whose type is or derives from this type will be excluded. + /// For sealed types, only exact type matches are excluded. For open generic types (e.g., typeof(Nullable<>)), + /// all closed generics and types deriving from them will be excluded. + /// + /// is . + /// + /// + /// For non-sealed types, this excludes members of the specified type and all derived types. + /// For example, Excluding(typeof(BaseClass)) will exclude members of type BaseClass and DerivedClass. + /// + /// + /// For sealed types (like ), only exact type matches are excluded. + /// + /// + /// For open generic types, this excludes all closed generics and types deriving from them. For example, + /// Excluding(typeof(Nullable<>)) excludes all nullable value types like int?, double?, etc. + /// Similarly, Excluding(typeof(List<>)) excludes List<int>, List<string>, + /// and any types deriving from those closed generics. + /// + /// + public TSelf Excluding(Type type) + { + Guard.ThrowIfArgumentIsNull(type); + AddSelectionRule(new ExcludeMemberByTypeSelectionRule(type)); + return (TSelf)this; + } + /// /// Includes the specified member in the equality check. /// diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 18b5cdd04c..e1e65f1112 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -924,6 +924,8 @@ namespace FluentAssertions.Equivalency public TSelf ComparingRecordsByMembers() { } public TSelf ComparingRecordsByValue() { } public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } + public TSelf Excluding(System.Type type) { } + public TSelf Excluding() { } public TSelf ExcludingExplicitlyImplementedProperties() { } public TSelf ExcludingFields() { } public TSelf ExcludingMembersNamed(params string[] memberNames) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index c29f32091e..4402ee7a4a 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -943,6 +943,8 @@ namespace FluentAssertions.Equivalency public TSelf ComparingRecordsByMembers() { } public TSelf ComparingRecordsByValue() { } public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } + public TSelf Excluding(System.Type type) { } + public TSelf Excluding() { } public TSelf ExcludingExplicitlyImplementedProperties() { } public TSelf ExcludingFields() { } public TSelf ExcludingMembersNamed(params string[] memberNames) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index b52faa2341..58e186bea5 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -916,6 +916,8 @@ namespace FluentAssertions.Equivalency public TSelf ComparingRecordsByMembers() { } public TSelf ComparingRecordsByValue() { } public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } + public TSelf Excluding(System.Type type) { } + public TSelf Excluding() { } public TSelf ExcludingExplicitlyImplementedProperties() { } public TSelf ExcludingFields() { } public TSelf ExcludingMembersNamed(params string[] memberNames) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index fc2d857989..a6e93047ac 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -924,6 +924,8 @@ namespace FluentAssertions.Equivalency public TSelf ComparingRecordsByMembers() { } public TSelf ComparingRecordsByValue() { } public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } + public TSelf Excluding(System.Type type) { } + public TSelf Excluding() { } public TSelf ExcludingExplicitlyImplementedProperties() { } public TSelf ExcludingFields() { } public TSelf ExcludingMembersNamed(params string[] memberNames) { } diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.ExcludingByType.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.ExcludingByType.cs new file mode 100644 index 0000000000..ab2281fd39 --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.ExcludingByType.cs @@ -0,0 +1,537 @@ +using System; +using System.Collections.Generic; +using JetBrains.Annotations; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Equivalency.Specs; + +public partial class SelectionRulesSpecs +{ + public class ExcludingByType + { + [Fact] + public void Can_exclude_exact_type_using_a_type_parameter() + { + // Arrange + var subject = new + { + Name = "John", + Age = 30, + Duration = TimeSpan.FromHours(5), + Score = 100 + }; + + var expectation = new + { + Name = "John", + Age = 30, + Duration = TimeSpan.FromHours(10), // Different value + Score = 100 + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .Excluding()); + } + + [Fact] + public void Can_exclude_exact_type_using_a_type_instance() + { + // Arrange + var subject = new + { + Name = "John", + Age = 30, + Duration = TimeSpan.FromHours(5), + Score = 100 + }; + + var expectation = new + { + Name = "John", + Age = 30, + Duration = TimeSpan.FromHours(10), // Different value + Score = 100 + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .Excluding(typeof(TimeSpan))); + } + + [Fact] + public void Other_members_are_still_selected() + { + // Arrange + var subject = new + { + Name = "John", + Age = 30, + Duration = TimeSpan.FromHours(5) + }; + + var expectation = new + { + Name = "Jack", // Different value + Age = 30, + Duration = TimeSpan.FromHours(10) + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, options => options + .Excluding()); + + // Assert + act.Should().Throw() + .WithMessage("*Exclude members of type System.TimeSpan*"); + } + + [Fact] + public void Can_exclude_all_types_implementing_a_generic_interface() + { + // Arrange + var subject = new + { + Name = "John", + Items = new List { 1, 2, 3 }, + Values = new[] { 4, 5, 6 }, + Age = 30 + }; + + var expectation = new + { + Name = "John", + Items = new List { 7, 8, 9 }, // Different value + Values = new[] { 10, 11, 12 }, // Different value + Age = 30 + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .Excluding>()); + } + + [Fact] + public void Can_exclude_all_closed_generic_types() + { + // Arrange + var subject = new + { + Name = "John", + NullableInt = (int?)42, + NullableDouble = (double?)3.14, + NullableDateTime = (DateTime?)DateTime.Now, + Age = 30 + }; + + var expectation = new + { + Name = "John", + NullableInt = (int?)99, // Different value + NullableDouble = (double?)2.71, // Different value + NullableDateTime = (DateTime?)DateTime.Now.AddDays(1), // Different value + Age = 30 + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .Excluding(typeof(Nullable<>))); + } + + [Fact] + public void Excluding_applies_to_all_levels_in_a_nested_structure() + { + // Arrange + var subject = new + { + Name = "John", + Settings = new + { + Timeout = TimeSpan.FromSeconds(30), + Name = "Config" + }, + Interval = TimeSpan.FromMinutes(5) + }; + + var expectation = new + { + Name = "John", + Settings = new + { + Timeout = TimeSpan.FromSeconds(60), // Different value + Name = "Config" + }, + Interval = TimeSpan.FromMinutes(10) // Different value + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .Excluding()); + } + + [Fact] + public void Excluding_applies_to_collections_as_well() + { + // Arrange + var subject = new[] + { + new + { + Name = "John", + Duration = TimeSpan.FromHours(5) + }, + new + { + Name = "Jane", + Duration = TimeSpan.FromHours(3) + } + }; + + var expectation = new[] + { + new + { + Name = "John", + Duration = TimeSpan.FromHours(10) // Different value + }, + new + { + Name = "Jane", + Duration = TimeSpan.FromHours(8) // Different value + } + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .Excluding()); + } + + [Fact] + public void Null_is_not_a_valid_type() + { + // Arrange + var subject = new { Name = "John" }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(subject, options => options + .Excluding((Type)null)); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Reports_the_interface_type() + { + // Arrange + var subject = new + { + Name = "John", + Items = new List { 1, 2, 3 } + }; + + var expectation = new + { + Name = "Jack", + Items = new List { 4, 5, 6 } + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, options => options + .Excluding>()); + + // Assert + act.Should().Throw() + .WithMessage("*Exclude members whose type is/derives from*"); + } + + [Fact] + public void Reports_the_open_generic_type() + { + // Arrange + var subject = new + { + Name = "John", + NullableInt = (int?)42 + }; + + var expectation = new + { + Name = "Jack", + NullableInt = (int?)99 + }; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, options => options + .Excluding(typeof(Nullable<>))); + + // Assert + act.Should().Throw() + .WithMessage("*Exclude members whose type derives from/is a closed generic type of*"); + } + + [Fact] + public void Can_exclude_all_types_deriving_from_an_abstract_type() + { + // Arrange + var subject = new + { + Name = "John", + BaseObject = new ConcreteClass { Value = 10 }, + Age = 30 + }; + + var expectation = new + { + Name = "John", + BaseObject = new ConcreteClass { Value = 20 }, // Different value + Age = 30 + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .Excluding()); + } + + [Fact] + public void Can_exclude_multiple_types() + { + // Arrange + var subject = new + { + Name = "John", + Age = 30, + Duration = TimeSpan.FromHours(5), + Score = 100.5 + }; + + var expectation = new + { + Name = "John", + Age = 30, + Duration = TimeSpan.FromHours(10), // Different value + Score = 200.5 // Different value + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .Excluding() + .Excluding()); + } + + [Fact] + public void Excluding_string_type_excludes_all_string_members() + { + // Arrange + var subject = new + { + FirstName = "John", + LastName = "Doe", + Age = 30 + }; + + var expectation = new + { + FirstName = "Jane", // Different value + LastName = "Smith", // Different value + Age = 30 + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .Excluding()); + } + + [Fact] + public void Excluding_by_type_with_nested_generics_works() + { + // Arrange + var subject = new + { + Name = "John", + ListOfLists = new List> { new() { 1, 2 } }, + Age = 30 + }; + + var expectation = new + { + Name = "John", + ListOfLists = new List> { new() { 3, 4 } }, // Different value + Age = 30 + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .Excluding>>()); + } + + [Fact] + public void Can_exclude_value_types() + { + // Arrange + var subject = new + { + Name = "John", + Age = 30, + Score = 100, + Rating = 5 + }; + + var expectation = new + { + Name = "John", + Age = 35, // Different value + Score = 200, // Different value + Rating = 10 // Different value + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .Excluding()); + } + + [Fact] + public void Excluding_non_abstract_base_type_excludes_derived_types() + { + // Arrange + var subject = new + { + Name = "John", + BaseObject = new DerivedFromNonAbstract { Value = 10 }, + Age = 30 + }; + + var expectation = new + { + Name = "John", + BaseObject = new DerivedFromNonAbstract { Value = 20 }, // Different value + Age = 30 + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .Excluding()); + } + + [Fact] + public void Excluding_open_generic_excludes_closed_generic_derived_type() + { + // Arrange + var subject = new + { + Name = "John", + ClosedGeneric = new ClosedGeneric { Value = 10 }, + Age = 30 + }; + + var expectation = new + { + Name = "John", + ClosedGeneric = new ClosedGeneric { Value = 20 }, // Different value + Age = 30 + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .Excluding(typeof(OpenGeneric<>))); + } + + [Fact] + public void Excluding_open_generic_excludes_derived_open_generic_type() + { + // Arrange + var subject = new + { + Name = "John", + DerivedOpenGeneric = new DerivedOpenGeneric { Value = 10 }, + Age = 30 + }; + + var expectation = new + { + Name = "John", + DerivedOpenGeneric = new DerivedOpenGeneric { Value = 20 }, // Different value + Age = 30 + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .Excluding(typeof(OpenGeneric<>))); + } + + [Fact] + public void Excluding_open_generic_excludes_closed_derived_generic_type() + { + // Arrange + var subject = new + { + Name = "John", + ClosedDerivedGeneric = new ClosedDerivedGeneric { Value = 10 }, + Age = 30 + }; + + var expectation = new + { + Name = "John", + ClosedDerivedGeneric = new ClosedDerivedGeneric { Value = 20 }, // Different value + Age = 30 + }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, options => options + .Excluding(typeof(OpenGeneric<>))); + } + + [Fact] + public void Excluding_sealed_type_excludes_only_exact_type() + { + // Arrange + var subject = new + { + Name = "John", + Text = "Test", + Age = 30 + }; + + var expectation = new + { + Name = "John", + Text = "Different", // Different value - will be excluded + Age = 30 + }; + + // Act / Assert - string is sealed, so only exact matches are excluded + subject.Should().BeEquivalentTo(expectation, options => options + .Excluding()); + } + + [UsedImplicitly(ImplicitUseTargetFlags.WithMembers)] + private abstract class AbstractBaseClass + { + public int Value { get; set; } + } + + private class ConcreteClass : AbstractBaseClass; + + [UsedImplicitly(ImplicitUseTargetFlags.WithMembers)] + private class NonAbstractBase + { + public int Value { get; set; } + } + + private class DerivedFromNonAbstract : NonAbstractBase; + + [UsedImplicitly(ImplicitUseTargetFlags.WithMembers)] + private class OpenGeneric + { + public int Value { get; set; } + } + + private class ClosedGeneric : OpenGeneric; + + private class DerivedOpenGeneric : OpenGeneric; + + private class ClosedDerivedGeneric : DerivedOpenGeneric; + } +} diff --git a/docs/_pages/objectgraphs.md b/docs/_pages/objectgraphs.md index d353d34c9b..89981f50dc 100644 --- a/docs/_pages/objectgraphs.md +++ b/docs/_pages/objectgraphs.md @@ -165,6 +165,29 @@ orderDto.Should().BeEquivalentTo(order, options => options .ExcludingMembersNamed("ID", "Version")); ``` +You can also exclude all members of a certain type from the comparison. This is useful when you want to ignore certain types throughout the entire object graph: + +```csharp +orderDto.Should().BeEquivalentTo(order, options => options + .Excluding()); +``` + +This works for any type, including interfaces (which will exclude all types implementing that interface): + +```csharp +orderDto.Should().BeEquivalentTo(order, options => options + .Excluding>()); +``` + +You can also exclude members of open generic types by passing the type definition: + +```csharp +orderDto.Should().BeEquivalentTo(order, options => options + .Excluding(typeof(Nullable<>))); +``` + +This will exclude all nullable value types like `int?`, `DateTime?`, etc. The exclusion also applies to derived types, so excluding a base class will also exclude all types that derive from it. + Maybe far-fetched, but you may even decide to exclude a member on a particular nested object by its index. ```csharp diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 2afbc67593..28dceb2e30 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -11,6 +11,7 @@ sidebar: ### What's new +* Added `Excluding()` and `Excluding(Type)` overloads to exclude all members of a certain type from equivalency comparisons - [#3115](https://github.com/fluentassertions/fluentassertions/pull/3115) * New overloads of `BeXmlSerializable` and `BeDataContractSerializable` that allow `EquivalencyOptions` to be configured, allowing the use of member selection rules. - [#3107](https://github.com/fluentassertions/fluentassertions/pull/3107) ## 8.8.0 diff --git a/package-lock.json b/package-lock.json index 38d7f24ace..9783a4b8be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -186,8 +186,7 @@ "version": "4.0.18", "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.18.tgz", "integrity": "sha512-EF77RqROHL+4LhMGW5NTeKqfUd/e4OOv6EDFQ/UQQiFyWuqkEKyEz0NDILxOFxWUEVdjT2GQ2cC7t12B6pESwg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@cspell/dict-dart": { "version": "2.3.1", @@ -307,15 +306,13 @@ "version": "4.0.13", "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.13.tgz", "integrity": "sha512-vHzk2xfqQYPvoXtQtywa6ekIonPrUEwe2uftjry3UNRNl89TtzLJVSkiymKJ3WMb+W/DwKXKIb1tKzcIS8ccIg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@cspell/dict-html-symbol-entities": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.4.tgz", "integrity": "sha512-afea+0rGPDeOV9gdO06UW183Qg6wRhWVkgCFwiO3bDupAoyXRuvupbb5nUyqSTsLXIKL8u8uXQlJ9pkz07oVXw==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@cspell/dict-java": { "version": "5.0.12", @@ -486,8 +483,7 @@ "version": "3.2.3", "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.2.3.tgz", "integrity": "sha512-zXh1wYsNljQZfWWdSPYwQhpwiuW0KPW1dSd8idjMRvSD0aSvWWHoWlrMsmZeRl4qM4QCEAjua8+cjflm41cQBg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@cspell/dict-vue": { "version": "3.0.5", From 7daa0c238455dabd73526df0ecbcd18acfc02c46 Mon Sep 17 00:00:00 2001 From: kz <74097723+fuguiKz@users.noreply.github.com> Date: Sun, 4 Jan 2026 20:13:29 +0800 Subject: [PATCH 773/845] Add xUnit migration tips (#3141) --- docs/_data/navigation.yml | 2 + docs/_data/xunit-migration/assert.yml | 225 ++++++++++++++++++++++++++ docs/_pages/tips.md | 9 ++ 3 files changed, 236 insertions(+) create mode 100644 docs/_data/xunit-migration/assert.yml diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index 4ad8e9de44..e9542f1320 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -101,6 +101,8 @@ sidebar: url: /tips/#improved-assertions - title: Migrating from MSTest url: /tips/#mstest-migration + - title: Migrating from xUnit + url: /tips/#xunit-migration - title: Serialization & Ignored Members url: /serializationignoredmembers diff --git a/docs/_data/xunit-migration/assert.yml b/docs/_data/xunit-migration/assert.yml new file mode 100644 index 0000000000..a17658c827 --- /dev/null +++ b/docs/_data/xunit-migration/assert.yml @@ -0,0 +1,225 @@ +- old: | + Assert.True(actual); + + new: | + actual.Should().BeTrue(); + + old-message: | + Assert.True() Failure + Expected: True + Actual: False + + new-message: | + Expected actual to be True, but found False. + +- old: | + Assert.False(actual); + + new: | + actual.Should().BeFalse(); + + old-message: | + Assert.False() Failure + Expected: False + Actual: True + + new-message: | + Expected actual to be False, but found True. + +- old: | + Assert.Equal(expected, actual); + + new: | + actual.Should().Be(expected); + + old-message: | + Assert.Equal() Failure: Values differ + Expected: 2 + Actual: 1 + + new-message: | + Expected actual to be 2, but found 1. + +- old: | + Assert.NotEqual(expected, actual); + + new: | + actual.Should().NotBe(expected); + + old-message: | + Assert.NotEqual() Failure: Values are equal + Expected: Not 1 + Actual: 1 + + new-message: | + Did not expect actual to be 1. + +- old: | + Assert.Null(actual); + + new: | + actual.Should().BeNull(); + + old-message: | + Assert.Null() Failure: Value is not null + Expected: null + Actual: Object { } + + new-message: | + Expected actual to be , but found System.Object (HashCode=33420276). + +- old: | + Assert.NotNull(actual); + + new: | + actual.Should().NotBeNull(); + + old-message: | + Assert.NotNull() Failure: Value is null + + new-message: | + Expected actual not to be . + +- old: | + Assert.Same(expected, actual); + + new: | + actual.Should().BeSameAs(expected); + + old-message: | + Assert.Same() Failure: Values are not the same instance + Expected: { OtherProperty = "expected", SomeProperty = 2 } + Actual: { OtherProperty = "actual", SomeProperty = 1 } + + new-message: | + Expected actual to refer to { + OtherProperty = "expected", + SomeProperty = 2 + }, but found { + OtherProperty = "actual", + SomeProperty = 1 + }. + +- old: | + Assert.NotSame(expected, actual); + + new: | + actual.Should().NotBeSameAs(expected); + + old-message: | + Assert.NotSame() Failure: Values are the same instance + + new-message: | + Did not expect actual to refer to { + OtherProperty = "expected", + SomeProperty = 1 + }. + +- old: | + Assert.Contains(expected, actual); + + new: | + actual.Should().Contain(expected); + + old-message: | + Assert.Contains() Failure: Item not found in collection + Collection: [1, 2] + Not found: 3 + + new-message: | + Expected actual {1, 2} to contain 3. + +- old: | + Assert.DoesNotContain(unexpected, actual); + + new: | + actual.Should().NotContain(unexpected); + + old-message: | + Assert.DoesNotContain() Failure: Item found in collection + ↓ (pos 1) + Collection: [1, 2] + Found: 2 + + new-message: | + Expected actual {1, 2} to not contain 2. + +- old: | + Assert.Empty(actual); + + new: | + actual.Should().BeEmpty(); + + old-message: | + Assert.Empty() Failure: Collection was not empty + Collection: [1] + + new-message: | + Expected actual to be empty, but found at least one item {1}. + +- old: | + Assert.NotEmpty(actual); + + new: | + actual.Should().NotBeEmpty(); + + old-message: | + Assert.NotEmpty() Failure: Collection was empty + + new-message: | + Expected actual not to be empty. + +- old: | + Assert.Single(actual); + + new: | + actual.Should().ContainSingle(); + + old-message: | + Assert.Single() Failure: The collection contained 2 items + Collection: [1, 2] + + new-message: | + Expected actual to contain a single item, but found {1, 2}. + +- old: | + Assert.IsType(actual); + + new: | + actual.Should().BeOfType(); + + old-message: | + Assert.IsType() Failure: Value is not the exact type + Expected: typeof(string) + Actual: typeof(int) + + new-message: | + Expected type to be System.String, but found System.Int32. + +- old: | + Assert.IsAssignableFrom(actual); + + new: | + actual.Should().BeAssignableTo(); + + old-message: | + Assert.IsAssignableFrom() Failure: Value is an incompatible type + Expected: typeof(string) + Actual: typeof(int) + + new-message: | + Expected actual to be assignable to System.String, but System.Int32 is not. + +- old: | + Assert.Throws(() => ...); + + new: | + action.Should().ThrowExactly(); + + old-message: | + Assert.Throws() Failure: Exception type was not an exact match + Expected: typeof(System.InvalidOperationException) + Actual: typeof(System.ArgumentException) + + new-message: | + Expected type to be System.InvalidOperationException, but found System.ArgumentException. diff --git a/docs/_pages/tips.md b/docs/_pages/tips.md index b35d4879fa..04c2a15eb5 100644 --- a/docs/_pages/tips.md +++ b/docs/_pages/tips.md @@ -39,3 +39,12 @@ If you see something missing, please consider submitting a pull request. {% include assertion-comparison.html header1="MSTest" header2="Fluent Assertions" idPrefix="mstest-" caption="CollectionAssert" examples=site.data.mstest-migration.collectionAssert %} {% include assertion-comparison.html header1="MSTest" header2="Fluent Assertions" idPrefix="mstest-" caption="StringAssert" examples=site.data.mstest-migration.stringAssert %} {% include assertion-comparison.html header1="MSTest" header2="Fluent Assertions" idPrefix="mstest-" caption="Exceptions" examples=site.data.mstest-migration.exceptions %} + +## xUnit Migration + +The examples below show how you might write equivalent xUnit assertions using Fluent Assertions including the failure message from each case. +We think this is both a useful migration guide and a convincing argument for switching. + +If you see something missing, please consider submitting a pull request. + +{% include assertion-comparison.html header1="xUnit" header2="Fluent Assertions" idPrefix="xunit-" caption="Assert" examples=site.data.xunit-migration.assert %} From 4762446cff18d5a13aa4fae3e7389744413d251c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 18:49:14 +0000 Subject: [PATCH 774/845] Bump cspell from 9.4.0 to 9.6.0 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 9.4.0 to 9.6.0. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.6.0/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.6.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 442 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 221 insertions(+), 223 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9783a4b8be..456232fe0d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,45 +7,45 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.4.0" + "cspell": "^9.6.0" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.4.0.tgz", - "integrity": "sha512-Hm2gpMg/lRv4fKtiO2NfBiaJdFZVVb1V1a+IVhlD9qCuObLhCt60Oze2kD1dQzhbaIX756cs/eyxa5bQ5jihhQ==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.6.0.tgz", + "integrity": "sha512-gLNe9bB+5gMsTEhR9YPE0Wt122HR2EV+Q1j9W+MbwbeBJmpTWrgAP1ZdpvHOg+6LF6x/bD/EC9HfWdd/om8wXA==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.1", "@cspell/dict-al": "^1.1.1", - "@cspell/dict-aws": "^4.0.16", + "@cspell/dict-aws": "^4.0.17", "@cspell/dict-bash": "^4.2.2", - "@cspell/dict-companies": "^3.2.7", - "@cspell/dict-cpp": "^6.0.15", + "@cspell/dict-companies": "^3.2.10", + "@cspell/dict-cpp": "^7.0.2", "@cspell/dict-cryptocurrencies": "^5.0.5", - "@cspell/dict-csharp": "^4.0.7", - "@cspell/dict-css": "^4.0.18", - "@cspell/dict-dart": "^2.3.1", - "@cspell/dict-data-science": "^2.0.12", - "@cspell/dict-django": "^4.1.5", - "@cspell/dict-docker": "^1.1.16", - "@cspell/dict-dotnet": "^5.0.10", + "@cspell/dict-csharp": "^4.0.8", + "@cspell/dict-css": "^4.0.19", + "@cspell/dict-dart": "^2.3.2", + "@cspell/dict-data-science": "^2.0.13", + "@cspell/dict-django": "^4.1.6", + "@cspell/dict-docker": "^1.1.17", + "@cspell/dict-dotnet": "^5.0.11", "@cspell/dict-elixir": "^4.0.8", - "@cspell/dict-en_us": "^4.4.24", - "@cspell/dict-en-common-misspellings": "^2.1.8", - "@cspell/dict-en-gb-mit": "^3.1.14", - "@cspell/dict-filetypes": "^3.0.14", + "@cspell/dict-en_us": "^4.4.27", + "@cspell/dict-en-common-misspellings": "^2.1.11", + "@cspell/dict-en-gb-mit": "^3.1.16", + "@cspell/dict-filetypes": "^3.0.15", "@cspell/dict-flutter": "^1.1.1", "@cspell/dict-fonts": "^4.0.5", "@cspell/dict-fsharp": "^1.1.1", "@cspell/dict-fullstack": "^3.2.7", "@cspell/dict-gaming-terms": "^1.1.2", "@cspell/dict-git": "^3.0.7", - "@cspell/dict-golang": "^6.0.24", + "@cspell/dict-golang": "^6.0.26", "@cspell/dict-google": "^1.0.9", "@cspell/dict-haskell": "^4.0.6", - "@cspell/dict-html": "^4.0.13", - "@cspell/dict-html-symbol-entities": "^4.0.4", + "@cspell/dict-html": "^4.0.14", + "@cspell/dict-html-symbol-entities": "^4.0.5", "@cspell/dict-java": "^5.0.12", "@cspell/dict-julia": "^1.1.1", "@cspell/dict-k8s": "^1.0.12", @@ -54,20 +54,20 @@ "@cspell/dict-lorem-ipsum": "^4.0.5", "@cspell/dict-lua": "^4.0.8", "@cspell/dict-makefile": "^1.0.5", - "@cspell/dict-markdown": "^2.0.13", - "@cspell/dict-monkeyc": "^1.0.11", + "@cspell/dict-markdown": "^2.0.14", + "@cspell/dict-monkeyc": "^1.0.12", "@cspell/dict-node": "^5.0.8", - "@cspell/dict-npm": "^5.2.25", - "@cspell/dict-php": "^4.1.0", + "@cspell/dict-npm": "^5.2.29", + "@cspell/dict-php": "^4.1.1", "@cspell/dict-powershell": "^5.0.15", "@cspell/dict-public-licenses": "^2.0.15", - "@cspell/dict-python": "^4.2.23", + "@cspell/dict-python": "^4.2.25", "@cspell/dict-r": "^2.1.1", - "@cspell/dict-ruby": "^5.0.9", - "@cspell/dict-rust": "^4.0.12", - "@cspell/dict-scala": "^5.0.8", + "@cspell/dict-ruby": "^5.1.0", + "@cspell/dict-rust": "^4.1.1", + "@cspell/dict-scala": "^5.0.9", "@cspell/dict-shell": "^1.1.2", - "@cspell/dict-software-terms": "^5.1.15", + "@cspell/dict-software-terms": "^5.1.20", "@cspell/dict-sql": "^2.2.1", "@cspell/dict-svelte": "^1.0.7", "@cspell/dict-swift": "^2.0.6", @@ -81,30 +81,30 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.4.0.tgz", - "integrity": "sha512-TpHY7t13xNhcZF9bwOfgVIhcyPDamMnxU/TBYhf4mPtXPLrZ5gBTg3UZh0/9Zn3naMjmJtngdsLvB2wai9xBlQ==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.6.0.tgz", + "integrity": "sha512-5sY1lgAXS5xEOsjT5rREMADj7pHIt56XOL7xR80nNl0TwlpZbeBHhoB2aH5sirVTeodJFN5iraXNbVOYPPupPw==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.4.0" + "@cspell/cspell-types": "9.6.0" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-pipe": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.4.0.tgz", - "integrity": "sha512-cI0sUe7SB99hJB1T6PhH/MpSrnml1kOekTCE+VH3Eb7zkVP5/mwJXs8BlufdvwBona+Cgkx6jeWlhFpxLc39Yg==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.6.0.tgz", + "integrity": "sha512-YNuY8NNXfE+8Qzknm2ps6QbrZLZu6rSZTZr3dYW3K6TK7+IFVlJ6e2Z9iKJTqp6aZ4AGU/r9QYGmNX4Oq4gZ0A==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.4.0.tgz", - "integrity": "sha512-o9gbbdXlhxG2rqtGqQ7xZ8MGDDsPLbskBnTeuA++ix4Ch/HdjrBNmKReIGAEqJPfP+JGgoEKqFISHUDKAJ/ygQ==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.6.0.tgz", + "integrity": "sha512-Gb2UWNmRpTOQGpYL4Q/LMw+b50KcRZcf/wJg6w0Yl3IT+F/uDNhNh1f5rHuTyGsbMsMxHJhsb2AoP+73GlbIfw==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" @@ -114,18 +114,18 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.4.0.tgz", - "integrity": "sha512-UottRlFPN6FGUfojx5HtUPZTeYXg2rf2HvO/HLh0KicirVYO16vFxTevg9MyOvw1EXSsDRz8ECANjiE7fnzBCQ==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.6.0.tgz", + "integrity": "sha512-DCuKKkySTEB8MPLTdoPMdmakYcx7XCsHz1YEMbzOcLqJCxXsRlRZg4qE9kRBee/2QY7eYA2kaYNgn/TDMooa4g==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.4.0.tgz", - "integrity": "sha512-vSpd50OfmthBH0aRFRLA2zJFtwli3ntHA0WAOJ8tIMLUCJgF3udooRXFeX3wR8ri69C9mc3864LC4inyRC/E9w==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.6.0.tgz", + "integrity": "sha512-JTqrD47tV+rWc1y2W8T0NTfWLQMlSWX4OF64/Jf3WbsOD+4UXVIfjRlzPry7+1Zekm6pa38+23jkDBytYpu8yw==", "license": "MIT", "engines": { "node": ">=20" @@ -144,9 +144,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-aws": { - "version": "4.0.16", - "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.16.tgz", - "integrity": "sha512-a681zShZbtTo947NvTYGLer95ZDQw1ROKvIFydak1e0OlfFCsNdtcYTupn0nbbYs53c9AO7G2DU8AcNEAnwXPA==", + "version": "4.0.17", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.17.tgz", + "integrity": "sha512-ORcblTWcdlGjIbWrgKF+8CNEBQiLVKdUOFoTn0KPNkAYnFcdPP0muT4892h7H4Xafh3j72wqB4/loQ6Nti9E/w==", "license": "MIT" }, "node_modules/@cspell/dict-bash": { @@ -159,15 +159,15 @@ } }, "node_modules/@cspell/dict-companies": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.2.7.tgz", - "integrity": "sha512-fEyr3LmpFKTaD0LcRhB4lfW1AmULYBqzg4gWAV0dQCv06l+TsA+JQ+3pZJbUcoaZirtgsgT3dL3RUjmGPhUH0A==", + "version": "3.2.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.2.10.tgz", + "integrity": "sha512-bJ1qnO1DkTn7JYGXvxp8FRQc4yq6tRXnrII+jbP8hHmq5TX5o1Wu+rdfpoUQaMWTl6balRvcMYiINDesnpR9Bw==", "license": "MIT" }, "node_modules/@cspell/dict-cpp": { - "version": "6.0.15", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-6.0.15.tgz", - "integrity": "sha512-N7MKK3llRNoBncygvrnLaGvmjo4xzVr5FbtAc9+MFGHK6/LeSySBupr1FM72XDaVSIsmBEe7sDYCHHwlI9Jb2w==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-7.0.2.tgz", + "integrity": "sha512-dfbeERiVNeqmo/npivdR6rDiBCqZi3QtjH2Z0HFcXwpdj6i97dX1xaKyK2GUsO/p4u1TOv63Dmj5Vm48haDpuA==", "license": "MIT" }, "node_modules/@cspell/dict-cryptocurrencies": { @@ -177,45 +177,45 @@ "license": "MIT" }, "node_modules/@cspell/dict-csharp": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.7.tgz", - "integrity": "sha512-H16Hpu8O/1/lgijFt2lOk4/nnldFtQ4t8QHbyqphqZZVE5aS4J/zD/WvduqnLY21aKhZS6jo/xF5PX9jyqPKUA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.8.tgz", + "integrity": "sha512-qmk45pKFHSxckl5mSlbHxmDitSsGMlk/XzFgt7emeTJWLNSTUK//MbYAkBNRtfzB4uD7pAFiKgpKgtJrTMRnrQ==", "license": "MIT" }, "node_modules/@cspell/dict-css": { - "version": "4.0.18", - "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.18.tgz", - "integrity": "sha512-EF77RqROHL+4LhMGW5NTeKqfUd/e4OOv6EDFQ/UQQiFyWuqkEKyEz0NDILxOFxWUEVdjT2GQ2cC7t12B6pESwg==", + "version": "4.0.19", + "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.19.tgz", + "integrity": "sha512-VYHtPnZt/Zd/ATbW3rtexWpBnHUohUrQOHff/2JBhsVgxOrksAxJnLAO43Q1ayLJBJUUwNVo+RU0sx0aaysZfg==", "license": "MIT" }, "node_modules/@cspell/dict-dart": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.3.1.tgz", - "integrity": "sha512-xoiGnULEcWdodXI6EwVyqpZmpOoh8RA2Xk9BNdR7DLamV/QMvEYn8KJ7NlRiTSauJKPNkHHQ5EVHRM6sTS7jdg==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.3.2.tgz", + "integrity": "sha512-sUiLW56t9gfZcu8iR/5EUg+KYyRD83Cjl3yjDEA2ApVuJvK1HhX+vn4e4k4YfjpUQMag8XO2AaRhARE09+/rqw==", "license": "MIT" }, "node_modules/@cspell/dict-data-science": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.12.tgz", - "integrity": "sha512-vI/mg6cI28IkFcpeINS7cm5M9HWemmXSTnxJiu3nmc4VAGx35SXIEyuLGBcsVzySvDablFYf4hsEpmg1XpVsUQ==", + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.13.tgz", + "integrity": "sha512-l1HMEhBJkPmw4I2YGVu2eBSKM89K9pVF+N6qIr5Uo5H3O979jVodtuwP8I7LyPrJnC6nz28oxeGRCLh9xC5CVA==", "license": "MIT" }, "node_modules/@cspell/dict-django": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.5.tgz", - "integrity": "sha512-AvTWu99doU3T8ifoMYOMLW2CXKvyKLukPh1auOPwFGHzueWYvBBN+OxF8wF7XwjTBMMeRleVdLh3aWCDEX/ZWg==", + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.6.tgz", + "integrity": "sha512-SdbSFDGy9ulETqNz15oWv2+kpWLlk8DJYd573xhIkeRdcXOjskRuxjSZPKfW7O3NxN/KEf3gm3IevVOiNuFS+w==", "license": "MIT" }, "node_modules/@cspell/dict-docker": { - "version": "1.1.16", - "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.16.tgz", - "integrity": "sha512-UiVQ5RmCg6j0qGIxrBnai3pIB+aYKL3zaJGvXk1O/ertTKJif9RZikKXCEgqhaCYMweM4fuLqWSVmw3hU164Iw==", + "version": "1.1.17", + "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.17.tgz", + "integrity": "sha512-OcnVTIpHIYYKhztNTyK8ShAnXTfnqs43hVH6p0py0wlcwRIXe5uj4f12n7zPf2CeBI7JAlPjEsV0Rlf4hbz/xQ==", "license": "MIT" }, "node_modules/@cspell/dict-dotnet": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.10.tgz", - "integrity": "sha512-ooar8BP/RBNP1gzYfJPStKEmpWy4uv/7JCq6FOnJLeD1yyfG3d/LFMVMwiJo+XWz025cxtkM3wuaikBWzCqkmg==", + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.11.tgz", + "integrity": "sha512-LSVKhpFf/ASTWJcfYeS0Sykcl1gVMsv2Z5Eo0TnTMSTLV3738HH+66pIsjUTChqU6SF3gKPuCe6EOaRYqb/evA==", "license": "MIT" }, "node_modules/@cspell/dict-elixir": { @@ -225,27 +225,27 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.4.24", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.24.tgz", - "integrity": "sha512-JE+/H2YicHJTneRmgH4GSI21rS+1yGZVl1jfOQgl8iHLC+yTTMtCvueNDMK94CgJACzYAoCsQB70MqiFJJfjLQ==", + "version": "4.4.27", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.27.tgz", + "integrity": "sha512-0y4vH2i5cFmi8sxkc4OlD2IlnqDznOtKczm4h6jA288g5VVrm3bhkYK6vcB8b0CoRKtYWKet4VEmHBP1yI+Qfw==", "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.8.tgz", - "integrity": "sha512-vDsjRFPQGuAADAiitf82z9Mz3DcqKZi6V5hPAEIFkLLKjFVBcjUsSq59SfL59ElIFb76MtBO0BLifdEbBj+DoQ==", + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.11.tgz", + "integrity": "sha512-2jcY494If1udvzd7MT2z/QH/RACUo/I02vIY4ttNdZhgYvUmRKhg8OBdrbzYo0lJOcc7XUb8rhIFQRHzxOSVeA==", "license": "CC BY-SA 4.0" }, "node_modules/@cspell/dict-en-gb-mit": { - "version": "3.1.14", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.14.tgz", - "integrity": "sha512-b+vEerlHP6rnNf30tmTJb7JZnOq4WAslYUvexOz/L3gDna9YJN3bAnwRJ3At3bdcOcMG7PTv3Pi+C73IR22lNg==", + "version": "3.1.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.16.tgz", + "integrity": "sha512-4PPdapCJslytxAVJu35Mv97qDyGmAQxtDE790T2bWNhcqN6gvRVAc/eTRaXkUIf21q1xCxxNNqpH4VfMup69rQ==", "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.14.tgz", - "integrity": "sha512-KSXaSMYYNMLLdHEnju1DyRRH3eQWPRYRnOXpuHUdOh2jC44VgQoxyMU7oB3NAhDhZKBPCihabzECsAGFbdKfEA==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.15.tgz", + "integrity": "sha512-uDMeqYlLlK476w/muEFQGBy9BdQWS0mQ7BJiy/iQv5XUWZxE2O54ZQd9nW8GyQMzAgoyg5SG4hf9l039Qt66oA==", "license": "MIT" }, "node_modules/@cspell/dict-flutter": { @@ -285,9 +285,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-golang": { - "version": "6.0.24", - "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.24.tgz", - "integrity": "sha512-rY7PlC3MsHozmjrZWi0HQPUl0BVCV0+mwK0rnMT7pOIXqOe4tWCYMULDIsEk4F0gbIxb5badd2dkCPDYjLnDgA==", + "version": "6.0.26", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.26.tgz", + "integrity": "sha512-YKA7Xm5KeOd14v5SQ4ll6afe9VSy3a2DWM7L9uBq4u3lXToRBQ1W5PRa+/Q9udd+DTURyVVnQ+7b9cnOlNxaRg==", "license": "MIT" }, "node_modules/@cspell/dict-google": { @@ -303,15 +303,15 @@ "license": "MIT" }, "node_modules/@cspell/dict-html": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.13.tgz", - "integrity": "sha512-vHzk2xfqQYPvoXtQtywa6ekIonPrUEwe2uftjry3UNRNl89TtzLJVSkiymKJ3WMb+W/DwKXKIb1tKzcIS8ccIg==", + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.14.tgz", + "integrity": "sha512-2bf7n+kS92g+cMKV0wr9o/Oq9n8JzU7CcrB96gIh2GHgnF+0xDOqO2W/1KeFAqOfqosoOVE48t+4dnEMkkoJ2Q==", "license": "MIT" }, "node_modules/@cspell/dict-html-symbol-entities": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.4.tgz", - "integrity": "sha512-afea+0rGPDeOV9gdO06UW183Qg6wRhWVkgCFwiO3bDupAoyXRuvupbb5nUyqSTsLXIKL8u8uXQlJ9pkz07oVXw==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.5.tgz", + "integrity": "sha512-429alTD4cE0FIwpMucvSN35Ld87HCyuM8mF731KU5Rm4Je2SG6hmVx7nkBsLyrmH3sQukTcr1GaiZsiEg8svPA==", "license": "MIT" }, "node_modules/@cspell/dict-java": { @@ -363,21 +363,21 @@ "license": "MIT" }, "node_modules/@cspell/dict-markdown": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.13.tgz", - "integrity": "sha512-rFeGikf+lVlywEp7giATUfi8myFeee6jqgbUgtdIdl/OBmRBPe5m7mKNk7yMItMZe8ICrwMxFwJy5OeTnrr6QA==", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.14.tgz", + "integrity": "sha512-uLKPNJsUcumMQTsZZgAK9RgDLyQhUz/uvbQTEkvF/Q4XfC1i/BnA8XrOrd0+Vp6+tPOKyA+omI5LRWfMu5K/Lw==", "license": "MIT", "peerDependencies": { - "@cspell/dict-css": "^4.0.18", - "@cspell/dict-html": "^4.0.13", - "@cspell/dict-html-symbol-entities": "^4.0.4", + "@cspell/dict-css": "^4.0.19", + "@cspell/dict-html": "^4.0.14", + "@cspell/dict-html-symbol-entities": "^4.0.5", "@cspell/dict-typescript": "^3.2.3" } }, "node_modules/@cspell/dict-monkeyc": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-monkeyc/-/dict-monkeyc-1.0.11.tgz", - "integrity": "sha512-7Q1Ncu0urALI6dPTrEbSTd//UK0qjRBeaxhnm8uY5fgYNFYAG+u4gtnTIo59S6Bw5P++4H3DiIDYoQdY/lha8w==", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-monkeyc/-/dict-monkeyc-1.0.12.tgz", + "integrity": "sha512-MN7Vs11TdP5mbdNFQP5x2Ac8zOBm97ARg6zM5Sb53YQt/eMvXOMvrep7+/+8NJXs0jkp70bBzjqU4APcqBFNAw==", "license": "MIT" }, "node_modules/@cspell/dict-node": { @@ -387,15 +387,15 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.25", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.25.tgz", - "integrity": "sha512-jxhVxM3+ilxbum/N2ejAvVuvet1OrGeW1fD7GagAkHU/2zlzINZkJLDtXk6v1WHUjigfhiAsois3puobv/2A1A==", + "version": "5.2.29", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.29.tgz", + "integrity": "sha512-ZAef8JpYmbuHFT1zekj/YyImLPvZevjECw663EmG5GPePyNo4AfH8Dd2fFhaOyQ3P5I5LrkAhGwypnOfUxcssw==", "license": "MIT" }, "node_modules/@cspell/dict-php": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.1.0.tgz", - "integrity": "sha512-dTDeabyOj7eFvn2Q4Za3uVXM2+SzeFMqX8ly2P0XTo4AzbCmI2hulFD/QIADwWmwiRrInbbf8cxwFHNIYrXl4w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.1.1.tgz", + "integrity": "sha512-EXelI+4AftmdIGtA8HL8kr4WlUE11OqCSVlnIgZekmTkEGSZdYnkFdiJ5IANSALtlQ1mghKjz+OFqVs6yowgWA==", "license": "MIT" }, "node_modules/@cspell/dict-powershell": { @@ -411,12 +411,12 @@ "license": "MIT" }, "node_modules/@cspell/dict-python": { - "version": "4.2.23", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.23.tgz", - "integrity": "sha512-c0C//tmG4PZWeONtTBPXa6q0ylfz3/BgEcHAR1L0BPWjNUIzTyx9J+hEIUCPYf7eAPeYjaDuTvYlg11igXXE4Q==", + "version": "4.2.25", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.25.tgz", + "integrity": "sha512-hDdN0YhKgpbtZVRjQ2c8jk+n0wQdidAKj1Fk8w7KEHb3YlY5uPJ0mAKJk7AJKPNLOlILoUmN+HAVJz+cfSbWYg==", "license": "MIT", "dependencies": { - "@cspell/dict-data-science": "^2.0.12" + "@cspell/dict-data-science": "^2.0.13" } }, "node_modules/@cspell/dict-r": { @@ -426,21 +426,21 @@ "license": "MIT" }, "node_modules/@cspell/dict-ruby": { - "version": "5.0.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.9.tgz", - "integrity": "sha512-H2vMcERMcANvQshAdrVx0XoWaNX8zmmiQN11dZZTQAZaNJ0xatdJoSqY8C8uhEMW89bfgpN+NQgGuDXW2vmXEw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.1.0.tgz", + "integrity": "sha512-9PJQB3cfkBULrMLp5kSAcFPpzf8oz9vFN+QYZABhQwWkGbuzCIXSorHrmWSASlx4yejt3brjaWS57zZ/YL5ZQQ==", "license": "MIT" }, "node_modules/@cspell/dict-rust": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.12.tgz", - "integrity": "sha512-z2QiH+q9UlNhobBJArvILRxV8Jz0pKIK7gqu4TgmEYyjiu1TvnGZ1tbYHeu9w3I/wOP6UMDoCBTty5AlYfW0mw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.1.1.tgz", + "integrity": "sha512-fXiXnZH0wOaEVTKFRNaz6TsUGhuB8dAT0ubYkDNzRQCaV5JGSOebGb1v2x5ZrOSVp+moxWM/vdBfiNU6KOEaFQ==", "license": "MIT" }, "node_modules/@cspell/dict-scala": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.8.tgz", - "integrity": "sha512-YdftVmumv8IZq9zu1gn2U7A4bfM2yj9Vaupydotyjuc+EEZZSqAafTpvW/jKLWji2TgybM1L2IhmV0s/Iv9BTw==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.9.tgz", + "integrity": "sha512-AjVcVAELgllybr1zk93CJ5wSUNu/Zb5kIubymR/GAYkMyBdYFCZ3Zbwn4Zz8GJlFFAbazABGOu0JPVbeY59vGg==", "license": "MIT" }, "node_modules/@cspell/dict-shell": { @@ -450,9 +450,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.1.15", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.15.tgz", - "integrity": "sha512-93VqazVvVtHuKY7seGxbfdtrnPBgZ/hZ/NmFFkBRhkRL6NavaQ6U2QsHpnlVEZN5km3DmaQy1X4ZcvNoSTK/ZQ==", + "version": "5.1.20", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.20.tgz", + "integrity": "sha512-TEk1xHvetTI4pv7Vzje1D322m6QEjaH2P6ucOOf6q7EJCppQIdC0lZSXkgHJAFU5HGSvEXSzvnVeW2RHW86ziQ==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -498,12 +498,12 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.4.0.tgz", - "integrity": "sha512-d2fjLjzrKGUIn5hWK8gMuyAh2pqXSxBqOHpU1jR3jxbrO3MilunKNijaSstv7CZn067Jpc36VfaKQodaXNZzUA==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.6.0.tgz", + "integrity": "sha512-Lkn82wyGj2ltxeYfH2bEjshdes1fx3ouYUZxeW5i6SBBvEVJoSmr43AygI8A317UMIQxVj59qVBorrtGYcRI1w==", "license": "MIT", "dependencies": { - "@cspell/url": "9.4.0", + "@cspell/url": "9.6.0", "import-meta-resolve": "^4.2.0" }, "engines": { @@ -511,27 +511,27 @@ } }, "node_modules/@cspell/filetypes": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.4.0.tgz", - "integrity": "sha512-RMrYHkvPF0tHVFM+T4voEhX9sfYQrd/mnNbf6+O4CWUyLCz4NQ5H9yOgEIJwEcLu4y3NESGXFef/Jn5xo0CUfg==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.6.0.tgz", + "integrity": "sha512-CaWyk5j20H6sr+HCArtUY95jUQb7A/6W0GC4B4umnqoWvgqwR72duowLFa+w1K2C7tZg3GoV4Wf2cUn9jjt5FA==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/strong-weak-map": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.4.0.tgz", - "integrity": "sha512-ui7mlXYmqElS/SmRubPBNWdkQVWgWbB6rjCurc+0owYXlnweItAMHTxC8mCWM/Au22SF1dB/JR8QBELFXLkTjQ==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.6.0.tgz", + "integrity": "sha512-9g8LCLv/2RrprGeGnFAaBETWq7ESnBcoMbvgNu+vZE58iF+pbFvP0qGgKvVeKEEpc2LZhNuHLsUH37MUS6DOQg==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.4.0.tgz", - "integrity": "sha512-nt88P6m20AaVbqMxsyPf8KqyWPaFEW2UANi0ijBxc2xTkD2KiUovxfZUYW6NMU9XBYZlovT5LztkEhst2yBcSA==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.6.0.tgz", + "integrity": "sha512-257WOxh9vOYHAVgBNXRCdLEd+ldzlVbzcc9u+6DYoCDCNGe0OvOWOGsAfnUbMc9xEw48XgBlDYgOlPbjWGLOTg==", "license": "MIT", "engines": { "node": ">=20" @@ -617,9 +617,9 @@ } }, "node_modules/comment-json": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.4.1.tgz", - "integrity": "sha512-r1To31BQD5060QdkC+Iheai7gHwoSZobzunqkf2/kQ6xIAfJyrKNAFUwdKvkK7Qgu7pVTKQEa7ok7Ed3ycAJgg==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.5.1.tgz", + "integrity": "sha512-taEtr3ozUmOB7it68Jll7s0Pwm+aoiHyXKrEC8SEodL4rNpdfDLqa7PfBlrgFoCNNdR8ImL+muti5IGvktJAAg==", "license": "MIT", "dependencies": { "array-timsort": "^1.0.3", @@ -637,26 +637,26 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.4.0.tgz", - "integrity": "sha512-ZvXO+EY/G0/msu7jwRiVk0sXL/zB7DMJLBvjSUrK82uVbDoDxHwXxUuOz2UVnk2+J61//ldIZrjxVK8KMvaJlg==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.6.0.tgz", + "integrity": "sha512-Mpf0oT2KAHTIb3YPAXWhW64/4CZKW5Lka4j1YxCLK3jM3nenmIsY/ocrJvqCMF4+1eejRF0N55sT3XmrijI5YQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "9.4.0", - "@cspell/cspell-pipe": "9.4.0", - "@cspell/cspell-types": "9.4.0", - "@cspell/dynamic-import": "9.4.0", - "@cspell/url": "9.4.0", + "@cspell/cspell-json-reporter": "9.6.0", + "@cspell/cspell-pipe": "9.6.0", + "@cspell/cspell-types": "9.6.0", + "@cspell/dynamic-import": "9.6.0", + "@cspell/url": "9.6.0", "ansi-regex": "^6.2.2", "chalk": "^5.6.2", "chalk-template": "^1.1.2", "commander": "^14.0.2", - "cspell-config-lib": "9.4.0", - "cspell-dictionary": "9.4.0", - "cspell-gitignore": "9.4.0", - "cspell-glob": "9.4.0", - "cspell-io": "9.4.0", - "cspell-lib": "9.4.0", + "cspell-config-lib": "9.6.0", + "cspell-dictionary": "9.6.0", + "cspell-gitignore": "9.6.0", + "cspell-glob": "9.6.0", + "cspell-io": "9.6.0", + "cspell-lib": "9.6.0", "fast-json-stable-stringify": "^2.1.0", "flatted": "^3.3.3", "semver": "^7.7.3", @@ -674,14 +674,14 @@ } }, "node_modules/cspell-config-lib": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.4.0.tgz", - "integrity": "sha512-CvQKSmK/DRIf3LpNx2sZth65pHW2AHngZqLkH3DTwnAPbiCAsE0XvCrVhvDfCNu/6uJIaa+NVHSs8GOf//DHBQ==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.6.0.tgz", + "integrity": "sha512-5ztvheawkmFXNHGN82iOOntU3T5mmlQBP/plgoKdBZ6+lSYrOJLkOyqxYyi7MrUBDtWrXPzFllkBrPNRDlbX/A==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.4.0", - "comment-json": "^4.4.1", - "smol-toml": "^1.5.2", + "@cspell/cspell-types": "9.6.0", + "comment-json": "^4.5.1", + "smol-toml": "^1.6.0", "yaml": "^2.8.2" }, "engines": { @@ -689,29 +689,29 @@ } }, "node_modules/cspell-dictionary": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.4.0.tgz", - "integrity": "sha512-c2qscanRZChoHZFYI7KpvBMdy8i6wNwl2EflcNRrFiFOq67t9CgxLe54PafaqhrHGpBc8nElaZKciLvjj6Uscw==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.6.0.tgz", + "integrity": "sha512-wW0m1kLrbK6bRY/GrLUGKUUJ1Z4ZUgIb8LD4zNaECcvGviv9V7VcR3mEwUip3ZjoHa3ClzEoWgQ9gXrtac80Wg==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.4.0", - "@cspell/cspell-types": "9.4.0", - "cspell-trie-lib": "9.4.0", - "fast-equals": "^5.3.3" + "@cspell/cspell-pipe": "9.6.0", + "@cspell/cspell-types": "9.6.0", + "cspell-trie-lib": "9.6.0", + "fast-equals": "^6.0.0" }, "engines": { "node": ">=20" } }, "node_modules/cspell-gitignore": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.4.0.tgz", - "integrity": "sha512-HMrzLmJBUMSpaMMkltlTAz/aVOrHxixyhKfg5WbFCJ5JYZO6Qu3/JU3wRoOFoud9449wRjLkvrGmbbL2+vO6Lw==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.6.0.tgz", + "integrity": "sha512-8GfmJuRBBvibyPHnNE2wYJAiQ/ceDYLD1X1sUQaCyj6hPMR7ChJiVhFPtS11hMqkjZ46OBMYTMGWqO792L9fEQ==", "license": "MIT", "dependencies": { - "@cspell/url": "9.4.0", - "cspell-glob": "9.4.0", - "cspell-io": "9.4.0" + "@cspell/url": "9.6.0", + "cspell-glob": "9.6.0", + "cspell-io": "9.6.0" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -721,12 +721,12 @@ } }, "node_modules/cspell-glob": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.4.0.tgz", - "integrity": "sha512-Q87Suj9oXrhoKck15qWorCizBjMNxG/k3NjnhKIAMrF+PdUa1Mpl0MOD+hqV1Wvwh1UHcIMYCP3bR3XpBbNx+Q==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.6.0.tgz", + "integrity": "sha512-KmEbKN0qdEamsEYbkFu7zjLYfw3hMmn9kmeh94IHr2kq6vWq5vNP5l1BuqmrUeFZlbNd07vj08IKAZHYsoGheQ==", "license": "MIT", "dependencies": { - "@cspell/url": "9.4.0", + "@cspell/url": "9.6.0", "picomatch": "^4.0.3" }, "engines": { @@ -734,13 +734,13 @@ } }, "node_modules/cspell-grammar": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.4.0.tgz", - "integrity": "sha512-ie7OQ4Neflo+61bMzoLR7GtlZfMBAm2KL1U4iNqh15wUE5fDbvXeN15H5lu+gcO8BwYvC5wxZknw1x62/J8+3Q==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.6.0.tgz", + "integrity": "sha512-jZVIM5/3eB9rWURDq+VXdYip+DmPuFzO+bqaRtzqT8w6YoOIGYbiIxdwvyyA9xdH7SmW8uqHJP5x4pzZju1lNQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.4.0", - "@cspell/cspell-types": "9.4.0" + "@cspell/cspell-pipe": "9.6.0", + "@cspell/cspell-types": "9.6.0" }, "bin": { "cspell-grammar": "bin.mjs" @@ -750,39 +750,39 @@ } }, "node_modules/cspell-io": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.4.0.tgz", - "integrity": "sha512-8w30dqlO54H9w6WGlvZhHI5kytVbF3bYPqKJAZLWKEO36L2mdpf6/abx/FA4yVLJ56wmH1x0N0ZK32wNRl5C6A==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.6.0.tgz", + "integrity": "sha512-wZuZzKOYIb698kVEINYjGaNFQu+AFZ945TORM3hapmPjez+vsHwl8m/pPpCHeGMpQtHMEDkX84AbQ7R55MRIwg==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "9.4.0", - "@cspell/url": "9.4.0" + "@cspell/cspell-service-bus": "9.6.0", + "@cspell/url": "9.6.0" }, "engines": { "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.4.0.tgz", - "integrity": "sha512-ajjioE59IEDNUPawfaBpiMfGC32iKPkuYd4T9ftguuef8VvyKRifniiUi1nxwGgAhzSfxHvWs7qdT+29Pp5TMQ==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.6.0.tgz", + "integrity": "sha512-m9rIv8hkQ3Dio4s80HQbM9cdxENcd6pS8j2AHWL50OSjJf3Xhw6/wMrIAGbwLHP15K6QZVU2eJ/abCzIJwjA4w==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.4.0", - "@cspell/cspell-pipe": "9.4.0", - "@cspell/cspell-resolver": "9.4.0", - "@cspell/cspell-types": "9.4.0", - "@cspell/dynamic-import": "9.4.0", - "@cspell/filetypes": "9.4.0", - "@cspell/strong-weak-map": "9.4.0", - "@cspell/url": "9.4.0", + "@cspell/cspell-bundled-dicts": "9.6.0", + "@cspell/cspell-pipe": "9.6.0", + "@cspell/cspell-resolver": "9.6.0", + "@cspell/cspell-types": "9.6.0", + "@cspell/dynamic-import": "9.6.0", + "@cspell/filetypes": "9.6.0", + "@cspell/strong-weak-map": "9.6.0", + "@cspell/url": "9.6.0", "clear-module": "^4.1.2", - "cspell-config-lib": "9.4.0", - "cspell-dictionary": "9.4.0", - "cspell-glob": "9.4.0", - "cspell-grammar": "9.4.0", - "cspell-io": "9.4.0", - "cspell-trie-lib": "9.4.0", + "cspell-config-lib": "9.6.0", + "cspell-dictionary": "9.6.0", + "cspell-glob": "9.6.0", + "cspell-grammar": "9.6.0", + "cspell-io": "9.6.0", + "cspell-trie-lib": "9.6.0", "env-paths": "^3.0.0", "gensequence": "^8.0.8", "import-fresh": "^3.3.1", @@ -796,17 +796,15 @@ } }, "node_modules/cspell-trie-lib": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.4.0.tgz", - "integrity": "sha512-bySJTm8XDiJAoC1MDo4lE/KpSNxydo13ZETC8TF7Hb3rbWI1c6o5eZ4+i/tkG3M94OvKV91+MeAvoMCe7GGgAw==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.6.0.tgz", + "integrity": "sha512-L7GSff5F9cF60QT78WsebVlb3sppi6jbvTHwsw7WF1jUN/ioAo7OzBYtYB7xkYeejcdVEpqfvf/ZOXPDp8x2Wg==", "license": "MIT", - "dependencies": { - "@cspell/cspell-pipe": "9.4.0", - "@cspell/cspell-types": "9.4.0", - "gensequence": "^8.0.8" - }, "engines": { "node": ">=20" + }, + "peerDependencies": { + "@cspell/cspell-types": "9.6.0" } }, "node_modules/env-paths": { @@ -835,9 +833,9 @@ } }, "node_modules/fast-equals": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.3.3.tgz", - "integrity": "sha512-/boTcHZeIAQ2r/tL11voclBHDeP9WPxLt+tyAbVSyyXuUFyh0Tne7gJZTqGbxnvj79TjLdCXLOY7UIPhyG5MTw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-6.0.0.tgz", + "integrity": "sha512-PFhhIGgdM79r5Uztdj9Zb6Tt1zKafqVfdMGwVca1z5z6fbX7DmsySSuJd8HiP6I1j505DCS83cLxo5rmSNeVEA==", "license": "MIT", "engines": { "node": ">=6.0.0" @@ -998,9 +996,9 @@ } }, "node_modules/smol-toml": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.5.2.tgz", - "integrity": "sha512-QlaZEqcAH3/RtNyet1IPIYPsEWAaYyXXv1Krsi+1L/QHppjX4Ifm8MQsBISz9vE8cHicIq3clogsheili5vhaQ==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.6.0.tgz", + "integrity": "sha512-4zemZi0HvTnYwLfrpk/CF9LOd9Lt87kAt50GnqhMpyF9U3poDAP2+iukq2bZsO/ufegbYehBkqINbsWxj4l4cw==", "license": "BSD-3-Clause", "engines": { "node": ">= 18" diff --git a/package.json b/package.json index a172e3703a..cbe3bc8624 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.4.0" + "cspell": "^9.6.0" } } From 60b430aaa1a1bc22133603b3b9ae41f8a234f95b Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 26 Jan 2026 07:29:42 +0100 Subject: [PATCH 775/845] Fix formatting exception when comparing strings containing braces (#3151) --- .../Primitives/StringEqualityStrategy.cs | 7 ++-- .../Primitives/StringAssertionSpecs.Be.cs | 32 +++++++++++++++++++ docs/_pages/releases.md | 6 +++- 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs index b7c23f0293..387ad7d9b5 100644 --- a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs @@ -164,19 +164,20 @@ private string GetMismatchSegmentForLongStrings(string subject, string expected, if (IncludeFullDetails && wasTruncated) { - sb.AppendFormat(CultureInfo.InvariantCulture, + string fullDetails = string.Create(CultureInfo.InvariantCulture, $""" Full expectation: - {expected.RenderAsIndentedBlock().AsNonFormattable()}, + {expected.RenderAsIndentedBlock()}, Full subject: - {subject.RenderAsIndentedBlock().AsNonFormattable()} + {subject.RenderAsIndentedBlock()} """); + sb.Append(fullDetails); } return sb.ToString(); diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.Be.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.Be.cs index ad21556083..d81d007f8e 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.Be.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.Be.cs @@ -391,6 +391,38 @@ public void Will_include_the_full_subject_and_expectation_for_long_truncated_str "The streets were quiet except for the faint hum of neon signs flickering in the night. A cat darted across the alley, chasing shadows only it could see. Somewhere, a radio whispered a half-forgotten song, mixing with the distant rumble of a train. The air carried the scent of rain on warm asphalt, heavy and restless. Each step felt like moving between moments—time stretching, folding, and twisting—while the city itself seemed to wait, holding its breath for what might come next." """); } + + [Fact] + public void When_string_contains_opening_brace_it_should_not_throw_format_exception() + { + // Arrange - create a string longer than the default truncation length (80 chars) + // with an opening brace to trigger the full details display which had the bug + const int lengthToTriggerFullDetails = 80; + var actual = "{" + new string('x', lengthToTriggerFullDetails); + var expected = ""; + + // Act + Action act = () => actual.Should().Be(expected); + + // Assert - should throw XunitException, not FormatException + act.Should().Throw() + .WithMessage("*Expected*to be a match*"); + } + + [Fact] + public void When_long_string_contains_braces_it_should_display_properly() + { + // Arrange + const string subject = "public class Test { public void Method() { var x = 1; } }"; + const string expected = "public class Test { public void Method() { var x = 2; } }"; + + // Act + Action act = () => subject.Should().Be(expected); + + // Assert + act.Should().Throw() + .WithMessage("*Expected*to be a match*"); + } } public class NotBe diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 28dceb2e30..1bff992eb7 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,13 +7,17 @@ sidebar: nav: "sidebar" --- -## Unreleased +## 8.9.0 ### What's new * Added `Excluding()` and `Excluding(Type)` overloads to exclude all members of a certain type from equivalency comparisons - [#3115](https://github.com/fluentassertions/fluentassertions/pull/3115) * New overloads of `BeXmlSerializable` and `BeDataContractSerializable` that allow `EquivalencyOptions` to be configured, allowing the use of member selection rules. - [#3107](https://github.com/fluentassertions/fluentassertions/pull/3107) +### Fixes + +* Fixed a formatting exception when comparing strings containing braces - [#3151](https://github.com/fluentassertions/fluentassertions/pull/3151) + ## 8.8.0 ### What's new From 120e842f523be0de36f1e7a850c060af6adc2255 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 16:39:17 +0000 Subject: [PATCH 776/845] Bump cspell from 9.6.0 to 9.6.2 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 9.6.0 to 9.6.2. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.6.2/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.6.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 271 +++++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 149 insertions(+), 124 deletions(-) diff --git a/package-lock.json b/package-lock.json index 456232fe0d..733024368d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.6.0" + "cspell": "^9.6.2" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.6.0.tgz", - "integrity": "sha512-gLNe9bB+5gMsTEhR9YPE0Wt122HR2EV+Q1j9W+MbwbeBJmpTWrgAP1ZdpvHOg+6LF6x/bD/EC9HfWdd/om8wXA==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.6.2.tgz", + "integrity": "sha512-s5u/3nhQUftKibPIbRLLAf4M5JG1NykqkPCxS0STMmri0hzVMZbAOCyHjdLoOCqPUn0xZzLA8fgeYg3b7QuHpg==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.1", @@ -32,15 +32,15 @@ "@cspell/dict-dotnet": "^5.0.11", "@cspell/dict-elixir": "^4.0.8", "@cspell/dict-en_us": "^4.4.27", - "@cspell/dict-en-common-misspellings": "^2.1.11", + "@cspell/dict-en-common-misspellings": "^2.1.12", "@cspell/dict-en-gb-mit": "^3.1.16", "@cspell/dict-filetypes": "^3.0.15", "@cspell/dict-flutter": "^1.1.1", "@cspell/dict-fonts": "^4.0.5", "@cspell/dict-fsharp": "^1.1.1", - "@cspell/dict-fullstack": "^3.2.7", + "@cspell/dict-fullstack": "^3.2.8", "@cspell/dict-gaming-terms": "^1.1.2", - "@cspell/dict-git": "^3.0.7", + "@cspell/dict-git": "^3.1.0", "@cspell/dict-golang": "^6.0.26", "@cspell/dict-google": "^1.0.9", "@cspell/dict-haskell": "^4.0.6", @@ -50,14 +50,14 @@ "@cspell/dict-julia": "^1.1.1", "@cspell/dict-k8s": "^1.0.12", "@cspell/dict-kotlin": "^1.1.1", - "@cspell/dict-latex": "^4.0.4", + "@cspell/dict-latex": "^5.0.0", "@cspell/dict-lorem-ipsum": "^4.0.5", "@cspell/dict-lua": "^4.0.8", "@cspell/dict-makefile": "^1.0.5", "@cspell/dict-markdown": "^2.0.14", "@cspell/dict-monkeyc": "^1.0.12", - "@cspell/dict-node": "^5.0.8", - "@cspell/dict-npm": "^5.2.29", + "@cspell/dict-node": "^5.0.9", + "@cspell/dict-npm": "^5.2.31", "@cspell/dict-php": "^4.1.1", "@cspell/dict-powershell": "^5.0.15", "@cspell/dict-public-licenses": "^2.0.15", @@ -81,30 +81,39 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.6.0.tgz", - "integrity": "sha512-5sY1lgAXS5xEOsjT5rREMADj7pHIt56XOL7xR80nNl0TwlpZbeBHhoB2aH5sirVTeodJFN5iraXNbVOYPPupPw==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.6.2.tgz", + "integrity": "sha512-8TCD7KOG9ppo5BoJOe2diACfB6I6UpJmYmjLOxMy0o8y3ruWFoDKaDEsf5tIi4T7cdVb8MjGbHjw9ksCwRRMjA==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.6.0" + "@cspell/cspell-types": "9.6.2" }, "engines": { "node": ">=20" } }, + "node_modules/@cspell/cspell-performance-monitor": { + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-performance-monitor/-/cspell-performance-monitor-9.6.2.tgz", + "integrity": "sha512-MZuhYy59zFCVsX3PzW02/3TqPsPw87MELOJuZfpWDcGgxrweTrVjMdmJ0/w7COJ6zEAqtgGjNMAEmK4xJnrQjQ==", + "license": "MIT", + "engines": { + "node": ">=20.18" + } + }, "node_modules/@cspell/cspell-pipe": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.6.0.tgz", - "integrity": "sha512-YNuY8NNXfE+8Qzknm2ps6QbrZLZu6rSZTZr3dYW3K6TK7+IFVlJ6e2Z9iKJTqp6aZ4AGU/r9QYGmNX4Oq4gZ0A==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.6.2.tgz", + "integrity": "sha512-Wt6Cf4b/E0QJ/TkbOMjXSGrccASgbc8xZq3c+8+kCXM5JT92NP2Lx67m3UA1g+BDv7E4DNPuwm1fM7o/2zum5w==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.6.0.tgz", - "integrity": "sha512-Gb2UWNmRpTOQGpYL4Q/LMw+b50KcRZcf/wJg6w0Yl3IT+F/uDNhNh1f5rHuTyGsbMsMxHJhsb2AoP+73GlbIfw==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.6.2.tgz", + "integrity": "sha512-u7P4ErApEcSP+Si2HaeotFQXjuCopAa+wPF1fDzuJzpotPxsDwNDanGGn2qUMjOyVI4UiI84MPI6ZuGLj5EDyQ==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" @@ -114,23 +123,35 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.6.0.tgz", - "integrity": "sha512-DCuKKkySTEB8MPLTdoPMdmakYcx7XCsHz1YEMbzOcLqJCxXsRlRZg4qE9kRBee/2QY7eYA2kaYNgn/TDMooa4g==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.6.2.tgz", + "integrity": "sha512-T4LBWe3NYpKPD/fIkYAL56z5pr8Cgh//UZDl4afDTJNuTkdE6ZL93MBAUXggONHqY8B9dRXlQKrD4PD+kHabtw==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.6.0.tgz", - "integrity": "sha512-JTqrD47tV+rWc1y2W8T0NTfWLQMlSWX4OF64/Jf3WbsOD+4UXVIfjRlzPry7+1Zekm6pa38+23jkDBytYpu8yw==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.6.2.tgz", + "integrity": "sha512-RsUFrSB0oQHEBnR8yarKIReUPwSu2ROpbjhdVKi4T/nQhMaS+TnIQPBwkMtb2r8A1KS2Hijw4D/4bV/XHoFQWw==", "license": "MIT", "engines": { "node": ">=20" } }, + "node_modules/@cspell/cspell-worker": { + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/@cspell/cspell-worker/-/cspell-worker-9.6.2.tgz", + "integrity": "sha512-1xq8jmt6YZ7MVPESydjYJ3p67vi+YWgi5qow1xyZzeQWFXVCCFi9pQSxC0bzGQwWrYGNWSAIbYZB3Sq5ntYz4w==", + "license": "MIT", + "dependencies": { + "cspell-lib": "9.6.2" + }, + "engines": { + "node": ">=20.18" + } + }, "node_modules/@cspell/dict-ada": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.1.1.tgz", @@ -231,9 +252,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.11.tgz", - "integrity": "sha512-2jcY494If1udvzd7MT2z/QH/RACUo/I02vIY4ttNdZhgYvUmRKhg8OBdrbzYo0lJOcc7XUb8rhIFQRHzxOSVeA==", + "version": "2.1.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.12.tgz", + "integrity": "sha512-14Eu6QGqyksqOd4fYPuRb58lK1Va7FQK9XxFsRKnZU8LhL3N+kj7YKDW+7aIaAN/0WGEqslGP6lGbQzNti8Akw==", "license": "CC BY-SA 4.0" }, "node_modules/@cspell/dict-en-gb-mit": { @@ -267,9 +288,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-fullstack": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.7.tgz", - "integrity": "sha512-IxEk2YAwAJKYCUEgEeOg3QvTL4XLlyArJElFuMQevU1dPgHgzWElFevN5lsTFnvMFA1riYsVinqJJX0BanCFEg==", + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.8.tgz", + "integrity": "sha512-J6EeoeThvx/DFrcA2rJiCA6vfqwJMbkG0IcXhlsmRZmasIpanmxgt90OEaUazbZahFiuJT8wrhgQ1QgD1MsqBw==", "license": "MIT" }, "node_modules/@cspell/dict-gaming-terms": { @@ -279,9 +300,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-git": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.7.tgz", - "integrity": "sha512-odOwVKgfxCQfiSb+nblQZc4ErXmnWEnv8XwkaI4sNJ7cNmojnvogYVeMqkXPjvfrgEcizEEA4URRD2Ms5PDk1w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.1.0.tgz", + "integrity": "sha512-KEt9zGkxqGy2q1nwH4CbyqTSv5nadpn8BAlDnzlRcnL0Xb3LX9xTgSGShKvzb0bw35lHoYyLWN2ZKAqbC4pgGQ==", "license": "MIT" }, "node_modules/@cspell/dict-golang": { @@ -339,9 +360,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-latex": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-4.0.4.tgz", - "integrity": "sha512-YdTQhnTINEEm/LZgTzr9Voz4mzdOXH7YX+bSFs3hnkUHCUUtX/mhKgf1CFvZ0YNM2afjhQcmLaR9bDQVyYBvpA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-5.0.0.tgz", + "integrity": "sha512-HUrIqUVohM6P0+5b7BsdAdb0STIv0aaFBvguI7pLcreljlcX3FSPUxea7ticzNlCNeVrEaiEn/ws9m6rYUeuNw==", "license": "MIT" }, "node_modules/@cspell/dict-lorem-ipsum": { @@ -381,15 +402,15 @@ "license": "MIT" }, "node_modules/@cspell/dict-node": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.8.tgz", - "integrity": "sha512-AirZcN2i84ynev3p2/1NCPEhnNsHKMz9zciTngGoqpdItUb2bDt1nJBjwlsrFI78GZRph/VaqTVFwYikmncpXg==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.9.tgz", + "integrity": "sha512-hO+ga+uYZ/WA4OtiMEyKt5rDUlUyu3nXMf8KVEeqq2msYvAPdldKBGH7lGONg6R/rPhv53Rb+0Y1SLdoK1+7wQ==", "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.29", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.29.tgz", - "integrity": "sha512-ZAef8JpYmbuHFT1zekj/YyImLPvZevjECw663EmG5GPePyNo4AfH8Dd2fFhaOyQ3P5I5LrkAhGwypnOfUxcssw==", + "version": "5.2.31", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.31.tgz", + "integrity": "sha512-+HoFoFe53pL0wDuSHRs5L+CcDMaG5sLfjKLPT4H0VdwNzho3HLOohTCZr6cYt7OEbXf3xi4YXBkamCy38xOpjA==", "license": "MIT" }, "node_modules/@cspell/dict-php": { @@ -498,12 +519,12 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.6.0.tgz", - "integrity": "sha512-Lkn82wyGj2ltxeYfH2bEjshdes1fx3ouYUZxeW5i6SBBvEVJoSmr43AygI8A317UMIQxVj59qVBorrtGYcRI1w==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.6.2.tgz", + "integrity": "sha512-DY/X6lsdK4aeJ4erPVZoU1ccEXqtnYqWCMUXZOsMeIsZlXwZz/ocNNd09A4ga9IzGj1lYsB13UG4GVe8lSMAXQ==", "license": "MIT", "dependencies": { - "@cspell/url": "9.6.0", + "@cspell/url": "9.6.2", "import-meta-resolve": "^4.2.0" }, "engines": { @@ -511,27 +532,27 @@ } }, "node_modules/@cspell/filetypes": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.6.0.tgz", - "integrity": "sha512-CaWyk5j20H6sr+HCArtUY95jUQb7A/6W0GC4B4umnqoWvgqwR72duowLFa+w1K2C7tZg3GoV4Wf2cUn9jjt5FA==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.6.2.tgz", + "integrity": "sha512-XYAuGZoRCUf4Y12YP+K0BpU3QUMj4Z4SkKpi08Dwx/bQlq/NqycHKkUWYhlViHLav1+MJbWxcvDIHxGNv0UIaA==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/strong-weak-map": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.6.0.tgz", - "integrity": "sha512-9g8LCLv/2RrprGeGnFAaBETWq7ESnBcoMbvgNu+vZE58iF+pbFvP0qGgKvVeKEEpc2LZhNuHLsUH37MUS6DOQg==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.6.2.tgz", + "integrity": "sha512-7zpnLkpT91wsH4aU3oAprnzrURvBWKq97j5i/SWXGuNKf36XNEO4HaeaPp6L2oVq4OzdUOdm0tUK1gB0HhMWSg==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.6.0.tgz", - "integrity": "sha512-257WOxh9vOYHAVgBNXRCdLEd+ldzlVbzcc9u+6DYoCDCNGe0OvOWOGsAfnUbMc9xEw48XgBlDYgOlPbjWGLOTg==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.6.2.tgz", + "integrity": "sha512-625EiP1jUOQZ6UQuTUV1XB8Bxa18z3EtC1qA6PJyM3TqUD8PD8Tz183j9av6d/Dq52+7w0F4ovuqjUcTXTfD6g==", "license": "MIT", "engines": { "node": ">=20" @@ -637,26 +658,28 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.6.0.tgz", - "integrity": "sha512-Mpf0oT2KAHTIb3YPAXWhW64/4CZKW5Lka4j1YxCLK3jM3nenmIsY/ocrJvqCMF4+1eejRF0N55sT3XmrijI5YQ==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.6.2.tgz", + "integrity": "sha512-EmkSGhStMbSh2BcyMqbVDOF48fSPWL3adjqajUVCwfnlZD7mzUWPx9pR8pt2dOQaFEE47rlOQGXdd3wTqL5dnQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "9.6.0", - "@cspell/cspell-pipe": "9.6.0", - "@cspell/cspell-types": "9.6.0", - "@cspell/dynamic-import": "9.6.0", - "@cspell/url": "9.6.0", + "@cspell/cspell-json-reporter": "9.6.2", + "@cspell/cspell-performance-monitor": "9.6.2", + "@cspell/cspell-pipe": "9.6.2", + "@cspell/cspell-types": "9.6.2", + "@cspell/cspell-worker": "9.6.2", + "@cspell/dynamic-import": "9.6.2", + "@cspell/url": "9.6.2", "ansi-regex": "^6.2.2", "chalk": "^5.6.2", "chalk-template": "^1.1.2", "commander": "^14.0.2", - "cspell-config-lib": "9.6.0", - "cspell-dictionary": "9.6.0", - "cspell-gitignore": "9.6.0", - "cspell-glob": "9.6.0", - "cspell-io": "9.6.0", - "cspell-lib": "9.6.0", + "cspell-config-lib": "9.6.2", + "cspell-dictionary": "9.6.2", + "cspell-gitignore": "9.6.2", + "cspell-glob": "9.6.2", + "cspell-io": "9.6.2", + "cspell-lib": "9.6.2", "fast-json-stable-stringify": "^2.1.0", "flatted": "^3.3.3", "semver": "^7.7.3", @@ -667,19 +690,19 @@ "cspell-esm": "bin.mjs" }, "engines": { - "node": ">=20" + "node": ">=20.18" }, "funding": { "url": "https://github.com/streetsidesoftware/cspell?sponsor=1" } }, "node_modules/cspell-config-lib": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.6.0.tgz", - "integrity": "sha512-5ztvheawkmFXNHGN82iOOntU3T5mmlQBP/plgoKdBZ6+lSYrOJLkOyqxYyi7MrUBDtWrXPzFllkBrPNRDlbX/A==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.6.2.tgz", + "integrity": "sha512-VQB+xmqGqCJrt5k/o0rRG9v0X0CA96CEd9FsmBAm5+9DvNiRzXOqewZSdsOM2Y0SX7YKcvG82PfRsujhYltcfQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.6.0", + "@cspell/cspell-types": "9.6.2", "comment-json": "^4.5.1", "smol-toml": "^1.6.0", "yaml": "^2.8.2" @@ -689,14 +712,15 @@ } }, "node_modules/cspell-dictionary": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.6.0.tgz", - "integrity": "sha512-wW0m1kLrbK6bRY/GrLUGKUUJ1Z4ZUgIb8LD4zNaECcvGviv9V7VcR3mEwUip3ZjoHa3ClzEoWgQ9gXrtac80Wg==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.6.2.tgz", + "integrity": "sha512-J55/9+AtkRzfSVn+KaqoWxsS4O66szKP6LrDW0O2qWnuvVvO1BoAMsINynD845IIzrd1n1yTOHS/DbjmHd4//A==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.6.0", - "@cspell/cspell-types": "9.6.0", - "cspell-trie-lib": "9.6.0", + "@cspell/cspell-performance-monitor": "9.6.2", + "@cspell/cspell-pipe": "9.6.2", + "@cspell/cspell-types": "9.6.2", + "cspell-trie-lib": "9.6.2", "fast-equals": "^6.0.0" }, "engines": { @@ -704,14 +728,14 @@ } }, "node_modules/cspell-gitignore": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.6.0.tgz", - "integrity": "sha512-8GfmJuRBBvibyPHnNE2wYJAiQ/ceDYLD1X1sUQaCyj6hPMR7ChJiVhFPtS11hMqkjZ46OBMYTMGWqO792L9fEQ==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.6.2.tgz", + "integrity": "sha512-vtwc9AAA9m3aZPtbvPPRTLXIqwryljxEgQTkpr92mFZaGftvnLfNVb2z++NvWbXq9azGKN/7oiLjecb9dhYnfA==", "license": "MIT", "dependencies": { - "@cspell/url": "9.6.0", - "cspell-glob": "9.6.0", - "cspell-io": "9.6.0" + "@cspell/url": "9.6.2", + "cspell-glob": "9.6.2", + "cspell-io": "9.6.2" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -721,12 +745,12 @@ } }, "node_modules/cspell-glob": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.6.0.tgz", - "integrity": "sha512-KmEbKN0qdEamsEYbkFu7zjLYfw3hMmn9kmeh94IHr2kq6vWq5vNP5l1BuqmrUeFZlbNd07vj08IKAZHYsoGheQ==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.6.2.tgz", + "integrity": "sha512-5j+g4JzcWjW16ZAtcPHpG138CEfpp1YmuYJoYtze3lIZLgttt+k2gXJsqyWaP/6MdVknI0Q1afGSKYRtH8mLRA==", "license": "MIT", "dependencies": { - "@cspell/url": "9.6.0", + "@cspell/url": "9.6.2", "picomatch": "^4.0.3" }, "engines": { @@ -734,13 +758,13 @@ } }, "node_modules/cspell-grammar": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.6.0.tgz", - "integrity": "sha512-jZVIM5/3eB9rWURDq+VXdYip+DmPuFzO+bqaRtzqT8w6YoOIGYbiIxdwvyyA9xdH7SmW8uqHJP5x4pzZju1lNQ==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.6.2.tgz", + "integrity": "sha512-JTH92+1VGFPb3UsDT+Ezur/ouR8t+XOZkETUkk8eoSBzli9hWgPHW7kl2T8Chcn+Dq/6FLlvezYbBvhSauqJRw==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.6.0", - "@cspell/cspell-types": "9.6.0" + "@cspell/cspell-pipe": "9.6.2", + "@cspell/cspell-types": "9.6.2" }, "bin": { "cspell-grammar": "bin.mjs" @@ -750,39 +774,40 @@ } }, "node_modules/cspell-io": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.6.0.tgz", - "integrity": "sha512-wZuZzKOYIb698kVEINYjGaNFQu+AFZ945TORM3hapmPjez+vsHwl8m/pPpCHeGMpQtHMEDkX84AbQ7R55MRIwg==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.6.2.tgz", + "integrity": "sha512-VRBkAfUdbaq5yDYoVMvodQF3bIdBL6Gy4tiMvf+UI9C16am47AuThg1gGXRzwi5hCEXnCfevAmuVdaQP3onkow==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "9.6.0", - "@cspell/url": "9.6.0" + "@cspell/cspell-service-bus": "9.6.2", + "@cspell/url": "9.6.2" }, "engines": { "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.6.0.tgz", - "integrity": "sha512-m9rIv8hkQ3Dio4s80HQbM9cdxENcd6pS8j2AHWL50OSjJf3Xhw6/wMrIAGbwLHP15K6QZVU2eJ/abCzIJwjA4w==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.6.2.tgz", + "integrity": "sha512-LvValIwqDAwVp2Www+7PPJ7UbVurYtKGPddpGH7GN+0u+UWzR4oUXR80gY8lHgSrIQ3EkdLhFAItPcyMjGjzIg==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.6.0", - "@cspell/cspell-pipe": "9.6.0", - "@cspell/cspell-resolver": "9.6.0", - "@cspell/cspell-types": "9.6.0", - "@cspell/dynamic-import": "9.6.0", - "@cspell/filetypes": "9.6.0", - "@cspell/strong-weak-map": "9.6.0", - "@cspell/url": "9.6.0", + "@cspell/cspell-bundled-dicts": "9.6.2", + "@cspell/cspell-performance-monitor": "9.6.2", + "@cspell/cspell-pipe": "9.6.2", + "@cspell/cspell-resolver": "9.6.2", + "@cspell/cspell-types": "9.6.2", + "@cspell/dynamic-import": "9.6.2", + "@cspell/filetypes": "9.6.2", + "@cspell/strong-weak-map": "9.6.2", + "@cspell/url": "9.6.2", "clear-module": "^4.1.2", - "cspell-config-lib": "9.6.0", - "cspell-dictionary": "9.6.0", - "cspell-glob": "9.6.0", - "cspell-grammar": "9.6.0", - "cspell-io": "9.6.0", - "cspell-trie-lib": "9.6.0", + "cspell-config-lib": "9.6.2", + "cspell-dictionary": "9.6.2", + "cspell-glob": "9.6.2", + "cspell-grammar": "9.6.2", + "cspell-io": "9.6.2", + "cspell-trie-lib": "9.6.2", "env-paths": "^3.0.0", "gensequence": "^8.0.8", "import-fresh": "^3.3.1", @@ -796,15 +821,15 @@ } }, "node_modules/cspell-trie-lib": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.6.0.tgz", - "integrity": "sha512-L7GSff5F9cF60QT78WsebVlb3sppi6jbvTHwsw7WF1jUN/ioAo7OzBYtYB7xkYeejcdVEpqfvf/ZOXPDp8x2Wg==", + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.6.2.tgz", + "integrity": "sha512-JpCHpMdxo680yEkb6U1y3wrhZGHltgCnaQ8Zj6yKE8KE0BTLVl9UQGisP5De1wlFn4GtpPCf7WtQ8+M5aqq3YQ==", "license": "MIT", "engines": { "node": ">=20" }, "peerDependencies": { - "@cspell/cspell-types": "9.6.0" + "@cspell/cspell-types": "9.6.2" } }, "node_modules/env-paths": { diff --git a/package.json b/package.json index cbe3bc8624..eb342ba980 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.6.0" + "cspell": "^9.6.2" } } From 590eda54ae9187ce6148b1c59de7c51ae52597b6 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 27 Jan 2026 19:29:12 +0100 Subject: [PATCH 777/845] Bump Node 20.17.0 -> 20.20.0 --- NodeVersion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NodeVersion b/NodeVersion index 3516580bbb..586e275eb9 100644 --- a/NodeVersion +++ b/NodeVersion @@ -1 +1 @@ -20.17.0 +20.20.0 From e546bda2a150ec7172d4948c8afb5ce40b99ed94 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Thu, 29 Jan 2026 08:22:33 +0100 Subject: [PATCH 778/845] Hide the FluentAssertions code from the stack trace --- .../AggregateExceptionExtractor.cs | 1 + Src/FluentAssertions/AndConstraint.cs | 1 + Src/FluentAssertions/AndWhichConstraint.cs | 7 +- .../AssertionConfiguration.cs | 3 +- Src/FluentAssertions/AssertionEngine.cs | 2 + Src/FluentAssertions/AtLeast.cs | 3 +- Src/FluentAssertions/AtMost.cs | 3 +- .../CallerIdentification/IParsingStrategy.cs | 2 +- .../MultiLineCommentParsingStrategy.cs | 2 +- .../CallerIdentification/ParsingState.cs | 2 +- .../QuotesParsingStrategy.cs | 2 +- .../SemicolonParsingStrategy.cs | 2 +- .../ShouldCallParsingStrategy.cs | 2 +- .../SingleLineCommentParsingStrategy.cs | 2 +- .../CallerIdentification/StatementParser.cs | 2 +- Src/FluentAssertions/CallerIdentifier.cs | 4 +- .../GenericCollectionAssertions.cs | 35 ++-- .../GenericDictionaryAssertions.cs | 2 +- .../MaximumMatching/MaximumMatchingProblem.cs | 2 +- .../MaximumMatchingSolution.cs | 2 +- .../MaximumMatching/MaximumMatchingSolver.cs | 2 +- .../Collections/MaximumMatching/Predicate.cs | 2 +- .../Collections/StringCollectionAssertions.cs | 5 +- .../Collections/WhoseValueConstraint.cs | 1 + .../Common/CSharpAccessModifierExtensions.cs | 4 +- Src/FluentAssertions/Common/Clock.cs | 3 +- .../Common/DateTimeExtensions.cs | 1 + .../Common/EnumerableExtensions.cs | 1 + .../Common/ExceptionExtensions.cs | 4 +- .../Common/ExpressionExtensions.cs | 176 +++++++++--------- Src/FluentAssertions/Common/Guard.cs | 3 +- Src/FluentAssertions/Common/IClock.cs | 2 +- Src/FluentAssertions/Common/ITimer.cs | 2 +- .../Common/IntegerExtensions.cs | 5 +- Src/FluentAssertions/Common/Iterator.cs | 4 +- .../KeyValuePairCollectionExtensions.cs | 4 +- Src/FluentAssertions/Common/MemberPath.cs | 2 + .../MemberPathSegmentEqualityComparer.cs | 4 +- .../Common/MethodInfoExtensions.cs | 4 +- .../Common/ObjectExtensions.cs | 2 + .../Common/PropertyInfoExtensions.cs | 4 +- Src/FluentAssertions/Common/StartTimer.cs | 2 +- Src/FluentAssertions/Common/StopwatchTimer.cs | 4 +- .../Common/StringExtensions.cs | 2 + .../Common/TimeOnlyExtensions.cs | 2 + Src/FluentAssertions/Common/TypeExtensions.cs | 2 + Src/FluentAssertions/Common/TypeReflector.cs | 4 +- .../Common/ValueFormatterDetectionMode.cs | 2 +- .../Configuration/GlobalConfiguration.cs | 1 + .../Configuration/GlobalEquivalencyOptions.cs | 3 + .../Configuration/GlobalFormattingOptions.cs | 2 + .../CustomAssertionAttribute.cs | 4 +- .../CustomAssertionsAssemblyAttribute.cs | 2 + Src/FluentAssertions/Disposable.cs | 4 +- .../Equivalency/AssertionChainExtensions.cs | 2 + .../Equivalency/Comparands.cs | 5 +- .../Equivalency/ConversionSelector.cs | 2 + Src/FluentAssertions/Equivalency/Digit.cs | 2 + .../Equivalency/EqualityStrategyProvider.cs | 2 + .../Equivalency/EquivalencyOptions.cs | 2 + .../Equivalency/EquivalencyPlan.cs | 6 +- .../Equivalency/EquivalencyStep.cs | 3 +- .../EquivalencyValidationContext.cs | 3 + .../Equivalency/EquivalencyValidator.cs | 1 + .../CollectionMemberOptionsDecorator.cs | 2 + .../Execution/CyclicReferenceDetector.cs | 2 + .../Equivalency/Execution/ObjectInfo.cs | 2 + .../Equivalency/Execution/ObjectReference.cs | 2 + Src/FluentAssertions/Equivalency/Field.cs | 2 + .../Inlining/ActionBasedInlineAssertion.cs | 2 + .../Inlining/ConditionBasedInlineAssertion.cs | 2 + .../Inlining/InlineEquivalencyStep.cs | 2 + .../Equivalency/JsonProperty.cs | 2 + .../Equivalency/MemberFactory.cs | 3 + .../Equivalency/MemberSelectionContext.cs | 2 + .../Equivalency/MemberVisibility.cs | 2 +- .../Equivalency/MemberVisibilityExtensions.cs | 2 + .../MultiDimensionalArrayEquivalencyStep.cs | 4 +- .../NestedExclusionOptionBuilder.cs | 4 +- Src/FluentAssertions/Equivalency/Node.cs | 2 + .../Equivalency/OrderingRuleCollection.cs | 2 + Src/FluentAssertions/Equivalency/Property.cs | 2 + .../ExcludeMemberByPredicateSelectionRule.cs | 2 +- .../ExcludeNonBrowsableMembersRule.cs | 2 +- .../SelfReferenceEquivalencyOptions.cs | 4 +- .../Equivalency/Steps/AssertionContext.cs | 2 + .../Equivalency/Steps/AssertionResultSet.cs | 2 + .../Steps/AssertionRuleEquivalencyStep.cs | 3 + .../Equivalency/Steps/AutoConversionStep.cs | 2 + .../Steps/DateAndTimeEquivalencyStep.cs | 2 + .../Steps/DictionaryEquivalencyStep.cs | 11 +- .../Steps/DictionaryInterfaceInfo.cs | 4 +- .../Equivalency/Steps/EnumEqualityStep.cs | 24 +-- .../Steps/EnumerableEquivalencyStep.cs | 3 + .../Steps/EnumerableEquivalencyValidator.cs | 2 + ...numerableEquivalencyValidatorExtensions.cs | 2 + .../Steps/EqualityComparerEquivalencyStep.cs | 3 + .../EquivalencyValidationContextExtensions.cs | 4 +- .../Steps/GenericDictionaryEquivalencyStep.cs | 3 + .../Steps/GenericEnumerableEquivalencyStep.cs | 3 + .../Equivalency/Steps/JsonConversionStep.cs | 2 + .../Steps/ReferenceEqualityEquivalencyStep.cs | 3 +- .../Steps/RunAllUserStepsEquivalencyStep.cs | 3 +- .../Steps/SimpleEqualityEquivalencyStep.cs | 2 + .../Steps/StringEqualityEquivalencyStep.cs | 2 + .../StructuralEqualityEquivalencyStep.cs | 2 + .../Equivalency/Steps/TypeEquivalencyStep.cs | 2 + .../Steps/ValueTypeEquivalencyStep.cs | 2 + .../Steps/XAttributeEquivalencyStep.cs | 3 +- .../Steps/XDocumentEquivalencyStep.cs | 3 +- .../Steps/XElementEquivalencyStep.cs | 3 +- .../Equivalency/SubjectInfoExtensions.cs | 4 +- .../Typing/AlwaysBeStrictTypingRule.cs | 1 + .../Typing/PredicateBasedTypingRule.cs | 2 + .../EventRaisingExtensions.cs | 1 + .../Events/EventAssertions.cs | 3 +- .../Events/EventHandlerFactory.cs | 2 + Src/FluentAssertions/Events/EventMetadata.cs | 4 +- Src/FluentAssertions/Events/EventMonitor.cs | 4 +- .../Events/EventMonitorOptions.cs | 2 + Src/FluentAssertions/Events/EventRecorder.cs | 1 + .../Events/FilteredEventRecording.cs | 4 +- Src/FluentAssertions/Events/IMonitor.cs | 2 +- Src/FluentAssertions/Events/OccurredEvent.cs | 4 +- Src/FluentAssertions/Events/RecordedEvent.cs | 3 +- .../Events/ThreadSafeSequenceGenerator.cs | 2 + Src/FluentAssertions/Exactly.cs | 3 +- .../ExceptionAssertionsExtensions.cs | 2 + .../Execution/AssertionChain.cs | 3 +- .../Execution/AssertionFailedException.cs | 2 + .../Execution/AssertionScope.cs | 1 + .../Execution/CollectingAssertionStrategy.cs | 1 + .../Execution/ContextDataDictionary.cs | 2 + .../Execution/Continuation.cs | 3 +- .../Execution/ContinuationOfGiven.cs | 4 +- .../Execution/DefaultAssertionStrategy.cs | 1 + Src/FluentAssertions/Execution/FailReason.cs | 1 + .../Execution/FailureMessageFormatter.cs | 4 +- .../Execution/FallbackTestFramework.cs | 1 + .../Execution/GivenSelector.cs | 4 +- .../Execution/GivenSelectorExtensions.cs | 5 +- .../Execution/IAssertionStrategy.cs | 2 +- .../Execution/ITestFramework.cs | 2 +- .../Execution/LateBoundTestFramework.cs | 3 +- .../Execution/MSTestFrameworkV2.cs | 3 +- .../Execution/MSTestFrameworkV4.cs | 3 +- .../Execution/MSpecFramework.cs | 3 +- .../Execution/NUnitTestFramework.cs | 3 +- Src/FluentAssertions/Execution/Reason.cs | 2 + .../Execution/StringExtensions.cs | 1 + .../Execution/SubjectIdentificationBuilder.cs | 2 + .../Execution/TUnitFramework.cs | 3 +- .../Execution/TestFrameworkFactory.cs | 4 +- .../Execution/WithoutFormattingWrapper.cs | 2 + .../Execution/XUnitTestFramework.cs | 1 + .../AssertionEngineInitializerAttribute.cs | 4 +- .../Extensions/FluentTimeSpanExtensions.cs | 1 + .../OccurrenceConstraintExtensions.cs | 1 + Src/FluentAssertions/FluentActions.cs | 3 +- Src/FluentAssertions/FluentAssertions.csproj | 6 +- .../DateTimeOffsetValueFormatter.cs | 2 +- .../Formatting/DecimalValueFormatter.cs | 2 +- .../Formatting/DictionaryValueFormatter.cs | 2 +- .../Formatting/DoubleValueFormatter.cs | 2 +- .../Formatting/EnumValueFormatter.cs | 2 +- .../Formatting/EnumerableExtensions.cs | 2 +- .../Formatting/EnumerableValueFormatter.cs | 2 +- .../Formatting/ExceptionValueFormatter.cs | 2 +- .../Formatting/ExpressionValueFormatter.cs | 2 +- .../Formatting/FormatChild.cs | 2 +- Src/FluentAssertions/Formatting/Formatter.cs | 2 +- .../Formatting/FormattingContext.cs | 2 +- .../Formatting/FormattingOptions.cs | 2 +- .../Formatting/IValueFormatter.cs | 2 +- .../Formatting/Int16ValueFormatter.cs | 2 +- .../Formatting/Int32ValueFormatter.cs | 2 +- .../Formatting/Int64ValueFormatter.cs | 2 +- .../Formatting/MaxLinesExceededException.cs | 2 +- .../MultidimensionalArrayFormatter.cs | 2 +- .../Formatting/NullValueFormatter.cs | 2 +- ...PredicateLambdaExpressionValueFormatter.cs | 2 +- .../Formatting/PropertyInfoFormatter.cs | 2 +- .../Formatting/SByteValueFormatter.cs | 2 +- .../Formatting/SingleValueFormatter.cs | 2 +- .../Formatting/StringValueFormatter.cs | 2 +- .../Formatting/TaskFormatter.cs | 2 +- .../Formatting/TimeSpanValueFormatter.cs | 2 +- .../Formatting/UInt16ValueFormatter.cs | 2 +- .../Formatting/UInt32ValueFormatter.cs | 2 +- .../Formatting/UInt64ValueFormatter.cs | 2 +- .../Formatting/XDocumentValueFormatter.cs | 2 +- .../Formatting/XElementValueFormatter.cs | 2 +- .../Formatting/XmlReaderValueFormatter.cs | 2 +- .../JsonAssertionExtensions.cs | 2 +- Src/FluentAssertions/LessThan.cs | 3 +- Src/FluentAssertions/License.cs | 1 + Src/FluentAssertions/MoreThan.cs | 3 +- .../Numeric/ByteAssertions.cs | 2 +- .../Numeric/DecimalAssertions.cs | 2 +- .../Numeric/DoubleAssertions.cs | 2 +- .../Numeric/Int16Assertions.cs | 2 +- .../Numeric/Int32Assertions.cs | 2 +- .../Numeric/Int64Assertions.cs | 2 +- .../Numeric/NullableByteAssertions.cs | 2 +- .../Numeric/NullableDecimalAssertions.cs | 2 +- .../Numeric/NullableInt16Assertions.cs | 2 +- .../Numeric/NullableInt32Assertions.cs | 2 +- .../Numeric/NullableInt64Assertions.cs | 2 +- .../Numeric/NullableSByteAssertions.cs | 2 +- .../Numeric/NullableSingleAssertions.cs | 2 +- .../Numeric/NullableUInt16Assertions.cs | 2 +- .../Numeric/NullableUInt32Assertions.cs | 2 +- .../Numeric/NullableUInt64Assertions.cs | 2 +- .../Numeric/NumericAssertionsBase.cs | 2 + .../Numeric/SByteAssertions.cs | 3 +- .../Numeric/SingleAssertions.cs | 3 +- .../Numeric/UInt16Assertions.cs | 2 +- .../Numeric/UInt32Assertions.cs | 2 +- .../Numeric/UInt64Assertions.cs | 2 +- .../NumericAssertionsExtensions.cs | 1 + .../ObjectAssertionsExtensions.cs | 2 + Src/FluentAssertions/OccurrenceConstraint.cs | 4 +- .../Polyfill/StringBuilderExtensions.cs | 2 +- .../Polyfill/StringExtensions.cs | 2 +- .../Polyfill/SystemExtensions.cs | 2 +- .../Primitives/BooleanAssertions.cs | 2 +- .../Primitives/DateOnlyAssertions.cs | 2 +- .../Primitives/DateTimeAssertions.cs | 2 +- .../Primitives/DateTimeOffsetAssertions.cs | 2 +- .../DateTimeOffsetRangeAssertions.cs | 3 +- .../Primitives/DateTimeRangeAssertions.cs | 3 +- .../Primitives/EnumAssertions.cs | 3 +- .../Primitives/GuidAssertions.cs | 2 +- .../Primitives/NullableBooleanAssertions.cs | 3 +- .../Primitives/NullableDateOnlyAssertions.cs | 1 + .../Primitives/NullableDateTimeAssertions.cs | 3 +- .../NullableDateTimeOffsetAssertions.cs | 3 +- .../Primitives/NullableEnumAssertions.cs | 3 +- .../Primitives/NullableGuidAssertions.cs | 3 +- .../NullableSimpleTimeSpanAssertions.cs | 3 +- .../Primitives/NullableTimeOnlyAssertions.cs | 1 + .../Primitives/SimpleTimeSpanAssertions.cs | 3 +- .../Primitives/StringAssertions.cs | 2 +- .../Primitives/StringContainsStrategy.cs | 3 + .../Primitives/StringEndStrategy.cs | 3 + .../Primitives/StringEqualityStrategy.cs | 1 + .../Primitives/StringStartStrategy.cs | 3 + .../Primitives/StringValidator.cs | 1 + .../StringValidatorSupportingNull.cs | 2 + .../StringWildcardMatchingStrategy.cs | 11 +- .../Primitives/TimeOnlyAssertions.cs | 2 +- .../Primitives/TimeSpanPredicate.cs | 2 + .../Specialized/ActionAssertions.cs | 2 +- .../Specialized/DelegateAssertions.cs | 2 +- .../Specialized/DelegateAssertionsBase.cs | 2 +- .../Specialized/ExceptionAssertions.cs | 2 +- .../Specialized/ExecutionTime.cs | 5 +- .../Specialized/ExecutionTimeAssertions.cs | 4 +- .../Specialized/FunctionAssertions.cs | 2 +- .../GenericAsyncFunctionAssertions.cs | 2 + .../Specialized/JsonNodeAssertions.cs | 1 + .../Specialized/JsonValueExtensions.cs | 2 + .../Specialized/MemberExecutionTime.cs | 5 +- .../NonGenericAsyncFunctionAssertions.cs | 2 + .../TaskCompletionSourceAssertions.cs | 6 +- .../TaskCompletionSourceAssertionsBase.cs | 2 + .../Streams/BufferedStreamAssertions.cs | 9 +- .../Streams/StreamAssertions.cs | 4 +- .../TypeEnumerableExtensions.cs | 1 + Src/FluentAssertions/TypeExtensions.cs | 1 + Src/FluentAssertions/Types/AllTypes.cs | 2 + .../Types/AssemblyAssertions.cs | 3 +- .../Types/ConstructorInfoAssertions.cs | 1 + .../Types/MemberInfoAssertions.cs | 1 + .../Types/MethodBaseAssertions.cs | 1 + .../Types/MethodInfoAssertions.cs | 1 + .../Types/MethodInfoSelector.cs | 2 + .../Types/MethodInfoSelectorAssertions.cs | 1 + .../Types/PropertyInfoAssertions.cs | 1 + .../Types/PropertyInfoSelector.cs | 2 + .../Types/PropertyInfoSelectorAssertions.cs | 1 + Src/FluentAssertions/Types/TypeAssertions.cs | 1 + Src/FluentAssertions/Types/TypeSelector.cs | 2 + .../Types/TypeSelectorAssertions.cs | 1 + Src/FluentAssertions/Value.cs | 2 + .../Xml/Equivalency/AttributeData.cs | 1 + .../Xml/Equivalency/Failure.cs | 1 + Src/FluentAssertions/Xml/Equivalency/Node.cs | 2 + .../Xml/Equivalency/XmlIterator.cs | 2 + .../Xml/Equivalency/XmlReaderValidator.cs | 3 +- .../Xml/XAttributeAssertions.cs | 1 + .../Xml/XDocumentAssertions.cs | 1 + .../Xml/XElementAssertions.cs | 3 +- .../Xml/XmlElementAssertions.cs | 3 +- Src/FluentAssertions/Xml/XmlNodeAssertions.cs | 3 +- Src/FluentAssertions/Xml/XmlNodeFormatter.cs | 4 +- .../XmlAssertionExtensions.cs | 3 +- .../FluentAssertions/net6.0.verified.txt | 73 ++++++++ .../Exceptions/OuterExceptionSpecs.cs | 1 - .../StackTraceHiddenSpecs.cs | 88 +++++++++ 300 files changed, 809 insertions(+), 311 deletions(-) create mode 100644 Tests/FluentAssertions.Specs/StackTraceHiddenSpecs.cs diff --git a/Src/FluentAssertions/AggregateExceptionExtractor.cs b/Src/FluentAssertions/AggregateExceptionExtractor.cs index 9f697b2776..1262e57d60 100644 --- a/Src/FluentAssertions/AggregateExceptionExtractor.cs +++ b/Src/FluentAssertions/AggregateExceptionExtractor.cs @@ -6,6 +6,7 @@ namespace FluentAssertions; +[System.Diagnostics.StackTraceHidden] public class AggregateExceptionExtractor : IExtractExceptions { public IEnumerable OfType(Exception actualException) diff --git a/Src/FluentAssertions/AndConstraint.cs b/Src/FluentAssertions/AndConstraint.cs index 796336bd30..fd46c5ee30 100644 --- a/Src/FluentAssertions/AndConstraint.cs +++ b/Src/FluentAssertions/AndConstraint.cs @@ -2,6 +2,7 @@ namespace FluentAssertions; +[StackTraceHidden] [DebuggerNonUserCode] public class AndConstraint { diff --git a/Src/FluentAssertions/AndWhichConstraint.cs b/Src/FluentAssertions/AndWhichConstraint.cs index 37d6183a47..9b0e83e1ae 100644 --- a/Src/FluentAssertions/AndWhichConstraint.cs +++ b/Src/FluentAssertions/AndWhichConstraint.cs @@ -1,5 +1,6 @@ -using System; +using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using FluentAssertions.Execution; using FluentAssertions.Formatting; @@ -10,6 +11,8 @@ namespace FluentAssertions; /// Provides a property that can be used in chained assertions where the prior assertions returns a /// single object that the assertion continues on. /// +[StackTraceHidden] +[DebuggerNonUserCode] public class AndWhichConstraint : AndConstraint { private readonly AssertionChain assertionChain; @@ -98,7 +101,7 @@ private static TSubject Single(IEnumerable subjects) matchedElements.Select(ele => "\t" + Formatter.ToString(ele))); string message = "More than one object found. FluentAssertions cannot determine which object is meant." - + $" Found objects:{Environment.NewLine}{foundObjects}"; + + $" Found objects:{Environment.NewLine}{foundObjects}"; AssertionEngine.TestFramework.Throw(message); } diff --git a/Src/FluentAssertions/AssertionConfiguration.cs b/Src/FluentAssertions/AssertionConfiguration.cs index 82a2833716..463118084f 100644 --- a/Src/FluentAssertions/AssertionConfiguration.cs +++ b/Src/FluentAssertions/AssertionConfiguration.cs @@ -1,10 +1,11 @@ -using FluentAssertions.Configuration; +using FluentAssertions.Configuration; namespace FluentAssertions; /// /// Provides access to the global configuration and options to customize the behavior of FluentAssertions. /// +[System.Diagnostics.StackTraceHidden] public static class AssertionConfiguration { public static GlobalConfiguration Current => AssertionEngine.Configuration; diff --git a/Src/FluentAssertions/AssertionEngine.cs b/Src/FluentAssertions/AssertionEngine.cs index 3c36472317..69d8bd808f 100644 --- a/Src/FluentAssertions/AssertionEngine.cs +++ b/Src/FluentAssertions/AssertionEngine.cs @@ -12,6 +12,7 @@ namespace FluentAssertions; /// /// Represents the run-time configuration of the assertion library. /// +[StackTraceHidden] public static class AssertionEngine { private static readonly object Lockable = new(); @@ -148,3 +149,4 @@ private static bool IsFramework(Assembly assembly) #endif } } + diff --git a/Src/FluentAssertions/AtLeast.cs b/Src/FluentAssertions/AtLeast.cs index 95750816f2..37fd679599 100644 --- a/Src/FluentAssertions/AtLeast.cs +++ b/Src/FluentAssertions/AtLeast.cs @@ -1,5 +1,6 @@ -namespace FluentAssertions; +namespace FluentAssertions; +[System.Diagnostics.StackTraceHidden] public static class AtLeast { public static OccurrenceConstraint Once() => new AtLeastTimesConstraint(1); diff --git a/Src/FluentAssertions/AtMost.cs b/Src/FluentAssertions/AtMost.cs index e11c892068..5268a80de2 100644 --- a/Src/FluentAssertions/AtMost.cs +++ b/Src/FluentAssertions/AtMost.cs @@ -1,5 +1,6 @@ -namespace FluentAssertions; +namespace FluentAssertions; +[System.Diagnostics.StackTraceHidden] public static class AtMost { public static OccurrenceConstraint Once() => new AtMostTimesConstraint(1); diff --git a/Src/FluentAssertions/CallerIdentification/IParsingStrategy.cs b/Src/FluentAssertions/CallerIdentification/IParsingStrategy.cs index 1076b460ae..8c5beea1d7 100644 --- a/Src/FluentAssertions/CallerIdentification/IParsingStrategy.cs +++ b/Src/FluentAssertions/CallerIdentification/IParsingStrategy.cs @@ -1,4 +1,4 @@ -using System.Text; +using System.Text; namespace FluentAssertions.CallerIdentification; diff --git a/Src/FluentAssertions/CallerIdentification/MultiLineCommentParsingStrategy.cs b/Src/FluentAssertions/CallerIdentification/MultiLineCommentParsingStrategy.cs index 8630d3d5a8..115da14aef 100644 --- a/Src/FluentAssertions/CallerIdentification/MultiLineCommentParsingStrategy.cs +++ b/Src/FluentAssertions/CallerIdentification/MultiLineCommentParsingStrategy.cs @@ -1,4 +1,4 @@ -using System.Text; +using System.Text; namespace FluentAssertions.CallerIdentification; diff --git a/Src/FluentAssertions/CallerIdentification/ParsingState.cs b/Src/FluentAssertions/CallerIdentification/ParsingState.cs index 18ac092068..607fc3b8b0 100644 --- a/Src/FluentAssertions/CallerIdentification/ParsingState.cs +++ b/Src/FluentAssertions/CallerIdentification/ParsingState.cs @@ -1,4 +1,4 @@ -namespace FluentAssertions.CallerIdentification; +namespace FluentAssertions.CallerIdentification; internal enum ParsingState { diff --git a/Src/FluentAssertions/CallerIdentification/QuotesParsingStrategy.cs b/Src/FluentAssertions/CallerIdentification/QuotesParsingStrategy.cs index 1cb9f41906..8eda4c9aa3 100644 --- a/Src/FluentAssertions/CallerIdentification/QuotesParsingStrategy.cs +++ b/Src/FluentAssertions/CallerIdentification/QuotesParsingStrategy.cs @@ -1,4 +1,4 @@ -using System.Text; +using System.Text; namespace FluentAssertions.CallerIdentification; diff --git a/Src/FluentAssertions/CallerIdentification/SemicolonParsingStrategy.cs b/Src/FluentAssertions/CallerIdentification/SemicolonParsingStrategy.cs index c5480ef6b5..b01d7e3101 100644 --- a/Src/FluentAssertions/CallerIdentification/SemicolonParsingStrategy.cs +++ b/Src/FluentAssertions/CallerIdentification/SemicolonParsingStrategy.cs @@ -1,4 +1,4 @@ -using System.Text; +using System.Text; namespace FluentAssertions.CallerIdentification; diff --git a/Src/FluentAssertions/CallerIdentification/ShouldCallParsingStrategy.cs b/Src/FluentAssertions/CallerIdentification/ShouldCallParsingStrategy.cs index e7a82a85dd..b45af424c4 100644 --- a/Src/FluentAssertions/CallerIdentification/ShouldCallParsingStrategy.cs +++ b/Src/FluentAssertions/CallerIdentification/ShouldCallParsingStrategy.cs @@ -1,4 +1,4 @@ -using System.Text; +using System.Text; namespace FluentAssertions.CallerIdentification; diff --git a/Src/FluentAssertions/CallerIdentification/SingleLineCommentParsingStrategy.cs b/Src/FluentAssertions/CallerIdentification/SingleLineCommentParsingStrategy.cs index 371facc25f..4dbf5eed8d 100644 --- a/Src/FluentAssertions/CallerIdentification/SingleLineCommentParsingStrategy.cs +++ b/Src/FluentAssertions/CallerIdentification/SingleLineCommentParsingStrategy.cs @@ -1,4 +1,4 @@ -using System.Text; +using System.Text; namespace FluentAssertions.CallerIdentification; diff --git a/Src/FluentAssertions/CallerIdentification/StatementParser.cs b/Src/FluentAssertions/CallerIdentification/StatementParser.cs index 2b9497653d..26dbaf0add 100644 --- a/Src/FluentAssertions/CallerIdentification/StatementParser.cs +++ b/Src/FluentAssertions/CallerIdentification/StatementParser.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/Src/FluentAssertions/CallerIdentifier.cs b/Src/FluentAssertions/CallerIdentifier.cs index 4948e4ea0f..af437bbcaf 100644 --- a/Src/FluentAssertions/CallerIdentifier.cs +++ b/Src/FluentAssertions/CallerIdentifier.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; @@ -16,6 +16,7 @@ namespace FluentAssertions; /// Tries to extract the name of the variable or invocation on which the assertion is executed. /// // REFACTOR: Should be internal and treated as an implementation detail of the AssertionScope +[StackTraceHidden] public static class CallerIdentifier { public static Action Logger { get; set; } = _ => { }; @@ -290,3 +291,4 @@ private static StackFrame[] GetFrames(StackTrace stack) .ToArray(); } } + diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index afff6d0f95..48afbd0128 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; @@ -36,7 +36,6 @@ public GenericCollectionAssertions(TCollection actualValue, AssertionChain asser #pragma warning disable CS0659, S1206 // Ignore not overriding Object.GetHashCode() #pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals - [DebuggerNonUserCode] public class GenericCollectionAssertions : ReferenceTypeAssertions where TCollection : IEnumerable @@ -1186,28 +1185,28 @@ public AndWhichConstraint ContainSingle( switch (actualItems.Count) { case 0: // Fail, Collection is empty - { - assertionChain - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:collection} to contain a single item{reason}, but the collection is empty."); + { + assertionChain + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:collection} to contain a single item{reason}, but the collection is empty."); - break; - } + break; + } case 1: // Success Condition - { - match = actualItems.Single(); - break; - } + { + match = actualItems.Single(); + break; + } default: // Fail, Collection contains more than a single item - { - assertionChain - .BecauseOf(because, becauseArgs) - .FailWith("Expected {context:collection} to contain a single item{reason}, but found {0}.", Subject); + { + assertionChain + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:collection} to contain a single item{reason}, but found {0}.", Subject); - break; - } + break; + } } } diff --git a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs index 68f3c66a4a..9607f5fd72 100644 --- a/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingProblem.cs b/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingProblem.cs index b5955cbe83..bb4a6433bc 100644 --- a/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingProblem.cs +++ b/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingProblem.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; diff --git a/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingSolution.cs b/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingSolution.cs index e4b28e29b1..230c312baf 100644 --- a/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingSolution.cs +++ b/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingSolution.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; namespace FluentAssertions.Collections.MaximumMatching; diff --git a/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingSolver.cs b/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingSolver.cs index 8bf25ee394..e87a2a58a2 100644 --- a/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingSolver.cs +++ b/Src/FluentAssertions/Collections/MaximumMatching/MaximumMatchingSolver.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/Src/FluentAssertions/Collections/MaximumMatching/Predicate.cs b/Src/FluentAssertions/Collections/MaximumMatching/Predicate.cs index df5f2bd565..5b478b680a 100644 --- a/Src/FluentAssertions/Collections/MaximumMatching/Predicate.cs +++ b/Src/FluentAssertions/Collections/MaximumMatching/Predicate.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq.Expressions; using FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs index 20fcd05306..f160fa54b1 100644 --- a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; @@ -135,7 +135,8 @@ public AndConstraint BeEquivalentTo(IEnumerable expectation options = config(AssertionConfiguration.Current.Equivalency.CloneDefaults()).AsCollection(); var context = - new EquivalencyValidationContext(Node.From>(() => CurrentAssertionChain.CallerIdentifier), options) + new EquivalencyValidationContext(Node.From>(() => CurrentAssertionChain.CallerIdentifier), + options) { Reason = new Reason(because, becauseArgs), TraceWriter = options.TraceWriter diff --git a/Src/FluentAssertions/Collections/WhoseValueConstraint.cs b/Src/FluentAssertions/Collections/WhoseValueConstraint.cs index 50516dd040..4c15197ffd 100644 --- a/Src/FluentAssertions/Collections/WhoseValueConstraint.cs +++ b/Src/FluentAssertions/Collections/WhoseValueConstraint.cs @@ -2,6 +2,7 @@ namespace FluentAssertions.Collections; +[System.Diagnostics.StackTraceHidden] public class WhoseValueConstraint : AndConstraint where TCollection : IEnumerable> where TAssertions : GenericDictionaryAssertions diff --git a/Src/FluentAssertions/Common/CSharpAccessModifierExtensions.cs b/Src/FluentAssertions/Common/CSharpAccessModifierExtensions.cs index bdbd5008c8..60ff569047 100644 --- a/Src/FluentAssertions/Common/CSharpAccessModifierExtensions.cs +++ b/Src/FluentAssertions/Common/CSharpAccessModifierExtensions.cs @@ -1,8 +1,9 @@ -using System; +using System; using System.Reflection; namespace FluentAssertions.Common; +[System.Diagnostics.StackTraceHidden] internal static class CSharpAccessModifierExtensions { internal static CSharpAccessModifier GetCSharpAccessModifier(this MethodBase methodBase) @@ -105,3 +106,4 @@ internal static CSharpAccessModifier GetCSharpAccessModifier(this Type type) return CSharpAccessModifier.InvalidForCSharp; } } + diff --git a/Src/FluentAssertions/Common/Clock.cs b/Src/FluentAssertions/Common/Clock.cs index b7bd423253..9cf2e24cf0 100644 --- a/Src/FluentAssertions/Common/Clock.cs +++ b/Src/FluentAssertions/Common/Clock.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading; using System.Threading.Tasks; @@ -7,6 +7,7 @@ namespace FluentAssertions.Common; /// /// Default implementation for for production use. /// +[System.Diagnostics.StackTraceHidden] internal class Clock : IClock { public void Delay(TimeSpan timeToDelay) => Task.Delay(timeToDelay).GetAwaiter().GetResult(); diff --git a/Src/FluentAssertions/Common/DateTimeExtensions.cs b/Src/FluentAssertions/Common/DateTimeExtensions.cs index 74e00b3611..e48e1e5fe5 100644 --- a/Src/FluentAssertions/Common/DateTimeExtensions.cs +++ b/Src/FluentAssertions/Common/DateTimeExtensions.cs @@ -18,3 +18,4 @@ public static DateTimeOffset ToDateTimeOffset(this DateTime dateTime, TimeSpan o return new DateTimeOffset(DateTime.SpecifyKind(dateTime, DateTimeKind.Unspecified), offset); } } + diff --git a/Src/FluentAssertions/Common/EnumerableExtensions.cs b/Src/FluentAssertions/Common/EnumerableExtensions.cs index 8c9c1063f7..25516424ef 100644 --- a/Src/FluentAssertions/Common/EnumerableExtensions.cs +++ b/Src/FluentAssertions/Common/EnumerableExtensions.cs @@ -4,6 +4,7 @@ namespace FluentAssertions.Common; +[System.Diagnostics.StackTraceHidden] internal static class EnumerableExtensions { public static ICollection ConvertOrCastToCollection(this IEnumerable source) diff --git a/Src/FluentAssertions/Common/ExceptionExtensions.cs b/Src/FluentAssertions/Common/ExceptionExtensions.cs index 1e3bbd3fe5..8479a559ea 100644 --- a/Src/FluentAssertions/Common/ExceptionExtensions.cs +++ b/Src/FluentAssertions/Common/ExceptionExtensions.cs @@ -1,9 +1,10 @@ -using System; +using System; using System.Reflection; using System.Runtime.ExceptionServices; namespace FluentAssertions.Common; +[System.Diagnostics.StackTraceHidden] internal static class ExceptionExtensions { public static ExceptionDispatchInfo Unwrap(this TargetInvocationException exception) @@ -18,3 +19,4 @@ public static ExceptionDispatchInfo Unwrap(this TargetInvocationException except return ExceptionDispatchInfo.Capture(result); } } + diff --git a/Src/FluentAssertions/Common/ExpressionExtensions.cs b/Src/FluentAssertions/Common/ExpressionExtensions.cs index bca2089a11..1bf02dc0fe 100644 --- a/Src/FluentAssertions/Common/ExpressionExtensions.cs +++ b/Src/FluentAssertions/Common/ExpressionExtensions.cs @@ -7,6 +7,7 @@ namespace FluentAssertions.Common; +[System.Diagnostics.StackTraceHidden] internal static class ExpressionExtensions { /// @@ -56,79 +57,79 @@ public static IEnumerable GetMemberPaths( #pragma warning restore IDE0010 { case ExpressionType.Lambda: - { - node = ((LambdaExpression)node).Body; - break; - } + { + node = ((LambdaExpression)node).Body; + break; + } case ExpressionType.Convert: case ExpressionType.ConvertChecked: - { - var unaryExpression = (UnaryExpression)node; - node = unaryExpression.Operand; - break; - } + { + var unaryExpression = (UnaryExpression)node; + node = unaryExpression.Operand; + break; + } case ExpressionType.MemberAccess: - { - var memberExpression = (MemberExpression)node; - node = memberExpression.Expression; + { + var memberExpression = (MemberExpression)node; + node = memberExpression.Expression; - break; - } + break; + } case ExpressionType.ArrayIndex: - { - var binaryExpression = (BinaryExpression)node; - node = binaryExpression.Left; + { + var binaryExpression = (BinaryExpression)node; + node = binaryExpression.Left; - break; - } + break; + } case ExpressionType.Parameter: - { - node = null; - break; - } + { + node = null; + break; + } case ExpressionType.Call: - { - var methodCallExpression = (MethodCallExpression)node; - - if (methodCallExpression is not { Method.Name: "get_Item", Arguments: [ConstantExpression] }) { - throw new ArgumentException(GetUnsupportedExpressionMessage(expression.Body), nameof(expression)); - } + var methodCallExpression = (MethodCallExpression)node; + + if (methodCallExpression is not { Method.Name: "get_Item", Arguments: [ConstantExpression] }) + { + throw new ArgumentException(GetUnsupportedExpressionMessage(expression.Body), nameof(expression)); + } - node = methodCallExpression.Object; - break; - } + node = methodCallExpression.Object; + break; + } default: - { - throw new ArgumentException(GetUnsupportedExpressionMessage(expression.Body), nameof(expression)); - } + { + throw new ArgumentException(GetUnsupportedExpressionMessage(expression.Body), nameof(expression)); + } } } } @@ -242,3 +243,4 @@ public static void ValidateMemberPath( private static string GetUnsupportedExpressionMessage(Expression expression) => $"Expression <{expression}> cannot be used to select a member."; } + diff --git a/Src/FluentAssertions/Common/Guard.cs b/Src/FluentAssertions/Common/Guard.cs index 2ca3fa22f9..b8ff3fd48d 100644 --- a/Src/FluentAssertions/Common/Guard.cs +++ b/Src/FluentAssertions/Common/Guard.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; @@ -6,6 +6,7 @@ namespace FluentAssertions.Common; +[System.Diagnostics.StackTraceHidden] internal static class Guard { public static void ThrowIfArgumentIsNull([ValidatedNotNull][NoEnumeration] T obj, diff --git a/Src/FluentAssertions/Common/IClock.cs b/Src/FluentAssertions/Common/IClock.cs index ad953a8ad3..4e72fa8679 100644 --- a/Src/FluentAssertions/Common/IClock.cs +++ b/Src/FluentAssertions/Common/IClock.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading; using System.Threading.Tasks; diff --git a/Src/FluentAssertions/Common/ITimer.cs b/Src/FluentAssertions/Common/ITimer.cs index c1bd9f293f..f210425614 100644 --- a/Src/FluentAssertions/Common/ITimer.cs +++ b/Src/FluentAssertions/Common/ITimer.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace FluentAssertions.Common; diff --git a/Src/FluentAssertions/Common/IntegerExtensions.cs b/Src/FluentAssertions/Common/IntegerExtensions.cs index 3e742bfeba..903a9dd867 100644 --- a/Src/FluentAssertions/Common/IntegerExtensions.cs +++ b/Src/FluentAssertions/Common/IntegerExtensions.cs @@ -1,8 +1,9 @@ -namespace FluentAssertions.Common; +namespace FluentAssertions.Common; +[System.Diagnostics.StackTraceHidden] internal static class IntegerExtensions { public static string Times(this int count) => count == 1 ? "1 time" : $"{count} times"; - internal static bool IsConsecutiveTo(this int startNumber, int endNumber) => endNumber == (startNumber + 1); + internal static bool IsConsecutiveTo(this int startNumber, int endNumber) => endNumber == startNumber + 1; } diff --git a/Src/FluentAssertions/Common/Iterator.cs b/Src/FluentAssertions/Common/Iterator.cs index 697994dbb6..63626e001f 100644 --- a/Src/FluentAssertions/Common/Iterator.cs +++ b/Src/FluentAssertions/Common/Iterator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; @@ -8,6 +8,7 @@ namespace FluentAssertions.Common; /// A smarter enumerator that can provide information about the relative location (current, first, last) /// of the current item within the collection without unnecessarily iterating the collection. /// +[System.Diagnostics.StackTraceHidden] internal sealed class Iterator : IEnumerator { private const int InitialIndex = -1; @@ -137,3 +138,4 @@ public void Dispose() enumerator.Dispose(); } } + diff --git a/Src/FluentAssertions/Common/KeyValuePairCollectionExtensions.cs b/Src/FluentAssertions/Common/KeyValuePairCollectionExtensions.cs index 1b2cbc65ce..fc807be666 100644 --- a/Src/FluentAssertions/Common/KeyValuePairCollectionExtensions.cs +++ b/Src/FluentAssertions/Common/KeyValuePairCollectionExtensions.cs @@ -1,9 +1,10 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; namespace FluentAssertions.Common; +[System.Diagnostics.StackTraceHidden] internal static class KeyValuePairCollectionExtensions { public static IEnumerable GetKeys(this TCollection collection) @@ -81,3 +82,4 @@ public static TValue GetValue(this TCollection collec }; } } + diff --git a/Src/FluentAssertions/Common/MemberPath.cs b/Src/FluentAssertions/Common/MemberPath.cs index 58334bcbca..bbe8fb29df 100644 --- a/Src/FluentAssertions/Common/MemberPath.cs +++ b/Src/FluentAssertions/Common/MemberPath.cs @@ -9,6 +9,7 @@ namespace FluentAssertions.Common; /// Encapsulates a dotted candidate to a (nested) member of a type as well as the /// declaring type of the deepest member. /// +[System.Diagnostics.StackTraceHidden] internal class MemberPath { private readonly string dottedPath; @@ -136,3 +137,4 @@ public override string ToString() return dottedPath; } } + diff --git a/Src/FluentAssertions/Common/MemberPathSegmentEqualityComparer.cs b/Src/FluentAssertions/Common/MemberPathSegmentEqualityComparer.cs index 07dbccad00..d8fe45c39c 100644 --- a/Src/FluentAssertions/Common/MemberPathSegmentEqualityComparer.cs +++ b/Src/FluentAssertions/Common/MemberPathSegmentEqualityComparer.cs @@ -1,4 +1,4 @@ -#if NET6_0_OR_GREATER || NETSTANDARD2_1 +#if NET6_0_OR_GREATER || NETSTANDARD2_1 using System; #endif using System.Collections.Generic; @@ -11,6 +11,7 @@ namespace FluentAssertions.Common; /// Sets the equal with any numeric index qualifier. /// All other comparisons are default string equality. /// +[System.Diagnostics.StackTraceHidden] internal class MemberPathSegmentEqualityComparer : IEqualityComparer { private const string AnyIndexQualifier = "*"; @@ -49,3 +50,4 @@ public int GetHashCode(string obj) #endif } } + diff --git a/Src/FluentAssertions/Common/MethodInfoExtensions.cs b/Src/FluentAssertions/Common/MethodInfoExtensions.cs index 98637454ed..2d1348be8a 100644 --- a/Src/FluentAssertions/Common/MethodInfoExtensions.cs +++ b/Src/FluentAssertions/Common/MethodInfoExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; @@ -7,6 +7,7 @@ namespace FluentAssertions.Common; +[System.Diagnostics.StackTraceHidden] internal static class MethodInfoExtensions { /// @@ -66,3 +67,4 @@ private static (bool Success, MethodImplAttribute Attribute) RecreateMethodImplA return (false, null); } } + diff --git a/Src/FluentAssertions/Common/ObjectExtensions.cs b/Src/FluentAssertions/Common/ObjectExtensions.cs index e1bf0f0032..8db90f98d4 100644 --- a/Src/FluentAssertions/Common/ObjectExtensions.cs +++ b/Src/FluentAssertions/Common/ObjectExtensions.cs @@ -5,6 +5,7 @@ namespace FluentAssertions.Common; +[System.Diagnostics.StackTraceHidden] internal static class ObjectExtensions { public static Func GetComparer() @@ -87,3 +88,4 @@ public static string ToFormattedString(this object source) return Formatter.ToString(source); } } + diff --git a/Src/FluentAssertions/Common/PropertyInfoExtensions.cs b/Src/FluentAssertions/Common/PropertyInfoExtensions.cs index ec2f738dd2..587cea6828 100644 --- a/Src/FluentAssertions/Common/PropertyInfoExtensions.cs +++ b/Src/FluentAssertions/Common/PropertyInfoExtensions.cs @@ -1,7 +1,8 @@ -using System.Reflection; +using System.Reflection; namespace FluentAssertions.Common; +[System.Diagnostics.StackTraceHidden] internal static class PropertyInfoExtensions { internal static bool IsVirtual(this PropertyInfo property) @@ -22,3 +23,4 @@ internal static bool IsAbstract(this PropertyInfo property) return methodInfo.IsAbstract; } } + diff --git a/Src/FluentAssertions/Common/StartTimer.cs b/Src/FluentAssertions/Common/StartTimer.cs index 63870db3bd..422bcb6ee7 100644 --- a/Src/FluentAssertions/Common/StartTimer.cs +++ b/Src/FluentAssertions/Common/StartTimer.cs @@ -1,4 +1,4 @@ -namespace FluentAssertions.Common; +namespace FluentAssertions.Common; /// /// Factory for starting a timer on demand. diff --git a/Src/FluentAssertions/Common/StopwatchTimer.cs b/Src/FluentAssertions/Common/StopwatchTimer.cs index 889a316e5f..dbda4bcac5 100644 --- a/Src/FluentAssertions/Common/StopwatchTimer.cs +++ b/Src/FluentAssertions/Common/StopwatchTimer.cs @@ -1,8 +1,9 @@ -using System; +using System; using System.Diagnostics; namespace FluentAssertions.Common; +[StackTraceHidden] internal sealed class StopwatchTimer : ITimer { private readonly Stopwatch stopwatch = Stopwatch.StartNew(); @@ -19,3 +20,4 @@ public void Dispose() } } } + diff --git a/Src/FluentAssertions/Common/StringExtensions.cs b/Src/FluentAssertions/Common/StringExtensions.cs index d24ab5eab2..c8ae35d02d 100644 --- a/Src/FluentAssertions/Common/StringExtensions.cs +++ b/Src/FluentAssertions/Common/StringExtensions.cs @@ -7,6 +7,7 @@ namespace FluentAssertions.Common; +[System.Diagnostics.StackTraceHidden] internal static class StringExtensions { /// @@ -179,3 +180,4 @@ public static string RenderAsIndentedBlock(this string message) return " \"" + string.Join(Environment.NewLine + " ", wrappedLines) + "\""; } } + diff --git a/Src/FluentAssertions/Common/TimeOnlyExtensions.cs b/Src/FluentAssertions/Common/TimeOnlyExtensions.cs index e327319193..cee301084c 100644 --- a/Src/FluentAssertions/Common/TimeOnlyExtensions.cs +++ b/Src/FluentAssertions/Common/TimeOnlyExtensions.cs @@ -3,6 +3,7 @@ namespace FluentAssertions.Common; +[System.Diagnostics.StackTraceHidden] internal static class TimeOnlyExtensions { /// @@ -27,3 +28,4 @@ public static bool IsCloseTo(this TimeOnly subject, TimeOnly other, TimeSpan pre } #endif + diff --git a/Src/FluentAssertions/Common/TypeExtensions.cs b/Src/FluentAssertions/Common/TypeExtensions.cs index 4cd89baa9c..1a2c86354e 100644 --- a/Src/FluentAssertions/Common/TypeExtensions.cs +++ b/Src/FluentAssertions/Common/TypeExtensions.cs @@ -11,6 +11,7 @@ namespace FluentAssertions.Common; +[System.Diagnostics.StackTraceHidden] internal static class TypeExtensions { private const BindingFlags PublicInstanceMembersFlag = @@ -482,3 +483,4 @@ public static Type NullableOrActualType(this Type type) return type; } } + diff --git a/Src/FluentAssertions/Common/TypeReflector.cs b/Src/FluentAssertions/Common/TypeReflector.cs index d630c2f0a3..33b5fd9879 100644 --- a/Src/FluentAssertions/Common/TypeReflector.cs +++ b/Src/FluentAssertions/Common/TypeReflector.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -6,6 +6,7 @@ namespace FluentAssertions.Common; +[System.Diagnostics.StackTraceHidden] internal static class TypeReflector { public static IEnumerable GetAllTypesFromAppDomain(Func predicate) @@ -56,3 +57,4 @@ private static IEnumerable GetExportedTypes(Assembly assembly) } } } + diff --git a/Src/FluentAssertions/Common/ValueFormatterDetectionMode.cs b/Src/FluentAssertions/Common/ValueFormatterDetectionMode.cs index cc938cc6a2..ec1924e582 100644 --- a/Src/FluentAssertions/Common/ValueFormatterDetectionMode.cs +++ b/Src/FluentAssertions/Common/ValueFormatterDetectionMode.cs @@ -1,4 +1,4 @@ -using FluentAssertions.Configuration; +using FluentAssertions.Configuration; namespace FluentAssertions.Common; diff --git a/Src/FluentAssertions/Configuration/GlobalConfiguration.cs b/Src/FluentAssertions/Configuration/GlobalConfiguration.cs index 5235e8c02d..5dba8e4ecd 100644 --- a/Src/FluentAssertions/Configuration/GlobalConfiguration.cs +++ b/Src/FluentAssertions/Configuration/GlobalConfiguration.cs @@ -1,5 +1,6 @@ namespace FluentAssertions.Configuration; +[System.Diagnostics.StackTraceHidden] public class GlobalConfiguration { /// diff --git a/Src/FluentAssertions/Configuration/GlobalEquivalencyOptions.cs b/Src/FluentAssertions/Configuration/GlobalEquivalencyOptions.cs index 059efa534a..7b5081ea33 100644 --- a/Src/FluentAssertions/Configuration/GlobalEquivalencyOptions.cs +++ b/Src/FluentAssertions/Configuration/GlobalEquivalencyOptions.cs @@ -1,10 +1,12 @@ using System; + using FluentAssertions.Common; using FluentAssertions.Equivalency; using JetBrains.Annotations; namespace FluentAssertions.Configuration; +[System.Diagnostics.StackTraceHidden] public class GlobalEquivalencyOptions { private EquivalencyOptions defaults = new(); @@ -49,3 +51,4 @@ public EquivalencyOptions CloneDefaults() return new EquivalencyOptions(defaults); } } + diff --git a/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs b/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs index 937ccb4f3e..f15e6ea1ef 100644 --- a/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs +++ b/Src/FluentAssertions/Configuration/GlobalFormattingOptions.cs @@ -4,6 +4,7 @@ namespace FluentAssertions.Configuration; +[System.Diagnostics.StackTraceHidden] public class GlobalFormattingOptions : FormattingOptions { public string ValueFormatterAssembly @@ -32,3 +33,4 @@ public string ValueFormatterAssembly }; } } + diff --git a/Src/FluentAssertions/CustomAssertionAttribute.cs b/Src/FluentAssertions/CustomAssertionAttribute.cs index 87dfa929b1..198b7a96c4 100644 --- a/Src/FluentAssertions/CustomAssertionAttribute.cs +++ b/Src/FluentAssertions/CustomAssertionAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace FluentAssertions; @@ -8,4 +8,6 @@ namespace FluentAssertions; /// [AttributeUsage(AttributeTargets.Method)] #pragma warning disable CA1813 // Avoid unsealed attributes. This type has shipped. +[System.Diagnostics.StackTraceHidden] public class CustomAssertionAttribute : Attribute; + diff --git a/Src/FluentAssertions/CustomAssertionsAssemblyAttribute.cs b/Src/FluentAssertions/CustomAssertionsAssemblyAttribute.cs index 9e0cc90410..6b332c1d81 100644 --- a/Src/FluentAssertions/CustomAssertionsAssemblyAttribute.cs +++ b/Src/FluentAssertions/CustomAssertionsAssemblyAttribute.cs @@ -7,4 +7,6 @@ namespace FluentAssertions; /// internally, or directly uses AssertionChain. /// [AttributeUsage(AttributeTargets.Assembly)] +[System.Diagnostics.StackTraceHidden] public sealed class CustomAssertionsAssemblyAttribute : Attribute; + diff --git a/Src/FluentAssertions/Disposable.cs b/Src/FluentAssertions/Disposable.cs index ac98c8167a..3cd8ec4337 100644 --- a/Src/FluentAssertions/Disposable.cs +++ b/Src/FluentAssertions/Disposable.cs @@ -1,7 +1,8 @@ -using System; +using System; namespace FluentAssertions; +[System.Diagnostics.StackTraceHidden] internal sealed class Disposable : IDisposable { private readonly Action action; @@ -16,3 +17,4 @@ public void Dispose() action(); } } + diff --git a/Src/FluentAssertions/Equivalency/AssertionChainExtensions.cs b/Src/FluentAssertions/Equivalency/AssertionChainExtensions.cs index d7cfd1e1e5..aff493b87b 100644 --- a/Src/FluentAssertions/Equivalency/AssertionChainExtensions.cs +++ b/Src/FluentAssertions/Equivalency/AssertionChainExtensions.cs @@ -2,6 +2,7 @@ namespace FluentAssertions.Equivalency; +[System.Diagnostics.StackTraceHidden] internal static class AssertionChainExtensions { /// @@ -17,3 +18,4 @@ public static AssertionChain For(this AssertionChain chain, IEquivalencyValidati .BecauseOf(context.Reason); } } + diff --git a/Src/FluentAssertions/Equivalency/Comparands.cs b/Src/FluentAssertions/Equivalency/Comparands.cs index 200d282322..2f483e8476 100644 --- a/Src/FluentAssertions/Equivalency/Comparands.cs +++ b/Src/FluentAssertions/Equivalency/Comparands.cs @@ -1,9 +1,11 @@ -using System; +using System; + using System.Globalization; using FluentAssertions.Common; namespace FluentAssertions.Equivalency; +[System.Diagnostics.StackTraceHidden] public class Comparands { public Comparands() @@ -75,3 +77,4 @@ public override string ToString() return string.Create(CultureInfo.InvariantCulture, $"{{Subject={Subject}, Expectation={Expectation}}}"); } } + diff --git a/Src/FluentAssertions/Equivalency/ConversionSelector.cs b/Src/FluentAssertions/Equivalency/ConversionSelector.cs index c2985fcae1..bf791f99c8 100644 --- a/Src/FluentAssertions/Equivalency/ConversionSelector.cs +++ b/Src/FluentAssertions/Equivalency/ConversionSelector.cs @@ -11,6 +11,7 @@ namespace FluentAssertions.Equivalency; /// /// Collects the members that need to be converted by the . /// +[System.Diagnostics.StackTraceHidden] public class ConversionSelector { private sealed class ConversionSelectorRule @@ -112,3 +113,4 @@ public ConversionSelector Clone() return new ConversionSelector(new List(inclusions), new List(exclusions)); } } + diff --git a/Src/FluentAssertions/Equivalency/Digit.cs b/Src/FluentAssertions/Equivalency/Digit.cs index 123b552896..56a41b9d8e 100644 --- a/Src/FluentAssertions/Equivalency/Digit.cs +++ b/Src/FluentAssertions/Equivalency/Digit.cs @@ -2,6 +2,7 @@ namespace FluentAssertions.Equivalency; +[System.Diagnostics.StackTraceHidden] internal class Digit { private readonly int length; @@ -49,3 +50,4 @@ public bool Increment() return success; } } + diff --git a/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs b/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs index d4b3925a26..57bcadc959 100644 --- a/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs +++ b/Src/FluentAssertions/Equivalency/EqualityStrategyProvider.cs @@ -8,6 +8,7 @@ namespace FluentAssertions.Equivalency; +[System.Diagnostics.StackTraceHidden] internal sealed class EqualityStrategyProvider { private readonly List referenceTypes = []; @@ -127,3 +128,4 @@ public override string ToString() return builder.ToString(); } } + diff --git a/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs index 039a2195c1..dbe425b1e1 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs @@ -12,6 +12,7 @@ namespace FluentAssertions.Equivalency; /// /// Represents the run-time type-specific behavior of a structural equivalency assertion. /// +[System.Diagnostics.StackTraceHidden] public class EquivalencyOptions : SelfReferenceEquivalencyOptions> { @@ -208,3 +209,4 @@ public EquivalencyOptions() PreferringDeclaredMemberTypes(); } } + diff --git a/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs b/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs index f81b3d48c2..edf514bed3 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyPlan.cs @@ -1,5 +1,3 @@ -#region - using System; using System.Collections; using System.Collections.Generic; @@ -7,14 +5,13 @@ using FluentAssertions.Equivalency.Inlining; using FluentAssertions.Equivalency.Steps; -#endregion - namespace FluentAssertions.Equivalency; /// /// Represents a mutable collection of equivalency steps that can be reordered and/or amended with additional /// custom equivalency steps. /// +[System.Diagnostics.StackTraceHidden] public class EquivalencyPlan : IEnumerable { private List steps = GetDefaultSteps(); @@ -166,3 +163,4 @@ private static List GetDefaultSteps() ]; } } + diff --git a/Src/FluentAssertions/Equivalency/EquivalencyStep.cs b/Src/FluentAssertions/Equivalency/EquivalencyStep.cs index 58f689f771..497e7677f3 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyStep.cs @@ -1,8 +1,9 @@ -namespace FluentAssertions.Equivalency; +namespace FluentAssertions.Equivalency; /// /// Convenient implementation of that will only invoke /// +[System.Diagnostics.StackTraceHidden] public abstract class EquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs index 87478a98fa..f35899b186 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs @@ -1,6 +1,7 @@ #if !NET6_0_OR_GREATER using System; #endif + using System.Globalization; using FluentAssertions.Equivalency.Execution; using FluentAssertions.Equivalency.Tracing; @@ -11,6 +12,7 @@ namespace FluentAssertions.Equivalency; /// /// Provides information on a particular property during an assertion for structural equality of two object graphs. /// +[System.Diagnostics.StackTraceHidden] public class EquivalencyValidationContext : IEquivalencyValidationContext { private Tracer tracer; @@ -104,3 +106,4 @@ public override string ToString() return string.Create(CultureInfo.InvariantCulture, $"{{Path=\"{CurrentNode.Subject.PathAndName}\"}}"); } } + diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs index 6a796efdec..25f40f194b 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidator.cs @@ -7,6 +7,7 @@ namespace FluentAssertions.Equivalency; /// /// Is responsible for validating the equivalency of a subject with another object. /// +[System.Diagnostics.StackTraceHidden] internal class EquivalencyValidator : IValidateChildNodeEquivalency { private const int MaxDepth = 10; diff --git a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs index 445537aa1e..05b87b5b92 100644 --- a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs +++ b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs @@ -11,6 +11,7 @@ namespace FluentAssertions.Equivalency.Execution; /// /// Ensures that all the rules remove the collection index from the path before processing it further. /// +[System.Diagnostics.StackTraceHidden] internal class CollectionMemberOptionsDecorator : IEquivalencyOptions, IContainTypingRules { private readonly IEquivalencyOptions inner; @@ -93,3 +94,4 @@ public EqualityStrategy GetEqualityStrategy(Type type) public ITraceWriter TraceWriter => inner.TraceWriter; } + diff --git a/Src/FluentAssertions/Equivalency/Execution/CyclicReferenceDetector.cs b/Src/FluentAssertions/Equivalency/Execution/CyclicReferenceDetector.cs index 4ca13ce49d..d8d21327bb 100644 --- a/Src/FluentAssertions/Equivalency/Execution/CyclicReferenceDetector.cs +++ b/Src/FluentAssertions/Equivalency/Execution/CyclicReferenceDetector.cs @@ -7,6 +7,7 @@ namespace FluentAssertions.Equivalency.Execution; /// Keeps track of objects and their location within an object graph so that cyclic references can be detected /// and handled upon. /// +[System.Diagnostics.StackTraceHidden] internal class CyclicReferenceDetector : ICloneable2 { #region Private Definitions @@ -45,3 +46,4 @@ public object Clone() }; } } + diff --git a/Src/FluentAssertions/Equivalency/Execution/ObjectInfo.cs b/Src/FluentAssertions/Equivalency/Execution/ObjectInfo.cs index 345e572a05..0733af802c 100644 --- a/Src/FluentAssertions/Equivalency/Execution/ObjectInfo.cs +++ b/Src/FluentAssertions/Equivalency/Execution/ObjectInfo.cs @@ -2,6 +2,7 @@ namespace FluentAssertions.Equivalency.Execution; +[System.Diagnostics.StackTraceHidden] internal class ObjectInfo : IObjectInfo { public ObjectInfo(Comparands comparands, INode currentNode) @@ -23,3 +24,4 @@ public ObjectInfo(Comparands comparands, INode currentNode) public Type RuntimeType { get; } } + diff --git a/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs b/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs index f3910fe6d7..58a782bd1a 100644 --- a/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs +++ b/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs @@ -9,6 +9,7 @@ namespace FluentAssertions.Equivalency.Execution; /// /// Represents an object tracked by the including it's location within an object graph. /// +[System.Diagnostics.StackTraceHidden] internal class ObjectReference { private readonly object @object; @@ -90,3 +91,4 @@ public override string ToString() /// public bool CompareByMembers { get; } } + diff --git a/Src/FluentAssertions/Equivalency/Field.cs b/Src/FluentAssertions/Equivalency/Field.cs index 1aa33d79e4..4fd1af6c72 100644 --- a/Src/FluentAssertions/Equivalency/Field.cs +++ b/Src/FluentAssertions/Equivalency/Field.cs @@ -8,6 +8,7 @@ namespace FluentAssertions.Equivalency; /// /// A specialized type of that represents a field of an object in a structural equivalency assertion. /// +[System.Diagnostics.StackTraceHidden] internal class Field : Node, IMember { private readonly FieldInfo fieldInfo; @@ -42,3 +43,4 @@ public object GetValue(object obj) public bool IsBrowsable => isBrowsable ??= fieldInfo.GetCustomAttribute() is not { State: EditorBrowsableState.Never }; } + diff --git a/Src/FluentAssertions/Equivalency/Inlining/ActionBasedInlineAssertion.cs b/Src/FluentAssertions/Equivalency/Inlining/ActionBasedInlineAssertion.cs index d314e64b53..2eff6916d0 100644 --- a/Src/FluentAssertions/Equivalency/Inlining/ActionBasedInlineAssertion.cs +++ b/Src/FluentAssertions/Equivalency/Inlining/ActionBasedInlineAssertion.cs @@ -9,6 +9,7 @@ namespace FluentAssertions.Equivalency.Inlining; /// of the assertion APIs provided by Fluent Assertions. /// /// The expected type of the subject to which the assertion is applied. +[System.Diagnostics.StackTraceHidden] internal class ActionBasedInlineAssertion(Action assertion) : IInlineEquivalencyAssertion { /// @@ -24,3 +25,4 @@ public void Execute(AssertionChain assertionChain, Comparands comparands) } } } + diff --git a/Src/FluentAssertions/Equivalency/Inlining/ConditionBasedInlineAssertion.cs b/Src/FluentAssertions/Equivalency/Inlining/ConditionBasedInlineAssertion.cs index eef612dbbd..1f48475dc4 100644 --- a/Src/FluentAssertions/Equivalency/Inlining/ConditionBasedInlineAssertion.cs +++ b/Src/FluentAssertions/Equivalency/Inlining/ConditionBasedInlineAssertion.cs @@ -8,6 +8,7 @@ namespace FluentAssertions.Equivalency.Inlining; /// Represents a condition-based inline equivalency assertion that evaluates a specified condition against a subject during object equivalency checks. /// /// The expected type of the subject being asserted. +[System.Diagnostics.StackTraceHidden] internal class ConditionBasedInlineAssertion(Expression> condition) : IInlineEquivalencyAssertion { /// @@ -22,3 +23,4 @@ public void Execute(AssertionChain assertionChain, Comparands comparands) .FailWith("Expected {context:subject} to meet condition {0}, but it did not.", condition); } } + diff --git a/Src/FluentAssertions/Equivalency/Inlining/InlineEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Inlining/InlineEquivalencyStep.cs index b4c5b62f97..f9d5fe9ee7 100644 --- a/Src/FluentAssertions/Equivalency/Inlining/InlineEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Inlining/InlineEquivalencyStep.cs @@ -13,6 +13,7 @@ namespace FluentAssertions.Equivalency.Inlining; /// This step allows users to define custom equivalency behaviors inline during assertion /// execution. /// +[System.Diagnostics.StackTraceHidden] public class InlineEquivalencyStep : IEquivalencyStep { /// @@ -31,3 +32,4 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon return EquivalencyResult.ContinueWithNext; } } + diff --git a/Src/FluentAssertions/Equivalency/JsonProperty.cs b/Src/FluentAssertions/Equivalency/JsonProperty.cs index c50668f4b0..58b679667d 100644 --- a/Src/FluentAssertions/Equivalency/JsonProperty.cs +++ b/Src/FluentAssertions/Equivalency/JsonProperty.cs @@ -12,6 +12,7 @@ namespace FluentAssertions.Equivalency; /// information about a specific JSON property, its parent object, and its counterpart in an expectation object /// when performing comparisons. /// +[System.Diagnostics.StackTraceHidden] internal class JsonProperty(JsonNode property, JsonObject parent, INode expectationParent) : IMember { // SMELL: A lot of properties are required by the IMember interface, but they are not used. In the future @@ -145,3 +146,4 @@ public static JsonProperty Find(IMember expectedMember, INode parent, object sub } #endif + diff --git a/Src/FluentAssertions/Equivalency/MemberFactory.cs b/Src/FluentAssertions/Equivalency/MemberFactory.cs index 6fed0af560..b34c371c83 100644 --- a/Src/FluentAssertions/Equivalency/MemberFactory.cs +++ b/Src/FluentAssertions/Equivalency/MemberFactory.cs @@ -1,9 +1,11 @@ using System; + using System.Reflection; using FluentAssertions.Common; namespace FluentAssertions.Equivalency; +[System.Diagnostics.StackTraceHidden] public static class MemberFactory { public static IMember Create(MemberInfo memberInfo, INode parent) @@ -29,3 +31,4 @@ internal static IMember Find(object target, string memberName, INode parent) return field is not null ? new Field(field, parent) : null; } } + diff --git a/Src/FluentAssertions/Equivalency/MemberSelectionContext.cs b/Src/FluentAssertions/Equivalency/MemberSelectionContext.cs index 2e5417bf16..f234134479 100644 --- a/Src/FluentAssertions/Equivalency/MemberSelectionContext.cs +++ b/Src/FluentAssertions/Equivalency/MemberSelectionContext.cs @@ -6,6 +6,7 @@ namespace FluentAssertions.Equivalency; /// /// Provides contextual information to an . /// +[System.Diagnostics.StackTraceHidden] public class MemberSelectionContext { private readonly Type compileTimeType; @@ -42,3 +43,4 @@ public Type Type } } } + diff --git a/Src/FluentAssertions/Equivalency/MemberVisibility.cs b/Src/FluentAssertions/Equivalency/MemberVisibility.cs index a0eddebf20..f41b857b57 100644 --- a/Src/FluentAssertions/Equivalency/MemberVisibility.cs +++ b/Src/FluentAssertions/Equivalency/MemberVisibility.cs @@ -1,4 +1,4 @@ -using System; +using System; #pragma warning disable CA1714 namespace FluentAssertions.Equivalency; diff --git a/Src/FluentAssertions/Equivalency/MemberVisibilityExtensions.cs b/Src/FluentAssertions/Equivalency/MemberVisibilityExtensions.cs index 01abeeba12..1f14f26269 100644 --- a/Src/FluentAssertions/Equivalency/MemberVisibilityExtensions.cs +++ b/Src/FluentAssertions/Equivalency/MemberVisibilityExtensions.cs @@ -4,6 +4,7 @@ namespace FluentAssertions.Equivalency; +[System.Diagnostics.StackTraceHidden] internal static class MemberVisibilityExtensions { private static readonly ConcurrentDictionary Cache = new(); @@ -41,3 +42,4 @@ public static MemberKind ToMemberKind(this MemberVisibility visibility) }); } } + diff --git a/Src/FluentAssertions/Equivalency/MultiDimensionalArrayEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/MultiDimensionalArrayEquivalencyStep.cs index 4962f36860..70d6cb84df 100644 --- a/Src/FluentAssertions/Equivalency/MultiDimensionalArrayEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/MultiDimensionalArrayEquivalencyStep.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using FluentAssertions.Execution; @@ -8,6 +8,7 @@ namespace FluentAssertions.Equivalency; /// Supports recursively comparing two multi-dimensional arrays for equivalency using strict order for the array items /// themselves. /// +[System.Diagnostics.StackTraceHidden] internal class MultiDimensionalArrayEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, @@ -105,3 +106,4 @@ private static bool HaveSameRank(object subject, Array expectation, AssertionCha return assertionChain.Succeeded; } } + diff --git a/Src/FluentAssertions/Equivalency/NestedExclusionOptionBuilder.cs b/Src/FluentAssertions/Equivalency/NestedExclusionOptionBuilder.cs index 1708c3e7a7..1dc2a26169 100644 --- a/Src/FluentAssertions/Equivalency/NestedExclusionOptionBuilder.cs +++ b/Src/FluentAssertions/Equivalency/NestedExclusionOptionBuilder.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq.Expressions; using FluentAssertions.Common; @@ -6,6 +6,7 @@ namespace FluentAssertions.Equivalency; +[System.Diagnostics.StackTraceHidden] public class NestedExclusionOptionBuilder { /// @@ -49,3 +50,4 @@ public NestedExclusionOptionBuilder For( return new NestedExclusionOptionBuilder(capturedOptions, currentPathSelectionRule); } } + diff --git a/Src/FluentAssertions/Equivalency/Node.cs b/Src/FluentAssertions/Equivalency/Node.cs index 0bcad601a2..6de5450342 100644 --- a/Src/FluentAssertions/Equivalency/Node.cs +++ b/Src/FluentAssertions/Equivalency/Node.cs @@ -7,6 +7,7 @@ namespace FluentAssertions.Equivalency; +[System.Diagnostics.StackTraceHidden] internal class Node : INode { private static readonly Regex MatchFirstIndex = new(@"^\[[0-9]+\]$"); @@ -151,3 +152,4 @@ public override int GetHashCode() public override string ToString() => Subject.Description; } + diff --git a/Src/FluentAssertions/Equivalency/OrderingRuleCollection.cs b/Src/FluentAssertions/Equivalency/OrderingRuleCollection.cs index 645bba4ad2..6478f7a2da 100644 --- a/Src/FluentAssertions/Equivalency/OrderingRuleCollection.cs +++ b/Src/FluentAssertions/Equivalency/OrderingRuleCollection.cs @@ -7,6 +7,7 @@ namespace FluentAssertions.Equivalency; /// /// Collection of s. /// +[System.Diagnostics.StackTraceHidden] public class OrderingRuleCollection : IEnumerable { private readonly List rules = []; @@ -70,3 +71,4 @@ public bool IsOrderingStrictFor(IObjectInfo objectInfo) return results.Contains(OrderStrictness.Strict) && !results.Contains(OrderStrictness.NotStrict); } } + diff --git a/Src/FluentAssertions/Equivalency/Property.cs b/Src/FluentAssertions/Equivalency/Property.cs index 4655f8905c..31a2fc3ccf 100644 --- a/Src/FluentAssertions/Equivalency/Property.cs +++ b/Src/FluentAssertions/Equivalency/Property.cs @@ -9,6 +9,7 @@ namespace FluentAssertions.Equivalency; /// A specialized type of that represents a property of an object in a structural equivalency assertion. /// #pragma warning disable CA1716 +[System.Diagnostics.StackTraceHidden] internal class Property : Node, IMember { private readonly PropertyInfo propertyInfo; @@ -48,3 +49,4 @@ public object GetValue(object obj) public bool IsBrowsable => isBrowsable ??= propertyInfo.GetCustomAttribute() is not { State: EditorBrowsableState.Never }; } + diff --git a/Src/FluentAssertions/Equivalency/Selection/ExcludeMemberByPredicateSelectionRule.cs b/Src/FluentAssertions/Equivalency/Selection/ExcludeMemberByPredicateSelectionRule.cs index cc1fd9cd45..e497250682 100644 --- a/Src/FluentAssertions/Equivalency/Selection/ExcludeMemberByPredicateSelectionRule.cs +++ b/Src/FluentAssertions/Equivalency/Selection/ExcludeMemberByPredicateSelectionRule.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; diff --git a/Src/FluentAssertions/Equivalency/Selection/ExcludeNonBrowsableMembersRule.cs b/Src/FluentAssertions/Equivalency/Selection/ExcludeNonBrowsableMembersRule.cs index 79ffb0df6c..9828300d5b 100644 --- a/Src/FluentAssertions/Equivalency/Selection/ExcludeNonBrowsableMembersRule.cs +++ b/Src/FluentAssertions/Equivalency/Selection/ExcludeNonBrowsableMembersRule.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; namespace FluentAssertions.Equivalency.Selection; diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index 3d323e6aa5..21c61fb668 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -21,6 +21,7 @@ namespace FluentAssertions.Equivalency; /// /// Represents the run-time behavior of a structural equivalency assertion. /// +[StackTraceHidden] public abstract class SelfReferenceEquivalencyOptions : IEquivalencyOptions, IContainTypingRules where TSelf : SelfReferenceEquivalencyOptions { @@ -449,7 +450,7 @@ public TSelf Excluding() /// /// For open generic types, this excludes all closed generics and types deriving from them. For example, /// Excluding(typeof(Nullable<>)) excludes all nullable value types like int?, double?, etc. - /// Similarly, Excluding(typeof(List<>)) excludes List<int>, List<string>, + /// Similarly, Excluding(typeof(List<>)) excludes List<int>, List<string>, /// and any types deriving from those closed generics. /// /// @@ -1066,3 +1067,4 @@ private TSelf AddEquivalencyStep(IEquivalencyStep equivalencyStep) #endregion } + diff --git a/Src/FluentAssertions/Equivalency/Steps/AssertionContext.cs b/Src/FluentAssertions/Equivalency/Steps/AssertionContext.cs index f8a9c02f33..4af7e61781 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AssertionContext.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AssertionContext.cs @@ -2,6 +2,7 @@ namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] internal sealed class AssertionContext : IAssertionContext { private AssertionContext(INode currentNode, TSubject subject, TSubject expectation, @@ -34,3 +35,4 @@ internal static AssertionContext CreateFrom(Comparands comparands, IEq context.Reason.Arguments); } } + diff --git a/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs b/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs index c636079e68..abbe6587b1 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs @@ -8,6 +8,7 @@ namespace FluentAssertions.Equivalency.Steps; /// /// Represents a collection of assertion results obtained through a . /// +[System.Diagnostics.StackTraceHidden] internal class AssertionResultSet { private readonly Dictionary set = []; @@ -68,3 +69,4 @@ private KeyValuePair[] GetBestResultSets() /// public bool ContainsSuccessfulSet() => set.Values.Any(v => v.Length == 0); } + diff --git a/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs index cb6d2fcc03..31f1b83743 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AssertionRuleEquivalencyStep.cs @@ -1,4 +1,5 @@ using System; + using System.Linq.Expressions; using FluentAssertions.Common; using FluentAssertions.Equivalency.Execution; @@ -6,6 +7,7 @@ namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] public class AssertionRuleEquivalencyStep : IEquivalencyStep { private readonly Func predicate; @@ -115,3 +117,4 @@ public override string ToString() return "Invoke Action<" + typeof(TSubject).Name + "> when " + description; } } + diff --git a/Src/FluentAssertions/Equivalency/Steps/AutoConversionStep.cs b/Src/FluentAssertions/Equivalency/Steps/AutoConversionStep.cs index aab246429f..0cb2d09a4e 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AutoConversionStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AutoConversionStep.cs @@ -10,6 +10,7 @@ namespace FluentAssertions.Equivalency.Steps; /// /// Whether or not the conversion is attempted depends on the . /// +[System.Diagnostics.StackTraceHidden] public class AutoConversionStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, @@ -85,3 +86,4 @@ public override string ToString() return string.Empty; } } + diff --git a/Src/FluentAssertions/Equivalency/Steps/DateAndTimeEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/DateAndTimeEquivalencyStep.cs index 6b04dbb728..b694f9a916 100644 --- a/Src/FluentAssertions/Equivalency/Steps/DateAndTimeEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/DateAndTimeEquivalencyStep.cs @@ -10,6 +10,7 @@ namespace FluentAssertions.Equivalency.Steps; /// Specific equivalency step for handling date and time types where the types are different and the failure message /// should make that clear. /// +[System.Diagnostics.StackTraceHidden] public class DateAndTimeEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, @@ -51,3 +52,4 @@ private static bool IsOfDateOrTimeType(Type type) => } #pragma warning restore AV1000 + diff --git a/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs index edcc887fb5..9aa65aa915 100644 --- a/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs @@ -9,6 +9,7 @@ namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] public class DictionaryEquivalencyStep : EquivalencyStep { [SuppressMessage("ReSharper", "PossibleNullReferenceException")] @@ -28,9 +29,11 @@ protected override EquivalencyResult OnHandle(Comparands comparands, if (context.Options.IsRecursive) { context.Tracer.WriteLine(member => - string.Create(CultureInfo.InvariantCulture, $"Recursing into dictionary item {key} at {member.Expectation}")); + string.Create(CultureInfo.InvariantCulture, + $"Recursing into dictionary item {key} at {member.Expectation}")); - nestedValidator.AssertEquivalencyOf(new Comparands(subject[key], expectation[key], typeof(object)), context.AsDictionaryItem(key)); + nestedValidator.AssertEquivalencyOf(new Comparands(subject[key], expectation[key], typeof(object)), + context.AsDictionaryItem(key)); } else { @@ -50,8 +53,8 @@ protected override EquivalencyResult OnHandle(Comparands comparands, private static bool PreconditionsAreMet(IDictionary expectation, IDictionary subject, AssertionChain assertionChain) { return AssertIsDictionary(subject, assertionChain) - && AssertEitherIsNotNull(expectation, subject, assertionChain) - && AssertSameLength(expectation, subject, assertionChain); + && AssertEitherIsNotNull(expectation, subject, assertionChain) + && AssertSameLength(expectation, subject, assertionChain); } private static bool AssertEitherIsNotNull(IDictionary expectation, IDictionary subject, AssertionChain assertionChain) diff --git a/Src/FluentAssertions/Equivalency/Steps/DictionaryInterfaceInfo.cs b/Src/FluentAssertions/Equivalency/Steps/DictionaryInterfaceInfo.cs index e0ca76da14..8e253e604b 100644 --- a/Src/FluentAssertions/Equivalency/Steps/DictionaryInterfaceInfo.cs +++ b/Src/FluentAssertions/Equivalency/Steps/DictionaryInterfaceInfo.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; @@ -10,6 +10,7 @@ namespace FluentAssertions.Equivalency.Steps; /// /// Provides Reflection-backed meta-data information about a type implementing the interface. /// +[System.Diagnostics.StackTraceHidden] internal sealed class DictionaryInterfaceInfo { // ReSharper disable once PossibleNullReferenceException @@ -135,3 +136,4 @@ private static Dictionary ConvertToDictionaryInternal $"IDictionary<{Key}, {Value}>"; } + diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs b/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs index 0cf246e82d..18a0b80d5d 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumEqualityStep.cs @@ -8,6 +8,7 @@ namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] public class EnumEqualityStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, @@ -39,21 +40,21 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon switch (context.Options.EnumEquivalencyHandling) { case EnumEquivalencyHandling.ByValue: - { - HandleByValue(assertionChain, comparands, context.Reason); - break; - } + { + HandleByValue(assertionChain, comparands, context.Reason); + break; + } case EnumEquivalencyHandling.ByName: - { - HandleByName(assertionChain, comparands, context.Reason); - break; - } + { + HandleByName(assertionChain, comparands, context.Reason); + break; + } default: - { - throw new InvalidOperationException($"Do not know how to handle {context.Options.EnumEquivalencyHandling}"); - } + { + throw new InvalidOperationException($"Do not know how to handle {context.Options.EnumEquivalencyHandling}"); + } } } @@ -119,3 +120,4 @@ private static string GetDisplayNameForEnumComparison(object o, decimal? v) return o is not null ? Convert.ToDecimal(o, CultureInfo.InvariantCulture) : null; } } + diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs index 1b6906ba58..2a36e04cc3 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs @@ -1,10 +1,12 @@ using System; + using System.Collections; using System.Linq; using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] public class EnumerableEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, @@ -77,3 +79,4 @@ private static bool IsIgnorableArrayLikeType(object value) (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(ArraySegment<>)); } } + diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs index 05b7b47631..5777630f5a 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs @@ -13,6 +13,7 @@ namespace FluentAssertions.Equivalency.Steps; /// /// Executes a single equivalency assertion on two collections, optionally recursive and with or without strict ordering. /// +[System.Diagnostics.StackTraceHidden] internal class EnumerableEquivalencyValidator { private const int FailedItemsFastFailThreshold = 10; @@ -217,3 +218,4 @@ private bool StrictlyMatchAgainst(object[] subjects, T expectation, int expec return !failed; } } + diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidatorExtensions.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidatorExtensions.cs index f3f3d00e21..8012d736c8 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidatorExtensions.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidatorExtensions.cs @@ -4,6 +4,7 @@ namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] internal static class EnumerableEquivalencyValidatorExtensions { public static Continuation AssertEitherCollectionIsNotEmpty(this AssertionChain assertionChain, @@ -49,3 +50,4 @@ public static Continuation AssertCollectionHasNotTooManyItems(this AssertionC expectation)); } } + diff --git a/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs index 1330b54089..48febbfd49 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EqualityComparerEquivalencyStep.cs @@ -1,9 +1,11 @@ using System.Collections.Generic; + using FluentAssertions.Common; using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] public class EqualityComparerEquivalencyStep : IEquivalencyStep { private readonly IEqualityComparer comparer; @@ -49,3 +51,4 @@ public override string ToString() return $"Use {comparer} for objects of type {typeof(T)}"; } } + diff --git a/Src/FluentAssertions/Equivalency/Steps/EquivalencyValidationContextExtensions.cs b/Src/FluentAssertions/Equivalency/Steps/EquivalencyValidationContextExtensions.cs index 207044c478..e3a85593d7 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EquivalencyValidationContextExtensions.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EquivalencyValidationContextExtensions.cs @@ -1,10 +1,12 @@ -using System.Globalization; +using System.Globalization; namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] internal static class EquivalencyValidationContextExtensions { public static IEquivalencyValidationContext AsCollectionItem(this IEquivalencyValidationContext context, int index) => context.AsCollectionItem(index.ToString(CultureInfo.InvariantCulture)); } + diff --git a/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs index 1d398fdcd2..f490d467d9 100644 --- a/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/GenericDictionaryEquivalencyStep.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; @@ -8,6 +9,7 @@ namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] public class GenericDictionaryEquivalencyStep : IEquivalencyStep { #pragma warning disable SA1110 // Allow opening parenthesis on new line to reduce line length @@ -225,3 +227,4 @@ public KeyDifference(List missingKeys, List additiona public List AdditionalKeys { get; } } } + diff --git a/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs index f7e4e7297f..a736888e93 100644 --- a/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs @@ -1,5 +1,6 @@ using System; using System.Collections; + using System.Collections.Generic; using System.Linq; using System.Reflection; @@ -8,6 +9,7 @@ namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] public class GenericEnumerableEquivalencyStep : IEquivalencyStep { #pragma warning disable SA1110 // Allow opening parenthesis on new line to reduce line length @@ -125,3 +127,4 @@ private static T[] ToArray(IEnumerable value) } } } + diff --git a/Src/FluentAssertions/Equivalency/Steps/JsonConversionStep.cs b/Src/FluentAssertions/Equivalency/Steps/JsonConversionStep.cs index 8ae2289f0f..e7bd20ec19 100644 --- a/Src/FluentAssertions/Equivalency/Steps/JsonConversionStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/JsonConversionStep.cs @@ -6,6 +6,7 @@ namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] public class JsonConversionStep : IEquivalencyStep { /// @@ -63,3 +64,4 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon } #endif + diff --git a/Src/FluentAssertions/Equivalency/Steps/ReferenceEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/ReferenceEqualityEquivalencyStep.cs index c41e899078..b1770b6283 100644 --- a/Src/FluentAssertions/Equivalency/Steps/ReferenceEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/ReferenceEqualityEquivalencyStep.cs @@ -1,5 +1,6 @@ -namespace FluentAssertions.Equivalency.Steps; +namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] public class ReferenceEqualityEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, diff --git a/Src/FluentAssertions/Equivalency/Steps/RunAllUserStepsEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/RunAllUserStepsEquivalencyStep.cs index 114a0aa726..f928070aa1 100644 --- a/Src/FluentAssertions/Equivalency/Steps/RunAllUserStepsEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/RunAllUserStepsEquivalencyStep.cs @@ -1,9 +1,10 @@ -namespace FluentAssertions.Equivalency.Steps; +namespace FluentAssertions.Equivalency.Steps; /// /// Represents a composite equivalency step that passes the execution to all user-supplied steps that can handle the /// current context. /// +[System.Diagnostics.StackTraceHidden] public class RunAllUserStepsEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, diff --git a/Src/FluentAssertions/Equivalency/Steps/SimpleEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/SimpleEqualityEquivalencyStep.cs index af3598ec1d..3920ab5932 100644 --- a/Src/FluentAssertions/Equivalency/Steps/SimpleEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/SimpleEqualityEquivalencyStep.cs @@ -2,6 +2,7 @@ namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] public class SimpleEqualityEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, @@ -21,3 +22,4 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon return EquivalencyResult.ContinueWithNext; } } + diff --git a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs index 80c8b32452..0b06225076 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs @@ -3,6 +3,7 @@ namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] public class StringEqualityEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, @@ -106,3 +107,4 @@ private static bool ValidateSubjectIsString(AssertionChain assertionChain, Compa return assertionChain.Succeeded; } } + diff --git a/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs index 188b4f7d79..2481aca98d 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StructuralEqualityEquivalencyStep.cs @@ -5,6 +5,7 @@ namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] public class StructuralEqualityEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, @@ -108,3 +109,4 @@ private static IEnumerable GetMembersFromExpectation(INode currentNode, return members; } } + diff --git a/Src/FluentAssertions/Equivalency/Steps/TypeEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/TypeEquivalencyStep.cs index e63c850e43..04fdf8183c 100644 --- a/Src/FluentAssertions/Equivalency/Steps/TypeEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/TypeEquivalencyStep.cs @@ -13,6 +13,7 @@ namespace FluentAssertions.Equivalency.Steps; /// This differs from the default equivalency assertion which states that two objects are equivalent if they have the /// same properties and values, regardless of their type. /// +[System.Diagnostics.StackTraceHidden] public class TypeEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, @@ -57,3 +58,4 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon return EquivalencyResult.ContinueWithNext; } } + diff --git a/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs index 2af82fa77d..4c5bb459de 100644 --- a/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs @@ -6,6 +6,7 @@ namespace FluentAssertions.Equivalency.Steps; /// /// Ensures that types that are marked as value types are treated as such. /// +[System.Diagnostics.StackTraceHidden] public class ValueTypeEquivalencyStep : IEquivalencyStep { public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, @@ -39,3 +40,4 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon return EquivalencyResult.ContinueWithNext; } } + diff --git a/Src/FluentAssertions/Equivalency/Steps/XAttributeEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/XAttributeEquivalencyStep.cs index c403ed74d9..5cd7af5f93 100644 --- a/Src/FluentAssertions/Equivalency/Steps/XAttributeEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/XAttributeEquivalencyStep.cs @@ -1,8 +1,9 @@ -using System.Xml.Linq; +using System.Xml.Linq; using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] public class XAttributeEquivalencyStep : EquivalencyStep { protected override EquivalencyResult OnHandle(Comparands comparands, diff --git a/Src/FluentAssertions/Equivalency/Steps/XDocumentEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/XDocumentEquivalencyStep.cs index b88921f45b..727f6ef730 100644 --- a/Src/FluentAssertions/Equivalency/Steps/XDocumentEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/XDocumentEquivalencyStep.cs @@ -1,8 +1,9 @@ -using System.Xml.Linq; +using System.Xml.Linq; using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] public class XDocumentEquivalencyStep : EquivalencyStep { protected override EquivalencyResult OnHandle(Comparands comparands, diff --git a/Src/FluentAssertions/Equivalency/Steps/XElementEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/XElementEquivalencyStep.cs index 9ed4e2d503..3450ec7716 100644 --- a/Src/FluentAssertions/Equivalency/Steps/XElementEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/XElementEquivalencyStep.cs @@ -1,8 +1,9 @@ -using System.Xml.Linq; +using System.Xml.Linq; using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Steps; +[System.Diagnostics.StackTraceHidden] public class XElementEquivalencyStep : EquivalencyStep { protected override EquivalencyResult OnHandle(Comparands comparands, diff --git a/Src/FluentAssertions/Equivalency/SubjectInfoExtensions.cs b/Src/FluentAssertions/Equivalency/SubjectInfoExtensions.cs index 6cdc9e0349..abc1ce3696 100644 --- a/Src/FluentAssertions/Equivalency/SubjectInfoExtensions.cs +++ b/Src/FluentAssertions/Equivalency/SubjectInfoExtensions.cs @@ -1,7 +1,8 @@ -using FluentAssertions.Common; +using FluentAssertions.Common; namespace FluentAssertions.Equivalency; +[System.Diagnostics.StackTraceHidden] public static class SubjectInfoExtensions { /// @@ -48,3 +49,4 @@ public static bool WhichGetterDoesNotHave(this IMemberInfo memberInfo, CSharpAcc return memberInfo.GetterAccessibility != accessModifier; } } + diff --git a/Src/FluentAssertions/Equivalency/Typing/AlwaysBeStrictTypingRule.cs b/Src/FluentAssertions/Equivalency/Typing/AlwaysBeStrictTypingRule.cs index 8f81205c2c..5140bd56c4 100644 --- a/Src/FluentAssertions/Equivalency/Typing/AlwaysBeStrictTypingRule.cs +++ b/Src/FluentAssertions/Equivalency/Typing/AlwaysBeStrictTypingRule.cs @@ -3,6 +3,7 @@ namespace FluentAssertions.Equivalency.Typing; /// /// An implementation of that applies strict typing to all objects. /// +[System.Diagnostics.StackTraceHidden] internal class AlwaysBeStrictTypingRule : ITypingRule { /// diff --git a/Src/FluentAssertions/Equivalency/Typing/PredicateBasedTypingRule.cs b/Src/FluentAssertions/Equivalency/Typing/PredicateBasedTypingRule.cs index 3aea5b3db2..f6bfe6daa2 100644 --- a/Src/FluentAssertions/Equivalency/Typing/PredicateBasedTypingRule.cs +++ b/Src/FluentAssertions/Equivalency/Typing/PredicateBasedTypingRule.cs @@ -8,6 +8,7 @@ namespace FluentAssertions.Equivalency.Typing; /// An implementation of that uses a predicate to determine /// whether strict typing should be applied during equivalency comparison. /// +[System.Diagnostics.StackTraceHidden] internal class PredicateBasedTypingRule : ITypingRule { private readonly Func predicate; @@ -37,3 +38,4 @@ public override string ToString() return $"Use strict typing when {description}"; } } + diff --git a/Src/FluentAssertions/EventRaisingExtensions.cs b/Src/FluentAssertions/EventRaisingExtensions.cs index 15798cba20..17c04f2b23 100644 --- a/Src/FluentAssertions/EventRaisingExtensions.cs +++ b/Src/FluentAssertions/EventRaisingExtensions.cs @@ -177,3 +177,4 @@ internal static IEventRecording WithPropertyChangeFor(this IEventRecording event return new FilteredEventRecording(eventRecording, eventsForPropertyName); } } + diff --git a/Src/FluentAssertions/Events/EventAssertions.cs b/Src/FluentAssertions/Events/EventAssertions.cs index 36210c41eb..809558eef9 100644 --- a/Src/FluentAssertions/Events/EventAssertions.cs +++ b/Src/FluentAssertions/Events/EventAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq; @@ -174,3 +174,4 @@ public void NotRaisePropertyChangeFor(Expression> propertyExpres protected override string Identifier => "subject"; } + diff --git a/Src/FluentAssertions/Events/EventHandlerFactory.cs b/Src/FluentAssertions/Events/EventHandlerFactory.cs index bf05ddf5af..54dc1e4d93 100644 --- a/Src/FluentAssertions/Events/EventHandlerFactory.cs +++ b/Src/FluentAssertions/Events/EventHandlerFactory.cs @@ -7,6 +7,7 @@ namespace FluentAssertions.Events; /// /// Static methods that aid in generic event subscription /// +[System.Diagnostics.StackTraceHidden] internal static class EventHandlerFactory { /// @@ -146,3 +147,4 @@ private static MethodInfo DelegateInvokeMethod(Type d) return invoke; } } + diff --git a/Src/FluentAssertions/Events/EventMetadata.cs b/Src/FluentAssertions/Events/EventMetadata.cs index e569b862c8..3fc8f5c97f 100644 --- a/Src/FluentAssertions/Events/EventMetadata.cs +++ b/Src/FluentAssertions/Events/EventMetadata.cs @@ -1,10 +1,11 @@ -using System; +using System; namespace FluentAssertions.Events; /// /// Provides the metadata of a monitored event. /// +[System.Diagnostics.StackTraceHidden] public class EventMetadata { /// @@ -23,3 +24,4 @@ public EventMetadata(string eventName, Type handlerType) HandlerType = handlerType; } } + diff --git a/Src/FluentAssertions/Events/EventMonitor.cs b/Src/FluentAssertions/Events/EventMonitor.cs index 435f0a0795..23ecf5afb0 100644 --- a/Src/FluentAssertions/Events/EventMonitor.cs +++ b/Src/FluentAssertions/Events/EventMonitor.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 using System; using System.Collections.Concurrent; @@ -13,6 +13,7 @@ namespace FluentAssertions.Events; /// /// Tracks the events an object raises. /// +[System.Diagnostics.StackTraceHidden] internal sealed class EventMonitor : IMonitor { private readonly WeakReference subject; @@ -165,3 +166,4 @@ private void AttachEventHandler(EventInfo eventInfo, EventRecorder recorder) } #endif + diff --git a/Src/FluentAssertions/Events/EventMonitorOptions.cs b/Src/FluentAssertions/Events/EventMonitorOptions.cs index c6cbf76d25..4d04765e88 100644 --- a/Src/FluentAssertions/Events/EventMonitorOptions.cs +++ b/Src/FluentAssertions/Events/EventMonitorOptions.cs @@ -5,6 +5,7 @@ namespace FluentAssertions.Events; /// /// Settings for the EventMonitor. /// +[System.Diagnostics.StackTraceHidden] public class EventMonitorOptions { /// @@ -54,3 +55,4 @@ internal EventMonitorOptions ConfigureTimestampProvider(Func timestamp return this; } } + diff --git a/Src/FluentAssertions/Events/EventRecorder.cs b/Src/FluentAssertions/Events/EventRecorder.cs index 768449083e..33ec8de284 100644 --- a/Src/FluentAssertions/Events/EventRecorder.cs +++ b/Src/FluentAssertions/Events/EventRecorder.cs @@ -12,6 +12,7 @@ namespace FluentAssertions.Events; /// Records activity for a single event. /// [DebuggerNonUserCode] +[StackTraceHidden] internal sealed class EventRecorder : IEventRecording, IDisposable { private readonly Func utcNow; diff --git a/Src/FluentAssertions/Events/FilteredEventRecording.cs b/Src/FluentAssertions/Events/FilteredEventRecording.cs index 018229d66f..a99ae9970a 100644 --- a/Src/FluentAssertions/Events/FilteredEventRecording.cs +++ b/Src/FluentAssertions/Events/FilteredEventRecording.cs @@ -1,10 +1,11 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; namespace FluentAssertions.Events; +[System.Diagnostics.StackTraceHidden] internal class FilteredEventRecording : IEventRecording { private readonly OccurredEvent[] occurredEvents; @@ -42,3 +43,4 @@ public IEnumerator GetEnumerator() } } } + diff --git a/Src/FluentAssertions/Events/IMonitor.cs b/Src/FluentAssertions/Events/IMonitor.cs index a1e831d2d5..cb47f8d38c 100644 --- a/Src/FluentAssertions/Events/IMonitor.cs +++ b/Src/FluentAssertions/Events/IMonitor.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace FluentAssertions.Events; diff --git a/Src/FluentAssertions/Events/OccurredEvent.cs b/Src/FluentAssertions/Events/OccurredEvent.cs index 6f062b7050..74e8865cd6 100644 --- a/Src/FluentAssertions/Events/OccurredEvent.cs +++ b/Src/FluentAssertions/Events/OccurredEvent.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Linq; @@ -7,6 +7,7 @@ namespace FluentAssertions.Events; /// /// Represents an occurrence of a particular event. /// +[System.Diagnostics.StackTraceHidden] public class OccurredEvent { /// @@ -44,3 +45,4 @@ internal bool IsAffectingPropertyName(string propertyName) .Any(e => string.IsNullOrEmpty(e.PropertyName) || e.PropertyName == propertyName); } } + diff --git a/Src/FluentAssertions/Events/RecordedEvent.cs b/Src/FluentAssertions/Events/RecordedEvent.cs index 1d44a724a6..b486192e28 100644 --- a/Src/FluentAssertions/Events/RecordedEvent.cs +++ b/Src/FluentAssertions/Events/RecordedEvent.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; namespace FluentAssertions.Events; @@ -7,6 +7,7 @@ namespace FluentAssertions.Events; /// This class is used to store data about an intercepted event /// [DebuggerNonUserCode] +[StackTraceHidden] internal class RecordedEvent { /// diff --git a/Src/FluentAssertions/Events/ThreadSafeSequenceGenerator.cs b/Src/FluentAssertions/Events/ThreadSafeSequenceGenerator.cs index 3faccd0e53..d72e869554 100644 --- a/Src/FluentAssertions/Events/ThreadSafeSequenceGenerator.cs +++ b/Src/FluentAssertions/Events/ThreadSafeSequenceGenerator.cs @@ -5,6 +5,7 @@ namespace FluentAssertions.Events; /// /// Generates a sequence in a thread-safe manner. /// +[System.Diagnostics.StackTraceHidden] internal sealed class ThreadSafeSequenceGenerator { private int sequence = -1; @@ -17,3 +18,4 @@ public int Increment() return Interlocked.Increment(ref sequence); } } + diff --git a/Src/FluentAssertions/Exactly.cs b/Src/FluentAssertions/Exactly.cs index 6b1c424666..1319edc240 100644 --- a/Src/FluentAssertions/Exactly.cs +++ b/Src/FluentAssertions/Exactly.cs @@ -1,5 +1,6 @@ -namespace FluentAssertions; +namespace FluentAssertions; +[System.Diagnostics.StackTraceHidden] public static class Exactly { public static OccurrenceConstraint Once() => new ExactlyTimesConstraint(1); diff --git a/Src/FluentAssertions/ExceptionAssertionsExtensions.cs b/Src/FluentAssertions/ExceptionAssertionsExtensions.cs index 2de8149e47..31773d9dc8 100644 --- a/Src/FluentAssertions/ExceptionAssertionsExtensions.cs +++ b/Src/FluentAssertions/ExceptionAssertionsExtensions.cs @@ -1,4 +1,5 @@ using System; + using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Threading.Tasks; @@ -224,3 +225,4 @@ public static async Task> WithParameterName, /// you can run multiple assertions which failure messages will be collected until the scope is disposed. /// +[System.Diagnostics.StackTraceHidden] public sealed class AssertionChain { private readonly Func getCurrentScope; diff --git a/Src/FluentAssertions/Execution/AssertionFailedException.cs b/Src/FluentAssertions/Execution/AssertionFailedException.cs index d21f2f6ab8..dda9396090 100644 --- a/Src/FluentAssertions/Execution/AssertionFailedException.cs +++ b/Src/FluentAssertions/Execution/AssertionFailedException.cs @@ -7,7 +7,9 @@ namespace FluentAssertions.Execution; /// /// The mandatory exception message #pragma warning disable CA1032, RCS1194 // AssertionFailedException should never be constructed with an empty message +[System.Diagnostics.StackTraceHidden] public class AssertionFailedException(string message) : Exception(message), IAssertionException #pragma warning restore CA1032, RCS1194 { } + diff --git a/Src/FluentAssertions/Execution/AssertionScope.cs b/Src/FluentAssertions/Execution/AssertionScope.cs index b2b4dbf604..2daa2ab8e8 100644 --- a/Src/FluentAssertions/Execution/AssertionScope.cs +++ b/Src/FluentAssertions/Execution/AssertionScope.cs @@ -15,6 +15,7 @@ namespace FluentAssertions.Execution; /// such as when using or . /// // Remove all assertion logic from this class since it is superseded by the Assertion class +[System.Diagnostics.StackTraceHidden] public sealed class AssertionScope : IDisposable { private readonly IAssertionStrategy assertionStrategy; diff --git a/Src/FluentAssertions/Execution/CollectingAssertionStrategy.cs b/Src/FluentAssertions/Execution/CollectingAssertionStrategy.cs index 4c017f1806..b8cb21ae77 100644 --- a/Src/FluentAssertions/Execution/CollectingAssertionStrategy.cs +++ b/Src/FluentAssertions/Execution/CollectingAssertionStrategy.cs @@ -6,6 +6,7 @@ namespace FluentAssertions.Execution; +[System.Diagnostics.StackTraceHidden] internal class CollectingAssertionStrategy : IAssertionStrategy { private readonly List failureMessages = []; diff --git a/Src/FluentAssertions/Execution/ContextDataDictionary.cs b/Src/FluentAssertions/Execution/ContextDataDictionary.cs index 7bc42fdd97..3e112e493e 100644 --- a/Src/FluentAssertions/Execution/ContextDataDictionary.cs +++ b/Src/FluentAssertions/Execution/ContextDataDictionary.cs @@ -8,6 +8,7 @@ namespace FluentAssertions.Execution; /// /// Represents a collection of data items that are associated with an . /// +[System.Diagnostics.StackTraceHidden] internal class ContextDataDictionary { private readonly List items = []; @@ -78,3 +79,4 @@ public DataItem Clone() } } } + diff --git a/Src/FluentAssertions/Execution/Continuation.cs b/Src/FluentAssertions/Execution/Continuation.cs index b2f65e62a3..ee6d772807 100644 --- a/Src/FluentAssertions/Execution/Continuation.cs +++ b/Src/FluentAssertions/Execution/Continuation.cs @@ -1,8 +1,9 @@ -namespace FluentAssertions.Execution; +namespace FluentAssertions.Execution; /// /// Enables chaining multiple assertions on an . /// +[System.Diagnostics.StackTraceHidden] public class Continuation { internal Continuation(AssertionChain parent) diff --git a/Src/FluentAssertions/Execution/ContinuationOfGiven.cs b/Src/FluentAssertions/Execution/ContinuationOfGiven.cs index ef42263f3f..7b09cad36a 100644 --- a/Src/FluentAssertions/Execution/ContinuationOfGiven.cs +++ b/Src/FluentAssertions/Execution/ContinuationOfGiven.cs @@ -1,8 +1,9 @@ -namespace FluentAssertions.Execution; +namespace FluentAssertions.Execution; /// /// Enables chaining multiple assertions from a call. /// +[System.Diagnostics.StackTraceHidden] public class ContinuationOfGiven { internal ContinuationOfGiven(GivenSelector parent) @@ -17,3 +18,4 @@ internal ContinuationOfGiven(GivenSelector parent) public bool Succeeded => Then.Succeeded; } + diff --git a/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs b/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs index 2a0a5d8e03..d7831f7738 100644 --- a/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs +++ b/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs @@ -4,6 +4,7 @@ namespace FluentAssertions.Execution; [ExcludeFromCodeCoverage] +[System.Diagnostics.StackTraceHidden] internal class DefaultAssertionStrategy : IAssertionStrategy { /// diff --git a/Src/FluentAssertions/Execution/FailReason.cs b/Src/FluentAssertions/Execution/FailReason.cs index 27bab552db..ea6fffb22f 100644 --- a/Src/FluentAssertions/Execution/FailReason.cs +++ b/Src/FluentAssertions/Execution/FailReason.cs @@ -19,6 +19,7 @@ namespace FluentAssertions.Execution; /// Note that only 10 args are supported in combination with a {reason}. /// /// +[System.Diagnostics.StackTraceHidden] public class FailReason { /// diff --git a/Src/FluentAssertions/Execution/FailureMessageFormatter.cs b/Src/FluentAssertions/Execution/FailureMessageFormatter.cs index 9fc73c1682..905e835f93 100644 --- a/Src/FluentAssertions/Execution/FailureMessageFormatter.cs +++ b/Src/FluentAssertions/Execution/FailureMessageFormatter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using System.Linq; using System.Text.RegularExpressions; @@ -10,6 +10,7 @@ namespace FluentAssertions.Execution; /// /// Encapsulates expanding the various placeholders supported in a failure message. /// +[System.Diagnostics.StackTraceHidden] internal class FailureMessageFormatter(FormattingOptions formattingOptions) { private static readonly char[] Blanks = ['\r', '\n', ' ', '\t']; @@ -152,3 +153,4 @@ private string FormatArgumentPlaceholders(string failureMessage, object[] failur } } } + diff --git a/Src/FluentAssertions/Execution/FallbackTestFramework.cs b/Src/FluentAssertions/Execution/FallbackTestFramework.cs index a5c3715734..eb4fadfc94 100644 --- a/Src/FluentAssertions/Execution/FallbackTestFramework.cs +++ b/Src/FluentAssertions/Execution/FallbackTestFramework.cs @@ -5,6 +5,7 @@ namespace FluentAssertions.Execution; /// /// Throws a generic exception in case no other test harness is detected. /// +[System.Diagnostics.StackTraceHidden] internal class FallbackTestFramework : ITestFramework { /// diff --git a/Src/FluentAssertions/Execution/GivenSelector.cs b/Src/FluentAssertions/Execution/GivenSelector.cs index 0c2e42798f..65ed49c8d2 100644 --- a/Src/FluentAssertions/Execution/GivenSelector.cs +++ b/Src/FluentAssertions/Execution/GivenSelector.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using FluentAssertions.Common; @@ -8,6 +8,7 @@ namespace FluentAssertions.Execution; /// Represents a chaining object returned from to continue the assertion using /// an object returned by a selector. /// +[System.Diagnostics.StackTraceHidden] public class GivenSelector { private readonly AssertionChain assertionChain; @@ -74,3 +75,4 @@ public ContinuationOfGiven FailWith(string message, params object[] args) return new ContinuationOfGiven(this); } } + diff --git a/Src/FluentAssertions/Execution/GivenSelectorExtensions.cs b/Src/FluentAssertions/Execution/GivenSelectorExtensions.cs index 2d32816641..a7733f5d02 100644 --- a/Src/FluentAssertions/Execution/GivenSelectorExtensions.cs +++ b/Src/FluentAssertions/Execution/GivenSelectorExtensions.cs @@ -1,10 +1,12 @@ -using System; +using System; + using System.Collections; using System.Collections.Generic; using FluentAssertions.Common; namespace FluentAssertions.Execution; +[System.Diagnostics.StackTraceHidden] internal static class GivenSelectorExtensions { public static ContinuationOfGiven> AssertCollectionIsNotNull( @@ -104,3 +106,4 @@ public CollectionWithIndex(ICollection items, int index) IEnumerator IEnumerable.GetEnumerator() => Items.GetEnumerator(); } } + diff --git a/Src/FluentAssertions/Execution/IAssertionStrategy.cs b/Src/FluentAssertions/Execution/IAssertionStrategy.cs index 84612c05cb..a3a667ef3f 100644 --- a/Src/FluentAssertions/Execution/IAssertionStrategy.cs +++ b/Src/FluentAssertions/Execution/IAssertionStrategy.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Execution/ITestFramework.cs b/Src/FluentAssertions/Execution/ITestFramework.cs index 9aa877ea26..114a8849ea 100644 --- a/Src/FluentAssertions/Execution/ITestFramework.cs +++ b/Src/FluentAssertions/Execution/ITestFramework.cs @@ -1,4 +1,4 @@ -using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.CodeAnalysis; namespace FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Execution/LateBoundTestFramework.cs b/Src/FluentAssertions/Execution/LateBoundTestFramework.cs index 010150d46a..ed2422c813 100644 --- a/Src/FluentAssertions/Execution/LateBoundTestFramework.cs +++ b/Src/FluentAssertions/Execution/LateBoundTestFramework.cs @@ -1,10 +1,11 @@ -using System; +using System; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Reflection; namespace FluentAssertions.Execution; +[System.Diagnostics.StackTraceHidden] internal abstract class LateBoundTestFramework : ITestFramework { private Func exceptionFactory = diff --git a/Src/FluentAssertions/Execution/MSTestFrameworkV2.cs b/Src/FluentAssertions/Execution/MSTestFrameworkV2.cs index b299b995ab..8a424f3aad 100644 --- a/Src/FluentAssertions/Execution/MSTestFrameworkV2.cs +++ b/Src/FluentAssertions/Execution/MSTestFrameworkV2.cs @@ -1,5 +1,6 @@ -namespace FluentAssertions.Execution; +namespace FluentAssertions.Execution; +[System.Diagnostics.StackTraceHidden] internal class MSTestFrameworkV2 : LateBoundTestFramework { protected override string ExceptionFullName => "Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException"; diff --git a/Src/FluentAssertions/Execution/MSTestFrameworkV4.cs b/Src/FluentAssertions/Execution/MSTestFrameworkV4.cs index c40fcda2c3..249f0cc075 100644 --- a/Src/FluentAssertions/Execution/MSTestFrameworkV4.cs +++ b/Src/FluentAssertions/Execution/MSTestFrameworkV4.cs @@ -1,5 +1,6 @@ -namespace FluentAssertions.Execution; +namespace FluentAssertions.Execution; +[System.Diagnostics.StackTraceHidden] internal sealed class MSTestFrameworkV4 : LateBoundTestFramework { protected override string ExceptionFullName => "Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException"; diff --git a/Src/FluentAssertions/Execution/MSpecFramework.cs b/Src/FluentAssertions/Execution/MSpecFramework.cs index ffbd583395..35532767c8 100644 --- a/Src/FluentAssertions/Execution/MSpecFramework.cs +++ b/Src/FluentAssertions/Execution/MSpecFramework.cs @@ -1,5 +1,6 @@ -namespace FluentAssertions.Execution; +namespace FluentAssertions.Execution; +[System.Diagnostics.StackTraceHidden] internal class MSpecFramework : LateBoundTestFramework { protected internal override string AssemblyName => "Machine.Specifications"; diff --git a/Src/FluentAssertions/Execution/NUnitTestFramework.cs b/Src/FluentAssertions/Execution/NUnitTestFramework.cs index 700e4a2ce3..e4624b5cb9 100644 --- a/Src/FluentAssertions/Execution/NUnitTestFramework.cs +++ b/Src/FluentAssertions/Execution/NUnitTestFramework.cs @@ -1,5 +1,6 @@ -namespace FluentAssertions.Execution; +namespace FluentAssertions.Execution; +[System.Diagnostics.StackTraceHidden] internal class NUnitTestFramework : LateBoundTestFramework { protected internal override string AssemblyName => "nunit.framework"; diff --git a/Src/FluentAssertions/Execution/Reason.cs b/Src/FluentAssertions/Execution/Reason.cs index ca6996b66f..297f47e437 100644 --- a/Src/FluentAssertions/Execution/Reason.cs +++ b/Src/FluentAssertions/Execution/Reason.cs @@ -5,6 +5,7 @@ namespace FluentAssertions.Execution; /// /// Represents the reason for a structural equivalency assertion. /// +[System.Diagnostics.StackTraceHidden] public class Reason { public Reason([StringSyntax("CompositeFormat")] string formattedMessage, object[] arguments) @@ -24,3 +25,4 @@ public Reason([StringSyntax("CompositeFormat")] string formattedMessage, object[ /// public object[] Arguments { get; set; } } + diff --git a/Src/FluentAssertions/Execution/StringExtensions.cs b/Src/FluentAssertions/Execution/StringExtensions.cs index ab1b13eb16..6f3b226d4d 100644 --- a/Src/FluentAssertions/Execution/StringExtensions.cs +++ b/Src/FluentAssertions/Execution/StringExtensions.cs @@ -1,5 +1,6 @@ namespace FluentAssertions.Execution; +[System.Diagnostics.StackTraceHidden] internal static class StringExtensions { /// diff --git a/Src/FluentAssertions/Execution/SubjectIdentificationBuilder.cs b/Src/FluentAssertions/Execution/SubjectIdentificationBuilder.cs index 8d8371000d..7ffee1cf36 100644 --- a/Src/FluentAssertions/Execution/SubjectIdentificationBuilder.cs +++ b/Src/FluentAssertions/Execution/SubjectIdentificationBuilder.cs @@ -12,6 +12,7 @@ namespace FluentAssertions.Execution; /// (nested) instances of and modifications made by the /// . /// +[System.Diagnostics.StackTraceHidden] internal class SubjectIdentificationBuilder { private readonly Func getScopeName; @@ -100,3 +101,4 @@ private string GetIdentifier(int index) return identifiersExtractedFromTheCode.Value.Length > index ? identifiersExtractedFromTheCode.Value[index] : null; } } + diff --git a/Src/FluentAssertions/Execution/TUnitFramework.cs b/Src/FluentAssertions/Execution/TUnitFramework.cs index 94e8337ee6..90c0d694c0 100644 --- a/Src/FluentAssertions/Execution/TUnitFramework.cs +++ b/Src/FluentAssertions/Execution/TUnitFramework.cs @@ -1,5 +1,6 @@ -namespace FluentAssertions.Execution; +namespace FluentAssertions.Execution; +[System.Diagnostics.StackTraceHidden] internal class TUnitFramework : LateBoundTestFramework { public TUnitFramework() diff --git a/Src/FluentAssertions/Execution/TestFrameworkFactory.cs b/Src/FluentAssertions/Execution/TestFrameworkFactory.cs index ac298b9045..dcc44d4918 100644 --- a/Src/FluentAssertions/Execution/TestFrameworkFactory.cs +++ b/Src/FluentAssertions/Execution/TestFrameworkFactory.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using FluentAssertions.Configuration; @@ -9,6 +9,7 @@ namespace FluentAssertions.Execution; /// Determines the test framework, either by scanning the current app domain for known test framework assemblies or by /// passing the framework name directly. /// +[System.Diagnostics.StackTraceHidden] internal static class TestFrameworkFactory { private static readonly Dictionary Frameworks = new() @@ -73,3 +74,4 @@ private static ITestFramework AttemptToDetectUsingDynamicScanning() return Frameworks.Values.FirstOrDefault(framework => framework.IsAvailable); } } + diff --git a/Src/FluentAssertions/Execution/WithoutFormattingWrapper.cs b/Src/FluentAssertions/Execution/WithoutFormattingWrapper.cs index 0696cde026..bdf8e7756e 100644 --- a/Src/FluentAssertions/Execution/WithoutFormattingWrapper.cs +++ b/Src/FluentAssertions/Execution/WithoutFormattingWrapper.cs @@ -5,7 +5,9 @@ namespace FluentAssertions.Execution; /// /// Wrapper to tell the not to apply any value formatters on this string. /// +[System.Diagnostics.StackTraceHidden] internal class WithoutFormattingWrapper(string value) { public override string ToString() => value; } + diff --git a/Src/FluentAssertions/Execution/XUnitTestFramework.cs b/Src/FluentAssertions/Execution/XUnitTestFramework.cs index 8ef0c1d7dc..f25b3b5252 100644 --- a/Src/FluentAssertions/Execution/XUnitTestFramework.cs +++ b/Src/FluentAssertions/Execution/XUnitTestFramework.cs @@ -3,6 +3,7 @@ namespace FluentAssertions.Execution; /// /// Implements the xUnit (version 2 and 3) test framework adapter. /// +[System.Diagnostics.StackTraceHidden] internal class XUnitTestFramework : LateBoundTestFramework { private readonly string assemblyName; diff --git a/Src/FluentAssertions/Extensibility/AssertionEngineInitializerAttribute.cs b/Src/FluentAssertions/Extensibility/AssertionEngineInitializerAttribute.cs index c6f5d4f4e2..60b8f02705 100644 --- a/Src/FluentAssertions/Extensibility/AssertionEngineInitializerAttribute.cs +++ b/Src/FluentAssertions/Extensibility/AssertionEngineInitializerAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Reflection; namespace FluentAssertions.Extensibility; @@ -7,6 +7,7 @@ namespace FluentAssertions.Extensibility; /// Can be added to an assembly so it gets a change to initialize Fluent Assertions before the first assertion happens. /// [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] +[System.Diagnostics.StackTraceHidden] public sealed class AssertionEngineInitializerAttribute : Attribute { private readonly string methodName; @@ -28,3 +29,4 @@ internal void Initialize() type?.GetMethod(methodName, BindingFlags.Public | BindingFlags.Static)?.Invoke(obj: null, parameters: null); } } + diff --git a/Src/FluentAssertions/Extensions/FluentTimeSpanExtensions.cs b/Src/FluentAssertions/Extensions/FluentTimeSpanExtensions.cs index 865b72cf7b..4afd886b08 100644 --- a/Src/FluentAssertions/Extensions/FluentTimeSpanExtensions.cs +++ b/Src/FluentAssertions/Extensions/FluentTimeSpanExtensions.cs @@ -248,3 +248,4 @@ public static TimeSpan And(this TimeSpan sourceTime, TimeSpan offset) return sourceTime.Add(offset); } } + diff --git a/Src/FluentAssertions/Extensions/OccurrenceConstraintExtensions.cs b/Src/FluentAssertions/Extensions/OccurrenceConstraintExtensions.cs index beeaa525bf..1df6053b10 100644 --- a/Src/FluentAssertions/Extensions/OccurrenceConstraintExtensions.cs +++ b/Src/FluentAssertions/Extensions/OccurrenceConstraintExtensions.cs @@ -34,3 +34,4 @@ public static OccurrenceConstraint TimesOrMore(this int times) return AtLeast.Times(times); } } + diff --git a/Src/FluentAssertions/FluentActions.cs b/Src/FluentAssertions/FluentActions.cs index 4f78f889ef..f7621a3243 100644 --- a/Src/FluentAssertions/FluentActions.cs +++ b/Src/FluentAssertions/FluentActions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; @@ -10,6 +10,7 @@ namespace FluentAssertions; /// /// Contains static methods to help with exception assertions on actions. /// +[StackTraceHidden] [DebuggerNonUserCode] public static class FluentActions { diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 2d853b4ddd..78c033eba8 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -47,12 +47,16 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all + + true + + diff --git a/Src/FluentAssertions/Formatting/DateTimeOffsetValueFormatter.cs b/Src/FluentAssertions/Formatting/DateTimeOffsetValueFormatter.cs index 1c9085dab7..140dd62ebc 100644 --- a/Src/FluentAssertions/Formatting/DateTimeOffsetValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/DateTimeOffsetValueFormatter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics.CodeAnalysis; using System.Globalization; using FluentAssertions.Common; diff --git a/Src/FluentAssertions/Formatting/DecimalValueFormatter.cs b/Src/FluentAssertions/Formatting/DecimalValueFormatter.cs index a7a6d86020..476e913ab0 100644 --- a/Src/FluentAssertions/Formatting/DecimalValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/DecimalValueFormatter.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/DictionaryValueFormatter.cs b/Src/FluentAssertions/Formatting/DictionaryValueFormatter.cs index ffaf470a52..c40fbce002 100644 --- a/Src/FluentAssertions/Formatting/DictionaryValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/DictionaryValueFormatter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Globalization; diff --git a/Src/FluentAssertions/Formatting/DoubleValueFormatter.cs b/Src/FluentAssertions/Formatting/DoubleValueFormatter.cs index 0166c44651..6fa1890fda 100644 --- a/Src/FluentAssertions/Formatting/DoubleValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/DoubleValueFormatter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/EnumValueFormatter.cs b/Src/FluentAssertions/Formatting/EnumValueFormatter.cs index 516e3f2a88..09ccbd1e50 100644 --- a/Src/FluentAssertions/Formatting/EnumValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/EnumValueFormatter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/EnumerableExtensions.cs b/Src/FluentAssertions/Formatting/EnumerableExtensions.cs index 621ebebd62..b6feed56c8 100644 --- a/Src/FluentAssertions/Formatting/EnumerableExtensions.cs +++ b/Src/FluentAssertions/Formatting/EnumerableExtensions.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Text; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/EnumerableValueFormatter.cs b/Src/FluentAssertions/Formatting/EnumerableValueFormatter.cs index fe15e11746..42c98a2ad3 100644 --- a/Src/FluentAssertions/Formatting/EnumerableValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/EnumerableValueFormatter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Globalization; diff --git a/Src/FluentAssertions/Formatting/ExceptionValueFormatter.cs b/Src/FluentAssertions/Formatting/ExceptionValueFormatter.cs index a4975af707..971224a535 100644 --- a/Src/FluentAssertions/Formatting/ExceptionValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/ExceptionValueFormatter.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/ExpressionValueFormatter.cs b/Src/FluentAssertions/Formatting/ExpressionValueFormatter.cs index c22dbd46bc..c76ec824aa 100644 --- a/Src/FluentAssertions/Formatting/ExpressionValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/ExpressionValueFormatter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq.Expressions; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/FormatChild.cs b/Src/FluentAssertions/Formatting/FormatChild.cs index d182debfa4..bf5de58fa1 100644 --- a/Src/FluentAssertions/Formatting/FormatChild.cs +++ b/Src/FluentAssertions/Formatting/FormatChild.cs @@ -1,4 +1,4 @@ -namespace FluentAssertions.Formatting; +namespace FluentAssertions.Formatting; /// /// Represents a method that can be used to format child values from inside an . diff --git a/Src/FluentAssertions/Formatting/Formatter.cs b/Src/FluentAssertions/Formatting/Formatter.cs index a2c4dbc150..0525613c7d 100644 --- a/Src/FluentAssertions/Formatting/Formatter.cs +++ b/Src/FluentAssertions/Formatting/Formatter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; diff --git a/Src/FluentAssertions/Formatting/FormattingContext.cs b/Src/FluentAssertions/Formatting/FormattingContext.cs index 76dee54f8f..f444b665fd 100644 --- a/Src/FluentAssertions/Formatting/FormattingContext.cs +++ b/Src/FluentAssertions/Formatting/FormattingContext.cs @@ -1,4 +1,4 @@ -namespace FluentAssertions.Formatting; +namespace FluentAssertions.Formatting; /// /// Provides information about the current formatting action. diff --git a/Src/FluentAssertions/Formatting/FormattingOptions.cs b/Src/FluentAssertions/Formatting/FormattingOptions.cs index 8cb16870f8..abb3d5be41 100644 --- a/Src/FluentAssertions/Formatting/FormattingOptions.cs +++ b/Src/FluentAssertions/Formatting/FormattingOptions.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using FluentAssertions.Execution; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/IValueFormatter.cs b/Src/FluentAssertions/Formatting/IValueFormatter.cs index 0c29d895f5..cb908199cc 100644 --- a/Src/FluentAssertions/Formatting/IValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/IValueFormatter.cs @@ -1,4 +1,4 @@ -namespace FluentAssertions.Formatting; +namespace FluentAssertions.Formatting; /// /// Represents a strategy for formatting an arbitrary value into a human-readable string representation. diff --git a/Src/FluentAssertions/Formatting/Int16ValueFormatter.cs b/Src/FluentAssertions/Formatting/Int16ValueFormatter.cs index 8f8e29de9d..07598bc245 100644 --- a/Src/FluentAssertions/Formatting/Int16ValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/Int16ValueFormatter.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/Int32ValueFormatter.cs b/Src/FluentAssertions/Formatting/Int32ValueFormatter.cs index 97693fc410..240723feb1 100644 --- a/Src/FluentAssertions/Formatting/Int32ValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/Int32ValueFormatter.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/Int64ValueFormatter.cs b/Src/FluentAssertions/Formatting/Int64ValueFormatter.cs index bda4695f61..f65a1545bf 100644 --- a/Src/FluentAssertions/Formatting/Int64ValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/Int64ValueFormatter.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/MaxLinesExceededException.cs b/Src/FluentAssertions/Formatting/MaxLinesExceededException.cs index f6d5b5b260..195750a9a2 100644 --- a/Src/FluentAssertions/Formatting/MaxLinesExceededException.cs +++ b/Src/FluentAssertions/Formatting/MaxLinesExceededException.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/MultidimensionalArrayFormatter.cs b/Src/FluentAssertions/Formatting/MultidimensionalArrayFormatter.cs index 02bdca8483..e549b6cd14 100644 --- a/Src/FluentAssertions/Formatting/MultidimensionalArrayFormatter.cs +++ b/Src/FluentAssertions/Formatting/MultidimensionalArrayFormatter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Diagnostics.CodeAnalysis; using System.Linq; diff --git a/Src/FluentAssertions/Formatting/NullValueFormatter.cs b/Src/FluentAssertions/Formatting/NullValueFormatter.cs index 62dd35c090..958d479179 100644 --- a/Src/FluentAssertions/Formatting/NullValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/NullValueFormatter.cs @@ -1,4 +1,4 @@ -namespace FluentAssertions.Formatting; +namespace FluentAssertions.Formatting; public class NullValueFormatter : IValueFormatter { diff --git a/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs b/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs index 0180eee2c5..cbe85985ac 100644 --- a/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/PredicateLambdaExpressionValueFormatter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; diff --git a/Src/FluentAssertions/Formatting/PropertyInfoFormatter.cs b/Src/FluentAssertions/Formatting/PropertyInfoFormatter.cs index 4ec7de86e0..da639e0a7f 100644 --- a/Src/FluentAssertions/Formatting/PropertyInfoFormatter.cs +++ b/Src/FluentAssertions/Formatting/PropertyInfoFormatter.cs @@ -1,4 +1,4 @@ -using System.Reflection; +using System.Reflection; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/SByteValueFormatter.cs b/Src/FluentAssertions/Formatting/SByteValueFormatter.cs index 4d54c84475..3104d9cafb 100644 --- a/Src/FluentAssertions/Formatting/SByteValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/SByteValueFormatter.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/SingleValueFormatter.cs b/Src/FluentAssertions/Formatting/SingleValueFormatter.cs index b018d3e159..74445d8310 100644 --- a/Src/FluentAssertions/Formatting/SingleValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/SingleValueFormatter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/StringValueFormatter.cs b/Src/FluentAssertions/Formatting/StringValueFormatter.cs index fdf30f7b52..4c6e0b1a7b 100644 --- a/Src/FluentAssertions/Formatting/StringValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/StringValueFormatter.cs @@ -1,4 +1,4 @@ -namespace FluentAssertions.Formatting; +namespace FluentAssertions.Formatting; public class StringValueFormatter : IValueFormatter { diff --git a/Src/FluentAssertions/Formatting/TaskFormatter.cs b/Src/FluentAssertions/Formatting/TaskFormatter.cs index 993597ad2c..4d6a15957c 100644 --- a/Src/FluentAssertions/Formatting/TaskFormatter.cs +++ b/Src/FluentAssertions/Formatting/TaskFormatter.cs @@ -1,4 +1,4 @@ -using System.Threading.Tasks; +using System.Threading.Tasks; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/TimeSpanValueFormatter.cs b/Src/FluentAssertions/Formatting/TimeSpanValueFormatter.cs index d03cf8992c..c81b89f9af 100644 --- a/Src/FluentAssertions/Formatting/TimeSpanValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/TimeSpanValueFormatter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; diff --git a/Src/FluentAssertions/Formatting/UInt16ValueFormatter.cs b/Src/FluentAssertions/Formatting/UInt16ValueFormatter.cs index 780dea3b67..5d93e9e116 100644 --- a/Src/FluentAssertions/Formatting/UInt16ValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/UInt16ValueFormatter.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/UInt32ValueFormatter.cs b/Src/FluentAssertions/Formatting/UInt32ValueFormatter.cs index b8e1a8d299..b67a1e1511 100644 --- a/Src/FluentAssertions/Formatting/UInt32ValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/UInt32ValueFormatter.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/UInt64ValueFormatter.cs b/Src/FluentAssertions/Formatting/UInt64ValueFormatter.cs index 80ecb63fc4..72ecbb3fae 100644 --- a/Src/FluentAssertions/Formatting/UInt64ValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/UInt64ValueFormatter.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/XDocumentValueFormatter.cs b/Src/FluentAssertions/Formatting/XDocumentValueFormatter.cs index 195ca000bb..278091b576 100644 --- a/Src/FluentAssertions/Formatting/XDocumentValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/XDocumentValueFormatter.cs @@ -1,4 +1,4 @@ -using System.Xml.Linq; +using System.Xml.Linq; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/Formatting/XElementValueFormatter.cs b/Src/FluentAssertions/Formatting/XElementValueFormatter.cs index 3d34495f38..4fd4c5e450 100644 --- a/Src/FluentAssertions/Formatting/XElementValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/XElementValueFormatter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Xml.Linq; using FluentAssertions.Common; diff --git a/Src/FluentAssertions/Formatting/XmlReaderValueFormatter.cs b/Src/FluentAssertions/Formatting/XmlReaderValueFormatter.cs index 324eb60225..ac93b18506 100644 --- a/Src/FluentAssertions/Formatting/XmlReaderValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/XmlReaderValueFormatter.cs @@ -1,4 +1,4 @@ -using System.Xml; +using System.Xml; namespace FluentAssertions.Formatting; diff --git a/Src/FluentAssertions/JsonAssertionExtensions.cs b/Src/FluentAssertions/JsonAssertionExtensions.cs index 6fc01d88c2..d05748ea4a 100644 --- a/Src/FluentAssertions/JsonAssertionExtensions.cs +++ b/Src/FluentAssertions/JsonAssertionExtensions.cs @@ -1,4 +1,4 @@ -#if NET6_0_OR_GREATER +#if NET6_0_OR_GREATER using System.Diagnostics; using System.Linq; diff --git a/Src/FluentAssertions/LessThan.cs b/Src/FluentAssertions/LessThan.cs index dcfa40d876..7652d07baf 100644 --- a/Src/FluentAssertions/LessThan.cs +++ b/Src/FluentAssertions/LessThan.cs @@ -1,5 +1,6 @@ -namespace FluentAssertions; +namespace FluentAssertions; +[System.Diagnostics.StackTraceHidden] public static class LessThan { public static OccurrenceConstraint Twice() => new LessThanTimesConstraint(2); diff --git a/Src/FluentAssertions/License.cs b/Src/FluentAssertions/License.cs index df3a6b8afb..e53fa10225 100644 --- a/Src/FluentAssertions/License.cs +++ b/Src/FluentAssertions/License.cs @@ -3,6 +3,7 @@ namespace FluentAssertions; /// /// Provides access to the licensing state of Fluent Assertions /// +[System.Diagnostics.StackTraceHidden] public static class License { /// diff --git a/Src/FluentAssertions/MoreThan.cs b/Src/FluentAssertions/MoreThan.cs index 0c6ae3572a..14265b1e4f 100644 --- a/Src/FluentAssertions/MoreThan.cs +++ b/Src/FluentAssertions/MoreThan.cs @@ -1,5 +1,6 @@ -namespace FluentAssertions; +namespace FluentAssertions; +[System.Diagnostics.StackTraceHidden] public static class MoreThan { public static OccurrenceConstraint Once() => new MoreThanTimesConstraint(1); diff --git a/Src/FluentAssertions/Numeric/ByteAssertions.cs b/Src/FluentAssertions/Numeric/ByteAssertions.cs index ccd7399bcf..ec4c529c7b 100644 --- a/Src/FluentAssertions/Numeric/ByteAssertions.cs +++ b/Src/FluentAssertions/Numeric/ByteAssertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/DecimalAssertions.cs b/Src/FluentAssertions/Numeric/DecimalAssertions.cs index aa31679f46..56a0b33c2e 100644 --- a/Src/FluentAssertions/Numeric/DecimalAssertions.cs +++ b/Src/FluentAssertions/Numeric/DecimalAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/DoubleAssertions.cs b/Src/FluentAssertions/Numeric/DoubleAssertions.cs index 0596191408..f9f82489cb 100644 --- a/Src/FluentAssertions/Numeric/DoubleAssertions.cs +++ b/Src/FluentAssertions/Numeric/DoubleAssertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/Int16Assertions.cs b/Src/FluentAssertions/Numeric/Int16Assertions.cs index 7d7b9c2102..63d3a27564 100644 --- a/Src/FluentAssertions/Numeric/Int16Assertions.cs +++ b/Src/FluentAssertions/Numeric/Int16Assertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/Int32Assertions.cs b/Src/FluentAssertions/Numeric/Int32Assertions.cs index cfcb25f472..3bc3225707 100644 --- a/Src/FluentAssertions/Numeric/Int32Assertions.cs +++ b/Src/FluentAssertions/Numeric/Int32Assertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/Int64Assertions.cs b/Src/FluentAssertions/Numeric/Int64Assertions.cs index c733dd294e..ee482615f9 100644 --- a/Src/FluentAssertions/Numeric/Int64Assertions.cs +++ b/Src/FluentAssertions/Numeric/Int64Assertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/NullableByteAssertions.cs b/Src/FluentAssertions/Numeric/NullableByteAssertions.cs index 9fa6a4c4f0..da4ac20f00 100644 --- a/Src/FluentAssertions/Numeric/NullableByteAssertions.cs +++ b/Src/FluentAssertions/Numeric/NullableByteAssertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/NullableDecimalAssertions.cs b/Src/FluentAssertions/Numeric/NullableDecimalAssertions.cs index d5b27880c6..c114cef559 100644 --- a/Src/FluentAssertions/Numeric/NullableDecimalAssertions.cs +++ b/Src/FluentAssertions/Numeric/NullableDecimalAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/NullableInt16Assertions.cs b/Src/FluentAssertions/Numeric/NullableInt16Assertions.cs index 802d0c864d..c73ec63f64 100644 --- a/Src/FluentAssertions/Numeric/NullableInt16Assertions.cs +++ b/Src/FluentAssertions/Numeric/NullableInt16Assertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/NullableInt32Assertions.cs b/Src/FluentAssertions/Numeric/NullableInt32Assertions.cs index 7b2400568f..cf31981cb1 100644 --- a/Src/FluentAssertions/Numeric/NullableInt32Assertions.cs +++ b/Src/FluentAssertions/Numeric/NullableInt32Assertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/NullableInt64Assertions.cs b/Src/FluentAssertions/Numeric/NullableInt64Assertions.cs index 1e5e04d386..f78d5dbf3b 100644 --- a/Src/FluentAssertions/Numeric/NullableInt64Assertions.cs +++ b/Src/FluentAssertions/Numeric/NullableInt64Assertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/NullableSByteAssertions.cs b/Src/FluentAssertions/Numeric/NullableSByteAssertions.cs index e83e756404..2a4a4110d3 100644 --- a/Src/FluentAssertions/Numeric/NullableSByteAssertions.cs +++ b/Src/FluentAssertions/Numeric/NullableSByteAssertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/NullableSingleAssertions.cs b/Src/FluentAssertions/Numeric/NullableSingleAssertions.cs index 3a82df8969..2cec4f7c95 100644 --- a/Src/FluentAssertions/Numeric/NullableSingleAssertions.cs +++ b/Src/FluentAssertions/Numeric/NullableSingleAssertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/NullableUInt16Assertions.cs b/Src/FluentAssertions/Numeric/NullableUInt16Assertions.cs index 0df417d5e2..416ccc64c2 100644 --- a/Src/FluentAssertions/Numeric/NullableUInt16Assertions.cs +++ b/Src/FluentAssertions/Numeric/NullableUInt16Assertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/NullableUInt32Assertions.cs b/Src/FluentAssertions/Numeric/NullableUInt32Assertions.cs index 69b94a8086..b650d76a99 100644 --- a/Src/FluentAssertions/Numeric/NullableUInt32Assertions.cs +++ b/Src/FluentAssertions/Numeric/NullableUInt32Assertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/NullableUInt64Assertions.cs b/Src/FluentAssertions/Numeric/NullableUInt64Assertions.cs index 6c36e3b703..c8f19561ca 100644 --- a/Src/FluentAssertions/Numeric/NullableUInt64Assertions.cs +++ b/Src/FluentAssertions/Numeric/NullableUInt64Assertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/NumericAssertionsBase.cs b/Src/FluentAssertions/Numeric/NumericAssertionsBase.cs index 224f4ad286..ba2454c03a 100644 --- a/Src/FluentAssertions/Numeric/NumericAssertionsBase.cs +++ b/Src/FluentAssertions/Numeric/NumericAssertionsBase.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Linq.Expressions; @@ -10,6 +11,7 @@ namespace FluentAssertions.Numeric; #pragma warning disable CS0659, S1206 // Ignore not overriding Object.GetHashCode() #pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals +[DebuggerNonUserCode] public abstract class NumericAssertionsBase where T : struct, IComparable where TAssertions : NumericAssertionsBase diff --git a/Src/FluentAssertions/Numeric/SByteAssertions.cs b/Src/FluentAssertions/Numeric/SByteAssertions.cs index 7ac217e8a3..726a98eeef 100644 --- a/Src/FluentAssertions/Numeric/SByteAssertions.cs +++ b/Src/FluentAssertions/Numeric/SByteAssertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; @@ -21,3 +21,4 @@ private protected override string CalculateDifferenceForFailureMessage(sbyte sub return difference != 0 ? difference.ToString(CultureInfo.InvariantCulture) : null; } } + diff --git a/Src/FluentAssertions/Numeric/SingleAssertions.cs b/Src/FluentAssertions/Numeric/SingleAssertions.cs index 2276b01334..10a18ca2ce 100644 --- a/Src/FluentAssertions/Numeric/SingleAssertions.cs +++ b/Src/FluentAssertions/Numeric/SingleAssertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; @@ -23,3 +23,4 @@ private protected override string CalculateDifferenceForFailureMessage(float sub return difference != 0 ? difference.ToString("R", CultureInfo.InvariantCulture) : null; } } + diff --git a/Src/FluentAssertions/Numeric/UInt16Assertions.cs b/Src/FluentAssertions/Numeric/UInt16Assertions.cs index c1672f1482..39791add6a 100644 --- a/Src/FluentAssertions/Numeric/UInt16Assertions.cs +++ b/Src/FluentAssertions/Numeric/UInt16Assertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/UInt32Assertions.cs b/Src/FluentAssertions/Numeric/UInt32Assertions.cs index 49bcaad48f..6579ffc493 100644 --- a/Src/FluentAssertions/Numeric/UInt32Assertions.cs +++ b/Src/FluentAssertions/Numeric/UInt32Assertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Numeric/UInt64Assertions.cs b/Src/FluentAssertions/Numeric/UInt64Assertions.cs index 3060a1c012..f94d214a57 100644 --- a/Src/FluentAssertions/Numeric/UInt64Assertions.cs +++ b/Src/FluentAssertions/Numeric/UInt64Assertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/NumericAssertionsExtensions.cs b/Src/FluentAssertions/NumericAssertionsExtensions.cs index 01e48fe96b..e52f282f88 100644 --- a/Src/FluentAssertions/NumericAssertionsExtensions.cs +++ b/Src/FluentAssertions/NumericAssertionsExtensions.cs @@ -1796,3 +1796,4 @@ private static long GetMaxValue(long value, ulong delta) return maxValue; } } + diff --git a/Src/FluentAssertions/ObjectAssertionsExtensions.cs b/Src/FluentAssertions/ObjectAssertionsExtensions.cs index 238cd317e2..bceadd6257 100644 --- a/Src/FluentAssertions/ObjectAssertionsExtensions.cs +++ b/Src/FluentAssertions/ObjectAssertionsExtensions.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics.CodeAnalysis; + using System.IO; using System.Runtime.Serialization; using System.Xml.Serialization; @@ -199,3 +200,4 @@ private static object CreateCloneUsingXmlSerializer(object subject) return serializer.Deserialize(stream); } } + diff --git a/Src/FluentAssertions/OccurrenceConstraint.cs b/Src/FluentAssertions/OccurrenceConstraint.cs index 347df0b750..cfde7aa192 100644 --- a/Src/FluentAssertions/OccurrenceConstraint.cs +++ b/Src/FluentAssertions/OccurrenceConstraint.cs @@ -1,8 +1,9 @@ -using System; +using System; using FluentAssertions.Common; namespace FluentAssertions; +[System.Diagnostics.StackTraceHidden] public abstract class OccurrenceConstraint { protected OccurrenceConstraint(int expectedCount) @@ -26,3 +27,4 @@ internal void RegisterContextData(Action register) register("expectedOccurrence", $"{Mode} {ExpectedCount.Times()}"); } } + diff --git a/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs b/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs index d2d901b678..f908b01e67 100644 --- a/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs +++ b/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs @@ -1,4 +1,4 @@ -#if NET47 || NETSTANDARD2_0 || NETSTANDARD2_1 +#if NET47 || NETSTANDARD2_0 || NETSTANDARD2_1 using System.Collections.Generic; diff --git a/Src/FluentAssertions/Polyfill/StringExtensions.cs b/Src/FluentAssertions/Polyfill/StringExtensions.cs index 100d7890f6..6f3948c6b3 100644 --- a/Src/FluentAssertions/Polyfill/StringExtensions.cs +++ b/Src/FluentAssertions/Polyfill/StringExtensions.cs @@ -1,4 +1,4 @@ -#if !NET6_0_OR_GREATER +#if !NET6_0_OR_GREATER using System; using System.Collections.Generic; diff --git a/Src/FluentAssertions/Polyfill/SystemExtensions.cs b/Src/FluentAssertions/Polyfill/SystemExtensions.cs index a725bd4f3c..0ac331a182 100644 --- a/Src/FluentAssertions/Polyfill/SystemExtensions.cs +++ b/Src/FluentAssertions/Polyfill/SystemExtensions.cs @@ -1,4 +1,4 @@ -#if NET47 || NETSTANDARD2_0 +#if NET47 || NETSTANDARD2_0 // ReSharper disable once CheckNamespace namespace System; diff --git a/Src/FluentAssertions/Primitives/BooleanAssertions.cs b/Src/FluentAssertions/Primitives/BooleanAssertions.cs index 45fa01878c..9ed804e6e7 100644 --- a/Src/FluentAssertions/Primitives/BooleanAssertions.cs +++ b/Src/FluentAssertions/Primitives/BooleanAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs b/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs index c5e57b5d73..ac36975f37 100644 --- a/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateOnlyAssertions.cs @@ -1,4 +1,4 @@ -#if NET6_0_OR_GREATER +#if NET6_0_OR_GREATER using System; using System.Collections.Generic; diff --git a/Src/FluentAssertions/Primitives/DateTimeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeAssertions.cs index b1f7ffa01a..8e359b9457 100644 --- a/Src/FluentAssertions/Primitives/DateTimeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs index ffe944f88c..2bb4429016 100644 --- a/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/Src/FluentAssertions/Primitives/DateTimeOffsetRangeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeOffsetRangeAssertions.cs index 964b73c9db..b75bdca8bf 100644 --- a/Src/FluentAssertions/Primitives/DateTimeOffsetRangeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeOffsetRangeAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; @@ -138,3 +138,4 @@ private static string PositionRelativeToTarget(DateTimeOffset actual, DateTimeOf public override bool Equals(object obj) => throw new NotSupportedException("Equals is not part of Fluent Assertions. Did you mean Before() or After() instead?"); } + diff --git a/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs index 6192cfa16b..79a3e98da5 100644 --- a/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; @@ -140,3 +140,4 @@ private static string PositionRelativeToTarget(DateTime actual, DateTime target) public override bool Equals(object obj) => throw new NotSupportedException("Equals is not part of Fluent Assertions. Did you mean Before() or After() instead?"); } + diff --git a/Src/FluentAssertions/Primitives/EnumAssertions.cs b/Src/FluentAssertions/Primitives/EnumAssertions.cs index b740b3c7d3..cc88b41652 100644 --- a/Src/FluentAssertions/Primitives/EnumAssertions.cs +++ b/Src/FluentAssertions/Primitives/EnumAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; @@ -460,3 +460,4 @@ private static string GetName(T @enum) public override bool Equals(object obj) => throw new NotSupportedException("Equals is not part of Fluent Assertions. Did you mean Be() instead?"); } + diff --git a/Src/FluentAssertions/Primitives/GuidAssertions.cs b/Src/FluentAssertions/Primitives/GuidAssertions.cs index d30fe808df..37faccdc71 100644 --- a/Src/FluentAssertions/Primitives/GuidAssertions.cs +++ b/Src/FluentAssertions/Primitives/GuidAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; diff --git a/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs b/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs index 6fc162b2f8..4cfdcbd70b 100644 --- a/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableBooleanAssertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; @@ -187,3 +187,4 @@ public AndConstraint NotBeTrue([StringSyntax("CompositeFormat")] st return new AndConstraint((TAssertions)this); } } + diff --git a/Src/FluentAssertions/Primitives/NullableDateOnlyAssertions.cs b/Src/FluentAssertions/Primitives/NullableDateOnlyAssertions.cs index ecdde62a34..41f0bdcf5a 100644 --- a/Src/FluentAssertions/Primitives/NullableDateOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableDateOnlyAssertions.cs @@ -106,3 +106,4 @@ public AndConstraint BeNull([StringSyntax("CompositeFormat")] strin } #endif + diff --git a/Src/FluentAssertions/Primitives/NullableDateTimeAssertions.cs b/Src/FluentAssertions/Primitives/NullableDateTimeAssertions.cs index d7b8f1bc13..d4a13f5c81 100644 --- a/Src/FluentAssertions/Primitives/NullableDateTimeAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableDateTimeAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; @@ -109,3 +109,4 @@ public AndConstraint BeNull([StringSyntax("CompositeFormat")] strin return NotHaveValue(because, becauseArgs); } } + diff --git a/Src/FluentAssertions/Primitives/NullableDateTimeOffsetAssertions.cs b/Src/FluentAssertions/Primitives/NullableDateTimeOffsetAssertions.cs index 3508fb2f36..fd61a04611 100644 --- a/Src/FluentAssertions/Primitives/NullableDateTimeOffsetAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableDateTimeOffsetAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; @@ -112,3 +112,4 @@ public AndConstraint BeNull([StringSyntax("CompositeFormat")] strin return NotHaveValue(because, becauseArgs); } } + diff --git a/Src/FluentAssertions/Primitives/NullableEnumAssertions.cs b/Src/FluentAssertions/Primitives/NullableEnumAssertions.cs index 7096c1ab53..f822f58b40 100644 --- a/Src/FluentAssertions/Primitives/NullableEnumAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableEnumAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; @@ -101,3 +101,4 @@ public AndConstraint BeNull([StringSyntax("CompositeFormat")] strin return NotHaveValue(because, becauseArgs); } } + diff --git a/Src/FluentAssertions/Primitives/NullableGuidAssertions.cs b/Src/FluentAssertions/Primitives/NullableGuidAssertions.cs index 1eea1e758b..e08a85eae9 100644 --- a/Src/FluentAssertions/Primitives/NullableGuidAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableGuidAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; @@ -123,3 +123,4 @@ public AndConstraint Be(Guid? expected, [StringSyntax("CompositeFor return new AndConstraint((TAssertions)this); } } + diff --git a/Src/FluentAssertions/Primitives/NullableSimpleTimeSpanAssertions.cs b/Src/FluentAssertions/Primitives/NullableSimpleTimeSpanAssertions.cs index 03ffb3d9bd..c27e8ec10b 100644 --- a/Src/FluentAssertions/Primitives/NullableSimpleTimeSpanAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableSimpleTimeSpanAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using FluentAssertions.Execution; @@ -132,3 +132,4 @@ public AndConstraint Be(TimeSpan? expected, return new AndConstraint((TAssertions)this); } } + diff --git a/Src/FluentAssertions/Primitives/NullableTimeOnlyAssertions.cs b/Src/FluentAssertions/Primitives/NullableTimeOnlyAssertions.cs index 8e6ede5140..0aee3613a2 100644 --- a/Src/FluentAssertions/Primitives/NullableTimeOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableTimeOnlyAssertions.cs @@ -106,3 +106,4 @@ public AndConstraint BeNull([StringSyntax("CompositeFormat")] strin } #endif + diff --git a/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs b/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs index 8441b5e06c..3d974edade 100644 --- a/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs +++ b/Src/FluentAssertions/Primitives/SimpleTimeSpanAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using FluentAssertions.Common; @@ -302,3 +302,4 @@ public AndConstraint NotBeCloseTo(TimeSpan distantTime, TimeSpan pr public override bool Equals(object obj) => throw new NotSupportedException("Equals is not part of Fluent Assertions. Did you mean Be() instead?"); } + diff --git a/Src/FluentAssertions/Primitives/StringAssertions.cs b/Src/FluentAssertions/Primitives/StringAssertions.cs index 06e0cb2ffc..36c59d0644 100644 --- a/Src/FluentAssertions/Primitives/StringAssertions.cs +++ b/Src/FluentAssertions/Primitives/StringAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/Src/FluentAssertions/Primitives/StringContainsStrategy.cs b/Src/FluentAssertions/Primitives/StringContainsStrategy.cs index 6411133327..c9672aae40 100644 --- a/Src/FluentAssertions/Primitives/StringContainsStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringContainsStrategy.cs @@ -1,9 +1,11 @@ using System.Collections.Generic; + using FluentAssertions.Common; using FluentAssertions.Execution; namespace FluentAssertions.Primitives; +[System.Diagnostics.StackTraceHidden] internal class StringContainsStrategy : IStringComparisonStrategy { private readonly IEqualityComparer comparer; @@ -34,3 +36,4 @@ public void AssertNeitherIsNull(AssertionChain assertionChain, string subject, s } } } + diff --git a/Src/FluentAssertions/Primitives/StringEndStrategy.cs b/Src/FluentAssertions/Primitives/StringEndStrategy.cs index 3a2d0044e0..bab06cbcdf 100644 --- a/Src/FluentAssertions/Primitives/StringEndStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringEndStrategy.cs @@ -1,9 +1,11 @@ using System.Collections.Generic; + using FluentAssertions.Common; using FluentAssertions.Execution; namespace FluentAssertions.Primitives; +[System.Diagnostics.StackTraceHidden] internal class StringEndStrategy : IStringComparisonStrategy { private readonly IEqualityComparer comparer; @@ -49,3 +51,4 @@ public void AssertNeitherIsNull(AssertionChain assertionChain, string subject, s private string ExpectationDescription => $"Expected {{context:string}} to {predicateDescription} {{0}}{{reason}}"; } + diff --git a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs index 387ad7d9b5..00975db75b 100644 --- a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs @@ -8,6 +8,7 @@ namespace FluentAssertions.Primitives; +[System.Diagnostics.StackTraceHidden] internal class StringEqualityStrategy : IStringComparisonStrategy { private readonly IEqualityComparer comparer; diff --git a/Src/FluentAssertions/Primitives/StringStartStrategy.cs b/Src/FluentAssertions/Primitives/StringStartStrategy.cs index 4738d90355..2d225e11d8 100644 --- a/Src/FluentAssertions/Primitives/StringStartStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringStartStrategy.cs @@ -1,9 +1,11 @@ using System.Collections.Generic; + using FluentAssertions.Common; using FluentAssertions.Execution; namespace FluentAssertions.Primitives; +[System.Diagnostics.StackTraceHidden] internal class StringStartStrategy : IStringComparisonStrategy { private readonly IEqualityComparer comparer; @@ -49,3 +51,4 @@ public void AssertNeitherIsNull(AssertionChain assertionChain, string subject, s private string ExpectationDescription => $"Expected {{context:string}} to {predicateDescription} "; } + diff --git a/Src/FluentAssertions/Primitives/StringValidator.cs b/Src/FluentAssertions/Primitives/StringValidator.cs index c98ff29fda..401cf711c5 100644 --- a/Src/FluentAssertions/Primitives/StringValidator.cs +++ b/Src/FluentAssertions/Primitives/StringValidator.cs @@ -3,6 +3,7 @@ namespace FluentAssertions.Primitives; +[System.Diagnostics.StackTraceHidden] internal class StringValidator { private readonly IStringComparisonStrategy comparisonStrategy; diff --git a/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs b/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs index cabd1a6e37..849c0faeff 100644 --- a/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs +++ b/Src/FluentAssertions/Primitives/StringValidatorSupportingNull.cs @@ -4,6 +4,7 @@ namespace FluentAssertions.Primitives; +[System.Diagnostics.StackTraceHidden] internal class StringValidatorSupportingNull { private readonly IStringComparisonStrategy comparisonStrategy; @@ -27,3 +28,4 @@ public void Validate(string subject, string expected) comparisonStrategy.AssertForEquality(assertionChain, subject, expected); } } + diff --git a/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs b/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs index af35e3de3c..33ddcccdf4 100644 --- a/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringWildcardMatchingStrategy.cs @@ -6,6 +6,7 @@ namespace FluentAssertions.Primitives; +[System.Diagnostics.StackTraceHidden] internal class StringWildcardMatchingStrategy : IStringComparisonStrategy { public void AssertForEquality(AssertionChain assertionChain, string subject, string expected) @@ -39,7 +40,7 @@ public void AssertForEquality(AssertionChain assertionChain, string subject, str else { assertionChain.FailWith($"{ExpectationDescription} {{0}}{{reason}}, but {{1}} {OutcomeDescription}.", expected, - subject); + subject); } } @@ -67,10 +68,10 @@ private bool IsMatch(string subject, string expected) private static string ConvertWildcardToRegEx(string wildcardExpression) { return "^" - + Regex.Escape(wildcardExpression) - .Replace("\\*", ".*", StringComparison.Ordinal) - .Replace("\\?", ".", StringComparison.Ordinal) - + "$"; + + Regex.Escape(wildcardExpression) + .Replace("\\*", ".*", StringComparison.Ordinal) + .Replace("\\?", ".", StringComparison.Ordinal) + + "$"; } private static bool IsLongOrMultiline(string message) diff --git a/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs b/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs index ed92a9c0cb..1796a06c0f 100644 --- a/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs +++ b/Src/FluentAssertions/Primitives/TimeOnlyAssertions.cs @@ -1,4 +1,4 @@ -#if NET6_0_OR_GREATER +#if NET6_0_OR_GREATER using System; using System.Collections.Generic; diff --git a/Src/FluentAssertions/Primitives/TimeSpanPredicate.cs b/Src/FluentAssertions/Primitives/TimeSpanPredicate.cs index 9f8e68982c..9d60df5fc0 100644 --- a/Src/FluentAssertions/Primitives/TimeSpanPredicate.cs +++ b/Src/FluentAssertions/Primitives/TimeSpanPredicate.cs @@ -5,6 +5,7 @@ namespace FluentAssertions.Primitives; /// /// Provides the logic and the display text for a . /// +[System.Diagnostics.StackTraceHidden] internal class TimeSpanPredicate { private readonly Func lambda; @@ -22,3 +23,4 @@ public bool IsMatchedBy(TimeSpan actual, TimeSpan expected) return lambda(actual, expected) && actual >= TimeSpan.Zero; } } + diff --git a/Src/FluentAssertions/Specialized/ActionAssertions.cs b/Src/FluentAssertions/Specialized/ActionAssertions.cs index 94be29f8c4..0bf9c980b3 100644 --- a/Src/FluentAssertions/Specialized/ActionAssertions.cs +++ b/Src/FluentAssertions/Specialized/ActionAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using FluentAssertions.Common; diff --git a/Src/FluentAssertions/Specialized/DelegateAssertions.cs b/Src/FluentAssertions/Specialized/DelegateAssertions.cs index b0586629b8..f5cdf3342f 100644 --- a/Src/FluentAssertions/Specialized/DelegateAssertions.cs +++ b/Src/FluentAssertions/Specialized/DelegateAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Reflection; diff --git a/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs b/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs index 8a79abd9af..b405cf6869 100644 --- a/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs +++ b/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs index 3ab2fe9a0d..4589f6e430 100644 --- a/Src/FluentAssertions/Specialized/ExceptionAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExceptionAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/Src/FluentAssertions/Specialized/ExecutionTime.cs b/Src/FluentAssertions/Specialized/ExecutionTime.cs index e3249e242b..608b236df6 100644 --- a/Src/FluentAssertions/Specialized/ExecutionTime.cs +++ b/Src/FluentAssertions/Specialized/ExecutionTime.cs @@ -1,9 +1,11 @@ -using System; +using System; + using System.Threading.Tasks; using FluentAssertions.Common; namespace FluentAssertions.Specialized; +[System.Diagnostics.StackTraceHidden] public class ExecutionTime { private ITimer timer; @@ -114,3 +116,4 @@ protected ExecutionTime(Func action, string actionDescription, StartTimer internal Exception Exception { get; private set; } } + diff --git a/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs b/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs index 327fba2433..8b429e026a 100644 --- a/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs +++ b/Src/FluentAssertions/Specialized/ExecutionTimeAssertions.cs @@ -1,4 +1,5 @@ -using System; +using System; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using FluentAssertions.Common; using FluentAssertions.Execution; @@ -10,6 +11,7 @@ namespace FluentAssertions.Specialized; /// /// Provides methods for asserting that the execution time of an satisfies certain conditions. /// +[DebuggerNonUserCode] public class ExecutionTimeAssertions { private readonly ExecutionTime execution; diff --git a/Src/FluentAssertions/Specialized/FunctionAssertions.cs b/Src/FluentAssertions/Specialized/FunctionAssertions.cs index 4a093c1444..3d9f725022 100644 --- a/Src/FluentAssertions/Specialized/FunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/FunctionAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using FluentAssertions.Common; diff --git a/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs index f5860af3ad..49cf1b4b00 100644 --- a/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -11,6 +12,7 @@ namespace FluentAssertions.Specialized; /// Contains a number of methods to assert that an asynchronous method yields the expected result. /// /// The type returned in the . +[DebuggerNonUserCode] public class GenericAsyncFunctionAssertions : AsyncFunctionAssertions, GenericAsyncFunctionAssertions> { diff --git a/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs b/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs index 48f76b4aa7..8ede596fdf 100644 --- a/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs +++ b/Src/FluentAssertions/Specialized/JsonNodeAssertions.cs @@ -524,3 +524,4 @@ public AndConstraint> NotBeEquivalentTo( } #endif + diff --git a/Src/FluentAssertions/Specialized/JsonValueExtensions.cs b/Src/FluentAssertions/Specialized/JsonValueExtensions.cs index 551c55fba7..6e7ed2ad40 100644 --- a/Src/FluentAssertions/Specialized/JsonValueExtensions.cs +++ b/Src/FluentAssertions/Specialized/JsonValueExtensions.cs @@ -5,6 +5,7 @@ namespace FluentAssertions.Specialized; +[System.Diagnostics.StackTraceHidden] internal static class JsonValueExtensions { public static bool IsNumeric(this JsonValue value) @@ -14,3 +15,4 @@ public static bool IsNumeric(this JsonValue value) } #endif + diff --git a/Src/FluentAssertions/Specialized/MemberExecutionTime.cs b/Src/FluentAssertions/Specialized/MemberExecutionTime.cs index 995d18a7c8..4429676f01 100644 --- a/Src/FluentAssertions/Specialized/MemberExecutionTime.cs +++ b/Src/FluentAssertions/Specialized/MemberExecutionTime.cs @@ -1,9 +1,11 @@ -using System; +using System; + using System.Linq.Expressions; using FluentAssertions.Common; namespace FluentAssertions.Specialized; +[System.Diagnostics.StackTraceHidden] public class MemberExecutionTime : ExecutionTime { /// @@ -18,3 +20,4 @@ public MemberExecutionTime(T subject, Expression> action, StartTimer c { } } + diff --git a/Src/FluentAssertions/Specialized/NonGenericAsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/NonGenericAsyncFunctionAssertions.cs index f68a8dac85..0af9a329c4 100644 --- a/Src/FluentAssertions/Specialized/NonGenericAsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/NonGenericAsyncFunctionAssertions.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -10,6 +11,7 @@ namespace FluentAssertions.Specialized; /// /// Contains a number of methods to assert that an asynchronous method yields the expected result. /// +[DebuggerNonUserCode] public class NonGenericAsyncFunctionAssertions : AsyncFunctionAssertions { private readonly AssertionChain assertionChain; diff --git a/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs b/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs index 0081053767..d08039e479 100644 --- a/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs +++ b/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertions.cs @@ -1,4 +1,5 @@ -using System; +using System; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; using FluentAssertions.Common; @@ -10,6 +11,7 @@ namespace FluentAssertions.Specialized; #pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals #if NET6_0_OR_GREATER +[DebuggerNonUserCode] public class TaskCompletionSourceAssertions : TaskCompletionSourceAssertionsBase { private readonly AssertionChain assertionChain; @@ -90,8 +92,10 @@ public async Task> NotCompleteWith return new AndConstraint(this); } } + #endif +[DebuggerNonUserCode] public class TaskCompletionSourceAssertions : TaskCompletionSourceAssertionsBase { private readonly AssertionChain assertionChain; diff --git a/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertionsBase.cs b/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertionsBase.cs index e1e69ea94a..aabeacef65 100644 --- a/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertionsBase.cs +++ b/Src/FluentAssertions/Specialized/TaskCompletionSourceAssertionsBase.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -10,6 +11,7 @@ namespace FluentAssertions.Specialized; /// /// Implements base functionality for assertions on TaskCompletionSource. /// +[DebuggerNonUserCode] public class TaskCompletionSourceAssertionsBase { protected TaskCompletionSourceAssertionsBase(IClock clock) diff --git a/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs b/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs index 1073684a4c..bf2ec1c8f5 100644 --- a/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs +++ b/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs @@ -1,9 +1,9 @@ -using System.Diagnostics; -using System.IO; -using FluentAssertions.Execution; -#if NET6_0_OR_GREATER || NETSTANDARD2_1 +using System.Diagnostics; +#if NETSTANDARD2_1 || NETCOREAPP2_1_OR_GREATER using System.Diagnostics.CodeAnalysis; #endif +using System.IO; +using FluentAssertions.Execution; namespace FluentAssertions.Streams; @@ -105,3 +105,4 @@ public BufferedStreamAssertions(BufferedStream stream, AssertionChain assertionC protected override string Identifier => "buffered stream"; } + diff --git a/Src/FluentAssertions/Streams/StreamAssertions.cs b/Src/FluentAssertions/Streams/StreamAssertions.cs index 3116721541..83459ebe24 100644 --- a/Src/FluentAssertions/Streams/StreamAssertions.cs +++ b/Src/FluentAssertions/Streams/StreamAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; @@ -22,6 +22,7 @@ public StreamAssertions(Stream stream, AssertionChain assertionChain) /// /// Contains a number of methods to assert that a is in the expected state. /// +[DebuggerNonUserCode] public class StreamAssertions : ReferenceTypeAssertions where TSubject : Stream where TAssertions : StreamAssertions @@ -516,3 +517,4 @@ public AndConstraint NotBeWriteOnly([StringSyntax("CompositeFormat" return new AndConstraint((TAssertions)this); } } + diff --git a/Src/FluentAssertions/TypeEnumerableExtensions.cs b/Src/FluentAssertions/TypeEnumerableExtensions.cs index 444fc1eea3..8e096c01c5 100644 --- a/Src/FluentAssertions/TypeEnumerableExtensions.cs +++ b/Src/FluentAssertions/TypeEnumerableExtensions.cs @@ -134,3 +134,4 @@ public static IEnumerable UnwrapEnumerableTypes(this IEnumerable typ return new TypeSelector(types).UnwrapEnumerableTypes(); } } + diff --git a/Src/FluentAssertions/TypeExtensions.cs b/Src/FluentAssertions/TypeExtensions.cs index f08db1bf69..8f8e9415e0 100644 --- a/Src/FluentAssertions/TypeExtensions.cs +++ b/Src/FluentAssertions/TypeExtensions.cs @@ -78,3 +78,4 @@ public static PropertyInfoSelector Properties(this TypeSelector typeSelector) return new PropertyInfoSelector(typeSelector.ToList()); } } + diff --git a/Src/FluentAssertions/Types/AllTypes.cs b/Src/FluentAssertions/Types/AllTypes.cs index 54a4778131..8bc235fcbb 100644 --- a/Src/FluentAssertions/Types/AllTypes.cs +++ b/Src/FluentAssertions/Types/AllTypes.cs @@ -11,6 +11,7 @@ namespace FluentAssertions.Types; /// .Should()
/// .BeDecoratedWith<SomeAttribute>() /// +[System.Diagnostics.StackTraceHidden] public static class AllTypes { /// @@ -23,3 +24,4 @@ public static TypeSelector From(Assembly assembly) return assembly.Types(); } } + diff --git a/Src/FluentAssertions/Types/AssemblyAssertions.cs b/Src/FluentAssertions/Types/AssemblyAssertions.cs index f0ba014e31..7833377c6c 100644 --- a/Src/FluentAssertions/Types/AssemblyAssertions.cs +++ b/Src/FluentAssertions/Types/AssemblyAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; @@ -224,3 +224,4 @@ private static string ToHexString(byte[] bytes) => /// protected override string Identifier => "assembly"; } + diff --git a/Src/FluentAssertions/Types/ConstructorInfoAssertions.cs b/Src/FluentAssertions/Types/ConstructorInfoAssertions.cs index c65c9d8cfd..48399acf80 100644 --- a/Src/FluentAssertions/Types/ConstructorInfoAssertions.cs +++ b/Src/FluentAssertions/Types/ConstructorInfoAssertions.cs @@ -28,3 +28,4 @@ private static string GetDescriptionFor(ConstructorInfo constructorInfo) return $"{constructorInfo.DeclaringType}({GetParameterString(constructorInfo)})"; } } + diff --git a/Src/FluentAssertions/Types/MemberInfoAssertions.cs b/Src/FluentAssertions/Types/MemberInfoAssertions.cs index 3e214fd28c..2082e9218a 100644 --- a/Src/FluentAssertions/Types/MemberInfoAssertions.cs +++ b/Src/FluentAssertions/Types/MemberInfoAssertions.cs @@ -155,3 +155,4 @@ public AndConstraint NotBeDecoratedWith( private protected virtual string SubjectDescription => $"{Subject.DeclaringType}.{Subject.Name}"; } + diff --git a/Src/FluentAssertions/Types/MethodBaseAssertions.cs b/Src/FluentAssertions/Types/MethodBaseAssertions.cs index 042c34b27e..503c53d604 100644 --- a/Src/FluentAssertions/Types/MethodBaseAssertions.cs +++ b/Src/FluentAssertions/Types/MethodBaseAssertions.cs @@ -120,3 +120,4 @@ internal static string GetParameterString(MethodBase methodBase) return string.Join(", ", parameterTypes.Select(p => p.FullName)); } } + diff --git a/Src/FluentAssertions/Types/MethodInfoAssertions.cs b/Src/FluentAssertions/Types/MethodInfoAssertions.cs index cfd799d9d5..81700e966e 100644 --- a/Src/FluentAssertions/Types/MethodInfoAssertions.cs +++ b/Src/FluentAssertions/Types/MethodInfoAssertions.cs @@ -311,3 +311,4 @@ internal static string GetDescriptionFor(MethodInfo method) protected override string Identifier => "method"; } + diff --git a/Src/FluentAssertions/Types/MethodInfoSelector.cs b/Src/FluentAssertions/Types/MethodInfoSelector.cs index 511309ae7a..1ae9926f3c 100644 --- a/Src/FluentAssertions/Types/MethodInfoSelector.cs +++ b/Src/FluentAssertions/Types/MethodInfoSelector.cs @@ -11,6 +11,7 @@ namespace FluentAssertions.Types; /// /// Allows for fluent selection of methods of a type through reflection. /// +[System.Diagnostics.StackTraceHidden] public class MethodInfoSelector : IEnumerable { private IEnumerable selectedMethods; @@ -256,3 +257,4 @@ IEnumerator IEnumerable.GetEnumerator() return GetEnumerator(); } } + diff --git a/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs b/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs index 71b3c51213..c18cf46840 100644 --- a/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs +++ b/Src/FluentAssertions/Types/MethodInfoSelectorAssertions.cs @@ -348,3 +348,4 @@ private static string GetDescriptionsFor(IEnumerable methods) public override bool Equals(object obj) => throw new NotSupportedException("Equals is not part of Fluent Assertions. Did you mean Be() instead?"); } + diff --git a/Src/FluentAssertions/Types/PropertyInfoAssertions.cs b/Src/FluentAssertions/Types/PropertyInfoAssertions.cs index 85ada02e77..023da0ac5d 100644 --- a/Src/FluentAssertions/Types/PropertyInfoAssertions.cs +++ b/Src/FluentAssertions/Types/PropertyInfoAssertions.cs @@ -397,3 +397,4 @@ public AndConstraint NotReturn([StringSyntax("C ///
protected override string Identifier => "property"; } + diff --git a/Src/FluentAssertions/Types/PropertyInfoSelector.cs b/Src/FluentAssertions/Types/PropertyInfoSelector.cs index db860f3879..9eab951ccf 100644 --- a/Src/FluentAssertions/Types/PropertyInfoSelector.cs +++ b/Src/FluentAssertions/Types/PropertyInfoSelector.cs @@ -10,6 +10,7 @@ namespace FluentAssertions.Types; /// /// Allows for fluent selection of properties of a type through reflection. /// +[System.Diagnostics.StackTraceHidden] public class PropertyInfoSelector : IEnumerable { private IEnumerable selectedProperties; @@ -228,3 +229,4 @@ IEnumerator IEnumerable.GetEnumerator() return GetEnumerator(); } } + diff --git a/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs b/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs index 4aca174681..75ad12367b 100644 --- a/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs +++ b/Src/FluentAssertions/Types/PropertyInfoSelectorAssertions.cs @@ -238,3 +238,4 @@ private static string GetDescriptionsFor(IEnumerable properties) public override bool Equals(object obj) => throw new NotSupportedException("Equals is not part of Fluent Assertions. Did you mean Be() instead?"); } + diff --git a/Src/FluentAssertions/Types/TypeAssertions.cs b/Src/FluentAssertions/Types/TypeAssertions.cs index 3fc3d8fdac..cb8f141e05 100644 --- a/Src/FluentAssertions/Types/TypeAssertions.cs +++ b/Src/FluentAssertions/Types/TypeAssertions.cs @@ -1916,3 +1916,4 @@ private void AssertThatSubjectIsClass() } } } + diff --git a/Src/FluentAssertions/Types/TypeSelector.cs b/Src/FluentAssertions/Types/TypeSelector.cs index e6d46458d9..792d9c21e4 100644 --- a/Src/FluentAssertions/Types/TypeSelector.cs +++ b/Src/FluentAssertions/Types/TypeSelector.cs @@ -10,6 +10,7 @@ namespace FluentAssertions.Types; /// /// Allows for fluent filtering a list of types. /// +[System.Diagnostics.StackTraceHidden] public class TypeSelector : IEnumerable { private List types; @@ -368,3 +369,4 @@ IEnumerator IEnumerable.GetEnumerator() return GetEnumerator(); } } + diff --git a/Src/FluentAssertions/Types/TypeSelectorAssertions.cs b/Src/FluentAssertions/Types/TypeSelectorAssertions.cs index 41711ae15f..76b42fb34e 100644 --- a/Src/FluentAssertions/Types/TypeSelectorAssertions.cs +++ b/Src/FluentAssertions/Types/TypeSelectorAssertions.cs @@ -489,3 +489,4 @@ public override bool Equals(object obj) => throw new NotSupportedException( "Equals is not part of Fluent Assertions. Did you mean BeInNamespace() or BeDecoratedWith() instead?"); } + diff --git a/Src/FluentAssertions/Value.cs b/Src/FluentAssertions/Value.cs index a07827ceff..ee938df6c9 100644 --- a/Src/FluentAssertions/Value.cs +++ b/Src/FluentAssertions/Value.cs @@ -8,6 +8,7 @@ namespace FluentAssertions; /// /// Provides a fluent API for defining inline assertions. /// +[System.Diagnostics.StackTraceHidden] public static class Value { /// @@ -34,3 +35,4 @@ public static IInlineEquivalencyAssertion ThatSatisfies(Action assertion) return new ActionBasedInlineAssertion(assertion); } } + diff --git a/Src/FluentAssertions/Xml/Equivalency/AttributeData.cs b/Src/FluentAssertions/Xml/Equivalency/AttributeData.cs index 57fb715f6f..2bc866f783 100644 --- a/Src/FluentAssertions/Xml/Equivalency/AttributeData.cs +++ b/Src/FluentAssertions/Xml/Equivalency/AttributeData.cs @@ -1,5 +1,6 @@ namespace FluentAssertions.Xml.Equivalency; +[System.Diagnostics.StackTraceHidden] internal class AttributeData { public AttributeData(string namespaceUri, string localName, string value, string prefix) diff --git a/Src/FluentAssertions/Xml/Equivalency/Failure.cs b/Src/FluentAssertions/Xml/Equivalency/Failure.cs index 8468497957..e21b371161 100644 --- a/Src/FluentAssertions/Xml/Equivalency/Failure.cs +++ b/Src/FluentAssertions/Xml/Equivalency/Failure.cs @@ -1,5 +1,6 @@ namespace FluentAssertions.Xml.Equivalency; +[System.Diagnostics.StackTraceHidden] internal class Failure { public Failure(string formatString, params object[] formatParams) diff --git a/Src/FluentAssertions/Xml/Equivalency/Node.cs b/Src/FluentAssertions/Xml/Equivalency/Node.cs index 8e19a40132..3a83ccf03f 100644 --- a/Src/FluentAssertions/Xml/Equivalency/Node.cs +++ b/Src/FluentAssertions/Xml/Equivalency/Node.cs @@ -5,6 +5,7 @@ namespace FluentAssertions.Xml.Equivalency; +[System.Diagnostics.StackTraceHidden] internal sealed class Node { private readonly List children = []; @@ -78,3 +79,4 @@ private Node AddChildNode(string name) return node; } } + diff --git a/Src/FluentAssertions/Xml/Equivalency/XmlIterator.cs b/Src/FluentAssertions/Xml/Equivalency/XmlIterator.cs index 72f665b136..d90544ccba 100644 --- a/Src/FluentAssertions/Xml/Equivalency/XmlIterator.cs +++ b/Src/FluentAssertions/Xml/Equivalency/XmlIterator.cs @@ -3,6 +3,7 @@ namespace FluentAssertions.Xml.Equivalency; +[System.Diagnostics.StackTraceHidden] internal class XmlIterator { private readonly XmlReader reader; @@ -76,3 +77,4 @@ public IList GetAttributes() return attributes; } } + diff --git a/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs b/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs index 79290986d4..7a973fa867 100644 --- a/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs +++ b/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; @@ -7,6 +7,7 @@ namespace FluentAssertions.Xml.Equivalency; +[System.Diagnostics.StackTraceHidden] internal class XmlReaderValidator { private readonly AssertionChain assertionChain; diff --git a/Src/FluentAssertions/Xml/XAttributeAssertions.cs b/Src/FluentAssertions/Xml/XAttributeAssertions.cs index 5c63862d5c..15531a9fc4 100644 --- a/Src/FluentAssertions/Xml/XAttributeAssertions.cs +++ b/Src/FluentAssertions/Xml/XAttributeAssertions.cs @@ -104,3 +104,4 @@ public AndConstraint HaveValue(string expected, /// protected override string Identifier => "XML attribute"; } + diff --git a/Src/FluentAssertions/Xml/XDocumentAssertions.cs b/Src/FluentAssertions/Xml/XDocumentAssertions.cs index 235a997d5e..9bc7de6893 100644 --- a/Src/FluentAssertions/Xml/XDocumentAssertions.cs +++ b/Src/FluentAssertions/Xml/XDocumentAssertions.cs @@ -543,3 +543,4 @@ public AndConstraint NotHaveElementWithValue(XName unexpect ///
protected override string Identifier => "XML document"; } + diff --git a/Src/FluentAssertions/Xml/XElementAssertions.cs b/Src/FluentAssertions/Xml/XElementAssertions.cs index 659e398d98..9b7baf9c2a 100644 --- a/Src/FluentAssertions/Xml/XElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XElementAssertions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; @@ -762,3 +762,4 @@ public AndConstraint NotHaveElementWithValue(XName unexpecte ///
protected override string Identifier => "XML element"; } + diff --git a/Src/FluentAssertions/Xml/XmlElementAssertions.cs b/Src/FluentAssertions/Xml/XmlElementAssertions.cs index daeffcd3fd..7fcf904de2 100644 --- a/Src/FluentAssertions/Xml/XmlElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XmlElementAssertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Xml; using FluentAssertions.Common; @@ -172,3 +172,4 @@ public AndWhichConstraint HaveElementWithNames protected override string Identifier => "XML element"; } + diff --git a/Src/FluentAssertions/Xml/XmlNodeAssertions.cs b/Src/FluentAssertions/Xml/XmlNodeAssertions.cs index f903b7ec0a..0a210a4148 100644 --- a/Src/FluentAssertions/Xml/XmlNodeAssertions.cs +++ b/Src/FluentAssertions/Xml/XmlNodeAssertions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Xml; using FluentAssertions.Execution; @@ -89,3 +89,4 @@ public AndConstraint NotBeEquivalentTo(XmlNode unexpected, ///
protected override string Identifier => "XML node"; } + diff --git a/Src/FluentAssertions/Xml/XmlNodeFormatter.cs b/Src/FluentAssertions/Xml/XmlNodeFormatter.cs index b416fc12a3..c9cb146506 100644 --- a/Src/FluentAssertions/Xml/XmlNodeFormatter.cs +++ b/Src/FluentAssertions/Xml/XmlNodeFormatter.cs @@ -1,9 +1,10 @@ -using System.Xml; +using System.Xml; using FluentAssertions.Common; using FluentAssertions.Formatting; namespace FluentAssertions.Xml; +[System.Diagnostics.StackTraceHidden] public class XmlNodeFormatter : IValueFormatter { public bool CanHandle(object value) @@ -25,3 +26,4 @@ public void Format(object value, FormattedObjectGraph formattedGraph, Formatting formattedGraph.AddLine(outerXml.EscapePlaceholders()); } } + diff --git a/Src/FluentAssertions/XmlAssertionExtensions.cs b/Src/FluentAssertions/XmlAssertionExtensions.cs index 79da764778..4eea8cea6a 100644 --- a/Src/FluentAssertions/XmlAssertionExtensions.cs +++ b/Src/FluentAssertions/XmlAssertionExtensions.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Xml; using FluentAssertions.Execution; @@ -19,3 +19,4 @@ public static XmlElementAssertions Should([NotNull] this XmlElement actualValue) return new XmlElementAssertions(actualValue, AssertionChain.GetOrCreate()); } } + diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 4402ee7a4a..0dcf8a2edd 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -4,17 +4,20 @@ [assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"FluentAssertions.Specs, PublicKey=00240000048000009400000006020000002400005253413100040000010001002d25ff515c85b13ba08f61d466cff5d80a7f28ba197bbf8796085213e7a3406f970d2a4874932fed35db546e89af2da88c194bf1b7f7ac70de7988c78406f7629c547283061282a825616eb7eb48a9514a7570942936020a9bb37dca9ff60b778309900851575614491c6d25018fadb75828f4c7a17bf2d7dc86e7b6eafc5d8f")] namespace FluentAssertions { + [System.Diagnostics.StackTraceHidden] public class AggregateExceptionExtractor : FluentAssertions.Specialized.IExtractExceptions { public AggregateExceptionExtractor() { } public System.Collections.Generic.IEnumerable OfType(System.Exception actualException) where T : System.Exception { } } + [System.Diagnostics.StackTraceHidden] public class AndConstraint { public AndConstraint(TParent parent) { } public TParent And { get; } } + [System.Diagnostics.StackTraceHidden] public class AndWhichConstraint : FluentAssertions.AndConstraint { public AndWhichConstraint(TParent parent, System.Collections.Generic.IEnumerable subjects) { } @@ -25,10 +28,12 @@ namespace FluentAssertions public TSubject Subject { get; } public TSubject Which { get; } } + [System.Diagnostics.StackTraceHidden] public static class AssertionConfiguration { public static FluentAssertions.Configuration.GlobalConfiguration Current { get; } } + [System.Diagnostics.StackTraceHidden] public static class AssertionEngine { public static FluentAssertions.Configuration.GlobalConfiguration Configuration { get; } @@ -188,6 +193,7 @@ namespace FluentAssertions public static System.Threading.Tasks.Task, T>> WithResult(this System.Threading.Tasks.Task, T>> task, T expected, string because = "", params object[] becauseArgs) { } public static System.Threading.Tasks.Task, T>> WithResult(this System.Threading.Tasks.Task, T>> task, T expected, string because = "", params object[] becauseArgs) { } } + [System.Diagnostics.StackTraceHidden] public static class AtLeast { public static FluentAssertions.OccurrenceConstraint Once() { } @@ -195,6 +201,7 @@ namespace FluentAssertions public static FluentAssertions.OccurrenceConstraint Times(int expected) { } public static FluentAssertions.OccurrenceConstraint Twice() { } } + [System.Diagnostics.StackTraceHidden] public static class AtMost { public static FluentAssertions.OccurrenceConstraint Once() { } @@ -202,6 +209,7 @@ namespace FluentAssertions public static FluentAssertions.OccurrenceConstraint Times(int expected) { } public static FluentAssertions.OccurrenceConstraint Twice() { } } + [System.Diagnostics.StackTraceHidden] public static class CallerIdentifier { public static System.Action Logger { get; set; } @@ -209,11 +217,13 @@ namespace FluentAssertions public static string DetermineCallerIdentity() { } } [System.AttributeUsage(System.AttributeTargets.Method)] + [System.Diagnostics.StackTraceHidden] public class CustomAssertionAttribute : System.Attribute { public CustomAssertionAttribute() { } } [System.AttributeUsage(System.AttributeTargets.Assembly)] + [System.Diagnostics.StackTraceHidden] public sealed class CustomAssertionsAssemblyAttribute : System.Attribute { public CustomAssertionsAssemblyAttribute() { } @@ -231,6 +241,7 @@ namespace FluentAssertions public static FluentAssertions.Events.IEventRecording WithArgs(this FluentAssertions.Events.IEventRecording eventRecording, params System.Linq.Expressions.Expression>[] predicates) { } public static FluentAssertions.Events.IEventRecording WithSender(this FluentAssertions.Events.IEventRecording eventRecording, object expectedSender) { } } + [System.Diagnostics.StackTraceHidden] public static class Exactly { public static FluentAssertions.OccurrenceConstraint Once() { } @@ -261,6 +272,7 @@ namespace FluentAssertions public static System.Threading.Tasks.Task> WithoutMessage(this System.Threading.Tasks.Task> task, string wildcardPattern, string because = "", params object[] becauseArgs) where TException : System.Exception { } } + [System.Diagnostics.StackTraceHidden] public static class FluentActions { public static System.Func Awaiting(System.Func action) { } @@ -276,16 +288,19 @@ namespace FluentAssertions public static FluentAssertions.Specialized.JsonNodeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this T jsonNode) where T : System.Text.Json.Nodes.JsonNode { } } + [System.Diagnostics.StackTraceHidden] public static class LessThan { public static FluentAssertions.OccurrenceConstraint Thrice() { } public static FluentAssertions.OccurrenceConstraint Times(int expected) { } public static FluentAssertions.OccurrenceConstraint Twice() { } } + [System.Diagnostics.StackTraceHidden] public static class License { public static bool Accepted { get; set; } } + [System.Diagnostics.StackTraceHidden] public static class MoreThan { public static FluentAssertions.OccurrenceConstraint Once() { } @@ -347,6 +362,7 @@ namespace FluentAssertions public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } public static FluentAssertions.AndConstraint BeXmlSerializable(this FluentAssertions.Primitives.ObjectAssertions assertions, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> options, string because = "", params object[] becauseArgs) { } } + [System.Diagnostics.StackTraceHidden] public abstract class OccurrenceConstraint { protected OccurrenceConstraint(int expectedCount) { } @@ -383,6 +399,7 @@ namespace FluentAssertions public static FluentAssertions.Types.TypeSelector Types(this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.TypeSelector Types(this System.Type type) { } } + [System.Diagnostics.StackTraceHidden] public static class Value { public static FluentAssertions.Equivalency.Inlining.IInlineEquivalencyAssertion ThatMatches(System.Linq.Expressions.Expression> condition) { } @@ -581,6 +598,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint> ThenBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ThenBeInDescendingOrder(System.Linq.Expressions.Expression> propertyExpression, System.Collections.Generic.IComparer comparer, string because = "", params object[] becauseArgs) { } } + [System.Diagnostics.StackTraceHidden] public class WhoseValueConstraint : FluentAssertions.AndConstraint where TCollection : System.Collections.Generic.IEnumerable> where TAssertions : FluentAssertions.Collections.GenericDictionaryAssertions @@ -626,6 +644,7 @@ namespace FluentAssertions.Common } namespace FluentAssertions.Configuration { + [System.Diagnostics.StackTraceHidden] public class GlobalConfiguration { public GlobalConfiguration() { } @@ -633,6 +652,7 @@ namespace FluentAssertions.Configuration public FluentAssertions.Configuration.GlobalFormattingOptions Formatting { get; set; } public FluentAssertions.Configuration.TestFramework? TestFramework { get; set; } } + [System.Diagnostics.StackTraceHidden] public class GlobalEquivalencyOptions { public GlobalEquivalencyOptions() { } @@ -640,6 +660,7 @@ namespace FluentAssertions.Configuration public FluentAssertions.Equivalency.EquivalencyOptions CloneDefaults() { } public void Modify(System.Func configureOptions) { } } + [System.Diagnostics.StackTraceHidden] public class GlobalFormattingOptions : FluentAssertions.Formatting.FormattingOptions { public GlobalFormattingOptions() { } @@ -659,6 +680,7 @@ namespace FluentAssertions.Configuration } namespace FluentAssertions.Equivalency { + [System.Diagnostics.StackTraceHidden] public class Comparands { public Comparands() { } @@ -670,6 +692,7 @@ namespace FluentAssertions.Equivalency public System.Type GetExpectedType(FluentAssertions.Equivalency.IEquivalencyOptions options) { } public override string ToString() { } } + [System.Diagnostics.StackTraceHidden] public class ConversionSelector { public ConversionSelector() { } @@ -701,6 +724,7 @@ namespace FluentAssertions.Equivalency { public EquivalencyOptions() { } } + [System.Diagnostics.StackTraceHidden] public class EquivalencyOptions : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions> { public EquivalencyOptions() { } @@ -716,6 +740,7 @@ namespace FluentAssertions.Equivalency public FluentAssertions.Equivalency.EquivalencyOptions WithStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } public FluentAssertions.Equivalency.EquivalencyOptions WithoutStrictOrderingFor(System.Linq.Expressions.Expression> expression) { } } + [System.Diagnostics.StackTraceHidden] public class EquivalencyPlan : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { public EquivalencyPlan() { } @@ -738,12 +763,14 @@ namespace FluentAssertions.Equivalency ContinueWithNext = 0, EquivalencyProven = 1, } + [System.Diagnostics.StackTraceHidden] public abstract class EquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { protected EquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } protected abstract FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator); } + [System.Diagnostics.StackTraceHidden] public class EquivalencyValidationContext : FluentAssertions.Equivalency.IEquivalencyValidationContext { public EquivalencyValidationContext(FluentAssertions.Equivalency.INode root, FluentAssertions.Equivalency.IEquivalencyOptions options) { } @@ -866,10 +893,12 @@ namespace FluentAssertions.Equivalency { void AssertEquivalencyOf(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context); } + [System.Diagnostics.StackTraceHidden] public static class MemberFactory { public static FluentAssertions.Equivalency.IMember Create(System.Reflection.MemberInfo memberInfo, FluentAssertions.Equivalency.INode parent) { } } + [System.Diagnostics.StackTraceHidden] public class MemberSelectionContext { public MemberSelectionContext(System.Type compileTimeType, System.Type runtimeType, FluentAssertions.Equivalency.IEquivalencyOptions options) { } @@ -886,6 +915,7 @@ namespace FluentAssertions.Equivalency ExplicitlyImplemented = 4, DefaultInterfaceProperties = 8, } + [System.Diagnostics.StackTraceHidden] public class NestedExclusionOptionBuilder { public FluentAssertions.Equivalency.EquivalencyOptions Exclude(System.Linq.Expressions.Expression> expression) { } @@ -897,6 +927,7 @@ namespace FluentAssertions.Equivalency NotStrict = 1, Irrelevant = 2, } + [System.Diagnostics.StackTraceHidden] public class OrderingRuleCollection : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { public OrderingRuleCollection() { } @@ -916,6 +947,7 @@ namespace FluentAssertions.Equivalency public override string ToString() { } public delegate string GetDescription(string pathAndName); } + [System.Diagnostics.StackTraceHidden] public abstract class SelfReferenceEquivalencyOptions : FluentAssertions.Equivalency.IEquivalencyOptions where TSelf : FluentAssertions.Equivalency.SelfReferenceEquivalencyOptions { @@ -1002,6 +1034,7 @@ namespace FluentAssertions.Equivalency where TMemberType : TMember { } } } + [System.Diagnostics.StackTraceHidden] public static class SubjectInfoExtensions { public static bool WhichGetterDoesNotHave(this FluentAssertions.Equivalency.IMemberInfo memberInfo, FluentAssertions.Common.CSharpAccessModifier accessModifier) { } @@ -1016,6 +1049,7 @@ namespace FluentAssertions.Equivalency.Inlining { void Execute(FluentAssertions.Execution.AssertionChain assertionChain, FluentAssertions.Equivalency.Comparands comparands); } + [System.Diagnostics.StackTraceHidden] public class InlineEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public InlineEquivalencyStep() { } @@ -1024,104 +1058,124 @@ namespace FluentAssertions.Equivalency.Inlining } namespace FluentAssertions.Equivalency.Steps { + [System.Diagnostics.StackTraceHidden] public class AssertionRuleEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public AssertionRuleEquivalencyStep(System.Linq.Expressions.Expression> predicate, System.Action> assertionAction) { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } + [System.Diagnostics.StackTraceHidden] public class AutoConversionStep : FluentAssertions.Equivalency.IEquivalencyStep { public AutoConversionStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } + [System.Diagnostics.StackTraceHidden] public class DateAndTimeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public DateAndTimeEquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + [System.Diagnostics.StackTraceHidden] public class DictionaryEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public DictionaryEquivalencyStep() { } protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } + [System.Diagnostics.StackTraceHidden] public class EnumEqualityStep : FluentAssertions.Equivalency.IEquivalencyStep { public EnumEqualityStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + [System.Diagnostics.StackTraceHidden] public class EnumerableEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public EnumerableEquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + [System.Diagnostics.StackTraceHidden] public class EqualityComparerEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public EqualityComparerEquivalencyStep(System.Collections.Generic.IEqualityComparer comparer) { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } public override string ToString() { } } + [System.Diagnostics.StackTraceHidden] public class GenericDictionaryEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public GenericDictionaryEquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + [System.Diagnostics.StackTraceHidden] public class GenericEnumerableEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public GenericEnumerableEquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + [System.Diagnostics.StackTraceHidden] public class JsonConversionStep : FluentAssertions.Equivalency.IEquivalencyStep { public JsonConversionStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + [System.Diagnostics.StackTraceHidden] public class ReferenceEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public ReferenceEqualityEquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + [System.Diagnostics.StackTraceHidden] public class RunAllUserStepsEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public RunAllUserStepsEquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + [System.Diagnostics.StackTraceHidden] public class SimpleEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public SimpleEqualityEquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + [System.Diagnostics.StackTraceHidden] public class StringEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public StringEqualityEquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + [System.Diagnostics.StackTraceHidden] public class StructuralEqualityEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public StructuralEqualityEquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + [System.Diagnostics.StackTraceHidden] public class TypeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public TypeEquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + [System.Diagnostics.StackTraceHidden] public class ValueTypeEquivalencyStep : FluentAssertions.Equivalency.IEquivalencyStep { public ValueTypeEquivalencyStep() { } public FluentAssertions.Equivalency.EquivalencyResult Handle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency valueChildNodes) { } } + [System.Diagnostics.StackTraceHidden] public class XAttributeEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XAttributeEquivalencyStep() { } protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } + [System.Diagnostics.StackTraceHidden] public class XDocumentEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XDocumentEquivalencyStep() { } protected override FluentAssertions.Equivalency.EquivalencyResult OnHandle(FluentAssertions.Equivalency.Comparands comparands, FluentAssertions.Equivalency.IEquivalencyValidationContext context, FluentAssertions.Equivalency.IValidateChildNodeEquivalency nestedValidator) { } } + [System.Diagnostics.StackTraceHidden] public class XElementEquivalencyStep : FluentAssertions.Equivalency.EquivalencyStep { public XElementEquivalencyStep() { } @@ -1163,12 +1217,14 @@ namespace FluentAssertions.Events public FluentAssertions.Events.IEventRecording Raise(string eventName, string because = "", params object[] becauseArgs) { } public FluentAssertions.Events.IEventRecording RaisePropertyChangeFor(System.Linq.Expressions.Expression> propertyExpression, string because = "", params object[] becauseArgs) { } } + [System.Diagnostics.StackTraceHidden] public class EventMetadata { public EventMetadata(string eventName, System.Type handlerType) { } public string EventName { get; } public System.Type HandlerType { get; } } + [System.Diagnostics.StackTraceHidden] public class EventMonitorOptions { public EventMonitorOptions() { } @@ -1190,6 +1246,7 @@ namespace FluentAssertions.Events FluentAssertions.Events.IEventRecording GetRecordingFor(string eventName); FluentAssertions.Events.EventAssertions Should(); } + [System.Diagnostics.StackTraceHidden] public class OccurredEvent { public OccurredEvent() { } @@ -1201,6 +1258,7 @@ namespace FluentAssertions.Events } namespace FluentAssertions.Execution { + [System.Diagnostics.StackTraceHidden] public sealed class AssertionChain { public string CallerIdentifier { get; } @@ -1228,10 +1286,12 @@ namespace FluentAssertions.Execution public FluentAssertions.Execution.AssertionChain WithReportable(string name, System.Func content) { } public static FluentAssertions.Execution.AssertionChain GetOrCreate() { } } + [System.Diagnostics.StackTraceHidden] public class AssertionFailedException : System.Exception { public AssertionFailedException(string message) { } } + [System.Diagnostics.StackTraceHidden] public sealed class AssertionScope : System.IDisposable { public AssertionScope() { } @@ -1247,21 +1307,25 @@ namespace FluentAssertions.Execution public void Dispose() { } public bool HasFailures() { } } + [System.Diagnostics.StackTraceHidden] public class Continuation { public FluentAssertions.Execution.AssertionChain Then { get; } } + [System.Diagnostics.StackTraceHidden] public class ContinuationOfGiven { public bool Succeeded { get; } public FluentAssertions.Execution.GivenSelector Then { get; } } + [System.Diagnostics.StackTraceHidden] public class FailReason { public FailReason(string message, params object[] args) { } public object[] Args { get; } public string Message { get; } } + [System.Diagnostics.StackTraceHidden] public class GivenSelector { public bool Succeeded { get; } @@ -1288,6 +1352,7 @@ namespace FluentAssertions.Execution [System.Diagnostics.CodeAnalysis.DoesNotReturn] void Throw(string message); } + [System.Diagnostics.StackTraceHidden] public class Reason { public Reason(string formattedMessage, object[] arguments) { } @@ -1298,6 +1363,7 @@ namespace FluentAssertions.Execution namespace FluentAssertions.Extensibility { [System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)] + [System.Diagnostics.StackTraceHidden] public sealed class AssertionEngineInitializerAttribute : System.Attribute { public AssertionEngineInitializerAttribute(System.Type type, string methodName) { } @@ -2318,6 +2384,7 @@ namespace FluentAssertions.Specialized public virtual FluentAssertions.Specialized.ExceptionAssertions WithMessage(string expectedWildcardPattern, string because = "", params object[] becauseArgs) { } public virtual FluentAssertions.Specialized.ExceptionAssertions WithoutMessage(string wildcardPattern, string because = "", params object[] becauseArgs) { } } + [System.Diagnostics.StackTraceHidden] public class ExecutionTime { public ExecutionTime(System.Action action, FluentAssertions.Common.StartTimer createTimer) { } @@ -2382,6 +2449,7 @@ namespace FluentAssertions.Specialized public FluentAssertions.AndConstraint> NotBeUtcDate(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> NotHaveProperty(string code, string because = "", params object[] becauseArgs) { } } + [System.Diagnostics.StackTraceHidden] public class MemberExecutionTime : FluentAssertions.Specialized.ExecutionTime { public MemberExecutionTime(T subject, System.Linq.Expressions.Expression> action, FluentAssertions.Common.StartTimer createTimer) { } @@ -2456,6 +2524,7 @@ namespace FluentAssertions.Streams } namespace FluentAssertions.Types { + [System.Diagnostics.StackTraceHidden] public static class AllTypes { public static FluentAssertions.Types.TypeSelector From(System.Reflection.Assembly assembly) { } @@ -2513,6 +2582,7 @@ namespace FluentAssertions.Types public FluentAssertions.AndConstraint> Return(string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> ReturnVoid(string because = "", params object[] becauseArgs) { } } + [System.Diagnostics.StackTraceHidden] public class MethodInfoSelector : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { public MethodInfoSelector(System.Collections.Generic.IEnumerable types) { } @@ -2580,6 +2650,7 @@ namespace FluentAssertions.Types public FluentAssertions.AndConstraint Return(System.Type propertyType, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint Return(string because = "", params object[] becauseArgs) { } } + [System.Diagnostics.StackTraceHidden] public class PropertyInfoSelector : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { public PropertyInfoSelector(System.Collections.Generic.IEnumerable types) { } @@ -2700,6 +2771,7 @@ namespace FluentAssertions.Types public FluentAssertions.AndConstraint NotImplement(string because = "", params object[] becauseArgs) where TInterface : class { } } + [System.Diagnostics.StackTraceHidden] public class TypeSelector : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { public TypeSelector(System.Collections.Generic.IEnumerable types) { } @@ -2849,6 +2921,7 @@ namespace FluentAssertions.Xml public FluentAssertions.AndConstraint BeEquivalentTo(System.Xml.XmlNode expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Xml.XmlNode unexpected, string because = "", params object[] becauseArgs) { } } + [System.Diagnostics.StackTraceHidden] public class XmlNodeFormatter : FluentAssertions.Formatting.IValueFormatter { public XmlNodeFormatter() { } diff --git a/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs index d5682199fe..d1b54f9830 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/OuterExceptionSpecs.cs @@ -51,7 +51,6 @@ public void Long_exception_messages_are_rendered_over_multiple_lines() { // Act testSubject - .Should().Throw() .WithMessage(new string('#', 101)); diff --git a/Tests/FluentAssertions.Specs/StackTraceHiddenSpecs.cs b/Tests/FluentAssertions.Specs/StackTraceHiddenSpecs.cs new file mode 100644 index 0000000000..4d56a1ad5b --- /dev/null +++ b/Tests/FluentAssertions.Specs/StackTraceHiddenSpecs.cs @@ -0,0 +1,88 @@ +#if NET6_0_OR_GREATER +using System; +using System.Diagnostics; +using System.Linq; +using System.Runtime.CompilerServices; +using FluentAssertions.Equivalency; +using FluentAssertions.Types; +using Reflectify; +using Xunit; + +namespace FluentAssertions.Specs; + +public class StackTraceHiddenSpecs +{ + [Fact] + public void All_non_assertion_classes_have_their_stack_trace_hidden() + { + // Arrange / Act + var allFluentAssertionsClasses = GetAnnotatableTypes() + .Except(ShouldNotBeAnnotated()) + .Types(); + + // Assert + allFluentAssertionsClasses.Should().BeDecoratedWith( + "because all \"internal\" code should be hidden from the stacktrace to improve the debugging experience"); + } + + [Fact] + public void Assertion_classes_do_not_have_their_stack_trace_hidden() + { + // Arrange / Act + var allFluentAssertionsClasses = ShouldNotBeAnnotated(); + + // Assert + allFluentAssertionsClasses.Should().NotBeDecoratedWith( + "because we do want to see the actual assertion method being used"); + } + + private static TypeSelector GetAnnotatableTypes() + { + return AllTypes + .From(typeof(FluentAssertions.AssertionExtensions).Assembly) + .ThatAreUnderNamespace("FluentAssertions") + .ThatAreClasses() + .ThatSatisfy(t => !t.IsNested) + .ThatSatisfy(t => !t.IsSameOrInherits()) + .ThatSatisfy(t => !t.IsCompilerGenerated() && !t.HasAttribute()); + } + + private static TypeSelector ShouldNotBeAnnotated() + { + string[] typeNameSuffixes = + [ + "Assertions", + "AssertionsBase", + "AssertionExtensions", + "AssertionsExtensions", + "DateTimeExtensions", + "EventRaisingExtensions", + "FluentDateTimeExtensions", + "FluentTimeSpanExtensions", + "OccurrenceConstraintExtensions", + "Common.TypeExtensions", + "TypeEnumerableExtensions", + "FluentAssertions.TypeExtensions", + ]; + + string[] namespaces = + [ + "FluentAssertions.CallerIdentification", + "FluentAssertions.Collections.MaximumMatching", + "FluentAssertions.Equivalency.Matching", + "FluentAssertions.Equivalency.Ordering", + "FluentAssertions.Equivalency.Selection", + "FluentAssertions.Equivalency.Tracing", + "FluentAssertions.Formatting", + ]; + + return GetAnnotatableTypes() + .ThatSatisfy(t => + t == typeof(EquivalencyOptions) || + typeNameSuffixes.Any(bt => bt == t.FullName || t.GetNonGenericName().EndsWith(bt, StringComparison.Ordinal)) || + namespaces.Any(ns => t?.Namespace?.StartsWith(ns, StringComparison.Ordinal) is true) + ); + } + +} +#endif From 7bc149e812dc5aa5b37754a927e5c8d9b8a64f7b Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Fri, 13 Feb 2026 17:07:22 +0100 Subject: [PATCH 779/845] Point the docs to the new site --- docs/_data/navigation.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index e9542f1320..3b9abbe76c 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -3,11 +3,13 @@ main: - title: "About" url: /about/ - title: "Documentation" - url: /introduction + url: https://doc.xceed.com - title: "Releases" url: /releases/ - title: "GitHub" url: https://github.com/fluentassertions/fluentassertions + - title: "Other Products" + url: https://www.xceed.com sidebar: - title: About From a358529fa66086919aa4ebcc3f252c8039dca010 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Fri, 13 Feb 2026 14:53:18 +0100 Subject: [PATCH 780/845] Fix CA1830 --- .../Equivalency/Tracing/StringBuilderTraceWriter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs b/Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs index a0752de0e3..28119cfba2 100644 --- a/Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs +++ b/Src/FluentAssertions/Equivalency/Tracing/StringBuilderTraceWriter.cs @@ -30,7 +30,7 @@ private void WriteLine(string trace) { foreach (string traceLine in trace.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries)) { - builder.Append(new string(' ', depth * 2)).AppendLine(traceLine); + builder.Append(' ', depth * 2).AppendLine(traceLine); } } From 129a8208dd12b0c1316611a9568d525a1342f033 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Fri, 13 Feb 2026 14:58:04 +0100 Subject: [PATCH 781/845] Polyfill StringBuilder.Append --- Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs | 7 +++++-- Src/FluentAssertions/Primitives/StringEqualityStrategy.cs | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs b/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs index f908b01e67..bda9a34fa8 100644 --- a/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs +++ b/Src/FluentAssertions/Polyfill/StringBuilderExtensions.cs @@ -13,8 +13,11 @@ namespace System.Text; /// internal static class StringBuilderExtensions { - public static StringBuilder AppendLine(this StringBuilder stringBuilder, IFormatProvider _, string value) => - stringBuilder.AppendLine(value); + public static StringBuilder Append(this StringBuilder stringBuilder, IFormatProvider provider, FormattableString formattable) => + stringBuilder.Append(string.Create(provider, formattable)); + + public static StringBuilder AppendLine(this StringBuilder stringBuilder, IFormatProvider provider, FormattableString formattable) => + stringBuilder.AppendLine(string.Create(provider, formattable)); #if NET47 || NETSTANDARD2_0 public static StringBuilder AppendJoin(this StringBuilder stringBuilder, string separator, IEnumerable values) => diff --git a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs index 00975db75b..6e6ec75342 100644 --- a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs @@ -165,7 +165,7 @@ private string GetMismatchSegmentForLongStrings(string subject, string expected, if (IncludeFullDetails && wasTruncated) { - string fullDetails = string.Create(CultureInfo.InvariantCulture, + sb.Append(CultureInfo.InvariantCulture, $""" @@ -178,7 +178,6 @@ private string GetMismatchSegmentForLongStrings(string subject, string expected, {subject.RenderAsIndentedBlock()} """); - sb.Append(fullDetails); } return sb.ToString(); From 5f3d5216ff03b73bb8eb0383b73aaa7b8e14567e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Feb 2026 16:10:05 +0000 Subject: [PATCH 782/845] Bump cspell from 9.6.2 to 9.6.4 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 9.6.2 to 9.6.4. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.6.4/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.6.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 305 +++++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 166 insertions(+), 141 deletions(-) diff --git a/package-lock.json b/package-lock.json index 733024368d..adde032dc3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.6.2" + "cspell": "^9.6.4" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.6.2.tgz", - "integrity": "sha512-s5u/3nhQUftKibPIbRLLAf4M5JG1NykqkPCxS0STMmri0hzVMZbAOCyHjdLoOCqPUn0xZzLA8fgeYg3b7QuHpg==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.6.4.tgz", + "integrity": "sha512-OIiPQuB7XQ6rnUv4KaCwHr9vNwbh6VZ4GfgQjcThT0oz0hkL6E5Ar3tq54K9jyqE9ylcHqpRuXUgnKgio6Hlig==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.1", @@ -31,9 +31,9 @@ "@cspell/dict-docker": "^1.1.17", "@cspell/dict-dotnet": "^5.0.11", "@cspell/dict-elixir": "^4.0.8", - "@cspell/dict-en_us": "^4.4.27", + "@cspell/dict-en_us": "^4.4.28", "@cspell/dict-en-common-misspellings": "^2.1.12", - "@cspell/dict-en-gb-mit": "^3.1.16", + "@cspell/dict-en-gb-mit": "^3.1.17", "@cspell/dict-filetypes": "^3.0.15", "@cspell/dict-flutter": "^1.1.1", "@cspell/dict-fonts": "^4.0.5", @@ -57,14 +57,14 @@ "@cspell/dict-markdown": "^2.0.14", "@cspell/dict-monkeyc": "^1.0.12", "@cspell/dict-node": "^5.0.9", - "@cspell/dict-npm": "^5.2.31", + "@cspell/dict-npm": "^5.2.32", "@cspell/dict-php": "^4.1.1", "@cspell/dict-powershell": "^5.0.15", "@cspell/dict-public-licenses": "^2.0.15", "@cspell/dict-python": "^4.2.25", "@cspell/dict-r": "^2.1.1", "@cspell/dict-ruby": "^5.1.0", - "@cspell/dict-rust": "^4.1.1", + "@cspell/dict-rust": "^4.1.2", "@cspell/dict-scala": "^5.0.9", "@cspell/dict-shell": "^1.1.2", "@cspell/dict-software-terms": "^5.1.20", @@ -81,39 +81,39 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.6.2.tgz", - "integrity": "sha512-8TCD7KOG9ppo5BoJOe2diACfB6I6UpJmYmjLOxMy0o8y3ruWFoDKaDEsf5tIi4T7cdVb8MjGbHjw9ksCwRRMjA==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.6.4.tgz", + "integrity": "sha512-rGYSDnDWACrUyovfN8M/LM8CCFSKjYd2kehbNS7YMPk0Jk+rLk6sgt5WYu3ty45otXCkiO07bjUo/81wBLet7A==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.6.2" + "@cspell/cspell-types": "9.6.4" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-performance-monitor": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-performance-monitor/-/cspell-performance-monitor-9.6.2.tgz", - "integrity": "sha512-MZuhYy59zFCVsX3PzW02/3TqPsPw87MELOJuZfpWDcGgxrweTrVjMdmJ0/w7COJ6zEAqtgGjNMAEmK4xJnrQjQ==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-performance-monitor/-/cspell-performance-monitor-9.6.4.tgz", + "integrity": "sha512-exuqxV1IVfZkasg57ZjUbaHeZDd6Mdbsbe5FBT3+XaVnRij+wpY2oEW9+kIOL5MOQE3bgQKgu37iMtA1NlCrGA==", "license": "MIT", "engines": { "node": ">=20.18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.6.2.tgz", - "integrity": "sha512-Wt6Cf4b/E0QJ/TkbOMjXSGrccASgbc8xZq3c+8+kCXM5JT92NP2Lx67m3UA1g+BDv7E4DNPuwm1fM7o/2zum5w==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.6.4.tgz", + "integrity": "sha512-vVxajTG9Ko01oHk8HPsMLajcLrd9AfkOk6vdgFI4FD7ZPq1CY0hfTmfmJ8bzZ4/QkqXglTvePdSgHQVJeltwWw==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.6.2.tgz", - "integrity": "sha512-u7P4ErApEcSP+Si2HaeotFQXjuCopAa+wPF1fDzuJzpotPxsDwNDanGGn2qUMjOyVI4UiI84MPI6ZuGLj5EDyQ==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.6.4.tgz", + "integrity": "sha512-3xsgZEqqH9Uj8ZYLBnWbnsHz8wphgaeuWKcNDqgwoMjvwTMQLGoXjHht8Jx5yxd2e080lB7fJax8TaBdCzmFFA==", "license": "MIT", "dependencies": { "global-directory": "^4.0.1" @@ -123,30 +123,30 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.6.2.tgz", - "integrity": "sha512-T4LBWe3NYpKPD/fIkYAL56z5pr8Cgh//UZDl4afDTJNuTkdE6ZL93MBAUXggONHqY8B9dRXlQKrD4PD+kHabtw==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.6.4.tgz", + "integrity": "sha512-oGNEzP1gJ43rLklJQjOk5PsfX0mZkLjV19djGptb9xZQeC2qAUxnaAbZtWt5CE8ni2iiTaRmgNRbUqAhRCnjew==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.6.2.tgz", - "integrity": "sha512-RsUFrSB0oQHEBnR8yarKIReUPwSu2ROpbjhdVKi4T/nQhMaS+TnIQPBwkMtb2r8A1KS2Hijw4D/4bV/XHoFQWw==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.6.4.tgz", + "integrity": "sha512-lf6d+BdMkJIFCxx2FpajLpqVGGyaGUNFU6jhEM6QUPeGuoA5et2kJXrL0NSY2uWLOVyYYc/FPjzlbe8trA9tBQ==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-worker": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/@cspell/cspell-worker/-/cspell-worker-9.6.2.tgz", - "integrity": "sha512-1xq8jmt6YZ7MVPESydjYJ3p67vi+YWgi5qow1xyZzeQWFXVCCFi9pQSxC0bzGQwWrYGNWSAIbYZB3Sq5ntYz4w==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-worker/-/cspell-worker-9.6.4.tgz", + "integrity": "sha512-anacKDOZzDfPzuDeFOXGI2tFBYiRRCSnIZP/AOyJ9zTvEQcqq5p/ak18nJ5OQyDr2NG7ovJiCDT5YNiH2Vdg/g==", "license": "MIT", "dependencies": { - "cspell-lib": "9.6.2" + "cspell-lib": "9.6.4" }, "engines": { "node": ">=20.18" @@ -234,9 +234,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-dotnet": { - "version": "5.0.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.11.tgz", - "integrity": "sha512-LSVKhpFf/ASTWJcfYeS0Sykcl1gVMsv2Z5Eo0TnTMSTLV3738HH+66pIsjUTChqU6SF3gKPuCe6EOaRYqb/evA==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.12.tgz", + "integrity": "sha512-FiV934kNieIjGTkiApu/WKvLYi/KBpvfWB2TSqpDQtmXZlt3uSa5blwblO1ZC8OvjH8RCq/31H5IdEYmTaZS7A==", "license": "MIT" }, "node_modules/@cspell/dict-elixir": { @@ -246,9 +246,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.4.27", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.27.tgz", - "integrity": "sha512-0y4vH2i5cFmi8sxkc4OlD2IlnqDznOtKczm4h6jA288g5VVrm3bhkYK6vcB8b0CoRKtYWKet4VEmHBP1yI+Qfw==", + "version": "4.4.29", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.29.tgz", + "integrity": "sha512-G3B27++9ziRdgbrY/G/QZdFAnMzzx17u8nCb2Xyd4q6luLpzViRM/CW3jA+Mb/cGT5zR/9N+Yz9SrGu1s0bq7g==", "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { @@ -258,9 +258,9 @@ "license": "CC BY-SA 4.0" }, "node_modules/@cspell/dict-en-gb-mit": { - "version": "3.1.16", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.16.tgz", - "integrity": "sha512-4PPdapCJslytxAVJu35Mv97qDyGmAQxtDE790T2bWNhcqN6gvRVAc/eTRaXkUIf21q1xCxxNNqpH4VfMup69rQ==", + "version": "3.1.18", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.18.tgz", + "integrity": "sha512-AXaMzbaxhSc32MSzKX0cpwT+Thv1vPfxQz1nTly1VHw3wQcwPqVFSqrLOYwa8VNqAPR45583nnhD6iqJ9YESoQ==", "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { @@ -408,9 +408,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.31", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.31.tgz", - "integrity": "sha512-+HoFoFe53pL0wDuSHRs5L+CcDMaG5sLfjKLPT4H0VdwNzho3HLOohTCZr6cYt7OEbXf3xi4YXBkamCy38xOpjA==", + "version": "5.2.34", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.34.tgz", + "integrity": "sha512-M2MtfmYeHIPBuC8esMU4JQXHKma7Xt7VyBWUk67B62KDu61sxebQ2HeizdqmN2sLEJsTkq3bZT5PGzHpZ0LEWQ==", "license": "MIT" }, "node_modules/@cspell/dict-php": { @@ -453,9 +453,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-rust": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.1.1.tgz", - "integrity": "sha512-fXiXnZH0wOaEVTKFRNaz6TsUGhuB8dAT0ubYkDNzRQCaV5JGSOebGb1v2x5ZrOSVp+moxWM/vdBfiNU6KOEaFQ==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.1.2.tgz", + "integrity": "sha512-O1FHrumYcO+HZti3dHfBPUdnDFkI+nbYK3pxYmiM1sr+G0ebOd6qchmswS0Wsc6ZdEVNiPYJY/gZQR6jfW3uOg==", "license": "MIT" }, "node_modules/@cspell/dict-scala": { @@ -471,9 +471,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.1.20", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.20.tgz", - "integrity": "sha512-TEk1xHvetTI4pv7Vzje1D322m6QEjaH2P6ucOOf6q7EJCppQIdC0lZSXkgHJAFU5HGSvEXSzvnVeW2RHW86ziQ==", + "version": "5.1.21", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.21.tgz", + "integrity": "sha512-3lAB4OXsf6rs5zbwe4/nKmwyAJAvjs5KTRrPckzHx7q9dYpviW+UxDyhevCCsRfmcu24OhYP7BVQWXxLvYk4xA==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -519,12 +519,12 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.6.2.tgz", - "integrity": "sha512-DY/X6lsdK4aeJ4erPVZoU1ccEXqtnYqWCMUXZOsMeIsZlXwZz/ocNNd09A4ga9IzGj1lYsB13UG4GVe8lSMAXQ==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.6.4.tgz", + "integrity": "sha512-1VnL9ahT3s17DLWl4MeO1pYg7zcVT3X9cKynI2/U86zNK5xMGS5icvjp7X65tsCAVNcWOtkqVFfrxi7kWxn67g==", "license": "MIT", "dependencies": { - "@cspell/url": "9.6.2", + "@cspell/url": "9.6.4", "import-meta-resolve": "^4.2.0" }, "engines": { @@ -532,27 +532,36 @@ } }, "node_modules/@cspell/filetypes": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.6.2.tgz", - "integrity": "sha512-XYAuGZoRCUf4Y12YP+K0BpU3QUMj4Z4SkKpi08Dwx/bQlq/NqycHKkUWYhlViHLav1+MJbWxcvDIHxGNv0UIaA==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.6.4.tgz", + "integrity": "sha512-a1aZ/8vGnhTknxTukjzo3m8CISyHW2MWnbedywg5SDEl5RMJitmzX90QZiQdSvEcqzqmtoAgSEZNBT2LX2gIKg==", "license": "MIT", "engines": { "node": ">=20" } }, + "node_modules/@cspell/rpc": { + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/@cspell/rpc/-/rpc-9.6.4.tgz", + "integrity": "sha512-vGI1788Rx5Yml9N1/pD4zGd8Vrchi2Y01ADf9NiiOaNVVdf4PU1GCssLCsiIzhYQneErpQ8pJi/mS2F/QMZbRA==", + "license": "MIT", + "engines": { + "node": ">=20.18" + } + }, "node_modules/@cspell/strong-weak-map": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.6.2.tgz", - "integrity": "sha512-7zpnLkpT91wsH4aU3oAprnzrURvBWKq97j5i/SWXGuNKf36XNEO4HaeaPp6L2oVq4OzdUOdm0tUK1gB0HhMWSg==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.6.4.tgz", + "integrity": "sha512-AQrUbA0JUOEQgwItnfUQ6Ydk0hWY/uV3VhLwZWyrnT9eiQynmTnRTHtOCkkSl9+M4P0N4Raa2eGFRLcPAFksaw==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.6.2.tgz", - "integrity": "sha512-625EiP1jUOQZ6UQuTUV1XB8Bxa18z3EtC1qA6PJyM3TqUD8PD8Tz183j9av6d/Dq52+7w0F4ovuqjUcTXTfD6g==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.6.4.tgz", + "integrity": "sha512-h6VMlb7bDyGJfwLtipxxtHlT+ojzUXZz14AqZ/NEzY3LfOhfJTGpRcWLYFsgG/L0Ma4qjsYbPJt/Sj1C14j0VA==", "license": "MIT", "engines": { "node": ">=20" @@ -629,9 +638,9 @@ } }, "node_modules/commander": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.2.tgz", - "integrity": "sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", + "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", "license": "MIT", "engines": { "node": ">=20" @@ -658,28 +667,28 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.6.2.tgz", - "integrity": "sha512-EmkSGhStMbSh2BcyMqbVDOF48fSPWL3adjqajUVCwfnlZD7mzUWPx9pR8pt2dOQaFEE47rlOQGXdd3wTqL5dnQ==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.6.4.tgz", + "integrity": "sha512-rZJmgcyBGKX3KcJ3KC9JYVHeKhDEVbmCheSp8eRGMYw6MCG9o7FHqQjGA/u4lEu4A0psr7ACP/5ym/QHyntRbA==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "9.6.2", - "@cspell/cspell-performance-monitor": "9.6.2", - "@cspell/cspell-pipe": "9.6.2", - "@cspell/cspell-types": "9.6.2", - "@cspell/cspell-worker": "9.6.2", - "@cspell/dynamic-import": "9.6.2", - "@cspell/url": "9.6.2", + "@cspell/cspell-json-reporter": "9.6.4", + "@cspell/cspell-performance-monitor": "9.6.4", + "@cspell/cspell-pipe": "9.6.4", + "@cspell/cspell-types": "9.6.4", + "@cspell/cspell-worker": "9.6.4", + "@cspell/dynamic-import": "9.6.4", + "@cspell/url": "9.6.4", "ansi-regex": "^6.2.2", "chalk": "^5.6.2", "chalk-template": "^1.1.2", - "commander": "^14.0.2", - "cspell-config-lib": "9.6.2", - "cspell-dictionary": "9.6.2", - "cspell-gitignore": "9.6.2", - "cspell-glob": "9.6.2", - "cspell-io": "9.6.2", - "cspell-lib": "9.6.2", + "commander": "^14.0.3", + "cspell-config-lib": "9.6.4", + "cspell-dictionary": "9.6.4", + "cspell-gitignore": "9.6.4", + "cspell-glob": "9.6.4", + "cspell-io": "9.6.4", + "cspell-lib": "9.6.4", "fast-json-stable-stringify": "^2.1.0", "flatted": "^3.3.3", "semver": "^7.7.3", @@ -697,12 +706,12 @@ } }, "node_modules/cspell-config-lib": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.6.2.tgz", - "integrity": "sha512-VQB+xmqGqCJrt5k/o0rRG9v0X0CA96CEd9FsmBAm5+9DvNiRzXOqewZSdsOM2Y0SX7YKcvG82PfRsujhYltcfQ==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.6.4.tgz", + "integrity": "sha512-MecJNR9bIlcPBhyZFsXP6Q2n8qQ2IR9N9HiIz0yh0gBNVydp3LR5JITP5Ji8m7hexmZzVeoXms/dVN74XbS95g==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.6.2", + "@cspell/cspell-types": "9.6.4", "comment-json": "^4.5.1", "smol-toml": "^1.6.0", "yaml": "^2.8.2" @@ -712,15 +721,15 @@ } }, "node_modules/cspell-dictionary": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.6.2.tgz", - "integrity": "sha512-J55/9+AtkRzfSVn+KaqoWxsS4O66szKP6LrDW0O2qWnuvVvO1BoAMsINynD845IIzrd1n1yTOHS/DbjmHd4//A==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.6.4.tgz", + "integrity": "sha512-Ik9ZQVqV/fJfMt5X6IkC7yHGVH46/qjcqCNWwrMSwvROLM3SemNxxZoLvh0wi0GXz9WF1lHcxLJVdeKUk6QB8g==", "license": "MIT", "dependencies": { - "@cspell/cspell-performance-monitor": "9.6.2", - "@cspell/cspell-pipe": "9.6.2", - "@cspell/cspell-types": "9.6.2", - "cspell-trie-lib": "9.6.2", + "@cspell/cspell-performance-monitor": "9.6.4", + "@cspell/cspell-pipe": "9.6.4", + "@cspell/cspell-types": "9.6.4", + "cspell-trie-lib": "9.6.4", "fast-equals": "^6.0.0" }, "engines": { @@ -728,14 +737,14 @@ } }, "node_modules/cspell-gitignore": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.6.2.tgz", - "integrity": "sha512-vtwc9AAA9m3aZPtbvPPRTLXIqwryljxEgQTkpr92mFZaGftvnLfNVb2z++NvWbXq9azGKN/7oiLjecb9dhYnfA==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.6.4.tgz", + "integrity": "sha512-a8asE9BsjJgJ506WUGh5VHrTdVEE8hWELjCJB2atPrW6iY5e4aCIugy0gkRC1ZH9/TseadlmMLrFzHUkJUjzsg==", "license": "MIT", "dependencies": { - "@cspell/url": "9.6.2", - "cspell-glob": "9.6.2", - "cspell-io": "9.6.2" + "@cspell/url": "9.6.4", + "cspell-glob": "9.6.4", + "cspell-io": "9.6.4" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -745,12 +754,12 @@ } }, "node_modules/cspell-glob": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.6.2.tgz", - "integrity": "sha512-5j+g4JzcWjW16ZAtcPHpG138CEfpp1YmuYJoYtze3lIZLgttt+k2gXJsqyWaP/6MdVknI0Q1afGSKYRtH8mLRA==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.6.4.tgz", + "integrity": "sha512-253VrjbR8QU15h8GtpDQLX5Ti9uNSuNod2T7f8YEElQOb9I/kUXoCj3Cq4P390IC99klqSHIDxHsxd77ex19lA==", "license": "MIT", "dependencies": { - "@cspell/url": "9.6.2", + "@cspell/url": "9.6.4", "picomatch": "^4.0.3" }, "engines": { @@ -758,13 +767,13 @@ } }, "node_modules/cspell-grammar": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.6.2.tgz", - "integrity": "sha512-JTH92+1VGFPb3UsDT+Ezur/ouR8t+XOZkETUkk8eoSBzli9hWgPHW7kl2T8Chcn+Dq/6FLlvezYbBvhSauqJRw==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.6.4.tgz", + "integrity": "sha512-rvZyTB45/XSRWx7eAsrvTTAZvBTREr/2G2JWVMdqrptFyq1XReAKHhw/x1HJkNgWC9LKAK3bVQJpjLsNG37U9A==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.6.2", - "@cspell/cspell-types": "9.6.2" + "@cspell/cspell-pipe": "9.6.4", + "@cspell/cspell-types": "9.6.4" }, "bin": { "cspell-grammar": "bin.mjs" @@ -774,41 +783,42 @@ } }, "node_modules/cspell-io": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.6.2.tgz", - "integrity": "sha512-VRBkAfUdbaq5yDYoVMvodQF3bIdBL6Gy4tiMvf+UI9C16am47AuThg1gGXRzwi5hCEXnCfevAmuVdaQP3onkow==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.6.4.tgz", + "integrity": "sha512-bmvJ4yn5QK2FZWTkZA4sx2qJqIi8BrUUUV7W209drSwkYjhJtXqP0RyF6Qx4Xuu2D1s0UilEtO5Jd+E9UJkQ6w==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "9.6.2", - "@cspell/url": "9.6.2" + "@cspell/cspell-service-bus": "9.6.4", + "@cspell/url": "9.6.4" }, "engines": { "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.6.2.tgz", - "integrity": "sha512-LvValIwqDAwVp2Www+7PPJ7UbVurYtKGPddpGH7GN+0u+UWzR4oUXR80gY8lHgSrIQ3EkdLhFAItPcyMjGjzIg==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.6.4.tgz", + "integrity": "sha512-fUodKcIHTwvokuowB25XyFzBxlk73yj1QRw2por3BxDz9fAim1zAIohAPAnGuzj3LowYnTMjHLYE7RFDUSxy5A==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.6.2", - "@cspell/cspell-performance-monitor": "9.6.2", - "@cspell/cspell-pipe": "9.6.2", - "@cspell/cspell-resolver": "9.6.2", - "@cspell/cspell-types": "9.6.2", - "@cspell/dynamic-import": "9.6.2", - "@cspell/filetypes": "9.6.2", - "@cspell/strong-weak-map": "9.6.2", - "@cspell/url": "9.6.2", + "@cspell/cspell-bundled-dicts": "9.6.4", + "@cspell/cspell-performance-monitor": "9.6.4", + "@cspell/cspell-pipe": "9.6.4", + "@cspell/cspell-resolver": "9.6.4", + "@cspell/cspell-types": "9.6.4", + "@cspell/dynamic-import": "9.6.4", + "@cspell/filetypes": "9.6.4", + "@cspell/rpc": "9.6.4", + "@cspell/strong-weak-map": "9.6.4", + "@cspell/url": "9.6.4", "clear-module": "^4.1.2", - "cspell-config-lib": "9.6.2", - "cspell-dictionary": "9.6.2", - "cspell-glob": "9.6.2", - "cspell-grammar": "9.6.2", - "cspell-io": "9.6.2", - "cspell-trie-lib": "9.6.2", - "env-paths": "^3.0.0", + "cspell-config-lib": "9.6.4", + "cspell-dictionary": "9.6.4", + "cspell-glob": "9.6.4", + "cspell-grammar": "9.6.4", + "cspell-io": "9.6.4", + "cspell-trie-lib": "9.6.4", + "env-paths": "^4.0.0", "gensequence": "^8.0.8", "import-fresh": "^3.3.1", "resolve-from": "^5.0.0", @@ -821,24 +831,27 @@ } }, "node_modules/cspell-trie-lib": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.6.2.tgz", - "integrity": "sha512-JpCHpMdxo680yEkb6U1y3wrhZGHltgCnaQ8Zj6yKE8KE0BTLVl9UQGisP5De1wlFn4GtpPCf7WtQ8+M5aqq3YQ==", + "version": "9.6.4", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.6.4.tgz", + "integrity": "sha512-JKwyRtyybbaTrixwI1OgU5Hvva2Z5zHVWl92WBa9U7KijAyiD/Ehp3T3DCYuBwGks7egw7MgWPySkXXnpme6mw==", "license": "MIT", "engines": { "node": ">=20" }, "peerDependencies": { - "@cspell/cspell-types": "9.6.2" + "@cspell/cspell-types": "9.6.4" } }, "node_modules/env-paths": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", - "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-4.0.0.tgz", + "integrity": "sha512-pxP8eL2SwwaTRi/KHYwLYXinDs7gL3jxFcBYmEdYfZmZXbaVDvdppd0XBU8qVz03rDfKZMXg1omHCbsJjZrMsw==", "license": "MIT", + "dependencies": { + "is-safe-filename": "^0.1.0" + }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -975,6 +988,18 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/is-safe-filename": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-safe-filename/-/is-safe-filename-0.1.1.tgz", + "integrity": "sha512-4SrR7AdnY11LHfDKTZY1u6Ga3RuxZdl3YKWWShO5iyuG5h8QS4GD2tOb04peBJ5I7pXbR+CGBNEhTcwK+FzN3g==", + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parent-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz", diff --git a/package.json b/package.json index eb342ba980..efb1721dd1 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.6.2" + "cspell": "^9.6.4" } } From 9b4d8b9a1362fb37cec7e7d47b10dc00e0ff2a58 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sat, 21 Feb 2026 13:06:57 +0100 Subject: [PATCH 783/845] Bump F# to 8.0 to compile with .NET 11 SDK This fixes the following compile error: ``` FSC : error FS3880: Language version '6.0' is out of support. The last .NET SDK supporting it is available at https://dotnet.microsoft.com/en-us/download/dotnet/10.0 ``` --- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 529597fa17..97234f4386 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -2,7 +2,7 @@ net6.0 - 6.0 + 8.0 true From d90aad344ea4a0aa4f8ddc2ea97c303fbeb412a4 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 14 Dec 2025 21:11:26 +0100 Subject: [PATCH 784/845] Improve reporting the differences between differently sized collections in BeEquivalentTo --- .../Common/EnumerableExtensions.cs | 15 ++ .../Common/StringExtensions.cs | 15 ++ .../Equivalency/ConversionSelector.cs | 2 +- .../CollectionMemberOptionsDecorator.cs | 2 + .../Equivalency/IEquivalencyOptions.cs | 5 + .../SelfReferenceEquivalencyOptions.cs | 13 + .../Steps/EnumerableEquivalencyValidator.cs | 219 +++++------------ ...numerableEquivalencyValidatorExtensions.cs | 53 ---- .../Equivalency/Steps/EnumerableExtensions.cs | 12 + .../Steps/IndexedItemCollection{T}.cs | 52 ++++ .../Equivalency/Steps/IndexedItem{T}.cs | 13 + .../LooselyOrderedEquivalencyStrategy.cs | 228 ++++++++++++++++++ .../Steps/ReadOnlyCollectionExtensions.cs | 57 +++++ .../StrictlyOrderedEquivalencyStrategy.cs | 58 +++++ .../Steps/StringEqualityEquivalencyStep.cs | 4 +- .../FluentAssertions/net47.verified.txt | 3 + .../FluentAssertions/net6.0.verified.txt | 3 + .../netstandard2.0.verified.txt | 3 + .../netstandard2.1.verified.txt | 3 + .../BasicSpecs.cs | 129 ++++++++++ .../CollectionSpecs.cs | 38 +-- .../DictionarySpecs.cs | 3 + .../NestedPropertiesSpecs.cs | 2 +- .../PerformanceSpecs.cs | 43 ++++ .../TracingSpecs.cs | 11 + ...CollectionAssertionSpecs.BeEquivalentTo.cs | 4 +- ...onAssertionOfStringSpecs.BeEquivalentTo.cs | 2 +- docs/_pages/about.md | 54 +++++ docs/_pages/objectgraphs.md | 25 +- docs/_pages/releases.md | 6 +- 30 files changed, 843 insertions(+), 234 deletions(-) delete mode 100644 Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidatorExtensions.cs create mode 100644 Src/FluentAssertions/Equivalency/Steps/EnumerableExtensions.cs create mode 100644 Src/FluentAssertions/Equivalency/Steps/IndexedItemCollection{T}.cs create mode 100644 Src/FluentAssertions/Equivalency/Steps/IndexedItem{T}.cs create mode 100644 Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs create mode 100644 Src/FluentAssertions/Equivalency/Steps/ReadOnlyCollectionExtensions.cs create mode 100644 Src/FluentAssertions/Equivalency/Steps/StrictlyOrderedEquivalencyStrategy.cs create mode 100644 Tests/FluentAssertions.Equivalency.Specs/PerformanceSpecs.cs diff --git a/Src/FluentAssertions/Common/EnumerableExtensions.cs b/Src/FluentAssertions/Common/EnumerableExtensions.cs index 25516424ef..b6a9718045 100644 --- a/Src/FluentAssertions/Common/EnumerableExtensions.cs +++ b/Src/FluentAssertions/Common/EnumerableExtensions.cs @@ -56,4 +56,19 @@ public static int IndexOfFirstDifferenceWith(this IEnumerable + /// Enumerates a sequence, returning each element along with its index. + /// + /// The type of the elements in the sequence. + /// The sequence to enumerate. + /// An enumerable of tuples, where each tuple contains the index and the element at that index in the sequence. + public static IEnumerable<(int Index, T Item)> Index(this IEnumerable items) + { + int index = 0; + foreach (var item in items) + { + yield return (index++, item); + } + } } diff --git a/Src/FluentAssertions/Common/StringExtensions.cs b/Src/FluentAssertions/Common/StringExtensions.cs index c8ae35d02d..f8e5c6b503 100644 --- a/Src/FluentAssertions/Common/StringExtensions.cs +++ b/Src/FluentAssertions/Common/StringExtensions.cs @@ -1,7 +1,11 @@ using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using System.Globalization; using System.Linq; +#if NET6_0_OR_GREATER +using System.Runtime.CompilerServices; +#endif using System.Text.RegularExpressions; using FluentAssertions.Formatting; @@ -179,5 +183,16 @@ public static string RenderAsIndentedBlock(this string message) return " \"" + string.Join(Environment.NewLine + " ", wrappedLines) + "\""; } + + /// + /// Simplifies setting the invariant culture when using interpolated strings. + /// +#if NET6_0_OR_GREATER + public static string Invariant(ref DefaultInterpolatedStringHandler formattable) + => string.Create(CultureInfo.InvariantCulture, ref formattable); +#else + public static string Invariant(FormattableString formattable) + => string.Create(CultureInfo.InvariantCulture, formattable); +#endif } diff --git a/Src/FluentAssertions/Equivalency/ConversionSelector.cs b/Src/FluentAssertions/Equivalency/ConversionSelector.cs index bf791f99c8..f0f8248a34 100644 --- a/Src/FluentAssertions/Equivalency/ConversionSelector.cs +++ b/Src/FluentAssertions/Equivalency/ConversionSelector.cs @@ -90,7 +90,7 @@ public override string ToString() { if (inclusions.Count == 0 && exclusions.Count == 0) { - return "Without automatic conversion."; + return "Without automatic conversion"; } var descriptionBuilder = new StringBuilder(); diff --git a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs index 05b87b5b92..df6f32a544 100644 --- a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs +++ b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs @@ -92,6 +92,8 @@ public EqualityStrategy GetEqualityStrategy(Type type) /// public bool IgnoreJsonPropertyCasing => inner.IgnoreJsonPropertyCasing; + public bool EnableFullDump => inner.EnableFullDump; + public ITraceWriter TraceWriter => inner.TraceWriter; } diff --git a/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs index 61a77d6efe..0fbd660e03 100644 --- a/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs @@ -132,4 +132,9 @@ public interface IEquivalencyOptions /// When set to true, the comparison will ignore the casing of JSON property names when comparing objects to JSON trees. /// bool IgnoreJsonPropertyCasing { get; } + + /// + /// Gets a value indicating whether the full dump of the subject should be included in the failure message. + /// + bool EnableFullDump { get; } } diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index 21c61fb668..8476cdda63 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -93,6 +93,7 @@ protected SelfReferenceEquivalencyOptions(IEquivalencyOptions defaults) includedFields = defaults.IncludedFields; ignoreNonBrowsableOnSubject = defaults.IgnoreNonBrowsableOnSubject; excludeNonBrowsableOnExpectation = defaults.ExcludeNonBrowsableOnExpectation; + EnableFullDump = defaults.EnableFullDump; IgnoreLeadingWhitespace = defaults.IgnoreLeadingWhitespace; IgnoreTrailingWhitespace = defaults.IgnoreTrailingWhitespace; IgnoreCase = defaults.IgnoreCase; @@ -212,6 +213,9 @@ EqualityStrategy IEquivalencyOptions.GetEqualityStrategy(Type type) public bool IgnoreJsonPropertyCasing { get; set; } + /// + public bool EnableFullDump { get; private set; } + public ITraceWriter TraceWriter { get; private set; } /// @@ -810,6 +814,15 @@ public TSelf WithTracing(ITraceWriter writer = null) return (TSelf)this; } + /// + /// Configures the equivalency options to include the full representation of the subject in assertion failure messages. + /// + public TSelf WithFullDump() + { + EnableFullDump = true; + return (TSelf)this; + } + /// /// Instructs the equivalency comparison to try to convert the values of /// matching properties before running any of the other steps. diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs index 5777630f5a..7f9e10445c 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs @@ -1,12 +1,10 @@ -#if !NET6_0_OR_GREATER -using System; -#endif using System.Collections.Generic; -using System.Globalization; using System.Linq; +using System.Text; using FluentAssertions.Equivalency.Execution; using FluentAssertions.Equivalency.Tracing; using FluentAssertions.Execution; +using static FluentAssertions.Common.StringExtensions; namespace FluentAssertions.Equivalency.Steps; @@ -14,208 +12,119 @@ namespace FluentAssertions.Equivalency.Steps; /// Executes a single equivalency assertion on two collections, optionally recursive and with or without strict ordering. /// [System.Diagnostics.StackTraceHidden] -internal class EnumerableEquivalencyValidator +internal class EnumerableEquivalencyValidator( + AssertionChain assertionChain, + IValidateChildNodeEquivalency parent, + IEquivalencyValidationContext context) { - private const int FailedItemsFastFailThreshold = 10; - - #region Private Definitions - - private readonly AssertionChain assertionChain; - private readonly IValidateChildNodeEquivalency parent; - private readonly IEquivalencyValidationContext context; - - #endregion - - public EnumerableEquivalencyValidator(AssertionChain assertionChain, IValidateChildNodeEquivalency parent, - IEquivalencyValidationContext context) - { - this.assertionChain = assertionChain; - this.parent = parent; - this.context = context; - } + private readonly Tracer tracer = context.Tracer; public required bool Recursive { get; init; } public required OrderingRuleCollection OrderingRules { get; init; } - public void Execute(object[] subject, T[] expectation) + public void Execute(object[] subjects, T[] expectations) { - if (AssertIsNotNull(expectation, subject) && AssertCollectionsHaveSameCount(subject, expectation)) + if (AssertIsNotNull(expectations, subjects)) { if (Recursive) { - using var _ = context.Tracer.WriteBlock(member => - string.Create(CultureInfo.InvariantCulture, - $"Structurally comparing {subject} and expectation {expectation} at {member.Expectation}")); + using var _ = tracer.WriteBlock(member => + Invariant($"Structurally comparing {subjects} and expectation {expectations} at {member.Expectation}")); - AssertElementGraphEquivalency(subject, expectation, context.CurrentNode); + ExecuteRecursiveAssertion(subjects, expectations); } else { - using var _ = context.Tracer.WriteBlock(member => - string.Create(CultureInfo.InvariantCulture, - $"Comparing subject {subject} and expectation {expectation} at {member.Expectation} using simple value equality")); + using var _ = tracer.WriteBlock(member => + Invariant( + $"Comparing subject {subjects} and expectation {expectations} at {member.Expectation} using simple value equality")); - subject.Should().BeEquivalentTo(expectation); + subjects.Should().BeEquivalentTo(expectations); } } } - private bool AssertIsNotNull(object expectation, object[] subject) + private bool AssertIsNotNull(T[] expectations, object[] subjects) { assertionChain - .ForCondition(expectation is not null) - .FailWith("Expected {context:subject} to be , but found {0}.", [subject]); + .ForCondition(expectations is not null) + .FailWith("Expected {context:subject} to be , but found {0}.", [subjects]); return assertionChain.Succeeded; } - private bool AssertCollectionsHaveSameCount(ICollection subject, ICollection expectation) + private void ExecuteRecursiveAssertion(object[] subjects, T[] expectation) { - assertionChain - .AssertEitherCollectionIsNotEmpty(subject, expectation) - .Then - .AssertCollectionHasEnoughItems(subject, expectation) - .Then - .AssertCollectionHasNotTooManyItems(subject, expectation); + List remainingSubjects = new(subjects); + List remainingExpectations = new(expectation); - return assertionChain.Succeeded; - } - - private void AssertElementGraphEquivalency(object[] subjects, T[] expectations, INode currentNode) - { - unmatchedSubjectIndexes = Enumerable.Range(0, subjects.Length).ToList(); - - if (OrderingRules.IsOrderingStrictFor(new ObjectInfo(new Comparands(subjects, expectations, typeof(T[])), currentNode))) + bool isOrderingStrict = IsOrderingStrictFor(remainingSubjects, remainingExpectations, context.CurrentNode); + if (isOrderingStrict) { - AssertElementGraphEquivalencyWithStrictOrdering(subjects, expectations); + new StrictlyOrderedEquivalencyStrategy(parent, context) + .FindAndRemoveMatches(remainingSubjects, remainingExpectations); } else { - AssertElementGraphEquivalencyWithLooseOrdering(subjects, expectations); + new LooselyOrderedEquivalencyStrategy(assertionChain, parent, context) + .FindAndRemoveMatches(remainingSubjects, remainingExpectations); } + + ReportRemainingOrMissingItems(remainingSubjects, remainingExpectations, subjects, expectation.Length, + isOrderingStrict ? "in order" : "in any order"); } - private void AssertElementGraphEquivalencyWithStrictOrdering(object[] subjects, T[] expectations) + private bool IsOrderingStrictFor(List subjects, List expectations, INode currentNode) { - int failedCount = 0; - - foreach (int index in Enumerable.Range(0, expectations.Length)) - { - T expectation = expectations[index]; - - using var _ = context.Tracer.WriteBlock(member => - string.Create(CultureInfo.InvariantCulture, - $"Strictly comparing expectation {expectation} at {member.Expectation} to item with index {index} in {subjects}")); - - bool succeeded = StrictlyMatchAgainst(subjects, expectation, index); - if (!succeeded) - { - failedCount++; - if (failedCount >= FailedItemsFastFailThreshold) - { - context.Tracer.WriteLine(member => - $"Aborting strict order comparison of collections after {FailedItemsFastFailThreshold} items failed at {member.Expectation}"); - - break; - } - } - } + return OrderingRules.IsOrderingStrictFor(new ObjectInfo(new Comparands(subjects, expectations, typeof(T[])), + currentNode)); } - private void AssertElementGraphEquivalencyWithLooseOrdering(object[] subjects, T[] expectations) - { - int failedCount = 0; +#pragma warning disable CA1305 - foreach (int index in Enumerable.Range(0, expectations.Length)) + private void ReportRemainingOrMissingItems(List remainingSubjects, List remainingExpectations, + object[] allSubjects, + int expectationLength, string orderingDescription) + { + if (remainingSubjects.Count > 0 || remainingExpectations.Count > 0) { - T expectation = expectations[index]; - - using var _ = context.Tracer.WriteBlock(member => - string.Create(CultureInfo.InvariantCulture, - $"Finding the best match of {expectation} within all items in {subjects} at {member.Expectation}[{index}]")); + StringBuilder message = new(); + string phrase = expectationLength switch + { + 0 => "be an empty collection", + 1 => "contain exactly one item", + _ => $"contain exactly {expectationLength} items {orderingDescription}" + }; - bool succeeded = LooselyMatchAgainst(subjects, expectation, index); + message.Append( + $"Expected {{context:collection}} to {phrase}{{reason}}, but "); - if (!succeeded) + if (remainingExpectations.Count > 0) { - failedCount++; - - if (failedCount >= FailedItemsFastFailThreshold) + message.Append("it misses {0}"); + if (remainingSubjects.Count > 0) { - context.Tracer.WriteLine(member => - $"Fail failing loose order comparison of collection after {FailedItemsFastFailThreshold} items failed at {member.Expectation}"); - - break; + message.Append(" and "); } } - } - } - - private List unmatchedSubjectIndexes; - - private bool LooselyMatchAgainst(IList subjects, T expectation, int expectationIndex) - { - var results = new AssertionResultSet(); - int index = 0; - - GetTraceMessage getMessage = member => - $"Comparing subject at {member.Subject}[{index}] with the expectation at {member.Expectation}[{expectationIndex}]"; - int indexToBeRemoved = -1; - - for (var metaIndex = 0; metaIndex < unmatchedSubjectIndexes.Count; metaIndex++) - { - index = unmatchedSubjectIndexes[metaIndex]; - object subject = subjects[index]; - - using var _ = context.Tracer.WriteBlock(getMessage); - string[] failures = TryToMatch(subject, expectation, expectationIndex); - - results.AddSet(index, failures); - - if (results.ContainsSuccessfulSet()) + if (remainingSubjects.Count > 0) { - context.Tracer.WriteLine(_ => "It's a match"); - indexToBeRemoved = metaIndex; - break; + phrase = remainingSubjects.Count > 1 ? "extraneous items" : "one extraneous item"; + message.Append($"found {phrase} {{1}}"); } - context.Tracer.WriteLine(_ => $"Contained {failures.Length} failures"); - } - - if (indexToBeRemoved != -1) - { - unmatchedSubjectIndexes.RemoveAt(indexToBeRemoved); - } + if (context.Options.EnableFullDump) + { + message.AppendLine(); + message.AppendLine(); + message.AppendLine("Full dump of {context:subject}: {2}"); + } - foreach (string failure in results.GetTheFailuresForTheSetWithTheFewestFailures(expectationIndex)) - { - assertionChain.AddPreFormattedFailure(failure); + assertionChain.FailWith(message.ToString(), remainingExpectations, + remainingSubjects.Count == 1 ? remainingSubjects.Single() : remainingSubjects, allSubjects); } - - return indexToBeRemoved != -1; - } - - private string[] TryToMatch(object subject, T expectation, int expectationIndex) - { - using var scope = new AssertionScope(); - - parent.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(T)), context.AsCollectionItem(expectationIndex)); - - return scope.Discard(); - } - - private bool StrictlyMatchAgainst(object[] subjects, T expectation, int expectationIndex) - { - using var scope = new AssertionScope(); - object subject = subjects[expectationIndex]; - IEquivalencyValidationContext equivalencyValidationContext = context.AsCollectionItem(expectationIndex); - - parent.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(T)), equivalencyValidationContext); - - bool failed = scope.HasFailures(); - return !failed; } } diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidatorExtensions.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidatorExtensions.cs deleted file mode 100644 index 8012d736c8..0000000000 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidatorExtensions.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections.Generic; -using FluentAssertions.Execution; - -namespace FluentAssertions.Equivalency.Steps; - -[System.Diagnostics.StackTraceHidden] -internal static class EnumerableEquivalencyValidatorExtensions -{ - public static Continuation AssertEitherCollectionIsNotEmpty(this AssertionChain assertionChain, - ICollection subject, - ICollection expectation) - { - return assertionChain - .WithExpectation("Expected {context:subject} to be a collection with {0} item(s){reason}", expectation.Count, - chain => chain - .ForCondition(subject.Count > 0 || expectation.Count == 0) - .FailWith(", but found an empty collection.") - .Then - .ForCondition(subject.Count == 0 || expectation.Count > 0) - .FailWith($", but {{0}}{Environment.NewLine}contains {{1}} item(s).", - subject, - subject.Count)); - } - - public static Continuation AssertCollectionHasEnoughItems(this AssertionChain assertionChain, ICollection subject, - ICollection expectation) - { - return assertionChain - .WithExpectation("Expected {context:subject} to be a collection with {0} item(s){reason}", expectation.Count, - chain => chain - .ForCondition(subject.Count >= expectation.Count) - .FailWith($", but {{0}}{Environment.NewLine}contains {{1}} item(s) less than{Environment.NewLine}{{2}}.", - subject, - expectation.Count - subject.Count, - expectation)); - } - - public static Continuation AssertCollectionHasNotTooManyItems(this AssertionChain assertionChain, - ICollection subject, - ICollection expectation) - { - return assertionChain - .WithExpectation("Expected {context:subject} to be a collection with {0} item(s){reason}", expectation.Count, - chain => chain - .ForCondition(subject.Count <= expectation.Count) - .FailWith($", but {{0}}{Environment.NewLine}contains {{1}} item(s) more than{Environment.NewLine}{{2}}.", - subject, - subject.Count - expectation.Count, - expectation)); - } -} - diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableExtensions.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableExtensions.cs new file mode 100644 index 0000000000..b2faeb9339 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableExtensions.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; + +namespace FluentAssertions.Equivalency.Steps; + +[System.Diagnostics.StackTraceHidden] +internal static class EnumerableExtensions +{ + /// + /// Converts an enumerable collection of into an . + /// + public static IndexedItemCollection ToIndexedList(this IEnumerable> source) => new(source); +} diff --git a/Src/FluentAssertions/Equivalency/Steps/IndexedItemCollection{T}.cs b/Src/FluentAssertions/Equivalency/Steps/IndexedItemCollection{T}.cs new file mode 100644 index 0000000000..246611af1d --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Steps/IndexedItemCollection{T}.cs @@ -0,0 +1,52 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace FluentAssertions.Equivalency.Steps; + +/// +/// Represents a collection of indexed items of type that implements . +/// +/// The type of elements in the collection. +[System.Diagnostics.StackTraceHidden] +internal class IndexedItemCollection : IReadOnlyList> +{ + private readonly List> items = new(); + + public IndexedItemCollection(IEnumerable source) + { + items = source.Select((item, index) => new IndexedItem(item, index)).ToList(); + } + + public IndexedItemCollection(IEnumerable> source) + { + items.AddRange(source); + } + + /// + public IEnumerator> GetEnumerator() => items.GetEnumerator(); + + /// + IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable)items).GetEnumerator(); + + public int Count => items.Count; + + /// + public IndexedItem this[int index] => items[index]; + + public void Remove(IndexedItem item) + { + items.Remove(item); + } + + /// + /// Removes items from the specified list of expectations that do not have a corresponding match + /// in the current collection. + /// + /// The list of expectations to be filtered by removing unmatched items. + public void RemoveMatchedItemFrom(List expectations) + { + var existingItems = new HashSet(items.Select(x => x.Item)); + expectations.RemoveAll(expectation => !existingItems.Contains(expectation)); + } +} diff --git a/Src/FluentAssertions/Equivalency/Steps/IndexedItem{T}.cs b/Src/FluentAssertions/Equivalency/Steps/IndexedItem{T}.cs new file mode 100644 index 0000000000..4f7b46082b --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Steps/IndexedItem{T}.cs @@ -0,0 +1,13 @@ +namespace FluentAssertions.Equivalency.Steps; + +/// +/// Encapsulates an item of type associated with an index. +/// +/// The type of the item being indexed. +[System.Diagnostics.StackTraceHidden] +internal class IndexedItem(T item, int index) +{ + public T Item { get; } = item; + + public int Index { get; } = index; +} diff --git a/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs b/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs new file mode 100644 index 0000000000..0f1512d039 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs @@ -0,0 +1,228 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Runtime.CompilerServices; +using FluentAssertions.Common; +using FluentAssertions.Equivalency.Tracing; +using FluentAssertions.Execution; + +namespace FluentAssertions.Equivalency.Steps; + +[System.Diagnostics.StackTraceHidden] +internal class LooselyOrderedEquivalencyStrategy( + AssertionChain assertionChain, + IValidateChildNodeEquivalency parent, + IEquivalencyValidationContext context) +{ + private const int MaximumFailuresToReport = 10; + + private readonly Tracer tracer = context.Tracer; + private Dictionary<(object Subject, object Expectation, int ExpectationIndex), string[]> failuresCache = new(); + + public void FindAndRemoveMatches(List subjects, List expectations) + { + failuresCache = new(new ReferentialComparer()); + + var expectationsWithIndexes = new IndexedItemCollection(expectations); + + // First find the exact matches and remove them from the collection + FindAndRemoveExactMatches(subjects, expectationsWithIndexes); + + // Reorder the remaining expectations based on their similarity to the remaining unmatched subjects. + expectationsWithIndexes = SortExpectationsByMinDistance(subjects, expectationsWithIndexes); + + // If there are still unmatched expectations, find the closest matches + FindAndRemoveClosestMatches(subjects, expectationsWithIndexes); + + // Remove the items that are no longer needed from the original list of expectations + expectationsWithIndexes.RemoveMatchedItemFrom(expectations); + } + + private void FindAndRemoveExactMatches(List subjects, IndexedItemCollection expectationsWithIndexes) + { + int expectationIndex = 0; + while (expectationsWithIndexes.Count > expectationIndex) + { + IndexedItem expectation = expectationsWithIndexes[expectationIndex]; + if (StrictlyMatchAgainst(subjects, expectation.Item, expectation.Index)) + { + // It's a full match, so we don't have to look at it again + expectationsWithIndexes.Remove(expectation); + } + else + { + // Continue with the next item, but we leave the unmatched items. + expectationIndex++; + } + } + } + + [SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope")] + private bool StrictlyMatchAgainst(List remainingSubjects, TExpectation expectation, int expectationIndex) + { + foreach ((int index, object subject) in remainingSubjects.Index()) + { + using var _ = tracer.WriteBlock(member => + $"Comparing subject at {member.Subject}[{index}] with the expectation at {member.Expectation}[{expectationIndex}]"); + + string[] failures = TryToMatch(expectation, subject, expectationIndex); + + if (failures.Length == 0) + { + tracer.WriteLine(_ => "It's a match"); + remainingSubjects.RemoveAt(index); + return true; + } + + tracer.WriteLine(_ => $"Contained {failures.Length} failures"); + } + + return false; + } + + /// + /// This is an optimization for loosely-ordered collection comparison. By processing expectations + /// that are most similar to remaining subjects first, the algorithm is more likely + /// to find the correct pairings earlier, leading to better error messages when mismatches occur. + /// + private IndexedItemCollection SortExpectationsByMinDistance(List remainingSubjects, + IndexedItemCollection expectationsWithIndexes) + { + if (remainingSubjects.Count > 0) + { + return expectationsWithIndexes + .Select(e => new + { + Expectation = e, + MinDistance = remainingSubjects.Min(a => TryToMatch(e.Item, a, e.Index).Length) + }) + .OrderBy(x => x.MinDistance) + .Select(x => x.Expectation) + .ToIndexedList(); + } + else + { + return expectationsWithIndexes; + } + } + + private void FindAndRemoveClosestMatches(List remainingSubjects, + IndexedItemCollection expectationsWithIndexes) + { + int nrFailures = 0; + if (expectationsWithIndexes.Count > 0 && remainingSubjects.Count > 0) + { + IReadOnlyList<(IndexedItem, object, string[])> bestMatches = + FindClosestMismatches(remainingSubjects, expectationsWithIndexes, TryToMatch); + + foreach (var (expectation, subject, failures) in bestMatches) + { + foreach (string failure in failures) + { + if (nrFailures < MaximumFailuresToReport) + { + assertionChain.AddPreFormattedFailure(failure); + nrFailures++; + } + } + + remainingSubjects.Remove(subject); + expectationsWithIndexes.Remove(expectation); + } + } + } + + private static IReadOnlyList<(IndexedItem Expectation, object Actual, string[] Failures)> FindClosestMismatches( + List remainingSubjects, IndexedItemCollection expectationsWithIndexes, + Func getFailures) + { + var bestScore = int.MaxValue; + List<(IndexedItem ExpectationWithIndex, object, string[] Failures)> bestSet = null; + + const int maxPermutations = 200_000; + int seen = 0; + + foreach (IReadOnlyList assignment in remainingSubjects.Permute()) + { + if (++seen > maxPermutations) + { + break; + } + + int score = 0; + var currentSet = new List<(IndexedItem ExpectationWithIndex, object, string[] Failures)>(); + + for (int index = 0; index < expectationsWithIndexes.Count && index < assignment.Count; index++) + { + IndexedItem expectationWithIndex = expectationsWithIndexes[index]; + + string[] failures = getFailures(expectationWithIndex.Item, assignment[index], expectationWithIndex.Index); + + int distance = failures.Length; + score += distance; + + if (score >= bestScore) + { + // No need to continue as we already have a better matching set + break; + } + + currentSet.Add((expectationWithIndex, assignment[index], failures)); + } + + if (score < bestScore) + { + bestScore = score; + bestSet = currentSet; + } + } + + return bestSet is not null ? bestSet : Array.Empty<(IndexedItem, object, string[])>(); + } + + private string[] TryToMatch(TExpectation expectation, object subject, int expectationIndex) + { + // Create a cache key based on the subject and expectation instances + var cacheKey = (subject, (object)expectation, expectationIndex); + + if (failuresCache.TryGetValue(cacheKey, out string[] cachedResult)) + { + return cachedResult; + } + + using var scope = new AssertionScope(); + + parent.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(TExpectation)), + context.AsCollectionItem(expectationIndex)); + + string[] failures = scope.Discard(); + failuresCache[cacheKey] = failures; + + return failures; + } + + /// + /// Provides a mechanism for comparing tuples that consist of a subject, an expectation, + /// and an expectation index. The comparison is based on object references and the expectation index. + /// + private sealed class ReferentialComparer : IEqualityComparer<(object Subject, object Expectation, int ExpectationIndex)> + { + public bool Equals((object Subject, object Expectation, int ExpectationIndex) x, + (object Subject, object Expectation, int ExpectationIndex) y) + { + return ReferenceEquals(x.Subject, y.Subject) + && ReferenceEquals(x.Expectation, y.Expectation) + && x.ExpectationIndex == y.ExpectationIndex; + } + + public int GetHashCode((object Subject, object Expectation, int ExpectationIndex) obj) + { + int hashCode = RuntimeHelpers.GetHashCode(obj.Subject); + hashCode = (hashCode * 397) + RuntimeHelpers.GetHashCode(obj.Expectation); + hashCode = (hashCode * 397) + obj.ExpectationIndex; + return hashCode; + } + } +} + diff --git a/Src/FluentAssertions/Equivalency/Steps/ReadOnlyCollectionExtensions.cs b/Src/FluentAssertions/Equivalency/Steps/ReadOnlyCollectionExtensions.cs new file mode 100644 index 0000000000..8b2ca781c1 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Steps/ReadOnlyCollectionExtensions.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace FluentAssertions.Equivalency.Steps; + +[System.Diagnostics.StackTraceHidden] +internal static class ReadOnlyCollectionExtensions +{ + /// + /// Generates all possible permutations of the given collection. + /// + /// The type of the elements in the collection. + /// The collection of items for which permutations are to be generated. + /// A sequence of all possible permutations, where each permutation is represented as a read-only list of elements. + public static IEnumerable> Permute(this IReadOnlyList items) + { + int[] indices = Enumerable.Range(0, items.Count).ToArray(); + + do + { + var result = new T[indices.Length]; + for (int index = 0; index < indices.Length; index++) + { + result[index] = items[indices[index]]; + } + + yield return result; + } + while (NextPermutation(indices)); + } + + private static bool NextPermutation(int[] indices) + { + int index = indices.Length - 2; + while (index >= 0 && indices[index] >= indices[index + 1]) + { + index--; + } + + if (index < 0) + { + return false; + } + + int j = indices.Length - 1; + while (indices[j] <= indices[index]) + { + j--; + } + + (indices[index], indices[j]) = (indices[j], indices[index]); + Array.Reverse(indices, index + 1, indices.Length - index - 1); + return true; + } + +} diff --git a/Src/FluentAssertions/Equivalency/Steps/StrictlyOrderedEquivalencyStrategy.cs b/Src/FluentAssertions/Equivalency/Steps/StrictlyOrderedEquivalencyStrategy.cs new file mode 100644 index 0000000000..b8ac038815 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Steps/StrictlyOrderedEquivalencyStrategy.cs @@ -0,0 +1,58 @@ +using System.Collections.Generic; +using FluentAssertions.Equivalency.Tracing; +using FluentAssertions.Execution; +using static FluentAssertions.Common.StringExtensions; + +namespace FluentAssertions.Equivalency.Steps; + +[System.Diagnostics.StackTraceHidden] +internal class StrictlyOrderedEquivalencyStrategy( + IValidateChildNodeEquivalency parent, + IEquivalencyValidationContext context) +{ + private const int FailedItemsFastFailThreshold = 10; + private readonly Tracer tracer = context.Tracer; + + public void FindAndRemoveMatches(List subjects, List expectations) + { + int failedCount = 0; + + int index = 0; + for (; index < expectations.Count && index < subjects.Count; index++) + { + TExpectation expectation = expectations[index]; + + int tempIndex = index; + using var _ = tracer.WriteBlock(member => + Invariant($"Strictly comparing expectation {expectation} at {member.Expectation} to item with index {tempIndex} in {subjects}")); + + bool succeeded = StrictlyMatchAgainst(subjects, expectation, index); + if (!succeeded) + { + failedCount++; + if (failedCount >= FailedItemsFastFailThreshold) + { + tracer.WriteLine(member => + $"Aborting strict order comparison of collections after {FailedItemsFastFailThreshold} items failed at {member.Expectation}"); + + break; + } + } + } + + subjects.RemoveRange(0, index); + expectations.RemoveRange(0, index); + } + + private bool StrictlyMatchAgainst(List subjects, T expectation, int expectationIndex) + { + using var scope = new AssertionScope(); + + object subject = subjects[expectationIndex]; + IEquivalencyValidationContext equivalencyValidationContext = context.AsCollectionItem(expectationIndex); + + parent.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(T)), equivalencyValidationContext); + + return !scope.HasFailures(); + } +} diff --git a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs index 0b06225076..29136acd53 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs @@ -101,8 +101,8 @@ private static bool ValidateSubjectIsString(AssertionChain assertionChain, Compa } assertionChain.FailWith( - "Expected {0} to be {1}, but found {2}.", currentNode.AsNonFormattable(), - comparands.RuntimeType, comparands.Subject.GetType()); + "Expected {0} to be of type {1}, but found {2} of type {3}.", currentNode.AsNonFormattable(), + comparands.RuntimeType, comparands.Subject, comparands.Subject.GetType()); return assertionChain.Succeeded; } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index e1e65f1112..b776b23e8d 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -755,6 +755,7 @@ namespace FluentAssertions.Equivalency bool? CompareRecordsByValue { get; } FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } FluentAssertions.Equivalency.CyclicReferenceHandling CyclicReferenceHandling { get; } + bool EnableFullDump { get; } FluentAssertions.Equivalency.EnumEquivalencyHandling EnumEquivalencyHandling { get; } bool ExcludeNonBrowsableOnExpectation { get; } bool IgnoreCase { get; } @@ -903,6 +904,7 @@ namespace FluentAssertions.Equivalency protected SelfReferenceEquivalencyOptions(FluentAssertions.Equivalency.IEquivalencyOptions defaults) { } public bool? CompareRecordsByValue { get; } public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } + public bool EnableFullDump { get; } public bool IgnoreCase { get; } public bool IgnoreJsonPropertyCasing { get; set; } public bool IgnoreLeadingWhitespace { get; } @@ -962,6 +964,7 @@ namespace FluentAssertions.Equivalency where TEqualityComparer : System.Collections.Generic.IEqualityComparer, new () { } public TSelf WithAutoConversion() { } public TSelf WithAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } + public TSelf WithFullDump() { } public TSelf WithStrictOrdering() { } public TSelf WithStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithStrictTyping() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 0dcf8a2edd..82ddd066a9 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -801,6 +801,7 @@ namespace FluentAssertions.Equivalency bool? CompareRecordsByValue { get; } FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } FluentAssertions.Equivalency.CyclicReferenceHandling CyclicReferenceHandling { get; } + bool EnableFullDump { get; } FluentAssertions.Equivalency.EnumEquivalencyHandling EnumEquivalencyHandling { get; } bool ExcludeNonBrowsableOnExpectation { get; } bool IgnoreCase { get; } @@ -954,6 +955,7 @@ namespace FluentAssertions.Equivalency protected SelfReferenceEquivalencyOptions(FluentAssertions.Equivalency.IEquivalencyOptions defaults) { } public bool? CompareRecordsByValue { get; } public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } + public bool EnableFullDump { get; } public bool IgnoreCase { get; } public bool IgnoreJsonPropertyCasing { get; set; } public bool IgnoreLeadingWhitespace { get; } @@ -1014,6 +1016,7 @@ namespace FluentAssertions.Equivalency where TEqualityComparer : System.Collections.Generic.IEqualityComparer, new () { } public TSelf WithAutoConversion() { } public TSelf WithAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } + public TSelf WithFullDump() { } public TSelf WithStrictOrdering() { } public TSelf WithStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithStrictTyping() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 58e186bea5..8ec208944d 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -747,6 +747,7 @@ namespace FluentAssertions.Equivalency bool? CompareRecordsByValue { get; } FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } FluentAssertions.Equivalency.CyclicReferenceHandling CyclicReferenceHandling { get; } + bool EnableFullDump { get; } FluentAssertions.Equivalency.EnumEquivalencyHandling EnumEquivalencyHandling { get; } bool ExcludeNonBrowsableOnExpectation { get; } bool IgnoreCase { get; } @@ -895,6 +896,7 @@ namespace FluentAssertions.Equivalency protected SelfReferenceEquivalencyOptions(FluentAssertions.Equivalency.IEquivalencyOptions defaults) { } public bool? CompareRecordsByValue { get; } public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } + public bool EnableFullDump { get; } public bool IgnoreCase { get; } public bool IgnoreJsonPropertyCasing { get; set; } public bool IgnoreLeadingWhitespace { get; } @@ -954,6 +956,7 @@ namespace FluentAssertions.Equivalency where TEqualityComparer : System.Collections.Generic.IEqualityComparer, new () { } public TSelf WithAutoConversion() { } public TSelf WithAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } + public TSelf WithFullDump() { } public TSelf WithStrictOrdering() { } public TSelf WithStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithStrictTyping() { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index a6e93047ac..ea9b1c521a 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -755,6 +755,7 @@ namespace FluentAssertions.Equivalency bool? CompareRecordsByValue { get; } FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } FluentAssertions.Equivalency.CyclicReferenceHandling CyclicReferenceHandling { get; } + bool EnableFullDump { get; } FluentAssertions.Equivalency.EnumEquivalencyHandling EnumEquivalencyHandling { get; } bool ExcludeNonBrowsableOnExpectation { get; } bool IgnoreCase { get; } @@ -903,6 +904,7 @@ namespace FluentAssertions.Equivalency protected SelfReferenceEquivalencyOptions(FluentAssertions.Equivalency.IEquivalencyOptions defaults) { } public bool? CompareRecordsByValue { get; } public FluentAssertions.Equivalency.ConversionSelector ConversionSelector { get; } + public bool EnableFullDump { get; } public bool IgnoreCase { get; } public bool IgnoreJsonPropertyCasing { get; set; } public bool IgnoreLeadingWhitespace { get; } @@ -962,6 +964,7 @@ namespace FluentAssertions.Equivalency where TEqualityComparer : System.Collections.Generic.IEqualityComparer, new () { } public TSelf WithAutoConversion() { } public TSelf WithAutoConversionFor(System.Linq.Expressions.Expression> predicate) { } + public TSelf WithFullDump() { } public TSelf WithStrictOrdering() { } public TSelf WithStrictOrderingFor(System.Linq.Expressions.Expression> predicate) { } public TSelf WithStrictTyping() { } diff --git a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs index e68426d0a0..a09059ff51 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs @@ -917,5 +917,134 @@ public void The_entire_subject_and_expectation_can_be_included_in_the_failure() // Assert act.Should().Throw().WithMessage("*Full expectation*"); } + + [Fact] + public void Reports_all_relevant_details_to_understand_the_differences() + { + // Arrange + var actual = new[] + { + new Customer + { + Age = 13, + Name = "Jits" + }, + new Customer + { + Age = 16, + Name = "Teddie" + } + }; + + // Act + var act = () => actual.Should().BeEquivalentTo([ + new Customer + { + Age = 52, + Name = "Dennis" + } + ], opt => opt.Excluding(x => x.Id)); + + // Assert + act.Should().Throw().WithMessage( + """ + Expected property actual[0].Name to be "Dennis" with a length of 6, but "Jits" has a length of 4, differs near "Jit" (index 0). + Expected property actual[0].Age to be 52, but found 13. + Expected actual to contain exactly one item, but found one extraneous item FluentAssertions.Equivalency.Specs.Customer + { + Age = 16, + Birthdate = <0001-01-01 00:00:00.000>, + Id = 0L, + Name = "Teddie" + } + + With configuration: + - Prefer the declared type of the members + - Compare enums by value + - Compare tuples by their properties + - Compare anonymous types by their properties + - Compare records by their members + - Include non-browsable members + - Include all non-private properties + - Include all non-private fields + - Exclude member Id + - Match (JSON) member by name (or throw) + - Be strict about the order of items in byte arrays + - Without automatic conversion + """); + } + + [Fact] + public void Reports_all_relevant_details_to_understand_the_differences_including_the_full_dump() + { + // Arrange + var actual = new[] + { + new Customer + { + Age = 13, + Name = "Jits" + }, + new Customer + { + Age = 16, + Name = "Teddie" + } + }; + + // Act + var act = () => actual.Should().BeEquivalentTo([ + new Customer + { + Age = 52, + Name = "Dennis" + } + ], opt => opt.Excluding(x => x.Id).WithFullDump()); + + // Assert + act.Should().Throw().WithMessage( + """ + Expected property actual[0].Name to be "Dennis" with a length of 6, but "Jits" has a length of 4, differs near "Jit" (index 0). + Expected property actual[0].Age to be 52, but found 13. + Expected actual to contain exactly one item, but found one extraneous item FluentAssertions.Equivalency.Specs.Customer + { + Age = 16, + Birthdate = <0001-01-01 00:00:00.000>, + Id = 0L, + Name = "Teddie" + } + + Full dump of actual: { + FluentAssertions.Equivalency.Specs.Customer + { + Age = 13, + Birthdate = <0001-01-01 00:00:00.000>, + Id = 0L, + Name = "Jits" + }, + FluentAssertions.Equivalency.Specs.Customer + { + Age = 16, + Birthdate = <0001-01-01 00:00:00.000>, + Id = 0L, + Name = "Teddie" + } + } + + With configuration: + - Prefer the declared type of the members + - Compare enums by value + - Compare tuples by their properties + - Compare anonymous types by their properties + - Compare records by their members + - Include non-browsable members + - Include all non-private properties + - Include all non-private fields + - Exclude member Id + - Match (JSON) member by name (or throw) + - Be strict about the order of items in byte arrays + - Without automatic conversion + """); + } } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs index 15e8bd9b0d..c5e910ecb7 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs @@ -197,18 +197,18 @@ public void When_the_expectation_is_an_array_of_interface_type_it_should_respect public void When_the_expectation_has_fewer_dimensions_than_a_multi_dimensional_subject_it_should_fail() { // Arrange - object objectA = new(); - object objectB = new(); + string objectA = "A"; + string objectB = "B"; - object[][] actual = [[objectA, objectB]]; - var expected = actual[0]; + string[][] actual = [[objectA, objectB]]; + string[] expected = actual[0]; // Act Action act = () => actual.Should().BeEquivalentTo(expected); // Assert act.Should().Throw() - .WithMessage("*be a collection with 2 item(s)*contains 1 item(s) less than*", + .WithMessage("*actual[0] to be of type System.String, but found {\"A\", \"B\"} of type System.String[]*", "adding a `params object[]` overload cannot distinguish 'an array of objects' from 'an element which is an array of objects'"); } @@ -288,7 +288,7 @@ public void When_a_collection_does_not_match_it_should_include_items_in_message( // Assert action.Should().Throw() - .WithMessage("Expected*but*{1, 2}*1 item(s) less than*{3, 2, 1}*"); + .WithMessage("Expected subject to contain exactly 3 items in any order, but it misses {3}*"); } [Fact] @@ -300,10 +300,10 @@ public void When_collection_of_same_count_does_not_match_it_should_include_at_mo var expectation = Enumerable.Repeat(20, subject.Length).ToArray(); // Act - Action action = () => subject.Should().BeEquivalentTo(expectation); + var act = () => subject.Should().BeEquivalentTo(expectation); // Assert - action.Should().Throw().Which + act.Should().Throw().Which .Message.Should().Contain("[9]").And.NotContain("[10]"); } @@ -378,14 +378,20 @@ public void When_a_collection_contains_less_items_than_expected_it_should_throw( // Assert act.Should().Throw() .WithMessage( - "*Customers*to be a collection with 2 item(s), but*contains 1 item(s) less than*"); + "*Expected property subject.Customers to contain exactly 2 items in any order, but it misses*"); } [Fact] public void When_a_collection_contains_more_items_than_expected_it_should_throw() { // Arrange - var expected = new { Customers = new[] { new Customer { Age = 38, Birthdate = 20.September(1973), Name = "John" } } }; + var expected = new + { + Customers = new[] + { + new Customer { Age = 38, Birthdate = 20.September(1973), Name = "John" } + } + }; var subject = new { @@ -402,7 +408,7 @@ public void When_a_collection_contains_more_items_than_expected_it_should_throw( // Assert act.Should().Throw() .WithMessage( - "*Customers*to be a collection with 1 item(s), but*contains 1 item(s) more than*"); + "*Customers*to contain exactly one item, but found one extraneous*"); } [Fact] @@ -1385,7 +1391,7 @@ public void When_an_unordered_collection_must_be_strict_using_a_predicate_it_sho // Assert action.Should().Throw() - .WithMessage("*Expected*[0].UnorderedCollection*5 item(s)*empty collection*"); + .WithMessage("*Expected subject[0].UnorderedCollection[4] to be 1, but found 5*"); } [Fact] @@ -1442,7 +1448,7 @@ public void When_an_unordered_collection_must_be_strict_using_an_expression_it_s // Assert action.Should().Throw() .WithMessage( - "*Expected*[0].UnorderedCollection*5 item(s)*empty collection*"); + "*Expected subject[0].UnorderedCollection[4] to be 1, but found 5*"); } [Fact] @@ -1467,7 +1473,7 @@ public void Can_force_strict_ordering_based_on_the_parent_type_of_an_unordered_c // Assert action.Should().Throw() - .WithMessage("*Expected*[0].UnorderedCollection*5 item(s)*empty collection*"); + .WithMessage("*Expected subject[0].UnorderedCollection[4] to be 1, but found 5*"); } [Fact] @@ -2191,7 +2197,7 @@ public void When_the_subject_contains_less_items_than_expected_it_should_throw() // Assert action.Should().Throw() .WithMessage( - "*subject*to be a collection with 2 item(s), but*contains 1 item(s) less than*"); + "*Expected subject to contain exactly 2 items in any order, but it misses*Age = 24*"); } [Fact] @@ -2216,7 +2222,7 @@ public void When_the_subject_contains_more_items_than_expected_it_should_throw() // Assert action.Should().Throw() .WithMessage( - "Expected subject*to be a collection with 1 item(s), but*contains 1 item(s) more than*"); + "*Expected subject to contain exactly one item, but found one extraneous item*Age = 24*"); } [Fact] diff --git a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs index ba15c61d19..553ca245e5 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/DictionarySpecs.cs @@ -1199,6 +1199,7 @@ public void When_a_custom_rule_is_applied_on_a_dictionary_it_should_apply_it_on_ [Fact] public void Passing_the_reason_to_the_inner_equivalency_assertion_works() { + // Arrange var subject = new Dictionary { ["a"] = new List() @@ -1209,8 +1210,10 @@ public void Passing_the_reason_to_the_inner_equivalency_assertion_works() ["a"] = new List { 42 } }; + // Act Action act = () => subject.Should().BeEquivalentTo(expected, "FOO {0}", "BAR"); + // Assert act.Should().Throw().WithMessage("*FOO BAR*"); } diff --git a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs index c4ca546adb..7614238b37 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/NestedPropertiesSpecs.cs @@ -125,7 +125,7 @@ public void When_not_all_the_properties_of_the_nested_objects_are_equal_it_shoul "- Compare records by their members*" + "- Match (JSON) member by name (or throw)*" + "- Be strict about the order of items in byte arrays*" + - "- Without automatic conversion.*"); + "- Without automatic conversion*"); } [Fact] diff --git a/Tests/FluentAssertions.Equivalency.Specs/PerformanceSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/PerformanceSpecs.cs new file mode 100644 index 0000000000..f3affd4b82 --- /dev/null +++ b/Tests/FluentAssertions.Equivalency.Specs/PerformanceSpecs.cs @@ -0,0 +1,43 @@ +using System.Linq; +using Xunit; + +namespace FluentAssertions.Equivalency.Specs; + +public class PerformanceSpecs +{ + [Fact(Skip = "Performance test")] + public void Compare_complex_collection() + { + int n = 500; + var subject = Enumerable.Range(0, n).Select(index => Create(index)).ToArray(); + var expected = Enumerable.Range(n, n).Select(index => Create(index)).ToArray(); + + subject.Should().BeEquivalentTo(expected, e => e.WithoutStrictOrdering()); + } + + private object Create(int index) => new + { + Value = index, + Name = $"Item-{index}-{new string((char)('A' + (index % 26)), 50)}", + Description = $"Description for item number {index} with extra padding {new string('x', 100)}", + Category = $"Category-{index % 10}", + Nested = new + { + Id = index * 100, + Label = $"Nested-{index}-{new string('z', 50)}", + SubNested = new + { + Code = index * 1000, + Data = $"Data-{index}-{new string('y', 80)}" + } + }, + Meta = new + { + K1 = index, + K2 = index * 2, + K3 = index * 3, + K4 = index * 4, + K5 = index * 5 + } + }; +} diff --git a/Tests/FluentAssertions.Equivalency.Specs/TracingSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/TracingSpecs.cs index 617f4fc276..dad037e49c 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/TracingSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/TracingSpecs.cs @@ -31,4 +31,15 @@ public void Tracing_must_be_safe_when_executed_concurrently() AssertionEngine.ResetToDefaults(); } } + + [Fact] + public void Can_trace_the_internals() + { + // Act + var act = () => new { A = "a" }.Should().BeEquivalentTo(new { A = "b" }, opt => opt.WithTracing()); + + // Assert + act.Should().Throw() + .WithMessage("*With trace:*"); + } } diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs index 60a28858db..cf82eecbe2 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs @@ -58,7 +58,7 @@ public void When_collections_are_not_equivalent_it_should_throw() // Assert act.Should().Throw().WithMessage( - "Expected*collection*2 item(s)*we treat all alike, but *1 item(s) more than*"); + "Expected collection1*2 items*we treat all alike, but*extraneous item 3*"); } [Fact] @@ -88,7 +88,7 @@ public void When_testing_for_equivalence_against_empty_collection_it_should_thro // Assert act.Should().Throw().WithMessage( - "Expected subject to be a collection with 0 item(s), but*contains 3 item(s)*"); + "Expected subject to be an empty collection, but found extraneous items*1*2*3*"); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEquivalentTo.cs index d23523d701..dec6a71f34 100644 --- a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEquivalentTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEquivalentTo.cs @@ -53,7 +53,7 @@ public void When_testing_for_equivalence_against_empty_collection_it_should_thro // Assert act.Should().Throw().WithMessage( - "Expected subject*to be a collection with 0 item(s), but*contains 3 item(s)*"); + "Expected subject to be an empty collection, but found extraneous items*one*two*three*"); } [Fact] diff --git a/docs/_pages/about.md b/docs/_pages/about.md index 8c0b9e9e6e..b04b499378 100644 --- a/docs/_pages/about.md +++ b/docs/_pages/about.md @@ -37,6 +37,60 @@ will fail with: > Expected numbers to have an item matching (item > 3) because at least 1 item should be larger than 3. +Another example of the power of Fluent Assertions is how you can compare collections. For example, consider the following test: + +```csharp +var actual = new[] +{ + new Customer + { + Age = 13, + Name = "John" + }, + new Customer + { + Age = 16, + Name = "Frank" + } +}; + +actual.Should().BeEquivalentTo([ + new Customer + { + Age = 52, + Name = "James" + } +], opt => opt.Excluding(x => x.Id)); +``` + +This test will fail with the following details: + +``` +Expected property actual[0].Name to be "James" with a length of 6, but "John" has a length of 4, differs near "Joh" (index 0). +Expected property actual[0].Age to be 52, but found 13. +Expected actual to contain exactly one item, but found one extraneous item FluentAssertions.Equivalency.Specs.Customer +{ + Age = 16, + Birthdate = <0001-01-01 00:00:00.000>, + Id = 0L, + Name = "Frank" +} + +With configuration: +- Prefer the declared type of the members +- Compare enums by value +- Compare tuples by their properties +- Compare anonymous types by their properties +- Compare records by their members +- Include non-browsable members +- Include all non-private properties +- Include all non-private fields +- Exclude member Id +- Match (JSON) member by name (or throw) +- Be strict about the order of items in byte arrays +- Without automatic conversion +``` + ## Supported Frameworks and Libraries Fluent Assertions cross-compiles to .NET Framework 4.7, as well as .NET 6, .NET Standard 2.0 and 2.1. diff --git a/docs/_pages/objectgraphs.md b/docs/_pages/objectgraphs.md index 89981f50dc..86c2dab1fe 100644 --- a/docs/_pages/objectgraphs.md +++ b/docs/_pages/objectgraphs.md @@ -501,7 +501,7 @@ orderDto.Should().BeEquivalentTo(expectation, options => options.WithoutStrictOr `Should().BeEquivalentTo` is a very powerful feature, and one of the unique selling points of Fluent Assertions. But sometimes it can be a bit overwhelming, especially if some assertion fails under unexpected conditions. To help you understand how Fluent Assertions compared two (collections of) object graphs, the failure message will always include the relevant configuration settings: -```csharp +``` Xunit.Sdk.XunitException Expected item[0] to be 0x06, but found 0x01. Expected item[1] to be 0x05, but found 0x02. @@ -519,7 +519,28 @@ With configuration: - Be strict about the order of items in byte arrays ``` -However, sometimes that's not enough. For those scenarios where you need to understand a bit more, you can add the `WithTracing` option. When added to the assertion call, it would extend the above output with something like this: +For more complicated comparisons where some items match, some items are missing or some items are unexpected, it might be useful to dump the entire contents of the subject-under-test. You can do this using the `WithFullDump` option. This will add something like this to the failure message. + +``` +Full dump of actual: { + FluentAssertions.Equivalency.Specs.Customer + { + Age = 13, + Birthdate = <0001-01-01 00:00:00.000>, + Id = 0L, + Name = "Jits" + }, + FluentAssertions.Equivalency.Specs.Customer + { + Age = 16, + Birthdate = <0001-01-01 00:00:00.000>, + Id = 0L, + Name = "Teddie" + } +} +``` + +However, sometimes even that is not enough. For those scenarios where you need to understand a bit more, you can add the `WithTracing` option. When added to the assertion call, it would extend the above output with something like this: ```text With trace: diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 1bff992eb7..7715cbbc4b 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -12,7 +12,10 @@ sidebar: ### What's new * Added `Excluding()` and `Excluding(Type)` overloads to exclude all members of a certain type from equivalency comparisons - [#3115](https://github.com/fluentassertions/fluentassertions/pull/3115) -* New overloads of `BeXmlSerializable` and `BeDataContractSerializable` that allow `EquivalencyOptions` to be configured, allowing the use of member selection rules. - [#3107](https://github.com/fluentassertions/fluentassertions/pull/3107) +* `BeEquivalentTo` will now report the missing or extraneous items for differently sized collections - [#3133](https://github.com/fluentassertions/fluentassertions/pull/3133) + +### Enhancements +* Added option `WithFullDump` to `BeEquivalentTo` to include the entire contents of the subject-under-test in the failure message - [#3133](https://github.com/fluentassertions/fluentassertions/pull/3133) ### Fixes @@ -24,6 +27,7 @@ sidebar: * Added `WithoutMessage` to allow asserting an exception message does not contain a wildcard pattern - [#3100](https://github.com/fluentassertions/fluentassertions/pull/3100) * Added support for MSTest 4 - [#3111](https://github.com/fluentassertions/fluentassertions/pull/3111) +* New overloads of `BeXmlSerializable` and `BeDataContractSerializable` that allow `EquivalencyOptions` to be configured, allowing the use of member selection rules. - [#3107](https://github.com/fluentassertions/fluentassertions/pull/3107) ### Enhancements From 268fee5cc5bcdbacf43f86215f269aa1402f21af Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Thu, 19 Feb 2026 20:28:56 +0100 Subject: [PATCH 785/845] Improve reporting the subject when chaining Throw and Which --- Src/FluentAssertions/CallerIdentifier.cs | 20 +++++++++++++++++++ .../Execution/AssertionChain.cs | 16 +++++++++++++-- .../Execution/SubjectIdentificationBuilder.cs | 12 +++++++++++ .../Specialized/AsyncFunctionAssertions.cs | 2 +- .../Specialized/DelegateAssertionsBase.cs | 7 ++++++- .../FluentAssertions/net47.verified.txt | 3 ++- .../FluentAssertions/net6.0.verified.txt | 3 ++- .../netstandard2.0.verified.txt | 3 ++- .../netstandard2.1.verified.txt | 3 ++- .../Exceptions/MiscellaneousExceptionSpecs.cs | 19 +++++++++++++++++- 10 files changed, 79 insertions(+), 9 deletions(-) diff --git a/Src/FluentAssertions/CallerIdentifier.cs b/Src/FluentAssertions/CallerIdentifier.cs index af437bbcaf..a13e0af809 100644 --- a/Src/FluentAssertions/CallerIdentifier.cs +++ b/Src/FluentAssertions/CallerIdentifier.cs @@ -92,6 +92,14 @@ public static string[] DetermineCallerIdentities() return callers; } + /// + /// Represents a specific point in the call stack to facilitate skipping over internal FluentAssertions + /// frames when analyzing stack traces for caller identification. + /// + /// + /// Instances of this class are used to track and adjust starting points for stack trace searches, + /// ensuring that FluentAssertions internal frames are excluded from caller identification processes. + /// private sealed class StackFrameReference : IDisposable { public int SkipStackFrameCount { get; } @@ -126,11 +134,23 @@ public void Dispose() private static readonly AsyncLocal StartStackSearchAfterStackFrame = new(); + /// + /// Temporarily adjusts the stack trace search behavior to focus on the current scope during Fluent Assertions evaluations. + /// + /// An object that reverts the stack trace search behavior upon disposal. internal static IDisposable OverrideStackSearchUsingCurrentScope() { return new StackFrameReference(); } + /// + /// Determines whether there is only one Fluent Assertions scope present in the current call stack. + /// This is used to identify if a nested Fluent Assertions scope exists within the stack trace. + /// + /// + /// A boolean value indicating true if only one Fluent Assertions scope exists on the call stack; + /// otherwise, false. + /// internal static bool OnlyOneFluentAssertionScopeOnCallStack() { var allStackFrames = GetFrames(new StackTrace()); diff --git a/Src/FluentAssertions/Execution/AssertionChain.cs b/Src/FluentAssertions/Execution/AssertionChain.cs index 07a2c20c98..05f1f8fe74 100644 --- a/Src/FluentAssertions/Execution/AssertionChain.cs +++ b/Src/FluentAssertions/Execution/AssertionChain.cs @@ -32,9 +32,10 @@ public sealed class AssertionChain /// /// Ensures that the next call to will reuse the current instance. /// - public void ReuseOnce() + public AssertionChain ReuseOnce() { Instance.Value = this; + return this; } /// @@ -288,7 +289,17 @@ public void OverrideCallerIdentifier(Func getCallerIdentifier) public AssertionChain WithCallerPostfix(string postfix) { identifierBuilder.UsePostfix(postfix); + return this; + } + /// + /// Adds a specified prefix to the caller identifier used in the current assertion chain. + /// + /// The prefix to prepend to the caller identifier. + /// An updated instance of with the specified prefix applied. + public AssertionChain WithCallerPrefix(string prefix) + { + identifierBuilder.UsePrefix(prefix); return this; } @@ -296,9 +307,10 @@ public AssertionChain WithCallerPostfix(string postfix) /// Marks the next assertion as being part of a chained call to Should where it needs to find the next /// caller identifier. /// - internal void AdvanceToNextIdentifier() + internal AssertionChain AdvanceToNextIdentifier() { identifierBuilder.AdvanceToNextSubject(); + return this; } /// diff --git a/Src/FluentAssertions/Execution/SubjectIdentificationBuilder.cs b/Src/FluentAssertions/Execution/SubjectIdentificationBuilder.cs index 7ffee1cf36..cbeae9f658 100644 --- a/Src/FluentAssertions/Execution/SubjectIdentificationBuilder.cs +++ b/Src/FluentAssertions/Execution/SubjectIdentificationBuilder.cs @@ -59,6 +59,18 @@ public void OverrideSubjectIdentifier(Func getSubject) this.getSubject = getSubject; } + /// + /// Prepends the given prefix to the current subject and combines that with next subject. + /// + /// The prefix to prepend to the current subject. + public void UsePrefix(string prefix) + { + var localIndex = identifierIndex; + getSubject = () => (prefix + GetIdentifier(localIndex)).Combine(GetIdentifier(localIndex + 1)); + + HasOverriddenIdentifier = true; + } + /// /// Appends the given postfix to the current subject and combines that with next subject. /// diff --git a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs index a775860198..f0e651a3dd 100644 --- a/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs +++ b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs @@ -368,7 +368,7 @@ private protected static async Task InvokeWithInterceptionAsync(Func< // not "await action". using (CallerIdentifier.OnlyOneFluentAssertionScopeOnCallStack() ? CallerIdentifier.OverrideStackSearchUsingCurrentScope() - : default) + : null) { await action(); } diff --git a/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs b/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs index b405cf6869..dd75daf1cf 100644 --- a/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs +++ b/Src/FluentAssertions/Specialized/DelegateAssertionsBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; @@ -53,6 +53,11 @@ protected ExceptionAssertions ThrowInternal( exception?.GetType(), exception)); + AssertionChain.GetOrCreate() + .ReuseOnce() + .AdvanceToNextIdentifier() + .WithCallerPrefix($"{typeof(TException).Name}."); + return new ExceptionAssertions(expectedExceptions, assertionChain); } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index b776b23e8d..1f3f08404c 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -1197,8 +1197,9 @@ namespace FluentAssertions.Execution public FluentAssertions.Execution.AssertionChain ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } public void OverrideCallerIdentifier(System.Func getCallerIdentifier) { } - public void ReuseOnce() { } + public FluentAssertions.Execution.AssertionChain ReuseOnce() { } public FluentAssertions.Execution.AssertionChain WithCallerPostfix(string postfix) { } + public FluentAssertions.Execution.AssertionChain WithCallerPrefix(string prefix) { } public FluentAssertions.Execution.AssertionChain WithDefaultIdentifier(string identifier) { } public FluentAssertions.Execution.Continuation WithExpectation(string message, System.Action chain) { } public FluentAssertions.Execution.Continuation WithExpectation(string message, object arg1, System.Action chain) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 82ddd066a9..e3680a0382 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -1280,8 +1280,9 @@ namespace FluentAssertions.Execution public FluentAssertions.Execution.AssertionChain ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } public void OverrideCallerIdentifier(System.Func getCallerIdentifier) { } - public void ReuseOnce() { } + public FluentAssertions.Execution.AssertionChain ReuseOnce() { } public FluentAssertions.Execution.AssertionChain WithCallerPostfix(string postfix) { } + public FluentAssertions.Execution.AssertionChain WithCallerPrefix(string prefix) { } public FluentAssertions.Execution.AssertionChain WithDefaultIdentifier(string identifier) { } public FluentAssertions.Execution.Continuation WithExpectation(string message, System.Action chain) { } public FluentAssertions.Execution.Continuation WithExpectation(string message, object arg1, System.Action chain) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index 8ec208944d..54323469e5 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -1141,8 +1141,9 @@ namespace FluentAssertions.Execution public FluentAssertions.Execution.AssertionChain ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } public void OverrideCallerIdentifier(System.Func getCallerIdentifier) { } - public void ReuseOnce() { } + public FluentAssertions.Execution.AssertionChain ReuseOnce() { } public FluentAssertions.Execution.AssertionChain WithCallerPostfix(string postfix) { } + public FluentAssertions.Execution.AssertionChain WithCallerPrefix(string prefix) { } public FluentAssertions.Execution.AssertionChain WithDefaultIdentifier(string identifier) { } public FluentAssertions.Execution.Continuation WithExpectation(string message, System.Action chain) { } public FluentAssertions.Execution.Continuation WithExpectation(string message, object arg1, System.Action chain) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index ea9b1c521a..49585cdd18 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -1197,8 +1197,9 @@ namespace FluentAssertions.Execution public FluentAssertions.Execution.AssertionChain ForConstraint(FluentAssertions.OccurrenceConstraint constraint, int actualOccurrences) { } public FluentAssertions.Execution.GivenSelector Given(System.Func selector) { } public void OverrideCallerIdentifier(System.Func getCallerIdentifier) { } - public void ReuseOnce() { } + public FluentAssertions.Execution.AssertionChain ReuseOnce() { } public FluentAssertions.Execution.AssertionChain WithCallerPostfix(string postfix) { } + public FluentAssertions.Execution.AssertionChain WithCallerPrefix(string prefix) { } public FluentAssertions.Execution.AssertionChain WithDefaultIdentifier(string identifier) { } public FluentAssertions.Execution.Continuation WithExpectation(string message, System.Action chain) { } public FluentAssertions.Execution.Continuation WithExpectation(string message, object arg1, System.Action chain) { } diff --git a/Tests/FluentAssertions.Specs/Exceptions/MiscellaneousExceptionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/MiscellaneousExceptionSpecs.cs index ebf4a2aa4e..e2a091388e 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/MiscellaneousExceptionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/MiscellaneousExceptionSpecs.cs @@ -47,7 +47,6 @@ public void When_validating_a_subject_against_multiple_conditions_it_should_supp // Act / Assert testSubject - .Should().Throw() .WithInnerException() .WithMessage("inner message"); @@ -199,4 +198,22 @@ public void When_a_method_throws_with_a_non_matching_parameter_name_it_should_fa act.Should().Throw() .WithMessage("*with parameter name \"someParameter\"*we want to test the failure message*\"someOtherParameter\"*"); } + + [Fact] + public void Reports_the_exception_type_for_chained_assertions() + { + // Arrange + Action throwingAction = () => throw new SomeException(); + + // Act + var act = () => throwingAction.Should().Throw().Which.Property.Should().Be("Value"); + + // Assert + act.Should().Throw().WithMessage("*SomeException*Value*"); + } + + private class SomeException : Exception + { + public string Property { get; } = "OtherValue"; + } } From 74db96dc906aba0a76e6445b5a96a82a21c477f2 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 22 Feb 2026 08:40:22 +0100 Subject: [PATCH 786/845] Added missing release notes --- docs/_pages/releases.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 7715cbbc4b..7709e4e7af 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -16,6 +16,8 @@ sidebar: ### Enhancements * Added option `WithFullDump` to `BeEquivalentTo` to include the entire contents of the subject-under-test in the failure message - [#3133](https://github.com/fluentassertions/fluentassertions/pull/3133) +* Remove FluentAssertions code from the stack trace when an assertion fails - [#3152](https://github.com/fluentassertions/fluentassertions/pull/3152) +* Improve reporting the subject when chaining `Throw` with `Which` - [#3160](https://github.com/fluentassertions/fluentassertions/pull/3160) ### Fixes From 27bd2f917a50f89326806ae1bf24dca94a0a01b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:32:03 +0000 Subject: [PATCH 787/845] Bump cspell from 9.6.4 to 9.7.0 Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 9.6.4 to 9.7.0. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.7.0/packages/cspell) --- updated-dependencies: - dependency-name: cspell dependency-version: 9.7.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 288 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 145 insertions(+), 145 deletions(-) diff --git a/package-lock.json b/package-lock.json index adde032dc3..8e4b83a1b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,13 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.6.4" + "cspell": "^9.7.0" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.6.4.tgz", - "integrity": "sha512-OIiPQuB7XQ6rnUv4KaCwHr9vNwbh6VZ4GfgQjcThT0oz0hkL6E5Ar3tq54K9jyqE9ylcHqpRuXUgnKgio6Hlig==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.7.0.tgz", + "integrity": "sha512-s7h1vo++Q3AsfQa3cs0u/KGwm3SYInuIlC4kjlCBWjQmb4KddiZB5O1u0+3TlA7GycHb5M4CR7MDfHUICgJf+w==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.1", @@ -29,11 +29,11 @@ "@cspell/dict-data-science": "^2.0.13", "@cspell/dict-django": "^4.1.6", "@cspell/dict-docker": "^1.1.17", - "@cspell/dict-dotnet": "^5.0.11", + "@cspell/dict-dotnet": "^5.0.12", "@cspell/dict-elixir": "^4.0.8", - "@cspell/dict-en_us": "^4.4.28", + "@cspell/dict-en_us": "^4.4.29", "@cspell/dict-en-common-misspellings": "^2.1.12", - "@cspell/dict-en-gb-mit": "^3.1.17", + "@cspell/dict-en-gb-mit": "^3.1.18", "@cspell/dict-filetypes": "^3.0.15", "@cspell/dict-flutter": "^1.1.1", "@cspell/dict-fonts": "^4.0.5", @@ -57,7 +57,7 @@ "@cspell/dict-markdown": "^2.0.14", "@cspell/dict-monkeyc": "^1.0.12", "@cspell/dict-node": "^5.0.9", - "@cspell/dict-npm": "^5.2.32", + "@cspell/dict-npm": "^5.2.34", "@cspell/dict-php": "^4.1.1", "@cspell/dict-powershell": "^5.0.15", "@cspell/dict-public-licenses": "^2.0.15", @@ -67,7 +67,7 @@ "@cspell/dict-rust": "^4.1.2", "@cspell/dict-scala": "^5.0.9", "@cspell/dict-shell": "^1.1.2", - "@cspell/dict-software-terms": "^5.1.20", + "@cspell/dict-software-terms": "^5.1.21", "@cspell/dict-sql": "^2.2.1", "@cspell/dict-svelte": "^1.0.7", "@cspell/dict-swift": "^2.0.6", @@ -81,72 +81,72 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.6.4.tgz", - "integrity": "sha512-rGYSDnDWACrUyovfN8M/LM8CCFSKjYd2kehbNS7YMPk0Jk+rLk6sgt5WYu3ty45otXCkiO07bjUo/81wBLet7A==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.7.0.tgz", + "integrity": "sha512-6xpGXlMtQA3hV2BCAQcPkpx9eI12I0o01i9eRqSSEDKtxuAnnrejbcCpL+5OboAjTp3/BSeNYSnhuWYLkSITWQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.6.4" + "@cspell/cspell-types": "9.7.0" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-performance-monitor": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-performance-monitor/-/cspell-performance-monitor-9.6.4.tgz", - "integrity": "sha512-exuqxV1IVfZkasg57ZjUbaHeZDd6Mdbsbe5FBT3+XaVnRij+wpY2oEW9+kIOL5MOQE3bgQKgu37iMtA1NlCrGA==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-performance-monitor/-/cspell-performance-monitor-9.7.0.tgz", + "integrity": "sha512-w1PZIFXuvjnC6mQHyYAFnrsn5MzKnEcEkcK1bj4OG00bAt7WX2VUA/eNNt9c1iHozCQ+FcRYlfbGxuBmNyzSgw==", "license": "MIT", "engines": { "node": ">=20.18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.6.4.tgz", - "integrity": "sha512-vVxajTG9Ko01oHk8HPsMLajcLrd9AfkOk6vdgFI4FD7ZPq1CY0hfTmfmJ8bzZ4/QkqXglTvePdSgHQVJeltwWw==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.7.0.tgz", + "integrity": "sha512-iiisyRpJciU9SOHNSi0ZEK0pqbEMFRatI/R4O+trVKb+W44p4MNGClLVRWPGUmsFbZKPJL3jDtz0wPlG0/JCZA==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.6.4.tgz", - "integrity": "sha512-3xsgZEqqH9Uj8ZYLBnWbnsHz8wphgaeuWKcNDqgwoMjvwTMQLGoXjHht8Jx5yxd2e080lB7fJax8TaBdCzmFFA==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.7.0.tgz", + "integrity": "sha512-uiEgS238mdabDnwavo6HXt8K98jlh/jpm7NONroM9NTr9rzck2VZKD2kXEj85wDNMtRsRXNoywTjwQ8WTB6/+w==", "license": "MIT", "dependencies": { - "global-directory": "^4.0.1" + "global-directory": "^5.0.0" }, "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.6.4.tgz", - "integrity": "sha512-oGNEzP1gJ43rLklJQjOk5PsfX0mZkLjV19djGptb9xZQeC2qAUxnaAbZtWt5CE8ni2iiTaRmgNRbUqAhRCnjew==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.7.0.tgz", + "integrity": "sha512-fkqtaCkg4jY/FotmzjhIavbXuH0AgUJxZk78Ktf4XlhqOZ4wDeUWrCf220bva4mh3TWiLx/ae9lIlpl59Vx6hA==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-types": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.6.4.tgz", - "integrity": "sha512-lf6d+BdMkJIFCxx2FpajLpqVGGyaGUNFU6jhEM6QUPeGuoA5et2kJXrL0NSY2uWLOVyYYc/FPjzlbe8trA9tBQ==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.7.0.tgz", + "integrity": "sha512-Tdfx4eH2uS+gv9V9NCr3Rz+c7RSS6ntXp3Blliud18ibRUlRxO9dTaOjG4iv4x0nAmMeedP1ORkEpeXSkh2QiQ==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/cspell-worker": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/@cspell/cspell-worker/-/cspell-worker-9.6.4.tgz", - "integrity": "sha512-anacKDOZzDfPzuDeFOXGI2tFBYiRRCSnIZP/AOyJ9zTvEQcqq5p/ak18nJ5OQyDr2NG7ovJiCDT5YNiH2Vdg/g==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-worker/-/cspell-worker-9.7.0.tgz", + "integrity": "sha512-cjEApFF0aOAa1vTUk+e7xP8ofK7iC7hsRzj1FmvvVQz8PoLWPRaq+1bT89ypPsZQvavqm5sIgb97S60/aW4TVg==", "license": "MIT", "dependencies": { - "cspell-lib": "9.6.4" + "cspell-lib": "9.7.0" }, "engines": { "node": ">=20.18" @@ -264,9 +264,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { - "version": "3.0.15", - "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.15.tgz", - "integrity": "sha512-uDMeqYlLlK476w/muEFQGBy9BdQWS0mQ7BJiy/iQv5XUWZxE2O54ZQd9nW8GyQMzAgoyg5SG4hf9l039Qt66oA==", + "version": "3.0.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.16.tgz", + "integrity": "sha512-SyrtuK2/sx+cr94jOp2/uOAb43ngZEVISUTRj4SR6SfoGULVV1iJS7Drqn7Ul9HJ731QDttwWlOUgcQ+yMRblg==", "license": "MIT" }, "node_modules/@cspell/dict-flutter": { @@ -408,9 +408,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.34", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.34.tgz", - "integrity": "sha512-M2MtfmYeHIPBuC8esMU4JQXHKma7Xt7VyBWUk67B62KDu61sxebQ2HeizdqmN2sLEJsTkq3bZT5PGzHpZ0LEWQ==", + "version": "5.2.35", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.35.tgz", + "integrity": "sha512-w0VIDUvzHSTt4S9pfvSatApxtCesLMFrDUYD0Wjtw91EBRkB2wVw/RV3q1Ni9Nzpx6pCFpcB7c1xBY8l22cyiQ==", "license": "MIT" }, "node_modules/@cspell/dict-php": { @@ -426,9 +426,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-public-licenses": { - "version": "2.0.15", - "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.15.tgz", - "integrity": "sha512-cJEOs901H13Pfy0fl4dCD1U+xpWIMaEPq8MeYU83FfDZvellAuSo4GqWCripfIqlhns/L6+UZEIJSOZnjgy7Wg==", + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.16.tgz", + "integrity": "sha512-EQRrPvEOmwhwWezV+W7LjXbIBjiy6y/shrET6Qcpnk3XANTzfvWflf9PnJ5kId/oKWvihFy0za0AV1JHd03pSQ==", "license": "MIT" }, "node_modules/@cspell/dict-python": { @@ -471,9 +471,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.1.21", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.21.tgz", - "integrity": "sha512-3lAB4OXsf6rs5zbwe4/nKmwyAJAvjs5KTRrPckzHx7q9dYpviW+UxDyhevCCsRfmcu24OhYP7BVQWXxLvYk4xA==", + "version": "5.1.22", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.22.tgz", + "integrity": "sha512-ELi8wqyDAreDpo17Pu45AuKvcrhqPCkGeL+DMuSVxEimBwEqPB+KeQ89DkVap6QDJHl3LCth0pjv8uOgS1dtdQ==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -519,12 +519,12 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.6.4.tgz", - "integrity": "sha512-1VnL9ahT3s17DLWl4MeO1pYg7zcVT3X9cKynI2/U86zNK5xMGS5icvjp7X65tsCAVNcWOtkqVFfrxi7kWxn67g==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.7.0.tgz", + "integrity": "sha512-Ws36IYvtS/8IN3x6K9dPLvTmaArodRJmzTn2Rkf2NaTnIYWhRuFzsP3SVVO59NN3fXswAEbmz5DSbVUe8bPZHg==", "license": "MIT", "dependencies": { - "@cspell/url": "9.6.4", + "@cspell/url": "9.7.0", "import-meta-resolve": "^4.2.0" }, "engines": { @@ -532,36 +532,36 @@ } }, "node_modules/@cspell/filetypes": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.6.4.tgz", - "integrity": "sha512-a1aZ/8vGnhTknxTukjzo3m8CISyHW2MWnbedywg5SDEl5RMJitmzX90QZiQdSvEcqzqmtoAgSEZNBT2LX2gIKg==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.7.0.tgz", + "integrity": "sha512-Ln9e/8wGOyTeL3DCCs6kwd18TSpTw3kxsANjTrzLDASrX4cNmAdvc9J5dcIuBHPaqOAnRQxuZbzUlpRh73Y24w==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/rpc": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/@cspell/rpc/-/rpc-9.6.4.tgz", - "integrity": "sha512-vGI1788Rx5Yml9N1/pD4zGd8Vrchi2Y01ADf9NiiOaNVVdf4PU1GCssLCsiIzhYQneErpQ8pJi/mS2F/QMZbRA==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/@cspell/rpc/-/rpc-9.7.0.tgz", + "integrity": "sha512-VnZ4ABgQeoS4RwofcePkDP7L6tf3Kh5D7LQKoyRM4R6XtfSsYefym6XKaRl3saGtthH5YyjgNJ0Tgdjen4wAAw==", "license": "MIT", "engines": { "node": ">=20.18" } }, "node_modules/@cspell/strong-weak-map": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.6.4.tgz", - "integrity": "sha512-AQrUbA0JUOEQgwItnfUQ6Ydk0hWY/uV3VhLwZWyrnT9eiQynmTnRTHtOCkkSl9+M4P0N4Raa2eGFRLcPAFksaw==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.7.0.tgz", + "integrity": "sha512-5xbvDASjklrmy88O6gmGXgYhpByCXqOj5wIgyvwZe2l83T1bE+iOfGI4pGzZJ/mN+qTn1DNKq8BPBPtDgb7Q2Q==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/@cspell/url": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.6.4.tgz", - "integrity": "sha512-h6VMlb7bDyGJfwLtipxxtHlT+ojzUXZz14AqZ/NEzY3LfOhfJTGpRcWLYFsgG/L0Ma4qjsYbPJt/Sj1C14j0VA==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.7.0.tgz", + "integrity": "sha512-ZaaBr0pTvNxmyUbIn+nVPXPr383VqJzfUDMWicgTjJIeo2+T2hOq2kNpgpvTIrWtZrsZnSP8oXms1+sKTjcvkw==", "license": "MIT", "engines": { "node": ">=20" @@ -667,31 +667,31 @@ "license": "MIT" }, "node_modules/cspell": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.6.4.tgz", - "integrity": "sha512-rZJmgcyBGKX3KcJ3KC9JYVHeKhDEVbmCheSp8eRGMYw6MCG9o7FHqQjGA/u4lEu4A0psr7ACP/5ym/QHyntRbA==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.7.0.tgz", + "integrity": "sha512-ftxOnkd+scAI7RZ1/ksgBZRr0ouC7QRKtPQhD/PbLTKwAM62sSvRhE1bFsuW3VKBn/GilWzTjkJ40WmnDqH5iQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "9.6.4", - "@cspell/cspell-performance-monitor": "9.6.4", - "@cspell/cspell-pipe": "9.6.4", - "@cspell/cspell-types": "9.6.4", - "@cspell/cspell-worker": "9.6.4", - "@cspell/dynamic-import": "9.6.4", - "@cspell/url": "9.6.4", + "@cspell/cspell-json-reporter": "9.7.0", + "@cspell/cspell-performance-monitor": "9.7.0", + "@cspell/cspell-pipe": "9.7.0", + "@cspell/cspell-types": "9.7.0", + "@cspell/cspell-worker": "9.7.0", + "@cspell/dynamic-import": "9.7.0", + "@cspell/url": "9.7.0", "ansi-regex": "^6.2.2", "chalk": "^5.6.2", "chalk-template": "^1.1.2", "commander": "^14.0.3", - "cspell-config-lib": "9.6.4", - "cspell-dictionary": "9.6.4", - "cspell-gitignore": "9.6.4", - "cspell-glob": "9.6.4", - "cspell-io": "9.6.4", - "cspell-lib": "9.6.4", + "cspell-config-lib": "9.7.0", + "cspell-dictionary": "9.7.0", + "cspell-gitignore": "9.7.0", + "cspell-glob": "9.7.0", + "cspell-io": "9.7.0", + "cspell-lib": "9.7.0", "fast-json-stable-stringify": "^2.1.0", "flatted": "^3.3.3", - "semver": "^7.7.3", + "semver": "^7.7.4", "tinyglobby": "^0.2.15" }, "bin": { @@ -706,12 +706,12 @@ } }, "node_modules/cspell-config-lib": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.6.4.tgz", - "integrity": "sha512-MecJNR9bIlcPBhyZFsXP6Q2n8qQ2IR9N9HiIz0yh0gBNVydp3LR5JITP5Ji8m7hexmZzVeoXms/dVN74XbS95g==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.7.0.tgz", + "integrity": "sha512-pguh8A3+bSJ1OOrKCiQan8bvaaY125de76OEFz7q1Pq309lIcDrkoL/W4aYbso/NjrXaIw6OjkgPMGRBI/IgGg==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.6.4", + "@cspell/cspell-types": "9.7.0", "comment-json": "^4.5.1", "smol-toml": "^1.6.0", "yaml": "^2.8.2" @@ -721,15 +721,15 @@ } }, "node_modules/cspell-dictionary": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.6.4.tgz", - "integrity": "sha512-Ik9ZQVqV/fJfMt5X6IkC7yHGVH46/qjcqCNWwrMSwvROLM3SemNxxZoLvh0wi0GXz9WF1lHcxLJVdeKUk6QB8g==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.7.0.tgz", + "integrity": "sha512-k/Wz0so32+0QEqQe21V9m4BNXM5ZN6lz3Ix/jLCbMxFIPl6wT711ftjOWIEMFhvUOP0TWXsbzcuE9mKtS5mTig==", "license": "MIT", "dependencies": { - "@cspell/cspell-performance-monitor": "9.6.4", - "@cspell/cspell-pipe": "9.6.4", - "@cspell/cspell-types": "9.6.4", - "cspell-trie-lib": "9.6.4", + "@cspell/cspell-performance-monitor": "9.7.0", + "@cspell/cspell-pipe": "9.7.0", + "@cspell/cspell-types": "9.7.0", + "cspell-trie-lib": "9.7.0", "fast-equals": "^6.0.0" }, "engines": { @@ -737,14 +737,14 @@ } }, "node_modules/cspell-gitignore": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.6.4.tgz", - "integrity": "sha512-a8asE9BsjJgJ506WUGh5VHrTdVEE8hWELjCJB2atPrW6iY5e4aCIugy0gkRC1ZH9/TseadlmMLrFzHUkJUjzsg==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.7.0.tgz", + "integrity": "sha512-MtoYuH4ah4K6RrmaF834npMcRsTKw0658mC6yvmBacUQOmwB/olqyuxF3fxtbb55HDb7cXDQ35t1XuwwGEQeZw==", "license": "MIT", "dependencies": { - "@cspell/url": "9.6.4", - "cspell-glob": "9.6.4", - "cspell-io": "9.6.4" + "@cspell/url": "9.7.0", + "cspell-glob": "9.7.0", + "cspell-io": "9.7.0" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -754,12 +754,12 @@ } }, "node_modules/cspell-glob": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.6.4.tgz", - "integrity": "sha512-253VrjbR8QU15h8GtpDQLX5Ti9uNSuNod2T7f8YEElQOb9I/kUXoCj3Cq4P390IC99klqSHIDxHsxd77ex19lA==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.7.0.tgz", + "integrity": "sha512-LUeAoEsoCJ+7E3TnUmWBscpVQOmdwBejMlFn0JkXy6LQzxrybxXBKf65RSdIv1o5QtrhQIMa358xXYQG0sv/tA==", "license": "MIT", "dependencies": { - "@cspell/url": "9.6.4", + "@cspell/url": "9.7.0", "picomatch": "^4.0.3" }, "engines": { @@ -767,13 +767,13 @@ } }, "node_modules/cspell-grammar": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.6.4.tgz", - "integrity": "sha512-rvZyTB45/XSRWx7eAsrvTTAZvBTREr/2G2JWVMdqrptFyq1XReAKHhw/x1HJkNgWC9LKAK3bVQJpjLsNG37U9A==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.7.0.tgz", + "integrity": "sha512-oEYME+7MJztfVY1C06aGcJgEYyqBS/v/ETkQGPzf/c6ObSAPRcUbVtsXZgnR72Gru9aBckc70xJcD6bELdoWCA==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.6.4", - "@cspell/cspell-types": "9.6.4" + "@cspell/cspell-pipe": "9.7.0", + "@cspell/cspell-types": "9.7.0" }, "bin": { "cspell-grammar": "bin.mjs" @@ -783,41 +783,41 @@ } }, "node_modules/cspell-io": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.6.4.tgz", - "integrity": "sha512-bmvJ4yn5QK2FZWTkZA4sx2qJqIi8BrUUUV7W209drSwkYjhJtXqP0RyF6Qx4Xuu2D1s0UilEtO5Jd+E9UJkQ6w==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.7.0.tgz", + "integrity": "sha512-V7x0JHAUCcJPRCH8c0MQkkaKmZD2yotxVyrNEx2SZTpvnKrYscLEnUUTWnGJIIf9znzISqw116PLnYu2c+zd6Q==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "9.6.4", - "@cspell/url": "9.6.4" + "@cspell/cspell-service-bus": "9.7.0", + "@cspell/url": "9.7.0" }, "engines": { "node": ">=20" } }, "node_modules/cspell-lib": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.6.4.tgz", - "integrity": "sha512-fUodKcIHTwvokuowB25XyFzBxlk73yj1QRw2por3BxDz9fAim1zAIohAPAnGuzj3LowYnTMjHLYE7RFDUSxy5A==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.7.0.tgz", + "integrity": "sha512-aTx/aLRpnuY1RJnYAu+A8PXfm1oIUdvAQ4W9E66bTgp1LWI+2G2++UtaPxRIgI0olxE9vcXqUnKpjOpO+5W9bQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.6.4", - "@cspell/cspell-performance-monitor": "9.6.4", - "@cspell/cspell-pipe": "9.6.4", - "@cspell/cspell-resolver": "9.6.4", - "@cspell/cspell-types": "9.6.4", - "@cspell/dynamic-import": "9.6.4", - "@cspell/filetypes": "9.6.4", - "@cspell/rpc": "9.6.4", - "@cspell/strong-weak-map": "9.6.4", - "@cspell/url": "9.6.4", + "@cspell/cspell-bundled-dicts": "9.7.0", + "@cspell/cspell-performance-monitor": "9.7.0", + "@cspell/cspell-pipe": "9.7.0", + "@cspell/cspell-resolver": "9.7.0", + "@cspell/cspell-types": "9.7.0", + "@cspell/dynamic-import": "9.7.0", + "@cspell/filetypes": "9.7.0", + "@cspell/rpc": "9.7.0", + "@cspell/strong-weak-map": "9.7.0", + "@cspell/url": "9.7.0", "clear-module": "^4.1.2", - "cspell-config-lib": "9.6.4", - "cspell-dictionary": "9.6.4", - "cspell-glob": "9.6.4", - "cspell-grammar": "9.6.4", - "cspell-io": "9.6.4", - "cspell-trie-lib": "9.6.4", + "cspell-config-lib": "9.7.0", + "cspell-dictionary": "9.7.0", + "cspell-glob": "9.7.0", + "cspell-grammar": "9.7.0", + "cspell-io": "9.7.0", + "cspell-trie-lib": "9.7.0", "env-paths": "^4.0.0", "gensequence": "^8.0.8", "import-fresh": "^3.3.1", @@ -831,15 +831,15 @@ } }, "node_modules/cspell-trie-lib": { - "version": "9.6.4", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.6.4.tgz", - "integrity": "sha512-JKwyRtyybbaTrixwI1OgU5Hvva2Z5zHVWl92WBa9U7KijAyiD/Ehp3T3DCYuBwGks7egw7MgWPySkXXnpme6mw==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.7.0.tgz", + "integrity": "sha512-a2YqmcraL3g6I/4gY7SYWEZfP73oLluUtxO7wxompk/kOG2K1FUXyQfZXaaR7HxVv10axT1+NrjhOmXpfbI6LA==", "license": "MIT", "engines": { "node": ">=20" }, "peerDependencies": { - "@cspell/cspell-types": "9.6.4" + "@cspell/cspell-types": "9.7.0" } }, "node_modules/env-paths": { @@ -918,15 +918,15 @@ } }, "node_modules/global-directory": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", - "integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-5.0.0.tgz", + "integrity": "sha512-1pgFdhK3J2LeM+dVf2Pd424yHx2ou338lC0ErNP2hPx4j8eW1Sp0XqSjNxtk6Tc4Kr5wlWtSvz8cn2yb7/SG/w==", "license": "MIT", "dependencies": { - "ini": "4.1.1" + "ini": "6.0.0" }, "engines": { - "node": ">=18" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -980,12 +980,12 @@ } }, "node_modules/ini": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", - "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-6.0.0.tgz", + "integrity": "sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ==", "license": "ISC", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^20.17.0 || >=22.9.0" } }, "node_modules/is-safe-filename": { @@ -1034,9 +1034,9 @@ } }, "node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "license": "ISC", "bin": { "semver": "bin/semver.js" diff --git a/package.json b/package.json index efb1721dd1..aa3040c15d 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.6.4" + "cspell": "^9.7.0" } } From e525b91246649a7ec0ed8ae4828650b0477d6fef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 16:38:34 +0000 Subject: [PATCH 788/845] Bump actions/upload-artifact from 6 to 7 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77c00d8901..ca247274ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,7 +69,7 @@ jobs: - name: Upload artifacts if: always() - uses: actions/upload-artifact@v6 + uses: actions/upload-artifact@v7 with: name: windows-artifacts path: | @@ -102,7 +102,7 @@ jobs: - name: Upload artifacts if: always() - uses: actions/upload-artifact@v6 + uses: actions/upload-artifact@v7 with: name: ${{ runner.os }}-artifacts path: | From c6042a2503044be42ba32d21ab3f9c97ec4e2ba8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 16:38:21 +0000 Subject: [PATCH 789/845] Bump actions/download-artifact from 7 to 8 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7 to 8. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v7...v8) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca247274ec..3b1ba2e8b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -119,7 +119,7 @@ jobs: steps: - name: Download Artifacts - uses: actions/download-artifact@v7 + uses: actions/download-artifact@v8 with: path: artifacts From b423c367b568bba47f701b58981b672711f66670 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 16:38:29 +0000 Subject: [PATCH 790/845] Bump actions/attest-build-provenance from 3 to 4 Bumps [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) from 3 to 4. - [Release notes](https://github.com/actions/attest-build-provenance/releases) - [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md) - [Commits](https://github.com/actions/attest-build-provenance/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/attest-build-provenance dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b1ba2e8b3..b9a800cc57 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,7 +62,7 @@ jobs: files: "Artifacts/*.nupkg" - name: Attest NuGet package - uses: actions/attest-build-provenance@v3 + uses: actions/attest-build-provenance@v4 if: startsWith(github.ref, 'refs/tags/') && steps.check_nupkg.outputs.files_exists == 'true' with: subject-path: ./Artifacts/*.nupkg From f7faecaffabfa5475eed15b274cf4d976dc9660e Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 3 Mar 2026 12:09:21 +0100 Subject: [PATCH 791/845] Replace `attest-build-provenance` with `attest` Since v4 the former is simply a wrapper around the latter. See https://github.com/actions/attest-build-provenance/releases/tag/v4.0.0 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b9a800cc57..e14858b7bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,7 +62,7 @@ jobs: files: "Artifacts/*.nupkg" - name: Attest NuGet package - uses: actions/attest-build-provenance@v4 + uses: actions/attest@v4 if: startsWith(github.ref, 'refs/tags/') && steps.check_nupkg.outputs.files_exists == 'true' with: subject-path: ./Artifacts/*.nupkg From ef3a1e0ddd6c9a6bbc4e4bfa96b66aa3b527a848 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Mar 2026 08:00:42 +0100 Subject: [PATCH 792/845] Add HaveMillisecond/NotHaveMillisecond assertion methods for DateTime and DateTimeOffset (#3164) --- .../Primitives/DateTimeAssertions.cs | 52 +++++++++++ .../Primitives/DateTimeOffsetAssertions.cs | 53 +++++++++++ .../FluentAssertions/net47.verified.txt | 4 + .../FluentAssertions/net6.0.verified.txt | 4 + .../netstandard2.0.verified.txt | 4 + .../netstandard2.1.verified.txt | 4 + .../DateTimeAssertionSpecs.HaveMillisecond.cs | 90 +++++++++++++++++++ ...imeOffsetAssertionSpecs.HaveMillisecond.cs | 90 +++++++++++++++++++ docs/_pages/releases.md | 1 + 9 files changed, 302 insertions(+) create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveMillisecond.cs create mode 100644 Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveMillisecond.cs diff --git a/Src/FluentAssertions/Primitives/DateTimeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeAssertions.cs index 8e359b9457..83cbec39ac 100644 --- a/Src/FluentAssertions/Primitives/DateTimeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeAssertions.cs @@ -705,6 +705,58 @@ public AndConstraint NotHaveSecond(int unexpected, return new AndConstraint((TAssertions)this); } + /// + /// Asserts that the current has the millisecond. + /// + /// The expected milliseconds of the current value. + /// + /// 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 HaveMillisecond(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + assertionChain + .BecauseOf(because, becauseArgs) + .WithExpectation("Expected the milliseconds part of {context:the time} to be {0}{reason}", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateTime.") + .Then + .ForCondition(Subject.Value.Millisecond == expected) + .FailWith(", but found {0}.", Subject.Value.Millisecond)); + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that the current does not have the millisecond. + /// + /// The millisecond that should not be in the current value. + /// + /// 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 NotHaveMillisecond(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + assertionChain + .BecauseOf(because, becauseArgs) + .WithExpectation("Did not expect the milliseconds part of {context:the time} to be {0}{reason}", unexpected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith(", but found a DateTime.") + .Then + .ForCondition(Subject.Value.Millisecond != unexpected) + .FailWith(", but it was.")); + + return new AndConstraint((TAssertions)this); + } + /// /// Returns a object that can be used to assert that the current /// exceeds the specified compared to another . diff --git a/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs index 2bb4429016..75e682201d 100644 --- a/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs @@ -836,6 +836,59 @@ public AndConstraint NotHaveSecond(int unexpected, return new AndConstraint((TAssertions)this); } + /// + /// Asserts that the current has the millisecond. + /// + /// The expected milliseconds of the current value. + /// + /// 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 HaveMillisecond(int expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + assertionChain + .BecauseOf(because, becauseArgs) + .WithExpectation("Expected the milliseconds part of {context:the time} to be {0}{reason}, ", expected, chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Millisecond == expected) + .FailWith("but it was {0}.", Subject.Value.Millisecond)); + + return new AndConstraint((TAssertions)this); + } + + /// + /// Asserts that the current does not have the millisecond. + /// + /// The millisecond that should not be in the current value. + /// + /// 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 NotHaveMillisecond(int unexpected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + assertionChain + .BecauseOf(because, becauseArgs) + .WithExpectation("Did not expect the milliseconds part of {context:the time} to be {0}{reason}, ", unexpected, + chain => chain + .ForCondition(Subject.HasValue) + .FailWith("but found a DateTimeOffset.") + .Then + .ForCondition(Subject.Value.Millisecond != unexpected) + .FailWith("but it was.")); + + return new AndConstraint((TAssertions)this); + } + /// /// Asserts that the current has the offset. /// diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 1f3f08404c..c741a64f7e 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -1735,6 +1735,7 @@ namespace FluentAssertions.Primitives public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveMillisecond(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMonth(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveSecond(int expected, string because = "", params object[] becauseArgs) { } @@ -1750,6 +1751,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBeSameDateAs(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveDay(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveHour(int unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveMillisecond(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveMinute(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveMonth(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveSecond(int unexpected, string because = "", params object[] becauseArgs) { } @@ -1786,6 +1788,7 @@ namespace FluentAssertions.Primitives public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveMillisecond(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMonth(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveOffset(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } @@ -1803,6 +1806,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBeSameDateAs(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveDay(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveHour(int unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveMillisecond(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveMinute(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveMonth(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveOffset(System.TimeSpan unexpected, string because = "", params object[] becauseArgs) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index e3680a0382..8689740f9b 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -1877,6 +1877,7 @@ namespace FluentAssertions.Primitives public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveMillisecond(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMonth(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveSecond(int expected, string because = "", params object[] becauseArgs) { } @@ -1892,6 +1893,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBeSameDateAs(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveDay(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveHour(int unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveMillisecond(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveMinute(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveMonth(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveSecond(int unexpected, string because = "", params object[] becauseArgs) { } @@ -1928,6 +1930,7 @@ namespace FluentAssertions.Primitives public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveMillisecond(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMonth(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveOffset(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } @@ -1945,6 +1948,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBeSameDateAs(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveDay(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveHour(int unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveMillisecond(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveMinute(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveMonth(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveOffset(System.TimeSpan 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 54323469e5..a7092c158c 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -1679,6 +1679,7 @@ namespace FluentAssertions.Primitives public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveMillisecond(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMonth(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveSecond(int expected, string because = "", params object[] becauseArgs) { } @@ -1694,6 +1695,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBeSameDateAs(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveDay(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveHour(int unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveMillisecond(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveMinute(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveMonth(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveSecond(int unexpected, string because = "", params object[] becauseArgs) { } @@ -1730,6 +1732,7 @@ namespace FluentAssertions.Primitives public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveMillisecond(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMonth(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveOffset(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } @@ -1747,6 +1750,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBeSameDateAs(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveDay(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveHour(int unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveMillisecond(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveMinute(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveMonth(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveOffset(System.TimeSpan 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 49585cdd18..d51f46b68a 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -1735,6 +1735,7 @@ namespace FluentAssertions.Primitives public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveMillisecond(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMonth(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveSecond(int expected, string because = "", params object[] becauseArgs) { } @@ -1750,6 +1751,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBeSameDateAs(System.DateTime unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveDay(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveHour(int unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveMillisecond(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveMinute(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveMonth(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveSecond(int unexpected, string because = "", params object[] becauseArgs) { } @@ -1786,6 +1788,7 @@ namespace FluentAssertions.Primitives public override bool Equals(object obj) { } public FluentAssertions.AndConstraint HaveDay(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveHour(int expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint HaveMillisecond(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMinute(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveMonth(int expected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint HaveOffset(System.TimeSpan expected, string because = "", params object[] becauseArgs) { } @@ -1803,6 +1806,7 @@ namespace FluentAssertions.Primitives public FluentAssertions.AndConstraint NotBeSameDateAs(System.DateTimeOffset unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveDay(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveHour(int unexpected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotHaveMillisecond(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveMinute(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveMonth(int unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotHaveOffset(System.TimeSpan unexpected, string because = "", params object[] becauseArgs) { } diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveMillisecond.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveMillisecond.cs new file mode 100644 index 0000000000..95d335228d --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeAssertionSpecs.HaveMillisecond.cs @@ -0,0 +1,90 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeAssertionSpecs +{ + public class HaveMillisecond + { + [Fact] + public void Succeeds_for_datetime_with_the_same_milliseconds() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00, 123); + + // Act / Assert + subject.Should().HaveMillisecond(123); + } + + [Fact] + public void Fails_for_datetime_with_different_milliseconds() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00, 123); + + // Act + Action act = () => subject.Should().HaveMillisecond(124); + + // Assert + act.Should().Throw() + .WithMessage("Expected the milliseconds part of subject to be 124, but found 123."); + } + + [Fact] + public void Fails_for_null_datetime() + { + // Arrange + DateTime? subject = null; + + // Act + Action act = () => subject.Should().HaveMillisecond(22); + + // Assert + act.Should().Throw() + .WithMessage("Expected the milliseconds part of subject to be 22, but found a DateTime."); + } + } + + public class NotHaveMillisecond + { + [Fact] + public void Fails_for_datetime_with_the_same_milliseconds() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00, 123); + + // Act + Action act = () => subject.Should().NotHaveMillisecond(123); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the milliseconds part of subject to be 123, but it was."); + } + + [Fact] + public void Succeeds_for_datetime_with_different_milliseconds() + { + // Arrange + DateTime subject = new(2009, 12, 31, 23, 59, 00, 123); + + // Act / Assert + subject.Should().NotHaveMillisecond(124); + } + + [Fact] + public void Fails_for_null_datetime() + { + // Arrange + DateTime? subject = null; + + // Act + Action act = () => subject.Should().NotHaveMillisecond(22); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the milliseconds part of subject to be 22, but found a DateTime."); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveMillisecond.cs b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveMillisecond.cs new file mode 100644 index 0000000000..6c103b0c26 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Primitives/DateTimeOffsetAssertionSpecs.HaveMillisecond.cs @@ -0,0 +1,90 @@ +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class DateTimeOffsetAssertionSpecs +{ + public class HaveMillisecond + { + [Fact] + public void Succeeds_for_datetimeoffset_with_the_same_milliseconds() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00, 123), TimeSpan.Zero); + + // Act / Assert + subject.Should().HaveMillisecond(123); + } + + [Fact] + public void Fails_for_datetimeoffset_with_different_milliseconds() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00, 123), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().HaveMillisecond(124); + + // Assert + act.Should().Throw() + .WithMessage("Expected the milliseconds part of subject to be 124, but it was 123."); + } + + [Fact] + public void Fails_for_null_datetimeoffset() + { + // Arrange + DateTimeOffset? subject = null; + + // Act + Action act = () => subject.Should().HaveMillisecond(22); + + // Assert + act.Should().Throw() + .WithMessage("Expected the milliseconds part of subject to be 22, but found a DateTimeOffset."); + } + } + + public class NotHaveMillisecond + { + [Fact] + public void Fails_for_datetimeoffset_with_the_same_milliseconds() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00, 123), TimeSpan.Zero); + + // Act + Action act = () => subject.Should().NotHaveMillisecond(123); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the milliseconds part of subject to be 123, but it was."); + } + + [Fact] + public void Succeeds_for_datetimeoffset_with_different_milliseconds() + { + // Arrange + DateTimeOffset subject = new(new DateTime(2009, 12, 31, 23, 59, 00, 123), TimeSpan.Zero); + + // Act / Assert + subject.Should().NotHaveMillisecond(124); + } + + [Fact] + public void Fails_for_null_datetimeoffset() + { + // Arrange + DateTimeOffset? subject = null; + + // Act + Action act = () => subject.Should().NotHaveMillisecond(22); + + // Assert + act.Should().Throw() + .WithMessage("Did not expect the milliseconds part of subject to be 22, but found a DateTimeOffset."); + } + } +} diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 7709e4e7af..685961f616 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -13,6 +13,7 @@ sidebar: * Added `Excluding()` and `Excluding(Type)` overloads to exclude all members of a certain type from equivalency comparisons - [#3115](https://github.com/fluentassertions/fluentassertions/pull/3115) * `BeEquivalentTo` will now report the missing or extraneous items for differently sized collections - [#3133](https://github.com/fluentassertions/fluentassertions/pull/3133) +* Added `HaveMillisecond` and `NotHaveMillisecond` assertion methods for `DateTime` and `DateTimeOffset` - [#3164](https://github.com/fluentassertions/fluentassertions/pull/3164) ### Enhancements * Added option `WithFullDump` to `BeEquivalentTo` to include the entire contents of the subject-under-test in the failure message - [#3133](https://github.com/fluentassertions/fluentassertions/pull/3133) From d33871e63498dea0c0c880db787882f9501e4342 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 1 Mar 2026 12:09:54 +0100 Subject: [PATCH 793/845] Add support for Span, ReadOnlySpan, Memory and ReadOnlyMemory --- Src/FluentAssertions/AssertionExtensions.cs | 71 ++++ .../Collections/SpanAssertions.cs | 69 ++++ .../Collections/SpanAssertionsExtensions.cs | 54 +++ Src/FluentAssertions/FluentAssertions.csproj | 2 +- .../FluentAssertions/net6.0.verified.txt | 16 + .../netstandard2.1.verified.txt | 16 + .../AssertionExtensionsSpecs.cs | 10 +- .../Collections/SpanAndMemorySpecs.cs | 350 ++++++++++++++++++ docs/_pages/collections.md | 31 +- docs/_pages/releases.md | 1 + 10 files changed, 616 insertions(+), 4 deletions(-) create mode 100644 Src/FluentAssertions/Collections/SpanAssertions.cs create mode 100644 Src/FluentAssertions/Collections/SpanAssertionsExtensions.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/SpanAndMemorySpecs.cs diff --git a/Src/FluentAssertions/AssertionExtensions.cs b/Src/FluentAssertions/AssertionExtensions.cs index 34583ce90a..3bde7e78eb 100644 --- a/Src/FluentAssertions/AssertionExtensions.cs +++ b/Src/FluentAssertions/AssertionExtensions.cs @@ -6,6 +6,7 @@ using System.IO; using System.Linq.Expressions; using System.Reflection; +using System.Runtime.CompilerServices; using System.Threading.Tasks; using System.Xml.Linq; using FluentAssertions.Collections; @@ -229,6 +230,75 @@ public static BufferedStreamAssertions Should([NotNull] this BufferedStream actu return new BufferedStreamAssertions(actualValue, AssertionChain.GetOrCreate()); } +#if NET6_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER + /// + /// Returns a object that can be used to assert the + /// current . + /// + [Pure] + [OverloadResolutionPriority(-1)] + public static SpanAssertions Should(this Span actualValue) + { + return new SpanAssertions(actualValue.ToArray(), AssertionChain.GetOrCreate()); + } + + /// + /// Returns a object that can be used to assert the + /// current . + /// + [Pure] + [OverloadResolutionPriority(-1)] + public static SpanAssertions Should(this ReadOnlySpan actualValue) + { + return new SpanAssertions(actualValue.ToArray(), AssertionChain.GetOrCreate()); + } + + /// + /// Returns a object that can be used to assert the + /// current of strings. + /// + [Pure] + [OverloadResolutionPriority(-1)] + public static StringCollectionAssertions Should(this Span actualValue) + { + return new StringCollectionAssertions(actualValue.ToArray(), AssertionChain.GetOrCreate()); + } + + /// + /// Returns a object that can be used to assert the + /// current of strings. + /// + [Pure] + [OverloadResolutionPriority(-1)] + public static StringCollectionAssertions Should(this ReadOnlySpan actualValue) + { + return new StringCollectionAssertions(actualValue.ToArray(), AssertionChain.GetOrCreate()); + } + + /// + /// Returns a object that can be used to assert the + /// current . + /// + [Pure] + [OverloadResolutionPriority(-1)] + public static GenericCollectionAssertions Should(this Memory actualValue) + { + return new GenericCollectionAssertions(actualValue.ToArray(), AssertionChain.GetOrCreate()); + } + + /// + /// Returns a object that can be used to assert the + /// current . + /// + [Pure] + [OverloadResolutionPriority(-1)] + public static GenericCollectionAssertions Should(this ReadOnlyMemory actualValue) + { + return new GenericCollectionAssertions(actualValue.ToArray(), AssertionChain.GetOrCreate()); + } + +#endif + /// /// Forces enumerating a collection. Should be used to assert that a method that uses the /// keyword throws a particular exception. @@ -281,6 +351,7 @@ private static void ForceEnumeration(T subject, Func enumerab /// current . /// [Pure] + [OverloadResolutionPriority(-2)] public static ObjectAssertions Should([NotNull] this object actualValue) { return new ObjectAssertions(actualValue, AssertionChain.GetOrCreate()); diff --git a/Src/FluentAssertions/Collections/SpanAssertions.cs b/Src/FluentAssertions/Collections/SpanAssertions.cs new file mode 100644 index 0000000000..032cd437aa --- /dev/null +++ b/Src/FluentAssertions/Collections/SpanAssertions.cs @@ -0,0 +1,69 @@ +#if NET6_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER +using System; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using FluentAssertions.Execution; + +namespace FluentAssertions.Collections; + +/// +/// Contains a number of methods to assert that a or matches an expected set of values. +/// +/// +/// Note: Assertion methods convert spans to arrays for comparison, which involves heap allocation. +/// This is necessary to integrate with the existing assertion infrastructure. +/// +[DebuggerNonUserCode] +public class SpanAssertions : GenericCollectionAssertions> +{ + /// + /// Initializes a new instance of the class. + /// + /// The values of the span under test. + /// The assertion chain that is used to build fluent continuations. + public SpanAssertions(T[] actualValue, AssertionChain assertionChain) + : base(actualValue, assertionChain) + { + } + + /// + /// Asserts that the current span is equal to . + /// + /// The expected values to compare against. + /// + /// 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 . + /// + /// + /// An which can be used to chain assertions. + /// + public AndConstraint> BeEqualTo(Span expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + return Equal(expected.ToArray(), because, becauseArgs); + } + + /// + /// Asserts that the current span is equal to . + /// + /// The expected values to compare against. + /// + /// 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 . + /// + /// + /// An which can be used to chain assertions. + /// + public AndConstraint> BeEqualTo(ReadOnlySpan expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + return Equal(expected.ToArray(), because, becauseArgs); + } +} +#endif diff --git a/Src/FluentAssertions/Collections/SpanAssertionsExtensions.cs b/Src/FluentAssertions/Collections/SpanAssertionsExtensions.cs new file mode 100644 index 0000000000..b44c255c11 --- /dev/null +++ b/Src/FluentAssertions/Collections/SpanAssertionsExtensions.cs @@ -0,0 +1,54 @@ +#if NET6_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER + +using System; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using FluentAssertions.Collections; +using FluentAssertions.Common; +using FluentAssertions.Primitives; + +// ReSharper disable once CheckNamespace +#pragma warning disable IDE0130 // Namespace does not match folder structure +namespace FluentAssertions; + +/// +/// Provides string-specific assertion extensions for . +/// +[DebuggerNonUserCode] +public static class SpanAssertionsExtensions +{ + /// + /// Asserts that a or is exactly the same as , + /// including the casing and any leading or trailing whitespace. + /// + /// The on which the assertion is executed. + /// The expected string. + /// + /// 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 . + /// + /// + /// An which can be used to chain assertions. + /// + /// is . + public static AndConstraint> Be([NotNull] this SpanAssertions assertions, string expected, + [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) + { + Guard.ThrowIfArgumentIsNull(expected); + + var subject = new string(assertions.Subject!); + + var stringEqualityValidator = new StringValidator(assertions.CurrentAssertionChain, + new StringEqualityStrategy(StringComparer.Ordinal, "be"), + because, becauseArgs); + + stringEqualityValidator.Validate(subject, expected); + + return new AndConstraint>(assertions); + } +} + +#endif diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 78c033eba8..d7b4f66a64 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -47,7 +47,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 8689740f9b..f3fd04ac88 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -89,10 +89,12 @@ namespace FluentAssertions public static FluentAssertions.Primitives.NullableGuidAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Guid? actualValue) { } public static FluentAssertions.Streams.BufferedStreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.BufferedStream actualValue) { } public static FluentAssertions.Streams.StreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.Stream actualValue) { } + public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.ReadOnlySpan actualValue) { } public static FluentAssertions.Types.AssemblyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.ConstructorInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.ConstructorInfo constructorInfo) { } public static FluentAssertions.Types.MethodInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.MethodInfo methodInfo) { } public static FluentAssertions.Types.PropertyInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.PropertyInfo propertyInfo) { } + public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Span actualValue) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } public static FluentAssertions.Primitives.TimeOnlyAssertions Should(this System.TimeOnly actualValue) { } public static FluentAssertions.Primitives.NullableTimeOnlyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.TimeOnly? actualValue) { } @@ -168,6 +170,10 @@ namespace FluentAssertions public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func> action) { } public static FluentAssertions.Specialized.FunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func func) { } public static FluentAssertions.Numeric.ComparableTypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IComparable comparableValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Memory actualValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.ReadOnlyMemory actualValue) { } + public static FluentAssertions.Collections.SpanAssertions Should(this System.ReadOnlySpan actualValue) { } + public static FluentAssertions.Collections.SpanAssertions Should(this System.Span actualValue) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] @@ -367,6 +373,10 @@ namespace FluentAssertions { protected OccurrenceConstraint(int expectedCount) { } } + public static class SpanAssertionsExtensions + { + public static FluentAssertions.AndConstraint> Be([System.Diagnostics.CodeAnalysis.NotNull] this FluentAssertions.Collections.SpanAssertions assertions, string expected, string because = "", params object[] becauseArgs) { } + } public static class TypeEnumerableExtensions { public static System.Collections.Generic.IEnumerable ThatAreClasses(this System.Collections.Generic.IEnumerable types) { } @@ -566,6 +576,12 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint NotEqual(T unexpected, string because = "", params object[] becauseArgs) where T : System.Collections.Generic.IEnumerable> { } } + public class SpanAssertions : FluentAssertions.Collections.GenericCollectionAssertions> + { + public SpanAssertions(T[] actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } + public FluentAssertions.AndConstraint> BeEqualTo(System.ReadOnlySpan expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint> BeEqualTo(System.Span expected, string because = "", params object[] becauseArgs) { } + } public class StringCollectionAssertions : FluentAssertions.Collections.StringCollectionAssertions> { public StringCollectionAssertions(System.Collections.Generic.IEnumerable actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index d51f46b68a..f37a6670d6 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -82,10 +82,12 @@ namespace FluentAssertions public static FluentAssertions.Primitives.NullableGuidAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Guid? actualValue) { } public static FluentAssertions.Streams.BufferedStreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.BufferedStream actualValue) { } public static FluentAssertions.Streams.StreamAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IO.Stream actualValue) { } + public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.ReadOnlySpan actualValue) { } public static FluentAssertions.Types.AssemblyAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.Assembly assembly) { } public static FluentAssertions.Types.ConstructorInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.ConstructorInfo constructorInfo) { } public static FluentAssertions.Types.MethodInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.MethodInfo methodInfo) { } public static FluentAssertions.Types.PropertyInfoAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Reflection.PropertyInfo propertyInfo) { } + public static FluentAssertions.Collections.StringCollectionAssertions Should(this System.Span actualValue) { } public static FluentAssertions.Primitives.SimpleTimeSpanAssertions Should(this System.TimeSpan actualValue) { } public static FluentAssertions.Primitives.NullableSimpleTimeSpanAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.TimeSpan? actualValue) { } public static FluentAssertions.Types.TypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Type subject) { } @@ -150,6 +152,10 @@ namespace FluentAssertions public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func> action) { } public static FluentAssertions.Specialized.FunctionAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.Func func) { } public static FluentAssertions.Numeric.ComparableTypeAssertions Should([System.Diagnostics.CodeAnalysis.NotNull] this System.IComparable comparableValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.Memory actualValue) { } + public static FluentAssertions.Collections.GenericCollectionAssertions Should(this System.ReadOnlyMemory actualValue) { } + public static FluentAssertions.Collections.SpanAssertions Should(this System.ReadOnlySpan actualValue) { } + public static FluentAssertions.Collections.SpanAssertions Should(this System.Span actualValue) { } public static FluentAssertions.Specialized.TaskCompletionSourceAssertions Should(this System.Threading.Tasks.TaskCompletionSource tcs) { } [System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" + "ly following \'And\'", true)] @@ -332,6 +338,10 @@ namespace FluentAssertions { protected OccurrenceConstraint(int expectedCount) { } } + public static class SpanAssertionsExtensions + { + public static FluentAssertions.AndConstraint> Be([System.Diagnostics.CodeAnalysis.NotNull] this FluentAssertions.Collections.SpanAssertions assertions, string expected, string because = "", params object[] becauseArgs) { } + } public static class TypeEnumerableExtensions { public static System.Collections.Generic.IEnumerable ThatAreClasses(this System.Collections.Generic.IEnumerable types) { } @@ -530,6 +540,12 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint NotEqual(T unexpected, string because = "", params object[] becauseArgs) where T : System.Collections.Generic.IEnumerable> { } } + public class SpanAssertions : FluentAssertions.Collections.GenericCollectionAssertions> + { + public SpanAssertions(T[] actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } + public FluentAssertions.AndConstraint> BeEqualTo(System.ReadOnlySpan expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint> BeEqualTo(System.Span expected, string because = "", params object[] becauseArgs) { } + } public class StringCollectionAssertions : FluentAssertions.Collections.StringCollectionAssertions> { public StringCollectionAssertions(System.Collections.Generic.IEnumerable actualValue, FluentAssertions.Execution.AssertionChain assertionChain) { } diff --git a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs index 8d6e287d63..c5e037e1a2 100644 --- a/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/AssertionExtensionsSpecs.cs @@ -9,6 +9,7 @@ using FluentAssertions.Primitives; using FluentAssertions.Specialized; using FluentAssertions.Types; +using Reflectify; using Xunit; namespace FluentAssertions.Specs; @@ -162,8 +163,13 @@ public void Should_methods_have_a_matching_overload_to_guard_against_chaining_an [MemberData(nameof(GetShouldMethods), true)] public void Should_methods_returning_reference_or_nullable_type_assertions_are_annotated_with_not_null_attribute(MethodInfo method) { - var notNullAttribute = method.GetParameters().Single().GetCustomAttribute(); - notNullAttribute.Should().NotBeNull(); + ParameterInfo parameter = method.GetParameters().Single(); + + Type type = parameter.ParameterType; + + AssertionChain.GetOrCreate() + .ForCondition(type.IsRefStruct() || type.IsStruct() || parameter.HasAttribute()) + .FailWith($"Should method '{method}' should have [NotNull] attribute for parameter '{parameter.Name}'"); } [Theory] diff --git a/Tests/FluentAssertions.Specs/Collections/SpanAndMemorySpecs.cs b/Tests/FluentAssertions.Specs/Collections/SpanAndMemorySpecs.cs new file mode 100644 index 0000000000..cdcaf72acc --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/SpanAndMemorySpecs.cs @@ -0,0 +1,350 @@ +#if NET6_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public class SpanAndMemorySpecs +{ + public class GeneralPurposeCollections + { + [Fact] + public void A_span_supports_all_collection_assertions() + { + // Arrange + Span span = new[] { 1, 2, 3 }; + + // Act / Assert + span.Should().HaveCount(3) + .And.Contain(2) + .And.NotContain(4) + .And.StartWith(1) + .And.EndWith(3) + .And.BeInAscendingOrder(); + } + + [Fact] + public void A_readonly_span_supports_all_collection_assertions() + { + // Arrange + ReadOnlySpan span = [1, 2, 3]; + + // Act / Assert + span.Should().HaveCount(3) + .And.Contain(2) + .And.NotContain(4) + .And.StartWith(1) + .And.EndWith(3) + .And.BeInAscendingOrder(); + } + + [Fact] + public void A_memory_object_supports_all_collection_assertions() + { + // Arrange + Memory memory = new[] { 1, 2, 3 }; + + // Act / Assert + memory.Should().HaveCount(3) + .And.Contain(2) + .And.NotContain(4) + .And.StartWith(1) + .And.EndWith(3) + .And.BeInAscendingOrder(); + } + + [Fact] + public void A_readonly_memory_object_supports_all_collection_assertions() + { + // Arrange + ReadOnlyMemory memory = new[] { 1, 2, 3 }; + + // Act / Assert + memory.Should().HaveCount(3) + .And.Contain(2) + .And.NotContain(4) + .And.StartWith(1) + .And.EndWith(3) + .And.BeInAscendingOrder(); + } + + [Fact] + public void A_readonly_span_of_strings_supports_string_collection_assertions() + { + // Arrange + string[] array = ["one", "two", "three"]; + ReadOnlySpan span = new(array); + + // Act / Assert + span.Should().HaveCount(3) + .And.Contain("two") + .And.NotContain("four") + .And.StartWith("one") + .And.EndWith("three") + .And.ContainMatch("o*"); + } + + [Fact] + public void An_empty_span_supports_assertions() + { + // Arrange + Span span = []; + + // Act / Assert + span.Should().BeEmpty() + .And.HaveCount(0) + .And.NotContain(1); + } + + [Fact] + public void An_empty_readonly_span_supports_assertions() + { + // Arrange + ReadOnlySpan span = []; + + // Act / Assert + span.Should().BeEmpty() + .And.HaveCount(0) + .And.NotContain(1); + } + + [Fact] + public void An_empty_memory_supports_assertions() + { + // Arrange + Memory memory = Array.Empty(); + + // Act / Assert + memory.Should().BeEmpty() + .And.HaveCount(0) + .And.NotContain(1); + } + + [Fact] + public void An_empty_readonly_memory_supports_assertions() + { + // Arrange + ReadOnlyMemory memory = Array.Empty(); + + // Act / Assert + memory.Should().BeEmpty() + .And.HaveCount(0) + .And.NotContain(1); + } + + [Fact] + public void A_span_of_strings_supports_string_collection_assertions() + { + // Arrange + Span span = ["one", "two", "three"]; + + // Act / Assert + span.Should().HaveCount(3) + .And.Contain("two") + .And.NotContain("four") + .And.ContainMatch("t*") + .And.OnlyContain(s => s.Length >= 3); + } + + [Fact] + public void Chaining_on_a_span_is_supported() + { + // Arrange + Span span = new[] { 1, 2, 3 }; + + // Act / Assert + span.Should().HaveCount(3).And.Contain(2); + } + } + + public class Equality + { + [Fact] + public void A_span_of_integers_can_be_asserted_for_equality() + { + // Arrange + Span span = [1, 2, 3]; + + // Act / Assert + span.Should().Equal(1, 2, 3); + span.Should().BeEqualTo([1, 2, 3]); + } + + [Fact] + public void A_readonly_span_of_integers_can_be_asserted_for_equality() + { + // Arrange + ReadOnlySpan span = [1, 2, 3]; + + // Act / Assert + span.Should().Equal(1, 2, 3); + span.Should().BeEqualTo([1, 2, 3]); + } + + [Fact] + public void A_span_be_equal_to_accepts_span() + { + // Arrange + Span span = [1, 2, 3]; + Span expected = [1, 2, 3]; + + // Act / Assert + span.Should().BeEqualTo(expected); + } + + [Fact] + public void A_span_be_equal_to_accepts_readonly_span() + { + // Arrange + Span span = [1, 2, 3]; + ReadOnlySpan expected = [1, 2, 3]; + + // Act / Assert + span.Should().BeEqualTo(expected); + } + + [Fact] + public void A_readonly_span_be_equal_to_accepts_readonly_span() + { + // Arrange + ReadOnlySpan span = [1, 2, 3]; + ReadOnlySpan expected = [1, 2, 3]; + + // Act / Assert + span.Should().BeEqualTo(expected); + } + + [Fact] + public void A_span_of_integers_be_equal_to_should_throw_when_values_differ() + { + // Arrange + Span span = [1, 2, 3]; + + try + { + // Act + span.Should().BeEqualTo([1, 2, 4], "because {0}", "reasons"); + } + catch (XunitException e) + { + // Assert + e.Message.Should().Be( + "Expected span to be equal to {1, 2, 4} because reasons, but {1, 2, 3} differs at index 2."); + return; + } + + throw new XunitException("This point should not be reached."); + } + + [Fact] + public void A_readonly_span_of_integers_be_equal_to_should_throw_when_values_differ() + { + // Arrange + ReadOnlySpan span = [1, 2, 3]; + + try + { + // Act + span.Should().BeEqualTo([1, 2, 4]); + } + catch (XunitException e) + { + // Assert + e.Message.Should().Be( + "Expected span to be equal to {1, 2, 4}, but {1, 2, 3} differs at index 2."); + return; + } + + throw new XunitException("This point should not be reached."); + } + } + + public class Strings + { + [Fact] + public void A_span_of_chars_can_be_asserted_using_a_string() + { + // Arrange + Span span = ['a', 'b', 'c']; + + // Act / Assert + span.Should().Be("abc"); + } + + [Fact] + public void A_readonly_span_of_chars_can_be_asserted_using_a_string() + { + // Arrange + ReadOnlySpan span = ['a', 'b', 'c']; + + // Act / Assert + span.Should().Be("abc"); + } + + [Fact] + public void A_span_of_chars_be_should_throw_when_values_differ() + { + // Arrange + Span span = ['a', 'b', 'c']; + + try + { + // Act + span.Should().Be("abd", "because {0}", "reasons"); + } + catch (XunitException e) + { + // Assert + e.Message.Should().Match("Expected span to be \"abd\" because reasons, but*"); + return; + } + + throw new XunitException("This point should not be reached."); + } + + [Fact] + public void A_readonly_span_of_chars_be_should_throw_when_values_differ() + { + // Arrange + ReadOnlySpan span = ['a', 'b', 'c']; + + try + { + // Act + span.Should().Be("abd"); + } + catch (XunitException e) + { + // Assert + e.Message.Should().Match("Expected span to be \"abd\", but*"); + return; + } + + throw new XunitException("This point should not be reached."); + } + + [Fact] + public void A_span_of_chars_be_should_throw_when_expected_is_null() + { + // Arrange + Span span = ['a', 'b', 'c']; + + try + { + // Act + span.Should().Be(null!); + } + catch (ArgumentNullException e) + { + // Assert + e.ParamName.Should().Be("expected"); + return; + } + + throw new XunitException("This point should not be reached."); + } + } +} + +#endif diff --git a/docs/_pages/collections.md b/docs/_pages/collections.md index 692900a14c..1339cfaf01 100644 --- a/docs/_pages/collections.md +++ b/docs/_pages/collections.md @@ -90,6 +90,35 @@ singleEquivalent.Should().ContainSingle() .Which.Should().BeEquivalentTo(new { Size = 42 }); ``` +You can use the same collection assertions on `Span`, `ReadOnlySpan`, `Memory`, and `ReadOnlyMemory`. +For spans, `BeEqualTo` is available as a readability alias for `Equal`. + +```csharp +Span span = [1, 2, 3]; +ReadOnlySpan readOnlySpan = [1, 2, 3]; +Memory memory = new[] { 1, 2, 3 }; +ReadOnlyMemory readOnlyMemory = new[] { 1, 2, 3 }; + +span.Should().Equal([1, 2, 3]); +span.Should().BeEqualTo([1, 2, 3]); + +readOnlySpan.Should().Equal([1, 2, 3]); +readOnlySpan.Should().BeEqualTo([1, 2, 3]); + +memory.Should().Contain(2).And.HaveCount(3); +readOnlyMemory.Should().Contain(2).And.HaveCount(3); +``` + +For character spans, you can assert exact string equality with `Be`. + +```csharp +Span chars = ['a', 'b', 'c']; +ReadOnlySpan readOnlyChars = ['a', 'b', 'c']; + +chars.Should().Be("abc"); +readOnlyChars.Should().Be("abc"); +``` + Asserting that a collection contains items in a certain order is as easy as using one of the several overloads of `BeInAscendingOrder` or `BeInDescendingOrder`. The default overload will use the default `Comparer` for the specified type, but overloads also exist that take an `IComparer`, a property expression to sort by an object's property, or a lambda expression to avoid the need for `IComparer` implementations. ```csharp @@ -108,7 +137,7 @@ collection.Should().BeInDescendingOrder(item => item.SomeProp, StringComparer.Cu collection.Should().NotBeInAscendingOrder(item => item.SomeProp, StringComparer.CurrentCulture); collection.Should().NotBeInDescendingOrder(item => item.SomeProp, StringComparer.CurrentCulture); ``` - + For `String` collections there are specific methods to assert the items. For the `ContainMatch` and `NotContainMatch` methods we support wildcards. The pattern can be a combination of literal and wildcard characters, but it doesn't support regular expressions. diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 685961f616..7f9b256d5f 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -11,6 +11,7 @@ sidebar: ### What's new +* Added extensive support for `Span` / `ReadOnlySpan` and `Be(string)` for `Span` / `ReadOnlySpan` - [#3172](https://github.com/fluentassertions/fluentassertions/pull/3172) * Added `Excluding()` and `Excluding(Type)` overloads to exclude all members of a certain type from equivalency comparisons - [#3115](https://github.com/fluentassertions/fluentassertions/pull/3115) * `BeEquivalentTo` will now report the missing or extraneous items for differently sized collections - [#3133](https://github.com/fluentassertions/fluentassertions/pull/3133) * Added `HaveMillisecond` and `NotHaveMillisecond` assertion methods for `DateTime` and `DateTimeOffset` - [#3164](https://github.com/fluentassertions/fluentassertions/pull/3164) From 4a8d68596c2a2fec4619803faee61c746ee59096 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 8 Mar 2026 10:47:23 +0100 Subject: [PATCH 794/845] Remove namespace qualifiers --- Src/FluentAssertions/AssertionExtensions.cs | 12 ++++++------ Src/FluentAssertions/AsyncAssertionsExtensions.cs | 2 +- .../Common/ValueFormatterDetectionMode.cs | 2 +- Src/FluentAssertions/Equivalency/IObjectInfo.cs | 2 +- .../Equivalency/OrderingRuleCollection.cs | 4 ++-- .../Equivalency/SelfReferenceEquivalencyOptions.cs | 2 +- Src/FluentAssertions/Execution/Reason.cs | 2 +- .../Formatting/DefaultValueFormatter.cs | 6 +++--- Src/FluentAssertions/Formatting/Formatter.cs | 2 +- Src/FluentAssertions/Formatting/FormattingOptions.cs | 2 +- .../Primitives/DateTimeAssertions.cs | 4 ++-- .../Primitives/DateTimeOffsetAssertions.cs | 4 ++-- .../Primitives/DateTimeRangeAssertions.cs | 4 ++-- .../Primitives/NullableDateTimeOffsetAssertions.cs | 4 ++-- .../Primitives/NullableSimpleTimeSpanAssertions.cs | 4 ++-- Src/FluentAssertions/TypeExtensions.cs | 2 +- Src/FluentAssertions/Types/MethodInfoSelector.cs | 4 ++-- Src/FluentAssertions/Types/PropertyInfoSelector.cs | 4 ++-- Src/FluentAssertions/Types/TypeAssertions.cs | 4 ++-- Src/FluentAssertions/Types/TypeSelector.cs | 6 +++--- .../Common/TypeExtensionsSpecs.cs | 2 ++ 21 files changed, 40 insertions(+), 38 deletions(-) diff --git a/Src/FluentAssertions/AssertionExtensions.cs b/Src/FluentAssertions/AssertionExtensions.cs index 3bde7e78eb..077d236cf9 100644 --- a/Src/FluentAssertions/AssertionExtensions.cs +++ b/Src/FluentAssertions/AssertionExtensions.cs @@ -162,7 +162,7 @@ public static ExecutionTime ExecutionTime(this Func action) /// /// Returns an object that can be used to assert the - /// current . + /// current . /// [Pure] public static ExecutionTimeAssertions Should(this ExecutionTime executionTime) @@ -802,7 +802,7 @@ public static NullableSimpleTimeSpanAssertions Should([NotNull] this TimeSpan? a /// /// Returns a object that can be used to assert the - /// current . + /// current . /// [Pure] public static TypeAssertions Should([NotNull] this Type subject) @@ -824,7 +824,7 @@ public static TypeSelectorAssertions Should(this TypeSelector typeSelector) } /// - /// Returns a object + /// Returns a object /// that can be used to assert the current . /// /// @@ -885,7 +885,7 @@ public static PropertyInfoSelectorAssertions Should(this PropertyInfoSelector pr /// /// Returns a object that can be used to assert the - /// current . + /// current . /// [Pure] public static ActionAssertions Should([NotNull] this Action action) @@ -895,7 +895,7 @@ public static ActionAssertions Should([NotNull] this Action action) /// /// Returns a object that can be used to assert the - /// current . + /// current . /// [Pure] public static NonGenericAsyncFunctionAssertions Should([NotNull] this Func action) @@ -915,7 +915,7 @@ public static GenericAsyncFunctionAssertions Should([NotNull] this Func /// Returns a object that can be used to assert the - /// current . + /// current . /// [Pure] public static FunctionAssertions Should([NotNull] this Func func) diff --git a/Src/FluentAssertions/AsyncAssertionsExtensions.cs b/Src/FluentAssertions/AsyncAssertionsExtensions.cs index 4981a66dd0..fa5fb7d8ed 100644 --- a/Src/FluentAssertions/AsyncAssertionsExtensions.cs +++ b/Src/FluentAssertions/AsyncAssertionsExtensions.cs @@ -21,7 +21,7 @@ public static class AsyncAssertionsExtensions /// /// /// Please note that this assertion cannot identify whether the previous assertion was successful or not. - /// In case it was not successful and it is running within an active + /// In case it was not successful and it is running within an active /// there is no current result to compare with. /// So, this extension will compare with the default value. /// diff --git a/Src/FluentAssertions/Common/ValueFormatterDetectionMode.cs b/Src/FluentAssertions/Common/ValueFormatterDetectionMode.cs index ec1924e582..67eb0cfada 100644 --- a/Src/FluentAssertions/Common/ValueFormatterDetectionMode.cs +++ b/Src/FluentAssertions/Common/ValueFormatterDetectionMode.cs @@ -3,7 +3,7 @@ namespace FluentAssertions.Common; /// -/// Defines the modes in which custom implementations of +/// Defines the modes in which custom implementations of /// are detected as configured through . /// public enum ValueFormatterDetectionMode diff --git a/Src/FluentAssertions/Equivalency/IObjectInfo.cs b/Src/FluentAssertions/Equivalency/IObjectInfo.cs index a02a04a1a0..5a10a3da8e 100644 --- a/Src/FluentAssertions/Equivalency/IObjectInfo.cs +++ b/Src/FluentAssertions/Equivalency/IObjectInfo.cs @@ -30,7 +30,7 @@ public interface IObjectInfo /// /// Gets the compile-time type of the current object. If the current object is not the root object and the type is not , - /// then it returns the same as the property does. + /// then it returns the same as the property does. /// Type CompileTimeType { get; } diff --git a/Src/FluentAssertions/Equivalency/OrderingRuleCollection.cs b/Src/FluentAssertions/Equivalency/OrderingRuleCollection.cs index 6478f7a2da..8707a7d659 100644 --- a/Src/FluentAssertions/Equivalency/OrderingRuleCollection.cs +++ b/Src/FluentAssertions/Equivalency/OrderingRuleCollection.cs @@ -31,7 +31,7 @@ public OrderingRuleCollection(IEnumerable orderingRules) /// Returns an enumerator that iterates through the collection. /// /// - /// A that can be used to iterate through the collection. + /// A that can be used to iterate through the collection. /// /// 1 public IEnumerator GetEnumerator() @@ -43,7 +43,7 @@ public IEnumerator GetEnumerator() /// Returns an enumerator that iterates through a collection. /// /// - /// An object that can be used to iterate through the collection. + /// An object that can be used to iterate through the collection. /// /// 2 IEnumerator IEnumerable.GetEnumerator() diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index 8476cdda63..aaf30b9127 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -917,7 +917,7 @@ public TSelf IgnoringJsonPropertyCasing() /// /// Returns the comparer for strings, which is either an explicitly specified comparer via - /// or an ordinal + /// or an ordinal /// comparer depending on . /// internal IEqualityComparer GetStringComparerOrDefault() diff --git a/Src/FluentAssertions/Execution/Reason.cs b/Src/FluentAssertions/Execution/Reason.cs index 297f47e437..11468f3d6a 100644 --- a/Src/FluentAssertions/Execution/Reason.cs +++ b/Src/FluentAssertions/Execution/Reason.cs @@ -21,7 +21,7 @@ public Reason([StringSyntax("CompositeFormat")] string formattedMessage, object[ public string FormattedMessage { get; set; } /// - /// Zero or more objects to format using the placeholders in . + /// Zero or more objects to format using the placeholders in . /// public object[] Arguments { get; set; } } diff --git a/Src/FluentAssertions/Formatting/DefaultValueFormatter.cs b/Src/FluentAssertions/Formatting/DefaultValueFormatter.cs index 01ff94aab3..aa9b376c4b 100644 --- a/Src/FluentAssertions/Formatting/DefaultValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/DefaultValueFormatter.cs @@ -45,7 +45,7 @@ public void Format(object value, FormattedObjectGraph formattedGraph, Formatting /// /// Selects which members of to format. /// - /// The of the object being formatted. + /// The of the object being formatted. /// The members of that will be included when formatting this object. /// The default is all non-private members. protected virtual MemberInfo[] GetMembers(Type type) @@ -115,9 +115,9 @@ private static void WriteMemberValues(object obj, MemberInfo[] members, Formatte /// /// Selects the name to display for . /// - /// The of the object being formatted. + /// The of the object being formatted. /// The name to be displayed for . - /// The default is . + /// The default is . protected virtual string TypeDisplayName(Type type) => type.FullName; private static void WriteMemberValueTextFor(object value, MemberInfo member, FormattedObjectGraph formattedGraph, diff --git a/Src/FluentAssertions/Formatting/Formatter.cs b/Src/FluentAssertions/Formatting/Formatter.cs index 0525613c7d..811a2fbf6f 100644 --- a/Src/FluentAssertions/Formatting/Formatter.cs +++ b/Src/FluentAssertions/Formatting/Formatter.cs @@ -168,7 +168,7 @@ private static void Format(object value, FormattedObjectGraph output, Formatting } /// - /// Removes a custom formatter that was previously added through . + /// Removes a custom formatter that was previously added through . /// /// /// This method is not thread-safe and should not be invoked from within a unit test. diff --git a/Src/FluentAssertions/Formatting/FormattingOptions.cs b/Src/FluentAssertions/Formatting/FormattingOptions.cs index abb3d5be41..8327b13e7b 100644 --- a/Src/FluentAssertions/Formatting/FormattingOptions.cs +++ b/Src/FluentAssertions/Formatting/FormattingOptions.cs @@ -43,7 +43,7 @@ public class FormattingOptions public int MaxLines { get; set; } = 100; /// - /// Removes a scoped formatter that was previously added through . + /// Removes a scoped formatter that was previously added through . /// /// A custom implementation of public void RemoveFormatter(IValueFormatter formatter) diff --git a/Src/FluentAssertions/Primitives/DateTimeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeAssertions.cs index 83cbec39ac..551471e40a 100644 --- a/Src/FluentAssertions/Primitives/DateTimeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeAssertions.cs @@ -12,7 +12,7 @@ namespace FluentAssertions.Primitives; /// Contains a number of methods to assert that a is in the expected state. /// /// -/// You can use the +/// You can use the /// for a more fluent way of specifying a . /// [DebuggerNonUserCode] @@ -30,7 +30,7 @@ public DateTimeAssertions(DateTime? value, AssertionChain assertionChain) /// Contains a number of methods to assert that a is in the expected state. /// /// -/// You can use the +/// You can use the /// for a more fluent way of specifying a . /// [DebuggerNonUserCode] diff --git a/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs index 75e682201d..b17e9b3d3d 100644 --- a/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeOffsetAssertions.cs @@ -12,7 +12,7 @@ namespace FluentAssertions.Primitives; /// Contains a number of methods to assert that a is in the expected state. /// /// -/// You can use the +/// You can use the /// for a more fluent way of specifying a . /// [DebuggerNonUserCode] @@ -31,7 +31,7 @@ public DateTimeOffsetAssertions(DateTimeOffset? value, AssertionChain assertionC /// Contains a number of methods to assert that a is in the expected state. /// /// -/// You can use the +/// You can use the /// for a more fluent way of specifying a . /// [DebuggerNonUserCode] diff --git a/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs b/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs index 79a3e98da5..400215e9a0 100644 --- a/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs +++ b/Src/FluentAssertions/Primitives/DateTimeRangeAssertions.cs @@ -12,8 +12,8 @@ namespace FluentAssertions.Primitives; /// Contains a number of methods to assert that two objects differ in the expected way. /// /// -/// You can use the and -/// for a more fluent +/// You can use the and +/// for a more fluent /// way of specifying a or a . /// [DebuggerNonUserCode] diff --git a/Src/FluentAssertions/Primitives/NullableDateTimeOffsetAssertions.cs b/Src/FluentAssertions/Primitives/NullableDateTimeOffsetAssertions.cs index fd61a04611..e1b4160635 100644 --- a/Src/FluentAssertions/Primitives/NullableDateTimeOffsetAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableDateTimeOffsetAssertions.cs @@ -9,7 +9,7 @@ namespace FluentAssertions.Primitives; /// Contains a number of methods to assert that a nullable is in the expected state. /// /// -/// You can use the +/// You can use the /// for a more fluent way of specifying a . /// [DebuggerNonUserCode] @@ -25,7 +25,7 @@ public NullableDateTimeOffsetAssertions(DateTimeOffset? expected, AssertionChain /// Contains a number of methods to assert that a nullable is in the expected state. /// /// -/// You can use the +/// You can use the /// for a more fluent way of specifying a . /// [DebuggerNonUserCode] diff --git a/Src/FluentAssertions/Primitives/NullableSimpleTimeSpanAssertions.cs b/Src/FluentAssertions/Primitives/NullableSimpleTimeSpanAssertions.cs index c27e8ec10b..cc339a6643 100644 --- a/Src/FluentAssertions/Primitives/NullableSimpleTimeSpanAssertions.cs +++ b/Src/FluentAssertions/Primitives/NullableSimpleTimeSpanAssertions.cs @@ -9,7 +9,7 @@ namespace FluentAssertions.Primitives; /// Contains a number of methods to assert that a nullable is in the expected state. /// /// -/// You can use the +/// You can use the /// for a more fluent way of specifying a . /// [DebuggerNonUserCode] @@ -25,7 +25,7 @@ public NullableSimpleTimeSpanAssertions(TimeSpan? value, AssertionChain assertio /// Contains a number of methods to assert that a nullable is in the expected state. /// /// -/// You can use the +/// You can use the /// for a more fluent way of specifying a . /// [DebuggerNonUserCode] diff --git a/Src/FluentAssertions/TypeExtensions.cs b/Src/FluentAssertions/TypeExtensions.cs index 8f8e9415e0..e7f7e63e8a 100644 --- a/Src/FluentAssertions/TypeExtensions.cs +++ b/Src/FluentAssertions/TypeExtensions.cs @@ -31,7 +31,7 @@ public static TypeSelector Types(this Type type) } /// - /// Returns a type selector for the current . + /// Returns a type selector for the current . /// public static TypeSelector Types(this IEnumerable types) { diff --git a/Src/FluentAssertions/Types/MethodInfoSelector.cs b/Src/FluentAssertions/Types/MethodInfoSelector.cs index 1ae9926f3c..dd6fa959a6 100644 --- a/Src/FluentAssertions/Types/MethodInfoSelector.cs +++ b/Src/FluentAssertions/Types/MethodInfoSelector.cs @@ -237,7 +237,7 @@ private static bool HasSpecialName(MethodInfo method) /// Returns an enumerator that iterates through the collection. /// /// - /// A that can be used to iterate through the collection. + /// A that can be used to iterate through the collection. /// /// 1 public IEnumerator GetEnumerator() @@ -249,7 +249,7 @@ public IEnumerator GetEnumerator() /// Returns an enumerator that iterates through a collection. /// /// - /// An object that can be used to iterate through the collection. + /// An object that can be used to iterate through the collection. /// /// 2 IEnumerator IEnumerable.GetEnumerator() diff --git a/Src/FluentAssertions/Types/PropertyInfoSelector.cs b/Src/FluentAssertions/Types/PropertyInfoSelector.cs index 9eab951ccf..f08761718b 100644 --- a/Src/FluentAssertions/Types/PropertyInfoSelector.cs +++ b/Src/FluentAssertions/Types/PropertyInfoSelector.cs @@ -209,7 +209,7 @@ public PropertyInfo[] ToArray() /// Returns an enumerator that iterates through the collection. /// /// - /// A that can be used to iterate through the collection. + /// A that can be used to iterate through the collection. /// /// 1 public IEnumerator GetEnumerator() @@ -221,7 +221,7 @@ public IEnumerator GetEnumerator() /// Returns an enumerator that iterates through a collection. /// /// - /// An object that can be used to iterate through the collection. + /// An object that can be used to iterate through the collection. /// /// 2 IEnumerator IEnumerable.GetEnumerator() diff --git a/Src/FluentAssertions/Types/TypeAssertions.cs b/Src/FluentAssertions/Types/TypeAssertions.cs index cb8f141e05..2a77c46207 100644 --- a/Src/FluentAssertions/Types/TypeAssertions.cs +++ b/Src/FluentAssertions/Types/TypeAssertions.cs @@ -292,7 +292,7 @@ public AndWhichConstraint BeDecoratedWith - /// Asserts that the current is decorated with, or inherits from a parent class, the specified . + /// Asserts that the current is decorated with, or inherits from a parent class, the specified . /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -317,7 +317,7 @@ public AndWhichConstraint BeDecoratedWithOrInherit - /// Asserts that the current is decorated with, or inherits from a parent class, an attribute of type + /// Asserts that the current is decorated with, or inherits from a parent class, an attribute of type /// that matches the specified . /// /// diff --git a/Src/FluentAssertions/Types/TypeSelector.cs b/Src/FluentAssertions/Types/TypeSelector.cs index 792d9c21e4..03d7c1e8eb 100644 --- a/Src/FluentAssertions/Types/TypeSelector.cs +++ b/Src/FluentAssertions/Types/TypeSelector.cs @@ -33,7 +33,7 @@ public TypeSelector(IEnumerable types) } /// - /// The resulting objects. + /// The resulting objects. /// public Type[] ToArray() { @@ -349,7 +349,7 @@ public TypeSelector UnwrapEnumerableTypes() /// Returns an enumerator that iterates through the collection. /// /// - /// A that can be used to iterate through the collection. + /// A that can be used to iterate through the collection. /// /// 1 public IEnumerator GetEnumerator() @@ -361,7 +361,7 @@ public IEnumerator GetEnumerator() /// Returns an enumerator that iterates through a collection. /// /// - /// An object that can be used to iterate through the collection. + /// An object that can be used to iterate through the collection. /// /// 2 IEnumerator IEnumerable.GetEnumerator() diff --git a/Tests/FluentAssertions.Specs/Common/TypeExtensionsSpecs.cs b/Tests/FluentAssertions.Specs/Common/TypeExtensionsSpecs.cs index 72c2e297b4..08a138a7ba 100644 --- a/Tests/FluentAssertions.Specs/Common/TypeExtensionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Common/TypeExtensionsSpecs.cs @@ -210,7 +210,9 @@ private record struct MyRecordStruct(int Value); private record struct MyRecordStructWithCustomPrintMembers(int Value) { // ReSharper disable once RedundantNameQualifier +#pragma warning disable IDE0001 private bool PrintMembers(System.Text.StringBuilder builder) +#pragma warning restore IDE0001 { builder.Append(Value); return true; From c8262f75322bc8e2cfa7e4efea66311db9295261 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 8 Mar 2026 10:51:19 +0100 Subject: [PATCH 795/845] Fix "an" vs "a" typos --- Src/FluentAssertions/AssertionExtensions.cs | 92 +++++++++---------- .../GenericCollectionAssertions.cs | 6 +- .../Equivalency/EquivalencyOptions.cs | 2 +- .../Equivalency/IAssertionContext.cs | 2 +- .../Equivalency/OrderingRuleCollection.cs | 2 +- .../Equivalency/Steps/AssertionResultSet.cs | 2 +- .../Events/EventAssertions.cs | 2 +- .../Execution/CollectingAssertionStrategy.cs | 2 +- .../Execution/ContinuationOfGiven.cs | 2 +- .../Execution/DefaultAssertionStrategy.cs | 2 +- .../Execution/IAssertionStrategy.cs | 4 +- .../Formatting/IValueFormatter.cs | 2 +- .../Numeric/Int32Assertions.cs | 2 +- .../Streams/BufferedStreamAssertions.cs | 2 +- .../Streams/StreamAssertions.cs | 2 +- .../Types/MethodInfoSelector.cs | 2 +- .../Types/PropertyInfoSelector.cs | 2 +- Src/FluentAssertions/Types/TypeSelector.cs | 2 +- Tests/.editorconfig | 4 +- 19 files changed, 68 insertions(+), 68 deletions(-) diff --git a/Src/FluentAssertions/AssertionExtensions.cs b/Src/FluentAssertions/AssertionExtensions.cs index 077d236cf9..35d7a6f5e6 100644 --- a/Src/FluentAssertions/AssertionExtensions.cs +++ b/Src/FluentAssertions/AssertionExtensions.cs @@ -211,7 +211,7 @@ public static XAttributeAssertions Should([NotNull] this XAttribute actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -221,7 +221,7 @@ public static StreamAssertions Should([NotNull] this Stream actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -360,7 +360,7 @@ public static ObjectAssertions Should([NotNull] this object actualValue) #pragma warning disable AV1564 // Avoid signatures that take a bool parameter /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -370,7 +370,7 @@ public static BooleanAssertions Should(this bool actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -382,7 +382,7 @@ public static NullableBooleanAssertions Should([NotNull] this bool? actualValue) #pragma warning restore AV1564 /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -392,7 +392,7 @@ public static GuidAssertions Should(this Guid actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -402,7 +402,7 @@ public static NullableGuidAssertions Should([NotNull] this Guid? actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -412,7 +412,7 @@ public static GenericCollectionAssertions Should([NotNull] this IEnumerabl } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -422,7 +422,7 @@ public static StringCollectionAssertions Should([NotNull] this IEnumerable - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -434,7 +434,7 @@ public static GenericDictionaryAssertions, TKey, TValu } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current of . /// [Pure] @@ -446,7 +446,7 @@ public static GenericDictionaryAssertions } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -458,7 +458,7 @@ public static GenericDictionaryAssertions Should - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -468,7 +468,7 @@ public static DateTimeAssertions Should(this DateTime actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -478,7 +478,7 @@ public static DateTimeOffsetAssertions Should(this DateTimeOffset actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -488,7 +488,7 @@ public static NullableDateTimeAssertions Should([NotNull] this DateTime? actualV } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -499,7 +499,7 @@ public static NullableDateTimeOffsetAssertions Should([NotNull] this DateTimeOff #if NET6_0_OR_GREATER /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -509,7 +509,7 @@ public static DateOnlyAssertions Should(this DateOnly actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -519,7 +519,7 @@ public static NullableDateOnlyAssertions Should([NotNull] this DateOnly? actualV } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -529,7 +529,7 @@ public static TimeOnlyAssertions Should(this TimeOnly actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -541,7 +541,7 @@ public static NullableTimeOnlyAssertions Should([NotNull] this TimeOnly? actualV #endif /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -551,7 +551,7 @@ public static ComparableTypeAssertions Should([NotNull] this IComparable - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -561,7 +561,7 @@ public static NumericAssertions Should(this int actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -571,7 +571,7 @@ public static NullableNumericAssertions Should([NotNull] this int? actualVa } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -581,7 +581,7 @@ public static NumericAssertions Should(this uint actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -591,7 +591,7 @@ public static NullableNumericAssertions Should([NotNull] this uint? actual } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -601,7 +601,7 @@ public static NumericAssertions Should(this decimal actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -611,7 +611,7 @@ public static NullableNumericAssertions Should([NotNull] this decimal? } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -621,7 +621,7 @@ public static NumericAssertions Should(this byte actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -631,7 +631,7 @@ public static NullableNumericAssertions Should([NotNull] this byte? actual } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -641,7 +641,7 @@ public static NumericAssertions Should(this sbyte actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -651,7 +651,7 @@ public static NullableNumericAssertions Should([NotNull] this sbyte? actu } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -661,7 +661,7 @@ public static NumericAssertions Should(this short actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -671,7 +671,7 @@ public static NullableNumericAssertions Should([NotNull] this short? actu } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -681,7 +681,7 @@ public static NumericAssertions Should(this ushort actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -691,7 +691,7 @@ public static NullableNumericAssertions Should([NotNull] this ushort? ac } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -701,7 +701,7 @@ public static NumericAssertions Should(this long actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -711,7 +711,7 @@ public static NullableNumericAssertions Should([NotNull] this long? actual } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -721,7 +721,7 @@ public static NumericAssertions Should(this ulong actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -731,7 +731,7 @@ public static NullableNumericAssertions Should([NotNull] this ulong? actu } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -741,7 +741,7 @@ public static NumericAssertions Should(this float actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -751,7 +751,7 @@ public static NullableNumericAssertions Should([NotNull] this float? actu } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -761,7 +761,7 @@ public static NumericAssertions Should(this double actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -771,7 +771,7 @@ public static NullableNumericAssertions Should([NotNull] this double? ac } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -781,7 +781,7 @@ public static StringAssertions Should([NotNull] this string actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current . /// [Pure] @@ -791,7 +791,7 @@ public static SimpleTimeSpanAssertions Should(this TimeSpan actualValue) } /// - /// Returns an object that can be used to assert the + /// Returns a object that can be used to assert the /// current nullable . /// [Pure] @@ -884,7 +884,7 @@ public static PropertyInfoSelectorAssertions Should(this PropertyInfoSelector pr } /// - /// Returns a object that can be used to assert the + /// Returns an object that can be used to assert the /// current . /// [Pure] diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index 48afbd0128..e3a4c4985c 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -1303,7 +1303,7 @@ public AndConstraint EndWith(IEnumerable expectation, [StringSyn /// A collection of expected elements. /// /// - /// A equality comparison the is used to determine whether two objects should be treated as equal. + /// An equality comparison the is used to determine whether two objects should be treated as equal. /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -1364,7 +1364,7 @@ public AndConstraint Equal(params T[] elements) /// The collection to compare the subject with. /// /// - /// A equality comparison the is used to determine whether two objects should be treated as equal. + /// An equality comparison the is used to determine whether two objects should be treated as equal. /// /// /// A formatted phrase as is supported by explaining why the assertion @@ -3275,7 +3275,7 @@ public AndConstraint StartWith(IEnumerable expectation, [StringS /// A collection of expected elements. /// /// - /// A equality comparison the is used to determine whether two objects should be treated as equal. + /// An equality comparison the is used to determine whether two objects should be treated as equal. /// /// /// A formatted phrase as is supported by explaining why the assertion diff --git a/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs index dbe425b1e1..857e94d96d 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyOptions.cs @@ -95,7 +95,7 @@ public EquivalencyOptions WithoutStrictOrderingFor( } /// - /// Creates a new set of options based on the current instance which acts on a a collection of the . + /// Creates a new set of options based on the current instance which acts on a collection of the . /// public EquivalencyOptions> AsCollection() { diff --git a/Src/FluentAssertions/Equivalency/IAssertionContext.cs b/Src/FluentAssertions/Equivalency/IAssertionContext.cs index 1c6d662a82..4b993796ad 100644 --- a/Src/FluentAssertions/Equivalency/IAssertionContext.cs +++ b/Src/FluentAssertions/Equivalency/IAssertionContext.cs @@ -18,7 +18,7 @@ public interface IAssertionContext TSubject Subject { get; } /// - /// Gets the value of the expectation object that was matched with the subject using a . + /// Gets the value of the expectation object that was matched with the subject using an . /// TSubject Expectation { get; } diff --git a/Src/FluentAssertions/Equivalency/OrderingRuleCollection.cs b/Src/FluentAssertions/Equivalency/OrderingRuleCollection.cs index 8707a7d659..20a1581893 100644 --- a/Src/FluentAssertions/Equivalency/OrderingRuleCollection.cs +++ b/Src/FluentAssertions/Equivalency/OrderingRuleCollection.cs @@ -31,7 +31,7 @@ public OrderingRuleCollection(IEnumerable orderingRules) /// Returns an enumerator that iterates through the collection. /// /// - /// A that can be used to iterate through the collection. + /// An that can be used to iterate through the collection. /// /// 1 public IEnumerator GetEnumerator() diff --git a/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs b/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs index abbe6587b1..17e5ddda05 100644 --- a/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs +++ b/Src/FluentAssertions/Equivalency/Steps/AssertionResultSet.cs @@ -6,7 +6,7 @@ namespace FluentAssertions.Equivalency.Steps; /// -/// Represents a collection of assertion results obtained through a . +/// Represents a collection of assertion results obtained through an . /// [System.Diagnostics.StackTraceHidden] internal class AssertionResultSet diff --git a/Src/FluentAssertions/Events/EventAssertions.cs b/Src/FluentAssertions/Events/EventAssertions.cs index 809558eef9..00c1bacc11 100644 --- a/Src/FluentAssertions/Events/EventAssertions.cs +++ b/Src/FluentAssertions/Events/EventAssertions.cs @@ -10,7 +10,7 @@ namespace FluentAssertions.Events; /// -/// Provides convenient assertion methods on a that can be +/// Provides convenient assertion methods on an that can be /// used to assert that certain events have been raised. /// public class EventAssertions : ReferenceTypeAssertions> diff --git a/Src/FluentAssertions/Execution/CollectingAssertionStrategy.cs b/Src/FluentAssertions/Execution/CollectingAssertionStrategy.cs index b8cb21ae77..574f652aa2 100644 --- a/Src/FluentAssertions/Execution/CollectingAssertionStrategy.cs +++ b/Src/FluentAssertions/Execution/CollectingAssertionStrategy.cs @@ -49,7 +49,7 @@ public void ThrowIfAny(IDictionary context) } /// - /// Instructs the strategy to handle a assertion failure. + /// Instructs the strategy to handle an assertion failure. /// public void HandleFailure(string message) { diff --git a/Src/FluentAssertions/Execution/ContinuationOfGiven.cs b/Src/FluentAssertions/Execution/ContinuationOfGiven.cs index 7b09cad36a..f3240248d1 100644 --- a/Src/FluentAssertions/Execution/ContinuationOfGiven.cs +++ b/Src/FluentAssertions/Execution/ContinuationOfGiven.cs @@ -1,7 +1,7 @@ namespace FluentAssertions.Execution; /// -/// Enables chaining multiple assertions from a call. +/// Enables chaining multiple assertions from an call. /// [System.Diagnostics.StackTraceHidden] public class ContinuationOfGiven diff --git a/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs b/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs index d7831f7738..b6421e59a0 100644 --- a/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs +++ b/Src/FluentAssertions/Execution/DefaultAssertionStrategy.cs @@ -13,7 +13,7 @@ internal class DefaultAssertionStrategy : IAssertionStrategy public IEnumerable FailureMessages => []; /// - /// Instructs the strategy to handle a assertion failure. + /// Instructs the strategy to handle an assertion failure. /// public void HandleFailure(string message) { diff --git a/Src/FluentAssertions/Execution/IAssertionStrategy.cs b/Src/FluentAssertions/Execution/IAssertionStrategy.cs index a3a667ef3f..8dbd04e0d2 100644 --- a/Src/FluentAssertions/Execution/IAssertionStrategy.cs +++ b/Src/FluentAssertions/Execution/IAssertionStrategy.cs @@ -3,7 +3,7 @@ namespace FluentAssertions.Execution; /// -/// Defines a strategy for handling failures in a . +/// Defines a strategy for handling failures in an . /// public interface IAssertionStrategy { @@ -13,7 +13,7 @@ public interface IAssertionStrategy IEnumerable FailureMessages { get; } /// - /// Instructs the strategy to handle a assertion failure. + /// Instructs the strategy to handle an assertion failure. /// void HandleFailure(string message); diff --git a/Src/FluentAssertions/Formatting/IValueFormatter.cs b/Src/FluentAssertions/Formatting/IValueFormatter.cs index cb908199cc..d230fe3e80 100644 --- a/Src/FluentAssertions/Formatting/IValueFormatter.cs +++ b/Src/FluentAssertions/Formatting/IValueFormatter.cs @@ -35,7 +35,7 @@ public interface IValueFormatter /// DO NOT CALL directly, but use /// instead. This will ensure cyclic dependencies are properly detected. /// Also, the may throw - /// an that must be ignored by implementations of this interface. + /// a that must be ignored by implementations of this interface. /// void Format(object value, FormattedObjectGraph formattedGraph, FormattingContext context, FormatChild formatChild); } diff --git a/Src/FluentAssertions/Numeric/Int32Assertions.cs b/Src/FluentAssertions/Numeric/Int32Assertions.cs index 3bc3225707..e0f6d492cc 100644 --- a/Src/FluentAssertions/Numeric/Int32Assertions.cs +++ b/Src/FluentAssertions/Numeric/Int32Assertions.cs @@ -5,7 +5,7 @@ namespace FluentAssertions.Numeric; /// -/// Contains a number of methods to assert that a is in the expected state. +/// Contains a number of methods to assert that an is in the expected state. /// [DebuggerNonUserCode] internal class Int32Assertions : NumericAssertions diff --git a/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs b/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs index bf2ec1c8f5..2c195dcbe9 100644 --- a/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs +++ b/Src/FluentAssertions/Streams/BufferedStreamAssertions.cs @@ -8,7 +8,7 @@ namespace FluentAssertions.Streams; /// -/// Contains a number of methods to assert that an is in the expected state. +/// Contains a number of methods to assert that a is in the expected state. /// /// [DebuggerNonUserCode] diff --git a/Src/FluentAssertions/Streams/StreamAssertions.cs b/Src/FluentAssertions/Streams/StreamAssertions.cs index 83459ebe24..4b2813b23b 100644 --- a/Src/FluentAssertions/Streams/StreamAssertions.cs +++ b/Src/FluentAssertions/Streams/StreamAssertions.cs @@ -8,7 +8,7 @@ namespace FluentAssertions.Streams; /// -/// Contains a number of methods to assert that an is in the expected state. +/// Contains a number of methods to assert that a is in the expected state. /// [DebuggerNonUserCode] public class StreamAssertions : StreamAssertions diff --git a/Src/FluentAssertions/Types/MethodInfoSelector.cs b/Src/FluentAssertions/Types/MethodInfoSelector.cs index dd6fa959a6..f2dc5d2f87 100644 --- a/Src/FluentAssertions/Types/MethodInfoSelector.cs +++ b/Src/FluentAssertions/Types/MethodInfoSelector.cs @@ -237,7 +237,7 @@ private static bool HasSpecialName(MethodInfo method) /// Returns an enumerator that iterates through the collection. /// /// - /// A that can be used to iterate through the collection. + /// An that can be used to iterate through the collection. /// /// 1 public IEnumerator GetEnumerator() diff --git a/Src/FluentAssertions/Types/PropertyInfoSelector.cs b/Src/FluentAssertions/Types/PropertyInfoSelector.cs index f08761718b..c55e7a6f5b 100644 --- a/Src/FluentAssertions/Types/PropertyInfoSelector.cs +++ b/Src/FluentAssertions/Types/PropertyInfoSelector.cs @@ -209,7 +209,7 @@ public PropertyInfo[] ToArray() /// Returns an enumerator that iterates through the collection. /// /// - /// A that can be used to iterate through the collection. + /// An that can be used to iterate through the collection. /// /// 1 public IEnumerator GetEnumerator() diff --git a/Src/FluentAssertions/Types/TypeSelector.cs b/Src/FluentAssertions/Types/TypeSelector.cs index 03d7c1e8eb..e0f5d423bb 100644 --- a/Src/FluentAssertions/Types/TypeSelector.cs +++ b/Src/FluentAssertions/Types/TypeSelector.cs @@ -349,7 +349,7 @@ public TypeSelector UnwrapEnumerableTypes() /// Returns an enumerator that iterates through the collection. /// /// - /// A that can be used to iterate through the collection. + /// An that can be used to iterate through the collection. /// /// 1 public IEnumerator GetEnumerator() diff --git a/Tests/.editorconfig b/Tests/.editorconfig index 15629ab354..ab90857a06 100644 --- a/Tests/.editorconfig +++ b/Tests/.editorconfig @@ -216,7 +216,7 @@ dotnet_diagnostic.RCS1213.severity = none # Implement IComparable when implementing IComparable. Disabled since we don't want to be so strict in tests. dotnet_diagnostic.RCS1241.severity = none -# Purpose: Use an overload that has a IEqualityComparer or IComparer parameter +# Purpose: Use an overload that has an IEqualityComparer or IComparer parameter # Reason: Not important in tests dotnet_diagnostic.MA0002.severity = none @@ -278,4 +278,4 @@ dotnet_diagnostic.S3237.severity = none dotnet_diagnostic.S3928.severity = none # Remove this unread private field 'field' or refactor the code to use its value -dotnet_diagnostic.S4487.severity = none \ No newline at end of file +dotnet_diagnostic.S4487.severity = none From 77b7d5bf17ecfcadcbc840ee735c2a92eeeabfdf Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Mar 2026 12:39:56 +0100 Subject: [PATCH 796/845] Add `BeEqualTo` and `NotBeEqualTo` as collection assertion aliases (#3166) --- .../GenericCollectionAssertions.cs | 81 +++++++ .../Collections/StringCollectionAssertions.cs | 3 + .../FluentAssertions/net47.verified.txt | 4 + .../FluentAssertions/net6.0.verified.txt | 4 + .../netstandard2.0.verified.txt | 4 + .../netstandard2.1.verified.txt | 4 + .../CollectionAssertionSpecs.BeEqualTo.cs | 204 ++++++++++++++++++ ...lectionAssertionOfStringSpecs.BeEqualTo.cs | 46 ++++ docs/_pages/releases.md | 1 + 9 files changed, 351 insertions(+) create mode 100644 Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEqualTo.cs create mode 100644 Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEqualTo.cs diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs index e3a4c4985c..f9599df2ee 100644 --- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; @@ -1349,6 +1350,7 @@ public AndConstraint EndWith(T element, [StringSyntax("CompositeFor /// . Elements are compared using their method. /// /// A params array with the expected elements. + [EditorBrowsable(EditorBrowsableState.Never)] public AndConstraint Equal(params T[] elements) { AssertSubjectEquality(elements, ObjectExtensions.GetComparer(), string.Empty); @@ -1356,6 +1358,18 @@ public AndConstraint Equal(params T[] elements) return new AndConstraint((TAssertions)this); } + /// + /// Asserts that the current collection contains all the same elements in the same order as the collection identified by + /// . Elements are compared using their method. + /// + /// A params array with the expected elements. + public AndConstraint BeEqualTo(params T[] elements) + { + AssertSubjectEquality(elements, ObjectExtensions.GetComparer(), string.Empty); + + return new AndConstraint((TAssertions)this); + } + /// /// Asserts that two collections contain the same items in the same order, where equality is determined using a /// . @@ -1373,6 +1387,7 @@ public AndConstraint Equal(params T[] elements) /// /// Zero or more objects to format using the placeholders in . /// + [EditorBrowsable(EditorBrowsableState.Never)] public AndConstraint Equal( IEnumerable expectation, Func equalityComparison, [StringSyntax("CompositeFormat")] string because = "", @@ -1395,6 +1410,7 @@ public AndConstraint Equal( /// /// Zero or more objects to format using the placeholders in . /// + [EditorBrowsable(EditorBrowsableState.Never)] public AndConstraint Equal(IEnumerable expected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { @@ -1403,6 +1419,50 @@ public AndConstraint Equal(IEnumerable expected, [StringSyntax(" return new AndConstraint((TAssertions)this); } + /// + /// Asserts that the current collection contains all the same elements in the same order as the collection identified by + /// . Elements are compared using their method. + /// + /// An with the expected elements. + /// + /// 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 BeEqualTo(IEnumerable expected, + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) + { + return Equal(expected, because, becauseArgs); + } + + /// + /// Asserts that two collections contain the same items in the same order, where equality is determined using a + /// . + /// + /// + /// The collection to compare the subject with. + /// + /// + /// An equality comparison that is used to determine whether two objects should be treated as equal. + /// + /// + /// 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 BeEqualTo( + IEnumerable expectation, Func equalityComparison, + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) + { + return Equal(expectation, equalityComparison, because, becauseArgs); + } + /// /// Asserts that the number of items in the collection matches the supplied amount. /// @@ -2737,6 +2797,7 @@ public AndConstraint NotContainNulls( /// Zero or more objects to format using the placeholders in . /// /// is . + [EditorBrowsable(EditorBrowsableState.Never)] public AndConstraint NotEqual(IEnumerable unexpected, [StringSyntax("CompositeFormat")] string because = "", params object[] becauseArgs) { @@ -2760,6 +2821,26 @@ public AndConstraint NotEqual(IEnumerable unexpected, [StringSyn return new AndConstraint((TAssertions)this); } + /// + /// Asserts that the current collection does not contain all the same elements in the same order as the collection + /// identified by . Elements are compared using their . + /// + /// An with the elements that are not expected. + /// + /// 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 . + /// + /// is . + public AndConstraint NotBeEqualTo(IEnumerable unexpected, + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) + { + return NotEqual(unexpected, because, becauseArgs); + } + /// /// Asserts that the number of items in the collection does not match the supplied amount. /// diff --git a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs index f160fa54b1..94daadec75 100644 --- a/Src/FluentAssertions/Collections/StringCollectionAssertions.cs +++ b/Src/FluentAssertions/Collections/StringCollectionAssertions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq; using FluentAssertions.Common; @@ -54,6 +55,7 @@ public StringCollectionAssertions(TCollection actualValue, AssertionChain assert /// /// An with the expected elements. [SuppressMessage("Class Design", "AV1010:Member hides inherited member")] + [EditorBrowsable(EditorBrowsableState.Never)] public new AndConstraint Equal(params string[] expected) { return base.Equal(expected.AsEnumerable()); @@ -65,6 +67,7 @@ public StringCollectionAssertions(TCollection actualValue, AssertionChain assert /// the element order, use instead. /// /// An with the expected elements. + [EditorBrowsable(EditorBrowsableState.Never)] public AndConstraint Equal(IEnumerable expected) { return base.Equal(expected); diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index c741a64f7e..3d478f2caa 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -403,6 +403,9 @@ namespace FluentAssertions.Collections protected void AssertCollectionStartsWith(System.Collections.Generic.IEnumerable actualItems, System.Collections.Generic.ICollection expected, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } protected void AssertSubjectEquality(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEqualTo(params T[] elements) { } + public FluentAssertions.AndConstraint BeEqualTo(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEqualTo(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeInAscendingOrder(string because = "", params object[] becauseArgs) { } @@ -448,6 +451,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint HaveSameCount(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint IntersectWith(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEqualTo(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInAscendingOrder(string because = "", params object[] becauseArgs) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index f3fd04ac88..42d0d6e122 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -449,6 +449,9 @@ namespace FluentAssertions.Collections protected void AssertCollectionStartsWith(System.Collections.Generic.IEnumerable actualItems, System.Collections.Generic.ICollection expected, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } protected void AssertSubjectEquality(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEqualTo(params T[] elements) { } + public FluentAssertions.AndConstraint BeEqualTo(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEqualTo(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeInAscendingOrder(string because = "", params object[] becauseArgs) { } @@ -494,6 +497,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint HaveSameCount(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint IntersectWith(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEqualTo(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInAscendingOrder(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 a7092c158c..b065facf1a 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -395,6 +395,9 @@ namespace FluentAssertions.Collections protected void AssertCollectionStartsWith(System.Collections.Generic.IEnumerable actualItems, System.Collections.Generic.ICollection expected, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } protected void AssertSubjectEquality(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEqualTo(params T[] elements) { } + public FluentAssertions.AndConstraint BeEqualTo(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEqualTo(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeInAscendingOrder(string because = "", params object[] becauseArgs) { } @@ -440,6 +443,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint HaveSameCount(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint IntersectWith(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEqualTo(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInAscendingOrder(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 f37a6670d6..08e044e3e1 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -413,6 +413,9 @@ namespace FluentAssertions.Collections protected void AssertCollectionStartsWith(System.Collections.Generic.IEnumerable actualItems, System.Collections.Generic.ICollection expected, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } protected void AssertSubjectEquality(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEmpty(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEqualTo(params T[] elements) { } + public FluentAssertions.AndConstraint BeEqualTo(System.Collections.Generic.IEnumerable expected, string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint BeEqualTo(System.Collections.Generic.IEnumerable expectation, System.Func equalityComparison, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint BeEquivalentTo(System.Collections.Generic.IEnumerable expectation, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint> BeInAscendingOrder(string because = "", params object[] becauseArgs) { } @@ -458,6 +461,7 @@ namespace FluentAssertions.Collections public FluentAssertions.AndConstraint HaveSameCount(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint IntersectWith(System.Collections.Generic.IEnumerable otherCollection, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEmpty(string because = "", params object[] becauseArgs) { } + public FluentAssertions.AndConstraint NotBeEqualTo(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeEquivalentTo(System.Collections.Generic.IEnumerable unexpected, System.Func, FluentAssertions.Equivalency.EquivalencyOptions> config, string because = "", params object[] becauseArgs) { } public FluentAssertions.AndConstraint NotBeInAscendingOrder(string because = "", params object[] becauseArgs) { } diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEqualTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEqualTo.cs new file mode 100644 index 0000000000..c2b930f2e6 --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEqualTo.cs @@ -0,0 +1,204 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +/// +/// The [Not]BeEqualTo specs. +/// +public partial class CollectionAssertionSpecs +{ + public class BeEqualTo + { + [Fact] + public void Two_collections_with_the_same_elements_in_the_same_order_are_okay() + { + // Arrange + int[] collection1 = [1, 2, 3]; + int[] collection2 = [1, 2, 3]; + + // Act / Assert + collection1.Should().BeEqualTo(collection2); + } + + [Fact] + public void Two_null_collections_are_okay() + { + // Arrange + int[] nullColl = null; + + // Act + Action act = () => nullColl.Should().BeEqualTo(null); + + // Assert + act.Should().NotThrow(); + } + + [Fact] + public void Fails_with_a_descriptive_message_for_a_differing_item() + { + // Arrange + int[] collection1 = [1, 2, 3]; + int[] collection2 = [1, 2, 5]; + + // Act + Action act = () => collection1.Should().BeEqualTo(collection2, "because we want to test the failure {0}", "message"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection1 to be equal to {1, 2, 5} because we want to test the failure message, but {1, 2, 3} differs at index 2."); + } + + [Fact] + public void Fails_for_a_null_subject_collection() + { + // Arrange + int[] collection = null; + int[] collection1 = [1, 2, 3]; + + // Act + Action act = () => + collection.Should().BeEqualTo(collection1, "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to be equal to {1, 2, 3} because we want to test the behaviour with a null subject, but found ."); + } + + [Fact] + public void Throws_for_a_null_expected_collection() + { + // Arrange + int[] collection = [1, 2, 3]; + int[] collection1 = null; + + // Act + Action act = () => + collection.Should().BeEqualTo(collection1, "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw() + .WithMessage("Cannot compare collection with .*") + .WithParameterName("expectation"); + } + + [Fact] + public void Succeeds_using_custom_equality_comparison() + { + // Arrange + var actual = new List { "ONE", "TWO", "THREE", "FOUR" }; + + var expected = new[] + { + new { Value = "One" }, + new { Value = "Two" }, + new { Value = "Three" }, + new { Value = "Four" } + }; + + // Act + Action action = () => actual.Should().BeEqualTo(expected, + (a, e) => string.Equals(a, e.Value, StringComparison.OrdinalIgnoreCase)); + + // Assert + action.Should().NotThrow(); + } + + [Fact] + public void Fails_using_custom_equality_comparison_for_a_differing_item() + { + // Arrange + var actual = new List { "ONE", "TWO", "THREE", "FOUR" }; + + var expected = new[] + { + new { Value = "One" }, + new { Value = "Two" }, + new { Value = "Three" }, + new { Value = "Five" } + }; + + // Act + Action action = () => actual.Should().BeEqualTo(expected, + (a, e) => string.Equals(a, e.Value, StringComparison.OrdinalIgnoreCase)); + + // Assert + action + .Should().Throw() + .WithMessage("*Expected*equal to*, but*differs at index 3.*"); + } + + [Fact] + public void Succeeds_for_params_with_same_elements_in_same_order() + { + // Arrange + int[] collection = [1, 2, 3]; + + // Act / Assert + collection.Should().BeEqualTo(1, 2, 3); + } + + [Fact] + public void Fails_for_params_with_a_differing_element() + { + // Arrange + int[] collection = [1, 2, 3]; + + // Act + Action act = () => collection.Should().BeEqualTo(1, 2, 5); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to be equal to {1, 2, 5}, but {1, 2, 3} differs at index 2."); + } + } + + public class NotBeEqualTo + { + [Fact] + public void Succeeds_for_collections_with_different_elements() + { + // Arrange + int[] collection1 = [1, 2, 3]; + int[] collection2 = [3, 1, 2]; + + // Act / Assert + collection1.Should().NotBeEqualTo(collection2); + } + + [Fact] + public void Fails_for_collections_with_the_same_elements_in_the_same_order() + { + // Arrange + int[] collection1 = [1, 2, 3]; + int[] collection2 = [1, 2, 3]; + + // Act + Action act = () => collection1.Should().NotBeEqualTo(collection2); + + // Assert + act.Should().Throw().WithMessage( + "Did not expect collections {1, 2, 3} and {1, 2, 3} to be equal."); + } + + [Fact] + public void Throws_for_a_null_unexpected_collection() + { + // Arrange + int[] collection1 = null; + int[] collection2 = null; + + // Act + Action act = () => + collection1.Should().NotBeEqualTo(collection2, + "because we want to test the behaviour with a null subject"); + + // Assert + act.Should().Throw() + .WithMessage("Cannot compare collection with .*") + .WithParameterName("unexpected"); + } + } +} diff --git a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEqualTo.cs b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEqualTo.cs new file mode 100644 index 0000000000..898a9db58c --- /dev/null +++ b/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionOfStringSpecs.BeEqualTo.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Collections; + +public partial class GenericCollectionAssertionOfStringSpecs +{ + public class BeEqualTo + { + [Fact] + public void Succeeds_for_collections_with_same_elements_in_same_order() + { + // Arrange + IEnumerable collection1 = ["one", "two", "three"]; + IEnumerable collection2 = ["one", "two", "three"]; + + // Act / Assert + collection1.Should().BeEqualTo(collection2); + } + + [Fact] + public void Succeeds_for_params_with_same_elements_in_same_order() + { + // Arrange + IEnumerable collection = ["one", "two", "three"]; + + // Act / Assert + collection.Should().BeEqualTo("one", "two", "three"); + } + + [Fact] + public void Fails_for_params_with_a_differing_element() + { + // Arrange + IEnumerable collection = ["one", "two", "three"]; + + // Act + System.Action act = () => collection.Should().BeEqualTo("one", "two", "five"); + + // Assert + act.Should().Throw().WithMessage( + "Expected collection to be equal to {\"one\", \"two\", \"five\"}, but {\"one\", \"two\", \"three\"} differs at index 2."); + } + } +} diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 7f9b256d5f..f041c2a8c7 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -14,6 +14,7 @@ sidebar: * Added extensive support for `Span` / `ReadOnlySpan` and `Be(string)` for `Span` / `ReadOnlySpan` - [#3172](https://github.com/fluentassertions/fluentassertions/pull/3172) * Added `Excluding()` and `Excluding(Type)` overloads to exclude all members of a certain type from equivalency comparisons - [#3115](https://github.com/fluentassertions/fluentassertions/pull/3115) * `BeEquivalentTo` will now report the missing or extraneous items for differently sized collections - [#3133](https://github.com/fluentassertions/fluentassertions/pull/3133) +* Added `BeEqualTo` and `NotBeEqualTo` to the collection assertions as a more fluent alternative to `Equal` - [#3166](https://github.com/fluentassertions/fluentassertions/pull/3166) * Added `HaveMillisecond` and `NotHaveMillisecond` assertion methods for `DateTime` and `DateTimeOffset` - [#3164](https://github.com/fluentassertions/fluentassertions/pull/3164) ### Enhancements From d602a8d4477d2f8b2c918e4bc2238eabb024a820 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 8 Mar 2026 11:24:40 +0100 Subject: [PATCH 797/845] Remove UWP.Specs --- FluentAssertions.slnx | 5 - README.md | 2 +- Tests/UWP.Specs/App.xaml | 4 - Tests/UWP.Specs/App.xaml.cs | 23 ---- .../Assets/LockScreenLogo.scale-200.png | Bin 1430 -> 0 bytes .../Assets/SplashScreen.scale-200.png | Bin 7700 -> 0 bytes .../Assets/Square150x150Logo.scale-200.png | Bin 2937 -> 0 bytes .../Assets/Square44x44Logo.scale-200.png | Bin 1647 -> 0 bytes ...x44Logo.targetsize-24_altform-unplated.png | Bin 1255 -> 0 bytes Tests/UWP.Specs/Assets/StoreLogo.png | Bin 1451 -> 0 bytes .../Assets/Wide310x150Logo.scale-200.png | Bin 3204 -> 0 bytes Tests/UWP.Specs/Directory.Build.props | 7 -- Tests/UWP.Specs/Package.appxmanifest | 25 ----- Tests/UWP.Specs/Properties/AssemblyInfo.cs | 16 --- Tests/UWP.Specs/Properties/Default.rd.xml | 5 - Tests/UWP.Specs/UWP.Specs.csproj | 101 ------------------ Tests/UWP.Specs/UwpSpecs.cs | 22 ---- qodana.yaml | 1 - 18 files changed, 1 insertion(+), 210 deletions(-) delete mode 100644 Tests/UWP.Specs/App.xaml delete mode 100644 Tests/UWP.Specs/App.xaml.cs delete mode 100644 Tests/UWP.Specs/Assets/LockScreenLogo.scale-200.png delete mode 100644 Tests/UWP.Specs/Assets/SplashScreen.scale-200.png delete mode 100644 Tests/UWP.Specs/Assets/Square150x150Logo.scale-200.png delete mode 100644 Tests/UWP.Specs/Assets/Square44x44Logo.scale-200.png delete mode 100644 Tests/UWP.Specs/Assets/Square44x44Logo.targetsize-24_altform-unplated.png delete mode 100644 Tests/UWP.Specs/Assets/StoreLogo.png delete mode 100644 Tests/UWP.Specs/Assets/Wide310x150Logo.scale-200.png delete mode 100644 Tests/UWP.Specs/Directory.Build.props delete mode 100644 Tests/UWP.Specs/Package.appxmanifest delete mode 100644 Tests/UWP.Specs/Properties/AssemblyInfo.cs delete mode 100644 Tests/UWP.Specs/Properties/Default.rd.xml delete mode 100644 Tests/UWP.Specs/UWP.Specs.csproj delete mode 100644 Tests/UWP.Specs/UwpSpecs.cs diff --git a/FluentAssertions.slnx b/FluentAssertions.slnx index ef1ac24134..15ff2cba12 100644 --- a/FluentAssertions.slnx +++ b/FluentAssertions.slnx @@ -47,11 +47,6 @@ - - - - - diff --git a/README.md b/README.md index 01687af1b6..c4200f674f 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ Expected numbers to contain 4 item(s) because we thought we put four items in th Visit https://www.fluentassertions.com for [background information](https://fluentassertions.com/about/), [usage documentation](https://fluentassertions.com/introduction), an [extensibility guide](https://fluentassertions.com/extensibility/), support information and more [tips & tricks](https://fluentassertions.com/tips/). # Building -Install Visual Studio 2026 18.0+ or JetBrains Rider 2025.3 as well as the Build Tools 2026 (including the Universal Windows Platform build tools). You will also need to have .NET Framework 4.7 SDK and .NET 10.0 SDK installed. Check the [global.json](global.json) for the current minimum required version. +Install Visual Studio 2026 18.0+ or JetBrains Rider 2025.3. You will also need to have .NET Framework 4.7 SDK and .NET 10.0 SDK installed. Check the [global.json](global.json) for the current minimum required version. You can also build, run the unit tests and package the code using the following command-line: diff --git a/Tests/UWP.Specs/App.xaml b/Tests/UWP.Specs/App.xaml deleted file mode 100644 index 0d5a0c69ec..0000000000 --- a/Tests/UWP.Specs/App.xaml +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/Tests/UWP.Specs/App.xaml.cs b/Tests/UWP.Specs/App.xaml.cs deleted file mode 100644 index 768f758892..0000000000 --- a/Tests/UWP.Specs/App.xaml.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.VisualStudio.TestPlatform.TestExecutor; -using Windows.ApplicationModel; -using Windows.ApplicationModel.Activation; -using Windows.UI.Xaml; - -namespace UWP.Specs; - -internal sealed partial class App : Application -{ - public App() - { - InitializeComponent(); - Suspending += OnSuspending; - } - - protected override void OnLaunched(LaunchActivatedEventArgs args) - { - UnitTestClient.Run(args.Arguments); - } - - private void OnSuspending(object sender, SuspendingEventArgs e) => - e.SuspendingOperation.GetDeferral().Complete(); -} diff --git a/Tests/UWP.Specs/Assets/LockScreenLogo.scale-200.png b/Tests/UWP.Specs/Assets/LockScreenLogo.scale-200.png deleted file mode 100644 index 735f57adb5dfc01886d137b4e493d7e97cf13af3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1430 zcmaJ>TTC2P7~aKltDttVHYH6u8Io4i*}3fO&d$gd*bA_<3j~&e7%8(eXJLfhS!M@! zKrliY>>6yT4+Kr95$!DoD(Qn-5TP|{V_KS`k~E6(LGS@#`v$hQo&^^BKsw3HIsZBT z_y6C2n`lK@apunKojRQ^(_P}Mgewt$(^BBKCTZ;*xa?J3wQ7~@S0lUvbcLeq1Bg4o zH-bvQi|wt~L7q$~a-gDFP!{&TQfc3fX*6=uHv* zT&1&U(-)L%Xp^djI2?~eBF2cxC@YOP$+9d?P&h?lPy-9M2UT9fg5jKm1t$m#iWE{M zIf%q9@;fyT?0UP>tcw-bLkz;s2LlKl2qeP0w zECS7Ate+Awk|KQ+DOk;fl}Xsy4o^CY=pwq%QAAKKl628_yNPsK>?A>%D8fQG6IgdJ ztnxttBz#NI_a@fk7SU`WtrpsfZsNs9^0(2a z@C3#YO3>k~w7?2hipBf{#b6`}Xw1hlG$yi?;1dDs7k~xDAw@jiI*+tc;t2Lflg&bM)0!Y;0_@=w%`LW^8DsYpS#-bLOklX9r?Ei}TScw|4DbpW%+7 zFgAI)f51s}{y-eWb|vrU-Ya!GuYKP)J7z#*V_k^Xo>4!1Yqj*m)x&0L^tg3GJbVAJ zJ-Pl$R=NAabouV=^z_t;^K*0AvFs!vYU>_<|I^#c?>>CR<(T?=%{;U=aI*SbZADLH z&(f2wz_Y0??Tf|g;?|1Znw6}6U43Q#qNRwv1vp9uFn1)V#*4p&%$mP9x&15^OaBiDS(XppT|z^>;B{PLVEbS3IFYV yGvCsSX*m diff --git a/Tests/UWP.Specs/Assets/SplashScreen.scale-200.png b/Tests/UWP.Specs/Assets/SplashScreen.scale-200.png deleted file mode 100644 index 023e7f1feda78d5100569825acedfd213a0d84e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7700 zcmeHLYj~4Yw%(;oxoEH#Kxq-eR|+VkP17b#Vk;?4QwkI+A{L04G+#<<(x#Un1#+h5>eArRq zTw$)ZvTWW_Y?bDho0nPVTh08+s`sp!j74rJTTtXIDww0SILedFv?sZ?yb@@}GN;#8 znk_b~Q(A0YR#uV4ef!osoV1M3;vQ8N$O|fStfgf$S5;ddUNv`tWtGjM;koG#N;7M< zP*84lnx(bn_KF&9Z5Ai$)#Cs3a|$OFw>WKCT$of*L7_CqQEinflT|W{JT+aKp-E0v zsxmYg)1(T>DROm+LN1eQw8}KCTp=C!$H7`PU!t9_Hw@TsTI2`udRZv*!a5`#A9hK6Y95L(CDUX&_@QxKV z_feX{UhA#ZWlvgpL$#w^D#lq`_A4AzDqd|Zv6y9PX&DNcN|l}_D^{q@GG&H^Pg583 z8FI6N8^H7b5WjGp;urW)d7F+_lcp%KsLX0viCmE(OHH+=%ZfD_=`voUuoUxFO^L;- z;!;2{g-YiiO6m4bs89OuF9!p{FGtH-f%8<2gY!h9s)4ciN%{Kh1+`}{^}M~+TDH9N z^Z5PlgVXMC&2&k*Hw^Lb9gny#ro$MOIxIt{+r)EA10$VR3 zanN8D{TUkl+v0CQ_>ZoHP<M-x#8@8ZiT#$Kh`(uRaX1g$Bg|qy$<#7 zSSAi{Nb8Y=lvNVeio+UGLCAtoLBfL`iOv`)yoJMDJBN>4IH@(l7YRF;61@>qq1iM9 zr@b#OC~SAxSle?5Pp8Z78{VO0YFr1x7kZU64Z23eLf2T2#6J_t;-E}DkB?NufZ0Ug zi?J&byXeaB-uTNVhuiM!UVQw}bZrJ3GtAETYp->!{q#zfN7D3AS9@Q7*V^85jGx#R z(QxYV(wW#F0XF9^^s>>H8pPlVJ>)3Oz z&_X8Sf@~?cH_O*cgi$U#`v`RRfv#y3m(ZpKk^5uLup+lVs$~}FZU$r_+}#hl%?g5m z-u-}-666ssp-xWQak~>PPy$mRc|~?pVSs1_@mBEXpPVfLF6(Ktf1S* zPPh@QZ=tFMs?LM2(5P3L2;l_6XX6s&cYsP1ip#eg0`ZEP0HGYh{UmS@o`MihLLvkU zgyAG0G`b1|qjxxh1(ODKFE%AP}Dq=3vK$P7TXP4GrM1kQ72!GUVMDl`rDC&2;TA}*nF z8$nQD&6ys_nc1*E7$*1S@R8$ymy(sQV}imGSedB@{!QR5P&N_H=-^o!?LsWs+2|mH z-e=)T^SvI)=_JIm7}j4;@*Z17=(#}m=~YF~z~CLI+vdAGlJDcdF$TM?CVI1%LhUrN zaa6DJ=Yh$)$k&Oz{-~8yw^GM^8prYxSxo zvI4k#ibryMa%%*8oI-5m61Koa_A_xg=(fwp0aBX{;X4Q;NXUhtaoJDo1>TqhWtn=_ zd5~chq#&6~c%8JZK#t_&J(9EVUU&upYeIovLt1>vaHe}UUq>#RGQj!EN#5+0@T`(@ z^g~>*c`VGRiSt;!$_4+0hk^I!@O3``5=sZ8IwlxWW7km1B&_t&E*u0_9UBa#VqwY* zz>nxv?FAsVnRaD(Bui=6i==BFUw0k4n$>`umU`F2l?7CYTD^)c2X+d9X&ddS9|gj? zM?knGkGCX&W8offw8aLC2$D{PjC3nVZwd4k?eZH8*mZ)U@3Qk8RDFOz_#WUA#vnzy zyP>KrCfKwSXea7}jgJjBc}PGY+4#6%lbZyjhy`5sZd_Vy6Wz;ixa?czkN}J9It1K6 zY!eu>|AwF^fwZlLAYyQI*lM@^>O>Iu6Vf6i>Q$?v!SeUS<{>UYMwz$*%Aq?w^`j{h z!$GZbhu=^D{&ET8;))LL%ZBDZkQqRd2;u~!d9bHGmLRhLDctNgYyjsuvoSZ#iVdoB z2!f--UUA#U;<{je#?cYt^{PIyKa%hW>}uepWMyAI{{Zo7?2>?$c9;whJae%oN|I-kpTQSx_C$Z&;f zi2i)qmEn=y4U0uvk)$m;zKfjPK@oc?I`}1Jzl$Q~aoKBd3kt7L#7gyt|A_qgz6ai< z=X%D1i!d2h?rHR^R8SUj&G||dkC?DT>{o#Yau<@uqVT{Xef&XG}5*E4aPk{}~ zplx&XhaV)&1EfI3Em;Bw#O5SV^c;{twb-1Rw)+=0!e_BLbd7tYmXCH0wrlOSS+~`7He8Iqx0{CN+DVit9;*6L~JAN zD&cyT)2?h}xnYmL?^)<7YyzZ3$FHU^Eg;DLqAV{#wv#Wj7S`Jdl1pX&{3(uZ?!uh} zDc$ZTNV*7le_W6}Hju~GMTxZQ1aWCeUc%!jv3MHAzt>Y-nQK%zfT*3ebDQA5b?iGn; zBjv3B+GhLTexd_(CzZDP4|#n5^~scvB6#Pk%Ho!kQ>yYw((Dv{6=$g3jT1!u6gORW zx5#`7Wy-ZHRa~IxGHdrp(bm%lf>2%J660nj$fCqN(epv@y!l9s7@k6EvxS{AMP>WY zX4$@F8^kayphIx-RGO$+LYl9YdoI5d|4#q9##`_F5Xnx`&GPzp2fB{-{P@ATw=X@~ z_|&^UMWAKD;jjBKTK(~o?cUFRK8EX=6>cXpfzg4ZpMB>*w_^8GSiT-Jp|xBOnzM+j z*09-@-~qJ(eqWq5@R4i^u4^{McCP(!3}C|v_WsTR*bIUxN(Nx`u##3B4{sE`Z`v8w zAwIG`?1~PkID~W{uDzmqH98Pew_1(;x2%8r^vY{)_&J2K)cN{W+h5+g)ZcjP&Ci#O zgy|8K@4kyMfwilHd&6TDlhb%++Pk!>9HRld6HT7gwyZGrxS$}CsD6`>6!!2K1@Mjf z(P0WYB7V_OFZyeWrbOFb>O54BNXf~K&?}3=^v;v_wT{DKr?jN^DtN&DXwX%u?s*c6`%8>WFz z7}YW^tp0bp^NriE)AB6M2l<7rn7fzePtR*omOevpfm9n?}2V*+0iW;S)C zhg`NAjL?D=W#k*$aR{>pGf~lD-rVtD;5jW1_*Jn1j1=es@Kcx4ySM_bwcQCT=d+DV z>Sz~L=Hj@(X%31nK$mWI@7d>}ORB`K(p=+`UD)+99YUGQc7y^bHZ1F(8|tL0 zdK*DT0kSXG_{BKTpP2*2PecdKV9;dq$^ZZDP;Nyq1kp-&GI5eAyZsK!e3V zK@rPy*{(`KIfo+lc878mDKk^V#`VT05}64kBtk%DgwLrOvLMj5-;*GNKv6c6pzMuL z6EP%ob|_0IW}lLRXCP2!9wWhEw3LA7iF#1O1mIZ@Z=6&bz41F;@S_GvYAG-#CW3z{ zP3+6vHhvP&A3$##Vo9$dT^#MoGg^|MDm=Bt1d2RRwSZ<;ZHICpLBv5Xs!D?BH^(9_ z7`H=N&^v|Z-%mP}wNzG{aiFCsRgwzwq!N6obW9+7(R; z(SZ=23`|`>qil!LMGG{_Heq!BD>(Y-zV9wD)}hz25JA37YR%39;kI4y9pgtcUass6 zP24}ZY$vvYeI`zy&)A_X#nY3017ap*0&jx|mVwyGhg3;!keU53a}Uhm3BZI$N$6Se zLWlAmy1S0xKJm4G_U@sN_Tm=`$xWJSEwKU98rZ&)1R^*$$1vA3oG#&*%SMxY_~oGP zP&PFJatFLM-Ps%84IV-+Ow)T{C7cqUAvauy4C z(FRz&?6$Rypj{xO!`y=*J5o4@U8Q-(y5(*=YoKeZ+-1YdljXxkA#B)zo=FeQH#?Le zycNUmEEHWO9a=X^pb#&cOq7-`7UA87#|S22)<7RUtZo|(zibX=w;K3qur9vy#`MNV z6UUcf9ZwEnKCCp+OoBnF@OdbvH)ANXO0o~Pi9l8=x3))}L<#vO0-~O4!~--Ket?d} zJaqsj<@CD1%S2cTW%rOP{Vto%0sGW~1RMa_j^)5nil0Yw- z0EE#bP+l4#P^%PQ+N*oxu1Zq05xZ!bXfYTg>9c{(Iw*lnjR^>kz%lAN^zFce7rppy zY8zA~3GD=A6d*hze&l4D_wA~+O!56)BZTe_rEu}Ezi<4!kG|W#amBZ5{&XS2@6R~H z{9o^y*BkH4$~yX9U&@CgbOzX1bn9xqF|zh$Dh0Y5y*E0e90*$!ObrHY3Ok0`2=O~r zCuke6KrP9KOf?V(YDsM<6pX2nVoN%M$LT^q#FmtaF?1^27F*IcNX~XRB(|hCFvdcc zc)$=S-)acdk$g4?_>jRqxpI6M3vHZk?0c^3=byamYDNf;uB{3NlKW5IhnOS3DNkMV z?tK8?kJ}pmvp%&&eTVOVjHP`q34hN1@!aK}H(K!vI`~gf|Gv+FNEQD5Yd<~yX7k_l h&G-K)@HZb3BABY{)U1?^%I#E6`MGoTtustd{~yM6srvu` diff --git a/Tests/UWP.Specs/Assets/Square150x150Logo.scale-200.png b/Tests/UWP.Specs/Assets/Square150x150Logo.scale-200.png deleted file mode 100644 index af49fec1a5484db1d52a7f9b5ec90a27c7030186..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2937 zcma)84OCO-8BSud5)jwMLRVKgX(S?$n?Ld|vrsm<$CF7)&zTbyy1FE5bU`Q17MRv`9ue$;R(@8kR;#vJ*IM0>cJIAOte!d7oRgdH zd%ySjdB6L9=gX^A6)VzH7p2l@v~3zJAMw|DFy#^)F@@F*`mqUn=Il>l)8_+ab;nOW{%+iPx z+s{Eu|&pIs)Z7{La9~?xKfyl z#43?gjEL15d4WbOZo#SiP%>DB^+BcnJ=7dHEe;r#G=tuw|ka z%q@}##Uh7;tc%L_64m(kHtw74ty%BJMb)_1)#S0j`)F8_1jF7vScpsnH=0V19bO8y zR`0SjIdCUo&=>JwMQF8KHA<{ODHTiQh}0^@5QRmCA?gOH6_H3K^-_sNB^RrdNuK-R zOO*vOrKCVvDwgUck`kF(E7j{I#iiN;b*ZdCt4m@HPA`EuEqGGf4%!K<;(=I=&Vyrw z%TwcWtxa}8mCZ%Cyf&ActJ6_$ox5z6-D!0-dvnRx6t7y3d+h6QYpKWO;8OdnvERo7 zuEf>ih5`wqY)~o@OeVt-wM?Q!>QzdGRj!bz6fzYrfw$hZfAKzr2-M+D+R>}~oT574c;_3zquHcElqKIsryILt3g8n3jcMb+j?i?-L3FpZJ z2WRVBRdDPc+G5aaYg#5hpE+6nQ|(VSoxT3|biF;BUq#==-27Xi=gihDPYP$7?=9cP zYKE$jeQ|3~_L0VG-(F~2ZPyD0=k{J4Q~h(t__{-mz_w8{JDY9{`1ouzz!Vr5!ECdE z6U~O1k8c}24V7~zzXWTV-Pe4)y}wQJS&q%H5`Fo_f_JvIU489aCX$;P`u#!I-=^4ijC2{&9!O&h>mi?9oYD=GC#%)6{GzN6nQYw+Fal50!#x^asjBBR50i`+mho*ttoqV)ubM2KD9S~k7+FR4>{29?6 z{!l6kDdyTN0YJ9LgkPWeXm|gyi@zM3?0@{&pXT12w|78&W-q!RRF)&iLCEZVH<|fR zN0fr2^t8H(>L?>K#>^+jWROLral(Qy-xoBq1U7A&DV||wClb)Otd9?(gZ|8znMF}D zf<1haWz^s0qgecz;RFGt0C-B4g`jNGHsFU+;{<%t65v^sjk^h$lmWn#B0#_)9ij&d z-~lc`A)YYExi^7sBuPM^Y|wA2g*5?`K?#7tzELQYNxGo$UB$4J8RJp1k(8Jj+~hMT zlN~>M@KTTh^--8y3PK_NZ@AC!{PT=CziBzGd+wTJ^@icH!Bd}%)g8V)%K?|c&WTUk zy}qv1C%(fjRoZ4ozC3{O%@5?)XzH35zHns$pgU*Q?fj4v?fp1Qbm+j;3l;9jam9Da zXVcKjPlQ73x78QPu|Ffm6x?`~e3oD=gl=4kYK?={kD5j~QCXU)`HSdduNNENzA*2$ zOm3PzF!lN5e*06-f1Uot67wY#{o-S1!KZ7E=!~7ynnk9_iJR#kFoNbAOT#^2Gd17F zMmvU6>lndZQGd|ax9kUoXXO+$N?|j@6qpsF&_j7YXvwo_C{JpmLw5&#e6k>atv%es z5)7r*Wvv_JkUpT}M!_o!nVlEk1Zbl=a*2hQ*<|%*K1Glj^FcF`6kTzGQ3lz~2tCc@ z&x|tj;aH&1&9HwcJBcT`;{?a+pnej;M1HO(6Z{#J!cZA04hnFl;NXA+&`=7bjW_^o zfC40u3LMG?NdPtwGl>Tq6u}*QG)}-y;)lu-_>ee3kibW(69n0$0Zy!}9rQz%*v1iO zT9_H>99yIrSPYVy6^);rR}7Yo=J_T@hi+qhTZXnVWyf;JDYm5#eYLTxr*?kiNn!+Y zQ+LUkBafNJ#rH#C(?d5^;gw9o#%daEI{mA*LHPIHPU`#|H$hD zwm>0&+kahQ)E#%~k>&5@&#Vg82H?s%71=)(soi@174pi9--2{w{1$}Sz4zGn3Du&x bht0Iza^2ykEt4(epJ78uh5nDlX8(TxzDYwP diff --git a/Tests/UWP.Specs/Assets/Square44x44Logo.scale-200.png b/Tests/UWP.Specs/Assets/Square44x44Logo.scale-200.png deleted file mode 100644 index ce342a2ec8a61291ba76c54604aea7e9d20af11b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1647 zcmaJ?eM}Q)7(e+G1Q(|`V9JhTI2>MkceK4;p;PR&$Pi?ejk3YQ_3o`S&|W_dsOZ8# zWPTt69g`t$ab`0cj-Y0yiBSOqmd)tG7G(}M5aP0_%&9TijB#&)I{zSE^4@#z^FF`l z`8{8`o%wlL(UI|y2!cdsuVamHH~H86F!*-15em4)NqUpCQM5?aoC_eCf@lV4wvF2a zjDQn1JBL69f&@2M3rvzJcfE!eZ8FZUBlFlC5RD)it33{mF9#B82AiyQE%w)`vlwa> zv{<1sm&kSKK$&%2jSFn7$t&P%%6Ue>R=EAnG8N7fqynWG8L3p!4801a;8{+nliO(qd(jNJ_?+9W3#hLIDLoT6~3fx9=`CC-D}-AMrpEO7HK zt3$GicGPc?GmDjy7K2P@La;eu4!$zWCZ`ym{Z$b zu-O6RM&K4JT|BIZB`E-gxqG%FzanI#+2FFmqHqXG7yxWB=w55RGOM)$xMb(>kSNR z2w=1AZi%z=AmG~yea~XaXJR!v7vLn(RUnELfiB1|6D84ICOS}^Zo2AdN}<&*h}G_u z{xZ!(%>tLT3J3<5XhWy-tg+6)0nmUUENLW8TWA{R6bgVd3X;anYFZ^IRis*_P-C-r z;i>%1^eL3UI2-{w8nuFFcs0e~7J{O2k^~Ce%+Ly4U?|=!0LH=t6()xi<^I-rs+9sF z*q{E-CxZbGPeu#a;XJwE;9S1?#R&uns>^0G3p`hEUF*v`M?@h%T%J%RChmD|EVydq zmHWh*_=S%emRC*mhxaVLzT@>Z2SX0u9v*DIJ@WC^kLVdlGV6LpK$KIrlJqc zpJ921)+3JJdTx|<`G&kXpKkjGJv=76R`yYIQ{#c-`%+`#V(7}Q;&@6U8!Td1`d;?N z_9mnI#?AA}4J!r)LN4!E-@H5eXauuB7TOawS>Y|{-P?NNx-lq+z1W-+y(;39P&&LP zL{N80?&=C*qKmdA^moMZRuPcD!B<*mq$ch=0Cnlitw#txRWhb3%TQvPqjkC`F69G4b! ze7z9MZ#+;_#l?H37UqUhDFb^l&s2{oM$3I0o^Q!yx;;V)QmCMo)Tb_ui|mit8MS?U zm##6$sZZ1$@|s%?l@>4Z<*Q}sRBSKMhb4I{e5LdEhsHIHTe8Bod5c>6QtT>$XgUBz z6MK`kO$=jmt@FqggOhJ5j~e@ygRbG;<{Vu)*+nn9aQeo0;$#j;|MS=S$&L?BeV25z xs3B`@=#`5TF{^6(A1rvdY@|-RtQ|iS5{tyX+wH?;n8E)G$kykv-D^wh{{!TZT%7;_ diff --git a/Tests/UWP.Specs/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/Tests/UWP.Specs/Assets/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index f6c02ce97e0a802b85f6021e822c89f8bf57d5cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1255 zcmaJ>TWs4@7*5+{G#S+&C!qC#> zf>5N3P6jO*Cz>ug*(_DmW=)kea&m$gZ^+nyiF`;j%w@}y8)>p*SH}C`m?DXeieF2U zyQHecc_L%Gh!7GMt+hG06y;+|p4>m~}PjA}rKViGiEnn7G0ZO<>G|7q;2?NwGCM3s?eued6%hd$B+ z*kQJ{#~$S=DFE(%=E+UkmlEI*%3llUf~8Ja9YU1Vui0IbGBkW_gHB%Rd&!!ioX zs40O?i9I{};kle7GMvE7(rk`la=gTI)47=>%?q@^iL-nUo3}h4S}N-KHn8t5mVP8w z&bSErwp+37 zNJJ8?a|{r5Q3R0Z5s-LB1WHOwYC@7pCHWND#cL1cZ?{kJ368_*(UDWUDyb<}0y@o# zfMF016iMWPCb6obAxT$JlB6(2DrlXDTB&!0`!m??4F(qWMhjVZo?JXQmz`1*58Z=& zcDmB|S-E@j?BoFGix0flckqdS4jsPNzhfWyWIM98GxcLs89C(~dw%$_t;JjX-SD}E zfiGV;{8Q%8r}w9x>EEigW81>`kvnU@pK)4+xk9@+bNj9L!AAZ@SZ@q|)&BmY3+HZx zul~BeG4|}-;L%cHViQGQX?^zFfO0&#cHwel=d`lH9sJ-@Sl@n*(8J2>%Ac`IxyY?Q z{=GhWvC#gu-~Ia7*n{=+;qM?Ul_wy1+u7ho;=`>EwP^g~R@{unBds`!#@}tluZQpS zm)M~nYEifJWJGx?_6DcTy>#uh%>!H9=hb^(v`=m3F1{L>db=<5_tm+_&knAQ2EU$s Mu9UqpbNZeC0BbUo^Z)<= diff --git a/Tests/UWP.Specs/Assets/StoreLogo.png b/Tests/UWP.Specs/Assets/StoreLogo.png deleted file mode 100644 index 7385b56c0e4d3c6b0efe3324aa1194157d837826..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1451 zcmaJ>eN5D57_Z|bH;{0+1#mbl)eTU3{h)Wf7EZV?;HD@XL@{B`Ui%(2aMxQ~xdXSv z5nzWi(LW)U2=Vc-cY@s7nPt{i0hc6!7xN4NNHI#EQl>YNBy8l4%x9gr_W-j zEZMQmmTIy(>;lblRfh`dIyTgc9W5d!VP$L4(kKrN1c5G~(O_#xG zAJCNTstD^5SeXFB+&$h=ToJP2H>xr$iqPs-#O*;4(!Fjw25-!gEb*)mU}=)J;Iu>w zxK(5XoD0wrPSKQ~rbL^Cw6O_03*l*}i=ydbu7adJ6y;%@tjFeXIXT+ms30pmbOP%Q zX}S;+LBh8Tea~TSkHzvX6$rYb)+n&{kSbIqh|c7hmlxmwSiq5iVhU#iEQ<>a18|O^Sln-8t&+t`*{qBWo5M?wFM(JuimAOb5!K#D}XbslM@#1ZVz_;!9U zpfEpLAOz=0g@bd6Xj_ILi-x^!M}73h^o@}hM$1jflTs|Yuj9AL@A3<-?MV4!^4q`e z)fO@A;{9K^?W?DbnesnPr6kK>$zaKo&;FhFd(GYFCIU^T+OIMb%Tqo+P%oq(IdX7S zf6+HLO?7o0m+p>~Tp5UrXWh!UH!wZ5kv!E`_w)PTpI(#Iw{AS`gH4^b(bm^ZCq^FZ zY9DD7bH}rq9mg88+KgA$Zp!iWncuU2n1AuIa@=sWvUR-s`Qb{R*kk(SPU^`$6BXz8 zn#7yaFOIK%qGxyi`dYtm#&qqox0$h=pNi#u=M8zUG@bpiZ=3sT=1}Trr}39cC)H|v zbL?W)=&s4zrh)7>L(|cc%$1#!zfL?HjpeP%T+x_a+jZ16b^iKOHxFEX$7d|8${H-* zIrOJ5w&i$>*D>AKaIoYg`;{L@jM((Kt?$N$5OnuPqVvq**Nm}(f0wwOF%iX_Pba;V z;m@wxX&NcV3?<1+u?A{y_DIj7#m3Af1rCE)o`D&Y3}0%7E;iX1yMDiS)sh0wKi!36 zL!Wmq?P^Ku&rK~HJd97KkLTRl>ScGFYZNlYytWnhmuu|)L&ND8_PmkayQb{HOY640 bno1(wj@u8DCVuFR|31B*4ek@pZJqxCDDe1x diff --git a/Tests/UWP.Specs/Assets/Wide310x150Logo.scale-200.png b/Tests/UWP.Specs/Assets/Wide310x150Logo.scale-200.png deleted file mode 100644 index 288995b397fdbef1fb7e85afd71445d5de1952c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3204 zcmbVPeQXow8NYmBd90>}0NP?GhXW~VaeThm=a0tV#EwJMI!)6M3}|c4_Bl3=Kd>G0 z(GHx1wl<7(tP?FsOQkTilSo*iIvF%uArExJ73~P zSv1xEy!U(Wd4A9D`FQV@W3@F^qJ@PEF$@z`Z!*BbFsS(^?B zyiAzJ+q})bkgiQHWqEb*jJD-coHYr1^iocg)l!Qa{Xqs-l~6J}p-|##ZHYofskQ3$ zI0;xzXyhazBeXhIsg5A=%ufo@f)1yy&ScKS0;HF^!r_2UE^lpZEom(+@duma3awTv zCrCL-%D_SvYWIcdHkmI}#50(fkUi)Qgx!80ju>g1za^}ff>JI8Z@^-iCiaCgg@TgF z+vtE?Q9{VQUX&MW9SYYmGcxA14%N2@7FwBTD4N<(2{nWgV8$e3?-F=L^&FrtWn~(U_Q~~^uYiyeY6-KoTnfh9AWz@ zIKje0)u!_Lw)E}G!#kEfwKVdNt(UAf9*f>tEL_(=xco-T%jTi@7YlC3hs2ik%Le0H ztj}RTeCF(5mwvi3_56>-yB?l;J>-1%!9~=fs|QcNG3J~a@JCu`4SB460s0ZO+##4fFUSGLcj_ja^fL4&BKALfb#$6$O?>P@qx2Agl^x0i&ugt zsy5Pyu=()`7HRMG3IB7F1@`_ z+-!J%#i6e^U$e#+C%Q>_qVRzWRsG^W_n+@OcX@vzI&z;mzHNb!GQ?LWA(wtpqHqTM z1OFw_{Zn?fD)p)`c`kOgv{de=v@suGRqY{N^U7gI1VF3*F=obwaXI6ob5__Yn zVTguS!%(NI09J8x#AO_aW!9W7k*UvB;IWDFC3srwftr{kHj%g)fvnAm;&h_dnl~

MY- zf+K}sCe8qU6Ujs`3ua{U0Of$R_gVQBuUA za0v=mu#vIOqiiAZOr&h*$WyOw&k-xr$;G4Ixa!#TJNr>95(h>l%)PUy4p+^SgR(uR zta%k*?ny-+nAr8spEk1fo{J4i!b^Fia`N{_F6@zidA2ZTTrjl#^5Z-2KfB@Cu}l9s z(*|Z2jc?p~vn2f)3y9i*7zJV1L{$?|&q)4oaT;uXi6>1GkRXVTOzAz(RHEmr=eFIi z`}<>-Q?K0GN8!IYxeP1XKXO+jsJbp~o^);Bc;%b7Flpe7;1`Ny@3r7ZR;?R)aJt8C ziNlEC<@3f_lIV4TwV}&e;D!Ee5_|e#g0LUh=5vmYWYm7&2h*M>QPKvGh9-)wfMMW3 z8J9b%1k7dzPzO0_NGQy92BZ^FR6R~6;^6?lqO;-QUP4BY%cG%3vEhbm#>4vIhPBh3 z-+pZGjh$x%Hp{?=FHsMp0&wNPlj00us{&`1ZOZTqs8%4X&xH=UDr*xyBW(Zp&Em94 zf)ZSfn#yg0N)>!1kWdkqJ^S*z0FF5|fj&qcE#Na|%OY0$uO>!&hP+1ywfD_WXk@4J(?MBftK7>$Nvqh@tDuarN%PrTLQ2Uzysx>UV=V zk^RrDSvdQ?0;=hY67EgII-f4`t=+i*yS=Y~!XlqIy_4x&%+OdfbKOFPXS2X5%4R{N z$SQMX^AK6(fA - - 13.0 - false - true - - diff --git a/Tests/UWP.Specs/Package.appxmanifest b/Tests/UWP.Specs/Package.appxmanifest deleted file mode 100644 index bbe9c9803a..0000000000 --- a/Tests/UWP.Specs/Package.appxmanifest +++ /dev/null @@ -1,25 +0,0 @@ - - - - - UWP.Specs - FluentAssertions - Assets\StoreLogo.png - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Tests/UWP.Specs/Properties/AssemblyInfo.cs b/Tests/UWP.Specs/Properties/AssemblyInfo.cs deleted file mode 100644 index bccfd85910..0000000000 --- a/Tests/UWP.Specs/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("UWP.Specs")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("UWP.Specs")] -[assembly: AssemblyCopyright("Copyright © 2022")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: AssemblyMetadata("TargetPlatform", "UAP")] - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: ComVisible(false)] diff --git a/Tests/UWP.Specs/Properties/Default.rd.xml b/Tests/UWP.Specs/Properties/Default.rd.xml deleted file mode 100644 index f3d2603c7e..0000000000 --- a/Tests/UWP.Specs/Properties/Default.rd.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/Tests/UWP.Specs/UWP.Specs.csproj b/Tests/UWP.Specs/UWP.Specs.csproj deleted file mode 100644 index 4e917a7c68..0000000000 --- a/Tests/UWP.Specs/UWP.Specs.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - x86 - {08087654-2C32-4818-95E4-45362373441D} - AppContainerExe - Properties - UWP.Specs - UWP.Specs - en-US - UAP - 10.0.19041.0 - 10.0.18362.0 - 14 - 512 - {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - $(VisualStudioVersion) - false - $(NoWarn);2008 - true - true - 17.3.3 - - - true - bin\x64\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP - full - x64 - false - prompt - true - - - bin\x64\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP - true - pdbonly - x64 - false - prompt - true - - - PackageReference - - - - - - - - App.xaml - - - - - - MSBuild:Compile - Designer - - - - - Designer - - - - - - - - - - - - - - - Src\FluentAssertions\bin\$(Configuration)\netstandard2.0\FluentAssertions.dll - {34E3713D-C02F-4868-BBE7-47DAD2C7F03D} - FluentAssertions - - - - - 6.2.14 - - - 3.11.1 - - - 3.11.1 - - - 4.7.0 - - - - \ No newline at end of file diff --git a/Tests/UWP.Specs/UwpSpecs.cs b/Tests/UWP.Specs/UwpSpecs.cs deleted file mode 100644 index e21dce7d8d..0000000000 --- a/Tests/UWP.Specs/UwpSpecs.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using FluentAssertions; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace UWP.Specs; - -[TestClass] -public class UwpSpecs -{ - [TestMethod] - public void Determining_caller_identity_should_not_throw_for_native_programs() - { - // Arrange - Action someAction = () => throw new Exception(); - - // Act - Action act = () => someAction.Should().NotThrow(); - - // Assert - act.Should().Throw(); - } -} diff --git a/qodana.yaml b/qodana.yaml index d6c80a6293..b355925cec 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -24,7 +24,6 @@ exclude: - Tests/AssemblyA - Tests/AssemblyB - Tests/Benchmarks - - Tests/UWP.Specs - Src/FluentAssertions/Polyfill - name: UnusedMember.Global - name: ArrangeTrailingCommaInMultilineLists From 5eeda07bfca99fe8455a3b2e852e0d1b9f03d968 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 8 Mar 2026 17:44:51 +0100 Subject: [PATCH 798/845] Use OrdinalCase for newlines --- Src/FluentAssertions/Primitives/StringEqualityStrategy.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs index 6e6ec75342..e8b693032a 100644 --- a/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs +++ b/Src/FluentAssertions/Primitives/StringEqualityStrategy.cs @@ -205,8 +205,8 @@ private static bool AppendPrefixAndEscapedPhraseToShowWithEllipsisAndSuffix(Stri stringBuilder.Append(text .Substring(indexOfStartingPhrase, subjectLength) - .Replace("\r", "\\r", StringComparison.OrdinalIgnoreCase) - .Replace("\n", "\\n", StringComparison.OrdinalIgnoreCase)); + .Replace("\r", "\\r", StringComparison.Ordinal) + .Replace("\n", "\\n", StringComparison.Ordinal)); bool wasTruncated = false; From d1e7c292dbf463ac5caa8237d2f7136f4d81c706 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 8 Mar 2026 18:11:23 +0100 Subject: [PATCH 799/845] Avoid unused iterator variable `i` --- Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs index b21bf168f6..bfe7c1ecb5 100644 --- a/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs +++ b/Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs @@ -385,7 +385,7 @@ public void int maxDepth = 10; int iterations = (maxDepth / 2) + 1; // Each iteration adds two levels of depth to the graph - foreach (int i in Enumerable.Range(0, iterations)) + for (var i = 0; i < iterations; i++) { var newHead = new Node(); node.Children.Add(newHead); @@ -410,8 +410,9 @@ public void When_the_maximum_recursion_depth_is_never_reached_it_should_render_t var node = head; int iterations = 10; + int maxDepth = (iterations * 2) + 1; // Each iteration adds two levels of depth to the graph - foreach (int i in Enumerable.Range(0, iterations)) + for (var i = 0; i < iterations; i++) { var newHead = new Node(); node.Children.Add(newHead); @@ -421,8 +422,7 @@ public void When_the_maximum_recursion_depth_is_never_reached_it_should_render_t // Act string result = Formatter.ToString(head, new FormattingOptions { - // Each iteration adds two levels of depth to the graph - MaxDepth = (iterations * 2) + 1 + MaxDepth = maxDepth }); // Assert From 483eef77d06f11d0045cd8473e00f144e21496d9 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 8 Mar 2026 18:22:21 +0100 Subject: [PATCH 800/845] Remove explicit calls to ToString() --- .../Equivalency/SelfReferenceEquivalencyOptions.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index aaf30b9127..40eca97af5 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -975,30 +975,30 @@ public override string ToString() foreach (IMemberSelectionRule rule in selectionRules) { - builder.Append("- ").AppendLine(rule.ToString()); + builder.Append("- ").Append(rule).AppendLine(); } foreach (ITypingRule rule in typingRules) { - builder.Append("- ").AppendLine(rule.ToString()); + builder.Append("- ").Append(rule).AppendLine(); } foreach (IMemberMatchingRule rule in matchingRules) { - builder.Append("- ").AppendLine(rule.ToString()); + builder.Append("- ").Append(rule).AppendLine(); } foreach (IEquivalencyStep step in userEquivalencySteps) { - builder.Append("- ").AppendLine(step.ToString()); + builder.Append("- ").Append(step).AppendLine(); } foreach (IOrderingRule rule in OrderingRules) { - builder.Append("- ").AppendLine(rule.ToString()); + builder.Append("- ").Append(rule).AppendLine(); } - builder.Append("- ").AppendLine(ConversionSelector.ToString()); + builder.Append("- ").Append(ConversionSelector).AppendLine(); return builder.ToString(); } From 1052d770a87c142fcf891dc4fc107cad70864c8b Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 8 Mar 2026 19:09:09 +0100 Subject: [PATCH 801/845] Remove redundant null checks --- .../Steps/DictionaryEquivalencyStep.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs index 9aa65aa915..f53a550a04 100644 --- a/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/DictionaryEquivalencyStep.cs @@ -22,7 +22,7 @@ protected override EquivalencyResult OnHandle(Comparands comparands, var assertionChain = AssertionChain.GetOrCreate().For(context); - if (PreconditionsAreMet(expectation, subject, assertionChain) && expectation is not null) + if (PreconditionsAreMet(expectation, subject, assertionChain)) { foreach (object key in expectation.Keys) { @@ -52,21 +52,21 @@ protected override EquivalencyResult OnHandle(Comparands comparands, private static bool PreconditionsAreMet(IDictionary expectation, IDictionary subject, AssertionChain assertionChain) { - return AssertIsDictionary(subject, assertionChain) - && AssertEitherIsNotNull(expectation, subject, assertionChain) + return AssertSubjectIsNotNull(subject, assertionChain) + && AssertExpectationIsNotNull(expectation, subject, assertionChain) && AssertSameLength(expectation, subject, assertionChain); } - private static bool AssertEitherIsNotNull(IDictionary expectation, IDictionary subject, AssertionChain assertionChain) + private static bool AssertExpectationIsNotNull(IDictionary expectation, IDictionary subject, AssertionChain assertionChain) { assertionChain - .ForCondition((expectation is null && subject is null) || expectation is not null) + .ForCondition(expectation is not null) .FailWith("Expected {context:subject} to be {0}{reason}, but found {1}.", null, subject); return assertionChain.Succeeded; } - private static bool AssertIsDictionary(IDictionary subject, AssertionChain assertionChain) + private static bool AssertSubjectIsNotNull(IDictionary subject, AssertionChain assertionChain) { assertionChain .ForCondition(subject is not null) @@ -78,9 +78,9 @@ private static bool AssertIsDictionary(IDictionary subject, AssertionChain asser private static bool AssertSameLength(IDictionary expectation, IDictionary subject, AssertionChain assertionChain) { assertionChain - .ForCondition(expectation is null || subject.Keys.Count == expectation.Keys.Count) + .ForCondition(subject.Keys.Count == expectation.Keys.Count) .FailWith("Expected {context:subject} to be a dictionary with {0} item(s), but it only contains {1} item(s).", - expectation?.Keys.Count, subject?.Keys.Count); + expectation.Keys.Count, subject.Keys.Count); return assertionChain.Succeeded; } From 1ba808c972709ed2ac982eab1bab4597601be767 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 15 Mar 2026 15:01:27 +0100 Subject: [PATCH 802/845] Bump flatted in the npm_and_yarn group across 1 directory (#3181) Bumps the npm_and_yarn group with 1 update in the / directory: [flatted](https://github.com/WebReflection/flatted). Updates `flatted` from 3.3.3 to 3.4.1 - [Commits](https://github.com/WebReflection/flatted/compare/v3.3.3...v3.4.1) --- updated-dependencies: - dependency-name: flatted dependency-version: 3.4.1 dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8e4b83a1b2..ddc569d712 100644 --- a/package-lock.json +++ b/package-lock.json @@ -903,9 +903,9 @@ } }, "node_modules/flatted": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", - "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.1.tgz", + "integrity": "sha512-IxfVbRFVlV8V/yRaGzk0UVIcsKKHMSfYw66T/u4nTwlWteQePsxe//LjudR1AMX4tZW3WFCh3Zqa/sjlqpbURQ==", "license": "ISC" }, "node_modules/gensequence": { From e395aa9283147378a9c786b0f31003499987c276 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Thu, 19 Mar 2026 17:58:52 +0100 Subject: [PATCH 803/845] Reroute the docs link to Xceed (#3183) Co-authored-by: Dennis Doomen --- docs/_data/navigation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index 3b9abbe76c..2b1a285cb5 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -3,7 +3,7 @@ main: - title: "About" url: /about/ - title: "Documentation" - url: https://doc.xceed.com + url: https://xceed.com/documentation/xceed-fluent-assertions-for-net/ - title: "Releases" url: /releases/ - title: "GitHub" From e179bb0aa07a35c1d629c55087978029e5b5285b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 10:27:43 -0700 Subject: [PATCH 804/845] Bump flatted in the npm_and_yarn group across 1 directory (#3184) Bumps the npm_and_yarn group with 1 update in the / directory: [flatted](https://github.com/WebReflection/flatted). Updates `flatted` from 3.4.1 to 3.4.2 - [Commits](https://github.com/WebReflection/flatted/compare/v3.4.1...v3.4.2) --- updated-dependencies: - dependency-name: flatted dependency-version: 3.4.2 dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ddc569d712..927456df1c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -903,9 +903,9 @@ } }, "node_modules/flatted": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.1.tgz", - "integrity": "sha512-IxfVbRFVlV8V/yRaGzk0UVIcsKKHMSfYw66T/u4nTwlWteQePsxe//LjudR1AMX4tZW3WFCh3Zqa/sjlqpbURQ==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", "license": "ISC" }, "node_modules/gensequence": { From 2a6f493bebb5bde6cc709cae87038bae5fd48971 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Mar 2026 14:23:07 -0700 Subject: [PATCH 805/845] Add AI assistant instruction file (agents.md) for Copilot, Claude, and JetBrains Junie (#3176) --- .github/copilot-instructions.md | 1 + .junie/guidelines.md | 1 + CLAUDE.md | 1 + agents.md | 196 ++++++++++++++++++++++++++++++++ 4 files changed, 199 insertions(+) create mode 100644 .github/copilot-instructions.md create mode 100644 .junie/guidelines.md create mode 100644 CLAUDE.md create mode 100644 agents.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000000..c1eb48e7e0 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1 @@ +The guidelines for this repository are maintained in [agents.md](../agents.md) at the root of the repository. diff --git a/.junie/guidelines.md b/.junie/guidelines.md new file mode 100644 index 0000000000..c1eb48e7e0 --- /dev/null +++ b/.junie/guidelines.md @@ -0,0 +1 @@ +The guidelines for this repository are maintained in [agents.md](../agents.md) at the root of the repository. diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000000..79709e3ef5 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +@agents.md diff --git a/agents.md b/agents.md new file mode 100644 index 0000000000..913b610091 --- /dev/null +++ b/agents.md @@ -0,0 +1,196 @@ +# Fluent Assertions – AI Agent Guidelines + +## Project Overview + +Fluent Assertions is a .NET library providing a rich set of fluent extension methods that allow developers to more naturally specify the expected outcome of test assertions. It supports multiple .NET test frameworks (xUnit, NUnit, MSTest, MSpec, TUnit, etc.) and targets `net47`, `net6.0`, and `net8.0`. + +The source lives in `Src/FluentAssertions/` and the tests in `Tests/FluentAssertions.Specs/` and `Tests/FluentAssertions.Equivalency.Specs/`. + +## Build & Test Commands + +```bash +# Build +dotnet build + +# Run all tests +dotnet test + +# Run tests for a specific project +dotnet test Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj + +# Spell check documentation (run before pushing) +./build.sh --target spellcheck # Linux/macOS +.\build.ps1 --target spellcheck # Windows + +# Accept intentional public API changes (after running approval tests) +./AcceptApiChanges.sh # Linux/macOS +.\AcceptApiChanges.ps1 # Windows +``` + +The project uses a [Nuke](https://nuke.build/)-based build system. The build scripts `build.sh` / `build.ps1` / `build.cmd` are thin wrappers around Nuke and support all standard Nuke targets. + +## Contributing Workflow + +- Always target the `main` branch for pull requests +- Prefer rebase over merge when updating a local branch +- **Any change to the public API requires prior approval**: open a GitHub issue, get it labeled `api-approved`, then open the PR +- After intentional public API changes, run `AcceptApiChanges.sh` / `AcceptApiChanges.ps1` to update the API approval baselines in `Tests/Approval.Tests/` +- Update `docs/_pages/releases.md` when adding features or fixing bugs +- Update `docs/_pages/` documentation when assertions are added or changed +- Run the spell checker before pushing: `./build.sh --target spellcheck` + +## Code Style + +Follow the [C# Coding Guidelines](https://csharpcodingguidelines.com/). Key rules enforced by `.editorconfig`: + +- 4 spaces indentation; max line length of 130 characters +- CRLF line endings +- Opening braces on their own line (`csharp_new_line_before_open_brace = all`) +- Use language keywords instead of BCL types (`int` not `Int32`, `string` not `String`) +- Prefer pattern matching over casts (`is` patterns, not `as` + null check) +- Avoid `this.` qualifier unless required for disambiguation +- Use `var` only when the type is immediately apparent from the right-hand side +- Access modifiers are required on all non-interface members +- `readonly` is required on fields that are never reassigned +- Constant fields use PascalCase + +## Assertion Classes + +All assertion classes follow this dual-class pattern (concrete + generic base) to support both simple use and extensibility via inheritance: + +```csharp +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using FluentAssertions.Execution; + +namespace FluentAssertions.Primitives; + +///

+/// Contains a number of methods to assert that a is in the expected state. +/// +[DebuggerNonUserCode] +public class FooAssertions : FooAssertions +{ + public FooAssertions(Foo value, AssertionChain assertionChain) + : base(value, assertionChain) + { + } +} + +#pragma warning disable CS0659, S1206 // Ignore not overriding Object.GetHashCode() +#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals +/// +/// Contains a number of methods to assert that a is in the expected state. +/// +[DebuggerNonUserCode] +public class FooAssertions + where TAssertions : FooAssertions +{ + private readonly AssertionChain assertionChain; + + public FooAssertions(Foo value, AssertionChain assertionChain) + { + this.assertionChain = assertionChain; + Subject = value; + } + + /// + /// Gets the object whose value is being asserted. + /// + public Foo Subject { get; } + + /// + /// Asserts that the foo satisfies some condition. + /// + /// + /// 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 BeSomething( + [StringSyntax("CompositeFormat")] string because = "", + params object[] becauseArgs) + { + assertionChain + .ForCondition(/* condition */) + .BecauseOf(because, becauseArgs) + .FailWith("Expected {context:foo} to be something{reason}."); + + return new AndConstraint((TAssertions)this); + } +} +``` + +Key points: +- All assertion classes must have `[DebuggerNonUserCode]` +- Generic parameter is `TAssertions` constrained to the class itself +- `Subject` property exposes the value under test +- Assertion methods return `AndConstraint` or `AndWhichConstraint` to support chaining (`.And`) +- `because` / `becauseArgs` parameters are required on every assertion method +- `because` is decorated with `[StringSyntax("CompositeFormat")]` +- Failure messages use `{context:typename}` for the subject reference and `{reason}` for the `because` clause +- The `Should()` extension method for new types is added to `Src/FluentAssertions/AssertionExtensions.cs` +- XML doc comments on `Should()` extension methods follow the pattern: `Returns an object that can be used to assert the current .` + +## Test Conventions + +Tests use xUnit and the Arrange-Act-Assert (AAA) pattern. Each spec class is a partial class split into one file per assertion method. + +**File naming**: `FooAssertionSpecs.BeSomething.cs` (partial class file per assertion method) + +```csharp +using System; +using Xunit; +using Xunit.Sdk; + +namespace FluentAssertions.Specs.Primitives; + +public partial class FooAssertionSpecs +{ + public class BeSomething // One nested class per assertion method + { + [Fact] + public void Succeeds_for_foo_with_the_expected_value() + { + // Arrange + var subject = new Foo(expectedValue); + + // Act / Assert + subject.Should().BeSomething(); + } + + [Fact] + public void The_foo_must_satisfy_some_condition() + { + // Arrange + var subject = new Foo(unexpectedValue); + + // Act + Action act = () => subject.Should().BeSomething(); + + // Assert + act.Should().Throw() + .WithMessage("Expected foo to be something*"); + } + + [Fact] + public void Fails_for_null_foo() + { + // Arrange + Foo subject = null; + + // Act + Action act = () => subject.Should().BeSomething(); + + // Assert + act.Should().Throw(); + } + } +} +``` + +Naming rules: +- Use fact-based test method names (e.g. `Succeeds_for_*`, `The_X_must_be_Y`, `An_X_is_required`) – avoid "Should", "When", and "Asserting" +- Separate the "Act" and "Assert" steps only when testing failure paths; success-path tests can combine them as `// Act / Assert` From fdfe953df465a2270051f1cd3abf1a5e524ff330 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 11:19:17 -0700 Subject: [PATCH 806/845] Bump smol-toml in the npm_and_yarn group across 1 directory (#3185) Bumps the npm_and_yarn group with 1 update in the / directory: [smol-toml](https://github.com/squirrelchat/smol-toml). Updates `smol-toml` from 1.6.0 to 1.6.1 - [Release notes](https://github.com/squirrelchat/smol-toml/releases) - [Commits](https://github.com/squirrelchat/smol-toml/compare/v1.6.0...v1.6.1) --- updated-dependencies: - dependency-name: smol-toml dependency-version: 1.6.1 dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 927456df1c..8aae6678e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1046,9 +1046,9 @@ } }, "node_modules/smol-toml": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.6.0.tgz", - "integrity": "sha512-4zemZi0HvTnYwLfrpk/CF9LOd9Lt87kAt50GnqhMpyF9U3poDAP2+iukq2bZsO/ufegbYehBkqINbsWxj4l4cw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.6.1.tgz", + "integrity": "sha512-dWUG8F5sIIARXih1DTaQAX4SsiTXhInKf1buxdY9DIg4ZYPZK5nGM1VRIYmEbDbsHt7USo99xSLFu5Q1IqTmsg==", "license": "BSD-3-Clause", "engines": { "node": ">= 18" From c73b73097ff0e28f87535cfd007eccc06b0612dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 12:51:24 -0700 Subject: [PATCH 807/845] Bump the npm_and_yarn group across 1 directory with 2 updates (#3186) Bumps the npm_and_yarn group with 2 updates in the / directory: [picomatch](https://github.com/micromatch/picomatch) and [yaml](https://github.com/eemeli/yaml). Updates `picomatch` from 4.0.3 to 4.0.4 - [Release notes](https://github.com/micromatch/picomatch/releases) - [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/picomatch/compare/4.0.3...4.0.4) Updates `yaml` from 2.8.2 to 2.8.3 - [Release notes](https://github.com/eemeli/yaml/releases) - [Commits](https://github.com/eemeli/yaml/compare/v2.8.2...v2.8.3) --- updated-dependencies: - dependency-name: picomatch dependency-version: 4.0.4 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: yaml dependency-version: 2.8.3 dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8aae6678e1..66e4aabb82 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1013,9 +1013,9 @@ } }, "node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "license": "MIT", "engines": { "node": ">=12" @@ -1098,9 +1098,9 @@ } }, "node_modules/yaml": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", - "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz", + "integrity": "sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg==", "license": "ISC", "bin": { "yaml": "bin.mjs" From efe9635553ce8d1078fcfa47c632cd3bfefcc273 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 18:28:04 +0200 Subject: [PATCH 808/845] Bump cspell from 9.7.0 to 10.0.0 (#3189) --- NodeVersion | 2 +- package-lock.json | 492 ++++++++++++++++++++-------------------------- package.json | 2 +- 3 files changed, 213 insertions(+), 283 deletions(-) diff --git a/NodeVersion b/NodeVersion index 586e275eb9..91d5f6ff8e 100644 --- a/NodeVersion +++ b/NodeVersion @@ -1 +1 @@ -20.20.0 +22.18.0 diff --git a/package-lock.json b/package-lock.json index 66e4aabb82..e12e565acf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,67 +7,67 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.7.0" + "cspell": "^10.0.0" } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-9.7.0.tgz", - "integrity": "sha512-s7h1vo++Q3AsfQa3cs0u/KGwm3SYInuIlC4kjlCBWjQmb4KddiZB5O1u0+3TlA7GycHb5M4CR7MDfHUICgJf+w==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-10.0.0.tgz", + "integrity": "sha512-ci410HEkng2582oOjlRHQtlGXwh+rUC/mVcN9dObLHpKhvPgzn2S6vT56pARstxxZpcCUG/oLhn3dCqdJlVzmA==", "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.1", "@cspell/dict-al": "^1.1.1", "@cspell/dict-aws": "^4.0.17", "@cspell/dict-bash": "^4.2.2", - "@cspell/dict-companies": "^3.2.10", + "@cspell/dict-companies": "^3.2.11", "@cspell/dict-cpp": "^7.0.2", "@cspell/dict-cryptocurrencies": "^5.0.5", "@cspell/dict-csharp": "^4.0.8", - "@cspell/dict-css": "^4.0.19", + "@cspell/dict-css": "^4.1.1", "@cspell/dict-dart": "^2.3.2", "@cspell/dict-data-science": "^2.0.13", "@cspell/dict-django": "^4.1.6", "@cspell/dict-docker": "^1.1.17", - "@cspell/dict-dotnet": "^5.0.12", + "@cspell/dict-dotnet": "^5.0.13", "@cspell/dict-elixir": "^4.0.8", - "@cspell/dict-en_us": "^4.4.29", + "@cspell/dict-en_us": "^4.4.33", "@cspell/dict-en-common-misspellings": "^2.1.12", - "@cspell/dict-en-gb-mit": "^3.1.18", - "@cspell/dict-filetypes": "^3.0.15", + "@cspell/dict-en-gb-mit": "^3.1.22", + "@cspell/dict-filetypes": "^3.0.18", "@cspell/dict-flutter": "^1.1.1", - "@cspell/dict-fonts": "^4.0.5", + "@cspell/dict-fonts": "^4.0.6", "@cspell/dict-fsharp": "^1.1.1", - "@cspell/dict-fullstack": "^3.2.8", + "@cspell/dict-fullstack": "^3.2.9", "@cspell/dict-gaming-terms": "^1.1.2", "@cspell/dict-git": "^3.1.0", "@cspell/dict-golang": "^6.0.26", "@cspell/dict-google": "^1.0.9", "@cspell/dict-haskell": "^4.0.6", - "@cspell/dict-html": "^4.0.14", + "@cspell/dict-html": "^4.0.15", "@cspell/dict-html-symbol-entities": "^4.0.5", "@cspell/dict-java": "^5.0.12", "@cspell/dict-julia": "^1.1.1", "@cspell/dict-k8s": "^1.0.12", "@cspell/dict-kotlin": "^1.1.1", - "@cspell/dict-latex": "^5.0.0", + "@cspell/dict-latex": "^5.1.0", "@cspell/dict-lorem-ipsum": "^4.0.5", "@cspell/dict-lua": "^4.0.8", "@cspell/dict-makefile": "^1.0.5", - "@cspell/dict-markdown": "^2.0.14", + "@cspell/dict-markdown": "^2.0.16", "@cspell/dict-monkeyc": "^1.0.12", "@cspell/dict-node": "^5.0.9", - "@cspell/dict-npm": "^5.2.34", + "@cspell/dict-npm": "^5.2.38", "@cspell/dict-php": "^4.1.1", "@cspell/dict-powershell": "^5.0.15", - "@cspell/dict-public-licenses": "^2.0.15", - "@cspell/dict-python": "^4.2.25", + "@cspell/dict-public-licenses": "^2.0.16", + "@cspell/dict-python": "^4.2.26", "@cspell/dict-r": "^2.1.1", - "@cspell/dict-ruby": "^5.1.0", + "@cspell/dict-ruby": "^5.1.1", "@cspell/dict-rust": "^4.1.2", "@cspell/dict-scala": "^5.0.9", "@cspell/dict-shell": "^1.1.2", - "@cspell/dict-software-terms": "^5.1.21", + "@cspell/dict-software-terms": "^5.2.2", "@cspell/dict-sql": "^2.2.1", "@cspell/dict-svelte": "^1.0.7", "@cspell/dict-swift": "^2.0.6", @@ -77,79 +77,79 @@ "@cspell/dict-zig": "^1.0.0" }, "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-9.7.0.tgz", - "integrity": "sha512-6xpGXlMtQA3hV2BCAQcPkpx9eI12I0o01i9eRqSSEDKtxuAnnrejbcCpL+5OboAjTp3/BSeNYSnhuWYLkSITWQ==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-10.0.0.tgz", + "integrity": "sha512-hq5dui2ngYMZKbBauX7K1tkqlu81sX/uaCO49ZJLPjeZsE1auZLtHehDLfAr/ZXoj/dLYeQMSKiaJyE+qLVPHA==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.7.0" + "@cspell/cspell-types": "10.0.0" }, "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/@cspell/cspell-performance-monitor": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-performance-monitor/-/cspell-performance-monitor-9.7.0.tgz", - "integrity": "sha512-w1PZIFXuvjnC6mQHyYAFnrsn5MzKnEcEkcK1bj4OG00bAt7WX2VUA/eNNt9c1iHozCQ+FcRYlfbGxuBmNyzSgw==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-performance-monitor/-/cspell-performance-monitor-10.0.0.tgz", + "integrity": "sha512-2vMh2pLt2dg/ArYvWjMP4v9HCm0pRhONsEJyc8oHdZyOYvX7trixX894I0M39+VBf3yWtPCEgYRh1UDXNIZRig==", "license": "MIT", "engines": { - "node": ">=20.18" + "node": ">=22.18.0" } }, "node_modules/@cspell/cspell-pipe": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-9.7.0.tgz", - "integrity": "sha512-iiisyRpJciU9SOHNSi0ZEK0pqbEMFRatI/R4O+trVKb+W44p4MNGClLVRWPGUmsFbZKPJL3jDtz0wPlG0/JCZA==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-10.0.0.tgz", + "integrity": "sha512-qcgHhQvtEX8LSwIVsWrdUgiGim52lN3jT+ghlkdp72v+nBcGKsS2frEKTmbGLug+xcqppkzs6Q6VmsFp1MGtfA==", "license": "MIT", "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/@cspell/cspell-resolver": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-9.7.0.tgz", - "integrity": "sha512-uiEgS238mdabDnwavo6HXt8K98jlh/jpm7NONroM9NTr9rzck2VZKD2kXEj85wDNMtRsRXNoywTjwQ8WTB6/+w==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-10.0.0.tgz", + "integrity": "sha512-8H+IUDB7SmrpcRugQ5f55qG81ZShk6nQRk+natLz41TEY98D8/LCmjHEkh/vhDPph9pVJmNUp7JcM2E1UHEa2g==", "license": "MIT", "dependencies": { "global-directory": "^5.0.0" }, "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/@cspell/cspell-service-bus": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-9.7.0.tgz", - "integrity": "sha512-fkqtaCkg4jY/FotmzjhIavbXuH0AgUJxZk78Ktf4XlhqOZ4wDeUWrCf220bva4mh3TWiLx/ae9lIlpl59Vx6hA==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-10.0.0.tgz", + "integrity": "sha512-V7eigqg/TOoKwNK4Q18wr9KGxA8U5SFcoWVS8RyAxv4mQ+yNKHhvHEbRBifjPbQDer66afOrclb2UbqkIy2SOw==", "license": "MIT", "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/@cspell/cspell-types": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.7.0.tgz", - "integrity": "sha512-Tdfx4eH2uS+gv9V9NCr3Rz+c7RSS6ntXp3Blliud18ibRUlRxO9dTaOjG4iv4x0nAmMeedP1ORkEpeXSkh2QiQ==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-10.0.0.tgz", + "integrity": "sha512-IQA++Idqb8fZzkCbHq3+T+9yG9WpeaBxomOrG2KcR/Pj0CgnovzuApYKL2cc35UWLePboKinMeqEPiweFpHVug==", "license": "MIT", "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/@cspell/cspell-worker": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-worker/-/cspell-worker-9.7.0.tgz", - "integrity": "sha512-cjEApFF0aOAa1vTUk+e7xP8ofK7iC7hsRzj1FmvvVQz8PoLWPRaq+1bT89ypPsZQvavqm5sIgb97S60/aW4TVg==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-worker/-/cspell-worker-10.0.0.tgz", + "integrity": "sha512-V5bjMldNksilnja3fu8muQmkW5/guyua1yNVOhoE2r7othSvjuDlGMl8g2bQSrWjp+UXu0dP/BEZ6JC/IfNwTA==", "license": "MIT", "dependencies": { - "cspell-lib": "9.7.0" + "cspell-lib": "10.0.0" }, "engines": { - "node": ">=20.18" + "node": ">=22.18.0" } }, "node_modules/@cspell/dict-ada": { @@ -180,9 +180,9 @@ } }, "node_modules/@cspell/dict-companies": { - "version": "3.2.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.2.10.tgz", - "integrity": "sha512-bJ1qnO1DkTn7JYGXvxp8FRQc4yq6tRXnrII+jbP8hHmq5TX5o1Wu+rdfpoUQaMWTl6balRvcMYiINDesnpR9Bw==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.2.11.tgz", + "integrity": "sha512-0cmafbcz2pTHXLd59eLR1gvDvN6aWAOM0+cIL4LLF9GX9yB2iKDNrKsvs4tJRqutoaTdwNFBbV0FYv+6iCtebQ==", "license": "MIT" }, "node_modules/@cspell/dict-cpp": { @@ -204,9 +204,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-css": { - "version": "4.0.19", - "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.19.tgz", - "integrity": "sha512-VYHtPnZt/Zd/ATbW3rtexWpBnHUohUrQOHff/2JBhsVgxOrksAxJnLAO43Q1ayLJBJUUwNVo+RU0sx0aaysZfg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.1.1.tgz", + "integrity": "sha512-y/Vgo6qY08e1t9OqR56qjoFLBCpi4QfWMf2qzD1l9omRZwvSMQGRPz4x0bxkkkU4oocMAeztjzCsmLew//c/8w==", "license": "MIT" }, "node_modules/@cspell/dict-dart": { @@ -234,9 +234,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-dotnet": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.12.tgz", - "integrity": "sha512-FiV934kNieIjGTkiApu/WKvLYi/KBpvfWB2TSqpDQtmXZlt3uSa5blwblO1ZC8OvjH8RCq/31H5IdEYmTaZS7A==", + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.13.tgz", + "integrity": "sha512-xPp7jMnFpOri7tzmqmm/dXMolXz1t2bhNqxYkOyMqXhvs08oc7BFs+EsbDY0X7hqiISgeFZGNqn0dOCr+ncPYw==", "license": "MIT" }, "node_modules/@cspell/dict-elixir": { @@ -246,9 +246,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.4.29", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.29.tgz", - "integrity": "sha512-G3B27++9ziRdgbrY/G/QZdFAnMzzx17u8nCb2Xyd4q6luLpzViRM/CW3jA+Mb/cGT5zR/9N+Yz9SrGu1s0bq7g==", + "version": "4.4.33", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.33.tgz", + "integrity": "sha512-zWftVqfUStDA37wO1ZNDN1qMJOfcxELa8ucHW8W8wBAZY3TK5Nb6deLogCK/IJi/Qljf30dwwuqqv84Qqle9Tw==", "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { @@ -258,15 +258,15 @@ "license": "CC BY-SA 4.0" }, "node_modules/@cspell/dict-en-gb-mit": { - "version": "3.1.18", - "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.18.tgz", - "integrity": "sha512-AXaMzbaxhSc32MSzKX0cpwT+Thv1vPfxQz1nTly1VHw3wQcwPqVFSqrLOYwa8VNqAPR45583nnhD6iqJ9YESoQ==", + "version": "3.1.22", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.22.tgz", + "integrity": "sha512-xE5Vg6gGdMkZ1Ep6z9SJMMioGkkT1GbxS5Mm0U3Ey1/H68P0G7cJcyiVr1CARxFbLqKE4QUpoV1o6jz1Z5Yl9Q==", "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { - "version": "3.0.16", - "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.16.tgz", - "integrity": "sha512-SyrtuK2/sx+cr94jOp2/uOAb43ngZEVISUTRj4SR6SfoGULVV1iJS7Drqn7Ul9HJ731QDttwWlOUgcQ+yMRblg==", + "version": "3.0.18", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.18.tgz", + "integrity": "sha512-yU7RKD/x1IWmDLzWeiItMwgV+6bUcU/af23uS0+uGiFUbsY1qWV/D4rxlAAO6Z7no3J2z8aZOkYIOvUrJq0Rcw==", "license": "MIT" }, "node_modules/@cspell/dict-flutter": { @@ -276,9 +276,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-fonts": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.5.tgz", - "integrity": "sha512-BbpkX10DUX/xzHs6lb7yzDf/LPjwYIBJHJlUXSBXDtK/1HaeS+Wqol4Mlm2+NAgZ7ikIE5DQMViTgBUY3ezNoQ==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.6.tgz", + "integrity": "sha512-aR/0csY01dNb0A1tw/UmN9rKgHruUxsYsvXu6YlSBJFu60s26SKr/k1o4LavpHTQ+lznlYMqAvuxGkE4Flliqw==", "license": "MIT" }, "node_modules/@cspell/dict-fsharp": { @@ -288,9 +288,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-fullstack": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.8.tgz", - "integrity": "sha512-J6EeoeThvx/DFrcA2rJiCA6vfqwJMbkG0IcXhlsmRZmasIpanmxgt90OEaUazbZahFiuJT8wrhgQ1QgD1MsqBw==", + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.9.tgz", + "integrity": "sha512-diZX+usW5aZ4/b2T0QM/H/Wl9aNMbdODa1Jq0ReBr/jazmNeWjd+PyqeVgzd1joEaHY+SAnjrf/i9CwKd2ZtWQ==", "license": "MIT" }, "node_modules/@cspell/dict-gaming-terms": { @@ -324,9 +324,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-html": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.14.tgz", - "integrity": "sha512-2bf7n+kS92g+cMKV0wr9o/Oq9n8JzU7CcrB96gIh2GHgnF+0xDOqO2W/1KeFAqOfqosoOVE48t+4dnEMkkoJ2Q==", + "version": "4.0.15", + "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.15.tgz", + "integrity": "sha512-GJYnYKoD9fmo2OI0aySEGZOjThnx3upSUvV7mmqUu8oG+mGgzqm82P/f7OqsuvTaInZZwZbo+PwJQd/yHcyFIw==", "license": "MIT" }, "node_modules/@cspell/dict-html-symbol-entities": { @@ -360,9 +360,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-latex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-5.0.0.tgz", - "integrity": "sha512-HUrIqUVohM6P0+5b7BsdAdb0STIv0aaFBvguI7pLcreljlcX3FSPUxea7ticzNlCNeVrEaiEn/ws9m6rYUeuNw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-5.1.0.tgz", + "integrity": "sha512-qxT4guhysyBt0gzoliXYEBYinkAdEtR2M7goRaUH0a7ltCsoqqAeEV8aXYRIdZGcV77gYSobvu3jJL038tlPAw==", "license": "MIT" }, "node_modules/@cspell/dict-lorem-ipsum": { @@ -384,13 +384,13 @@ "license": "MIT" }, "node_modules/@cspell/dict-markdown": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.14.tgz", - "integrity": "sha512-uLKPNJsUcumMQTsZZgAK9RgDLyQhUz/uvbQTEkvF/Q4XfC1i/BnA8XrOrd0+Vp6+tPOKyA+omI5LRWfMu5K/Lw==", + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.16.tgz", + "integrity": "sha512-976RRqKv6cwhrxdFCQP2DdnBVB86BF57oQtPHy4Zbf4jF/i2Oy29MCrxirnOBalS1W6KQeto7NdfDXRAwkK4PQ==", "license": "MIT", "peerDependencies": { - "@cspell/dict-css": "^4.0.19", - "@cspell/dict-html": "^4.0.14", + "@cspell/dict-css": "^4.1.1", + "@cspell/dict-html": "^4.0.15", "@cspell/dict-html-symbol-entities": "^4.0.5", "@cspell/dict-typescript": "^3.2.3" } @@ -408,9 +408,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.2.35", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.35.tgz", - "integrity": "sha512-w0VIDUvzHSTt4S9pfvSatApxtCesLMFrDUYD0Wjtw91EBRkB2wVw/RV3q1Ni9Nzpx6pCFpcB7c1xBY8l22cyiQ==", + "version": "5.2.38", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.38.tgz", + "integrity": "sha512-21ucGRPYYhr91C2cDBoMPTrcIOStQv33xOqJB0JLoC5LAs2Sfj9EoPGhGb+gIFVHz6Ia7JQWE2SJsOVFJD1wmg==", "license": "MIT" }, "node_modules/@cspell/dict-php": { @@ -432,9 +432,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-python": { - "version": "4.2.25", - "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.25.tgz", - "integrity": "sha512-hDdN0YhKgpbtZVRjQ2c8jk+n0wQdidAKj1Fk8w7KEHb3YlY5uPJ0mAKJk7AJKPNLOlILoUmN+HAVJz+cfSbWYg==", + "version": "4.2.26", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.26.tgz", + "integrity": "sha512-hbjN6BjlSgZOG2dA2DtvYNGBM5Aq0i0dHaZjMOI9K/9vRicVvKbcCiBSSrR3b+jwjhQL5ff7HwG5xFaaci0GQA==", "license": "MIT", "dependencies": { "@cspell/dict-data-science": "^2.0.13" @@ -447,9 +447,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-ruby": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.1.0.tgz", - "integrity": "sha512-9PJQB3cfkBULrMLp5kSAcFPpzf8oz9vFN+QYZABhQwWkGbuzCIXSorHrmWSASlx4yejt3brjaWS57zZ/YL5ZQQ==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.1.1.tgz", + "integrity": "sha512-LHrp84oEV6q1ZxPPyj4z+FdKyq1XAKYPtmGptrd+uwHbrF/Ns5+fy6gtSi7pS+uc0zk3JdO9w/tPK+8N1/7WUA==", "license": "MIT" }, "node_modules/@cspell/dict-rust": { @@ -471,9 +471,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "5.1.22", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.1.22.tgz", - "integrity": "sha512-ELi8wqyDAreDpo17Pu45AuKvcrhqPCkGeL+DMuSVxEimBwEqPB+KeQ89DkVap6QDJHl3LCth0pjv8uOgS1dtdQ==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.2.2.tgz", + "integrity": "sha512-0CaYd6TAsKtEoA7tNswm1iptEblTzEe3UG8beG2cpSTHk7afWIVMtJLgXDv0f/Li67Lf3Z1Jf3JeXR7GsJ2TRw==", "license": "MIT" }, "node_modules/@cspell/dict-sql": { @@ -519,52 +519,52 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.7.0.tgz", - "integrity": "sha512-Ws36IYvtS/8IN3x6K9dPLvTmaArodRJmzTn2Rkf2NaTnIYWhRuFzsP3SVVO59NN3fXswAEbmz5DSbVUe8bPZHg==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-10.0.0.tgz", + "integrity": "sha512-fMqu/5Ma1Q5ZCR/Par+Q4pvaTKmx5pKZzQmkwld2hNounVdk2OaIPM9MzpNn6I1mLk5J+wTnIZmfcWNAzNP9aQ==", "license": "MIT", "dependencies": { - "@cspell/url": "9.7.0", + "@cspell/url": "10.0.0", "import-meta-resolve": "^4.2.0" }, "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/@cspell/filetypes": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-9.7.0.tgz", - "integrity": "sha512-Ln9e/8wGOyTeL3DCCs6kwd18TSpTw3kxsANjTrzLDASrX4cNmAdvc9J5dcIuBHPaqOAnRQxuZbzUlpRh73Y24w==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-10.0.0.tgz", + "integrity": "sha512-UP57j9yrDtlCHpFxc/eGho1m8DP5olfu9KRWwd5fiqL9nMSE2rUJtPzQyvqmDwO5bVZt3B+fTVdo4gxuiqw25A==", "license": "MIT", "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/@cspell/rpc": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/@cspell/rpc/-/rpc-9.7.0.tgz", - "integrity": "sha512-VnZ4ABgQeoS4RwofcePkDP7L6tf3Kh5D7LQKoyRM4R6XtfSsYefym6XKaRl3saGtthH5YyjgNJ0Tgdjen4wAAw==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@cspell/rpc/-/rpc-10.0.0.tgz", + "integrity": "sha512-QrpOZMwz2pAjvl6Hky2PauYoMpLCASn3osjn7uKUbgFV70sahyj6tmx4rRgRX7vHu2WQLZev+YsuO4EujiBDOg==", "license": "MIT", "engines": { - "node": ">=20.18" + "node": ">=22.18.0" } }, "node_modules/@cspell/strong-weak-map": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-9.7.0.tgz", - "integrity": "sha512-5xbvDASjklrmy88O6gmGXgYhpByCXqOj5wIgyvwZe2l83T1bE+iOfGI4pGzZJ/mN+qTn1DNKq8BPBPtDgb7Q2Q==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-10.0.0.tgz", + "integrity": "sha512-JRsato0s2IjYdsng+AGL6oAqgZVQgih5aWKdmxs21H6EdhMaoFDmRE5kXm/RT5a6OMdtnzQM9DqeToqBChWIOQ==", "license": "MIT", "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/@cspell/url": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.7.0.tgz", - "integrity": "sha512-ZaaBr0pTvNxmyUbIn+nVPXPr383VqJzfUDMWicgTjJIeo2+T2hOq2kNpgpvTIrWtZrsZnSP8oXms1+sKTjcvkw==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-10.0.0.tgz", + "integrity": "sha512-q+0pHQ8DbqjemyaOn/mTtBRbCuKDqhnsVbZ6J9zkTsxPgMpccjy0s5oLXwomfrrxMRBH+UcbERwtUmE+SbnoIQ==", "license": "MIT", "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/ansi-regex": { @@ -585,15 +585,6 @@ "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", "license": "MIT" }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/chalk": { "version": "5.6.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", @@ -621,22 +612,6 @@ "url": "https://github.com/chalk/chalk-template?sponsor=1" } }, - "node_modules/clear-module": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/clear-module/-/clear-module-4.1.2.tgz", - "integrity": "sha512-LWAxzHqdHsAZlPlEyJ2Poz6AIs384mPeqLVCru2p0BrP9G/kVGuhNyZYClLO6cXlnuJjzC8xtsJIuMjKqLXoAw==", - "license": "MIT", - "dependencies": { - "parent-module": "^2.0.0", - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/commander": { "version": "14.0.3", "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", @@ -647,50 +622,43 @@ } }, "node_modules/comment-json": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.5.1.tgz", - "integrity": "sha512-taEtr3ozUmOB7it68Jll7s0Pwm+aoiHyXKrEC8SEodL4rNpdfDLqa7PfBlrgFoCNNdR8ImL+muti5IGvktJAAg==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.6.2.tgz", + "integrity": "sha512-R2rze/hDX30uul4NZoIZ76ImSJLFxn/1/ZxtKC1L77y2X1k+yYu1joKbAtMA2Fg3hZrTOiw0I5mwVMo0cf250w==", "license": "MIT", "dependencies": { "array-timsort": "^1.0.3", - "core-util-is": "^1.0.3", "esprima": "^4.0.1" }, "engines": { "node": ">= 6" } }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "license": "MIT" - }, "node_modules/cspell": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.7.0.tgz", - "integrity": "sha512-ftxOnkd+scAI7RZ1/ksgBZRr0ouC7QRKtPQhD/PbLTKwAM62sSvRhE1bFsuW3VKBn/GilWzTjkJ40WmnDqH5iQ==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-10.0.0.tgz", + "integrity": "sha512-R25gsSR1SLlcGyw48fwJwp0PjXrVdl7RDO/Dm5+s4DvC1uQSlyiUxsr/8ZtbyC/MPeUJFQN9B4luqLlSm0WelQ==", "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "9.7.0", - "@cspell/cspell-performance-monitor": "9.7.0", - "@cspell/cspell-pipe": "9.7.0", - "@cspell/cspell-types": "9.7.0", - "@cspell/cspell-worker": "9.7.0", - "@cspell/dynamic-import": "9.7.0", - "@cspell/url": "9.7.0", + "@cspell/cspell-json-reporter": "10.0.0", + "@cspell/cspell-performance-monitor": "10.0.0", + "@cspell/cspell-pipe": "10.0.0", + "@cspell/cspell-types": "10.0.0", + "@cspell/cspell-worker": "10.0.0", + "@cspell/dynamic-import": "10.0.0", + "@cspell/url": "10.0.0", "ansi-regex": "^6.2.2", "chalk": "^5.6.2", "chalk-template": "^1.1.2", "commander": "^14.0.3", - "cspell-config-lib": "9.7.0", - "cspell-dictionary": "9.7.0", - "cspell-gitignore": "9.7.0", - "cspell-glob": "9.7.0", - "cspell-io": "9.7.0", - "cspell-lib": "9.7.0", + "cspell-config-lib": "10.0.0", + "cspell-dictionary": "10.0.0", + "cspell-gitignore": "10.0.0", + "cspell-glob": "10.0.0", + "cspell-io": "10.0.0", + "cspell-lib": "10.0.0", "fast-json-stable-stringify": "^2.1.0", - "flatted": "^3.3.3", + "flatted": "^3.4.2", "semver": "^7.7.4", "tinyglobby": "^0.2.15" }, @@ -699,147 +667,146 @@ "cspell-esm": "bin.mjs" }, "engines": { - "node": ">=20.18" + "node": ">=22.18.0" }, "funding": { "url": "https://github.com/streetsidesoftware/cspell?sponsor=1" } }, "node_modules/cspell-config-lib": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-9.7.0.tgz", - "integrity": "sha512-pguh8A3+bSJ1OOrKCiQan8bvaaY125de76OEFz7q1Pq309lIcDrkoL/W4aYbso/NjrXaIw6OjkgPMGRBI/IgGg==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-10.0.0.tgz", + "integrity": "sha512-HWK7SRnJ3N/kOThw/uzmXmQYCzBxu58Jkq2hHyte1voDl118BeNFoaNRWMpYdHbBi3kCj8gaZu8wGtm+Zmdhxw==", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "9.7.0", - "comment-json": "^4.5.1", - "smol-toml": "^1.6.0", - "yaml": "^2.8.2" + "@cspell/cspell-types": "10.0.0", + "comment-json": "^4.6.2", + "smol-toml": "^1.6.1", + "yaml": "^2.8.3" }, "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/cspell-dictionary": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-9.7.0.tgz", - "integrity": "sha512-k/Wz0so32+0QEqQe21V9m4BNXM5ZN6lz3Ix/jLCbMxFIPl6wT711ftjOWIEMFhvUOP0TWXsbzcuE9mKtS5mTig==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-10.0.0.tgz", + "integrity": "sha512-KubSoEAJO+77KPSSWjoLCz0+MIWVNq3joGTSyxucAZrBSJD64Y1O4BHHr1aj6XHIZwXhWWNScQlrQR3OcIulng==", "license": "MIT", "dependencies": { - "@cspell/cspell-performance-monitor": "9.7.0", - "@cspell/cspell-pipe": "9.7.0", - "@cspell/cspell-types": "9.7.0", - "cspell-trie-lib": "9.7.0", + "@cspell/cspell-performance-monitor": "10.0.0", + "@cspell/cspell-pipe": "10.0.0", + "@cspell/cspell-types": "10.0.0", + "cspell-trie-lib": "10.0.0", "fast-equals": "^6.0.0" }, "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/cspell-gitignore": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-9.7.0.tgz", - "integrity": "sha512-MtoYuH4ah4K6RrmaF834npMcRsTKw0658mC6yvmBacUQOmwB/olqyuxF3fxtbb55HDb7cXDQ35t1XuwwGEQeZw==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-10.0.0.tgz", + "integrity": "sha512-55XLH9Y52eR7QgyV28Uaw8V9cN1YZ3PQIyrN9YBR4ndQNBKJxO9+jX1nwSspwnccCZiE/N+GGxFzRBb75JDSCw==", "license": "MIT", "dependencies": { - "@cspell/url": "9.7.0", - "cspell-glob": "9.7.0", - "cspell-io": "9.7.0" + "@cspell/url": "10.0.0", + "cspell-glob": "10.0.0", + "cspell-io": "10.0.0" }, "bin": { "cspell-gitignore": "bin.mjs" }, "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/cspell-glob": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-9.7.0.tgz", - "integrity": "sha512-LUeAoEsoCJ+7E3TnUmWBscpVQOmdwBejMlFn0JkXy6LQzxrybxXBKf65RSdIv1o5QtrhQIMa358xXYQG0sv/tA==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-10.0.0.tgz", + "integrity": "sha512-bXS35fMcA9X7GEkfnWBfoPd/vTnxxfXW+YHt6tWxu5fejfs00qUbjWp1oLC9FxRaXWxIkfsYp2mi1k1jYl4RVw==", "license": "MIT", "dependencies": { - "@cspell/url": "9.7.0", - "picomatch": "^4.0.3" + "@cspell/url": "10.0.0", + "picomatch": "^4.0.4" }, "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/cspell-grammar": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-9.7.0.tgz", - "integrity": "sha512-oEYME+7MJztfVY1C06aGcJgEYyqBS/v/ETkQGPzf/c6ObSAPRcUbVtsXZgnR72Gru9aBckc70xJcD6bELdoWCA==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-10.0.0.tgz", + "integrity": "sha512-49udtYzkcCYEIDJbFOb4IwiAJebOYZnYvG6o6Ep19Tq0Xwjk7i4vxUprNiFNDCWFbcbJRPE9cpwQUVwp5WFGLw==", "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "9.7.0", - "@cspell/cspell-types": "9.7.0" + "@cspell/cspell-pipe": "10.0.0", + "@cspell/cspell-types": "10.0.0" }, "bin": { "cspell-grammar": "bin.mjs" }, "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/cspell-io": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-9.7.0.tgz", - "integrity": "sha512-V7x0JHAUCcJPRCH8c0MQkkaKmZD2yotxVyrNEx2SZTpvnKrYscLEnUUTWnGJIIf9znzISqw116PLnYu2c+zd6Q==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-10.0.0.tgz", + "integrity": "sha512-NQCAUhx9DwKApxPuFl7EK1K1XSaQEAPld45yjjwv93xF8rJkEGkgzOwjbqafwAD20eKYv1a7oj/9EC0S5jETSw==", "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "9.7.0", - "@cspell/url": "9.7.0" + "@cspell/cspell-service-bus": "10.0.0", + "@cspell/url": "10.0.0" }, "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/cspell-lib": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-9.7.0.tgz", - "integrity": "sha512-aTx/aLRpnuY1RJnYAu+A8PXfm1oIUdvAQ4W9E66bTgp1LWI+2G2++UtaPxRIgI0olxE9vcXqUnKpjOpO+5W9bQ==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-10.0.0.tgz", + "integrity": "sha512-PowW6JEjuv/F2aFEirZvBxpzHdchOnpsUJbeIcFcai0++taLTbHQObROBEBf7e0S8DnHpVD5TZkqrTME5e44wg==", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "9.7.0", - "@cspell/cspell-performance-monitor": "9.7.0", - "@cspell/cspell-pipe": "9.7.0", - "@cspell/cspell-resolver": "9.7.0", - "@cspell/cspell-types": "9.7.0", - "@cspell/dynamic-import": "9.7.0", - "@cspell/filetypes": "9.7.0", - "@cspell/rpc": "9.7.0", - "@cspell/strong-weak-map": "9.7.0", - "@cspell/url": "9.7.0", - "clear-module": "^4.1.2", - "cspell-config-lib": "9.7.0", - "cspell-dictionary": "9.7.0", - "cspell-glob": "9.7.0", - "cspell-grammar": "9.7.0", - "cspell-io": "9.7.0", - "cspell-trie-lib": "9.7.0", + "@cspell/cspell-bundled-dicts": "10.0.0", + "@cspell/cspell-performance-monitor": "10.0.0", + "@cspell/cspell-pipe": "10.0.0", + "@cspell/cspell-resolver": "10.0.0", + "@cspell/cspell-types": "10.0.0", + "@cspell/dynamic-import": "10.0.0", + "@cspell/filetypes": "10.0.0", + "@cspell/rpc": "10.0.0", + "@cspell/strong-weak-map": "10.0.0", + "@cspell/url": "10.0.0", + "cspell-config-lib": "10.0.0", + "cspell-dictionary": "10.0.0", + "cspell-glob": "10.0.0", + "cspell-grammar": "10.0.0", + "cspell-io": "10.0.0", + "cspell-trie-lib": "10.0.0", "env-paths": "^4.0.0", "gensequence": "^8.0.8", - "import-fresh": "^3.3.1", + "import-fresh": "^4.0.0", "resolve-from": "^5.0.0", "vscode-languageserver-textdocument": "^1.0.12", "vscode-uri": "^3.1.0", "xdg-basedir": "^5.1.0" }, "engines": { - "node": ">=20" + "node": ">=22.18.0" } }, "node_modules/cspell-trie-lib": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-9.7.0.tgz", - "integrity": "sha512-a2YqmcraL3g6I/4gY7SYWEZfP73oLluUtxO7wxompk/kOG2K1FUXyQfZXaaR7HxVv10axT1+NrjhOmXpfbI6LA==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-10.0.0.tgz", + "integrity": "sha512-R8qrMx10E/bm3Lecslwxn9XYo5NzSRK1rtandEX5n9UmEYHoBXjZELkg5+TOnV8VgrVaJSK57XtcGrbKp/4kSg==", "license": "MIT", "engines": { - "node": ">=20" + "node": ">=22.18.0" }, "peerDependencies": { - "@cspell/cspell-types": "9.7.0" + "@cspell/cspell-types": "10.0.0" } }, "node_modules/env-paths": { @@ -933,42 +900,17 @@ } }, "node_modules/import-fresh": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", - "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-4.0.0.tgz", + "integrity": "sha512-Fpi660c7VPDM3fPKYovStd9IP1CPOikf6v/dGxJJMmHPcwYQIMJ4W7kO1avBYEpMqkCh+Dx3Ln6H7VYqgztLjw==", "license": "MIT", - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, "engines": { - "node": ">=6" + "node": ">=22.15" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/import-fresh/node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "license": "MIT", - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/import-fresh/node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/import-meta-resolve": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz", @@ -1000,18 +942,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/parent-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-2.0.0.tgz", - "integrity": "sha512-uo0Z9JJeWzv8BG+tRcapBKNJ0dro9cLyczGzulS6EfeyAdeC9sbojtW6XwvYxJkEne9En+J2XEl4zyglVeIwFg==", - "license": "MIT", - "dependencies": { - "callsites": "^3.1.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/picomatch": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", diff --git a/package.json b/package.json index aa3040c15d..a158a38bf2 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,6 @@ "cspell": "cspell --config ./cSpell.json ./docs/**/*.md --no-progress --no-summary" }, "dependencies": { - "cspell": "^9.7.0" + "cspell": "^10.0.0" } } From ca64123edf2656453d9e04481d7dd17de27b12ec Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 12 Apr 2026 14:55:36 +0200 Subject: [PATCH 809/845] Fail with descriptive errors for selection rules on value-semantic types (#3187) --- Src/FluentAssertions/Common/MemberPath.cs | 6 +- .../CollectionMemberSelectionRuleDecorator.cs | 15 +- .../ExcludeMemberByPathSelectionRule.cs | 11 +- .../Selection/IPathBasedSelectionRule.cs | 16 ++ .../IncludeMemberByPathSelectionRule.cs | 15 +- .../SelectMemberByPathSelectionRule.cs | 64 +++++- .../Steps/ValueTypeEquivalencyStep.cs | 169 ++++++++++++-- .../SelectionRulesSpecs.Excluding.cs | 208 ++++++++++++++++++ .../SelectionRulesSpecs.Including.cs | 18 ++ docs/_pages/releases.md | 1 + 10 files changed, 471 insertions(+), 52 deletions(-) create mode 100644 Src/FluentAssertions/Equivalency/Selection/IPathBasedSelectionRule.cs diff --git a/Src/FluentAssertions/Common/MemberPath.cs b/Src/FluentAssertions/Common/MemberPath.cs index bbe8fb29df..7121d92260 100644 --- a/Src/FluentAssertions/Common/MemberPath.cs +++ b/Src/FluentAssertions/Common/MemberPath.cs @@ -70,7 +70,11 @@ public bool IsSameAs(MemberPath candidate) return false; } - private bool IsParentOf(MemberPath candidate) + /// + /// Determines whether the current path is the prefix of + /// (i.e., the current path "owns" the candidate), treating numeric indices and wildcards as interchangeable. + /// + public bool IsParentOf(MemberPath candidate) { string[] candidateSegments = candidate.Segments; diff --git a/Src/FluentAssertions/Equivalency/Selection/CollectionMemberSelectionRuleDecorator.cs b/Src/FluentAssertions/Equivalency/Selection/CollectionMemberSelectionRuleDecorator.cs index cfcdb8d5da..8fab431258 100644 --- a/Src/FluentAssertions/Equivalency/Selection/CollectionMemberSelectionRuleDecorator.cs +++ b/Src/FluentAssertions/Equivalency/Selection/CollectionMemberSelectionRuleDecorator.cs @@ -2,15 +2,8 @@ namespace FluentAssertions.Equivalency.Selection; -internal class CollectionMemberSelectionRuleDecorator : IMemberSelectionRule +internal class CollectionMemberSelectionRuleDecorator(IMemberSelectionRule selectionRule) : IPathBasedSelectionRule { - private readonly IMemberSelectionRule selectionRule; - - public CollectionMemberSelectionRuleDecorator(IMemberSelectionRule selectionRule) - { - this.selectionRule = selectionRule; - } - public bool IncludesMembers => selectionRule.IncludesMembers; public IEnumerable SelectMembers(INode currentNode, IEnumerable selectedMembers, @@ -19,6 +12,12 @@ public IEnumerable SelectMembers(INode currentNode, IEnumerable /// Selection rule that removes a particular property from the structural comparison. /// -internal class ExcludeMemberByPathSelectionRule : SelectMemberByPathSelectionRule +internal class ExcludeMemberByPathSelectionRule(MemberPath pathToExclude) : SelectMemberByPathSelectionRule { - private MemberPath memberToExclude; - - public ExcludeMemberByPathSelectionRule(MemberPath pathToExclude) - { - memberToExclude = pathToExclude; - } + private MemberPath memberToExclude = pathToExclude; protected override void AddOrRemoveMembersFrom(List selectedMembers, INode parent, string parentPath, MemberSelectionContext context) @@ -27,6 +22,8 @@ public void AppendPath(MemberPath nextPath) memberToExclude = memberToExclude.AsParentCollectionOf(nextPath); } + protected override MemberPath MemberPath => memberToExclude; + public MemberPath CurrentPath => memberToExclude; public override string ToString() diff --git a/Src/FluentAssertions/Equivalency/Selection/IPathBasedSelectionRule.cs b/Src/FluentAssertions/Equivalency/Selection/IPathBasedSelectionRule.cs new file mode 100644 index 0000000000..f7ded83c08 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Selection/IPathBasedSelectionRule.cs @@ -0,0 +1,16 @@ +namespace FluentAssertions.Equivalency.Selection; + +/// +/// Represents a selection rule whose effect is determined by a configured member path. +/// This allows callers to ask whether the rule targets any members within the subtree rooted at +/// a given , even when the rule is wrapped by decorators such as the +/// collection-member options decorator. +/// +internal interface IPathBasedSelectionRule : IMemberSelectionRule +{ + /// + /// Returns true when this rule targets at least one member of + /// or one of its descendants. + /// + bool SelectsMembersOf(INode currentNode); +} diff --git a/Src/FluentAssertions/Equivalency/Selection/IncludeMemberByPathSelectionRule.cs b/Src/FluentAssertions/Equivalency/Selection/IncludeMemberByPathSelectionRule.cs index 4ed440b5a5..79775410b3 100644 --- a/Src/FluentAssertions/Equivalency/Selection/IncludeMemberByPathSelectionRule.cs +++ b/Src/FluentAssertions/Equivalency/Selection/IncludeMemberByPathSelectionRule.cs @@ -8,17 +8,12 @@ namespace FluentAssertions.Equivalency.Selection; /// /// Selection rule that includes a particular property in the structural comparison. /// -internal class IncludeMemberByPathSelectionRule : SelectMemberByPathSelectionRule +internal class IncludeMemberByPathSelectionRule(MemberPath pathToInclude) : SelectMemberByPathSelectionRule { - private readonly MemberPath memberToInclude; - - public IncludeMemberByPathSelectionRule(MemberPath pathToInclude) - { - memberToInclude = pathToInclude; - } - public override bool IncludesMembers => true; + protected override MemberPath MemberPath => pathToInclude; + protected override void AddOrRemoveMembersFrom(List selectedMembers, INode parent, string parentPath, MemberSelectionContext context) { @@ -26,7 +21,7 @@ protected override void AddOrRemoveMembersFrom(List selectedMembers, IN { var memberPath = new MemberPath(context.Type, memberInfo.DeclaringType, parentPath.Combine(memberInfo.Name)); - if (memberToInclude.IsSameAs(memberPath) || memberToInclude.IsParentOrChildOf(memberPath)) + if (pathToInclude.IsSameAs(memberPath) || pathToInclude.IsParentOrChildOf(memberPath)) { selectedMembers.Add(MemberFactory.Create(memberInfo, parent)); } @@ -35,6 +30,6 @@ protected override void AddOrRemoveMembersFrom(List selectedMembers, IN public override string ToString() { - return "Include member root." + memberToInclude; + return "Include member root." + pathToInclude; } } diff --git a/Src/FluentAssertions/Equivalency/Selection/SelectMemberByPathSelectionRule.cs b/Src/FluentAssertions/Equivalency/Selection/SelectMemberByPathSelectionRule.cs index ac37b31834..2f0fae01e5 100644 --- a/Src/FluentAssertions/Equivalency/Selection/SelectMemberByPathSelectionRule.cs +++ b/Src/FluentAssertions/Equivalency/Selection/SelectMemberByPathSelectionRule.cs @@ -1,36 +1,82 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; +using FluentAssertions.Common; namespace FluentAssertions.Equivalency.Selection; -internal abstract class SelectMemberByPathSelectionRule : IMemberSelectionRule +internal abstract class SelectMemberByPathSelectionRule : IPathBasedSelectionRule { + private static readonly Regex LeadingCollectionIndexRegex = new(@"^\[[0-9]+]\.?"); + public virtual bool IncludesMembers => false; + protected abstract MemberPath MemberPath { get; } + public IEnumerable SelectMembers(INode currentNode, IEnumerable selectedMembers, MemberSelectionContext context) { - var currentPath = RemoveRootIndexQualifier(currentNode.Expectation.PathAndName); var members = selectedMembers.ToList(); - AddOrRemoveMembersFrom(members, currentNode, currentPath, context); + AddOrRemoveMembersFrom(members, currentNode, GetPathRelativeToSelectionRoot(currentNode), context); return members; } + /// + /// Returns true if this rule would select members within the subtree rooted at + /// , meaning the rule path targets any member at or below the current node. + /// + public bool SelectsMembersOf(INode currentNode) + { + if (currentNode.IsRoot) + { + return !MemberPath.ToString().IsNullOrEmpty(); + } + + string currentPath = GetPathRelativeToSelectionRoot(currentNode); + + if (string.IsNullOrEmpty(currentPath)) + { + return !MemberPath.ToString().IsNullOrEmpty(); + } + + // Compare normalized path segments rather than raw strings so collection rules like "Items[].Name" + // still match the concrete node path "Items[0].Name", and so paths built through + // MemberPath.AsParentCollectionOf are interpreted consistently. + return new MemberPath(currentPath).IsParentOf(MemberPath); + } + protected abstract void AddOrRemoveMembersFrom(List selectedMembers, INode parent, string parentPath, MemberSelectionContext context); - private static string RemoveRootIndexQualifier(string path) + /// + /// Returns the path used for member-selection matching at . + /// For items inside a root collection, Fluent Assertions exposes paths such as [0].Name, but + /// selection rules are expressed relative to the collection item type (for example Name). + /// This method removes that root-item index so both sides use the same coordinate system. + /// + private static string GetPathRelativeToSelectionRoot(INode currentNode) { - Match match = new Regex(@"^\[[0-9]+]").Match(path); - - if (match.Success) + if (currentNode.IsRoot) { - path = path.Substring(match.Length); + return string.Empty; } - return path; + string expectationPath = currentNode.Expectation.PathAndName; + return RemoveLeadingCollectionIndex(expectationPath); + } + + /// + /// Removes only the leading root-collection index from , such as turning + /// [0] into an empty path and [0].Name into Name. + /// Nested collection indices are intentionally left in place; they are handled later by + /// comparison, which treats [] and concrete indices as equivalent. + /// + private static string RemoveLeadingCollectionIndex(string path) + { + Match match = LeadingCollectionIndexRegex.Match(path); + return match.Success ? path.Substring(match.Length) : path; } } diff --git a/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs index 4c5bb459de..1ddaa1228a 100644 --- a/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/ValueTypeEquivalencyStep.cs @@ -1,4 +1,7 @@ using System; +using System.Collections.Generic; +using System.Linq; +using FluentAssertions.Equivalency.Selection; using FluentAssertions.Execution; namespace FluentAssertions.Equivalency.Steps; @@ -12,32 +15,164 @@ public class ValueTypeEquivalencyStep : IEquivalencyStep public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationContext context, IValidateChildNodeEquivalency valueChildNodes) { - Type expectationType = comparands.GetExpectedType(context.Options); - EqualityStrategy strategy = context.Options.GetEqualityStrategy(expectationType); + var options = context.Options; + Type expectationType = comparands.GetExpectedType(options); + EqualityStrategy strategy = options.GetEqualityStrategy(expectationType); - bool canHandle = strategy is EqualityStrategy.Equals or EqualityStrategy.ForceEquals; + if (strategy is not (EqualityStrategy.Equals or EqualityStrategy.ForceEquals)) + { + return EquivalencyResult.ContinueWithNext; + } - if (canHandle) + if (ReportConflictIfAny(context, comparands, options, expectationType, strategy)) { - context.Tracer.WriteLine(member => - { - string strategyName = strategy == EqualityStrategy.Equals - ? $"{expectationType} overrides Equals" - : "we are forced to use Equals"; + return EquivalencyResult.EquivalencyProven; + } + + ApplyValueSemantics(comparands, context, expectationType, strategy); + return EquivalencyResult.EquivalencyProven; + } - return $"Treating {member.Expectation.Description} as a value type because {strategyName}."; - }); + /// + /// Checks for any selection rule that targets members of the current node, which would be silently + /// ignored under value-semantic comparison. Reports the conflict and returns true if one is found. + /// + private static bool ReportConflictIfAny( + IEquivalencyValidationContext context, + Comparands comparands, + IEquivalencyOptions options, + Type expectationType, + EqualityStrategy strategy) + { + // Path-based rules can be checked cheaply by comparing path strings (also handles deep paths like o.Child.Text). + IMemberSelectionRule conflictingRule = options.SelectionRules + .OfType() + .FirstOrDefault(rule => rule.SelectsMembersOf(context.CurrentNode)); - AssertionChain.GetOrCreate() - .For(context) - .ReuseOnce(); + // Non-path rules (based on predicates) require evaluating them against the actual member list + conflictingRule ??= FindConflictingNonPathRule(context.CurrentNode, comparands, options); - comparands.Subject.Should().Be(comparands.Expectation, context.Reason.FormattedMessage, context.Reason.Arguments); + if (conflictingRule is not null) + { + ReportConflict(context, expectationType, conflictingRule, strategy); + } - return EquivalencyResult.EquivalencyProven; + return conflictingRule is not null; + } + + /// + /// Finds the first non-path selection rule that would modify the member list of , + /// indicating it would be silently ignored due to value-semantic comparison. + /// + private static IMemberSelectionRule FindConflictingNonPathRule( + INode currentNode, Comparands comparands, IEquivalencyOptions options) + { + var selectionContext = new MemberSelectionContext(comparands.CompileTimeType, comparands.RuntimeType, options); + IList allMembers = GetAllMembers(currentNode, selectionContext); + + // If the type has no accessible members, no selection rule can meaningfully conflict. + if (allMembers.Count == 0) + { + return null; } - return EquivalencyResult.ContinueWithNext; + return options.SelectionRules + .Where(rule => !IsInfrastructureRule(rule) && rule is not IPathBasedSelectionRule) + .FirstOrDefault(rule => RuleAffectsMembers(rule, allMembers, GetFilteredMembers(rule, currentNode, allMembers, selectionContext))); + } + + /// + /// Applies in isolation to determine whether it modifies the member list. + /// Inclusion rules are run from an empty starting set; exclusion rules are run on the full member list. + /// + private static IList GetFilteredMembers( + IMemberSelectionRule rule, INode currentNode, IList allMembers, MemberSelectionContext context) + { + IEnumerable seed = rule.IncludesMembers ? [] : allMembers; + return rule.SelectMembers(currentNode, seed, context).ToList(); + } + + /// Gets all properties and fields of the current node's type, respecting the configured visibility. + private static IList GetAllMembers(INode currentNode, MemberSelectionContext context) + { + IEnumerable members = new AllPropertiesSelectionRule().SelectMembers(currentNode, [], context); + return new AllFieldsSelectionRule().SelectMembers(currentNode, members, context).ToList(); + } + + /// + /// Returns true if actually affects the member set of the current value type. + /// For inclusion rules, a conflict exists only when the rule selects at least one member of this type, + /// meaning the user intended to compare this value type member-by-member. + /// For exclusion rules, a conflict exists when the rule removes at least one member from the full set. + /// + private static bool RuleAffectsMembers(IMemberSelectionRule rule, IList allMembers, IList filteredMembers) => + rule.IncludesMembers + ? filteredMembers.Count > 0 + : MemberSetChanged(allMembers, filteredMembers); + + /// Returns true if represents a different set of members than . + private static bool MemberSetChanged(IList before, IList after) => + before.Count != after.Count || before.Except(after).Any(); + + /// Returns true for rules that are part of the default selection pipeline, not user-configured. + private static bool IsInfrastructureRule(IMemberSelectionRule rule) => + rule is AllPropertiesSelectionRule or AllFieldsSelectionRule or ExcludeNonBrowsableMembersRule; + + /// Reports an assertion failure for a selection rule that conflicts with value semantics. + private static void ReportConflict( + IEquivalencyValidationContext context, + Type expectationType, + IMemberSelectionRule conflictingRule, + EqualityStrategy strategy) + { + Reason reason = context.Reason; + bool isGeneric = expectationType.IsGenericType; + + string cause = strategy == EqualityStrategy.ForceEquals + ? $"{expectationType} is compared by value (because ComparingByValue was configured), " + : $"{expectationType} is compared by value (because it overrides Equals), "; + + string suggestion = strategy == EqualityStrategy.ForceEquals + ? "Either remove the ComparingByValue configuration, " + : isGeneric + ? "Either call the ComparingByMembers(Type) overload to force member-wise comparison, " + : $"Either call ComparingByMembers<{expectationType.Name}>() to force member-wise comparison, "; + + string message = + cause + + $"so the {conflictingRule} selection rule does not apply. " + + suggestion + + "or remove the selection rule." + + reason.FormattedMessage; + + AssertionChain.GetOrCreate().For(context).FailWith(message, reason.Arguments); + } + + /// + /// Traces the value-semantic comparison strategy and performs the equality assertion. + /// + private static void ApplyValueSemantics( + Comparands comparands, + IEquivalencyValidationContext context, + Type expectationType, + EqualityStrategy strategy) + { + context.Tracer.WriteLine(member => + { + string strategyName = strategy == EqualityStrategy.Equals + ? $"{expectationType} overrides Equals" + : "we are forced to use Equals"; + + return $"Treating {member.Expectation.Description} as a value type because {strategyName}."; + }); + + var reason = context.Reason; + + AssertionChain.GetOrCreate() + .For(context) + .ReuseOnce(); + + comparands.Subject.Should().Be(comparands.Expectation, reason.FormattedMessage, reason.Arguments); } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs index 44b8686a82..21a676ba3b 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs @@ -1259,5 +1259,213 @@ public void Cannot_provide_null_as_a_property_name() act.Should().Throw() .WithMessage("*Member names cannot be null*"); } + + [Fact] + public void Excluding_a_member_by_path_on_a_type_with_value_semantics_fails_with_a_descriptive_error() + { + // Arrange + var actual = new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "x" }; + var expected = new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "y" }; + + // Act + Action act = () => actual.Should().BeEquivalentTo(expected, + opt => opt.Excluding(o => o.NestedProperty)); + + // Assert + act.Should().Throw() + .WithMessage( + "*ClassWithValueSemanticsOnSingleProperty*compared by value*overrides Equals*" + + "*ComparingByMembers*"); + } + + [Fact] + public void Excluding_a_member_by_path_when_forcing_value_semantics_explicitly_fails_with_a_descriptive_error() + { + // Arrange + var actual = new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "x" }; + var expected = new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "y" }; + + // Act + Action act = () => actual.Should().BeEquivalentTo(expected, + opt => opt.Excluding(o => o.NestedProperty).ComparingByValue()); + + // Assert + act.Should().Throw() + .WithMessage( + "*ClassWithValueSemanticsOnSingleProperty*compared by value*ComparingByValue was configured*" + + "*remove the ComparingByValue configuration*"); + } + + [Fact] + public void Including_a_member_by_path_when_forcing_value_semantics_explicitly_fails_with_a_descriptive_error() + { + // Arrange + var actual = new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "x" }; + var expected = new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "y" }; + + // Act + Action act = () => actual.Should().BeEquivalentTo(expected, + opt => opt.Including(o => o.Key).ComparingByValue()); + + // Assert + act.Should().Throw() + .WithMessage( + "*ClassWithValueSemanticsOnSingleProperty*compared by value*ComparingByValue was configured*" + + "*remove the ComparingByValue configuration*"); + } + + [Fact] + public void Excluding_a_member_by_predicate_when_forcing_value_semantics_explicitly_fails_with_a_descriptive_error() + { + // Arrange + var actual = new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "x" }; + var expected = new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "y" }; + + // Act + Action act = () => actual.Should().BeEquivalentTo(expected, + opt => opt + .Excluding(m => m.Name == nameof(ClassWithValueSemanticsOnSingleProperty.NestedProperty)) + .ComparingByValue()); + + // Assert + act.Should().Throw() + .WithMessage( + "*ClassWithValueSemanticsOnSingleProperty*compared by value*ComparingByValue was configured*" + + "*remove the ComparingByValue configuration*"); + } + + [Fact] + public void Excluding_a_member_by_path_and_then_forcing_member_comparison_does_not_fail() + { + // Arrange + var actual = new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "x" }; + var expected = new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "y" }; + + // Act / Assert + actual.Should().BeEquivalentTo(expected, opt => opt + .ComparingByMembers() + .Excluding(o => o.NestedProperty)); + } + + [Fact] + public void Excluding_a_nested_member_by_path_on_a_type_with_value_semantics_fails_with_a_descriptive_error() + { + // Arrange + var actual = new ClassWithValueSemanticsAndNestedObject { Key = "same", Child = new NestedObjectWithProperty { Text = "x" } }; + var expected = new ClassWithValueSemanticsAndNestedObject { Key = "same", Child = new NestedObjectWithProperty { Text = "y" } }; + + // Act + Action act = () => actual.Should().BeEquivalentTo(expected, + opt => opt.Excluding(o => o.Child.Text)); + + // Assert - multi-segment path at root should also be detected as conflicting + act.Should().Throw() + .WithMessage( + "*ClassWithValueSemanticsAndNestedObject*compared by value*overrides Equals*" + + "*ComparingByMembers*"); + } + + [Fact] + public void Excluding_a_member_by_predicate_on_a_type_with_value_semantics_fails_with_a_descriptive_error() + { + // Arrange + var actual = new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "x" }; + var expected = new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "y" }; + + // Act + Action act = () => actual.Should().BeEquivalentTo(expected, + opt => opt.Excluding(m => m.Name == nameof(ClassWithValueSemanticsOnSingleProperty.NestedProperty))); + + // Assert + act.Should().Throw() + .WithMessage( + "*ClassWithValueSemanticsOnSingleProperty*compared by value*overrides Equals*" + + "*ComparingByMembers*"); + } + + [Fact] + public void Including_members_by_predicate_on_a_type_with_value_semantics_fails_with_a_descriptive_error() + { + // Arrange + var actual = new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "x" }; + var expected = new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "y" }; + + // Act + Action act = () => actual.Should().BeEquivalentTo(expected, + opt => opt.Including(m => m.Name == nameof(ClassWithValueSemanticsOnSingleProperty.Key))); + + // Assert + act.Should().Throw() + .WithMessage( + "*ClassWithValueSemanticsOnSingleProperty*compared by value*overrides Equals*" + + "*ComparingByMembers*"); + } + + [Fact] + public void Excluding_a_member_of_a_collection_element_with_value_semantics_via_For_and_Exclude_fails_with_a_descriptive_error() + { + // Arrange + var actual = new ClassWithCollectionOfValueSemantics + { + Items = [new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "x" }] + }; + + var expected = new ClassWithCollectionOfValueSemantics + { + Items = [new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "y" }] + }; + + // Act + // .For(o => o.Items).Exclude(c => c.NestedProperty) creates path "Items[].NestedProperty" (wildcard), + // which should be detected as conflicting when processing the value-semantic item at Items[0]. + Action act = () => actual.Should().BeEquivalentTo(expected, + opt => opt.For(o => o.Items).Exclude(c => c.NestedProperty)); + + // Assert + act.Should().Throw() + .WithMessage( + "*ClassWithValueSemanticsOnSingleProperty*compared by value*overrides Equals*"); + } + } +} + +public class ClassWithCollectionOfValueSemantics +{ + public List Items { get; set; } +} + +public class ClassWithValueSemanticsAndNestedObject +{ + public string Key { get; set; } + + public NestedObjectWithProperty Child { get; set; } + + protected bool Equals(ClassWithValueSemanticsAndNestedObject other) => Key == other.Key; + + public override bool Equals(object obj) + { + if (obj is null) + { + return false; + } + + if (ReferenceEquals(this, obj)) + { + return true; + } + + if (obj.GetType() != GetType()) + { + return false; + } + + return Equals((ClassWithValueSemanticsAndNestedObject)obj); } + + public override int GetHashCode() => Key?.GetHashCode() ?? 0; +} + +public class NestedObjectWithProperty +{ + public string Text { get; set; } } diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs index c43e529ec3..eea424bc19 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Including.cs @@ -506,5 +506,23 @@ public void An_anonymous_object_in_combination_with_exclude_selects_nested_field .Match("*Expected*subject.NestedField.FieldB*").And .NotMatch("*Expected*FieldC*FieldD*FieldE*"); } + + [Fact] + public void Including_a_member_by_path_on_a_type_with_value_semantics_fails_with_a_descriptive_error() + { + // Arrange + var actual = new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "x" }; + var expected = new ClassWithValueSemanticsOnSingleProperty { Key = "same", NestedProperty = "y" }; + + // Act + Action act = () => actual.Should().BeEquivalentTo(expected, + opt => opt.Including(o => o.Key)); + + // Assert + act.Should().Throw() + .WithMessage( + "*ClassWithValueSemanticsOnSingleProperty*compared by value*overrides Equals*" + + "*ComparingByMembers*"); + } } } diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index f041c2a8c7..23c61839c2 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -25,6 +25,7 @@ sidebar: ### Fixes * Fixed a formatting exception when comparing strings containing braces - [#3151](https://github.com/fluentassertions/fluentassertions/pull/3151) +* Path-based `Excluding()` and `Including()` rules on types that use value semantics (i.e. override `Equals`) now fail with a descriptive error instead of being silently ignored - [#3187](https://github.com/fluentassertions/fluentassertions/pull/3187) ## 8.8.0 From faedd12c82f80502e81df2fcf46ac8290dc6697e Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Wed, 8 Apr 2026 21:44:16 +0200 Subject: [PATCH 810/845] Replace permutation search with greedy algorithm for large unordered collections Replace the O(n! * n) permutation search in FindClosestMismatches with a two-strategy approach: - For n <= 8 items remaining, keep the exact permutation search (globally optimal; factorial(8) = 40,320, well within cost). - For n > 8, use a greedy O(n^2 log n) assignment that sorts all n^2 (expectation, subject) pairs by failure count and picks the closest unassigned pair first. Ties are broken by expectation index then subject index to preserve deterministic, natural-order error messages. Also extract ReferentialComparer to its own file and bump Reflectify to 1.9.0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../LooselyOrderedEquivalencyStrategy.cs | 151 ++++++++++++------ .../Equivalency/Steps/ReferentialComparer.cs | 28 ++++ Src/FluentAssertions/FluentAssertions.csproj | 2 +- Tests/Benchmarks/Program.cs | 2 +- 4 files changed, 134 insertions(+), 49 deletions(-) create mode 100644 Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs diff --git a/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs b/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs index 0f1512d039..58a16f2389 100644 --- a/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs +++ b/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; -using System.Runtime.CompilerServices; using FluentAssertions.Common; using FluentAssertions.Equivalency.Tracing; using FluentAssertions.Execution; @@ -18,6 +17,7 @@ internal class LooselyOrderedEquivalencyStrategy( private const int MaximumFailuresToReport = 10; private readonly Tracer tracer = context.Tracer; + private Dictionary<(object Subject, object Expectation, int ExpectationIndex), string[]> failuresCache = new(); public void FindAndRemoveMatches(List subjects, List expectations) @@ -67,7 +67,6 @@ private bool StrictlyMatchAgainst(List remainingSubjects, TExpectation e $"Comparing subject at {member.Subject}[{index}] with the expectation at {member.Expectation}[{expectationIndex}]"); string[] failures = TryToMatch(expectation, subject, expectationIndex); - if (failures.Length == 0) { tracer.WriteLine(_ => "It's a match"); @@ -137,48 +136,130 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, List remainingSubjects, IndexedItemCollection expectationsWithIndexes, Func getFailures) { - var bestScore = int.MaxValue; - List<(IndexedItem ExpectationWithIndex, object, string[] Failures)> bestSet = null; + // For small collections, use exact permutation search to find the globally optimal assignment. + // factorial(8) = 40,320 which is well within reason. + const int maxSizeForExactSearch = 8; - const int maxPermutations = 200_000; - int seen = 0; + return remainingSubjects.Count <= maxSizeForExactSearch ? + FindClosestMismatchesByPermutation(remainingSubjects, expectationsWithIndexes, getFailures) : + FindClosestMismatchesByGreedyAssignment(remainingSubjects, expectationsWithIndexes, getFailures); + } + + /// + /// Finds the best assignment by exhaustively trying all permutations. Only suitable for small collections. + /// + private static IReadOnlyList<(IndexedItem Expectation, object Actual, string[] Failures)> FindClosestMismatchesByPermutation( + List remainingSubjects, IndexedItemCollection expectationsWithIndexes, + Func getFailures) + { + var bestScore = int.MaxValue; + IReadOnlyList bestAssignment = null; foreach (IReadOnlyList assignment in remainingSubjects.Permute()) { - if (++seen > maxPermutations) - { - break; - } - int score = 0; - var currentSet = new List<(IndexedItem ExpectationWithIndex, object, string[] Failures)>(); + bool tooHigh = false; for (int index = 0; index < expectationsWithIndexes.Count && index < assignment.Count; index++) { IndexedItem expectationWithIndex = expectationsWithIndexes[index]; - - string[] failures = getFailures(expectationWithIndex.Item, assignment[index], expectationWithIndex.Index); - - int distance = failures.Length; - score += distance; + score += getFailures(expectationWithIndex.Item, assignment[index], expectationWithIndex.Index).Length; if (score >= bestScore) { - // No need to continue as we already have a better matching set + tooHigh = true; break; } - - currentSet.Add((expectationWithIndex, assignment[index], failures)); } - if (score < bestScore) + if (!tooHigh && score < bestScore) { bestScore = score; - bestSet = currentSet; + bestAssignment = assignment; + } + } + + if (bestAssignment is null) + { + return Array.Empty<(IndexedItem, object, string[])>(); + } + + int pairCount = Math.Min(expectationsWithIndexes.Count, bestAssignment.Count); + var result = new List<(IndexedItem, object, string[])>(pairCount); + + for (int index = 0; index < pairCount; index++) + { + IndexedItem expectationWithIndex = expectationsWithIndexes[index]; + string[] failures = getFailures(expectationWithIndex.Item, bestAssignment[index], expectationWithIndex.Index); + result.Add((expectationWithIndex, bestAssignment[index], failures)); + } + + return result; + } + + /// + /// Finds a near-optimal assignment using a greedy strategy. Suitable for large collections where the exact + /// permutation search would be prohibitively expensive. All distances are already cached from Phase 1, so + /// this is O(n² log n) rather than O(n! × n). + /// + private static IReadOnlyList<(IndexedItem Expectation, object Actual, string[] Failures)> FindClosestMismatchesByGreedyAssignment( + List remainingSubjects, IndexedItemCollection expectationsWithIndexes, + Func getFailures) + { + int subjectCount = remainingSubjects.Count; + int expectationCount = expectationsWithIndexes.Count; + int pairCount = expectationCount * subjectCount; + + var allPairs = new List<(int ExpectationIndex, int SubjectIndex, int Count)>(pairCount); + + for (int expectationIndex = 0; expectationIndex < expectationCount; expectationIndex++) + { + IndexedItem exp = expectationsWithIndexes[expectationIndex]; + + for (int subjectIndex = 0; subjectIndex < subjectCount; subjectIndex++) + { + int count = getFailures(exp.Item, remainingSubjects[subjectIndex], exp.Index).Length; + allPairs.Add((expectationIndex, subjectIndex, count)); } } - return bestSet is not null ? bestSet : Array.Empty<(IndexedItem, object, string[])>(); + // Sort by distance ascending. When distances are equal, use expectation index then subject index as + // tiebreakers so that assignments are deterministic and follow natural ordering. + allPairs.Sort(static (a, b) => + { + int relativeOrder = a.Count.CompareTo(b.Count); + if (relativeOrder != 0) + { + return relativeOrder; + } + + relativeOrder = a.ExpectationIndex.CompareTo(b.ExpectationIndex); + return relativeOrder != 0 ? relativeOrder : a.SubjectIndex.CompareTo(b.SubjectIndex); + }); + + var assignedExpectationIndexes = new bool[expectationCount]; + var assignedSubjectIndexes = new bool[subjectCount]; + int totalToAssign = Math.Min(expectationCount, subjectCount); + + var result = new List<(IndexedItem, object, string[])>(totalToAssign); + + foreach (var (expectationIndex, subjectIndex, _) in allPairs) + { + if (!assignedExpectationIndexes[expectationIndex] && !assignedSubjectIndexes[subjectIndex]) + { + string[] failures = getFailures(expectationsWithIndexes[expectationIndex].Item, remainingSubjects[subjectIndex], expectationsWithIndexes[expectationIndex].Index); + result.Add((expectationsWithIndexes[expectationIndex], remainingSubjects[subjectIndex], failures)); + assignedExpectationIndexes[expectationIndex] = true; + assignedSubjectIndexes[subjectIndex] = true; + + if (result.Count == totalToAssign) + { + break; + } + } + } + + return result; } private string[] TryToMatch(TExpectation expectation, object subject, int expectationIndex) @@ -201,28 +282,4 @@ private string[] TryToMatch(TExpectation expectation, object subject, int expect return failures; } - - /// - /// Provides a mechanism for comparing tuples that consist of a subject, an expectation, - /// and an expectation index. The comparison is based on object references and the expectation index. - /// - private sealed class ReferentialComparer : IEqualityComparer<(object Subject, object Expectation, int ExpectationIndex)> - { - public bool Equals((object Subject, object Expectation, int ExpectationIndex) x, - (object Subject, object Expectation, int ExpectationIndex) y) - { - return ReferenceEquals(x.Subject, y.Subject) - && ReferenceEquals(x.Expectation, y.Expectation) - && x.ExpectationIndex == y.ExpectationIndex; - } - - public int GetHashCode((object Subject, object Expectation, int ExpectationIndex) obj) - { - int hashCode = RuntimeHelpers.GetHashCode(obj.Subject); - hashCode = (hashCode * 397) + RuntimeHelpers.GetHashCode(obj.Expectation); - hashCode = (hashCode * 397) + obj.ExpectationIndex; - return hashCode; - } - } } - diff --git a/Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs b/Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs new file mode 100644 index 0000000000..6b8241bab8 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace FluentAssertions.Equivalency.Steps; + +/// +/// Provides a mechanism for comparing tuples that consist of a subject, an expectation, +/// and an expectation index. The comparison is based on object references and the expectation index. +/// +[System.Diagnostics.StackTraceHidden] +internal sealed class ReferentialComparer : IEqualityComparer<(object Subject, object Expectation, int ExpectationIndex)> +{ + public bool Equals((object Subject, object Expectation, int ExpectationIndex) x, + (object Subject, object Expectation, int ExpectationIndex) y) + { + return ReferenceEquals(x.Subject, y.Subject) + && ReferenceEquals(x.Expectation, y.Expectation) + && x.ExpectationIndex == y.ExpectationIndex; + } + + public int GetHashCode((object Subject, object Expectation, int ExpectationIndex) obj) + { + int hashCode = RuntimeHelpers.GetHashCode(obj.Subject); + hashCode = (hashCode * 397) + RuntimeHelpers.GetHashCode(obj.Expectation); + hashCode = (hashCode * 397) + obj.ExpectationIndex; + return hashCode; + } +} diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index d7b4f66a64..0482bcb6a7 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -47,7 +47,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/Benchmarks/Program.cs b/Tests/Benchmarks/Program.cs index ff2fb9ab18..2405f2befe 100644 --- a/Tests/Benchmarks/Program.cs +++ b/Tests/Benchmarks/Program.cs @@ -24,6 +24,6 @@ public static void Main() var config = ManualConfig.CreateMinimumViable().AddExporter(exporter); - _ = BenchmarkRunner.Run(config); + _ = BenchmarkRunner.Run(config); } } From ad4ae6b26d5e2e1d5a1708cc0cf3e2633dd83e2a Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Wed, 8 Apr 2026 21:44:24 +0200 Subject: [PATCH 811/845] Pre-cache collection index strings to reduce ToString allocations AsCollectionItem(int) now returns a pre-computed string for indices 0-1023 instead of calling ToString() on every comparison. For large collections this avoids repeated short-lived string allocations in hot paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../EquivalencyValidationContextExtensions.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Src/FluentAssertions/Equivalency/Steps/EquivalencyValidationContextExtensions.cs b/Src/FluentAssertions/Equivalency/Steps/EquivalencyValidationContextExtensions.cs index e3a85593d7..febfd913c4 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EquivalencyValidationContextExtensions.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EquivalencyValidationContextExtensions.cs @@ -5,8 +5,24 @@ namespace FluentAssertions.Equivalency.Steps; [System.Diagnostics.StackTraceHidden] internal static class EquivalencyValidationContextExtensions { + // Pre-cached string representations of common collection indices to avoid repeated allocations. + private static readonly string[] CachedIndexStrings = InitializeCachedIndexStrings(1024); + + private static string[] InitializeCachedIndexStrings(int count) + { + var result = new string[count]; + for (int i = 0; i < count; i++) + { + result[i] = i.ToString(CultureInfo.InvariantCulture); + } + + return result; + } + public static IEquivalencyValidationContext AsCollectionItem(this IEquivalencyValidationContext context, int index) => - context.AsCollectionItem(index.ToString(CultureInfo.InvariantCulture)); + context.AsCollectionItem(index < CachedIndexStrings.Length + ? CachedIndexStrings[index] + : index.ToString(CultureInfo.InvariantCulture)); } From 40550e9ba4decbbbb34d4cc79fc66fff49be7ed8 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Wed, 8 Apr 2026 21:47:29 +0200 Subject: [PATCH 812/845] Skip failure message formatting in dry-run comparisons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add UseDryRun flag to AssertionScope. When set, AssertionChain.FailWith() increments a counter instead of formatting and storing the full message. LooselyOrderedEquivalencyStrategy uses a dry-run scope in TryToMatchCount to count failures cheaply, split caches (countCache for counts, fullFailuresCache for strings), and updates FindClosestMismatches to take separate getFailureCount and getFullFailures delegates — deferring string allocation to the winning assignment only. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../LooselyOrderedEquivalencyStrategy.cs | 85 ++++++++++++++----- .../Execution/AssertionChain.cs | 18 +++- .../Execution/AssertionScope.cs | 22 +++++ 3 files changed, 100 insertions(+), 25 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs b/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs index 58a16f2389..0487913a04 100644 --- a/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs +++ b/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs @@ -18,11 +18,16 @@ internal class LooselyOrderedEquivalencyStrategy( private readonly Tracer tracer = context.Tracer; - private Dictionary<(object Subject, object Expectation, int ExpectationIndex), string[]> failuresCache = new(); + // Populated during Phase 1 + 2 using skip-formatting dry-runs (no string allocation). + private Dictionary<(object Subject, object Expectation, int ExpectationIndex), int> countCache = new(); + + // Populated lazily during Phase 3 for the ~n selected pairs with full formatting. + private Dictionary<(object Subject, object Expectation, int ExpectationIndex), string[]> fullFailuresCache = new(); public void FindAndRemoveMatches(List subjects, List expectations) { - failuresCache = new(new ReferentialComparer()); + countCache = new(new ReferentialComparer()); + fullFailuresCache = new(new ReferentialComparer()); var expectationsWithIndexes = new IndexedItemCollection(expectations); @@ -66,15 +71,15 @@ private bool StrictlyMatchAgainst(List remainingSubjects, TExpectation e using var _ = tracer.WriteBlock(member => $"Comparing subject at {member.Subject}[{index}] with the expectation at {member.Expectation}[{expectationIndex}]"); - string[] failures = TryToMatch(expectation, subject, expectationIndex); - if (failures.Length == 0) + int failures = TryToMatchCount(expectation, subject, expectationIndex); + if (failures == 0) { tracer.WriteLine(_ => "It's a match"); remainingSubjects.RemoveAt(index); return true; } - tracer.WriteLine(_ => $"Contained {failures.Length} failures"); + tracer.WriteLine(_ => $"Contained {failures} failures"); } return false; @@ -94,7 +99,7 @@ private IndexedItemCollection SortExpectationsByMinDistance(List new { Expectation = e, - MinDistance = remainingSubjects.Min(a => TryToMatch(e.Item, a, e.Index).Length) + MinDistance = remainingSubjects.Min(a => TryToMatchCount(e.Item, a, e.Index)) }) .OrderBy(x => x.MinDistance) .Select(x => x.Expectation) @@ -113,7 +118,7 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, if (expectationsWithIndexes.Count > 0 && remainingSubjects.Count > 0) { IReadOnlyList<(IndexedItem, object, string[])> bestMatches = - FindClosestMismatches(remainingSubjects, expectationsWithIndexes, TryToMatch); + FindClosestMismatches(remainingSubjects, expectationsWithIndexes, TryToMatchCount, TryToMatch); foreach (var (expectation, subject, failures) in bestMatches) { @@ -134,23 +139,27 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, private static IReadOnlyList<(IndexedItem Expectation, object Actual, string[] Failures)> FindClosestMismatches( List remainingSubjects, IndexedItemCollection expectationsWithIndexes, - Func getFailures) + Func getFailureCount, + Func getFullFailures) { // For small collections, use exact permutation search to find the globally optimal assignment. // factorial(8) = 40,320 which is well within reason. const int maxSizeForExactSearch = 8; return remainingSubjects.Count <= maxSizeForExactSearch ? - FindClosestMismatchesByPermutation(remainingSubjects, expectationsWithIndexes, getFailures) : - FindClosestMismatchesByGreedyAssignment(remainingSubjects, expectationsWithIndexes, getFailures); + FindClosestMismatchesByPermutation(remainingSubjects, expectationsWithIndexes, getFailureCount, getFullFailures) : + FindClosestMismatchesByGreedyAssignment(remainingSubjects, expectationsWithIndexes, getFailureCount, getFullFailures); } /// /// Finds the best assignment by exhaustively trying all permutations. Only suitable for small collections. + /// Uses failure counts for scoring (no string formatting) and only fetches full failure strings for the + /// winning assignment. /// private static IReadOnlyList<(IndexedItem Expectation, object Actual, string[] Failures)> FindClosestMismatchesByPermutation( List remainingSubjects, IndexedItemCollection expectationsWithIndexes, - Func getFailures) + Func getFailureCount, + Func getFullFailures) { var bestScore = int.MaxValue; IReadOnlyList bestAssignment = null; @@ -163,7 +172,7 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, for (int index = 0; index < expectationsWithIndexes.Count && index < assignment.Count; index++) { IndexedItem expectationWithIndex = expectationsWithIndexes[index]; - score += getFailures(expectationWithIndex.Item, assignment[index], expectationWithIndex.Index).Length; + score += getFailureCount(expectationWithIndex.Item, assignment[index], expectationWithIndex.Index); if (score >= bestScore) { @@ -184,13 +193,14 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, return Array.Empty<(IndexedItem, object, string[])>(); } + // Fetch full failure strings only for the winning assignment. int pairCount = Math.Min(expectationsWithIndexes.Count, bestAssignment.Count); var result = new List<(IndexedItem, object, string[])>(pairCount); for (int index = 0; index < pairCount; index++) { IndexedItem expectationWithIndex = expectationsWithIndexes[index]; - string[] failures = getFailures(expectationWithIndex.Item, bestAssignment[index], expectationWithIndex.Index); + string[] failures = getFullFailures(expectationWithIndex.Item, bestAssignment[index], expectationWithIndex.Index); result.Add((expectationWithIndex, bestAssignment[index], failures)); } @@ -204,12 +214,14 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, /// private static IReadOnlyList<(IndexedItem Expectation, object Actual, string[] Failures)> FindClosestMismatchesByGreedyAssignment( List remainingSubjects, IndexedItemCollection expectationsWithIndexes, - Func getFailures) + Func getFailureCount, + Func getFullFailures) { int subjectCount = remainingSubjects.Count; int expectationCount = expectationsWithIndexes.Count; int pairCount = expectationCount * subjectCount; + // Use failure counts (no string allocation) to build the pair list for sorting/assignment. var allPairs = new List<(int ExpectationIndex, int SubjectIndex, int Count)>(pairCount); for (int expectationIndex = 0; expectationIndex < expectationCount; expectationIndex++) @@ -218,7 +230,7 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, for (int subjectIndex = 0; subjectIndex < subjectCount; subjectIndex++) { - int count = getFailures(exp.Item, remainingSubjects[subjectIndex], exp.Index).Length; + int count = getFailureCount(exp.Item, remainingSubjects[subjectIndex], exp.Index); allPairs.Add((expectationIndex, subjectIndex, count)); } } @@ -243,11 +255,16 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, var result = new List<(IndexedItem, object, string[])>(totalToAssign); + // First checks candidate matches from best to worst, then picks the first unused expectation/subject pair it finds, + // computes detailed failures only for that chosen pair, and then repeats until all possible matches are assigned. foreach (var (expectationIndex, subjectIndex, _) in allPairs) { if (!assignedExpectationIndexes[expectationIndex] && !assignedSubjectIndexes[subjectIndex]) { - string[] failures = getFailures(expectationsWithIndexes[expectationIndex].Item, remainingSubjects[subjectIndex], expectationsWithIndexes[expectationIndex].Index); + // Fetch full failure strings only for the selected pairs (~n total). + string[] failures = getFullFailures(expectationsWithIndexes[expectationIndex].Item, + remainingSubjects[subjectIndex], expectationsWithIndexes[expectationIndex].Index); + result.Add((expectationsWithIndexes[expectationIndex], remainingSubjects[subjectIndex], failures)); assignedExpectationIndexes[expectationIndex] = true; assignedSubjectIndexes[subjectIndex] = true; @@ -262,23 +279,49 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, return result; } + /// + /// Performs a dry-run comparison using a scope that skips formatting. Returns the number of failures + /// without allocating any string messages. Used in Phase 1 and Phase 2 to avoid eager + /// FailureMessageFormatter + Regex.Replace costs for pairs that will ultimately be discarded. + /// + private int TryToMatchCount(TExpectation expectation, object subject, int expectationIndex) + { + var cacheKey = (subject, (object)expectation, expectationIndex); + + if (countCache.TryGetValue(cacheKey, out int cachedCount)) + { + return cachedCount; + } + + using var scope = new AssertionScope { UseDryRun = true }; + + IEquivalencyValidationContext itemContext = context.AsCollectionItem(expectationIndex); + + parent.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(TExpectation)), itemContext); + + int count = scope.GetFailureCount(); + countCache[cacheKey] = count; + + return count; + } + private string[] TryToMatch(TExpectation expectation, object subject, int expectationIndex) { - // Create a cache key based on the subject and expectation instances var cacheKey = (subject, (object)expectation, expectationIndex); - if (failuresCache.TryGetValue(cacheKey, out string[] cachedResult)) + if (fullFailuresCache.TryGetValue(cacheKey, out string[] cachedResult)) { return cachedResult; } using var scope = new AssertionScope(); - parent.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(TExpectation)), - context.AsCollectionItem(expectationIndex)); + IEquivalencyValidationContext itemContext = context.AsCollectionItem(expectationIndex); + + parent.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(TExpectation)), itemContext); string[] failures = scope.Discard(); - failuresCache[cacheKey] = failures; + fullFailuresCache[cacheKey] = failures; return failures; } diff --git a/Src/FluentAssertions/Execution/AssertionChain.cs b/Src/FluentAssertions/Execution/AssertionChain.cs index 05f1f8fe74..7c68a10693 100644 --- a/Src/FluentAssertions/Execution/AssertionChain.cs +++ b/Src/FluentAssertions/Execution/AssertionChain.cs @@ -252,14 +252,24 @@ private Continuation FailWith(Func getFailureReason) if (succeeded != true) { - string failure = getFailureReason(); + AssertionScope scope = getCurrentScope(); - if (expectation is not null) + if (scope.UseDryRun) { - failure = expectation() + failure; + // Dry-run mode: skip all string formatting and only count the failure. + scope.RegisterFailure(); } + else + { + string failure = getFailureReason(); + + if (expectation is not null) + { + failure = expectation() + failure; + } - getCurrentScope().AddPreFormattedFailure(failure.Capitalize().RemoveTrailingWhitespaceFromLines()); + scope.AddPreFormattedFailure(failure.Capitalize().RemoveTrailingWhitespaceFromLines()); + } } } diff --git a/Src/FluentAssertions/Execution/AssertionScope.cs b/Src/FluentAssertions/Execution/AssertionScope.cs index 2daa2ab8e8..bee8b4661e 100644 --- a/Src/FluentAssertions/Execution/AssertionScope.cs +++ b/Src/FluentAssertions/Execution/AssertionScope.cs @@ -26,6 +26,9 @@ public sealed class AssertionScope : IDisposable private AssertionScope parent; + // Tracks failure count when SkipFormattingForFailures is enabled (no string storage needed). + private int failureCount; + /// /// Starts an unnamed scope within which multiple assertions can be executed /// and which will not throw until the scope is disposed. @@ -133,6 +136,25 @@ public static AssertionScope Current /// public FormattingOptions FormattingOptions { get; } = AssertionConfiguration.Current.Formatting.Clone(); + /// + /// When set to true, will skip building failure message + /// strings and only track the number of failures. Use this for dry-run comparisons (e.g. collection + /// matching) where the actual formatted messages are not needed and would be discarded anyway. + /// + internal bool UseDryRun { get; set; } + + /// + /// Returns the number of failures recorded while is enabled. + /// Only counts direct failures tracked via . + /// + internal int GetFailureCount() => failureCount; + + /// + /// Increments the failure counter without storing or formatting a failure message. + /// Only called from when is active. + /// + internal void RegisterFailure() => failureCount++; + /// /// Adds a pre-formatted failure message to the current scope. /// From 02ad7f16e7e869ee2cf006bcf200e215d8a45d8e Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Wed, 8 Apr 2026 21:48:59 +0200 Subject: [PATCH 813/845] Clone CyclicReferenceDetector for dry-run comparisons to prevent stack overflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dry-run comparisons in TryToMatchCount and TryToMatch share the parent context's CyclicReferenceDetector by default. When the same object appears in multiple positions in an unordered collection, the detector could flag subsequent dry-runs as cyclic references and skip them — producing wrong failure counts and potential stack overflows. Fix by cloning the detector before each dry-run invocation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Equivalency/EquivalencyValidationContext.cs | 2 +- .../Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs index f35899b186..c00e6ae223 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs @@ -32,7 +32,7 @@ public EquivalencyValidationContext(INode root, IEquivalencyOptions options) public IEquivalencyOptions Options { get; } - private CyclicReferenceDetector CyclicReferenceDetector { get; set; } + internal CyclicReferenceDetector CyclicReferenceDetector { get; set; } public IEquivalencyValidationContext AsNestedMember(IMember expectationMember) { diff --git a/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs b/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs index 0487913a04..b92f89db6f 100644 --- a/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs +++ b/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs @@ -3,6 +3,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using FluentAssertions.Common; +using FluentAssertions.Equivalency.Execution; using FluentAssertions.Equivalency.Tracing; using FluentAssertions.Execution; @@ -295,7 +296,8 @@ private int TryToMatchCount(TExpectation expectation, object subject, int expect using var scope = new AssertionScope { UseDryRun = true }; - IEquivalencyValidationContext itemContext = context.AsCollectionItem(expectationIndex); + var itemContext = (EquivalencyValidationContext)context.AsCollectionItem(expectationIndex); + itemContext.CyclicReferenceDetector = (CyclicReferenceDetector)((EquivalencyValidationContext)context).CyclicReferenceDetector.Clone(); parent.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(TExpectation)), itemContext); @@ -316,7 +318,8 @@ private string[] TryToMatch(TExpectation expectation, object subject, int expect using var scope = new AssertionScope(); - IEquivalencyValidationContext itemContext = context.AsCollectionItem(expectationIndex); + var itemContext = (EquivalencyValidationContext)context.AsCollectionItem(expectationIndex); + itemContext.CyclicReferenceDetector = (CyclicReferenceDetector)((EquivalencyValidationContext)context).CyclicReferenceDetector.Clone(); parent.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(TExpectation)), itemContext); From 7ae21ac2b7c63391ee203d4fbd6bba2f221d3c56 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Wed, 8 Apr 2026 21:49:21 +0200 Subject: [PATCH 814/845] Include nested scope failures in dry-run failure count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GetFailureCount() was only counting direct RegisterFailure() calls. Failures from nested assertion scopes (e.g. via AssertionRuleEquivalencyStep) are stored in assertionStrategy.FailureMessages rather than the local counter, so they were invisible to TryToMatchCount — causing mismatches to look like matches (count=0) and corrupting the optimal assignment. Also call scope.Discard() after GetFailureCount() so that the dry-run scope does not propagate its failure messages to the parent scope on disposal. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .packageguard/cache.bin | Bin 131545 -> 114563 bytes .../LooselyOrderedEquivalencyStrategy.cs | 1 + .../Execution/AssertionScope.cs | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.packageguard/cache.bin b/.packageguard/cache.bin index 8907a098efd845e3e19c2fa757b0f8c6ace74115..509299b601da1d928507e2b0ff77267600e05f30 100644 GIT binary patch delta 1427 zcmZ`&e@v8R9OrW!zvPZP1gCi5@heXtUhaj1fnA2tB3Xg0#4Rev7>1#S9ILkcwJ~#R zX~Ls?0~2YsHoC12-;EbRevd*Sq0Lbu2}K*VS`r`%f!A{{QT(XC-sk=NdYDz&D-rVN?#pfk*w5Yk{mP|#Lm=8(y7aK zm1|JmqLZ>e_JfoqzrMx=F#R1JRr?@Fy4^9NR*>(n`7>>okJQ&)3Ku|*&G4q`Ja|bt zJuN(DP)&hru!AZAE9ekEz{Q|Q>c z#z^-5z_fI6WH^sx%UDFwDPm{Fhb`1PoUOLyhVk#kWMvU z;{@&K!aGZTn}-lglV2il3HDwelIUVL3gOPm0-t8%X(3F%$4cgTgvzbM2mpm#N6CM% z#Mxf?l^)FD|5!TkJK`zmI`m{6K!%?vqzGc%{(X7*2W|PQ=UYhREAsJ@Z{Eaa$a}uU zGhQ?}gH(1V_Aq_W4?Eo$!Q0EA0^*B!oIV_bhSnd2NF&_{psZ17S}TD$cjr;>?1DrTU&AAp{1hyMPG#%nqX} z$xJSyd5THuh1feU8(4&2M(B!NHymXNJpz+qMSNx za8DHe_8RLEONBCw6+kc>k62I5GA}Q_3015r(m;+Ye2=Fa5d9DTYr_hD8!U9Fi`O33 zhz+o?=L0HP=rIrat`R}*$%2`t8ev5;eG`K7)Z2vT6!7>YcVu3LehDLxrWKJK5L=PX zKkaSkBx@VYe0-n{FDyVmKxBPq6KJ3vetd}OGJ3NE>DpPR)9K;n=9VDD^WI#FhaJ%H zYAuRp{3PFry%T|kMd6FP4(=sj=tZKqQnHl&K=u}Pn4doP9s7gv=3m`F4`cyC{4N zqU`?=T2S^3wzyEH@-;E@VNYtA;csw}9iBy;;tBhcAIT!hr}U?jbN|MfX=o0^=9K@A><_^PO|gVM}-5`7Kgd*bd*sL$F<*Ch=qJ;gs+tON+RY8eVT(K`r}@)f>QW zo;_az0Zg9uL$>JQtMoUBim5s)SosO5z3`E5=dh=9me^aC%mGo_)B)05aydOSZCuC{ z>ZA6?+!{a3$b&?C`SRu|5ahuMwkE~Ex+*i7a%wCyHcRdHnqNK?d9%B_J7m(NNyU7X zk=F}`D)!OtSay;n#P;>nD^#48Q!0!GJ#V)0;B?_Vzf4y2mpE)`f$8?F=R+O{_9H1> zBrTh@2PO^#09BhHpUFFItn*!&J><}CKi{a&wMd!bSdhKizAkh`4!gW_eZYuRPAimO zNU^nwkXm_W2l&K-pKxQ&Lqbl{Q7Gyh1}WX{f-Uw_0qLDnZT_=9S7987izgYdt-kdE+3e z1#DB{G}it15KW~;F!O?046N^2_ z@&m4s;8?sOgE$5`@sn@SYap?x(z#SFl{E!rveh{e(bVqCVDAF4tr}+FQ(GW{wSFC4 zC}Ket`%dD zm!=g2djpvYlbHWe>=kJ&D{h}3;9;7J6%1GKAl3I}f|v**a@-O#C6m>rGcGllD=l@l zBBM^IvRF;MKx)ObnovMy`3$7=G6g_RNo95A2d6XFbL`r|DsMosb1e}PCt*>?a<7EP z_e#SCNZx$1!W%>Mr({mzU~|-`O(zE29#&_>Zs&!VrvS+t)op_^&S6tXL#W9%BlsS#`dT}v5IXk47uBzxUpvPTZBaBNJxx!4{}d4d8|mB zASC7uhlEyh2Q_YjZOTSb<2=q0t!C_1E{Q;%5T81Y()Y*|?eOs)-oLwA=K}r*pL31U zPVzBlh>z>;D5HJ<${4RoKGqpN{Hjf83?FabzTEF=t?U1E_q1wz^zN=^v!i>wV(sqX z@D*vOhxhBMJqU^WV%7Fg;WD&$ux6{0C)7d8DAsHb6)r>jU9NDRy!-A{xFH_iw-s(6 z692yyZn5uY4WH8l*(XTb}X8f%LVsZOJz$H^BS5~AGs@;YKg@#LayO$%3 zJsr%`H3=TihDf|Fqo1pxFx6p-gXgnwax=*NRh$x4&5#Q!)-L-welLcuKcW$4J3@X0 zABLj>A;B*#70VD7($oH|V!s3nc0&dpZh-{Q;Hffr45$ANV*E9n$~Ao9_mJZFb2Y>R zO83yOl6@7a#^rk;0#C)jE(~oW9q})LwrAv-mj;i7;j+D;#_j@0#gls>#>H2&4`%wO zb1H1w2bp4nEuQiM8eWD1=SzdX8ozuQBHTwfBvme8AR#@kHjcR@RAH7Il7Hw&;a0hXhve8#s_rUGaRmC{X>aEo4?cZd{9bvia3fJY@_tDon<>o5m* zAB0)Xegq?B&c6=Al%ZtvU0q`SCmn+DK?D~MLB6X?%-t33AR9#BRFv5Pvmg!2JD`vr z2Rq;$P~u;s39hb_AeB&Zsm0zlF~1|R?l45r__o7PfUkGJtFGSX{?OYyFGO!KnJi`} zTh>-sh^;5!OtS+L#n~9*6dH~e2ZUkvR>*gb;?_4oK|+tb3CrAiN#AUjs(B$Mp(dqP z)o;sV#~_Kus*XXa8^^oHK~254kHd<--fN`ye6Uk*RCxbC8c;Maat*X1&3egy0beNf A@Bjb+ diff --git a/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs b/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs index b92f89db6f..c672d212ca 100644 --- a/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs +++ b/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs @@ -302,6 +302,7 @@ private int TryToMatchCount(TExpectation expectation, object subject, int expect parent.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(TExpectation)), itemContext); int count = scope.GetFailureCount(); + scope.Discard(); countCache[cacheKey] = count; return count; diff --git a/Src/FluentAssertions/Execution/AssertionScope.cs b/Src/FluentAssertions/Execution/AssertionScope.cs index bee8b4661e..2060d94649 100644 --- a/Src/FluentAssertions/Execution/AssertionScope.cs +++ b/Src/FluentAssertions/Execution/AssertionScope.cs @@ -147,7 +147,7 @@ public static AssertionScope Current /// Returns the number of failures recorded while is enabled. /// Only counts direct failures tracked via . /// - internal int GetFailureCount() => failureCount; + internal int GetFailureCount() => failureCount + assertionStrategy.FailureMessages.Count(); /// /// Increments the failure counter without storing or formatting a failure message. From f429c2ee065eb04e8ef7d5b5aab3006439d38164 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 12 Apr 2026 14:12:36 +0200 Subject: [PATCH 815/845] Make closest-match helpers instance methods The strategy already owns TryToMatchCount and TryToMatch, so keeping the closest-match helper chain static forced delegate plumbing without adding value. Make those helpers instance methods so they can use the existing instance members directly while preserving the matching logic, scoring, and caches. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../LooselyOrderedEquivalencyStrategy.cs | 32 ++++++++----------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs b/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs index c672d212ca..5bd348c3e6 100644 --- a/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs +++ b/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs @@ -119,7 +119,7 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, if (expectationsWithIndexes.Count > 0 && remainingSubjects.Count > 0) { IReadOnlyList<(IndexedItem, object, string[])> bestMatches = - FindClosestMismatches(remainingSubjects, expectationsWithIndexes, TryToMatchCount, TryToMatch); + FindClosestMismatches(remainingSubjects, expectationsWithIndexes); foreach (var (expectation, subject, failures) in bestMatches) { @@ -138,18 +138,16 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, } } - private static IReadOnlyList<(IndexedItem Expectation, object Actual, string[] Failures)> FindClosestMismatches( - List remainingSubjects, IndexedItemCollection expectationsWithIndexes, - Func getFailureCount, - Func getFullFailures) + private IReadOnlyList<(IndexedItem Expectation, object Actual, string[] Failures)> FindClosestMismatches( + List remainingSubjects, IndexedItemCollection expectationsWithIndexes) { // For small collections, use exact permutation search to find the globally optimal assignment. // factorial(8) = 40,320 which is well within reason. const int maxSizeForExactSearch = 8; return remainingSubjects.Count <= maxSizeForExactSearch ? - FindClosestMismatchesByPermutation(remainingSubjects, expectationsWithIndexes, getFailureCount, getFullFailures) : - FindClosestMismatchesByGreedyAssignment(remainingSubjects, expectationsWithIndexes, getFailureCount, getFullFailures); + FindClosestMismatchesByPermutation(remainingSubjects, expectationsWithIndexes) : + FindClosestMismatchesByGreedyAssignment(remainingSubjects, expectationsWithIndexes); } /// @@ -157,10 +155,8 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, /// Uses failure counts for scoring (no string formatting) and only fetches full failure strings for the /// winning assignment. /// - private static IReadOnlyList<(IndexedItem Expectation, object Actual, string[] Failures)> FindClosestMismatchesByPermutation( - List remainingSubjects, IndexedItemCollection expectationsWithIndexes, - Func getFailureCount, - Func getFullFailures) + private IReadOnlyList<(IndexedItem Expectation, object Actual, string[] Failures)> FindClosestMismatchesByPermutation( + List remainingSubjects, IndexedItemCollection expectationsWithIndexes) { var bestScore = int.MaxValue; IReadOnlyList bestAssignment = null; @@ -173,7 +169,7 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, for (int index = 0; index < expectationsWithIndexes.Count && index < assignment.Count; index++) { IndexedItem expectationWithIndex = expectationsWithIndexes[index]; - score += getFailureCount(expectationWithIndex.Item, assignment[index], expectationWithIndex.Index); + score += TryToMatchCount(expectationWithIndex.Item, assignment[index], expectationWithIndex.Index); if (score >= bestScore) { @@ -201,7 +197,7 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, for (int index = 0; index < pairCount; index++) { IndexedItem expectationWithIndex = expectationsWithIndexes[index]; - string[] failures = getFullFailures(expectationWithIndex.Item, bestAssignment[index], expectationWithIndex.Index); + string[] failures = TryToMatch(expectationWithIndex.Item, bestAssignment[index], expectationWithIndex.Index); result.Add((expectationWithIndex, bestAssignment[index], failures)); } @@ -213,10 +209,8 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, /// permutation search would be prohibitively expensive. All distances are already cached from Phase 1, so /// this is O(n² log n) rather than O(n! × n). /// - private static IReadOnlyList<(IndexedItem Expectation, object Actual, string[] Failures)> FindClosestMismatchesByGreedyAssignment( - List remainingSubjects, IndexedItemCollection expectationsWithIndexes, - Func getFailureCount, - Func getFullFailures) + private IReadOnlyList<(IndexedItem Expectation, object Actual, string[] Failures)> FindClosestMismatchesByGreedyAssignment( + List remainingSubjects, IndexedItemCollection expectationsWithIndexes) { int subjectCount = remainingSubjects.Count; int expectationCount = expectationsWithIndexes.Count; @@ -231,7 +225,7 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, for (int subjectIndex = 0; subjectIndex < subjectCount; subjectIndex++) { - int count = getFailureCount(exp.Item, remainingSubjects[subjectIndex], exp.Index); + int count = TryToMatchCount(exp.Item, remainingSubjects[subjectIndex], exp.Index); allPairs.Add((expectationIndex, subjectIndex, count)); } } @@ -263,7 +257,7 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, if (!assignedExpectationIndexes[expectationIndex] && !assignedSubjectIndexes[subjectIndex]) { // Fetch full failure strings only for the selected pairs (~n total). - string[] failures = getFullFailures(expectationsWithIndexes[expectationIndex].Item, + string[] failures = TryToMatch(expectationsWithIndexes[expectationIndex].Item, remainingSubjects[subjectIndex], expectationsWithIndexes[expectationIndex].Index); result.Add((expectationsWithIndexes[expectationIndex], remainingSubjects[subjectIndex], failures)); From 431e5a8c7e7560536af8c6fd9fdbe5caa0a711c0 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 19 Apr 2026 11:36:00 +0200 Subject: [PATCH 816/845] Meziantou.Analyzer 2.0.260 -> 3.0.50 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index eb3303cc88..69be3ee979 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 48cca1fae07835c610f62bc66ded7371a1f54b1f Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 19 Apr 2026 11:37:16 +0200 Subject: [PATCH 817/845] TUnit 1.5.60 -> 1.37.0 --- Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj index 3dd7c50b35..ae89b6c1ae 100644 --- a/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj +++ b/Tests/TestFrameworks/TUnit.Specs/TUnit.Specs.csproj @@ -11,7 +11,7 @@ - + From 0c21d1e0a21227015f823bad00795b5718c1b053 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 19 Apr 2026 11:38:13 +0200 Subject: [PATCH 818/845] MSTest 4.0.2 -> 4.2.1 --- Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj b/Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj index 028bc9372e..bc4de568be 100644 --- a/Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + From 1dd2dc9a366c92a529a8c68b4630b984e2d77cf4 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 19 Apr 2026 11:39:14 +0200 Subject: [PATCH 819/845] xunit.v3 3.2.1 -> 3.2.2 --- Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj | 2 +- Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj index 88097f9f53..c7c2d290ca 100644 --- a/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3.Specs/XUnit3.Specs.csproj @@ -9,7 +9,7 @@ - + diff --git a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj index cf8470a62a..8def8827c2 100644 --- a/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj +++ b/Tests/TestFrameworks/XUnit3Core.Specs/XUnit3Core.Specs.csproj @@ -9,7 +9,7 @@ - + From 39143b18fa91eba6f17194c5bcfc28d0eb7d3bbc Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 19 Apr 2026 11:42:12 +0200 Subject: [PATCH 820/845] SharpCompress 0.42.1 -> 0.47.4 --- Build/CompressionExtensions.cs | 2 +- Build/_build.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Build/CompressionExtensions.cs b/Build/CompressionExtensions.cs index 334960480d..89753805b2 100644 --- a/Build/CompressionExtensions.cs +++ b/Build/CompressionExtensions.cs @@ -9,7 +9,7 @@ public static void UnTarXzTo(this AbsolutePath archive, AbsolutePath directory) { using Stream stream = File.OpenRead(archive); - using var reader = ReaderFactory.Open(stream); + using var reader = ReaderFactory.OpenReader(stream); while (reader.MoveToNextEntry()) { diff --git a/Build/_build.csproj b/Build/_build.csproj index a1e6784b97..8ddb6c753f 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -17,6 +17,6 @@ - + From 48130c3be73bfafe1bea1a3b926af89b8a771d3b Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 19 Apr 2026 11:43:29 +0200 Subject: [PATCH 821/845] ReportGenerator 5.5.1 -> 5.5.5 --- Build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 8ddb6c753f..1e1d59c579 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -11,7 +11,7 @@ - + From f6f0f3ee3c382f6571ce81ead371811f647c983e Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 19 Apr 2026 11:46:16 +0200 Subject: [PATCH 822/845] Limit Xunit.StaFact to xunitV2 compatible versions --- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 560da3337e..193a4f01a1 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -32,7 +32,7 @@ all runtime; build; native; contentfiles; analyzers - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 11a0bcabd9..42b87d5010 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -31,7 +31,7 @@ all runtime; build; native; contentfiles; analyzers - + runtime; build; native; contentfiles; analyzers; buildtransitive From e9b2c1afb3d8c8e0f74cfc4c60d579f07798fc54 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 19 Apr 2026 11:52:52 +0200 Subject: [PATCH 823/845] Upgrade Approval.Tests to xunit.v3 Verify.Xunit is deprecated, so moving to Verify.XunitV3 --- Tests/Approval.Tests/Approval.Tests.csproj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 59464305e9..ba378957c5 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -2,18 +2,19 @@ net10.0 + Exe - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + From 93af1bd3207c3d3dc68352ef1c6fd007333ba324 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 19 Apr 2026 11:53:32 +0200 Subject: [PATCH 824/845] Reflectify 1.9.0 -> 1.9.1 --- Src/FluentAssertions/FluentAssertions.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 0482bcb6a7..528baf976e 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -47,7 +47,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From b338e1fc64cbabe8074ec0f2ac2c7b253719dad3 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 19 Apr 2026 11:57:37 +0200 Subject: [PATCH 825/845] NUnit 4.4.0 -> 4.5.1 --- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index 7ddcd3bea5..f606846da4 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 40633d1c43b60b486871da97f1d0b0d573bc7d4c Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 19 Apr 2026 11:59:28 +0200 Subject: [PATCH 826/845] JetBrains.Annotations 2024.3.0 -> 2025.2.4 --- Src/FluentAssertions/FluentAssertions.csproj | 2 +- .../FluentAssertions.Equivalency.Specs.csproj | 2 +- Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/FluentAssertions.csproj b/Src/FluentAssertions/FluentAssertions.csproj index 528baf976e..327d5ffbb9 100644 --- a/Src/FluentAssertions/FluentAssertions.csproj +++ b/Src/FluentAssertions/FluentAssertions.csproj @@ -59,7 +59,7 @@ - + diff --git a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj index 193a4f01a1..5ed4eef871 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj +++ b/Tests/FluentAssertions.Equivalency.Specs/FluentAssertions.Equivalency.Specs.csproj @@ -25,7 +25,7 @@ - + diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index 42b87d5010..eb96bd99bf 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -25,7 +25,7 @@ - + all From 3c248f6958cd4db7ae72f7641cdcb359a02a7137 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 19 Apr 2026 12:05:07 +0200 Subject: [PATCH 827/845] xunit.runner.visualstudio 3.0.0 -> 3.0.2 --- Tests/FSharp.Specs/FSharp.Specs.fsproj | 2 +- Tests/VB.Specs/VB.Specs.vbproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/FSharp.Specs/FSharp.Specs.fsproj b/Tests/FSharp.Specs/FSharp.Specs.fsproj index 97234f4386..c209ea6edd 100644 --- a/Tests/FSharp.Specs/FSharp.Specs.fsproj +++ b/Tests/FSharp.Specs/FSharp.Specs.fsproj @@ -14,7 +14,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/VB.Specs/VB.Specs.vbproj b/Tests/VB.Specs/VB.Specs.vbproj index cfc7e3edc4..80e5416353 100644 --- a/Tests/VB.Specs/VB.Specs.vbproj +++ b/Tests/VB.Specs/VB.Specs.vbproj @@ -9,7 +9,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 1cb7ce9e23932a859bfcbdcb0f618eeb242f7464 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 19 Apr 2026 12:26:19 +0200 Subject: [PATCH 828/845] Bump vulnerable dependencies of NUKE https://github.com/nuke-build/nuke/pull/1592 --- Build/_build.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Build/_build.csproj b/Build/_build.csproj index 1e1d59c579..46dbdb457a 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -15,8 +15,10 @@ + + From 82aa225dfc619e1cb7a5b8ac7b1d1e51867eb768 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 19 Apr 2026 13:42:06 +0200 Subject: [PATCH 829/845] Fixup Qodana issues * Don't use mutable member in GetHashCode * Remove unused using --- .../Equivalency/Selection/SelectMemberByPathSelectionRule.cs | 1 - .../SelectionRulesSpecs.Excluding.cs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Selection/SelectMemberByPathSelectionRule.cs b/Src/FluentAssertions/Equivalency/Selection/SelectMemberByPathSelectionRule.cs index 2f0fae01e5..618dcd70c5 100644 --- a/Src/FluentAssertions/Equivalency/Selection/SelectMemberByPathSelectionRule.cs +++ b/Src/FluentAssertions/Equivalency/Selection/SelectMemberByPathSelectionRule.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; diff --git a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs index 21a676ba3b..c84eca6151 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/SelectionRulesSpecs.Excluding.cs @@ -1436,9 +1436,9 @@ public class ClassWithCollectionOfValueSemantics public class ClassWithValueSemanticsAndNestedObject { - public string Key { get; set; } + public string Key { get; init; } - public NestedObjectWithProperty Child { get; set; } + public NestedObjectWithProperty Child { get; init; } protected bool Equals(ClassWithValueSemanticsAndNestedObject other) => Key == other.Key; From aeb92c2ae0cf59293d1243ea9f42e7338ea10a96 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Sun, 19 Apr 2026 14:19:15 +0200 Subject: [PATCH 830/845] Fix typo in release notes --- docs/_pages/releases.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 23c61839c2..92b2014dde 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -57,7 +57,7 @@ sidebar: ### What's new -* Add `Value.ThatMatches` and `Value.ThatSatifies` to build inline assertions when using `BeEquivalentTo` - [#3076](https://github.com/fluentassertions/fluentassertions/pull/3076) +* Add `Value.ThatMatches` and `Value.ThatSatisfies` to build inline assertions when using `BeEquivalentTo` - [#3076](https://github.com/fluentassertions/fluentassertions/pull/3076) ## 8.5.0 From 3ca68beb0df96ff43e103f50068fe4af4a7e04ad Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 20 Apr 2026 09:36:59 +0200 Subject: [PATCH 831/845] Fix Qodana argument separator ``` Comma-separated args format is deprecated and will be removed in a future version. Please switch to space-separated format: Current: "--baseline,qodana.sarif.json,--ide,QDNET" Suggested: "--baseline qodana.sarif.json --ide QDNET" ``` --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index 02898b7683..b975a04efc 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -21,7 +21,7 @@ jobs: uses: JetBrains/qodana-action@v2025.3 with: upload-result: ${{ github.ref_name == 'main' || github.ref_name == 'develop' }} - args: --baseline,qodana.sarif.json,--ide,QDNET + args: --baseline qodana.sarif.json --ide QDNET pr-mode: ${{ github.event_name == 'pull_request_target' }} env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} From 2d6d417945fc0535ff5da7d82f083ddb5159070e Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 20 Apr 2026 13:08:41 +0200 Subject: [PATCH 832/845] Use new Qodana linter option Due to this warning > Flag --ide has been deprecated, use --linter with corresponding linter type and --within-docker=false instead Changes done in accordance to: https://www.jetbrains.com/help/qodana/dotnet.html#Basic+use+case --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index b975a04efc..e2ddda03fc 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -21,7 +21,7 @@ jobs: uses: JetBrains/qodana-action@v2025.3 with: upload-result: ${{ github.ref_name == 'main' || github.ref_name == 'develop' }} - args: --baseline qodana.sarif.json --ide QDNET + args: --baseline qodana.sarif.json --linter qodana-dotnet --within-docker false pr-mode: ${{ github.event_name == 'pull_request_target' }} env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} From 79050a92a0c18e8938fbf303f31cfd4a9a7640f1 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Mon, 20 Apr 2026 14:55:00 +0200 Subject: [PATCH 833/845] Fix typos in docs --- docs/_pages/releases.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 92b2014dde..a916f544f0 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -51,7 +51,6 @@ sidebar: ### What's new * Added support for `System.Text.Json.JsonNode` and `JsonArray` through new assertions as well as the `BeEquivalentTo` API - [#3094](https://github.com/fluentassertions/fluentassertions/pull/3094) -* Added `WithoutMessage` to allow asserting an exception message does not contain a wildcard pattern - [#3100](https://github.com/fluentassertions/fluentassertions/pull/3100) ## 8.6.0 @@ -238,12 +237,12 @@ Version 7 will remain fully open-source indefinitely and receive bugfixes and ot ### Fixes -* The expectation node identified as a cyclic reference is still compared to the subject node using simple equality - [2819](https://github.com/fluentassertions/fluentassertions/pull/2819) +* The expectation node identified as a cyclic reference is still compared to the subject node using simple equality - [#2819](https://github.com/fluentassertions/fluentassertions/pull/2819) ## 6.12.2 ### Fixes -* Better handling of normal vs explicitly implemented vs default interface properties - [2794](https://github.com/fluentassertions/fluentassertions/pull/2794) +* Better handling of normal vs explicitly implemented vs default interface properties - [#2794](https://github.com/fluentassertions/fluentassertions/pull/2794) ## 6.12.1 @@ -422,7 +421,7 @@ Version 7 will remain fully open-source indefinitely and receive bugfixes and ot ### Fixes * Prevent multiple enumeration of `IEnumerable`s in parameter-less `ContainSingle()` - [#1753](https://github.com/fluentassertions/fluentassertions/pull/1753) * Changed `HaveCount()` assertion message order to state expected and actual collection count before dumping its content` - [#1760](https://github.com/fluentassertions/fluentassertions/pull/1760) -* `CompleteWithinAsync` did not take initial sync computation into account when measuring execution time - [1762](https://github.com/fluentassertions/fluentassertions/pull/1762). +* `CompleteWithinAsync` did not take initial sync computation into account when measuring execution time - [#1762](https://github.com/fluentassertions/fluentassertions/pull/1762). ## 6.2.0 From f1370c1662fc4c2e4c3e36ec24d34d919fb99a16 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Apr 2026 17:07:37 +0300 Subject: [PATCH 834/845] Fix flaky BeLessThanOrEqualTo execution time test (#3200) --- .../Specialized/ExecutionTimeAssertionsSpecs.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/FluentAssertions.Specs/Specialized/ExecutionTimeAssertionsSpecs.cs b/Tests/FluentAssertions.Specs/Specialized/ExecutionTimeAssertionsSpecs.cs index d0f632baa4..7277d16dc1 100644 --- a/Tests/FluentAssertions.Specs/Specialized/ExecutionTimeAssertionsSpecs.cs +++ b/Tests/FluentAssertions.Specs/Specialized/ExecutionTimeAssertionsSpecs.cs @@ -63,7 +63,7 @@ public void When_the_execution_time_of_an_action_is_less_than_or_equal_to_a_limi Action someAction = () => Thread.Sleep(100); // Act - Action act = () => someAction.ExecutionTime().Should().BeLessThanOrEqualTo(1.Seconds()); + Action act = () => someAction.ExecutionTime().Should().BeLessThanOrEqualTo(2.Seconds()); // Assert act.Should().NotThrow(); From 84b7cb606674e8216d0f30f4e22f94a251689a9d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 09:30:46 +0200 Subject: [PATCH 835/845] Bump JetBrains/qodana-action from 2025.3 to 2026.1 (#3201) Bumps [JetBrains/qodana-action](https://github.com/jetbrains/qodana-action) from 2025.3 to 2026.1. - [Commits](https://github.com/jetbrains/qodana-action/compare/v2025.3...v2026.1) --- updated-dependencies: - dependency-name: JetBrains/qodana-action dependency-version: '2026.1' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index e2ddda03fc..94699ce1c2 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2025.3 + uses: JetBrains/qodana-action@v2026.1 with: upload-result: ${{ github.ref_name == 'main' || github.ref_name == 'develop' }} args: --baseline qodana.sarif.json --linter qodana-dotnet --within-docker false From f81cb7c3d196ec9a30e788195bf26a2e61bc1500 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Tue, 5 May 2026 16:30:10 +0200 Subject: [PATCH 836/845] Use long for hashCode in ReferentialComparer to avoid overflow (#3204) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs b/Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs index 6b8241bab8..1d69a05e54 100644 --- a/Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs +++ b/Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs @@ -20,9 +20,9 @@ public bool Equals((object Subject, object Expectation, int ExpectationIndex) x, public int GetHashCode((object Subject, object Expectation, int ExpectationIndex) obj) { - int hashCode = RuntimeHelpers.GetHashCode(obj.Subject); + long hashCode = RuntimeHelpers.GetHashCode(obj.Subject); hashCode = (hashCode * 397) + RuntimeHelpers.GetHashCode(obj.Expectation); hashCode = (hashCode * 397) + obj.ExpectationIndex; - return hashCode; + return (int)hashCode; } } From fb4295467f3ea347940d65f7ecd4b8b396c17b6d Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Sun, 3 May 2026 11:43:11 +0200 Subject: [PATCH 837/845] Add ComparingNullCollectionsAsEmpty and ComparingNullStringsAsEmpty options to BeEquivalentTo Fixes #1938 by introducing two new equivalency options: - ComparingNullCollectionsAsEmpty(): treats null collections as equivalent to empty ones - ComparingNullStringsAsEmpty(): treats null strings as equivalent to empty strings Both options work for direct assertions and when the subject is nested inside an object graph. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../CollectionMemberOptionsDecorator.cs | 6 + .../Equivalency/IEquivalencyOptions.cs | 10 ++ .../SelfReferenceEquivalencyOptions.cs | 26 ++++ .../Steps/EnumerableEquivalencyStep.cs | 12 +- .../Steps/GenericEnumerableEquivalencyStep.cs | 21 ++- .../Steps/StringEqualityEquivalencyStep.cs | 15 +- .../Primitives/StringAssertions.cs | 5 +- .../FluentAssertions/net47.verified.txt | 6 + .../FluentAssertions/net6.0.verified.txt | 6 + .../netstandard2.0.verified.txt | 6 + .../netstandard2.1.verified.txt | 6 + .../CollectionSpecs.cs | 136 ++++++++++++++++++ .../StringAssertionSpecs.BeEquivalentTo.cs | 114 +++++++++++++++ docs/_pages/objectgraphs.md | 14 +- docs/_pages/releases.md | 1 + 15 files changed, 373 insertions(+), 11 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs index df6f32a544..a5ba14b3ec 100644 --- a/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs +++ b/Src/FluentAssertions/Equivalency/Execution/CollectionMemberOptionsDecorator.cs @@ -94,6 +94,12 @@ public EqualityStrategy GetEqualityStrategy(Type type) public bool EnableFullDump => inner.EnableFullDump; + /// + public bool TreatNullCollectionsAsEmpty => inner.TreatNullCollectionsAsEmpty; + + /// + public bool TreatNullStringsAsEmpty => inner.TreatNullStringsAsEmpty; + public ITraceWriter TraceWriter => inner.TraceWriter; } diff --git a/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs index 0fbd660e03..03d17a0734 100644 --- a/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/IEquivalencyOptions.cs @@ -137,4 +137,14 @@ public interface IEquivalencyOptions /// Gets a value indicating whether the full dump of the subject should be included in the failure message. /// bool EnableFullDump { get; } + + /// + /// Gets a value indicating whether null collections should be treated as equivalent to empty collections. + /// + bool TreatNullCollectionsAsEmpty { get; } + + /// + /// Gets a value indicating whether null strings should be treated as equivalent to empty strings. + /// + bool TreatNullStringsAsEmpty { get; } } diff --git a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs index 40eca97af5..00f6348f14 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -100,6 +100,8 @@ protected SelfReferenceEquivalencyOptions(IEquivalencyOptions defaults) IgnoreNewlineStyle = defaults.IgnoreNewlineStyle; IncludeFullStringsInDifference = defaults.IncludeFullStringsInDifference; IgnoreJsonPropertyCasing = defaults.IgnoreJsonPropertyCasing; + TreatNullCollectionsAsEmpty = defaults.TreatNullCollectionsAsEmpty; + TreatNullStringsAsEmpty = defaults.TreatNullStringsAsEmpty; ConversionSelector = defaults.ConversionSelector.Clone(); @@ -216,6 +218,10 @@ EqualityStrategy IEquivalencyOptions.GetEqualityStrategy(Type type) /// public bool EnableFullDump { get; private set; } + public bool TreatNullCollectionsAsEmpty { get; private set; } + + public bool TreatNullStringsAsEmpty { get; private set; } + public ITraceWriter TraceWriter { get; private set; } /// @@ -904,6 +910,26 @@ public TSelf IncludingFullStringsInDifference() return (TSelf)this; } + /// + /// Instructs the comparison to treat null collections as equivalent to empty collections, + /// regardless of whether the subject or the expectation is null. + /// + public TSelf ComparingNullCollectionsAsEmpty() + { + TreatNullCollectionsAsEmpty = true; + return (TSelf)this; + } + + /// + /// Instructs the comparison to treat null strings as equivalent to empty strings, + /// regardless of whether the subject or the expectation is null. + /// + public TSelf ComparingNullStringsAsEmpty() + { + TreatNullStringsAsEmpty = true; + return (TSelf)this; + } + #if NET6_0_OR_GREATER /// /// Tells the comparison to ignore the casing when trying to match a property to a JSON property. diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs index 2a36e04cc3..f88ac4078a 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyStep.cs @@ -19,7 +19,13 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon var assertionChain = AssertionChain.GetOrCreate().For(context); - if (AssertSubjectIsCollection(assertionChain, comparands.Subject)) + bool treatNullAsEmpty = context.Options.TreatNullCollectionsAsEmpty; + + bool subjectIsUsable = treatNullAsEmpty + ? comparands.Subject is null || AssertSubjectIsCollection(assertionChain, comparands.Subject) + : AssertSubjectIsCollection(assertionChain, comparands.Subject); + + if (subjectIsUsable) { var validator = new EnumerableEquivalencyValidator(assertionChain, valueChildNodes, context) { @@ -27,7 +33,9 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon OrderingRules = context.Options.OrderingRules }; - validator.Execute(ToArray(comparands.Subject), ToArray(comparands.Expectation)); + validator.Execute( + treatNullAsEmpty && comparands.Subject is null ? [] : ToArray(comparands.Subject), + treatNullAsEmpty && comparands.Expectation is null ? [] : ToArray(comparands.Expectation)); } return EquivalencyResult.EquivalencyProven; diff --git a/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs index a736888e93..83935c1ec4 100644 --- a/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/GenericEnumerableEquivalencyStep.cs @@ -22,7 +22,12 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon { Type expectedType = comparands.GetExpectedType(context.Options); - if (comparands.Expectation is null || !IsGenericCollection(expectedType)) + if (!IsGenericCollection(expectedType)) + { + return EquivalencyResult.ContinueWithNext; + } + + if (comparands.Expectation is null && !context.Options.TreatNullCollectionsAsEmpty) { return EquivalencyResult.ContinueWithNext; } @@ -37,7 +42,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon "to use for asserting the equivalency of the collection. ", interfaceTypes.Select(type => "IEnumerable<" + type.GetGenericArguments().Single() + ">"))); - if (AssertSubjectIsCollection(assertionChain, comparands.Subject)) + if (AssertSubjectIsCollection(assertionChain, comparands.Subject, context.Options.TreatNullCollectionsAsEmpty)) { var validator = new EnumerableEquivalencyValidator(assertionChain, valueChildNodes, context) { @@ -47,12 +52,13 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon Type typeOfEnumeration = GetTypeOfEnumeration(expectedType); - var subjectAsArray = EnumerableEquivalencyStep.ToArray(comparands.Subject); + var subjectAsArray = comparands.Subject is null ? [] : EnumerableEquivalencyStep.ToArray(comparands.Subject); + object expectation = comparands.Expectation ?? Array.CreateInstance(typeOfEnumeration, 0); try { HandleMethod.MakeGenericMethod(typeOfEnumeration) - .Invoke(null, [validator, subjectAsArray, comparands.Expectation]); + .Invoke(null, [validator, subjectAsArray, expectation]); } catch (TargetInvocationException e) { @@ -66,8 +72,13 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon private static void HandleImpl(EnumerableEquivalencyValidator validator, object[] subject, IEnumerable expectation) => validator.Execute(subject, ToArray(expectation)); - private static bool AssertSubjectIsCollection(AssertionChain assertionChain, object subject) + private static bool AssertSubjectIsCollection(AssertionChain assertionChain, object subject, bool treatNullAsEmpty) { + if (treatNullAsEmpty && subject is null) + { + return true; + } + assertionChain .ForCondition(subject is not null) .FailWith("Expected {context:subject} not to be {0}.", new object[] { null }); diff --git a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs index 29136acd53..bf283246d3 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StringEqualityEquivalencyStep.cs @@ -18,7 +18,7 @@ public EquivalencyResult Handle(Comparands comparands, IEquivalencyValidationCon var assertionChain = AssertionChain.GetOrCreate().For(context); - if (!ValidateAgainstNulls(assertionChain, comparands, context.CurrentNode)) + if (!ValidateAgainstNulls(assertionChain, comparands, context.CurrentNode, context.Options.TreatNullStringsAsEmpty)) { return EquivalencyResult.EquivalencyProven; } @@ -74,7 +74,8 @@ private static Func, EquivalencyOptions> Crea return o; }; - private static bool ValidateAgainstNulls(AssertionChain assertionChain, Comparands comparands, INode currentNode) + private static bool ValidateAgainstNulls(AssertionChain assertionChain, Comparands comparands, INode currentNode, + bool treatNullAsEmpty) { object expected = comparands.Expectation; object subject = comparands.Subject; @@ -83,6 +84,16 @@ private static bool ValidateAgainstNulls(AssertionChain assertionChain, Comparan if (onlyOneNull) { + if (treatNullAsEmpty) + { + string nonNullValue = (string)(expected ?? subject); + + if (nonNullValue.Length == 0) + { + return false; + } + } + assertionChain.FailWith( "Expected {0} to be {1}{reason}, but found {2}.", currentNode.Subject.Description.AsNonFormattable(), expected, subject); diff --git a/Src/FluentAssertions/Primitives/StringAssertions.cs b/Src/FluentAssertions/Primitives/StringAssertions.cs index 36c59d0644..540d75483a 100644 --- a/Src/FluentAssertions/Primitives/StringAssertions.cs +++ b/Src/FluentAssertions/Primitives/StringAssertions.cs @@ -156,7 +156,10 @@ public AndConstraint BeEquivalentTo(string expected, new StringEqualityStrategy(options.GetStringComparerOrDefault(), "be equivalent to"), because, becauseArgs); - var subject = ApplyStringSettings(Subject, options); + string subject = options.TreatNullStringsAsEmpty ? Subject ?? "" : Subject; + expected = options.TreatNullStringsAsEmpty ? expected ?? "" : expected; + + subject = ApplyStringSettings(subject, options); expected = ApplyStringSettings(expected, options); expectation.Validate(subject, expected); diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index 3d478f2caa..abe83d9c68 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt @@ -776,6 +776,8 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } System.Collections.Generic.IEnumerable SelectionRules { get; } FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } + bool TreatNullCollectionsAsEmpty { get; } + bool TreatNullStringsAsEmpty { get; } bool UseRuntimeTyping { get; } System.Collections.Generic.IEnumerable UserEquivalencySteps { get; } FluentAssertions.Equivalency.EqualityStrategy GetEqualityStrategy(System.Type type); @@ -918,6 +920,8 @@ namespace FluentAssertions.Equivalency [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } + public bool TreatNullCollectionsAsEmpty { get; } + public bool TreatNullStringsAsEmpty { get; } protected TSelf AddMatchingRule(FluentAssertions.Equivalency.IMemberMatchingRule matchingRule) { } protected TSelf AddSelectionRule(FluentAssertions.Equivalency.IMemberSelectionRule selectionRule) { } public TSelf AllowingInfiniteRecursion() { } @@ -927,6 +931,8 @@ namespace FluentAssertions.Equivalency public TSelf ComparingByValue() { } public TSelf ComparingEnumsByName() { } public TSelf ComparingEnumsByValue() { } + public TSelf ComparingNullCollectionsAsEmpty() { } + public TSelf ComparingNullStringsAsEmpty() { } public TSelf ComparingRecordsByMembers() { } public TSelf ComparingRecordsByValue() { } public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt index 42d0d6e122..9438447689 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net6.0.verified.txt @@ -838,6 +838,8 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } System.Collections.Generic.IEnumerable SelectionRules { get; } FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } + bool TreatNullCollectionsAsEmpty { get; } + bool TreatNullStringsAsEmpty { get; } bool UseRuntimeTyping { get; } System.Collections.Generic.IEnumerable UserEquivalencySteps { get; } FluentAssertions.Equivalency.EqualityStrategy GetEqualityStrategy(System.Type type); @@ -985,6 +987,8 @@ namespace FluentAssertions.Equivalency [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } + public bool TreatNullCollectionsAsEmpty { get; } + public bool TreatNullStringsAsEmpty { get; } protected TSelf AddMatchingRule(FluentAssertions.Equivalency.IMemberMatchingRule matchingRule) { } protected TSelf AddSelectionRule(FluentAssertions.Equivalency.IMemberSelectionRule selectionRule) { } public TSelf AllowingInfiniteRecursion() { } @@ -994,6 +998,8 @@ namespace FluentAssertions.Equivalency public TSelf ComparingByValue() { } public TSelf ComparingEnumsByName() { } public TSelf ComparingEnumsByValue() { } + public TSelf ComparingNullCollectionsAsEmpty() { } + public TSelf ComparingNullStringsAsEmpty() { } public TSelf ComparingRecordsByMembers() { } public TSelf ComparingRecordsByValue() { } public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt index b065facf1a..7ced24c3b4 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.0.verified.txt @@ -768,6 +768,8 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } System.Collections.Generic.IEnumerable SelectionRules { get; } FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } + bool TreatNullCollectionsAsEmpty { get; } + bool TreatNullStringsAsEmpty { get; } bool UseRuntimeTyping { get; } System.Collections.Generic.IEnumerable UserEquivalencySteps { get; } FluentAssertions.Equivalency.EqualityStrategy GetEqualityStrategy(System.Type type); @@ -910,6 +912,8 @@ namespace FluentAssertions.Equivalency [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } + public bool TreatNullCollectionsAsEmpty { get; } + public bool TreatNullStringsAsEmpty { get; } protected TSelf AddMatchingRule(FluentAssertions.Equivalency.IMemberMatchingRule matchingRule) { } protected TSelf AddSelectionRule(FluentAssertions.Equivalency.IMemberSelectionRule selectionRule) { } public TSelf AllowingInfiniteRecursion() { } @@ -919,6 +923,8 @@ namespace FluentAssertions.Equivalency public TSelf ComparingByValue() { } public TSelf ComparingEnumsByName() { } public TSelf ComparingEnumsByValue() { } + public TSelf ComparingNullCollectionsAsEmpty() { } + public TSelf ComparingNullStringsAsEmpty() { } public TSelf ComparingRecordsByMembers() { } public TSelf ComparingRecordsByValue() { } public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt index 08e044e3e1..64c73b18c6 100644 --- a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt +++ b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/netstandard2.1.verified.txt @@ -792,6 +792,8 @@ namespace FluentAssertions.Equivalency FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } System.Collections.Generic.IEnumerable SelectionRules { get; } FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } + bool TreatNullCollectionsAsEmpty { get; } + bool TreatNullStringsAsEmpty { get; } bool UseRuntimeTyping { get; } System.Collections.Generic.IEnumerable UserEquivalencySteps { get; } FluentAssertions.Equivalency.EqualityStrategy GetEqualityStrategy(System.Type type); @@ -934,6 +936,8 @@ namespace FluentAssertions.Equivalency [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] protected FluentAssertions.Equivalency.OrderingRuleCollection OrderingRules { get; } public FluentAssertions.Equivalency.Tracing.ITraceWriter TraceWriter { get; } + public bool TreatNullCollectionsAsEmpty { get; } + public bool TreatNullStringsAsEmpty { get; } protected TSelf AddMatchingRule(FluentAssertions.Equivalency.IMemberMatchingRule matchingRule) { } protected TSelf AddSelectionRule(FluentAssertions.Equivalency.IMemberSelectionRule selectionRule) { } public TSelf AllowingInfiniteRecursion() { } @@ -943,6 +947,8 @@ namespace FluentAssertions.Equivalency public TSelf ComparingByValue() { } public TSelf ComparingEnumsByName() { } public TSelf ComparingEnumsByValue() { } + public TSelf ComparingNullCollectionsAsEmpty() { } + public TSelf ComparingNullStringsAsEmpty() { } public TSelf ComparingRecordsByMembers() { } public TSelf ComparingRecordsByValue() { } public TSelf Excluding(System.Linq.Expressions.Expression> predicate) { } diff --git a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs index c5e910ecb7..7d3eec78de 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs @@ -2824,6 +2824,142 @@ ClassWithLotsOfProperties GetObject(int i) act.ExecutionTime().Should().BeLessThan(20.Seconds()); } + public class ComparingNullCollectionsAsEmpty + { + [Fact] + public void A_null_subject_collection_is_equivalent_to_an_empty_expectation() + { + // Arrange + int[] subject = null; + int[] expectation = []; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, opt => opt.ComparingNullCollectionsAsEmpty()); + } + + [Fact] + public void An_empty_subject_collection_is_equivalent_to_a_null_expectation() + { + // Arrange + int[] subject = []; + int[] expectation = null; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, opt => opt.ComparingNullCollectionsAsEmpty()); + } + + [Fact] + public void A_null_subject_collection_fails_when_the_expectation_is_non_empty() + { + // Arrange + int[] subject = null; + int[] expectation = [1, 2, 3]; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, opt => opt.ComparingNullCollectionsAsEmpty()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void A_non_empty_subject_collection_fails_when_the_expectation_is_null() + { + // Arrange + int[] subject = [1, 2, 3]; + int[] expectation = null; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, opt => opt.ComparingNullCollectionsAsEmpty()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Without_the_option_a_null_subject_collection_is_not_equivalent_to_an_empty_expectation() + { + // Arrange + int[] subject = null; + int[] expectation = []; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Without_the_option_an_empty_subject_collection_is_not_equivalent_to_a_null_expectation() + { + // Arrange + int[] subject = []; + int[] expectation = null; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void A_null_generic_list_subject_is_equivalent_to_an_empty_generic_list_expectation() + { + // Arrange + List subject = null; + var expectation = new List(); + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, opt => opt.ComparingNullCollectionsAsEmpty()); + } + + [Fact] + public void An_empty_generic_list_subject_is_equivalent_to_a_null_generic_list_expectation() + { + // Arrange + var subject = new List(); + List expectation = null; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, opt => opt.ComparingNullCollectionsAsEmpty()); + } + + [Fact] + public void A_null_nested_collection_is_equivalent_to_an_empty_nested_collection() + { + // Arrange + var subject = new { Items = (int[])null }; + var expectation = new { Items = Array.Empty() }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, opt => opt.ComparingNullCollectionsAsEmpty()); + } + + [Fact] + public void An_empty_nested_collection_is_equivalent_to_a_null_nested_collection() + { + // Arrange + var subject = new { Items = Array.Empty() }; + var expectation = new { Items = (int[])null }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, opt => opt.ComparingNullCollectionsAsEmpty()); + } + + [Fact] + public void Two_null_collections_are_equivalent() + { + // Arrange + int[] subject = null; + int[] expectation = null; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, opt => opt.ComparingNullCollectionsAsEmpty()); + } + } + private class ClassWithLotsOfProperties { public string Id { get; set; } diff --git a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeEquivalentTo.cs index 46787cf393..a073f2a060 100644 --- a/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeEquivalentTo.cs +++ b/Tests/FluentAssertions.Specs/Primitives/StringAssertionSpecs.BeEquivalentTo.cs @@ -375,4 +375,118 @@ public void When_the_actual_string_equivalent_to_the_expected_but_with_trailing_ act.Should().NotThrow(); } } + + public class ComparingNullStringsAsEmpty + { + [Fact] + public void A_null_subject_string_is_equivalent_to_an_empty_expectation_string() + { + // Arrange + string subject = null; + string expectation = ""; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, opt => opt.ComparingNullStringsAsEmpty()); + } + + [Fact] + public void An_empty_subject_string_is_equivalent_to_a_null_expectation_string() + { + // Arrange + string subject = ""; + string expectation = null; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, opt => opt.ComparingNullStringsAsEmpty()); + } + + [Fact] + public void Two_null_strings_are_equivalent() + { + // Arrange + string subject = null; + string expectation = null; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, opt => opt.ComparingNullStringsAsEmpty()); + } + + [Fact] + public void A_null_subject_string_fails_when_the_expectation_is_non_empty() + { + // Arrange + string subject = null; + string expectation = "hello"; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, opt => opt.ComparingNullStringsAsEmpty()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void A_non_empty_subject_string_fails_when_the_expectation_is_null() + { + // Arrange + string subject = "hello"; + string expectation = null; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation, opt => opt.ComparingNullStringsAsEmpty()); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Without_the_option_a_null_subject_string_is_not_equivalent_to_an_empty_expectation_string() + { + // Arrange + string subject = null; + string expectation = ""; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void Without_the_option_an_empty_subject_string_is_not_equivalent_to_a_null_expectation_string() + { + // Arrange + string subject = ""; + string expectation = null; + + // Act + Action act = () => subject.Should().BeEquivalentTo(expectation); + + // Assert + act.Should().Throw(); + } + + [Fact] + public void A_null_nested_string_is_equivalent_to_an_empty_nested_string() + { + // Arrange + var subject = new { Name = (string)null }; + var expectation = new { Name = "" }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, opt => opt.ComparingNullStringsAsEmpty()); + } + + [Fact] + public void An_empty_nested_string_is_equivalent_to_a_null_nested_string() + { + // Arrange + var subject = new { Name = "" }; + var expectation = new { Name = (string)null }; + + // Act / Assert + subject.Should().BeEquivalentTo(expectation, opt => opt.ComparingNullStringsAsEmpty()); + } + } } diff --git a/docs/_pages/objectgraphs.md b/docs/_pages/objectgraphs.md index 86c2dab1fe..f6668f5195 100644 --- a/docs/_pages/objectgraphs.md +++ b/docs/_pages/objectgraphs.md @@ -396,7 +396,13 @@ string expect = "A\r\nB\nC"; actual.Should().BeEquivalentTo(expect, o => o.IgnoringNewlineStyle()); ``` -Next to that, when two long strings differ, by default the reporting will only include the relevant fragments needed to highlight the differences. If you want to see the full text of both strings, use the `IncludingFullStringsInDifference()` option. +Next to that, when two long strings differ, by default the reporting will only include the relevant fragments needed to highlight the differences. If you want to see the full text of both strings, use the `IncludingFullStringsInDifference()` option. + +You can also treat `null` strings as equivalent to empty strings using `ComparingNullStringsAsEmpty()`: + +```csharp +((string)null).Should().BeEquivalentTo("", o => o.ComparingNullStringsAsEmpty()); +``` ### Enums @@ -424,6 +430,12 @@ You can also assert that all instances of `OrderDto` are structurally equal to a orderDtos.Should().AllBeEquivalentTo(singleOrder); ``` +If you want to treat `null` collections as equivalent to empty collections, use `ComparingNullCollectionsAsEmpty()`: + +```csharp +((int[])null).Should().BeEquivalentTo([], o => o.ComparingNullCollectionsAsEmpty()); +``` + ### JSON For projects targeting .NET 6 or later, you can also compare a `JsonNode` from the `System.Text.Json` namespace representing a deeply nested JSON block against another object such as an anonymous type. You can even use inline assertions like `Value.ThatSatisfies()` and `Value.ThatMatches()`. diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index a916f544f0..8bf48bd429 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -18,6 +18,7 @@ sidebar: * Added `HaveMillisecond` and `NotHaveMillisecond` assertion methods for `DateTime` and `DateTimeOffset` - [#3164](https://github.com/fluentassertions/fluentassertions/pull/3164) ### Enhancements +* Added `ComparingNullCollectionsAsEmpty()` and `ComparingNullStringsAsEmpty()` options to `BeEquivalentTo` to treat `null` collections and strings as equivalent to empty ones - [#3202](https://github.com/fluentassertions/fluentassertions/pull/3202) * Added option `WithFullDump` to `BeEquivalentTo` to include the entire contents of the subject-under-test in the failure message - [#3133](https://github.com/fluentassertions/fluentassertions/pull/3133) * Remove FluentAssertions code from the stack trace when an assertion fails - [#3152](https://github.com/fluentassertions/fluentassertions/pull/3152) * Improve reporting the subject when chaining `Throw` with `Which` - [#3160](https://github.com/fluentassertions/fluentassertions/pull/3160) From 0804dbc43d692c2dd529cdedba556178dfe6be55 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Wed, 6 May 2026 13:48:45 +0200 Subject: [PATCH 838/845] Include original index in extraneous item failure messages (#3203) --- .../Steps/EnumerableEquivalencyValidator.cs | 46 +++++++++++++--- .../LooselyOrderedEquivalencyStrategy.cs | 48 ++++++++-------- .../StrictlyOrderedEquivalencyStrategy.cs | 6 +- .../BasicSpecs.cs | 4 +- .../CollectionSpecs.cs | 55 ++++++++++++++++++- ...CollectionAssertionSpecs.BeEquivalentTo.cs | 2 +- docs/_pages/releases.md | 1 + 7 files changed, 123 insertions(+), 39 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs index 7f9e10445c..8e11be3ed3 100644 --- a/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs +++ b/Src/FluentAssertions/Equivalency/Steps/EnumerableEquivalencyValidator.cs @@ -4,6 +4,7 @@ using FluentAssertions.Equivalency.Execution; using FluentAssertions.Equivalency.Tracing; using FluentAssertions.Execution; +using FluentAssertions.Formatting; using static FluentAssertions.Common.StringExtensions; namespace FluentAssertions.Equivalency.Steps; @@ -56,10 +57,13 @@ private bool AssertIsNotNull(T[] expectations, object[] subjects) private void ExecuteRecursiveAssertion(object[] subjects, T[] expectation) { - List remainingSubjects = new(subjects); + List> remainingSubjects = subjects + .Select((item, index) => new IndexedItem(item, index)) + .ToList(); + List remainingExpectations = new(expectation); - bool isOrderingStrict = IsOrderingStrictFor(remainingSubjects, remainingExpectations, context.CurrentNode); + bool isOrderingStrict = IsOrderingStrictFor(subjects, remainingExpectations, context.CurrentNode); if (isOrderingStrict) { new StrictlyOrderedEquivalencyStrategy(parent, context) @@ -75,7 +79,7 @@ private void ExecuteRecursiveAssertion(object[] subjects, T[] expectation) isOrderingStrict ? "in order" : "in any order"); } - private bool IsOrderingStrictFor(List subjects, List expectations, INode currentNode) + private bool IsOrderingStrictFor(object[] subjects, List expectations, INode currentNode) { return OrderingRules.IsOrderingStrictFor(new ObjectInfo(new Comparands(subjects, expectations, typeof(T[])), currentNode)); @@ -83,7 +87,7 @@ private bool IsOrderingStrictFor(List subjects, List expectations, #pragma warning disable CA1305 - private void ReportRemainingOrMissingItems(List remainingSubjects, List remainingExpectations, + private void ReportRemainingOrMissingItems(List> remainingSubjects, List remainingExpectations, object[] allSubjects, int expectationLength, string orderingDescription) { @@ -111,8 +115,31 @@ private void ReportRemainingOrMissingItems(List remainingSubjects, Li if (remainingSubjects.Count > 0) { - phrase = remainingSubjects.Count > 1 ? "extraneous items" : "one extraneous item"; - message.Append($"found {phrase} {{1}}"); + if (remainingExpectations.Count == 0) + { + // Subjects are truly extra (the subject collection has more items than expected). + // Show each extraneous item with its original index to help pinpoint the divergence. + if (remainingSubjects.Count == 1) + { + message.Append($"found one extraneous item at index {remainingSubjects[0].Index}: {{1}}"); + } + else + { + string formattedItems = string.Join(", ", + remainingSubjects.Select(s => + $"{Formatter.ToString(s.Item).EscapePlaceholders()} (at index {s.Index})")); + + message.Append("found extraneous items "); + message.Append(formattedItems); + } + } + else + { + // Both missing and extra subjects exist (same-size collections with pairwise mismatches). + // Fall back to the compact list format without per-item indices. + phrase = remainingSubjects.Count > 1 ? "extraneous items" : "one extraneous item"; + message.Append($"found {phrase} {{1}}"); + } } if (context.Options.EnableFullDump) @@ -122,8 +149,11 @@ private void ReportRemainingOrMissingItems(List remainingSubjects, Li message.AppendLine("Full dump of {context:subject}: {2}"); } - assertionChain.FailWith(message.ToString(), remainingExpectations, - remainingSubjects.Count == 1 ? remainingSubjects.Single() : remainingSubjects, allSubjects); + object subjectsArg = remainingSubjects.Count == 1 + ? remainingSubjects[0].Item + : remainingSubjects.Select(s => s.Item).ToList(); + + assertionChain.FailWith(message.ToString(), remainingExpectations, subjectsArg, allSubjects); } } } diff --git a/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs b/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs index 5bd348c3e6..06b37dfbbd 100644 --- a/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs +++ b/Src/FluentAssertions/Equivalency/Steps/LooselyOrderedEquivalencyStrategy.cs @@ -25,7 +25,7 @@ internal class LooselyOrderedEquivalencyStrategy( // Populated lazily during Phase 3 for the ~n selected pairs with full formatting. private Dictionary<(object Subject, object Expectation, int ExpectationIndex), string[]> fullFailuresCache = new(); - public void FindAndRemoveMatches(List subjects, List expectations) + public void FindAndRemoveMatches(List> subjects, List expectations) { countCache = new(new ReferentialComparer()); fullFailuresCache = new(new ReferentialComparer()); @@ -45,7 +45,7 @@ public void FindAndRemoveMatches(List subjects, List expec expectationsWithIndexes.RemoveMatchedItemFrom(expectations); } - private void FindAndRemoveExactMatches(List subjects, IndexedItemCollection expectationsWithIndexes) + private void FindAndRemoveExactMatches(List> subjects, IndexedItemCollection expectationsWithIndexes) { int expectationIndex = 0; while (expectationsWithIndexes.Count > expectationIndex) @@ -65,14 +65,14 @@ private void FindAndRemoveExactMatches(List subjects, IndexedItemCollect } [SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope")] - private bool StrictlyMatchAgainst(List remainingSubjects, TExpectation expectation, int expectationIndex) + private bool StrictlyMatchAgainst(List> remainingSubjects, TExpectation expectation, int expectationIndex) { - foreach ((int index, object subject) in remainingSubjects.Index()) + foreach ((int index, IndexedItem subject) in remainingSubjects.Index()) { using var _ = tracer.WriteBlock(member => $"Comparing subject at {member.Subject}[{index}] with the expectation at {member.Expectation}[{expectationIndex}]"); - int failures = TryToMatchCount(expectation, subject, expectationIndex); + int failures = TryToMatchCount(expectation, subject.Item, expectationIndex); if (failures == 0) { tracer.WriteLine(_ => "It's a match"); @@ -91,7 +91,7 @@ private bool StrictlyMatchAgainst(List remainingSubjects, TExpectation e /// that are most similar to remaining subjects first, the algorithm is more likely /// to find the correct pairings earlier, leading to better error messages when mismatches occur. /// - private IndexedItemCollection SortExpectationsByMinDistance(List remainingSubjects, + private IndexedItemCollection SortExpectationsByMinDistance(List> remainingSubjects, IndexedItemCollection expectationsWithIndexes) { if (remainingSubjects.Count > 0) @@ -100,7 +100,7 @@ private IndexedItemCollection SortExpectationsByMinDistance(List new { Expectation = e, - MinDistance = remainingSubjects.Min(a => TryToMatchCount(e.Item, a, e.Index)) + MinDistance = remainingSubjects.Min(a => TryToMatchCount(e.Item, a.Item, e.Index)) }) .OrderBy(x => x.MinDistance) .Select(x => x.Expectation) @@ -112,13 +112,13 @@ private IndexedItemCollection SortExpectationsByMinDistance(List remainingSubjects, + private void FindAndRemoveClosestMatches(List> remainingSubjects, IndexedItemCollection expectationsWithIndexes) { int nrFailures = 0; if (expectationsWithIndexes.Count > 0 && remainingSubjects.Count > 0) { - IReadOnlyList<(IndexedItem, object, string[])> bestMatches = + IReadOnlyList<(IndexedItem, IndexedItem, string[])> bestMatches = FindClosestMismatches(remainingSubjects, expectationsWithIndexes); foreach (var (expectation, subject, failures) in bestMatches) @@ -138,8 +138,8 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, } } - private IReadOnlyList<(IndexedItem Expectation, object Actual, string[] Failures)> FindClosestMismatches( - List remainingSubjects, IndexedItemCollection expectationsWithIndexes) + private IReadOnlyList<(IndexedItem Expectation, IndexedItem Actual, string[] Failures)> FindClosestMismatches( + List> remainingSubjects, IndexedItemCollection expectationsWithIndexes) { // For small collections, use exact permutation search to find the globally optimal assignment. // factorial(8) = 40,320 which is well within reason. @@ -155,13 +155,13 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, /// Uses failure counts for scoring (no string formatting) and only fetches full failure strings for the /// winning assignment. /// - private IReadOnlyList<(IndexedItem Expectation, object Actual, string[] Failures)> FindClosestMismatchesByPermutation( - List remainingSubjects, IndexedItemCollection expectationsWithIndexes) + private IReadOnlyList<(IndexedItem Expectation, IndexedItem Actual, string[] Failures)> FindClosestMismatchesByPermutation( + List> remainingSubjects, IndexedItemCollection expectationsWithIndexes) { var bestScore = int.MaxValue; - IReadOnlyList bestAssignment = null; + IReadOnlyList> bestAssignment = null; - foreach (IReadOnlyList assignment in remainingSubjects.Permute()) + foreach (IReadOnlyList> assignment in remainingSubjects.Permute()) { int score = 0; bool tooHigh = false; @@ -169,7 +169,7 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, for (int index = 0; index < expectationsWithIndexes.Count && index < assignment.Count; index++) { IndexedItem expectationWithIndex = expectationsWithIndexes[index]; - score += TryToMatchCount(expectationWithIndex.Item, assignment[index], expectationWithIndex.Index); + score += TryToMatchCount(expectationWithIndex.Item, assignment[index].Item, expectationWithIndex.Index); if (score >= bestScore) { @@ -187,17 +187,17 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, if (bestAssignment is null) { - return Array.Empty<(IndexedItem, object, string[])>(); + return Array.Empty<(IndexedItem, IndexedItem, string[])>(); } // Fetch full failure strings only for the winning assignment. int pairCount = Math.Min(expectationsWithIndexes.Count, bestAssignment.Count); - var result = new List<(IndexedItem, object, string[])>(pairCount); + var result = new List<(IndexedItem, IndexedItem, string[])>(pairCount); for (int index = 0; index < pairCount; index++) { IndexedItem expectationWithIndex = expectationsWithIndexes[index]; - string[] failures = TryToMatch(expectationWithIndex.Item, bestAssignment[index], expectationWithIndex.Index); + string[] failures = TryToMatch(expectationWithIndex.Item, bestAssignment[index].Item, expectationWithIndex.Index); result.Add((expectationWithIndex, bestAssignment[index], failures)); } @@ -209,8 +209,8 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, /// permutation search would be prohibitively expensive. All distances are already cached from Phase 1, so /// this is O(n² log n) rather than O(n! × n). /// - private IReadOnlyList<(IndexedItem Expectation, object Actual, string[] Failures)> FindClosestMismatchesByGreedyAssignment( - List remainingSubjects, IndexedItemCollection expectationsWithIndexes) + private IReadOnlyList<(IndexedItem Expectation, IndexedItem Actual, string[] Failures)> FindClosestMismatchesByGreedyAssignment( + List> remainingSubjects, IndexedItemCollection expectationsWithIndexes) { int subjectCount = remainingSubjects.Count; int expectationCount = expectationsWithIndexes.Count; @@ -225,7 +225,7 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, for (int subjectIndex = 0; subjectIndex < subjectCount; subjectIndex++) { - int count = TryToMatchCount(exp.Item, remainingSubjects[subjectIndex], exp.Index); + int count = TryToMatchCount(exp.Item, remainingSubjects[subjectIndex].Item, exp.Index); allPairs.Add((expectationIndex, subjectIndex, count)); } } @@ -248,7 +248,7 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, var assignedSubjectIndexes = new bool[subjectCount]; int totalToAssign = Math.Min(expectationCount, subjectCount); - var result = new List<(IndexedItem, object, string[])>(totalToAssign); + var result = new List<(IndexedItem, IndexedItem, string[])>(totalToAssign); // First checks candidate matches from best to worst, then picks the first unused expectation/subject pair it finds, // computes detailed failures only for that chosen pair, and then repeats until all possible matches are assigned. @@ -258,7 +258,7 @@ private void FindAndRemoveClosestMatches(List remainingSubjects, { // Fetch full failure strings only for the selected pairs (~n total). string[] failures = TryToMatch(expectationsWithIndexes[expectationIndex].Item, - remainingSubjects[subjectIndex], expectationsWithIndexes[expectationIndex].Index); + remainingSubjects[subjectIndex].Item, expectationsWithIndexes[expectationIndex].Index); result.Add((expectationsWithIndexes[expectationIndex], remainingSubjects[subjectIndex], failures)); assignedExpectationIndexes[expectationIndex] = true; diff --git a/Src/FluentAssertions/Equivalency/Steps/StrictlyOrderedEquivalencyStrategy.cs b/Src/FluentAssertions/Equivalency/Steps/StrictlyOrderedEquivalencyStrategy.cs index b8ac038815..809a41bad8 100644 --- a/Src/FluentAssertions/Equivalency/Steps/StrictlyOrderedEquivalencyStrategy.cs +++ b/Src/FluentAssertions/Equivalency/Steps/StrictlyOrderedEquivalencyStrategy.cs @@ -13,7 +13,7 @@ internal class StrictlyOrderedEquivalencyStrategy( private const int FailedItemsFastFailThreshold = 10; private readonly Tracer tracer = context.Tracer; - public void FindAndRemoveMatches(List subjects, List expectations) + public void FindAndRemoveMatches(List> subjects, List expectations) { int failedCount = 0; @@ -44,11 +44,11 @@ public void FindAndRemoveMatches(List subjects, List expec expectations.RemoveRange(0, index); } - private bool StrictlyMatchAgainst(List subjects, T expectation, int expectationIndex) + private bool StrictlyMatchAgainst(List> subjects, T expectation, int expectationIndex) { using var scope = new AssertionScope(); - object subject = subjects[expectationIndex]; + object subject = subjects[expectationIndex].Item; IEquivalencyValidationContext equivalencyValidationContext = context.AsCollectionItem(expectationIndex); parent.AssertEquivalencyOf(new Comparands(subject, expectation, typeof(T)), equivalencyValidationContext); diff --git a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs index a09059ff51..3baaae2c08 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/BasicSpecs.cs @@ -950,7 +950,7 @@ public void Reports_all_relevant_details_to_understand_the_differences() """ Expected property actual[0].Name to be "Dennis" with a length of 6, but "Jits" has a length of 4, differs near "Jit" (index 0). Expected property actual[0].Age to be 52, but found 13. - Expected actual to contain exactly one item, but found one extraneous item FluentAssertions.Equivalency.Specs.Customer + Expected actual to contain exactly one item, but found one extraneous item at index 1: FluentAssertions.Equivalency.Specs.Customer { Age = 16, Birthdate = <0001-01-01 00:00:00.000>, @@ -1006,7 +1006,7 @@ public void Reports_all_relevant_details_to_understand_the_differences_including """ Expected property actual[0].Name to be "Dennis" with a length of 6, but "Jits" has a length of 4, differs near "Jit" (index 0). Expected property actual[0].Age to be 52, but found 13. - Expected actual to contain exactly one item, but found one extraneous item FluentAssertions.Equivalency.Specs.Customer + Expected actual to contain exactly one item, but found one extraneous item at index 1: FluentAssertions.Equivalency.Specs.Customer { Age = 16, Birthdate = <0001-01-01 00:00:00.000>, diff --git a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs index 7d3eec78de..47ef46c99c 100644 --- a/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs +++ b/Tests/FluentAssertions.Equivalency.Specs/CollectionSpecs.cs @@ -2222,7 +2222,60 @@ public void When_the_subject_contains_more_items_than_expected_it_should_throw() // Assert action.Should().Throw() .WithMessage( - "*Expected subject to contain exactly one item, but found one extraneous item*Age = 24*"); + "*Expected subject to contain exactly one item, but found one extraneous item at index 1:*Age = 24*"); + } + + [Fact] + public void When_the_subject_contains_multiple_extra_items_it_should_include_the_index_of_each() + { + // Arrange + var subject = new List + { + new() { Name = "John", Age = 27, Id = 1 }, + new() { Name = "Jane", Age = 24, Id = 2 }, + new() { Name = "Bob", Age = 32, Id = 3 } + }; + + var expectation = new List + { + new() { Name = "John", Age = 27, Id = 1 } + }; + + // Act + Action action = + () => subject.Should().BeEquivalentTo(expectation); + + // Assert + action.Should().Throw() + .WithMessage("*extraneous items *at index 1*at index 2*"); + } + + [Fact] + public void When_the_subject_contains_multiple_extra_items_the_failure_message_should_include_their_formatted_properties() + { + // Arrange - Customer objects produce formatted output containing curly braces (e.g. "Customer\r\n{\r\n Age = 24\r\n}") + // which must be escaped before embedding into the FailWith format string to prevent string.Format from + // interpreting them as placeholders and producing a **WARNING** instead of the actual failure message. + var subject = new List + { + new() { Name = "John", Age = 27, Id = 1 }, + new() { Name = "Jane", Age = 24, Id = 2 }, + new() { Name = "Bob", Age = 32, Id = 3 } + }; + + var expectation = new List + { + new() { Name = "John", Age = 27, Id = 1 } + }; + + // Act + Action action = + () => subject.Should().BeEquivalentTo(expectation); + + // Assert + action.Should().Throw() + .WithMessage("*extraneous items*Age = 24*at index 1*Age = 32*at index 2*") + .WithoutMessage("**WARNING**"); } [Fact] diff --git a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs index cf82eecbe2..f094c3ffdc 100644 --- a/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs +++ b/Tests/FluentAssertions.Specs/Collections/CollectionAssertionSpecs.BeEquivalentTo.cs @@ -58,7 +58,7 @@ public void When_collections_are_not_equivalent_it_should_throw() // Assert act.Should().Throw().WithMessage( - "Expected collection1*2 items*we treat all alike, but*extraneous item 3*"); + "Expected collection1*2 items*we treat all alike, but*extraneous item*3*"); } [Fact] diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md index 8bf48bd429..24c5551ee8 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -19,6 +19,7 @@ sidebar: ### Enhancements * Added `ComparingNullCollectionsAsEmpty()` and `ComparingNullStringsAsEmpty()` options to `BeEquivalentTo` to treat `null` collections and strings as equivalent to empty ones - [#3202](https://github.com/fluentassertions/fluentassertions/pull/3202) +* `BeEquivalentTo` now includes the original index of each extraneous item in the failure message - [#3203](https://github.com/fluentassertions/fluentassertions/pull/3203) * Added option `WithFullDump` to `BeEquivalentTo` to include the entire contents of the subject-under-test in the failure message - [#3133](https://github.com/fluentassertions/fluentassertions/pull/3133) * Remove FluentAssertions code from the stack trace when an assertion fails - [#3152](https://github.com/fluentassertions/fluentassertions/pull/3152) * Improve reporting the subject when chaining `Throw` with `Which` - [#3160](https://github.com/fluentassertions/fluentassertions/pull/3160) From a36d71ca37e3072172063e5d95cb5a2c0f5f4265 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Tue, 12 May 2026 07:21:37 +0200 Subject: [PATCH 839/845] Fix Qodana overflow warning in ReferentialComparer using unchecked context Use unchecked arithmetic with int (the standard C# hash code pattern) instead of long, which still triggers Qodana's overflow inspection. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Equivalency/Steps/ReferentialComparer.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs b/Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs index 1d69a05e54..ffaedd60f4 100644 --- a/Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs +++ b/Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs @@ -20,9 +20,12 @@ public bool Equals((object Subject, object Expectation, int ExpectationIndex) x, public int GetHashCode((object Subject, object Expectation, int ExpectationIndex) obj) { - long hashCode = RuntimeHelpers.GetHashCode(obj.Subject); - hashCode = (hashCode * 397) + RuntimeHelpers.GetHashCode(obj.Expectation); - hashCode = (hashCode * 397) + obj.ExpectationIndex; - return (int)hashCode; + unchecked + { + int hashCode = RuntimeHelpers.GetHashCode(obj.Subject); + hashCode = (hashCode * 397) + RuntimeHelpers.GetHashCode(obj.Expectation); + hashCode = (hashCode * 397) + obj.ExpectationIndex; + return hashCode; + } } } From 2daa84f8a06b302d9c555ef6a458f3af506dcc5d Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Tue, 12 May 2026 08:31:10 +0200 Subject: [PATCH 840/845] Fix failing pipeline - Revert ReferentialComparer hash code to original int-based implementation that matches the Qodana baseline (was incorrectly changed to long/unchecked) - Upgrade SharpCompress from 0.47.4 to 1.0.0 to fix NU1902 vulnerability (GHSA-6c8g-7p36-r338) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Build/_build.csproj | 2 +- .../Equivalency/Steps/ReferentialComparer.cs | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Build/_build.csproj b/Build/_build.csproj index 46dbdb457a..71e3559779 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -18,7 +18,7 @@ - + diff --git a/Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs b/Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs index ffaedd60f4..6b8241bab8 100644 --- a/Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs +++ b/Src/FluentAssertions/Equivalency/Steps/ReferentialComparer.cs @@ -20,12 +20,9 @@ public bool Equals((object Subject, object Expectation, int ExpectationIndex) x, public int GetHashCode((object Subject, object Expectation, int ExpectationIndex) obj) { - unchecked - { - int hashCode = RuntimeHelpers.GetHashCode(obj.Subject); - hashCode = (hashCode * 397) + RuntimeHelpers.GetHashCode(obj.Expectation); - hashCode = (hashCode * 397) + obj.ExpectationIndex; - return hashCode; - } + int hashCode = RuntimeHelpers.GetHashCode(obj.Subject); + hashCode = (hashCode * 397) + RuntimeHelpers.GetHashCode(obj.Expectation); + hashCode = (hashCode * 397) + obj.ExpectationIndex; + return hashCode; } } From 43524ef4592147ecabcc21b3df97a9e97c30d610 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Tue, 12 May 2026 08:39:04 +0200 Subject: [PATCH 841/845] Update SharpCompress API usage for 1.0.0 breaking change ReaderFactory.OpenReader(Stream) was renamed to ReaderFactory.Open(Stream, ReaderOptions) in SharpCompress 1.0.0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Build/CompressionExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/CompressionExtensions.cs b/Build/CompressionExtensions.cs index 89753805b2..649eb2bb34 100644 --- a/Build/CompressionExtensions.cs +++ b/Build/CompressionExtensions.cs @@ -9,7 +9,7 @@ public static void UnTarXzTo(this AbsolutePath archive, AbsolutePath directory) { using Stream stream = File.OpenRead(archive); - using var reader = ReaderFactory.OpenReader(stream); + using var reader = ReaderFactory.Open(stream, new ReaderOptions()); while (reader.MoveToNextEntry()) { From 33d12d151aa7b8be58e6b98e7e46d7df91cad6e6 Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Tue, 12 May 2026 08:59:03 +0200 Subject: [PATCH 842/845] Downgrade SharpCompress 1.0.0 -> 0.48.0 1.0.0 is unlisted on nuget.org --- Build/CompressionExtensions.cs | 2 +- Build/_build.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Build/CompressionExtensions.cs b/Build/CompressionExtensions.cs index 649eb2bb34..89753805b2 100644 --- a/Build/CompressionExtensions.cs +++ b/Build/CompressionExtensions.cs @@ -9,7 +9,7 @@ public static void UnTarXzTo(this AbsolutePath archive, AbsolutePath directory) { using Stream stream = File.OpenRead(archive); - using var reader = ReaderFactory.Open(stream, new ReaderOptions()); + using var reader = ReaderFactory.OpenReader(stream); while (reader.MoveToNextEntry()) { diff --git a/Build/_build.csproj b/Build/_build.csproj index 71e3559779..6d7e45f810 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -18,7 +18,7 @@ - + From bf5cafed1b35931206b26216f9a9d67cb72d5105 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 07:35:23 +0000 Subject: [PATCH 843/845] Bump NUnit Bumps NUnit to 4.6.0 --- updated-dependencies: - dependency-name: NUnit dependency-version: 4.6.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: nunit - dependency-name: NUnit dependency-version: 4.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: nunit - dependency-name: NUnit3TestAdapter dependency-version: 6.2.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: nunit - dependency-name: NUnit3TestAdapter dependency-version: 6.2.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: nunit ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj index f606846da4..38663aa3a4 100644 --- a/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj +++ b/Tests/TestFrameworks/NUnit4.Specs/NUnit4.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 1c22299fbb374d544f7fe9fde0a8ec3f851a4e1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 07:34:12 +0000 Subject: [PATCH 844/845] Bump MSTest.TestAdapter and MSTest.TestFramework Bumps MSTest.TestAdapter to 4.2.2 Bumps MSTest.TestFramework to 4.2.2 --- updated-dependencies: - dependency-name: MSTest.TestAdapter dependency-version: 4.2.2 dependency-type: direct:production update-type: version-update:semver-major dependency-group: mstest - dependency-name: MSTest.TestAdapter dependency-version: 4.2.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: mstest - dependency-name: MSTest.TestFramework dependency-version: 4.2.2 dependency-type: direct:production update-type: version-update:semver-major dependency-group: mstest - dependency-name: MSTest.TestFramework dependency-version: 4.2.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: mstest ... Signed-off-by: dependabot[bot] --- Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj b/Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj index bc4de568be..dc27b69b7e 100644 --- a/Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj +++ b/Tests/TestFrameworks/MSTestV4.Specs/MSTestV4.Specs.csproj @@ -12,7 +12,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + From 0954811776a71005283221b91aabafc5fec332b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 07:35:42 +0000 Subject: [PATCH 845/845] Bump Verify.XunitV3 Bumps Verify.XunitV3 from 31.16.1 to 31.16.3 --- updated-dependencies: - dependency-name: Verify.XunitV3 dependency-version: 31.16.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: xunit - dependency-name: Xunit.StaFact dependency-version: 3.0.13 dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit - dependency-name: Xunit.StaFact dependency-version: 3.0.13 dependency-type: direct:production update-type: version-update:semver-major dependency-group: xunit ... Signed-off-by: dependabot[bot] --- Tests/Approval.Tests/Approval.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index ba378957c5..112bf8a4d7 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -14,7 +14,7 @@ - +